Skip to content

Commit

Permalink
Added symbol linkage support for GNU unique linkage types (#209)
Browse files Browse the repository at this point in the history
* Added symbol linkage support for GNU unique linkage types

* Added define guards around STB_GNU_UNIQUE
  • Loading branch information
bwelton authored and wrwilliams committed Oct 19, 2016
1 parent 85c4fc2 commit a8252fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion symtabAPI/h/Symbol.h
Expand Up @@ -130,7 +130,8 @@ class SYMTAB_EXPORT Symbol : public Serializable,
SL_UNKNOWN,
SL_GLOBAL,
SL_LOCAL,
SL_WEAK
SL_WEAK,
SL_UNIQUE
};

static const char *symbolLinkage2Str(SymbolLinkage t);
Expand Down
3 changes: 3 additions & 0 deletions symtabAPI/src/Object-elf.C
Expand Up @@ -1861,6 +1861,9 @@ static Symbol::SymbolLinkage pdelf_linkage(int elf_binding)
case STB_LOCAL: return Symbol::SL_LOCAL;
case STB_WEAK: return Symbol::SL_WEAK;
case STB_GLOBAL: return Symbol::SL_GLOBAL;
#if defined(STB_GNU_UNIQUE)
case STB_GNU_UNIQUE: return Symbol::SL_UNIQUE;
#endif
}
return Symbol::SL_UNKNOWN;
}
Expand Down
3 changes: 3 additions & 0 deletions symtabAPI/src/emitElf.C
Expand Up @@ -225,6 +225,9 @@ static int elfSymBind(Symbol::SymbolLinkage sLinkage)
case Symbol::SL_LOCAL: return STB_LOCAL;
case Symbol::SL_WEAK: return STB_WEAK;
case Symbol::SL_GLOBAL: return STB_GLOBAL;
#if defined(STB_GNU_UNIQUE)
case Symbol::SL_UNIQUE: return STB_GNU_UNIQUE;
#endif
default: return STB_LOPROC;
}
}
Expand Down

0 comments on commit a8252fd

Please sign in to comment.