From 62912a6532427e89e395f5791187fed573c87e84 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Fri, 19 Jul 2002 02:56:59 +0000 Subject: [PATCH] * emultempl/mmo.em (mmo_place_orphan): Handle case of no .text output section. --- ld/ChangeLog | 5 +++++ ld/emultempl/mmo.em | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/ld/ChangeLog b/ld/ChangeLog index 876110fc2..1443cc62f 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2002-07-19 Hans-Peter Nilsson + + * emultempl/mmo.em (mmo_place_orphan): Handle case of no .text + output section. + 2002-07-16 Denis Chertykov Nick Clifton Frank Ch. Eigler diff --git a/ld/emultempl/mmo.em b/ld/emultempl/mmo.em index d8675bf39..23bab1653 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) -- 2.11.4.GIT