@@ -92,7 +92,7 @@ class X86TargetInfo final : public TargetInfo {
92
92
bool isTlsGlobalDynamicRel (uint32_t Type) const override ;
93
93
bool isTlsInitialExecRel (uint32_t Type) const override ;
94
94
void writeGotPlt (uint8_t *Buf, const SymbolBody &S) const override ;
95
- void writePltZero (uint8_t *Buf) const override ;
95
+ void writePltHeader (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 ;
98
98
void relocateOne (uint8_t *Loc, uint32_t Type, uint64_t Val) const override ;
@@ -115,7 +115,7 @@ class X86_64TargetInfo final : public TargetInfo {
115
115
bool isTlsInitialExecRel (uint32_t Type) const override ;
116
116
void writeGotPltHeader (uint8_t *Buf) const override ;
117
117
void writeGotPlt (uint8_t *Buf, const SymbolBody &S) const override ;
118
- void writePltZero (uint8_t *Buf) const override ;
118
+ void writePltHeader (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 ;
121
121
void relocateOne (uint8_t *Loc, uint32_t Type, uint64_t Val) const override ;
@@ -156,7 +156,7 @@ class AArch64TargetInfo final : public TargetInfo {
156
156
uint32_t getDynRel (uint32_t Type) const override ;
157
157
bool isTlsInitialExecRel (uint32_t Type) const override ;
158
158
void writeGotPlt (uint8_t *Buf, const SymbolBody &S) const override ;
159
- void writePltZero (uint8_t *Buf) const override ;
159
+ void writePltHeader (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 ;
162
162
bool usesOnlyLowPageBits (uint32_t Type) const override ;
@@ -182,7 +182,7 @@ class ARMTargetInfo final : public TargetInfo {
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
184
void writeGotPlt (uint8_t *Buf, const SymbolBody &S) const override ;
185
- void writePltZero (uint8_t *Buf) const override ;
185
+ void writePltHeader (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 ;
188
188
void relocateOne (uint8_t *Loc, uint32_t Type, uint64_t Val) const override ;
@@ -195,7 +195,7 @@ template <class ELFT> class MipsTargetInfo final : public TargetInfo {
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
197
void writeGotPlt (uint8_t *Buf, const SymbolBody &S) const override ;
198
- void writePltZero (uint8_t *Buf) const override ;
198
+ void writePltHeader (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 ;
201
201
void writeThunk (uint8_t *Buf, uint64_t S) const override ;
@@ -302,7 +302,7 @@ X86TargetInfo::X86TargetInfo() {
302
302
TlsModuleIndexRel = R_386_TLS_DTPMOD32;
303
303
TlsOffsetRel = R_386_TLS_DTPOFF32;
304
304
PltEntrySize = 16 ;
305
- PltZeroSize = 16 ;
305
+ PltHeaderSize = 16 ;
306
306
TlsGdRelaxSkip = 2 ;
307
307
}
308
308
@@ -376,7 +376,7 @@ bool X86TargetInfo::isTlsInitialExecRel(uint32_t Type) const {
376
376
return Type == R_386_TLS_IE || Type == R_386_TLS_GOTIE;
377
377
}
378
378
379
- void X86TargetInfo::writePltZero (uint8_t *Buf) const {
379
+ void X86TargetInfo::writePltHeader (uint8_t *Buf) const {
380
380
// Executable files and shared object files have
381
381
// separate procedure linkage tables.
382
382
if (Config->Pic ) {
@@ -415,7 +415,7 @@ void X86TargetInfo::writePlt(uint8_t *Buf, uint64_t GotEntryAddr,
415
415
uint32_t Got = Out<ELF32LE>::GotPlt->getVA ();
416
416
write32le (Buf + 2 , Config->Shared ? GotEntryAddr - Got : GotEntryAddr);
417
417
write32le (Buf + 7 , RelOff);
418
- write32le (Buf + 12 , -Index * PltEntrySize - PltZeroSize - 16 );
418
+ write32le (Buf + 12 , -Index * PltEntrySize - PltHeaderSize - 16 );
419
419
}
420
420
421
421
uint64_t X86TargetInfo::getImplicitAddend (const uint8_t *Buf,
@@ -543,7 +543,7 @@ X86_64TargetInfo::X86_64TargetInfo() {
543
543
TlsModuleIndexRel = R_X86_64_DTPMOD64;
544
544
TlsOffsetRel = R_X86_64_DTPOFF64;
545
545
PltEntrySize = 16 ;
546
- PltZeroSize = 16 ;
546
+ PltHeaderSize = 16 ;
547
547
TlsGdRelaxSkip = 2 ;
548
548
}
549
549
@@ -588,7 +588,7 @@ void X86_64TargetInfo::writeGotPlt(uint8_t *Buf, const SymbolBody &S) const {
588
588
write32le (Buf, S.getPltVA <ELF64LE>() + 6 );
589
589
}
590
590
591
- void X86_64TargetInfo::writePltZero (uint8_t *Buf) const {
591
+ void X86_64TargetInfo::writePltHeader (uint8_t *Buf) const {
592
592
const uint8_t PltData[] = {
593
593
0xff , 0x35 , 0x00 , 0x00 , 0x00 , 0x00 , // pushq GOT+8(%rip)
594
594
0xff , 0x25 , 0x00 , 0x00 , 0x00 , 0x00 , // jmp *GOT+16(%rip)
@@ -613,7 +613,7 @@ void X86_64TargetInfo::writePlt(uint8_t *Buf, uint64_t GotEntryAddr,
613
613
614
614
write32le (Buf + 2 , GotEntryAddr - PltEntryAddr - 6 );
615
615
write32le (Buf + 7 , Index);
616
- write32le (Buf + 12 , -Index * PltEntrySize - PltZeroSize - 16 );
616
+ write32le (Buf + 12 , -Index * PltEntrySize - PltHeaderSize - 16 );
617
617
}
618
618
619
619
uint32_t X86_64TargetInfo::getDynRel (uint32_t Type) const {
@@ -1113,7 +1113,7 @@ AArch64TargetInfo::AArch64TargetInfo() {
1113
1113
TlsDescRel = R_AARCH64_TLSDESC;
1114
1114
TlsGotRel = R_AARCH64_TLS_TPREL64;
1115
1115
PltEntrySize = 16 ;
1116
- PltZeroSize = 32 ;
1116
+ PltHeaderSize = 32 ;
1117
1117
1118
1118
// It doesn't seem to be documented anywhere, but tls on aarch64 uses variant
1119
1119
// 1 of the tls structures and the tcb size is 16.
@@ -1211,7 +1211,7 @@ static uint64_t getAArch64Page(uint64_t Expr) {
1211
1211
return Expr & (~static_cast <uint64_t >(0xFFF ));
1212
1212
}
1213
1213
1214
- void AArch64TargetInfo::writePltZero (uint8_t *Buf) const {
1214
+ void AArch64TargetInfo::writePltHeader (uint8_t *Buf) const {
1215
1215
const uint8_t PltData[] = {
1216
1216
0xf0 , 0x7b , 0xbf , 0xa9 , // stp x16, x30, [sp,#-16]!
1217
1217
0x10 , 0x00 , 0x00 , 0x90 , // adrp x16, Page(&(.plt.got[2]))
@@ -1453,7 +1453,7 @@ ARMTargetInfo::ARMTargetInfo() {
1453
1453
TlsModuleIndexRel = R_ARM_TLS_DTPMOD32;
1454
1454
TlsOffsetRel = R_ARM_TLS_DTPOFF32;
1455
1455
PltEntrySize = 16 ;
1456
- PltZeroSize = 20 ;
1456
+ PltHeaderSize = 20 ;
1457
1457
}
1458
1458
1459
1459
RelExpr ARMTargetInfo::getRelExpr (uint32_t Type, const SymbolBody &S) const {
@@ -1502,7 +1502,7 @@ void ARMTargetInfo::writeGotPlt(uint8_t *Buf, const SymbolBody &) const {
1502
1502
write32le (Buf, Out<ELF32LE>::Plt->getVA ());
1503
1503
}
1504
1504
1505
- void ARMTargetInfo::writePltZero (uint8_t *Buf) const {
1505
+ void ARMTargetInfo::writePltHeader (uint8_t *Buf) const {
1506
1506
const uint8_t PltData[] = {
1507
1507
0x04 , 0xe0 , 0x2d , 0xe5 , // str lr, [sp,#-4]!
1508
1508
0x04 , 0xe0 , 0x9f , 0xe5 , // ldr lr, L2
@@ -1720,7 +1720,7 @@ template <class ELFT> MipsTargetInfo<ELFT>::MipsTargetInfo() {
1720
1720
GotPltHeaderEntriesNum = 2 ;
1721
1721
PageSize = 65536 ;
1722
1722
PltEntrySize = 16 ;
1723
- PltZeroSize = 32 ;
1723
+ PltHeaderSize = 32 ;
1724
1724
ThunkSize = 16 ;
1725
1725
CopyRel = R_MIPS_COPY;
1726
1726
PltRel = R_MIPS_JUMP_SLOT;
@@ -1828,7 +1828,7 @@ template <endianness E> static int16_t readSignedLo16(const uint8_t *Loc) {
1828
1828
}
1829
1829
1830
1830
template <class ELFT >
1831
- void MipsTargetInfo<ELFT>::writePltZero (uint8_t *Buf) const {
1831
+ void MipsTargetInfo<ELFT>::writePltHeader (uint8_t *Buf) const {
1832
1832
const endianness E = ELFT::TargetEndianness;
1833
1833
write32<E>(Buf, 0x3c1c0000 ); // lui $28, %hi(&GOTPLT[0])
1834
1834
write32<E>(Buf + 4 , 0x8f990000 ); // lw $25, %lo(&GOTPLT[0])($28)
0 commit comments