Re: [cc65] Atari relocation format

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-02-05 20:56:22
On Thu, Feb 05, 2009 at 07:10:23AM -0800, Winslow, Dan D (US SSA) wrote:
> The CC65 documentation mentions a .o65 relocation format, and that 'the
> assembler produces relocatable object files'. I don't see any option for
> producing .o65 files, and I was wondering if that format is the same as
> the .o file format.
 
No. The .o files output by the assembler are not the same as the .o65 format.
The latter was developed by Andre Fachat with native relocation in mind. See
here for the specs:

        http://www.6502.org/users/andre/o65/fileformat.html

.o65 files can be generated by the linker ld65.

> Also, if it is not the same format, is there a
> structural description of the .o files available? My goal is to be able
> to use/write a relocating loader ( maybe like mod_load in the library
> sources? )  that will allow me to do run-time relocation of object
> files.

Unlike the o65 format, the internal object file format was never designed to
be handled by a memory contrained 8-bit CPU. The files support anything the
assembler does: Complete expression trees, assertions, segments, some sort of
debug information and so on. In addition, the format has changed over time and
this may happen again. The od65 utility is able to peek into the internals.

My suggestion would be to use the .o65 format. I would even suggest to use
mod_load if possible for your purposes, because it's highly optimized (and
still ~500 Bytes in size). It doesn't have all o65 features, like symbol
relocation, but this would increase code size even more.

Regards


        Uz


-- 
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 Thu Feb 5 20:59:01 2009

This archive was generated by hypermail 2.1.8 : 2009-02-05 20:59:02 CET