From 13b58694fbcfb75644dd7e6d48d7c0995d4ab861 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Thu, 6 Mar 1997 19:53:29 +0000 Subject: [PATCH] start-sanitize-tic80 * coff-tic80.c (rtype2howto): If passed a relocation type we don't understand, just set the howto field to NULL, and the caller will print an appropriate error message. end-sanitize-tic80 * coffcode.h (coff_slurp_reloc_table): Pull duplicate declarations and code fragment out of both legs of #ifdef RELOC_PROCESSING ... #endif block. Use NULL for initializations of "ptr" rather than bare 0. * coff-h8300.c: Fix typo in comment. * coff-h8500.c: Ditto. * coff-w65.c: Ditto * coff-z8k.c: Ditto. --- bfd/ChangeLog | 15 +++++++++++++++ bfd/coffcode.h | 29 +++++++++++++++-------------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c45f59a5ded..a87bac12527 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,18 @@ +Thu Mar 6 12:19:59 1997 Fred Fish + +start-sanitize-tic80 + * coff-tic80.c (rtype2howto): If passed a relocation type we don't + understand, just set the howto field to NULL, and the caller will + print an appropriate error message. +end-sanitize-tic80 + * coffcode.h (coff_slurp_reloc_table): Pull duplicate declarations and + code fragment out of both legs of #ifdef RELOC_PROCESSING ... #endif + block. Use NULL for initializations of "ptr" rather than bare 0. + * coff-h8300.c: Fix typo in comment. + * coff-h8500.c: Ditto. + * coff-w65.c: Ditto + * coff-z8k.c: Ditto. + start-sanitize-m32r Wed Mar 5 13:59:09 1997 Doug Evans diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 5d8b7545536..e2a7dde90e4 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1906,6 +1906,13 @@ coff_set_flags (abfd, magicp, flagsp) } break; #endif +/* start-sanitize-tic80 */ +#ifdef TIC80_ARCH_MAGIC + case bfd_arch_tic80: + *magicp = TIC80_ARCH_MAGIC; + return true; +#endif +/* end-sanitize-tic80 */ #ifdef ARMMAGIC case bfd_arch_arm: *magicp = ARMMAGIC; @@ -3620,26 +3627,20 @@ coff_slurp_reloc_table (abfd, asect, symbols) for (idx = 0; idx < asect->reloc_count; idx++) { -#ifdef RELOC_PROCESSING struct internal_reloc dst; struct external_reloc *src; - - cache_ptr = reloc_cache + idx; - src = native_relocs + idx; - coff_swap_reloc_in (abfd, src, &dst); - - RELOC_PROCESSING (cache_ptr, &dst, symbols, abfd, asect); -#else - struct internal_reloc dst; +#ifndef RELOC_PROCESSING asymbol *ptr; - struct external_reloc *src; +#endif cache_ptr = reloc_cache + idx; src = native_relocs + idx; coff_swap_reloc_in (abfd, src, &dst); - +#ifdef RELOC_PROCESSING + RELOC_PROCESSING (cache_ptr, &dst, symbols, abfd, asect); +#else cache_ptr->address = dst.r_vaddr; if (dst.r_symndx != -1) @@ -3650,7 +3651,7 @@ coff_slurp_reloc_table (abfd, asect, symbols) ("%s: warning: illegal symbol index %ld in relocs", bfd_get_filename (abfd), dst.r_symndx); cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - ptr = 0; + ptr = NULL; } else { @@ -3662,7 +3663,7 @@ coff_slurp_reloc_table (abfd, asect, symbols) else { cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - ptr = 0; + ptr = NULL; } /* The symbols definitions that we have read in have been @@ -3680,7 +3681,7 @@ coff_slurp_reloc_table (abfd, asect, symbols) /* Fill in the cache_ptr->howto field from dst.r_type */ RTYPE2HOWTO (cache_ptr, &dst); -#endif +#endif /* RELOC_PROCESSING */ if (cache_ptr->howto == NULL) { -- 2.30.2