summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/powerpc/crt1.S
AgeCommit message (Collapse)Author
2022-10-14Static pie support for ppclinted
Modified config files and crt1.S to support static pie elf generation. Signed-off-by: linted <linted@users.noreply.github.com>
2021-06-04powerpc: fix PIE/PIC builds with newer gcc/binutils which use secureplt by ↵Yann Sionneau
default This patch fixes segfault of all user space processes (including init, which caused a panic) on recent buildroot powerpc32 builds. The issue has been reported by Romain Naour in this thread: https://mailman.uclibc-ng.org/pipermail/devel/2021-May/002068.html Recent buildroot toolchain enables secure PLT in powerpc gcc. The latter will then supply -msecure-plt to gas invocations by default. Recent buildroot also enables PIE by defaults. For the secure PLT to work in PIC, the r30 register needs to point to the GOT. Old "bss plt" was just a one-instruction-wide PLT slot, pointed-to by a R_PPC_JMP_SLOT relocation, which was written on-the-fly to contain a branch instruction to the correct address. It therefore had to stay writable. New secure PLT only contains read-only code which loads the branch address from the writable GOT. Note: secure PLT without PIC does not need r30 to be set. Because offset between plt stub code and got is known at link-time. In this case the PLT entry looks like: 1009b3e0 <__uClibc_main@plt>: 1009b3e0: 3d 60 10 0e lis r11,4110 1009b3e4: 81 6b 03 74 lwz r11,884(r11) 1009b3e8: 7d 69 03 a6 mtctr r11 1009b3ec: 4e 80 04 20 bctr Whereas secure PLT with PIC - offset between plt and got is unknown at link-time - looks like this: 000af800 <00000000.plt_pic32.__uClibc_main>: af800: 81 7e 03 80 lwz r11,896(r30) af804: 7d 69 03 a6 mtctr r11 af808: 4e 80 04 20 bctr af80c: 60 00 00 00 nop Signed-off-by: Yann Sionneau <yann@sionneau.net>
2012-11-18Replace FSF snail mail address with URLsMike Frysinger
This matches a similar change made to glibc. No functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2007-03-31Update comment regarding passing dl_fini.Joakim Tjernlund
2007-03-29Revert last change until we figure out the correct fix.Rob Landley
2007-03-28Make the code match the comments. (I narrowed down the bug, Khem Raj Rob Landley
pointed out the solution. This fixes a segfault for me on exit from a statically linked "hello world".)
2007-03-19Joseph S. Myers writes:Joakim Tjernlund
On PowerPC, r13 is used for a small data pointer and needs to be set up from _SDA_BASE_ (defined by the linker) at startup. This is needed for the GCC testcase gcc.target/powerpc/980827-1.c to work. This patch fixes that testcase (verified for both static and dynamic linking).
2007-01-05Support SecurePLTs for PowerPC. You need a toolchain that supportsJoakim Tjernlund
config option --enable-secureplt. The assembler must also supports R_PPC_REL16* relocations. gcc 4.1.1 and binutils 2.17 is known to do this.
2005-12-15Fix static apps on linux 2.6. Linux clobbers r7 in 2.6, soJoakim Tjernlund
use r3 instead to pass _dl_fini.
2005-06-29declare init/fini as weak if __UCLIBC_CTOR_DTOR__ is turned offJoakim Tjernlund
2005-06-26stack_end in __uClibc_main must point to where argc is.Joakim Tjernlund
2005-06-25Change L_Scrt1 to __PIC__Joakim Tjernlund
2005-05-28Add Peter Mazinger fini/crt compat patch. Select DL_FINI_CRT_COMPAT toJoakim Tjernlund
be able to run apps built with 0.9.27. This also renames __uClibc_start_main to __uClibc_main. This compat option should be removed some time after 0.9.28 is released. Let me know if you don't like this change.
2005-05-26Pass the aligned stack ptr, not the unaligned.Joakim Tjernlund
2005-05-26Fix PPC wrt new __uClibc_start_main.Joakim Tjernlund
2005-05-26Fix "off by one" bug.Joakim Tjernlund
2005-05-25Adapt startup code in x86 and PPC to almost match glibc. _init vs. ↵Joakim Tjernlund
__libc_csu_init and _fini vs. __libc_csu_fini remains to do.
2005-05-21Update PowerPC to new ABI.Joakim Tjernlund