mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-04 11:17:31 +00:00
Global ctors / dtors alignment shouldn't be hard-coded at 4. e.g. It could be 8 for 64-bit targets.
llvm-svn: 37421
This commit is contained in:
parent
79f53ff66d
commit
8728a6c3fd
@ -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…
x
Reference in New Issue
Block a user