public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [M68K] Fix TLS_GD relocation against localized symbol
@ 2011-02-01 15:16 Andreas Schwab
  2011-02-14  9:46 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2011-02-01 15:16 UTC (permalink / raw)
  To: binutils

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."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [M68K] Fix TLS_GD relocation against localized symbol
  2011-02-01 15:16 [M68K] Fix TLS_GD relocation against localized symbol Andreas Schwab
@ 2011-02-14  9:46 ` Andreas Schwab
  2011-02-22 15:32   ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2011-02-14  9:46 UTC (permalink / raw)
  To: binutils

Ping.

Andreas.

-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [M68K] Fix TLS_GD relocation against localized symbol
  2011-02-14  9:46 ` Andreas Schwab
@ 2011-02-22 15:32   ` Nick Clifton
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2011-02-22 15:32 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: binutils

Hi Andreas,

> Ping.

Oops, sorry:

 > 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.

Approved - please apply.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-22 15:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-01 15:16 [M68K] Fix TLS_GD relocation against localized symbol Andreas Schwab
2011-02-14  9:46 ` Andreas Schwab
2011-02-22 15:32   ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).