Re: [PATCH v2 1/3] vmlinux.lds.h: Add .gnu.version* to DISCARDS
From: Kees Cook
Date: Mon Jun 22 2020 - 18:09:22 EST
On Mon, Jun 22, 2020 at 03:00:43PM -0700, Fangrui Song wrote:
> On 2020-06-22, Kees Cook wrote:
> > For vmlinux linking, no architecture uses the .gnu.version* section,
> > so remove it via the common DISCARDS macro in preparation for adding
> > --orphan-handling=warn more widely.
> >
> > Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
> > ---
> > include/asm-generic/vmlinux.lds.h | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> > index db600ef218d7..6fbe9ed10cdb 100644
> > --- a/include/asm-generic/vmlinux.lds.h
> > +++ b/include/asm-generic/vmlinux.lds.h
> > @@ -934,6 +934,7 @@
> > *(.discard) \
> > *(.discard.*) \
> > *(.modinfo) \
> > + *(.gnu.version*) \
> > }
> >
> > /**
> > --
> > 2.25.1
>
> I wonder what lead to .gnu.version{,_d,_r} sections in the kernel.
Here's where I see it:
ld: warning: orphan section `.gnu.version_d' from `arch/x86/boot/compressed/kernel_info.o' being placed in section `.gnu.version_d'
--
Kees Cook