ArticleslgStudy

science

Application binary interface

Application binary interface is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Application binary interface rather than just read about it. In short: An application binary interface (ABI) is an interface exposed by software that is defined for in-process machine code access. Often, the exposing software is a library, and the consumer is a program.

Application binary interface — main illustration
Application binary interface — illustration

Key takeaways

  • Application binary interface belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Application binary interface to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Application binary interface from memory before moving on to harder problems.

Reference excerpt

An application binary interface (ABI) is an interface exposed by software that is defined for in-process machine code access. Often, the exposing software is a library, and the consumer is a program. An ABI is at a relatively low level of abstraction. Interface compatibility depends on the target hardware and the software build toolchain. In contrast, an application programming interface (API) defines access in source code, which is a relatively high-level, hardware-independent, and human-readable format. An API defines an interface at the source code level, before compilation, whereas an ABI defines an interface to compiled code. API compatibility is generally the concern for system design and of the toolchain. However, a programmer may have to deal with an ABI directly when writing a program in multiple languages or when using multiple compilers for the same language. A complete ABI enables a program that supports an ABI to run without modification on multiple operating systems that provide the ABI. The target system must provide any required libraries (that implement the ABI), and there may be other prerequisites.

Description Interface aspects covered by an ABI include:

Processor instruction set, with details like register file structure, memory access types, etc. Size, layout, and alignment of basic data types that the processor can directly access Calling convention, which controls how the arguments of functions are passed, and return values retrieved; for example, it controls the following: How the call stack is organized Whether all parameters are passed on the call stack, or some are passed in registers Which registers are used for which function parameters Which registers should be preserved by the callee (restore its value if changed) Whether the first function parameter passed on the call stack is pushed first or last Whether the caller or callee is responsible for cleaning up the call stack after the function call Stack unwinding (setjmp/longjmp) Name mangling, or how an API entity is named in the resulting object file (not in C) Exception propagation (not in C) How an application should make system calls to the operating system, and if the ABI specifies direct system calls rather than procedure calls to system call stubs, the system call numbers In the case of a complete operating system ABI, the binary format of object files, program libraries, etc. Example ABIs include the obsolete Intel Binary Compatibility Standard (iBCS),, the System V Release 4 ABIs for various instruction set architectures (ISAs) used by many Unix-like systems, and the Microsoft Windows ABIs for various ISAs.

Embedded ABI An embedded ABI (EABI), used on an embedded operating system, specifies aspects such as file formats, data types, register usage, stack frame organization, and function parameter passing of an embedded software program. Each compiler and assembler that supports an EABI creates object code that is compatible with code generated by other such compilers and assemblers. This allows developers to link libraries generated by one compiler with object code generated by another. Typically, an EABI is optimized for performance for the limited resources of the target embedded system. Therefore, an EABI may omit abstractions between kernel and user space typically found in desktop operating systems. For example, dynamic linking may be avoided to allow smaller executables and faster loading, fixed register usage allows more compact stacks and kernel calls, and running the application in privileged mode allows direct access to custom hardware operation without the indirection of calling a device driver. The choice of EABI can affect performance. Widely used EABIs include the PowerPC, Arm, and MIPS EABIs. Specific software implementations like the C library may impose additional limitations to form more concrete ABIs; one example is the GNU OABI and EABI for ARM, both of which are subsets of the ARM EABI. Another point of distinction is whether optional features such as hardware floating-point is present. For example, in GCC and LLVM, armv7-unknown-linux-musleabi, armv7-unknown-linux-musleabihf both refer to GNU EABI with the musl C library, except the latter uses hardware floating-point and therefore has a slightly different call convention.

Language ABIs Each programming language may use a different set of features and data types. If there is no existing ABI for a feature, the language often needs to define its own ABI as an extension of the existing ABI.

C The official website of the C programming language describes C as a lingua franca in foreign function interfaces (FFIs: function calls between different programming languages). Many languages define their FFIs around the C ABI, for example the extern "C" of Rust and C++. This is because almost every current operating system, both Unix-like and Windows, provides an agreed-upon C ABI. These systems themselves mainly provide a C API, which depends upon a C ABI for functioning, hence the ubiquity of a C ABI. (Furthermore, C is relatively limited in what it requires of the ABI rules compared to other languages, only requiring definition of data structure layout and calling convention.) Nevertheless, C was not originally designed to serve in this role, and the ABI has been criticized for many of its perceived deficiencies as an FFI:

C ABIs are defined by C APIs, which are defined in C header files. However, C header files are very hard to parse and most FFI implementations resort to calling the compiler. C ABIs define interpretations for C-specific types such as long long, time_t, intmax_t. These choices of types are set in stone by the ABI, but there exist valid reasons to change them, which ends up breaking the ABI. C ABIs do not have parts required to support features in other languages, e.g. type safety and memory safety.

… excerpt ends here. Continue reading the full article.

Illustrations

Application binary interface: A high-level comparison of in-kernel and kernel-to-userspace APIs and ABIs
A high-level comparison of in-kernel and kernel-to-userspace APIs and ABIs
Application binary interface: The Linux kernel and GNU C Library define the Linux API. After compilation, the binaries offer an ABI. Keeping this ABI stable over a long time is important for ISVs.
The Linux kernel and GNU C Library define the Linux API. After compilation, the binaries offer an ABI. Keeping this ABI stable over a long time is important for ISVs.

Worked examples

Example 1 — a first encounter with Application binary interface

Start with the simplest possible case. Write down what Application binary interface claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Application binary interface before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Application binary interface ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Application binary interface

In research
Application binary interface appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Application binary interface in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Application binary interface is common in secondary-school and first-year university syllabi. It links to neighbouring topics Application programming interfaces, Operating system technology, so understanding it makes those chapters shorter.
In everyday life
Look for Application binary interface outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Application binary interface” →

How to study Application binary interface in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Application binary interface means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Application binary interface out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Application binary interface in simple terms?

An application binary interface (ABI) is an interface exposed by software that is defined for in-process machine code access. Often, the exposing software is a library, and the consumer is a program.

Why does Application binary interface matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Application binary interface?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Application binary interface.

Tags

  • Application programming interfaces
  • Operating system technology

Keep exploring