This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
powerpc64-linux-gcc -mbigtoc tls
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 31 Mar 2010 09:39:06 +1030
- Subject: powerpc64-linux-gcc -mbigtoc tls
Found when testing gcc -mbigtoc. ppc64_elf_tls_optimize decides that
an IE sequence can be optimized to LE and thus needs no GOT entry, but
relocate_section didn't edit the insns setting up the high part of the
GOT offset, so we hit an abort.
* elf64-ppc.c (ppc64_elf_relocate_section): Nop out optimized
TPREL16_HI and TPREL16_HA insns.
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.324
diff -u -p -r1.324 elf64-ppc.c
--- bfd/elf64-ppc.c 26 Mar 2010 00:35:57 -0000 1.324
+++ bfd/elf64-ppc.c 30 Mar 2010 23:00:35 -0000
@@ -11569,6 +11569,18 @@ ppc64_elf_relocate_section (bfd *output_
}
break;
+ case R_PPC64_GOT_TPREL16_HI:
+ case R_PPC64_GOT_TPREL16_HA:
+ if (tls_mask != 0
+ && (tls_mask & TLS_TPREL) == 0)
+ {
+ rel->r_offset -= d_offset;
+ bfd_put_32 (output_bfd, NOP, contents + rel->r_offset);
+ r_type = R_PPC64_NONE;
+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
+ }
+ break;
+
case R_PPC64_GOT_TPREL16_DS:
case R_PPC64_GOT_TPREL16_LO_DS:
if (tls_mask != 0
--
Alan Modra
Australia Development Lab, IBM