@@ -228,10 +228,6 @@ class Symbol {
228
228
// non-lazy object causes a runtime error.
229
229
void extract () const ;
230
230
231
- static bool isExportDynamic (Kind k) {
232
- return k == SharedKind || config->shared || config->exportDynamic ;
233
- }
234
-
235
231
private:
236
232
void resolveUndefined (const Undefined &other);
237
233
void resolveCommon (const CommonSymbol &other);
@@ -250,14 +246,14 @@ class Symbol {
250
246
binding (binding), type(type), stOther(stOther), symbolKind(k),
251
247
visibility(stOther & 3 ),
252
248
isUsedInRegularObj(!file || file->kind () == InputFile::ObjKind),
253
- exportDynamic(isExportDynamic(k)) , inDynamicList(false ),
254
- canInline (false ), referenced (false ), traced (false ),
255
- hasVersionSuffix (false ), isInIplt (false ), gotInIgot (false ),
256
- isPreemptible( false ), used(!config->gcSections), folded(false ),
257
- needsTocRestore (false ), scriptDefined (false ), needsCopy (false ),
258
- needsGot (false ), needsPlt (false ), needsTlsDesc (false ),
259
- needsTlsGd (false ), needsTlsGdToIe (false ), needsTlsLd (false ),
260
- needsGotDtprel( false ), needsTlsIe(false ), hasDirectReloc(false ) {}
249
+ exportDynamic(false ) , inDynamicList( false ), canInline (false ),
250
+ referenced (false ), traced (false ), hasVersionSuffix (false ),
251
+ isInIplt (false ), gotInIgot (false ), isPreemptible (false ),
252
+ used(!config->gcSections), folded( false ), needsTocRestore (false ),
253
+ scriptDefined (false ), needsCopy (false ), needsGot (false ),
254
+ needsPlt (false ), needsTlsDesc (false ), needsTlsGd (false ),
255
+ needsTlsGdToIe (false ), needsTlsLd (false ), needsGotDtprel (false ),
256
+ needsTlsIe(false ), hasDirectReloc(false ) {}
261
257
262
258
public:
263
259
// True if this symbol is in the Iplt sub-section of the Plt and the Igot
@@ -330,7 +326,9 @@ class Defined : public Symbol {
330
326
Defined (InputFile *file, StringRef name, uint8_t binding, uint8_t stOther,
331
327
uint8_t type, uint64_t value, uint64_t size, SectionBase *section)
332
328
: Symbol(DefinedKind, file, name, binding, stOther, type), value(value),
333
- size (size), section(section) {}
329
+ size (size), section(section) {
330
+ exportDynamic = config->shared || config->exportDynamic ;
331
+ }
334
332
335
333
static bool classof (const Symbol *s) { return s->isDefined (); }
336
334
@@ -365,7 +363,9 @@ class CommonSymbol : public Symbol {
365
363
CommonSymbol (InputFile *file, StringRef name, uint8_t binding,
366
364
uint8_t stOther, uint8_t type, uint64_t alignment, uint64_t size)
367
365
: Symbol(CommonKind, file, name, binding, stOther, type),
368
- alignment (alignment), size(size) {}
366
+ alignment (alignment), size(size) {
367
+ exportDynamic = config->shared || config->exportDynamic ;
368
+ }
369
369
370
370
static bool classof (const Symbol *s) { return s->isCommon (); }
371
371
@@ -396,6 +396,7 @@ class SharedSymbol : public Symbol {
396
396
: Symbol(SharedKind, &file, name, binding, stOther, type), value(value),
397
397
size (size), alignment(alignment) {
398
398
this ->verdefIndex = verdefIndex;
399
+ exportDynamic = true ;
399
400
// GNU ifunc is a mechanism to allow user-supplied functions to
400
401
// resolve PLT slot values at load-time. This is contrary to the
401
402
// regular symbol resolution scheme in which symbols are resolved just
0 commit comments