* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
authorAlan Modra <amodra@gmail.com>
Sat, 20 Jul 2002 13:41:11 +0000 (13:41 +0000)
committerAlan Modra <amodra@gmail.com>
Sat, 20 Jul 2002 13:41:11 +0000 (13:41 +0000)
bomb on /DISCARD/ input section.
* emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
* emultempl/mmo.em (mmo_place_orphan): Likewise.

ld/ChangeLog
ld/emultempl/elf32.em
ld/emultempl/mmo.em
ld/emultempl/pe.em

index 1443cc62f0f336815191ae33ca5cf8929008968c..01ee8c576dafac443079cdc1e09de5856c246370 100644 (file)
@@ -1,3 +1,10 @@
+2002-07-20  Alan Modra  <amodra@bigpond.net.au>
+
+       * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
+       bomb on /DISCARD/ input section.
+       * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+       * emultempl/mmo.em (mmo_place_orphan): Likewise.
+
 2002-07-19  Hans-Peter Nilsson  <hp@bitrange.com>
 
        * emultempl/mmo.em (mmo_place_orphan): Handle case of no .text
index 58a1ccc0bcbaf165238055ff25c6bdafdf25fb23..26e4c46297f89742c5a358e2852ad8bc236f2f72 100644 (file)
@@ -1249,7 +1249,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
   /* Restore the global list pointer.  */
   stat_ptr = old;
 
-  if (place != NULL)
+  if (place != NULL && os->bfd_section != NULL)
     {
       asection *snew, **pps;
 
index 23bab1653764b0883ef1f93ae592f61afe4ceffe..8b17dcc2ac7c38646531c993a2ac99fbd55482aa 100644 (file)
@@ -152,6 +152,11 @@ mmo_place_orphan (file, s)
   /* Restore the global list pointer.  */
   stat_ptr = old;
 
+  snew = os->bfd_section;
+  if (snew == NULL)
+    /* /DISCARD/ section.  */
+    return true;
+
   /* 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
@@ -163,7 +168,6 @@ mmo_place_orphan (file, s)
       hold_text.os = os;
     }
 
-  snew = os->bfd_section;
   bfd_section = place->os->bfd_section;
   if (place->section == NULL && bfd_section == NULL)
     bfd_section = output_prev_sec_find (place->os);
index a6dfe46373756ae0ca21589c98283627eea548f3..37146ab59f843f9e248f9232f3812e269233a16c 100644 (file)
@@ -1668,7 +1668,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
 
       stat_ptr = old;
 
-      if (place != NULL)
+      if (place != NULL && os->bfd_section != NULL)
        {
          asection *snew, **pps;
 
This page took 0.030242 seconds and 4 git commands to generate.