Skip to content

Commit 59085e9

Browse files
committed
Fix more lld warnings introduced in #111434 [-Wnontrivial-memaccess]
1 parent 48adfaf commit 59085e9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lld/ELF/Arch/ARM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ template <class ELFT> void ObjFile<ELFT>::importCmseSymbols() {
12071207
Defined *sym = reinterpret_cast<Defined *>(make<SymbolUnion>());
12081208

12091209
// Initialize symbol fields.
1210-
memset(sym, 0, sizeof(Symbol));
1210+
memset(static_cast<void *>(sym), 0, sizeof(Symbol));
12111211
sym->setName(CHECK(eSyms[i].getName(stringTable), this));
12121212
sym->value = eSym.st_value;
12131213
sym->size = eSym.st_size;

lld/ELF/SymbolTable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void SymbolTable::wrap(Symbol *sym, Symbol *real, Symbol *wrap) {
5656
// alias for sym, but that could degrade the user experience of some tools
5757
// that can print out only one symbol for each location: sym is a preferred
5858
// name than real, but they might print out real instead.
59-
memcpy(real, sym, sizeof(SymbolUnion));
59+
memcpy(static_cast<void *>(real), sym, sizeof(SymbolUnion));
6060
real->isUsedInRegularObj = false;
6161
}
6262

@@ -87,7 +87,7 @@ Symbol *SymbolTable::insert(StringRef name) {
8787
symVector.push_back(sym);
8888

8989
// *sym was not initialized by a constructor. Initialize all Symbol fields.
90-
memset(sym, 0, sizeof(Symbol));
90+
memset(static_cast<void *>(sym), 0, sizeof(Symbol));
9191
sym->setName(name);
9292
sym->partition = 1;
9393
sym->versionId = VER_NDX_GLOBAL;

0 commit comments

Comments
 (0)