This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Source Code for Profile Guided Code Positioning
- From: Ian Lance Taylor <iant at google dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: Yury Gribov <y dot gribov at samsung dot com>, vivek pandya <vivekvpandya at gmail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Maxim Ostapenko <m dot ostapenko at partner dot samsung dot com>, Pavel Kopyl <p dot kopyl at samsung dot com>
- Date: Wed, 20 Jan 2016 05:39:41 -0800
- Subject: Re: Source Code for Profile Guided Code Positioning
- Authentication-results: sourceware.org; auth=none
- References: <CAHYgpoLhosGmQZJb6OHiD6SmJ6Y_BTuEh_8Pj6z1DeHp_b0C4A at mail dot gmail dot com> <56992CFC dot 7050207 at samsung dot com> <CAHYgpoJ9mqxcAiLLrAdPyiwmzms+Vcz3yk9f2uN_39AjHFuqhw at mail dot gmail dot com> <56993187 dot 7050409 at samsung dot com> <CAAs8Hmz7GM07cA-kxGDb6xkTKn1G05b7DJAi-p=JiNAnvbLHLw at mail dot gmail dot com>
On Tue, Jan 19, 2016 at 11:08 PM, Sriraman Tallam <tmsriram@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