From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41BF4C54FD3 for ; Wed, 25 Mar 2020 02:46:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2293D20724 for ; Wed, 25 Mar 2020 02:46:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727290AbgCYCqu (ORCPT ); Tue, 24 Mar 2020 22:46:50 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:40940 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727259AbgCYCqu (ORCPT ); Tue, 24 Mar 2020 22:46:50 -0400 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S23992811AbgCYCqrzvS2L (ORCPT + 1 other); Wed, 25 Mar 2020 03:46:47 +0100 Date: Wed, 25 Mar 2020 02:46:47 +0000 (GMT) From: "Maciej W. Rozycki" To: Masahiro Yamada cc: Thomas Bogendoerfer , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Lobakin , Paul Burton , clang-built-linux@googlegroups.com Subject: Re: [PATCH] MIPS: mark some functions as weak to avoid conflict with Octeon ones In-Reply-To: <20200324164005.8259-1-masahiroy@kernel.org> Message-ID: References: <20200324164005.8259-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Mar 2020, Masahiro Yamada wrote: > MIPS provides multiple definitions for the following functions: > > fw_init_cmdline > __delay > __udelay > __ndelay > memmove > __rmemcpy > memcpy > __copy_user > > The generic ones are defined in lib-y objects, which are overridden by > the Octeon ones when CONFIG_CAVIUM_OCTEON_SOC is enabled. > > The use of EXPORT_SYMBOL in static libraries potentially causes a > problem for the llvm linker [1]. So, I want to forcibly link lib-y > objects to vmlinux when CONFIG_MODULES=y. > > As a groundwork, we must fix multiple definitions that have been > hidden by lib-y. IIUC that causes known dead code to be included in the kernel image. Wouldn't it be possible to actually omit replaced functions from output by keying the build of the sources providing generic code with appropriate CONFIG_* settings (such as CONFIG_GENERIC_DELAY, CONFIG_GENERIC_MEMCPY, etc. or suchlike)? Maciej