From patchwork Fri Mar 14 15:50:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 26270 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0BC4B202DD for ; Fri, 14 Mar 2014 15:50:48 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf9268975iec.4 for ; Fri, 14 Mar 2014 08:50:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:subject:date :message-id:x-original-sender:x-original-authentication-results; bh=Lm2SGQWWvRxJ9dMFsHJZe5eedBpZt24AFDdBd7xrPfo=; b=FVNCNwVH7BXBhkmFslbCyLLeGGbi/fH9aDr2WT1AUw6ypBl+n5Np8+Zs7zVsrAlzhk lCdJfVFWpsvsaPBiLj/LQZAZfw5LTTLIT/NSRC8myUYkJWep5TD0yQSJCBIemgRzI/tR YJQ2Yfe9tVQTjX5vWYYWbvMceDUSl2LLgdp/2ARUC9RIUHbarzrOortPdHwYrQmQC5Gu bgwmXleE5QM5kO7DgA+OIMBWPbXxrPOGpFxcGeR9/Lfij3vUlqDBfY8BnPkvzSLG3gwM /qlstb+Hsg1TEghL+Yo4PLl3wBKizR5hHrM+TitY0NYbrjFXzw0Y6hgfAlmaOQFs0eWP KTww== X-Gm-Message-State: ALoCoQlvWCWaLRpioQlWSaBWrcA+GEtZoB5PmgfRfZP6nK6N4OpDGni3/BMEQGVaHcMA7PTXns55 X-Received: by 10.42.75.10 with SMTP id y10mr3154345icj.19.1394812248538; Fri, 14 Mar 2014 08:50:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.161 with SMTP id o30ls793823qga.94.gmail; Fri, 14 Mar 2014 08:50:48 -0700 (PDT) X-Received: by 10.221.40.10 with SMTP id to10mr6849518vcb.22.1394812248405; Fri, 14 Mar 2014 08:50:48 -0700 (PDT) Received: from mail-ve0-x22d.google.com (mail-ve0-x22d.google.com [2607:f8b0:400c:c01::22d]) by mx.google.com with ESMTPS id fi2si2234751vdb.153.2014.03.14.08.50.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Mar 2014 08:50:48 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22d; Received: by mail-ve0-f173.google.com with SMTP id oy12so2850093veb.4 for ; Fri, 14 Mar 2014 08:50:48 -0700 (PDT) X-Received: by 10.58.123.70 with SMTP id ly6mr1485624veb.26.1394812248338; Fri, 14 Mar 2014 08:50:48 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp29027vck; Fri, 14 Mar 2014 08:50:47 -0700 (PDT) X-Received: by 10.66.49.74 with SMTP id s10mr10087670pan.0.1394812247476; Fri, 14 Mar 2014 08:50:47 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id ey10si4117935pab.188.2014.03.14.08.50.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Mar 2014 08:50:47 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-return-83145-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 22398 invoked by alias); 14 Mar 2014 15:50:31 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Subscribe: List-Archive: List-Post: , List-Help: , Sender: binutils-owner@sourceware.org Delivered-To: mailing list binutils@sourceware.org Received: (qmail 22389 invoked by uid 89); 14 Mar 2014 15:50:30 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f170.google.com Received: from mail-we0-f170.google.com (HELO mail-we0-f170.google.com) (74.125.82.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 14 Mar 2014 15:50:28 +0000 Received: by mail-we0-f170.google.com with SMTP id w61so2315340wes.29 for ; Fri, 14 Mar 2014 08:50:25 -0700 (PDT) X-Received: by 10.180.100.103 with SMTP id ex7mr6833339wib.24.1394812225225; Fri, 14 Mar 2014 08:50:25 -0700 (PDT) Received: from localhost.localdomain (cpc6-seac21-2-0-cust453.7-2.cable.virginm.net. [82.1.113.198]) by mx.google.com with ESMTPSA id fo6sm17859841wib.7.2014.03.14.08.50.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Mar 2014 08:50:24 -0700 (PDT) From: Will Newton To: binutils@sourceware.org Subject: [PATCH] bfd/elfnn-aarch64.c: Fix calculation of DT_RELASZ Date: Fri, 14 Mar 2014 15:50:20 +0000 Message-Id: <1394812220-15667-1-git-send-email-will.newton@linaro.org> X-IsSubscribed: yes X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22d 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; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 The current code subtracts the size of the output section containing relplt from RELASZ. In some cases this will be the same output section as the dynamic relocs causing a value of zero to be output. Calculating the size from input sections seems to make more sense. bfd/ChangeLog: 2014-03-14 Will Newton * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections): Set value of DT_PLTRELSZ and DT_RELASZ based on the size of input sections rather than output sections. --- bfd/elfnn-aarch64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index c2adcc9..638938d 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -6993,7 +6993,7 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd, break; case DT_PLTRELSZ: - s = htab->root.srelplt->output_section; + s = htab->root.srelplt; dyn.d_un.d_val = s->size; break; @@ -7007,7 +7007,7 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd, about changing the DT_RELA entry. */ if (htab->root.srelplt != NULL) { - s = htab->root.srelplt->output_section; + s = htab->root.srelplt; dyn.d_un.d_val -= s->size; } break;