This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] libdwfl: Fix relocation overlap sanity check.
- From: Mark Wielaard <mark at klomp dot org>
- To: elfutils-devel at sourceware dot org
- Date: Mon, 26 Nov 2018 11:37:01 +0100
- Subject: Re: [PATCH] libdwfl: Fix relocation overlap sanity check.
- References: <1543004401-15437-1-git-send-email-mark@klomp.org>
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.