diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp index a33ef78fa953..e5fa7556053f 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -611,7 +611,7 @@ void MipsTargetELFStreamer::emitDirectiveEnd(StringRef Name) { MCStreamer &OS = getStreamer(); MCSectionELF *Sec = Context.getELFSection(".pdr", ELF::SHT_PROGBITS, - ELF::SHT_REL); + ELF::SHF_ALLOC | ELF::SHT_REL); MCSymbol *Sym = Context.getOrCreateSymbol(Name); const MCSymbolRefExpr *ExprRef = diff --git a/llvm/test/MC/Mips/mips-pdr.s b/llvm/test/MC/Mips/mips-pdr.s index c4b63783e76c..8177e3e23448 100644 --- a/llvm/test/MC/Mips/mips-pdr.s +++ b/llvm/test/MC/Mips/mips-pdr.s @@ -18,8 +18,8 @@ # OBJOUT: Section { # OBJOUT: Name: .pdr # OBJOUT: Type: SHT_PROGBITS (0x1) -# OBJOUT: Flags [ (0x9) -# OBJOUT-NOT: SHF_ALLOC (0x2) +# OBJOUT: Flags [ (0xB) +# OBJOUT: SHF_ALLOC (0x2) # OBJOUT: SHF_WRITE (0x1) # OBJOUT: ] # OBJOUT: Size: 64