What does Znwm and ZdlPv mean in assembly?

随声附和 提交于 2019-12-23 13:13:04

问题


I'm new to assembly and I'm trying to figure out how C++ handles dynamic dispatch in assembly.

When looking through assembly code, I saw that there were 2 unusual calls:

call _Znwm
call _ZdlPv

These did not have a subroutine that I could trace them to. From examining the code, Znwm seemed to return the address of the object when its constructor was called, but I'm not sure about that. ZdlPv was in a block of code that could never be reached (it was jumped over). C++:

Fruit * f;
f = new Apple();

x86:

# BB#1:
    mov eax, 8
    mov edi, eax
    call    _Znwm
    mov rdi, rax
    mov rcx, rax
.Ltmp6:
    mov qword ptr [rbp - 48], rdi # 8-byte Spill
    mov rdi, rax
    mov qword ptr [rbp - 56], rcx # 8-byte Spill
    call    _ZN5AppleC2Ev

Any advice would be appreciated. Thanks.


回答1:


_Znwm is operator new.
_ZdlPv is operator delete.



来源:https://stackoverflow.com/questions/47337760/what-does-znwm-and-zdlpv-mean-in-assembly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!