This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

3.4 PATCH: Disable .hidden support without GNU ld


While testing a fix for PR target/12101, I tried to bootstrap mainline on
Solaris 9/Intel with gas 2.14 and the native ld.  Initially, the build
failed since libgcc_s.so.1 didn't link:

ld: fatal: symbol `__i686.get_pc_thunk.bx' is multiply-defined:
	(file ./crtbegin.o type=FUNC; file libgcc/./_floatdisf.o type=FUNC);

  and many more

Building crtbegin.o and _floatdisf.o with -save-temps, it turns out that
the two definitions are

	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
.globl __i686.get_pc_thunk.bx
	.hidden	__i686.get_pc_thunk.bx
	.type	__i686.get_pc_thunk.bx, @function
__i686.get_pc_thunk.bx:
	movl	(%esp), %ebx
	ret

Obviously, the native linker cannot handle .hidden.  As far as I can see,
almost no vendor ELF linker can do so yet, so I suggest the following patch
to avoid the problem for the moment.

This may change in the future: e.g. /opt/SUNWspro/bin/fbe (identical to
/usr/ccs/bin/as, but newer than the Solaris 9 as) from Sun's recent SunONE
Studio Compiler Collection 8.0 does handle .hidden, as does Solaris 10 as
(which seems to be identical to the fbe above).  Up to Solaris 9, the
native ld does not; again, this seems to have changed in Solaris 10.

Since this is obviously hard to feature-test for (the equivalent test for
support in GNU ld is by version only), I think it's safest to disable with
native/vendor linkers by default and only enable again when support has
been verified.

This allowed me to finish the bootstrap above without regressions.

Ok for mainline?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Tue Sep  2 23:16:06 2003  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* configure.in (gcc_cv_ld_hidden): Disable unless using GNU ld.
	* configure: Regenerate.
	
Index: gcc/configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.721
diff -u -p -r1.721 configure.in
--- gcc/configure.in	31 Aug 2003 19:37:18 -0000	1.721
+++ gcc/configure.in	3 Sep 2003 00:00:30 -0000
@@ -1858,19 +1858,10 @@ changequote(,)dnl
 changequote([,])dnl
     fi
   else
-    case "$target" in
-      mips-sgi-irix[[56]]*)
-        if test x"$gnu_ld_flag" = x"no"; then
-          # Even if using gas with .hidden support, the resulting object files
-          # cannot be linked with the IRIX 5 and IRIX 6 O32 linkers.  With
-          # the IRIX 6 N32 and N64 linkers, the problem is that the linker
-          # refuses to accept -call_shared (passed by default to the
-          # linker) and -r (used to link the object file generated without
-          # .hidden directives with one that hides symbols), so we also lose.
-          gcc_cv_ld_hidden=no
-        fi
-     ;;
-    esac
+    # non-GNU linkers don't seem to support .hidden yet
+    if test x"$gnu_ld_flag" = x"no"; then
+      gcc_cv_ld_hidden=no
+    fi
   fi
 fi])
 libgcc_visibility=no


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]