aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp')
-rw-r--r--lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp b/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
index 1f355171ebd3..80357a63a4e1 100644
--- a/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
+++ b/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
@@ -70,7 +70,7 @@ void BPFAsmBackend::applyFixup(const MCFixup &Fixup, char *Data,
unsigned Size = Fixup.getKind() == FK_Data_4 ? 4 : 8;
for (unsigned i = 0; i != Size; ++i) {
- unsigned Idx = IsLittleEndian ? i : Size - i;
+ unsigned Idx = IsLittleEndian ? i : Size - i - 1;
Data[Fixup.getOffset() + Idx] = uint8_t(Value >> (i * 8));
}
} else {