6.6.3.1 Accessing Assembly Language Global Variables
Accessing variables from the .bss section or a section named with .usect is straightforward:
- Use the .bss or .usect directive to define the variable.
- Use the .def or .global directive to make the definition external.
- Use the appropriate linkname in assembly language.
- In C/C++, declare the variable as extern and access it normally.
Example 5 and Example 4 show how you can access a variable defined in .bss.