forked from OSchip/llvm-project
ELF2: Remove setNameOffset and combine that with writeHeader. NFC.
llvm-svn: 251193
This commit is contained in:
parent
9fbb3d8850
commit
157c433a83
|
@ -224,6 +224,7 @@ InterpSection<ELFT>::InterpSection()
|
|||
|
||||
template <class ELFT>
|
||||
void OutputSectionBase<ELFT>::writeHeaderTo(Elf_Shdr *SHdr) {
|
||||
Header.sh_name = Out<ELFT>::ShStrTab->getOffset(Name);
|
||||
*SHdr = Header;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,6 @@ public:
|
|||
void setFileOffset(uintX_t Off) { Header.sh_offset = Off; }
|
||||
void writeHeaderTo(Elf_Shdr *SHdr);
|
||||
StringRef getName() { return Name; }
|
||||
void setNameOffset(uintX_t Offset) { Header.sh_name = Offset; }
|
||||
|
||||
unsigned SectionIndex;
|
||||
|
||||
|
|
|
@ -740,10 +740,8 @@ template <class ELFT> void Writer<ELFT>::writeHeader() {
|
|||
auto SHdrs = reinterpret_cast<Elf_Shdr *>(Buf + EHdr->e_shoff);
|
||||
// First entry is null.
|
||||
++SHdrs;
|
||||
for (OutputSectionBase<ELFT> *Sec : OutputSections) {
|
||||
Sec->setNameOffset(Out<ELFT>::ShStrTab->getOffset(Sec->getName()));
|
||||
for (OutputSectionBase<ELFT> *Sec : OutputSections)
|
||||
Sec->writeHeaderTo(SHdrs++);
|
||||
}
|
||||
}
|
||||
|
||||
template <class ELFT> void Writer<ELFT>::openFile(StringRef Path) {
|
||||
|
|
Loading…
Reference in New Issue