# Win32 Is The Only Stable ABI on Linux

# Win32 Is The Only Stable ABI on Linux

**Author:** ivyl (blog.hiler.eu)
**Date:** 2022-08-15
**URL:** https://blog.hiler.eu/win32-the-only-stable-abi/

## Content

Glibc 2.36 broke games using EAC EOS on Linux. A bisect identified the offending commit, and a glibc bug was filed. Other software also broke.

### DT_HASH vs DT_GNU_HASH

ELF has two symbol hash table formats:
- `DT_HASH` — part of the SYSV generic ABI, mandatory and well-documented
- `DT_GNU_HASH` — newer, smaller, faster, but undocumented. Doesn't provide identical functionality to `DT_HASH` — to get the number of symbols you have to completely parse it.

Glibc historically provided both for compatibility but recently dropped `DT_HASH`. Since glibc uses `ELFOSABI_GNU`, excluding `DT_HASH` is technically acceptable under the generic ABI. But it broke real software.

### Regressions

- Games using EAC EOS became unplayable
- Open-source frame rate limiter libstrangle regressed
- Shovel Knight (non-EAC game) broke
- More breakages expected as glibc 2.36 reaches mainstream distros

### ABI Discussion

Arguments made in the glibc discussion:
- `DT_HASH` isn't part of the ABI
- The lookup information is still there, just in a different format
- Distributions should handle `DT_HASH` inclusion
- The change saves ~16kB (under 1% size reduction)

### Linus Torvalds ABI Rule

The author references Linus's philosophy: "changing ABI is okay as long as no one has noticed, but once it gets noticed — then it's a regression."

Glibc doesn't follow this rule. The kernel does.

### --hash-style History

GNU Linker defaults to `--hash-style=both`. Mold defaults to `--hash-style=sysv`. Most distributions configured GCC with `--with-linker-hash-style=gnu` — a leftover from when `DT_GNU_HASH` was newly introduced and ld defaulted to sysv only. Clang mimics distro-specific GCC defaults through distro detection.

### Conclusion

Win32 (via Wine + friends) is the only stable ABI on Linux. Native Linux game development faces ABI instability that Windows targeting via Wine avoids. The stability guarantee comes from Wine's commitment to not breaking applications, not from Linux itself.
