Skip to content

Commit

Permalink
The change to llvm-nm in r305733 added fields to the struct NMSymbol
Browse files Browse the repository at this point in the history
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305762 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
enderby committed Jun 20, 2017
1 parent 5a7b330 commit eaf57f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/llvm-nm/llvm-nm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include <cstring>
#include <system_error>
#include <vector>
#include <string.h>

using namespace llvm;
using namespace object;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit eaf57f3

Please sign in to comment.