* emultempl/spuelf.em (_binary_builtin_ovl_mgr_start): Rename
authorAlan Modra <amodra@gmail.com>
Mon, 26 Feb 2007 08:58:16 +0000 (08:58 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 26 Feb 2007 08:58:16 +0000 (08:58 +0000)
to _binary_spu_ovl_o_start.
(_binary_builtin_ovl_mgr_end): Rename to _binary_spu_ovl_o_end.
(spu_elf_load_ovl_mgr): Fatal error on missing overlay manager.
* emultempl/spu_inc.s: Rename symbols.
* emultempl/spu_none.s: New file.
* emultempl/spu_ovl.S: Update copyright.
* Makefile.am (spu_inc.o): Try building with ld -r first, then
gas incbin, then build without overlay manager.
* Makefile.in: Regenerate.

ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/emultempl/spu_inc.s
ld/emultempl/spu_none.s [new file with mode: 0644]
ld/emultempl/spu_ovl.S
ld/emultempl/spuelf.em

index a119a0a38b490a08306f4cd2c0da39e0edab0049..f6de156690682952749bcc0cc8ff69ad04d629fb 100644 (file)
@@ -1,3 +1,16 @@
+2007-02-26  Alan Modra  <amodra@bigpond.net.au>
+
+       * emultempl/spuelf.em (_binary_builtin_ovl_mgr_start): Rename
+       to _binary_spu_ovl_o_start.
+       (_binary_builtin_ovl_mgr_end): Rename to _binary_spu_ovl_o_end.
+       (spu_elf_load_ovl_mgr): Fatal error on missing overlay manager.
+       * emultempl/spu_inc.s: Rename symbols.
+       * emultempl/spu_none.s: New file.
+       * emultempl/spu_ovl.S: Update copyright.
+       * Makefile.am (spu_inc.o): Try building with ld -r first, then
+       gas incbin, then build without overlay manager.
+       * Makefile.in: Regenerate.
+
 2007-02-22  Joseph Myers  <joseph@codesourcery.com>
 
        * configure.tgt (mips64*el-*-linux-*, mips64*-*-linux-*,
index a62167a753441aa38c6a47f5623309a767407320..d83bb16177ffa5c85850ece2766a575388f6464d 100644 (file)
@@ -724,8 +724,14 @@ eelf32_sparc_vxworks.c: $(srcdir)/emulparams/elf32_sparc_vxworks.sh \
 eelf32_spu.c: $(srcdir)/emulparams/elf32_spu.sh $(srcdir)/emultempl/spuelf.em \
   $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} elf32_spu "$(tdir_elf32_spu)"
-spu_inc.o: $(srcdir)/emultempl/spu_inc.s $(srcdir)/emultempl/spu_ovl.o
-       $(CC) -c -Wa,-I,$(srcdir)/emultempl -o $@ $<
+spu_inc.o: $(srcdir)/emultempl/spu_inc.s $(srcdir)/emultempl/spu_none.s \
+  $(srcdir)/emultempl/spu_ovl.o
+       cp $(srcdir)/emultempl/spu_ovl.o spu_ovl.o; \
+       if ! ld -r -o $@ -b binary spu_ovl.o; then \
+         if ! $(CC) -c -o $@ $(srcdir)/emultempl/spu_inc.s; then \
+           $(CC) -c -o $@ $(srcdir)/emultempl/spu_none.s; \
+         fi \
+       fi
 $(srcdir)/emultempl/spu_ovl.o: @MAINT@ $(srcdir)/emultempl/spu_ovl.S
        cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s
        if ../gas/as-new --version \
index c19ff975475241aaf67e13b31c5b91f720bc1415..cf3357bdf08122a3ec89df324d5dd312a906f5e5 100644 (file)
@@ -1535,8 +1535,14 @@ eelf32_sparc_vxworks.c: $(srcdir)/emulparams/elf32_sparc_vxworks.sh \
 eelf32_spu.c: $(srcdir)/emulparams/elf32_spu.sh $(srcdir)/emultempl/spuelf.em \
   $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} elf32_spu "$(tdir_elf32_spu)"
