Skip to content

Commit 2559c77

Browse files
jrtc27krishna2803
authored andcommitted
[NFC][ELF] Don't duplicate DynamicReloc constructor
This second constructor is just a shorthand for an AddendOnly relocation against dummySym with R_ADDEND, so write it as such. Reviewers: arichardson, MaskRay Reviewed By: MaskRay, arichardson Pull Request: llvm#150811
1 parent 134e3c0 commit 2559c77

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lld/ELF/SyntheticSections.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,8 @@ class DynamicReloc {
442442
/// This constructor records a relative relocation with no symbol.
443443
DynamicReloc(RelType type, const InputSectionBase *inputSec,
444444
uint64_t offsetInSec, int64_t addend = 0)
445-
: sym(inputSec->getCtx().dummySym), inputSec(inputSec),
446-
offsetInSec(offsetInSec), type(type), addend(addend), kind(AddendOnly),
447-
expr(R_ADDEND) {}
445+
: DynamicReloc(type, inputSec, offsetInSec, AddendOnly,
446+
*inputSec->getCtx().dummySym, addend, R_ADDEND) {}
448447

449448
uint64_t getOffset() const;
450449
uint32_t getSymIndex(SymbolTableBaseSection *symTab) const;

0 commit comments

Comments
 (0)