bfd/
authorAlan Modra <amodra@gmail.com>
Sat, 16 Jul 2005 03:30:24 +0000 (03:30 +0000)
committerAlan Modra <amodra@gmail.com>
Sat, 16 Jul 2005 03:30:24 +0000 (03:30 +0000)
* elf32-ppc.c (ppc_elf_set_sdata_syms): Return void.  Remove hack
for zero size sections.  Don't set .sbss syms here.
* elf32-ppc.h (ppc_elf_set_sdata_syms): Adjust prototype.
ld/
* emultempl/elf32.em (gld*_provide_init_fini_syms): Prototype.
(gld*_before_allocation): Call ldemul_do_assignments rather than
gld*_provide_init_fini_syms directly.
* emultempl/ppc32elf.em (gld*_after_allocation): Delete.
(ppc_do_assignments): New function.
(LDEMUL_AFTER_ALLOCATION): Don't define.
(LDEMUL_DO_ASSIGNMENTS): Define.

bfd/ChangeLog
bfd/elf32-ppc.c
bfd/elf32-ppc.h
ld/ChangeLog
ld/emultempl/elf32.em
ld/emultempl/ppc32elf.em

index 56319a32c1f2fcb50d1f51dd8e80c3ee1bcec2ef..7870c6005f9d00285f28816016f18600818f5dad 100644 (file)
@@ -1,3 +1,9 @@
+2005-07-16  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf32-ppc.c (ppc_elf_set_sdata_syms): Return void.  Remove hack
+       for zero size sections.  Don't set .sbss syms here.
+       * elf32-ppc.h (ppc_elf_set_sdata_syms): Adjust prototype.
+
 2005-07-16  Alan Modra  <amodra@bigpond.net.au>
 
        * Makefile.am: Run "make dep-am".
index d4ef6120d25792afc1ea34eff6d2ac44e0182d75..16d11c40f06455d5dd5238e2f93ec890e9fce828 100644 (file)
@@ -5261,7 +5261,7 @@ ppc_elf_relax_section (bfd *abfd,
    statement runs the risk of section alignment affecting where the
    section starts.  */
 
-bfd_boolean
+void
 ppc_elf_set_sdata_syms (bfd *obfd, struct bfd_link_info *info)
 {
   struct ppc_elf_link_hash_table *htab;
@@ -5286,16 +5286,9 @@ ppc_elf_set_sdata_syms (bfd *obfd, struct bfd_link_info *info)
       if (s)
        {
          /* VxWorks executables are relocatable, so the sdata base symbols
-            must be section-relative.  If the section is zero sized leave
-            them as absolute symbols to avoid creationg an unused
-            output section.  */
+            must be section-relative.  */
          val = 32768;
          lsect->sym_val = val + s->vma;
-         if (s->size == 0)
-           {
-             val += s->vma;
-             s = NULL;
-           }
        }
       else
        {
@@ -5305,13 +5298,6 @@ ppc_elf_set_sdata_syms (bfd *obfd, struct bfd_link_info *info)
 
       _bfd_elf_provide_symbol (info, lsect->sym_name, val, s);
     }
-
-  s = bfd_get_section_by_name (obfd, ".sbss");
-  _bfd_elf_provide_section_bound_symbols (info, s,
-                                         "__sbss_start", "__sbss_end");
-  _bfd_elf_provide_section_bound_symbols (info, s,
-                                         "___sbss_start", "___sbss_end");
-  return TRUE;
 }
 \f
 /* Fill in the address for a pointer generated in a linker section.  */
index fa8ffc44dc6faad6622d8dc64eb252dbe2b86281..2bec595392c96cd10937999a924bbefa1ffefed6 100644 (file)
@@ -20,4 +20,4 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
 int ppc_elf_select_plt_layout (bfd *, struct bfd_link_info *, int);
 asection *ppc_elf_tls_setup (bfd *, struct bfd_link_info *);
 bfd_boolean ppc_elf_tls_optimize (bfd *, struct bfd_link_info *);
-bfd_boolean ppc_elf_set_sdata_syms (bfd *, struct bfd_link_info *);
+void ppc_elf_set_sdata_syms (bfd *, struct bfd_link_info *);
index 04e6d1a4d580bba0ea53245d23e9b16aab27f356..7cdf1147da725ef801bcd28e0838cd1675d8f02f 100644 (file)
@@ -1,3 +1,13 @@
+2005-07-16  Alan Modra  <amodra@bigpond.net.au>
+
+       * emultempl/elf32.em (gld*_provide_init_fini_syms): Prototype.
+       (gld*_before_allocation): Call ldemul_do_assignments rather than
+       gld*_provide_init_fini_syms directly.
+       * emultempl/ppc32elf.em (gld*_after_allocation): Delete.
+       (ppc_do_assignments): New function.
+       (LDEMUL_AFTER_ALLOCATION): Don't define.
+       (LDEMUL_DO_ASSIGNMENTS): Define.
+
 2005-07-16  Alan Modra  <amodra@bigpond.net.au>
 
        * Makefile.am: Run "make dep-am".
index 3899a02df6244ddce68e33f6d6abb5da242becd4..b04d624adea2e6fb80a42297264bf9ca92b9bc97 100644 (file)
@@ -57,6 +57,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
 /* Declare functions used by various EXTRA_EM_FILEs.  */
 static void gld${EMULATION_NAME}_before_parse (void);
 static void gld${EMULATION_NAME}_after_open (void);
+static void gld${EMULATION_NAME}_provide_init_fini_syms (void);
 static void gld${EMULATION_NAME}_before_allocation (void);
 static bfd_boolean gld${EMULATION_NAME}_place_orphan
   (lang_input_statement_type *file, asection *s);
@@ -1097,7 +1098,7 @@ gld${EMULATION_NAME}_before_allocation (void)
      referred to by dynamic objects.  */
   lang_for_each_statement (gld${EMULATION_NAME}_find_statement_assignment);
 
-  gld${EMULATION_NAME}_provide_init_fini_syms ();
+  ldemul_do_assignments ();
 
   /* Let the ELF backend work out the sizes of any sections required
      by dynamic linking.  */
index 9a64da26c8cbccab5a2ec21c2b18f9c4334730dc..ba59b80a9785fd77b7adaeaf45cee68a652f8864 100644 (file)
@@ -118,13 +118,20 @@ ppc_before_allocation (void)
 }
 
 static void
-gld${EMULATION_NAME}_after_allocation (void)
+ppc_do_assignments (void)
 {
+  asection *s;
+
   if (is_ppc_elf32_vec (link_info.hash->creator))
-    {
-      if (!ppc_elf_set_sdata_syms (output_bfd, &link_info))
-       einfo ("%X%P: cannot set sdata syms %E\n");
-    }
+    ppc_elf_set_sdata_syms (output_bfd, &link_info);
+
+  s = bfd_get_section_by_name (output_bfd, ".sbss");
+  _bfd_elf_provide_section_bound_symbols (&link_info, s,
+                                         "__sbss_start", "__sbss_end");
+  _bfd_elf_provide_section_bound_symbols (&link_info, s,
+                                         "___sbss_start", "___sbss_end");
+
+  gld${EMULATION_NAME}_provide_init_fini_syms ();
 }
 
 EOF
@@ -170,4 +177,4 @@ PARSE_AND_LIST_ARGS_CASES='
 #
 LDEMUL_AFTER_OPEN=ppc_after_open
 LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation
-LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation
+LDEMUL_DO_ASSIGNMENTS=ppc_do_assignments