This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems with objcopy and PIE


lÃr 2009-10-17 klockan 12:16 -0700 skrev H.J. Lu:
> On Sat, Oct 17, 2009 at 12:18 AM, Peter Hjalmarsson <xake@rymdraket.net> wrote:
> > In the manpage for objcopy it says:
> >
> > "Note that objcopy should be able to copy a fully linked file between
> > any two formats. However, copying a relocatable  object  file  between
> > any  two  formats  may  not work as expected."
> >
> > Now I have an little issue with objcopy and my question is if this is
> > something that is expected or if this is a bug in objcopy.
> > Here is the problem in commands and output.
> > Notice how for the first round tmp and tmp2 got the same permissions,
> > while when compiled with "-fPIE -pie" they have not:
> >
> >
> > $ echo "main(){}" > tmp.c && gcc -o tmp tmp.c && objcopy tmp tmp2 && ls
> > -l tmp tmp2
> > -rwxr-xr-x 1 xake xake 8081 17 okt 09.12 tmp
> > -rwxr-xr-x 1 xake xake 8081 17 okt 09.12 tmp2
> >
> > $ echo "main(){}" > tmp.c && gcc -fPIE -pie -o tmp tmp.c && objcopy tmp
> > tmp2 && ls -l tmp tmp2
> > -rwxr-xr-x 1 xake xake 8133 17 okt 09.13 tmp
> > -rw-r--r-- 1 xake xake 8133 17 okt 09.13 tmp2
> >
> >
> 
> It is a bug.  Please open a bug report at:
> 
> http://www.sourceware.org/bugzilla/
> 
> Thanks.
> 
> 

Thank you for your answer.

Bug filed as http://sourceware.org/bugzilla/show_bug.cgi?id=10802


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]