[uclibc-ng-devel] -static-pie and FDPIC

Waldemar Brodkorb wbx at uclibc-ng.org
Fri May 24 12:07:38 CEST 2019

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 [1],
> 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.

best regards

More information about the devel mailing list