From 00017cf84adc0f74de9e8fd0cf8d9d77fc20b94286812155a2d71f11e57b2e1d Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 8 Dec 2017 08:51:32 +0000 Subject: [PATCH] Accepting request 555069 from home:michals - Fix resolving .TOC. in modules on 4.4 and older kernel (bsc#1070209) depmod-Don-t-add-.TOC.-when-it-s-in-the-kernel.patch OBS-URL: https://build.opensuse.org/request/show/555069 OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=130 --- ...-t-add-.TOC.-when-it-s-in-the-kernel.patch | 35 +++++++++++++++++++ kmod.changes | 6 ++++ kmod.spec | 3 +- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 depmod-Don-t-add-.TOC.-when-it-s-in-the-kernel.patch diff --git a/depmod-Don-t-add-.TOC.-when-it-s-in-the-kernel.patch b/depmod-Don-t-add-.TOC.-when-it-s-in-the-kernel.patch new file mode 100644 index 0000000..1a4c533 --- /dev/null +++ b/depmod-Don-t-add-.TOC.-when-it-s-in-the-kernel.patch @@ -0,0 +1,35 @@ +From d43ed9df0c22aa06b254b86dcf6dfbad04699242 Mon Sep 17 00:00:00 2001 +From: Michal Suchanek +Date: Thu, 7 Dec 2017 13:51:31 +0100 +Subject: [PATCH] depmod: Don't add .TOC. when it's in the kernel. + +References: bsc#1070209 + +d46136bb59c4 ("depmod: Ignore PowerPC64 ABIv2 .TOC. symbol") adds fake +.TOC. unconditionally but when there is .TOC. in the kernel adding the +fake one breaks resolving .TOC. + +Fixes: d46136bb59c4 ("depmod: Ignore PowerPC64 ABIv2 .TOC. symbol") + +Signed-off-by: Michal Suchanek +--- + tools/depmod.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tools/depmod.c b/tools/depmod.c +index 7ff3e9ed191e..9db602d76ee4 100644 +--- a/tools/depmod.c ++++ b/tools/depmod.c +@@ -2480,7 +2480,8 @@ static void depmod_add_fake_syms(struct depmod *depmod) + /* On S390, this is faked up too */ + depmod_symbol_add(depmod, "_GLOBAL_OFFSET_TABLE_", true, 0, NULL); + /* On PowerPC64 ABIv2, .TOC. is more or less _GLOBAL_OFFSET_TABLE_ */ +- depmod_symbol_add(depmod, "TOC.", true, 0, NULL); ++ if (!depmod_symbol_find(depmod, "TOC.")) ++ depmod_symbol_add(depmod, "TOC.", true, 0, NULL); + } + + static int depmod_load_symvers(struct depmod *depmod, const char *filename) +-- +2.13.6 + diff --git a/kmod.changes b/kmod.changes index 6fda261..b37d5a0 100644 --- a/kmod.changes +++ b/kmod.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Dec 7 12:56:32 UTC 2017 - msuchanek@suse.com + +- Fix resolving .TOC. in modules on 4.4 and older kernel (bsc#1070209) + depmod-Don-t-add-.TOC.-when-it-s-in-the-kernel.patch + ------------------------------------------------------------------- Mon Nov 20 14:34:59 UTC 2017 - msuchanek@suse.com diff --git a/kmod.spec b/kmod.spec index 18528bf..cb5cd9a 100644 --- a/kmod.spec +++ b/kmod.spec @@ -34,6 +34,7 @@ Patch2: 0003-libkmod-config-Recognize-allow_unsupported_modules-i.patch Patch3: 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch Patch4: 0010-modprobe-Implement-allow-unsupported-modules.patch Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch +Patch6: depmod-Don-t-add-.TOC.-when-it-s-in-the-kernel.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake @@ -105,7 +106,7 @@ in %lname. %prep %setup -q -n kmod-%version -%patch -P 1 -P 2 -P 3 -P 4 -P 5 -p1 +%patch -P 1 -P 2 -P 3 -P 4 -P 5 -P 6 -p1 %build autoreconf -fi