Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MEMORY
- {
- FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
- RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
- STACK (rwx) : ORIGIN = 0x20007FFF, LENGTH = 0x00000000
- }
- /*
- * Sections definitions:
- *
- * .text - machine instructions.
- * .data - initialized data defined in the program.
- * .bss - un-initialized global and static variables (to be initialized to 0 before starting main).
- * .stack - just contains the pointer to the stack end at the right place.
- */
- SECTIONS
- {
- /* This section it's the code, containing the NVIC Vector table that must start at 0x0
- * Look at the LM4F120H5QR datasheet for details. (Table 2-8. Exception Types)
- */
- .text :
- {
- KEEP(*(.nvic_table)) /* I should keep the NVIC ISR Table because it's needed by the processor to start. */
- _start_text = .; /* This is an index to the start of .text segment. */
- *(.text.*) /* This contains the code after the ISR table. */
- *(.text) /* This contains the code after the ISR table. */
- *(.rodata)
- *(.rodata.*) /* Read only data. */
- *(.glue_7)
- *(.glue_7t)
- *(.vfp11_veneer)
- *(.v4_bx)
- *(.dyn)
- *(.iplt)
- *(.rel.dyn)
- *(.rel.iplt)
- _end_text = .; /* This is an index to the end of .text segment. */
- }>FLASH
- /*
- * .data segment must be placed in RAM but it's originally stored in FLASH
- * So I set the data segment in ram, but I specify the load address with the AT
- * keyword to set that right after the .text section.
- * (Look at the LD documentation. (Optional Section Attributes))
- * Thanks https://github.com/utzig for the hints!
- */
- .data :
- {
- . = ALIGN(4);
- _start_data = .; /* An index to the beginning of .data segment. */
- *(vtable) /* vtable it's generated by stellarisware to store the NVIC table in ram*/
- *(.data) /* I should put there all my initialized data of my program. */
- *(.data.*)
- . = ALIGN(4);
- _end_data = .; /* And another index to the end of .data segment. */
- } >RAM AT >FLASH
- /*
- * .bss contains the unitialized variables and must be set as 0x0 during runtime.
- * It should be loaded in RAM and particular care should be taken initializing them in the startup file.
- */
- .bss :
- {
- . = ALIGN(4);
- _start_bss = .; /* This is an index to the beginning of .bss segment. */
- *(.bss) /* The un-initialized data should go there. */
- *(.bss.*)
- *(COMMON) /* All the other stuff should be put there */
- . = ALIGN(4);
- _end_bss = .; /* End index for .bss segment */
- }>RAM
- /*
- * .stack contains nothing, but I use it to set the first vector item (SP R13).
- */
- .stack :
- {
- _stack_top = .; /* An index to the end of the stack */
- }>STACK
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement