LTO rescan archives
authorAlan Modra <amodra@gmail.com>
Sat, 2 Sep 2017 01:38:05 +0000 (11:08 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 2 Sep 2017 08:09:04 +0000 (17:39 +0930)
commit1fa4ec6ae707402c6b61cde33cfe4bdeafd53f82
tree2db8c41ce002aebac5440e5a6349d1c4a3a91517
parentad71ce8de7dba823f5fc478e6d5eba03f1a2e822
LTO rescan archives

ld ought to be more clever about where it puts LTO recompiled objects.
Ideally the recompiled objects ought to be ordered to the same place
their IR objects were, and files extracted from archives on the second
pass ought to go in the same place as they would if extracted on the
first pass.  This patch addresses the archive problem.  Without this
fix, objects extracted from archives might be placed after the crt
files intended to go at the end of an executable or shared library,
possibly causing exception handling failures.

* ldlang.h (lang_input_statement_type): Expand comments.
(LANG_FOR_EACH_INPUT_STATEMENT): Rewrite without casts.
* ldlang.c (lang_for_each_input_file): Likewise.
(load_symbols): Set usrdata for archives.
(find_rescan_insertion): New function.
(lang_process): Trim off and reinsert entries added to file chain
when rescanning archives for LTO.
* ldmain.c (add_archive_element): Set my_archive input_statement
next pointer to last element added.
ld/ChangeLog
ld/ldlang.c
ld/ldlang.h
ld/ldmain.c
This page took 0.024805 seconds and 4 git commands to generate.