You are misunderstanding the effect of the commands you ran. If you run:
$ gcc -o simple.obj simple.c
it already creates the program you want to run, it's already linked. You don't need to link it again, especially by running ld
directly unless you know what you are doing. Even if its extension is obj, it doesn't matter, it's just the name of the file, but the content of the file is already a complete Linux program. So if you run:
$ ./simple.obj
it will execute your code.
You usually don't call ld
directly, but instead you use gcc
as a front-end to compile and link. This is because gcc
takes care of linking also important libraries that you are not linking such as the startup code, and that's the reason why your second attempt resulted in "no _start
section" or something like that.