This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR binutils/10802: objcopy an executable file compiled with PIE failed
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 20 Oct 2009 09:04:14 +1030
- Subject: Re: PATCH: PR binutils/10802: objcopy an executable file compiled with PIE failed
- References: <20091019181840.GA6273@lucon.org>
On Mon, Oct 19, 2009 at 11:18:40AM -0700, H.J. Lu wrote:
> Hi,
>
> We failed to preserve the permission bits on PIE since it is marked as
> ET_DYN. This patch tries to preserve the permission bits when copying
> a file. OK to install?
ld does this differently. It sets EXEC_P on the output bfd before
calling bfd_close. I think objcopy should do the same, or better,
bfd/opncls.c:_maybe_make_executable should look at both EXEC_P and
DYNAMIC.
--
Alan Modra
Australia Development Lab, IBM