I'll handle this, but differently. Specifically I won't go through GOT,
but directly to variable, something like this:
I would like to politely request that you don't go down this road.
.Lretl:
retl
nop
...
sethi %hi(var-.Lpic),%reg
.Lpic: call .Lretl
add %o7,%lo(var-.Lpic),%reg
I honestly think it's easiest to to simply generate correct PIC
sequences, as my macros are trying to do.
Being hit by various problems it became kind of occupational hazard:
assume bare minimum. The rule of thumb forged over years is if it's
possible to rely on generic instruction set and assembler properties,
not specific to some binary format, then it's preferable approach. You
can blame me for it, but it served OpenSSL very well at numerous
occasions and I see no reason to give it up. Naturally unless one has
to. And it seems to be the case here. Because (var-.Lpic) doesn't seem
to work with external variables on SPARC Solaris. Unfortunate...
As for preferred approach mentioned above. I for one have never actually
tested assembly modules on linux-sparc. But it didn't prevent me from
being sure that they work. Because they were sheer code segments, which
is direct result of the conservative approach.
We can add whatever ifdefs and code generation cases we need to
sparc_arch.h The code that I'm emitting is identical to what GCC
generates on Linux and Solaris under Sparc regardless of which
assembler and linker are in use.
Well, vendor compiler doesn't define __PIC__, so macros wouldn't work
there... Let me ponder... It might take time to figure it out (because
of my time constrains), but I'll get there. I'm pretty confident that
you'll be satisfied.
I should know, I wrote much of the sparc GCC backend.
If you describe to me what problems your scheme ran into, I can fix
them up.
The above mentioned rule is a general rule. In SPARC case it was rather
projection of experience with x86, x86_64, ppc on multiple systems
(think mixture of Windows, MacOS X, AIX).
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-dev@openssl.org
Automated List Manager majord...@openssl.org