No such file or directory error for wrong linking
This is regarding the code in chap04 - cpuid2.s
If I have a call to printf from the asm code and I link it like this:-
ld -lc -o cpuid2 cpuid2.o
and execute
./cpuid2
I get error:-
bash: ./cpuid2: No such file or directory.
Why such a strange error for dynamic linking problem? If a file "a" contains garbage, then the error looks like this:- ./a: line 1: asdfasfsdaf: command not found. So why not a similar error for my linked executable? If I use --dynamic-linker /lib/ld-linux.so.2 while linking, of course it runs fine. But I wonder why it would say "no such file" if I do not link it properly.
|