From patchwork Thu Dec 7 14:31:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michal_Such=C3=A1nek?= X-Patchwork-Id: 10099315 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A1D3F60325 for ; Thu, 7 Dec 2017 14:31:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34CF62A473 for ; Thu, 7 Dec 2017 14:31:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29B6F2A49C; Thu, 7 Dec 2017 14:31:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B353B2A473 for ; Thu, 7 Dec 2017 14:31:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753905AbdLGObk (ORCPT ); Thu, 7 Dec 2017 09:31:40 -0500 Received: from mx2.suse.de ([195.135.220.15]:40962 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753566AbdLGOb2 (ORCPT ); Thu, 7 Dec 2017 09:31:28 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B387CABB4 for ; Thu, 7 Dec 2017 14:31:27 +0000 (UTC) From: Michal Suchanek To: linux-modules@vger.kernel.org Cc: Michal Suchanek Subject: [PATCH] depmod: Don't add .TOC. when it's in the kernel. Date: Thu, 7 Dec 2017 15:31:19 +0100 Message-Id: <20171207143119.7046-1-msuchanek@suse.de> X-Mailer: git-send-email 2.13.6 Sender: owner-linux-modules@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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)