From patchwork Wed Oct 26 04:40:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Anand X-Patchwork-Id: 9395903 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 A117E60231 for ; Wed, 26 Oct 2016 04:42:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84B092979D for ; Wed, 26 Oct 2016 04:42:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 798412979F; Wed, 26 Oct 2016 04:42:05 +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 187942979D for ; Wed, 26 Oct 2016 04:42:04 +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 1bzG1H-0002UE-UZ; Wed, 26 Oct 2016 04:40:55 +0000 Received: from mail-qk0-f182.google.com ([209.85.220.182]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bzG1C-0002Fe-DS for linux-arm-kernel@lists.infradead.org; Wed, 26 Oct 2016 04:40:51 +0000 Received: by mail-qk0-f182.google.com with SMTP id z190so273378369qkc.2 for ; Tue, 25 Oct 2016 21:40:30 -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=pWq80x2bRkUlhmm/SnmoiQKeb6BQ7D8sX0YL3mpLMvo=; b=GQQFW6aT87ebg5W5AKV5a7wrMDlYFt7BPUBju8Yd8l8VsbO6Kcz+bXLo8XwHUsJR7S 4qrgo6734u2M3vwXX8ex6xtq+b1euVbl1q9D0Dm0l8A1/K4j12ComEtpCJvR7N79fv8W AHulq2YPKTUQOeNa2NKpBOK/nD9fsGZNh+MdK0KNLJBI9wqe2IWMmYd9WQXEd3pPNk2n sAmEAgVM4CSUnLmWLeiRI/vrKg1XQS3E2KzdbZOzTpDksa/rnpzoIpi2T1avLqFg7ZRc wi0bBwqhV2/Rgpq9tkPma17oFZjgoycMaANrGR/fEjy685CdrEr6C56WtODNtbi4fgP5 HeIw== X-Gm-Message-State: ABUngvfuzIcoueLVRefIf+XTUD4WsDxB7x9dGwtuprgkL1yl0t/Gm8/Zludap8DEkLAVrvqR X-Received: by 10.55.96.7 with SMTP id u7mr25241401qkb.189.1477456829325; Tue, 25 Oct 2016 21:40:29 -0700 (PDT) Received: from localhost ([122.180.204.166]) by smtp.gmail.com with ESMTPSA id 21sm95463qkg.27.2016.10.25.21.40.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Oct 2016 21:40:28 -0700 (PDT) From: Pratyush Anand To: geoff@infradead.org, horms@verge.net.au Subject: [PATCH] arm64: Add support of R_AARCH64_PREL32 relocation in purgatory Date: Wed, 26 Oct 2016 10:10:23 +0530 Message-Id: <0eb8a908f617e0f957df7fb3ef293596f47e6832.1477456661.git.panand@redhat.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161025_214050_593302_3DFB1F88 X-CRM114-Status: GOOD ( 10.89 ) 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 --- kexec/arch/arm64/kexec-arm64.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c index 218f0bc832cd..b12de4772412 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,11 @@ 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;