linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Tim Abbott <tabbott@ksplice.com>
Cc: linux-parisc@vger.kernel.org, Kyle McMartin <kyle@mcmartin.ca>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH v2 0/2] Linker script cleanup patches for parisc
Date: Mon, 28 Sep 2009 00:39:47 +0200	[thread overview]
Message-ID: <4ABFE9B3.8000000@gmx.de> (raw)
In-Reply-To: <alpine.DEB.1.10.0909271719570.14151@dr-wily.mit.edu>

On 09/27/2009 11:25 PM, Tim Abbott wrote:
> On Sun, 27 Sep 2009, Helge Deller wrote:
>
>>   Tim, thanks for your work!
>>
>> Sadly it broke the parisc build in two places:
>> a) THREAD_SIZE can't be used in the vmlinux.lds.S file
>> b) It generates linker errors like "local symbol 0: discarded in section
>> `.exit.text' from kernel/built-in.o".
>
> Sorry about that -- I should have tried harder to get someone to test this
> one, since parisc is one of the architectures for which I don't have a
> cross-compiler.

No problem. It was on my todo-list to test your patch, but then it
already got merged :-)

>> Attached patch below fixes both issues. Tested with 32- and 64-bit parisc
>> kernel.
>
> The .exit.text change looks fine.

Good.

> [...]
> Rather than adding a new definition in asm-offsets.c, I think it'll be
> better to do something like the following to make the normal THREAD_SIZE
> definition available in the linker script and other assembly files:
>
> 	-Tim Abbott
>
> parisc: Make THREAD_SIZE available to assembly files and linker scripts.
>
> Signed-off-by: Tim Abbott<tabbott@ksplice.com>

Yes, much better.
Acked-by: Helge Deller <deller@gmx.de>

But with this change, the vmlinux.lds.S file needs to include
the <asm/thread_info.h> file as well. I've added the adjusted patch
to vmlinux.lds.S below.

> ---
>   arch/parisc/include/asm/thread_info.h |   10 +++++-----
>   1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h
> index ac775a7..51bca20 100644
> --- a/arch/parisc/include/asm/thread_info.h
> +++ b/arch/parisc/include/asm/thread_info.h
> @@ -32,6 +32,11 @@ struct thread_info {
>   #define init_thread_info        (init_thread_union.thread_info)
>   #define init_stack              (init_thread_union.stack)
>
> +/* how to get the thread information struct from C */
> +#define current_thread_info()	((struct thread_info *)mfctl(30))
> +
> +#endif /* !__ASSEMBLY */
> +
>   /* thread information allocation */
>
>   #define THREAD_SIZE_ORDER            2
> @@ -40,11 +45,6 @@ struct thread_info {
>   #define THREAD_SIZE             (PAGE_SIZE<<  THREAD_SIZE_ORDER)
>   #define THREAD_SHIFT            (PAGE_SHIFT + THREAD_SIZE_ORDER)
>
> -/* how to get the thread information struct from C */
> -#define current_thread_info()	((struct thread_info *)mfctl(30))
> -
> -#endif /* !__ASSEMBLY */
> -
>   #define PREEMPT_ACTIVE_BIT	28
>   #define PREEMPT_ACTIVE		(1<<  PREEMPT_ACTIVE_BIT)
>

Adjusted patch to vmlinux.lds.S:

parisc: Fix linker script breakage.

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index 775be27..7fc2c3d 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -28,6 +28,7 @@
  #include <asm/cache.h>
  #include <asm/page.h>
  #include <asm/asm-offsets.h>
+#include <asm/thread_info.h>
  	
  /* ld script to make hppa Linux kernel */
  #ifndef CONFIG_64BIT
@@ -135,6 +136,16 @@ SECTIONS
  	INIT_TEXT_SECTION(16384)
  	INIT_DATA_SECTION(16)
  
+	/* we have to discard exit text and such at runtime, not link time */
+	.exit.text :
+	{
+		EXIT_TEXT
+	}
+	.exit.data :
+	{
+		EXIT_DATA
+	}
+
  	PERCPU(PAGE_SIZE)
  	. = ALIGN(PAGE_SIZE);
  	__init_end = .;

      reply	other threads:[~2009-09-27 22:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18 20:34 [PATCH v2 0/2] Linker script cleanup patches for parisc Tim Abbott
2009-09-18 20:34 ` [PATCH v2 1/2] parisc: Clean up linker script using new linker script macros Tim Abbott
2009-09-18 20:34 ` [PATCH v2 2/2] parisc: Remove useless altinstructions code copied from x86 Tim Abbott
2009-09-19  8:38 ` [PATCH v2 0/2] Linker script cleanup patches for parisc Sam Ravnborg
2009-09-27 21:02 ` Helge Deller
2009-09-27 21:25   ` Tim Abbott
2009-09-27 22:39     ` Helge Deller [this message]

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=4ABFE9B3.8000000@gmx.de \
    --to=deller@gmx.de \
    --cc=kyle@mcmartin.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@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;
as well as URLs for NNTP newsgroup(s).