[Patch] Don't relocate compressed sections

Cary Coutant ccoutant at google.com
Wed Mar 28 22:20:17 UTC 2012


> Ok, so gas now has an option to produce them that way.
> That's pretty inane, but so it is.

Admittedly, a more principled approach would have been to add an
SHF_COMPRESSED flag to ELF without changing the section name, but the
".zdebug_" approach matches what was done a few years ago for ET_EXEC
files. It's also easier to handle it that way in the non-ELF file
formats.

> How does the rest of binutils deal with this?  Does it decompress .zfoo and
> pretend it was called .foo and then apply a .rel.foo section's relocs to
> it?

Yes. There's a BFD flag that lets the client specify whether it wants
to see the decompressed contents or not. If you're asking for
relocated section contents, it'll decompress first.

>  (I guess the name of the reloc section doesn't actually matter, if
> it's just following the sh_info pointer as it should.)

Right.

-cary


More information about the elfutils-devel mailing list