Re: object code from which compiler



ajm wrote:
Hi All,

given an object file is there any way (or tool) to determine which
compiler created it ?

The format of the object file may be different for each implementation or platform. Some do record the compiler name, some don't. One of my object files has the following string embedded, which I extracted with the "strings" and "grep" commands.


$ strings RGBColour.obj | grep compiler
@-compiler:"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\c2.dll"


Just determining the file format may help. Try the "file" command.

$ file devcpp/main.o
devcpp/main.o: 80386 COFF executable not stripped - version 30821

$ file linux2/main.o
linux2/main.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped


$ file vsnet/main.obj
vsnet/main.obj: data

It recognised the Windows and Linux object files produced by GCC, but unfortunately it didn't recognise the VS.NET object file.

--
Simon.
.



Relevant Pages

  • Re: How to compile g95 and get 64-bit executable (Question reformulated)
    ... > and this compiler generates also some 32-bit executable (after I ... a 32 bit ELF executable just specifies the object file ... no matter what the platform or the object file format. ...
    (comp.lang.fortran)
  • Re: namespaces and main()
    ... would make the compiler read type information for OtherClass ... >>object file formats used to communicate between compiler and linker ... what does "full static type inf." ... of the AST for the current translation unit, ...
    (comp.lang.cpp)
  • Re: External RAMdisk
    ... battery backed RAM disk. ... I goosed the KayPro II up to 5 MHz, ... People used to tell me that this wasn't much of a test, because all I was measuring was the overhead time of the compiler and other tools. ... To put things in perspective, running this on a VAX 11/780, with BSD Unix, took 20 seconds, and generated a 20k object file. ...
    (comp.os.cpm)
  • Re: What a translation unit is.
    ... >>So therefore it only makes sense to me that the most usefull translation ... > But let's keep assuming the traditional compiler system. ... >>something inbetween states of tranlation then the object file is most ... >>The source file is a unit to be translated. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Help! simple compile question
    ... That would depend on what compiler you use, ... sub1 calls sub2 and sub3. ... and sub3 to end up in the same object file. ... the compiled result from multiple source files in a single file, ...
    (comp.lang.fortran)