ARM Overview: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
Pancakes (talk | contribs)
m finally got it right
Pancakes (talk | contribs)
m changed statement meaning from "should" to "need" for usage of LIBGCC and make it more attraction for people to check out links about cross-compiling and libgcc than forum links (which might cause them to try to go around using libgcc)
Line 249:
==Coding Gotchas==
===== Missing Division Functions (__aeabi_uidivmod, __aeabi_idiv) / No Division Support =====
This is caused by using GCC and not linking with ''libgcc''. It isYou ''highlyNEED TO'' recommended that you link with ''libgcc'' when using GCC. For information about why you should link and information about ''libgcc'', read [[Libgcc]] and [[GCC_Cross-Compiler]].
 
You must also make sure you use the ''libgcc'' that has been compiled for your target machine/architecture/platform. See [[Libgcc]] for more information. You can produce the correct library for GCC by reading [[GCC_Cross-Compiler]].
 
====== This section is just if you want a more in depth explanation and discussion. ======
This issue is actually complicated because different CPUs may not support hardware division, support it only through the floating point operations, in thumb mode, in native mode, or a combination. Also, in certain situations you may find it faster or more compact to use different methods because you may be interested in code size or performance. Normally,The ''libgcc'' will handle all of these situations and provide the needed symbols, however here are some various sources of information that can give you a more in-depth understanding:
 
<pre>
The following links talk about different methods in handling this problem:
http://forum.osdev.org/viewtopic.php?f=1&t=23857&p=212244
 
http://stackoverflow.com/questions/8348030/how-does-one-do-integer-signed-or-unsigned-division-on-arm
http://forum.osdev.org/viewtopic.php?f=1&t=23857&p=212244
 
http://stackoverflow.com/questions/8348030/how-does-one-do-integer-signed-or-unsigned-division-on-arm
 
Also, some extra information that maybe useful:
http://www.linkedin.com/groups/ARM-cores-hardware-division-85447.S.242517259
 
A discussion about this section, and also at the end an example of LIBGCC's version of the functionsdivide function:
http://www.linkedin.com/groups/ARM-cores-hardware-division-85447.S.242517259
http://forum.osdev.org/viewtopic.php?f=8&t=27767
 
A discussion about this section, and also at the end an example of LIBGCC's version of the functions:
 
http://forum.osdev.org/viewtopic.php?f=8&t=27767
 
The source for LIBGCC and source of the division emulation function:
https://github.com/mirrors/gcc/blob/master/libgcc/udivmodsi4.c
 
https://github.com/mirrors/gcc/blob/master/libgcc/udivmodsi4.c
</pre>
 
https://github.com/mirrors/gcc/blob/master/libgcc/
 
===== Unaligned Memory Access And Byte Order =====
{| border="1px"