diff options
Diffstat (limited to 'bfd/elfnn-aarch64.c')
-rw-r--r-- | bfd/elfnn-aarch64.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 548da1f..cec579c 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -2268,6 +2268,9 @@ elfNN_aarch64_howto_from_bfd_reloc (bfd_reloc_code_real_type code) if (code == BFD_RELOC_AARCH64_NONE) return &elfNN_aarch64_howto_none; + if (code == BFD_RELOC_AARCH64_BRANCH9) + return &elfNN_aarch64_howto_none; + return NULL; } @@ -2619,6 +2622,9 @@ struct elf_aarch64_link_hash_table /* Don't apply link-time values for dynamic relocations. */ int no_apply_dynamic_relocs; + /* Memtag Extension mode of operation. */ + aarch64_memtag_opts memtag_opts; + /* The number of bytes in the initial entry in the PLT. */ bfd_size_type plt_header_size; @@ -5006,13 +5012,15 @@ bfd_elfNN_aarch64_set_options (struct bfd *output_bfd, int fix_erratum_835769, erratum_84319_opts fix_erratum_843419, int no_apply_dynamic_relocs, - const aarch64_protection_opts *sw_protections) + const aarch64_protection_opts *sw_protections, + const aarch64_memtag_opts *memtag_opts) { struct elf_aarch64_link_hash_table *globals; globals = elf_aarch64_hash_table (link_info); globals->pic_veneer = pic_veneer; globals->fix_erratum_835769 = fix_erratum_835769; + globals->memtag_opts = *memtag_opts; /* If the default options are used, then ERRAT_ADR will be set by default which will enable the ADRP->ADR workaround for the erratum 843419 workaround. */ @@ -7051,7 +7059,8 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, if (sec != NULL && discarded_section (sec)) RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section, - rel, 1, relend, howto, 0, contents); + rel, 1, relend, R_AARCH64_NONE, + howto, 0, contents); if (bfd_link_relocatable (info)) continue; @@ -8456,10 +8465,9 @@ elfNN_aarch64_modify_headers (bfd *abfd, struct bfd_link_info *info) { struct elf_segment_map *m; - unsigned int segment_count = 0; Elf_Internal_Phdr *p; - for (m = elf_seg_map (abfd); m != NULL; m = m->next, segment_count++) + for (m = elf_seg_map (abfd); m != NULL; m = m->next) { /* We are only interested in the memory tag segment that will be dumped to a core file. If we have no memory tags or this isn't a core file we @@ -9772,7 +9780,20 @@ elfNN_aarch64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, && !add_dynamic_entry (DT_AARCH64_PAC_PLT, 0)) return false; } + + if (is_aarch64_elf (output_bfd) + && htab->memtag_opts.memtag_mode != AARCH64_MEMTAG_MODE_NONE + && !add_dynamic_entry (DT_AARCH64_MEMTAG_MODE, + htab->memtag_opts.memtag_mode == AARCH64_MEMTAG_MODE_ASYNC)) + return false; + + if (is_aarch64_elf (output_bfd) + && htab->memtag_opts.memtag_stack == 1 + && !add_dynamic_entry (DT_AARCH64_MEMTAG_STACK, + htab->memtag_opts.memtag_stack == 1)) + return false; } + #undef add_dynamic_entry return true; |