blob: a97d79b575147711ff348c208e52e49a711dc77d [file] [log] [blame]
Klaus Heinrich Kiwibdfc1ac2020-12-11 07:27:58 -05001From 6def8ac06ff34b2232de48e5f9bc3a179199a9ad Mon Sep 17 00:00:00 2001
2From: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
3Date: Thu, 10 Dec 2020 15:44:55 -0500
4Subject: [PATCH] build: Fix linker script for builtin Kernel
5
6Commit '6b08928d - build/lds: place debug sections according to
7defaults' introduced a DEBUG_SECTIONS macro that is effectivelly
8resetting the location pointer back to zero, making the next section
9(builtin_kernel) collide with the earlier sections.
10
11Fix by moving these sections to the very end.
12
13Error message:
14$ make KERNEL=zImage.epapr
15 [CC] asm/asm-offsets.s
16 [GN] include/asm-offsets.h
17<...>
18 [LD] skiboot.tmp.elf
19ld: section .builtin_kernel LMA [0000000000000000,0000000000285d87]
20 overlaps section .head LMA [0000000000000000,0000000000003897]
21ld: section .naca LMA [0000000000004000,000000000000505f] overlaps
22 section .builtin_kernel LMA [0000000000000000,0000000000285d87]
23make: *** [/skiboot/Makefile.main:333: skiboot.tmp.elf] Error 1
24
25Fixes: 6b08928d - build/lds: place debug sections according to defaults
26Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
27---
28 skiboot.lds.S | 4 ++--
29 1 file changed, 2 insertions(+), 2 deletions(-)
30
31diff --git a/skiboot.lds.S b/skiboot.lds.S
32index 5da6f9d8..5a7f9e31 100644
33--- a/skiboot.lds.S
34+++ b/skiboot.lds.S
35@@ -233,8 +233,6 @@ SECTIONS
36
37 ASSERT((HEAP_BASE - SKIBOOT_BASE) >= _end, "Heap collision with image")
38
39- DEBUG_SECTIONS
40-
41 /* Optional kernel image */
42 . = ALIGN(PAGE_SIZE);
43 .builtin_kernel : {
44@@ -243,6 +241,8 @@ SECTIONS
45 __builtin_kernel_end = .;
46 }
47
48+ DEBUG_SECTIONS
49+
50 /* Discards */
51 /DISCARD/ : {
52 *(.note.GNU-stack)
53--
542.27.0
55