1
GLIBC없이 컴파일 할 때 main()에서 값을 반환하려고하는데 작동하지 않습니다. 내가 GLIBC 컴파일하면 나는 잘 반환 값을 얻을 지금glibc없이 main()에서 값을 반환했습니다.
[[email protected] tests]$ cat stubstart.S
.globl _start
_start:
call main
movl $1, %eax
xorl %ebx, %ebx
int $0x80
[[email protected] tests]$ cat m.c
int main(int argc,char **argv) {
return(90);
}
[[email protected] tests]$ gcc -nostdlib stubstart.S -o m m.c
[[email protected] tests]$ ./m
[[email protected] tests]$ echo $?
0
[[email protected] tests]$
:
[[email protected] tests]$ gcc -o mglibc m.c
[[email protected] tests]$ ./mglibc
[[email protected] tests]$ echo $?
90
[[email protected] tests]$
그래서, aparently 복귀는 stubstart 제대로 수행하지 내가 인터넷에서 발견이 예제를 할 수 있습니다. S, 내가 어떻게 제대로 만들지? (Linux에만 해당)