Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!yetti!geac!daveb From: daveb@geac.UUCP (Brown) Newsgroups: comp.arch Subject: Re: Big Programs Hurt Performance Message-ID: <1502@geac.UUCP> Date: Tue, 29-Sep-87 13:51:27 EDT Article-I.D.: geac.1502 Posted: Tue Sep 29 13:51:27 1987 Date-Received: Wed, 30-Sep-87 03:20:28 EDT References: <417@devvax.JPL.NASA.GOV> <12780006@acf4.UUCP> <2614@aw.sei.cmu.edu> <275@xyzzy.UUCP> Reply-To: daveb@geac.UUCP (Dave Collier-Brown) Organization: The little blue rock next to that twinkly star. Lines: 38 In article <275@xyzzy.UUCP> meissner@nightmare.UUCP (Michael Meissner) writes: >One of the things that is hard about position independent code is dealing >with the initialization of pointers to static/extern data items, which is >typically done at link time. You have to have some way of getting the >right value into the pointer before it is used. Well, you delay some portion of linking 'til run-time. If we assume that externs are in the data segment, you link with a unique segment number which at run-time turns out to mean "pages 23-29" to your paging hardware. The hard part is figuring out the data structures to pass to the program loader (and to generate in the linker) so that gets done cleanly and in finite time. Multics used a very simple scheme: an address had a segment number (no, not the same as IBM-PC segments) and an offset. When an address was evaluated, the segment number was used as an index into an on-board translate table which yielded a page address, and if it wasn't there a page fault occurred. +-----+--------+ | seg | offset | -------> address in page/page-sequence +-----+--------+ \ --------------------> index into page-tables If you can define how your address get interpreted, (ie, you're a machine designer) you can set this up and migrate your customer base to it via having a new linker, loader and "magic number" for the new executables. They won't run on *old* machines, of course... --daveb ps: this *is* idealized, you understand. -- David Collier-Brown. {mnetor|yetti|utgpu}!geac!daveb Geac Computers International Inc., | Computer Science loses its 350 Steelcase Road,Markham, Ontario, | memory (if not its mind) CANADA, L3R 1B3 (416) 475-0525 x3279 | every 6 months.