Benutzer jetzt online: 466 - Anmelden  » Suche  » Forum Index  

linux executable

roboticmehdi
wrote 2 years ago


reply
hi everybody. i have worked with slax a lot. i have worked with other linux distributions a lot too. but still i can't find the answer to this question : " What is the linux executable ? ". In windows it is mostly known as exe. what about linux? i know that linux is not extension oriented os. that means if the file is executable but its extension is .bmp for exeampla , for linux it is still an executable file. so what is the linux executable? what is its structure? thank you... :-)
 
ben_coh
wrote 2 years ago


reply
You should check this out :
http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
 
Rabiul
wrote 2 years ago


reply
Linux executables mostly don't have any extension. Some may have *.bin, as file.bin. You may check a file whether it is executable or not, by entering:

file /usr/bin/myfile

And you can make a script standalone executable for linux, by:

chmod 755 myfile

Then run it as:

./myfile
 
roboticmehdi
wrote 2 years ago


reply
yes. but what is the structure of linux executable ???
 
parrothead
wrote 2 years ago


reply
roboticmehdi wrote:
yes. but what is the structure of linux executable ???


Did you follow ben_coh's link? The wiki has links at the bottom that cover the format for various hardware since obviously the binary format will be different for Intel, PowerPC, SPARC, etc. systems.

Pat
 
Rabiul
wrote 2 years ago


reply
I can not understand what do you mean about structure. Say, for example, a windows executable file.exe prints a line 'Hello World' on terminal. How do you explain about the structure of file.exe?
 
parrothead
wrote 2 years ago


reply
Rabiul wrote:
I can not understand what do you mean about structure. Say, for example, a windows executable file.exe prints a line 'Hello World' on terminal. How do you explain about the structure of file.exe?


But what is IN file.exe? The operating system is expecting this file to be in a certain binary format, containing the data and code used by the program. So .com files are a different structure than .exe files. And files in Linux are expected to be of a certain structure as well, which varies depending on the type of hardware you are using. SPARC (Sun) computers have different instruction sets than x86 systems, etc. I'm not sure why anyone other than someone writing a complier, assembler or linker would care about the structure of these executable files, though. Obviously an ordinary user of Slax doesn't need to know byte-level details of files like this.

Pat
 
Rabiul
wrote 2 years ago


reply
parrothead, I think you have missed the thread... I was asking that to roboticmehdi as I believe he doesn't want to know the structure of linux executable to write any compiler or linker, or to get much deeper things of executables (neither do I...:). I think he wants to know the difference of linux executables with the windows one or he may wants to know how executables in linux run without having any extension or with any extension. I was asking that just to make clear what roboticmehdi does mean by 'structure'.
 
markds
wrote 2 years ago


reply
If he wants to know how linux/unix identifies the binary as an executable or otherwise, I think what he is looking for is ELF. ELF stands for "executable and linkable format" and is the standard executable format amongst most modern UNIX and UNIX-like operating systems. All ELF files begin with an header, the first part (ELF header) of which contains an identifier, whether 32 or 64 bit, etc. The later part of the header (Program header) contains info on the target architecture, whether the file is an executable, an object file, or a shared-object library, it's starting address, etc. Its that later part that identifies what it is to the system so the knows what to do with it.

Google ELF or "executable and linkable format". Lots of documentation on it.
 
Guest
wrote 2 years ago


reply
Ben posted a link for him. If he is really that interested, wikipedia is just a joy to read.
Hard to say what he thinks about. Linux and Windows programs are written in same languages and compiled for same processor, hence they must have the same machine-language/assembly translation in general.
To be very short, I think to remember that PE only uses an allocation into code and data, while there are tree "tables" in Elf. Then again, the header may be very different organized. You can maybe compare to different internetprotocols. They work differently, but in general you get the same iso-image if you download via ftp or http. For any deeper detailed, this is very heavy programming stuff. You can f.instance give PEExplorer a try to analyse the Windows PEformat. But this question cannot be serious. It is stuff for virii authors and anti-virii authors, along with serious codecracker and some really old-schoolers. I have never tried, but writing a compiler is in my imagination the heaviest thing you can do. Then you can use switches while compiling to change a little bit around on the header and inlining. Then comes metamorphic code that can really change on the allocation....

So in short I'd guess that the easiest explanation is that the OS and its kids/programs, they need to speak the same language. Windows do not understand ELF and vice versa. Although what the kids say/programs do, is about the same, but once upon a time they needed to agree on how to talk with each other, the OS and its applications. Microsoft developed there dialect, and unix has its own.
 
bhunter736
wrote 2 years ago


reply
Having migrated from windows not too long ago, I remember wondering how you identify executables in Linux. Then, like learning to spell, I quit worrying about it and started accepting that it is just different. In DOS/Win, there is a visible crutch attached to the file name. In linux, you need to see file details list to get that information. Although, you don't have to worry about it if you are not reverse engineering, but since this is open source, there is no need.

So why ask the question?

Because the light hasn't turned on yet. : )

It will eventually I hope, mine did.
 
Guest
wrote 2 years ago


reply
Well, very nice discussion. What is windows .Net details? I have not used that. Is that an interpreter? There is an environment named mono for linux. After reading few web pages I understand that it needs very large runtime. Why to use that big runtime while there are other interpreters too that are much smaller than .Net. What advantages do .Net provide that others can't? And last of all is there any good future of .Net? I mean if it is a fake thing then it is going to be refused by the user today or tomorrow.
 

  » Suche  » Forum Index  

Post your reply

Your name (Login):

Message:

These HTML tags are allowed: <quote>, <b>, <u>, <i>, <pre>, <code>, <small>, <h1>, <h2>, <h3>, <li>



Visit Tomas M's blog for fun, mostly on religious idiocy.