From patchwork Thu Apr 25 13:34:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 16395 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C3CEE2395D for ; Thu, 25 Apr 2013 13:35:14 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id i72sf5148885yha.2 for ; Thu, 25 Apr 2013 06:34:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type:content-transfer-encoding; bh=+wyMVg1EOLj7Oo9TFtDbzKzKT1gZ3tc2IgauC+TAYc0=; b=GUx6FFqTZ7RU2uk41W5ia1AHmYfZX+77QcmAGQv+3jQTE9ucvYucDqz22znxcClP5K 2tDbBb1BTe6VtC+dSU+L+44BTMPu8JltcQ0zues+JIDaXm0DOQApQw/qfupPSNwJ333A Vm+27zFMzAY87DBL+3UxGXaGeocYHuYCBHGSKtvdn8KlmptAm7pUhFkn4deqX1vfCZMW kAj6bFcIhtJ44We2ZgpzJdXl1PO9JWA9BnsBN2B+N1OLD1eMkd8mOVM/ako2ONJX9Da6 5fr9n1TG5RAvRdwNglUwMacTSzhBlBkdPijCpUM7W5M/oPlB1Yz7yY6bv35170WMn+3R FJUA== X-Received: by 10.224.160.65 with SMTP id m1mr27298740qax.2.1366896861276; Thu, 25 Apr 2013 06:34:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.232 with SMTP id k8ls1325229qer.99.gmail; Thu, 25 Apr 2013 06:34:21 -0700 (PDT) X-Received: by 10.220.175.66 with SMTP id w2mr4994578vcz.9.1366896861074; Thu, 25 Apr 2013 06:34:21 -0700 (PDT) Received: from mail-ve0-x232.google.com (mail-ve0-x232.google.com [2607:f8b0:400c:c01::232]) by mx.google.com with ESMTPS id u19si3305534vcp.2.2013.04.25.06.34.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 06:34:21 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::232 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::232; Received: by mail-ve0-f178.google.com with SMTP id c13so1269095vea.37 for ; Thu, 25 Apr 2013 06:34:21 -0700 (PDT) X-Received: by 10.52.69.109 with SMTP id d13mr850857vdu.75.1366896860999; Thu, 25 Apr 2013 06:34:20 -0700 (PDT) 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.58.127.98 with SMTP id nf2csp23043veb; Thu, 25 Apr 2013 06:34:20 -0700 (PDT) X-Received: by 10.194.93.231 with SMTP id cx7mr14546913wjb.33.1366896859660; Thu, 25 Apr 2013 06:34:19 -0700 (PDT) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [2a00:1450:400c:c00::236]) by mx.google.com with ESMTPS id u8si2398286wjx.247.2013.04.25.06.34.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 06:34:19 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::236 is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=2a00:1450:400c:c00::236; Received: by mail-wg0-f54.google.com with SMTP id y10so1435937wgg.21 for ; Thu, 25 Apr 2013 06:34:18 -0700 (PDT) X-Received: by 10.194.122.7 with SMTP id lo7mr53828684wjb.48.1366896858644; Thu, 25 Apr 2013 06:34:18 -0700 (PDT) Received: from localhost.localdomain (cpc11-seac20-2-0-cust84.7-2.cable.virginmedia.com. [81.108.156.85]) by mx.google.com with ESMTPSA id ej8sm38577086wib.9.2013.04.25.06.34.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 25 Apr 2013 06:34:17 -0700 (PDT) Message-ID: <517930D7.9090907@linaro.org> Date: Thu, 25 Apr 2013 14:34:15 +0100 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5 MIME-Version: 1.0 To: binutils@sourceware.org CC: patches@linaro.org Subject: [PATCH, AArch64] Remove some dead code from elf64_aarch64_check_relocs. X-Gm-Message-State: ALoCoQmxb6W/Xl5mVpBxSN54Lyn85lszOLdTgsj69pUOKdceZx4V5cfX/bypAdxAH678JcUZFMca X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::232 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: , This code was inherited from the ARM backend, but will never be hit due to the more restrictive test above. bfd/ChangeLog: 2013-04-25 Will Newton * elf64-aarch64.c (elf64_aarch64_check_relocs): Remove dead code. --- bfd/elf64-aarch64.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/bfd/elf64-aarch64.c b/bfd/elf64-aarch64.c index 540b275..9a6d8b4 100644 --- a/bfd/elf64-aarch64.c +++ b/bfd/elf64-aarch64.c @@ -5141,8 +5141,6 @@ elf64_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, struct elf64_aarch64_link_hash_table *htab; - unsigned long nsyms; - if (info->relocatable) return TRUE; @@ -5153,7 +5151,6 @@ elf64_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, symtab_hdr = &elf_symtab_hdr (abfd); sym_hashes = elf_sym_hashes (abfd); - nsyms = NUM_SHDR_ENTRIES (symtab_hdr); rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) @@ -5172,18 +5169,7 @@ elf64_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, return FALSE; } - if (r_symndx >= nsyms - /* PR 9934: It is possible to have relocations that do not - refer to symbols, thus it is also possible to have an - object file containing relocations but no symbol table. */ - && (r_symndx > 0 || nsyms > 0)) - { - (*_bfd_error_handler) (_("%B: bad symbol index: %d"), abfd, - r_symndx); - return FALSE; - } - - if (nsyms == 0 || r_symndx < symtab_hdr->sh_info) + if (r_symndx < symtab_hdr->sh_info) h = NULL; else {