Generates a Position Independent eXecute Only (PIXO) library.
-mpixolib is disabled by default.
-mpixolib to create a PIXO library, which is a relocatable library containing eXecutable Only code. The compiler ensures that accesses to static data use relative addressing. To access static data in the
RW section, the compiler uses relative addressing using
R9 as the base register. To access static data in the
RO section, the compiler uses relative addressing using
R8 as the base registers.
When creating the PIXO library, if you use
armclang to invoke the linker, then
armclang automatically passes the linker option
armlink. If you invoke the linker separately, then you must use the
--pixolib command-line option. When creating a PIXO library, you must also provide a scatter file to the linker.
Each PIXO library must contain all the required standard library functions. Arm® Compiler 6 provides PIXO variants of the standard libraries based on Microlib. You must specify the required libraries on the command-line when creating your PIXO library. These libraries are located in the compiler installation directory under /lib/pixolib/.
The PIXO variants of the standard libraries have the naming format
- C library.
- Math library for targets with hardware double precision floating-point support that is compatible with
- Math library for targets with hardware single precision floating-point support that is compatible with
- Math library for targets without hardware support for floating-point.
- Software floating-point library. This library is required when:
printf()to print floating-point values.
- Using a math library that does not have all the required floating-point support in hardware. For example if your code has double precision floating-point operations but your target has
fpv4-sp-d16, then the software floating-point library is used for the double-precision operations.
- Little endian
- Big endian
NoteGeneration of PIXO libraries is only supported for Armv7‑M targets.
Generation of PIXO libraries is only supported for C code. However, the application that uses the PIXO library can have C or C++ code.
You cannot generate a PIXO library if your source files contain variadic arguments.
It is not possible for a function in one PIXO library to jump or branch to a symbol in a different PIXO library. Therefore, each PIXO library must contain all the standard library functions it requires. This can result in multiple definitions within the final application.
When linking your application code with your PIXO library:
- The linker must not remove any unused sections from the PIXO library. You can ensure this with the armlink
SHT_PROGBITSmust be kept in the same order and same relative offset for each PIXO library in the final image, as they were in the original PIXO libraries before linking the final image.
This example shows the command-line invocations for compiling and linking in separate steps, to create a PIXO library from the source file
armclang --target=arm-arm-none-eabi -march=armv7-m -mpixolib -c -o foo.o foo.c armlink --pixolib --scatter=pixo.scf -o foo-pixo-library.o foo.o mc_wg.l
This example shows the command-line invocations for compiling and linking in a single step, to create a PIXO library from the source file
armclang --target=arm-arm-none-eabi -march=armv7-m -mpixolib -Wl,--scatter=pixo.scf -o foo-pixo-library.o foo.c mc_wg.l