lkml.org 
[lkml]   [2009]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] m68knommu: Clean up linker script using new linker script macros.
On Tue, 8 Sep 2009, Greg Ungerer wrote:

> But now the bss section doesn't looked properly aligned (at
> least it is not on a page boundary any longer after the init.data):
>
> Sections:
> Idx Name Size VMA LMA File off Algn
> 0 .text 00124ab8 40020000 40020000 00002000 2**4
> CONTENTS, ALLOC, LOAD, READONLY, CODE
> 1 .data 00011540 40144ac0 40144ac0 00126ac0 2**4
> CONTENTS, ALLOC, LOAD, DATA
> 2 .init.text 0000a96c 40156000 40156000 00138000 2**2
> CONTENTS, ALLOC, LOAD, READONLY, CODE
> 3 .init.data 00000b7c 4016096c 4016096c 0014296c 2**2
> CONTENTS, ALLOC, LOAD, DATA
> 4 .bss 0000a9e8 401614f0 401614f0 001434e8 2**4
> ALLOC
> 5 .comment 00001c8c 00000000 00000000 001434e8 2**0
> CONTENTS, READONLY
>
> Seems kind of odd because:
>
> 40156000 A __init_begin
> 40162000 A __init_end
> 401614f0 B _sbss

Yes, that is quite odd.

> The resulting kernels don't boot.

Right, presumably a big chunk of the .sbss code is being freed since _sbss
is before __init_end.

I'm guessing the issue here is that the __init_begin and __init_end
markers are now not actually in a section (and thus don't have a memory
region marker attached). Does the following patch cause _sbss to not
overlap the init region?

-Tim Abbott

diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index c380040..81b54cb 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -154,12 +154,16 @@ SECTIONS {
_edata = . ;
} > DATA

- . = ALIGN(PAGE_SIZE);
- __init_begin = .;
+ .init_begin : {
+ . = ALIGN(PAGE_SIZE);
+ __init_begin = .;
+ } > INIT
INIT_TEXT_SECTION(PAGE_SIZE) > INIT
INIT_DATA_SECTION(16) > INIT
- . = ALIGN(PAGE_SIZE);
- __init_end = .;
+ .init_end : {
+ . = ALIGN(PAGE_SIZE);
+ __init_end = .;
+ } > INIT

/DISCARD/ : {
EXIT_TEXT

\
 
 \ /
  Last update: 2009-09-08 16:39    [W:0.064 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site