SPONSORED LINKS

Description of program sections

.rdata

"read-only" data, typically used for "const"s.

.text

where the main code is located.

.ctors and .dtors

The sections used for C++ constructors and destructor code.

.data

Where "initialised" global variables are stored (e.g. "int blah=4;")

.bss

Where uninitialised global data will reside - this section only exists on the target machine (i.e. takes up no space in the executable), and is pre-initialised to 0 by the startup code.

.sdata and .sbss

The "small" equivalents of .data and .bss. These are used when the MIPS-specific "gp optimisation" technique is used - this is a system whereby the gp register is set up at startup as a pointer into the small data sections, and the compiler produces code that references these variables as an offset from gp, thus saving code space and speeding up execution by not using the "absolute" address. There are obviously restrictions - the offset is a 16-bit signed value, which means that no more than 64k of data can be gp-referenced, and the .sdata and .sbss sections *must* be contiguous, otherwise an "out of range in instruction patch" error will be generated by the linker.