diff options
| author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-08-14 19:45:38 +0000 |
|---|---|---|
| committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-08-14 19:45:38 +0000 |
| commit | c773141e668d8b2a97d03b0fd79ae0518afce79e (patch) | |
| tree | 01118aea13177b233e2a4698e6241f55b15d269d | |
| parent | 8cd3566d6d1206da476a0b88ffa6bafe362d8c2b (diff) | |
| download | bcm5719-llvm-c773141e668d8b2a97d03b0fd79ae0518afce79e.tar.gz bcm5719-llvm-c773141e668d8b2a97d03b0fd79ae0518afce79e.zip | |
*try* to use a better name to describe how common symbols are marked on the elf object file.
llvm-svn: 79029
| -rw-r--r-- | llvm/include/llvm/MC/MCSectionELF.h | 6 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/ELFWriter.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/MC/MCSectionELF.cpp | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/llvm/include/llvm/MC/MCSectionELF.h b/llvm/include/llvm/MC/MCSectionELF.h index 8d23b285f3e..1c2943a9097 100644 --- a/llvm/include/llvm/MC/MCSectionELF.h +++ b/llvm/include/llvm/MC/MCSectionELF.h @@ -52,8 +52,10 @@ public: /// ShouldPrintSectionType - Only prints the section type if supported bool ShouldPrintSectionType(unsigned Ty) const; - /// IsCommon - True if this section contains only common symbols - bool IsCommon() const; + /// HasCommonSymbols - True if this section holds common symbols, this is + /// indicated on the ELF object file by a symbol with SHN_COMMON section + /// header index. + bool HasCommonSymbols() const; /// These are the section type and flags fields. An ELF section can have /// only one Type, but can have more than one of the flags specified. diff --git a/llvm/lib/CodeGen/ELFWriter.cpp b/llvm/lib/CodeGen/ELFWriter.cpp index e62079f9472..ffbaf6ba925 100644 --- a/llvm/lib/CodeGen/ELFWriter.cpp +++ b/llvm/lib/CodeGen/ELFWriter.cpp @@ -356,7 +356,7 @@ void ELFWriter::EmitGlobal(const GlobalValue *GV) { unsigned Size = TD->getTypeAllocSize(GVar->getInitializer()->getType()); GblSym->Size = Size; - if (S->IsCommon()) { // Symbol must go to a common section + if (S->HasCommonSymbols()) { // Symbol must go to a common section GblSym->SectionIdx = ELFSection::SHN_COMMON; // A new linkonce section is created for each global in the diff --git a/llvm/lib/MC/MCSectionELF.cpp b/llvm/lib/MC/MCSectionELF.cpp index 246bf4adac8..3d8774ceeb2 100644 --- a/llvm/lib/MC/MCSectionELF.cpp +++ b/llvm/lib/MC/MCSectionELF.cpp @@ -122,8 +122,10 @@ void MCSectionELF::PrintSwitchToSection(const TargetAsmInfo &TAI, OS << '\n'; } -// IsCommon - True if this section contains only common symbols -bool MCSectionELF::IsCommon() const { +// HasCommonSymbols - True if this section holds common symbols, this is +// indicated on the ELF object file by a symbol with SHN_COMMON section +// header index. +bool MCSectionELF::HasCommonSymbols() const { if (strncmp(SectionName.c_str(), ".gnu.linkonce.", 14) == 0) return true; |

