aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@embecosm.com>2003-07-08 18:05:34 +0000
committerJoern Rennecke <joern.rennecke@embecosm.com>2003-07-08 18:05:34 +0000
commitfb319d8d1d764e846fd7a84e76d7104706ac344f (patch)
treed525abac0e65022269b63c911d8d7095b5d1d51c /ld
parentdc5dd1eba02996a994edfee80c746af6ffe72de5 (diff)
downloadgdb-fb319d8d1d764e846fd7a84e76d7104706ac344f.zip
gdb-fb319d8d1d764e846fd7a84e76d7104706ac344f.tar.gz
gdb-fb319d8d1d764e846fd7a84e76d7104706ac344f.tar.bz2
* emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation):
Allow second call from ldemul_finish.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/sh64elf.em9
2 files changed, 13 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 27af4c8..7dc68c6 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2003-07-08 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation):
+ Allow second call from ldemul_finish.
+
2003-07-04 J"orn Rennecke <joern.rennecke@superh.com>
* emulparams/shelf32.sh (STACK_ADDR): Don't define.
diff --git a/ld/emultempl/sh64elf.em b/ld/emultempl/sh64elf.em
index 3c348fd..7f2b037 100644
--- a/ld/emultempl/sh64elf.em
+++ b/ld/emultempl/sh64elf.em
@@ -375,7 +375,14 @@ sh64_elf_${EMULATION_NAME}_after_allocation (void)
}
}
- BFD_ASSERT (cranges->contents == NULL);
+ /* ldemul_after_allocation may be called twice. First directly from
+ lang_process, and the second time when lang_process calls ldemul_finish,
+ which calls gld${EMULATION_NAME}_finish, e.g. gldshelf32_finish, which
+ is defined in emultempl/elf32.em and calls ldemul_after_allocation,
+ if bfd_elf${ELFSIZE}_discard_info returned true. */
+ if (cranges->contents != NULL)
+ free (cranges->contents);
+
BFD_ASSERT (sh64_elf_section_data (cranges)->sh64_info != NULL);
/* Make sure we have .cranges in memory even if there were only