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