gold patch to discard .note.callgraph sections in the final link.

Cary Coutant ccoutant@google.com
Thu Sep 22 18:26:00 GMT 2011


> +         // This section is special.  It records the callgraph edge profile
> +         // information.  It should be omitted after its contents are read.
> +         if (is_prefix_of(".note.callgraph.text", name))
> +           {
> +             if (!relocatable)
> +               omit[i] = true;
> +           }

The comment should mention that the contents of this section are read
by a plugin, rather than by the linker itself.

Like Ian, I don't like special-casing the name. I thought of
suggesting that the plugin should arrange to discard the section, but
we'd want to discard it even (especially!) when the plugin isn't being
used. That suggests use of the SHF_EXCLUDE flag, but we want ld -r to
pass the section through for processing during the final link. That
brings up the issue of whether SHF_EXCLUDE sections should be
discarded during an ld -r link, or whether we'd want yet another flag
for that. This special case seems easiest for now.

-cary



More information about the Binutils mailing list