From: Greg Ungerer <gerg@snapgear.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Tim Abbott <tabbott@ksplice.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 6/7] m68knommu: Move __init_end out of the .init section.
Date: Fri, 30 Oct 2009 10:44:00 +1000 [thread overview]
Message-ID: <4AEA36D0.8000106@snapgear.com> (raw)
In-Reply-To: <20091014151616.GA6901@merkur.ravnborg.org>
Hi Sam,
Sorry for the slow response.
Sam Ravnborg wrote:
> On Wed, Oct 14, 2009 at 02:41:38PM +1000, Greg Ungerer wrote:
>> Hi Tim,
>>
>> Tim Abbott wrote:
>>> Signed-off-by: Tim Abbott <tabbott@ksplice.com>
>>> ---
>>> arch/m68knommu/kernel/vmlinux.lds.S | 2 ++
>>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
>>> index 73fe172..49d5c4d 100644
>>> --- a/arch/m68knommu/kernel/vmlinux.lds.S
>>> +++ b/arch/m68knommu/kernel/vmlinux.lds.S
>>> @@ -169,6 +169,8 @@ SECTIONS {
>>> CON_INITCALL
>>> SECURITY_INITCALL
>>> INIT_RAM_FS
>>> + } > INIT
>>> + .init_end : {
>>> . = ALIGN(PAGE_SIZE);
>>> __init_end = .;
>>> } > INIT
>>
>> After applying this I can no longer boot.
>>
>> Resulting headers for vmlinux are:
>>
>> vmlinux: file format elf32-m68k
>>
>> Sections:
>> Idx Name Size VMA LMA File off Algn
>> 0 .text 00125ff0 40020000 40020000 00002000 2**4
>> CONTENTS, ALLOC, LOAD, READONLY, CODE
>> 1 .data 00012010 40145ff0 40145ff0 00127ff0 2**4
>> CONTENTS, ALLOC, LOAD, DATA
>> 2 .init 0000b608 40158000 40158000 0013a000 2**2
>> CONTENTS, ALLOC, LOAD, CODE
>> 3 .init_end 000009f8 40163608 40163608 00145608 2**0
>> ALLOC
>> 4 .bss 0000a9ec 40164000 40164000 00145608 2**4
>> ALLOC
>> 5 .comment 00001c56 00000000 00000000 00145608 2**0
>> CONTENTS, READONLY
>
> Took a look at this trying to understand why this
> caused a non-booting system.
>
> The previous post should have created a section named "init_begin",
> but it is not present in the above.
> I think this is beacuse the section had a zero size and thus
> got ignored by the linker.
>
> An the linker is allowed to rearrange sections so the concept
> with a init_begin, init_end sections looks wrongs.
> We do not know the order of these sections and they may
> be linked in a different order than what we expect.
>
> I think the better solution is to use the same section name
> several times like this:
>
> .init : {
> . = ALIGN(PAGE_SIZE);
> __init_end = .;
> } > INIT
>
> We should do this both for begin and end.
> Then the linker will not fool us and try to rearrange stuff.
> And we do not end up with zero sized sections.
>
> Greg - I assume the boot failed when it tried to free initmem.
No, it was very early - no console trace even. I didn't check
in logbuf to see what early kernel boot messages there where.
I'll try Tim's next set and see where that gets to.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg@snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
next prev parent reply other threads:[~2009-10-30 0:44 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-22 16:56 [PATCH v2 0/2] Linker script cleanup patches for m68knommu Tim Abbott
2009-09-22 16:56 ` [PATCH v2 1/2] m68knommu: Make THREAD_SIZE available to assembly files Tim Abbott
2009-09-22 16:56 ` [PATCH v2 2/2] m68knommu: Clean up linker script using new linker script macros Tim Abbott
2009-10-01 5:56 ` Greg Ungerer
2009-10-12 14:47 ` Tim Abbott
2009-10-12 23:46 ` Greg Ungerer
2009-10-13 1:30 ` [PATCH v3 0/7] " Tim Abbott
2009-10-13 1:30 ` [PATCH v3 1/7] m68knommu: Don't hardcode the value of PAGE_SIZE in the linker script Tim Abbott
2009-10-13 1:30 ` [PATCH v3 2/7] m68knommu: Make THREAD_SIZE available to assembly files Tim Abbott
2009-10-13 1:30 ` [PATCH v3 3/7] m68knommu: Use INIT_TASK_DATA and CACHELINE_ALIGNED_DATA Tim Abbott
2009-10-13 1:30 ` [PATCH v3 4/7] m68knommu: Use more macros inside the .init section Tim Abbott
2009-10-13 1:30 ` [PATCH v3 5/7] m68knommu: Move __init_begin out of " Tim Abbott
2009-10-13 1:30 ` [PATCH v3 6/7] m68knommu: Move __init_end " Tim Abbott
2009-10-13 1:30 ` [PATCH v3 7/7] m68knommu: Split the .init section into INIT_TEXT_SECTION and INIT_DATA_SECTION Tim Abbott
2009-10-14 4:41 ` [PATCH v3 6/7] m68knommu: Move __init_end out of the .init section Greg Ungerer
2009-10-14 15:16 ` Sam Ravnborg
2009-10-18 17:22 ` Tim Abbott
2009-10-18 17:23 ` [PATCH v4 1/7] m68knommu: Don't hardcode the value of PAGE_SIZE in the linker script Tim Abbott
2009-10-30 0:57 ` Greg Ungerer
2009-10-30 1:22 ` Tim Abbott
2009-10-30 5:02 ` Greg Ungerer
2009-10-18 17:23 ` [PATCH v4 2/7] m68knommu: Make THREAD_SIZE available to assembly files Tim Abbott
2009-10-18 17:23 ` [PATCH v4 3/7] m68knommu: Use INIT_TASK_DATA and CACHELINE_ALIGNED_DATA Tim Abbott
2009-10-18 17:23 ` [PATCH v4 4/7] m68knommu: Use more macros inside the .init section Tim Abbott
2009-10-18 17:23 ` [PATCH v4 5/7] m68knommu: Move __init_begin out of " Tim Abbott
2009-10-18 17:23 ` [PATCH v4 6/7] m68knommu: Move __init_end " Tim Abbott
2009-10-18 17:23 ` [PATCH v4 7/7] m68knommu: Split the .init section into INIT_TEXT_SECTION and INIT_DATA_SECTION Tim Abbott
2009-10-30 1:13 ` Greg Ungerer
2009-10-30 1:30 ` Tim Abbott
2009-10-30 5:10 ` Greg Ungerer
2009-10-30 11:35 ` Sam Ravnborg
2009-10-30 18:10 ` Tim Abbott
2009-10-30 0:44 ` Greg Ungerer [this message]
2009-10-13 5:55 ` [PATCH v3 4/7] m68knommu: Use more macros inside the .init section Greg Ungerer
2009-10-13 15:39 ` Tim Abbott
2009-10-14 4:22 ` Greg Ungerer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AEA36D0.8000106@snapgear.com \
--to=gerg@snapgear.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=tabbott@ksplice.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.