Operating System - HP-UX
1821245 Members
2694 Online
109632 Solutions
New Discussion юеВ

Command to tell if exec is 32-bit or 64-bit

 
SOLVED
Go to solution
John M. Robinson_1
Occasional Advisor

Command to tell if exec is 32-bit or 64-bit

Is there a way of telling if a particular exec is 32-bir or 64-bit?
If you don't ask, the answer is NO.
3 REPLIES 3
Mark Grant
Honored Contributor
Solution

Re: Command to tell if exec is 32-bit or 64-bit

the "file" command will report

ELF-64 executable object file - PA-RISC 2.0 or similar for 64 bit and PA-RISC1.1 or similar for 32 bit.



Never preceed any demonstration with anything more predictive than "watch this"
RAC_1
Honored Contributor

Re: Command to tell if exec is 32-bit or 64-bit

file "file_name"
chatr "file_name"

Anil
There is no substitute to HARDWORK
H.Merijn Brand (procura
Honored Contributor

Re: Command to tell if exec is 32-bit or 64-bit

This is a FAQ, and as such noted in the FAQ section of my site, which states about 32/64 it issues:

--8<---
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
Do I need 64bit gcc?

You only need 64bit gcc if you have to build 64bit binaries. gcc/64 cannot build 32bit binaries, so if you need both, you need two versions/builds of gcc
Do I need a 64bit build of perl?

In general, no. You only need a 64bit build of perl when you have to link to 64bit objects/libraries of other applications, such as Oracle. 32bit build Oracle does not play nice with 64bit build of perl or the other way round.
-->8---

My HP ITRC site pages can be found at

Singapore https://www.beepz.com/personal/merijn/
Rotterdam http://www.cmve.net/~merijn/
Seattle http://www.hpux.ws/merijn/

Enjoy, Have FUN! H.Merijn [ Who thinks that searching ITRC Forum should be better known and be more propagated ]
Enjoy, Have FUN! H.Merijn