1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/lib/Target/BPF
Yonghong Song b2cd040e05 BPF: fix FIELD_EXISTS relocation with array subscripts
Lorenz Bauer reported an issue in bpf mailing list ([1]) where
for FIELD_EXISTS relocation, if the object is an array subscript,
the patched immediate is the object offset from the base address,
instead of 1.

Currently in BPF AbstractMemberAccess pass, the final offset
from the base address is the patched offset except FIELD_EXISTS
which is 1 unconditionally. In this particular case, the last
data structure access is not a field (struct/union offset)
so it didn't hit the place to set patched immediate to be 1.

This patch fixed the issue by checking the relocation type.
If the type is FIELD_EXISTS, just set to 1.
Tested by modifying some bpf selftests, libbpf is okay with
such types with FIELD_EXISTS relocation.

 [1] https://lore.kernel.org/bpf/CACAyw99n-cMEtVst7aK-3BfHb99GMEChmRLCvhrjsRpHhPrtvA@mail.gmail.com/

Differential Revision: https://reviews.llvm.org/D102036
2021-05-06 22:37:02 -07:00
..
AsmParser
Disassembler
MCTargetDesc
TargetInfo
BPF.h
BPF.td
BPFAbstractMemberAccess.cpp BPF: fix FIELD_EXISTS relocation with array subscripts 2021-05-06 22:37:02 -07:00
BPFAdjustOpt.cpp Update BPFAdjustOpt.cpp to accept select form of or as well 2021-02-20 18:29:58 +09:00
BPFAsmPrinter.cpp
BPFCallingConv.td
BPFCheckAndAdjustIR.cpp
BPFCORE.h
BPFFrameLowering.cpp
BPFFrameLowering.h
BPFInstrFormats.td
BPFInstrInfo.cpp
BPFInstrInfo.h
BPFInstrInfo.td
BPFISelDAGToDAG.cpp [llvm] Remove redundant return and continue statements (NFC) 2021-01-14 20:30:34 -08:00
BPFISelLowering.cpp BPF: provide better error message for unsupported atomic operations 2021-03-11 19:19:00 -08:00
BPFISelLowering.h BPF: provide better error message for unsupported atomic operations 2021-03-11 19:19:00 -08:00
BPFMCInstLower.cpp
BPFMCInstLower.h
BPFMIChecking.cpp
BPFMIPeephole.cpp BPF: Fix a bug in peephole TRUNC elimination optimization 2021-03-02 13:03:42 -08:00
BPFMISimplifyPatchable.cpp
BPFPreserveDIType.cpp BPF: permit type modifiers for __builtin_btf_type_id() relocation 2021-03-04 16:27:23 -08:00
BPFRegisterInfo.cpp
BPFRegisterInfo.h
BPFRegisterInfo.td
BPFSelectionDAGInfo.cpp
BPFSelectionDAGInfo.h
BPFSubtarget.cpp
BPFSubtarget.h
BPFTargetMachine.cpp BPF: Implement TTI.IntImmCost() properly 2021-02-11 08:35:25 -08:00
BPFTargetMachine.h BPF: Implement TTI.IntImmCost() properly 2021-02-11 08:35:25 -08:00
BPFTargetTransformInfo.h [TTI] NFC: Change getCmpSelInstrCost to return InstructionCost 2021-04-13 14:21:01 +01:00
BTF.def [BPF] Add support for floats and doubles 2021-03-05 15:10:11 +01:00
BTF.h
BTFDebug.cpp BPF: generate BTF info for LD_imm64 loaded function pointer 2021-04-26 17:23:36 -07:00
BTFDebug.h BPF: generate BTF info for LD_imm64 loaded function pointer 2021-04-26 17:23:36 -07:00
CMakeLists.txt BPF: Add LLVMTransformUtils in CMakefile LINK_COMPONENTS 2021-02-25 15:43:25 -08:00