This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: error no such file or directory B
- From: Ian Lance Taylor <iant at google dot com>
- To: siretb <siretb at free dot fr>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 21 Aug 2007 21:19:32 -0700
- Subject: Re: error no such file or directory B
- References: <12161503.post@talk.nabble.com>
siretb <siretb@free.fr> writes:
> I am new at programming in assembler (platform linux SUSE 10.2)
> I have a main routine in C that call ASM
> I compile the C as gcc -c caller.c
> I compile the asm as nasm -f aout callee.c
> I link as ld caller.o callee.o -o callx.out
Link using the gcc driver, not by calling ld directly. For example:
gcc -o callx.out caller.o callee.o
> There are no errors , no warnings. I do get a non zero length callx.out
>
> trouble is that the command ./callx.out returns error:no such file or
> directory.
Yes, it's a very confusing error. It most likely occurs because when
you use the gcc driver it automatically passes the correct
-dynamic-linker option to the linker. Without that option, the name
of the dynamic linker stored in the executable by ld is incorrect and
the file does not exist. When the kernel tries to invoke the dynamic
linker, it fails.
Ian