UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 21205

7.1 EDK, GNU - The size of the bss_stack section in a linker script generated using "Generate Linker Script" is over twice the actual size of the stack and heap

Description

Keywords: EDK, 7.1, bss, stack, heap, linker, script, section, size, twice, double

Urgency: Standard

General Description:
When I use the "Generate Linker Script" tool in a MicroBlaze system in EDK 7.1, the stack and heap are assigned to a section called bss_stack.

However, the size of the bss_stack section is always more than twice that of the requested stack and heap size. Why?

Solution

The size of the stack and heap in the system are as requested. However, the bss_stack section is approximately twice as large as required. The bss_stack section should be approximately the same size as the requested stack and heap size.

To work around this issue, remove the bss_section from the linker script. Place the stack and the heap into the .bss section.

To do this, alter the .bss section from:

.bss : {
. = ALIGN(4);
__bss_start = .;
*(.bss)
*(COMMON)
. = ALIGN(4);
__bss_end = .;
} > relevant_memory_region

to:

.bss : {
. = ALIGN(4);
__bss_start = .;
*(.bss)
*(COMMON)
. = ALIGN(4);
__bss_end = .;

. = ALIGN(8);
_heap = .;
_heap_start = _heap;
. += _HEAP_SIZE;
. += _STACK_SIZE;
. = ALIGN(8);
_stack = .;
__stack = _stack;

} > relevant_memory_region
AR# 21205
Date Created 04/12/2005
Last Updated 04/13/2007
Status Archive
Type General Article