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: Ian Lance Taylor <iant at google dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: binutils <binutils at sourceware dot org>, Cary Coutant <ccoutant at google dot com>
- Date: Thu, 22 Sep 2011 11:14:41 -0700
- Subject: Re: gold patch to discard .note.callgraph sections in the final link.
- References: <CAAs8Hmwff246Uukik_Wcbn4c=mEpGp3wR_u1P8e3RKn8D3Ji1g@mail.gmail.com>
Sriraman Tallam <tmsriram@google.com> writes:
> I am working on a project to global function layout in the linker
> where the linker reads the callgraph edge profile information,
> generated by FDO, and uses that to find a ordering of functions that
> will place functions calling each other frequently closer. To do
> this, I create special .note sections, called .note.callgraph which
> records the callgraph edge profile info. Please see :
> http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00602.html
>
> This patch is to make gold omit these sections in the final link
> except when generating relocatable objects. Is this ok to submit?
>
>
>
> * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
> Omit .note.callgraph sections in the final link.
Usually sections whose names begin with .note are SHT_NOTE sections with
have a specific format described in the ELF ABI. I would recommend
against using a section name beginning with .note if you are not
following that format. Unless you expect this to work with other
toolchains, I would recommend using a name which starts with ".gnu.".
It's really hard for me to feel comfortable about adding yet another
magic section recognized by name. I know it's not your fault but we're
getting these because the assembler is unable to set a specific ELF
section type.
You are using a plugin, right? Can you just arrange for your plugin to
drop the section, rather than doing this in the linker proper?
Ian