Operating System - HP-UX
1833296 Members
3238 Online
110051 Solutions
New Discussion

Re: ELF-64 binaries execution problem

 
Alekseev Roman
Occasional Contributor

ELF-64 binaries execution problem

Hello there.

On a A-400 system with a Hp-UX 11.00 and a kernel running in a 64b mode -

#file /stand/vmunix
/stand/vmunix: ELF-64 executable object file - PA-RISC 2.0 (LP64)

when i am trying to execute any ELF-64 binaries, like -

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

i am geting a such message:

#/oracle/bin/oracle
/oracle/bin/oracle: Exec format error. Binary file not executable.

What have i do to run it? Any PA 1.1 executables are running ok ...
7 REPLIES 7
Ceesjan van Hattum
Esteemed Contributor

Re: ELF-64 binaries execution problem

Hi Alekseev

The output of 'file' might say that your file is a "ELF-64 executable object file", but what about the permission settings? Is it r-xr-xr-x ? And is the ownership correct (like oracle:oracle ?).
Try chmod -R a+x /oracle/bin/*

Hopefully this answer is not too trivial..

Regards,
Ceesjan
Hartmut Lang
Trusted Contributor

Re: ELF-64 binaries execution problem

You can use "chatr " to check the binaries attributes.

Hartmut
H.Merijn Brand (procura
Honored Contributor

Re: ELF-64 binaries execution problem

CeesJan, that answer is wrong. sorry. Exec format error tells us that the file is readable and executable - technically - but doesn't fit in the current architecture.

Please check that the kernel is /indeed/ capable of running this file format, and check that your CPU is:

l1:/pro/3gl/CPAN/perl-current/hints 104 > getconf CPU_VERSION
532
l1:/pro/3gl/CPAN/perl-current/hints 105 > getconf KERNEL_BITS
64
l1:/pro/3gl/CPAN/perl-current/hints 106 >

decimal 532 = 0x214

l1:/pro/3gl/CPAN/perl-current/hints 109 > grep e\ CPU_ /usr/include/sys/unistd.h
# define CPU_HP_MC68020 0x20C /* Motorola MC68020 */
# define CPU_HP_MC68030 0x20D /* Motorola MC68030 */
# define CPU_HP_MC68040 0x20E /* Motorola MC68040 */
# define CPU_PA_RISC1_0 0x20B /* HP PA-RISC1.0 */
# define CPU_PA_RISC1_1 0x210 /* HP PA-RISC1.1 */
# define CPU_PA_RISC1_2 0x211 /* HP PA-RISC1.2 */
# define CPU_PA_RISC2_0 0x214 /* HP PA-RISC2.0 */
# define CPU_PA_RISC_MAX 0x2FF /* Maximum value for HP PA-RISC systems */
# define CPU_IS_PA_RISC(__x) # define CPU_IS_HP_MC68K(__x) l1:/pro/3gl/CPAN/perl-current/hints 110 >

Ergo, my system is a PA_RISC2_0 architecture with a 64bit kernel

GNU utils use config.guess for this, which should return

hppa-2.0w-hp-hpux11.00

or, in ELF64 mode

hppa64-hp-hpux11.00

HTH
Enjoy, Have FUN! H.Merijn
MTSU_SAN
Regular Advisor

Re: ELF-64 binaries execution problem

I also have HP-UX 11.0 running on Vclass system, but file output of file that won't run is:
frank:[/usr/local4/crsp/accbin] # file stk_print
stk_print: ELF-64 executable object file

and I just get a simple
frank:[/usr/local4/crsp/accbin] # ./stk_print
sh: ./stk_print: Execute permission denied.

message when trying to run. Permissions are:
-r-xr-xr-x 1 eventus sys 882720 Oct 27 18:25 stk_print

How exactly do I tell if my kernel and operating system can run this file, or how to I convert it? I've got the same getconf output as noted.
H.Merijn Brand (procura
Honored Contributor

Re: ELF-64 binaries execution problem

Jerry, do a 'chattr' on that file and see what shared libraries it requires. I bet one of those is r-x------ or at least not readable to the process

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
MTSU_SAN
Regular Advisor

Re: ELF-64 binaries execution problem

OK, I did the chatr, and it shows library dependencies of libm.so.1 and libc.so.1. What is this supposed to be? Are they shared libraries? Does anyone know what the HP equivalents might be, or is it hopeless?
ranganath ramachandra
Esteemed Contributor

Re: ELF-64 binaries execution problem

jerry,

from the names of the libraries you mention, the executable seems to be an IA binary. you can not run that binary on a PA system. note that the 'file' command did not say stk_print is a PA binary, it just said stk_print is an ELF file.

libraries in IA hpux are named with the extension .so*. the PA equivalents are libc.sl and libm.sl etc. the PA libraries will be in /usr/lib (32-bit) and /usr/lib/pa20_64/ (64-bit) on both PA and IA systems. the IA libraries will be in /usr/lib/hpux32 and /usr/lib/hpux64 - of course only on IA systems.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo