From patchwork Mon May 13 11:59:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 16878 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8500625E14 for ; Mon, 13 May 2013 12:00:32 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id b10sf8335294qen.5 for ; Mon, 13 May 2013 05:00:00 -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=iAnwTFtyuCuw1vKYQQKqhmlYKfk340MAQ6wFAiWQrbY=; b=aYcA0kQzI1CjPkdcego5U9Nh8UMuOO2dfpk20houLr/M9Y+mwyorCbf7gyYtIOB2qy hdwYE6MUoBcJ2DbdhYykKuKHD3evgHu9K0MtieXbFURKafXgfPjbT4dmaWPvEt1B/7vv 4pH+AxOihY2clYIgjx8HeSURtRj1irh52IaF22D8NbyuKpBAUMTukU2esdePCbShO7am ctu2lokiO77qfLvnwrTXWOXO66j9GwxOj6W/JKcjWgfrH2AtmJRA09WIvd4CbkA/z5wW aLAUJtrtaTbcI+mute7p0g3aksDxNrq5m8idWZfHdjZahab+MsSeNTLuV16WsY+skn/v Z0fw== X-Received: by 10.236.170.36 with SMTP id o24mr14834773yhl.2.1368446400153; Mon, 13 May 2013 05:00:00 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.8 with SMTP id e8ls1433123qey.6.gmail; Mon, 13 May 2013 04:59:59 -0700 (PDT) X-Received: by 10.52.22.164 with SMTP id e4mr15418478vdf.56.1368446399859; Mon, 13 May 2013 04:59:59 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id gs2si8261640vdc.76.2013.05.13.04.59.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 May 2013 04:59:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hz10so5460511vcb.10 for ; Mon, 13 May 2013 04:59:59 -0700 (PDT) X-Received: by 10.52.36.115 with SMTP id p19mr1270899vdj.8.1368446399703; Mon, 13 May 2013 04:59:59 -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.220.217.15 with SMTP id hk15csp15857vcb; Mon, 13 May 2013 04:59:59 -0700 (PDT) X-Received: by 10.204.174.143 with SMTP id t15mr5403192bkz.37.1368446398426; Mon, 13 May 2013 04:59:58 -0700 (PDT) Received: from mail-bk0-x22f.google.com (mail-bk0-x22f.google.com [2a00:1450:4008:c01::22f]) by mx.google.com with ESMTPS id ts9si1002327bkb.24.2013.05.13.04.59.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 May 2013 04:59:58 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:4008:c01::22f is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=2a00:1450:4008:c01::22f; Received: by mail-bk0-f47.google.com with SMTP id jg9so2366600bkc.20 for ; Mon, 13 May 2013 04:59:57 -0700 (PDT) X-Received: by 10.204.119.77 with SMTP id y13mr5505696bkq.64.1368446397439; Mon, 13 May 2013 04:59:57 -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 cl14sm2059656bkb.6.2013.05.13.04.59.55 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 13 May 2013 04:59:56 -0700 (PDT) Message-ID: <5190D5BB.3040601@linaro.org> Date: Mon, 13 May 2013 12:59:55 +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] bfd/elf64-aarch64.c: Remove dead code. X-Gm-Message-State: ALoCoQkKr7xrY7GmYvt1Bm9RsnBVuuerGG8svfP1Pv3sqZKMCUF5PRhv/pCvebUNPKviDorQBOJA X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 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: , The relocs_copied member is never assigned a non-NULL value, so this code does not appear to be used. 2013-05-13 Will Newton * bfd/elf64-aarch64.c (elf64_aarch64_link_hash_entry): Remove relocs_copied member. (elf64_aarch64_link_hash_newfunc): Remove initialization of relocs_copied member. (elf64_aarch64_copy_indirect_symbol): Remove code to copy relocs_copied member. --- bfd/elf64-aarch64.c | 55 ----------------------------------------------------- 1 file changed, 55 deletions(-) diff --git a/bfd/elf64-aarch64.c b/bfd/elf64-aarch64.c index e3cae95..4a9dda5 100644 --- a/bfd/elf64-aarch64.c +++ b/bfd/elf64-aarch64.c @@ -1730,26 +1730,6 @@ elf64_aarch64_mkobject (bfd *abfd) AARCH64_ELF_DATA); } -/* The AArch64 linker needs to keep track of the number of relocs that it - decides to copy in check_relocs for each symbol. This is so that - it can discard PC relative relocs if it doesn't need them when - linking with -Bsymbolic. We store the information in a field - extending the regular ELF linker hash table. */ - -/* This structure keeps track of the number of relocs we have copied - for a given symbol. */ -struct elf64_aarch64_relocs_copied -{ - /* Next section. */ - struct elf64_aarch64_relocs_copied *next; - /* A section in dynobj. */ - asection *section; - /* Number of relocs copied in this section. */ - bfd_size_type count; - /* Number of PC-relative relocs copied in this section. */ - bfd_size_type pc_count; -}; - #define elf64_aarch64_hash_entry(ent) \ ((struct elf64_aarch64_link_hash_entry *)(ent)) @@ -1769,9 +1749,6 @@ struct elf64_aarch64_link_hash_entry /* Track dynamic relocs copied for this symbol. */ struct elf_dyn_relocs *dyn_relocs; - /* Number of PC relative relocs copied for this symbol. */ - struct elf64_aarch64_relocs_copied *relocs_copied; - /* Since PLT entries have variable size, we need to record the index into .got.plt instead of recomputing it from the PLT offset. */ @@ -1950,7 +1927,6 @@ elf64_aarch64_link_hash_newfunc (struct bfd_hash_entry *entry, if (ret != NULL) { ret->dyn_relocs = NULL; - ret->relocs_copied = NULL; ret->got_type = GOT_UNKNOWN; ret->plt_got_offset = (bfd_vma) - 1; ret->stub_cache = NULL; @@ -2041,37 +2017,6 @@ elf64_aarch64_copy_indirect_symbol (struct bfd_link_info *info, eind->dyn_relocs = NULL; } - if (eind->relocs_copied != NULL) - { - if (edir->relocs_copied != NULL) - { - struct elf64_aarch64_relocs_copied **pp; - struct elf64_aarch64_relocs_copied *p; - - /* Add reloc counts against the indirect sym to the direct sym - list. Merge any entries against the same section. */ - for (pp = &eind->relocs_copied; (p = *pp) != NULL;) - { - struct elf64_aarch64_relocs_copied *q; - - for (q = edir->relocs_copied; q != NULL; q = q->next) - if (q->section == p->section) - { - q->pc_count += p->pc_count; - q->count += p->count; - *pp = p->next; - break; - } - if (q == NULL) - pp = &p->next; - } - *pp = edir->relocs_copied; - } - - edir->relocs_copied = eind->relocs_copied; - eind->relocs_copied = NULL; - } - if (ind->root.type == bfd_link_hash_indirect) { /* Copy over PLT info. */