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]

Some tweaks for powerpc64-linux


This patch tweaks a few things for powerpc64-linux, most notably to
symbols exported from libgcc_s.so.  On powerpc64-linux, we want a
shared lib that provides a function "foo" to export both "foo", the
function descriptor sym, and ".foo", the function code sym.  The
reason we need ".foo" is so that references to ".foo" are satisfied
during the early stages of linking.  Otherwise the linker might
decide to pull in a definition for ".foo" from some other object,
eg. a static library.

gcc/ChangeLog
	* config/rs6000/t-linux64: New.
	* config.gcc (powerpc64-*-linux*): Use t-linux64.
	* mklibgcc.in (SHLIB_MKMAP_OPTS): New variable.
	* mkmap-symver.awk (dotsyms): If set, output .foo as well as foo.

OK for mainline and branch?

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

diff -urpN -xCVS -x*~ -xTAGS gcc-ppc64-31.orig/gcc/config/rs6000/t-linux64 gcc-ppc64-31/gcc/config/rs6000/t-linux64
--- gcc-ppc64-31.orig/gcc/config/rs6000/t-linux64	Thu Jan  1 09:30:00 1970
+++ gcc-ppc64-31/gcc/config/rs6000/t-linux64	Wed Mar 20 13:53:42 2002
@@ -0,0 +1,18 @@
+# Override rs6000/t-ppcos because we don't need -fPIC or -mstrict-align
+MULTILIB_EXTRA_OPTS =
+
+# Override rs6000/t-ppccomm because we don't support -msdata
+CRTSTUFF_T_CFLAGS =
+CRTSTUFF_T_CFLAGS_S =
+
+# Override rs6000/t-ppccomm because we don't need the trampoline
+LIB2FUNCS_EXTRA =
+
+# We don't want -fPIC.
+TARGET_LIBGCC2_CFLAGS =
+
+# We don't want the fp save/restore functions either.
+LIB2FUNCS_STATIC_EXTRA =
+
+# Modify the shared lib version file
+SHLIB_MKMAP_OPTS = -v dotsyms=1
diff -urpN -xCVS -x*~ -xTAGS gcc-ppc64-31.orig/gcc/config.gcc gcc-ppc64-31/gcc/config.gcc
--- gcc-ppc64-31.orig/gcc/config.gcc	Thu Mar  7 22:30:05 2002
+++ gcc-ppc64-31/gcc/config.gcc	Wed Mar 20 13:54:42 2002
@@ -2677,7 +2677,7 @@ powerpc-*-openbsd*)
 powerpc64-*-linux*)
 	tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux64.h"
 	out_file=rs6000/rs6000.c
-	tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
+	tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm rs6000/t-linux64"
 	;;
 powerpc64-*-gnu*)
 	tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux64.h rs6000/gnu.h"
diff -urpN -xCVS -x*~ -xTAGS gcc-ppc64-31.orig/gcc/mklibgcc.in gcc-ppc64-31/gcc/mklibgcc.in
--- gcc-ppc64-31.orig/gcc/mklibgcc.in	Thu Mar  7 22:30:05 2002
+++ gcc-ppc64-31/gcc/mklibgcc.in	Wed Mar 20 13:59:21 2002
@@ -28,6 +28,7 @@
 # SHLIB_LINK
 # SHLIB_MULTILIB
 # SHLIB_MKMAP
+# SHLIB_MKMAP_OPTS
 # SHLIB_MAPFILES
 # SHLIB_NM_FLAGS
 # SHLIB_INSTALL
@@ -231,6 +232,7 @@ for file in $LIB2ADD_ST; do
 done
 
 # SHLIB_MKMAP
+# SHLIB_MKMAP_OPTS
 # SHLIB_MAPFILES
 for ml in $MULTILIBS; do
   dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
@@ -259,7 +261,7 @@ for ml in $MULTILIBS; do
     mapfile="libgcc.map"
     echo ""
     echo "${mapfile}: $SHLIB_MKMAP $SHLIB_MAPFILES $libgcc_sh_objs"
-    echo '	{ $(NM_FOR_TARGET)'" $SHLIB_NM_FLAGS $libgcc_sh_objs; echo %%; cat $SHLIB_MAPFILES; } | "'$(AWK)'" -f $SHLIB_MKMAP > "'tmp-$@'
+    echo '	{ $(NM_FOR_TARGET)'" $SHLIB_NM_FLAGS $libgcc_sh_objs; echo %%; cat $SHLIB_MAPFILES; } | "'$(AWK)'" -f $SHLIB_MKMAP $SHLIB_MKMAP_OPTS > "'tmp-$@'
     echo '	mv tmp-$@ $@'
   fi
   shlib_deps="$shlib_deps $mapfile"
diff -urpN -xCVS -x*~ -xTAGS gcc-ppc64-31.orig/gcc/mkmap-symver.awk gcc-ppc64-31/gcc/mkmap-symver.awk
--- gcc-ppc64-31.orig/gcc/mkmap-symver.awk	Thu Aug 23 23:05:55 2001
+++ gcc-ppc64-31/gcc/mkmap-symver.awk	Wed Mar 20 13:56:52 2002
@@ -92,7 +92,11 @@ function output(lib) {
   printf("  global:\n");
   for (sym in ver)
     if ((ver[sym] == lib) && (sym in def))
-      printf("\t%s;\n", sym);
+      {
+	printf("\t%s;\n", sym);
+	if (dotsyms)
+	  printf("\t.%s;\n", sym);
+      }
 
   if (inherit[lib])
     printf("} %s;\n", inherit[lib]);


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