[PATCH 4/8] section-select: Completely rebuild matches
Alan Modra
amodra@gmail.com
Mon Nov 28 01:57:58 GMT 2022
On Fri, Nov 25, 2022 at 04:55:12PM +0000, Michael Matz via Binutils wrote:
> this resets all section matches before updating for newly created
> sections (i.e. completely rebuilds the matches). This fixes powerpc
> "TOC opt" tests that shows a difference in section order: originally
> .got of "linker stubs" comes before .toc (both placed into the same
> .got output section due to ".got {*(.got .toc)}". But .got of linker
> stubs is created later, and in the second run of resolve_wilds is
> appended to the list, hence is then coming after .toc (which was added
> already in the earlier resolve_wilds run). So order swapped ->
> test fails.
That's a problem. The got header is created in the .got of "linker
stubs", and code setting the value of .TOC. assumes that the header
will be located first in the .got output section. This ties in with
where ld.so expects to find the header too.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list