Skip to content

Emit the string helper on demand and pin the import surface - #33

Merged
bytetroll merged 1 commit into
masterfrom
anomalous-abi-symbol-surface
Nov 9, 2026
Merged

bytetroll merged 1 commit into
masterfrom
anomalous-abi-symbol-surface

Conversation

@bytetroll

Copy link
Copy Markdown
Contributor

Targeting the Anomalous rite ABI starts with what a native object requires, because a freestanding consumer has to supply every undefined symbol deliberately. Anomalous ADR 0049 records the current cost: the compiler's "unconditional unused string helper imports strlen, calloc, and memcpy", and the fixture satisfies them with fatal trap stubs that fail the proof if reached.

They were unconditional because __ny_string_concat was built into every module while its only caller looked it up on demand. The helper is now built on first use, like the runtime failure function beside it. An object for a program that concatenates nothing imports exactly the five native runtime hooks -- nyrt_abi_version, nyrt_context_begin, nyrt_context_end, nyrt_fail and nyrt_profile_site -- and no libc at all, which is the ABI Anomalous reverse-engineered rather than was given.

nil.native-symbol-surface pins that boundary by reading the ELF symbol table directly, so it does not depend on binutils. It also compiles a program that does concatenate and requires the helper's dependencies to come back, because otherwise the first assertion would pass just as well if the helper had been dropped entirely.

Linux: 573 registered, 0 failed, 3 environment skips. The test is ELF only and skips elsewhere; it is gated on the native backend.

Targeting the Anomalous rite ABI starts with what a native object
requires, because a freestanding consumer has to supply every undefined
symbol deliberately. Anomalous ADR 0049 records the current cost: the
compiler's "unconditional unused string helper imports strlen, calloc,
and memcpy", and the fixture satisfies them with fatal trap stubs that
fail the proof if reached.

They were unconditional because __ny_string_concat was built into every
module while its only caller looked it up on demand. The helper is now
built on first use, like the runtime failure function beside it. An
object for a program that concatenates nothing imports exactly the five
native runtime hooks -- nyrt_abi_version, nyrt_context_begin,
nyrt_context_end, nyrt_fail and nyrt_profile_site -- and no libc at all,
which is the ABI Anomalous reverse-engineered rather than was given.

nil.native-symbol-surface pins that boundary by reading the ELF symbol
table directly, so it does not depend on binutils. It also compiles a
program that does concatenate and requires the helper's dependencies to
come back, because otherwise the first assertion would pass just as well
if the helper had been dropped entirely.

Linux: 573 registered, 0 failed, 3 environment skips. The test is ELF
only and skips elsewhere; it is gated on the native backend.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bytetroll
bytetroll merged commit cbe8fe7 into master Nov 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant