o i386 kernel reboots instantly if compiled with binutils older than
2.6.15.
o Older binutils required explicit flags to mark a section allocatable
and executable(AX). Newer binutils automatically mark a section AX if
the name starts with .text.
o While defining a new section using assembler "section" directive,
explicitly mention section flags.
Signed-off-by: Segher Boessenkool <[email protected]>
Signed-off-by: Vivek Goyal <[email protected]>
---
arch/i386/boot/compressed/head.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN arch/i386/boot/compressed/head.S~jean-reboot-issue-fix arch/i386/boot/compressed/head.S
--- linux-2.6.20-rc2-reloc/arch/i386/boot/compressed/head.S~jean-reboot-issue-fix 2007-01-02 09:54:56.000000000 +0530
+++ linux-2.6.20-rc2-reloc-root/arch/i386/boot/compressed/head.S 2007-01-02 09:57:46.000000000 +0530
@@ -28,7 +28,7 @@
#include <asm/page.h>
#include <asm/boot.h>
-.section ".text.head"
+.section ".text.head","ax",@progbits
.globl startup_32
startup_32:
_
Vivek Goyal <[email protected]> writes:
> o i386 kernel reboots instantly if compiled with binutils older than
> 2.6.15.
>
> o Older binutils required explicit flags to mark a section allocatable
> and executable(AX). Newer binutils automatically mark a section AX if
> the name starts with .text.
>
> o While defining a new section using assembler "section" directive,
> explicitly mention section flags.
As such this patch looks fine, and is certainly harmless. But don't we
also need to address the issue that .text.head is not listed in the
linker script?
i.e. Don't we also need?
.text : AT(ADDR(.text) - LOAD_OFFSET) {
_text = .; /* Text and read-only data */
+ *(.text.head)
*(.text)
SCHED_TEXT
LOCK_TEXT
KPROBES_TEXT
*(.fixup)
*(.gnu.warning)
_etext = .; /* End of text section */
} :text = 0x9090
I'm not even certain how the i386 kernel links properly without the above.
Eric
On Tue, Jan 02, 2007 at 11:44:34PM -0700, Eric W. Biederman wrote:
> Vivek Goyal <[email protected]> writes:
>
> > o i386 kernel reboots instantly if compiled with binutils older than
> > 2.6.15.
> >
> > o Older binutils required explicit flags to mark a section allocatable
> > and executable(AX). Newer binutils automatically mark a section AX if
> > the name starts with .text.
> >
> > o While defining a new section using assembler "section" directive,
> > explicitly mention section flags.
>
> As such this patch looks fine, and is certainly harmless. But don't we
> also need to address the issue that .text.head is not listed in the
> linker script?
>
> i.e. Don't we also need?
>
> .text : AT(ADDR(.text) - LOAD_OFFSET) {
> _text = .; /* Text and read-only data */
> + *(.text.head)
> *(.text)
> SCHED_TEXT
> LOCK_TEXT
> KPROBES_TEXT
> *(.fixup)
> *(.gnu.warning)
> _etext = .; /* End of text section */
> } :text = 0x9090
>
>
> I'm not even certain how the i386 kernel links properly without the above.
Hi Eric,
This .text.head section is not part of vmlinux. This is part of uncompressed
portion in bzImage. arch/i386/boot/compressed/head.S.
Hence, arch/i386/boot/compressed/vmlinux.lds should take care of it which
already has entry for linking .text.head section.
. = 0 ;
.text.head : {
_head = . ;
*(.text.head)
_ehead = . ;
}
Thanks
Vivek
Vivek Goyal <[email protected]> writes:
> Hi Eric,
>
> This .text.head section is not part of vmlinux. This is part of uncompressed
> portion in bzImage. arch/i386/boot/compressed/head.S.
>
> Hence, arch/i386/boot/compressed/vmlinux.lds should take care of it which
> already has entry for linking .text.head section.
Yep. Sorry never mind.
Thanks for the good tracking on this one.
Eric
On Wed, Jan 03, 2007 at 09:46:45AM +0530, Vivek Goyal wrote:
>
> o i386 kernel reboots instantly if compiled with binutils older than
> 2.6.15.
Should that have been "2.15"?
And is the following perhaps the same issue?
Subject : kernel immediately reboots instead of booting
References : http://lkml.org/lkml/2007/1/2/15
Submitter : Steve Youngs <[email protected]>
Status : unknown
@Steve:
You had binutils 2.14.90.0.6 .
Does this patch fix it for you?
> o Older binutils required explicit flags to mark a section allocatable
> and executable(AX). Newer binutils automatically mark a section AX if
> the name starts with .text.
>
> o While defining a new section using assembler "section" directive,
> explicitly mention section flags.
>
> Signed-off-by: Segher Boessenkool <[email protected]>
> Signed-off-by: Vivek Goyal <[email protected]>
> ---
>
> arch/i386/boot/compressed/head.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -puN arch/i386/boot/compressed/head.S~jean-reboot-issue-fix arch/i386/boot/compressed/head.S
> --- linux-2.6.20-rc2-reloc/arch/i386/boot/compressed/head.S~jean-reboot-issue-fix 2007-01-02 09:54:56.000000000 +0530
> +++ linux-2.6.20-rc2-reloc-root/arch/i386/boot/compressed/head.S 2007-01-02 09:57:46.000000000 +0530
> @@ -28,7 +28,7 @@
> #include <asm/page.h>
> #include <asm/boot.h>
>
> -.section ".text.head"
> +.section ".text.head","ax",@progbits
> .globl startup_32
>
> startup_32:
> _
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
On Wed, Jan 03, 2007 at 02:53:26PM +0100, Adrian Bunk wrote:
> On Wed, Jan 03, 2007 at 09:46:45AM +0530, Vivek Goyal wrote:
> >
> > o i386 kernel reboots instantly if compiled with binutils older than
> > 2.6.15.
>
> Should that have been "2.15"?
>
Yes Adrian, it should be 2.15 instead. My mistake.
Hopefully this patch should solve steve's issue too.
Reattaching the patch with corrected changelog.
Thanks
Vivek
o i386 kernel reboots instantly if compiled with binutils older than
2.15.
o Older binutils required explicit flags to mark a section allocatable
and executable(AX). Newer binutils automatically mark a section AX if
the name starts with .text.
o While defining a new section using assembler "section" directive,
explicitly mention section flags.
Signed-off-by: Segher Boessenkool <[email protected]>
Signed-off-by: Vivek Goyal <[email protected]>
---
arch/i386/boot/compressed/head.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN arch/i386/boot/compressed/head.S~jean-reboot-issue-fix arch/i386/boot/compressed/head.S
--- linux-2.6.20-rc2-reloc/arch/i386/boot/compressed/head.S~jean-reboot-issue-fix 2007-01-02 09:54:56.000000000 +0530
+++ linux-2.6.20-rc2-reloc-root/arch/i386/boot/compressed/head.S 2007-01-02 09:57:46.000000000 +0530
@@ -28,7 +28,7 @@
#include <asm/page.h>
#include <asm/boot.h>
-.section ".text.head"
+.section ".text.head","ax",@progbits
.globl startup_32
startup_32:
_
On Wed, 3 Jan 2007 14:53:26 +0100, Adrian Bunk wrote:
> On Wed, Jan 03, 2007 at 09:46:45AM +0530, Vivek Goyal wrote:
> >
> > o i386 kernel reboots instantly if compiled with binutils older than
> > 2.6.15.
>
> Should that have been "2.15"?
>
> And is the following perhaps the same issue?
>
> Subject : kernel immediately reboots instead of booting
> References : http://lkml.org/lkml/2007/1/2/15
> Submitter : Steve Youngs <[email protected]>
> Status : unknown
Indeed this pretty much resembles my problem.
> @Steve:
> You had binutils 2.14.90.0.6 .
> Does this patch fix it for you?
I'd really expect it to, Steve please try the patch and confirm.
--
Jean Delvare
> Hopefully this patch should solve steve's issue too.
Sure looks like it.
> o Older binutils required explicit flags to mark a section allocatable
> and executable(AX). Newer binutils automatically mark a section AX if
> the name starts with .text.
More exactly, since 2.15 more section names are automatically
recognised as being of a certain type; older binutils already
did this for plain .text, for example. Just a nitpick, but
perhaps it explains the problem better; I'm fine with the
patch as-is.
Segher