From 4db7b2663090f11386e806c421560a4d0923a7fb Mon Sep 17 00:00:00 2001 From: John Marino Date: Tue, 14 Aug 2012 16:38:31 +0200 Subject: [PATCH] rtld: Parse notes later (bug# 2376) Parse notes only after object structure has been allocated. Taken-from: FreeBSD svn 239019 DragonFly-bug: --- libexec/rtld-elf/map_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index 215ae0c58f..14cedfc809 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -153,7 +153,6 @@ map_object(int fd, const char *path, const struct stat *sb) break; note_start = (Elf_Addr)(char *)hdr + phdr->p_offset; note_end = note_start + phdr->p_filesz; - digest_notes(obj, note_start, note_end); break; } @@ -299,6 +298,8 @@ map_object(int fd, const char *path, const struct stat *sb) obj->relro_page = obj->relocbase + trunc_page(relro_page); obj->relro_size = round_page(relro_size); } + if (note_start < note_end) + digest_notes(obj, note_start, note_end); return obj; } -- 2.41.0