Index: lib/Core/Resolver.cpp =================================================================== --- lib/Core/Resolver.cpp +++ lib/Core/Resolver.cpp @@ -383,11 +383,16 @@ // Some type of references prevent referring atoms to be dead-striped. // Make a reverse map of such references before traversing the graph. - for (const Atom *atom : _atoms) + // While traversing the list of atoms, mark AbsoluteAtoms as live + // in order to avoid reclaim. + for (const Atom *atom : _atoms) { if (const DefinedAtom *defAtom = dyn_cast(atom)) for (const Reference *ref : *defAtom) if (isBackref(ref)) _reverseRef[ref->target()].insert(atom); + if (const AbsoluteAtom *absAtom = dyn_cast(atom)) + markLive(absAtom); + } // By default, shared libraries are built with all globals as dead strip roots if (_context.globalsAreDeadStripRoots()) Index: test/core/absolute-basic.objtxt =================================================================== --- test/core/absolute-basic.objtxt +++ test/core/absolute-basic.objtxt @@ -1,4 +1,4 @@ -# RUN: lld -core %s | FileCheck %s +# RUN: lld -core --dead-strip %s | FileCheck %s # # Test that absolute symbols are parsed and preserved