Gcc driver and -T option
Daniel Jacobowitz
drow@mvista.com
Wed Aug 28 06:40:00 GMT 2002
On Wed, Aug 28, 2002 at 02:22:59AM -0400, 7400 wrote:
> I would like to know the opinion about following situation related with gcc driver.
>
> - I have a directory under which there are 2 c files say - 1.c and 2.c
> - I compile these file using gcc -o test.exe *.c -Tscript.ld
> - This script.ld uses 1.o and 2.o
>
> Since 1.o and 2.o are NOT created in the cwd the link fails
> I'm aware that driver chooses $TMPDIR to create temporary file and deletes them when linking
> is done
> Temporary files are never created in the current directory Also when temporary files are
> created their names are
> different than that of the .c files . No doubt the linking will fail in the case the
> above as specified object files are not found in current directory Since gcc
> drive is not aware of what obj files are specified in the linker script ( and why it should
> be ? ) it will try to pass the object files in $(TMPDIR)/temporary files with
> generated names to linker (-v option shows the temporary files used )
You should not have to mention 1.o and 2.o by name in your linker
script. Just place the sections you want.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
More information about the Gcc-bugs
mailing list