ARM calling conventions on WinCE and Linux?

Does WinCE and Linux use the same calling convention on ARM? What are the differences?

The documents that I have found so far do not explain very well. For example, at http://msdn.microsoft.com/en-us/library/ms864497.aspx he says “Windows CE.NET Compiler” on one line, but “ARM compiler” on the next line, and “CLARM” at the bottom. and it is unclear whether this applies to the same compiler or to other compilers. Here is what I have found so far ...

  • ARM Call Sequence Specification (WinCE) - Poorly Written Documentation
  • ARM to C calling convention (Linux) - unofficial explanation
  • Wikipedia - the OS is not specified and it does not say how the structures are processed, with floating point or 64-bit numbers, and it does not say where additional arguments are added if they do not fit into the registers.
  • Update: Procedure for calling Standard for ARM architecture - finally, I found a comprehensive document, but it does not say which operating systems follow the standard (or which options or additional restrictions that these OSs can use).

I ask that I try to use LLVM in WinCE to generate some simple code at runtime, but it only officially supports Linux.

+4
source share
2 answers

Call conventions are what are implemented by the compiler and are not operating system dependent. Having said that, I can confirm that both gcc and RVCT (ARM c / C ++ compiler) generate code that follows the conditional procedure convention for the ARM architecture that you mentioned above.

By looking at the link to the Microsoft documentation, I can also confirm that it complies with the ARM calling convention.

+2
source

I came across the same question for which I was trying to find the answer. Namely, where / that the document says something or defines the ARM ABI used under LINUX.

The following document is closest to answer

ARM GNU/Linux Application Binary Interface Supplement

this is with the help of CodeSourcery and in its abstract expression encoded, in my opinion, the answer to the question above, namely:

Application Binary Interface (ABI) for the ARM Architecture (a document published by ARM Ltd) defines the various compilation and linking aspects required for interoperability between the toolchains used for the ARM architecture.

However, since the ABI published in this document is designed without reference to a specific operating system, there are certain aspects that remain unspecified.

Apparently, the CodeSourcery document is intended to complement the ABI for the ARM architecture, indicating the decisions made for these aspects when using the GNU / Linux operating system.

I will put one link to this document (others can be found by searching for the name of the document):

http://www.boost.org/doc/libs/1_51_0_beta1/libs/context/doc/pdf/arm-linux-aapcs.pdf

It seems that the standard specifying ARM ABI under LINUX did not exist, and again it seems that the CodeSourcery document is an attempt to cover this aspect.

+1
source

Source: https://habr.com/ru/post/1315985/


All Articles