[PATCH][gold] Place sections like ".rela.dyn" according to linker scripts.

Cary Coutant ccoutant@gmail.com
Tue Dec 13 03:05:00 GMT 2016


> I've checked it. The things with these sections are definitely complicated
> if we try to imitate ld's behavior in every single detail. Anyway, my patch
> deals with only one particular case and, as far as I can see, doesn't change
> anything for the sample from PR 20062.

Thanks for the patch. I've changed it a bit -- after thinking about it
for a *long* time (!), experimenting with Gnu ld, and working through
a few other test cases, I've decided that linker-generated sections
should match *only* via the output section name (except for the case
of /DISCARD/). Accordingly, this patch just changes
Output_section_definition::output_section_name() to check the output
section name for a linker-generated section. I think this will also
fix both PR 20062 and PR 20522, as we will no longer try to place
.rela.data into .rela.dyn.

I've attached the patch as committed.

-cary


2016-12-12  Igor Kudrin  <ikudrin@accesssoftek.com>
            Cary Coutant  <ccoutant@gmail.com>

gold/
        PR gold/14676
        * script-sections.cc (Output_section_definition::output_section_name):
        For linker-generated sections, compare with output section name.
        * testsuite/Makefile.am (script_test_13): New test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/script_test_13.c: New source file.
        * testsuite/script_test_13.sh: New script.
        * testsuite/script_test_13.t: New linker script.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr14676.patch
Type: application/octet-stream
Size: 4377 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20161213/bcc1f2b5/attachment.obj>


More information about the Binutils mailing list