OSDN Git Service

[mips] Removed the SHF_ALLOC flag and the SHT_REL flag from the .pdr section.
authorScott Egerton <Scott.Egerton@imgtec.com>
Wed, 17 Feb 2016 11:15:16 +0000 (11:15 +0000)
committerScott Egerton <Scott.Egerton@imgtec.com>
Wed, 17 Feb 2016 11:15:16 +0000 (11:15 +0000)
This section is used for debug information and has no need to be
in memory at runtime. This patch also fixes an error when compiling
the Linux kernel. The error is that there are relocations within the
.pdr section in a VDSO. SHT_REL was removed as it is a section type
and not a section flag, therefore it does not make sense for it to
be there. With this patch, LLVM now emits the same flags as
the GNU assembler.

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

lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
test/MC/Mips/mips-pdr.s

index e5fa755..e13254e 100644 (file)
@@ -610,8 +610,7 @@ void MipsTargetELFStreamer::emitDirectiveEnd(StringRef Name) {
   MCContext &Context = MCA.getContext();
   MCStreamer &OS = getStreamer();
 
-  MCSectionELF *Sec = Context.getELFSection(".pdr", ELF::SHT_PROGBITS,
-                                            ELF::SHF_ALLOC | ELF::SHT_REL);
+  MCSectionELF *Sec = Context.getELFSection(".pdr", ELF::SHT_PROGBITS, 0);
 
   MCSymbol *Sym = Context.getOrCreateSymbol(Name);
   const MCSymbolRefExpr *ExprRef =
index 8177e3e..b19dca3 100644 (file)
@@ -18,9 +18,9 @@
 # OBJOUT: Section {
 # OBJOUT:     Name: .pdr
 # OBJOUT:     Type: SHT_PROGBITS (0x1)
-# OBJOUT:     Flags [ (0xB)
-# OBJOUT:       SHF_ALLOC (0x2)
-# OBJOUT:       SHF_WRITE (0x1)
+# OBJOUT:     Flags [ (0x0)
+# OBJOUT-NOT:   SHF_ALLOC (0x2)
+# OBJOUT-NOT:   SHF_WRITE (0x1)
 # OBJOUT:     ]
 # OBJOUT:     Size: 64
 # OBJOUT:     SectionData (