From 28fbeab8064f97ca5fe1a851fdc4146b7aed8863 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 28 May 2019 15:06:47 +0930 Subject: [PATCH] Alpha-linux linker segmentation fault 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 | 7 +++++++ bfd/elf64-alpha.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index de58a02a174..1d8b75dda1a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2019-05-28 Alan Modra + + 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 PR 24596 diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 50961d75aec..6810483a059 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -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 { -- 2.30.2