From 67e184efcf88f28aa3c0a3cc9d132e99993e8046 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Wed, 17 Nov 2004 12:29:10 +0000 Subject: Make __builtin_return_address() return NULL at top of stack frame. This will make backtracing possible. --- libc/sysdeps/linux/powerpc/crt0.S | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libc') diff --git a/libc/sysdeps/linux/powerpc/crt0.S b/libc/sysdeps/linux/powerpc/crt0.S index 4be3e6414..fc77bdc99 100644 --- a/libc/sysdeps/linux/powerpc/crt0.S +++ b/libc/sysdeps/linux/powerpc/crt0.S @@ -50,6 +50,10 @@ _start: /* Save the stack pointer, in case we're statically linked under Linux. */ mr r9,r1 +#if defined L_Scrt0 || defined L_Scrt1 + bl _GLOBAL_OFFSET_TABLE_-4@local + mflr r31 +#endif /* Set up an initial stack frame, and clear the LR. */ clrrwi r1,r1,4 li r0,0 @@ -66,28 +70,24 @@ _start: addi r5,r5,1 rlwinm r5,r5,2,0,29 add r5,r5,r4 -#if defined L_Scrt0 || defined L_Scrt1 - bl _GLOBAL_OFFSET_TABLE_-4@local - mflr r31 -#endif /* Ok, now run uClibc's main() -- shouldn't return */ #if (defined L_crt1 || defined L_Scrt1) && defined __UCLIBC_CTOR_DTOR__ # ifdef L_Scrt1 lwz r6,_init@got(r31) lwz r7,_fini@got(r31) - bl __uClibc_start_main@plt + b __uClibc_start_main@plt # else lis r6,_init@ha # load top 16 bits addi r6,r6,_init@l # load bottom 16 bits lis r7,_fini@ha # load top 16 bits of &msg addi r7,r7,_fini@l # load bottom 16 bits - bl __uClibc_start_main + b __uClibc_start_main # endif #else # ifdef L_Scrt0 - bl __uClibc_main@plt + b __uClibc_main@plt # else - bl __uClibc_main + b __uClibc_main # endif #endif .size _start,.-_start -- cgit v1.2.3