Skip to content

Commit

Permalink
fix more linking issues
Browse files Browse the repository at this point in the history
Make TABLES appear before __MERGED by introducing a fake symbol in the TABLES section
in the first file that goes into linking (TMap.asm[060] needs to be first,
because it has all the startup code.)
This works around a bug where vlink would place _LinkerDB (the symbol that all
base-relative data addressing is relative to) into the last BSS section (formalery
TABLES) instead of __MERGED. Now __MERGED is encountered after TABLES and thus
_LinkerDB ends up in the right one.

Define _custom as absolute global symbol. This way we don't need to link against
amiga.lib
  • Loading branch information
mheyer32 committed Aug 28, 2020
1 parent fc002bd commit ece34a5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Sorgenti/TMap.asm
Expand Up @@ -44,7 +44,7 @@

;* Inizio del programma ********************************


_start
movem.l d0-d7/a0-a6,-(sp)

GETDBASE
Expand Down Expand Up @@ -1152,7 +1152,12 @@ PaletteRGB32 dc.l $01000000
dc.l 0

;***************************************************************************
section TABLES,bss

xdef stupid
stupid ds.l 1

;***************************************************************************
section __MERGED,bss

xdef ChunkyPointer,ChunkyBuffer,Yoffset
Expand Down Expand Up @@ -1300,7 +1305,6 @@ Palette ds.b 256*3
RedPalette ds.b 256*3

cnop 0,4

end


7 changes: 6 additions & 1 deletion Sorgenti/TMap.asm060
Expand Up @@ -45,7 +45,7 @@

;* Inizio del programma ********************************

_start
movem.l d0-d7/a0-a6,-(sp)

GETDBASE
Expand Down Expand Up @@ -1166,6 +1166,11 @@ PaletteRGB32 dc.l $01000000
ds.l 256*3
dc.l 0

;***************************************************************************
section TABLES,bss
xdef stupid
stupid ds.l 1

;***************************************************************************

section __MERGED,BSS
Expand Down
4 changes: 4 additions & 0 deletions Sorgenti/TMapMain.asm
Expand Up @@ -2280,5 +2280,9 @@ GlobalSound10 ds.l 1 ;Pun. al global sound 10

cnop 0,4

; define our own _custom symbol to not have to link against amiga.lib
org 0xDFF000
xdef _custom
_custom ds.l 1

end
4 changes: 4 additions & 0 deletions Sorgenti/TMapMain.demo
Expand Up @@ -2280,5 +2280,9 @@ GlobalSound10 ds.l 1 ;Pun. al global sound 10

cnop 0,4

; define our own _custom symbol to not have to link against amiga.lib
org 0xDFF000
xdef _custom
_custom ds.l 1

end

0 comments on commit ece34a5

Please sign in to comment.