You copied the Doc URL to your clipboard.

Example of placing ARM C++ library code

You can place C++ library code using a scatter file.

The following is a C++ program that is to be scatter-loaded:

#include <iostream>

using namespace std;

extern "C" int foo ()
{
  cout << "Hello" << endl;
  return 1;
}

To place the C++ library code, define the scatter file as follows:

LR 0x8000
{
    ER1 0x0
    {
        *armlib*(*)
    }
    ER2 +0
    {
        *libcxx*(*)
    }
    ER3 +0
    {
        *(+RO)
        *libcxx*(.ARM.exidx*) ; These sections must be placed explicitly,
        *armlib*(.ARM.exidx*) ; otherwise they are shared between two regions, and
        *(.ARM.exidx*)        ; the linker is unable to decide where to place them.
    }
    ER4 +0
    {
        *(+RW,+ZI)
    }
}

The name *armlib* matches install_directory\ARMCompiler6\lib\armlib, indicating the ARM C library files that are located in the armlib directory.

The name *libcxx* matches install_directory\ARMCompiler6\lib\libcxx, indicating the C++ library files that are located in the libcxx directory.

Was this page helpful? Yes No