При компилировании возникает ошибка - collect2.exe: error: ld returned 1 exit status
Если выделение памяти производить через malloc, то все компилируется без проблем. В чем может быть ошибка?
Последний раз редактировалось gruffi Пн дек 23, 2013 17:07:47, всего редактировалось 1 раз.
Да извините недоглядел. Вот вывод из консоли:
Спойлер**** Build of configuration Debug for project timer ****
cs-make all
'Building file: ../src/CKeyboard/CKeyboard.cpp'
'Invoking: ARM Windows GCC C++ Compiler (Sourcery Lite Bare)'
arm-none-eabi-g++ -Os -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="src/CKeyboard/CKeyboard.o.lst" -fno-exceptions -fno-rtti -funsigned-bitfields -c -fmessage-length=0 -MMD -MP -MF"src/CKeyboard/CKeyboard.d" -MT"src/CKeyboard/CKeyboard.d" -mcpu=cortex-m3 -mthumb -g3 -o "src/CKeyboard/CKeyboard.o" "../src/CKeyboard/CKeyboard.cpp"
'Finished building: ../src/CKeyboard/CKeyboard.cpp'
' '
'Building file: ../src/main.cpp'
'Invoking: ARM Windows GCC C++ Compiler (Sourcery Lite Bare)'
arm-none-eabi-g++ -Os -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="src/main.o.lst" -fno-exceptions -fno-rtti -funsigned-bitfields -c -fmessage-length=0 -MMD -MP -MF"src/main.d" -MT"src/main.d" -mcpu=cortex-m3 -mthumb -g3 -o "src/main.o" "../src/main.cpp"
'Finished building: ../src/main.cpp'
' '
'Building target: timer.elf'
'Invoking: ARM Windows GCC C++ Linker (Sourcery Lite Bare)'
arm-none-eabi-g++ -T"C:\ARM\Development\Workspace\timer\system\gcc_cs.ld" -Xlinker --gc-sections -Wl,-Map,"timer.map" -mcpu=cortex-m3 -mthumb -g3 -o "timer.elf" ./system/startup_ARMCM3.o ./system/system_stm32f10x.o ./src/CKeyboard/CKeyboard.o ./src/main.o
c:/arm/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_close.o): warning: IO function '_close' used
c:/arm/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_fstat.o): warning: IO function '_fstat' used
c:/arm/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-isatty.o): warning: IO function '_isatty' used
c:/arm/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_kill.o): warning: IO function '_kill' used
c:/arm/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_lseek.o): warning: IO function '_lseek' used
c:/arm/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_read.o): warning: IO function '_read' used
c:/arm/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_write.o): warning: IO function '_write' used
c:/arm/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/bin/ld.exe: timer.elf section `.text' will not fit in region `rom'
c:/arm/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/bin/ld.exe: region `rom' overflowed by 36720 bytes
collect2.exe: error: ld returned 1 exit status
cs-make: *** [timer.elf] Error 1
Все вопрос решен . Тема закрыта. Для моих нужд подойдет и статический массив . При динамическом выделении памяти с помощью malloc размер прошивки увеличился в 8 раз...