comparison lld/ELF/Symbols.h @ 252:1f2b6ac9f198 llvm-original

LLVM16-1
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 18 Aug 2023 09:04:13 +0900
parents c4bab56944e8
children
comparison
equal deleted inserted replaced
237:c80f45b162ad 252:1f2b6ac9f198
252 252
253 protected: 253 protected:
254 Symbol(Kind k, InputFile *file, StringRef name, uint8_t binding, 254 Symbol(Kind k, InputFile *file, StringRef name, uint8_t binding,
255 uint8_t stOther, uint8_t type) 255 uint8_t stOther, uint8_t type)
256 : file(file), nameData(name.data()), nameSize(name.size()), type(type), 256 : file(file), nameData(name.data()), nameSize(name.size()), type(type),
257 binding(binding), stOther(stOther), symbolKind(k), 257 binding(binding), stOther(stOther), symbolKind(k), exportDynamic(false),
258 exportDynamic(false) {} 258 archSpecificBit(false) {}
259 259
260 void overwrite(Symbol &sym, Kind k) const { 260 void overwrite(Symbol &sym, Kind k) const {
261 if (sym.traced) 261 if (sym.traced)
262 printTraceSymbol(*this, sym.getName()); 262 printTraceSymbol(*this, sym.getName());
263 sym.file = file; 263 sym.file = file;
277 uint8_t gotInIgot : 1; 277 uint8_t gotInIgot : 1;
278 278
279 // True if defined relative to a section discarded by ICF. 279 // True if defined relative to a section discarded by ICF.
280 uint8_t folded : 1; 280 uint8_t folded : 1;
281 281
282 // True if a call to this symbol needs to be followed by a restore of the 282 // Allow reuse of a bit between architecture-exclusive symbol flags.
283 // PPC64 toc pointer. 283 // - needsTocRestore(): On PPC64, true if a call to this symbol needs to be
284 uint8_t needsTocRestore : 1; 284 // followed by a restore of the toc pointer.
285 // - isTagged(): On AArch64, true if the symbol needs special relocation and
286 // metadata semantics because it's tagged, under the AArch64 MemtagABI.
287 uint8_t archSpecificBit : 1;
288 bool needsTocRestore() const { return archSpecificBit; }
289 bool isTagged() const { return archSpecificBit; }
290 void setNeedsTocRestore(bool v) { archSpecificBit = v; }
291 void setIsTagged(bool v) {
292 archSpecificBit = v;
293 }
285 294
286 // True if this symbol is defined by a symbol assignment or wrapped by --wrap. 295 // True if this symbol is defined by a symbol assignment or wrapped by --wrap.
287 // 296 //
288 // LTO shouldn't inline the symbol because it doesn't know the final content 297 // LTO shouldn't inline the symbol because it doesn't know the final content
289 // of the symbol. 298 // of the symbol.
290 uint8_t scriptDefined : 1; 299 uint8_t scriptDefined : 1;
291 300
292 // True if defined in a DSO as protected visibility. 301 // True if defined in a DSO as protected visibility.
293 uint8_t dsoProtected : 1; 302 uint8_t dsoProtected : 1;
303
304 // True if targeted by a range extension thunk.
305 uint8_t thunkAccessed : 1;
294 306
295 // Temporary flags used to communicate which symbol entries need PLT and GOT 307 // Temporary flags used to communicate which symbol entries need PLT and GOT
296 // entries during postScanRelocations(); 308 // entries during postScanRelocations();
297 std::atomic<uint16_t> flags; 309 std::atomic<uint16_t> flags;
298 310
510 // _gp, _gp_disp and __gnu_local_gp symbols. Only for MIPS. 522 // _gp, _gp_disp and __gnu_local_gp symbols. Only for MIPS.
511 static Defined *mipsGp; 523 static Defined *mipsGp;
512 static Defined *mipsGpDisp; 524 static Defined *mipsGpDisp;
513 static Defined *mipsLocalGp; 525 static Defined *mipsLocalGp;
514 526
527 // __global_pointer$ for RISC-V.
528 static Defined *riscvGlobalPointer;
529
515 // __rel{,a}_iplt_{start,end} symbols. 530 // __rel{,a}_iplt_{start,end} symbols.
516 static Defined *relaIpltStart; 531 static Defined *relaIpltStart;
517 static Defined *relaIpltEnd; 532 static Defined *relaIpltEnd;
518
519 // __global_pointer$ for RISC-V.
520 static Defined *riscvGlobalPointer;
521 533
522 // _TLS_MODULE_BASE_ on targets that support TLSDESC. 534 // _TLS_MODULE_BASE_ on targets that support TLSDESC.
523 static Defined *tlsModuleBase; 535 static Defined *tlsModuleBase;
524 }; 536 };
525 537