Re: A89: About saving integers in C.


[Prev][Next][Index][Thread]

Re: A89: About saving integers in C.




On Wed, Sep 13, 2000 at 08:43:08AM +0200, Olle Hedman wrote:
> 
> From: <JHill8075@aol.com>
> > You MUST initialize all static variables.
> 
> I wonder when Xavier will fix that stupid bug... quite annoying some times.

Or use another linker ... mine for example!  :D

It doesn't have this stupid bug, but it is not fully compatible with TIGCC
(see below) and it can only generate "nostub" programs.

The incompatibility is the "jmp _main" (or whatever) kludge in `nostub.h'.
This (very ugly hack, IMHO -- but I know it's the only way) is not needed
with my linker, instead a "real" entry point is required. You (usually) must
link C programs with a "stub":

	xdef	__main
	xref	_main
	section "stub",code
__main
	bra	_main	; 16 bit relocation saves 6 bytes!
	end

The stub must be linked with the program and `-e=__main' must be used to
tell the linker that the entry point is `__main' and not `_main' (the
default). The linker will always put the entry point at offset 0 in the
output image, and give an error message if it can't. (In future versions,
this "jump stub" might be generated automatically if necessary.)

Other features include .89z, .9xz, .raw and .hex output file formats, 16 bit
relocations (calculated at link time => no relocation data -- if only TIGCC
could understand this!), optional removal of the annoying aligning NOP in
AmigaDOS text sections (saves two bytes! wow! :) ) and optional removal of
unused sections (can be used to implement crude library support).

The flags -k and -p (for kernel and prosit images, respectively) "works",
but the they have no "image creation" functions -- an error message will be
given when the linker tries to put the sections together into a program
image.

Anyway, if you're interested you can get it at
http://m101.ryd.student.liu.se/mlink.exe


/Johan  "Knowledge is an illusion without answers."



References: