diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-09-23 19:53:07 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-09-23 19:53:07 -0700 |
| commit | 9806454fbcd9cbb195eb5ef17e0a1d36e06a64f9 (patch) | |
| tree | 34c27d1166153a7663353bbc73b38fc66d7e7927 | |
| parent | 74b5a9cbbaccfad88ac8c041d85a12f419bc4148 (diff) | |
FreeBSD support via Linux compatibility mode
this is done by setting the ABI version in the ELF header. many thanks to nortti for checking that things otherwise work, and validating that the approach makes sense in terms of FreeBSD's cultural expectations. Irenes don't have the ability to easily test this on our end, but this is an easy step that can improve compatibility. Force-Push: yes Change-Id: I3d55ed240c050839b8a11312f151d0809aef9031
| -rw-r--r-- | elf.e | 8 | ||||
| -rw-r--r-- | evoke.hex | 2 | ||||
| -rwxr-xr-x | hex | bin | 480 -> 480 bytes | |||
| -rw-r--r-- | hex.hex | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/elf.e b/elf.e index 1d2d7a0..2a67c54 100644 --- a/elf.e +++ b/elf.e @@ -24,7 +24,11 @@ ~ The program we're building should call this word as the first output it ~ generates. ~ -~ The only interesting thing here is the entry pointer. +~ The most interesting thing here is the entry pointer. +~ +~ It's also worth noticing that we set the ABI version to 3. An ABI version +~ of 0 (for the System V ABI) would work fine too, but 3 allows FreeBSD's +~ Linux compatibility features to kick in. : elf-file-header ~ : blank-line @@ -38,7 +42,7 @@ 2 pack8 ~ : -1 64-bit 1 pack8 ~ : -1 little-endian 1 pack8 ~ : -1 ELF header format v1 - 0 pack8 ~ : -1 System-V ABI + 3 pack8 ~ : -1 Linux ABI 0 pack64 ~ : -8 (padding) ~ : blank-line diff --git a/evoke.hex b/evoke.hex index e0bfb85..fce637f 100644 --- a/evoke.hex +++ b/evoke.hex @@ -22,7 +22,7 @@ 02 ~ 64-bit 01 ~ little-endian 01 ~ ELF header format v1 - 00 ~ System-V ABI + 03 ~ Linux ABI 00 00 00 00 00 00 00 00 ~ (padding) 02 00 ~ *executable diff --git a/hex b/hex index 4e3b7da..83ecf5a 100755 --- a/hex +++ b/hex Binary files differdiff --git a/hex.hex b/hex.hex index 6e627e9..eeb5b25 100644 --- a/hex.hex +++ b/hex.hex @@ -16,7 +16,7 @@ 02 ~ 64-bit 01 ~ little-endian 01 ~ ELF header format v1 - 00 ~ System-V ABI + 03 ~ Linux ABI 00 00 00 00 00 00 00 00 ~ (padding) 02 00 ~ *executable |