[all-commits] [llvm/llvm-project] 3f5dc5: [LLD][ELF] - Don't keep empty output sections whic...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Wed Dec 2 00:22:57 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3f5dc57fd18106766f45216b5ddd4648d2fb4629
      https://github.com/llvm/llvm-project/commit/3f5dc57fd18106766f45216b5ddd4648d2fb4629
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-12-02 (Wed, 02 Dec 2020)

  Changed paths:
    M lld/ELF/LinkerScript.cpp
    M lld/test/ELF/linkerscript/empty-relaplt-dyntags.test
    M lld/test/ELF/linkerscript/implicit-program-header.test
    M lld/test/ELF/linkerscript/orphan-phdrs.s

  Log Message:
  -----------
  [LLD][ELF] - Don't keep empty output sections which have explicit program headers.

This reverts a side effect introduced in the code cleanup patch D43571:
LLD started to emit empty output sections that are explicitly assigned to a segment.

This patch fixes the issue by removing the !sec.phdrs.empty() special case from
isDiscardable. As compensation, we add an early phdrs propagation step (see the inline comment).
This is similar to one that we do in adjustSectionsAfterSorting.

Differential revision: https://reviews.llvm.org/D92301




More information about the All-commits mailing list