Operating System - HP-UX
1833882 Members
2220 Online
110063 Solutions
New Discussion

What is statically-linked executable?

 
Rashid Ali
Frequent Advisor

What is statically-linked executable?

I was told that statically-linked executables can simply be migraded over from HP-UX 10.20 to 11 without recompilation but dynamically-linked ones cannot. When I run "file commands", I only see either "s800 shared executable dynamically linked" or "s800 shared executable", May I know whether the latter one( /usr/ccs/lbin/cpp, for example) is statically-linked one?

Thanks,
3 REPLIES 3
Stefan Farrelly
Honored Contributor

Re: What is statically-linked executable?


do a chatr command on /sbin/sh this is a statically linked shell for when the system boots in single user mode and /usr/lib is not available - ie. the libraries are built into the /sbin/sh executable.

Now do the same chatr command on /usr/bin/sh. You will see its much smaller in size and dynamic paths allowed to search for the necessary libraries (SHLIB_PATH etc.)

Thats the difference.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Carlos Ruiz
Occasional Contributor

Re: What is statically-linked executable?

If you don't see "dynamically linked", then it's statically linked.
Rashid Ali
Frequent Advisor

Re: What is statically-linked executable?

Thanks.