lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNAQA1Z3=9QFvvVx8Zqiq3zKTM8W=JurBuua4iEZf=WL9ZA@mail.gmail.com>
Date:   Wed, 25 Mar 2020 16:33:14 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     "Maciej W. Rozycki" <macro@...ux-mips.org>
Cc:     Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        linux-mips@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Alexander Lobakin <alobakin@...nk.ru>,
        Paul Burton <paulburton@...nel.org>,
        clang-built-linux <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH] MIPS: mark some functions as weak to avoid conflict with
 Octeon ones

Hi Maciej,

On Wed, Mar 25, 2020 at 11:46 AM Maciej W. Rozycki <macro@...ux-mips.org> wrote:
>
> 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


You are right.
__weak cannot trim the dead code.


I can work on the CONFIG_ approach,
but I'd rather to use inverted
CONFIG_HAVE_PLAT_* because it is easier
to make CAVIUM_OCTEON_SOC select them.



-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