This is the mail archive of the
mailing list for the binutils project.
Copying .group sections using BFD
- From: Andrew Geissler <geissonator at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 28 Jan 2015 16:57:22 -0600
- Subject: Copying .group sections using BFD
- Authentication-results: sourceware.org; auth=none
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 -
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
The issue I'm working for this is
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.