※ 引述《leicheong.bbs@bbs.sayya.org (理昌)》之銘言:
> 噢... 我倒忘了自己把真正function call的部份strip去了... :P
> 00401028 |. 68 D8604000 PUSH test.004060D8 ; ASCII "%d"
> 0040102D |. E8 09000000 CALL test.0040103B
> 在push 10後是有再push "%d"的指標啦, 不過這裡有一點有趣的地方,
> 就是"%d"這字串的位置不在data segment(00408000-00409FFF)
> 也不在code segment(00401000-00405FFF),卻在.rdata(00406000-00407FFF)裡,
> 真想不到.
這是很正常的現象,
gcc 的話也是會把 literal string 放在 .rodata,
我是不清楚 .rdata 有沒有 read only 的效果,
不過正常來說它必須要是 read only 的,
在 UNIX 上對這個 section 做寫入會收到 Bus error 的 signal。
早期的 gcc 可以打開 writable strings 選項,
這樣就會放在 .data 裡面,
不過後來也是被拿掉了,
畢竟那是很不好的習慣。
--
Name: Tseng, Ling-hua E-mail Address: uranus@it.muds.net
School: National Chung Cheng University
Department: Computer Science and Information Engineering
Researching: Porting GCC and Implementing VLIW instruction scheduler in GCC
Homepage: https://it.muds.net/~uranus
--
╔═══╗ ┼────────────────────────╮
║狂狷 ║ │* Origin:[ 狂 狷 年 少 ] whshs.cs.nccu.edu.tw ╰─╮
║ 年少║ ┼╮ < IP:140.119.164.16 > ╰─╮
╚╦═╦╝ ╰ * From:218-171-150-86.dynamic.hinet.net
─╨─╨─ KGBBS ─ ◎ 遨翔"BBS"的狂狷不馴;屬於年少的輕狂色彩 ◎
--
* Modify: tinlans 06/05/11 13:07:23 <218-171-150-86.dynamic.hinet.net>