Delete more ELF bits from the old linker.
authorRafael Espindola <rafael.espindola@gmail.com>
Sun, 28 Feb 2016 16:03:37 +0000 (16:03 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sun, 28 Feb 2016 16:03:37 +0000 (16:03 +0000)
llvm-svn: 262181

27 files changed:
lld/docs/design.rst
lld/include/lld/Core/DefinedAtom.h
lld/include/lld/Core/Reference.h
lld/include/lld/Core/Resolver.h
lld/include/lld/Core/SymbolTable.h
lld/lib/Core/DefinedAtom.cpp
lld/lib/Core/Reader.cpp
lld/lib/Core/Resolver.cpp
lld/lib/Core/SymbolTable.cpp
lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
lld/test/core/Inputs/gnulinkonce-rearrange-resolve.objtxt [deleted file]
lld/test/core/Inputs/gnulinkonce-remaining-undef.objtxt [deleted file]
lld/test/core/Inputs/gnulinkonce-resolve.objtxt [deleted file]
lld/test/core/Inputs/sectiongroup-gnulinkonce-error.objtxt [deleted file]
lld/test/core/Inputs/sectiongroup-rearrange-resolve.objtxt [deleted file]
lld/test/core/Inputs/sectiongroup-remaining-undef.objtxt [deleted file]
lld/test/core/Inputs/sectiongroup-resolve.objtxt [deleted file]
lld/test/core/gnulinkonce-rearrange-resolve.objtxt [deleted file]
lld/test/core/gnulinkonce-remaining-undef.objtxt [deleted file]
lld/test/core/gnulinkonce-resolve.objtxt [deleted file]
lld/test/core/gnulinkonce-simple.objtxt [deleted file]
lld/test/core/sectiongroup-deadstrip.objtxt [deleted file]
lld/test/core/sectiongroup-gnulinkonce-error.objtxt [deleted file]
lld/test/core/sectiongroup-rearrange-resolve.objtxt [deleted file]
lld/test/core/sectiongroup-remaining-undef.objtxt [deleted file]
lld/test/core/sectiongroup-resolve.objtxt [deleted file]
lld/test/core/sectiongroup-simple.objtxt [deleted file]

index 408b8ac..14d1809 100644 (file)
@@ -150,37 +150,6 @@ into an Atom graph.  For instance, you may want the Reader to only accept
 certain architectures.  The options class can be instantiated from command
 line options, or it can be subclassed and the ivars programmatically set.
 
-ELF Section Groups
-~~~~~~~~~~~~~~~~~~
-Reference : `ELF Section Groups <http://mentorembedded.github.io/cxx-abi/abi/prop-72-comdat.html>`_
-
-C++ has many situations where the compiler may need to emit code or data,
-but may not be able to identify a unique compilation unit where it should be
-emitted. The approach chosen by the C++ ABI group to deal with this problem, is
-to allow the compiler to emit the required information in multiple compilation
-units, in a form which allows the linker to remove all but one copy. This is
-essentially the feature called COMDAT in several existing implementations.
-
-The COMDAT sections in ELF are modeled by using '.group' sections in the input
-files. Each '.group' section is associated with a signature. The '.group'
-section has a list of members that are part of the the '.group' which the linker
-selects to appear in the input file(Whichever .group section appeared first
-in the link). References to any of the '.group' members can also appear from
-outside the '.group'.
-
-In lld the the '.group' sections with COMDAT are identified by contentType(
-typeGroupComdat). The '.group' members are identified by using
-**kindGroupChild** references.
-
-The point to be noted here is the 'group child' members would need to be emitted
-in the output file **iff** the group was selected by the resolver.
-
-This is modeled in lld by removing the 'group child' members from the
-definedAtom List.
-
-Any reference to the group-child from **outside the group** is referenced using
-a 'undefined' atom.
-
 Resolving
 ~~~~~~~~~
 
index 8384475..e3ab133 100644 (file)
@@ -149,13 +149,6 @@ public:
     typeTLVInitialZeroFill, // TLV initial zero fill data [Darwin]
     typeTLVInitializerPtr,  // pointer to thread local initializer [Darwin]
     typeDSOHandle,          // atom representing DSO handle [Darwin]
-    typeThreadZeroFill,     // Uninitialized thread local data(TBSS) [ELF]
-    typeThreadData,         // Initialized thread local data(TDATA) [ELF]
-    typeRONote,             // Identifies readonly note sections [ELF]
-    typeRWNote,             // Identifies readwrite note sections [ELF]
-    typeNoAlloc,            // Identifies non allocatable sections [ELF]
-    typeGroupComdat,        // Identifies a section group [ELF, COFF]
-    typeGnuLinkOnce,        // Identifies a gnu.linkonce section [ELF]
     typeSectCreate,         // Created via the -sectcreate option [Darwin]
   };
 
