EABI functions like __aeabi_f2ulz are defined as aliases of standard
libgcc functions like __fixunssfdi.  In libgcc.a, the standard function
gets the correct hidden visibility, but the alias retains default
visibility.  This means that DSOs linked against libgcc.a may end
up exporting the libgcc.a definition of __aeabi_f2ulz.

The bug is that bpabi-lib.h uses an asm statement to define an alias,
so the standard ways of forcing hidden visibility at the C level have
no effect.  Fixed by using attributes instead.

Tested on arm-linux-gnueabi.  Also tested by making sure that libgcc.a
defined no default-visibility symbols.  OK for trunk?

What about release branches?  I suppose this isn't a regression,
but it is a backwards-compatible ABI fix.

Richard


libgcc/
        PR target/50090
        * config/arm/bpabi-lib.h (RENAME_LIBRARY): Use a C-level alias
        instead of an assembly one.

Index: libgcc/config/arm/bpabi-lib.h
===================================================================
--- libgcc/config/arm/bpabi-lib.h       2011-08-15 16:46:13.000000000 +0100
+++ libgcc/config/arm/bpabi-lib.h       2011-08-15 16:50:39.052030640 +0100
@@ -28,9 +28,8 @@ #define RENAME_LIBRARY_SET ".set"
 
 /* Make __aeabi_AEABI_NAME an alias for __GCC_NAME.  */
 #define RENAME_LIBRARY(GCC_NAME, AEABI_NAME)           \
-  __asm__ (".globl\t__aeabi_" #AEABI_NAME "\n"         \
-          RENAME_LIBRARY_SET "\t__aeabi_" #AEABI_NAME  \
-            ", __" #GCC_NAME "\n");
+  typeof (__##GCC_NAME) __aeabi_##AEABI_NAME \
+    __attribute__((alias ("__" #GCC_NAME)));
 
 /* Give some libgcc functions an additional __aeabi name.  */
 #ifdef L_muldi3

Reply via email to