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.
When I use a library like 'ipc.lib' which includes 'a.obj' and 'b.obj', how can I put the '.text' section of 'a.obj' to a group like 'mygroup'.
Furthermore how can I just put a function of 'a.obj' in 'ipc.lib' to a group?
like this:
.FblHdr_AppStart :
{
*(.FblHdr_AppStart)
} > DDR0_APP_HDR,
RUN_START(_FblHdr_AppStart_RUN_START),
RUN_END(_FblHdr_AppStart_RUN_LIMIT)
Hi! You can call out individual object files (and individual sections) from a library by using this syntax:
.output_section { ipc.lib<a.obj>(.text) } > MEM_REGION
The linker works with sections, not functions in particular, but if function subsections is enabled, this will allow you to name explicit function subsections.
In your example code, ".FblHdr_AppStart" identifies an output section, not a group, so I'm not sure if you are referencing by referring to a "group". The linker does support grouping of output sections with common allocation. This can be incorporated into a GROUP by using the GROUP keyword
SECTIONS
{
GROUP
{
.output_section { ipc.lib<a.obj>(.text:myfunc) }
} > MEM_REGION
}
For more information about how this works, please search the TI ARM assembly tools manual for the sub-chapter titled "Linker Command Files"
Hi,there is something i want to ask:
1."The linker works with sections, not functions in particular, but if function subsections is enabled, this will allow you to name explicit function subsections.", I want to know how to enable function subsections ?
2.Whether i can link my function just by a.obj (.text:myfunc) rather than ipc.lib<a.obj>(.text:myfunc)? like this:
SECTIONS
{
GROUP
{
.output_section {a.obj(.text:myfunc) }
} > MEM_REGION
}
3.Does "myfunc" is the name of my function in "ipc.lib<a.obj>(.text:myfunc)" ?
how to enable function subsections ?
Please search the TI ARM compiler manual for the option --gen_func_subsections.
Whether i can link my function just by a.obj (.text:myfunc) rather than ipc.lib<a.obj>(.text:myfunc)?
No. Because a.obj comes from a library, and that syntax is the only way the linker knows it.
Does "myfunc" is the name of my function in "ipc.lib<a.obj>(.text:myfunc)" ?
When you adapt this example, replace myfunc with the name of the function in the library.
One additional detail to consider ... I don't think you need to use GROUP. In a linker command file, a GROUP is for organizing multiple output sections together in a specific order. I don't think you need to do that. To understand more, please read the first part of the article Linker Command File Primer, then page down to the part of the article titled Group Output Sections Together.
Thanks and regards,
-George
Hi:
in this chapter 4.2.1 Generate List of Dead Functions (--generate_dead_funcs_list Option), Now I want to reduce my code size with deleting the functions not used, but I have a lot of libraries, how can I deal with them? should I use the option "--generate_dead_funcs_list" when complier the library? By the way, should I use the flag during compiling or linking process, or both?
I apologize. We should have removed the --generate_dead_funcs_list option from the documentation. It is only useful when using the compiler with the older ABI's that were previously supported. When you build with EABI, which is now the only ABI presently supported, this option is not useful. Please ignore it. When you build with --gen_func_subsections, functions that are never called are automatically removed.
Thanks and regards,
-George
Hi,if pdk's libs(such as ti.drv.i2c.aer5f) compile with --gen_func_subsections?
if pdk's libs(such as ti.drv.i2c.aer5f) compile with --gen_func_subsections?
I don't know. But I can show you how to find out. Run a command similar to ...
% armofd --obj_display=none,sections ti.csl.aer5f | findstr /v /c:" N " | findstr "OBJECT .text" OBJECT FILE: csl_arm_r5.oer5f 1 .text 0x00000000 0x00000000 0x278 4 Y OBJECT FILE: csl_arm_r5_mpu.oer5f 1 .text 0x00000000 0x00000000 0xf4 2 Y OBJECT FILE: csl_arm_r5_pmu.oer5f 1 .text 0x00000000 0x00000000 0x106 2 Y OBJECT FILE: csl_arm_r5_hard_err_cache.oer5f 1 .text 0x00000000 0x00000000 0x34 2 Y OBJECT FILE: interrupt.oer5f 12 .text 0x00000000 0x00000000 0x0 2 Y 14 .text:IntDefaultHandler 0x00000000 0x00000000 0x12 2 Y 15 .text:undefInstruction... 0x00000000 0x00000000 0x74 4 Y 16 .text:swIntrExptnHandler 0x00000000 0x00000000 0x4c 4 Y <and so on>
The command armofd is the object file display utility. It is located in the same directory as the compiler armcl. It is documented in the TI ARM assembly tools manual. The options --obj_display=none,sections cause it to only display summary information about sections. The library used here is ti.csl.aer5f. I doubt it is from the same PDK as you use. But the output might be representative. The utility findstr is a command built-in to Windows. The first one filters out lines that have a lone N on them. Such sections are not loaded to the target, and thus are not of interest. The second findstr command removes all lines except those that have either OBJECT or .text on them. This shows us the names of the object files in the library, and the .text sections that are in those object files. In this specific case, some object files have only one .text section in them. These files are not built with --gen_func_subsections. But, because there is only one .text section, it doesn't matter. Other object files have section names of the form .text:name_of_function. These files are built with --gen_func_subsections.
Thanks and regards,
-George