bionic: loader: Don't bail out if reading pad_segment note fails

The PAD_SEGMENT note is used to optimize memory usage of the loader.

If the note parsing fails, skip the optimization and continue
loading the ELF normally.

Bug: 324309329
Bug: 316403210
Change-Id: I2aabc9f399816c53eb33ff303208a16022571edf
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
This commit is contained in:
Kalesh Singh 2024-02-08 00:03:06 -08:00
parent 07694f8f47
commit fb5440baee

View file

@ -721,8 +721,9 @@ bool ElfReader::ReadPadSegmentNote() {
// at most 1 PT_NOTE mapped at anytime during this search.
MappedFileFragment note_fragment;
if (!note_fragment.Map(fd_, file_offset_, phdr->p_offset, phdr->p_memsz)) {
DL_ERR("\"%s\" note mmap failed: %s", name_.c_str(), strerror(errno));
return false;
DL_WARN("\"%s\" note mmap failed: %s", name_.c_str(), strerror(errno));
// If mmap failed, skip the optimization but don't block ELF loading
return true;
}
const ElfW(Nhdr)* note_hdr = nullptr;