mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
1d0a1ee04d
Currently, BPF only contains three relocations: R_BPF_NONE for no relocation R_BPF_64_64 for LD_imm64 and normal 64-bit data relocation R_BPF_64_32 for call insn and normal 32-bit data relocation Also .BTF and .BTF.ext sections contain symbols in allocated program and data sections. These two sections reserved 32bit space to hold the offset relative to the symbol's section. When LLVM JIT is used, the LLVM ExecutionEngine RuntimeDyld may attempt to resolve relocations for .BTF and .BTF.ext, which we want to prevent. So we used R_BPF_NONE for such relocations. This all works fine until when we try to do linking of multiple objects. . R_BPF_64_64 handling of LD_imm64 vs. normal 64-bit data is different, so lld target->relocate() needs more context to do a correct job. . The same for R_BPF_64_32. More context is needed for lld target->relocate() to differentiate call insn vs. normal 32-bit data relocation. . Since relocations in .BTF and .BTF.ext are set to R_BPF_NONE, they will not be relocated properly when multiple .BTF/.BTF.ext sections are merged by lld. This patch intends to address this issue by adding additional relocation kinds: R_BPF_64_ABS64 for normal 64-bit data relocation R_BPF_64_ABS32 for normal 32-bit data relocation R_BPF_64_NODYLD32 for .BTF and .BTF.ext style relocations. The old R_BPF_64_{64,32} semantics: R_BPF_64_64 for LD_imm64 relocation R_BPF_64_32 for call insn relocation The existing R_BPF_64_64/R_BPF_64_32 mapping to numeric values is maintained. They are the most common use cases for bpf programs and we want to maintain backward compatibility as much as possible. ExecutionEngine RuntimeDyld BPF relocations are adjusted as well. R_BPF_64_{ABS64,ABS32} relocations will be resolved properly and other relocations will be ignored. Two tests are added for RuntimeDyld. Not handling R_BPF_64_NODYLD32 in RuntimeDyldELF.cpp will result in "Relocation type not implemented yet!" fatal error. FK_SecRel_4 usages in BPFAsmBackend.cpp and BPFELFObjectWriter.cpp are removed as they are not triggered in BPF backend. BPF backend used FK_SecRel_8 for LD_imm64 instruction operands. Differential Revision: https://reviews.llvm.org/D102712 |
||
---|---|---|
.. | ||
BTF | ||
CORE | ||
32-bit-subreg-alu.ll | ||
32-bit-subreg-cond-select.ll | ||
32-bit-subreg-load-store.ll | ||
32-bit-subreg-peephole-phi-1.ll | ||
32-bit-subreg-peephole-phi-2.ll | ||
32-bit-subreg-peephole-phi-3.ll | ||
32-bit-subreg-peephole.ll | ||
32-bit-subreg-zext.ll | ||
adjust-opt-icmp1.ll | ||
adjust-opt-icmp2.ll | ||
adjust-opt-speculative1.ll | ||
adjust-opt-speculative2.ll | ||
alu8.ll | ||
atomics_2.ll | ||
atomics.ll | ||
basictest.ll | ||
byval.ll | ||
callx.ll | ||
cc_args_be.ll | ||
cc_args.ll | ||
cc_ret.ll | ||
cmp.ll | ||
dwarfdump.ll | ||
elf-symbol-information.ll | ||
ex1.ll | ||
fi_ri.ll | ||
i128.ll | ||
inline_asm.ll | ||
inlineasm-output-template.ll | ||
inlineasm-wreg.ll | ||
intrinsics.ll | ||
is_trunc_free.ll | ||
is_zext_free.ll | ||
lit.local.cfg | ||
load.ll | ||
loops.ll | ||
many_args1.ll | ||
many_args2.ll | ||
mem_offset_be.ll | ||
mem_offset.ll | ||
memcpy-expand-in-order.ll | ||
objdump_atomics.ll | ||
objdump_cond_op_2.ll | ||
objdump_cond_op.ll | ||
objdump_dis_all.ll | ||
objdump_imm_hex.ll | ||
objdump_intrinsics.ll | ||
objdump_nop.ll | ||
objdump_static_var.ll | ||
objdump_trivial.ll | ||
objdump_two_funcs.ll | ||
optnone-1.ll | ||
optnone-2.ll | ||
reloc-2.ll | ||
reloc-3.ll | ||
reloc-btf-2.ll | ||
reloc-btf.ll | ||
reloc.ll | ||
remove_truncate_1.ll | ||
remove_truncate_2.ll | ||
remove_truncate_3.ll | ||
remove_truncate_4.ll | ||
remove_truncate_5.ll | ||
remove_truncate_6.ll | ||
remove_truncate_7.ll | ||
remove_truncate_8.ll | ||
rodata_1.ll | ||
rodata_2.ll | ||
rodata_3.ll | ||
rodata_4.ll | ||
rodata_5.ll | ||
rodata_6.ll | ||
rodata_7.ll | ||
sanity.ll | ||
sdiv_error.ll | ||
select_ri.ll | ||
selectiondag-bug.ll | ||
setcc.ll | ||
shifts.ll | ||
simplifycfg.ll | ||
sockex2.ll | ||
struct_ret1.ll | ||
struct_ret2.ll | ||
undef.ll | ||
vararg1.ll | ||
warn-call.ll | ||
warn-stack.ll | ||
xadd_legal.ll | ||
xadd.ll |