Add support for non-contiguous memory regions
[deliverable/binutils-gdb.git] / bfd / elf32-hppa.c
index b1b0f8284c41f876e46bdc651f2bbe42bc07d76b..9760b751612b6dde409316e53b9d257f1e6622bd 100644 (file)
@@ -731,6 +731,17 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
   switch (hsh->stub_type)
     {
     case hppa_stub_long_branch:
+      /* Fail if the target section could not be assigned to an output
+        section.  The user should fix his linker script.  */
+      if (hsh->target_section->output_section == NULL
+         && info->non_contiguous_regions)
+       {
+         _bfd_error_handler (_("Could not assign '%pA' to an output section. "
+                               "Retry without --enable-non-contiguous-regions.\n"),
+                             hsh->target_section);
+         abort();
+    }
+
       /* Create the long branch.  A long branch is formed with "ldil"
         loading the upper bits of the target address into a register,
         then branching with "be" which adds in the lower bits.
@@ -751,6 +762,16 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
       break;
 
     case hppa_stub_long_branch_shared:
+      /* Fail if the target section could not be assigned to an output
+        section.  The user should fix his linker script.  */
+      if (hsh->target_section->output_section == NULL
+         && info->non_contiguous_regions)
+       {
+         _bfd_error_handler (_("Could not assign %pA to an output section. "
+                               "Retry without --enable-non-contiguous-regions.\n"),
+                             hsh->target_section);
+         abort();
+    }
       /* Branches are relative.  This is where we are going to.  */
       sym_value = (hsh->target_value
                   + hsh->target_section->output_offset
@@ -823,6 +844,16 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
       break;
 
     case hppa_stub_export:
+      /* Fail if the target section could not be assigned to an output
+        section.  The user should fix his linker script.  */
+      if (hsh->target_section->output_section == NULL
+         && info->non_contiguous_regions)
+       {
+         _bfd_error_handler (_("Could not assign %pA to an output section. "
+                               "Retry without --enable-non-contiguous-regions.\n"),
+                             hsh->target_section);
+         abort();
+    }
       /* Branches are relative.  This is where we are going to.  */
       sym_value = (hsh->target_value
                   + hsh->target_section->output_offset
This page took 0.024497 seconds and 4 git commands to generate.