Do not add .interp, .dynamic nor .eh_frame_hdr to segments just by type.
authorRui Ueyama <ruiu@google.com>
Mon, 22 Aug 2016 04:55:20 +0000 (04:55 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 22 Aug 2016 04:55:20 +0000 (04:55 +0000)
commit464daadc3de8be1801e3aace6366c7255f08e531
tree95036b4cba9df10ccb76eb3da8c8b16a16a8a88b
parent0672a27bb5d30f7349cd6370baac91c47e0a045f
Do not add .interp, .dynamic nor .eh_frame_hdr to segments just by type.

Summary:
We previously added these output sections to segments just by type.
Therefore, if there's a PHDRS command like this

  PHDRS {
    headers PT_PHDR PHDRS;
    interp PT_INTERP;
  }

  SECTIONS {
    . = SIZEOF_HEADERS;
    .interp : { *(.interp) } :text
  }

then .interp was added to "interp" segment even though the linker
is not instructed to do so by SECTIONS command. This patch removes
the default behavior to simplify.

Differential Revision: https://reviews.llvm.org/D23702

llvm-svn: 279414
lld/ELF/LinkerScript.cpp