[cc65] Startup magic (was: Segment EXEHDR does not exist - while using ld65 directly)

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-07-31 16:01:39

I've now implemented the necessary magic to link in the startup file
automatically. It is mostly based on Gregs proposal but doesn't use the _exit
symbol but a new symbol named __STARTUP__ which is used to mark the startup

This has some consequences:

  1. There's no longer a need to link in the startup file manually. If you
     have make or command files, you will have to change them.

  2. If you have developed your own startup code, you will need to add
     something like

        .export __STARTUP__ : absolute = 1      ; Mark as startup module

     to it, and link it to the application before the target library.

There may also be problems with some platforms. Since the startup module is no
longer the first module on the linker command line, startup code placement has
to be done in the linker config using segments. I've checked all platforms and
the only one that I think may have problems is the Atari startup. Christian,
can you please check that? There's an executable header with an address that
points to the start of the LOWCODE segment. If this address is the start
address, it will have to be fixed, since with more than one module defining
code in LOWCODE, the startup code may not be at the beginning of LOWCODE. I
would suggest to implement a STARTUP segment as already done for most other

Documentation will get updated in the next few days.

Please let me know if there are any problems! I would also be glad to hear
positive reports about the less used platforms (lynx, supervision, nes, atmos,



Ullrich von Bassewitz                                  uz@musoftware.de
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Jul 31 16:03:35 2009

This archive was generated by hypermail 2.1.8 : 2009-07-31 16:03:37 CEST