[3/6][PATCH] Revise linker plugin API to better preserve link order.

Dave Korn dave.korn.cygwin@gmail.com
Sat Feb 26 00:46:00 GMT 2011


    Hi list,

  One of the two main functional changes to the plugin API.  This patch works
by taking all the files added by the lto plugin and inserting them into the
list of input statements at a point immediately after the first claimed object
file.

ld/ChangeLog:

2011-02-20  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.


    cheers,
      DaveK

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 003ld-plugin-api-link-order.diff
Type: text/x-c
Size: 8920 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20110226/5b1f5192/attachment.bin>


More information about the Binutils mailing list