Alpha-linux linker segmentation fault
authorAlan Modra <amodra@gmail.com>
Tue, 28 May 2019 05:36:47 +0000 (15:06 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 28 May 2019 05:41:54 +0000 (15:11 +0930)
This patch cures a linker segfault, and "FAIL: Build pr22263-1".

PR 24596
* elf64-alpha.c (elf64_alpha_relocate_section): Don't attempt
to emit R_ALPHA_GOTTPREL in PIEs, for which no space is
allocated in alpha_dynamic_entries_for_reloc.

bfd/ChangeLog
bfd/elf64-alpha.c

index de58a02a174ef44103ee7233c99e5f70421b72b8..1d8b75dda1af6fd14cdafc22a332521a8eda862d 100644 (file)
@@ -1,3 +1,10 @@
+2019-05-28  Alan Modra  <amodra@gmail.com>
+
+       PR 24596
+       * elf64-alpha.c (elf64_alpha_relocate_section): Don't attempt
+       to emit R_ALPHA_GOTTPREL in PIEs, for which no space is
+       allocated in alpha_dynamic_entries_for_reloc.
+
 2019-05-28  Alan Modra  <amodra@gmail.com>
 
        PR 24596
index 50961d75aecd3a9f6885cc20a30cdc424d406194..6810483a0590966810bc9b464a700d075a9dd36d 100644 (file)
@@ -4724,7 +4724,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                  BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);
                  if (r_type == R_ALPHA_GOTDTPREL)
                    value -= dtp_base;
-                 else if (!bfd_link_pic (info))
+                 else if (bfd_link_executable (info))
                    value -= tp_base;
                  else
                    {