]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
depmod: Don't add .TOC. when it's in the kernel.
authorMichal Suchanek <msuchanek@suse.de>
Thu, 7 Dec 2017 14:31:19 +0000 (15:31 +0100)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 7 Dec 2017 19:04:37 +0000 (11:04 -0800)
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 <msuchanek@suse.de>
tools/depmod.c

index 7ff3e9ed191e43b3c327c6caab9a6765b188e5d8..9db602d76ee4208de9f275363957cccb6a024acd 100644 (file)
@@ -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)