This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]