This is the mail archive of the
mailing list for the binutils project.
RE: RFC: MIPS .reginfo section and objcopy --extract-symbols
- From: "Maciej W. Rozycki" <macro at imgtec dot com>
- To: Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- Cc: Hans-Peter Nilsson <hp at bitrange dot com>, Nick Clifton <nickc at redhat dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Sat, 30 Jan 2016 19:49:03 +0000
- Subject: RE: RFC: MIPS .reginfo section and objcopy --extract-symbols
- Authentication-results: sourceware.org; auth=none
- References: <87k2nfvma6 dot fsf at redhat dot com> <alpine dot BSF dot 2 dot 02 dot 1601112325320 dot 87741 at arjuna dot pair dot com> <6D39441BF12EF246A7ABCE6654B0235361D5894E at LEMAIL01 dot le dot imgtec dot org>
On Tue, 12 Jan 2016, Matthew Fortune wrote:
> We have to support weird and wonderful ELF files in tools because we
> can't constrain what users may want to do when squeezing every last byte
> out of their system. This means that a MIPS ELF with all the processor
> specific sections removed is accepted as valid in the tools albeit
> missing some information that the MIPS ABI would normally mandate.
> Corrupt special sections are a different matter though and raising
> errors for such cases seems reasonable.
FWIW Linux kernel binaries are built with a linker script that explicitly
discards these sections from output so as not to confuse some less capable
ELF loaders various system firmware have. So yes, I think removing these
sections is a valid action, which does not even make the resulting files
invalid, only more legacy-like. And in this particular case none of these
sections actually have a meaning, as they really only describe code and
with symbol sections only remaining there's no code anymore anyway.
As I communicated to Nick already, I had started looking into it a while
ago as I noticed the regression and I'll be pushing a proper fix once I've
found a minute to complete that effort.