dmd asm output

John Colvin john.loughran.colvin at gmail.com
Mon Apr 1 04:27:56 PDT 2013


On Monday, 1 April 2013 at 11:10:56 UTC, Artur Skawina wrote:
> On 04/01/13 12:24, js.mdnq wrote:
>> On Monday, 1 April 2013 at 01:54:10 UTC, John Colvin wrote:
>> What's after the code?
>> 
>> The 0x76 call is an inline call function, the ret returns it. 
>> The stuff before it is setting up the registers for the call 
>> and what comes after
>> 
>>> 0x0000000000000076 <+54>:    call   0x7b 
>>> <_D3sse5addtoFAiAiZv+59>
>>> 0x000000000000007b <+59>:    mov    rsp,rbp
>>> 0x000000000000007e <+62>:    pop    rbp
>>> 0x000000000000007f <+63>:    ret
>> 
>> As you can see, the call is calling the function right below 
>> it, [...]
>
> This is just how objdump/gdb shows the code - it does *not* 
> display
> relocations inline, so you get this misleading output. The call
> instruction will not end up having a zero offset (that is why it
> seems to point at the next op), but will be fixed up to call the
> right function. Run
>
>    objdump -dr your_obj_or_exe_file
>
> and the real call target will be shown as a relocation entry 
> after
> the call instruction.
>
> artur

thanks, that explains it.


More information about the Digitalmars-d-learn mailing list