10.6.3 The symbol versioning script file

You can embed the commands to produce symbol versions in a script file.

You specify a symbol versioning script file with the command-line option --symver_script=file. Using this option automatically enables symbol versioning.

The script file supports the same syntax as the GNU ld linker.

Using a script file enables you to associate a version with an earlier version.

You can provide a steering file in addition to the embedded symbol method. If you choose to do this then your script file must match your embedded symbols and use the Backus-Naur Form (BNF) notation:

version_definition ::= 
  version_name "{" symbol_association* "}" [depend_version] ";"
      
symbol_association ::= 
  "local:" | "global:" | symbol_name ";"

Where:

  • version_name is a string containing the name of the version.
  • depend_version is a string containing the name of a version that this version_name depends on. This version must have already been defined in the script file.
  • "local:" indicates that all subsequent symbol_names in this version definition are local to the shared object and are not versioned.
  • "global:" indicates that all subsequent symbol_names belong to this version definition.

    There is an implicit "global:" at the start of every version definition.

  • symbol_name is the name of a global symbol in the static symbol table.

Version names have no specific meaning, but they are significant in that they make it into the output. In the output, they are a part of the version specification of the library and a part of the version requirements of a program that links against such a library. The following example shows the use of version names:

VERSION_1
{
    ...
};
VERSION_2
{
    ...
} VERSION_1;

Note:

If you use a script file then the version definitions and symbols associated with them must match. The linker warns you if it detects any mismatch.
Non-ConfidentialPDF file icon PDF versionARM DUI0474M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.