mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-27 05:55:40 +00:00
elf writer really wants the size of the global, not the size
of the pointer to the global. llvm-svn: 61630
This commit is contained in:
parent
7343641ae4
commit
30de396459
@ -34,7 +34,7 @@
|
|||||||
#include "ELFWriter.h"
|
#include "ELFWriter.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/PassManager.h"
|
#include "llvm/PassManager.h"
|
||||||
#include "llvm/Type.h" // FIXME: For PATypeHolder::get().
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/CodeGen/FileWriters.h"
|
#include "llvm/CodeGen/FileWriters.h"
|
||||||
#include "llvm/CodeGen/MachineCodeEmitter.h"
|
#include "llvm/CodeGen/MachineCodeEmitter.h"
|
||||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||||
@ -274,9 +274,9 @@ void ELFWriter::EmitGlobal(GlobalVariable *GV) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Type *GVType = (const Type*)GV->getType();
|
|
||||||
unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
|
unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
|
||||||
unsigned Size = TM.getTargetData()->getABITypeSize(GVType);
|
unsigned Size =
|
||||||
|
TM.getTargetData()->getABITypeSize(GV->getType()->getElementType());
|
||||||
|
|
||||||
// If this global has a zero initializer, it is part of the .bss or common
|
// If this global has a zero initializer, it is part of the .bss or common
|
||||||
// section.
|
// section.
|
||||||
|
Loading…
Reference in New Issue
Block a user