[pups] Maximum PDP-11 executable size?

Steven M. Schultz sms at moe.2bsd.com
Fri Apr 20 14:49:59 AEST 2001


> From: Edward Brocklesby <ejb at leguin.org.uk>
> The problem appears to be `libmh.a', which alone has 30K text + 22K data + 
> 24K bss (77444 total).  Any way around this? I've tried all the combinations 
> i can think of, to no avail..

	I think this would be a very good time to point out that 'data' is
	NOT overlaid, only the text is overlaid.   There is but 1 data segment
	and all data+bss goes into it.

	Text overlays work because there's a very careful dance done by the
	assembler and linker.   Functions use a 'thunk' (intermediate
	transfer vector) - thus when a program calls foo() it is really
	calling something like ~foo().  That thunk performs part of the 
	function prolog and then checks if the overlay mapping needs to changeoa	and if so makes a syscall to have the kernel twiddle the MMU.  Then
	the thunk calls foo+4 (skipping the part of the function prolog that
	has already been done).   Very elegant but completely unapplicable
	to data references (think on it - how is each and every pointer
	dereference to be checked to see if that data is mapped in?).
	
	In order to get the code to fit it would be necessary to extract
	all of the .o files from the .a file ("ar x libmh.a") and
	pack the .o files into overlays so they fit nicely.

> > 	One thing that can be done is to run 'xstr' over the sources and
> 
> hmm... a lot of work just to get MH working.

	Getting 32bit programs (and MH was done on a VAX or PDP10 (which is
	actually a 36 bit machine ;)) to run on a 16 bit machine is a lot of
	work.

	Since MH was written with a large address space in mind it will likely
	be necessary to go thru the code and find the "#define BUFSIZE 32000"
	or whatever and scale things back.   The odds are good that many 
	buffers are declared to be large just because it didn't matter on
	a big address space machine.   That's what had to be done for 'vi',
	'sendmail', 'kermit', etc.

> > 	"size libmh.a" will give a much better idea where the problem areas
> > 	are.
> 
> unfortunately, size doesn't appear to work on archive libraries.

	Oh.  Darn, I got my systems mixed up.  On some systems 'size' will
	work on .a files - something to put on the TODO pile (shouldn't be
	too hard since 'nm' works with .a files).

	Steven Schultz
	sms at moe.2bsd.com

Received: (from major at localhost)
	by minnie.cs.adfa.edu.au (8.9.3/8.9.3) id PAA58368
	for pups-liszt; Fri, 20 Apr 2001 15:35:23 +1000 (EST)
	(envelope-from owner-pups at minnie.cs.adfa.edu.au)


More information about the TUHS mailing list