File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -4419,6 +4419,7 @@ void RewriteInstance::patchELFSectionHeaderTable(ELFObjectFile<ELFT> *File) {
4419
4419
raw_fd_ostream &OS = Out->os ();
4420
4420
const ELFFile<ELFT> &Obj = File->getELFFile ();
4421
4421
4422
+ // Mapping from old section indices to new ones
4422
4423
std::vector<uint32_t > NewSectionIndex;
4423
4424
std::vector<ELFShdrTy> OutputSections =
4424
4425
getOutputSections (File, NewSectionIndex);
@@ -4436,10 +4437,8 @@ void RewriteInstance::patchELFSectionHeaderTable(ELFObjectFile<ELFT> *File) {
4436
4437
// Write all section header entries while patching section references.
4437
4438
for (ELFShdrTy &Section : OutputSections) {
4438
4439
Section.sh_link = NewSectionIndex[Section.sh_link ];
4439
- if (Section.sh_type == ELF::SHT_REL || Section.sh_type == ELF::SHT_RELA) {
4440
- if (Section.sh_info )
4441
- Section.sh_info = NewSectionIndex[Section.sh_info ];
4442
- }
4440
+ if (Section.sh_type == ELF::SHT_REL || Section.sh_type == ELF::SHT_RELA)
4441
+ Section.sh_info = NewSectionIndex[Section.sh_info ];
4443
4442
OS.write (reinterpret_cast <const char *>(&Section), sizeof (Section));
4444
4443
}
4445
4444
You can’t perform that action at this time.
0 commit comments