OA. free
Free
Qualcomm Embedded Systems & Hardware Embedded Systems & Hardware Medium

Which of the memory layout section given in options is also called as the 'bss segment'?

Qualcomm technical mcq question, verified with a worked answer. Free to practise - no sign-up.

Which of the memory layout section given in options is also called as the 'bss segment'?

Choose one option.
Show answer & explanation
Answer: B. Uninitialized data segment

The BSS segment (Block Started by Symbol) is the memory section that contains uninitialized global and static variables. These variables are not explicitly initialized in the code and are set to zero at runtime by the loader. The Stack, Code, and Initialized data segment all have different purposes: the Stack stores local variables and function calls, Code contains executable instructions, and the Initialized data segment holds variables with explicit initial values.

Step-by-step Derivation:
In embedded systems and process memory layout:

  1. Code segment (text): Read-only executable instructions
  2. Initialized data segment (.data): Global/static variables with explicit values
  3. BSS segment (Block Started by Symbol): Uninitialized global/static variables, zero-initialized at load time
  4. Heap: Dynamically allocated memory
  5. Stack: Local variables and function frames

The BSS segment is specifically the uninitialized data segment. Its key characteristic is that uninitialized variables don't take up space in the executable file—only their size is recorded. The loader allocates and zeros this memory at runtime, making BSS an efficient way to handle large uninitialized arrays.