3.6. Object File Portability

It is possible to create object files using Sourcery G++ for Power ELF or EABI that are link-compatible with the GNU C library provided with Sourcery G++ for Power GNU/Linux as well as with the CodeSourcery C Library or Newlib C Library provided with Power bare-metal toolchains. Currently this is only supported when compiling and linking for the e500mc (with -te500mc).

To use this feature, when compiling your files with the bare-metal Power ELF or EABI toolchain define the preprocessor constant _AEABI_PORTABILITY_LEVEL to 1 before including any system header files. For example, pass the option -D_AEABI_PORTABILITY_LEVEL=1 on your compilation command line. No special options are required when linking the resulting object files. When building applications for Power ELF or EABI, files compiled with this definition may be linked freely with those compiled without it.

Files compiled in this manner may not use the functions fgetpos or fsetpos, or reference the type fpos_t. This is because Newlib assumes a representation for fpos_t that is not AEABI-compliant.

Note that object files are only portable from bare-metal toolchains to GNU/Linux, and not vice versa; object files compiled for Power GNU/Linux targets cannot be linked into Power ELF or EABI executables.