[PATCH] D67324: [ELF] nmagic or omagic: don't allocate PT_PHDR or PF_R PT_LOAD for the !hasPhdrsCommands case

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 7 22:53:02 PDT 2019


MaskRay created this revision.
MaskRay added reviewers: grimar, peter.smith, ruiu.
Herald added subscribers: llvm-commits, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

  part.phdrs = script->hasPhdrsCommands() ? script->createPhdrs() : createPhdrs(part);

createPhdrs() allocates a PT_PHDR and a PF_R PT_LOAD, which will be
deleted later in LinkerScript::allocateHeaders, but leave a gap between
the program headers and the first section. Don't allocate them.
PT_INTERP is likely not needed as well.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D67324

Files:
  ELF/Writer.cpp
  test/ELF/magic-page-combo-warn.s
  test/ELF/nmagic.s
  test/ELF/relro-omagic.s
  test/ELF/segments.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67324.219255.patch
Type: text/x-patch
Size: 8351 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190908/1deaff9c/attachment.bin>


More information about the llvm-commits mailing list