PR26150, Assertion when asm() defines global symbols, -flto and --start-group
authorAlan Modra <amodra@gmail.com>
Tue, 23 Jun 2020 14:20:56 +0000 (23:50 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 23 Jun 2020 15:20:48 +0000 (00:50 +0930)
commit9221725d1f6e3f5dd0c0143ee750460619c582f2
treed3c8991309aa4961a98a10489063eb6bc70ef8d9
parent39f381cb80463bd814da549a927bee4643d4ceac
PR26150, Assertion when asm() defines global symbols, -flto and --start-group

If an archive map contains symbols that aren't actually defined by the
indexed element for any reason, then loading that element will leave
the symbol undefined (or common).  This leads to the possibility of
the element being loaded again should the archive be searched again
due to the action of --start-group/--end-group.  The testcase
triggering this problem was an archive containing fat lto objects,
with the archive map incorrectly created by ar rather than gcc-ar.

PR 26150
* ldlang.c (ldlang_add_file): Assert that we aren't adding the
current end of link.next list again too.
* ldmain.c (add_archive_element): Don't load archive elements
again that have already been loaded.
ld/ChangeLog
ld/ldlang.c
ld/ldmain.c
This page took 0.026229 seconds and 4 git commands to generate.