From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: X-Archive-Original-Message-ID: <199704172121.QAA23283@atheist.tamu.edu> Date: Thu, 17 Apr 1997 22:15:10 -0400 From: Jim Paradis Subject: Re: some questions. Richard Henderson wrote: > > > Since so many codes were written with this assumption, one would assume > > that some body would come up with a C compiler that forces 32bit > > compitablity you know like a compiler flag or something. > > Digital's compiler does this. > > On more cynical days I ask why I should coddle to people just so they > can do the Wrong Thing. In reality it probably wouldn't be terribly > difficult to do with gcc and gld. But no one has yet to do so. Actually you can do this -- sort of -- with the current tools. What the Digital C compiler offers is the "-taso" switch. This stands for "Truncated Address Space Option". The only thing that switch does is instruct ld to load the program in "low" memory (text at 0x20000000 data at 0x40000000, stack below text). Although the compiler still generates 64-bit pointers, because all of the memory addresses fit in 32 bits you can still sling pointers and longs around with relatively wild abandon... This trick doesn't seem to work nearly as well on Linux/Alpha. The equivalent "ld" switches to make this work (-Ttext, -Tdata) seem to be broken... try to use them and you get relocation overflows and/or bfd assertion failures. The only way I've found to make this work is to go into /usr/lib/ldscripts, take a script that works to load the kind of program you're linking (e.g. elf64alpha.x) and change the initial ". =" declaration from 0x120000000 to 0x20000000, give the script a new name, and invoke it using the "-T scriptname" flag to ld (or "-Wl,-Tscriptname" to gcc). I haven't yet figured out how to map ld args to ld scripts, otherwise one could just put modified scripts into that directory and invoke them using linker options... -- Jim Paradis jrp@jrp.tiac.net http://www.tiac.net/users/jrp/index.html "It's not procrastination, it's my new Just-In-Time Workload Management System!" -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com