[PATCH] D21681: [ELF] - Implemented support of default/non-default symbols versions
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 25 09:55:43 PDT 2016
grimar added inline comments.
================
Comment at: ELF/SymbolTable.cpp:166
@@ -165,1 +165,3 @@
+static void setupVersionAttributes(Symbol *Sym, StringRef Name) {
+ size_t VersionBegin = Name.find('@');
----------------
ruiu wrote:
> You can make this function side-effect-free.
>
> static uint16_t getVersionId(Symbol *Sym, StringRef Name)
>
> which returns a version ID. Then use it in insert() like this.
>
> Sym->VersionId = getVersionId(Sym, Name);
I can, but what about VersionedName flag ?
I need to set it too, I think the only way to do that without second search of '@' would be:
```
Sym->VersionId = getVersionId(Sym, Name); //search is inside
Sym->VersionedName = Sym->VersionId != VER_NDX_LOCAL &&
Sym->VersionId != VER_NDX_GLOBAL;
```
Looks ok ?
http://reviews.llvm.org/D21681
More information about the llvm-commits
mailing list