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
0 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
0 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
0 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.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.