mirror of
https://github.com/yuzu-emu/breakpad
synced 2024-11-25 13:58:53 +00:00
linux_dumper: Always map ELF file from offset 0
Functions such as FindElfSection and FindElfSegments that inspect the ELF header expect a pointer to the first byte of the file. IsValidElf() checks for the ELF magic number at offset 0. Thus, we must map ELF object files from offset 0. Change-Id: Icebfb46229a04019f57a7ec07844257b98ceb278 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4674337 Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
0d0354463e
commit
d10ef76a38
1 changed files with 2 additions and 2 deletions
|
@ -346,7 +346,7 @@ LinuxDumper::ElfFileIdentifierForMapping(const MappingInfo& mapping,
|
||||||
return false;
|
return false;
|
||||||
bool filename_modified = HandleDeletedFileInMapping(filename);
|
bool filename_modified = HandleDeletedFileInMapping(filename);
|
||||||
|
|
||||||
MemoryMappedFile mapped_file(filename, mapping.offset);
|
MemoryMappedFile mapped_file(filename, 0);
|
||||||
if (!mapped_file.data() || mapped_file.size() < SELFMAG)
|
if (!mapped_file.data() || mapped_file.size() < SELFMAG)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -459,7 +459,7 @@ bool ElfFileSoName(const LinuxDumper& dumper,
|
||||||
if (!dumper.GetMappingAbsolutePath(mapping, filename))
|
if (!dumper.GetMappingAbsolutePath(mapping, filename))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MemoryMappedFile mapped_file(filename, mapping.offset);
|
MemoryMappedFile mapped_file(filename, 0);
|
||||||
if (!mapped_file.data() || mapped_file.size() < SELFMAG) {
|
if (!mapped_file.data() || mapped_file.size() < SELFMAG) {
|
||||||
// mmap failed
|
// mmap failed
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue