From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30406 invoked by alias); 1 Feb 2011 15:16:35 -0000 Received: (qmail 30390 invoked by uid 22791); 1 Feb 2011 15:16:33 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Feb 2011 15:16:29 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p11FGSMv018537 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Feb 2011 10:16:28 -0500 Received: from hase (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p11FGQMw019929 for ; Tue, 1 Feb 2011 10:16:27 -0500 From: Andreas Schwab To: binutils@sourceware.org Subject: [M68K] Fix TLS_GD relocation against localized symbol X-Yow: .. hubub, hubub, HUBUB, hubub, hubub, hubub, HUBUB, hubub, hubub, hubub. Date: Tue, 01 Feb 2011 15:16:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-02/txt/msg00008.txt.bz2 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 * 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."