summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorLogan Chien <tzuhsiang.chien@gmail.com>2013-12-05 00:34:11 +0000
committerLogan Chien <tzuhsiang.chien@gmail.com>2013-12-05 00:34:11 +0000
commitee36595ce6fcf2046bf48f762cea3eadba480d00 (patch)
tree481a0b24fd18cc96bdf8aa006fd3b3c528d47daf /llvm/lib/MC
parentb53a85a6f833f49f3781229163720ec38f4a4df2 (diff)
downloadbcm5719-llvm-ee36595ce6fcf2046bf48f762cea3eadba480d00.tar.gz
bcm5719-llvm-ee36595ce6fcf2046bf48f762cea3eadba480d00.zip
[mc] Fix ELF st_other flag.
ELF_Other_Weakref and ELF_Other_ThumbFunc seems to be LLVM internal ELF symbol flags. These should not be emitted to object file. This commit defines ELF_STO_Shift for the target-defined flags for st_other, and increase the value of ELF_Other_Shift to 16. llvm-svn: 196440
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp3
-rw-r--r--llvm/lib/MC/MCELF.cpp6
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 9899bb2eac2..972c64cc565 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -551,8 +551,7 @@ void ELFObjectWriter::WriteSymbol(MCDataFragment *SymtabF,
// Other and Visibility share the same byte with Visibility using the lower
// 2 bits
uint8_t Visibility = MCELF::GetVisibility(OrigData);
- uint8_t Other = MCELF::getOther(OrigData) <<
- (ELF_Other_Shift - ELF_STV_Shift);
+ uint8_t Other = MCELF::getOther(OrigData) << (ELF_STO_Shift - ELF_STV_Shift);
Other |= Visibility;
uint64_t Value = SymbolValue(Data, Layout);
diff --git a/llvm/lib/MC/MCELF.cpp b/llvm/lib/MC/MCELF.cpp
index ebb189e5439..0a9cd31dda0 100644
--- a/llvm/lib/MC/MCELF.cpp
+++ b/llvm/lib/MC/MCELF.cpp
@@ -72,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 Other =
- (SD.getFlags() & (0x3f << ELF_Other_Shift)) >> ELF_Other_Shift;
+ (SD.getFlags() & (0x3f << ELF_STO_Shift)) >> ELF_STO_Shift;
return Other;
}
OpenPOWER on IntegriCloud