On Tue, Mar 22, 2005 at 10:41:17PM +0000, Ralf Baechle wrote:
> On Mon, Mar 21, 2005 at 06:21:46PM -0800, Andrew Morton wrote:
>
> > > It seems all 25 linker scripts in the current bk tree are suffering from
> > > this. Which mean with CONFIG_BLK_DEV_INITRD enabled first free_initrd_mem
> > > may be called to free the initram disk and just a little later
> > > free_initmem will try to free the entire range again, so either the
> > > linker scripts would need fixing or free_initrd_mem has become obsolete.
> > >
> >
> > Hard call. I'd be 51% inclined to change the linker scripts so that the
> > freeing of the initram disk happens explicitly, rather than having it
> > magically hidden inside the main initmem segment.
> >
> > Any objections from anyone?
> >
> > (cc'ed Adrian, who might be interested in raising a patch ;))
>
> I've cooked that already. Let me check if I can dig it up from here - I'm
> supposed to be on vacation ;-)
> . = ALIGN(4096);
> __initramfs_start = .;
> .init.ramfs : { *(.init.ramfs) }
> __initramfs_end = .;
Hi Ralf.
When you anyway hack on thins in your vacation please
move the definition of initramfs to asm-generic.
Sam
Something like this:
===== include/asm-generic/vmlinux.lds.h 1.18 vs edited =====
--- 1.18/include/asm-generic/vmlinux.lds.h 2005-03-14 20:55:39 +01:00
+++ edited/include/asm-generic/vmlinux.lds.h 2005-03-22 23:55:17 +01:00
@@ -97,3 +97,12 @@
VMLINUX_SYMBOL(__lock_text_start) = .; \
*(.spinlock.text) \
VMLINUX_SYMBOL(__lock_text_end) = .;
+
+/* initramfs area. */
+# define INITRAMFS \
+ . = ALIGN(4096); \
+ .init.ramfs : { \
+ VMLINUX_SYMBOL(__initramfs_start) = .; \
+ *(.init.ramfs) \
+ VMLINUX_SYMBOL(__initramfs_end) = .; \
+ }