On Tue, Jan 19, 2016 at 11:08 PM, Sriraman Tallam <tmsri...@google.com> wrote: > > There is no documentation as such that I am aware of to write a linker > plugin. Here is a very brief overview. The linker calls the > plugin's "onload" function when registering the plugin and the plugin > inturn can register two call-backs with the linker, "claim_file_hook" > and the "all_symbols_read_hook". "claim_file_hook" is called for > each object file that the linker prcesses and the > "all_symbols_read_hook" is called after all the symbols have been read > by the linker. These are just two different interesting points in the > course of a link. > > The plugin can also get handles to linker functions like > "get_input_section_name" which it can use to process sections given > their handle. You can also check the gold linker tests for simpler > plugin examples.
The linker plugin interface is somewhat documented at https://gcc.gnu.org/wiki/whopr/driver . Ian