Skip to content

Commit 52c8ee5

Browse files
oberparsfrothwell
authored andcommitted
vmlinux.lds.h: Fix linker warnings about orphan .LPBX sections
Enabling both CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y and CONFIG_GCOV_PROFILE_ALL=y results in linker warnings: warning: orphan section `.data..LPBX1' being placed in section `.data..LPBX1'. LD_DEAD_CODE_DATA_ELIMINATION adds compiler flag -fdata-sections. This option causes GCC to create separate data sections for data objects, including those generated by GCC internally for gcov profiling. The names of these objects start with a dot (.LPBX0, .LPBX1), resulting in section names starting with 'data..'. As section names starting with 'data..' are used for specific purposes in the Linux kernel, the linker script does not automatically include them in the output data section, resulting in the "orphan section" linker warnings. Fix this by specifically including sections named "data..LPBX*" in the data section. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> Tested-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
1 parent 8dcf86c commit 52c8ee5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎include/asm-generic/vmlinux.lds.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
*/
6969
#ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
7070
#define TEXT_MAIN .text .text.[0-9a-zA-Z_]*
71-
#define DATA_MAIN .data .data.[0-9a-zA-Z_]*
71+
#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..LPBX*
7272
#define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]*
7373
#define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]*
7474
#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]*

0 commit comments

Comments
 (0)