[Core] Do not reclaim absolute atoms in resolver.

This fixes a linker crash (found out while testing --gc-sections,
testcase provided by Rafael Avila de Espindola).
While this behaviour was found while testing ELF, it' not necessarily
ELF specific and this change is (apparently) harmless on all the
other drivers.

Differential Revision:  D7823
Reviewed by:    ruiu

llvm-svn: 230614
diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp
index 63c2b31..ff217f2 100644
--- a/lld/lib/Core/Resolver.cpp
+++ b/lld/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<DefinedAtom>(atom))
       for (const Reference *ref : *defAtom)
         if (isBackref(ref))
           _reverseRef[ref->target()].insert(atom);
+    if (const AbsoluteAtom *absAtom = dyn_cast<AbsoluteAtom>(atom))
+      markLive(absAtom);
+  }
 
   // By default, shared libraries are built with all globals as dead strip roots
   if (_context.globalsAreDeadStripRoots())