This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

armlink: symdefs generation

Note: This was originally posted on 19th November 2008 at http://forums.arm.com

Hi all,

I use ARM linker, ADS1.2 [Build 848].
I found some strangeness with generation of the Symbol Definitions file.
So, what I do, step by step (with CodeWarrior):

1. Project->Remove Object Code
2. Make
The symdefs file is created, and 89 global symbols are written to the symdefs file.
After that I repeat:
3. Project->Remove Object Code (symdefs file is not deleted automatically).
4. Make
The symdefs file is rebuilt, but only 67 global symbols have been remained in the symdefs file.

As I change nothing, just rebuild the project, I expect that the number of global symbols must not be changed, and as a result the symdefs file should be identical to the previously created.

Please, could somebody explain me where I am wrong? And, what do I have to do to avoid this problem?

Thank you,
Alexandre.
  • Note: This was originally posted on 4th December 2008 at http://forums.arm.com

    So, I have verifyed optimization and feedback.
    -feedback is not supported.
    "no optimization" does not help.
    :)
  • Note: This was originally posted on 27th November 2008 at http://forums.arm.com

    Hello, arunjr,

    thank you for interest! If I remember exactly, I was trying -feedback, but unfortunately ARM linker from ADS1.2 [Build 848] does not support it  :)  . Anyway I will look precisely at this poit tomorrow, and will try to suppress all optimization.

    Thanks.
  • Note: This was originally posted on 25th November 2008 at http://forums.arm.com

    may be the 22 symbols which got removed were not used at all in the final binary?
    In the link which Jacob has given, it asks to remove the unused symbols manually. we write symdefs manually and feed it to the linker. I dont know about ADS. sorry. but may be it removed automatically?(seems like!)
    cheers
    Aj

    Jacob, arunjr, thanks a lot for answers.
    I understand what you mean. I have read armlink documentation thoroughly. This is because I'm discouraged.

    Since I do not modify symdefs file at all, and since the first time created file already includes ALL global symbols, and since I do not modify my sources/project/options etc but just recompile/relink the project, so, exactly the same set of global symbols should be generated in the "temporary output file" (in terms of Jacob's link), and no one line must be added or deleted from the original one.

    Jacob's link:
    -----------------------------------------------------------------------
    armlink updates a symdefs file as follows:

    1. armlink creates a temporary output file.

    2. Lines from filename are processed:

        a. The comments and blank lines are copied unchanged to the temporary file. [color="#0000FF"][Aleph1024] there are no comments and no empty lines in the file, as this file is created by armlink and not modified manually[/color]

        b. When a symbol name is found in filename, the definition of the named symbol from the current image is output to the temporary file. [color="#0000FF"][Aleph1024] image should be the same with the same set of global symbols since nothing has been changed[/color]

    Note
    If a symbol occurs in filename more than once, only one definition of the symbol is placed in the temporary file. [color="#0000FF"][Aleph1024] symbol cannot be duplicated since the file is standard armlink generated one without any changes[/color]

    If a symbol is found in filename but is not defined in the current image, no output will be produced for that symbol. [color="#0000FF"][Aleph1024] all symbols should be found as nothing has been modified/added/deleted[/color]

    If the final link is successful, filename is deleted and the temporary file renamed as filename.[color="#0000FF"][Aleph1024] New shorter file is created[/color]
    -----------------------------------------------------------------------
    :)
  • Note: This was originally posted on 25th November 2008 at http://forums.arm.com

    I'm afraid that I'm not very familiar with ADS 1.2, however, [url="http://infocenter.arm.com/help/topic/com.arm.doc.dui0151a/ch04s02s02.html"]this page[/url] may explain what you're seeing:

    Does that help?
    Jacob

    may be the 22 symbols which got removed were not used at all in the final binary?
    In the link which Jacob has given, it asks to remove the unused symbols manually. we write symdefs manually and feed it to the linker. I dont know about ADS. sorry. but may be it removed automatically?(seems like!)
    cheers
    Aj
  • Note: This was originally posted on 27th November 2008 at http://forums.arm.com

    Hi Aleph1024,
    do you have --feedback option enabled for your linker?
    ref : RVCT linker and Utilities guide , chapter - 3.3.5. Linker feedback
    (--feedback is used to strip down the unused symbols during linking, during 'second build'.)

    and if the problem still persists, just try compiling with no optimization options(remove the inlining options too) and see whether the symdef file generated are still the holding good every time. But anyways, plz post the result. its interesting to know the answer.
    good luck.  :)
    cheers
    Aj
  • Note: This was originally posted on 25th November 2008 at http://forums.arm.com

    I'm afraid that I'm not very familiar with ADS 1.2, however, [url="http://infocenter.arm.com/help/topic/com.arm.doc.dui0151a/ch04s02s02.html"]this page[/url] may explain what you're seeing:
    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.

    Does that help?
    Jacob