Recent Entries
Archives
Search


Links
Powered by
Movable Type 2.64

2006年03月02日

gcc4で小さくなった訳(;´Д`)

gcc4革命的に小さいバイナリが吐けたが…(;´Д`)後日談(といっても当日だけど)

linux kernelソース中 include/asm/unistd.h ですが

static inline _syscall1(int,dup,int,fd)

上記行があります、でこの行の数行上には
#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トカ(;´Д`)
dup自体は init/do_mounts.c でも使ってるわけで、こちらを objdumpした結果には dup自体は見当たらないので さっくり inline指定を無視してくれていたようです>4.0.2

ということで、戦いは続く…ヽ(´ー`)ノ
Posted by minemaz at 2006年03月02日 21:47
トラックバック
このエントリーのトラックバックURL:
http://www.lancard.com/mt/mt-tb.cgi/329

nice piece of info about payday loan from nice piece of info about payday loan
Approximately http://nationwide-payday-loan.blogspot.com I bounced check this cool payday loan as PAYDAY LOAN a http://nationwide-p... [続きを読む]

トラックバック時刻: 2007年03月01日 14:43

9cbd05f3defe8546f951 from 9cbd05f3defe8546f951
9cbd05f3defe [続きを読む]

トラックバック時刻: 2007年04月19日 10:35

Comments
Post a comment









Remember personal info?