how to invoke ld without gcc
K. Ahmed Feroz
feroz@acmet.com
Thu May 27 07:41:00 GMT 2004
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
More information about the Binutils
mailing list