[Top] [All Lists]

Re: _stext is ill-defined / SysRq-T broken

To: Johannes Stezenbach <>
Subject: Re: _stext is ill-defined / SysRq-T broken
From: "Maciej W. Rozycki" <>
Date: Thu, 25 Jul 2002 12:08:15 +0200 (MET DST)
In-reply-to: <>
Organization: Technical University of Gdansk
On Wed, 24 Jul 2002, Johannes Stezenbach wrote:

> I found that the cause for this is that _stext (defined in head.S) is in
> .text.init instead of .text, so it's past _etext.
> I suggest the patch below to fix the bad formatting, but I'm
> not shure about _stext. Should kernel_entry be placed into the .text
> section, or should _stext = _ftext in ld.script?

 I think the intent is to skip initial parts of .text, specifically the
exception handlers (if linked at KSEG0).  kernel_entry is in .text.init
deliberately, as it's not needed except early in the boot process.  I
propose the following change.  Does it work for you? 

> Another nit (I don't have ejtag, so I don't care much):
>   head.S: Assembler messages:
>   head.S:102: Warning: Macro instruction expanded into multiple instructions 
> in a branch delay slot
> Maybe someone has spare nop to put there.

 The warning is spurious, but there seems no way to shut up gas in this
condition.  Thus an extra "nop" looks like the right workaround.

 I'll check your patch at run-time later -- I've noticed that the current
output is less than satisfying.


+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+        e-mail:, PGP key available        +

diff -up --recursive --new-file 
--- linux-mips-2.4.19-rc1-20020719.macro/arch/mips/kernel/head.S        
2002-06-04 03:04:12.000000000 +0000
+++ linux-mips-2.4.19-rc1-20020719/arch/mips/kernel/head.S      2002-07-25 
10:03:16.000000000 +0000
@@ -35,6 +35,10 @@
                .fill   0x400
+               /* The following two symbols are used for kernel profiling. */
+               EXPORT(stext)
+               EXPORT(_stext)
                /* Cache Error */
@@ -144,9 +148,6 @@ ejtag_return:
                NESTED(kernel_entry, 16, sp)
                .set    noreorder
-               /* The following two symbols are used for kernel profiling. */
-               EXPORT(stext)
-               EXPORT(_stext)
                 * Stack for kernel and init, current variable

<Prev in Thread] Current Thread [Next in Thread>