- Timestamp:
- Oct 27, 2021 8:00:05 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h
r89969 r92113 2386 2386 Elf_Xword cbMem = pPhdr->p_memsz; 2387 2387 Elf_Xword cbFile = pPhdr->p_filesz; 2388 2389 /* HACK to allow loading isolinux-debug.elf where program headers aren't 2390 sorted by virtual address. */ 2391 if ( (fFlags & RTLDR_O_FOR_DEBUG) 2392 && uAddr != paShdrs[iLoadShdr].sh_addr) 2393 { 2394 for (unsigned iShdr = 1; iShdr < pModElf->Ehdr.e_shnum; iShdr++) 2395 if (uAddr == paShdrs[iShdr].sh_addr) 2396 { 2397 iLoadShdr = iShdr; 2398 break; 2399 } 2400 } 2401 2388 2402 while (cbMem > 0) 2389 2403 { … … 2473 2487 ? off == paShdrs[iLoadShdr].sh_offset 2474 2488 && cbFile >= paShdrs[iLoadShdr].sh_size /* this might be too strict... */ 2475 : cbFile == 0) ) 2489 : cbFile == 0 2490 || cbMem > paShdrs[iLoadShdr].sh_size /* isolinux.elf: linker merge no-bits and progbits sections */) ) 2476 2491 { 2477 if (paShdrs[iLoadShdr].sh_type != SHT_NOBITS) 2492 if ( paShdrs[iLoadShdr].sh_type != SHT_NOBITS 2493 || cbFile != 0) 2478 2494 { 2479 2495 off += paShdrs[iLoadShdr].sh_size; … … 2757 2773 break; 2758 2774 default: 2759 if ( paDynamic[i].d_un.d_val < DT_ENCODING 2760 || (paDynamic[i].d_un.d_val & 1)) 2775 if ( paDynamic[i].d_tag < DT_ENCODING 2776 || paDynamic[i].d_tag >= DT_LOOS 2777 || (paDynamic[i].d_tag & 1)) 2761 2778 Log3(("RTLdrELF: DT[%u]: %#010RX64 %#RX64%s\n", i, (uint64_t)paDynamic[i].d_tag, 2762 2779 (uint64_t)paDynamic[i].d_un.d_val, paDynamic[i].d_un.d_val >= DT_ENCODING ? " (val)" : ""));
Note:
See TracChangeset
for help on using the changeset viewer.