diff options
author | Indu Bhagat <indu.bhagat@oracle.com> | 2025-07-12 11:10:23 +0200 |
---|---|---|
committer | Jose E. Marchesi <jose.marchesi@oracle.com> | 2025-07-12 11:33:25 +0200 |
commit | 97d71f2366fdbe506bcfad0c0abd3914ba334ada (patch) | |
tree | 5a42070b9d41b28465e3789ce8b567c53057d3a1 /libctf/ctf-open.c | |
parent | 427363b461dc40e4e03bef27d2d52623b800f312 (diff) | |
download | binutils-97d71f2366fdbe506bcfad0c0abd3914ba334ada.zip binutils-97d71f2366fdbe506bcfad0c0abd3914ba334ada.tar.gz binutils-97d71f2366fdbe506bcfad0c0abd3914ba334ada.tar.bz2 |
ld/aarch64elf: add support for DT_AARCH64_MEMTAG_MODE dynamic tag
Add new command line option -z memtag-mode=<mode> to aarch64 elf,
where <mode> can be one of none, sync, or async. For mode of sync or
async, a DT_AARCH64_MEMTAG_MODE dynamic tag with a value of 0 or 1
respectively is emitted.
readelf displays the dynamic tag when present:
$ readelf -d <exectutable>
Dynamic section at offset 0xfdd8 contains XX entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000c (INIT) 0x400520
0x000000000000000d (FINI) 0x400b64
0x0000000000000019 (INIT_ARRAY) 0x41fdc8
... ... ...
0x0000000070000009 (AARCH64_MEMTAG_MODE) 0x1
... ... ...
Note that this patch doesn't add support for the "asymm" MTE mode,
which is an Armv8.7 extension.
ChangeLog:
* bfd/elfnn-aarch64.c (struct elf_aarch64_link_hash_table): Add
new member for memtag properties.
(bfd_elfNN_aarch64_set_options): New argument to pass memtag
properties.
(elfNN_aarch64_late_size_sections): Emit DT_AARCH64_MEMTAG_MODE
dynamic tag.
* bfd/elfxx-aarch64.h: New definition for the various memtag
properties.
* binutils/readelf.c (get_aarch64_dynamic_type): Handle
DT_AARCH64_MEMTAG_MODE.
* ld/emultempl/aarch64elf.em: Likewise.
* ld/ld.texi: Add documentation for the new option
-z memtag-mode.
* ld/testsuite/ld-aarch64/aarch64-elf.exp: New test.
* ld/testsuite/ld-aarch64/dt-memtag.d: New test.
* ld/testsuite/ld-aarch64/dt-memtag-mode.s: New test.
include/ChangeLog:
* elf/aarch64.h (DT_AARCH64_MEMTAG_MODE): New definition.
Diffstat (limited to 'libctf/ctf-open.c')
0 files changed, 0 insertions, 0 deletions