aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2000-09-06 15:28:25 +0000
committerAlan Modra <amodra@gmail.com>2000-09-06 15:28:25 +0000
commitf998903041dd48584defd9c3b0fb6b30b1daf3bc (patch)
tree81a422882c10fa3a35bb027d70e312630ea5a97c /ld
parent967110cb4f8323e7fcb7578461fa8054fea8bbbc (diff)
downloadgdb-f998903041dd48584defd9c3b0fb6b30b1daf3bc.zip
gdb-f998903041dd48584defd9c3b0fb6b30b1daf3bc.tar.gz
gdb-f998903041dd48584defd9c3b0fb6b30b1daf3bc.tar.bz2
Fix place_orphan crash.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/emultempl/elf32.em9
2 files changed, 14 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 8058b6e..574884b 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2000-09-06 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
+ try shuffling sections when the orphan happens to be the place
+ holder. Keep count of unique section names generated so we speed
+ the search for a new name.
+
2000-09-06 Alexandre Oliva <aoliva@redhat.com>
* configure: Rebuilt with new libtool.m4.
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index e8be9cf..717f931 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1008,6 +1008,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
static struct orphan_save hold_bss;
static struct orphan_save hold_rel;
static struct orphan_save hold_interp;
+ static int count = 1;
struct orphan_save *place;
lang_statement_list_type *old = NULL;
lang_statement_list_type add;
@@ -1092,7 +1093,9 @@ gld${EMULATION_NAME}_place_orphan (file, s)
loadable or allocateable characteristics. */
outsecname = secname;
if (bfd_get_section_by_name (output_bfd, outsecname) != NULL)
- outsecname = bfd_get_unique_section_name (output_bfd, outsecname, NULL);
+ outsecname = bfd_get_unique_section_name (output_bfd,
+ outsecname,
+ &count);
if (place != NULL)
{
@@ -1154,7 +1157,9 @@ gld${EMULATION_NAME}_place_orphan (file, s)
stat_ptr = old;
snew = os->bfd_section;
- if (place->os->bfd_section != NULL || place->section != NULL)
+ if (place->section != NULL
+ || (place->os->bfd_section != NULL
+ && place->os->bfd_section != snew))
{
/* Shuffle the section to make the output file look neater. */
if (place->section == NULL)