Messages in this thread |  | | Subject | Re:Possible kernel optimizati | Date | Sat, 14 Dec 96 10:07:21 CET | From | Tekno Soft Snc <> |
| |
>> | heh :) when i first read the ELF standard i came up with the very same >> | idea ... then i was told that this idea is almost as old as Linux itself, >> | and that it comes up regularly on linux-kernel, but nobody has done it so >> | far. >> >> I would venture to guess that it is older than Linux. I first ran across it in >> 1975-1979 when I went to college and hacked on CDC 6[46]00 systems, where it >> was common to put the init code in the area you would use as buffers. I >> imagine that it is much older than that. > > The SPARC port already implements the ability to throw init code and > data out the door into the bit bucket after system setup. It should be > in the mainline kernel whenever Linus syncs the main tree to the SPARC > port's tree. > > Every piece of init code and data is tagged with the magical "section" > gcc attribute. Init code ends up in ELF section "text.init" and init > data ends up in "data.init". It is similar to the magical section > tricks done with the new exception handling mechanism. > > During the link stage, we arrange for the text.init and data.init > sections to be last in the executable. After system setup, the init > code/data gets reassigned as free pages. Viola!
Good! How can do it with a gcc ? In a C code we need to declare this functions as part of this section (with #pragma ?), in new exception handling we can do it with __asm__(".section __ex_table,\"ax\"").
Roberto Fichera - email MC3641@mclink.it
Xmeo ver.3.0 Alpha for Linux & Windows
|  |