Skip to content

Conversation

@katsyoshi
Copy link
Owner

@katsyoshi katsyoshi commented Jan 24, 2026

  • --shared + linker=self emits ET_DYN (no dlopen guarantee yet).
    • Acceptance: produces an ELF output with e_type == ET_DYN.
    • Acceptance: does not require main.
    • Acceptance: does not inject the executable _start-style stub (call main; exit).
    • Acceptance: documents that .dynamic/.dynsym/runtime relocations are not implemented yet.
    • Task: skip main lookup and exec stub injection when shared: true.
    • Task: write ELF header as ET_DYN for shared output and set e_entry appropriately (0 / unused).
    • Task: add a test that reads the produced file and asserts ET_DYN.

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: 1879249710

ℹ️ 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 +12 to +15
def initialize(endian: :little, type: :REL)
@ident = IDENT
@type = num2bytes(ELF_FILE_TYPE[elf(type)], 2)
@arch = arch(arc)
@type = num2bytes(ELF_FILE_TYPE[type], 2)
@arch = num2bytes(62, 2) # target: e_machine EM_x86_64

Choose a reason for hiding this comment

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

P2 Badge Preserve Header.new keyword/type normalization

The initializer now directly indexes ELF_FILE_TYPE[type] and dropped the previous normalization logic, so callers that still pass type: :rel/:exec or string values (which were accepted before) will now hit nil and raise a TypeError inside num2bytes. Also, removing the arc: keyword means any existing caller supplying arc: now gets an ArgumentError. This is a runtime regression for existing usage patterns; consider keeping the normalization/keyword or raising a clearer validation error.

Useful? React with 👍 / 👎.

ELF::Reeader now reads e_type/e_machine and sets them on Header
Header exposes #type/#arch and supports set!(arch:)
Add minimal C fixture for shared object input
@katsyoshi katsyoshi merged commit 2e34465 into main Jan 24, 2026
2 checks passed
@katsyoshi katsyoshi deleted the shared-library-output branch January 24, 2026 12:08
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