Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Exporting Symbols

As part of building a shared library, plug-in, or other software that will export symbols, you want to specify which symbols are available to clients of the software. The fewer symbols your software exports, the more quickly it will load at runtime. In addition, you typically do not want to expose internal entry points, due to both competitive and support issues.

CodeWarrior provides several options for specifying which symbols a shared library will export.

You can include your export file in an Xcode project as well, by setting the Exported Symbols File build setting to the name of your export file. Xcode passes the appropriate options to the static linker.

Note: The static linker also supports the -unexported_symbols_list option to specify a file containing symbols that should not be exported. However, there is currently no built-in build setting in the Xcode interface for setting this option.

You can’t use the pragma statements #pragma export on and #pragma export off to specify export symbols in Xcode because GCC does not support these pragma statements. However, GCC does have its own pragmas for controlling symbol visibility, described in C++ Runtime Environment Programming Guide.

Beginning with Xcode 2.2, the importer interprets the Export Symbols setting in your CodeWarrior target. Based on the following values for that setting, the importer configures the corresponding Xcode target differently:

The importer does not interpret the Referenced Globals or Use #pragma settings.

For related information in this document, see “Runtime and Library Issues,” “Dead Code Stripping,” and “Pragma Statements.”

For additional information on examining and managing your software’s exported symbols, and on other techniques for producing more efficient code, see Code Size Performance Guidelines. In particular, the section “Minimizing Your Exported Symbols” describes how to reduce the symbols exported by your application.



< Previous PageNext Page > Hide TOC


Last updated: 2006-10-26




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice