Re: [arm-gnu] Specify memory region for sections.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] Specify memory region for sections.



On Tue, 2008-12-30 at 19:25 -0500, Daniel Jacobowitz wrote:
> What kind of program are you trying to build?  For something that
> needs RAM and ROM memory regions, you should probably use the
> arm-none-eabi tools instead - they're targeted at bare metal systems
> or embedded RTOSes, but the Linux tools are targeted at GNU/Linux
> userspace programs.  So they don't have the necessary libraries or
> linker scripts for direct execution.

Ah ha, thanks for the tip.  I am trying to build a bare metal system.  I
downloaded the latest Sourcery_G++_Lite, and installed
in /opt/codesourcery/Sourcery_G++_Lite.

There was a failure to set the PATH, so I fixed that, and now;
$ which arm-none-eabi-gcc
/opt/codesourcery/Sourcery_G++_Lite/bin/arm-none-eabi-gcc

I found
/opt/codesourcery/Sourcery_G++_Lite/arm-none-eabi/lib/generic.ld

and thought that might make a good starting point, as it has a MEMORY
block.  I copied this into my project directory, and moved the MEMORY
block to my script.ld, which now reads;

MEMORY
{
  ram (rwx) : ORIGIN = 0x0, LENGTH = 128M
}

INCLUDE "generic.ld"

_sidata = _etext;
_sdata = __data_start;
_sbss = __bss_start;
_ebss = _bss_end__;
_estack = 0x20010000;

However, when I run make, at the linking phase I get;
arm-none-eabi-gcc -Wl,-T script.ld -Wl,-Map=obj/DMA_AN_Example1.elf.map
-o obj/DMA_AN_Example1.elf ./obj/stm32f10x_spi.o ./obj/stm32f10x_adc.o 
./obj/stm32f10x_dma.o ./obj/stm32f10x_flash.o ./obj/stm32f10x_gpio.o 
./obj/stm32f10x_lib.o ./obj/stm32f10x_nvic.o ./obj/stm32f10x_rcc.o 
./obj/main.o ./obj/stm32f10x_it.o ./obj/stm32f10x_vector.o ./obj/cortexm3_macro.o 
/opt/codesourcery/Sourcery_G
++_Lite/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/bin/ld: cannot find -lgcc

Hmm.  Why can't ld find libgcc?

Regards,
James.