- Toolchain: to compile the code
- Uploader: to upload the code
cpp ----> gcc ----> as ----> ld
( cpp, gcc ) : Partially generated and downloaded source is compiled into executables
( as, ld ) : Existing executables are directly used (eg for ld:glibc/newlib ). May be h/w stds and std files for a board.
---------------------------------------------------
Two are required for porting other than u r C code.
- Startup code : assembler code which does low-level hardware initialization and sets up such things as stack.
- linker script : which will tell to the linker where to put which sections of your complied code
Linker Script contains:
ENTRY : ENTRY( _startup ) means _startup as entry point, which is defined in the startup file and which is visible to linker as it is declared as global.
MEMORY:
MEMORY
{
RAM (rw) : ORIGIN = 0x40000200, LENGTH = (0x00002000 - 0x00000200 - 0x20 - 0x100)
}
RAM as Read/Write region of memory with origin and length of different sections.SECTIONS:
.text
.rodata for read-only data
.data read or write data
.bss for zero-initialized statically allocated variables.
References:
http://only.mawhrin.net/~alexey/prg/lpc2103/tutorial-hello/
http://www.cse.iitb.ac.in/~uday/courses/cs715-09/gcc-code-view.pdf