English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. Asm / Hardware (http://eab.abime.net/forumdisplay.php?f=112)
-   -   Help linking VASM object code (http://eab.abime.net/showthread.php?t=69362)

clenched 23 May 2013 22:10

Help linking VASM object code
 
Code:

  ;x.asm
  xref  _LVOSuperState
  jsr    _LVOSuperState(a6)

I'm having trouble getting VASM to create an object file that can be linked.

Code:


{Windows}
c:\vasm>vasmm68k_mot c:\x.asm -Fhunk -o c:\a.o
vasm 1.6b (c) in 2002-2013 Volker Barthelmann
vasm M68k/CPU32/ColdFire cpu backend 1.3e (c) 2002-2013 Frank Wille
vasm motorola syntax module 3.4a (c) 2002-2013 Frank Wille
vasm hunk format output module 2.3 (c) 2002-2012 Frank Wille
CODE(acrx2):              4 byte

then...
Code:


{WinUAE}
1.WinDH_C:> phxlnk a.o LIB:amiga.lib TO x
Unknown XREF type in unit "c:\x.asm" of "a.o" !
1.WinDH_C:> blink FROM a.o TO x LIB LIB:amiga.lib
Blink - Version 6.7 - 15 October 1986
Copyright © 1986 The Software Distillery.  All Rights Reserved.
235 Trillingham Lane, Cary NC 27511 - BBS: (919)-471-6436
Error 446: Invalid symbol type 138 for _LVOSuperState
1.WinDH_C:> alink a.o TO x LIB LIB:amiga.lib
Amiga Linker Version 2.32
Copyright (C) 1986 Metacomco plc.
All rights reserved.
Linker error: invalid type 0000008A for "4" in file "a.o"
 - linking abandoned
1.WinDH_C:> slink FROM a.o TO x LIB LIB:amiga.lib
Slink - Version 6.50
Copyright (c) 1988-1993 SAS Institute, Inc.  All Rights Reserved.
Error 446: Invalid symbol type 138 for _LVOSuperState

If I create an object file with PhxAss, C.A.P.E., asm, ( who knows how many others? ) then all the linkers work.
Vlink was the only one that could successfully link VASM object.
How do I make VASM object code compatible with old linkers?
.

phx 24 May 2013 12:22

Quote:

Originally Posted by clenched (Post 890274)
Code:

  ;x.asm
  xref  _LVOSuperState
  jsr    _LVOSuperState(a6)

...
Code:

Error 446: Invalid symbol type 138 for _LVOSuperState

That's an EXT_ABSREF16 reference (refer to doshunks.h), which is absolutely correct. The reference to _LVOSuperState in the operand of JSR is an absolute 16-bit displacement.

From dos/doshunks.h:
Code:

#define EXT_ABSREF16    138    /* 16 bit absolute reference to symbol */
Quote:

Originally Posted by clenched (Post 890274)
Vlink was the only one that could successfully link VASM object.
How do I make VASM object code compatible with old linkers?

That would be my task. I could add an option to be compatible with old linkers. I must say that I'm surprised that no other linker supports it.

The EXT_ABSREF16 define was added lately to doshunks.h (either for AmigaOS2.x or 3.x). Before that assemblers used EXT_REF16 (131), which is now known as EXT_RELREF16 and is a PC-relative 16-bit reference, which would be wrong here, IMHO.

BTW, what is wrong with using vlink? ;)

clenched 24 May 2013 22:32

phx - Thank you for that good explanation. There is no reason not to use Vlink. I just had the other ones at hand and know them, that's all. For now, I'm satisfied to know the reason for this trouble.


All times are GMT +2. The time now is 06:00.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.

Page generated in 0.04366 seconds with 11 queries