The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: fdig on February 04, 2006, 09:56:17 PM

Title: plain binary restrictions?
Post by: fdig on February 04, 2006, 09:56:17 PM
Hi!

Where is the difference between plain binary and eg elf binary?
Do i have any restrictions using only plain binary? Is plain binary more portable but without any bad restrictions?

which could be reason don't using eg. elf but plain binary instead?

thanks
Title: Re: plain binary restrictions?
Post by: dsouza123 on February 05, 2006, 12:28:00 AM
elf is a portable object and binary format for linux and similar OSes.

MASM32 produces Windows 32-bit PE files using coff object files (omf object files are also possible).
Title: Re: plain binary restrictions?
Post by: fdig on February 05, 2006, 02:03:57 AM
So you can say plain binaries are right thing to make same executable running on different platforms?
i tried linking plain binary ($file binary : MS-DOS executable (COM))
under linux with ld, but it says "file format not recognized".
so far i am searching for good explain of differences between plain binary and elf binary / win32 binary yet.
i can't imagine if "plain binary" is binary format such ELF, COM or some art of compiling "layer".

regards
Title: Re: plain binary restrictions?
Post by: hutch-- on February 05, 2006, 02:35:44 AM
fdig,

PE and ELF are just different object module formats. Various flavours of unix use different executable file formats and don't natively run msdos or windows files unless they have an additional layer that will recognise it. I have seen dos files run on linux and there is a wine emulator that is supposed to be getting better but they are finally diferent OS versions without much similarity so you cannot expect files from one to work on another unles there is some form of emulation software available on the target box that will run it.
Title: Re: plain binary restrictions?
Post by: zooba on February 05, 2006, 09:16:54 AM
Have a look at this (http://blogs.msdn.com/oldnewthing/archive/2006/01/30/519388.aspx) blog entry on The Old New Thing. He describes some of the base differences between executable binaries. :U
Title: Re: plain binary restrictions?
Post by: Mincho Georgiev on February 05, 2006, 11:09:58 AM
Mybe only the emulators are
Quoteright thing to make same executable running on different platforms
Or compile twice your program /for 2 different platforms/ .
Title: Re: plain binary restrictions?
Post by: fdig on February 05, 2006, 12:42:35 PM
Ok, i got it.
It's easiely - that's because of it's name - clear asm. No part of ELF / PE object file container (and surely not linked).

regards