Issue 133246
Summary differences between GCC and LLVM with __attribute__((constructor)) __attribute__((destructor))
Labels new issue
Assignees
Reporter LukeSTM
    demo:
```
void __attribute__((constructor)) kkk2()
{
        __asm__ volatile ("":::);
}

void __attribute__ ((destructor)) foo()
{
        __asm__ volatile ("":::);
}
```

https://godbolt.org/z/7shvxT3hY

There are differences in the behavior of `__attribute__((constructor)) __attribute__((destructor)) ` between GCC and LLVM. GCC places functions with the `__attribute__((constructor))` attribute in the `.text.startup` section, and places functions  with the `__attribute__((destructor))` attribute in the `.text.exit` section,but LLVM does not. Why is this the case?



_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to