Klaus Heinrich Kiwi | bdfc1ac | 2020-12-11 07:27:58 -0500 | [diff] [blame] | 1 | From 6def8ac06ff34b2232de48e5f9bc3a179199a9ad Mon Sep 17 00:00:00 2001 |
| 2 | From: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com> |
| 3 | Date: Thu, 10 Dec 2020 15:44:55 -0500 |
| 4 | Subject: [PATCH] build: Fix linker script for builtin Kernel |
| 5 | |
| 6 | Commit '6b08928d - build/lds: place debug sections according to |
| 7 | defaults' introduced a DEBUG_SECTIONS macro that is effectivelly |
| 8 | resetting the location pointer back to zero, making the next section |
| 9 | (builtin_kernel) collide with the earlier sections. |
| 10 | |
| 11 | Fix by moving these sections to the very end. |
| 12 | |
| 13 | Error message: |
| 14 | $ make KERNEL=zImage.epapr |
| 15 | [CC] asm/asm-offsets.s |
| 16 | [GN] include/asm-offsets.h |
| 17 | <...> |
| 18 | [LD] skiboot.tmp.elf |
| 19 | ld: section .builtin_kernel LMA [0000000000000000,0000000000285d87] |
| 20 | overlaps section .head LMA [0000000000000000,0000000000003897] |
| 21 | ld: section .naca LMA [0000000000004000,000000000000505f] overlaps |
| 22 | section .builtin_kernel LMA [0000000000000000,0000000000285d87] |
| 23 | make: *** [/skiboot/Makefile.main:333: skiboot.tmp.elf] Error 1 |
| 24 | |
| 25 | Fixes: 6b08928d - build/lds: place debug sections according to defaults |
| 26 | Signed-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 | |
| 31 | diff --git a/skiboot.lds.S b/skiboot.lds.S |
| 32 | index 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 | -- |
| 54 | 2.27.0 |
| 55 | |