+gcore_create_memtag_section_callback (CORE_ADDR vaddr, unsigned long size,
+ int read, int write, int exec,
+ int modified, bool memory_tagged,
+ void *data)
+{
+ /* Are there memory tags in this particular memory map entry? */
+ if (!memory_tagged)
+ return 0;
+
+ bfd *obfd = (bfd *) data;
+
+ /* Ask the architecture to create a memory tag section for this particular
+ memory map entry. It will be populated with contents later, as we can't
+ start writing the contents before we have all the sections sorted out. */
+ asection *memtag_section
+ = gdbarch_create_memtag_section (target_gdbarch (), obfd, vaddr, size);
+
+ if (memtag_section == nullptr)
+ {
+ warning (_("Couldn't make gcore memory tag segment: %s"),
+ bfd_errmsg (bfd_get_error ()));
+ return 1;
+ }
+
+ if (info_verbose)
+ {
+ gdb_printf (gdb_stdout, "Saved memory tag segment, %s bytes "
+ "at %s\n",
+ plongest (bfd_section_size (memtag_section)),
+ paddress (target_gdbarch (), vaddr));
+ }
+
+ return 0;
+}
+
+int
+objfile_find_memory_regions (struct target_ops *self,
+ find_memory_region_ftype func, void *obfd)