This repository contains a collection of tools to be used by Zig maintainers to
generate abilists files for various libc implementations; Zig users have no
direct use for this repository.
An abilists file can be used by the Zig compiler to generate an accurate stub
shared library when dynamically linking libc in cross-compilation scenarios. The
generated abilists files are shipped with the Zig compiler, so an effort is
made to keep them compact.
Currently supported libcs:
All integers are stored little-endian.
u8number of libc libraries. For each:- null-terminated name, e.g.
"c\x00","m\x00","dl\x00","pthread\x00"
- null-terminated name, e.g.
u8number of libc versions, sorted ascending. For each:u8majoru8minoru8patch
u8number of targets. For each:- null-terminated target string, e.g.
"arm-linux-gnueabi\x00"
- null-terminated target string, e.g.
u16number of function inclusions- null-terminated symbol name (not repeated for subsequent same symbol inclusions)
- Set of Function Inclusions
u16number of object inclusions- null-terminated symbol name (not repeated for subsequent same symbol inclusions)
- Set of Object Inclusions
u16number of TLS inclusions- null-terminated symbol name (not repeated for subsequent same symbol inclusions)
- Set of TLS Inclusions
Set of Function Inclusions:
- uleb128 (
u64) set of targets this inclusion applies to (1 << INDEX_IN_TARGET_LIST) u8index of libc library this inclusion applies to- unversioned is indicated if
1 << 5bit is set in library index - weak linkage is indicated if
1 << 6bit is set in library index - last inclusion is indicated if
1 << 7bit is set in library index
- unversioned is indicated if
[N]u8set of libc versions this inclusion applies to- last version index is indicated if
1 << 7bit is set in version index
- last version index is indicated if
Set of Object Inclusions:
- uleb128 (
u64) set of targets this inclusion applies to (1 << INDEX_IN_TARGET_LIST) - uleb128 (
u16) object size u8index of libc library this inclusion applies to- unversioned is indicated if
1 << 5bit is set in library index - weak linkage is indicated if
1 << 6bit is set in library index - last inclusion is indicated if
1 << 7bit is set in library index
- unversioned is indicated if
[N]u8set of libc versions this inclusion applies to- last version index is indicated if
1 << 7bit is set in version index
- last version index is indicated if
Set of TLS Inclusions:
- uleb128 (
u64) set of targets this inclusion applies to (1 << INDEX_IN_TARGET_LIST) - uleb128 (
u16) object size u8index of libc library this inclusion applies to- unversioned is indicated if
1 << 5bit is set in library index - weak linkage is indicated if
1 << 6bit is set in library index - last inclusion is indicated if
1 << 7bit is set in library index
- unversioned is indicated if
[N]u8set of libc versions this inclusion applies to- last version index is indicated if
1 << 7bit is set in version index
- last version index is indicated if
zig run list.zig -- abilists