Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip relocations to sections when parsing elf #762

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/asm_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,13 @@ vector<raw_program> read_elf(std::istream& input_stream, const std::string& path
if (!reloc.get_entry(i, offset, index, type, addend)) {
continue;
}

auto [symbol_value, symbol_type] = get_value(symbols, index);
elazarg marked this conversation as resolved.
Show resolved Hide resolved
if (symbol_type == ELFIO::STT_SECTION) {
// Skip relocations for sections.
continue;
}

if (offset < program_offset || offset >= program_offset + program_size) {
// Relocation is not for this program.
continue;
Expand Down
Loading