linking problems with newer than 4.5 gcc versions

Asked by Oscar Alcantara

I have created my toolchain for arm-none-eabi using summon script with Linaro gcc source and I got errors when linking (counter can not go backwards) the same happen to me using code sourcery. This error is present if newer releases are used after gcc-4.5. If I use gcc-4.5 or before all is OK.

I have used gcc, gcc-linaro and gcc code sourcery and the error is present in all.
Any hint or idea on this?

Thanks
OAM

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Joey Ye (jinyun-ye) said :
#1

Oscar, your description doesn't provide enough information to reproduce or analyse. Can you share error message and reduced case?

- Joey

Revision history for this message
Oscar Alcantara (oscalcmen) said :
#2

I download the Instant Contiki last release from GIT. If I use the included compiler gcc 4.5 compile and link OK for the STM32W108 processor (Cortex M3). If I use a newer release than gcc 4.5 I got a liker error and the error said that the linker counter cannot go backwards. I do not have the computer with me now I will post the error message as soon as possible.
I tried this with code sourcery compilers and only gcc 4.5 worked fine for me.

Thanks

Revision history for this message
Oscar Alcantara (oscalcmen) said :
#3

Below the message comming from make:

oscar@LinuxD630 ~/Contiki_All/contiki/examples/hello-world $ make TARGET=mb951
../../platform/mb951/Makefile.mb951:31: warning: overriding commands for target `login'
../../cpu/stm32w108/Makefile.stm32w108:296: warning: ignoring old commands for target `login'
arm-none-eabi-gcc -DCONTIKI=1 -DCONTIKI_TARGET_MB951=1 -mthumb -mcpu=cortex-m3 -D "PLATFORM_HEADER=\"hal/micro/cortexm3/compiler/gnu.h\"" -D BOARD_HEADER=\"board.h\" -g -Wall -Wno-strict-aliasing -mlittle-endian -D BOARD_MB851 -D CORTEXM3 -D CORTEXM3_STM32W108 -D PHY_STM32W108XX -D DISABLE_WATCHDOG -D ENABLE_ADC_EXTENDED_RANGE_BROKEN -D __SOURCEFILE__=\"hello-world.c\" -Os -ffunction-sections -I. -I../../platform/mb951/. -I../../platform/mb951/dev -I../../cpu/stm32w108/. -I../../cpu/stm32w108/dev -I../../cpu/stm32w108/hal -I../../cpu/stm32w108/simplemac -I../../cpu/stm32w108/hal/micro/cortexm3 -I../../cpu/stm32w108/hal/micro/cortexm3/stm32w108 -I../../core/dev -I../../core/lib -I../../core/net -I../../core/net/mac -I../../core/net/rime -I../../core/net/rpl -I../../core/sys -I../../core/cfs -I../../core/ctk -I../../core/lib/ctk -I../../core/loader -I../../core/. -I../../platform/mb951/ -DCONTIKI_VERSION_STRING=\"Contiki-2.6-324-ga7b3e99\" -DAUTOSTART_ENABLE -c hello-world.c -o hello-world.co
arm-none-eabi-gcc -DCONTIKI=1 -DCONTIKI_TARGET_MB951=1 -mthumb -mcpu=cortex-m3 -D "PLATFORM_HEADER=\"hal/micro/cortexm3/compiler/gnu.h\"" -D BOARD_HEADER=\"board.h\" -g -Wall -Wno-strict-aliasing -mlittle-endian -D BOARD_MB851 -D CORTEXM3 -D CORTEXM3_STM32W108 -D PHY_STM32W108XX -D DISABLE_WATCHDOG -D ENABLE_ADC_EXTENDED_RANGE_BROKEN -D __SOURCEFILE__=\"symbols.c\" -Os -ffunction-sections -I. -I../../platform/mb951/. -I../../platform/mb951/dev -I../../cpu/stm32w108/. -I../../cpu/stm32w108/dev -I../../cpu/stm32w108/hal -I../../cpu/stm32w108/simplemac -I../../cpu/stm32w108/hal/micro/cortexm3 -I../../cpu/stm32w108/hal/micro/cortexm3/stm32w108 -I../../core/dev -I../../core/lib -I../../core/net -I../../core/net/mac -I../../core/net/rime -I../../core/net/rpl -I../../core/sys -I../../core/cfs -I../../core/ctk -I../../core/lib/ctk -I../../core/loader -I../../core/. -I../../platform/mb951/ -DCONTIKI_VERSION_STRING=\"Contiki-2.6-324-ga7b3e99\" -MMD -c symbols.c -o obj_mb951/symbols.o
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Wl,-T -Xlinker ../../cpu/stm32w108/gnu.ld -Wl,-static -u Default_Handler -nostartfiles -Wl,-Map -Xlinker contiki-mb951.map -Wl,--gc-sections -Wl,--section-start=.coffee=0x801F800 hello-world.co obj_mb951/symbols.o -Wl,-\( contiki-mb951.a ../../cpu/stm32w108/simplemac/library/simplemac-library-gnu.a ../../cpu/stm32w108/lib/e_stdio_intonly_thumb2.a -Wl,-\) -o hello-world.mb951
../../cpu/stm32w108/gnu.ld:98 cannot move location counter backwards (from 000000000801f800 to 0000000000000000)
collect2: error: ld returned 1 exit status
make: *** [hello-world.mb951] Error 1
rm obj_mb951/symbols.o hello-world.co

this error was gotten using sunamon script with Linaro 4.7, if used gcc 4.5 the liker finishes correctly.
Thanks

Revision history for this message
Joey Ye (jinyun-ye) said :
#4

Oscar,

Sorry that we haven't reproduced your problem yet. Still need further work.

- Joey

Can you help with this problem?

Provide an answer of your own, or ask Oscar Alcantara for more information if necessary.

To post a message you must log in.