From patchwork Fri Feb 5 18:50:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 579585 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6A3A2140327 for ; Sat, 6 Feb 2016 05:59:32 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4A3C61A02CE for ; Sat, 6 Feb 2016 05:59:32 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id F24671A0026 for ; Sat, 6 Feb 2016 05:58:30 +1100 (AEDT) Received: by ozlabs.org (Postfix) id E1CAC140327; Sat, 6 Feb 2016 05:58:30 +1100 (AEDT) Delivered-To: linuxppc-dev@ozlabs.org X-Greylist: delayed 501 seconds by postgrey-1.35 at bilbo; Sat, 06 Feb 2016 05:58:30 AEDT Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 84126140321 for ; Sat, 6 Feb 2016 05:58:30 +1100 (AEDT) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3pxm5T6Bpsz3hjBG; Fri, 5 Feb 2016 19:50:05 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3pxm5T3jDjzvh27; Fri, 5 Feb 2016 19:50:05 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id D_P_CLv93MIg; Fri, 5 Feb 2016 19:50:04 +0100 (CET) X-Auth-Info: X1bDn2W21MMfx+n5x9YqCd66SFy4THVXH8Wej/5v8xzPBJODzXGNWJxw2Fxg5XKt Received: from igel.home (host-188-174-219-146.customer.m-online.net [188.174.219.146]) by mail.mnet-online.de (Postfix) with ESMTPA; Fri, 5 Feb 2016 19:50:04 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id 7D5842C450E; Fri, 5 Feb 2016 19:50:03 +0100 (CET) From: Andreas Schwab To: linuxppc-dev@ozlabs.org Subject: [PATCH] powerpc: fix dedotify for binutils >= 2.26 X-Yow: I OWN six pink HIPPOS!! Date: Fri, 05 Feb 2016 19:50:03 +0100 Message-ID: <87bn7vm1pg.fsf@linux-m68k.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.90 (gnu/linux) MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Since binutils 2.26 BFD is doing suffix merging on STRTAB sections. But dedotify modifies the symbol names in place, which can also modify unrelated symbols with a name that matches a suffix of a dotted name. To remove the leading dot of a symbol name we can just increment the pointer into the STRTAB section instead. Signed-off-by: Andreas Schwab --- arch/powerpc/kernel/module_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c index ac64ffd..08b7a40 100644 --- a/arch/powerpc/kernel/module_64.c +++ b/arch/powerpc/kernel/module_64.c @@ -340,7 +340,7 @@ static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab) if (name[0] == '.') { if (strcmp(name+1, "TOC.") == 0) syms[i].st_shndx = SHN_ABS; - memmove(name, name+1, strlen(name)); + syms[i].st_name++; } } }