EmbDev.net

Forum: ARM programming with GCC/GNU tools ld.exe: error: no memory region specified for loadable secti


von Michael S. (michaelshiloh)


Rate this post
useful
not useful
First of all, thanks for putting these tools together. The examples
compile fine, but when I go to my application I have trouble.

Here is the link line and error:

Linking: make.elf
arm-elf-gcc -mthumb -mcpu=arm7tdmi -mthumb-interwork -I. -gdwarf-2
-DRAM_RUN -DSAM7_GCC -DVECTORS_IN_RAM  -Os -Wall -Wcast-align -Wimplicit
-Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow
-Wunused -Wa,-adhlns=../controller/startup/AT91SAM7_Startup.lst
-I../controller/makingthings
-I../controller/freertos/portable/GCC/ARM7_AT91SAM7S/
-I../controller/freertos/include/ -I../appboard/makingthings/
-I../utility/makingthings/ -MD -MP -MF .dep/make.elf.d
../controller/startup/AT91SAM7_Startup.o   make.o      --output make.elf
-nostartfiles -Wl,-Map=make.map,--cref -lc  -lm -lc -lgcc
-T../controller/startup/atmel-rom.ld
c:\winarm\bin\..\lib\gcc\arm-elf\4.1.0\..\..\..\..\arm-elf\bin\ld.exe:
error: no memory region specified for loadable section `.vectors'
collect2: ld returned 1 exit status
make: *** [make.elf] Error 1



The critical bits from my Makefile:

MCU      = arm7tdmi
SUBMDL   = AT91SAM7S64
THUMB    = -mthumb
THUMB_IW = -mthumb-interwork

RUN_MODE=RAM_RUN:
VECTOR_LOCATION=VECTORS_IN_RAMf
LDFLAGS +=-T../controller/startup/atmel-rom.ld

Have you any suggestions for me?

Michael

von Martin Thomas (Guest)


Rate this post
useful
not useful
michael shiloh wrote:
> First of all, thanks for putting these tools together. The examples
> compile fine, but when I go to my application I have trouble.
>
> Here is the link line and error:
>
> Linking: make.elf
> arm-elf-gcc -mthumb -mcpu=arm7tdmi -mthumb-interwork -I. -gdwarf-2
> -DRAM_RUN -DSAM7_GCC -DVECTORS_IN_RAM  -Os -Wall -Wcast-align -Wimplicit
> -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow
> -Wunused -Wa,-adhlns=../controller/startup/AT91SAM7_Startup.lst
> -I../controller/makingthings
> -I../controller/freertos/portable/GCC/ARM7_AT91SAM7S/
> -I../controller/freertos/include/ -I../appboard/makingthings/
> -I../utility/makingthings/ -MD -MP -MF .dep/make.elf.d
> ../controller/startup/AT91SAM7_Startup.o   make.o      --output make.elf
> -nostartfiles -Wl,-Map=make.map,--cref -lc  -lm -lc -lgcc
> -T../controller/startup/atmel-rom.ld
> c:\winarm\bin\..\lib\gcc\arm-elf\4.1.0\..\..\..\..\arm-elf\bin\ld.exe:
> error: no memory region specified for loadable section `.vectors'
> collect2: ld returned 1 exit status
> make: *** [make.elf] Error 1
>
>
>
> The critical bits from my Makefile:
>
> MCU      = arm7tdmi
> SUBMDL   = AT91SAM7S64
> THUMB    = -mthumb
> THUMB_IW = -mthumb-interwork
>
> RUN_MODE=RAM_RUN:
> VECTOR_LOCATION=VECTORS_IN_RAMf
> LDFLAGS +=-T../controller/startup/atmel-rom.ld

It seems that you mix code/files from different sources. The settings of
"VECTORS_LOCATION" and "RUN_MODE" in the "WinARM"-makefile or just
variables/options which are passed to the compiler-frontend or used to
select a linker-script. Just setting these options in the makefile is
not enough if the rest of the code is not prepared for this.
atmel-rom.ld does not look like a script-filename I use in the WinARM
examples so there is a good change that this script is not prepared to
assign a memory-placement for the section vectors.

If you are interested in Remapping and "Run from RAM" you might take a
look into one of the SAM7S examples ("gamma") from my "Projects-Page":
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/index_at91.html#at91_gamma
(this code is also included in WinARM 6/2006). It should give you at
least an idea how the settings in the makefile are passed and used to
setup the device (remapping etc.).

Martin Thomas

von Michael S. (michaelshiloh)


Rate this post
useful
not useful
Martin Thomas wrote:

> It seems that you mix code/files from different sources. The settings of
> "VECTORS_LOCATION" and "RUN_MODE" in the "WinARM"-makefile or just
> variables/options which are passed to the compiler-frontend or used to
> select a linker-script. Just setting these options in the makefile is
> not enough if the rest of the code is not prepared for this.
> atmel-rom.ld does not look like a script-filename I use in the WinARM
> examples so there is a good change that this script is not prepared to
> assign a memory-placement for the section vectors.
>
> If you are interested in Remapping and "Run from RAM" you might take a
> look into one of the SAM7S examples ("gamma") from my "Projects-Page":
> 
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/index_at91.html#at91_gamma
> (this code is also included in WinARM 6/2006). It should give you at
> least an idea how the settings in the makefile are passed and used to
> setup the device (remapping etc.).
>
> Martin Thomas

I'm not the original author of this code and I'm not quite sure what the
original intent was. The original code was in a CrossStudio project and
I am trying to convert it from that to WinARM. Would it help if I posted
the Crossview project file? It's in xml.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.