Alpha-linux linker segmentation fault

Message ID 20190528054518.GS6820@bubble.grove.modra.org
State New
Headers show
Series
  • Alpha-linux linker segmentation fault
Related show

Commit Message

Alan Modra May 28, 2019, 5:45 a.m.
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.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 50961d75ae..6810483a05 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
 		    {