Skip to content

Conversation

@katsyoshi
Copy link
Owner

No description provided.

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

ℹ️ 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 +109 to +111
section_name = section.section_name
ref = @elf_obj.select_by_names(section_name.split(".").filter { |sn| !sn.empty? && sn != "rel" && sn != "rela" }).first
write_section_index(ref.section_name)

Choose a reason for hiding this comment

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

P1 Badge Resolve relocation target section with correct name

When writing an ELF that actually contains relocation sections (e.g., .rela.text or .rel.text), ref_index derives the target name by splitting on . and filtering out rel/rela, which yields "text" rather than ".text". Because select_by_names always includes nil section names, the first match is usually the null section, so write_section_index returns 0 and sh_info for the relocation points to section 0 instead of the referenced section. Tools that read relocations via sh_info will misinterpret or reject these sections. Consider preserving the leading dot (e.g., ".text") and/or filtering out nil sections when resolving the reference.

Useful? React with 👍 / 👎.

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