Skip to content

Conversation

@katsyoshi
Copy link
Owner

@katsyoshi katsyoshi commented Jan 24, 2026

  • Emit .dynsym/.dynstr and .dynamic for shared objects.
  • Task: define minimal Dynamic entry writer (DT_* tag/value).
  • Task: emit .dynstr string table (at least \\0 and exported symbol names).
  • Task: emit .dynsym with null symbol + exported globals (pointing at .text for now).
  • Task: write section headers for .dynsym/.dynstr/.dynamic (types/links/entsize/alignment).
  • Task: update .dynamic tags with pointers/sizes after layout is known (2-pass or patch-up).
  • Task: add a test asserting these sections exist (do not require .rela.dyn yet).

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a323bd83ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +114 to +118
dynstr_offset = file.pos
file.write(dynstr_section.body.build)
size = file.pos - dynstr_offset
dynstr_section.header.set!(offset: dynstr_offset, size:)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard shared writes when .dynstr/.dynsym are absent

When shared: true, write_shared_dynamic_sections unconditionally dereferences dynstr_section (and later dynsym_section). If a caller uses Writer.write! directly with an ELF object that lacks these sections (e.g., from Reader or a pre-change Builder), dynstr_section/dynsym_section will be nil and this will raise NoMethodError, preventing shared output. Consider guarding for missing sections or raising a clearer error so shared doesn’t crash on valid-but-minimal ELF inputs.

Useful? React with 👍 / 👎.

@katsyoshi katsyoshi merged commit 4a41f78 into main Jan 27, 2026
2 checks passed
@katsyoshi katsyoshi deleted the shared-dyn-sections branch January 27, 2026 12:48
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.

2 participants