uint32_t nameSize;
public:
- // A symAux index used to access GOT/PLT entry indexes. This is allocated in
- // postScanRelocations().
- uint32_t auxIdx = -1;
- uint32_t dynsymIndex = 0;
-
- // This field is a index to the symbol's version definition.
- uint16_t verdefIndex = -1;
-
- // Version definition index.
- uint16_t versionId;
-
// Symbol binding. This is not overwritten by replace() to track
// changes during resolution. In particular:
// - An undefined weak is still weak when it resolves to a shared library.
uint8_t symbolKind;
+ // The partition whose dynamic symbol table contains this symbol's definition.
+ uint8_t partition = 1;
+
// Symbol visibility. This is the computed minimum visibility of all
// observed non-DSO symbols.
uint8_t visibility : 2;
+ // True if this symbol is preemptible at load time.
+ uint8_t isPreemptible : 1;
+
// True if the symbol was used for linking and thus need to be added to the
// output file's symbol table. This is true for all symbols except for
// unreferenced DSO symbols, lazy (archive) symbols, and bitcode symbols that
// are unreferenced except by other bitcode objects.
uint8_t isUsedInRegularObj : 1;
+ // True if an undefined or shared symbol is used from a live section.
+ //
+ // NOTE: In Writer.cpp the field is used to mark local defined symbols
+ // which are referenced by relocations when -r or --emit-relocs is given.
+ uint8_t used : 1;
+
// Used by a Defined symbol with protected or default visibility, to record
// whether it is required to be exported into .dynsym. This is set when any of
// the following conditions hold:
uint8_t stOther, uint8_t type)
: file(file), nameData(name.data()), nameSize(name.size()),
binding(binding), type(type), stOther(stOther), symbolKind(k),
- visibility(stOther & 3),
+ visibility(stOther & 3), isPreemptible(false),
isUsedInRegularObj(!file || file->kind() == InputFile::ObjKind),
- exportDynamic(false), inDynamicList(false), referenced(false),
- traced(false), hasVersionSuffix(false), isInIplt(false),
- gotInIgot(false), isPreemptible(false), used(false), folded(false),
+ used(false), exportDynamic(false), inDynamicList(false),
+ referenced(false), traced(false), hasVersionSuffix(false),
+ isInIplt(false), gotInIgot(false), folded(false),
needsTocRestore(false), scriptDefined(false), needsCopy(false),
needsGot(false), needsPlt(false), needsTlsDesc(false),
needsTlsGd(false), needsTlsGdToIe(false), needsTlsLd(false),
// Igot. This will be true only for certain non-preemptible ifuncs.
uint8_t gotInIgot : 1;
- // True if this symbol is preemptible at load time.
- uint8_t isPreemptible : 1;
-
- // True if an undefined or shared symbol is used from a live section.
- //
- // NOTE: In Writer.cpp the field is used to mark local defined symbols
- // which are referenced by relocations when -r or --emit-relocs is given.
- uint8_t used : 1;
-
// True if defined relative to a section discarded by ICF.
uint8_t folded : 1;
uint8_t needsTlsIe : 1;
uint8_t hasDirectReloc : 1;
+ // A symAux index used to access GOT/PLT entry indexes. This is allocated in
+ // postScanRelocations().
+ uint32_t auxIdx = -1;
+ uint32_t dynsymIndex = 0;
+
+ // This field is a index to the symbol's version definition.
+ uint16_t verdefIndex = -1;
+
+ // Version definition index.
+ uint16_t versionId;
+
bool needsDynReloc() const {
return needsCopy || needsGot || needsPlt || needsTlsDesc || needsTlsGd ||
needsTlsGdToIe || needsTlsLd || needsGotDtprel || needsTlsIe;
symAux.emplace_back();
}
- // The partition whose dynamic symbol table contains this symbol's definition.
- uint8_t partition = 1;
-
bool isSection() const { return type == llvm::ELF::STT_SECTION; }
bool isTls() const { return type == llvm::ELF::STT_TLS; }
bool isFunc() const { return type == llvm::ELF::STT_FUNC; }
// old may be a placeholder. The referenced fields must be initialized in
// SymbolTable::insert.
- versionId = old.versionId;
+ partition = old.partition;
visibility = old.visibility;
+ isPreemptible = old.isPreemptible;
isUsedInRegularObj = old.isUsedInRegularObj;
exportDynamic = old.exportDynamic;
inDynamicList = old.inDynamicList;
referenced = old.referenced;
traced = old.traced;
hasVersionSuffix = old.hasVersionSuffix;
- isPreemptible = old.isPreemptible;
scriptDefined = old.scriptDefined;
- partition = old.partition;
+ versionId = old.versionId;
// Print out a log message if --trace-symbol was specified.
// This is for debugging.