[PATCH/AARCH64] Fix TLS for ILP32

Andrew Pinski pinskia@gmail.com
Tue Aug 13 00:33:00 GMT 2013


Hi,
  In ILP32, the thread control block is 2 pointers or 4 byte in size.
This patch fixes the code so that it uses the correct offset for the
TLS variables.

OK?  Built and tested on aarch64-linux-gnu with no regressions.

Thanks,
Andrew

ChangeLog:
* elfnn-aarch64.c (TCB_SIZE): Base on the ARCH_SIZE rather than a
fixed size of 16.
-------------- next part --------------
? bfd/.elfnn-aarch64.c.swp
Index: bfd/elfnn-aarch64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfnn-aarch64.c,v
retrieving revision 1.9
diff -u -p -r1.9 elfnn-aarch64.c
--- bfd/elfnn-aarch64.c	28 Jul 2013 03:29:41 -0000	1.9
+++ bfd/elfnn-aarch64.c	13 Aug 2013 00:33:05 -0000
@@ -1666,8 +1666,8 @@ _aarch64_elf_section_data;
 #define elf_aarch64_section_data(sec) \
   ((_aarch64_elf_section_data *) elf_section_data (sec))
 
-/* The size of the thread control block.  */
-#define TCB_SIZE	16
+/* The size of the thread control block which is defined to be two pointers.  */
+#define TCB_SIZE	(ARCH_SIZE/8)*2
 
 struct elf_aarch64_local_symbol
 {


More information about the Binutils mailing list