From patchwork Thu Jan 29 12:43:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 43925 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7370A24119 for ; Thu, 29 Jan 2015 12:45:30 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf19442607lbj.0 for ; Thu, 29 Jan 2015 04:45:29 -0800 (PST) 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=NV1i5awLKx/m5Hae2HWi2zDtp3DOhIaMIT+6Bsphe80=; b=TrTrusf1HU3P7vBGU/EciSsgbSZCsqNMEkrbfcn6YOMaJ690CwxZGzFWKx/FJzRTPy hKklzKLlbD7nDWAvcNremPuyHTHf6Pj7B4YWIlmpy4s1EYk4PInUjbxEXxAMhid8XFue Aw9OIuSS+LxpZxA5biXAVL0Nkq/dX2oPVcwv4KhoH95n+IDoOHjpgwuPB09J5GWf5mta NDkJ0JTHyZCJB2oa4LHRm3tFLESUYuOaqgrTFfRuNVzDLuMb8vUaRWl5c4zaWgpdjWy6 sEkiv9BZ5O5npT8g83fLUuB6URf7mtFCRiSkJ7xTQ0xCuea0B3dCRiiyloTdc1ZxeB4n jXpA== X-Gm-Message-State: ALoCoQmmhmupQycBWM2e/YNzvoXFyxTdi32zvGXow5+tydkrbDLmNOu/jmK6IAm/sZXVsjzOwLPH X-Received: by 10.112.167.166 with SMTP id zp6mr60951lbb.5.1422535529432; Thu, 29 Jan 2015 04:45:29 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.133 with SMTP id k5ls271610lah.48.gmail; Thu, 29 Jan 2015 04:45:29 -0800 (PST) X-Received: by 10.152.43.103 with SMTP id v7mr390345lal.29.1422535529290; Thu, 29 Jan 2015 04:45:29 -0800 (PST) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com. [2a00:1450:4010:c04::22e]) by mx.google.com with ESMTPS id em9si7258211lbc.102.2015.01.29.04.45.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 04:45:29 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22e as permitted sender) client-ip=2a00:1450:4010:c04::22e; Received: by mail-lb0-f174.google.com with SMTP id f15so27635673lbj.5 for ; Thu, 29 Jan 2015 04:45:29 -0800 (PST) X-Received: by 10.112.188.227 with SMTP id gd3mr544878lbc.22.1422535529171; Thu, 29 Jan 2015 04:45:29 -0800 (PST) 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.112.35.133 with SMTP id h5csp1750603lbj; Thu, 29 Jan 2015 04:45:28 -0800 (PST) X-Received: by 10.68.224.234 with SMTP id rf10mr473886pbc.124.1422535527518; Thu, 29 Jan 2015 04:45:27 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id vt3si9820710pbc.51.2015.01.29.04.45.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jan 2015 04:45:27 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-return-86250-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 22223 invoked by alias); 29 Jan 2015 12:43:39 -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 20959 invoked by uid 89); 29 Jan 2015 12:43:38 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f180.google.com Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 29 Jan 2015 12:43:36 +0000 Received: by mail-wi0-f180.google.com with SMTP id h11so24010180wiw.1 for ; Thu, 29 Jan 2015 04:43:33 -0800 (PST) X-Received: by 10.194.57.43 with SMTP id f11mr918432wjq.6.1422535412758; Thu, 29 Jan 2015 04:43:32 -0800 (PST) Received: from localhost.localdomain.localdomain (cpc16-seac21-2-0-cust244.7-2.cable.virginm.net. [82.17.33.245]) by mx.google.com with ESMTPSA id hn2sm10328522wjc.5.2015.01.29.04.43.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jan 2015 04:43:32 -0800 (PST) From: Will Newton To: binutils@sourceware.org Subject: [PATCH] bfd/elfnn-aarch64.c: Set st_value to zero for undefined symbols Date: Thu, 29 Jan 2015 12:43:27 +0000 Message-Id: <1422535407-4597-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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22e as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 Unless pointer_equality_needed is set then set st_value to be zero for undefined symbols. This relates to BZ #16715. bfd/ChangeLog: 2015-01-28 Will Newton * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Set st_value to zero for undefined symbols unless pointer_equality_needed. --- bfd/elfnn-aarch64.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 37de7fa..ee718c5 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -7441,6 +7441,12 @@ elfNN_aarch64_finish_dynamic_symbol (bfd *output_bfd, comparisons work between an application and shared library. */ sym->st_shndx = SHN_UNDEF; + /* If the symbol is weak, we do need to clear the value. + Otherwise, the PLT entry would provide a definition for + the symbol even if the symbol wasn't defined anywhere, + and so the symbol would never be NULL. */ + if (!h->ref_regular_nonweak || !h->pointer_equality_needed) + sym->st_value = 0; } }