[PATCH] D20024: [ELF] - Protect first entries of got.plt with RelRo.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 06:47:22 PDT 2016


> Since the the link-time address of _DYNAMIC is stored in the first element
> of the GOT as specified by the x86-64 psABI, one can use
>
> movq _GLOBAL_OFFSET_TABLE_(%rip), %rax
>
> to get the link-time address of _DYNAMIC.

Given that this is being done before relocations, what is the
difference from just using _DYNAMIC?

I couldn't find the code in the glibc dynamic linker, but I noticed
musl uses _DYNAMIC and I was able to bootstrap without setting got[0]
with glibc.

Cheers,
Rafael


More information about the llvm-commits mailing list