зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1606739 - Initialize the .dynamic section first. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D59078 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
e4b8074522
Коммит
a95697631f
|
@ -179,6 +179,14 @@ Elf::Elf(std::ifstream& file) {
|
|||
// Fill sections list
|
||||
sections = new ElfSection*[ehdr->e_shnum];
|
||||
for (int i = 0; i < ehdr->e_shnum; i++) sections[i] = nullptr;
|
||||
for (int i = 1; i < ehdr->e_shnum; i++) {
|
||||
// The .dynamic section is going to have references to other sections,
|
||||
// so it's better to start with that one and recursively initialize those
|
||||
// other sections first, to avoid possible infinite recursion (bug 1606739).
|
||||
if (tmp_shdr[i]->sh_type == SHT_DYNAMIC) {
|
||||
getSection(i);
|
||||
}
|
||||
}
|
||||
for (int i = 1; i < ehdr->e_shnum; i++) {
|
||||
if (sections[i] != nullptr) continue;
|
||||
getSection(i);
|
||||
|
|
Загрузка…
Ссылка в новой задаче