@@ -419,13 +419,10 @@ class StringTableSection final : public SyntheticSection {
419419class DynamicReloc {
420420public:
421421 enum Kind {
422- // / The resulting dynamic relocation does not reference a symbol (#sym must
423- // / be nullptr) and uses #addend as the result of computeAddend(ctx).
424- AddendOnly,
425422 // / The resulting dynamic relocation will not reference a symbol: #sym is
426423 // / only used to compute the addend with InputSection::getRelocTargetVA().
427424 // / Useful for various relative and TLS relocations (e.g. R_X86_64_TPOFF64).
428- AddendOnlyWithTargetVA ,
425+ AddendOnly ,
429426 // / The resulting dynamic relocation references symbol #sym from the dynamic
430427 // / symbol table and uses #addend as the value of computeAddend(ctx).
431428 AgainstSymbol,
@@ -438,7 +435,7 @@ class DynamicReloc {
438435 // / addresses of 64kb pages that lie inside the output section.
439436 MipsMultiGotPage,
440437 };
441- // / This constructor records a relocation against a symbol .
438+ // / This constructor records a normal relocation .
442439 DynamicReloc (RelType type, const InputSectionBase *inputSec,
443440 uint64_t offsetInSec, Kind kind, Symbol &sym, int64_t addend,
444441 RelExpr expr)
@@ -447,8 +444,9 @@ class DynamicReloc {
447444 // / This constructor records a relative relocation with no symbol.
448445 DynamicReloc (RelType type, const InputSectionBase *inputSec,
449446 uint64_t offsetInSec, int64_t addend = 0 )
450- : sym(nullptr ), inputSec(inputSec), offsetInSec(offsetInSec), type(type),
451- addend(addend), kind(AddendOnly), expr(R_ADDEND) {}
447+ : sym(inputSec->getCtx ().dummySym), inputSec(inputSec),
448+ offsetInSec(offsetInSec), type(type), addend(addend), kind(AddendOnly),
449+ expr(R_ADDEND) {}
452450 // / This constructor records dynamic relocation settings used by the MIPS
453451 // / multi-GOT implementation.
454452 DynamicReloc (RelType type, const InputSectionBase *inputSec,
@@ -528,8 +526,8 @@ class RelocationBaseSection : public SyntheticSection {
528526 uint64_t offsetInSec, Symbol &sym, int64_t addend,
529527 RelType addendRelType, RelExpr expr) {
530528 assert (expr != R_ADDEND && " expected non-addend relocation expression" );
531- addReloc<shard>(DynamicReloc::AddendOnlyWithTargetVA , dynType, isec,
532- offsetInSec, sym, addend, expr, addendRelType);
529+ addReloc<shard>(DynamicReloc::AddendOnly , dynType, isec, offsetInSec, sym ,
530+ addend, expr, addendRelType);
533531 }
534532 // / Add a dynamic relocation using the target address of \p sym as the addend
535533 // / if \p sym is non-preemptible. Otherwise add a relocation against \p sym.
0 commit comments