[PATCH] D43703: Keep flags from phantom synthetic sections

Rafael Avila de Espindola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 16:33:17 PST 2018


espindola created this revision.
espindola added reviewers: jhenderson, grimar.
Herald added subscribers: arichardson, emaste.

This fixes pr36475.

I think this code can be simplified a bit, but I would like to check in the more direct fix if we are in agreement on the direction and then refactor.

This is not something that bfd does. The issue is not noticed in bfd because it keeps fewer sections from the linkerscript in the output.

The reasons why it seems reasonable to do this:

- As George noticed, we would still keep the flags if the output section had both an empty synthetic section and a regular section
- We need an heuristic to find the flags of output sections. Using the flags of a synthetic section that would have been there seems a reasonable heuristic.


https://reviews.llvm.org/D43703

Files:
  ELF/LinkerScript.cpp
  ELF/OutputSections.cpp
  ELF/OutputSections.h
  ELF/Writer.cpp
  test/ELF/linkerscript/empty-synthetic-removed-flags.s
  test/ELF/pr36475.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43703.135728.patch
Type: text/x-patch
Size: 5563 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180224/b9e46c4e/attachment.bin>


More information about the llvm-commits mailing list