Skip to content

Make self-linked shared objects dlopen/Fiddle-compatible #47

@katsyoshi

Description

@katsyoshi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions