# API와 ABI

시스템 레벨에서 호환성에 영향을 주는 두 가지는 API(Application Programming Interface) 와 ABI(Application Binary Interface) 이다.

## API

API는 **소프트웨어의 소스 코드 레벨에서 서로 인터페이스 하는 방식**을 정의한다. 일반적으로 API 표준 인터페이스는 함수이며 상위 레벨의 소프트웨어에서 하위 레벨의 소프트웨어를 호출할 수 있다.

API는 인터페이스를 정의하며 그 정의를 실제로 구현한 소프트웨어를 **API 구현체**라고 한다.

API는 양쪽 소프트웨어 모두가 API 를 준수할 경우에만 동작하며 소스 코드 수준에서 호환된다. 즉, API의 구현체와 관계없이 해당 API를 따르기만 한다면 성공적으로 컴파일된다.

## ABI

API가 소스 코드 수준의 인터페이스를 정의한다면, **ABI는 특정 아키텍처 간에서 동작하는 소프트웨어 간의 바이너리 인터페이스를 정의**한다.&#x20;

API가 소스 코드 수준의 호환성을 보장한다면, ABI는 **바이너리의 호환성을 보장**하여 오브젝트 코드를 다시 컴파일하는 수고 없이 같은 ABI를 지원하는 시스템이라면 동일한 기능을 수행하도록 보장한다.

리눅스를 포함한 운영체제는 각각의 요구사항에 부합하는 고유의 ABI를 정의하려는 경향이 있다. ABI는 아키텍처와 밀접한 관계가 있으며, ABI 대부분은 특정 레지스터나 어셈블리 명령어 같은 하드웨어에 국한된 개념을 다루고 있다. 따라서, 리눅스에서는 아키텍처마다 다른 고유의 ABI를 가지고 있다.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://koseungbin.gitbook.io/wiki/books/undefined-2/undefined/api-abi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
