Skip to content

raw-dylib-elf: set correct DT_VERDEFNUM #145820

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mati865
Copy link
Member

@mati865 mati865 commented Aug 24, 2025

Previously it indicated a single version, regardless of their count.
Observed in: davidlattimore/wild#1041

@rustbot
Copy link
Collaborator

rustbot commented Aug 24, 2025

r? @jdonszelmann

rustbot has assigned @jdonszelmann.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 24, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@jdonszelmann
Copy link
Contributor

I'm sorry but I'm not sure I can judge this, gonna ask someone else. Maybe Bjorn? r? @bjorn3

@rustbot rustbot assigned bjorn3 and unassigned jdonszelmann Aug 24, 2025
@bjorn3
Copy link
Member

bjorn3 commented Aug 24, 2025

Makes sense. Thanks!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 24, 2025

📌 Commit 8ce7647 has been approved by bjorn3

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 24, 2025
if !vers.is_empty() {
stub.reserve_gnu_versym();
stub.reserve_gnu_verdef(1 + vers.len(), 1 + vers.len());
stub.reserve_gnu_verdef(verdef_count, verdef_count);
}
stub.reserve_dynamic(2); // DT_SONAME, DT_NULL
Copy link
Member

Choose a reason for hiding this comment

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

This will need to be updated to account for the DT_VERDEFNUM entry.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, good catch!
I think readelf would have caught this issue when manually inspecting the results, but it requires program headers to be present (without them, it just prints There is no dynamic section in this file.).
Unfortunately, objdump is too resilient to errors to catch that.

@bjorn3
Copy link
Member

bjorn3 commented Aug 24, 2025

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 24, 2025
@mati865 mati865 force-pushed the raw-elf-verdefnum branch 2 times, most recently from 5ddb747 to f6e62e4 Compare August 24, 2025 16:18
Previously it indicated a single version, regardless of their count.
Observed in: davidlattimore/wild#1041
@mati865 mati865 force-pushed the raw-elf-verdefnum branch from f6e62e4 to b1be775 Compare August 24, 2025 16:19
@mati865
Copy link
Member Author

mati865 commented Aug 24, 2025

Sorry for the pushes in the rapid succession. I was too hastily with a fix.

I have to admit, syncing both places is a bit annoying, but I don't know if creating a wrapper over .dynamic section is justified given there is not much going on there.

@bjorn3
Copy link
Member

bjorn3 commented Aug 24, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 24, 2025

📌 Commit b1be775 has been approved by bjorn3

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 24, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 24, 2025
raw-dylib-elf: set correct `DT_VERDEFNUM`

Previously it indicated a single version, regardless of their count.
Observed in: davidlattimore/wild#1041
bors added a commit that referenced this pull request Aug 24, 2025
Rollup of 6 pull requests

Successful merges:

 - #135761 (Dial down detail of B-tree description)
 - #144373 (remove deprecated Error::description in impls)
 - #145620 (Account for impossible bounds making seemingly unsatisfyable dyn-to-dyn casts)
 - #145783 (add span to struct pattern rest (..))
 - #145817 (cg_llvm: Replace the `llvm::Bool` typedef with a proper newtype)
 - #145820 (raw-dylib-elf: set correct `DT_VERDEFNUM`)

r? `@ghost`
`@rustbot` modify labels: rollup
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 24, 2025
raw-dylib-elf: set correct `DT_VERDEFNUM`

Previously it indicated a single version, regardless of their count.
Observed in: davidlattimore/wild#1041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants