ARM Technical Support Knowledge Articles

Linker Error: L6242E: Cannot link object <objname> as its attributes are incompatible with the image attributes.

Applies to: ARM Developer Suite (ADS), RealView Compilation Tools (RVCT) for BREW, RealView Development Suite (RVDS)

Answer

Each object file generated by the compilation tools includes a set of attributes that indicate the options used to build the object and various other information. The linker checks the attributes of each object file it processes. If it finds attributes that are incompatible with the previous object files loaded the linker generates an error message of the form:

L6242E: Cannot link object <objname> as its attributes are incompatible with the image attributes

There are three common reasons for this error message:

1) Error: L6242E: Cannot link object foo.o as its attributes are incompatible with the image attributes.
... require 4-byte alignment of 8-byte datatypes clashes with require 8-byte alignment of 8-byte datatypes.

This can occur when linking RVCT objects with legacy objects built with ADS or RVCT 1.2. The Application Binary Interface (ABI) was changed between ADS and RVCT 2.0. In ADS and RVCT 1.2, "double" and "long long" data types were 4-byte aligned (unless -Oldrd or __align were used). In RVCT 2.0 onwards, "double" and "long long" data types are now 8-byte aligned, according to the new EABI.

These changes mean that legacy ADS/RVCT1.2 objects and libraries using "double" or "long long" data types are not directly compatible with RVCT 2.x/3.x objects/libraries, and so the linker will report an attribute clash.

Some compatibility is made possible, with some restrictions, by way of the --apcs /adsabi switch in RVCT 2.x/3.0. To allow RVCT 2.x/3.0 C objects to be used with legacy ADS C objects, compile the RVCT 2.x/3.0 C code with --apcs /adsabi (--apcs /adsabi was deprecated in RVCT 2.2 and removed from RVCT 3.1).

2) Error: L6242E: Cannot link object foo.o as its attributes are incompatible with the image attributes.
... pure-endian double clashes with mixed-endian double.

This can occur when linking RVCT or ADS objects with legacy SDT objects or objects built using --fpu softfpa or --fpu fpa. SDT uses a non standard format for little-endian 'double' and big-endian 'long long'. However ADS and RVCT use industry-standard 'double' and 'long long' types, except for when the --fpu softfpa and --fpu fpa are used. If you attempt to link object files that use the different formats for little-endian 'double' and big-endian 'long long' then the linker will report this error.

The recommended solution is to rebuild your entire project with RVCT. If you do not have the source code for an object or library, then try recompiling your RVCT code with --fpu softfpa (only supported in RVCT 2.1 and earlier).

3) Error: L6242E: Cannot link object foo.o as its attributes are incompatible with the image attributes.
... FPA clashes with VFP.

This error typically occurs when attempting to link objects built with different --fpu options. The recommended solution is to rebuild your entire project with RVCT, with the same --fpu options.

Related FAQ:

Article last edited on: 2009-04-16 15:48:09

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential