The executable file format of Linux kernel research-general Linux technology-Linux programming and kernel information. The following is a detailed description. We know that not all binary files in Linux have the same format. Linux uses the binary file processing program to process different binary files separately. The binary processing program identifies a file by embedding a "feature sequence" (a special byte sequence) at the beginning of the file, and sometimes uses some features of the file name, for example, the ELF file starts with 'e' l' F' and the Java file starts with 0xcafebabe.
Linux uses sys_execve to mount executable binary files.
1. The current Linux version (2.2) provides the following binary file handlers:
• A. out: it is mainly used for compatibility with the past, because a. out is difficult to implement dynamic links to be obtained by ELF.
• ELF: Mainstream Linux binary files. Even so, she needs to use a binary handler like other formats.
• EM86: runs Intel Linux binary files on Alpha's host, as if they were Alpha's local binary files.
• Java: the handler returns the interpreted program that executes bytecode by taking the file name of the. class file as a parameter.
• Misc: the most sensible binary processing method. She uses embedded feature numbers or filename suffixes to identify binary formats. In addition, she can configure it at runtime instead of during compilation. In this way, you can add support for new binary format files without re-compiling the kernel. Some say it will replace Java and EM86 binary processors with her.
• Script: mainly supports shell scripts and Perl scripts. To put it bluntly, all the first two characters are #! The executable files are all processed by her.
Before proceeding, we must first understand a Data Structure linux_binfmt;