[PATCH v4 00/10] fix ifunc with static pie [BZ #27072]

H.J. Lu hjl.tools@gmail.com
Tue Jan 19 21:38:16 GMT 2021


On Tue, Jan 19, 2021 at 12:16 PM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 19/01/2021 16:41, H.J. Lu wrote:
> > On Tue, Jan 19, 2021 at 10:25 AM Szabolcs Nagy via Libc-alpha
> > <libc-alpha@sourceware.org> wrote:
> >>
> >> The 01/18/2021 18:37, Adhemerval Zanella wrote:
> >>> As a side note I tried your branch with a build for all support Linux
> >>> ABIs and it as least improves by issuing an error on architectures
> >>> where previously indicated support static-pie but it is broken in practice
> >>> (powerpc for instance [1])
> >>>
> >>> So currently static-pie are support for all architectures, however it
> >>> fails to build for:
> >>>
> >>> alpha-linux-gnu
> >>> arc-linux-gnuhf
> >>> hppa-linux-gnu
> >>> ia64-linux-gnu
> >>> m68k-linux-gnu
> >>> microblaze-linux-gnu
> >>> riscv32-linux-gnu-rv32imafdc-ilp32d
> >>> riscv64-linux-gnu-rv64imafdc-lp64d
> >>> s390-linux-gnu
> >>> sparc64-linux-gnu
> >>> sparcv9-linux-gnu
> >>>
> >>> By requiring PI_STATIC_AND_HIDDEN hppa, m68, microblaze, mips, nios2,
> >>> and powerpc fail at configure.  Some architecture still fails at build:
> >>>
> >>> alpha-linux-gnu
> >>> arc-linux-gnuhf
> >>> riscv32-linux-gnu-rv32imafdc-ilp32d
> >>> riscv64-linux-gnu-rv64imafdc-lp64d
> >>> s390-linux-gnu
> >>> sparc64-linux-gnu
> >>> sparcv9-linux-gnu
> >>>
> >>> I haven't checked if mips is currently broken for static-pie (since
> >>> as for powerpc, it does not define PI_STATIC_AND_HIDDEN); but I would
> >>> expect so.
> >>>
> >>> It would be good if we could avoid building the broken configuration
> >>> and warn it on configure, but I don't think this should be a blocker.
> >>> The NEWS for 2.27 states this features is only supported for x86
> >>> and aarch64, so I wonder if would be better to just enable it for
> >>> the supported architectures instead of relying on PI_STATIC_AND_HIDDEN.
> >>
> >> i randomly checked alpha, which fails while linking sln:
> >>
> >> elf/dl-reloc-static-pie.c:40: undefined reference to `_DYNAMIC'
> >>
> >> i think this should be possible to configure test in case others
> >> targets fail in a similar way.
> >>
> >
> > Linker must be fixed to support static PIE:
> >
> > https://sourceware.org/bugzilla/show_bug.cgi?id=22269
> > https://sourceware.org/bugzilla/show_bug.cgi?id=22263
> > https://sourceware.org/bugzilla/show_bug.cgi?id=21252
>
> My question is which is the correct way to check at configure time
> for this support? Currently this patchset added the PI_STATIC_AND_HIDDEN,
> which is set by each configure snipper within glibc.

Add and define SUPPORT_STATIC_PIE for x86 and aarch64.   Other
targets can opt-in.

-- 
H.J.


More information about the Libc-alpha mailing list