#ifdef __KERNEL_SYSCALLS__ /* * we need this inline - forking from kernel space will result * in NO COPY ON WRITE (!!!), until an execve is executed. This * is no problem, but for the stack. This is handled by not letting * main() use the stack at all after fork(). Thus, no function * calls - which means inline code for fork too, as otherwise we * would use the stack upon exit from 'fork()'. * * Actually only pause and fork are needed inline, so that there * won't be any messing with the stack from main(), but we define * some others too. */と書いてるわけなんですよね。で、上記dupの件発見したのは gcc-3.4.5と gcc-4.0.2で吐かれた init/main.c のバイナリを objdump -D して眺めていたのが元です(;´Д`) あれ?こっち(3.4.5)は dupをインラインで吐いてるけどこっち(4.0.2)はサブルーチン化してる~ 賢いな 4.0.2トカ(;´Д`)
トラックバック時刻: 2007年03月01日 14:43
トラックバック時刻: 2007年04月19日 10:35