summaryrefslogtreecommitdiff
path: root/patches/gcc/3.3.2
diff options
context:
space:
mode:
Diffstat (limited to 'patches/gcc/3.3.2')
-rw-r--r--patches/gcc/3.3.2/empty6.patch21
-rw-r--r--patches/gcc/3.3.2/gcc-3.2.3-g++.exp.patch100
-rw-r--r--patches/gcc/3.3.2/gcc-3.3-libstdc++-v3-dg.exp.patch54
-rw-r--r--patches/gcc/3.3.2/gcc-3.3.2-arm-bigendian.patch65
-rw-r--r--patches/gcc/3.3.2/gcc-3.3.2-trap-posix.patch44
l---------patches/gcc/3.3.2/pr10392-1-test.patch1
l---------patches/gcc/3.3.2/pr10412-1-test.patch1
l---------patches/gcc/3.3.2/pr10589-1-test.patch1
l---------patches/gcc/3.3.2/pr11162-1-test.patch1
l---------patches/gcc/3.3.2/pr11587-1-test.patch1
-rw-r--r--patches/gcc/3.3.2/pr11608-fix.patch31
l---------patches/gcc/3.3.2/pr11736-1-test.patch1
l---------patches/gcc/3.3.2/pr11864-1-test.patch1
-rw-r--r--patches/gcc/3.3.2/pr13260-test.patch56
l---------patches/gcc/3.3.2/pr9365-1-test.patch1
-rw-r--r--patches/gcc/3.3.2/sh-lib1funcs_sizeAndType.patch610
-rw-r--r--patches/gcc/3.3.2/sh-libgcc-hidden.patch122
-rw-r--r--patches/gcc/3.3.2/sh-pic-set_fpscr-gcc-3.3.2.patch67
-rw-r--r--patches/gcc/3.3.2/thunk3.patch23
19 files changed, 1201 insertions, 0 deletions
diff --git a/patches/gcc/3.3.2/empty6.patch b/patches/gcc/3.3.2/empty6.patch
new file mode 100644
index 0000000..1b0715c
--- /dev/null
+++ b/patches/gcc/3.3.2/empty6.patch
@@ -0,0 +1,21 @@
+From 3.4 branch. Fixes test failure
+FAIL: g++.dg/abi/empty6.C (test for warnings, line 6)
+
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/abi/empty6.C,v
+retrieving revision 1.1
+retrieving revision 1.2
+diff -u -r1.1 -r1.2
+--- gcc/gcc/testsuite/g++.dg/abi/empty6.C 2002/09/25 19:07:35 1.1
++++ gcc/gcc/testsuite/g++.dg/abi/empty6.C 2003/06/03 19:10:09 1.2
+@@ -5,4 +5,9 @@
+ struct B {
+ A a; // { dg-warning "empty" }
+ virtual void f () {}
+-};
++} __attribute__((aligned(8)));
++/* The preceding attribute is necessary on targets with
++ BIGGEST_ALIGNMENT <= 32 to trigger the warning, as otherwise a 32 bit
++ offset is split into DECL_FIELD_OFFSET 4 and DECL_FIELD_BIT_OFFSET 0,
++ and then there is no discrepancy between DECL_FIELD_OFFSET and
++ byte_position to warn about. */
diff --git a/patches/gcc/3.3.2/gcc-3.2.3-g++.exp.patch b/patches/gcc/3.3.2/gcc-3.2.3-g++.exp.patch
new file mode 100644
index 0000000..fb8e4f0
--- /dev/null
+++ b/patches/gcc/3.3.2/gcc-3.2.3-g++.exp.patch
@@ -0,0 +1,100 @@
+See http://gcc.gnu.org/PR12010
+
+g++ testsuite fixes for cross-compilers, Dan Kegel, Ixia Communications, 12 July 2003
+
+The first hunk fixes the error
+
+/testsuite_flags: /testsuite_flags: No such file or directory
+ while executing
+"exec sh ${odir_v3}/testsuite_flags --build-includes"
+ (procedure "g++_include_flags" line 21)
+ invoked from within
+"g++_include_flags [get_multilibs] "
+ (procedure "g++_init" line 63)
+ invoked from within
+"${tool}_init $test_file_name"
+ (procedure "runtest" line 19)
+ invoked from within
+"runtest $test_name"
+ ("foreach" body line 42)
+ invoked from within
+...
+make[1]: [check-g++] Error 1 (ignored)
+
+The fix isn't especially pretty, but it worked for me, and can't hurt the
+more common native compiler case. Maybe someone who knows the code better
+can come up with a better fix.
+
+The second hunk fixes the error
+
+sh: error while loading shared libraries: /opt/cegl-2.0/powerpc-405-linux-gnu/gcc-3.2.3-glibc-2.2.5/powerpc-405-linux-gnu/./lib/libdl.so.2: ELF file data encoding not little-endian
+
+when trying to compile g++ testcases (!); setting up
+the shared library environment when running crosstests of g++
+should either be done by a special board file, or by
+setting up a remote chroot environment (see http://kegel.com/crosstool),
+not by blithely setting LD_LIBRARY_PATH on the local system.
+
+--- gcc-3.2.3/gcc/testsuite/lib/g++.exp.old Fri Jul 11 15:42:47 2003
++++ gcc-3.2.3/gcc/testsuite/lib/g++.exp Sat Jul 12 12:57:07 2003
+@@ -72,6 +72,8 @@
+ #
+ proc g++_include_flags { paths } {
+ global srcdir
++ global objdir
++ global target_triplet
+ global HAVE_LIBSTDCXX_V3
+ global TESTING_IN_BUILD_TREE
+
+@@ -90,6 +92,20 @@
+
+ if { ${HAVE_LIBSTDCXX_V3} } {
+ set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
++ if { $odir_v3 == "" } {
++ verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir"
++ # first assume no multilibs
++ set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
++ }
++ if { $odir_v3 == "" } {
++ verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib"
++ # assume multilib only one level deep
++ set multisub [file tail $gccpath]
++ set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
++ }
++ if { $odir_v3 == "" } {
++ error "Can't find libstdc++-v3"
++ }
+ append flags [exec sh ${odir_v3}/testsuite_flags --build-includes]
+ } else {
+ set odir_v2 [lookfor_file ${gccpath} libstdc++]
+@@ -192,16 +192,20 @@
+ }
+ }
+
+- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
+- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
+- # (for the 64-bit ABI). The right way to do this would be to modify
+- # unix.exp -- but that's not an option since it's part of DejaGNU
+- # proper, so we do it here. We really only need to do
+- # this on IRIX, but it shouldn't hurt to do it anywhere else.
+- setenv LD_LIBRARY_PATH $ld_library_path
+- setenv SHLIB_PATH $ld_library_path
+- setenv LD_LIBRARYN32_PATH $ld_library_path
+- setenv LD_LIBRARY64_PATH $ld_library_path
++ if {![is_remote target]} {
++ # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
++ # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
++ # (for the 64-bit ABI). The right way to do this would be to modify
++ # unix.exp -- but that's not an option since it's part of DejaGNU
++ # proper, so we do it here. We really only need to do
++ # this on IRIX, but it shouldn't hurt to do it anywhere else.
++
++ # Doing this causes us to be unable to run cross-compilers.
++ setenv LD_LIBRARY_PATH $ld_library_path
++ setenv SHLIB_PATH $ld_library_path
++ setenv LD_LIBRARYN32_PATH $ld_library_path
++ setenv LD_LIBRARY64_PATH $ld_library_path
++ }
+
+ return "$flags"
+ }
diff --git a/patches/gcc/3.3.2/gcc-3.3-libstdc++-v3-dg.exp.patch b/patches/gcc/3.3.2/gcc-3.3-libstdc++-v3-dg.exp.patch
new file mode 100644
index 0000000..aafc130
--- /dev/null
+++ b/patches/gcc/3.3.2/gcc-3.3-libstdc++-v3-dg.exp.patch
@@ -0,0 +1,54 @@
+Without this patch, the command
+
+RUNTESTFLAGS=--target=powerpc-750-linux-gnu -v -v -v -v make check-target-libstdc++-v3
+
+fails in two ways:
+1. the -L option meant to locate the testsuite directory is incorrect, and
+2. the wrong compiler is invoked, causing all sorts of havoc, not least of which
+is the native compiler is invoked when we really wanted to invoke the cross-compiler
+we just built.
+
+Here's an example log of the problem in action. Every testcase fails, this shows just one:
+-------------
+Invoking the compiler as g++ -ggdb3 -DDEBUG_ASSERT -I/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite /home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc -g -O2 -DDEBUG_ASSERT -L/testsuite -lv3test -lm -o ./binders.exe
+compiler exited with status 1
+output is:
+/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h: In method `void binder2nd<mem_fun1_ref_t<void,Elem,int> >::operator ()(const Elem &) const':^M
+/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_algo.h:83: instantiated from `for_each<Elem *, binder2nd<mem_fun1_ref_t<void,Elem,int> > >(Elem *, Elem *, binder2nd<mem_fun1_ref_t<void,Elem,int> >)'^M
+/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc:43: instantiated from here^M
+/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:224: conversion from `const Elem' to `Elem &' discards qualifiers^M
+/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:622: in passing argument 1 of `mem_fun1_ref_t<void,Elem,int>::operator ()(Elem &, int) const'^M
+...
+FAIL: 20_util/binders.cc (test for excess errors)
+WARNING: 20_util/binders.cc compilation failed to produce executable
+-------------
+
+And here's the patch. I'm not happy with it, and it probably gets some cases wrong,
+but it seems to work for the common native case and for my cross-compiler case.
+
+--- gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp.old Sun Jul 13 10:42:01 2003
++++ gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp Sun Jul 13 11:39:54 2003
+@@ -46,8 +46,23 @@
+ global gluefile wrap_flags
+ global ld_library_path
+ global tool_root_dir
++ global target_triplet
+
+ set blddir [lookfor_file [get_multilibs] libstdc++-v3]
++ if { $blddir == "" } {
++ set multilibs [get_multilibs]
++ # FIXME: assume multilib only one level deep
++ set multisub [file tail $multilibs]
++ verbose "libstdc++-v3-init: couldn't find libstdc++-v3 in $multilibs, trying $objdir"
++ set blddir [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
++ }
++ if { $blddir == "" } {
++ verbose "libstdc++-v3-init: couldn't find libstdc++-v3, trying $objdir without multilibs"
++ set blddir [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
++ }
++ if { $blddir == "" } {
++ error "Can't find libstdc++-v3"
++ }
+
+ # By default, we assume we want to run program images.
+ global dg-do-what-default
diff --git a/patches/gcc/3.3.2/gcc-3.3.2-arm-bigendian.patch b/patches/gcc/3.3.2/gcc-3.3.2-arm-bigendian.patch
new file mode 100644
index 0000000..9ec6c53
--- /dev/null
+++ b/patches/gcc/3.3.2/gcc-3.3.2-arm-bigendian.patch
@@ -0,0 +1,65 @@
+By Lennert Buytenhek <buytenh@wantstofly.org>
+Adds support for arm*b-linux* big-endian ARM targets
+
+See http://gcc.gnu.org/PR16350
+
+diff -urN gcc-3.3.2.orig/gcc/config/arm/linux-elf.h gcc-3.3.2/gcc/config/arm/linux-elf.h
+--- gcc-3.3.2.orig/gcc/config/arm/linux-elf.h 2003-09-16 17:39:23.000000000 +0200
++++ gcc-3.3.2/gcc/config/arm/linux-elf.h 2004-07-07 14:03:54.329839922 +0200
+@@ -30,15 +30,29 @@
+ /* Do not assume anything about header files. */
+ #define NO_IMPLICIT_EXTERN_C
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
++#define TARGET_ENDIAN_OPTION "mbig-endian"
++#define TARGET_LINKER_EMULATION "armelfb_linux"
++#else
++#define TARGET_ENDIAN_DEFAULT 0
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#define TARGET_LINKER_EMULATION "armelf_linux"
++#endif
++
+ /* Default is to use APCS-32 mode. */
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS | TARGET_ENDIAN_DEFAULT)
+
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
+
+ #undef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
+
+ #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
+
+@@ -86,7 +100,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
+ -X \
+- %{mbig-endian:-EB}" \
++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
+ SUBTARGET_EXTRA_LINK_SPEC
+
+ #define TARGET_OS_CPP_BUILTINS() \
+diff -urN gcc-3.3.2.orig/gcc/config.gcc gcc-3.3.2/gcc/config.gcc
+--- gcc-3.3.2.orig/gcc/config.gcc 2003-10-01 21:07:01.000000000 +0200
++++ gcc-3.3.2/gcc/config.gcc 2004-07-07 14:04:59.046716638 +0200
+@@ -699,6 +699,11 @@
+ ;;
+ arm*-*-linux*) # ARM GNU/Linux with ELF
+ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
++ case $machine in
++ arm*b-*)
++ tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
++ ;;
++ esac
+ tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ gnu_ld=yes
diff --git a/patches/gcc/3.3.2/gcc-3.3.2-trap-posix.patch b/patches/gcc/3.3.2/gcc-3.3.2-trap-posix.patch
new file mode 100644
index 0000000..c8bc2ea
--- /dev/null
+++ b/patches/gcc/3.3.2/gcc-3.3.2-trap-posix.patch
@@ -0,0 +1,44 @@
+#
+# Submitted-By: Marc Kleine-Budde <mkl@pengutronix.de>, 2005-04-20
+#
+# Error:
+#
+# creating libintl.h
+# Configuring etc...
+# loading cache ../config.cache
+# checking for a BSD compatible install... (cached) /usr/bin/install -c
+# creating ./config.status
+# creating Makefile
+# trap: usage: trap [-lp] [[arg] signal_spec ...]
+#
+# Description:
+#
+# non-posix conform usage of trap causes bash >= 3.0 to fail
+# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html
+#
+# Status:
+#
+# fixed in gcc >= 3.3.5
+# backport of gcc-3.3.5 fix
+#
+diff -ruN gcc-3.3.2-orig/configure gcc-3.3.2/configure
+--- gcc-3.3.2-orig/configure 2002-09-29 18:11:24.000000000 +0200
++++ gcc-3.3.2/configure 2005-04-20 20:55:51.000000000 +0200
+@@ -697,7 +697,7 @@
+ if test -f skip-this-dir; then
+ # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
+ # and reset the trap handler.
+- trap 0
++ trap '' 0
+ rm -rf Makefile* ${tmpdir}
+ # Execute the final clean-up actions
+ ${config_shell} skip-this-dir
+@@ -1596,7 +1596,7 @@
+ # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
+ # and reset the trap handler.
+ rm -rf ${tmpdir}
+-trap 0
++trap '' 0
+
+ exit 0
+
diff --git a/patches/gcc/3.3.2/pr10392-1-test.patch b/patches/gcc/3.3.2/pr10392-1-test.patch
new file mode 120000
index 0000000..f02b235
--- /dev/null
+++ b/patches/gcc/3.3.2/pr10392-1-test.patch
@@ -0,0 +1 @@
+../3.3.1/pr10392-1-test.patch \ No newline at end of file
diff --git a/patches/gcc/3.3.2/pr10412-1-test.patch b/patches/gcc/3.3.2/pr10412-1-test.patch
new file mode 120000
index 0000000..195d7f5
--- /dev/null
+++ b/patches/gcc/3.3.2/pr10412-1-test.patch
@@ -0,0 +1 @@
+../3.3.1/pr10412-1-test.patch \ No newline at end of file
diff --git a/patches/gcc/3.3.2/pr10589-1-test.patch b/patches/gcc/3.3.2/pr10589-1-test.patch
new file mode 120000
index 0000000..b7e0a6b
--- /dev/null
+++ b/patches/gcc/3.3.2/pr10589-1-test.patch
@@ -0,0 +1 @@
+../3.3.1/pr10589-1-test.patch \ No newline at end of file
diff --git a/patches/gcc/3.3.2/pr11162-1-test.patch b/patches/gcc/3.3.2/pr11162-1-test.patch
new file mode 120000
index 0000000..9f17500
--- /dev/null
+++ b/patches/gcc/3.3.2/pr11162-1-test.patch
@@ -0,0 +1 @@
+../3.3.1/pr11162-1-test.patch \ No newline at end of file
diff --git a/patches/gcc/3.3.2/pr11587-1-test.patch b/patches/gcc/3.3.2/pr11587-1-test.patch
new file mode 120000
index 0000000..cdb9d8e
--- /dev/null
+++ b/patches/gcc/3.3.2/pr11587-1-test.patch
@@ -0,0 +1 @@
+../3.3.1/pr11587-1-test.patch \ No newline at end of file
diff --git a/patches/gcc/3.3.2/pr11608-fix.patch b/patches/gcc/3.3.2/pr11608-fix.patch
new file mode 100644
index 0000000..b435126
--- /dev/null
+++ b/patches/gcc/3.3.2/pr11608-fix.patch
@@ -0,0 +1,31 @@
+pr11608
+
+------------
+I'm building and testing an x86->sh4 crosscompiler with http://kegel.com/crosstool
+With either gcc-3.3 or gcc-ss-3_3-20030714 I get:
+
+Testing debug/20020327-1.c, -gstabs1
+...
+FAIL: gcc.dg/debug/20020327-1.c (test for excess errors)
+Excess errors:
+/tmp/cc8dFF7Y.s: Assembler messages:
+/tmp/cc8dFF7Y.s:66: Error: symbol `Letext' is already defined
+
+------------
+
+Index: elf.h
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/config/sh/elf.h,v
+retrieving revision 1.32
+diff -u -p -r1.32 elf.h
+--- gcc-orig/gcc/config/sh/elf.h 27 Sep 2003 04:48:28 -0000 1.32
++++ gcc-new/gcc/config/sh/elf.h 2 Jan 2004 07:23:23 -0000
+@@ -95,7 +95,7 @@ while (0)
+ #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
+ do { \
+ text_section (); \
+- fprintf ((FILE), "\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO); \
++ asm_fprintf ((FILE), "\t.stabs \"\",%d,0,0,%LLetext\n%LLetext:\n", N_SO); \
+ } while (0)
+
+ #undef STARTFILE_SPEC
diff --git a/patches/gcc/3.3.2/pr11736-1-test.patch b/patches/gcc/3.3.2/pr11736-1-test.patch
new file mode 120000
index 0000000..04a0841
--- /dev/null
+++ b/patches/gcc/3.3.2/pr11736-1-test.patch
@@ -0,0 +1 @@
+../3.3.1/pr11736-1-test.patch \ No newline at end of file
diff --git a/patches/gcc/3.3.2/pr11864-1-test.patch b/patches/gcc/3.3.2/pr11864-1-test.patch
new file mode 120000
index 0000000..b40aaa0
--- /dev/null
+++ b/patches/gcc/3.3.2/pr11864-1-test.patch
@@ -0,0 +1 @@
+../3.3.1/pr11864-1-test.patch \ No newline at end of file
diff --git a/patches/gcc/3.3.2/pr13260-test.patch b/patches/gcc/3.3.2/pr13260-test.patch
new file mode 100644
index 0000000..d9cc3e4
--- /dev/null
+++ b/patches/gcc/3.3.2/pr13260-test.patch
@@ -0,0 +1,56 @@
+See http://gcc.gnu.org/PR13260
+
+/cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/20031204-1.c,v --> standard output
+revision 1.1
+--- - 1970-01-01 00:00:00.000000000 +0000
++++ gcc/gcc/testsuite/gcc.c-torture/execute/20031204-1.c
+@@ -0,0 +1,49 @@
++/* PR optimization/13260 */
++
++#include <string.h>
++
++typedef unsigned long u32;
++
++u32 in_aton(const char* x)
++{
++ return 0x0a0b0c0d;
++}
++
++u32 root_nfs_parse_addr(char *name)
++{
++ u32 addr;
++ int octets = 0;
++ char *cp, *cq;
++
++ cp = cq = name;
++ while (octets < 4) {
++ while (*cp >= '0' && *cp <= '9')
++ cp++;
++ if (cp == cq || cp - cq > 3)
++ break;
++ if (*cp == '.' || octets == 3)
++ octets++;
++ if (octets < 4)
++ cp++;
++ cq = cp;
++ }
++
++ if (octets == 4 && (*cp == ':' || *cp == '\0')) {
++ if (*cp == ':')
++ *cp++ = '\0';
++ addr = in_aton(name);
++ strcpy(name, cp);
++ } else
++ addr = (-1);
++
++ return addr;
++}
++
++int
++main()
++{
++ static char addr[] = "10.11.12.13:/hello";
++ u32 result = root_nfs_parse_addr(addr);
++ if (result != 0x0a0b0c0d) { abort(); }
++ return 0;
++}
diff --git a/patches/gcc/3.3.2/pr9365-1-test.patch b/patches/gcc/3.3.2/pr9365-1-test.patch
new file mode 120000
index 0000000..a8eee16
--- /dev/null
+++ b/patches/gcc/3.3.2/pr9365-1-test.patch
@@ -0,0 +1 @@
+../3.3.1/pr9365-1-test.patch \ No newline at end of file
diff --git a/patches/gcc/3.3.2/sh-lib1funcs_sizeAndType.patch b/patches/gcc/3.3.2/sh-lib1funcs_sizeAndType.patch
new file mode 100644
index 0000000..5c1895a
--- /dev/null
+++ b/patches/gcc/3.3.2/sh-lib1funcs_sizeAndType.patch
@@ -0,0 +1,610 @@
+Fixes the problem
+ [ libdemo.so and main.o both use assignment on structures ]
+ $ sh4-unknown-linux-gnu-gcc libdemo.so main.o
+ sh4-unknown-linux-gnu/bin/ld: warning: type and size of dynamic symbol `__movstr_i4_even' are not defined
+ [ resulting app links, but crashes at runtime ]
+See testcase at http://tsukuba.m17n.org/linux-sh/ml/linux-sh/2003-11/msg00016.html
+
+Patch was posted as http://gcc.gnu.org/ml/gcc-patches/2002-11/msg01641.html
+and is in cvs as http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sh/lib1funcs.asm.diff?r1=1.29.4.1&r2=1.29.4.2
+
+but see also sh-libgcc-hidden.patch
+
+===================================================================
+
+--- gcc/gcc/config/sh/lib1funcs.asm 2002/09/20 01:29:21 1.29.4.1
++++ gcc/gcc/config/sh/lib1funcs.asm 2003/11/18 12:27:31
+@@ -38,9 +38,14 @@
+ amylaar@cygnus.com */
+
+ #ifdef __ELF__
+-#define LOCAL(X) .L_##X
+-#else
+-#define LOCAL(X) L_##X
++#define LOCAL(X) .L_##X
++#define FUNC(X) .type X,@function
++#define ENDFUNC0(X) .Lfe_##X: .size X,.Lfe_##X-X
++#define ENDFUNC(X) ENDFUNC0(X)
++#else
++#define LOCAL(X) L_##X
++#define FUNC(X)
++#define ENDFUNC(X)
+ #endif
+
+ #define CONCAT(A,B) A##B
+@@ -87,6 +92,40 @@
+ .global GLOBAL(ashiftrt_r4_31)
+ .global GLOBAL(ashiftrt_r4_32)
+
++ FUNC(GLOBAL(ashiftrt_r4_0))
++ FUNC(GLOBAL(ashiftrt_r4_1))
++ FUNC(GLOBAL(ashiftrt_r4_2))
++ FUNC(GLOBAL(ashiftrt_r4_3))
++ FUNC(GLOBAL(ashiftrt_r4_4))
++ FUNC(GLOBAL(ashiftrt_r4_5))
++ FUNC(GLOBAL(ashiftrt_r4_6))
++ FUNC(GLOBAL(ashiftrt_r4_7))
++ FUNC(GLOBAL(ashiftrt_r4_8))
++ FUNC(GLOBAL(ashiftrt_r4_9))
++ FUNC(GLOBAL(ashiftrt_r4_10))
++ FUNC(GLOBAL(ashiftrt_r4_11))
++ FUNC(GLOBAL(ashiftrt_r4_12))
++ FUNC(GLOBAL(ashiftrt_r4_13))
++ FUNC(GLOBAL(ashiftrt_r4_14))
++ FUNC(GLOBAL(ashiftrt_r4_15))
++ FUNC(GLOBAL(ashiftrt_r4_16))
++ FUNC(GLOBAL(ashiftrt_r4_17))
++ FUNC(GLOBAL(ashiftrt_r4_18))
++ FUNC(GLOBAL(ashiftrt_r4_19))
++ FUNC(GLOBAL(ashiftrt_r4_20))
++ FUNC(GLOBAL(ashiftrt_r4_21))
++ FUNC(GLOBAL(ashiftrt_r4_22))
++ FUNC(GLOBAL(ashiftrt_r4_23))
++ FUNC(GLOBAL(ashiftrt_r4_24))
++ FUNC(GLOBAL(ashiftrt_r4_25))
++ FUNC(GLOBAL(ashiftrt_r4_26))
++ FUNC(GLOBAL(ashiftrt_r4_27))
++ FUNC(GLOBAL(ashiftrt_r4_28))
++ FUNC(GLOBAL(ashiftrt_r4_29))
++ FUNC(GLOBAL(ashiftrt_r4_30))
++ FUNC(GLOBAL(ashiftrt_r4_31))
++ FUNC(GLOBAL(ashiftrt_r4_32))
++
+ .align 1
+ GLOBAL(ashiftrt_r4_32):
+ GLOBAL(ashiftrt_r4_31):
+@@ -166,6 +205,40 @@
+ GLOBAL(ashiftrt_r4_0):
+ rts
+ nop
++
++ ENDFUNC(GLOBAL(ashiftrt_r4_0))
++ ENDFUNC(GLOBAL(ashiftrt_r4_1))
++ ENDFUNC(GLOBAL(ashiftrt_r4_2))
++ ENDFUNC(GLOBAL(ashiftrt_r4_3))
++ ENDFUNC(GLOBAL(ashiftrt_r4_4))
++ ENDFUNC(GLOBAL(ashiftrt_r4_5))
++ ENDFUNC(GLOBAL(ashiftrt_r4_6))
++ ENDFUNC(GLOBAL(ashiftrt_r4_7))
++ ENDFUNC(GLOBAL(ashiftrt_r4_8))
++ ENDFUNC(GLOBAL(ashiftrt_r4_9))
++ ENDFUNC(GLOBAL(ashiftrt_r4_10))
++ ENDFUNC(GLOBAL(ashiftrt_r4_11))
++ ENDFUNC(GLOBAL(ashiftrt_r4_12))
++ ENDFUNC(GLOBAL(ashiftrt_r4_13))
++ ENDFUNC(GLOBAL(ashiftrt_r4_14))
++ ENDFUNC(GLOBAL(ashiftrt_r4_15))
++ ENDFUNC(GLOBAL(ashiftrt_r4_16))
++ ENDFUNC(GLOBAL(ashiftrt_r4_17))
++ ENDFUNC(GLOBAL(ashiftrt_r4_18))
++ ENDFUNC(GLOBAL(ashiftrt_r4_19))
++ ENDFUNC(GLOBAL(ashiftrt_r4_20))
++ ENDFUNC(GLOBAL(ashiftrt_r4_21))
++ ENDFUNC(GLOBAL(ashiftrt_r4_22))
++ ENDFUNC(GLOBAL(ashiftrt_r4_23))
++ ENDFUNC(GLOBAL(ashiftrt_r4_24))
++ ENDFUNC(GLOBAL(ashiftrt_r4_25))
++ ENDFUNC(GLOBAL(ashiftrt_r4_26))
++ ENDFUNC(GLOBAL(ashiftrt_r4_27))
++ ENDFUNC(GLOBAL(ashiftrt_r4_28))
++ ENDFUNC(GLOBAL(ashiftrt_r4_29))
++ ENDFUNC(GLOBAL(ashiftrt_r4_30))
++ ENDFUNC(GLOBAL(ashiftrt_r4_31))
++ ENDFUNC(GLOBAL(ashiftrt_r4_32))
+ #endif
+
+ #ifdef L_ashiftrt_n
+@@ -188,6 +261,7 @@
+ !
+
+ .global GLOBAL(ashrsi3)
++ FUNC(GLOBAL(ashrsi3))
+ .align 2
+ GLOBAL(ashrsi3):
+ mov #31,r0
+@@ -315,6 +389,7 @@
+ rts
+ nop
+
++ ENDFUNC(GLOBAL(ashrsi3))
+ #endif
+
+ #ifdef L_ashiftlt
+@@ -336,6 +411,7 @@
+ ! (none)
+ !
+ .global GLOBAL(ashlsi3)
++ FUNC(GLOBAL(ashlsi3))
+ .align 2
+ GLOBAL(ashlsi3):
+ mov #31,r0
+@@ -472,6 +548,7 @@
+ rts
+ nop
+
++ ENDFUNC(GLOBAL(ashlsi3))
+ #endif
+
+ #ifdef L_lshiftrt
+@@ -493,6 +570,7 @@
+ ! (none)
+ !
+ .global GLOBAL(lshrsi3)
++ FUNC(GLOBAL(lshrsi3))
+ .align 2
+ GLOBAL(lshrsi3):
+ mov #31,r0
+@@ -629,6 +707,7 @@
+ rts
+ nop
+
++ ENDFUNC(GLOBAL(lshrsi3))
+ #endif
+
+ #ifdef L_movstr
+@@ -645,76 +724,113 @@
+ add #64,r4
+ .align 4
+ .global GLOBAL(movstrSI64)
++ FUNC(GLOBAL(movstrSI64))
+ GLOBAL(movstrSI64):
+ mov.l @(60,r5),r0
+ mov.l r0,@(60,r4)
+ .global GLOBAL(movstrSI60)
++ FUNC(GLOBAL(movstrSI60))
+ GLOBAL(movstrSI60):
+ mov.l @(56,r5),r0
+ mov.l r0,@(56,r4)
+ .global GLOBAL(movstrSI56)
++ FUNC(GLOBAL(movstrSI56))
+ GLOBAL(movstrSI56):
+ mov.l @(52,r5),r0
+ mov.l r0,@(52,r4)
+ .global GLOBAL(movstrSI52)
++ FUNC(GLOBAL(movstrSI52))
+ GLOBAL(movstrSI52):
+ mov.l @(48,r5),r0
+ mov.l r0,@(48,r4)
+ .global GLOBAL(movstrSI48)
++ FUNC(GLOBAL(movstrSI48))
+ GLOBAL(movstrSI48):
+ mov.l @(44,r5),r0
+ mov.l r0,@(44,r4)
+ .global GLOBAL(movstrSI44)
++ FUNC(GLOBAL(movstrSI44))
+ GLOBAL(movstrSI44):
+ mov.l @(40,r5),r0
+ mov.l r0,@(40,r4)
+ .global GLOBAL(movstrSI40)
++ FUNC(GLOBAL(movstrSI40))
+ GLOBAL(movstrSI40):
+ mov.l @(36,r5),r0
+ mov.l r0,@(36,r4)
+ .global GLOBAL(movstrSI36)
++ FUNC(GLOBAL(movstrSI36))
+ GLOBAL(movstrSI36):
+ mov.l @(32,r5),r0
+ mov.l r0,@(32,r4)
+ .global GLOBAL(movstrSI32)
++ FUNC(GLOBAL(movstrSI32))
+ GLOBAL(movstrSI32):
+ mov.l @(28,r5),r0
+ mov.l r0,@(28,r4)
+ .global GLOBAL(movstrSI28)
++ FUNC(GLOBAL(movstrSI28))
+ GLOBAL(movstrSI28):
+ mov.l @(24,r5),r0
+ mov.l r0,@(24,r4)
+ .global GLOBAL(movstrSI24)
++ FUNC(GLOBAL(movstrSI24))
+ GLOBAL(movstrSI24):
+ mov.l @(20,r5),r0
+ mov.l r0,@(20,r4)
+ .global GLOBAL(movstrSI20)
++ FUNC(GLOBAL(movstrSI20))
+ GLOBAL(movstrSI20):
+ mov.l @(16,r5),r0
+ mov.l r0,@(16,r4)
+ .global GLOBAL(movstrSI16)
++ FUNC(GLOBAL(movstrSI16))
+ GLOBAL(movstrSI16):
+ mov.l @(12,r5),r0
+ mov.l r0,@(12,r4)
+ .global GLOBAL(movstrSI12)
++ FUNC(GLOBAL(movstrSI12))
+ GLOBAL(movstrSI12):
+ mov.l @(8,r5),r0
+ mov.l r0,@(8,r4)
+ .global GLOBAL(movstrSI8)
++ FUNC(GLOBAL(movstrSI8))
+ GLOBAL(movstrSI8):
+ mov.l @(4,r5),r0
+ mov.l r0,@(4,r4)
+ .global GLOBAL(movstrSI4)
++ FUNC(GLOBAL(movstrSI4))
+ GLOBAL(movstrSI4):
+ mov.l @(0,r5),r0
+ mov.l r0,@(0,r4)
++ .global GLOBAL(movstrSI0)
++ FUNC(GLOBAL(movstrSI0))
+ GLOBAL(movstrSI0):
+ rts
+ nop
+
++ ENDFUNC(GLOBAL(movstrSI64))
++ ENDFUNC(GLOBAL(movstrSI60))
++ ENDFUNC(GLOBAL(movstrSI56))
++ ENDFUNC(GLOBAL(movstrSI52))
++ ENDFUNC(GLOBAL(movstrSI48))
++ ENDFUNC(GLOBAL(movstrSI44))
++ ENDFUNC(GLOBAL(movstrSI40))
++ ENDFUNC(GLOBAL(movstrSI36))
++ ENDFUNC(GLOBAL(movstrSI32))
++ ENDFUNC(GLOBAL(movstrSI28))
++ ENDFUNC(GLOBAL(movstrSI24))
++ ENDFUNC(GLOBAL(movstrSI20))
++ ENDFUNC(GLOBAL(movstrSI16))
++ ENDFUNC(GLOBAL(movstrSI12))
++ ENDFUNC(GLOBAL(movstrSI8))
++ ENDFUNC(GLOBAL(movstrSI4))
++ ENDFUNC(GLOBAL(movstrSI0))
++
+ .align 4
+
+ .global GLOBAL(movstr)
++ FUNC(GLOBAL(movstr))
+ GLOBAL(movstr):
+ mov.l @(60,r5),r0
+ mov.l r0,@(60,r4)
+@@ -771,6 +887,8 @@
+ add #64,r5
+ bra GLOBAL(movstr)
+ add #64,r4
++
++ FUNC(GLOBAL(movstr))
+ #endif
+
+ #ifdef L_movstr_i4
+@@ -779,6 +897,10 @@
+ .global GLOBAL(movstr_i4_odd)
+ .global GLOBAL(movstrSI12_i4)
+
++ FUNC(GLOBAL(movstr_i4_even))
++ FUNC(GLOBAL(movstr_i4_odd))
++ FUNC(GLOBAL(movstrSI12_i4))
++
+ .p2align 5
+ L_movstr_2mod4_end:
+ mov.l r0,@(16,r4)
+@@ -787,6 +909,11 @@
+
+ .p2align 2
+
++GLOBAL(movstr_i4_even):
++ mov.l @r5+,r0
++ bra L_movstr_start_even
++ mov.l @r5+,r1
++
+ GLOBAL(movstr_i4_odd):
+ mov.l @r5+,r1
+ add #-4,r4
+@@ -813,10 +940,8 @@
+ rts
+ mov.l r3,@(12,r4)
+
+-GLOBAL(movstr_i4_even):
+- mov.l @r5+,r0
+- bra L_movstr_start_even
+- mov.l @r5+,r1
++ ENDFUNC(GLOBAL(movstr_i4_even))
++ ENDFUNC(GLOBAL(movstr_i4_odd))
+
+ .p2align 4
+ GLOBAL(movstrSI12_i4):
+@@ -827,12 +952,15 @@
+ mov.l r1,@(4,r4)
+ rts
+ mov.l r2,@(8,r4)
++
++ ENDFUNC(GLOBAL(movstrSI12_i4))
+ #endif
+
+ #ifdef L_mulsi3
+
+
+ .global GLOBAL(mulsi3)
++ FUNC(GLOBAL(mulsi3))
+
+ ! r4 = aabb
+ ! r5 = ccdd
+@@ -865,7 +993,7 @@
+ rts
+ add r2,r0
+
+-
++ FUNC(GLOBAL(mulsi3))
+ #endif
+ #endif /* ! __SH5__ */
+ #ifdef L_sdivsi3_i4
+@@ -875,6 +1003,7 @@
+ !! args in r4 and r5, result in fpul, clobber dr0, dr2
+
+ .global GLOBAL(sdivsi3_i4)
++ FUNC(GLOBAL(sdivsi3_i4))
+ GLOBAL(sdivsi3_i4):
+ lds r4,fpul
+ float fpul,dr0
+@@ -884,6 +1013,7 @@
+ rts
+ ftrc dr0,fpul
+
++ ENDFUNC(GLOBAL(sdivsi3_i4))
+ #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
+ !! args in r4 and r5, result in fpul, clobber r2, dr0, dr2
+
+@@ -892,6 +1022,7 @@
+ .mode SHcompact
+ #endif
+ .global GLOBAL(sdivsi3_i4)
++ FUNC(GLOBAL(sdivsi3_i4))
+ GLOBAL(sdivsi3_i4):
+ sts.l fpscr,@-r15
+ mov #8,r2
+@@ -906,6 +1037,7 @@
+ rts
+ lds.l @r15+,fpscr
+
++ ENDFUNC(GLOBAL(sdivsi3_i4))
+ #endif /* ! __SH5__ || __SH5__ == 32 */
+ #endif /* ! __SH4__ */
+ #endif
+@@ -920,9 +1052,10 @@
+ !!
+ !!
+
+-!! args in r4 and r5, result in r0 clobber r1,r2,r3
++!! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit
+
+ .global GLOBAL(sdivsi3)
++ FUNC(GLOBAL(sdivsi3))
+ #if __SHMEDIA__
+ #if __SH5__ == 32
+ .section .text..SHmedia32,"ax"
+@@ -1166,6 +1299,7 @@
+ div0: rts
+ mov #0,r0
+
++ ENDFUNC(GLOBAL(sdivsi3))
+ #endif /* ! __SHMEDIA__ */
+ #endif /* ! __SH4__ */
+ #endif
+@@ -1174,9 +1308,11 @@
+ .title "SH DIVIDE"
+ !! 4 byte integer Divide code for the Hitachi SH
+ #ifdef __SH4__
+-!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
++!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4,
++!! and t bit
+
+ .global GLOBAL(udivsi3_i4)
++ FUNC(GLOBAL(udivsi3_i4))
+ GLOBAL(udivsi3_i4):
+ mov #1,r1
+ cmp/hi r1,r5
+@@ -1217,11 +1353,13 @@
+ L1:
+ .double 2147483648
+
++ ENDFUNC(GLOBAL(udivsi3_i4))
+ #elif defined (__SH5__) && ! defined (__SH4_NOFPU__)
+ #if ! __SH5__ || __SH5__ == 32
+ !! args in r4 and r5, result in fpul, clobber r20, r21, dr0, fr33
+ .mode SHmedia
+ .global GLOBAL(udivsi3_i4)
++ FUNC(GLOBAL(udivsi3_i4))
+ GLOBAL(udivsi3_i4):
+ addz.l r4,r63,r20
+ addz.l r5,r63,r21
+@@ -1234,6 +1372,8 @@
+ ftrc.dq dr0,dr32
+ fmov.s fr33,fr32
+ blink tr0,r63
++
++ ENDFUNC(GLOBAL(udivsi3_i4))
+ #endif /* ! __SH5__ || __SH5__ == 32 */
+ #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__)
+ !! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
+@@ -1287,6 +1427,7 @@
+ #endif
+ .double 2147483648
+
++ ENDFUNC(GLOBAL(udivsi3_i4))
+ #endif /* ! __SH4__ */
+ #endif
+
+@@ -1297,6 +1438,7 @@
+
+ !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit
+ .global GLOBAL(udivsi3)
++ FUNC(GLOBAL(udivsi3))
+
+ #if __SHMEDIA__
+ #if __SH5__ == 32
+@@ -1485,6 +1627,7 @@
+ rts
+ rotcl r0
+
++ ENDFUNC(GLOBAL(udivsi3))
+ #endif /* ! __SHMEDIA__ */
+ #endif /* __SH4__ */
+ #endif /* L_udivsi3 */
+@@ -1790,6 +1933,7 @@
+ .mode SHcompact
+ #endif
+ .global GLOBAL(set_fpscr)
++ FUNC(GLOBAL(set_fpscr))
+ GLOBAL(set_fpscr):
+ lds r4,fpscr
+ mov.l LOCAL(set_fpscr_L1),r1
+@@ -1822,6 +1966,8 @@
+ .align 2
+ LOCAL(set_fpscr_L1):
+ .long GLOBAL(fpscr_values)
++
++ ENDFUNC(GLOBAL(set_fpscr))
+ #ifdef __ELF__
+ .comm GLOBAL(fpscr_values),8,4
+ #else
+@@ -1860,6 +2006,7 @@
+ blink tr0, r63
+ #elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
+ .global GLOBAL(ic_invalidate)
++ FUNC(GLOBAL(ic_invalidate))
+ GLOBAL(ic_invalidate):
+ ocbwb @r4
+ mova 0f,r0
+@@ -1882,6 +2029,8 @@
+ nop
+ .endr
+ .endr
++
++ ENDFUNC(GLOBAL(ic_invalidate))
+ #endif /* SH4 */
+ #endif /* L_ic_invalidate */
+
+@@ -1940,6 +2089,7 @@
+ will be expanded into r2/r3 upon return. */
+
+ .global GLOBAL(GCC_shcompact_call_trampoline)
++ FUNC(GLOBAL(GCC_shcompact_call_trampoline))
+ GLOBAL(GCC_shcompact_call_trampoline):
+ ptabs/l r0, tr0 /* Prepare to call the actual function. */
+ movi ((datalabel LOCAL(ct_main_table) - 31 * 2) >> 16) & 65535, r0
+@@ -2290,6 +2440,8 @@
+ shari r2, 32, r2
+ #endif
+ blink tr0, r63
++
++ ENDFUNC(GLOBAL(GCC_shcompact_call_trampoline))
+ #endif /* L_shcompact_call_trampoline */
+
+ #ifdef L_shcompact_return_trampoline
+@@ -2302,6 +2454,7 @@
+ .section .text..SHmedia32, "ax"
+ .align 2
+ .global GLOBAL(GCC_shcompact_return_trampoline)
++ FUNC(GLOBAL(GCC_shcompact_return_trampoline))
+ GLOBAL(GCC_shcompact_return_trampoline):
+ ptabs/l r18, tr0
+ #if __LITTLE_ENDIAN__
+@@ -2313,6 +2466,8 @@
+ #endif
+ or r3, r2, r2
+ blink tr0, r63
++
++ ENDFUNC(GLOBAL(GCC_shcompact_return_trampoline))
+ #endif /* L_shcompact_return_trampoline */
+
+ #ifdef L_shcompact_incoming_args
+@@ -2367,6 +2522,7 @@
+ actual bit pattern. */
+
+ .global GLOBAL(GCC_shcompact_incoming_args)
++ FUNC(GLOBAL(GCC_shcompact_incoming_args))
+ GLOBAL(GCC_shcompact_incoming_args):
+ ptabs/l r18, tr0 /* Prepare to return. */
+ shlri r17, 32, r0 /* Load the cookie. */
+@@ -2519,6 +2675,7 @@
+ LOCAL(ia_return): /* Return. */
+ blink tr0, r63
+ LOCAL(ia_end_of_push_seq): /* Label used to compute the first push instruction. */
++ ENDFUNC(GLOBAL(GCC_shcompact_incoming_args))
+ #endif /* L_shcompact_incoming_args */
+ #endif
+ #if __SH5__
+@@ -2530,6 +2687,7 @@
+ #endif
+ .align 3 /* It is copied in units of 8 bytes in SHmedia mode. */
+ .global GLOBAL(GCC_nested_trampoline)
++ FUNC(GLOBAL(GCC_nested_trampoline))
+ GLOBAL(GCC_nested_trampoline):
+ .mode SHmedia
+ ptrel/u r63, tr0
+@@ -2546,6 +2704,8 @@
+ ld.l r0, 28, r1
+ #endif
+ blink tr1, r63
++
++ ENDFUNC(GLOBAL(GCC_nested_trampoline))
+ #endif /* L_nested_trampoline */
+ #endif /* __SH5__ */
+ #if __SH5__ == 32
+@@ -2555,6 +2715,7 @@
+ .align 2
+ #ifndef __SH4_NOFPU__
+ .global GLOBAL(GCC_push_shmedia_regs)
++ FUNC(GLOBAL(GCC_push_shmedia_regs))
+ GLOBAL(GCC_push_shmedia_regs):
+ addi.l r15, -14*8, r15
+ fst.d r15, 13*8, dr62
+@@ -2573,6 +2734,7 @@
+ fst.d r15, 0*8, dr36
+ #endif
+ .global GLOBAL(GCC_push_shmedia_regs_nofpu)
++ FUNC(GLOBAL(GCC_push_shmedia_regs_nofpu))
+ GLOBAL(GCC_push_shmedia_regs_nofpu):
+ ptabs/l r18, tr0
+ addi.l r15, -27*8, r15
+@@ -2608,8 +2770,13 @@
+ st.q r15, 0*8, r28
+ blink tr0, r63
+
++#ifndef __SH4_NOFPU__
++ ENDFUNC(GLOBAL(GCC_push_shmedia_regs))
++#endif
++ ENDFUNC(GLOBAL(GCC_push_shmedia_regs_nofpu))
+ #ifndef __SH4_NOFPU__
+ .global GLOBAL(GCC_pop_shmedia_regs)
++ FUNC(GLOBAL(GCC_pop_shmedia_regs))
+ GLOBAL(GCC_pop_shmedia_regs):
+ pt .L0, tr1
+ movi 41*8, r0
+@@ -2630,6 +2797,7 @@
+ blink tr1, r63
+ #endif
+ .global GLOBAL(GCC_pop_shmedia_regs_nofpu)
++ FUNC(GLOBAL(GCC_pop_shmedia_regs_nofpu))
+ GLOBAL(GCC_pop_shmedia_regs_nofpu):
+ movi 27*8, r0
+ .L0:
+@@ -2666,5 +2834,10 @@
+ ld.q r15, 0*8, r28
+ add.l r15, r0, r15
+ blink tr0, r63
++
++#ifndef __SH4_NOFPU__
++ ENDFUNC(GLOBAL(GCC_pop_shmedia_regs))
++#endif
++ ENDFUNC(GLOBAL(GCC_pop_shmedia_regs_nofpu))
+ #endif /* __SH5__ == 32 */
+ #endif /* L_push_pop_shmedia_regs */
diff --git a/patches/gcc/3.3.2/sh-libgcc-hidden.patch b/patches/gcc/3.3.2/sh-libgcc-hidden.patch
new file mode 100644
index 0000000..adccc0e
--- /dev/null
+++ b/patches/gcc/3.3.2/sh-libgcc-hidden.patch
@@ -0,0 +1,122 @@
+[adjusted very slightly to apply to gcc-3.3.2 - dank]
+
+From: kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+I've noticed one more problem about this issue. In the testcase given
+by ZhouChang, libdemo.so exports __movstr_i4_even which is a function
+in libgcc.a. This itself is not a problem but it means that some functions
+in libgcc.a which should not be exported from shared objects might be
+exported from shared libs
+
+Date: Wed, 19 Nov 2003 09:04:12 +0900 (JST)
+From: kaz Kojima <kkojima@rr.iij4u.or.jp>
+Subject: [linux-sh:03096] Re: [linux] Re: About tool chain in
+ http://kegel.com/crosstool/
+To: dank@kegel.com
+Cc: zjuzhou@yahoo.com.cn, linux-sh@m17n.org, zhan_sh@yahoo.com.cn,
+ crossgcc@sources.redhat.com
+Message-Id: <20031119.090412.85413542.kkojima@rr.iij4u.or.jp>
+
+Hi,
+
+Dan Kegel <dank@kegel.com> wrote:
+> I'll try that, thanks. I notice that the '.hidden' isn't in cvs yet.
+> I also notice you've been trying to get that into CVS for two years
+> now (http://gcc.gnu.org/ml/gcc-patches/2001-10/msg00053.html).
+> Time for another try? It'd be nice if gcc-3.4 (and maybe even gcc-3.3.3)
+> didn't need a patch for this.
+
+The situation is a bit complicated. sh-linux target doesn't make
+shared libgcc in gcc-3.3.x.
+OTOH, I withdrew that .hidden patch because gcc-3.3 has a general
+mechanism to make all libgcc functions .hidden. But I missed that
+that mechanism was conditionalized later so that it's done only
+when the target creates the shared libgcc.
+In 3.4, sh-linux target becomes to use the shared libgcc like as
+all other linux targets, so there is no problem.
+
+I inclined to backport 3.4 shared libgcc stuff to 3.3.3 rather
+than the old .hidden patch. How do you think about it?
+I'm happy if you or ZhouChang create a PR on gcc bugzilla about
+this issue.
+
+Regards,
+ kaz
+--
+ This is a backport of 3.4 shared libgcc stuff to 3.3 branch.
+ * config.gcc (sh*-*-linux*): Add t-slibgcc-elf-ver and t-linux.
+ to tmake_file. * config/sh/libgcc-glibc.ver: New file.
+ * config/sh/t-linux (SHLIB_LINK): Override to use a linker script
+ libgcc_s.so.
+ (SHLIB_INSTALL): Likewise.
+
+diff -u3prN ORIG/gcc-3.3/gcc/config/sh/libgcc-glibc.ver gcc-3.3/gcc/config/sh/libgcc-glibc.ver
+--- ORIG/gcc-3.3/gcc/config/sh/libgcc-glibc.ver Thu Jan 1 09:00:00 1970
++++ gcc-3.3/gcc/config/sh/libgcc-glibc.ver Wed Nov 19 08:15:16 2003
+@@ -0,0 +1,21 @@
++# In order to work around the very problems that force us to now generally
++# create a libgcc.so, glibc reexported a number of routines from libgcc.a.
++# By now choosing the same version tags for these specific routines, we
++# maintain enough binary compatibility to allow future versions of glibc
++# to defer implementation of these routines to libgcc.so via DT_AUXILIARY.
++
++# Note that we cannot use the default libgcc-glibc.ver file on sh,
++# because GLIBC_2.0 does not exist on this architecture, as the first
++# ever glibc release on the platform was GLIBC_2.2.
++
++%inherit GCC_3.0 GLIBC_2.2
++GLIBC_2.2 {
++ __register_frame
++ __register_frame_table
++ __deregister_frame
++ __register_frame_info
++ __deregister_frame_info
++ __frame_state_for
++ __register_frame_info_table
++}
++
+diff -u3prN ORIG/gcc-3.3/gcc/config/sh/t-linux gcc-3.3/gcc/config/sh/t-linux
+--- ORIG/gcc-3.3/gcc/config/sh/t-linux Fri Jun 6 11:07:14 2003
++++ gcc-3.3/gcc/config/sh/t-linux Wed Nov 19 08:09:26 2003
+@@ -12,3 +12,27 @@ MULTILIB_MATCHES =
+ MULTILIB_EXCEPTIONS=
+
+ EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
++
++# Override t-slibgcc-elf-ver to export some libgcc symbols with
++# the symbol versions that glibc used.
++SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/sh/libgcc-glibc.ver
++
++# Override SHLIB_LINK and SHLIB_INSTALL to use linker script
++# libgcc_s.so.
++SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
++ -Wl,--soname=$(SHLIB_SONAME) \
++ -Wl,--version-script=$(SHLIB_MAP) \
++ -o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
++ rm -f $(SHLIB_SOLINK) && \
++ (echo "/* GNU ld script"; \
++ echo " Use the shared library, but some functions are only in"; \
++ echo " the static library. */"; \
++ echo "GROUP ( $(SHLIB_SONAME) libgcc.a )" \
++ ) > $(SHLIB_SOLINK)
++SHLIB_INSTALL = \
++ $$(SHELL) $$(srcdir)/mkinstalldirs $$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
++ $(INSTALL_DATA) $(SHLIB_NAME) \
++ $$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
++ rm -f $$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
++ $(INSTALL_DATA) $(SHLIB_SOLINK) \
++ $$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+diff -u3prN ORIG/gcc-3.3/gcc/config.gcc gcc-3.3/gcc/config.gcc
+--- ORIG/gcc-3.3/gcc/config.gcc Sat Aug 9 07:19:07 2003
++++ gcc-3.3/gcc/config.gcc Wed Nov 19 08:07:53 2003
+@@ -2308,7 +2308,7 @@ sh-*-rtems*)
+ fi
+ ;;
+ sh-*-linux* | sh[2346lbe]*-*-linux*)
+- tmake_file="sh/t-sh sh/t-elf"
++ tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux"
+ case $machine in
+ sh*be-*-* | sh*eb-*-*) ;;
+ *)
+
+
diff --git a/patches/gcc/3.3.2/sh-pic-set_fpscr-gcc-3.3.2.patch b/patches/gcc/3.3.2/sh-pic-set_fpscr-gcc-3.3.2.patch
new file mode 100644
index 0000000..2a9d592
--- /dev/null
+++ b/patches/gcc/3.3.2/sh-pic-set_fpscr-gcc-3.3.2.patch
@@ -0,0 +1,67 @@
+See http://gcc.gnu.org/PR11901
+Should fix
+make[2]: *** [/gcc-3.3-glibc-2.3.2/build-glibc/elf/check-textrel.out] Error 1
+in glibc's "make tests".
+
+Note: this patch is named
+sh-pic-set_fpscr-gcc-3.3.2.patch
+and must be applied after
+sh-lib1funcs_sizeAndType.patch
+but that'll happen naturally if you apply them in alphabetical order.
+
+-------------
+
+Date: Wed, 30 Jul 2003 12:03:01 +0900
+From: kaz Kojima <kkojima@rr.iij4u.or.jp>
+Subject: [linux-sh:02916] Re: Writing PIC version of __udivsi3_i4? (was: Re: "make tests" fails
+ with "libc.so: text relocations used" in glibc-2.3.2 for sh4)
+To: dank@kegel.com
+Cc: linux-sh@m17n.org
+Message-Id: <200307300255.h6U2tB906928@r-rr.iij4u.or.jp>
+
+> I'll try to write the PIC version of it,
+
+Dan, does the attached patch work for you?
+
+Regards,
+ kaz
+--
+diff -u3prN ORIG/gcc/gcc/config/sh/lib1funcs.asm LOCAL/gcc/gcc/config/sh/lib1funcs.asm
+--- ORIG/gcc/gcc/config/sh/lib1funcs.asm Thu Jun 19 07:38:59 2003
++++ gcc-3.3.2/gcc/config/sh/lib1funcs.asm Wed Jul 30 11:08:49 2003
+@@ -1936,7 +1944,17 @@ GLOBAL(moddi3):
+ FUNC(GLOBAL(set_fpscr))
+ GLOBAL(set_fpscr):
+ lds r4,fpscr
++#ifdef __PIC__
++ mov.l r12,@-r15
++ mova LOCAL(set_fpscr_L0),r0
++ mov.l LOCAL(set_fpscr_L0),r12
++ add r0,r12
++ mov.l LOCAL(set_fpscr_L1),r0
++ mov.l @(r0,r12),r1
++ mov.l @r15+,r12
++#else
+ mov.l LOCAL(set_fpscr_L1),r1
++#endif
+ swap.w r4,r0
+ or #24,r0
+ #ifndef FMOVD_WORKS
+@@ -1964,8 +1982,15 @@ GLOBAL(set_fpscr):
+ mov.l r3,@(4,r1)
+ #endif
+ .align 2
++#ifdef __PIC__
++LOCAL(set_fpscr_L0):
++ .long _GLOBAL_OFFSET_TABLE_
++LOCAL(set_fpscr_L1):
++ .long GLOBAL(fpscr_values@GOT)
++#else
+ LOCAL(set_fpscr_L1):
+ .long GLOBAL(fpscr_values)
++#endif
+
+ ENDFUNC(GLOBAL(set_fpscr))
+ #ifndef NO_FPSCR_VALUES
+
+
diff --git a/patches/gcc/3.3.2/thunk3.patch b/patches/gcc/3.3.2/thunk3.patch
new file mode 100644
index 0000000..7974a0c
--- /dev/null
+++ b/patches/gcc/3.3.2/thunk3.patch
@@ -0,0 +1,23 @@
+Fixes
+FAIL: g++.jason/thunk3.C (test for excess errors)
+on sh4-unknown-linux-gnu.
+
+Does any sh variant *not* use the generic thunk support? If so, the patch should be
+more cautious. As it is, it excludes all sh processors from this test.
+
+Index: thunk3.C
+===================================================================
+RCS file: /cvsroot/gcc/gcc/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C,v
+retrieving revision 1.13
+diff -u -d -u -r1.13 thunk3.C
+--- gcc-ss-3_3-20030714/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C.old 25 Mar 2002 17:57:03 -0000 1.13
++++ gcc-ss-3_3-20030714/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C 20 Jul 2003 16:57:38 -0000
+@@ -2,7 +2,7 @@
+ // Note that this will break on any target that uses the generic thunk
+ // support, because it doesn't support variadic functions.
+
+-// excess errors test - XFAIL mips*-*-* rs6000-*-* powerpc-*-eabi m68k-*-coff m68k-motorola-sysv m88k-motorola-sysv3 mn10300-*-* mn10200-*-* v850-*-* sh-*-* sh64-*-* h8*-*-* xtensa-*-*
++// excess errors test - XFAIL mips*-*-* rs6000-*-* powerpc-*-eabi m68k-*-coff m68k-motorola-sysv m88k-motorola-sysv3 mn10300-*-* mn10200-*-* v850-*-* sh*-*-* h8*-*-* xtensa-*-*
+
+ #include <stdarg.h>
+