PATCH: PR binutils/10802: objcopy an executable file compiled with PIE failed
H.J. Lu
hjl.tools@gmail.com
Mon Oct 19 23:56:00 GMT 2009
On Mon, Oct 19, 2009 at 3:34 PM, Alan Modra <amodra@bigpond.net.au> wrote:
> 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.
>
The question is if objcopy should preserve the permission bits. Do we
really mark all DSOs with the X bit?
--
H.J.
More information about the Binutils
mailing list