mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
If using __main, emit global ctor/dtor list like any other global
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25251 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
af551bcf6b
commit
5166b82866
@ -120,14 +120,14 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
|
|||||||
if (GV->getName() == "llvm.used")
|
if (GV->getName() == "llvm.used")
|
||||||
return true; // No need to emit this at all.
|
return true; // No need to emit this at all.
|
||||||
|
|
||||||
if (GV->getName() == "llvm.global_ctors") {
|
if (GV->getName() == "llvm.global_ctors" && GV->use_empty()) {
|
||||||
SwitchSection(StaticCtorsSection, 0);
|
SwitchSection(StaticCtorsSection, 0);
|
||||||
EmitAlignment(2, 0);
|
EmitAlignment(2, 0);
|
||||||
EmitXXStructorList(GV->getInitializer());
|
EmitXXStructorList(GV->getInitializer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GV->getName() == "llvm.global_dtors") {
|
if (GV->getName() == "llvm.global_dtors" && GV->use_empty()) {
|
||||||
SwitchSection(StaticDtorsSection, 0);
|
SwitchSection(StaticDtorsSection, 0);
|
||||||
EmitAlignment(2, 0);
|
EmitAlignment(2, 0);
|
||||||
EmitXXStructorList(GV->getInitializer());
|
EmitXXStructorList(GV->getInitializer());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user