g++ compilations without collect on your sys5 system

Michael Bloom mb at ttidca.TTI.COM
Mon Sep 10 14:16:03 AEST 1990


I am very close to releasing a new version of the patches to gas and gdb for
COFF systems.

Included in the new patch set will be a loader directive file that (together
with changes to gas/coff-conv.c and g++/gnulib3.c) eliminates the need to
use collect when linking g++ programs. 

One of the people who has tested a pre-release version sent me changes to
this new file ("g++.ifile") for his 386/IX system.

His patch changed the data mapping boundary from next(0x10000) to
next(0x400000).  The former worked on my system; the latter was the
minimum needed on his system. On my system this constant was defined
as NBPS in <sys/param.h>, but there was no corresponding definition on
his system.

I'd like to ask people who are using other coff systems to let me know what
values are needed on their system, and where such values might be defined
in their system headers, if such a definition exists.  When you write, please
also tell me the name of a preprocessor symbol that is unique to your system. 

Ideally, I'd like to put together a program to automatically generate
g++.ifile, so that users do not have to experiment with getting the values
right if they are not already right. 

I'm attaching a copy of the loader directive file from my g++ library 
directory.  I'd be curious to know if there are any other changes that
might be needed for your system.

/*
 *	BLOCK to an offset that leaves room for many headers ( the value
 *	here allows for a file header, an outheader, and up to 11 section 
 * 	headers on most systems.
 *	BIND to an address that excludes page 0 from being mapped. The value
 *	used for BLOCK should be or'd into this value. Here I'm setting BLOCK
 *	to 0x200 and BIND to ( 0x400000 | value_used_for(BLOCK) )
 *	If you are using shared libraries, watch that you don't overlap the
 *      address ranges assigned for shared libs.
 *
 *	GROUP BIND to a location in the next segment.  Here, the only value
 *	that you should change (I think) is that within NEXT, which I've set
 *	to my hardware segment size. You can always use a larger size, but not
 *	a smaller one.  I am presently using 0x10000, but jjc at jclark.uucp
 *	reports that the minimum value that works on a 386/IX system is
 *	0x400000.
 *	
 *	Note the items marked "placeholder for count". These will be filled in
 *	within gnulib3.
 */
SECTIONS
{
	.text BIND(0x400200) BLOCK (0x200) :
	{
		 /* plenty for room for headers */
		*(.init)
		*(.text)
		vfork = fork; /* I got tired of editing peoples sloppy code */
		*(.fini)
	}
	GROUP BIND( NEXT(0x10000) + ADDR(.text) + SIZEOF(.text)):
	{
			.data : {
				__CTOR_LIST__ = . ; 
				. += 4; 	/* placeholder for count*/
				*(.ctor) 
				__CTOR_LEN__ = (. - (__CTOR_LIST__ + 4 )) / 4 ;
				. += 4 ;	/* trailing NULL */
				__DTOR_LIST__ = . ;
				. += 4; 	/* placeholder for count*/
				*(.dtor) 
				__DTOR_LEN__ = ( . - (__DTOR_LIST__ + 4 ) )/4 ;
				. += 4 ; 	/* trailing NULL */
			 }
			.bss : { }
	}
}



More information about the Comp.sys.att mailing list