Assalam-O-Alaekum!
Assembly language is processor dependant not assembler dependent, right? Although, the difference between assemblers in linux and windows make the assembly code quite different but would the machine code also differ? Shouldn't machine code be the same because the OS is running on the same architecture?
Low level programming assembly/machine code question!
-
- Battalion Quarter Master Havaldaar
- Posts: 221
- Joined: Wed Aug 07, 2002 3:02 pm
- Location: Rawalpindi
Low level programming assembly/machine code question!
a10n3 s7r1k3r
-
- Battalion Quarter Master Havaldaar
- Posts: 221
- Joined: Wed Aug 07, 2002 3:02 pm
- Location: Rawalpindi
COM file equivalent in Linux?
Assalam-O-Alaekum!
Thanks for the reply. I have another question on the same topic. Is there a COM file equivalent for linux? Meaning, just like COM files don't have big headers with them, is there any such format for linux?
Also, what are ELF binaries and how do they differ from the older binaries?
Thanks for the reply. I have another question on the same topic. Is there a COM file equivalent for linux? Meaning, just like COM files don't have big headers with them, is there any such format for linux?
Also, what are ELF binaries and how do they differ from the older binaries?
a10n3 s7r1k3r
I dont know what youre asking about the COM file stuff. For ELF, you can search google or intels website. or take a look at this
http://www.muppetlabs.com/~breadbox/software/ELF.txt
http://www.muppetlabs.com/~breadbox/software/ELF.txt
I only run as fast as my angels can fly
-
- Battalion Quarter Master Havaldaar
- Posts: 221
- Joined: Wed Aug 07, 2002 3:02 pm
- Location: Rawalpindi
COM related
By COM issue I meant that in DOS/Windows, COM files contain no extra header info except the PSF while EXEs contain a lot of extra assembly code not written by the programmer. I wanted to know if there was an equivivalent of this in Linux.
a10n3 s7r1k3r
-
- Battalion Quarter Master Havaldaar
- Posts: 221
- Joined: Wed Aug 07, 2002 3:02 pm
- Location: Rawalpindi
got it.
Assalam-O-Alaekum!
Well, I found something. If we don't use the libc wrapper calls in assembly (meaning calling the syscalls directly) this reduces the size of elf binaries quite dramatically. I got a hello world program binary only in 488 bytes.
Well, I found something. If we don't use the libc wrapper calls in assembly (meaning calling the syscalls directly) this reduces the size of elf binaries quite dramatically. I got a hello world program binary only in 488 bytes.
a10n3 s7r1k3r
Re: COM file equivalent in Linux?
pretty much all binaries you execute on linux are elf binaries. if you write your entire app in assembly and never call out to any libraries, you can use the a.out format instead. you might have to load a kernel module or recompile your kernel to make it support a.out, though.s7r1k3r wrote:Thanks for the reply. I have another question on the same topic. Is there a COM file equivalent for linux? Meaning, just like COM files don't have big headers with them, is there any such format for linux?
elf binaries can have multiple sections of data, code (called "text"), and comments. a.out just has text, data, bss (unless hacked for more sections, which pretty much everyone did before switching to elf). a binary built with debugging info can have another section just for debugging foo; the advantage is that this section doesn't have to be paged in when the binary is run. also, a.out has to be hacked to support shared libraries; elf supports it natively.Also, what are ELF binaries and how do they differ from the older binaries?
elf is also cross-platform, and most x86 (for example) operating systems use the same binary format for their executables.
Re: Thanks
it's a variant of COFF. see http://www.theparticle.com/cs/bc/os/elfpecoff.html.