From patchwork Tue May 7 10:03:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 16730 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 59F00238FD for ; Tue, 7 May 2013 10:03:26 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id 15sf553571vea.9 for ; Tue, 07 May 2013 03:03:07 -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=bij0hTGOzZXILQu08F/gHwpUUAMOCrBfQOJpXhaR884=; b=DGyvXzNrvi7AVDOgVxKOOnTiSaek6SILWOZWq9WMRdiPJtNIt6gjBx1e9jbO9bJnaO 0O8QemD0Eo3p7eVItVANfuocQqLTd7+kQFDdBiJpw/oFFAez0ViEMbZyDsGz2WbgN6gr VKsRZBHTB5q6a182c89AgMbRv88cA5l1kN+hu9kIaoYeau6Soy92HaVVytldgQudTvCC n9yhJmADdHYQ0JtBWKU9uW3PCOEDoY+zWi84RDBn54nEvo9uiRw/xDIfpBLOM5wXsEyv iq7x0DEUEN/qHjBrq3LG0VqQfOAB8EfoqfYEFOu/8v4B3qzYlWWi9Zemu+kHIqSkmct9 Hh/Q== X-Received: by 10.236.134.132 with SMTP id s4mr833553yhi.56.1367920987837; Tue, 07 May 2013 03:03:07 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.108.167 with SMTP id hl7ls213006qeb.71.gmail; Tue, 07 May 2013 03:03:07 -0700 (PDT) X-Received: by 10.58.207.97 with SMTP id lv1mr671084vec.39.1367920987603; Tue, 07 May 2013 03:03:07 -0700 (PDT) Received: from mail-vb0-x232.google.com (mail-vb0-x232.google.com [2607:f8b0:400c:c02::232]) by mx.google.com with ESMTPS id o6si11906489vcx.62.2013.05.07.03.03.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 03:03:07 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::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:c02::232; Received: by mail-vb0-f50.google.com with SMTP id w16so291384vbb.9 for ; Tue, 07 May 2013 03:03:07 -0700 (PDT) X-Received: by 10.58.144.231 with SMTP id sp7mr678348veb.34.1367920987476; Tue, 07 May 2013 03:03:07 -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 nf2csp91511veb; Tue, 7 May 2013 03:03:06 -0700 (PDT) X-Received: by 10.204.172.80 with SMTP id k16mr348746bkz.123.1367920985720; Tue, 07 May 2013 03:03:05 -0700 (PDT) Received: from mail-bk0-x22a.google.com (mail-bk0-x22a.google.com [2a00:1450:4008:c01::22a]) by mx.google.com with ESMTPS id yu7si8918940bkb.64.2013.05.07.03.03.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 03:03:05 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:4008:c01::22a is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=2a00:1450:4008:c01::22a; Received: by mail-bk0-f42.google.com with SMTP id j4so183437bkw.29 for ; Tue, 07 May 2013 03:03:05 -0700 (PDT) X-Received: by 10.204.175.198 with SMTP id bb6mr374919bkb.9.1367920985135; Tue, 07 May 2013 03:03:05 -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 2sm6401915bki.19.2013.05.07.03.03.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 07 May 2013 03:03:04 -0700 (PDT) Message-ID: <5188D156.2070602@linaro.org> Date: Tue, 07 May 2013 11:03:02 +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/elf-ifunc.c: Add header size arg to _bfd_elf_allocate_ifunc_dyn_relocs. X-Gm-Message-State: ALoCoQnO1PZR/OY2FgMZ3cZyl3BhZ9bgyjaiMkLNtkbv+b/XHcwPveQHf/Bwh7Vla/UkJ3JvKYeR X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::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: , bfd/ChangeLog: 2013-05-07 Will Newton * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Add a plt_header_size argument for ports where it differs from plt_entry_size. * elf-bfd.h: Likewise. * elf32-i386.c: Pass plt_header_size to _bfd_elf_allocate_ifunc_dyn_relocs. * elf64-x86-64.c: Likewise. --- bfd/elf-bfd.h | 2 +- bfd/elf-ifunc.c | 3 ++- bfd/elf32-i386.c | 3 ++- bfd/elf64-x86-64.c | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index d1a7e26..4a67d02 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -2380,7 +2380,7 @@ extern bfd_boolean _bfd_elf_create_ifunc_sections (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *, struct elf_link_hash_entry *, - struct elf_dyn_relocs **, unsigned int, unsigned int); + struct elf_dyn_relocs **, unsigned int, unsigned int, unsigned int); extern void elf_append_rela (bfd *, asection *, Elf_Internal_Rela *); extern void elf_append_rel (bfd *, asection *, Elf_Internal_Rela *); diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c index ea08329..8d48e66 100644 --- a/bfd/elf-ifunc.c +++ b/bfd/elf-ifunc.c @@ -112,6 +112,7 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info, struct elf_link_hash_entry *h, struct elf_dyn_relocs **head, unsigned int plt_entry_size, + unsigned int plt_header_size, unsigned int got_entry_size) { asection *plt, *gotplt, *relplt; @@ -193,7 +194,7 @@ keep: /* If this is the first .plt entry, make room for the special first entry. */ if (plt->size == 0) - plt->size += plt_entry_size; + plt->size += plt_header_size; } else { diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 2609130..cc8b48e 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -2197,7 +2197,8 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) if (h->type == STT_GNU_IFUNC && h->def_regular) return _bfd_elf_allocate_ifunc_dyn_relocs (info, h, &eh->dyn_relocs, - plt_entry_size, 4); + plt_entry_size, + plt_entry_size, 4); else if (htab->elf.dynamic_sections_created && h->plt.refcount > 0) { diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 9adc959..758231e 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -2260,6 +2260,7 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) return _bfd_elf_allocate_ifunc_dyn_relocs (info, h, &eh->dyn_relocs, plt_entry_size, + plt_entry_size, GOT_ENTRY_SIZE); else if (htab->elf.dynamic_sections_created && h->plt.refcount > 0)