From: mogul@pa.dec.com (Jeffrey Mogul)
Subject: a little more about -xtaso and -taso in Digital UNIX
Date: 1995/12/16 [thread overview]
Message-ID: <4at731$17e@usenet.pa.dec.com> (raw)
In-Reply-To: danpop.818990982@rscernix
In article <danpop.818990982@rscernix> danpop@mail.cern.ch (Dan Pop) writes:
>Second, the way -xtaso works. Your pointers are still 64-bit, but the
>most significant 32 bits are zero. This can be easily proved:
>
> ues5:~/tmp 76> cat test.c
> #include <stdio.h>
> main(int argc, char **argv)
> {
> char *p;
> printf("%ld\n", (long)sizeof p);
> return 0;
> }
> ues5:~/tmp 77> cc -xtaso test.c
> ues5:~/tmp 78> ./a.out
> 8
Actually, this is still a little confused.
There are two different kinds of flags:
-taso tells the *linker* to load the program in a 32-bit
address space (i.e., all program addresses have
the upper 32 bits zero).
-xtaso tells the *compiler* to pay attention to the
#pragma pointer_size directives
Here's another example program (dan.c):
#include <stdio.h>
main(int argc, char **argv)
{
char *p = "Hello WRL";
printf("%ld %p\n", (long)sizeof p, p);
return 0;
}
and here is the result of compiling it several ways.
% cc dan.c
% a.out
8 140000010
% cc -xtaso dan.c
% a.out
8 140000010
Note: -xtaso has NO effect on the most significant bits of the pointer.
That address has 9 hex digits
% cc -taso dan.c
% a.out
8 14000010
Aha. Now we have only 8 hex digits in the address.
Obviously, if you are compiling a module with -xtaso (and using
#pragma pointer_size (short) anywhere) you must link the program
using -taso, or the results will be unpleasant.
>The easiest way to get 32-bit pointers is to use -xtaso_short instead:
A little too easy. I would advise never using -xtaso_short, since
unless you are not #including any header files, it's likely to cause
trouble. Use -xtaso and #pragma pointer_size.
-Jeff
next prev parent reply other threads:[~1995-12-16 5:00 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-12-06 5:00 ALPHA SLOWER THAN PENTIUM !!!! Emiliano Stesinach
1995-12-07 5:00 ` Javier Henderson
1995-12-08 5:00 ` michael
1995-12-07 5:00 ` Ron Fox
1995-12-07 5:00 ` Andrew Armstrong
1995-12-08 5:00 ` Yan-Song Chen
1995-12-09 5:00 ` Thumper!
1995-12-11 5:00 ` Dan Pop
1995-12-11 5:00 ` Robin.Fairbairns
1995-12-12 5:00 ` Michael Brodeur
1995-12-13 5:00 ` Dan Pop
1995-12-12 5:00 ` Dirk Grunwald
1995-12-13 5:00 ` Dan Pop
1995-12-13 5:00 ` Ron Natalie
1995-12-14 5:00 ` Dan Pop
1995-12-14 5:00 ` Ron Natalie
[not found] ` <danpop.819045506@rscernix>
1995-12-15 5:00 ` Ron Natalie
1995-12-16 5:00 ` Larry Kilgallen
1995-12-17 5:00 ` Dave Cherkus
1995-12-12 5:00 ` Richard Ingram
1995-12-13 5:00 ` Mike Weber
1995-12-13 5:00 ` Dirk Grunwald
1995-12-14 5:00 ` Ron Natalie
1995-12-15 5:00 ` Dan Pop
1995-12-16 5:00 ` Jeffrey Mogul [this message]
1995-12-22 5:00 ` Alan H. Martin
1995-12-13 5:00 ` Dirk Grunwald
1995-12-14 5:00 ` Dan Pop
1995-12-14 5:00 ` Joseph Vigneau
1995-12-14 5:00 ` Ron Natalie
1995-12-14 5:00 ` Gromit
1995-12-13 5:00 ` Mike Weber
1995-12-14 5:00 ` Dirk Grunwald
1995-12-14 5:00 ` David Mosberger-Tang
1995-12-15 5:00 ` Dirk Grunwald
1995-12-07 5:00 ` Dan Pop
1995-12-07 5:00 ` Gromit
1995-12-08 5:00 ` John Hascall
1995-12-07 5:00 ` Rob Young
1995-12-07 5:00 ` Yan-Song Chen
1995-12-08 5:00 ` Yan-Song Chen
1995-12-12 5:00 ` dave pierson
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