Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Custom Linker Scripts

If you start to run out of stack or heap memory, altering your linker script can help. A linker script tells the tools where in memory to place certain types of code. To alter your linker settings, in your software project in SDK you should see a file ldscript.ld. Double-click it.

The default values of 0x2000 (8KiB) are fairly small when we have 512MiB of DDR on the Zybo, so you can increase these (within reason) if you need more dynamic memory space for your C code.

You can also use this file to modify the DDR region used by your program, if you need to reserve an area of memory for storing data outside of your C program.

Compiler Optimisation Options

It is possible to reduce code size and increase soeed by turning on optimisation in the C compiler options within Xilinx SDK.

The 'release' build configuration in SDK sets optimisation to level 2 (-O2), whereas the default 'debug' configuration uses no optimisation (-O0).

To change the build configuration, ensure that your main project is selected (the options will be greyed out otherwise) and choose Project | Build Configurations | Set Active | Release.

For more information on GCC optimisation flags, see the GCC manual.

  • No labels