
01-05-2008, 10:46 AM
|
| |
Re: runtime identification of compiler through executable i need to use this information in a source file ... caseyjbrotherton@gmail.com 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 |