Bug 22173 – Target functions called through PLT in thunks

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2021-08-03T10:13:48Z
Last change time
2024-12-13T19:17:52Z
Keywords
backend, performance
Assigned to
No Owner
Creator
Iain Buclaw
Moved to GitHub: dmd#19968 →

Comments

Comment #0 by ibuclaw — 2021-08-03T10:13:48Z
Inside _THUNKs, DMD calls functions through PLT. --- sub $0x8,%eax jmp 0xf7f06970 <_D5mydll1C3fooMFCQp1IZCQvQr@plt> --- This is bad because it means the GOT needs to be loaded inside EBX before the JMP, else a segfault occurs (see issue 9729, and issue 22170). GDC instead calls the aliased symbol directly: --- subl $0x8,0x4(%esp) jmp 0xf7f34ffb <_D5mydll1C3fooMFCQp1IZCQvQr> --- DMD 32-bit PIC should be more like GDC 32-bit PIC to avoid this trap.
Comment #1 by robert.schadek — 2024-12-13T19:17:52Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19968 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB