[PATCH][RFC] aarch64: fix start code for static pie
Szabolcs Nagy
szabolcs.nagy@arm.com
Fri Nov 24 12:39:00 GMT 2017
with upcoming static pie patches there are three flavors of the crt startup code:
1) crt1.o used for non-pie static linking (executable has no relocs),
2) Scrt1.o used for dynamic linking (dynamic linker relocates),
3) rcrt1.o used for static pie linking (self relocation is needed)
when crt1.o and rcrt1.o is built in the --enable-static-pie case -DPIC is passed,
when Scrt1.o is built then -DPIC -DSHARED is passed.
(crt1.o gets a dummy _dl_relocate_static_pie that interposes the one in
libc so no self-relocation is done in that case in __libc_start_main)
the Scrt1.o code is position independent but it relies on GOT entries that
need to be relocated which happens later and the static linker cannot relax
the GOT loads, so rcrt1.o needs separate implementation.
This implementation works with .text <= 4G files, which is fine, currently
the toolchain does not support larger position independent executables.
tests pass with ld/22269 and ld/22263 binutils bugs fixed.
this patch is on top of master but assumes the static pie patches.
2017-11-24 Szabolcs Nagy <szabolcs.nagy@arm.com>
* sysdeps/aarch64/start.S (_start): Handle PIC && !SHARED case.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: static-pie-start.diff
Type: text/x-patch
Size: 753 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20171124/7bfa294e/attachment.bin>
More information about the Libc-alpha
mailing list