mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
[bpf] emit jmp fixups in little endian
The 'off' field of 'struct bpf_insn' is in cpu-endianness, since the rest is emitted as little endian, make sure that 'off' field is little endian as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238038 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
84b1a805bb
commit
1fd101c86d
@ -68,7 +68,9 @@ void BPFAsmBackend::applyFixup(const MCFixup &Fixup, char *Data,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
assert(Fixup.getKind() == FK_PCRel_2);
|
assert(Fixup.getKind() == FK_PCRel_2);
|
||||||
*(uint16_t *)&Data[Fixup.getOffset() + 2] = (uint16_t)((Value - 8) / 8);
|
Value = (uint16_t)((Value - 8) / 8);
|
||||||
|
Data[Fixup.getOffset() + 2] = Value & 0xFF;
|
||||||
|
Data[Fixup.getOffset() + 3] = Value >> 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
MCObjectWriter *BPFAsmBackend::createObjectWriter(raw_pwrite_stream &OS) const {
|
MCObjectWriter *BPFAsmBackend::createObjectWriter(raw_pwrite_stream &OS) const {
|
||||||
|
Loading…
Reference in New Issue
Block a user