This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Make Bss and BssRelRo sections to be synthetic by nature.
AbandonedPublic

Authored by grimar on Feb 28 2017, 6:46 AM.

Details

Reviewers
ruiu
rafael
Summary

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.

Diff Detail

Event Timeline

grimar created this revision.Feb 28 2017, 6:46 AM
grimar planned changes to this revision.Feb 28 2017, 6:53 AM

Will update soon.

grimar updated this revision to Diff 90026.Feb 28 2017, 7:03 AM
  • Added proper flag.
ruiu edited edge metadata.Feb 28 2017, 9:20 AM

It doesn't seem like an improvement to me. Out::Bss and Out::BssRelRo are containers of synthetic sections, thus they are output sections. You could represent them as input sections, and we want to do if that simplifies code/design, but this patch doesn't seem to simplify it.

grimar abandoned this revision.Mar 6 2017, 6:50 AM

D30541 was commited as alternative.