linux-mips
[Top] [All Lists]

head.S and init_task.c vs addinitrd

To: linux-mips@oss.sgi.com
Subject: head.S and init_task.c vs addinitrd
From: Guido Guenther <agx@sigxcpu.org>
Date: Sat, 13 Apr 2002 21:28:11 +0200
Mail-followup-to: linux-mips@oss.sgi.com
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.3.28i
Hi,
short: 
The attached patch modifies head.S/init_task.c to restore the old habit
of merging all sections(besides .reginfo) into one segment which lets
elf2ecoff/addinitrd work again.

long:
some of the recent head.S/init_task.c changes break addinitrd. In 2.4.16
we had two segments which allowed elf2ecoff to put everything (besides
bss) into one text section (dropping REGINFO) in the ecoff image leaving
the data section emtpy. Addinitrd then later merged the initial ramdisk
into that empty data section.

ELF kernel:
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  REGINFO        0x1c2ae0 0x881c3ae0 0x881c3ae0 0x00018 0x00018 R   0x4
  LOAD           0x001000 0x88002000 0x88002000 0x1e8000 0x1ff560 RWE 0x1000

 Section to Segment mapping:
  Segment Sections...
   00     .reginfo 
   01     .text .fixup .kstrtab __ex_table __ksymtab .text.init .data.init 
.setup.init .initcall.init .data.cacheline_aligned .reginfo .data .bss

ECOFF kernel:
Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         001e8000  0000000088002000  0000000088002000  000000d0  2**4
                  CONTENTS, ALLOC, LOAD, CODE
  1 .data         00000000  00000000881ea000  00000000881ea000  001e80d0  2**4
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          00017560  00000000881ea000  00000000881ea000  001e80d0  2**4
                  CONTENTS, ALLOC, NEVER_LOAD

Now as of 2.4.17+ we have three segments described in the program
header:

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  REGINFO        0x1c4ae0 0x881c5ae0 0x881c5ae0 0x00018 0x00018 R   0x4
  LOAD           0x001000 0x88002000 0x88002000 0x1ab140 0x1ab140 R E 0x1000
  LOAD           0x1ad000 0x881ae000 0x881ae000 0x43000 0x5a560 RWE 0x1000

 Section to Segment mapping:
  Segment Sections...
   00     .reginfo 
   01     .text .fixup .kstrtab __ex_table __ksymtab 
   02     .data.init_task .text.init .data.init .setup.init .initcall.init 
.data.cacheline_aligned .reginfo .data .bss

so there's no emtpy section left in the ecoff image for the initial
ramdisk. What was the reasoning for the above change? And why exactly
does this change cause a splitting into data and text segment where as
of 2.4.16 there was only a "data" segment?
Regards,
 -- Guido

Attachment: init_task-2002-04-13.diff
Description: Text document

Attachment: pgpKVtM7OxwfP.pgp
Description: PGP signature

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