Keep the following points in mind when writing or customizing your own linker script:
- Ensure that the different vector sections are assigned to the appropriate memories as defined by the MicroBlaze hardware.
- Allocate space in the
.bsssection for stack and heap. Set the_stackvariable to the location after_STACK_SIZElocations of this area, and the_heap_startvariable to the next location after the_STACK_SIZElocation. Because the stack and heap need not be initialized for hardware as well as simulation, define the_bss_endvariable after the.bssandCOMMONdefinitions.Note: The.bsssection boundary does not include either stack or heap. - Ensure that the variables
_SDATA_START__,_SDATA_END__,SDATA2_START,_SDATA2_END__,_SBSS2_START__,_SBSS2_END__,_bss_start,_bss_end,_sbss_start, and_sbss_endare defined to the beginning and end of the sectionssdata,sdata2,sbss2,bss, andsbssrespectively. - ANSI C requires that all uninitialized memory be initialized to startup (not
required for stack and heap). The standard CRT that is provided assumes a single
.bsssection that is initialized to zero. If there are multiple.bsssections, this CRT will not work. You should write your own CRT that initializes all the.bsssections.