1970-01-01 12:00:00
Notes - 4. A*I
4. ABI?
For me it wasnt clear enough about definition of ABI.
Application Binary Interface. Defines how data structures from machine code. System library / binary compatability. e.g. Data Type, Size, Layout, Alignment, ..
- In Linux,
struct dirent{}
and corresponding of other OS differ. It is data structure mismatch, which is part of ABI. Also, typing like int, long may be 32bits, 64bits,,, though it usually doesnt differ in modern system. - Alignment of memory.
- Calling convention … How argument is passed. Via “eax, ebx, ecx…” or in stack? and also return values.
- System ABI, syscalls? … syscall “int 0x80” is Linux’s own ABI. Where is argument, syscall type indication where?
- Object code, shared libraries. … Function call conventions, naming convention for shared object, may differ and thus mismatch?
- Binary object format, ELF, PE, Mach-O is also part of ABI.
- glibc, musl, … this libc mismatch is also part of ABI incompatibility. Function signatures, syscall wrappers, symbol versioning, …
API is just defining high-level approach of data exchange, ABI is more lower level approach of binary applications talk to each other via binary data structures and object conventions.
API read(fd, mode, bytes) can be same but where parameter is passed (in ASM level) may differ.