From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97845ED6 for ; Thu, 1 Sep 2022 10:40:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D4ABC43470 for ; Thu, 1 Sep 2022 10:40:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662028844; bh=LBa14xoUN0fMhLzLC7wVPDFh9Iet5/+NLV5mMa9mn/o=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sPAJY0gVqmkV7XMw/tcX9QW32uvxLniBcF9y2Lb1R3++Jt47suBJWhk3Zkgos6HAi 0aVIxTO/4iELlWickg+kLbupXAN5gQf403M3WH8C923Wc/C7/wQkKDmmwbIwNkh2Yf Hf5+bfMETsCMHE6OOzNY+omspABTzKRWY7oXFFRYTsbUcXr4vP2dGCEWhbcqHFXIYi +JBVoVScCsl3WKaNqA3F0aJgIrhmGUuZB1XoI9o2vbSRrr+uSfPjIyp8bRl0rtdjiH iPenQcAjSVv6+iiQv4sokE//LOJKE+gsJ2MzVPKVwrfegfKfjxnSDnk6ir6ex1HIcO 6tZSBcBqUsvxQ== Received: by mail-vs1-f48.google.com with SMTP id k66so11683393vsc.11 for ; Thu, 01 Sep 2022 03:40:44 -0700 (PDT) X-Gm-Message-State: ACgBeo1+6XgkFh6qRGbJHdNiGwSs2sLzvnzoUN1yam3OrfyDTL2w8g1t Mj9d/IJ8ZyIj0PDuq2JiKbVmTQeXCMBWDzNVPzU= X-Google-Smtp-Source: AA6agR7dNMRQwlxYH+D7lL3BtG0CaeaIu0EOhQ46VtPMSzp62FZbuavPop3/iV8rHcRRV0arRmbJashjVsJasIKdqVo= X-Received: by 2002:a67:df81:0:b0:390:21a3:823a with SMTP id x1-20020a67df81000000b0039021a3823amr8091257vsk.70.1662028843133; Thu, 01 Sep 2022 03:40:43 -0700 (PDT) Precedence: bulk X-Mailing-List: loongarch@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220819102037.2697798-1-chenhuacai@loongson.cn> <9b6f0aeaebbd36882b5b40d655f9ccd20c7be496.camel@xry111.site> In-Reply-To: From: Huacai Chen Date: Thu, 1 Sep 2022 18:40:31 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3] LoongArch: Add efistub booting support To: Ard Biesheuvel Cc: Xi Ruoyao , Huacai Chen , Arnd Bergmann , loongarch@lists.linux.dev, linux-arch , Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-efi , LKML Content-Type: text/plain; charset="UTF-8" Hi, Ard, On Sat, Aug 27, 2022 at 3:14 PM Ard Biesheuvel wrote: > > On Sat, 27 Aug 2022 at 06:41, Xi Ruoyao wrote: > > > > Tested V3 with the magic number check manually removed in my GRUB build. > > The system boots successfully. I've not tested Arnd's zBoot patch yet. > > I am Ard not Arnd :-) > > Please use this branch when testing the EFI decompressor: > https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=efi-decompressor-v4 The root cause of LoongArch zboot boot failure has been found, it is a binutils bug, latest toolchain with the below patch can solve the problem. diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c index 5b44901b9e0..fafdc7c7458 100644 --- a/bfd/elfnn-loongarch.c +++ b/bfd/elfnn-loongarch.c @@ -2341,9 +2341,10 @@ loongarch_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, case R_LARCH_SOP_PUSH_PLT_PCREL: unresolved_reloc = false; - if (resolved_to_const) + if (!is_undefweak && resolved_to_const) { relocation += rel->r_addend; + relocation -= pc; break; } else if (is_undefweak) Huacai