diff options
author | Luis Machado <luis.machado@linaro.org> | 2021-05-21 10:40:32 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2021-05-21 10:40:32 +0100 |
commit | 894982bfccec66a1496785bbef4d46423345b8c8 (patch) | |
tree | b1cc82e6ce9f4bab68f9aa2e30146ca5b73ab124 /bfd | |
parent | 75b969ccb1b05c3fbcecb0b6bb392d7448ce7286 (diff) | |
download | fsf-binutils-gdb-894982bfccec66a1496785bbef4d46423345b8c8.zip fsf-binutils-gdb-894982bfccec66a1496785bbef4d46423345b8c8.tar.gz fsf-binutils-gdb-894982bfccec66a1496785bbef4d46423345b8c8.tar.bz2 |
[AArch64] MTE corefile support
bfd * elf.c (elfcore_make_memtag_note_section): New function.
(elfcore_grok_note): Handle NT_MEMTAG note types.
binutils* readelf.c (get_note_type): Handle NT_MEMTAG note types.
include * elf/common.h (NT_MEMTAG): New constant.
(NT_MEMTAG_TYPE_AARCH_MTE): New constant.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf.c | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2ad7803..b614bd4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2021-05-21 Luis Machado <luis.machado@linaro.org> + + * elf.c (elfcore_make_memtag_note_section): New function. + (elfcore_grok_note): Handle NT_MEMTAG note types. + 2021-05-20 Andrew Burgess <andrew.burgess@embecosm.com> * section.c (bfd_get_section_by_name): Return NULL if name is @@ -9597,6 +9597,23 @@ elfcore_make_auxv_note_section (bfd *abfd, Elf_Internal_Note *note, return true; } +static bool +elfcore_make_memtag_note_section (bfd *abfd, Elf_Internal_Note *note, + size_t offs) +{ + asection *sect = bfd_make_section_anyway_with_flags (abfd, ".memtag", + SEC_HAS_CONTENTS); + + if (sect == NULL) + return false; + + sect->size = note->descsz - offs; + sect->filepos = note->descpos + offs; + sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32; + + return true; +} + /* prstatus_t exists on: solaris 2.5+ linux 2.[01] + glibc @@ -10657,6 +10674,8 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note) return elfcore_make_note_pseudosection (abfd, ".note.linuxcore.siginfo", note); + case NT_MEMTAG: + return elfcore_make_memtag_note_section (abfd, note, 0); } } |