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

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 07:43:29 PDT 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.

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.


https://reviews.llvm.org/D22516

Files:
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  ELF/OutputSections.cpp
  ELF/Writer.cpp
  test/ELF/linkerscript-repsection-va.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22516.64498.patch
Type: text/x-patch
Size: 4585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160719/c1f485df/attachment.bin>


More information about the llvm-commits mailing list