@@ -91,7 +91,7 @@ class X86TargetInfo final : public TargetInfo {
91
91
bool isTlsLocalDynamicRel (uint32_t Type) const override ;
92
92
bool isTlsGlobalDynamicRel (uint32_t Type) const override ;
93
93
bool isTlsInitialExecRel (uint32_t Type) const override ;
94
- void writeGotPlt (uint8_t *Buf, uint64_t Plt ) const override ;
94
+ void writeGotPlt (uint8_t *Buf, const SymbolBody &S ) const override ;
95
95
void writePltZero (uint8_t *Buf) const override ;
96
96
void writePlt (uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr,
97
97
int32_t Index, unsigned RelOff) const override ;
@@ -114,7 +114,7 @@ class X86_64TargetInfo final : public TargetInfo {
114
114
bool isTlsGlobalDynamicRel (uint32_t Type) const override ;
115
115
bool isTlsInitialExecRel (uint32_t Type) const override ;
116
116
void writeGotPltHeader (uint8_t *Buf) const override ;
117
- void writeGotPlt (uint8_t *Buf, uint64_t Plt ) const override ;
117
+ void writeGotPlt (uint8_t *Buf, const SymbolBody &S ) const override ;
118
118
void writePltZero (uint8_t *Buf) const override ;
119
119
void writePlt (uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr,
120
120
int32_t Index, unsigned RelOff) const override ;
@@ -155,7 +155,7 @@ class AArch64TargetInfo final : public TargetInfo {
155
155
RelExpr getRelExpr (uint32_t Type, const SymbolBody &S) const override ;
156
156
uint32_t getDynRel (uint32_t Type) const override ;
157
157
bool isTlsInitialExecRel (uint32_t Type) const override ;
158
- void writeGotPlt (uint8_t *Buf, uint64_t Plt ) const override ;
158
+ void writeGotPlt (uint8_t *Buf, const SymbolBody &S ) const override ;
159
159
void writePltZero (uint8_t *Buf) const override ;
160
160
void writePlt (uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr,
161
161
int32_t Index, unsigned RelOff) const override ;
@@ -181,7 +181,7 @@ class ARMTargetInfo final : public TargetInfo {
181
181
RelExpr getRelExpr (uint32_t Type, const SymbolBody &S) const override ;
182
182
uint32_t getDynRel (uint32_t Type) const override ;
183
183
uint64_t getImplicitAddend (const uint8_t *Buf, uint32_t Type) const override ;
184
- void writeGotPlt (uint8_t *Buf, uint64_t Plt ) const override ;
184
+ void writeGotPlt (uint8_t *Buf, const SymbolBody &S ) const override ;
185
185
void writePltZero (uint8_t *Buf) const override ;
186
186
void writePlt (uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr,
187
187
int32_t Index, unsigned RelOff) const override ;
@@ -194,7 +194,7 @@ template <class ELFT> class MipsTargetInfo final : public TargetInfo {
194
194
RelExpr getRelExpr (uint32_t Type, const SymbolBody &S) const override ;
195
195
uint64_t getImplicitAddend (const uint8_t *Buf, uint32_t Type) const override ;
196
196
uint32_t getDynRel (uint32_t Type) const override ;
197
- void writeGotPlt (uint8_t *Buf, uint64_t Plt ) const override ;
197
+ void writeGotPlt (uint8_t *Buf, const SymbolBody &S ) const override ;
198
198
void writePltZero (uint8_t *Buf) const override ;
199
199
void writePlt (uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr,
200
200
int32_t Index, unsigned RelOff) const override ;
@@ -350,10 +350,10 @@ void X86TargetInfo::writeGotPltHeader(uint8_t *Buf) const {
350
350
write32le (Buf, Out<ELF32LE>::Dynamic->getVA ());
351
351
}
352
352
353
- void X86TargetInfo::writeGotPlt (uint8_t *Buf, uint64_t Plt ) const {
353
+ void X86TargetInfo::writeGotPlt (uint8_t *Buf, const SymbolBody &S ) const {
354
354
// Entries in .got.plt initially points back to the corresponding
355
355
// PLT entries with a fixed offset to skip the first instruction.
356
- write32le (Buf, Plt + 6 );
356
+ write32le (Buf, S. getPltVA <ELF32LE>() + 6 );
357
357
}
358
358
359
359
uint32_t X86TargetInfo::getDynRel (uint32_t Type) const {
@@ -583,9 +583,9 @@ void X86_64TargetInfo::writeGotPltHeader(uint8_t *Buf) const {
583
583
write64le (Buf, Out<ELF64LE>::Dynamic->getVA ());
584
584
}
585
585
586
- void X86_64TargetInfo::writeGotPlt (uint8_t *Buf, uint64_t Plt ) const {
586
+ void X86_64TargetInfo::writeGotPlt (uint8_t *Buf, const SymbolBody &S ) const {
587
587
// See comments in X86TargetInfo::writeGotPlt.
588
- write32le (Buf, Plt + 6 );
588
+ write32le (Buf, S. getPltVA <ELF64LE>() + 6 );
589
589
}
590
590
591
591
void X86_64TargetInfo::writePltZero (uint8_t *Buf) const {
@@ -1203,7 +1203,7 @@ uint32_t AArch64TargetInfo::getDynRel(uint32_t Type) const {
1203
1203
return R_AARCH64_ABS32;
1204
1204
}
1205
1205
1206
- void AArch64TargetInfo::writeGotPlt (uint8_t *Buf, uint64_t Plt ) const {
1206
+ void AArch64TargetInfo::writeGotPlt (uint8_t *Buf, const SymbolBody & ) const {
1207
1207
write64le (Buf, Out<ELF64LE>::Plt->getVA ());
1208
1208
}
1209
1209
@@ -1498,7 +1498,7 @@ uint32_t ARMTargetInfo::getDynRel(uint32_t Type) const {
1498
1498
return R_ARM_ABS32;
1499
1499
}
1500
1500
1501
- void ARMTargetInfo::writeGotPlt (uint8_t *Buf, uint64_t Plt ) const {
1501
+ void ARMTargetInfo::writeGotPlt (uint8_t *Buf, const SymbolBody & ) const {
1502
1502
write32le (Buf, Out<ELF32LE>::Plt->getVA ());
1503
1503
}
1504
1504
@@ -1788,7 +1788,7 @@ uint32_t MipsTargetInfo<ELFT>::getDynRel(uint32_t Type) const {
1788
1788
}
1789
1789
1790
1790
template <class ELFT >
1791
- void MipsTargetInfo<ELFT>::writeGotPlt(uint8_t *Buf, uint64_t Plt ) const {
1791
+ void MipsTargetInfo<ELFT>::writeGotPlt(uint8_t *Buf, const SymbolBody & ) const {
1792
1792
write32<ELFT::TargetEndianness>(Buf, Out<ELFT>::Plt->getVA ());
1793
1793
}
1794
1794
0 commit comments