mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Global ctors / dtors alignment shouldn't be hard-coded at 4. e.g. It could be 8 for 64-bit targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37421 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3ec425470f
commit
916d07cdfa
@ -327,16 +327,18 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const TargetData *TD = TM.getTargetData();
|
||||
unsigned Align = Log2_32(TD->getPointerPrefAlignment());
|
||||
if (GV->getName() == "llvm.global_ctors" && GV->use_empty()) {
|
||||
SwitchToDataSection(TAI->getStaticCtorsSection());
|
||||
EmitAlignment(2, 0);
|
||||
EmitAlignment(Align, 0);
|
||||
EmitXXStructorList(GV->getInitializer());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (GV->getName() == "llvm.global_dtors" && GV->use_empty()) {
|
||||
SwitchToDataSection(TAI->getStaticDtorsSection());
|
||||
EmitAlignment(2, 0);
|
||||
EmitAlignment(Align, 0);
|
||||
EmitXXStructorList(GV->getInitializer());
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user