cancel
Showing results for 
Search instead for 
Did you mean: 

link time

SOLVED
Go to solution
Gio4Rdb
Occasional Visitor

link time

Hello everybody,

there is way to know when an executable file was compiled and linked?

ciao
GIovanni
8 REPLIES
Roberto Arias
Valued Contributor

Re: link time

hello Gio:

you can use chatr commnad. for example:

#chatr /usr/bin/ll
/usr/bin/ll:
32-bit ELF executable
shared library dynamic path search:
LD_LIBRARY_PATH disabled first
SHLIB_PATH disabled second
embedded path enabled third Not Defined
shared library list:
libxcurses.so.1
libc.so.1
shared library binding:
deferred
global hash table disabled
global hash table size 1103
shared library mapped private disabled
mem_check value disabled
shared library segment merging disabled
shared vtable support disabled
explicit unloading disabled
linkage table protection disabled
segments:
index type address flags size
7 text 04000000 z---c- D (default)
8 data 40000000 ---m-- D (default)
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation for dynamic segments disabled
nulptr dereferences trap disabled
address space model: default
caliper dynamic instrumentation disabled
The man is your friend
Gio4Rdb
Occasional Visitor

Re: link time

Hello Roberto,

unless I'm missing sometingh from your post...

I cannot see when /usr/bin/ll have been compiled nor linked

ciao
GIovanni
OldSchool
Honored Contributor

Re: link time

I believe Roberto interpreted your request about "link time" to refer to static -vs- dynamic linking.

If you are referring to the time the actual compile / link steps were performed to generate the executable, I don't believe that information is tracked anywhere within the executable. The nearest would be the various access / modification times of the file itself, which are probably not going to be sufficient.
Binu George
Advisor

Re: link time

On PA-RISC, you can use
'odump -compunit '

This will give you the list of all source files that were used to compile the executable, along with the compile and source time for each of the source files.

I noticed that though this works for some executables (like perl), it didn't work for many others (like ls).

--Binu
Dennis Handly
Acclaimed Contributor

Re: link time

>Binu: On PA-RISC, 'odump -compunit '

This is for PA32, compile times only.
For link time, you need to add "-aux" and look for the latest:
Auxiliary Header Record (Linker) for hiii:
product_id = 92453-07B version_id = 11.53
when_linked = Mon Nov 03 2008 22:29:59.000000000 PST

For PA64 and ELF you can use "elfdump -dl". -dl for linker only, -dc for compile, -d for both.

You can also use footprints(1):
Compiler footprint summary
Number of compilation units: 3
Earliest compiler timestamp: 10-Jun-2008 17:51 UTC
Latest compiler timestamp: 04-Nov-2008 06:29 UTC
Linker timestamp: 04-Nov-2008 06:29 UTC
...

>it didn't work for many others (like ls).

Those were stripped.
ranganath ramachandra
Esteemed Contributor
Solution

Re: link time

with the latest linker/loader patches installed, you can use /usr/ccs/bin/footprints (same command for PA32 and ELF).

partial output example:
--------------------------------------------------------------------------
$ uname -a
HP-UX hpux B.11.23 U ia64 3450348729 unlimited-user license

$ footprints /usr/bin/ls
Scanning /usr/bin/ls ...
Compiler footprint summary

Number of compilation units: 2

Earliest compiler timestamp: N/A
Latest compiler timestamp: N/A
Linker timestamp: 25-Aug-2004 05:01 UTC

Total size: 45.1K (text) 5.1K (data)

version [(na)/ANSI C 2]
architecture [ipf32 2]
-O [02 2]
(etc)
--------------------------------------------------------------------------
Gio4Rdb
Occasional Visitor

Re: link time


thank you all for yours usefull hints.

ciao
GIovanni
Dennis Handly
Acclaimed Contributor

Re: link time

>thank you all for yours useful hints.

If our answers were helpful, please read the following about assigning points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33