This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fix relro strip test for MIPS
- From: Daniel Jacobowitz <drow at false dot org>
- To: binutils at sourceware dot org
- Date: Mon, 24 Sep 2007 14:26:39 -0400
- Subject: Re: Fix relro strip test for MIPS
- References: <20070919160554.GA27329@caradoc.them.org>
On Wed, Sep 19, 2007 at 12:05:54PM -0400, Daniel Jacobowitz wrote:
> There are two unique things about MIPS which conspire to fail the
> ld -z relro -shared tests (which test that objcopy and strip do not
> change the binary). One is that .dynamic is writable and there is no
> .got.plt section, so a typical shared library has no PT_GNU_RELRO;
> it gets added and then converted to PT_NULL. The other is that it
> adds a second PT_NULL program header for prelinker support.
> These combine to produce an input file with two PT_NULL segments.
> There's a FIXME in copy_elf_program_header above some code which
> seems clearly wrong for this case.
>
> Deleting that turns up a second problem. The input file to strip
> has a PT_NULL segment with alignment of zero (I believe this is the
> aborted PT_GNU_RELRO segment, but it might have been the MIPS-specific
> one; I'm not completely sure). We were overriding its input alignment
> and I don't see any reason to do so.
>
> With this patch two more tests pass on mips-linux. Unless someone
> sees a problem with them, I will apply them in a few days.
I agree with H.J. that we should not generate the extra PT_NULL
segment, and I'm keeping an eye on his patch to prevent that
(thanks!). Meanwhile, there were no concerns about this patch
for copying odd binaries; I've checked it in.
--
Daniel Jacobowitz
CodeSourcery