From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51849 invoked by alias); 16 Aug 2016 15:51:41 -0000 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 Received: (qmail 51749 invoked by uid 89); 16 Aug 2016 15:51:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.2 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Content, H*Ad:D*synopsys.com, H*RU:sk:smtprel, Hx-spam-relays-external:sk:smtprel X-HELO: smtprelay.synopsys.com Received: from smtprelay4.synopsys.com (HELO smtprelay.synopsys.com) (198.182.47.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Aug 2016 15:51:31 +0000 Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id E28AF24E1356 for ; Tue, 16 Aug 2016 08:51:29 -0700 (PDT) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id D585755F13 for ; Tue, 16 Aug 2016 08:51:29 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id BC74B55F02 for ; Tue, 16 Aug 2016 08:51:29 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id A9729AAA; Tue, 16 Aug 2016 08:51:29 -0700 (PDT) Received: from cmiranda-laptop.internal.synopsys.com (cmiranda-laptop.internal.synopsys.com [10.225.2.155]) by mailhost.synopsys.com (Postfix) with ESMTP id AF401AA6; Tue, 16 Aug 2016 08:51:28 -0700 (PDT) From: Cupertino Miranda To: binutils@sourceware.org Cc: Francois.Bedard@synopsys.com, Claudiu.Zissulescu@synopsys.com, Cupertino Miranda Subject: [PATCH 2/5] Content for TLS_IE_GOT not written to .got. Date: Tue, 16 Aug 2016 15:51:00 -0000 Message-Id: <20160816155116.23937-3-cmiranda@synopsys.com> In-Reply-To: <20160816155116.23937-1-cmiranda@synopsys.com> References: <20160816155116.23937-1-cmiranda@synopsys.com> X-SW-Source: 2016-08/txt/msg00111.txt.bz2 When no dynamic relocation was generated the .got content would not be updated for the TLS_IE_GOT relocation addresses. bfd/ChangeLog: Cupertino Miranda arc-got.h (relocate_fix_got_relocs_for_got_info): Fixed addresses in debug comments. Fixed address in .got related to TLS_IE_GOT dynamic relocation. --- bfd/arc-got.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/bfd/arc-got.h b/bfd/arc-got.h index 7c3cfd9..9ac0295 100644 --- a/bfd/arc-got.h +++ b/bfd/arc-got.h @@ -334,13 +334,15 @@ relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p, ? 4 : 0)); ARC_DEBUG ("arc_info: FIXED -> %s value = %#lx " - "@ %p, for symbol %s\n", + "@ %lx, for symbol %s\n", (entry->type == GOT_TLS_GD ? "GOT_TLS_GD" : "GOT_TLS_IE"), (long) (sym_value - sec_vma), - htab->sgot->contents + entry->offset - + (entry->existing_entries == TLS_GOT_MOD_AND_OFF - ? 4 : 0), + (long) (htab->sgot->output_section->vma + + htab->sgot->output_offset->vma + + entry->offset + + (entry->existing_entries == TLS_GOT_MOD_AND_OFF + ? 4 : 0)), symbol_name); } break; @@ -351,14 +353,22 @@ relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p, bfd_vma ATTRIBUTE_UNUSED sec_vma = tls_sec->output_section->vma; + bfd_put_32 (output_bfd, + sym_value - sec_vma, + htab->sgot->contents + entry->offset + + (entry->existing_entries == TLS_GOT_MOD_AND_OFF + ? 4 : 0)); + ARC_DEBUG ("arc_info: FIXED -> %s value = %#lx " "@ %p, for symbol %s\n", (entry->type == GOT_TLS_GD ? "GOT_TLS_GD" : "GOT_TLS_IE"), (long) (sym_value - sec_vma), - htab->sgot->contents + entry->offset - + (entry->existing_entries == TLS_GOT_MOD_AND_OFF - ? 4 : 0), + (long) (htab->sgot->output_section->vma + + htab->sgot->output_offset->vma + + entry->offset + + (entry->existing_entries == TLS_GOT_MOD_AND_OFF + ? 4 : 0)), symbol_name); } break; -- 2.9.0