[mips] .reginfo is 8 byte aligned on N32.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 17 Jul 2014 10:10:04 +0000 (10:10 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 17 Jul 2014 10:10:04 +0000 (10:10 +0000)
Differential Revision: http://reviews.llvm.org/D4540

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213246 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
test/MC/Mips/elf_reginfo.s

index e017a27..4e72169 100644 (file)
@@ -366,7 +366,8 @@ void MipsTargetELFStreamer::finish() {
     const MCSectionELF *Sec =
         Context.getELFSection(".reginfo", ELF::SHT_MIPS_REGINFO, ELF::SHF_ALLOC,
                               SectionKind::getMetadata(), 24, "");
-    MCA.getOrCreateSectionData(*Sec).setAlignment(4);
+    MCA.getOrCreateSectionData(*Sec)
+        .setAlignment(Features & Mips::FeatureN32 ? 8 : 4);
     OS.SwitchSection(Sec);
 
     OS.EmitIntValue(0, 4); // ri_gprmask
index b88607a..ba4788a 100644 (file)
@@ -27,6 +27,6 @@
 # CHECK_32-LABEL:    Name: .reginfo
 # CHECK_32-NEXT:     Type:  SHT_MIPS_REGINFO
 # CHECK_32-NEXT:     Flags [ (0x2)
-# CHECK_32:          AddressAlignment: 4
+# CHECK_32:          AddressAlignment: 8
 # CHECK_32:          EntrySize: 24
 # CHECK_32-LABEL:  }