RFC: MIPS .reginfo section and objcopy --extract-symbols

Maciej W. Rozycki macro@imgtec.com
Sat Jan 30 19:49:00 GMT 2016


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.

  Maciej



More information about the Binutils mailing list