Getting Errors with arm-none-eabi-gcc.

Asked by Manikanta Velaga

Hello friends,
i am using "C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\bin" arm-none-eabi-gcc.exe for my code. This is for LPC2148.

The linker i am using in my makefile is:
LD = arm-none-eabi-ld -v
i got linker errors for malloc .

So i changed my makefile as below:
LD = arm-none-eabi-gcc --specs=rdimon.specs

Now i am getting below errors:
arm-none-eabi-gcc --specs=rdimon.specs -T demo2148_blink_flash.cmd -o main1.out crt.o main1.o lcd8bit.o
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/rdimon-crt0.o: In function `_start':
(.text+0x140): undefined reference to `__bss_start__'
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/rdimon-crt0.o: In function `_start':
(.text+0x144): undefined reference to `__bss_end__'
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/rdimon-crt0.o: In function `_start':
(.text+0x158): undefined reference to `__end__'
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib\librdimon.a(rdimon-syscalls.o): In function `_sbrk':
syscalls.c:(.text._sbrk+0x78): undefined reference to `end'

Anyone please suggest how to rectify these errors.

My linker script is:
/* identify the Entry Point */

ENTRY(_startup)

/* specify the LPC2148 memory areas */

MEMORY
{
 flash : ORIGIN = 0, LENGTH = 512K /* FLASH ROM */
 ram_isp_low(A) : ORIGIN = 0x40000120, LENGTH = 223 /* variables used by Philips ISP bootloader */
 ram : ORIGIN = 0x40000200, LENGTH = 32513 /* free RAM area */
 ram_isp_high(A) : ORIGIN = 0x40007FE0, LENGTH = 32 /* variables used by Philips ISP bootloader */
 ram_usb_dma : ORIGIN = 0x7FD00000, LENGTH = 8192 /* on-chip USB DMA RAM area (not used) */
}

/* define a global symbol _stack_end */

_stack_end = 0x40007EDC;

/* now define the output sections */

SECTIONS
{
 . = 0; /* set location counter to address zero */

 startup : { *(.startup)} >flash /* the startup code goes into FLASH */

 .text : /* collect all sections that should go into FLASH after startup */
 {
  *(.text) /* all .text sections (code) */
  *(.rodata) /* all .rodata sections (constants, strings, etc.) */
  *(.rodata*) /* all .rodata* sections (constants, strings, etc.) */
  *(.glue_7) /* all .glue_7 sections (no idea what these are) */
  *(.glue_7t) /* all .glue_7t sections (no idea what these are) */
  _etext = .; /* define a global symbol _etext just after the last code byte */
 } >flash /* put all the above into FLASH */

 .data : /* collect all initialized .data sections that go into RAM */
 {
  _data = .; /* create a global symbol marking the start of the .data section */
  *(.data) /* all .data sections */
  _edata = .; /* define a global symbol marking the end of the .data section */
 } >ram AT >flash /* put all the above into RAM (but load the LMA copy into FLASH) */

 .bss : /* collect all uninitialized .bss sections that go into RAM */
 {
  _bss_start = .; /* define a global symbol marking the start of the .bss section */
  *(.bss) /* all .bss sections */
 } >ram /* put all the above in RAM (it will be cleared in the startup code */

 . = ALIGN(4); /* advance location counter to the next 32-bit boundary */
 _bss_end = . ; /* define a global symbol marking the end of the .bss section */
}
 _end = .; /* define a global symbol marking the end of application RAM */

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
Andre Vieira (andre-simoesdiasvieira) said :
#1

Hi Manikanta,

You have to define the symbols in the error message.
I think you can get away with:

 __bss_start__ = _bss_start;
 __bss_end__ = _bss_end;
__end__ = _end;
end = _end;

Hope that helps.

Cheers,
Andre

Can you help with this problem?

Provide an answer of your own, or ask Manikanta Velaga for more information if necessary.

To post a message you must log in.