summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Symbols.h
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Symbols.h')
-rw-r--r--lld/ELF/Symbols.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h
index 62ef088784d..8b103ae889a 100644
--- a/lld/ELF/Symbols.h
+++ b/lld/ELF/Symbols.h
@@ -30,7 +30,6 @@ class BitcodeFile;
class InputFile;
class LazyObjectFile;
class SymbolBody;
-struct Version;
template <class ELFT> class ObjectFile;
template <class ELFT> class OutputSection;
template <class ELFT> class OutputSectionBase;
@@ -303,8 +302,13 @@ public:
SharedFile<ELFT> *File;
const Elf_Sym &Sym;
- // This field is a pointer to the symbol's version definition.
- const Elf_Verdef *Verdef;
+ // This field is initially a pointer to the symbol's version definition. As
+ // symbols are added to the version table, this field is replaced with the
+ // version identifier to be stored in .gnu.version in the output file.
+ union {
+ const Elf_Verdef *Verdef;
+ uint16_t VersionId;
+ };
// OffsetInBss is significant only when needsCopy() is true.
uintX_t OffsetInBss = 0;
@@ -403,9 +407,6 @@ struct Symbol {
// it is weak.
uint8_t Binding;
- // Version definition index.
- uint16_t VersionId;
-
// Symbol visibility. This is the computed minimum visibility of all
// observed non-DSO symbols.
unsigned Visibility : 2;
@@ -422,6 +423,11 @@ struct Symbol {
// --export-dynamic, and by dynamic lists.
unsigned ExportDynamic : 1;
+ // This flag acts as an additional filter on the dynamic symbol list. It is
+ // set if there is no version script, or if the symbol appears in the global
+ // section of the version script.
+ unsigned VersionScriptGlobal : 1;
+
bool includeInDynsym() const;
bool isWeak() const { return Binding == llvm::ELF::STB_WEAK; }
OpenPOWER on IntegriCloud