From patchwork Thu Dec 19 07:23:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 22628 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0D10523FCA for ; Thu, 19 Dec 2013 07:23:45 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id a41sf866729yho.8 for ; Wed, 18 Dec 2013 23:23:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=kvc4qv0xJc86WTNW38w04LpjZeCSmI16bNmy7Ee+dvA=; b=DNM8qzvXybYEd1LuBZvA1YIq0vztfolCm2oRHmWfc7RdV/aPEtM21XhAPowpeGXjt6 FNtXK1T+Tt15RW/wVXabGi9cR1B7IMkYNzeuQ1VjgjHKD1+x1+bTjoAgFZWlBVF9IlOM zbSUjefaM9WF9E01Xg2RXkPe2jmiR2hy8yKpy5q4kbQVootw1NroQD1FiFSLjT9vBq77 MIcb/Yg0GUYknpTx/lIab3qxUUg2uTT6dnWdP0ljDiit8bzF+5PuxLEUsPCcROTLfCe4 x219dAUq6tiYiBs5bcQPT0HyjPmHwX4l2uLx2nb3v5DjfbaX7nQmYGlZEtkxm9hi97dy V4bQ== X-Gm-Message-State: ALoCoQkk0N0eQMa+JbBOkqUQPY5oOyZ3vKezZ243646NTINWauHDKpeiovcskmFqzeC7r3NiQDsF X-Received: by 10.58.50.161 with SMTP id d1mr8536veo.24.1387437824554; Wed, 18 Dec 2013 23:23:44 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.85.162 with SMTP id i2ls292148qez.39.gmail; Wed, 18 Dec 2013 23:23:44 -0800 (PST) X-Received: by 10.58.144.168 with SMTP id sn8mr14777veb.33.1387437824443; Wed, 18 Dec 2013 23:23:44 -0800 (PST) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id t2si519402vem.142.2013.12.18.23.23.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 23:23:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id oy12so442284veb.29 for ; Wed, 18 Dec 2013 23:23:44 -0800 (PST) X-Received: by 10.220.16.73 with SMTP id n9mr7428vca.24.1387437824363; Wed, 18 Dec 2013 23:23:44 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp299161ved; Wed, 18 Dec 2013 23:23:42 -0800 (PST) X-Received: by 10.67.30.70 with SMTP id kc6mr46502pad.32.1387437822374; Wed, 18 Dec 2013 23:23:42 -0800 (PST) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id xu5si1867269pab.312.2013.12.18.23.23.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 23:23:42 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of kugan.vivekanandarajah@linaro.org) client-ip=209.85.220.47; Received: by mail-pa0-f47.google.com with SMTP id kq14so782830pab.34 for ; Wed, 18 Dec 2013 23:23:41 -0800 (PST) X-Received: by 10.68.195.70 with SMTP id ic6mr4357063pbc.112.1387437821403; Wed, 18 Dec 2013 23:23:41 -0800 (PST) Received: from [192.168.0.100] ([1.148.182.42]) by mx.google.com with ESMTPSA id yd4sm4951694pbc.13.2013.12.18.23.23.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 23:23:40 -0800 (PST) Message-ID: <52B29EF7.7040209@linaro.org> Date: Thu, 19 Dec 2013 18:23:35 +1100 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: binutils@sourceware.dot.org CC: Marcus Shawcroft , Michael Hudson-Doyle , "patches@linaro.org" Subject: [ Bug 16340][AARCH64][PATCH] Offset into GOT for TLS relocation computed inconsistently X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi, mongodb for aarch64 segfaults due to an error in applying GOT for TLS relocation. Michael Hudson-Doyle tracked this down to wrong usage of offset for the relocation. Attached patch (by Michael Hudson-Doyle) fixes this. Regression tested on aarch64-none-linux-gnu with no new regressions. Is this OK for trunk and backport for 2.24? Thanks, Kugan bfd/ +2013-12-19 Michael Hudson-Doyle + + * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use correct + offset for GOT in TLS while calculating relocation address. + diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 8f0e716..e1ab769 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -3831,7 +3831,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto, value = (symbol_got_offset (input_bfd, h, r_symndx) + globals->root.sgot->output_section->vma - + globals->root.sgot->output_section->output_offset); + + globals->root.sgot->output_offset); value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value, 0, weak_undef_p); @@ -3863,7 +3863,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto, value = (symbol_tlsdesc_got_offset (input_bfd, h, r_symndx) + globals->root.sgotplt->output_section->vma - + globals->root.sgotplt->output_section->output_offset + + globals->root.sgotplt->output_offset + globals->sgotplt_jump_table_size); value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,