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 4C50D3F54CB for ; Tue, 31 Mar 2026 14:56:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774969005; cv=none; b=V1Z+DW/0BGUA9SZSG0RSn0BrCxBNQvStHMW3a+lLP2o/9kps6n3xxnttB/kjaEibDUXgS5ISo/0AGZhQ/t/luc8Rzq0IXpnwhd92PSRYSYYRY4jqyGF1gKZibIejmt5Ogs5KS7YFtS2gicsFJYkqezE371i2IQJEs1oXEkmmZCg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774969005; c=relaxed/simple; bh=XP3qUWeZ9phQ+SLaiNfegvZjrxfOs6ykqkYVKNib+Sw=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=GkECXbgZYp6wrqpeKgIZNmaugOpNEYNCk4J2kb3g1lKRB5nJmNA+hb+dJwZZw/bIdUNgiTaYlytgR8XyKgvhC0DPLigA7/XKFrdLOLkFcRtBGJ+bNSt7qBxav2p7hx9tG+d6vromobS/xZm5JoSalOdTuuG2zCzm6Ng4ucuPhSQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GoPWr15Q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GoPWr15Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A6B3C19423; Tue, 31 Mar 2026 14:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774969004; bh=XP3qUWeZ9phQ+SLaiNfegvZjrxfOs6ykqkYVKNib+Sw=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=GoPWr15Qt+SH9l9gWYtBVHu8qUC7UlvUr/u3Y2oPImgpP0DB7aHVG70mMCRslaMgM 9b0SZUVD//0yCGrwXjfgQcsd+TiL3SMxrfOPcqieb4gafwG4x+IRJ2ygP/bBHvibAj X4mLrYMYjlBzl6YzbBOzCzDGJ+x3h8AQN80sHw0DtNecLtHu5RG45UkX7ge/EaMkUJ IMfOrtCJ2EbUYY133V2jbx1NQO/2Mtij5qlqyN4JO0pjzWEampPo3CPkNUDid6xbP2 qQQ/vVNJ+5j7z4aoXzbEYEy0Z1gzy1HObncbxy48ezwYrVE29EClCk3QHrFWSTVseJ WjraiyffJ0i0w== Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfauth.phl.internal (Postfix) with ESMTP id 36B2AF4006F; Tue, 31 Mar 2026 10:56:43 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-01.internal (MEProxy); Tue, 31 Mar 2026 10:56:43 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdeglecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegrihhl ohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpe foggffhffvvefkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdetrhguuceuihgv shhhvghuvhgvlhdfuceorghruggssehkvghrnhgvlhdrohhrgheqnecuggftrfgrthhtvg hrnheptdefveduheffgeeggeehiedtuddvhfevtefgieeugfdtffejtdekgeejkeevvddu necuffhomhgrihhnpehlihhnuhigrdhorhhgrdhukhenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhguodhmvghsmhhtphgruhhthhhpvghr shhonhgrlhhithihqdduieejtdehtddtjeelqdeffedvudeigeduhedqrghruggspeepkh gvrhhnvghlrdhorhhgseifohhrkhhofhgrrhgurdgtohhmpdhnsggprhgtphhtthhopedu iedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheplhhinhhugiesrghrmhhlihhnuh igrdhorhhgrdhukhdprhgtphhtthhopegrnhgrnhgurdhgohhrvgessghrohgruggtohhm rdgtohhmpdhrtghpthhtohepsggtmhdqkhgvrhhnvghlqdhfvggvuggsrggtkhdqlhhish htsegsrhhorggutghomhdrtghomhdprhgtphhtthhopehflhhorhhirghnrdhfrghinhgv lhhlihessghrohgruggtohhmrdgtohhmpdhrtghpthhtohepkhhurhhsrggurdhonhgvhi essghrohgruggtohhmrdgtohhmpdhrtghpthhtohepfihilhhlihgrmhdriihhrghnghes sghrohgruggtohhmrdgtohhmpdhrtghpthhtoheptghhrhhishhtohhphhgvrdhlvghroh ihsegtshhgrhhouhhprdgvuhdprhgtphhtthhopehpvghtvghriiesihhnfhhrrgguvggr ugdrohhrghdprhgtphhtthhopehmtghgrhhofheskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ice86485a:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 02793700069; Tue, 31 Mar 2026 10:56:43 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: AX_XmZLnGFDV Date: Tue, 31 Mar 2026 16:56:22 +0200 From: "Ard Biesheuvel" To: "William Zhang" , linux-arm-kernel@lists.infradead.org Cc: "Song Liu" , linus.walleij@linaro.org, florian.fainelli@broadcom.com, anand.gore@broadcom.com, "Broadcom Kernel List" , kursad.oney@broadcom.com, "Sebastian Andrzej Siewior" , "Peter Zijlstra" , "Luis Chamberlain" , linux-kernel@vger.kernel.org, "Thomas Gleixner" , "Christophe Leroy" , "Petr Pavlu" , "Russell King" Message-Id: In-Reply-To: References: <20250922202438.496433-1-william.zhang@broadcom.com> Subject: Re: [PATCH v2] ARM: module: fix unwind section relocation out of range error Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, On Mon, 23 Feb 2026, at 03:30, William Zhang wrote: > Hi, > > On Mon, Sep 22, 2025 at 1:24=E2=80=AFPM William Zhang > wrote: >> >> In an armv7 system that uses non-3G/1G split and with more than 512MB >> physical memory, driver load may fail with following error: >> section 29 reloc 0 sym '': relocation 42 out of range (0xc2ab9be8 = -> >> 0x7fad5998) >> >> This happens when relocation R_ARM_PREL31 from the unwind section >> .ARM.extab and .ARM.exidx are allocated from the VMALLOC space while >> .text section is from MODULES_VADDR space. It exceeds the +/-1GB >> relocation requirement of R_ARM_PREL31 hence triggers the error. >> >> The fix is to mark .ARM.extab and .ARM.exidx sections as executable so >> they can be allocated along with .text section and always meet range >> requirement. >> >> Fixes: ac3b43283923 ("module: replace module_layout with module_memor= y") >> >> Co-developed-by: Ard Biesheuvel >> Signed-off-by: Ard Biesheuvel >> Signed-off-by: William Zhang >> >> --- >> >> Changes in v2: >> - Fix the comment in code and commit message regarding the unwind >> section location >> - Add fix tag for more visibility >> >> arch/arm/kernel/module-plts.c | 12 ++++++++++++ >> 1 file changed, 12 insertions(+) >> >> diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-p= lts.c >> index 354ce16d83cb..b5338fe59706 100644 >> --- a/arch/arm/kernel/module-plts.c >> +++ b/arch/arm/kernel/module-plts.c >> @@ -225,6 +225,18 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, El= f_Shdr *sechdrs, >> mod->arch.init.plt =3D s; >> else if (s->sh_type =3D=3D SHT_SYMTAB) >> syms =3D (Elf32_Sym *)s->sh_addr; >> +#if defined(CONFIG_ARM_UNWIND) && !defined(CONFIG_VMSPLIT_3G) >> + else if (s->sh_type =3D=3D ELF_SECTION_UNWIND || >> + (strncmp(".ARM.extab", secstrings + s->sh_na= me, 10) =3D=3D 0)) { >> + /* >> + * To avoid the possible relocation out of ra= nge issue for >> + * R_ARM_PREL31, mark unwind section .ARM.ext= ab and .ARM.exidx as >> + * executable so they will be allocated along= with .text section to >> + * meet +/-1GB range requirement of the R_ARM= _PREL31 relocation >> + */ >> + s->sh_flags |=3D SHF_EXECINSTR; >> + } >> +#endif >> } >> >> if (!mod->arch.core.plt || !mod->arch.init.plt) { >> -- >> 2.43.7 >> > > Is this version okay to be accepted? > Please put it in Russell's patch tracker. https://www.arm.linux.org.uk/developer/patches/