Goal:
Produce shared objects from gcc-generated object files that can be loaded at runtime (Ruby dlopen path).
Scope:
- Define and implement the minimum linker requirements for a loadable
.so from gcc .o inputs.
- Prioritize runtime-load correctness over broad feature coverage.
- Cover the basic runtime path:
dlopen succeeds
- expected symbol is resolvable (
dlsym/equivalent)
- callable function returns expected value
Implementation plan (incremental):
- Start from a minimal
-fPIC fixture (single exported function, no complex deps).
- Enumerate relocations emitted by gcc for that fixture and support required subset.
- Keep unsupported relocations as explicit linker errors (no silent output corruption).
- Add E2E test(s) in Ruby-side runtime loading path (Fiddle or equivalent wrapper).
Acceptance criteria:
- A self-linked
.so from the minimal fixture is loadable and callable from Ruby runtime.
- Tests assert load + symbol resolution + function result.
- Failure mode for unsupported relocations is explicit and deterministic.
Out of scope (for this issue):
- Full relocation-family support across all gcc outputs.
- Property-based testing expansion (tracked separately).
Goal:
Produce shared objects from gcc-generated object files that can be loaded at runtime (Ruby
dlopenpath).Scope:
.sofrom gcc.oinputs.dlopensucceedsdlsym/equivalent)Implementation plan (incremental):
-fPICfixture (single exported function, no complex deps).Acceptance criteria:
.sofrom the minimal fixture is loadable and callable from Ruby runtime.Out of scope (for this issue):