-spu_inc.o: $(srcdir)/emultempl/spu_inc.s $(srcdir)/emultempl/spu_ovl.o
-       $(CC) -c -Wa,-I,$(srcdir)/emultempl -o $@ $<
+spu_inc.o: $(srcdir)/emultempl/spu_inc.s $(srcdir)/emultempl/spu_none.s \
+  $(srcdir)/emultempl/spu_ovl.o
+       cp $(srcdir)/emultempl/spu_ovl.o spu_ovl.o; \
+       if ! ld -r -o $@ -b binary spu_ovl.o; then \
+         if ! $(CC) -c -o $@ $(srcdir)/emultempl/spu_inc.s; then \
+           $(CC) -c -o $@ $(srcdir)/emultempl/spu_none.s; \
+         fi \
+       fi
 $(srcdir)/emultempl/spu_ovl.o: @MAINT@ $(srcdir)/emultempl/spu_ovl.S
        cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s
        if ../gas/as-new --version \
index 243bd1061e90e6a571f7d24efd2728f1eb96e62b..29a076cdffe36ac5920a8ee7f8365a0d06dd1686 100644 (file)
@@ -1,7 +1,7 @@
  .text
- .globl _binary_builtin_ovl_mgr_start
- .globl _binary_builtin_ovl_mgr_end
+ .globl _binary_spu_ovl_o_start
+ .globl _binary_spu_ovl_o_end
 
-_binary_builtin_ovl_mgr_start:
+_binary_spu_ovl_o_start:
  .incbin "spu_ovl.o"
-_binary_builtin_ovl_mgr_end:
+_binary_spu_ovl_o_end:
diff --git a/ld/emultempl/spu_none.s b/ld/emultempl/spu_none.s
new file mode 100644 (file)
index 0000000..f0d2318
--- /dev/null
@@ -0,0 +1,6 @@
+ .text
+ .globl _binary_spu_ovl_o_start
+ .globl _binary_spu_ovl_o_end
+
+_binary_spu_ovl_o_start:
+_binary_spu_ovl_o_end:
index 3af4fd897c12d5287d986e1b8e2c502131992620..53d82a41e7cb859492c610b820572fda003cb89f 100644 (file)
@@ -1,6 +1,6 @@
 /* Overlay manager for SPU.
 
-   Copyright 2006 Free Software Foundation, Inc.
+   Copyright 2006, 2007 Free Software Foundation, Inc.
 
    This file is part of GLD, the Gnu Linker.
 
index de6a914a8837411d88dd0f1188985c186796d112..95b1cb28e1eb071f0a85ebc189013fe9e0b522be 100644 (file)
@@ -38,12 +38,12 @@ static int emit_stub_syms = 0;
 static bfd_vma local_store_lo = 0;
 static bfd_vma local_store_hi = 0x3ffff;
 
-extern void *_binary_builtin_ovl_mgr_start;
-extern void *_binary_builtin_ovl_mgr_end;
+extern void *_binary_spu_ovl_o_start;
+extern void *_binary_spu_ovl_o_end;
 
 static const struct _ovl_stream ovl_mgr_stream = {
-  &_binary_builtin_ovl_mgr_start,
-  &_binary_builtin_ovl_mgr_end
+  &_binary_spu_ovl_o_start,
+  &_binary_spu_ovl_o_end
 };
 
 static asection *toe = NULL;
@@ -118,6 +118,8 @@ spu_elf_load_ovl_mgr (void)
     {
       /* User supplied __ovly_load.  */
     }
+  else if (ovl_mgr_stream.start == ovl_mgr_stream.end)
+    einfo ("%F%P: no built-in overlay manager\n");
   else
     {
       lang_input_statement_type *ovl_is;