This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Fix an issue when 2 output sections were created from single declaration in script
AbandonedPublic

Authored by grimar on Jul 19 2016, 7:43 AM.

Details

Reviewers
ruiu
rafael
Summary

I noticed that linkerscript-repsection-va.s was wrong:

For single foo entry:
SECTIONS {.foo : {*(.foo.*)} }
2 output sections were created.

I think that is wrong because:

  1. It is really confusing and complicates the understanding of the script output. I think nobody expects to see multiple output sections for single entry.
  2. Imagine that some symbols are to be declared: SECTIONS {.foo : {*(.foo.*)} end = .; } what should be the value of end if we have 2 output sections ? Its just confusing.
  3. gold and ld do not do that.
  4. It also adds a problem for refactoring of script I do.

Patch fixes that bu combining the flags of sections if scripted layouting is used.

Diff Detail

Event Timeline

grimar updated this revision to Diff 64498.Jul 19 2016, 7:43 AM
grimar retitled this revision from to [ELF] - Fix an issue when 2 output sections were created from single declaration in script.
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.
grimar abandoned this revision.Jul 20 2016, 11:54 PM

Patch was based on wrong assumption that behavior is wrong.
I think behavior is questionable, but for now no need to change it.