[PATCH] D30485: Perform symbol binding for .symver versioned symbols

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 14:18:32 PST 2017


pcc added a comment.

The parser doesn't seem like the correct place to handle this. If you introduce an `EmitELFSymverDirective` method on `MCStreamer`, and extend the `AsmSymbol` callback to `CollectAsmSymbols` with something that lets the caller know that this is a `symver` symbol and the name of the aliasee, I think you can move all handling of this directive into `RecordStreamer` and the `AsmSymbol` callback provided by `ModuleSymbolTable`.



================
Comment at: include/llvm/Object/ModuleSymbolTable.h:55
   static void CollectAsmSymbols(
-      const Triple &TheTriple, StringRef InlineAsm,
+      const Module &M,
       function_ref<void(StringRef, object::BasicSymbolRef::Flags)> AsmSymbol);
----------------
The signature change seems like a separately useful cleanup.


================
Comment at: lib/Object/ModuleSymbolTable.cpp:112
+      [&](StringRef Name) -> MCSymbolAttr {
+    auto *GV = M.getNamedValue(Name);
+    if (!GV)
----------------
I don't think this is right, as `Name` may be mangled.


https://reviews.llvm.org/D30485





More information about the llvm-commits mailing list