Are the variables declared in the .bss section of NASM loaded into the process data section, not the process bss section?

I compiled 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 run: mov DWORD [var3], 0xC1C2C3C4.

This is the state of the bottom left panel in OllyDbg after executing this command along with the memory card:

enter image description here

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


Edit:

I created an object file using the following command:

nasm -f win32 D:\1.asm

To create an 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
+4
source share
1 answer

, Microsoft.

PE , VirtualSize . VirtualSize, , 4 , Windows. .data 4 , , "".

.bss, - . .data .bss .

( .bss) .data, - . , , .bss.

Paweł Łukasik , MinGW .

Borland TLINK (, ) .bss. .data.

+4

Source: https://habr.com/ru/post/1681174/


All Articles