summaryrefslogtreecommitdiffstats
path: root/ld/emultempl
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/aix.em5
-rw-r--r--ld/emultempl/armcoff.em5
-rw-r--r--ld/emultempl/beos.em3
-rw-r--r--ld/emultempl/elf32.em7
-rw-r--r--ld/emultempl/linux.em4
-rw-r--r--ld/emultempl/lnk960.em7
-rw-r--r--ld/emultempl/m68kcoff.em2
-rw-r--r--ld/emultempl/pe.em3
-rw-r--r--ld/emultempl/sunos.em2
9 files changed, 28 insertions, 10 deletions
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
index c37cadfe01..480a3c6cfa 100644
--- a/ld/emultempl/aix.em
+++ b/ld/emultempl/aix.em
@@ -10,7 +10,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* AIX emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004
+ 2003, 2004, 2005
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
AIX support by Ian Lance Taylor <ian@cygnus.com>
@@ -787,6 +787,9 @@ gld${EMULATION_NAME}_before_allocation (void)
&is->header.next);
}
}
+
+ if (!link_info.relocatable)
+ strip_excluded_output_sections ();
}
static char *
diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em
index 468c3b08be..3dc8ee0f72 100644
--- a/ld/emultempl/armcoff.em
+++ b/ld/emultempl/armcoff.em
@@ -5,7 +5,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* emulate the original gld for the given ${EMULATION_NAME}
Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004 Free Software Foundation, Inc.
+ 2004, 2005 Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -125,6 +125,9 @@ gld${EMULATION_NAME}_before_allocation (void)
/* We have seen it all. Allocate it, and carry on */
bfd_arm_allocate_interworking_sections (& link_info);
+
+ if (!link_info.relocatable)
+ strip_excluded_output_sections ();
}
static void
diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em
index 679fd81052..2d4491f328 100644
--- a/ld/emultempl/beos.em
+++ b/ld/emultempl/beos.em
@@ -661,6 +661,9 @@ gld_${EMULATION_NAME}_before_allocation (void)
#endif /* TARGET_IS_ppcpe */
sort_sections (stat_ptr->head);
+
+ if (!link_info.relocatable)
+ strip_excluded_output_sections ();
}
/* Place an orphan section. We use this to put sections with a '\$' in them
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 2e1dac1a4c..641cd63211 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1069,6 +1069,7 @@ gld${EMULATION_NAME}_before_allocation (void)
(const char * const *) command_line.auxiliary_filters,
&link_info, &sinterp, lang_elf_version_info)))
einfo ("%P%F: failed to set dynamic section sizes: %E\n");
+
${ELF_INTERPRETER_SET_DEFAULT}
/* Let the user override the dynamic linker we are using. */
if (command_line.interpreter != NULL
@@ -1125,6 +1126,12 @@ ${ELF_INTERPRETER_SET_DEFAULT}
s->flags |= SEC_EXCLUDE;
}
}
+
+ if (!link_info.relocatable)
+ strip_excluded_output_sections ();
+
+ if (!bfd_elf_size_dynsym_hash_dynstr (output_bfd, &link_info))
+ einfo ("%P%F: failed to set dynamic section sizes: %E\n");
}
EOF
diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em
index 0d2dc5dc56..32a445c9f5 100644
--- a/ld/emultempl/linux.em
+++ b/ld/emultempl/linux.em
@@ -10,7 +10,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* Linux a.out emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004 Free Software Foundation, Inc.
+ 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
Linux support by Eric Youngdale <ericy@cais.cais.com>
@@ -121,6 +121,8 @@ gld${EMULATION_NAME}_before_allocation (void)
dynamic linking. */
if (! bfd_${EMULATION_NAME}_size_dynamic_sections (output_bfd, &link_info))
einfo ("%P%F: failed to set dynamic section sizes: %E\n");
+
+ strip_excluded_output_sections ();
}
static char *
diff --git a/ld/emultempl/lnk960.em b/ld/emultempl/lnk960.em
index 7d9176eec8..b58efcc788 100644
--- a/ld/emultempl/lnk960.em
+++ b/ld/emultempl/lnk960.em
@@ -130,11 +130,6 @@ lnk960_after_parse (void)
}
static void
-lnk960_before_allocation (void)
-{
-}
-
-static void
lnk960_after_allocation (void)
{
if (!link_info.relocatable)
@@ -273,7 +268,7 @@ struct ld_emulation_xfer_struct ld_lnk960_emulation =
lnk960_after_allocation,
lnk960_set_output_arch,
lnk960_choose_target,
- lnk960_before_allocation,
+ before_allocation_default,
lnk960_get_script,
"lnk960",
"",
diff --git a/ld/emultempl/m68kcoff.em b/ld/emultempl/m68kcoff.em
index ba251c1289..2d04ead3c9 100644
--- a/ld/emultempl/m68kcoff.em
+++ b/ld/emultempl/m68kcoff.em
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* Handle embedded relocs for m68k.
- Copyright 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Michael Sokolov <msokolov@ivan.Harhan.ORG>, based on generic.em
by Steve Chamberlain <steve@cygnus.com>, embedded relocs code based on
mipsecoff.em by Ian Lance Taylor <ian@cygnus.com>.
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 16cc437988..f2b5c03240 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1287,6 +1287,9 @@ gld_${EMULATION_NAME}_before_allocation (void)
/* We have seen it all. Allocate it, and carry on. */
bfd_arm_pe_allocate_interworking_sections (& link_info);
#endif /* TARGET_IS_armpe */
+
+ if (!link_info.relocatable)
+ strip_excluded_output_sections ();
}
#ifdef DLL_SUPPORT
diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em
index a84959f3c0..f5595ddf38 100644
--- a/ld/emultempl/sunos.em
+++ b/ld/emultempl/sunos.em
@@ -809,6 +809,8 @@ gld${EMULATION_NAME}_before_allocation (void)
hdyn->u.def.section = sdyn;
else
hdyn->u.def.section = bfd_abs_section_ptr;
+
+ strip_excluded_output_sections ();
}
}
OpenPOWER on IntegriCloud