SourceForge has been redesigned. Learn more.
Close

#432 Error in public/nonpublic symbol

closed-fixed
Assembler (85)
5
2009-01-27
2009-01-26
No

Many many errors anywhere I touch in NASM. :-(

In some cases the 'global' function staying nonpublic. I found error in several days.

Compiler: NASM 2.05.01, official Win32 version.

====================

%macro DefineGlobalLabels 1-*.nolist
%rep %0
%1:
global %1
%rotate 1
%endrep
%endmacro

section .text

align 8
;
; int32 __stdcall __atomic_int32_get(int32 const volatile * int32_ptr);
;
; Description:
; Atomic operation: *int32_ptr.
;
; Return value:
; *int32_ptr.
;

DefineGlobalLabels ?__atomic_int32_get@ulib@@YGHPDH@Z
; MSVC: int __stdcall ulib::__atomic_int32_get(int const volatile *)
DefineGlobalLabels ?__atomic_ptr_get@ulib@@YGPAXPBQCX@Z
; MSVC: void * __stdcall ulib::__atomic_ptr_get(void volatile * const *)

====================

nasm -05 -fwin32 file_name.asm

// But error: global labels in NONPUBLIC!!!

agner_objconv -fds file_name.obj

Symbol 7 - Name: ?__atomic_int32_get@ulib@@YGHPDH@Z
Value=0, Section=1, Type=0x0, StorClass=Static/Nonpublic, NumAux=0
Symbol 8 - Name: ?__atomic_ptr_get@ulib@@YGPAXPBQCX@Z
Value=0, Section=1, Type=0x0, StorClass=Static/Nonpublic, NumAux=0

====================

Dipl. Ing. Miloslav Ponkrác

Discussion

  • Nobody/Anonymous

    Hello Miloslav,

    Try, in your macro:

    ...
    global %1
    %1:
    ...

    if that'll work for you...

    Seems Nasm likes a symbol declared global *before* it's used. (so indicates my experimentation so far...)

    Best,
    Frank

     
  • AnonymousDog

    AnonymousDog - 2009-01-26

    The documentation has been updated to reflect the intended behavior.

     
  • AnonymousDog

    AnonymousDog - 2009-01-26

    Macro

    ...
    global %1
    %1:
    ...

    works good:

    Symbol 7 - Name: ?__atomic_int32_get@ulib@@YGHPDH@Z
    Value=0, Section=1, Type=0x0, StorClass=External/Public, NumAux=0
    Symbol 8 - Name: ?__atomic_ptr_get@ulib@@YGPAXPBQCX@Z
    Value=0, Section=1, Type=0x0, StorClass=External/Public, NumAux=0

    Miloslav Ponkrác

     
  • AnonymousDog

    AnonymousDog - 2009-01-27

    "The documentation has been updated to reflect the intended behavior."

    This is very bad! This is the worst behavior of NASM which can be exist.

    I can write 'global label' – which is error but NASM will be silent. Compilation will be ok without error and warnings. And output file will be bad. Really do you satisfied with this solving? More and more people will have errorneous compiled products of NASM but they will not be warned that file is bad!

    Either you correct NASM or you give warning – nothing else! Everything else is bad and very very error prone!

    The every people suppose if NASM (or any other) compiler will compile file without warning and errors then output file is without syntactic errors and output file is exactly reflect source code! Nowhere will be expect sabotage from NASM – public symbol which is not public and compiler will give no error not message!

    Dipl. Ing. Miloslav Ponkrác

     
  • Anonymous

    Anonymous - 2009-01-27

    The error message has been in the code for a long time, but had a typo which required two keystrokes to fix.

     
  • Anonymous

    Anonymous - 2009-01-27
    • assigned_to: nobody --> ccrayne
    • status: open --> closed-fixed
     

Log in to post a comment.