-
Notifications
You must be signed in to change notification settings - Fork 159
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
elf: symbol version utility APIs #282
Comments
The main requirement is to look up the version information for a given version index. Instead of using iteration like in I'm not sure of the value of providing |
I wonder if it would make sense to offer both, in case you want to lookup a single version similar to the link in the second bullet item above, In that case you don't have to build the full I don't see how the glibc dynamic loader relies on sequential version indices in the lines you linked. It seems to compute the max index and allocate an array with the corresponding size (like your implementation does). Or did you refer the "rely" on the allocation size, meaning you hope there is no bad version index?
I manly choose a If computing this information is quiet special in every usage, then we should keep it to the user and not provide an utility here. |
Sure. For that use, it doesn't make sense to me that you would want to check both verdefs and verneeds for the same symbol. You should already know which it might be in. So it might be more useful as separate methods on
Yeah, "rely" is probably too strong. If the version indices are random values in the 15-bit range then the algorithm is going to use a larger amount of memory.
It's hard to know based on one case. I don't have strong opinions about what to do here. |
Indeed, in that case you should already know in which section to look for. Having a lookup on each section sounds good to me. I could continue to prototype a bit, but I also understand if you only want to add this sort of utility APIs if there is a "real" user.
Maybe best is to wait and see some more uses, instead of providing something that's not useful to many :] |
After landing PR #280, which provides parsing of elf symbol version information, I wanted to discuss about higher-level utility APIs that would cover common use-cases.
In general I see the following use-cases:
I prototyped a bit here johannst/goblin@johannst:master...johannst:elf-gnu-symbol-versioning-utils, but note that the
find_version
algorithm needs somePlease let me know what you think about providing such utilities and if you see other use-cases.
The text was updated successfully, but these errors were encountered: