+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 8-bit absolute RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_8bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
+{
+ switch (filedata->file_header.e_machine)
+ {
+ case EM_RISCV:
+ return reloc_type == 54; /* R_RISCV_SET8. */
+ default:
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 6-bit absolute RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_6bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
+{
+ switch (filedata->file_header.e_machine)
+ {
+ case EM_RISCV:
+ return reloc_type == 53; /* R_RISCV_SET6. */
+ default:
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 32-bit inplace add RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_32bit_inplace_add_reloc (Filedata * filedata, unsigned int reloc_type)
+{
+ /* Please keep this table alpha-sorted for ease of visual lookup. */
+ switch (filedata->file_header.e_machine)
+ {
+ case EM_RISCV:
+ return reloc_type == 35; /* R_RISCV_ADD32. */
+ default:
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 32-bit inplace sub RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_32bit_inplace_sub_reloc (Filedata * filedata, unsigned int reloc_type)
+{
+ /* Please keep this table alpha-sorted for ease of visual lookup. */
+ switch (filedata->file_header.e_machine)
+ {
+ case EM_RISCV:
+ return reloc_type == 39; /* R_RISCV_SUB32. */
+ default:
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 64-bit inplace add RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_64bit_inplace_add_reloc (Filedata * filedata, unsigned int reloc_type)
+{
+ /* Please keep this table alpha-sorted for ease of visual lookup. */
+ switch (filedata->file_header.e_machine)
+ {
+ case EM_RISCV:
+ return reloc_type == 36; /* R_RISCV_ADD64. */
+ default:
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 64-bit inplace sub RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_64bit_inplace_sub_reloc (Filedata * filedata, unsigned int reloc_type)
+{
+ /* Please keep this table alpha-sorted for ease of visual lookup. */
+ switch (filedata->file_header.e_machine)
+ {
+ case EM_RISCV:
+ return reloc_type == 40; /* R_RISCV_SUB64. */
+ default:
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 16-bit inplace add RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_16bit_inplace_add_reloc (Filedata * filedata, unsigned int reloc_type)
+{
+ /* Please keep this table alpha-sorted for ease of visual lookup. */
+ switch (filedata->file_header.e_machine)
+ {
+ case EM_RISCV:
+ return reloc_type == 34; /* R_RISCV_ADD16. */
+ default:
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 16-bit inplace sub RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_16bit_inplace_sub_reloc (Filedata * filedata, unsigned int reloc_type)
+{
+ /* Please keep this table alpha-sorted for ease of visual lookup. */
+ switch (filedata->file_header.e_machine)
+ {
+ case EM_RISCV:
+ return reloc_type == 38; /* R_RISCV_SUB16. */
+ default:
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 8-bit inplace add RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_8bit_inplace_add_reloc (Filedata * filedata, unsigned int reloc_type)
+{
+ /* Please keep this table alpha-sorted for ease of visual lookup. */
+ switch (filedata->file_header.e_machine)
+ {
+ case EM_RISCV:
+ return reloc_type == 33; /* R_RISCV_ADD8. */
+ default:
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 8-bit inplace sub RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_8bit_inplace_sub_reloc (Filedata * filedata, unsigned int reloc_type)
+{
+ /* Please keep this table alpha-sorted for ease of visual lookup. */
+ switch (filedata->file_header.e_machine)
+ {
+ case EM_RISCV:
+ return reloc_type == 37; /* R_RISCV_SUB8. */
+ default:
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 6-bit inplace sub RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_6bit_inplace_sub_reloc (Filedata * filedata, unsigned int reloc_type)
+{
+ switch (filedata->file_header.e_machine)
+ {
+ case EM_RISCV:
+ return reloc_type == 52; /* R_RISCV_SUB6. */
+ default:
+ return FALSE;
+ }
+}
+