Skip to content

Commit e83503f

Browse files
chapuniantonbaliasnikov
authored andcommitted
Fix more lld warnings introduced in #111434 [-Wnontrivial-memaccess]
1 parent 19eef91 commit e83503f

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
@@ -1195,7 +1195,7 @@ template <class ELFT> void ObjFile<ELFT>::importCmseSymbols() {
11951195
Defined *sym = reinterpret_cast<Defined *>(make<SymbolUnion>());
11961196

11971197
// Initialize symbol fields.
1198-
memset(sym, 0, sizeof(Symbol));
1198+
memset(static_cast<void *>(sym), 0, sizeof(Symbol));
11991199
sym->setName(CHECK(eSyms[i].getName(stringTable), this));
12001200
sym->value = eSym.st_value;
12011201
sym->size = eSym.st_size;

lld/ELF/SymbolTable.cpp

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

@@ -89,7 +89,7 @@ Symbol *SymbolTable::insert(StringRef name) {
8989
symVector.push_back(sym);
9090

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

0 commit comments

Comments
 (0)