[PATCH] libdwfl: Fix relocation overlap sanity check.

Mark Wielaard mark@klomp.org
Mon Nov 26 10:37:00 GMT 2018

On Fri, 2018-11-23 at 21:20 +0100, Mark Wielaard wrote:
> We would not relocate when the relocation section data or the target
> section date would overlap with one of the ELF headers. This is only
> really necessary if the data comes directly from the mmapped file.
> Otherwise there is no real overlap and the relocations can be safely
> applied.
> One particular thing we got wrong with the original sanity check was
> when the relocation data or target data section was compressed. In
> that case it could happen we overestimated the size (because the Shdr
> would have been updated to show the uncompressed data size). But
> uncompressed data is always malloced and so cannot overlap with the
> mmapped Elf header structures.
> When building with CFLAGS="-g -Og" this showed up as a failure in
> run-strip-reloc.sh for strip-compressed.o. Where the .debug_loc
> section decompressed would "overlap" with the shdrs at the end of
> the file and so wouldn't get relocations applied.

Pushed to master.

More information about the Elfutils-devel mailing list