]> git.ipfire.org Git - thirdparty/glibc.git/commit
aarch64: fix start code for static pie
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 17 Nov 2017 10:45:32 +0000 (10:45 +0000)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Mon, 18 Dec 2017 10:07:07 +0000 (10:07 +0000)
commit14d886edbd3d80b771e1c42fbd9217f9074de9c6
treeeba41cf54321dfa4b27a3fa06cc10808a0161d35
parent7d38eb38977980efe703eac93645b1af5a5f8a0c
aarch64: fix start code for static pie

There are three flavors of the crt startup code:

1) crt1.o used for non-pie,
2) Scrt1.o used for dynamic linked pie (dynamic linker relocates),
3) rcrt1.o used for static linked pie (self relocation is needed)

In the --enable-static-pie case crt1.o is built with -DPIC and in case
of static linking it interposes _dl_relocate_static_pie in libc to
avoid self relocation.

Scrt1.o is built with -DPIC -DSHARED and it relies on GOT entries that
the static linker cannot relax and thus need relocation before the
start code is executed, so rcrt1.o needs separate implementation.

This implementation does not work for .text > 4G position independent
executables, which is fine since the toolchain does not support
-mcmodel=large with -fPIE.

Tests pass with ld/22269 and ld/22263 binutils bugs fixed.

* sysdeps/aarch64/start.S (_start): Handle PIC && !SHARED case.
ChangeLog
sysdeps/aarch64/start.S