Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2728616ybl; Sun, 26 Jan 2020 09:20:53 -0800 (PST) X-Google-Smtp-Source: APXvYqwAVOtkRYP8eMHA2kX7QepRsc+IGDTtTuaIADzZ59szwNT2/obGmn0io1IAv8w97GHYZ8/L X-Received: by 2002:a05:6830:18ce:: with SMTP id v14mr9584878ote.36.1580059253157; Sun, 26 Jan 2020 09:20:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580059253; cv=none; d=google.com; s=arc-20160816; b=MRBN/5cP+diCx06O5xI4Zk0dtZ1pF7XI2prNWzyUPyMPN25hGGRqut25HAsEaUfsgF qUEpbpCgDyvPeTIZB9OJngkp7TvU+9pcH+IZ674mxvUeia2OcRFvNWPe3i/NFivmnOld vuGOpM22TqmM2yLtXkbxciOEmVppaJrGUgB9lPAw9Ev4QRhIHWhZUIVYf91knCPDnohH 2qwjbSNFTBrkjaYQWfetH6sZD07h2YIXeMCtEqiNRzfwnEZy38mMrAe/mCdKL6ka/vwK D8tg/tqHpTjKVhD+KDRvuGITdsbKxd4DWCJgEwT9b3e8fDma6buu43eefcb2NehD43aq guaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=5s3uceSmzyVG0ofv/UT1wYTMdHoSHL/iqbe2xMvHTOM=; b=Jd72lykRfJ+vhdTffh9t6v/cCVeKCAzB6lQLx/Q4n5ktI7HJ/H5it3N1AXex4QuE49 RBXSuxnQg9ioT+fqyHD4esg5AF4pWkKZ67cjpnn4my0wROn1jjpAwgg2+RE4OqlhLc8t psGVqH9JidjuG4NxQTLnQUbCvjP2I4KJCVlooLA7IFzZ5OH4ViH3TIcOPP1jmHYMjkro RA8uSJNJ7/OaK0Va96o8S/1+JEqxIo17XXVm3ZeerTiPFCkQRVb6JTRmpLZx9PkNqWEY PfeEaZBE3O7fCvtESJ2pNtxcgFjOKzfqAmiXTQ9FoPosBuOKHzQ1a0YCtJd4v9pTsv3C 6dFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si5533854otq.112.2020.01.26.09.20.40; Sun, 26 Jan 2020 09:20:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728234AbgAZRNj (ORCPT + 99 others); Sun, 26 Jan 2020 12:13:39 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:52260 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbgAZRNj (ORCPT ); Sun, 26 Jan 2020 12:13:39 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ivlTe-0007Wy-4e; Sun, 26 Jan 2020 17:13:38 +0000 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1ivlTd-0012Yf-Ol; Sun, 26 Jan 2020 17:13:37 +0000 Message-ID: <114b087b50c83cfa3cc9afc8e08641a0d1ab8ce4.camel@decadent.org.uk> Subject: Re: [PATCH] fix 3.16 unknown rela relocation 4 error From: Ben Hutchings To: Woody Suwalski , LKML Cc: stable Date: Sun, 26 Jan 2020 17:13:32 +0000 In-Reply-To: <48d562fd-f80a-69ae-56e5-d0bada0feeed@gmail.com> References: <48d562fd-f80a-69ae-56e5-d0bada0feeed@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-l/T8Jq/8x20HtJEtG9xW" User-Agent: Evolution 3.34.1-2+b1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-l/T8Jq/8x20HtJEtG9xW Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 2020-01-25 at 22:16 -0500, Woody Suwalski wrote: > Trying to use an AMD64 3.16 kernel built on a new Debian system fails=20 > because > most of the kernel modules can not be loaded. I don't recommend using the latest toolchain for 3.16 (certainly gcc 9 won't work). But I will apply this since it's such a simple fix.=20 Thanks for the backport. Ben. > This patch handles the PLT32 relocation errors for kernels modules built= =20 > with binutils > newer then 2.31, similar to: > [ 5.742485] module: autofs4: Unknown rela relocation: 4 > [ 5.742536] systemd[1]: Failed to insert module 'autofs4': Exec=20 > format error >=20 > This patch is based on a mainline kernel patch=20 > b21ebf2fb4cde1618915a97cc773e287ff49173e > From: "H.J. Lu" > Date: Wed, 7 Feb 2018 14:20:09 -0800 > Subject: x86: Treat R_X86_64_PLT32 as R_X86_64_PC32 >=20 > Signed-off-by: Woody Suwalski >=20 > --- a/arch/x86/tools/relocs.c 2020-01-24 18:48:09.477919152 -0500 > +++ b/arch/x86/tools/relocs.c 2020-01-24 18:48:53.645612045 -0500 > @@ -763,6 +763,7 @@ static int do_reloc64(struct section *se > switch (r_type) { > case R_X86_64_NONE: > case R_X86_64_PC32: > + case R_X86_64_PLT32: > /* > * NONE can be ignored and PC relative relocations don't > * need to be adjusted. > --- a/arch/x86/kernel/module.c 2020-01-24 18:46:54.922670590 -0500 > +++ b/arch/x86/kernel/module.c 2020-01-24 18:47:46.714112016 -0500 > @@ -180,6 +180,7 @@ int apply_relocate_add(Elf64_Shdr *sechd > goto overflow; > break; > case R_X86_64_PC32: > + case R_X86_64_PLT32: > val -=3D (u64)loc; > *(u32 *)loc =3D val; > #if 0 >=20 --=20 Ben Hutchings The program is absolutely right; therefore, the computer must be wrong. --=-l/T8Jq/8x20HtJEtG9xW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAl4tyL0ACgkQ57/I7JWG EQnDABAAiq5hKPXIeNqducstec+5xobajzMwM13kj6uwspdGpvAkPiLIvysz+h+H K3bxP4Rb9GWtK1ONFDKBRYzYZtdvPHXjh0IwXCwegZi6tPdGbOvzWgpLZEVgkj4y 5xYAww1VQn8aWm2qyZnAljkVbgqrk/QOypRTIfOmwQH+hzOGPk3UTe0/b1i1sv1Z SJ7Pfq2HFR0zg7pg14wTCi0SuFOdFlX0MZCD1yANOTRGKL5cnqwq714e4gCttBJN ZFL7b9FTepOJChxG6D5o3uwQJMUZDzqBvC4bq7rIn7Zcg8BJNNTghChtTYNQdH/8 WeTTJ3OnOPgLKm2wZ2CYfzqJBpYTyQ5uQE4lv1FDUu1ctbhGK803Y4eWpNMNtShu urc68r7FPCdeT+JrK68hI8ARTkw6gMOdKXrdxWNtSZI4CSw3FY4gTULC7Ft3eR9P F0jbnF+3Hz1rjk7OjuDaX2LqCpY0oWVlukazr7Qmn5cMgY1EFgnNUzLO+z+ENBSK RL0w0RJjZnCuQpUmHFG26m+A6ZBH+u7mam/K6Ti+p1iuVNIrSReVyw7EqePH3Rhk tzQEWnaXdWni1lktM/2tqDItqN/1hL3glzkH/RCbC/sgkxP8kEsSaPnWqQDkB8yr ihpv5UJ42jzH4a1Phup2CffUJH+bR+4LLRh86Uni7CBie1ecWvA= =EvLl -----END PGP SIGNATURE----- --=-l/T8Jq/8x20HtJEtG9xW--