Tool/software: TI C/C++ Compiler
Hi,
Need a clarification on linker placement order:
There is a bewildering array of directives, UNION, SPLIT, GROUP, MEMORY, SECTION, etc.
In case we already have an linked and fully relocated .out file, in which funA@addrA, funcB@addrB, … funcY@addrY, and they are in an object file Old.obj .
Then we compile a new funZ(), which references some of the previous functions, providing the necessary declarations, and compile to an un-relocated Z.obj file.
Then we added Z.obj to the previous project, link it with existing Old.obj (not PARTIAL linking, because we are NOT relinking with an .out file containing relocation information). So the only difference is we add Z.obj, which only has outward references that needs to be relocated.
Then, would any of {addrA, … addrY} change?
Not sure of this because we have no linker source, and there are suspicions:
- In http://processors.wiki.ti.com/index.php/Program_Cache_Layout#--preferred_order_Option, there is “a weighted call graph (WCG)” concept for v7 of C6000 which create preferred placement order when involving cache, etc.
- In old version of linkers there have always been "--preferred_order" option.
We exclude the use of either (new funZ() never alter any call count, etc.), in this simple situation, please
- Accurately describe how functions and symbols are allocated, when SECTION/MEMORY are all specified. Say we have section beginning at 0Xc0000000 for .text, which functions from which objs will be allocated first?
- Does this differ between DSPs and other processors? The DSP compiler writers might have more considerations like memory hierarchies vs performance in their mind, so has allocation algorithms been changed anyhow?
- The linking and symbol RESOLUTION is recursively, which is obvious. Is the placement just plain old linear placement, from say 0Xc0000000, one after another and never winding back?
Dave