From 2a2068fd64676de8acda0a6f72b7daf3c0368be5 Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 24 May 2016 00:50:53 +0000 Subject: [PATCH] Read and load the aux vector from a core file --- external/gpl3/gdb/dist/bfd/elf.c | 14 ++++++++++++++ external/gpl3/gdb/dist/include/elf/common.h | 1 + 2 files changed, 15 insertions(+) diff --git a/external/gpl3/gdb/dist/bfd/elf.c b/external/gpl3/gdb/dist/bfd/elf.c index 3b445ee530fb..a23c6d2906b3 100644 --- a/external/gpl3/gdb/dist/bfd/elf.c +++ b/external/gpl3/gdb/dist/bfd/elf.c @@ -9241,6 +9241,20 @@ elfcore_grok_netbsd_note (bfd *abfd, Elf_Internal_Note *note) return elfcore_grok_netbsd_procinfo (abfd, note); } + if (note->type == NT_NETBSDCORE_AUXV) + { + asection *sect = bfd_make_section_anyway_with_flags (abfd, ".auxv", + SEC_HAS_CONTENTS); + + if (sect == NULL) + return FALSE; + sect->size = note->descsz; + sect->filepos = note->descpos; + sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32; + + return TRUE; + } + /* As of Jan 2002 there are no other machine-independent notes defined for NetBSD core files. If the note type is less than the start of the machine-dependent note types, we don't diff --git a/external/gpl3/gdb/dist/include/elf/common.h b/external/gpl3/gdb/dist/include/elf/common.h index e6d8c14d3a2d..8f462b658ae9 100644 --- a/external/gpl3/gdb/dist/include/elf/common.h +++ b/external/gpl3/gdb/dist/include/elf/common.h @@ -598,6 +598,7 @@ must start with "NetBSD-CORE". */ #define NT_NETBSDCORE_PROCINFO 1 /* Has a struct procinfo */ +#define NT_NETBSDCORE_AUXV 2 /* Has a copy of Elfxx_auxv_t */ #define NT_NETBSDCORE_FIRSTMACH 32 /* start of machdep note types */