Fix PR binutils/26356 on hppa*-*-hpux*.
[deliverable/binutils-gdb.git] / bfd / som.c
index 93a0ad89d52f7257ed2d78d5173ff1222ad89cf5..d3865f0ef6ecc4e9fabeb42314086954c1d9ca13 100644 (file)
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -5455,8 +5455,18 @@ som_bfd_copy_private_section_data (bfd *ibfd,
 
   /* Reparent if necessary.  */
   if (som_section_data (osection)->copy_data->container)
-    som_section_data (osection)->copy_data->container =
-      som_section_data (osection)->copy_data->container->output_section;
+    {
+      if (som_section_data (osection)->copy_data->container->output_section)
+       som_section_data (osection)->copy_data->container =
+         som_section_data (osection)->copy_data->container->output_section;
+      else
+       {
+         /* User has specified a subspace without its containing space.  */
+         _bfd_error_handler (_("%pB[%pA]: no output section for space %pA"),
+           obfd, osection, som_section_data (osection)->copy_data->container);
+         return FALSE;
+       }
+    }
 
   return TRUE;
 }
This page took 0.023091 seconds and 4 git commands to generate.