Jeremy Fitzhardinge <jeremy at goop.org> writes: Looks sane, and it sounds familiar. We need to get this out into a tree with a wide test base like the -mm tree for a while to see if there are any common versions of ld that have problems with this. I seem to remember trying something like this earlier and there being problems. But it was a long time ago and it was not this problem. > Signed-off-by: Jeremy Fitzhardinge <jeremy at xensource.com> > Cc: Eric W. Biederman <ebiederm at xmission.com> > Cc: Hollis Blanchard <hollisb at us.ibm.com> > > --- > arch/i386/kernel/vmlinux.lds.S | 12 ++++++++++-- > include/asm-generic/vmlinux.lds.h | 3 +++ > 2 files changed, 13 insertions(+), 2 deletions(-) > > > diff -r e29410954b12 arch/i386/kernel/vmlinux.lds.S > --- a/arch/i386/kernel/vmlinux.lds.S Thu Jul 27 18:06:38 2006 -0700 > +++ b/arch/i386/kernel/vmlinux.lds.S Fri Jul 28 15:15:05 2006 -0700 > @@ -13,6 +13,12 @@ OUTPUT_ARCH(i386) > OUTPUT_ARCH(i386) > ENTRY(phys_startup_32) > jiffies = jiffies_64; > + > +PHDRS { > + text PT_LOAD FLAGS(5); /* R_E */ > + data PT_LOAD FLAGS(7); /* RWE */ > + note PT_NOTE FLAGS(4); /* R__ */ > +} > SECTIONS > { > . = __KERNEL_START; > @@ -26,7 +32,7 @@ SECTIONS > KPROBES_TEXT > *(.fixup) > *(.gnu.warning) > - } = 0x9090 > + } :text = 0x9090 > > _etext = .; /* End of text section */ > > @@ -48,7 +54,7 @@ SECTIONS > .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */ > *(.data) > CONSTRUCTORS > - } > + } :data > > . = ALIGN(4096); > __nosave_begin = .; > @@ -184,4 +190,6 @@ SECTIONS > STABS_DEBUG > > DWARF_DEBUG > + > + NOTES > } > diff -r e29410954b12 include/asm-generic/vmlinux.lds.h > --- a/include/asm-generic/vmlinux.lds.h Thu Jul 27 18:06:38 2006 -0700 > +++ b/include/asm-generic/vmlinux.lds.h Fri Jul 28 15:15:05 2006 -0700 > @@ -194,3 +194,6 @@ > .stab.index 0 : { *(.stab.index) } \ > .stab.indexstr 0 : { *(.stab.indexstr) } \ > .comment 0 : { *(.comment) } > + > +#define NOTES \ > + .notes : { *(.note.*) } :note