Menu

#301 Exports only first symbol in obj-format

open
nobody
None
5
2007-06-22
2007-06-22
Anonymous
No

NASM 0.98.39 Windows32-Build
Windows XP
Borland Delphi 5, Delphi 2006

I successfully linked an OBJ with one symbol to my Borland executable.

Trying this with any further symbols fails. Delphi error message is "Symbol not found". First Symbol is still workiing.

Checked: Only the first defined symbol in CODE-Segment works.

Refering to a similar bug with win32 format, i tried
command line option -O0 until -O5, but without effect.

-------- test.asm
segment CSEG public use32 align=4

global func1
global func2

func1:
ret

func2:
ret

-------- unit1.pas

unit unit1;

interface

implementation

procedure func1(); external;
procedure func2(); external; //This is never be found

end.

--------- make.bat

nasm -O5 -f obj -g -l %1.lst -- %1

Discussion

  • Dale

    Dale - 2007-09-26

    Logged In: YES
    user_id=762255
    Originator: NO

    The Cygwin NASM generates seven (one for each of no -O and -O0..5) identical 283-byte files.
    $ strings test.obj
    test.asm?
    The Netwide Assembler 0.98.39
    CSEG=
    func1
    func2
    test.asm
    func1
    func2

    If I remove the -g, I get get seven other identical 114-byte files, and
    $ strings test.obj
    test.asm?
    The Netwide Assembler 0.98.39
    CSEG=
    func1
    func2

    I don't know whether these objects are valid, but when I have symbols missing from win32 output, they aren't present in the output of strings -a either.

    Either way, I suspect uploading the output files would be useful.

     
  • Nobody/Anonymous

    Logged In: NO

    I encountered the same problem.
    I suspect the Delphi 5 cannot handle combined PUBDEFs.

    TASM output which can be linked to Delphi successfully:

    000000 THEADR test.ASM
    00000D COMENT Purge: Yes, List: Yes, Class: 0 (000h)
    Translator: Turbo Assembler Version 5.0
    000030 COMENT Purge: Yes, List: No , Class: 233 (0E9h)
    Dependency File: test.ASM 04/01/2008 01:04:10 pm
    000043 COMENT Purge: Yes, List: No , Class: 233 (0E9h)
    End of Dependency List
    000049 LNAMES
    Name 1: ''
    00004E COMENT Purge: Yes, List: No , Class: 161 (0A1h)
    Object Module Extensions Present.
    000054 LNAMES
    Name 2: 'CSEG'
    00005D SEGDEF 1 : CSEG DWORD PUBLIC USE32 Length: 0002
    000067 PUBDEF 'FUNC1' Segment: CSEG:0000
    000076 PUBDEF 'FUNC2' Segment: CSEG:0001
    000085 COMENT Purge: Yes, List: No , Class: 162 (0A2h)
    Linker - Pass Two Marker.
    00008C LEDATA Segment: CSEG Offset: 0000 Length: 0002
    0000: C3 C3 テテ
    000095 MODEND

    nasm output:

    000000 THEADR test.nas
    00000D COMENT Purge: Yes, List: Yes, Class: 0 (000h)
    Translator: The Netwide Assembler 2.02
    00002E LNAMES
    Name 1: ''
    Name 2: 'CSEG'
    000038 SEGDEF 1 : CSEG DWORD PUBLIC USE32 Length: 0002
    000042 PUBDEF 'func1' Segment: CSEG:0000
    PUBDEF 'func2' Segment: CSEG:0001
    00005A COMENT Purge: Yes, List: No , Class: 162 (0A2h)
    Linker - Pass Two Marker.
    000061 LEDATA Segment: CSEG Offset: 0000 Length: 0002
    0000: C3 C3 テテ
    00006A MODE32

    This could be a Delphi's bug, but I appreciate if it could be
    addressed in nasm.

     
  • Nobody/Anonymous

    Logged In: NO

    I noticed this issue is described in the ToDo file.

     

Log in to post a comment.