| Index: src/IceELFObjectWriter.cpp
|
| diff --git a/src/IceELFObjectWriter.cpp b/src/IceELFObjectWriter.cpp
|
| index e263c687869922b9b84776ce3a650a4053f33673..eedaf5233d4fe591937e80f449b576b7e91c0346 100644
|
| --- a/src/IceELFObjectWriter.cpp
|
| +++ b/src/IceELFObjectWriter.cpp
|
| @@ -495,7 +495,8 @@ template <typename ConstType> void ELFObjectWriter::writeConstantPool(Type Ty) {
|
| // between entries.
|
| assert(WriteAmt % Align == 0);
|
| // Check that we write the full PrimType.
|
| - assert(WriteAmt == sizeof(typename ConstType::PrimType));
|
| + assert(WriteAmt == sizeof(typename ConstType::PrimType) ||
|
| + WriteAmt == sizeof(short) || WriteAmt == sizeof(char));
|
| const Elf64_Xword ShFlags = SHF_ALLOC | SHF_MERGE;
|
| std::string SecBuffer;
|
| llvm::raw_string_ostream SecStrBuf(SecBuffer);
|
| @@ -511,6 +512,8 @@ template <typename ConstType> void ELFObjectWriter::writeConstantPool(Type Ty) {
|
|
|
| // Write the data.
|
| for (Constant *C : Pool) {
|
| + if (!C->shouldBePooled)
|
| + continue;
|
| auto Const = llvm::cast<ConstType>(C);
|
| std::string SymBuffer;
|
| llvm::raw_string_ostream SymStrBuf(SymBuffer);
|
| @@ -536,6 +539,8 @@ template void ELFObjectWriter::writeConstantPool<ConstantFloat>(Type Ty);
|
|
|
| template void ELFObjectWriter::writeConstantPool<ConstantDouble>(Type Ty);
|
|
|
| +template void ELFObjectWriter::writeConstantPool<ConstantInteger32>(Type Ty);
|
| +
|
| void ELFObjectWriter::writeAllRelocationSections() {
|
| writeRelocationSections(RelTextSections);
|
| writeRelocationSections(RelDataSections);
|
|
|