|
|
|
|
| 为什么as没法编译成功gcc -S dump出来的汇编源程序? |
 为什么as没法编译成功gcc -S dump出来的汇编源程序? - million [ 2005-06-12 02:15 | 553 byte(s)]
 Re: 为什么as没法编译成功gcc -S dump出来的汇编源程序? - gangchen_sh [ 2005-06-12 04:29 | 484 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
环境:rh9
一个简单的C程序test.c,int main(int argc,char**argv){ return 1;}
$gcc -S -o test.S test.c
$as -o test.o test.S
$ld -o test test.S
ld:warning:can't find entry symbol _start; default to 08048074
$./test
Segmentation fault
看了看test.S,其默认.globl main,将所有的main改为_start,重新连接,没有那句ld: warning,然后执行,还是溢出错误。
改了许久,似乎要最后要用int $0x80退出才行。
谁能解释一下呢?
|
|
|
[Original]
[Print]
[Top]
|
|
|