我的makefile以前用都没问题 现在这个程序我要用到cos函数,需要用到数学库,应该是libm.a这个库吧,然后我把Makefile改了一下,把数学库包含了进来,然后就出现了那么多错误错误如下:
arm-linux-ld -Tleds.lds -o leds_elf crt0.o init.o nand.o leds.o -lgcc -L/work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/ -lm -L/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/lib/
arm-linux-ld: section .interp [00000570 -> 00000580] overlaps section firtst [00000000 -> 000005e3]
arm-linux-ld: section .gnu.version [00000582 -> 00000585] overlaps section firtst [00000000 -> 000005e3]
arm-linux-ld: section .gnu.version_r [00000588 -> 000005a7] overlaps section firtst [00000000 -> 000005e3]
arm-linux-ld: section .dynsym [000005a8 -> 000005c7] overlaps section firtst [00000000 -> 000005e3]
arm-linux-ld: section .dynstr [000005c8 -> 000005e0] overlaps section firtst [00000000 -> 000005e3]
arm-linux-ld: BFD 2.15 assertion fail /work/tools/create_crosstools/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6/binutils-2.15/bfd/elf32-arm.h:3905
Makefile如下:
objs := crt0.o init.o nand.o leds.o
LIBPATH=-lgcc -L/work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/
LIBPATH1=-lm -L/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/lib/
leds.bin: $(objs)
arm-linux-ld -Tleds.lds -o leds_elf $^ ${LIBPATH} ${LIBPATH1}
arm-linux-objcopy -O binary -S leds_elf $@
arm-linux-objdump -D -m arm leds_elf > leds.dis
%.o:%.c
arm-linux-gcc -Wall -O2 -c -o $@ $<
%.o:%.S
arm-linux-gcc -Wall -O2 -c -o $@ $<
clean:
rm -f leds.bin leds_elf leds.dis *.o
我的链接脚本如下:
SECTIONS {
firtst 0x00000000 : { crt0.o init.o nand.o}
second 0x30000000 : AT(4096) { leds.o }
}
|