Specifications

316 www.xilinx.com Embedded System Tools Guide (EDK 6.2i)
1-800-255-7778 UG111 (v1.4) January 30, 2004
Chapter 22: Address Management
R
. = ALIGN(4);
__bss_end = .;
} > OPB
_end = .;
}
Note that if you choose to write a linker script, you must do the following to ensure that
your program will work correctly. The example linker script given above incorporates
these restrictions. Each of the restriction is highlighted in the example linker script.
x Allocate space in the .bss section for stack and heap. Set the _heap variable to the
beginning of this area, and the _stack variable to the end of this area. See the .bss
section in the preceding script for an example. Ensure that the stack and heap space
are contiguous. See example above to see how this is done.
x Ensure that the _SDA2_BASE_ variable points to the center of the .sdata2 area, and
that _SDA2_BASE_ is aligned on a word boundary. See example above to see how this
is done.
x Ensure that the .sdata and the .sbss sections are contiguous, that the _SDA_BASE_
variable points to the center of this section, and that _SDA_BASE_ is aligned on a
word boundary. See example above to see how this is done.
x If you are not using the xmdstub, ensure that crt0 is always loaded into memory
address zero. mb-gcc ensures that this is the first file specified to the loader, but the
loader script needs to ensure that it gets loaded at address zero. See the .text section in
the example above to see how this is done.
x Ensure that __sbss_start, _sbss_end, __bss_start, __bss_end variables
are defined to the start and end of .sbss and .bss sections respectively. See the .bss,
.sbss sections in the example above to see how this is done.
x Ensure that the .bss and .common sections from input files are contiguous. ANSI C
requires that all uninitialized memory be initialized to startup (Not required for stack
and heap). The standard crt0.s that we provide assumes a single .bss section that is
initialized to zero. If there are multiple .bss sections, this crt will not work. You should
write your own crt that initializes all the bss sections.
x In order to minimize your simulation time, make sure to point your __bss_end
immediately after your declarations of all the .bss, .common sections from input files.
See .opb_bss section in the above example to see how this is done.
For more details on the linker scripts, refer to the GNU loader documentation in the binutil
online manual (
http://www.gnu.org/manual).
PowerPC Processor
Programs and Memory
PowerPC users can write either C, C++ or Assembly programs, and use the Embedded
Development Kit to transform their source code into bit patterns stored in the physical
memory of a EDK System. User programs typically access local/on-chip memory, external
memory and memory mapped peripherals. Memory requirements for your programs are
specified in terms of how much memory is required for storing the instructions, and how
much memory is required for storing the data associated with the program.