1826457 Members
4555 Online
109692 Solutions
New Discussion

32bit or 64bit

 
SOLVED
Go to solution
YLTan
Frequent Advisor

32bit or 64bit


Is there such a command in HPUX11.11 that can be use to check if a executable file is compiled in 32bit or 64bit??

tyl
6 REPLIES 6
twang
Honored Contributor

Re: 32bit or 64bit

Try this command:
# getconf KERNEL_BITS
K.Vijayaragavan.
Respected Contributor

Re: 32bit or 64bit

file
"Let us fine tune our knowledge together"
T G Manikandan
Honored Contributor

Re: 32bit or 64bit

Just do a
#file

32bit --->
PA-RISC1.1 shared executable dynamically linked
64 bit --->
ELF-64 shared object file - PA-RISC 2.0 (LP64)

Other way would be using
#chatr
schneider_15
Advisor

Re: 32bit or 64bit

Hi

to know if a binary is 32 ou 64 bits use

file binary

if you got PA-RISC1.1 executable it is a 32 bits, if you got ELF-64 executable object file then ...

To know if the hardware support 32 or 64 bits use

getconf HW_CPU_SUPP_BITS

regards
Michael Tully
Honored Contributor

Re: 32bit or 64bit


e.g.
# file /usr/sbin/pvdisplay

Returns with PA-RISC 1.x are 32 bit
Returns with PA-RISC 2.x are 64 bit

The usage of 'getconf kernel_bits' tells you th running kernel. You can't run anything that is 64 bit on a 32 bit kernel.

Anyone for a Mutiny ?
H.Merijn Brand (procura
Honored Contributor
Solution

Re: 32bit or 64bit

https://www.beepz.com/personal/merijn/#FAQ or http://www.cmve.net/~merijn/#FAQ


Does my system support 64bit builds

You can find out if your kernel supports 64bit binaries by issuing:

a5:/usr/local 110 > file /stand/vmunix
/stand/vmunix: ELF-64 executable object file - PA-RISC 2.0 (LP64)
a5:/usr/local 111 > getconf KERNEL_BITS
64
a5:/usr/local 112 > getconf HW_32_64_CAPABLE
1
a5:/usr/local 113 >

HP-UX 10.20 does not support 64bit objects
How can I see if my program is a 64bit object?

a5:/usr/local 108 > file pa*/bin/gcc
pa11_32/bin/gcc: PA-RISC1.1 shared executable dynamically linked -not stripped
pa20_32/bin/gcc: PA-RISC2.0 shared executable dynamically linked -not stripped
pa20_64/bin/gcc: ELF-64 executable object file - PA-RISC 2.0 (LP64)
a5:/usr/local 109 >
How can I see how my binary was compiled?

Provided your binary isn't stripped, and it is 32bit SOM that info should be reveiled with odump -compunit

Provided your binary isn't stripped, and it is 64bit ELF (LP64) that info should be reveiled with elfdump -dc

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn