Switch to Normal Style Sheet
Site Icon The Lab Book Pages Andrew Greensted (Modified: 17 June 2008)
Electronics > EDK HOWTO 5

Xilinx EDK HOWTO 5

A few bits of information on code segments and linking.

Note: This HOWTO uses Xilinx EDK version 9.1i

Divider Bar Go to page top

• Code Segments

Below is a list of some of the code segments that GCC can produce with descriptions of their purpose.

SegmentsDescription
.textProgram code
.dataInitialised global data
.sdataSmall .data
.bssUninitialised global data (Block Starting Symbol)
.sbssSmall .bss
.rodataConstants (Read only data)
.sdata2Small read only data

Below is an example taken from the Xilinx application note xapp642

• File: example.c
#include <stdio.h>
 
int array_data[10] = {0,1,2,3,4,5,6,7,8,9};
⇐ .data
const int array_const[10] = {9,8,7,6,5,4,3,2,1,0};
⇐ .rodata
 
int main(void)
{
   int i;
⇐ .bss
   i = i + 10;
⇐ .text
   printf("%d\n", array_data[0]);
⇐ .text
   array_data[0] = array_const[0];
⇐ .text
   printf("%d\n",array_data[0]);
⇐ .text
 
   return 0;
}
Divider Bar Go to page top

• Further Reading

Further reading.

Divider Bar Go to page top