@@ -355,16 +348,7 @@ public:
     ContentType atomContentType = contentType();
     return !(atomContentType == DefinedAtom::typeZeroFill ||
              atomContentType == DefinedAtom::typeZeroFillFast ||
-             atomContentType == DefinedAtom::typeTLVInitialZeroFill ||
-             atomContentType == DefinedAtom::typeThreadZeroFill);
-  }
-
-  /// Utility function to check if the atom belongs to a group section
-  /// that represents section groups or .gnu.linkonce sections.
-  bool isGroupParent() const {
-    ContentType atomContentType = contentType();
-    return (atomContentType == DefinedAtom::typeGroupComdat ||
-            atomContentType == DefinedAtom::typeGnuLinkOnce);
+             atomContentType == DefinedAtom::typeTLVInitialZeroFill);
   }
 
   // Returns true if lhs should be placed before rhs in the final output.
index 971721e..ca72e1e 100644 (file)
@@ -76,8 +76,6 @@ public:
     // kindLayoutAfter is treated as a bidirected edge by the dead-stripping
     // pass.
     kindLayoutAfter = 1,
-    // kindGroupChild is treated as a bidirected edge too.
-    kindGroupChild,
     kindAssociate,
   };
 
index 467ec00..b244a35 100644 (file)
@@ -63,9 +63,6 @@ private:
   bool undefinesAdded(int begin, int end);
   File *getFile(int &index);
 
-  /// \brief Add section group/.gnu.linkonce if it does not exist previously.
-  void maybeAddSectionGroupOrGnuLinkOnce(const DefinedAtom &atom);
-
   /// \brief The main function that iterates over the files to resolve
   void updatePreloadArchiveMap();
   bool resolveUndefines();
index 2e44592..4bde20d 100644 (file)
@@ -70,13 +70,6 @@ public:
   /// @brief if atom has been coalesced away, return true
   bool isCoalescedAway(const Atom *);
 
-  /// @brief Find a group atom.
-  const Atom *findGroup(StringRef name);
-
-  /// @brief Add a group atom and returns true/false depending on whether the
-  /// previously existed.
-  bool addGroup(const DefinedAtom &da);
-
 private:
   typedef llvm::DenseMap<const Atom *, const Atom *> AtomToAtom;
 
@@ -108,7 +101,6 @@ private:
   LinkingContext &_ctx;
   AtomToAtom _replacedAtoms;
   NameToAtom _nameTable;
-  NameToAtom _groupTable;
   AtomContentSet _contentTable;
 };
 
