From 8543fde54aeb0a961400b8d0d14b89dcc7708a2f Mon Sep 17 00:00:00 2001 From: Dave Korn Date: Thu, 10 Mar 2011 10:25:02 +0000 Subject: [PATCH] Revise linker plugin API to better preserve link order. ld/ChangeLog: 2011-03-10 Dave Korn * ldlang.h (lang_input_statement_type): Add new 'claim_archive' flag, wrapping both it and 'claim' flag in #ifdef ENABLE_PLUGINS. * ldmain.c (add_archive_element): Set it if the member is claimed. * ldlang.c (new_afile): Initialise claim_archive and claimed members. (find_replacements_insert_point): New helper function. (lang_process): After adding and opening replacement files passed from plugin, splice them into correct place in statement list and file chains to preserve critical link order. (lang_list_insert_after): New helper function. (lang_list_remove_tail): Likewise. --- ld/ldmain.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ld/ldmain.c') diff --git a/ld/ldmain.c b/ld/ldmain.c index 6e86c3d..005a894 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -833,6 +833,7 @@ add_archive_element (struct bfd_link_info *info, /* Substitute the dummy BFD. */ input->the_bfd = file.handle; input->claimed = TRUE; + input->claim_archive = TRUE; bfd_make_readable (input->the_bfd); *subsbfd = input->the_bfd; } -- cgit v1.1