[all-commits] [llvm/llvm-project] 4d5dff: [ELF] Initialize Symbol fields in the constructor ...
Fangrui Song via All-commits
all-commits at lists.llvm.org
Tue May 26 01:46:27 PDT 2026
Branch: refs/heads/release/22.x
Home: https://github.com/llvm/llvm-project
Commit: 4d5dffb59420df29cc3b419a7fc90834aed7f7a9
https://github.com/llvm/llvm-project/commit/4d5dffb59420df29cc3b419a7fc90834aed7f7a9
Author: Fangrui Song <i at maskray.me>
Date: 2026-05-26 (Tue, 26 May 2026)
Changed paths:
M lld/ELF/InputFiles.cpp
M lld/ELF/Symbols.h
Log Message:
-----------
[ELF] Initialize Symbol fields in the constructor instead of via memset (#198129)
`initSectionsAndLocalSyms` and `makeDefined` memset the storage to zero
and then placement-new a Symbol-derived object into it. Placement new
begins a new object's lifetime. The standard does not seem to guarantee
the memset bytes carry into members the constructor leaves
uninitialized.
lld built by GCC 16 can make Valgrind report reads of Symbol::flags
(via getSymSectionIndex during finalizeSections) as uses of
uninitialized values (ClangBuiltLinux/linux#2162).
This patch reinstates the per-field initialization that commit
778742760534 ("[ELF] Avoid redundant assignment to Symbol fields. NFC")
had replaced with a bulk memset.
(cherry picked from commit 905a88b923433eb8cd83677ea55bee82eb9ba498)
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list