[lld] [llvm] [WebAssembly] Add segment NO_STRIP flag to support private retained data (PR #81539)
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 12 14:20:29 PST 2024
================
@@ -56,21 +58,30 @@ void MarkLive::enqueue(Symbol *sym) {
LLVM_DEBUG(dbgs() << "markLive: " << sym->getName() << "\n");
InputFile *file = sym->getFile();
- bool needInitFunctions = file && !file->isLive() && sym->isDefined();
+ bool needMarkImplicitDeps = file && !file->isLive() && sym->isDefined();
sym->markLive();
- // Mark ctor functions in the object that defines this symbol live.
- // The ctor functions are all referenced by the synthetic callCtors
- // function. However, this function does not contain relocations so we
- // have to manually mark the ctors as live.
- if (needInitFunctions)
+ if (needMarkImplicitDeps) {
+ // Mark ctor functions in the object that defines this symbol live.
+ // The ctor functions are all referenced by the synthetic callCtors
+ // function. However, this function does not contain relocations so we
+ // have to manually mark the ctors as live.
enqueueInitFunctions(cast<ObjFile>(file));
+ // Mark retained segments in the object that defines this symbol live.
+ enqueueRetainedSegments(cast<ObjFile>(file));
+ }
if (InputChunk *chunk = sym->getChunk())
queue.push_back(chunk);
----------------
sbc100 wrote:
Should this call the new `enqueue` too?
https://github.com/llvm/llvm-project/pull/81539
More information about the llvm-commits
mailing list