This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Tracing symbol dependency

Is there a way to get the toolchain to output dependency information in the map file?  For example, if I see a reference to a C runtime function that I don't think should be there and I want to know which object (and which function in that object) caused the linker to calculate that dependency, is there a way to extract that information?

Thanks!

--Miles

  • Not directly, but you can use the nm utility to see which symbols a particular object file refers to.  You can gather the list of all object files which refer to a symbol.  Drop those which do not appear in your linker map file.  Repeat until you get to a function you wanted to include.

    Is the unwanted function a C I/O function?  Does your linker map file unexpectedly contain feraiseexcept?

  • The unwanted function was a string printf formatting function that was part of XDC.  One of the SYS/BIOS folks helped me disable the feature that was including it.

    Using nm or objdump to search for symbol reference can be tricky if the referring function is not, itself, referenced (and each function is in its own section...).   

    Maybe in a future version we can add a command line switch to the linker to have it dump dependency chains for each symbol in the map file.  :)

    Thanks!