summaryrefslogtreecommitdiffstats
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-07-16 03:30:24 +0000
committerAlan Modra <amodra@gmail.com>2005-07-16 03:30:24 +0000
commit42fa7765a27b1d9691a1ca141408279bd9c3cd4e (patch)
tree9e4727d31f491ae57d9a998af3f43d9411c66d8f /ld/emultempl
parent6e4d0bcbd2c70e408546eb98ac003354398ca525 (diff)
downloadppe42-binutils-42fa7765a27b1d9691a1ca141408279bd9c3cd4e.tar.gz
ppe42-binutils-42fa7765a27b1d9691a1ca141408279bd9c3cd4e.zip
bfd/
* 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.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf32.em3
-rw-r--r--ld/emultempl/ppc32elf.em19
2 files changed, 15 insertions, 7 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 3899a02df6..b04d624ade 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -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. */
diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em
index 9a64da26c8..ba59b80a97 100644
--- a/ld/emultempl/ppc32elf.em
+++ b/ld/emultempl/ppc32elf.em
@@ -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
OpenPOWER on IntegriCloud