PR22537, Segmentation fault with static PIE
authorAlan Modra <amodra@gmail.com>
Thu, 19 Apr 2018 04:43:41 +0000 (14:13 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 19 Apr 2018 05:52:25 +0000 (15:22 +0930)
The only stub type that makes sense for undefined symbols, or those
defined in shared libraries, is a plt call stub.  This patch arranges
to have "destination" set to -1 on such symbols, making for an easy
test in hppa_type_of_stub.

PR 22537
* elf32-hppa.c (elf32_hppa_size_stubs): Init "destination" to -1.
(hppa_type_of_stub): Don't return a long branch stub for
symbols other than those defined statically.

bfd/ChangeLog
bfd/elf32-hppa.c

index 2d896412e07003824170dae043fd2f969501283e..d92c334f3a5bb86248165a9adc307ba49db8855f 100644 (file)
@@ -1,3 +1,10 @@
+2018-04-19  Alan Modra  <amodra@gmail.com>
+
+       PR 22537
+       * elf32-hppa.c (elf32_hppa_size_stubs): Init "destination" to -1.
+       (hppa_type_of_stub): Don't return a long branch stub for
+       symbols other than those defined statically.
+
 2018-04-19  Alan Modra  <amodra@gmail.com>
 
        * Makefile.am: Revert 2018-04-18 coff-mips changes.
index 3ce38078b8d6f8ebce3b490b375a0108d0d5383d..44fb753c0ea2ca354dfde611baff8fdf2fa5f336 100644 (file)
@@ -612,6 +612,9 @@ hppa_type_of_stub (asection *input_sec,
       return hppa_stub_import;
     }
 
+  if (destination == (bfd_vma) -1)
+    return hppa_stub_none;
+
   /* Determine where the call point is.  */
   location = (input_sec->output_offset
              + input_sec->output_section->vma
@@ -2843,7 +2846,7 @@ elf32_hppa_size_stubs
                     section.  */
                  sym_sec = NULL;
                  sym_value = 0;
-                 destination = 0;
+                 destination = -1;
                  hh = NULL;
                  if (r_indx < symtab_hdr->sh_info)
                    {
This page took 0.027352 seconds and 4 git commands to generate.