[Skiboot] [PATCH] build: Fix linker script for builtin Kernel

Segher Boessenkool segher at kernel.crashing.org
Sat Dec 12 04:31:35 AEDT 2020


On Fri, Dec 11, 2020 at 08:18:30AM -0300, Klaus Heinrich Kiwi wrote:
> On 12/10/2020 9:47 PM, Klaus Heinrich Kiwi wrote:
> >On 12/10/2020 6:00 PM, Klaus Heinrich Kiwi wrote:
> >
> >>      /* Optional kernel image */
> >>         . = ALIGN(PAGE_SIZE);
> >>         .builtin_kernel : {
> >>@@ -243,6 +241,8 @@ SECTIONS
> >>          __builtin_kernel_end = .;
> >>      }
> >>
> >>+    DEBUG_SECTIONS
> >>+
> >
> >FYI, an IBM colleague from the compiler team (Segher) mentioned we could 
> >add (NOLOAD)
> >to the sections undere DEBUG_SECTIONS macro instead, and that could save 
> >us some
> >memory as well..
> >
> >I'll test this tomorrow and send a V2 if successful.
> 
> I did a few tests with the (NOLOAD) for the debug sections, but that alone 
> wasn't sufficient
> to fix original issue.. additionally, I couldn't note any memory / size 
> differences in the final
> binary.
> 
> So unless Segher has other suggestions, I think we will need the patch 
> above after all.

Flags are inherited from the previous section if you specify nothing,
so I thought that was what caused the problem if you have the debug
sections before everything else.  Just putting the debug sections after
other sections instead of before (just like every other project does)
is probably a good idea no matter what...  but figuring out what went
wrong is at least fun for a Friday, isn't it?  :-)


Segher


More information about the Skiboot mailing list