Error LNK2013 "overflow overflow"

I have a Windows 8 application written in C ++ that I am trying to compile for ARM. During binding, I get many examples of the following error:

"error LNK2013: BLX23(T) fixup overflow. Target '<mangledName>' is out of range" 

The MSDN website says: "You can solve this problem by creating multiple images or by using the / ORDER option so that the team and the target are closer to each other."

But I really don't understand how to do this. These characters are generated by the compiler and it has no Itanium architecture, so the other suggestions on this page do not apply. In addition, files with errors are * .g.cpp files generated by the compiler from the xaml pages included in the project.

The metro application works fine in the Win32 configuration, so I wonder if someone with more experience in ARM can better understand how to solve this problem.

Customization is Visual Studio 2012 RC on Windows 8 RP x64.

+4
source share
2 answers

This is due to an unsuccessful error in incremental binding to ARM, and it can be circumvented by disabling the incremental link. As mentioned in another answer, this is because the called function and the call site are so far apart that the linker needs to insert long island branches (and there is a special mistake with creating islands with long branches when using an incremental link).

As far as I know, this error was not fixed for RTM (when I discovered this problem myself, it was too late to fix the RTM release), but it is known and is planned to be fixed for a future version.

+8
source

The main problem is that the ARM instruction set only supports relative translations for instructions that the compiler is trying to use to generate a function call, and that these translations have a limited number of bits in them. In your case, you have so much code that the called function and the call site are so far apart in the address space that there are not enough bits in the offset for the compiler to generate the correct call command.

This can happen on ARM and IA64 (Itanium), but it cannot happen on x86 and x86-64, because these instruction sets have jump / call commands that can go into any possible address in the process address space.

The only correction is to move the caller and the interlocutor closer to each other in the final executable image. One way to do this is simply to move the code in the source files, because usually the compiler and linker code is placed in the executable in the same order in which the functions are declared in the source (within the same translation unit). Optimizations often change this order, but for the most part it is something like this.

Another option, as indicated in the link above, is to use the linker /ORDER command line option to move functions manually. Create an order file and collect functions that demonstrate this problem, assuming there are not many. Since it looks like you are dealing with auto-generated code, this is probably the best option because you do not want to edit the code every time it is restored.

You can also post an error report to connect.microsoft.com , since the default toolbox should not really force you to deal with this rather strange error (which is a very real error due to limitations set by the ARM instruction - this is not a compiler error )

+2
source

All Articles