summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Symbols.h
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-06-22 17:30:19 +0000
committerRui Ueyama <ruiu@google.com>2017-06-22 17:30:19 +0000
commit4402a39981063992cd8f4ca81e240a6fe7cdf4fd (patch)
treef03e508fe8780d1ebd1f2beb89f24a5cdd6ebebc /lld/ELF/Symbols.h
parent8a261c2565b377bd00dee3ac2fe1fa075cb910e4 (diff)
downloadbcm5719-llvm-4402a39981063992cd8f4ca81e240a6fe7cdf4fd.tar.gz
bcm5719-llvm-4402a39981063992cd8f4ca81e240a6fe7cdf4fd.zip
Keep the original symbol name when renamed.
Previously, when symbol A is renamed B, both A and B end up having the same name. This is because name is a symbol's attribute, and we memcpy symbols for symbol renaming. This pathc saves the original symbol name and restore it after memcpy to keep the original name. This patch shouldn't change program's meaning, but names in symbol tables make more sense than before. llvm-svn: 306036
Diffstat (limited to 'lld/ELF/Symbols.h')
-rw-r--r--lld/ELF/Symbols.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h
index 030527f6374..f30b389506a 100644
--- a/lld/ELF/Symbols.h
+++ b/lld/ELF/Symbols.h
@@ -69,6 +69,7 @@ public:
bool isLocal() const { return IsLocal; }
bool isPreemptible() const;
StringRef getName() const { return Name; }
+ void setName(StringRef S) { Name = S; }
uint8_t getVisibility() const { return StOther & 0x3; }
void parseSymbolVersion();
OpenPOWER on IntegriCloud