title: llsr and llsl (64-bit shift) for ARM Cortex-m3
body: <p>I'm trying to cross compile some code (tweetnacl) over to arm-none-eabi (bare metal cortex-m3)</p>
  
  <p>It has this function which does a 64-bit rotate:</p>
  
  <pre><code>static u64 R(u64 x,int c) { return (x &gt;&gt; c) | (x &lt;&lt; (64 - c)); }
  </code></pre>
  
  <p>The linker complains that it can't find the routines to do the 64-bit left shift and right shift:</p>
  
  <pre><code>tweetnacl.c:487: undefined reference to `__aeabi_llsr'
  tweetnacl.c:487: undefined reference to `__aeabi_llsl'
  </code></pre>
  
  <p><strike>I can't find much information on these routines.</strike>  auselen has provided a reference to the correct documentation which defines these functions.  Tool chain version that I'm using:</p>
  
  <pre><code>arm-none-eabi-gcc (Sourcery G++ Lite 2010q1-188) 4.4.1
  </code></pre>
  
  <p>Are implementations present in this tool chain?  What possible flags might cause the build process to exclude any compiler provided implementation? </p>
  
  <hr>
  
  <p><strong>Solution</strong>: turns out I needed to link in libgcc.a</p>