mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
*try* to use a better name to describe how common symbols are marked on the elf object file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79029 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -52,8 +52,10 @@ public:
|
|||||||
/// ShouldPrintSectionType - Only prints the section type if supported
|
/// ShouldPrintSectionType - Only prints the section type if supported
|
||||||
bool ShouldPrintSectionType(unsigned Ty) const;
|
bool ShouldPrintSectionType(unsigned Ty) const;
|
||||||
|
|
||||||
/// IsCommon - True if this section contains only common symbols
|
/// HasCommonSymbols - True if this section holds common symbols, this is
|
||||||
bool IsCommon() const;
|
/// 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
|
/// 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.
|
/// only one Type, but can have more than one of the flags specified.
|
||||||
|
@ -356,7 +356,7 @@ void ELFWriter::EmitGlobal(const GlobalValue *GV) {
|
|||||||
unsigned Size = TD->getTypeAllocSize(GVar->getInitializer()->getType());
|
unsigned Size = TD->getTypeAllocSize(GVar->getInitializer()->getType());
|
||||||
GblSym->Size = Size;
|
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;
|
GblSym->SectionIdx = ELFSection::SHN_COMMON;
|
||||||
|
|
||||||
// A new linkonce section is created for each global in the
|
// A new linkonce section is created for each global in the
|
||||||
|
@ -122,8 +122,10 @@ void MCSectionELF::PrintSwitchToSection(const TargetAsmInfo &TAI,
|
|||||||
OS << '\n';
|
OS << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsCommon - True if this section contains only common symbols
|
// HasCommonSymbols - True if this section holds common symbols, this is
|
||||||
bool MCSectionELF::IsCommon() const {
|
// 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)
|
if (strncmp(SectionName.c_str(), ".gnu.linkonce.", 14) == 0)
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user