[PATCH] D48095: [ELF][X86_64] Use R_GOTREL_FROM_END instead of R_GOTREL for R_X86_64_GOTOFF64

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 10:16:33 PDT 2018


ruiu added a comment.

In https://reviews.llvm.org/D48095#1130635, @MaskRay wrote:

> OK moved the test to `x86-64-reloc-gotoff64.s`, and renamed `x86-64-reloc-got.s` to `x86
>  `gcc -O2 -S -mcmodel=medium -fPIC a.c` emits the expected two instructions whose sum computes the pc-relative address (runtime address of `_DYNAMIC`)
>  clang emits a `movabsq` instruction which compiles to a `R_X86_64_RELATIVE` relocation after linking, which is not useful to the dynamic loader.


Thank you for the explanation. This is perhaps a bit of topic, but does this mean it's a clang's bug? It seems to me that the code clang emits is not position independent.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D48095





More information about the llvm-commits mailing list