Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hyj1991 authored Oct 20, 2022
2 parents 6384f4a + c574ca2 commit ee35185
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/platform/unix/core/linux/elfcore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,14 @@ static int CreateElfCore(void* handle,
mappings[i].end_address - mappings[i].start_address;
}

/* We could save the first page of ELF to record the BuildId,
* let the debugger later find the corresponding binary it used.
*/
if (!dontdump && mappings[i].write_size == 0 &&
(mappings[i].flags & PF_X) != 0) {
mappings[i].write_size = pagesize;
}

/* Remove mapping, if it was not readable, or completely zero
* anyway. The former is usually the case of stack guard pages, and
* the latter occasionally happens for unused memory.
Expand Down

0 comments on commit ee35185

Please sign in to comment.