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.

strange boot.ae66 link

Hello.

I have
/opt/ti/ti-cgt-c6000_8.0.1/bin/cl6x
and
/opt/ti/xdctools_3_23_04_60/packages/ti/targets/rts6000/lib/boot.ae66

On this command
/opt/ti/ti-cgt-c6000_8.0.1/bin/cl6x <...> --search_path=/opt/ti/xdctools_3_23_04_60/packages/ti/targets/rts6000/lib --library=boot.ae66 <...>
linking isn't done without any errors.

But if I move "--library=boot.ae66" to linker.cmd than it works.

What is that?

  • For the problem build, please show the complete and exact command line.  And show the error which results.  I might be able to explain things with that alone.  But it is likely I will need to reproduce the problem in order to explain it.

    Thanks and regards,

    -George

  • For the problem build, please show the complete and exact command line. 

    I gave you all necessary EXACT information.

    And show the error which results.
    I said that linking isn't done without any errors.

    But it is likely I will need to reproduce the problem in order to explain it.
    Really? So what's the problem for you to reproduce it? May be you will pay users the salary for doing your job if you won't/can't do that?
    Example build 5327.test.tar.gz

    Btw, your gdb (linux-c6x/linux-c6x-2.0.0.63/opt/gcc-c6x/bin/c6x-uclinux-gdb) crash with segfault on view locals and several else commands.
    Crappy soft, sad work, guys.

  • Alex,
    there are two boot.ae66 files, one comes from xdctools and another from the compiler. You are using xdctools, so you probably want the one from xdctools but I can't really tell because I can't see the rest of your project. Moving "--library=boot.ae66" to linker.cmd changes which boot file you are getting.
    You are also using a relatively old version of xdctools and a fresh new compiler, and I don't think anyone ever tested these two together so that might be an additional source of trouble.
    I'll try now to replicate the failure and I'll get back to you with more info.
  • Alex,
    the cause of your problem is the order of -llibc.a and --library=boot.ae66. If libc.a comes first, then the symbol _c_int00 is found there and boot.ae66 is excluded from the link because there are no unresolved symbols there. When boot.ae66 is excluded from the build, reset__I function defined in app_pe66.oe66 does not get linked in, which in the example you sent me means nothing from ti.targets.rts6000.ae66 is linked in. In a realistic example, the consequences are different but in any way if you are using XDCtools, you need the boot file from XDCtools.
    To always have that, use the order that XDCtools enforce when creating the linker command line:
    1. app_pe66.oe66
    2. ti.targets.rts6000.ae66
    3. boot.ae66
    4. libc.a (this one should actually just go to the end after everything else)
    It doesn't matter which of these is in the linker command file or on the command line, only the order matters.
  • Ki-Soo Lee said:
    You are using xdctools, so you probably want the one from xdctools

    Sasha Slijepcevic said:
    in any way if you are using XDCtools, you need the boot file from XDCtools
    I want them, and I use them. This file is
    /opt/ti/xdctools_3_23_04_60/packages/ti/targets/rts6000/lib/boot.ae66. And it's specified in search path.

    Ki-Soo Lee said:
    Moving "--library=boot.ae66" to linker.cmd changes which boot file you are getting.
    What? I hope you're joking. Yet one boot.ae66 in opt/ti/bios_6_40_01_15/packages/ti/targets/rts6000/lib/. And I have no "another from the compiler".

    Sasha Slijepcevic said:
    and boot.ae66 is excluded from the link because there are no unresolved symbols there

    But generated .out does not work on the dsp core SILENTLY without any error!! Is it normal for project build? NO! What a hell you're doing this? It's unacceptable dirty hack.

  • Have you tried ordering the relevant files as I recommended in my previous post? It should work fine based on the test case you posted.
    As for how the boot file, just because you have a library on the linker command line, it doesn't mean it has to be used. If the linker is looking for a symbol, an entry point for example, the linker will resolve it in the first library it finds on the command line. Any other library that defines that same symbol will be ignored. The process repeats for all symbols. This is how all linkers work, and I am sure if you search for "how linkers work" you'll find an explanation with more details.
    I am not sure what kind of error you expect from the generated .out file. The linker generated a valid executable based on the instructions given to it on the command line.
  • That is work, thanks.
    But you don't understand that such hidden hack cause hidden error if something goes wrong with linking command line.
    It is absolutely abnormal. I know how linkers work.
    You MUST include boot into app_pe66.oe66 (one library isn't enough?) or create external call between them with meaningful name like "check_bootlib_linked" which would crash.
    I write manually my own build and I don't want to think about your libraries relations.
    If something work it does not mean that it work right.
    Normal build is crash or work. All the rest is monkeycode . Think about it with your coders.