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 0x0
{
ER1 0x0
{
*armlib*(+RO)
}
ER2 +0
{
*cpplib*(+RO)
*(.init_array) ; Section .init_array must be placed explicitly,
; otherwise it is shared between two regions, and
; the linker is unable to decide where to place it.
}
ER3 +0
{
*(+RO)
}
ER4 +0
{
*(+RW,+ZI)
}
}
The name install_directory\lib\armlib is
used to indicate the ARM C library files that are located in the armlib directory.
The name install_directory\lib\cpplib is
used to indicate the ARM C++ library files that are located in the cpplib directory.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.