[PATCH] D21930: [ELF] - Implement extern "c++" version script tag
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 12 04:39:14 PDT 2016
grimar added inline comments.
================
Comment at: ELF/SymbolTable.cpp:572
@@ +571,3 @@
+static void setVersionId(SymbolBody *Body, StringRef VersionName,
+ StringRef Name, uint16_t Version) {
+ if (!Body || Body->isUndefined()) {
----------------
ruiu wrote:
> If you pass a SymbolBody, do you have to pass `Name`? I think you can obtain it by `Body->getName()`.
Here Name is the how it is written in linkerscript. It is SymbolVersion::Name.
So if we have demangled name under extern tag,
it will show it instead of mangled symbol name we can obtain from Body->getName() for example.
That is btw was why I named argument as Entry initially, because Name is a bit confusing in that case,
though it is still a name.
================
Comment at: ELF/SymbolTable.cpp:589
@@ +588,3 @@
+ std::map<std::string, SymbolBody *> Result;
+ for (auto I = Symtab.begin(); I != Symtab.end(); ++I)
+ Result[demangle(I->first.Val)] = SymVector[I->second]->body();
----------------
ruiu wrote:
> Why don't you use a range-based for?
Fixed.
================
Comment at: ELF/SymbolTable.cpp:627-628
@@ -598,7 +626,4 @@
continue;
- SymbolBody *B = find(Name);
- if (!B || B->isUndefined()) {
- if (Config->NoUndefinedVersion)
- error("version script assignment of " + V.Name + " to symbol " +
- Name + " failed: symbol not defined");
+ HasExternCpp |= Sym.IsExternCpp;
+ if (Sym.IsExternCpp)
----------------
ruiu wrote:
> I'd disagree -- that rule doesn't make sense to me. If you specify a mangled name (that contains no wildcards), then that is as specific/strict as demangled names. I don't see a reason to look for extern C++ names after non-extern-C++ names.
Ok. I agree here, implemented that just because I thought we want to follow the existent rules to prevent possible conflicts in existent software. Lets see how it works.
http://reviews.llvm.org/D21930
More information about the llvm-commits
mailing list