diff options
| -rw-r--r-- | lld/lib/ReaderWriter/ELF/DefaultLayout.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lld/lib/ReaderWriter/ELF/DefaultLayout.h b/lld/lib/ReaderWriter/ELF/DefaultLayout.h index 983208a7665..f9807a94e39 100644 --- a/lld/lib/ReaderWriter/ELF/DefaultLayout.h +++ b/lld/lib/ReaderWriter/ELF/DefaultLayout.h @@ -635,14 +635,13 @@ DefaultLayout<ELFT>::addAtom(const Atom *atom) { } return section->appendAtom(atom); } - if (const AbsoluteAtom *absoluteAtom = dyn_cast<AbsoluteAtom>(atom)) { - // Absolute atoms are not part of any section, they are global for the whole - // link - _absoluteAtoms.push_back(new (_allocator) - lld::AtomLayout(absoluteAtom, 0, absoluteAtom->value())); - return _absoluteAtoms.back(); - } - llvm_unreachable("Only absolute / defined atoms can be added here"); + + const AbsoluteAtom *absoluteAtom = cast<AbsoluteAtom>(atom); + // Absolute atoms are not part of any section, they are global for the whole + // link + _absoluteAtoms.push_back( + new (_allocator) lld::AtomLayout(absoluteAtom, 0, absoluteAtom->value())); + return _absoluteAtoms.back(); } /// Output sections with the same name into a OutputSection |

