Executable Format: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
=Internal=
=Internal=
* [[Multi-Architecture_Container_Images#Overview|Multi-Architecture Container Images]]
* [[Multi-Architecture_Container_Images#Overview|Multi-Architecture Container Images]]
* [[Machine Architecture]]


=Overview=
=Overview=
Line 16: Line 17:


On Linux:
On Linux:
<syntaxhighlight lang='bash'>
file getcap
getcap: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d043a7b3e7c8ec366bfa066b4c91be8ff25f1497, for GNU/Linux 3.2.0, stripped
</syntaxhighlight>


On Mac:
On Mac:

Latest revision as of 02:09, 9 December 2023

External

Internal

Overview

An executable file (or program) is a file that contains instructions, or machine code, directly executable by the CPU. The alternative is a file that contains higher level instructions or code to be interpreted by an interpreter. The executable files are usually created by assembling object files, which are created by compiling a higher level language.

Linux operating systems use Executable and Linkable Format (ELF).

MacOS uses Mach-O.

One can tell the format by executing the file command on the executable file.

On Linux:

file getcap
getcap: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d043a7b3e7c8ec366bfa066b4c91be8ff25f1497, for GNU/Linux 3.2.0, stripped

On Mac:

file yunikorn-scheduler
yunikorn-scheduler: Mach-O 64-bit executable x86_64

The format of the machine code stored in an executable file depends on the machine architecture.