mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@snapgear.com>
To: Tim Abbott <tabbott@ksplice.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Sam Ravnborg <sam@ravnborg.org>, Greg Ungerer <gerg@uclinux.org>
Subject: Re: [PATCH] m68knommu: Clean up linker script using new linker script macros.
Date: Tue, 08 Sep 2009 16:54:21 +1000	[thread overview]
Message-ID: <4AA5FF9D.10703@snapgear.com> (raw)
In-Reply-To: <alpine.DEB.1.10.0909071017001.17860@dr-wily.mit.edu>

Hi Tim,

Tim Abbott wrote:
> On Mon, 7 Sep 2009, Greg Ungerer wrote:
> 
>> Now, back to the original patch. Now fails with another syntax error
>> at the last line in this:
>>
>>  .init : {
>>   . = ALIGN((1 << (12)));
>>   __init_begin = .;
>>   . = ALIGN((1 << (12))); .init.text : AT(ADDR(.init.text) - 0) { _sinittext =
>> .; *(.init.text) *(.devinit.text) *(.cpuinit.text) *(.meminit.text) _einittext
>> = .; }
> 
> Oops.  The ".init : { }" wrapping the new macros there should have been 
> removed.
> 
> The following patch should fix this issue (obviously, you'll want to 
> squash it with the original patch, but I figure sending the diff will be 
> easier to review).

Ok, yes, that fixes that problem. I had to also make THREAD_SIZE
available to the linker with:

diff --git a/arch/m68k/include/asm/thread_info_no.h 
b/arch/m68k/include/asm/thre
index c2bde5e..a6512bf 100644
--- a/arch/m68k/include/asm/thread_info_no.h
+++ b/arch/m68k/include/asm/thread_info_no.h
@@ -12,8 +12,6 @@

  #ifdef __KERNEL__

-#ifndef __ASSEMBLY__
-
  /*
   * Size of kernel stack for each process. This must be a power of 2...
   */
@@ -28,6 +26,8 @@
   */
  #define THREAD_SIZE (PAGE_SIZE<<THREAD_SIZE_ORDER)

+#ifndef __ASSEMBLY__
+
  /*
   * low level task data.
   */


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

The resulting kernels don't boot.

Regards
Greg



> Signed-off-by: Tim Abbott <tabbott@ksplice.com>
> ---
>  arch/m68knommu/kernel/vmlinux.lds.S |   14 ++++++--------
>  1 files changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
> index 979acb5..c380040 100644
> --- a/arch/m68knommu/kernel/vmlinux.lds.S
> +++ b/arch/m68knommu/kernel/vmlinux.lds.S
> @@ -154,14 +154,12 @@ SECTIONS {
>  		_edata = . ;
>  	} > DATA
>  
> -	.init : {
> -		. = ALIGN(PAGE_SIZE);
> -		__init_begin = .;
> -		INIT_TEXT_SECTION(PAGE_SIZE)
> -		INIT_DATA_SECTION(16)
> -		. = ALIGN(PAGE_SIZE);
> -		__init_end = .;
> -	} > INIT
> +	. = ALIGN(PAGE_SIZE);
> +	__init_begin = .;
> +	INIT_TEXT_SECTION(PAGE_SIZE) > INIT
> +	INIT_DATA_SECTION(16) > INIT
> +	. = ALIGN(PAGE_SIZE);
> +	__init_end = .;
>  
>  	/DISCARD/ : {
>  		EXIT_TEXT

-- 
------------------------------------------------------------------------
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

  reply	other threads:[~2009-09-08  6:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-07  3:10 Tim Abbott
2009-09-07  5:25 ` Greg Ungerer
2009-09-07  5:37   ` Tim Abbott
2009-09-07  7:06     ` Greg Ungerer
2009-09-07 14:21       ` Tim Abbott
2009-09-08  6:54         ` Greg Ungerer [this message]
2009-09-08 14:36           ` Tim Abbott

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=4AA5FF9D.10703@snapgear.com \
    --to=gerg@snapgear.com \
    --cc=gerg@uclinux.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome