[edk2] Latest CodeSourcery gcc does not work with edk2

Subject: [edk2] Latest CodeSourcery gcc does not work with edk2

From: Andrew Fish <afish@apple.com>

To: edk2-devel@lists.sourceforge.net

Date: 2010-12-14 22:14:20

  • 2010-12-14 22:14:20  Andrew Fish   [edk2] Latest CodeSourcery gcc does not work with edk2
Just to let every one know the current CodeSourcey tools (2010.9-51 eabi) do not work with the edk2 due to lack of function typing in the assembler files. This leads to a situation where calling to ARM (all of our hand written) assembly does not generate the blx, it just generates a bl. Running ARM code in Thumb2 mode causes the system to crash.....

> The branches to the assembly functions are incorrectly compiled to a bl
> instruction after linking which causes the CPU never to change the mode.

Most likely you have not given your assembly symbols the correct type.
In particular function symbols need to be marked as such using the .type 
directive. e.g:

  .type my_fn_name, %function

Previous CodeSourcery toolchains incorrectly assumed that all untyped symbols 
referenced ARM code.  The 2010.09 toolchains fixed this bug, in line with the 
behavior specified by the ARM EABI.  Specifically the linker should not 
attempt to manipulate call relocations (insert veneers or do bl/blx 
conversion) unless the target symbol has function type.

Andrew Fish