From e26ed573b62f69d9813e72fda4ee3da6eaf4d7b7 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Fri, 5 Jan 2007 10:20:37 +0000 Subject: Support SecurePLTs for PowerPC. You need a toolchain that supports 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. --- ldso/ldso/powerpc/dl-startup.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ldso/ldso/powerpc/dl-startup.h') diff --git a/ldso/ldso/powerpc/dl-startup.h b/ldso/ldso/powerpc/dl-startup.h index becfa191e..a5a8a83f2 100644 --- a/ldso/ldso/powerpc/dl-startup.h +++ b/ldso/ldso/powerpc/dl-startup.h @@ -16,8 +16,15 @@ asm( " bl _dl_start@local\n" /* Perform relocation */ /* Save the address of the apps entry point in CTR register */ " mtctr 3\n" /* application entry point */ +#ifdef HAVE_ASM_PPC_REL16 + " bcl 20,31,1f\n" + "1: mflr 31\n" + " addis 31,31,_GLOBAL_OFFSET_TABLE_-1b@ha\n" + " addi 31,31,_GLOBAL_OFFSET_TABLE_-1b@l\n" +#else " bl _GLOBAL_OFFSET_TABLE_-4@local\n" /* Put our GOT pointer in r31, */ " mflr 31\n" +#endif " addi 1,1,16\n" /* Restore SP */ " lwz 7,_dl_skip_args@got(31)\n" /* load EA of _dl_skip_args */ " lwz 7,0(7)\n" /* Load word from _dl_skip_args */ -- cgit v1.2.3