Bug #393062 - Reading build-id ELF note through phdrs triggers
"debuginfo reader: ensure_valid failed"
Skip the phdrs when we have to search the shdrs. In separate
.debug files the phdrs might not be valid (they are a copy of
the main ELF file) and might trigger assertions when getting
image notes based on them.
393017 Add missing support for xsmaxcdp instruction, bug fixes for xsmincdp,
lxssp, stxssp and stxvl instructions.
393023 callgrind_control risks using the wrong vgdb
+393062 build-id ELF phdrs read causes "debuginfo reader: ensure_valid failed"
393099 posix_memalign() invalid write if alignment == 0
n-i-bz Fix missing workq_ops operations (macOS)
ElfXX_Ehdr ehdr;
ML_(img_get)(&ehdr, img, 0, sizeof(ehdr));
- for (i = 0; i < ehdr.e_phnum; i++) {
+ /* Skip the phdrs when we have to search the shdrs. In separate
+ .debug files the phdrs might not be valid (they are a copy of
+ the main ELF file) and might trigger assertions when getting
+ image notes based on them. */
+ for (i = 0; !search_shdrs && i < ehdr.e_phnum; i++) {
ElfXX_Phdr phdr;
ML_(img_get)(&phdr, img,
ehdr.e_phoff + i * ehdr.e_phentsize, sizeof(phdr));