none
strange release COFF format RRS feed

  • Question

  • Hi,

    i am creating a linker which use COFF obj files as input to create custom executable files for an other platform. I am using visual c++ compiler (using standard VC projects file but I replaced the "link" target to use my linker instead) to generate .obj files. I followed the official COFF specification to read obj files, and everything is working fine, except output files generated during release configuration are completely incompatibles. The header seems to contain a GUID, and others unknown fields. Then all sections names seems to be "cil$". VC++ linker understand this format because it release working executables, but theses sections doesn't figure in the COFF specification so what is the point of all this?

    thanks


    • Edited by Potatos Wednesday, November 21, 2012 4:59 PM
    • Moved by Ego Jiang Thursday, November 22, 2012 9:09 AM it is a c++ issue (From:Visual Studio Extensibility)
    Wednesday, November 21, 2012 3:12 PM

Answers

  • "except output files generated during release configuration are completely incompatibles"..."Then all sections names seems to be "cil$"."

    Your project is likely set to use "Link Time Code Generation" in the release build, in that case .obj files produced by the VC++ compiler do not contain native x86/x64 code. They contain intermediate code that's supposed to be used by the VC++ compiler backend to generated native code at link time.

    • Marked as answer by Potatos Thursday, November 22, 2012 7:17 PM
    Thursday, November 22, 2012 9:47 AM
    Moderator

All replies

  • Hi,

    I am moving this thread to C++ forum for better help.

    Thank you for your understanding and support.
     
    Best regards,


    Ego [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, November 22, 2012 9:08 AM
  • Hi,

    Welcome here.

    I will involve more experts to investigate it. It may be some times delayed.

    If you are urgent about this issue, please call the paid Microsoft Support.

    Have a nice day.

    Regards,


    Elegentin Xie [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, November 22, 2012 9:19 AM
    Moderator
  • "except output files generated during release configuration are completely incompatibles"..."Then all sections names seems to be "cil$"."

    Your project is likely set to use "Link Time Code Generation" in the release build, in that case .obj files produced by the VC++ compiler do not contain native x86/x64 code. They contain intermediate code that's supposed to be used by the VC++ compiler backend to generated native code at link time.

    • Marked as answer by Potatos Thursday, November 22, 2012 7:17 PM
    Thursday, November 22, 2012 9:47 AM
    Moderator
  • Hi all.

    Yea Mike, that was it, I didn't know about that option.

    I removed the text from the "link time code generation" option of the linker and turned off the "Whole program optimization" from the C/C++ optimization panel, then it solved the problem. 

    Thanks for all your help !


    • Edited by Potatos Thursday, November 22, 2012 7:19 PM
    Thursday, November 22, 2012 7:16 PM