This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: PING^N: [PATCH] Add --enable-static-pie to build static PIE [BZ #19574]


On Thu, 30 Nov 2017, H.J. Lu wrote:

> > However overall all these MIPS relocations are strictly non-PIC ones, so
> > clearly this code has not been correctly built.
> 
> That is MIPS specific issue.  It could be bfd_link_pic vs bfd_link_executable
> in MIPS linker backend.

 Well, these relocations are produced by GAS, which obviously has nothing 
to do with linking.  You need to find a way for them not to be produced in 
the first place, as they are not valid in a PIE executable link.

> >  AFAICT you need to pass -DPIC to GCC when assembling sysdeps/mips/start.S
> > to get a position-independent intermediate object.  The same applies to
> > our other MIPS assembly sources.
> 
> Everything is compiled with -fPIE -DPIC:
> 
> +ifeq (yes,$(enable-static-pie))
> +pic-default = -DPIC
> +pie-default = $(pie-ccflag)
> +ifeq (yes,$(have-static-pie))
> +default-pie-ldflag = -static-pie
> +else
> +default-pie-ldflag = -Wl,-pie,--no-dynamic-linker,--eh-frame-hdr,-z,text
> +endif
> +endif

 Well, that doesn't prove that these options actually make it to the GCC 
invocation line for say rcrt1.o.  Quoting the actual line for rcrt1.o from 
a build log would be more useful.

  Maciej


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