This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
how to invoke ld without gcc
- From: "K. Ahmed Feroz" <feroz at acmet dot com>
- To: <binutils at sources dot redhat dot com>
- Cc: <saurabh at acmet dot com>, <monika at acmet dot com>
- Date: Thu, 27 May 2004 13:02:58 +0530
- Subject: how to invoke ld without gcc
Hi all,
I am facing the following errors while invoking the 'gnu linker'
directly without using the driver 'gcc':
GNU mips ld version is 2.8
<$> ./mips-elf-gcc -T idt.ld <startupRoutine>.o <Test>.o -o <Test>.out
where <startupRoutine> used is crt0.S
crt0.o: In function `zerobss':
../../../../src/libgloss/mips/crt0.S:88: undefined reference to
`get_mem_info'
../../../../src/libgloss/mips/crt0.S:88: relocation truncated to fit:
R_MIPS_26 get_mem_info
crt0.o: In function `init':
../../../../src/libgloss/mips/crt0.S:136: undefined reference to
`__do_global_dtors'
../../../../src/libgloss/mips/crt0.S:136: undefined reference to
`__do_global_dtors'
../../../../src/libgloss/mips/crt0.S:137: undefined reference to
`atexit'
../../../../src/libgloss/mips/crt0.S:137: relocation truncated to fit:
R_MIPS_26 atexit
../../../../src/libgloss/mips/crt0.S:153: undefined reference to `exit'
../../../../src/libgloss/mips/crt0.S:153: relocation truncated to fit:
R_MIPS_26 exit
but, when 'ld' is invoked through 'gcc', it works fine:
<$> ./mips-elf-gcc -gdwarf-2 -T idt.ld <Test>.o -o <Test>.out
presumably because 'gcc' itself is arranging for all the required
libraries which I am failing to provide in the command line argument of
'ld'.
Please let me know the names of the required library, or if possible,
the complete command line arguments.
Regards,
Feroz