[Nasm-bugs] [Bug 3392451] New: windows does not get SECTION .text by default

no-reply at bugzilla-nasm.gorcunov.org no-reply at bugzilla-nasm.gorcunov.org
Fri Dec 1 14:00:32 PST 2017


https://bugzilla.nasm.us/show_bug.cgi?id=3392451

            Bug ID: 3392451
           Summary: windows does not get SECTION .text by default
           Product: NASM
           Version: 2.13.xx
          Hardware: All
                OS: Windows
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: johann.koenig at gmail.com
                CC: gorcunov at gmail.com, hpa at zytor.com, nasm-bugs at nasm.us
     Obtained from: From OS distribution

Per http://www.nasm.us/doc/nasmdoc7.html:
"Any code which comes before an explicit SECTION directive is directed by
default into the .text section."

However:
file.asm
global func1
func1:
 mov rax, 0
 ret

$ nasm -f elf64 -o file.o file.asm
$ objdump -xD file.o
<snip>
0000000000000000 <func1>:
   0:   b8 00 00 00 00          mov    $0x0,%eax
   5:   c3                      retq   

$ nasm -f win64 -o file.o file.asm
$ objdump -xD file.o
<snip>
0000000000000000 <.text>:
   0:   b8 00 00 00 00          mov    $0x0,%eax
   5:   c3                      retq   

Note that instead of func1, we see .text

yasm elf64 output is almost identical. It uses rax instead of eax.
win64:
$ yasm -f win64 -o file.o file.asm
$ objdump -xD file.o
<snip>
0000000000000000 <func1>:
   0:   48 c7 c0 00 00 00 00    mov    $0x0,%rax
   7:   c3                      retq

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list