index 09c52f8..8dc4d4a 100644 (file)
@@ -41,8 +41,6 @@ DefinedAtom::ContentPermissions DefinedAtom::permissions(ContentType type) {
   case typeDTraceDOF:
   case typeCompactUnwindInfo:
   case typeProcessedUnwindInfo:
-  case typeRONote:
-  case typeNoAlloc:
   case typeObjCImageInfo:
   case typeObjCMethodList:
     return permR__;
@@ -56,7 +54,6 @@ DefinedAtom::ContentPermissions DefinedAtom::permissions(ContentType type) {
   case typeLazyDylibPointer:
   case typeNonLazyPointer:
   case typeThunkTLV:
-  case typeRWNote:
     return permRW_;
 
   case typeGOT:
@@ -71,12 +68,8 @@ DefinedAtom::ContentPermissions DefinedAtom::permissions(ContentType type) {
   case typeTLVInitialData:
   case typeTLVInitialZeroFill:
   case typeTLVInitializerPtr:
-  case typeThreadData:
-  case typeThreadZeroFill:
     return permRW_L;
 
-  case typeGroupComdat:
-  case typeGnuLinkOnce:
   case typeUnknown:
   case typeTempLTO:
   case typeSectCreate:
index 6069093..107db07 100644 (file)
@@ -47,7 +47,6 @@ Registry::loadFile(std::unique_ptr<MemoryBuffer> mb) const {
 
 static const Registry::KindStrings kindStrings[] = {
     {Reference::kindLayoutAfter, "layout-after"},
-    {Reference::kindGroupChild, "group-child"},
     {Reference::kindAssociate, "associate"},
     LLD_KIND_STRING_END};
 
index 5f70ae2..840cbbe 100644 (file)
@@ -154,39 +154,6 @@ bool Resolver::doUndefinedAtom(const UndefinedAtom &atom) {
   return newUndefAdded;
 }
 
-/// \brief Add the section group and the group-child reference members.
-void Resolver::maybeAddSectionGroupOrGnuLinkOnce(const DefinedAtom &atom) {
-  // First time adding a group?
-  bool isFirstTime = _symbolTable.addGroup(atom);
-
-  if (!isFirstTime) {
-    // If duplicate symbols are allowed, select the first group.
-    if (_ctx.getAllowDuplicates())
-      return;
-    auto *prevGroup = dyn_cast<DefinedAtom>(_symbolTable.findGroup(atom.name()));
-    assert(prevGroup &&
-           "Internal Error: The group atom could only be a defined atom");
-    // The atoms should be of the same content type, reject invalid group
-    // resolution behaviors.
-    if (atom.contentType() == prevGroup->contentType())
-      return;
-    llvm::errs() << "SymbolTable: error while merging " << atom.name()
-                 << "\n";
-    llvm::report_fatal_error("duplicate symbol error");
-  }
-
-  for (const Reference *r : atom) {
-    if (r->kindNamespace() == lld::Reference::KindNamespace::all &&
-        r->kindValue() == lld::Reference::kindGroupChild) {
-      const DefinedAtom *target = dyn_cast<DefinedAtom>(r->target());
-      assert(target && "Internal Error: kindGroupChild references need to "
-                       "be associated with Defined Atoms only");
-      _atoms.push_back(target);
-      _symbolTable.add(*target);
-    }
-  }
-}
-
 // Called on each atom when a file is added. Returns true if a given
 // atom is added to the symbol table.
 void Resolver::doDefinedAtom(const DefinedAtom &atom) {
@@ -205,12 +172,7 @@ void Resolver::doDefinedAtom(const DefinedAtom &atom) {
 
   // add to list of known atoms
   _atoms.push_back(&atom);
-
-  if (atom.isGroupParent()) {
-    maybeAddSectionGroupOrGnuLinkOnce(atom);
-  } else {
-    _symbolTable.add(atom);
-  }
+  _symbolTable.add(atom);
 
   // An atom that should never be dead-stripped is a dead-strip root.
   if (_ctx.deadStrip() && atom.deadStrip() == DefinedAtom::deadStripNever) {
@@ -439,8 +401,7 @@ void Resolver::markLive(const Atom *atom) {
 static bool isBackref(const Reference *ref) {
   if (ref->kindNamespace() != lld::Reference::KindNamespace::all)
     return false;
-  return (ref->kindValue() == lld::Reference::kindLayoutAfter ||
-          ref->kindValue() == lld::Reference::kindGroupChild);
+  return (ref->kindValue() == lld::Reference::kindLayoutAfter);
 }
 
 // remove all atoms not actually used
index b85a83f..9382db9 100644 (file)
@@ -55,25 +55,6 @@ bool SymbolTable::add(const DefinedAtom &atom) {
   return false;
 }
 
-const Atom *SymbolTable::findGroup(StringRef sym) {
-  NameToAtom::iterator pos = _groupTable.find(sym);
-  if (pos == _groupTable.end())
-    return nullptr;
-  return pos->second;
-}
-
-bool SymbolTable::addGroup(const DefinedAtom &da) {
-  StringRef name = da.name();
-  assert(!name.empty());
-  const Atom *existing = findGroup(name);
-  if (existing == nullptr) {
-    _groupTable[name] = &da;
-    return true;
-  }
-  _replacedAtoms[&da] = existing;
-  return false;
-}
-
 enum NameCollisionResolution {
   NCR_First,
   NCR_Second,
index e01130e..151d204 100644 (file)
@@ -178,31 +178,10 @@ public:
     return nullptr;
   }
 
-  /// \brief Lookup a group parent when there is a reference of type
-  /// kindGroupChild. If there was no group-parent produce an appropriate
-  /// error.
-  const lld::Atom *lookupGroupParent(StringRef name) const {
-    NameToAtom::const_iterator pos = _groupMap.find(name);
-    if (pos != _groupMap.end())
-      return pos->second;
-    _io.setError(Twine("no such group name: ") + name);
-    return nullptr;
-  }
-
 private:
   typedef llvm::StringMap<const lld::Atom *> NameToAtom;
 
   void add(StringRef name, const lld::Atom *atom) {
-    if (const lld::DefinedAtom *da = dyn_cast<DefinedAtom>(atom)) {
-      if (da->isGroupParent()) {
-        if (_groupMap.count(name)) {
-          _io.setError(Twine("duplicate group name: ") + name);
-        } else {
-          _groupMap[name] = atom;
-        }
-        return;
-      }
-    }
     if (_nameMap.count(name)) {
       _io.setError(Twine("duplicate atom name: ") + name);
     } else {
@@ -212,7 +191,6 @@ private:
 
   IO &_io;
   NameToAtom _nameMap;
-  NameToAtom _groupMap;
 };
 
 /// Mapping of Atoms.
@@ -435,13 +413,6 @@ template <> struct ScalarEnumerationTraits<lld::DefinedAtom::ContentType> {
                                           DefinedAtom::typeTLVInitializerPtr);
     io.enumCase(value, "mach_header",     DefinedAtom::typeMachHeader);
     io.enumCase(value, "dso_handle",      DefinedAtom::typeDSOHandle);
-    io.enumCase(value, "thread-data",     DefinedAtom::typeThreadData);
-    io.enumCase(value, "thread-zero-fill",DefinedAtom::typeThreadZeroFill);
-    io.enumCase(value, "ro-note",         DefinedAtom::typeRONote);
-    io.enumCase(value, "rw-note",         DefinedAtom::typeRWNote);
-    io.enumCase(value, "no-alloc",        DefinedAtom::typeNoAlloc);
-    io.enumCase(value, "group-comdat", DefinedAtom::typeGroupComdat);
-    io.enumCase(value, "gnu-linkonce", DefinedAtom::typeGnuLinkOnce);
     io.enumCase(value, "sectcreate",      DefinedAtom::typeSectCreate);
   }
 };
@@ -792,7 +763,7 @@ template <> struct MappingTraits<const lld::DefinedAtom *> {
   public:
     NormalizedAtom(IO &io)
         : _file(fileFromContext(io)), _name(), _refName(), _contentType(),
-          _alignment(1), _content(), _references(), _isGroupChild(false) {
+          _alignment(1), _content(), _references() {
       static uint32_t ordinalCounter = 1;
       _ordinal = ordinalCounter++;
     }
@@ -856,8 +827,6 @@ template <> struct MappingTraits<const lld::DefinedAtom *> {
     DynamicExport dynamicExport() const override { return _dynamicExport; }
     CodeModel codeModel() const override { return _codeModel; }
     ContentPermissions permissions() const override { return _permissions; }
-    void setGroupChild(bool val) { _isGroupChild = val; }
-    bool isGroupChild() const { return _isGroupChild; }
     ArrayRef<uint8_t> rawContent() const override {
       if (!occupiesDiskSpace())
         return ArrayRef<uint8_t>();
@@ -917,7 +886,6 @@ template <> struct MappingTraits<const lld::DefinedAtom *> {
     StringRef                           _sectionName;
     uint64_t                            _sectionSize;
     std::vector<const lld::Reference *> _references;
-    bool _isGroupChild;
   };
 
   static void mapping(IO &io, const lld::DefinedAtom *&atom) {
@@ -1201,13 +1169,6 @@ MappingTraits<const lld::File *>::NormalizedFile::denormalize(IO &io) {
     normAtom->bind(nameResolver);
   }
 
-  _definedAtoms._atoms.erase(
-      std::remove_if(_definedAtoms._atoms.begin(), _definedAtoms._atoms.end(),
-                     [](const DefinedAtom *a) {
-        return ((const NormalizedAtom *)a)->isGroupChild();
-      }),
-      _definedAtoms._atoms.end());
-
   return this;
 }
 
@@ -1223,14 +1184,7 @@ inline void MappingTraits<const lld::DefinedAtom *>::NormalizedAtom::bind(
 
 inline void MappingTraits<const lld::Reference *>::NormalizedReference::bind(
     const RefNameResolver &resolver) {
-  typedef MappingTraits<const lld::DefinedAtom *>::NormalizedAtom NormalizedAtom;
-
   _target = resolver.lookup(_targetName);
-
-  if (_mappedKind.ns == lld::Reference::KindNamespace::all &&
-      _mappedKind.value == lld::Reference::kindGroupChild) {
-    ((NormalizedAtom *)const_cast<Atom *>(_target))->setGroupChild(true);
-  }
 }
 
 inline StringRef
diff --git a/lld/test/core/Inputs/gnulinkonce-rearrange-resolve.objtxt b/lld/test/core/Inputs/gnulinkonce-rearrange-resolve.objtxt
deleted file mode 100644 (file)
index e1fa42a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
----
-defined-atoms:
-  - name:            g1
-    scope:           global
-    type:            gnu-linkonce
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
diff --git a/lld/test/core/Inputs/gnulinkonce-remaining-undef.objtxt b/lld/test/core/Inputs/gnulinkonce-remaining-undef.objtxt
deleted file mode 100644 (file)
index 02903a6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
----
-defined-atoms:
-  - name:            anotherfunction
-    scope:           global
-    type:            data
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            f3
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            gnu-linkonce
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          f3
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
diff --git a/lld/test/core/Inputs/gnulinkonce-resolve.objtxt b/lld/test/core/Inputs/gnulinkonce-resolve.objtxt
deleted file mode 100644 (file)
index f4beb37..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-defined-atoms:
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            gnu-linkonce
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
diff --git a/lld/test/core/Inputs/sectiongroup-gnulinkonce-error.objtxt b/lld/test/core/Inputs/sectiongroup-gnulinkonce-error.objtxt
deleted file mode 100644 (file)
index a365d37..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
----
-defined-atoms:
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            gnu-linkonce
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
diff --git a/lld/test/core/Inputs/sectiongroup-rearrange-resolve.objtxt b/lld/test/core/Inputs/sectiongroup-rearrange-resolve.objtxt
deleted file mode 100644 (file)
index bcefee6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-defined-atoms:
-  - name:            g1
-    scope:           global
-    type:            group-comdat
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
diff --git a/lld/test/core/Inputs/sectiongroup-remaining-undef.objtxt b/lld/test/core/Inputs/sectiongroup-remaining-undef.objtxt
deleted file mode 100644 (file)
index 07c7af5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
----
-defined-atoms:
-  - name:            anotherfunction
-    scope:           global
-    type:            data
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            f3
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            group-comdat
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          f3
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
diff --git a/lld/test/core/Inputs/sectiongroup-resolve.objtxt b/lld/test/core/Inputs/sectiongroup-resolve.objtxt
deleted file mode 100644 (file)
index a047ad3..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
----
-defined-atoms:
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            group-comdat
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
diff --git a/lld/test/core/gnulinkonce-rearrange-resolve.objtxt b/lld/test/core/gnulinkonce-rearrange-resolve.objtxt
deleted file mode 100644 (file)
index b3df078..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-# RUN: lld -core %s %p/Inputs/gnulinkonce-rearrange-resolve.objtxt | FileCheck %s
-
-#
-# Test that gnu linkonce sections are parsed and the first section selected for symbol
-# resolution
-#
-
----
-defined-atoms:
-  - name:            g1
-    scope:           global
-    type:            gnu-linkonce
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-...
-
-# CHECK: defined-atoms:
-# CHECK:   - name:            g1
-# CHECK:     ref-name:        [[PARENT:[a-zA-Z\.0-9_]+]]
-# CHECK:     type:            gnu-linkonce
-# CHECK:     references:
-# CHECK:       - kind:            group-child
-# CHECK:         target:          f1
-# CHECK:       - kind:            group-child
-# CHECK:         target:          f2
-# CHECK:       - kind:            group-child
-# CHECK:         target:          [[CHILD:[a-zA-Z\.0-9_]+]]
-# CHECK:       - kind:            group-child
-# CHECK:         target:          d1
-# CHECK:   - name:            f1
-# CHECK:   - name:            f2
-# CHECK:   - name:            g1
-# CHECK:     ref-name:        [[CHILD]]
-# CHECK:   - name:            d1
diff --git a/lld/test/core/gnulinkonce-remaining-undef.objtxt b/lld/test/core/gnulinkonce-remaining-undef.objtxt
deleted file mode 100644 (file)
index 5fe0ab5..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-# RUN: lld -core %s %p/Inputs/gnulinkonce-remaining-undef.objtxt \
-# RUN: %p/Inputs/gnulinkonce-remaining-undef2.objtxt | FileCheck %s
-
-#
-# Test that gnu linkonce sections are parsed and the first section selected for
-# symbol resolution. The second file which has the same gnu linkonce section has
-# a unresolved undefined symbol. lets make sure that the symbol is kept around
-# in the final link and remains undefined.
-#
-
----
-defined-atoms:
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            gnu-linkonce
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
-...
-
-#CHECK:   - name:            anotherfunction
-#CHECK:     scope:           global
-#CHECK:     type:            data
-#CHECK: undefined-atoms:
-#CHECK:   - name:            f3
diff --git a/lld/test/core/gnulinkonce-resolve.objtxt b/lld/test/core/gnulinkonce-resolve.objtxt
deleted file mode 100644 (file)
index e926c39..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-# RUN: lld -core %s %p/Inputs/gnulinkonce-resolve.objtxt | FileCheck %s
-
-#
-# Test that gnu linkonce sections are parsed and the first section selected for symbol
-# resolution
-#
-
----
-defined-atoms:
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            gnu-linkonce
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
-...
-
-#CHECK: defined-atoms:
-#CHECK:   - name:            g1
-#CHECK:     ref-name:        [[PARENT:[a-zA-Z\.0-9_]+]]
-#CHECK:     scope:           global
-#CHECK:     type:            gnu-linkonce
-#CHECK:     references:
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          f1
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          f2
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          [[GCHILD:[a-zA-Z\.0-9_]+]]
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          d1
-#CHECK:   - name:            f1
-#CHECK:     scope:           global
-#CHECK:   - name:            f2
-#CHECK:     scope:           global
-#CHECK:   - name:            g1
-#CHECK:     ref-name:        [[GCHILD]]
-#CHECK:     scope:           global
-#CHECK:   - name:            d1
-#CHECK:     scope:           global
-#CHECK:     type:            data
diff --git a/lld/test/core/gnulinkonce-simple.objtxt b/lld/test/core/gnulinkonce-simple.objtxt
deleted file mode 100644 (file)
index 0576e5f..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-# RUN: lld -core %s %p/Inputs/gnulinkonce-simple.objtxt | FileCheck %s
-
-#
-# Test that gnu linkonce sections are parsed properly when there is a reference to a
-# atom from outside the gnu linkonce section.
-#
-
----
-defined-atoms:
-  - name:            f1
-    scope:           global
-    type:            code
-    references:
-      - kind:            layout-after
-        target:          anotherfunction
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            gnu-linkonce
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          d1
-      - kind:            group-child
-        target:          g1
-  - name:            anotherfunction
-    scope:           global
-    type:            data
-...
-
-#CHECK: defined-atoms:
-#CHECK:   - name:            g1
-#CHECK:     ref-name:        [[PARENT:[a-zA-Z\.0-9_]+]]
-#CHECK:     scope:           global
-#CHECK:     type:            gnu-linkonce
-#CHECK:     references:
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          f1
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          f2
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          d1
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          [[GCHILD:[a-zA-Z\.0-9_]+]]
-#CHECK:   - name:            f1
-#CHECK:     scope:           global
-#CHECK:     references:
-#CHECK:       - kind:            layout-after
-#CHECK:         offset:          0
-#CHECK:         target:          anotherfunction
-#CHECK:   - name:            f2
-#CHECK:     scope:           global
-#CHECK:   - name:            d1
-#CHECK:     scope:           global
-#CHECK:     type:            data
-#CHECK:   - name:            g1
-#CHECK:     ref-name:        [[GCHILD]]
-#CHECK:     scope:           global
-#CHECK:   - name:            anotherfunction
-#CHECK:     scope:           global
-#CHECK:     type:            data
diff --git a/lld/test/core/sectiongroup-deadstrip.objtxt b/lld/test/core/sectiongroup-deadstrip.objtxt
deleted file mode 100644 (file)
index 5055c6e..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-# Test for section group members be preserved even if there is a
-# reference to only one functions in the group.
-# RUN: lld -core --dead-strip %s %p/Inputs/sectiongroup-deadstrip.objtxt | FileCheck %s
-
-#
-# Test that section groups are parsed properly when there is a reference to a
-# group atom from outside a group.
-#
-
----
-defined-atoms:
-  - name:         entry
-    dead-strip:   never
-    references:
-    - offset:          1
-      kind:            pcrel32
-      target:          d1
-  - name:            f1
-    scope:           global
-    type:            code
-    references:
-      - kind:            layout-after
-        target:          anotherfunction
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            group-comdat
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          d1
-      - kind:            group-child
-        target:          g1
-  - name:            anotherfunction
-    scope:           global
-    type:            data
-...
-
-#CHECK: defined-atoms:
-#CHECK:   - name:            g1
-#CHECK:     ref-name:        [[PARENT:[a-zA-Z\.0-9_]+]]
-#CHECK:     scope:           global
-#CHECK:     type:            group-comdat
-#CHECK:     references:
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          f1
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          f2
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          d1
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          [[GCHILD:[a-zA-Z\.0-9_]+]]
-#CHECK:   - name:            f1
-#CHECK:     scope:           global
-#CHECK:     references:
-#CHECK:       - kind:            layout-after
-#CHECK:         offset:          0
-#CHECK:         target:          anotherfunction
-#CHECK:   - name:            f2
-#CHECK:     scope:           global
-#CHECK:   - name:            d1
-#CHECK:     scope:           global
-#CHECK:     type:            data
-#CHECK:   - name:            g1
-#CHECK:     ref-name:        [[GCHILD]]
-#CHECK:     scope:           global
-#CHECK:   - name:            anotherfunction
-#CHECK:     scope:           global
-#CHECK:     type:            data
diff --git a/lld/test/core/sectiongroup-gnulinkonce-error.objtxt b/lld/test/core/sectiongroup-gnulinkonce-error.objtxt
deleted file mode 100644 (file)
index 1b86170..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-# RUN: not lld -core %s %p/Inputs/sectiongroup-gnulinkonce-error.objtxt 2>&1 | FileCheck %s
-
-#
-# Test that section groups/gnu linkonce sections are parsed and a merge error
-# is displayed at the time of symbol resolution.
-#
-
----
-defined-atoms:
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            group-comdat
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
-...
-
-#CHECK: SymbolTable: error while merging g1
-#CHECK: LLVM ERROR: duplicate symbol error
-
diff --git a/lld/test/core/sectiongroup-rearrange-resolve.objtxt b/lld/test/core/sectiongroup-rearrange-resolve.objtxt
deleted file mode 100644 (file)
index f191113..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-# RUN: lld -core %s %p/Inputs/sectiongroup-rearrange-resolve.objtxt | FileCheck %s
-
-#
-# Test that section groups are parsed and the first group selected for symbol
-# resolution
-#
-
----
-defined-atoms:
-  - name:            g1
-    scope:           global
-    type:            group-comdat
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-...
-
-# CHECK: defined-atoms:
-# CHECK:   - name:            g1
-# CHECK:     ref-name:        [[PARENT:[a-zA-Z\.0-9_]+]]
-# CHECK:     type:            group-comdat
-# CHECK:     references:
-# CHECK:       - kind:            group-child
-# CHECK:         target:          f1
-# CHECK:       - kind:            group-child
-# CHECK:         target:          f2
-# CHECK:       - kind:            group-child
-# CHECK:         target:          [[CHILD:[a-zA-Z\.0-9_]+]]
-# CHECK:       - kind:            group-child
-# CHECK:         target:          d1
-# CHECK:   - name:            f1
-# CHECK:   - name:            f2
-# CHECK:   - name:            g1
-# CHECK:     ref-name:        [[CHILD]]
-# CHECK:   - name:            d1
diff --git a/lld/test/core/sectiongroup-remaining-undef.objtxt b/lld/test/core/sectiongroup-remaining-undef.objtxt
deleted file mode 100644 (file)
index 0a29204..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-# RUN: lld -core %s %p/Inputs/sectiongroup-remaining-undef.objtxt %p/Inputs/sectiongroup-remaining-undef2.objtxt | FileCheck %s
-
-#
-# Test that section groups are parsed and the first group selected for symbol
-# resolution. The second file which has the same group has a unresolved
-# undefined symbol. lets make sure that the symbol is kept around in the final
-# link and remains undefined.
-#
-
----
-defined-atoms:
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            group-comdat
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
-...
-
-#CHECK:   - name:            anotherfunction
-#CHECK:     scope:           global
-#CHECK:     type:            data
-#CHECK: undefined-atoms:
-#CHECK:   - name:            f3
diff --git a/lld/test/core/sectiongroup-resolve.objtxt b/lld/test/core/sectiongroup-resolve.objtxt
deleted file mode 100644 (file)
index 52197db..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# RUN: lld -core %s | FileCheck %s
-
-#
-# Test that section groups are parsed and the first group selected for symbol
-# resolution
-#
-
----
-defined-atoms:
-  - name:            f1
-    scope:           global
-    type:            code
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            group-comdat
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          g1
-      - kind:            group-child
-        target:          d1
-...
-
-#CHECK: defined-atoms:
-#CHECK:   - name:            g1
-#CHECK:     ref-name:        [[PARENT:[a-zA-Z\.0-9_]+]]
-#CHECK:     scope:           global
-#CHECK:     type:            group-comdat
-#CHECK:     references:
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          f1
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          f2
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          [[GCHILD:[a-zA-Z\.0-9_]+]]
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          d1
-#CHECK:   - name:            f1
-#CHECK:     scope:           global
-#CHECK:   - name:            f2
-#CHECK:     scope:           global
-#CHECK:   - name:            g1
-#CHECK:     ref-name:        [[GCHILD]]
-#CHECK:     scope:           global
-#CHECK:   - name:            d1
-#CHECK:     scope:           global
-#CHECK:     type:            data
-#CHECK: ...
diff --git a/lld/test/core/sectiongroup-simple.objtxt b/lld/test/core/sectiongroup-simple.objtxt
deleted file mode 100644 (file)
index d81b1a1..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-# RUN: lld -core %s | FileCheck %s
-
-#
-# Test that section groups are parsed properly when there is a reference to a
-# group atom from outside a group.
-#
-
----
-defined-atoms:
-  - name:            f1
-    scope:           global
-    type:            code
-    references:
-      - kind:            layout-after
-        target:          anotherfunction
-  - name:            f2
-    scope:           global
-    type:            code
-  - name:            g1
-    scope:           global
-    type:            code
-  - name:            d1
-    scope:           global
-    type:            data
-  - name:            g1
-    scope:           global
-    type:            group-comdat
-    references:
-      - kind:            group-child
-        target:          f1
-      - kind:            group-child
-        target:          f2
-      - kind:            group-child
-        target:          d1
-      - kind:            group-child
-        target:          g1
-  - name:            anotherfunction
-    scope:           global
-    type:            data
-...
-
-#CHECK: defined-atoms:
-#CHECK:   - name:            g1
-#CHECK:     ref-name:        [[PARENT:[a-zA-Z\.0-9_]+]]
-#CHECK:     scope:           global
-#CHECK:     type:            group-comdat
-#CHECK:     references:
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          f1
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          f2
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          d1
-#CHECK:       - kind:            group-child
-#CHECK:         offset:          0
-#CHECK:         target:          [[GCHILD:[a-zA-Z\.0-9_]+]]
-#CHECK:   - name:            f1
-#CHECK:     scope:           global
-#CHECK:     references:
-#CHECK:       - kind:            layout-after
-#CHECK:         offset:          0
-#CHECK:         target:          anotherfunction
-#CHECK:   - name:            f2
-#CHECK:     scope:           global
-#CHECK:   - name:            d1
-#CHECK:     scope:           global
-#CHECK:     type:            data
-#CHECK:   - name:            g1
-#CHECK:     ref-name:        [[GCHILD]]
-#CHECK:     scope:           global
-#CHECK:   - name:            anotherfunction
-#CHECK:     scope:           global
-#CHECK:     type:            data