summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2002-07-19 02:56:59 +0000
committerHans-Peter Nilsson <hp@axis.com>2002-07-19 02:56:59 +0000
commit3595bd6e74cdfaa655365ac00ce111e9ae89548c (patch)
tree6d1edee3012b761c1d6b434d25a832e4ab6ae3a2
parent9084e1dea4ed635155074dcfb96995d9f5ab219b (diff)
downloadbinutils-3595bd6e74cdfaa655365ac00ce111e9ae89548c.tar.gz
binutils-3595bd6e74cdfaa655365ac00ce111e9ae89548c.tar.bz2
binutils-3595bd6e74cdfaa655365ac00ce111e9ae89548c.zip
* emultempl/mmo.em (mmo_place_orphan): Handle case of no .text
output section.
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/mmo.em11
2 files changed, 16 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 876110fc2ca..1443cc62f0f 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2002-07-19 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * emultempl/mmo.em (mmo_place_orphan): Handle case of no .text
+ output section.
+
2002-07-16 Denis Chertykov <denisc@overta.ru>
Nick Clifton <nickc@redhat.com>
Frank Ch. Eigler <fche@redhat.com>
diff --git a/ld/emultempl/mmo.em b/ld/emultempl/mmo.em
index d8675bf392b..23bab165376 100644
--- a/ld/emultempl/mmo.em
+++ b/ld/emultempl/mmo.em
@@ -152,6 +152,17 @@ mmo_place_orphan (file, s)
/* Restore the global list pointer. */
stat_ptr = old;
+ /* We need an output section for .text as a root, so if there was none
+ (might happen with a peculiar linker script such as in "map
+ addresses", map-address.exp), we grab the output section created
+ above. */
+ if (hold_text.os == NULL)
+ {
+ if (os == NULL)
+ return false;
+ hold_text.os = os;
+ }
+
snew = os->bfd_section;
bfd_section = place->os->bfd_section;
if (place->section == NULL && bfd_section == NULL)