[PATCH] D48095: [ELF][X86_64] Use R_GOTREL_FROM_END instead of R_GOTREL for R_X86_64_GOTOFF64
Joerg Sonnenberger via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 14 00:42:42 PDT 2018
On Wed, Jun 13, 2018 at 03:01:34AM +0000, Fangrui Song via Phabricator via llvm-commits wrote:
> MaskRay added a comment.
>
> OK moved the test to `x86-64-reloc-gotoff64.s`, and renamed `x86-64-reloc-got.s` to `x86-64-reloc-gotpc64.s`.
>
> > Second of all, I got a different compilation result for the code that you gave to me: https://godbolt.org/g/qA1K9y. Is this expected?
>
> Sorry, the code was produced by gcc, not clang
>
> `gcc -O2 -S -mcmodel=medium -fPIC a.c` emits the expected two instruction which will compute the pc-relative address.
> clang emits a `movabsq` instruction which compiles to a
> `R_X86_64_RELATIVE` relocation which is not useful to the dynamic
> loader. The dynamic loader needs a runtime-address to compute its image base.
Can you create a (separate) bug for this one please?
Joerg
More information about the llvm-commits
mailing list