+ error (_("Missing knowledge of 32-bit reloc types used in DWARF sections of machine number %d\n"),
+ elf_header.e_machine);
+ abort ();
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 32-bit pc-relative RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_32bit_pcrel_reloc (unsigned int reloc_type)
+{
+ switch (elf_header.e_machine)
+ {
+ case EM_68K:
+ return reloc_type == 4; /* R_68K_PC32. */
+ case EM_ALPHA:
+ return reloc_type == 10; /* R_ALPHA_SREL32. */
+ case EM_PARISC:
+ return reloc_type == 0; /* R_PARISC_NONE. *//* FIXME: This reloc is generated, but it may be a bug. */
+ case EM_PPC:
+ return reloc_type == 26; /* R_PPC_REL32. */
+ case EM_PPC64:
+ return reloc_type == 26; /* R_PPC64_REL32. */
+ case EM_S390_OLD:
+ case EM_S390:
+ return reloc_type == 5; /* R_390_PC32. */
+ case EM_SH:
+ return reloc_type == 2; /* R_SH_REL32. */
+ case EM_SPARC32PLUS:
+ case EM_SPARCV9:
+ case EM_SPARC:
+ return reloc_type == 6; /* R_SPARC_DISP32. */
+ case EM_X86_64:
+ return reloc_type == 2; /* R_X86_64_PC32. */
+ default:
+ /* Do not abort or issue an error message here. Not all targets use
+ pc-relative 32-bit relocs in their DWARF debug information and we
+ have already tested for target coverage in is_32bit_abs_reloc. A
+ more helpful warning message will be generated by debug_apply_rela_addends
+ anyway, so just return. */
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 64-bit absolute RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_64bit_abs_reloc (unsigned int reloc_type)
+{
+ switch (elf_header.e_machine)
+ {
+ case EM_ALPHA:
+ return reloc_type == 2; /* R_ALPHA_REFQUAD. */
+ case EM_PPC64:
+ return reloc_type == 38; /* R_PPC64_ADDR64. */
+ case EM_SPARC32PLUS:
+ case EM_SPARCV9:
+ case EM_SPARC:
+ return reloc_type == 54; /* R_SPARC_UA64. */
+ case EM_X86_64:
+ return reloc_type == 1; /* R_X86_64_64. */
+ default:
+ return FALSE;
+ }
+}
+
+/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
+ a 16-bit absolute RELA relocation used in DWARF debug sections. */
+
+static bfd_boolean
+is_16bit_abs_reloc (unsigned int reloc_type)
+{
+ switch (elf_header.e_machine)
+ {
+ case EM_AVR_OLD:
+ case EM_AVR:
+ return reloc_type == 4; /* R_AVR_16. */
+ case EM_H8S:
+ case EM_H8_300:
+ case EM_H8_300H:
+ return reloc_type == R_H8_DIR16;
+ case EM_IP2K_OLD:
+ case EM_IP2K:
+ return reloc_type == 1; /* R_IP2K_16. */
+ case EM_MSP430_OLD:
+ case EM_MSP430:
+ return reloc_type == 5; /* R_MSP430_16_BYTE. */
+ default:
+ return FALSE;