Goal
Make self-linked shared objects (shared: true) usable from dlopen/Fiddle.
Acceptance Criteria
nm -D libadd.so shows exported symbols (e.g. add).
readelf -d libadd.so has consistent DT_SYMTAB/DT_STRTAB/DT_STRSZ/DT_HASH.
RUBY_BOX=1 ruby test/caotral/linker/fiddle_test.rb passes.
Tasks
- Populate
.dynsym with defined non-local symbols for shared objects.
- Append symbol names to
.dynstr and wire st_name offsets.
- Set
.dynsym symbol fields (st_value, st_shndx, st_size, st_info) for exported entries.
- Emit
.hash for shared objects (not only PIE) and patch DT_HASH.
- Ensure writer patches
DT_SYMTAB/DT_STRTAB/DT_STRSZ/DT_SYMENT from final layout.
- Add/maintain a minimal Fiddle smoke test (
add.c) with cleanup in teardown.
- Fix test input generation to use object files (
gcc -fPIC -c) instead of -shared -o *.o.
Goal
Make self-linked shared objects (
shared: true) usable fromdlopen/Fiddle.Acceptance Criteria
nm -D libadd.soshows exported symbols (e.g.add).readelf -d libadd.sohas consistentDT_SYMTAB/DT_STRTAB/DT_STRSZ/DT_HASH.RUBY_BOX=1 ruby test/caotral/linker/fiddle_test.rbpasses.Tasks
.dynsymwith defined non-local symbols for shared objects..dynstrand wirest_nameoffsets..dynsymsymbol fields (st_value,st_shndx,st_size,st_info) for exported entries..hashfor shared objects (not only PIE) and patchDT_HASH.DT_SYMTAB/DT_STRTAB/DT_STRSZ/DT_SYMENTfrom final layout.add.c) with cleanup inteardown.gcc -fPIC -c) instead of-shared -o *.o.