This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld thinks '1.o' different from './1.o'?
- From: "PRC" <panruochen at gmail dot com>
- To: "binutils" <binutils at sourceware dot org>
- Date: Thu, 13 Mar 2008 09:06:09 +0800
- Subject: ld thinks '1.o' different from './1.o'?
The linker script:
-----------------------------
OUTPUT_ARCH(mips)
SECTIONS
{
.text 0x80040000: { 1.o(.text) 2.o(.text) *(.text) *(.rodata*) }
.data : { *(.data) *(.sdata) }
.sbss : { *(.sbss) *(.scommon) }
.bss : { *(.bss) *(COMMON) }
}
building:
-----------------------------
mips-elf-ld -EL -T link.xn -r -o a.out ./1.o ./2.o
./1.o(.text+0x0): In function `f1':
: multiple definition of `f1'
1.o(.text+0x0): first defined here
./2.o(.text+0x0): In function `f2':
: multiple definition of `f2'
2.o(.text+0x0): first defined here
Linking is successful if the options are changed to:
----------------------------------------------------
mips-elf-ld -EL -T link.xn -r -o a.out 1.o 2.o
Does `ld' thinks `1.o' different from `./1.o' ?
Best Regards,
PRC
2008/3/13