summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2014-07-14 14:43:45 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2014-07-14 14:43:45 +0000
commitcb0d36e59216f05db621cc9836f912fb36fbb1ca (patch)
tree1d251d0628e9861bad0d59c7fca0955545454928 /llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
parent94b6801839deca5671df8cf8793b61e912b71c95 (diff)
downloadbcm5719-llvm-cb0d36e59216f05db621cc9836f912fb36fbb1ca.tar.gz
bcm5719-llvm-cb0d36e59216f05db621cc9836f912fb36fbb1ca.zip
Revert: [mips] Correct section alignments and EntrySizes for .bss, .text, .data, .reginfo, .MIPS.options, and .MIPS.abiflags
This commit causes multiple lld tests to fail. Reverting while I investigate the issue. llvm-svn: 212945
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp')
-rw-r--r--llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp28
1 files changed, 5 insertions, 23 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
index 45683e883ff..fbe375b8964 100644
--- a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
+++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
@@ -323,30 +323,13 @@ void MipsTargetELFStreamer::finish() {
MCAssembler &MCA = getStreamer().getAssembler();
MCContext &Context = MCA.getContext();
MCStreamer &OS = getStreamer();
- const MCObjectFileInfo &OFI = *Context.getObjectFileInfo();
Triple T(STI.getTargetTriple());
uint64_t Features = STI.getFeatureBits();
- // .bss, .text and .data are always at least 16-byte aligned.
- MCSectionData &TextSectionData =
- MCA.getOrCreateSectionData(*OFI.getTextSection());
- MCSectionData &DataSectionData =
- MCA.getOrCreateSectionData(*OFI.getDataSection());
- MCSectionData &BSSSectionData =
- MCA.getOrCreateSectionData(*OFI.getBSSSection());
-
- TextSectionData.setAlignment(std::max(16u, TextSectionData.getAlignment()));
- DataSectionData.setAlignment(std::max(16u, DataSectionData.getAlignment()));
- BSSSectionData.setAlignment(std::max(16u, BSSSectionData.getAlignment()));
-
if (T.isArch64Bit() && (Features & Mips::FeatureN64)) {
- // The EntrySize value of 1 seems strange since the records are neither
- // 1-byte long nor fixed length but it matches the value GAS emits.
- const MCSectionELF *Sec =
- Context.getELFSection(".MIPS.options", ELF::SHT_MIPS_OPTIONS,
- ELF::SHF_ALLOC | ELF::SHF_MIPS_NOSTRIP,
- SectionKind::getMetadata(), 1, "");
- MCA.getOrCreateSectionData(*Sec).setAlignment(8);
+ const MCSectionELF *Sec = Context.getELFSection(
+ ".MIPS.options", ELF::SHT_MIPS_OPTIONS,
+ ELF::SHF_ALLOC | ELF::SHF_MIPS_NOSTRIP, SectionKind::getMetadata());
OS.SwitchSection(Sec);
OS.EmitIntValue(1, 1); // kind
@@ -363,8 +346,7 @@ void MipsTargetELFStreamer::finish() {
} else {
const MCSectionELF *Sec =
Context.getELFSection(".reginfo", ELF::SHT_MIPS_REGINFO, ELF::SHF_ALLOC,
- SectionKind::getMetadata(), 24, "");
- MCA.getOrCreateSectionData(*Sec).setAlignment(4);
+ SectionKind::getMetadata());
OS.SwitchSection(Sec);
OS.EmitIntValue(0, 4); // ri_gprmask
@@ -656,7 +638,7 @@ void MipsTargetELFStreamer::emitMipsAbiFlags() {
MCStreamer &OS = getStreamer();
const MCSectionELF *Sec =
Context.getELFSection(".MIPS.abiflags", ELF::SHT_MIPS_ABIFLAGS,
- ELF::SHF_ALLOC, SectionKind::getMetadata(), 24, "");
+ ELF::SHF_ALLOC, SectionKind::getMetadata());
MCSectionData &ABIShndxSD = MCA.getOrCreateSectionData(*Sec);
ABIShndxSD.setAlignment(8);
OS.SwitchSection(Sec);
OpenPOWER on IntegriCloud