forked from OSchip/llvm-project
[lld-macho] Try to fix MSAN "uninitialized memory" error
I *think* this is the fix, with the regression being introduced by D104199. Not 100% sure since MSAN isn't supported on my Mac machine, and it'll take some time to spin up a Linux box... will look at the buildbots for answers
This commit is contained in:
parent
167e7afcd5
commit
9c5d43fb55
|
@ -1074,10 +1074,11 @@ void macho::createSyntheticSections() {
|
|||
|
||||
// This section contains space for just a single word, and will be used by
|
||||
// dyld to cache an address to the image loader it uses.
|
||||
ArrayRef<uint8_t> data{bAlloc.Allocate<uint8_t>(target->wordSize),
|
||||
target->wordSize};
|
||||
uint8_t *arr = bAlloc.Allocate<uint8_t>(target->wordSize);
|
||||
memset(arr, 0, target->wordSize);
|
||||
in.imageLoaderCache = make<ConcatInputSection>(
|
||||
segment_names::data, section_names::data, /*file=*/nullptr, data,
|
||||
segment_names::data, section_names::data, /*file=*/nullptr,
|
||||
ArrayRef<uint8_t>{arr, target->wordSize},
|
||||
/*align=*/target->wordSize, /*flags=*/S_REGULAR);
|
||||
// References from dyld are not visible to us, so ensure this section is
|
||||
// always treated as live.
|
||||
|
|
Loading…
Reference in New Issue