[AArch64] Support AArch64 MTE memory tag dumps in core files

The Linux kernel can dump memory tag segments to a core file, one segment
per mapped range. The format and documentation can be found in the Linux
kernel tree [1].

The following patch adjusts bfd and binutils so they can handle this new
segment type and display it accordingly. It also adds code required so GDB
can properly read/dump core file data containing memory tags.

Upon reading, each segment that contains memory tags gets mapped to a
section named "memtag". These sections will be used by GDB to lookup the tag
data. There can be multiple such sections with the same name, and they are not
numbered to simplify GDB's handling and lookup.

There is another patch for GDB that enables both reading
and dumping of memory tag segments.

Tested on aarch64-linux Ubuntu 20.04.

[1] Documentation/arm64/memory-tagging-extension.rst (Core Dump Support)
This commit is contained in:
Luis Machado
2022-06-28 12:57:34 +01:00
parent 3c539d41b4
commit d0ff5ca959
3 changed files with 93 additions and 0 deletions

View File

@ -27,6 +27,9 @@
/* Processor specific program header types. */
#define PT_AARCH64_ARCHEXT (PT_LOPROC + 0)
/* MTE memory tag segment type. */
#define PT_AARCH64_MEMTAG_MTE (PT_LOPROC + 0x2)
/* Additional section types. */
#define SHT_AARCH64_ATTRIBUTES 0x70000003 /* Section holds attributes. */