Operating System - HP-UX
1830933 Members
1952 Online
110017 Solutions
New Discussion

Re: How can I know if an executable is of 32 or 64 bits ?

 
SOLVED
Go to solution
Manuel Plaza
Regular Advisor

How can I know if an executable is of 32 or 64 bits ?

Hi all,

How can I know if an executable is of 32 or 64 bits ?

Thanks
7 REPLIES 7
Robert-Jan Goossens
Honored Contributor

Re: How can I know if an executable is of 32 or 64 bits ?

Hi,

You can use the file command,

# file /usr/local/bin/lsof
lsof: ELF-64 executable object file - PA-RISC 2.0 (LP64)

Regards,
Robert-Jan
Sanjay Kumar Suri
Honored Contributor
Solution

Re: How can I know if an executable is of 32 or 64 bits ?

Check following links:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=15503
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=210966

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Naveej.K.A
Honored Contributor

Re: How can I know if an executable is of 32 or 64 bits ?

file is the command which is used to determine the file type.

man file for more details

with best wishes
naveej
practice makes a man perfect!!!
Robert Binkhorst
Trusted Contributor

Re: How can I know if an executable is of 32 or 64 bits ?

Hi,

Merijn has a good page online, with a FAQ that includes this question. Find it here:
https://www.beepz.com/personal/merijn/#FAQ

From the page:
#
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 >

linux: the choice of a GNU generation
Manuel Plaza
Regular Advisor

Re: How can I know if an executable is of 32 or 64 bits ?

Hi,

file only indicate PA-RISC1.1 or PA-RISC2.0
Is it equivalent to 32 or 64 bits ?

Thanks
Fabio Ettore
Honored Contributor

Re: How can I know if an executable is of 32 or 64 bits ?

Hi,

link by Sanjay Kumar will clear your doubts.
Anyway yes, PA-RISC 1.1 means that it is 32 bit and PA-RISC 2.0 means that it is 64 bit.

Best regards,
Ettore
WISH? IMPROVEMENT!
Robert-Jan Goossens
Honored Contributor

Re: How can I know if an executable is of 32 or 64 bits ?

Hi again,

The file command returns if a executable is 64 bits. In case of a PA-RISC 1.1 it can not be a 64 bits because there wa no 64 bits version for 1.1. PA-RISC 2.0 has both options 32 and 64 bits.

Below you can see both, lsof is 64 bits compiled on PA-RISC 2.0, tusc is a 32 bits compiled on PA-RISC 1.1, both run great on my server 11.0 64 bits.

:/usr/local/bin# file lsof
lsof: ELF-64 executable object file - PA-RISC 2.0 (LP64)
:/usr/local/bin# file tusc
tusc: PA-RISC1.1 shared executable dynamically linked

Robert-Jan