View Single Post
Old 12 January 2020, 15:03   #4
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,983
Quote:
Originally Posted by adrianpbrown View Post
Code:
l:\catfish\amiga\rubyfire\tools\bin\vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -M "Build/main.o" "Libs/Catfish/Build/System.o" "Libs/Catfish/Build/System_c.o" -L"../../tools/bin/targets/m68k-amigaos/lib" -lvc -o blah.exe

Files:
  main.asm:  GameCode 0(38), Variables 0(18) hex
  System.asm:  Framework 0(dc), Variables 0(3c) hex
  Libs\Catfish\Src\System.c:  CODE 0(8) hex
Your code has no reference to vclib at all. Otherwise you would read on top of the map file something like "vclib (path/file.c) needed due to _xyz". So you could also choose to drop -L.. and -lvc at this point.


Quote:
Code:
Section mapping (numbers in hex):
------------------------------
  00000000 GameCode  (size 38)
           00000000 - 00000038 main.asm(GameCode)
Looking good. This is your first section in the executable, so the first instruction from main.asm(GameCode) starts it.

Quote:
It looks like it doesnt recognise the section details of the .asm file as code (Although that could just be the actual name).
It's just the section name. The C-compiler calls the code-section "CODE", while you called it "GameCode" and "Framework".

Note, that the linker will not merge sections with different names and/or types (unless specifying the -sc option to merge all code, or -sd to merge all data/bss). This might be important if you want to use PC-relative references between your code parts.

Quote:
The start of the main.asm is

Code:
                            SECTION        GameCode, CODE_F

Startup:
                            jsr            _SomeFunction
As to the startup file, hard to say other than i like to know exactly whats going on.
Is this not the first instructon executed in your executable? It should, according to the map file. I'm not sure whether I understand what your actual problem is.

(Side note: There is never a reason to use code_f instead of code, except you don't want anybody to run your code on a Chip-RAM-only system.)

Quote:
Originally Posted by adrianpbrown View Post
I pass one of the asm->.o files as the first object code to the linker but still it insists on putting the .c->.o file as the startup
What is a ".c->.o" file? Did you mean that System_c.o is the first code in your executable? I cannot believe that.

Quote:
Im not too fussed about using the standard libraries, its more just using C for functions to try and speed up development a bit (although most will likely be in asm).
This should work fine.
phx is offline  
 
Page generated in 0.04670 seconds with 11 queries