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

Help.. moving from GNU linker to armld

Presently, I use ARM cc compiler with GNU Linker, And I've been trying to move completely to the ARM toolchain. But I am not sure how to add symbols in ARM linker while using scatter file..

In ARM GNU linker, while using the .ld file, I could add my own symbol to the symbol table, so that i could add some Hardware registers like...
    MY_HW_BASE = 0x1000;
    MY_HW_REG1 = MY_HW_BASE + 0x03;

(Just like variables in C)

Any ideas if it can be done with ARM toolchain?

  • Hi

    I have moved this question to 'Software Tools' in order to try and help you get a resolution to your question. 

    Thanks

    Ryan

  • Hi Rajesh,

    I don't think we can **exactly** replicate the functionality you have in the GCC linker file - the ARM compilers go about things in a slightly different way. It should be possible to get the symbols you need where you need them, but I think the best way to do that with the ARM compilers is to split the functionality between the scatter file and the C source.

    Easiest way is probably to create an empty execution region in the scatter file with the correct base address for your register block, then reference that in your C source as an external variable. The ARM linker user guide contains the details you need: it looks like section 8.4 for creating the execution region, and section 6.3.2 for referencing execution block symbols from your C source. The user guide can be found here: https://developer.arm.com/products/software-development-tools/compilers/arm-compiler/docs

    Hopefully that should get you up and running! If you have current support & maintenance cover, our support experts are probably the best people to help with challenges like this - https://www.arm.com/support/index.php is a good place to start for that.

    Thanks,

    Paul.