[PATCH] sectiongroup support

Shankar Kalpathi Easwaran shankarke at gmail.com
Thu Mar 13 16:12:14 PDT 2014


  As with GNU, symbols from the first group are the ones chosen.

  Can we add an additional flag for atoms, that would contain what kind of references(lld core references) that the atom contains. This way we could find out by the flag that is set and check if its a group child very easily.


================
Comment at: lib/Core/Resolver.cpp:445-458
@@ +444,16 @@
+          (iterDefAtom->contentType() == DefinedAtom::typeGroupComdat)) {
+        std::vector<std::string> groupMemberDifference;
+        if (!verifyGroupMembers(iterDefAtom, replacedDefAtom,
+                                groupMemberDifference)) {
+          llvm::errs() << "New group member exists in " << iterDefAtom->name()
+                       << ":" << iterDefAtom->file().path()
+                       << " which is not found in group "
+                       << replacedDefAtom->name() << ":"
+                       << replacedDefAtom->file().path() << "\n";
+          llvm::errs() << "Group difference (new members)"
+                       << "\n";
+          for (auto mem : groupMemberDifference)
+            llvm::errs() << mem << " ";
+          llvm::errs() << "\n";
+          llvm::report_fatal_error("group resolution error");
+        }
----------------
kledzik at apple.com wrote:
> Shankar Kalpathi Easwaran wrote:
> > kledzik at apple.com wrote:
> > > I don't think we need to compare the members (unless there is some command line option for debugging group comdat coalescing).  You can have files compiled with different optimizations which may lead to different inlining and thus different symbols exposed for the same group.
> > could this be a warning instead of a error to notify the user ?
> What does the ELF linker do? 
There is no warning / error, but I think we could do better, if the user wants more information through the verbose flag that you mentioned.


http://llvm-reviews.chandlerc.com/D2961



More information about the llvm-commits mailing list