-
-
Notifications
You must be signed in to change notification settings - Fork 57
Description
We already support linking against shared objects that define symbol versions and emitting those symbol versions into the resulting binary so that the correct symbol can be selected at runtime.
However we don't as yet support building shared objects that define their own symbol versions.
Or put another way, we support referencing symbol versions, but don't support defining them.
When building a shared object, symbol versions can be defined by a version script. We have limited support for version scripts already, but only the part that allows symbols to be downgraded to locals. See VersionScript
in linker_script.rs
. This parsing would need to be extended to support more of the version script syntax. See https://sourceware.org/binutils/docs/ld/VERSION.html
Then version definitions and symbol -> version ID mappings would need to be written to the output shared object.
It'd also be good to extend linker-diff to verify as much of this as possible. i.e. check that the symbols in our output file have the same versions as those output by the reference linker.