summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-nm/llvm-nm.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2017-06-20 00:41:04 +0000
committerKevin Enderby <enderby@apple.com>2017-06-20 00:41:04 +0000
commita8c4c016f89a9196ff4c2492d1ff1f49862f041a (patch)
tree381f869c572b5cca9087e6f156901e40d35ca06f /llvm/tools/llvm-nm/llvm-nm.cpp
parentc595185f8fc85e331afda990b99bc8d6ffc85bca (diff)
downloadbcm5719-llvm-a8c4c016f89a9196ff4c2492d1ff1f49862f041a.tar.gz
bcm5719-llvm-a8c4c016f89a9196ff4c2492d1ff1f49862f041a.zip
The change to llvm-nm in r305733 added fields to the struct NMSymbol
that are not set on the main path. This diff does a memset to 0 the structs so this change is to hopefully fix the sanitizer-x86_64-linux-fast bot. llvm-svn: 305762
Diffstat (limited to 'llvm/tools/llvm-nm/llvm-nm.cpp')
-rw-r--r--llvm/tools/llvm-nm/llvm-nm.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp
index ed2f9e200c1..513e1b87558 100644
--- a/llvm/tools/llvm-nm/llvm-nm.cpp
+++ b/llvm/tools/llvm-nm/llvm-nm.cpp
@@ -48,6 +48,7 @@
#include <cstring>
#include <system_error>
#include <vector>
+#include <string.h>
using namespace llvm;
using namespace object;
@@ -1116,6 +1117,7 @@ dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName,
if (Nsect && Nsect != getNsectInMachO(*MachO, Sym))
continue;
NMSymbol S;
+ memset(&S, '\0', sizeof(S));
S.Size = 0;
S.Address = 0;
if (PrintSize) {
@@ -1207,6 +1209,7 @@ dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName,
}
if (!found) {
NMSymbol S;
+ memset(&S, '\0', sizeof(NMSymbol));
S.Address = Entry.address() + BaseSegmentAddress;
S.Size = 0;
S.TypeChar = '\0';
@@ -1297,6 +1300,7 @@ dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName,
// Now create the undefined symbol using the referened dynamic
// library.
NMSymbol U;
+ memset(&U, '\0', sizeof(NMSymbol));
U.Address = 0;
U.Size = 0;
U.TypeChar = 'U';
@@ -1361,6 +1365,7 @@ dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName,
if (!found) {
LastSymbolName = Entry.symbolName();
NMSymbol B;
+ memset(&B, '\0', sizeof(NMSymbol));
B.Address = 0;
B.Size = 0;
B.TypeChar = 'U';
@@ -1420,6 +1425,7 @@ dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName,
if (!found) {
LastSymbolName = Entry.symbolName();
NMSymbol L;
+ memset(&L, '\0', sizeof(NMSymbol));
L.Name = Entry.symbolName();
L.Address = 0;
L.Size = 0;
@@ -1482,6 +1488,7 @@ dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName,
if (!found) {
LastSymbolName = Entry.symbolName();
NMSymbol W;
+ memset(&W, '\0', sizeof(NMSymbol));
W.Name = Entry.symbolName();
W.Address = 0;
W.Size = 0;
OpenPOWER on IntegriCloud