Results 1 to 4 of 4
main.c is exactly:
Code:
_start{}
compiled it with:
Code:
cc -c main.c
ld main.o -lc
problem when running:
Code:
./a.out
output to stderr:
Code:
bash: ./a.out: No such file or ...
- 12-01-2008 #1Just Joined!
- Join Date
- Nov 2008
- Posts
- 5
[SOLVED] elf linking the plain stupid way
main.c is exactly:
compiled it with:Code:_start{}
problem when running:Code:cc -c main.c ld main.o -lc
output to stderr:Code:./a.out
What do I do to make it without crt objects?Code:bash: ./a.out: No such file or directory
HehLast edited by heh; 12-01-2008 at 05:07 PM. Reason: formatting
- 12-01-2008 #2
When I created a file main.c that contained exactly this:
and did this:Code:_start{}
I got this stderr output:Code:cc -c main.c
You won't get anywhere until you fix that.Code:main.c:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
Hope this helps.--
Bill
Old age and treachery will overcome youth and skill.
- 12-01-2008 #3Just Joined!
- Join Date
- Nov 2008
- Posts
- 5
try using this:
main.s content:
make with:Code:.text .globl _start _start: movl $1, %eax movl $0, %ebx int $0x80
run:Code:as main.s -o main.o ld main.o -lc
Still produces this stderr outputCode:./a.out
HehCode:bash: ./a.out: No such file or directory
Last edited by heh; 12-01-2008 at 05:57 PM. Reason: bad code
- 12-01-2008 #4Just Joined!
- Join Date
- Nov 2008
- Posts
- 5
SOLUTION:
People, don't link libc without ctr0.o. It bad for you.


Reply With Quote