[PATCH v1 1/2] arm64: vdso32: add ARM.exidx* sections

Joey Gouly joey.gouly at arm.com
Thu Jun 30 03:21:03 PDT 2022


Hi Nathan,

On Wed, Jun 29, 2022 at 01:10:10PM -0700, Nathan Chancellor wrote:
> Hi Joey,
> 
> On Tue, Jun 28, 2022 at 04:13:06PM +0100, Joey Gouly wrote:
> > These show up when building with clang+lld.
> > 
> > Signed-off-by: Joey Gouly <joey.gouly at arm.com>
> > Cc: Will Deacon <will at kernel.org>
> > Cc: Vincenzo Frascino <vincenzo.frascino at arm.com>
> > ---
> >  arch/arm64/kernel/vdso32/vdso.lds.S | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm64/kernel/vdso32/vdso.lds.S b/arch/arm64/kernel/vdso32/vdso.lds.S
> > index 120cf422036f..e2f8ced571d6 100644
> > --- a/arch/arm64/kernel/vdso32/vdso.lds.S
> > +++ b/arch/arm64/kernel/vdso32/vdso.lds.S
> > @@ -60,6 +60,7 @@ SECTIONS
> >  	}
> >  
> >  	ELF_DETAILS
> > +	.ARM.exidx : { *(.ARM.exidx*) }
> >  	.ARM.attributes 0 : { *(.ARM.attributes) }
> >  
> >  	/DISCARD/	: {
> > -- 
> > 2.17.1
> > 
> 
> This patch is now in -next as commit 5c4fb60816ea ("arm64: vdso32: add
> ARM.exidx* sections"), which causes the following errors with ld.lld 11:

Sorry for the breakage.

> 
>   ld.lld: error: could not allocate headers
>   ld.lld: error: unable to place section .text at file offset [0x2A0, 0xBB1]; check your linker script for overflows
>   ld.lld: error: unable to place section .comment at file offset [0xBB2, 0xC8A]; check your linker script for overflows
>   ld.lld: error: unable to place section .symtab at file offset [0xC8C, 0xE0B]; check your linker script for overflows
>   ld.lld: error: unable to place section .strtab at file offset [0xE0C, 0xF1C]; check your linker script for overflows
>   ld.lld: error: unable to place section .shstrtab at file offset [0xF1D, 0xFAA]; check your linker script for overflows
>   ld.lld: error: section .ARM.exidx file range overlaps with .hash
>   >>> .ARM.exidx range is [0x90, 0xCF]
>   >>> .hash range is [0xB4, 0xE3]
> 
>   ld.lld: error: section .hash file range overlaps with .ARM.attributes
>   >>> .hash range is [0xB4, 0xE3]
>   >>> .ARM.attributes range is [0xD0, 0x10B]
> 
>   ld.lld: error: section .ARM.attributes file range overlaps with .dynsym
>   >>> .ARM.attributes range is [0xD0, 0x10B]
>   >>> .dynsym range is [0xE4, 0x133]
> 
>   ld.lld: error: section .ARM.exidx virtual address range overlaps with .hash
>   >>> .ARM.exidx range is [0x90, 0xCF]
>   >>> .hash range is [0xB4, 0xE3]
> 
>   ld.lld: error: section .ARM.exidx load address range overlaps with .hash
>   >>> .ARM.exidx range is [0x90, 0xCF]
>   >>> .hash range is [0xB4, 0xE3]
> 
> I bisected LLVM to see what fixed this in ld.lld 12 and I landed on
> commit ec29538af2e0 ("[ELF] Assign file offsets of non-SHF_ALLOC after
> SHF_ALLOC and set sh_addr=0 to non-SHF_ALLOC") [1].
> 
> We could bump the minimum version of LLVM to 12 over this but the
> following diff appears to resolve it for me, although I am not sure as
> to why.
> 
> diff --git a/arch/arm64/kernel/vdso32/vdso.lds.S b/arch/arm64/kernel/vdso32/vdso.lds.S
> index 6e67a6524d58..c25bed8e6df1 100644
> --- a/arch/arm64/kernel/vdso32/vdso.lds.S
> +++ b/arch/arm64/kernel/vdso32/vdso.lds.S
> @@ -56,8 +56,8 @@ SECTIONS
>  
>  	.rel.dyn	: { *(.rel*) }
>  
> -	ELF_DETAILS
>  	.ARM.exidx : { *(.ARM.exidx*) }
> +	ELF_DETAILS
>  	.ARM.attributes 0 : { *(.ARM.attributes) }
>  
>  	/DISCARD/	: {
> 
> I just noticed that the .ARM.exidx section (ARM_UNWIND_SECTIONS)
> is placed before the sections the error mentions (ARM_DETAILS) in
> arch/arm/kernel/vmlinux.lds.S, where we do not see any errors with LLVM
> 11. Looking at the section headers, it seems like it should be okay?

I think it's good like this too, will you send it out as a patch?

Thanks,
Joey



More information about the linux-arm-kernel mailing list