[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] configure: Replace -Wl, -r, -d with -Wl, -r and add -fno-com
Re: [PATCH] configure: Replace -Wl, -r, -d with -Wl, -r and add -fno-common
Fri, 11 Feb 2022 10:39:40 -0800
Yes, please do.
Sorry for missing the tag.
On Fri, Feb 11, 2022 at 10:37 AM Daniel Kiper <email@example.com> wrote:
> On Fri, Feb 11, 2022 at 10:13:23AM -0800, Fangrui Song via Grub-devel wrote:
> > In GNU ld and ld.lld, -d is used with -r to allocate space to COMMON
> > symbols.
> > This behavior is presumably to work around legacy projects which inspect
> > relocatable output by themselves and do not handle COMMON symbols. grub does
> > not do this.
> > See https://github.com/llvm/llvm-project/issues/53660
> > -d is quite useless and ld.lld 15.0.0 will make -d no-op.
> > COMMON symbols have special symbol resolution semantics which can cause
> > surprise
> > (see https://maskray.me/blog/2022-02-06-all-about-common-symbols). GCC<10
> > and
> > Clang<11 defaulted to -fcommon. Just use -fno-common to avoid COMMON
> > symbols.
> Thank you for updating the patch.
> Nit, missing Signed-off-by. May I add it on your behalf?
> Otherwise Reviewed-by: Daniel Kiper <firstname.lastname@example.org>...