summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:17:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:17:15 +0000
commitac8d05af898765571f7f7db4b8bfc8b73907652d (patch)
tree0a1a0e03b3c49df9b7713587b9d423dc5d8a2709 /build
parentReleasing progress-linux version 127.0.1-1~progress7.99u1. (diff)
downloadfirefox-ac8d05af898765571f7f7db4b8bfc8b73907652d.tar.xz
firefox-ac8d05af898765571f7f7db4b8bfc8b73907652d.zip
Merging upstream version 127.0.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'build')
-rw-r--r--build/unix/elfhack/elfhack.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/build/unix/elfhack/elfhack.cpp b/build/unix/elfhack/elfhack.cpp
index 719d4ac8f5..baedadedf0 100644
--- a/build/unix/elfhack/elfhack.cpp
+++ b/build/unix/elfhack/elfhack.cpp
@@ -1116,7 +1116,7 @@ int do_relocation_section(Elf* elf, unsigned int rel_type,
// can actually use it)
if (elf->getSegmentByType(PT_GNU_RELRO)) {
ElfSection* gnu_versym = dyn->getSectionForType(DT_VERSYM);
- auto lookup = [&symtab, &gnu_versym](const char* symbol) {
+ auto ensure_symbol = [&symtab, &gnu_versym](const char* symbol) {
Elf_SymValue* sym_value = symtab->lookup(symbol, STT(FUNC));
if (!sym_value) {
symtab->syms.emplace_back();
@@ -1138,11 +1138,13 @@ int do_relocation_section(Elf* elf, unsigned int rel_type,
gnu_versym->grow(gnu_versym->getSize() + gnu_versym->getEntSize());
}
}
- return sym_value;
};
-
- Elf_SymValue* mprotect = lookup("mprotect");
- Elf_SymValue* sysconf = lookup("sysconf");
+ // ensure_symbol may trigger a symbol table vector resize, so only lookup
+ // the symbols after we're done touching the symbol table.
+ ensure_symbol("mprotect");
+ ensure_symbol("sysconf");
+ Elf_SymValue* mprotect = symtab->lookup("mprotect", STT(FUNC));
+ Elf_SymValue* sysconf = symtab->lookup("sysconf", STT(FUNC));
// Add relocations for the mprotect and sysconf symbols.
auto add_relocation_to = [&new_rels, &symtab, rel_type2](