HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 72 (of 101)
Chapter 11 Software Development
October 29, 2013
Problems Starting A Program
There are a few reasons why a shell cannot execute a program. The most obvious is that the
program file has no execute permission. The different shells then give a self-explaining message.
Another reason is that the file has an incorrect magic number. The magic number determines the
type of a file, and the system can tell by the magic number if the file contains executable code or
not.
ksh: ./a.out: Executable file incompatible with hardware
sh: a.out: Execute permission denied.
bash: ./a.out: Invalid argument
a.out: Executable file incompatible with hardware.
These errors are printed by the various shells when trying to execute a PA2.0 executable on a
PA1.1 system. As we can see the messages are not always clear about the reason.
If you get such an error message, and you verified the file permissions are correct, then also
check its file type with the file(1) command, and compare it with the CPU type of the system:
$ file a.out
a.out: PA-RISC2.0 shared executable dynamically linked -not
stripped
$ model
9000/778/B132L+
$ grep B132L /usr/sam/lib/mo/sched.models
B132L 1.1e PA7300
Here we have a PA2.0 executable, but an old PA1.1 system which cannot execute PA2.0
programs.
Another reason for denying execute permission is bad attributes set with chatr(1), e.g.
SHMEM_MAGIC executables that have q3p or q4p enabled, or other executables that have q4p but
not q3p enabled. In such a case, check and change the quadrant usage with chatr(1). Make sure
the quadrants used for private data are contiguous, ie. Q1+Q2+Q3, but not Q1+Q3+Q4. For
details check the section Beyond The Limits.
Error Messages From The Dynamic Loader
When errors are reported by dld.sl/.so, the program could be started, but a problem occurred
while loading libraries or resolving symbols. The dynamic loader will print an appropriate