This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold patch to discard .note.callgraph sections in the final link.
- From: Cary Coutant <ccoutant at google dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: binutils <binutils at sourceware dot org>, Ian Lance Taylor <iant at google dot com>
- Date: Thu, 22 Sep 2011 11:25:58 -0700
- Subject: Re: gold patch to discard .note.callgraph sections in the final link.
- References: <CAAs8Hmwff246Uukik_Wcbn4c=mEpGp3wR_u1P8e3RKn8D3Ji1g@mail.gmail.com>
> + ? ? ? ? // 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