Subject: Re: Precompiled vax packages anyone?
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Johnny Billquist <bqt@Update.UU.SE>
List: port-vax
Date: 02/22/1998 11:32:07
> >> Interesting... Unless my memory totally fails me, the VAX very much
> >> works the same way as the PDP-11, on which you really had to get
> >> explicit to avoid getting PIC code.
> 
> It's not the least bit difficult to generate non-PIC code, from the
> compiler author's point of view:
> 
> 	static char buf[1024];
> 	...
> 	 buf[i] = '@';
> 
> 		.data
> 	_buf:	.space	1024
> 		.text
> 	...i in r0...
> 		movb	$64,_buf(r0)
> 
> Indeed, in kernel code and similar places where some addresses need to
> be relocated and some don't, the difference between
> 
> 		movl	foo,r0
> and
> 		movl	@$foo,r0
> 
> is critical.  If foo is relocated, the first is PIC and the second
> isn't; if foo is absolute (not relocated), the second is PIC and the
> first isn't.

Oh, I'm aware that some addresses are absolute, but those should be
expressed in a way that makes the absolute too. The compiler should be
able to deduce that pretty simply. And adding @$ to every addressing is
what I'd call going out of the way. :-)

	Johnny

Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt@update.uu.se           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol