Page 1 of 1
Executable File Format
Posted: Thu Sep 04, 2003 2:44 pm
by horoz
hi all
i have passed the task, memory management stage and i've
written a basic fat12 and floppy driver. i've used flat memory model.
now i want to decide on which executable file format to use for applications. i don't want to use elf or pe. I've considered LX and rdoff (btw i couldn't find Rdoff 2.0 specification. not on google nor on wotsit :-\ ) If you have any suggestions on a format can you please give a link to any kind of specification.
thanks
Re:Executable File Format
Posted: Thu Sep 04, 2003 2:46 pm
by Whatever5k
Why don't you want to use ELF? I'd go for it...
Re:Executable File Format
Posted: Thu Sep 04, 2003 2:56 pm
by horoz
i don't know maybe i can i thought there might be a better format that's why i am asking.
Re:Executable File Format
Posted: Thu Sep 04, 2003 3:35 pm
by Tim
ELF and PE are both fine executable formats for 99% of what you might need. They're both very general-purpose. I believe PE is slightly better, as it has a few more bells and whistles (e.g. resources), and its relocations aren't based on Position-Independent Code, as ELF is. (PIC performs badly on x86 because it takes up one register which, in PE, can be used by the compiler.)
Re:Executable File Format
Posted: Fri Sep 05, 2003 1:08 am
by Pype.Clicker
You know, Tim, you're not forced to use PIC (position independent code) with elves. you just *can*, and that's the way Linux dynamic loader works ... but you can for sure write another loader that do not enforce this. Relocation infos are there too :p
Re:Executable File Format
Posted: Fri Sep 05, 2003 3:19 am
by Tim
You mean you can get the linker to emit a relocatable image with relocations instead of PIC? I never knew that.
To be honest, it's been a struggle getting ld to emit relocatable images even with PE (my relocatable drivers invoke ld three times -- apparently this is the only way of doing it).
Re:Executable File Format
Posted: Fri Sep 05, 2003 3:36 am
by Pype.Clicker
there is something like a "-r" or "-i" file that forces it to keep relocation information in the final object file. That's how Clicker modules are built
(though i admit there's no much more bits of elves when i'm done with them ... Maybe i should name my file format 'Obscure Relocatable Code' or something alike :p)