From f920bb66bfd7a6364ff1fa8796a6b3fd5a6606f0 Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Thu, 16 May 2024 09:01:45 +0200 Subject: [PATCH] Tighter bounds for the dumped hot region * src/pdumper.c (pdumper_load): Exclude the header and the discardable part. --- src/pdumper.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pdumper.c b/src/pdumper.c index 2437a70f0a8..00bb7dd8db8 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -5956,8 +5956,11 @@ pdumper_load (const char *dump_filename, char *argv0) dump_public.end = dump_public.start + dump_size; #ifdef HAVE_MPS - void *hot_start = (void *) dump_base; - void *hot_end = (void *) (dump_base + adj_discardable_start); + size_t aligned_header_size + = ((sizeof (struct dump_header) + DUMP_ALIGNMENT - 1) + & ~(DUMP_ALIGNMENT - 1)); + void *hot_start = (void *) (dump_base + aligned_header_size); + void *hot_end = (void *) (dump_base + header->discardable_start); #endif dump_do_all_dump_reloc_for_phase (header, dump_base, EARLY_RELOCS); -- 2.39.2