[PATCH 17/31] sandbox: Allow weak symbols to be dropped

Simon Glass sjg at chromium.org
Sat Apr 29 20:41:31 CEST 2023


Hi Pali,

On Tue, 25 Apr 2023 at 10:31, Pali Rohár <pali at kernel.org> wrote:
>
> On Tuesday 25 April 2023 10:44:17 Bin Meng wrote:
> > Hi Simon,
> >
> > On Tue, Apr 25, 2023 at 7:09 AM Simon Glass <sjg at chromium.org> wrote:
> > >
> > > The sandbox build makes use of a small number of weak symbols. Allow these
> > > to be dropped when building for the PE format, since its support for weak
> > > symbols is poor.
> > >
> > > Signed-off-by: Simon Glass <sjg at chromium.org>
> > > ---
> > >
> > >  cmd/bootefi.c                     | 3 ++-
> > >  cmd/bootz.c                       | 3 +++
> > >  common/usb.c                      | 3 +++
> > >  drivers/core/root.c               | 3 +++
> > >  drivers/spi/sandbox_spi.c         | 3 +++
> > >  env/env.c                         | 6 ++++++
> > >  lib/efi_loader/efi_image_loader.c | 3 +++
> > >  lib/efi_loader/efi_runtime.c      | 4 ++++
> > >  lib/lmb.c                         | 4 +++-
> > >  lib/time.c                        | 3 +++
> > >  10 files changed, 33 insertions(+), 2 deletions(-)
> > >
> >
> > You probably need to use:
> >
> > __declspec(selectany)
> >
> > to replace __weak in the ELF for the *nix world.
> >
> > Note this Microsoft bizarre does not provide the "strong override
> > weak" effect but I suspect what you only need is to get the build pass
> > on Windows so it should be okay.
> >
> > Regards,
> > Bin
>
> You have selectany and external weaks support in PE format. For the
> majority of weak function cases, this is enough. Cannot we use them?

Not that I can tell.

Can you provide a patch to linux/compiler_attributes.h which handles this?

Regards,
Simon


More information about the U-Boot mailing list