Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It makes more sense if you know of the small gotcha surrounding reading the PC: <em>most</em> instructions that read <em>PC</em> see a value of address_of_current_instruction+8 (except +4 in thumb mode, and <code>ldm</code> in ARM mode might be either +8 or +12 IIRC).</p> <p><code>cfldrdeq mvd15, [r12], #992</code> is not meant to be an instruction; it's a relative relocation that points to a relocation the DATA section. In the DATA section, there'll be a dynamic relocation that points to the actual address. Typical seudocode looks something like this</p> <pre><code> ldr r12,[pc,#small_offset_to_foo] ldr r12,[pc,r12] bx r12 ... a short distance away ... foo: int relative_offset_of_bar_from_the_second_ldr ... a galaxy far far away ... bar: int pointer_to_the_actual_syscall </code></pre> <p>I do not know why the disassembly for <code>syscall()</code> places "foo" between <code>ldr r12,[pc,r12]</code> and <code>bx r12</code>, causing the branch over the non-instruction "foo".</p> <p>It is also worth mentioning that simply pasting the code shown <em>will almost certainly not work</em>: you don't have the relocation that points to the <em>actual</em> implementation of syscall (in a debugger, step past <code>bx r12</code> and you should get there); you'll just branch to some randomish address.</p> <p>The error "cannot use register index with PC-relative addressing" is apparently because you're compiling in Thumb mode (the listing is ARM code). As for <code>cfldrdeq</code>, I believe it's just a conditional <code>cfldrd</code> instruction (the "eq" is a condition code), which Google suggests is related to a the Cirrus Logic "Maverick" processor series.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload