X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FMC%2FMCSectionELF.h;h=329c75cb1d7d9479d0f0dcd906cc0f5f7036d0e0;hb=645016533d1208d2e7a17d917d64b8b63c4f9939;hp=26951725e497912ed173fbd4bd52cc0e7d32ba2b;hpb=e4f6d7461aea7308e85c219c1cea5bd6059d4841;p=oota-llvm.git diff --git a/include/llvm/MC/MCSectionELF.h b/include/llvm/MC/MCSectionELF.h index 26951725e49..329c75cb1d7 100644 --- a/include/llvm/MC/MCSectionELF.h +++ b/include/llvm/MC/MCSectionELF.h @@ -14,6 +14,7 @@ #ifndef LLVM_MC_MCSECTIONELF_H #define LLVM_MC_MCSECTIONELF_H +#include "llvm/ADT/StringRef.h" #include "llvm/MC/MCSection.h" #include "llvm/Support/ELF.h" @@ -66,10 +67,15 @@ public: virtual bool UseCodeAlign() const; virtual bool isVirtualSection() const; + /// isBaseAddressKnownZero - We know that non-allocatable sections (like + /// debug info) have a base of zero. + virtual bool isBaseAddressKnownZero() const { + return (getFlags() & ELF::SHF_ALLOC) == 0; + } + static bool classof(const MCSection *S) { return S->getVariant() == SV_ELF; } - static bool classof(const MCSectionELF *) { return true; } // Return the entry size for sections with fixed-width data. static unsigned DetermineEntrySize(SectionKind Kind);