Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75d81c16ca
ℹ️ 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".
| if _start.nil? | ||
| main_offset = entry_sym.nil? ? 0 : entry_sym.value + start_len | ||
| start_bytes[1, 4] = num2bytes((main_offset - 5), 4) if @executable | ||
| text_section.body.prepend(start_bytes.pack("C*")) | ||
| end |
There was a problem hiding this comment.
Set entrypoint to resolved
_start address
When _start exists, this branch skips inserting the generated startup stub, but no replacement entry address is propagated; the writer still defaults e_entry to the start of .text. If _start is not at offset 0 in merged .text (for example, when its object is not first in inputs), the process starts at the wrong instructions and can crash immediately.
Useful? React with 👍 / 👎.
| sym_by_elf = Hash.new { |h, k| h[k] = [] } | ||
| dynstr, dynsym = build_shared_dynamic_sections if dynamic? | ||
|
|
||
| start_len = 0 if @elf_objs.any? { |elf| elf.find_by_name(".symtab").body.find { |sym| sym.name_string == "_start" } } |
There was a problem hiding this comment.
Require defined
_start before enabling custom entry mode
This _start probe matches by name only, so an undefined _start reference (shndx == 0) in any input object will disable the normal main startup path. That can produce an executable without a valid startup routine even though no _start definition was provided; restrict the detection to symbols that are actually defined.
Useful? React with 👍 / 👎.
No description provided.