This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] strip: Don't remove real symbols from allocated symbol tables.


On Thu, 2016-10-06 at 11:53 -0700, Josh Stone wrote:
> On 10/06/2016 07:18 AM, Mark Wielaard wrote:
> > Having a symbol in an allocated symbol table (like .dynsym) that
> > points to an unallocated section is wrong. Traditionally strip
> > has removed such symbols if they are section or group symbols.
> > But removing a real symbol from an allocate symbol table is hard
> > and probably a mistake. Really removing it means rewriting the
> > dynamic segment and hash sections. Since we don't do that, don't
> > remove the symbol (and corrupt the ELF file). Do warn and set
> > the symbol section to SHN_UNDEF.
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=1380961
> > 
> > Signed-off-by: Mark Wielaard <mjw@redhat.com>
> 
> Works for me.  On the test from bugzilla, I get the expected warning:
> 
>   strip: Cannot remove symbol [1550] from allocated symbol table [3]
> 
> but ldd is perfectly happy with the result.
> 
> I also tried it with a manual "objcopy -R .rustc" beforehand, which I
> will probably do in the rpm to prevent that section from even being
> saved to debuginfo -- just discard it entirely.  Strip still works with
> the same warning and a working result.

Thanks for testing. It also has been in Fedora rawhide for some time
now. I pushed it to master.

Cheers,

Mark

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]