[PATCH] D63869: [ELF] Do not produce DT_JMPREL and DT_PLTGOT if .rela.plt is empty.
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 27 04:55:25 PDT 2019
ikudrin marked an inline comment as done.
ikudrin added inline comments.
================
Comment at: test/ELF/empty-relaplt-dyntags.s:18
+## mentioned in the linker script. However, even in that case we should not
+## produce DT_JMPREL and DT_PLTGOT tags because this can cause a dynamic loader
+## to write into memory it considers reserved. In fact, as .got.plt is also
----------------
MaskRay wrote:
> > to write into memory it considers reserved
>
> I don't think a dynamic linker should do this because DT_PLTRELSZ is zero.
>
> I agree that 0 JMPREL should be omitted.
>
> 0x0000000000000017 (JMPREL) 0x0
> 0x0000000000000002 (PLTRELSZ) 0 (bytes)
> 0x0000000000000003 (PLTGOT) 0x0
That is why I posted the reproducer. I tested it on Ubuntu 18.04 with the fresh built `lld`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63869/new/
https://reviews.llvm.org/D63869
More information about the llvm-commits
mailing list