[PATCH] powerpc: Include .BTF section

Michael Ellerman mpe at ellerman.id.au
Mon Feb 24 11:29:47 AEDT 2020


"Naveen N. Rao" <naveen.n.rao at linux.vnet.ibm.com> writes:
> Selecting CONFIG_DEBUG_INFO_BTF results in the below warning from ld:
>   ld: warning: orphan section `.BTF' from `.btf.vmlinux.bin.o' being placed in section `.BTF'
>
> Include .BTF section in vmlinux explicitly to fix the same.

I don't see any other architectures doing this in their linker script.
Why are we special?

cheers

> diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
> index b4c89a1acebb..a32d478a7f41 100644
> --- a/arch/powerpc/kernel/vmlinux.lds.S
> +++ b/arch/powerpc/kernel/vmlinux.lds.S
> @@ -303,6 +303,12 @@ SECTIONS
>  		*(.branch_lt)
>  	}
>  
> +#ifdef CONFIG_DEBUG_INFO_BTF
> +	.BTF : AT(ADDR(.BTF) - LOAD_OFFSET) {
> +		*(.BTF)
> +	}
> +#endif
> +
>  	.opd : AT(ADDR(.opd) - LOAD_OFFSET) {
>  		__start_opd = .;
>  		KEEP(*(.opd))
> -- 
> 2.24.1


More information about the Linuxppc-dev mailing list