Skip to content

fix: import just GLIBC_ABI_DT_RELR version#1826

Merged
davidlattimore merged 2 commits intowild-linker:mainfrom
mati865:push-suwlrnzknyku
Apr 9, 2026
Merged

fix: import just GLIBC_ABI_DT_RELR version#1826
davidlattimore merged 2 commits intowild-linker:mainfrom
mati865:push-suwlrnzknyku

Conversation

@mati865
Copy link
Copy Markdown
Member

@mati865 mati865 commented Apr 8, 2026

A self-contained mess to import just the version and not the whole symbol for #1817. If we want to go this route I'll try to clean this up, but there is not much that can be done.

@davidlattimore
Copy link
Copy Markdown
Member

What about looking up the symbol, then loading the version for that symbol, but not loading the symbol itself? Something like the following:

        if symbol_db.args.is_relr_enabled()
            && let Some(symbol_id) =
                symbol_db.get_unversioned(&UnversionedSymbolName::prehashed(b"GLIBC_ABI_DT_RELR"))
        {
            let file_id = symbol_db.file_id_for_symbol(symbol_id);
            if let layout::FileLayoutState::Dynamic(state) =
                &mut groups[file_id.group()].files[file_id.file()]
            {
                let symbol_index = state.symbol_id_range.id_to_offset(symbol_id);
                let version_index = state.object.versym[symbol_index].0.get(LittleEndian);
                state.format_specific_state.symbol_versions_needed[version_index as usize - 1] = true;
            }
        }

This could be added somewhere like finalise_find_required_sections. It'd need to have the SymbolDb added as an argument and would also need the groups as a mutable reference.

@mati865
Copy link
Copy Markdown
Member Author

mati865 commented Apr 9, 2026

I'm going to sleep right now. You can post a new PR or push it here, I don't know how my availability later today (April 9 UTC time) will look like.

@davidlattimore davidlattimore marked this pull request as ready for review April 9, 2026 00:44
@davidlattimore
Copy link
Copy Markdown
Member

I pushed changes along the lines of what I suggested above to this PR

@davidlattimore davidlattimore merged commit d08790f into wild-linker:main Apr 9, 2026
24 checks passed
@davidlattimore
Copy link
Copy Markdown
Member

Given that you might have limited availability, I decided to just merge it, since I was happy with the state of it. Hope that's OK. Can always follow-up in a separate PR.

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