Skip to main content
Renesas India - Knowledgebase

How to know section top bottom addresses if GNU do not have sectop?

Latest Updated:10/30/2015


GNU compilers do not have __sectop, __secend operators.
How to know the section top and bottom addresses instead?


The section "label"(s) defined in linker section dialog are accessible via "extern" expressions, same as regular external symbols.

For example, e² studio generated GNU projects have .data section with "_data" and "_edata" labels at the top and bottom of the section, defined as default.

The addresses of those labels are accessible as pointers, through the declarations as follows:

    extern unsigned char data[];  /* _data label (section top) */
    extern unsigned char edata[];  /* _edata label (section bottom) */

This method is also applicable for user defined sections by adding section labels.

Suitable Products
e² studio