diff options
author | Peter Oberparleiter <oberpar@linux.ibm.com> | 2018-09-13 06:59:59 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2018-10-11 17:54:58 -0400 |
commit | 8dcf86caa1e3daf4a6ccf38e97f4f752b411f829 (patch) | |
tree | ae7b52e3e4b92eb90fbe745d75550a54c034292b | |
parent | 0778a9f2dd924c3af41971ba40eec44793aea531 (diff) |
vmlinux.lds.h: Fix incomplete .text.exit discards
Enabling CONFIG_GCOV_PROFILE_ALL=y causes linker errors on ARM:
`.text.exit' referenced in section `.ARM.exidx.text.exit':
defined in discarded section `.text.exit'
`.text.exit' referenced in section `.fini_array.00100':
defined in discarded section `.text.exit'
And related errors on NDS32:
`.text.exit' referenced in section `.dtors.65435':
defined in discarded section `.text.exit'
The gcov compiler flags cause certain compiler versions to generate
additional destructor-related sections that are not yet handled by the
linker script, resulting in references between discarded and
non-discarded sections.
Since destructors are not used in the Linux kernel, fix this by
discarding these additional sections.
Reported-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Greentime Hu <green.hu@gmail.com>
Tested-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r-- | arch/arm/kernel/vmlinux.lds.h | 2 | ||||
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/kernel/vmlinux.lds.h b/arch/arm/kernel/vmlinux.lds.h index ae5fdff18406..8247bc15addc 100644 --- a/arch/arm/kernel/vmlinux.lds.h +++ b/arch/arm/kernel/vmlinux.lds.h | |||
@@ -49,6 +49,8 @@ | |||
49 | #define ARM_DISCARD \ | 49 | #define ARM_DISCARD \ |
50 | *(.ARM.exidx.exit.text) \ | 50 | *(.ARM.exidx.exit.text) \ |
51 | *(.ARM.extab.exit.text) \ | 51 | *(.ARM.extab.exit.text) \ |
52 | *(.ARM.exidx.text.exit) \ | ||
53 | *(.ARM.extab.text.exit) \ | ||
52 | ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text)) \ | 54 | ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text)) \ |
53 | ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text)) \ | 55 | ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text)) \ |
54 | ARM_EXIT_DISCARD(EXIT_TEXT) \ | 56 | ARM_EXIT_DISCARD(EXIT_TEXT) \ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 7b75ff6e2fce..b4d74b1c1e1d 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -613,8 +613,8 @@ | |||
613 | 613 | ||
614 | #define EXIT_DATA \ | 614 | #define EXIT_DATA \ |
615 | *(.exit.data .exit.data.*) \ | 615 | *(.exit.data .exit.data.*) \ |
616 | *(.fini_array) \ | 616 | *(.fini_array .fini_array.*) \ |
617 | *(.dtors) \ | 617 | *(.dtors .dtors.*) \ |
618 | MEM_DISCARD(exit.data*) \ | 618 | MEM_DISCARD(exit.data*) \ |
619 | MEM_DISCARD(exit.rodata*) | 619 | MEM_DISCARD(exit.rodata*) |
620 | 620 | ||