X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FMC%2FMCELF.cpp;h=386c2099f2e27277542fac3f3c0c5d23cda62d9a;hb=822199b9e6867c3fe94bffa6ab57be903014f98a;hp=560cdbc6abae750a5279173b84472a1981805014;hpb=77afbdce53aa740777486b0cc4e9df151ae65468;p=oota-llvm.git diff --git a/lib/MC/MCELF.cpp b/lib/MC/MCELF.cpp index 560cdbc6aba..386c2099f2e 100644 --- a/lib/MC/MCELF.cpp +++ b/lib/MC/MCELF.cpp @@ -36,8 +36,8 @@ unsigned MCELF::GetBinding(const MCSymbolData &SD) { void MCELF::SetType(MCSymbolData &SD, unsigned Type) { assert(Type == ELF::STT_NOTYPE || Type == ELF::STT_OBJECT || Type == ELF::STT_FUNC || Type == ELF::STT_SECTION || - Type == ELF::STT_FILE || Type == ELF::STT_COMMON || - Type == ELF::STT_TLS || Type == ELF::STT_GNU_IFUNC); + Type == ELF::STT_COMMON || Type == ELF::STT_TLS || + Type == ELF::STT_GNU_IFUNC); uint32_t OtherFlags = SD.getFlags() & ~(0xf << ELF_STT_Shift); SD.setFlags(OtherFlags | (Type << ELF_STT_Shift)); @@ -47,8 +47,7 @@ unsigned MCELF::GetType(const MCSymbolData &SD) { uint32_t Type = (SD.getFlags() & (0xf << ELF_STT_Shift)) >> ELF_STT_Shift; assert(Type == ELF::STT_NOTYPE || Type == ELF::STT_OBJECT || Type == ELF::STT_FUNC || Type == ELF::STT_SECTION || - Type == ELF::STT_FILE || Type == ELF::STT_COMMON || - Type == ELF::STT_TLS || Type == ELF::STT_GNU_IFUNC); + Type == ELF::STT_COMMON || Type == ELF::STT_TLS || Type == ELF::STT_GNU_IFUNC); return Type; } @@ -62,7 +61,7 @@ void MCELF::SetVisibility(MCSymbolData &SD, unsigned Visibility) { SD.setFlags(OtherFlags | (Visibility << ELF_STV_Shift)); } -unsigned MCELF::GetVisibility(MCSymbolData &SD) { +unsigned MCELF::GetVisibility(const MCSymbolData &SD) { unsigned Visibility = (SD.getFlags() & (0x3 << ELF_STV_Shift)) >> ELF_STV_Shift; assert(Visibility == ELF::STV_DEFAULT || Visibility == ELF::STV_INTERNAL || @@ -73,13 +72,13 @@ unsigned MCELF::GetVisibility(MCSymbolData &SD) { // Other is stored in the last six bits of st_other // st_other values are stored in the second byte of get/setFlags void MCELF::setOther(MCSymbolData &SD, unsigned Other) { - uint32_t OtherFlags = SD.getFlags() & ~(0x3f << ELF_Other_Shift); - SD.setFlags(OtherFlags | (Other << ELF_Other_Shift)); + uint32_t OtherFlags = SD.getFlags() & ~(0x3f << ELF_STO_Shift); + SD.setFlags(OtherFlags | (Other << ELF_STO_Shift)); } -unsigned MCELF::getOther(MCSymbolData &SD) { +unsigned MCELF::getOther(const MCSymbolData &SD) { unsigned Other = - (SD.getFlags() & (0x3f << ELF_Other_Shift)) >> ELF_Other_Shift; + (SD.getFlags() & (0x3f << ELF_STO_Shift)) >> ELF_STO_Shift; return Other; }