PATCH: PR binutils/10802: objcopy an executable file compiled with PIE failed

Alan Modra amodra@bigpond.net.au
Mon Oct 19 22:34:00 GMT 2009


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



More information about the Binutils mailing list