diff options
| -rw-r--r-- | llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp | 16 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsTargetAsmInfo.h | 6 | 
2 files changed, 18 insertions, 4 deletions
diff --git a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp b/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp index f8a14c66da1..5c671cc24a3 100644 --- a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp +++ b/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp @@ -45,8 +45,16 @@ MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM):  } -SectionKind::Kind -MipsTargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const { +unsigned MipsTargetAsmInfo:: +SectionFlagsForGlobal(const GlobalValue *GV, const char* Name) const { +  unsigned Flags = ELFTargetAsmInfo::SectionFlagsForGlobal(GV, Name); +  // Mask out Small Section flag bit, Mips doesnt support 's' section symbol +  // for its small sections. +  return (Flags & (~SectionFlags::Small)); +} + +SectionKind::Kind MipsTargetAsmInfo:: +SectionKindForGlobal(const GlobalValue *GV) const {    SectionKind::Kind K = ELFTargetAsmInfo::SectionKindForGlobal(GV);    if (Subtarget->hasABICall()) @@ -72,8 +80,8 @@ MipsTargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {    return K;  } -const Section* -MipsTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { +const Section* MipsTargetAsmInfo:: +SelectSectionForGlobal(const GlobalValue *GV) const {    SectionKind::Kind K = SectionKindForGlobal(GV);    const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GV); diff --git a/llvm/lib/Target/Mips/MipsTargetAsmInfo.h b/llvm/lib/Target/Mips/MipsTargetAsmInfo.h index c798ae2a373..0511cca4551 100644 --- a/llvm/lib/Target/Mips/MipsTargetAsmInfo.h +++ b/llvm/lib/Target/Mips/MipsTargetAsmInfo.h @@ -34,6 +34,12 @@ namespace llvm {      virtual SectionKind::Kind      SectionKindForGlobal(const GlobalValue *GV) const; +    /// SectionFlagsForGlobal - This hook allows the target to select proper +    /// section flags either for given global or for section. +    virtual unsigned +    SectionFlagsForGlobal(const GlobalValue *GV = NULL, +                          const char* name = NULL) const; +      virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;      private:  | 

