This is the mail archive of the
mailing list for the binutils project.
Re: Fix segfault when .plt section does not exist
- From: "Maciej W. Rozycki" <macro at imgtec dot com>
- To: Palmer Dabbelt <palmer at dabbelt dot com>
- Cc: <binutils at sourceware dot org>
- Date: Wed, 8 Feb 2017 09:29:46 +0000
- Subject: Re: Fix segfault when .plt section does not exist
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.email@example.com> <firstname.lastname@example.org>
On Fri, 3 Feb 2017, Palmer Dabbelt wrote:
> Sorry to take a while to get back to you, how does this new version look?
I see you've committed the change already -- however I'd like to point
out that I am fairly sure (although not absolutely certain offhand) that
`splt->size' can actually be non-zero for a discarded `.plt' section, as
normal processing is done internally as if the section was to be included
in output, except that ->output_section points to the absolute section.
You'd have to create a small test case to verify that (mine for PR
ld/20828 isn't enough as it doesn't actually create a PLT), which could
then serve as a part of the test suite too.
NB, although we do handle such a situation in many places across BFD, I
have identified a couple where we don't, one in the MIPS backend and
another in generic ELF linker code. I have made patches to adjust those
places and intend to publish them sometime, however I'm yet thinking what
to do about some dynamic entries like DT_PLTGOT which are set incorrectly
when the corresponding section has been removed from output.