aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support
diff options
context:
space:
mode:
authorDavid Meyer <pdox@google.com>2012-03-09 20:59:52 +0000
committerDavid Meyer <pdox@google.com>2012-03-09 20:59:52 +0000
commit2d70e263c2b508bf4641273dd89a23149f6f6164 (patch)
tree73c16d556e0036179e38acac5d96621d8ddda23b /include/llvm/Support
parent6f9489a86f33624f9ff5388411d12359ce9cef20 (diff)
downloadexternal_llvm-2d70e263c2b508bf4641273dd89a23149f6f6164.zip
external_llvm-2d70e263c2b508bf4641273dd89a23149f6f6164.tar.gz
external_llvm-2d70e263c2b508bf4641273dd89a23149f6f6164.tar.bz2
Support reading GNU symbol versions in ELFObjectFile
* Add enums and structures for GNU version information. * Implement extraction of that information on a per-symbol basis (ELFObjectFile::getSymbolVersion). * Implement a generic interface, GetELFSymbolVersion(), for getting the symbol version from the ObjectFile (hides the templating). * Have llvm-readobj print out the version, when available. * Add a test for the new feature: readobj-elf-versioning.test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r--include/llvm/Support/ELF.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/llvm/Support/ELF.h b/include/llvm/Support/ELF.h
index 6dd76ea..052fc51 100644
--- a/include/llvm/Support/ELF.h
+++ b/include/llvm/Support/ELF.h
@@ -734,6 +734,9 @@ enum {
SHT_GROUP = 17, // Section group.
SHT_SYMTAB_SHNDX = 18, // Indices for SHN_XINDEX entries.
SHT_LOOS = 0x60000000, // Lowest operating system-specific type.
+ SHT_GNU_verdef = 0x6ffffffd, // GNU version definitions.
+ SHT_GNU_verneed = 0x6ffffffe, // GNU version references.
+ SHT_GNU_versym = 0x6fffffff, // GNU symbol versions table.
SHT_HIOS = 0x6fffffff, // Highest operating system-specific type.
SHT_LOPROC = 0x70000000, // Lowest processor architecture-specific type.
// Fixme: All this is duplicated in MCSectionELF. Why??
@@ -1102,6 +1105,33 @@ enum {
DF_STATIC_TLS = 0x10 // Reject attempts to load dynamically.
};
+// ElfXX_VerDef structure version (GNU versioning)
+enum {
+ VER_DEF_NONE = 0,
+ VER_DEF_CURRENT = 1
+};
+
+// VerDef Flags (ElfXX_VerDef::vd_flags)
+enum {
+ VER_FLG_BASE = 0x1,
+ VER_FLG_WEAK = 0x2,
+ VER_FLG_INFO = 0x4
+};
+
+// Special constants for the version table. (SHT_GNU_versym/.gnu.version)
+enum {
+ VER_NDX_LOCAL = 0, // Unversioned local symbol
+ VER_NDX_GLOBAL = 1, // Unversioned global symbol
+ VERSYM_VERSION = 0x7fff, // Version Index mask
+ VERSYM_HIDDEN = 0x8000 // Hidden bit (non-default version)
+};
+
+// ElfXX_VerNeed structure version (GNU versioning)
+enum {
+ VER_NEED_NONE = 0,
+ VER_NEED_CURRENT = 1
+};
+
} // end namespace ELF
} // end namespace llvm