Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2891296yba; Mon, 8 Apr 2019 06:57:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbJszxCn6XWvimeag5cKcqJa2hkS+BFj3W1WaELJSHHEOV5YhdxykOVYm60Y/FCZdeZscE X-Received: by 2002:a65:6546:: with SMTP id a6mr28784816pgw.5.1554731844977; Mon, 08 Apr 2019 06:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554731844; cv=none; d=google.com; s=arc-20160816; b=L6IiVSnr+bmhkDkzN12qzfDCCHOt3rYchZvDjy8BRQYavQoSRFMwYMwENwuqOPrDme 9qN+PaK4vTXt04u+3anZcsVhi4cub6n1B4s3MIkpNTZAQXcbIqv4jaiZqkSmb8jeg096 IBGNo2VCs56iHEsB0M4t9PQDz8MHkQpQfkYeVHQqtqeb4Q00i/whOceJGwgUYrLJQLQ7 X75FZo1Y83Pi5AA/S/17PFHP85CutSt6wupHrJpwUh8E8xlmK8NgFv/XQRCWpKBTXmZs BEJh6aj33yPa8VW2+X4Axn3pyj+ljF8KjJNC7qBgOFsPpd/paCXlWI20qdO8tU9+z7eM cGvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=3FsXCpgRe3xDgQcj7tbC+YXSmvtdF4Ztyqo/hZnMaAU=; b=ETVwYSxavVPCrfGr+zGC/IPNvlsW4X7reDJHenc+4ub4YDTSM6gS7nGWRD3SfaN7Sp oVStdvoKpFSJexfTAsTZfIYIQv8ZrOO1td6WJYXZua/O4EIhWqmyIortioehvsobN3rT Buf3KRv16jjnL09WVSVnz23PrM8bk1yXz/FdJZfUmosut4hy0TJ5LwGBWNQBQGW5w64X G/UpXfKe63s6fZNFG7ZtamUgLn7d2/BmDehw5oD6bNV+89YumxFDg/vfpPUhQKiipmjr ws1PqbFHr5FbbbSwxKkj8nSxmZCC/ZwlxmAAyxTuCXFqUyq/lyeFGjja2S3GbAUavPix Geuw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3si26878833pfc.276.2019.04.08.06.57.09; Mon, 08 Apr 2019 06:57:24 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726987AbfDHN4L (ORCPT + 99 others); Mon, 8 Apr 2019 09:56:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46502 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbfDHN4L (ORCPT ); Mon, 8 Apr 2019 09:56:11 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF72344F9F; Mon, 8 Apr 2019 13:56:10 +0000 (UTC) Received: from [10.43.17.46] (unknown [10.43.17.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6DAF64292; Mon, 8 Apr 2019 13:56:09 +0000 (UTC) Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32} To: sedat.dilek@gmail.com Cc: linux-kernel@vger.kernel.org, x86@kernel.org References: From: Denys Vlasenko Message-ID: Date: Mon, 8 Apr 2019 15:56:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 08 Apr 2019 13:56:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/8/19 3:36 PM, Sedat Dilek wrote: > I fell over your commit "crypto: x86 - make constants readonly, allow > linker to merge them" [1] while digging into ClangBuiltLinux issue 431 > [0]. > > I see the following in my dmesg-log: > > $ grep sysfs: dmesg_5.0.4-rc1-1-amd64-cbl-asmgoto.txt > [Fri Mar 22 10:32:09 2019] sysfs: cannot create duplicate filename > '/module/usbcore/sections/.rodata.cst16' > [Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename > '/module/nfsd/sections/.rodata.cst32' > [Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename > '/module/iwlwifi/sections/.rodata.cst16' > [Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename > '/module/i915/sections/.rodata.cst32' > [Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename > '/module/mac80211/sections/.rodata.cst32' > [Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename > '/module/iwlmvm/sections/.rodata.cst16' > [Fri Mar 22 10:32:20 2019] sysfs: cannot create duplicate filename > '/module/bluetooth/sections/.rodata.cst16' > > Above modules have dependencies to stuff from arch/x86/crypto (see below P.S.). Not sure how exactly this causes the error, but the cause seems to be having more than one section with the same name. This occurs in only three files (grep for ".rodata.cst16," string): cast6-avx-x86_64-asm_64.S camellia-aesni-avx2-asm_64.S camellia-aesni-avx-asm_64.S /* NB: section is mergeable, all elements must be aligned 16-byte blocks */ .section .rodata.cst16, "aM", @progbits, 16 In other places I used .rodata.cst16.OBJECTNAME, but in these three cases there are more than one object in the section, so I left it w/o OBJECTNAME. I propose to change section name, append _module_ name and optionally a comment why this is done: /* NB: section is mergeable, all elements must be aligned 16-byte blocks */ +/* There is more than one object in this section, let's use module name + as unique suffix */ -.section .rodata.cst16, "aM", @progbits, 16 +.section .rodata.cst16.cast6-avx-x86_64-asm_64, "aM", @progbits, 16 > Looks like LLD defaults to -ffunction-sections and -fdata-sections. > Do you happen to know what the defaults are for BFD linker? linker does not create section names. Compiler does for .c files, for .S files they are made by a human.