--symdefs=filename linker option
Creates a file containing the global symbol definitions from the output image.
where filename is the name of the text file to contain the global symbol definitions.
By default, all global symbols are written to the symdefs file. If a symdefs file called filename already exists, the linker restricts its output to the symbols already listed in this file.
If you do not want this behavior, be sure to delete any existing symdefs file before the link step.
If filename is specified without path information, the linker searches for it in the directory where the output image is being written. If it is not found, it is created in that directory.
You can use the symbol definitions file as input when linking another image.