[llvm] r261083 - [mips] Removed the SHF_ALLOC flag and the SHT_REL flag from the .pdr section.

Scott Egerton via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 03:15:17 PST 2016


Author: s.egerton
Date: Wed Feb 17 05:15:16 2016
New Revision: 261083

URL: http://llvm.org/viewvc/llvm-project?rev=261083&view=rev
Log:
[mips] Removed the SHF_ALLOC flag and the SHT_REL flag from the .pdr section.

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.


Modified:
    llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
    llvm/trunk/test/MC/Mips/mips-pdr.s

Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp?rev=261083&r1=261082&r2=261083&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp Wed Feb 17 05:15:16 2016
@@ -610,8 +610,7 @@ void MipsTargetELFStreamer::emitDirectiv
   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 =

Modified: llvm/trunk/test/MC/Mips/mips-pdr.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips-pdr.s?rev=261083&r1=261082&r2=261083&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips-pdr.s (original)
+++ llvm/trunk/test/MC/Mips/mips-pdr.s Wed Feb 17 05:15:16 2016
@@ -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 (




More information about the llvm-commits mailing list