
After porting BOLT to RISCV some of the relocations were broken on both AArch64 and X86. On AArch64 the example of broken relocations would be GOT, during handling them, we should replace the symbol to __BOLT_got_zero in order to address GOT entry, not the symbol that addresses this entry. This is done further in code, so it is too early to add rel here. On X86 it is a mistake to add relocations without addend. This is the exact problem that is raised on #97937. Due to different code generation I had to use gcc-generated yaml test, since with clang I wasn't able to reproduce problem. Added tests for both architectures and made the problematic condition riscV-specific.
9 lines
302 B
Plaintext
9 lines
302 B
Plaintext
// This test checks that relocation addend used to address build_id fields
|
|
// is properly disassembled by BOLT.
|
|
|
|
RUN: yaml2obj %p/Inputs/build_id.yaml &> %t.exe
|
|
RUN: llvm-bolt -print-disasm --print-only=print_build_id %t.exe -o %t.bolt | \
|
|
RUN: FileCheck %s
|
|
|
|
CHECK: leaq build_id_note+16(%rip), %rbx
|