#627 GAS 2.9.4 chokes on comments and assembling a push

binutils (105)

In the following code snippet, GAS fails to assembly a line
which contains a constant defined with .equ.

Furthermore, comments which starts with a digit are not
allowed (GAS thinks they are directives) so I've used
an additional REM.

Platform is Win32.


# GNU assembler version 2.9.4 (i586-cygwin32) using BFD
version 2.9.4
# bug-gnu-utils@gnu.org


.set printf, _printf


szFormat: .asciz "9 == %d\n"
Len = . - szFormat \# Should be "Len = 9".


.global _main

push ebp
mov ebp, esp

    \# Direct constant is ok.
    push 9
    push offset szFormat
    call printf
    add esp, 8

    push Len
    \# Previou line assembled as \(hex\):
    \# FF
    \# REM 35 09 00 00 00 00
    \# The program will crash.
    push offset szFormat
    call printf
    add esp, 8

    xor eax, eax

    mov esp, ebp    
    pop ebp



  • Danny Smith

    Danny Smith - 2004-07-25

    Logged In: YES

    gas 2.9.4 is obsolete. (released in 1998). Upgrade to a newer
    version of binutils package.

  • Danny Smith

    Danny Smith - 2004-07-25
    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks