Do the variables declared in the section .bss in NASM gets loaded in the data section of a process and not in the bss section of a process?

Viewed 2058

I have assembled the following code using NASM:

global _start

section .data
    var1 DD 0xA1A2A3A4        ; 4 bytes
    var2 DD 0xB1B2B3B4        ; 4 bytes
section .bss
    var3: RESD 1              ; 4 bytes

section .text
_start:
    mov DWORD [var3], 0xC1C2C3C4

I opened the file in OllyDbg and made it execute the instruction: mov DWORD [var3], 0xC1C2C3C4.

This is the state of the lower left pane in OllyDbg after executing this instruction, along with the memory map:

enter image description here

As you can see, the data section starts at address 0x00F02000 and its size is 0x1000 bytes (and so var3 is part of the data section).


Edit:

I created the object file using the following command:

nasm -f win32 D:\1.asm

To create the EXE file, I used the following command using the Visual C++ 2010 linker:

link D:\1.obj /OUT:D:\1.exe /ENTRY:start /SUBSYSTEM:CONSOLE
1 Answers
Related