+2001-08-07 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * coff-sh.c (sh_coff_reloc_type_lookup): Provide for sh-coff
+ targets as well as sh-pe.
+
2001-08-03 Ben Harris <bjh21@netbsd.org>
* elf32-arm.h (elf32_arm_final_link_relocate): Include offset of
#include "bfd.h"
#include "sysdep.h"
+#include "libiberty.h"
#include "libbfd.h"
#include "bfdlink.h"
#include "coff/sh.h"
return howto;
}
+#endif /* COFF_WITH_PE */
+
/* This structure is used to map BFD reloc codes to SH PE relocs. */
struct shcoff_reloc_map
{
{
unsigned int i;
- for (i = 0; i < sizeof (sh_reloc_map) / sizeof (struct shcoff_reloc_map); i++)
- {
- if (sh_reloc_map[i].bfd_reloc_val == code)
- return &sh_coff_howtos[(int) sh_reloc_map[i].shcoff_reloc_val];
- }
+ for (i = ARRAY_SIZE (sh_reloc_map); i--;)
+ if (sh_reloc_map[i].bfd_reloc_val == code)
+ return &sh_coff_howtos[(int) sh_reloc_map[i].shcoff_reloc_val];
fprintf (stderr, "SH Error: unknown reloc type %d\n", code);
return NULL;
}
-#endif /* COFF_WITH_PE */
/* This macro is used in coffcode.h to get the howto corresponding to
an internal reloc. */