Re: runtime identification of compiler through executable



i need to use this information in a source file ...
caseyjbrotherton@xxxxxxxxx wrote:
I don' t think there is a way to tell that
a certain compiler has created an executable.

Now, you can tell what an executable has been linked against
by using "dump -H" or ("dump -n" for alot of verbose output
including symbols in libraries that are referenced)

You can also tell what source files have been used for an
executable (If they followed the sccs file format) by using "what"

Hope this helps,
-Casey

steven_nospam at Yahoo! Canada wrote:
shankha wrote:
Is there is any tool on AIX which can tell me by looking at the
executable that what was the complier to make that executable

You can try a couple of things, but I am not sure it will give you
exactly what you are looking for:

The "file" command will tell you if a program is executable, but does
not give you the specifics such as indicating that the exceutable was
written in C or Perl or Korn or whatever.

You could try the "strings" command, which may help. It sometimes list
the compiler at the top, or the libraries used.

For example, the first ten lines of this "kornsample" script shows it
was compiled using a package called Shell-Lock (It is a Korn Shell
script):

# strings kornsample|head
H: Too many args
: No read permission
awk
@(#)shell-lock
1.6.2.2
?BBOF
KTYPPa
+40;3?
9;4/|^|
j^o89&o.)00


In the "csample" program below, you can see a library "threads_init.c"
and its original path. This suggests it was a C source, and the path
may suggest whether Visual Age or some other C compiler was used.

# strings csample |head
@(#)61
1.14 src/bos/usr/ccs/lib/libc/__threads_init.c, libcthrd, bos510
7/11/00 12:04:
14
hea2
bat#
aba2
info
jobs
qmv1
hea3
srch


Hope this helps

Steve

.



Relevant Pages

  • Re: How to set my own program startup in f77 programs other than MAIN__
    ... But we don't have the source file where ... whatever they call it these days) compiler. ... I think the whole approach of stuffing your initializer into a ... "Operation of the Runtime Linker ...
    (comp.lang.fortran)
  • Re: compiling multiple source files and static functions
    ... The compiler `gcc' won't compile them and spit's errors ... > undefined reference to `cmpr' ... There can't be any options to gcc (or any other correctly working ... in the source file they are defined in). ...
    (comp.unix.programmer)
  • Re: Getting source file from the object file
    ... is the output of a particular compiler whose output is a deterministic ... some source file which when compiled by that compiler ... machine code, and include the machine code as a static array. ...
    (comp.lang.c)
  • Re: Getting source file from the object file
    ... is the output of a particular compiler whose output is a deterministic ... some source file which when compiled by that compiler ... machine code, and include the machine code as a static array. ...
    (comp.lang.c)
  • Re: changing argument types for four functions
    ... | F77 compiler but I am also porting to Intel Visual Fortran compiler. ... That will work only in character/anything mismatches ... in effect one source file of 550,000 lines). ... If you put a MODULE x/END MODULE x around ...
    (comp.lang.fortran)