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]

Copying .group sections using BFD


Hi All,

We have some code which manipulates ELF files after they've been
compiled in order to optimize out some debug/trace data.

We use BFD to do this manipulation at the end of the compile process.
You can find the source up on github here -
https://github.com/open-power/hostboot/blob/master/src/build/trace/tracehash.c

The key code in question is on line 284 and has to do with the copying
of the .group section into the new .o file.  The current code just
skips over copying the .group section and all was ok with this in gcc
4.8 and lower.  The new gcc 4.9 though seems to require the .group
section.

The issue I'm working for this is
https://github.com/open-power/hostboot/issues/6

I've done a lot of googling and searching but I haven't found much
that has to do with copying a .group section over. The most obvious
example is in objcopy.c but in setup_section() I see internal calls to
code like group_signature (i.e. using Elf_Internal_Shdr) which is not
available when compiling using the standard BFD libraries.  I also see
that the skip_section() interface will return true for SEC_GROUP
sections so I'm assuming on a copy of a group, just the code in
setup_section() is needed?

Basically, all I want to do is copy the .group verbatim into the new
output file (or regenerate it in a way to make everyone happy).

And for reference, can anyone explain what a .group section is used
for?  I haven't been able to find a clear explanation of it.

Thanks!


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