[PATCH] D63869: [ELF] Do not produce DT_JMPREL and DT_PLTGOT if .rela.plt is empty.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 04:41:18 PDT 2019


MaskRay 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
----------------
> 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


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D63869





More information about the llvm-commits mailing list