[PATCH] D89795: [jitlink][ELF] Add zero-fill blocks for symbols in section SHN_COMMON

Stefan Gränitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 08:08:50 PDT 2020


sgraenitz added a comment.

I didn't get the test to work yet. Neither with a R_X86_64_REX_GOTPCRELX relocation for common_data (TOT clang and llvm-mc emit that, llvm-mc-10 too btw) nor with R_X86_64_GOTPCREL (clang-10). Some observations in the following.

Output is:

  Expression 'decode_operand(load_common, 4) = got_addr(elf_common.o, common_data) - next_pc(load_common)' is false: 0xff9 != 0x1ff9

Executable memory is:

  dis -s 0x00007ffff7ff5000 -e 0x00007ffff7ff5010
  0x7ffff7ff5000: leaq   0xff9(%rip), %rax

So movq became leaq. Apparently the optimizeELF_x86_64_GOTAndStubs post-allocation pass does that. The instruction makes sense to me, because the data segment is at 0x00007ffff7ff6000. The pass transforms the original PCRel32GOTLoad into a PCRel32 and the result seems to be correct in this case. So, if we keep the optimization, I had to adjust the test expression right?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89795/new/

https://reviews.llvm.org/D89795



More information about the llvm-commits mailing list