RISC-V: Support ELF attribute for gas and readelf.
[deliverable/binutils-gdb.git] / bfd / elfnn-riscv.c
index 78ab0519e8859df013ba65dac7bcec76c8d3b1b6..5430f61a7b87844f761db7c353d134d24777dbb2 100644 (file)
@@ -3654,6 +3654,14 @@ riscv_elf_object_p (bfd *abfd)
   return TRUE;
 }
 
+/* Determine whether an object attribute tag takes an integer, a
+   string or both.  */
+
+static int
+riscv_elf_obj_attrs_arg_type (int tag)
+{
+  return (tag & 1) != 0 ? ATTR_TYPE_FLAG_STR_VAL : ATTR_TYPE_FLAG_INT_VAL;
+}
 
 #define TARGET_LITTLE_SYM              riscv_elfNN_vec
 #define TARGET_LITTLE_NAME             "elfNN-littleriscv"
@@ -3696,4 +3704,13 @@ riscv_elf_object_p (bfd *abfd)
 #define elf_backend_rela_normal                1
 #define elf_backend_default_execstack  0
 
+#undef  elf_backend_obj_attrs_vendor
+#define elf_backend_obj_attrs_vendor            "riscv"
+#undef  elf_backend_obj_attrs_arg_type
+#define elf_backend_obj_attrs_arg_type          riscv_elf_obj_attrs_arg_type
+#undef  elf_backend_obj_attrs_section_type
+#define elf_backend_obj_attrs_section_type      SHT_RISCV_ATTRIBUTES
+#undef  elf_backend_obj_attrs_section
+#define elf_backend_obj_attrs_section           ".riscv.attributes"
+
 #include "elfNN-target.h"
This page took 0.025329 seconds and 4 git commands to generate.