This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Re: gcc 3.3.3: start, exit etc. unresolved


On Friday 22 October 2004 08:33 am, Toralf Lund wrote:
> I'm now trying to build using gcc 3.3.3 (+ newlib) on my M68k setup,
> where 2.95.3 was used earlier. Compilation works fine after a few minor
> adjustments, but link fails with lots of unresolved symbols, including
> missing start() and exit() - see linker output below. I'm using exactly
> the same newlib setup as earlier, and identical build options for
> cross-gcc as well as the actual app.
>
> Can anyone explain this? Has anything changed related to the way crt0
> etc. is handled?

I use these patches for m68k-elf.  You might have some luck with them.
I haven't tried a m68k-coff target.

diff -uNr orig/gcc-3.3.3/gcc/config/m68k/t-m68kelf gcc-3.3.3/gcc/config/m68k/t-m68kelf
--- orig/gcc-3.3.3/gcc/config/m68k/t-m68kelf	Wed Jan 23 20:21:48 2002
+++ gcc-3.3.3/gcc/config/m68k/t-m68kelf	Wed Apr  7 17:01:17 2004
@@ -21,6 +21,7 @@
 INSTALL_LIBGCC = install-multilib
 
 # from ../t-svr4
-EXTRA_PARTS=crtbegin.o crtend.o
+# EXTRA_PARTS=crtbegin.o crtend.o
+EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o
 # no pic for now
 #CRTSTUFF_T_CFLAGS=-fpic
diff -uNr orig/newlib-1.12.0/libgloss/m68k/sim.ld newlib-1.12.0/libgloss/m68k/sim.ld
--- orig/newlib-1.12.0/libgloss/m68k/sim.ld	Wed Feb 28 13:41:57 2001
+++ newlib-1.12.0/libgloss/m68k/sim.ld	Wed Apr  7 17:04:55 2004
@@ -8,17 +8,27 @@
 
 MEMORY
 {
-  ram (rwx) : ORIGIN = 0x80000000, LENGTH = 1M
+  ram (rwx) : ORIGIN = 0x00010000, LENGTH = 1M
 }
 
-PROVIDE (__stack = 0);
+PROVIDE (__stack = 0x00010000);
+
+/*
+ * Initalize some symbols to be zero so we can reference them in the
+ * crt0 without core dumping. These functions are all optional, but
+ * we do this so we can have our crt0 always use them if they exist.
+ * This is so BSPs work better when using the crt0 installed gcc.
+ */
+PROVIDE (hardware_init_hook = 0);
+PROVIDE (software_init_hook = 0);
 
 SECTIONS
 {
   .text :
   {
     CREATE_OBJECT_SYMBOLS
-    *(.text)
+    *(.text*)
+    *(.gnu.linkonce.t*)
 
     . = ALIGN(0x4);
     /* These are for running static constructors and destructors under ELF.  */
@@ -31,7 +41,8 @@
     KEEP (*(SORT(.dtors.*)))
     KEEP (*(.dtors))
 
-    *(.rodata)
+    *(.rodata*)
+    *(.gnu.linkonce.r*)
 
     . = ALIGN(0x4);
     *(.gcc_except_table) 
@@ -60,7 +71,8 @@
   .data :
   {
     *(.shdata)
-    *(.data)
+    *(.data*)
+    *(.gnu.linkonce.d*)
     _edata = .;
   } > ram
 

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

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