This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PPC shared libgcc buglet fix
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] PPC shared libgcc buglet fix
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Tue, 6 Nov 2001 20:38:45 +0100
Hi,
this patch fixes a small buglet on powerpc-linux-gnu that prevents a shared
libgcc from working due to the branch to abort() having the wrong relocation
type. A quick-and-dirty version of this patch is in use for a long time,
nevertheless I bootstrapped this version without regressions. I named the
macro after a similar one in glibc.
OK for mainline and branch?
Franz.
* ginclude/ppc-asm.h (JUMP_TARGET): New macro.
* config/rs6000/tramp.asm: Use it.
Index: gcc/ginclude/ppc-asm.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ginclude/ppc-asm.h,v
retrieving revision 1.4
diff -u -p -r1.4 ppc-asm.h
--- gcc/ginclude/ppc-asm.h 2001/08/13 17:37:17 1.4
+++ gcc/ginclude/ppc-asm.h 2001/11/06 19:43:02
@@ -105,6 +105,7 @@
#if defined(_CALL_AIXDESC)
#define FUNC_NAME(name) GLUE(.,name)
+#define JUMP_TARGET(name) FUNC_NAME(name)
#define FUNC_START(name) \
.section DESC_SECTION,"aw"; \
name: \
@@ -123,6 +124,7 @@ GLUE(.L,name): \
#elif defined(__WINNT__)
#define FUNC_NAME(name) GLUE(..,name)
+#define JUMP_TARGET(name) FUNC_NAME(name)
#define FUNC_START(name) \
.pdata; \
.align 2; \
@@ -141,6 +143,7 @@ GLUE(FE_MOT_RESVD..,name):
#elif defined(_CALL_NT)
#define FUNC_NAME(name) GLUE(..,name)
+#define JUMP_TARGET(name) FUNC_NAME(name)
#define FUNC_START(name) \
.section DESC_SECTION,"aw"; \
name: \
@@ -176,6 +179,11 @@ GLUE(.L,name): \
#else
#define FUNC_NAME(name) GLUE(__USER_LABEL_PREFIX__,name)
+#if defined __PIC__ || defined __pic__
+#define JUMP_TARGET(name) FUNC_NAME(name@plt)
+#else
+#define JUMP_TARGET(name) FUNC_NAME(name)
+#endif
#define FUNC_START(name) \
.type FUNC_NAME(name),@function; \
.globl FUNC_NAME(name); \
Index: gcc/config/rs6000/tramp.asm
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/tramp.asm,v
retrieving revision 1.3
diff -u -p -r1.3 tramp.asm
--- gcc/config/rs6000/tramp.asm 2000/03/16 03:16:41 1.3
+++ gcc/config/rs6000/tramp.asm 2001/11/06 19:43:02
@@ -104,6 +104,6 @@ FUNC_START(__trampoline_setup)
blr
.Labort:
- bl FUNC_NAME(abort)
+ bl JUMP_TARGET(abort)
FUNC_END(__trampoline_setup)