This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[M68K] Fix TLS_GD relocation against localized symbol
- From: Andreas Schwab <schwab at redhat dot com>
- To: binutils at sourceware dot org
- Date: Tue, 01 Feb 2011 16:16:26 +0100
- Subject: [M68K] Fix TLS_GD relocation against localized symbol
A TLS_GD relocation is associated with two GOT slots, with the
relocation value actually being put in the second slot. When adjusting
this relocation against a localized symbol read the value from the
second slot, not the first one.
Andreas.
2011-02-01 Andreas Schwab <schwab@redhat.com>
* elf32-m68k.c (elf_m68k_finish_dynamic_symbol): For a TLS_GD
relocation read the value from the second GOT slot.
Index: elf32-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68k.c,v
retrieving revision 1.124
diff -a -u -p -a -u -p -r1.124 elf32-m68k.c
--- elf32-m68k.c 25 Oct 2010 15:54:14 -0000 1.124
+++ elf32-m68k.c 1 Feb 2011 15:01:39 -0000
@@ -1,6 +1,6 @@
/* Motorola 68k series support for 32-bit ELF
Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -4390,6 +4390,11 @@ elf_m68k_finish_dynamic_symbol (output_b
break;
case R_68K_TLS_GD32:
+ /* The value for this relocation is actually put in
+ the second GOT slot. */
+ relocation = bfd_get_signed_32 (output_bfd,
+ (sgot->contents
+ + got_entry_offset + 4));
relocation += dtpoff_base (info);
break;
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."