https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115170
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |WAITING Last reconfirmed| |2024-05-21 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I tried the simple example: ``` struct s { ~s(); }; s f; ``` With `-fPIC -fno-plt` (and `-fPIE -fno-plt`) on x86_64-linux-gnu and don't get a call to @plt. PIE: ``` leaq __dso_handle(%rip), %rax movq %rax, %rdx leaq f(%rip), %rax movq %rax, %rsi movq _ZN1sD1Ev@GOTPCREL(%rip), %rax movq %rax, %rdi call *__cxa_atexit@GOTPCREL(%rip) nop popq %rbp ``` PIC: ``` leaq __dso_handle(%rip), %rax movq %rax, %rdx movq f@GOTPCREL(%rip), %rax movq %rax, %rsi movq _ZN1sD1Ev@GOTPCREL(%rip), %rax movq %rax, %rdi call *__cxa_atexit@GOTPCREL(%rip) nop popq %rbp ``` can you provide what target you are targetting and what exact version of GCC?