coff

PE Header Requirements

孤者浪人 提交于 2019-12-04 07:24:12
What are the requirements of a PE file (PE/COFF)? What fields should be set, which value, at a bare minimum for enabling it to "run" on Windows (i.e. executing "ret" instruction and then close, without error). The library I am building first is the linker: Now, the problem I have is the PE file (PE/COFF). I don't know what is "required" for a PE file before it can actually execute on my platform. My testing platform is Vista. I get an error message, saying " This is not a valid Win32 executable. " when I execute it by double-clicking, and I get an "Access Denied." when executing it with CLI

Usage differences between. a.out, .ELF, .EXE, and .COFF

a 夏天 提交于 2019-12-03 07:21:19
问题 Don't get me wrong by looking at the question title - I know what they are (format for portable executable files). But my interest scope is slightly different MY CONFUSION I am involved in re-hosting/retargeting applications that are originally from third parties. The problem is that sometimes the formats for object codes are also in .elf, .COFF formats and still says, "Executable and linkable". I am primarily a Windows user and know that when you compile and assemble your C/C++ code, you get

Linker error “contains invalid OMF record” 2

无人久伴 提交于 2019-12-02 09:15:51
问题 I'm working with Embarcadero XE8 C++ builder 32 bit. I was adding a library to my program for solving the Unresolved external error . When I added the library I got the error as in the title. So I searched the web and found this topic on stackoverflow: Linker error "contains invalid OMF record" As it says the COFF2OMF tool, CAN work. Sadly it didn't work for me, I give a 7mb library file, when I convert it with the tool it's only 41kb... so I guess the convertion failed. When I add the

COFF on Linux or ELF on Windows

浪子不回头ぞ 提交于 2019-12-01 03:14:06
Is it possible to run the COFF executable files on UNIX or the ELF executable files on Windows? And what would be the steps to be able to run either file type on Windows and UNIX. I'm just curious. To actually run executables and have them do useful stuff, you need to worry about the API, not just the executable file format. On a Linux machine with WINE installed, you can run Windows .EXE files from the command line and they do the same thing that they do on Windows. The other way around is not really possible, however if you install CYGWIN on a Windows machine, and then rebuild the

What's the difference between the OMF and COFF format?

久未见 提交于 2019-11-29 13:15:41
Recently I've been maintaining a legacy project written in VC++ 6.0. The code uses so many unique characteristics of this compiler that porting it to a more recent standard compiler has proved to be an herculean task. Among the thousands lines of code in the project, there are four assembler files. For some reason I don't understand, nor MASM615 nor TASM are able to compile them (they send errors), nevertheless I have the object files. However when I link the library I get a message warning LNK4033: converting object format from OMF to COFF The library works as expected, but I've been

What's the difference between the OMF and COFF format?

纵然是瞬间 提交于 2019-11-28 07:10:50
问题 Recently I've been maintaining a legacy project written in VC++ 6.0. The code uses so many unique characteristics of this compiler that porting it to a more recent standard compiler has proved to be an herculean task. Among the thousands lines of code in the project, there are four assembler files. For some reason I don't understand, nor MASM615 nor TASM are able to compile them (they send errors), nevertheless I have the object files. However when I link the library I get a message warning

Has anyone been able to create a hybrid of PE COFF and ELF?

﹥>﹥吖頭↗ 提交于 2019-11-28 06:36:50
I mean could a single binary file run in both Win32 and Linux i386 ? This is not possible, because the two types have conflicting formats: The initial two characters of a PE file must be 'M' 'Z' ; The initial four characters of an ELF file must be '\x7f' 'E' 'L' 'F' . Clearly, you can't create one file that satisifies both formats. In response to the comment about a polyglot binary valid as both a 16 bit COM file and a Linux ELF file, that's possible (although really a COM file is a DOS program, not Windows - and certainly not Win32). Here's one I knocked together - compile it with NASM. It

What is the COMDAT section used for?

你离开我真会死。 提交于 2019-11-27 07:35:37
I see the /Gy option and am wondering why I would use it? http://msdn.microsoft.com/en-us/library/xsa71f43.aspx Scott Wisniewski The currently accepted answer is somewhat incomplete. The purpose of a COMDAT section is to allow "duplicate" sections to be defined in multiple object files. Normally, if the same symbol is defined in multiple object files, the linker will report errors. This can cause problems for some C++ language features, like templates, that may instantiate the same symbols in different cpp files. COMDAT sections are used to get around this. When a section is marked as a COMDAT

Has anyone been able to create a hybrid of PE COFF and ELF?

∥☆過路亽.° 提交于 2019-11-27 01:25:12
问题 I mean could a single binary file run in both Win32 and Linux i386 ? 回答1: This is not possible, because the two types have conflicting formats: The initial two characters of a PE file must be 'M' 'Z' ; The initial four characters of an ELF file must be '\x7f' 'E' 'L' 'F' . Clearly, you can't create one file that satisifies both formats. In response to the comment about a polyglot binary valid as both a 16 bit COM file and a Linux ELF file, that's possible (although really a COM file is a DOS

What is the COMDAT section used for?

拥有回忆 提交于 2019-11-26 13:35:19
问题 I see the /Gy option and am wondering why I would use it? http://msdn.microsoft.com/en-us/library/xsa71f43.aspx 回答1: The currently accepted answer is somewhat incomplete. The purpose of a COMDAT section is to allow "duplicate" sections to be defined in multiple object files. Normally, if the same symbol is defined in multiple object files, the linker will report errors. This can cause problems for some C++ language features, like templates, that may instantiate the same symbols in different