4.2.2. Creating a symdefs file

Use armlink option -symdefs filename to produce a symdefs file.

armlink produces a symdefs file during a successful final link stage. It is not produced for partial linking or for unsuccessful final linking.

Note

If filename does not exist, the file is created containing all the global symbols. If filename exists, the existing contents of filename are used to select the symbols that are output when armlink rewrites the file.

Outputting a subset of the global symbols

By default, all global symbols are written to the symdefs file.

When filename exists, armlink uses its contents to restrict the output to a subset of the global symbols. To restrict the output symbols:

  1. Specify -symdefs filename when you are doing a nearly final link for image1. armlink creates a symdef file filename.

  2. Open filename in a text editor, remove any symbol entries you do not want in the final list, and save the file.

  3. Specify -symdefs filename when you are doing a final link for image1.

    You can edit filename at any time to add comments and relink image1 again to, for example, update the symbol definitions after one or more objects use to create image1 have changed.

armlink updates a symdefs file as follows:

  1. armlink creates a temporary output file.

  2. Lines from filename are processed:

    1. The comments and blank lines are copied unchanged to the temporary file.

    2. When a symbol name is found in filename, the definition of the named symbol from the current image is output to the temporary file.

      Note

      If a symbol occurs in filename more than once, only one definition of the symbol is placed in the temporary file.

      If a symbol is found in filename but is not defined in the current image, no output will be produced for that symbol.

  3. If the final link is successful, filename is deleted and the temporary file renamed as filename.

Copyright © 2001 ARM Limited. All rights reserved.ARM DUI 0151A
Non-Confidential