Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Jim Paradis <jrp@jrp.tiac.net>
Subject: Re: some questions.
Date: Thu, 17 Apr 1997 22:15:10 -0400	[thread overview]
Message-ID: <cf6467fc392d1f1d82d1cef40870b9b6.axp-list@archive.invalid> (raw)

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

             reply	other threads:[~1997-04-18  2:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-18  2:15 Jim Paradis [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-09-10 19:25 Some Questions Torsten Zirzlaff
1997-04-17 22:06 some questions david l nicol
     [not found] <Pine.A32.3.91.970416195518.18696A-100000@olvera.seas.ucla.edu>
1997-04-17 21:52 ` Richard Henderson
     [not found] <3356D92E.2DFC19BD@jrp.tiac.net>
1997-04-17 17:45 ` jestabro
1997-04-17  3:16 Javier Henderson
     [not found] <33557AE8.73908639@jrp.tiac.net>
1997-04-17  2:59 ` CHIH-HSIANG HENRY YAO
1997-04-17  1:20 Jim Paradis
1997-04-16 20:06 Anthony Pardini
     [not found] <Pine.LNX.3.91.970416144742.30218B-100000@ns2.cmpu.net>
1997-04-16 19:52 ` Ximenes
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox