From 8216bf1d6abd5b466fc71fcfd9d6a4115881fffc Mon Sep 17 00:00:00 2001 From: uz Date: Fri, 31 Jul 2009 12:05:42 +0000 Subject: [PATCH] Force an import of the special symbol __STARTUP__ in the C compiler when main() is encountered. Define this symbol in the startup code. This will automatically force linking of the startup code which can then reside inside the standard library as any other object file. git-svn-id: svn://svn.cc65.org/cc65/trunk@3988 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/Makefile | 15 --------------- libsrc/apple2/crt0.s | 13 ++++++------- libsrc/atari/crt0.s | 3 +-- libsrc/atmos/crt0.s | 3 +-- libsrc/c128/crt0.s | 3 +-- libsrc/c16/crt0.s | 3 +-- libsrc/c64/crt0.s | 3 +-- libsrc/cbm510/crt0.s | 3 +-- libsrc/cbm610/crt0.s | 3 +-- libsrc/lynx/crt0.s | 3 +-- libsrc/nes/crt0.s | 3 +-- libsrc/pet/crt0.s | 3 +-- libsrc/plus4/crt0.s | 3 +-- libsrc/supervision/crt0.s | 3 +-- libsrc/vic20/crt0.s | 3 +-- packages/rpm/redhat/cc65.spec | 16 ---------------- samples/Makefile | 34 ++++++++++++++++------------------ src/cc65/codegen.c | 6 ++---- 18 files changed, 37 insertions(+), 86 deletions(-) diff --git a/libsrc/Makefile b/libsrc/Makefile index f5d994814..85a5a64f6 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -46,7 +46,6 @@ apple2lib: $(MAKE) SYS=apple2 -C $$i || exit 1; \ $(AR) a apple2.lib $$i/*.o;\ done - mv apple2/crt0.o apple2.o cp apple2/apple2-auxmem.emd a2.auxmem.emd cp apple2/apple2-stdjoy.joy a2.stdjoy.joy cp apple2/apple2-stdmou.mou a2.stdmou.mou @@ -62,7 +61,6 @@ apple2enhlib: $(MAKE) SYS=apple2enh -C $$i || exit 1; \ $(AR) a apple2enh.lib $$i/*.o;\ done - mv apple2enh/crt0.o apple2enh.o cp apple2enh/apple2-auxmem.emd a2e.auxmem.emd cp apple2enh/apple2-stdjoy.joy a2e.stdjoy.joy cp apple2enh/apple2-stdmou.mou a2e.stdmou.mou @@ -78,7 +76,6 @@ atarilib: $(MAKE) SYS=atari -C $$i || exit 1; \ $(AR) a atari.lib $$i/*.o;\ done - mv atari/crt0.o atari.o cp atari/atari-stdjoy.joy ataristd.joy cp atari/atari-multijoy.joy atarimj8.joy @@ -90,7 +87,6 @@ atmoslib: $(MAKE) SYS=atmos -C $$i || exit 1; \ $(AR) a atmos.lib $$i/*.o;\ done - mv atmos/crt0.o atmos.o cp atmos/*.tgi . #----------------------------------------------------------------------------- @@ -101,7 +97,6 @@ c16lib: $(MAKE) SYS=c16 -C $$i || exit 1; \ $(AR) a c16.lib $$i/*.o;\ done - mv c16/crt0.o c16.o cp c16/*.joy . cp c16/*.emd . @@ -113,7 +108,6 @@ c64lib: $(MAKE) SYS=c64 -C $$i || exit 1; \ $(AR) a c64.lib $$i/*.o;\ done - mv c64/crt0.o c64.o cp c64/*.emd . cp c64/*.joy . cp c64/c64-1351.mou . @@ -130,7 +124,6 @@ c128lib: $(MAKE) SYS=c128 -C $$i || exit 1; \ $(AR) a c128.lib $$i/*.o;\ done - mv c128/crt0.o c128.o cp c128/*.emd . cp c128/*.joy . cp c128/c128-1351.mou . @@ -148,7 +141,6 @@ cbm510lib: $(MAKE) SYS=cbm510 -C $$i || exit 1; \ $(AR) a cbm510.lib $$i/*.o;\ done - mv cbm510/crt0.o cbm510.o cp cbm510/*.emd . cp cbm510/cbm510-stdjoy.joy cbm510-std.joy cp cbm510/cbm510-stdser.ser cbm510-std.ser @@ -161,7 +153,6 @@ cbm610lib: $(MAKE) SYS=cbm610 -C $$i || exit 1; \ $(AR) a cbm610.lib $$i/*.o;\ done - mv cbm610/crt0.o cbm610.o cp cbm610/*.emd . cp cbm610/cbm610-stdser.ser cbm610-std.ser @@ -204,7 +195,6 @@ lynxlib: $(MAKE) SYS=lynx -C $$i || exit 1; \ $(AR) a lynx.lib $$i/*.o;\ done - mv lynx/crt0.o lynx.o cp lynx/*.joy . cp lynx/*.tgi . @@ -216,7 +206,6 @@ neslib: $(MAKE) SYS=nes -C $$i || exit 1; \ $(AR) a nes.lib $$i/*.o;\ done - mv nes/crt0.o nes.o cp nes/*.joy . #----------------------------------------------------------------------------- @@ -227,7 +216,6 @@ petlib: $(MAKE) SYS=pet -C $$i || exit 1; \ $(AR) a pet.lib $$i/*.o;\ done - mv pet/crt0.o pet.o cp pet/*.joy . #----------------------------------------------------------------------------- @@ -238,7 +226,6 @@ plus4lib: $(MAKE) SYS=plus4 -C $$i || exit 1; \ $(AR) a plus4.lib $$i/*.o;\ done - mv plus4/crt0.o plus4.o cp plus4/*.joy . cp plus4/*.ser . @@ -250,7 +237,6 @@ supervisionlib: $(MAKE) SYS=supervision -C $$i || exit 1; \ $(AR) a supervision.lib $$i/*.o;\ done - mv supervision/crt0.o supervision.o #----------------------------------------------------------------------------- # Vic20 @@ -260,7 +246,6 @@ vic20lib: $(MAKE) SYS=vic20 -C $$i || exit 1; \ $(AR) a vic20.lib $$i/*.o;\ done - mv vic20/crt0.o vic20.o cp vic20/*.joy . #----------------------------------------------------------------------------- diff --git a/libsrc/apple2/crt0.s b/libsrc/apple2/crt0.s index ec61770bc..4985a87bf 100644 --- a/libsrc/apple2/crt0.s +++ b/libsrc/apple2/crt0.s @@ -1,10 +1,9 @@ ; ; Startup code for cc65 (Apple2 version) -; -; This must be the *first* file on the linker command line ; .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .import zerobss .import initlib, donelib .import callmain, callirq @@ -40,13 +39,13 @@ ; Switch in LC bank 2 for W/O bit $C081 bit $C081 - + ; Set source start address lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__) ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__) sta $9B sty $9C - + ; Set source last address lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__) ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__) @@ -68,7 +67,7 @@ ldy #>__ZPSAVE_RUN__ sta $9B sty $9C - + ; Set source last address lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__) ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__) @@ -92,7 +91,7 @@ _exit: ldx #exit jsr reset ; Setup RESET vector - + ; Switch in ROM in case it wasn't already switched in by a RESET bit $C082 @@ -159,7 +158,7 @@ init: ldx #zpspace-1 ldx #<_exit lda #>_exit jsr reset ; Setup RESET vector - + ; Setup the stack lda HIMEM sta sp diff --git a/libsrc/atari/crt0.s b/libsrc/atari/crt0.s index 03839ac09..68aa4425c 100644 --- a/libsrc/atari/crt0.s +++ b/libsrc/atari/crt0.s @@ -5,11 +5,10 @@ ; Mark Keates ; Freddy Offenga ; Christian Groessler -; -; This must be the *first* file on the linker command line ; .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .constructor initsp, 26 .import initlib, donelib, callmain diff --git a/libsrc/atmos/crt0.s b/libsrc/atmos/crt0.s index 677dee84e..4fe9d5cbc 100644 --- a/libsrc/atmos/crt0.s +++ b/libsrc/atmos/crt0.s @@ -2,11 +2,10 @@ ; Startup code for cc65 (Oric version) ; ; By Debrune Jérôme and Ullrich von Bassewitz -; -; This must be the *first* file on the linker command line ; .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .import initlib, donelib .import callmain, zerobss .import __RAM_START__, __RAM_SIZE__, __BSS_LOAD__ diff --git a/libsrc/c128/crt0.s b/libsrc/c128/crt0.s index 81e1d4dcf..d0a61ab00 100644 --- a/libsrc/c128/crt0.s +++ b/libsrc/c128/crt0.s @@ -1,10 +1,9 @@ ; ; Startup code for cc65 (C128 version) -; -; This must be the *first* file on the linker command line ; .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .import callirq, initlib, donelib .import zerobss .import push0, callmain diff --git a/libsrc/c16/crt0.s b/libsrc/c16/crt0.s index 3e48dbe4b..c967671c5 100644 --- a/libsrc/c16/crt0.s +++ b/libsrc/c16/crt0.s @@ -1,13 +1,12 @@ ; ; Startup code for cc65 (C16 version) ; -; This must be the *first* file on the linker command line -; ; Note: The C16 is actually the Plus/4 with just 16KB of memory. So many ; things are similar here, and we even use the plus4.inc include file. ; .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .import initlib, donelib, callirq .import callmain, zerobss .import MEMTOP, RESTOR, BSOUT, CLRCH diff --git a/libsrc/c64/crt0.s b/libsrc/c64/crt0.s index 8b094148d..18ef10904 100644 --- a/libsrc/c64/crt0.s +++ b/libsrc/c64/crt0.s @@ -1,10 +1,9 @@ ; ; Startup code for cc65 (C64 version) -; -; This must be the *first* file on the linker command line ; .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .import initlib, donelib, callirq .import zerobss .import callmain diff --git a/libsrc/cbm510/crt0.s b/libsrc/cbm510/crt0.s index 88c9a5dfe..ef2cb8c62 100644 --- a/libsrc/cbm510/crt0.s +++ b/libsrc/cbm510/crt0.s @@ -1,10 +1,9 @@ ; ; Startup code for cc65 (CBM 500 version) -; -; This must be the *first* file on the linker command line ; .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .import _clrscr, initlib, donelib, callirq_y .import push0, callmain diff --git a/libsrc/cbm610/crt0.s b/libsrc/cbm610/crt0.s index 6627a9270..5b6bb8b3c 100644 --- a/libsrc/cbm610/crt0.s +++ b/libsrc/cbm610/crt0.s @@ -1,10 +1,9 @@ ; ; Startup code for cc65 (CBM 600/700 version) -; -; This must be the *first* file on the linker command line ; .export _exit, BRKVec + .export __STARTUP__ : absolute = 1 ; Mark as startup .import callirq_y, initlib, donelib .import push0, callmain diff --git a/libsrc/lynx/crt0.s b/libsrc/lynx/crt0.s index 70d46629e..db107fd94 100644 --- a/libsrc/lynx/crt0.s +++ b/libsrc/lynx/crt0.s @@ -13,12 +13,11 @@ ; code structure. The C stack is located at the end of the RAM memory ; segment and grows downward. Bastian Schick's executable header is put ; on the front of the fully linked binary (see EXEHDR segment.) -; -; This must be the *first* file on the linker command line ; .include "lynx.inc" .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .import initlib, donelib .import zerobss diff --git a/libsrc/nes/crt0.s b/libsrc/nes/crt0.s index 3a2232497..373c3b9a3 100644 --- a/libsrc/nes/crt0.s +++ b/libsrc/nes/crt0.s @@ -3,11 +3,10 @@ ; ; by Groepaz/Hitmen ; based on code by Ullrich von Bassewitz -; -; This must be the *first* file on the linker command line ; .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .import initlib, donelib, callmain .import push0, _main, zerobss, copydata .import ppubuf_flush diff --git a/libsrc/pet/crt0.s b/libsrc/pet/crt0.s index 1e63617c2..23ff90ea3 100644 --- a/libsrc/pet/crt0.s +++ b/libsrc/pet/crt0.s @@ -1,10 +1,9 @@ ; ; Startup code for cc65 (PET version) -; -; This must be the *first* file on the linker command line ; .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .import initlib, donelib, callirq .import zerobss, push0 .import callmain diff --git a/libsrc/plus4/crt0.s b/libsrc/plus4/crt0.s index a7dda7dd4..9cf776a77 100644 --- a/libsrc/plus4/crt0.s +++ b/libsrc/plus4/crt0.s @@ -1,11 +1,10 @@ ; ; Startup code for cc65 (Plus/4 version) -; -; This must be the *first* file on the linker command line ; .export _exit .export brk_jmp + .export __STARTUP__ : absolute = 1 ; Mark as startup .import callirq_y, initlib, donelib .import callmain, zerobss diff --git a/libsrc/supervision/crt0.s b/libsrc/supervision/crt0.s index 2ad472fb2..6a3614476 100644 --- a/libsrc/supervision/crt0.s +++ b/libsrc/supervision/crt0.s @@ -1,10 +1,9 @@ ; ; Startup code for cc65 (supervision version) -; -; This must be the *first* file on the linker command line ; .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .import _main .import initlib, donelib, copydata diff --git a/libsrc/vic20/crt0.s b/libsrc/vic20/crt0.s index 2bd80e942..a5d613865 100644 --- a/libsrc/vic20/crt0.s +++ b/libsrc/vic20/crt0.s @@ -1,10 +1,9 @@ ; ; Startup code for cc65 (Vic20 version) -; -; This must be the *first* file on the linker command line ; .export _exit + .export __STARTUP__ : absolute = 1 ; Mark as startup .import initlib, donelib, callirq .import zerobss, push0 .import callmain diff --git a/packages/rpm/redhat/cc65.spec b/packages/rpm/redhat/cc65.spec index d1be1b76a..2e748cbbc 100644 --- a/packages/rpm/redhat/cc65.spec +++ b/packages/rpm/redhat/cc65.spec @@ -110,7 +110,6 @@ programs for the Apple ][ using the cc65 crosscompiler. %files apple2 %attr(644,root,root) /usr/lib/cc65/lib/apple2.lib -%attr(644,root,root) /usr/lib/cc65/lib/apple2.o %attr(644,root,root) /usr/lib/cc65/emd/a2.*.emd %attr(644,root,root) /usr/lib/cc65/joy/a2.*.joy %attr(644,root,root) /usr/lib/cc65/mou/a2.*.mou @@ -135,7 +134,6 @@ programs for the Apple //e using the cc65 crosscompiler. %files apple2enh %attr(644,root,root) /usr/lib/cc65/lib/apple2enh.lib -%attr(644,root,root) /usr/lib/cc65/lib/apple2enh.o %attr(644,root,root) /usr/lib/cc65/emd/a2e.*.emd %attr(644,root,root) /usr/lib/cc65/joy/a2e.*.joy %attr(644,root,root) /usr/lib/cc65/mou/a2e.*.mou @@ -160,7 +158,6 @@ programs for the 8 bit Atari machines using the cc65 crosscompiler. %files atari %attr(644,root,root) /usr/lib/cc65/lib/atari.lib -%attr(644,root,root) /usr/lib/cc65/lib/atari.o %attr(644,root,root) /usr/lib/cc65/joy/atari*.joy @@ -181,7 +178,6 @@ programs for the Oric Atmos using the cc65 crosscompiler. %files atmos %attr(644,root,root) /usr/lib/cc65/lib/atmos.lib -%attr(644,root,root) /usr/lib/cc65/lib/atmos.o %attr(644,root,root) /usr/lib/cc65/tgi/atmos-*.tgi @@ -202,7 +198,6 @@ programs for the Commodore C128 using the cc65 crosscompiler. %files c128 %attr(644,root,root) /usr/lib/cc65/lib/c128.lib -%attr(644,root,root) /usr/lib/cc65/lib/c128.o %attr(644,root,root) /usr/lib/cc65/emd/c128-*.emd %attr(644,root,root) /usr/lib/cc65/joy/c128-*.joy %attr(644,root,root) /usr/lib/cc65/mou/c128-*.mou @@ -227,7 +222,6 @@ programs for the Commodore C16/116 using the cc65 crosscompiler. %files c16 %attr(644,root,root) /usr/lib/cc65/lib/c16.lib -%attr(644,root,root) /usr/lib/cc65/lib/c16.o %attr(644,root,root) /usr/lib/cc65/emd/c16-*.emd %attr(644,root,root) /usr/lib/cc65/joy/c16-*.joy @@ -249,7 +243,6 @@ programs for the Commodore C64 using the cc65 crosscompiler. %files c64 %attr(644,root,root) /usr/lib/cc65/lib/c64.lib -%attr(644,root,root) /usr/lib/cc65/lib/c64.o %attr(644,root,root) /usr/lib/cc65/emd/dtv-*.emd %attr(644,root,root) /usr/lib/cc65/emd/c64-*.emd %attr(644,root,root) /usr/lib/cc65/joy/c64-*.joy @@ -276,7 +269,6 @@ crosscompiler. %files cbm510 %attr(644,root,root) /usr/lib/cc65/lib/cbm510.lib -%attr(644,root,root) /usr/lib/cc65/lib/cbm510.o %attr(644,root,root) /usr/lib/cc65/emd/cbm510-*.emd %attr(644,root,root) /usr/lib/cc65/joy/cbm510-*.joy %attr(644,root,root) /usr/lib/cc65/ser/cbm510-*.ser @@ -300,7 +292,6 @@ the cc65 crosscompiler. %files cbm610 %attr(644,root,root) /usr/lib/cc65/lib/cbm610.lib -%attr(644,root,root) /usr/lib/cc65/lib/cbm610.o %attr(644,root,root) /usr/lib/cc65/emd/cbm610-*.emd %attr(644,root,root) /usr/lib/cc65/ser/cbm610-*.ser @@ -323,7 +314,6 @@ GEOS programs for the C64/C128 using the cc65 crosscompiler. %files geos %attr(755,root,root) /usr/bin/grc %attr(644,root,root) /usr/lib/cc65/lib/geos.lib -%attr(644,root,root) /usr/lib/cc65/lib/geos.o %attr(755,root,root) %dir /usr/lib/cc65/include/geos %attr(644,root,root) /usr/lib/cc65/include/geos/*.h %attr(644,root,root) /usr/lib/cc65/emd/geos-*.emd @@ -348,7 +338,6 @@ programs for the Lynx Game Console using the cc65 crosscompiler. %files lynx %attr(644,root,root) /usr/lib/cc65/lib/lynx.lib -%attr(644,root,root) /usr/lib/cc65/lib/lynx.o %attr(644,root,root) /usr/lib/cc65/joy/lynx-*.joy %attr(644,root,root) /usr/lib/cc65/tgi/lynx-*.tgi @@ -371,7 +360,6 @@ crosscompiler. %files nes %attr(644,root,root) /usr/lib/cc65/lib/nes.lib -%attr(644,root,root) /usr/lib/cc65/lib/nes.o %attr(644,root,root) /usr/lib/cc65/joy/nes-*.joy @@ -393,7 +381,6 @@ crosscompiler. %files pet %attr(644,root,root) /usr/lib/cc65/lib/pet.lib -%attr(644,root,root) /usr/lib/cc65/lib/pet.o %attr(644,root,root) /usr/lib/cc65/joy/pet-*.joy @@ -415,7 +402,6 @@ crosscompiler. %files plus4 %attr(644,root,root) /usr/lib/cc65/lib/plus4.lib -%attr(644,root,root) /usr/lib/cc65/lib/plus4.o %attr(644,root,root) /usr/lib/cc65/joy/plus4-*.joy %attr(644,root,root) /usr/lib/cc65/ser/plus4-*.ser @@ -437,7 +423,6 @@ programs for the Supervision Game console using the cc65 crosscompiler. %files supervision %attr(644,root,root) /usr/lib/cc65/lib/supervision.lib -%attr(644,root,root) /usr/lib/cc65/lib/supervision.o @@ -457,7 +442,6 @@ programs for the Commodore VIC20 using the cc65 crosscompiler. %files vic20 %attr(644,root,root) /usr/lib/cc65/lib/vic20.lib -%attr(644,root,root) /usr/lib/cc65/lib/vic20.o %attr(644,root,root) /usr/lib/cc65/joy/vic20-*.joy diff --git a/samples/Makefile b/samples/Makefile index ed9cd09c5..cd8079a2c 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -12,7 +12,6 @@ SYS = c64 # source tree, otherwise use the "official" directories. ifeq "$(wildcard ../src)" "" # No source tree -CRT0 = $(SYS).o CLIB = $(SYS).lib CL = cl65 CC = cc65 @@ -21,7 +20,6 @@ LD = ld65 else # Samples is part of a complete source tree -CRT0 = ../libsrc/$(SYS).o CLIB = ../libsrc/$(SYS).lib CL = ../src/cl65/cl65 CC = ../src/cc65/cc65 @@ -68,63 +66,63 @@ EXELIST = ascii \ .PHONY: all all: $(EXELIST) -ascii: $(CRT0) ascii.o $(CLIB) +ascii: ascii.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ -diodemo: $(CRT0) diodemo.o $(CLIB) +diodemo: diodemo.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ -fire: $(CRT0) fire.o $(CLIB) +fire: fire.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ -gunzip65: $(CRT0) gunzip65.o $(CLIB) +gunzip65: gunzip65.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ -hello: $(CRT0) hello.o $(CLIB) +hello: hello.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ # The Apple machines need the start address adjusted for the mandelbrot demo ifeq "$(SYS)" "apple2" -mandelbrot: $(CRT0) mandelbrot.o $(CLIB) +mandelbrot: mandelbrot.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map --start-addr 0x4000 -o $@ $^ else ifeq "$(SYS)" "apple2enh" -mandelbrot: $(CRT0) mandelbrot.o $(CLIB) +mandelbrot: mandelbrot.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map --start-addr 0x4000 -o $@ $^ else -mandelbrot: $(CRT0) mandelbrot.o $(CLIB) +mandelbrot: mandelbrot.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ endif endif # The Apple ][ needs the start address adjusted for the mousedemo ifeq "$(SYS)" "apple2" -mousedemo: $(CRT0) mousedemo.o $(CLIB) +mousedemo: mousedemo.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map --start-addr 0x4000 -o $@ $^ else -mousedemo: $(CRT0) mousedemo.o $(CLIB) +mousedemo: mousedemo.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ endif -nachtm: $(CRT0) nachtm.o $(CLIB) +nachtm: nachtm.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map -Ln $(basename $@).lbl -o $@ $^ -plasma: $(CRT0) plasma.o $(CLIB) +plasma: plasma.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ -sieve: $(CRT0) sieve.o $(CLIB) +sieve: sieve.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ # The Apple machines need the start address adjusted for the tgidemo ifeq "$(SYS)" "apple2" -tgidemo: $(CRT0) tgidemo.o $(CLIB) +tgidemo: tgidemo.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map --start-addr 0x4000 -o $@ $^ else ifeq "$(SYS)" "apple2enh" -tgidemo: $(CRT0) tgidemo.o $(CLIB) +tgidemo: tgidemo.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map --start-addr 0x4000 -o $@ $^ else -tgidemo: $(CRT0) tgidemo.o $(CLIB) +tgidemo: tgidemo.o $(CLIB) @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ endif endif diff --git a/src/cc65/codegen.c b/src/cc65/codegen.c index dc0fd520d..34e942ff3 100644 --- a/src/cc65/codegen.c +++ b/src/cc65/codegen.c @@ -386,11 +386,9 @@ void g_defimport (const char* Name, int ZP) void g_importstartup (void) -/* Forced import of the startup segment */ +/* Forced import of the startup module */ { -#if 0 - AddTextLine ("\t.forceimport\t__STARTUP_RUN__"); -#endif + AddTextLine ("\t.forceimport\t__STARTUP__"); } -- 2.39.5