This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Linkerscript: create multiple output sections for inputs with different attributes.
ClosedPublic

Authored by grimar on Sep 1 2016, 4:43 AM.

Details

Summary

Previously we combined sections by name if linkerscript was used.
For that we had to disable SHF_MERGE handling temporarily, but then
found that implementing it properly will require additional complexity layers like
subsections or something.
At the same time looks we can live with multiple output sections approach for now.
That patch do this change.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 69987.Sep 1 2016, 4:43 AM
grimar retitled this revision from to [ELF] - Linkerscript: create multiple output sections for inputs with different attributes..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar updated this object.
grimar added subscribers: davide, evgeny777, llvm-commits, grimar.
ruiu accepted this revision.Sep 6 2016, 6:22 PM
ruiu edited edge metadata.

Sorry for the belated response. Let's try this. LGTM.

ELF/LinkerScript.cpp
366 ↗(On Diff #69987)

findSection*s*

368 ↗(On Diff #69987)

Out -> Ret (it is more conventional.)

369–373 ↗(On Diff #69987)
for (OutputSectionBase<ELFT> *Sec : Sections)
  if (Sec->getName() == Cmd.Name && checkConstraint(Sec->getFlags(), Cmd.Constraint))
    Out.push_back(Sec);
This revision is now accepted and ready to land.Sep 6 2016, 6:22 PM
This revision was automatically updated to reflect the committed changes.
lld/trunk/ELF/LinkerScript.cpp