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.

What is the proper way to list explicit object locations in the linker file?

Due to some restrictions we are working with a fairly old tms470 tool chain which would be probably impossible to update at this point, it is version 4.1.1. I am archiving a listing of about 2000 object files into a main library and then linking that library with any other libraries that are needed into the executable. Here is the command line:

lnk470.exe -b -a -x -q -w -c -priority -o output/bin/my_outfile.out -m output/bin/my_mapfile.map host_link.lcf output/lib/my_mainlib.lib many_other_libs.lib

with "many_other_libs.lib" being about 50 or so other .lib files all seperate. In my link.lcf file I have a something as shown below:

.FRAME_BUFFER : type = NOLOAD, align = 0x00100000
{
    *(.FRAME_BUFFER)
    output/lib/my_mainlib.lib<FrontDisplayBuffer.obj> (.bss)
} > ExternalRAM

The linker gives me the following warning:

>> host_link.lcf, line 178: warning:
    output/lib/my_mainlib.lib<FrontDisplayBuffer.obj>(.bss) not
    found

The object does have a .bss section, here is the output from ofd470 of the FrontDisplayBuffer.obj:

 

DEFINITION OF SECTION ".bss"
--------------------------------

Physical addr = 0x0, Virtual addr = 0x0, Size = 0x25820,
Number of relocation entries = 0, line number entries = 0
Flags = 0x280, Memory Width = 0 bits
[ Alignment = 4 units, Type = BSS ]

File pointers : Raw data at 0x0
: Relocation at 0x0
: Line # entries at 0x0

and here is the evidence that the FrontDisplayBuffer.obj is in the library using ar470 -t:

       3738   Thu Jul 12 09:57:20 2012    FrontDisplayBuffer.obj

Just in general I am seeing weird behavior with the linker finding explicit objects/object sections in this large my_mainlib.lib library. What is the correct way that you should tell the linker where these object files are located? I have had very different results when having the linker file placed before or after the my_mainlib.lib on the command line also have had other different behavior (objects that were before found but now not found) when using --search_path and --library. The assembly tools documentation is a little confusing to me as to when these different options are necessary. For reference I am archiving the objs using the command:

 

ar470.exe -vr1 output/lib/my_mainlib.lib obj_files