[uclibc-ng-devel] -static-pie and FDPIC
christophe.lyon at linaro.org
Mon May 27 08:46:36 CEST 2019
On Fri, 24 May 2019 at 12:07, Waldemar Brodkorb <wbx at uclibc-ng.org> wrote:
> Hi Christophe,
> Christophe Lyon wrote,
> > Hi,
> > My recent attempt at submitting the GCC patch series to add FDPIC
> > support for arm triggered a discussion about -static-pie support ,
> > which continued on IRC.
> > The patch currently supports -static but the resulting binary still
> > needs the dynamic linker to prepare the parameters for __self_reloc,
> > and there are arguments that a static binary should not have a
> > PT_INTERP field.
> > At present, musl supports -static-pie for sh+FDPIC only.
> > I think other uclibc-ng targets with FDPIC (frv, bfin) do not support
> > -static, but I'm not sure how to build such toolchains, nor if they
> > are still supported.
> > It seems I have several options:
> > (a) add support for static-pie to uclibc-ng. This means creating a new
> > rcrt1.o or similar, which would embed parts of the dynamic linker into
> > static-pie executables. I'm not sure how big a task this is?
> > (b) add support for FDPIC on arm to musl, which I'm not familiar with
> > (c) declare -static not supported on arm-FDPIC
> > (d) gather consensus that -static with pt_interp is ok (my preference,
> > since that's what the current patches do :-)
> > So, my questions are:
> > - does uclibc-ng support -static on some FDPIC targets? which ones?
> > - how much work would option (a) mean?
> > - are uclibc-ng people opposed to option (d)?
> I am fine with c). As for static binaries you could use binfmt.
> I think blackfin has the same limitation for FDPIC.
Thanks, that's what the updated GCC patch does:
I'm still waiting for feedback on the whole series of GCC patches.
> best regards
More information about the devel