[PATCH] D30458: [ELF] - Make Bss and BssRelRo sections to be synthetic by nature.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 06:46:32 PST 2017


grimar created this revision.

Previously we had:
static OutputSection *Bss;
static OutputSection *BssRelRo;

That was not very flexible. Sections required addditional handling
and it would be impossible to combine them into single if script
saying something like that:

  aabb : { *(.bss.*) }

I think using of approach for synthetics is more natural here.
Patch adds synthetic stubs .bss and .bss.rel.ro from start.
That allows linker to create output sections early. 
Later, depending on if we had the copy relocations or not, existing infrastructure
can remove unused output sections.
Patch removes need to add these sections manually.


https://reviews.llvm.org/D30458

Files:
  ELF/OutputSections.cpp
  ELF/OutputSections.h
  ELF/Relocations.cpp
  ELF/SyntheticSections.cpp
  ELF/SyntheticSections.h
  ELF/Writer.cpp
  test/ELF/map-file.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30458.90022.patch
Type: text/x-patch
Size: 7394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170228/fd5b4f92/attachment.bin>


More information about the llvm-commits mailing list