The gcc generates assembly code for functions in .text and global variables in either .data or .bss segments. There are predefined rules of which segment the gcc will generate the code of some kind (function, global variables etc). Programmers can override the behavior. The segment can be controlled.
Lets see an example.void __attribute__ ((section ("MySegment"))) fun() { } int main() { fun(); return 0; }
compile this file using gcc and generate a.out file. Now inspect the a.out file using objdump command as
objdump -h a.out