From patchwork Fri Oct 28 04:16:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Anand X-Patchwork-Id: 9401093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A8BB16022E for ; Fri, 28 Oct 2016 04:18:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 938A02A540 for ; Fri, 28 Oct 2016 04:18:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 828852A544; Fri, 28 Oct 2016 04:18:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 082132A540 for ; Fri, 28 Oct 2016 04:18:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bzyb4-0006MU-5y; Fri, 28 Oct 2016 04:16:50 +0000 Received: from mail-qk0-f174.google.com ([209.85.220.174]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bzyaz-0006KJ-Qu for linux-arm-kernel@lists.infradead.org; Fri, 28 Oct 2016 04:16:46 +0000 Received: by mail-qk0-f174.google.com with SMTP id z190so72491168qkc.2 for ; Thu, 27 Oct 2016 21:16:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VYHDH9OToiUbkq09+P+DTZZsaCEhaPneCDQShKE7NX4=; b=Mqim9giwCMNK58u7smQcGp+/D1ZLBQqd5XwQNksTi3Dnv4YUT5HscXDH7j4ZYW5BOR f0ry0mckQ1oyrEXEI8kY6MNCf/SgAtix0rLbD1VMIS5YD5HKc0phxzmeCQub/UHYLBNr pK8ZOIHvT0+htLUddOAWuXvfeEIkKl7o2Aw2HFUyKJDHeHf9H9fENLKCzf2uLq/rHp9E w0hqgNUuiyTulDij0pCQ/ycJOK9Rq0UPRXtZSzyg83SUIrLK1D0NljrhkuP5D8Wurwgm 2l0P4YF/NeBhZ8OUAJLQZGroUDn0dzB9LbBYVI1eJBaYuvAxuTBdqP43S29vhBb5U7zQ JRow== X-Gm-Message-State: ABUngvcG2DjvZbmoBzVY80PY77KWNLFStxYXDUkOGsnCj3YaANNr6hayGiI0nfITwYnxhvaS X-Received: by 10.55.6.14 with SMTP id 14mr4874374qkg.167.1477628183403; Thu, 27 Oct 2016 21:16:23 -0700 (PDT) Received: from localhost ([122.180.204.166]) by smtp.gmail.com with ESMTPSA id p13sm5427780qtp.20.2016.10.27.21.16.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Oct 2016 21:16:22 -0700 (PDT) From: Pratyush Anand To: geoff@infradead.org, horms@verge.net.au Subject: [PATCH V2] arm64: Add support of R_AARCH64_PREL32 relocation in purgatory Date: Fri, 28 Oct 2016 09:46:09 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161027_211646_052370_7EB1A8ED X-CRM114-Status: GOOD ( 11.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pratyush Anand , catalin.marinas@arm.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP gcc version in fedora koji is 6.2.1-2.fc25. kexec-tools compiled with this gcc produced another relocation error: machine_apply_elf_rel: ERROR Unknown type: 261 This patch fixes the above error. Signed-off-by: Pratyush Anand Reviewed-by: Geoff Levand --- v1 -> v2: fixed line width to less than 80 chars kexec/arch/arm64/kexec-arm64.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c index 218f0bc832cd..eb0c3b87354e 100644 --- a/kexec/arch/arm64/kexec-arm64.c +++ b/kexec/arch/arm64/kexec-arm64.c @@ -720,6 +720,10 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *UNUSED(sym), # define R_AARCH64_ABS64 257 #endif +#if !defined(R_AARCH64_PREL32) +# define R_AARCH64_PREL32 261 +#endif + #if !defined(R_AARCH64_LD_PREL_LO19) # define R_AARCH64_LD_PREL_LO19 273 #endif @@ -761,6 +765,12 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *UNUSED(sym), loc64 = ptr; *loc64 = cpu_to_elf64(ehdr, elf64_to_cpu(ehdr, *loc64) + value); break; + case R_AARCH64_PREL32: + type = "PREL32"; + loc32 = ptr; + *loc32 = cpu_to_elf32(ehdr, + elf32_to_cpu(ehdr, *loc32) + value - address); + break; case R_AARCH64_LD_PREL_LO19: type = "LD_PREL_LO19"; loc32 = ptr;