@@ -542,8 +542,8 @@ void EhFrameSection::writeTo(uint8_t *Buf) {
542
542
}
543
543
544
544
GotSection::GotSection ()
545
- : SyntheticSection(SHF_ALLOC | SHF_WRITE, SHT_PROGBITS,
546
- Target->GotEntrySize, " .got" ) {
545
+ : SyntheticSection(SHF_ALLOC | SHF_WRITE, SHT_PROGBITS, Config->Wordsize,
546
+ " .got" ) {
547
547
// PPC64 saves the ElfSym::GlobalOffsetTable .TOC. as the first entry in the
548
548
// .got. If there are no references to .TOC. in the symbol table,
549
549
// ElfSym::GlobalOffsetTable will not be defined and we won't need to save
@@ -1030,7 +1030,7 @@ void MipsGotSection::writeTo(uint8_t *Buf) {
1030
1030
GotPltSection::GotPltSection ()
1031
1031
: SyntheticSection(SHF_ALLOC | SHF_WRITE,
1032
1032
Config->EMachine == EM_PPC64 ? SHT_NOBITS : SHT_PROGBITS,
1033
- Target->GotPltEntrySize ,
1033
+ Config->Wordsize ,
1034
1034
Config->EMachine == EM_PPC64 ? " .plt" : " .got.plt" ) {}
1035
1035
1036
1036
void GotPltSection::addEntry (Symbol &Sym) {
@@ -1039,13 +1039,12 @@ void GotPltSection::addEntry(Symbol &Sym) {
1039
1039
}
1040
1040
1041
1041
size_t GotPltSection::getSize () const {
1042
- return (Target->GotPltHeaderEntriesNum + Entries.size ()) *
1043
- Target->GotPltEntrySize ;
1042
+ return (Target->GotPltHeaderEntriesNum + Entries.size ()) * Config->Wordsize ;
1044
1043
}
1045
1044
1046
1045
void GotPltSection::writeTo (uint8_t *Buf) {
1047
1046
Target->writeGotPltHeader (Buf);
1048
- Buf += Target->GotPltHeaderEntriesNum * Target-> GotPltEntrySize ;
1047
+ Buf += Target->GotPltHeaderEntriesNum * Config-> Wordsize ;
1049
1048
for (const Symbol *B : Entries) {
1050
1049
Target->writeGotPlt (Buf, *B);
1051
1050
Buf += Config->Wordsize ;
@@ -1076,15 +1075,15 @@ static StringRef getIgotPltName() {
1076
1075
IgotPltSection::IgotPltSection ()
1077
1076
: SyntheticSection(SHF_ALLOC | SHF_WRITE,
1078
1077
Config->EMachine == EM_PPC64 ? SHT_NOBITS : SHT_PROGBITS,
1079
- Target->GotPltEntrySize , getIgotPltName()) {}
1078
+ Config->Wordsize , getIgotPltName()) {}
1080
1079
1081
1080
void IgotPltSection::addEntry (Symbol &Sym) {
1082
1081
assert (Sym.PltIndex == Entries.size ());
1083
1082
Entries.push_back (&Sym);
1084
1083
}
1085
1084
1086
1085
size_t IgotPltSection::getSize () const {
1087
- return Entries.size () * Target-> GotPltEntrySize ;
1086
+ return Entries.size () * Config-> Wordsize ;
1088
1087
}
1089
1088
1090
1089
void IgotPltSection::writeTo (uint8_t *Buf) {
@@ -3228,7 +3227,6 @@ size_t PPC64LongBranchTargetSection::getSize() const {
3228
3227
}
3229
3228
3230
3229
void PPC64LongBranchTargetSection::writeTo (uint8_t *Buf) {
3231
- assert (Target->GotPltEntrySize == 8 );
3232
3230
// If linking non-pic we have the final addresses of the targets and they get
3233
3231
// written to the table directly. For pic the dynamic linker will allocate
3234
3232
// the section and fill it it.
@@ -3241,7 +3239,7 @@ void PPC64LongBranchTargetSection::writeTo(uint8_t *Buf) {
3241
3239
// must be a local-call.
3242
3240
write64 (Buf,
3243
3241
Sym->getVA () + getPPC64GlobalEntryToLocalEntryOffset (Sym->StOther ));
3244
- Buf += Target-> GotPltEntrySize ;
3242
+ Buf += 8 ;
3245
3243
}
3246
3244
}
3247
3245
0 commit comments