English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 08 July 2018, 20:56   #1
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Problem with VASM - file is not an object module on A500, ok on A1200???

I have a really odd problem that I haven't been able to get fixed after a few hours banging my head and I'm hoping someone could give some insight.

I have a source file which compiles fine, if I run it on a WinUAE A1200 config it runs fine, if I run it with A500 config I get an error "file is not an object module from workbench".

I can only imagine it's something to do with Vasm flags.

vasm -Fhunkexe -I C:\Development\Scroller\Include -o C:\Emulators\Commodore\Amiga\HardDrive\A500_TestRig\ToolChain\test.exe C:\Development\Scroller\main.asm

Can anyone shed any light? I didn't seem to have this problem when I was compiling Bomb Jack... very odd.

Cheers,
Geezer
mcgeezer is offline  
Old 08 July 2018, 21:20   #2
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,421
Quote:
Originally Posted by mcgeezer View Post
I have a really odd problem that I haven't been able to get fixed after a few hours banging my head and I'm hoping someone could give some insight.

I have a source file which compiles fine, if I run it on a WinUAE A1200 config it runs fine, if I run it with A500 config I get an error "file is not an object module from workbench".

I can only imagine it's something to do with Vasm flags.

vasm -Fhunkexe -I C:\Development\Scroller\Include -o C:\Emulators\Commodore\Amiga\HardDrive\A500_TestRig\ToolChain\test.exe C:\Development\Scroller\main.asm

Can anyone shed any light? I didn't seem to have this problem when I was compiling Bomb Jack... very odd.

Cheers,
Geezer

The first thing that springs to my mind is that some hunk types are not compatible with Kickstart 1.3. If you use BSS or similar sections this might cause trouble.


I usually use: vasm -kick1hunks -Fhunk
That should force Kickstart 1.3 compatible hunks.

Edit: -Fhunk is for further linking, so it should be -Fhunkexe in your case.
roondar is offline  
Old 08 July 2018, 21:25   #3
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by roondar View Post
The first thing that springs to my mind is that some hunk types are not compatible with Kickstart 1.3. If you use BSS or similar sections this might cause trouble.


I usually use: vasm -kick1hunks -Fhunk
That should force Kickstart 1.3 compatible hunks.

Edit: -Fhunk is for further linking, so it should be -Fhunkexe in your case.
Buddy - that was totally the issue, THANKYOU!!!!

I have no idea why I did not run into that when making Bomb Jack... really really weird.

If I post the source would we be able to understand why?
mcgeezer is offline  
Old 08 July 2018, 21:29   #4
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,421
Well, maybe - I'm not actually an expert on object files. Never looked into how that works t.b.h.

The VASM manual says that some types of relocation don't work under KS 1.3, but I don't know when these are created (as in, I do understand when relocations are created, just not why the linker would choose one type over another). Perhaps it'll shed some light on the matter?

Quote:
Originally Posted by VASM Manual
‘-kick1hunks’

Use only those hunk types and external reference types which have been valid at the time of Kickstart 1.x for compatibility with old assembler sources and old linkers. For example: no longer differentiate between absolute and relative references. In executables it will prevent the assembler from using 16-bit relocation offsets in hunks and rejects 32-bit PC-relative relocations.
roondar is offline  
Old 09 July 2018, 08:27   #5
hmn
Registered User
 
Join Date: Nov 2016
Location: DE
Posts: 20
Quote:
Originally Posted by mcgeezer View Post
If I post the source would we be able to understand why?
Look at the binary, does it start with $03f3 ? That is the header block id for executables (load files), whereas $03e7 is the header block id for linkable files. I would be really surprised if the loader on KS 1.3 accepted anything but the former.

EDIT: disregard - I mis-read roondar's reply and thought the problem was with -Fhunkexe.

Last edited by hmn; 09 July 2018 at 18:09.
hmn is offline  
Old 09 July 2018, 13:04   #6
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,502
When the program still assembles without error using -kick1hunks, then it cannot be an OS2+ specific relocation which was in use. So I am quite sure that the first executable just contained a HUNK_RELOC32SHORT hunk with 16-bit offsets for relocations, which is unknown to Kickstart 1.x, and which is the default without -kick1hunks (because it saves much space).


That the problem didn't appear with Bomb Jack might have several reasons. Maybe the sections offsets were too big for HUNK_RELOC32SHORT, or there were too many, or none at all? Or you linked the final executable from multiple object files with a different linker or different options?
phx is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vasm file type for cubicide? tolkien Coders. General 5 10 August 2017 11:54
A1200 RF module removal pics + A1200 chips overview eXeler0 Hardware pics 2 08 March 2017 00:09
Programs created by vasm don't run on vanilla A500 Knocker Coders. Asm / Hardware 12 30 July 2016 12:00
...file is not an object module Vaninna support.Apps 8 11 March 2015 11:53
Help linking VASM object code clenched Coders. Asm / Hardware 2 24 May 2013 22:32

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:01.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07097 seconds with 15 queries