Operating System - HP-UX
1753473 Members
4672 Online
108794 Solutions
New Discussion юеВ

Can PA-RISC1.1 library refer to PA-RISC2.0 library at run time

 
SujitB
New Member

Can PA-RISC1.1 library refer to PA-RISC2.0 library at run time

Can PA-RISC1.1 library refer to PA-RISC2.0 library at run time. If not are there any HP-UX documentation references which I can get.
6 REPLIES 6
Laurent Menase
Honored Contributor

Re: Can PA-RISC1.1 library refer to PA-RISC2.0 library at run time

It depends what you are calling PA1.1 and PA2.0 libs.

If you mean a 32 bit lib PA2 and a 32bit PA1, then yes.
If you mean a 64 bit lib PA2 and a 32 bit PA1, no off course.
2 reasons:
- 64 bits calling convention is not exactly the same as 32bits calling conventions
- PA2 64 bit is an elf object PA1.1 is an som object.


Dennis Handly
Acclaimed Contributor

Re: Can PA-RISC1.1 library refer to PA-RISC2.0 library at run time

Of course. The PA32 runtime is upward compatible from PA1.0 to PA2.0, provide you are on PA2.0 hardware.

>Laurent: 64 bits calling convention is not exactly the same as 32bits calling conventions

You forgot the most important thing, there is an extra hardware bit that says whether in 64 or 32 bit mode.
Laurent Menase
Honored Contributor

Re: Can PA-RISC1.1 library refer to PA-RISC2.0 library at run time

Just a precision why I am talking about pa2.0 32 bit code;

even if running a 32 bit os, and having a 32 bit application, it is still possible to use 64 bit register operation. Only memory access need to be 32 bits.

a PA 2.0 32 bit library could have use 64 bit operations. ( LDD, STD .....) and can be linked with a PA 1.0 32 bit library.
rick jones
Honored Contributor

Re: Can PA-RISC1.1 library refer to PA-RISC2.0 library at run time

While I'm not a compiler/assembly expert, it is my understanding that being able to manipulate 64 bit quantities such as integers is independent of the bitsize of pointers. Ie, a 32-bit (pointer size) application can manipulate uint64_t's and whatnot.
there is no rest for the wicked yet the virtuous have no pillows
Dennis Handly
Acclaimed Contributor

Re: Can PA-RISC1.1 library refer to PA-RISC2.0 library at run time

>Rick: a 32-bit application can manipulate uint64_t and whatnot.

I assume Laurent's point is that the hardware can use 64 bit operations instead of 32 bit operations to fiddle with uint64_t.
Laurent Menase
Honored Contributor

Re: Can PA-RISC1.1 library refer to PA-RISC2.0 library at run time

Yes;

long long x,y; /* same as uint_64 */

x=x+y;

with PA1 ( compile with +DS1.0 +DA1.0 with optimisation)
LDW -56[sp],r26
LDW -52[sp],r25
LDW -56[sp],r24
LDW -52[sp],r23
ADD r26,r24,r26
ADD,C r25,r23,r25
STW r26,-56[sp]
STW r25,-52[sp]

with PA2 (compile with +DS2.0 +DA2.0 and optimised can result in)
LDD -56[sp],r26
LDD -56[sp],r24
ADD r26,r24,r26
STD r26,-56[sp]

and such lib can be linked together and executed on a pa20 32 or 64 bit system.

+DA2.0W is used in place of +DA2.0 it is not possible because the first one will generate a elf64 when the second generate a som with 64 bits instructions used