diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2015-12-03 00:10:57 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2015-12-03 00:10:57 +0000 |
commit | 4bced8674ece4f9d2ac299c702ca6b0ce445f024 (patch) | |
tree | 98b0c907e41482f53a2b2079bef6b419bc5e68a0 /lib/csu | |
parent | 4de68fe96ca5aeb0ae05c52543409c56d13523f0 (diff) | |
download | FreeBSD-src-4bced8674ece4f9d2ac299c702ca6b0ce445f024.zip FreeBSD-src-4bced8674ece4f9d2ac299c702ca6b0ce445f024.tar.gz |
Provide support for ELFv2 userland if using a newer compiler (recent clang
or gcc) and binutils >= 2.24. Not enabled by default.
Diffstat (limited to 'lib/csu')
-rw-r--r-- | lib/csu/powerpc64/crti.S | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/lib/csu/powerpc64/crti.S b/lib/csu/powerpc64/crti.S index 767d920..00a1242 100644 --- a/lib/csu/powerpc64/crti.S +++ b/lib/csu/powerpc64/crti.S @@ -26,34 +26,59 @@ #include <machine/asm.h> __FBSDID("$FreeBSD$"); +#ifdef _CALL_ELF +.abiversion _CALL_ELF +#endif + .section .init,"ax",@progbits - .align 2 + .p2align 2 .globl _init +#if !defined(_CALL_ELF) || _CALL_ELF == 1 .section ".opd","aw" - .align 3 + .p2align 3 _init: .quad .L._init,.TOC.@tocbase,0 .previous .type _init,@function - .align 4 + .p2align 4 .L._init: +#else + .p2align 4 + .globl _init + .type _init,@function +_init: + addis %r2, %r12, (.TOC.-_init)@ha + addi %r2, %r2, (.TOC.-_init)@l + .localentry _init, .-_init +#endif stdu 1,-48(1) mflr 0 std 0,64(1) +/* Fini */ .section .fini,"ax",@progbits - .align 2 + .p2align 2 .globl _fini +#if !defined(_CALL_ELF) || _CALL_ELF == 1 .section ".opd","aw" - .align 3 + .p2align 3 _fini: .quad .L._fini,.TOC.@tocbase,0 .previous .type _fini,@function - .align 4 + .p2align 4 .L._fini: +#else + .p2align 4 + .globl _fini + .type _fini,@function +_fini: + addis %r2, %r12, (.TOC.-_fini)@ha + addi %r2, %r2, (.TOC.-_fini)@l + .localentry _fini, .-_fini +#endif stdu 1,-48(1) mflr 0 std 0,64(1) |