diff -uprN binutils-2.11.90.0.27/ChangeLog binutils-2.11.90.0.29/ChangeLog --- binutils-2.11.90.0.27/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/ChangeLog Wed Aug 22 08:52:09 2001 @@ -1,3 +1,7 @@ +2001-08-20 Alan Modra + + * config.sub, config.guess: Import latest from subversions. + 2001-07-26 DJ Delorie * MAINTAINERS: Clarify libiberty merge rules and procedures. diff -uprN binutils-2.11.90.0.27/bfd/ChangeLog binutils-2.11.90.0.29/bfd/ChangeLog --- binutils-2.11.90.0.27/bfd/ChangeLog Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/ChangeLog Mon Aug 27 11:44:50 2001 @@ -1,3 +1,502 @@ +2001-08-27 H.J. Lu + + * elf32-mips.c (mips_elf_create_dynamic_relocation): Add more + sanity check. + (mips_elf_calculate_relocation): Create dynamic relocation for + symbols with weak definition or the ELF_LINK_HASH_DEF_REGULAR + bit is not set. + +2001-08-27 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_hide_symbol): Add prototype. + (_bfd_mips_elf_copy_indirect_symbol): Likewise. + (_bfd_elf32_mips_grok_prstatus): Likewise. + (_bfd_elf32_mips_grok_psinfo): Likewise. + (_bfd_mips_elf_hide_symbol): Make it static and cast to + `struct mips_elf_link_hash_entry *'. + (_bfd_mips_elf_copy_indirect_symbol): Make it static. + +2001-08-27 Nick Clifton + + * mipsbsd.c: Add missing prototypes. + * hp300hpux.c: Add missing prototypes. + * i386aout.c: Add missing prototypes. + * i386lynx.c: Add missing prototypes. + * i386mach3.c: Add missing prototypes. + * i386msdos.c: Add missing prototypes. + * i386os9k.c: Add missing prototypes. + +2001-08-27 Linus Nordberg + Torbjorn Granlund + Staffan Ulfberg + Alan Modra + + * config.bfd: Add powerpc64 target. Add powerpc64 vectors to + targ64_selvecs for 32 bit powerpc targets. + * Makefile.am (BFD64_BACKENDS): Add elf64-ppc.lo. + (BFD64_BACKENDS_CFILES): Add elf64-ppc.c. + Run "make dep-am". + * Makefile.in: Regenerate. + * configure.in: Add elf64_powerpc vecs. + * configure: Regenerate. + * cpu-powerpc.c: Default to bfd_mach_ppc_620 entry for 64 bit. + * elf.c (prep_headers): EM_PPC64 for 64 bit ppc elf target. + * targets.c: Add bfd_elf64_powerpc_vec and bfd_elf64_powerpcle_vec. + * elf64-ppc.c: New file. + * reloc.c: Add powerpc64 relocs. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2001-08-27 Andreas Schwab + + * elf32-m68k.c (elf32_m68k_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf32_m68k_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf32_m68k_reloc_type_class): New function. + (elf_backend_reloc_type_class): Define. + +2001-08-27 Andreas Jaeger + + * elf64-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_s390_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + + * elf32-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_s390_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + + * elf32-ppc.c (ppc_elf_check_relocs): Set DF_TEXTREL if the reloc + is against read-only section. + (ppc_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (ppc_elf_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-26 Andreas Jaeger + + * elf32-cris.c (cris_elf_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf_cris_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_cris_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + + * elf32-sh.c (sh_elf_check_relocs): Set DF_TEXTREL if the reloc is + against read-only section. + (elf_backend_reloc_type_class): Define. + (sh_elf_reloc_type_class): New. + (sh_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + + * elf32-arm.h (elf32_arm_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf32_arm_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf32_arm_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-25 Andreas Jaeger + + * oasys.c: Add missing prototypes. + + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Add unused + attribute for parameter. + * elf.c (_bfd_elf_reloc_type_class): Likewise. + + * versados.c (get_4): Make static. + (get_10): Make static. + Add missing prototypes. + (process_esd): Fix call to versados_new_symbol. + +2001-08-25 Nick Clifton + + * coff-a29k.c: Add missing prototypes. + * coff-apollo.c: Add missing prototypes. + * coff-arm.c: Add missing prototypes. + * coff-i860.c: Add missing prototypes. + * coff-rs6000.c: Add missing prototypes. + * coff-tic80.c: Add missing prototypes. + * elf-m10200.c: Add missing prototypes. + * elf-m10300.c: Add missing prototypes. + * elf32-arm.h: Add missing prototypes. + * elf32-d10v.c: Add missing prototypes. + * elf32-m32r.c: Add missing prototypes. + * elf32-mcore.c: Add missing prototypes. + * elf32-openrisc.c: Add missing prototypes. + * elf32-sh.c: Add missing prototypes. + * elf32-sparc.c: Add missing prototypes. + * elf32-v850.c: Add missing prototypes. + * elfarm-nabi.c: Add missing prototypes. + * elfarm-oabi.c: Add missing prototypes. + +2001-08-25 Thiemo Seufer + + * elf32-mips.c (elf_mips_abi_name): Return the right ABI string for + E_MIPS_ABI_O64 and E_MIPS_ABI_EABI64 + +2001-08-24 H.J. Lu + + * elf.c (_bfd_elf_merge_sections): Fail if not using an ELF + hash structure. + +2001-08-24 Nick Clifton + + * elf-bfd.h (elf_hash_table): Revert definition. + (is_elf_hash_table): New macro. + * elflink.h (elf_link_add_object_symbols): Test + is_elf_hash_table before accessing ELF only fields in hash + structure. + (elf_link_create_dynamic_sections): Fail if not using an ELF + hash structure. + (elf_add_dynamic_entry): Fail if not using an ELF hash + structure. + (elf_link_record_local_dynamic_symbol): Fail if not using an + ELF hash structure. + (size_dynamic_sections): Fail if not using an ELF hash + structure. + (elf_adjust_dynamic_symbol): Fail if not using an ELF + hash structure. + (elf_bfd_final_link): Fail if not using an ELF hash + structure. + +2001-08-24 H.J. Lu + + * elf-bfd.h (elf_hash_table): Return NULL if the linker hash + table is not an ELF linker hash table. + + * elf.c (_bfd_elf_link_hash_table_init): Set the linker hash + table type to bfd_link_elf_hash_table. + + * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_create): Revert + the last change. + + * linker.c (_bfd_link_hash_table_init): Set the linker hash + table type to bfd_link_generic_hash_table. + +2001-08-24 Alexandre Oliva + + * bfd.c (bfd_alt_mach_code): New function. + * bfd-in2.h: Rebuilt. + +2001-08-24 Alexandre Oliva + + * elf-m10300.c (mn10300_elf_relocate_section): Test the right + `type' field in the hash entry when deciding whether to follow a + link. + +2001-08-24 Jakub Jelinek + + * elflink.h (elf_link_sort_cmp1): Sort RELATIVE relocs first, not + last. + (elf_link_sort_relocs): Adjust accordingly. + + * elf64-alpha.c (struct alpha_elf_link_hash_entry): Add reltext flag. + (elf64_alpha_check_relocs): Set it if section this reloc is against + is read-only. Set DF_TEXTREL if a RELATIVE reloc is needed against + read-only section. + (elf64_alpha_calc_dynrel_sizes): Set DF_TEXTREL flag if relocation + is is against read-only section. + (elf64_alpha_size_dynamic_sections): Use DF_TEXTREL flag, don't + check section names. + (elf64_alpha_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-24 Thiemo Seufer + + * linker.c (_bfd_generic_link_add_archive_symbols): Replace alloca() + by bfd_malloc(). + +2001-08-23 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Set DF_TEXTREL if + the reloc is against read-only section. + (elf64_x86_64_size_dynamic_sections): Use DF_TEXTREL flag instead + of looking up section names for DT_TEXTREL. + (elf64_x86_64_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-23 H.J. Lu + + * syms.c (bfd_print_symbol_vandf): Add abfd to arg. + * bfd-in2.h (bfd_print_symbol_vandf): Regenerated. + + * aoutx.h (NAME(aout,print_symbol)): Pass abfd to + bfd_print_symbol_vandf. + * coffgen.c (coff_print_symbol): Likewise. + * elf.c (bfd_elf_print_symbol): Likewise. + * ieee.c (ieee_print_symbol): Likewise. + * nlmcode.h (nlm_print_symbol): Likewise. + * oasys.c (oasys_print_symbol): Likewise. + * pdp11.c (NAME(aout,print_symbol)): Likewise. + * som.c (som_print_symbol): Likewise. + * srec.c (srec_print_symbol): Likewise. + * tekhex.c (tekhex_print_symbol): Likewise. + * versados.c (versados_print_symbol): Likewise. + * vms.c (vms_print_symbol): Likewise. + + * elf.c (_bfd_elf_print_private_bfd_data): Replace fprintf_vma + with bfd_fprintf_vma. + (bfd_elf_print_symbol): Likewise. + * syms.c (bfd_print_symbol_vandf): Likewise. + +2001-08-23 Nick Clifton + + * aoutf1.h (sunos_write_object_contents): Silence compile time + warning. + * libaout.h (N_SET_DYNAMIC): Silence compile time warning. + + * bout.c: Add missing function prototypes. Fix formatting. + * coff-z8k.c: Add missing function prototypes. Fix formatting. + * coff-w65.c: Add missing function prototypes. Fix formatting. + * coff-h8500.c: Add missing function prototypes. Fix formatting. + * coff-h8300.c: Add missing function prototypes. Fix formatting. + * coff-tic54x.c: Add missing function prototypes. Fix formatting. + * coff-tic30.c: Add missing function prototypes. Fix formatting. + * coff-m68k.c: Add missing function prototypes. Fix formatting. + * coff-rs6000.c: Add missing function prototypes. Fix formatting. + * coff-sh.c: Add missing function prototypes. Fix formatting. + +2001-08-23 Jakub Jelinek + + * elf-bfd.h (enum elf_reloc_type_class): New. + (struct elf_backend_data): Add elf_backend_reloc_type_class. + (_bfd_elf_reloc_type_class): New. + * elfxx-target.h (elf_backend_reloc_type_class): Define. + (elfNN_bed): Add elf_backend_reloc_type_class. + * elf.c (_bfd_elf_reloc_type_class): New. + * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc + is against read-only section. + (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_i386_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf32_sparc_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (sparc64_elf_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. + (elfNN_ia64_hash_table_create): Clear ia64_info. + (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only + section. + (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag + instead of looking up section names for DT_TEXTREL. + (elfNN_ia64_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. + (struct elf_link_sort_rela): New. + (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. + (elf_bfd_final_link): Call elf_link_sort_relocs. + Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if + necessary. + +2001-08-23 Nick Clifton + + * configure.in (x86-bsdi): No corefile support. + * configure: Regenerate. + +2001-08-22 Nick Clifton + + * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add missing + comma. + +2001-08-21 Mark Elbrecht + + * coff-go32.c: Make DWARF2 sections use an alignment of 0. Set + the alignment of dwarf2 linkonce sections to 0. + * coff-sto32.c: Likewise. + +2001-08-20 Andreas Jaeger + + * coff-sparc.c: Add missing prototypes. + * elf32-s390.c: Likewise. + * elf32-i960.c: Likewise. + * aout-target.h: Likewise. + +2001-08-20 H.J. Lu + + * elf-bfd.h (elf_obj_tdata): Add num_section_syms. + (elf_num_section_syms): New for num_section_syms. + + * elf.c (elf_map_symbols): Set num_section_syms. + (_bfd_elf_symbol_from_bfd_symbol): Check num_section_syms for + the section symbol index. + +2001-08-20 Nick Clifton + + * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_create): Never + select the generic has table creator. All elf backends need elf + specific fields in the hash table. + +2001-08-20 Alan Modra + + * archive.c (offsetof): Remove define. + * elf.c: Likewise. + * oasys.c: Likewise + * sysdep.h (offsetof): Define. + +2001-08-17 Alan Modra + + * bfd.c (bfd_get_gp_size): Return an unsigned int. + (bfd_set_gp_size): Make param unsigned. + * bfd-in2.h: Regenerate. + * elf32-ppc.c (ppc_elf_add_symbol_hook): Use elf_gp_size rather + than calling bfd_get_gp_size. + * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise. + * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Likewise. + +2001-08-17 Alan Modra + + * linker.c (default_fill_link_order): Handle four byte fill value. + +2001-08-17 Alan Modra + + * elf64-sparc.c (sparc64_elf_output_arch_syms): Add missing + prototype. + * nlm32-alpha.c (nlm_alpha_write_external): Fix warning. + + * elf64-mips.c (UNUSED_RELOC): Define. + (mips_elf64_howto_table_rel): Use it. + (mips_elf64_howto_table_rela): Here too. + (mips_elf64_write_relocs): Fix signed/unsigned warning. + + * coffcode.h (coff_write_object_contents): Add ATTRIBUTE_UNUSED to + silence warning. + * coffgen.c (coff_print_symbol): Fix warnings. + (coff_find_nearest_line): Likewise. + * cofflink.c (_bfd_coff_link_input_bfd): Likewise. + * coff-alpha.c (alpha_convert_external_reloc): Likewise. + * format.c (bfd_check_format_matches): Likewise. + (bfd_set_format): Likewise. + * coff-ia64.c: Add missing prototypes. + * elf64-alpha.c (struct alpha_elf_link_hash_entry): Make addend + signed to silence warnings. + (elf64_alpha_relocate_section): Likewise. + (elf64_alpha_find_reloc_at_ofs): Fix warnings. + (elf64_alpha_add_symbol_hook): Likewise. + (elf64_alpha_final_link): Likewise. + (elf64_alpha_relax_section): Remove redundant assign to info.gotent. + (elf64_alpha_merge_gots): Add ATTRIBUTE_UNUSED to unused args. + (elf64_alpha_size_got_sections): Likewise. + * elfxx-ia64.c: Add missing prototypes. + (elfNN_ia64_relocate_section): Fix warning. + (elfNN_ia64_unwind_entry_compare): Make params const. + +2001-08-17 Alan Modra + + * config.bfd (targ64_selvecs): New. + : Use it here instead of ineffectual #ifdef. + + * bfd-in.h (BFD_VERSION): Remove wrong comment. + (BFD_DEFAULT_TARGET_SIZE): New. + (BFD_ARCH_SIZE): Comment. + * configure.in (target_size): New. Set instead of target64 in + selvecs case statement. Set target64 from it. + (bfd_default_target_size): New. Set from taget_size. AC_SUBST. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + +2001-08-17 Alan Modra + + * bfd.c (enum bfd_error): Add bfd_error_wrong_object_format. + (bfd_errmsgs): Add corresponding message. + * archive.c (bfd_generic_archive_p): Don't release bfd_ardata when + finding an archive that contains different format object files. + Return bfd_error_wrong_object_format for this case. + * format.c: Formatting fixes. s/CONST/const/. + (bfd_check_format_matches): Accept archives that give + bfd_error_wrong_object_format if no full match is found. Tidy + code handling matching_vector. Don't return a pointer to freed + memory in `matching'. Handle ambiguous matches as for partial + archive matches. + * bfd-in2.h: Regenerate. + +2001-08-15 Alan Modra + + * libieee.h (common_header_type): Add last_byte field. + + * ieee.c: Add missing prototypes. Some format fixes. + (struct output_buffer_struct): Move for availability to prototypes. + (ieee_part_after): New function. + (ieee_slurp_debug): Use it here. + (ieee_seek): Pass in ieee_data_struct rather than bfd. Use + ieee_part_after to set last_byte to one past end of current part. + Update callers. + (ieee_pos): Pass in ieee_data_struct rather than bfd. + Update callers. + (parse_expression): Don't go beyond the end of the current part. + (ieee_slurp_external_symbols): Correct type passed to read_2bytes. + (ieee_get_symtab_upper_bound, ieee_get_symtab, + ieee_get_symbol_info, ieee_print_symbol, ieee_new_section_hook, + ieee_get_reloc_upper_bound, ieee_canonicalize_reloc, block, + ieee_set_section_contents, ieee_write_object_contents, + ieee_make_empty_symbol): Make static. + (ieee_archive_p): Correct comments regarding bfd_read. + (ieee_object_p): Similarly. + (ieee_mkobject): Move it. Clear output_ptr_start, output_ptr, + output_ptr_end, input_ptr_start, input_ptr, input_ptr_end, + input_bfd, output_bfd, output_buffer. + (do_as_repeat): Write out ieee_set_current_pc_enum value as for + do_with_relocs, ie. as a symbol for relocatable files. + (ieee_vec): Add comments showing functions referenced by macros. + +2001-08-14 Nick Clifton + + * aout-tic30.c: Add missing prototypes. Fix formatting. + * aout-ns32k.c: Add missing prototypes. Fix formatting. + * peXXigen.c: Add missining prototypes. Fix formatting. + * aout-adobe.c: Add missining prototypes. Fix formatting. + +2001-08-13 Nick Clifton + + * elf32-v850.c: Add missing function prototypes. + Fix some formatting. + + * cpu-v850.c: Add missing function prototype. + Fix some formatting. + +2001-08-11 Nick Clifton + + * elf-bfd.h (struct elf_backend_data): Add new fields + 'elf_backend_sprintf_vma' and 'elf_backend_fprintf_vma'. + (bfd_elf_sprintf_vma): Rename function prototype to + '_bfd_elf_sprintf_vma'. + (bfd_elf_fprintf_vma): Rename function prototype to + '_bfd_elf_fprintf_vma'. + * bfd.c (bfd_sprintf_vma): Do not invoke bfd_elf_sprintf_vma + directly, instead indirect via the elf_backend_data structure. + (bfd_fprintf_vma): Do not invoke bfd_elf_fprintf_vma directly, + instead indirect via the elf_backend_data structure. + * elf.c (bfd_elf_sprintf_vma): Rename to _bfd_elf_sprintf_vma. + (bfd_elf_fprintf_vma): Rename to _bfd_elf_fprintf_vma. + * elfxx-target.h (elf_backend_sprintf_vma): Initialise if not + already defined. + (elf_backend_fprintf_vma): Initialise if not already defined. + (struct elf_backend_data): Initialise the + elf_backend_sprintf_vma and elf_backend_fprintf_vma fields. + +2001-08-10 Andreas Jaeger + + * elf64-sparc.c: Add missing prototypes. + * elf32-cris.c: Likewise. + * elf32-i370.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-s390.c: Likewise. + 2001-08-10 Andreas Jaeger * elf64-x86-64.c (elf64_x86_64_elf_object_p): Make static. diff -uprN binutils-2.11.90.0.27/bfd/Makefile.am binutils-2.11.90.0.29/bfd/Makefile.am --- binutils-2.11.90.0.27/bfd/Makefile.am Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/bfd/Makefile.am Mon Aug 27 11:44:50 2001 @@ -426,6 +426,7 @@ BFD64_BACKENDS = \ elf64-ia64.lo \ elf64-gen.lo \ elf64-mips.lo \ + elf64-ppc.lo \ elf64-s390.lo \ elf64-sparc.lo \ elf64.lo \ @@ -444,6 +445,7 @@ BFD64_BACKENDS_CFILES = \ elf64-hppa.c \ elf64-gen.c \ elf64-mips.c \ + elf64-ppc.c \ elf64-s390.c \ elf64-sparc.c \ elf64.c \ @@ -919,9 +921,9 @@ coff-rs6000.lo: coff-rs6000.c $(INCDIR)/ $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \ $(INCDIR)/coff/rs6000.h libcoff.h libxcoff.h coffcode.h \ coffswap.h -coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ - libcoff.h coffcode.h coffswap.h +coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-sparc.lo: coff-sparc.c $(INCDIR)/filenames.h $(INCDIR)/coff/sparc.h \ $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h @@ -1097,7 +1099,7 @@ elf32-sparc.lo: elf32-sparc.c $(INCDIR)/ elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h + $(INCDIR)/libiberty.h elf32-target.h elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ @@ -1230,14 +1232,15 @@ pei-ppc.lo: pei-ppc.c $(INCDIR)/filename $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \ - libpei.h -pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \ +pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ coffcode.h peicode.h libpei.h +pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \ + $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \ + libpei.h pe-mips.lo: pe-mips.c $(INCDIR)/filenames.h $(INCDIR)/coff/mipspe.h \ $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ @@ -1327,6 +1330,10 @@ elf64-mips.lo: elf64-mips.c $(INCDIR)/fi $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \ ecoffswap.h elf64-target.h +elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + elf64-target.h elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ diff -uprN binutils-2.11.90.0.27/bfd/Makefile.in binutils-2.11.90.0.29/bfd/Makefile.in --- binutils-2.11.90.0.27/bfd/Makefile.in Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/bfd/Makefile.in Mon Aug 27 11:44:50 2001 @@ -114,6 +114,7 @@ WIN32LDFLAGS = @WIN32LDFLAGS@ WIN32LIBADD = @WIN32LIBADD@ all_backends = @all_backends@ bfd_backends = @bfd_backends@ +bfd_default_target_size = @bfd_default_target_size@ bfd_machines = @bfd_machines@ l = @l@ tdefaults = @tdefaults@ @@ -551,6 +552,7 @@ BFD64_BACKENDS = \ elf64-ia64.lo \ elf64-gen.lo \ elf64-mips.lo \ + elf64-ppc.lo \ elf64-s390.lo \ elf64-sparc.lo \ elf64.lo \ @@ -570,6 +572,7 @@ BFD64_BACKENDS_CFILES = \ elf64-hppa.c \ elf64-gen.c \ elf64-mips.c \ + elf64-ppc.c \ elf64-s390.c \ elf64-sparc.c \ elf64.c \ @@ -1457,9 +1460,9 @@ coff-rs6000.lo: coff-rs6000.c $(INCDIR)/ $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \ $(INCDIR)/coff/rs6000.h libcoff.h libxcoff.h coffcode.h \ coffswap.h -coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ - libcoff.h coffcode.h coffswap.h +coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-sparc.lo: coff-sparc.c $(INCDIR)/filenames.h $(INCDIR)/coff/sparc.h \ $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h @@ -1635,7 +1638,7 @@ elf32-sparc.lo: elf32-sparc.c $(INCDIR)/ elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h + $(INCDIR)/libiberty.h elf32-target.h elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ @@ -1768,14 +1771,15 @@ pei-ppc.lo: pei-ppc.c $(INCDIR)/filename $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \ - libpei.h -pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \ +pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ coffcode.h peicode.h libpei.h +pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \ + $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \ + libpei.h pe-mips.lo: pe-mips.c $(INCDIR)/filenames.h $(INCDIR)/coff/mipspe.h \ $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ @@ -1865,6 +1869,10 @@ elf64-mips.lo: elf64-mips.c $(INCDIR)/fi $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \ ecoffswap.h elf64-target.h +elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + elf64-target.h elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ diff -uprN binutils-2.11.90.0.27/bfd/aout-adobe.c binutils-2.11.90.0.29/bfd/aout-adobe.c --- binutils-2.11.90.0.27/bfd/aout-adobe.c Sat May 12 00:05:02 2001 +++ binutils-2.11.90.0.29/bfd/aout-adobe.c Wed Aug 22 08:52:09 2001 @@ -1,5 +1,5 @@ /* BFD back-end for a.out.adobe binaries. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. Based on bout.c. @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "aout/adobe.h" #include "aout/stab_gnu.h" -#include "libaout.h" /* BFD a.out internal data structures */ +#include "libaout.h" /* BFD a.out internal data structures. */ /* Forward decl. */ extern const bfd_target a_out_adobe_vec; @@ -35,7 +35,13 @@ static const bfd_target *aout_adobe_call extern boolean aout_32_slurp_symbol_table PARAMS ((bfd *abfd)); extern boolean aout_32_write_syms PARAMS ((bfd *)); -static void aout_adobe_write_section PARAMS ((bfd *abfd, sec_ptr sect)); +static void aout_adobe_write_section PARAMS ((bfd *abfd, sec_ptr sect)); +static const bfd_target * aout_adobe_object_p PARAMS ((bfd *)); +static boolean aout_adobe_mkobject PARAMS ((bfd *)); +static boolean aout_adobe_write_object_contents PARAMS ((bfd *)); +static boolean aout_adobe_set_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); +static boolean aout_adobe_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); +static int aout_adobe_sizeof_headers PARAMS ((bfd *, boolean)); /* Swaps the information in an executable header taken from a raw byte stream memory image, into the internal exec_header structure. */ @@ -142,7 +148,7 @@ aout_adobe_callback (abfd) asection *sect; struct external_segdesc ext[1]; char *section_name; - char try_again[30]; /* name and number */ + char try_again[30]; /* Name and number. */ char *newname; int trynum; flagword flags; @@ -155,13 +161,13 @@ aout_adobe_callback (abfd) obj_sym_filepos (abfd) = N_SYMOFF (*execp); /* Suck up the section information from the file, one section at a time. */ - for (;;) { if (bfd_read ((PTR) ext, 1, sizeof (*ext), abfd) != sizeof (*ext)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); + return 0; } switch (ext->e_type[0]) @@ -193,10 +199,10 @@ aout_adobe_callback (abfd) /* First one is called ".text" or whatever; subsequent ones are ".text1", ".text2", ... */ - bfd_set_error (bfd_error_no_error); sect = bfd_make_section (abfd, section_name); trynum = 0; + while (!sect) { if (bfd_get_error () != bfd_error_no_error) @@ -240,6 +246,9 @@ aout_adobe_callback (abfd) sect->rel_filepos = N_DRELOFF (*execp); sect->reloc_count = execp->a_drsize; break; + + default: + break; } } no_more_sections: @@ -253,10 +262,11 @@ aout_adobe_callback (abfd) return abfd->xvec; } -struct bout_data_struct { - struct aoutdata a; - struct internal_exec e; -}; +struct bout_data_struct + { + struct aoutdata a; + struct internal_exec e; + }; static boolean aout_adobe_mkobject (abfd) @@ -333,26 +343,16 @@ aout_adobe_write_object_contents (abfd) afterward. */ for (sect = abfd->sections; sect; sect = sect->next) - { - if (sect->flags & SEC_CODE) - { - aout_adobe_write_section (abfd, sect); - } - } + if (sect->flags & SEC_CODE) + aout_adobe_write_section (abfd, sect); + for (sect = abfd->sections; sect; sect = sect->next) - { - if (sect->flags & SEC_DATA) - { - aout_adobe_write_section (abfd, sect); - } - } + if (sect->flags & SEC_DATA) + aout_adobe_write_section (abfd, sect); + for (sect = abfd->sections; sect; sect = sect->next) - { - if (!(sect->flags & (SEC_CODE | SEC_DATA))) - { - aout_adobe_write_section (abfd, sect); - } - } + if (!(sect->flags & (SEC_CODE | SEC_DATA))) + aout_adobe_write_section (abfd, sect); /* Write final `sentinel` section header (with type of 0). */ if (bfd_write ((PTR) sentinel, 1, sizeof (*sentinel), abfd) @@ -374,27 +374,20 @@ aout_adobe_write_object_contents (abfd) return false; for (sect = abfd->sections; sect; sect = sect->next) - { - if (sect->flags & SEC_CODE) - { - if (!aout_32_squirt_out_relocs (abfd, sect)) - return false; - } - } + if (sect->flags & SEC_CODE) + if (!aout_32_squirt_out_relocs (abfd, sect)) + return false; if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*exec_hdr (abfd))), SEEK_SET) != 0) return false; for (sect = abfd->sections; sect; sect = sect->next) - { - if (sect->flags & SEC_DATA) - { - if (!aout_32_squirt_out_relocs (abfd, sect)) - return false; - } - } + if (sect->flags & SEC_DATA) + if (!aout_32_squirt_out_relocs (abfd, sect)) + return false; } + return true; } @@ -422,7 +415,6 @@ aout_adobe_set_section_contents (abfd, s { /* Assign file offsets to sections. Text sections are first, and are contiguous. Then data sections. Everything else at the end. */ - section_start = N_TXTOFF (ignore<-->me); for (sect = abfd->sections; sect; sect = sect->next) @@ -463,9 +455,8 @@ aout_adobe_set_section_contents (abfd, s return false; if (count != 0) - { - return (bfd_write ((PTR) location, 1, count, abfd) == count) ? true : false; - } + return (bfd_write ((PTR) location, 1, count, abfd) == count) ? true : false; + return true; } @@ -520,44 +511,45 @@ aout_adobe_sizeof_headers (ignore_abfd, #define aout_32_bfd_final_link _bfd_generic_final_link #define aout_32_bfd_link_split_section _bfd_generic_link_split_section -const bfd_target a_out_adobe_vec = { - "a.out.adobe", /* name */ - bfd_target_aout_flavour, - BFD_ENDIAN_BIG, /* data byte order is unknown (big assumed) */ - BFD_ENDIAN_BIG, /* hdr byte order is big */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), - /* section flags */ - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_DATA | SEC_RELOC), - '_', /* symbol leading char */ - ' ', /* ar_pad_char */ - 16, /* ar_max_namelen */ - - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - {_bfd_dummy_target, aout_adobe_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, aout_adobe_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, aout_adobe_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (aout_32), - BFD_JUMP_TABLE_COPY (_bfd_generic), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), - BFD_JUMP_TABLE_SYMBOLS (aout_32), - BFD_JUMP_TABLE_RELOCS (aout_32), - BFD_JUMP_TABLE_WRITE (aout_32), - BFD_JUMP_TABLE_LINK (aout_32), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), +const bfd_target a_out_adobe_vec = + { + "a.out.adobe", /* name */ + bfd_target_aout_flavour, + BFD_ENDIAN_BIG, /* data byte order is unknown (big assumed) */ + BFD_ENDIAN_BIG, /* hdr byte order is big */ + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + /* section flags */ + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_DATA | SEC_RELOC), + '_', /* symbol leading char */ + ' ', /* ar_pad_char */ + 16, /* ar_max_namelen */ + + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + {_bfd_dummy_target, aout_adobe_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, aout_adobe_mkobject, /* bfd_set_format */ + _bfd_generic_mkarchive, bfd_false}, + {bfd_false, aout_adobe_write_object_contents,/* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (aout_32), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), + BFD_JUMP_TABLE_SYMBOLS (aout_32), + BFD_JUMP_TABLE_RELOCS (aout_32), + BFD_JUMP_TABLE_WRITE (aout_32), + BFD_JUMP_TABLE_LINK (aout_32), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - NULL, + NULL, - (PTR) 0 -}; + (PTR) 0 + }; diff -uprN binutils-2.11.90.0.27/bfd/aout-arm.c binutils-2.11.90.0.29/bfd/aout-arm.c --- binutils-2.11.90.0.27/bfd/aout-arm.c Fri Mar 9 11:15:25 2001 +++ binutils-2.11.90.0.29/bfd/aout-arm.c Wed Aug 22 08:52:09 2001 @@ -1,5 +1,5 @@ /* BFD back-end for raw ARM a.out binaries. - Copyright 1994, 1995, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) @@ -19,6 +19,15 @@ You should have received a copy of the G along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "bfd.h" +#include "sysdep.h" +/* Avoid multiple defininitions from aoutx if supporting standarad a.out + as well as our own. */ +#define NAME(x,y) CAT3(aoutarm,_32_,y) + +#include "libaout.h" +#include "aout/aout64.h" + #define N_TXTADDR(x) \ ((N_MAGIC(x) == NMAGIC) ? 0x8000 : \ (N_MAGIC(x) != ZMAGIC) ? 0 : \ @@ -36,63 +45,45 @@ Foundation, Inc., 59 Temple Place - Suit ((x).a_info != NMAGIC)) #define N_MAGIC(x) ((x).a_info & ~07200) -#include "bfd.h" -#include "sysdep.h" - -#define MYARM(OP) CAT(aoutarm_,OP) -reloc_howto_type *MYARM(bfd_reloc_type_lookup) - PARAMS((bfd *, bfd_reloc_code_real_type)); -static boolean MYARM(write_object_contents) PARAMS((bfd *)); - -/* Avoid multiple defininitions from aoutx if supporting standarad a.out - as well as our own. */ -#define NAME(x,y) CAT3(aoutarm,_32_,y) - #define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup -#include "libaout.h" -#include "aout/aout64.h" - -static bfd_reloc_status_type -MY(fix_pcrel_26_done) PARAMS ((bfd *, arelent *, asymbol *, PTR, - asection *, bfd *, char **)); - -static bfd_reloc_status_type -MY(fix_pcrel_26) PARAMS ((bfd *, arelent *, asymbol *, PTR, - asection *, bfd *, char **)); -static void MY(swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *, - arelent *, asymbol **, - bfd_size_type)); -void MY(swap_std_reloc_out) PARAMS ((bfd *, arelent *, - struct reloc_std_external *)); - +static boolean MY(write_object_contents) PARAMS ((bfd *)); +static bfd_reloc_status_type MY(fix_pcrel_26_done) PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type MY(fix_pcrel_26) PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static void MY(swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *, arelent *, asymbol **, bfd_size_type)); +reloc_howto_type * MY(bfd_reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); +reloc_howto_type * MY(reloc_howto) PARAMS ((bfd *, struct reloc_std_external *, int *, int *, int *)); +void MY(put_reloc) PARAMS ((bfd *, int, int, long, reloc_howto_type *, struct reloc_std_external *)); +void MY(relocatable_reloc) PARAMS ((reloc_howto_type *, bfd *, struct reloc_std_external *, bfd_vma *, bfd_vma)); +void MY(swap_std_reloc_out) PARAMS ((bfd *, arelent *, struct reloc_std_external *)); + reloc_howto_type MY(howto_table)[] = -{ - /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask - pcdone */ - HOWTO (0, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, - 0x000000ff, 0x000000ff, false), - HOWTO (1, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, - 0x0000ffff, 0x0000ffff, false), - HOWTO (2, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, - 0xffffffff, 0xffffffff, false), - HOWTO (3, 2, 2, 26, true, 0, complain_overflow_signed, MY(fix_pcrel_26), - "ARM26", true, 0x00ffffff, 0x00ffffff, true), - HOWTO (4, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, - 0x000000ff, 0x000000ff, true), - HOWTO (5, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, - 0x0000ffff, 0x0000ffff, true), - HOWTO (6, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, - 0xffffffff, 0xffffffff, true), - HOWTO (7, 2, 2, 26, false, 0, complain_overflow_signed, - MY(fix_pcrel_26_done), "ARM26D", true, 0x0, 0x0, - false), - EMPTY_HOWTO (-1), - HOWTO (9, 0, -1, 16, false, 0, complain_overflow_bitfield, 0, "NEG16", true, - 0x0000ffff, 0x0000ffff, false), - HOWTO (10, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "NEG32", true, - 0xffffffff, 0xffffffff, false) -}; + { + /* Type rs size bsz pcrel bitpos ovrf sf name part_inpl + readmask setmask pcdone. */ + HOWTO (0, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, + 0x000000ff, 0x000000ff, false), + HOWTO (1, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, + 0x0000ffff, 0x0000ffff, false), + HOWTO (2, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, + 0xffffffff, 0xffffffff, false), + HOWTO (3, 2, 2, 26, true, 0, complain_overflow_signed, MY(fix_pcrel_26), + "ARM26", true, 0x00ffffff, 0x00ffffff, true), + HOWTO (4, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, + 0x000000ff, 0x000000ff, true), + HOWTO (5, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, + 0x0000ffff, 0x0000ffff, true), + HOWTO (6, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, + 0xffffffff, 0xffffffff, true), + HOWTO (7, 2, 2, 26, false, 0, complain_overflow_signed, + MY(fix_pcrel_26_done), "ARM26D", true, 0x0, 0x0, + false), + EMPTY_HOWTO (-1), + HOWTO (9, 0, -1, 16, false, 0, complain_overflow_bitfield, 0, "NEG16", true, + 0x0000ffff, 0x0000ffff, false), + HOWTO (10, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "NEG32", true, + 0xffffffff, 0xffffffff, false) + }; #define RELOC_ARM_BITS_NEG_BIG ((unsigned int) 0x08) #define RELOC_ARM_BITS_NEG_LITTLE ((unsigned int) 0x10) @@ -157,14 +148,16 @@ MY(put_reloc) (abfd, r_extern, r_index, int r_neg; PUT_WORD (abfd, value, reloc->r_address); - r_length = howto->size ; /* Size as a power of two */ + /* Size as a power of two. */ + r_length = howto->size; /* Special case for branch relocations. */ if (howto->type == 3 || howto->type == 7) r_length = 3; - r_pcrel = howto->type & 4; /* PC Relative done? */ - r_neg = howto->type & 8; /* Negative relocation */ + r_pcrel = howto->type & 4; /* PC Relative done? */ + r_neg = howto->type & 8; /* Negative relocation. */ + if (bfd_header_big_endian (abfd)) { reloc->r_index[0] = r_index >> 16; @@ -258,7 +251,7 @@ MY(fix_pcrel_26) (abfd, reloc_entry, sym long target = bfd_get_32 (abfd, (bfd_byte *) data + addr); bfd_reloc_status_type flag = bfd_reloc_ok; - /* If this is an undefined symbol, return error */ + /* If this is an undefined symbol, return error. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined; @@ -270,7 +263,7 @@ MY(fix_pcrel_26) (abfd, reloc_entry, sym return bfd_reloc_ok; relocation = (target & 0x00ffffff) << 2; - relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend */ + relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend. */ relocation += symbol->value; relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; @@ -281,7 +274,7 @@ MY(fix_pcrel_26) (abfd, reloc_entry, sym if (relocation & 3) return bfd_reloc_overflow; - /* Check for overflow */ + /* Check for overflow. */ if (relocation & 0x02000000) { if ((relocation & ~ (bfd_vma) 0x03ffffff) != ~ (bfd_vma) 0x03ffffff) @@ -313,7 +306,8 @@ MY(bfd_reloc_type_lookup) (abfd,code) case 32: code = BFD_RELOC_32; break; - default: return (CONST struct reloc_howto_struct *) 0; + default: + return (CONST struct reloc_howto_struct *) 0; } switch (code) @@ -324,7 +318,8 @@ MY(bfd_reloc_type_lookup) (abfd,code) ASTD (BFD_RELOC_8_PCREL, 4); ASTD (BFD_RELOC_16_PCREL, 5); ASTD (BFD_RELOC_32_PCREL, 6); - default: return (CONST struct reloc_howto_struct *) 0; + default: + return (CONST struct reloc_howto_struct *) 0; } } @@ -419,25 +414,25 @@ MY_swap_std_reloc_out (abfd, g, natptr) if (bfd_abs_section.symbol == sym) { /* Whoops, looked like an abs symbol, but is really an offset - from the abs section */ + from the abs section. */ r_index = 0; r_extern = 0; } else { - /* Fill in symbol */ + /* Fill in symbol. */ r_extern = 1; r_index = (*(g->sym_ptr_ptr))->KEEPIT; } } else { - /* Just an ordinary section */ + /* Just an ordinary section. */ r_extern = 0; r_index = output_section->target_index; } - /* now the fun stuff */ + /* Now the fun stuff. */ if (bfd_header_big_endian (abfd)) { natptr->r_index[0] = r_index >> 16; @@ -469,83 +464,83 @@ MY_swap_std_reloc_out (abfd, g, natptr) extern const bfd_target aout_arm_big_vec; const bfd_target aout_arm_little_vec = -{ - "a.out-arm-little", /* name */ - bfd_target_aout_flavour, - BFD_ENDIAN_LITTLE, /* target byte order (little) */ - BFD_ENDIAN_LITTLE, /* target headers byte order (little) */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), - MY_symbol_leading_char, - AR_PAD_CHAR, /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, MY_object_p, /* bfd_check_format */ - bfd_generic_archive_p, MY_core_file_p}, - {bfd_false, MY_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, MY_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (MY), - BFD_JUMP_TABLE_COPY (MY), - BFD_JUMP_TABLE_CORE (MY), - BFD_JUMP_TABLE_ARCHIVE (MY), - BFD_JUMP_TABLE_SYMBOLS (MY), - BFD_JUMP_TABLE_RELOCS (MY), - BFD_JUMP_TABLE_WRITE (MY), - BFD_JUMP_TABLE_LINK (MY), - BFD_JUMP_TABLE_DYNAMIC (MY), + { + "a.out-arm-little", /* name */ + bfd_target_aout_flavour, + BFD_ENDIAN_LITTLE, /* target byte order (little) */ + BFD_ENDIAN_LITTLE, /* target headers byte order (little) */ + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED), + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), + MY_symbol_leading_char, + AR_PAD_CHAR, /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + {_bfd_dummy_target, MY_object_p, /* bfd_check_format */ + bfd_generic_archive_p, MY_core_file_p}, + {bfd_false, MY_mkobject, /* bfd_set_format */ + _bfd_generic_mkarchive, bfd_false}, + {bfd_false, MY_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (MY), + BFD_JUMP_TABLE_COPY (MY), + BFD_JUMP_TABLE_CORE (MY), + BFD_JUMP_TABLE_ARCHIVE (MY), + BFD_JUMP_TABLE_SYMBOLS (MY), + BFD_JUMP_TABLE_RELOCS (MY), + BFD_JUMP_TABLE_WRITE (MY), + BFD_JUMP_TABLE_LINK (MY), + BFD_JUMP_TABLE_DYNAMIC (MY), - & aout_arm_big_vec, + & aout_arm_big_vec, - (PTR) MY_backend_data, -}; + (PTR) MY_backend_data, + }; const bfd_target aout_arm_big_vec = -{ - "a.out-arm-big", /* name */ - bfd_target_aout_flavour, - BFD_ENDIAN_BIG, /* target byte order (big) */ - BFD_ENDIAN_BIG, /* target headers byte order (big) */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), - MY_symbol_leading_char, - AR_PAD_CHAR, /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - {_bfd_dummy_target, MY_object_p, /* bfd_check_format */ - bfd_generic_archive_p, MY_core_file_p}, - {bfd_false, MY_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, MY_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (MY), - BFD_JUMP_TABLE_COPY (MY), - BFD_JUMP_TABLE_CORE (MY), - BFD_JUMP_TABLE_ARCHIVE (MY), - BFD_JUMP_TABLE_SYMBOLS (MY), - BFD_JUMP_TABLE_RELOCS (MY), - BFD_JUMP_TABLE_WRITE (MY), - BFD_JUMP_TABLE_LINK (MY), - BFD_JUMP_TABLE_DYNAMIC (MY), - - & aout_arm_little_vec, + { + "a.out-arm-big", /* name */ + bfd_target_aout_flavour, + BFD_ENDIAN_BIG, /* target byte order (big) */ + BFD_ENDIAN_BIG, /* target headers byte order (big) */ + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED), + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), + MY_symbol_leading_char, + AR_PAD_CHAR, /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + {_bfd_dummy_target, MY_object_p, /* bfd_check_format */ + bfd_generic_archive_p, MY_core_file_p}, + {bfd_false, MY_mkobject, /* bfd_set_format */ + _bfd_generic_mkarchive, bfd_false}, + {bfd_false, MY_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (MY), + BFD_JUMP_TABLE_COPY (MY), + BFD_JUMP_TABLE_CORE (MY), + BFD_JUMP_TABLE_ARCHIVE (MY), + BFD_JUMP_TABLE_SYMBOLS (MY), + BFD_JUMP_TABLE_RELOCS (MY), + BFD_JUMP_TABLE_WRITE (MY), + BFD_JUMP_TABLE_LINK (MY), + BFD_JUMP_TABLE_DYNAMIC (MY), + + & aout_arm_little_vec, - (PTR) MY_backend_data, -}; + (PTR) MY_backend_data, + }; diff -uprN binutils-2.11.90.0.27/bfd/aout-ns32k.c binutils-2.11.90.0.29/bfd/aout-ns32k.c --- binutils-2.11.90.0.27/bfd/aout-ns32k.c Fri Mar 9 11:15:25 2001 +++ binutils-2.11.90.0.29/bfd/aout-ns32k.c Wed Aug 22 08:52:09 2001 @@ -1,5 +1,5 @@ /* BFD back-end for ns32k a.out-ish binaries. - Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 2000 + Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc. Contributed by Ian Dall (idall@eleceng.adelaide.edu.au). @@ -35,9 +35,8 @@ boolean MYNS(write_object_contents) PARAMS((bfd *abfd)); -/* Avoid multiple definitions from aoutx if supporting standard a.out format(s) - * as well as this one - */ +/* Avoid multiple definitions from aoutx if supporting + standard a.out format(s) as well as this one. */ #define NAME(x,y) CAT3(ns32kaout,_32_,y) void bfd_ns32k_arch PARAMS ((void)); @@ -53,99 +52,102 @@ static void MY_swap_std_reloc_in PARAMS ((bfd *abfd, struct reloc_std_external *bytes, arelent *cache_ptr, asymbol **symbols, bfd_size_type symcount)); - static void MY_swap_std_reloc_out PARAMS ((bfd *abfd, arelent *g, struct reloc_std_external *natptr)); +reloc_howto_type * +MY(reloc_howto) PARAMS ((bfd *, struct reloc_std_external *, + int *, int *, int *)); +void +MY(put_reloc) PARAMS ((bfd *, int, int, long, reloc_howto_type *, + struct reloc_std_external *)); /* The ns32k series is ah, unusual, when it comes to relocation. - * There are three storage methods for relocateable objects. There - * are displacements, immediate operands and ordinary twos complement - * data. Of these, only the last fits into the standard relocation - * scheme. Immediate operands are stored huffman encoded and - * immediate operands are stored big endian (where as the natural byte - * order is little endian for this achitecture). - - * Note that the ns32k displacement storage method is orthogonal to - * whether the relocation is pc relative or not. The "displacement" - * storage scheme is used for essentially all address constants. The - * displacement can be relative to zero (absolute displacement), - * relative to the pc (pc relative), the stack pointer, the frame - * pointer, the static base register and general purpose register etc. - - * For example: - * - * sym1: .long . # pc relative 2's complement - * sym1: .long foo # 2's complement not pc relative - * - * self: movd @self, r0 # pc relative displacement - * movd foo, r0 # non pc relative displacement - * - * self: movd self, r0 # pc relative immediate - * movd foo, r0 # non pc relative immediate - * - * In addition, for historical reasons the encoding of the relocation types - * in the a.out format relocation entries is such that even the relocation - * methods which are standard are not encoded the standard way. - * - */ + There are three storage methods for relocateable objects. There + are displacements, immediate operands and ordinary twos complement + data. Of these, only the last fits into the standard relocation + scheme. Immediate operands are stored huffman encoded and + immediate operands are stored big endian (where as the natural byte + order is little endian for this achitecture). + + Note that the ns32k displacement storage method is orthogonal to + whether the relocation is pc relative or not. The "displacement" + storage scheme is used for essentially all address constants. The + displacement can be relative to zero (absolute displacement), + relative to the pc (pc relative), the stack pointer, the frame + pointer, the static base register and general purpose register etc. + + For example: + + sym1: .long . # pc relative 2's complement + sym1: .long foo # 2's complement not pc relative + + self: movd @self, r0 # pc relative displacement + movd foo, r0 # non pc relative displacement + + self: movd self, r0 # pc relative immediate + movd foo, r0 # non pc relative immediate + + In addition, for historical reasons the encoding of the relocation types + in the a.out format relocation entries is such that even the relocation + methods which are standard are not encoded the standard way. */ reloc_howto_type MY(howto_table)[] = -{ - /* ns32k immediate operands */ - HOWTO (BFD_RELOC_NS32K_IMM_8, 0, 0, 8, false, 0, true, - _bfd_ns32k_reloc_imm, "NS32K_IMM_8", - true, 0x000000ff,0x000000ff, false), - HOWTO (BFD_RELOC_NS32K_IMM_16, 0, 1, 16, false, 0, true, - _bfd_ns32k_reloc_imm, "NS32K_IMM_16", - true, 0x0000ffff,0x0000ffff, false), - HOWTO (BFD_RELOC_NS32K_IMM_32, 0, 2, 32, false, 0, true, - _bfd_ns32k_reloc_imm, "NS32K_IMM_32", - true, 0xffffffff,0xffffffff, false), - HOWTO (BFD_RELOC_NS32K_IMM_8_PCREL, 0, 0, 8, true, 0, false, - _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_8", - true, 0x000000ff, 0x000000ff, false), - HOWTO (BFD_RELOC_NS32K_IMM_16_PCREL, 0, 1, 16, true, 0, false, - _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_16", - true, 0x0000ffff,0x0000ffff, false), - HOWTO (BFD_RELOC_NS32K_IMM_32_PCREL, 0, 2, 32, true, 0, false, - _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_32", - true, 0xffffffff,0xffffffff, false), - - /* ns32k displacements */ - HOWTO (BFD_RELOC_NS32K_DISP_8, 0, 0, 8, false, 0, true, - _bfd_ns32k_reloc_disp, "NS32K_DISP_8", - true, 0x000000ff,0x000000ff, false), - HOWTO (BFD_RELOC_NS32K_DISP_16, 0, 1, 16, false, 0, true, - _bfd_ns32k_reloc_disp, "NS32K_DISP_16", - true, 0x0000ffff, 0x0000ffff, false), - HOWTO (BFD_RELOC_NS32K_DISP_32, 0, 2, 32, false, 0, true, - _bfd_ns32k_reloc_disp, "NS32K_DISP_32", - true, 0xffffffff, 0xffffffff, false), - HOWTO (BFD_RELOC_NS32K_DISP_8_PCREL, 0, 0, 8, true, 0, false, - _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_8", - true, 0x000000ff,0x000000ff, false), - HOWTO (BFD_RELOC_NS32K_DISP_16_PCREL, 0, 1, 16, true, 0, false, - _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_16", - true, 0x0000ffff,0x0000ffff, false), - HOWTO (BFD_RELOC_NS32K_DISP_32_PCREL, 0, 2, 32, true, 0, false, - _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_32", - true, 0xffffffff,0xffffffff, false), - - /* Normal 2's complement */ - HOWTO (BFD_RELOC_8, 0, 0, 8, false, 0, complain_overflow_bitfield,0, - "8", true, 0x000000ff,0x000000ff, false), - HOWTO (BFD_RELOC_16, 0, 1, 16, false, 0, complain_overflow_bitfield,0, - "16", true, 0x0000ffff,0x0000ffff, false), - HOWTO (BFD_RELOC_32, 0, 2, 32, false, 0, complain_overflow_bitfield,0, - "32", true, 0xffffffff,0xffffffff, false), - HOWTO (BFD_RELOC_8_PCREL, 0, 0, 8, true, 0, complain_overflow_signed, 0, - "PCREL_8", true, 0x000000ff,0x000000ff, false), - HOWTO (BFD_RELOC_16_PCREL, 0, 1, 16, true, 0, complain_overflow_signed, 0, - "PCREL_16", true, 0x0000ffff,0x0000ffff, false), - HOWTO (BFD_RELOC_32_PCREL, 0, 2, 32, true, 0, complain_overflow_signed, 0, - "PCREL_32", true, 0xffffffff,0xffffffff, false), -}; + { + /* ns32k immediate operands. */ + HOWTO (BFD_RELOC_NS32K_IMM_8, 0, 0, 8, false, 0, true, + _bfd_ns32k_reloc_imm, "NS32K_IMM_8", + true, 0x000000ff,0x000000ff, false), + HOWTO (BFD_RELOC_NS32K_IMM_16, 0, 1, 16, false, 0, true, + _bfd_ns32k_reloc_imm, "NS32K_IMM_16", + true, 0x0000ffff,0x0000ffff, false), + HOWTO (BFD_RELOC_NS32K_IMM_32, 0, 2, 32, false, 0, true, + _bfd_ns32k_reloc_imm, "NS32K_IMM_32", + true, 0xffffffff,0xffffffff, false), + HOWTO (BFD_RELOC_NS32K_IMM_8_PCREL, 0, 0, 8, true, 0, false, + _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_8", + true, 0x000000ff, 0x000000ff, false), + HOWTO (BFD_RELOC_NS32K_IMM_16_PCREL, 0, 1, 16, true, 0, false, + _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_16", + true, 0x0000ffff,0x0000ffff, false), + HOWTO (BFD_RELOC_NS32K_IMM_32_PCREL, 0, 2, 32, true, 0, false, + _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_32", + true, 0xffffffff,0xffffffff, false), + + /* ns32k displacements. */ + HOWTO (BFD_RELOC_NS32K_DISP_8, 0, 0, 8, false, 0, true, + _bfd_ns32k_reloc_disp, "NS32K_DISP_8", + true, 0x000000ff,0x000000ff, false), + HOWTO (BFD_RELOC_NS32K_DISP_16, 0, 1, 16, false, 0, true, + _bfd_ns32k_reloc_disp, "NS32K_DISP_16", + true, 0x0000ffff, 0x0000ffff, false), + HOWTO (BFD_RELOC_NS32K_DISP_32, 0, 2, 32, false, 0, true, + _bfd_ns32k_reloc_disp, "NS32K_DISP_32", + true, 0xffffffff, 0xffffffff, false), + HOWTO (BFD_RELOC_NS32K_DISP_8_PCREL, 0, 0, 8, true, 0, false, + _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_8", + true, 0x000000ff,0x000000ff, false), + HOWTO (BFD_RELOC_NS32K_DISP_16_PCREL, 0, 1, 16, true, 0, false, + _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_16", + true, 0x0000ffff,0x0000ffff, false), + HOWTO (BFD_RELOC_NS32K_DISP_32_PCREL, 0, 2, 32, true, 0, false, + _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_32", + true, 0xffffffff,0xffffffff, false), + + /* Normal 2's complement. */ + HOWTO (BFD_RELOC_8, 0, 0, 8, false, 0, complain_overflow_bitfield,0, + "8", true, 0x000000ff,0x000000ff, false), + HOWTO (BFD_RELOC_16, 0, 1, 16, false, 0, complain_overflow_bitfield,0, + "16", true, 0x0000ffff,0x0000ffff, false), + HOWTO (BFD_RELOC_32, 0, 2, 32, false, 0, complain_overflow_bitfield,0, + "32", true, 0xffffffff,0xffffffff, false), + HOWTO (BFD_RELOC_8_PCREL, 0, 0, 8, true, 0, complain_overflow_signed, 0, + "PCREL_8", true, 0x000000ff,0x000000ff, false), + HOWTO (BFD_RELOC_16_PCREL, 0, 1, 16, true, 0, complain_overflow_signed, 0, + "PCREL_16", true, 0x0000ffff,0x0000ffff, false), + HOWTO (BFD_RELOC_32_PCREL, 0, 2, 32, true, 0, complain_overflow_signed, 0, + "PCREL_32", true, 0xffffffff,0xffffffff, false), + }; #define CTOR_TABLE_RELOC_HOWTO(BFD) (MY(howto_table) + 14) @@ -164,7 +166,8 @@ MY(reloc_howto) (abfd, rel, r_index, r_e { unsigned int r_length; int r_ns32k_type; -/* BFD_ASSERT(bfd_header_little_endian (abfd)); */ + + /* BFD_ASSERT(bfd_header_little_endian (abfd)); */ *r_index = ((rel->r_index[2] << 16) | (rel->r_index[1] << 8) | rel->r_index[0] ); @@ -191,11 +194,13 @@ MY(put_reloc) (abfd, r_extern, r_index, unsigned int r_length; int r_pcrel; int r_ns32k_type; + PUT_WORD (abfd, value, reloc->r_address); - r_length = howto->size ; /* Size as a power of two */ - r_pcrel = (int) howto->pc_relative; /* Relative to PC? */ + r_length = howto->size ; /* Size as a power of two. */ + r_pcrel = (int) howto->pc_relative; /* Relative to PC? */ r_ns32k_type = (howto - MY(howto_table) )/6; -/* BFD_ASSERT (bfd_header_little_endian (abfd)); */ + + /* BFD_ASSERT (bfd_header_little_endian (abfd)); */ reloc->r_index[2] = r_index >> 16; reloc->r_index[1] = r_index >> 8; reloc->r_index[0] = r_index; @@ -233,6 +238,8 @@ MY(bfd_reloc_type_lookup) (abfd,code) case 32: code = BFD_RELOC_32; break; + default: + break; } switch (code) { @@ -254,7 +261,8 @@ MY(bfd_reloc_type_lookup) (abfd,code) ENTRY(BFD_RELOC_8_PCREL, 15); ENTRY(BFD_RELOC_16_PCREL, 16); ENTRY(BFD_RELOC_32_PCREL, 17); - default: return (reloc_howto_type *) NULL; + default: + return (reloc_howto_type *) NULL; } #undef ENTRY } @@ -274,11 +282,10 @@ MY_swap_std_reloc_in (abfd, bytes, cache cache_ptr->address = bfd_h_get_32 (abfd, bytes->r_address); - /* now the fun stuff */ - + /* Now the fun stuff. */ cache_ptr->howto = MY_reloc_howto(abfd, bytes, r_index, r_extern, r_pcrel); - MOVE_ADDRESS(0); + MOVE_ADDRESS (0); } static void @@ -295,7 +302,7 @@ MY_swap_std_reloc_out (abfd, g, natptr) r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma; - /* name was clobbered by aout_write_syms to be symbol index */ + /* Name was clobbered by aout_write_syms to be symbol index. */ /* If this relocation is relative to a symbol then set the r_index to the symbols index, and the r_extern bit. @@ -303,7 +310,6 @@ MY_swap_std_reloc_out (abfd, g, natptr) Absolute symbols can come in in two ways, either as an offset from the abs section, or as a symbol which has an abs value. Check for that here. */ - if (bfd_is_com_section (output_section) || output_section == &bfd_abs_section || output_section == &bfd_und_section) @@ -311,13 +317,13 @@ MY_swap_std_reloc_out (abfd, g, natptr) if (bfd_abs_section.symbol == sym) { /* Whoops, looked like an abs symbol, but is really an offset - from the abs section */ + from the abs section. */ r_index = 0; r_extern = 0; } else { - /* Fill in symbol */ + /* Fill in symbol. */ r_extern = 1; #undef KEEPIT #define KEEPIT udata.i @@ -327,7 +333,7 @@ MY_swap_std_reloc_out (abfd, g, natptr) } else { - /* Just an ordinary section */ + /* Just an ordinary section. */ r_extern = 0; r_index = output_section->target_index; } diff -uprN binutils-2.11.90.0.27/bfd/aout-target.h binutils-2.11.90.0.29/bfd/aout-target.h --- binutils-2.11.90.0.27/bfd/aout-target.h Sat May 12 00:05:03 2001 +++ binutils-2.11.90.0.29/bfd/aout-target.h Wed Aug 22 08:52:09 2001 @@ -250,6 +250,8 @@ MY_bfd_copy_private_section_data (ibfd, file header, symbols, and relocation. */ #ifndef MY_write_object_contents +static boolean MY(write_object_contents) PARAMS ((bfd *)); + static boolean MY(write_object_contents) (abfd) bfd *abfd; diff -uprN binutils-2.11.90.0.27/bfd/aout-tic30.c binutils-2.11.90.0.29/bfd/aout-tic30.c --- binutils-2.11.90.0.27/bfd/aout-tic30.c Sat May 12 00:05:03 2001 +++ binutils-2.11.90.0.29/bfd/aout-tic30.c Wed Aug 22 08:52:09 2001 @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C30 a.out binaries. - Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) This file is part of BFD, the Binary File Descriptor library. @@ -56,6 +56,12 @@ static bfd_reloc_status_type tic30_aout_ static const bfd_target *tic30_aout_object_p PARAMS ((bfd *)); static boolean tic30_aout_write_object_contents PARAMS ((bfd *)); static boolean tic30_aout_set_sizes PARAMS ((bfd *)); +static const bfd_target * tic30_aout_callback PARAMS ((bfd *)); +static boolean MY_bfd_copy_private_section_data PARAMS ((bfd *, asection *, bfd *, asection *)); +static boolean MY_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); +reloc_howto_type * tic30_aout_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); +enum machine_type tic30_aout_machine_type PARAMS ((enum bfd_architecture, unsigned long, boolean *)); +boolean tic30_aout_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); #define MY_reloc_howto(BFD,REL,IN,EX,PC) tic30_aout_reloc_howto(BFD,REL,&IN,&EX,&PC) #define MY_final_link_relocate tic30_aout_final_link_relocate @@ -130,26 +136,27 @@ static CONST struct aout_backend_data ti 2) to get the 32-bit addresses in the format the TMS320C30 likes it. */ reloc_howto_type tic30_aout_howto_table[] = -{ - EMPTY_HOWTO (-1), - HOWTO (1, 2, 1, 16, false, 0, 0, tic30_aout_fix_16, - "16", false, 0x0000FFFF, 0x0000FFFF, false), - HOWTO (2, 2, 2, 24, false, 0, complain_overflow_bitfield, NULL, - "24", false, 0x00FFFFFF, 0x00FFFFFF, false), - HOWTO (3, 18, 3, 24, false, 0, complain_overflow_bitfield, NULL, - "LDP", false, 0x00FF0000, 0x000000FF, false), - HOWTO (4, 2, 4, 32, false, 0, complain_overflow_bitfield, tic30_aout_fix_32, - "32", false, 0xFFFFFFFF, 0xFFFFFFFF, false), - HOWTO (5, 2, 1, 16, true, 0, complain_overflow_signed, - tic30_aout_fix_pcrel_16, "PCREL", true, 0x0000FFFF, 0x0000FFFF, true), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1) -}; + { + EMPTY_HOWTO (-1), + HOWTO (1, 2, 1, 16, false, 0, 0, tic30_aout_fix_16, + "16", false, 0x0000FFFF, 0x0000FFFF, false), + HOWTO (2, 2, 2, 24, false, 0, complain_overflow_bitfield, NULL, + "24", false, 0x00FFFFFF, 0x00FFFFFF, false), + HOWTO (3, 18, 3, 24, false, 0, complain_overflow_bitfield, NULL, + "LDP", false, 0x00FF0000, 0x000000FF, false), + HOWTO (4, 2, 4, 32, false, 0, complain_overflow_bitfield, tic30_aout_fix_32, + "32", false, 0xFFFFFFFF, 0xFFFFFFFF, false), + HOWTO (5, 2, 1, 16, true, 0, complain_overflow_signed, + tic30_aout_fix_pcrel_16, "PCREL", true, 0x0000FFFF, 0x0000FFFF, true), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1) + }; -extern reloc_howto_type *NAME (aout, reloc_type_lookup) (); +extern reloc_howto_type *NAME (aout, reloc_type_lookup) + PARAMS ((bfd *, bfd_reloc_code_real_type)); reloc_howto_type * tic30_aout_reloc_type_lookup (abfd, code) @@ -317,10 +324,10 @@ tic30_aout_callback (abfd) unsigned int arch_align_power; unsigned long arch_align; - /* Calculate the file positions of the parts of a newly read aout header */ + /* Calculate the file positions of the parts of a newly read aout header. */ obj_textsec (abfd)->_raw_size = N_TXTSIZE (*execp); - /* The virtual memory addresses of the sections */ + /* The virtual memory addresses of the sections. */ obj_textsec (abfd)->vma = N_TXTADDR (*execp); obj_datasec (abfd)->vma = N_DATADDR (*execp); obj_bsssec (abfd)->vma = N_BSSADDR (*execp); @@ -329,11 +336,11 @@ tic30_aout_callback (abfd) obj_datasec (abfd)->lma = obj_datasec (abfd)->vma; obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma; - /* The file offsets of the sections */ + /* The file offsets of the sections. */ obj_textsec (abfd)->filepos = N_TXTOFF (*execp); obj_datasec (abfd)->filepos = N_DATOFF (*execp); - /* The file offsets of the relocation info */ + /* The file offsets of the relocation info. */ obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp); obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp); @@ -429,7 +436,9 @@ tic30_aout_relocate_contents (howto, inp x = bfd_get_32 (input_bfd, location); break; } + overflow = false; + if (howto->complain_on_overflow != complain_overflow_dont) { bfd_vma check; @@ -520,14 +529,14 @@ tic30_aout_relocate_contents (howto, inp return overflow ? bfd_reloc_overflow : bfd_reloc_ok; } -/* Finish up the reading of an a.out file header */ +/* Finish up the reading of an a.out file header. */ static const bfd_target * tic30_aout_object_p (abfd) bfd *abfd; { - struct external_exec exec_bytes; /* Raw exec header from file */ - struct internal_exec exec; /* Cleaned-up exec header */ + struct external_exec exec_bytes; /* Raw exec header from file. */ + struct internal_exec exec; /* Cleaned-up exec header. */ const bfd_target *target; if (bfd_read ((PTR) & exec_bytes, 1, EXEC_BYTES_SIZE, abfd) @@ -562,10 +571,10 @@ tic30_aout_object_p (abfd) #ifdef ENTRY_CAN_BE_ZERO /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage) - * means that it isn't obvious if EXEC_P should be set. - * All of the following must be true for an executable: - * There must be no relocations, the bfd can be neither an - * archive nor an archive element, and the file must be executable. */ + means that it isn't obvious if EXEC_P should be set. + All of the following must be true for an executable: + There must be no relocations, the bfd can be neither an + archive nor an archive element, and the file must be executable. */ if (exec.a_trsize + exec.a_drsize == 0 && bfd_get_format (abfd) == bfd_object && abfd->my_archive == NULL) @@ -614,8 +623,9 @@ tic30_aout_write_object_contents (abfd) obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; { - bfd_size_type text_size; /* dummy vars */ + bfd_size_type text_size; /* Dummy vars. */ file_ptr text_end; + if (adata (abfd).magic == undecided_magic) NAME (aout, adjust_sizes_and_vmas) (abfd, &text_size, &text_end); @@ -633,8 +643,8 @@ tic30_aout_write_object_contents (abfd) if (bfd_write ((PTR) & exec_bytes, 1, adata (abfd).exec_bytes_size, abfd) != adata (abfd).exec_bytes_size) return false; } - /* Now write out reloc info, followed by syms and strings */ + /* Now write out reloc info, followed by syms and strings. */ if (bfd_get_outsymbols (abfd) != (asymbol **) NULL && bfd_get_symcount (abfd) != 0) { @@ -745,10 +755,10 @@ MY_bfd_final_link (abfd, info) { obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4); } + if (obj_datasec (abfd)->vma < vma) - { - obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4); - } + obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4); + obj_datasec (abfd)->user_set_vma = 1; vma = obj_datasec (abfd)->vma; obj_datasec (abfd)->filepos = vma + adata (abfd).exec_bytes_size; diff -uprN binutils-2.11.90.0.27/bfd/aoutf1.h binutils-2.11.90.0.29/bfd/aoutf1.h --- binutils-2.11.90.0.27/bfd/aoutf1.h Fri Mar 9 11:15:25 2001 +++ binutils-2.11.90.0.29/bfd/aoutf1.h Mon Aug 27 11:44:50 2001 @@ -259,7 +259,7 @@ sunos_write_object_contents (abfd) N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags); - N_SET_DYNAMIC (*execp, bfd_get_file_flags (abfd) & DYNAMIC); + N_SET_DYNAMIC (*execp, (long)(bfd_get_file_flags (abfd) & DYNAMIC)); WRITE_HEADERS (abfd, execp); diff -uprN binutils-2.11.90.0.27/bfd/aoutx.h binutils-2.11.90.0.29/bfd/aoutx.h --- binutils-2.11.90.0.27/bfd/aoutx.h Tue Jun 19 11:57:32 2001 +++ binutils-2.11.90.0.29/bfd/aoutx.h Mon Aug 27 11:44:50 2001 @@ -139,6 +139,7 @@ static boolean translate_to_native_sym_f static void adjust_o_magic PARAMS ((bfd *, struct internal_exec *)); static void adjust_z_magic PARAMS ((bfd *, struct internal_exec *)); static void adjust_n_magic PARAMS ((bfd *, struct internal_exec *)); +reloc_howto_type * NAME(aout,reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); /* SUBSECTION @@ -2553,7 +2554,7 @@ NAME(aout,get_symtab_upper_bound) (abfd) return (bfd_get_symcount (abfd)+1) * (sizeof (aout_symbol_type *)); } - alent * +alent * NAME(aout,get_lineno) (ignore_abfd, ignore_symbol) bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *ignore_symbol ATTRIBUTE_UNUSED; @@ -2589,8 +2590,8 @@ NAME(aout,get_symbol_info) (ignore_abfd, } void -NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +NAME(aout,print_symbol) (abfd, afile, symbol, how) + bfd *abfd; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -2611,7 +2612,7 @@ NAME(aout,print_symbol) (ignore_abfd, af { CONST char *section_name = symbol->section->name; - bfd_print_symbol_vandf((PTR)file,symbol); + bfd_print_symbol_vandf (abfd, (PTR)file, symbol); fprintf (file," %-5s %04x %02x %02x", section_name, diff -uprN binutils-2.11.90.0.27/bfd/archive.c binutils-2.11.90.0.29/bfd/archive.c --- binutils-2.11.90.0.27/bfd/archive.c Fri Mar 9 11:15:26 2001 +++ binutils-2.11.90.0.29/bfd/archive.c Wed Aug 22 08:52:09 2001 @@ -142,12 +142,6 @@ extern int errno; #define BFD_GNU960_ARMAG(abfd) (BFD_COFF_FILE_P((abfd)) ? ARMAG : ARMAGB) #endif -/* Define offsetof for those systems which lack it */ - -#ifndef offsetof -#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) -#endif - /* We keep a cache of archive filepointers to archive elements to speed up searching the archive by filepos. We only add an entry to the cache when we actually read one. We also don't sort the cache; @@ -684,15 +678,19 @@ bfd_generic_archive_p (abfd) if (bfd_check_format (first, bfd_object) && first->xvec != abfd->xvec) { +#if 0 + /* We ought to close `first' here, but we can't, because + we have no way to remove it from the archive cache. + It's close to impossible to figure out when we can + release bfd_ardata. FIXME. */ (void) bfd_close (first); bfd_release (abfd, bfd_ardata (abfd)); abfd->tdata.aout_ar_data = tdata_hold; - bfd_set_error (bfd_error_wrong_format); +#endif + bfd_set_error (bfd_error_wrong_object_format); return NULL; } - - /* We ought to close first here, but we can't, because we - have no way to remove it from the archive cache. FIXME. */ + /* And we ought to close `first' here too. */ } } diff -uprN binutils-2.11.90.0.27/bfd/bfd-in.h binutils-2.11.90.0.29/bfd/bfd-in.h --- binutils-2.11.90.0.27/bfd/bfd-in.h Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/bfd-in.h Wed Aug 22 08:52:09 2001 @@ -52,9 +52,16 @@ extern "C" { #include "ansidecl.h" -/* These two lines get substitutions done by commands in Makefile.in. */ #define BFD_VERSION "@VERSION@" + +/* The word size used by BFD on the host. This may be 64 with a 32 + bit target if the host is 64 bit, or if other 64 bit targets have + been selected with --enable-targets, or if --enable-64-bit-bfd. */ #define BFD_ARCH_SIZE @wordsize@ + +/* The word size of the default bfd target. */ +#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ + #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ #if @BFD_HOST_64_BIT_DEFINED@ #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@ diff -uprN binutils-2.11.90.0.27/bfd/bfd-in2.h binutils-2.11.90.0.29/bfd/bfd-in2.h --- binutils-2.11.90.0.27/bfd/bfd-in2.h Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/bfd-in2.h Mon Aug 27 11:44:50 2001 @@ -52,9 +52,16 @@ extern "C" { #include "ansidecl.h" -/* These two lines get substitutions done by commands in Makefile.in. */ #define BFD_VERSION "@VERSION@" + +/* The word size used by BFD on the host. This may be 64 with a 32 + bit target if the host is 64 bit, or if other 64 bit targets have + been selected with --enable-targets, or if --enable-64-bit-bfd. */ #define BFD_ARCH_SIZE @wordsize@ + +/* The word size of the default bfd target. */ +#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ + #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ #if @BFD_HOST_64_BIT_DEFINED@ #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@ @@ -1863,10 +1870,12 @@ The 24-bit relocation is used in some In BFD_RELOC_HI16_GOTOFF, BFD_RELOC_HI16_S_GOTOFF, BFD_RELOC_8_GOTOFF, + BFD_RELOC_64_PLT_PCREL, BFD_RELOC_32_PLT_PCREL, BFD_RELOC_24_PLT_PCREL, BFD_RELOC_16_PLT_PCREL, BFD_RELOC_8_PLT_PCREL, + BFD_RELOC_64_PLTOFF, BFD_RELOC_32_PLTOFF, BFD_RELOC_16_PLTOFF, BFD_RELOC_LO16_PLTOFF, @@ -2176,6 +2185,29 @@ to compensate for the borrow when the lo BFD_RELOC_PPC_EMB_RELST_HA, BFD_RELOC_PPC_EMB_BIT_FLD, BFD_RELOC_PPC_EMB_RELSDA, + BFD_RELOC_PPC64_HIGHER, + BFD_RELOC_PPC64_HIGHER_S, + BFD_RELOC_PPC64_HIGHEST, + BFD_RELOC_PPC64_HIGHEST_S, + BFD_RELOC_PPC64_TOC16_LO, + BFD_RELOC_PPC64_TOC16_HI, + BFD_RELOC_PPC64_TOC16_HA, + BFD_RELOC_PPC64_TOC, + BFD_RELOC_PPC64_PLTGOT16 , + BFD_RELOC_PPC64_PLTGOT16_LO, + BFD_RELOC_PPC64_PLTGOT16_HI, + BFD_RELOC_PPC64_PLTGOT16_HA, + BFD_RELOC_PPC64_ADDR16_DS, + BFD_RELOC_PPC64_ADDR16_LO_DS, + BFD_RELOC_PPC64_GOT16_DS, + BFD_RELOC_PPC64_GOT16_LO_DS, + BFD_RELOC_PPC64_PLT16_LO_DS, + BFD_RELOC_PPC64_SECTOFF_DS, + BFD_RELOC_PPC64_SECTOFF_LO_DS, + BFD_RELOC_PPC64_TOC16_DS, + BFD_RELOC_PPC64_TOC16_LO_DS, + BFD_RELOC_PPC64_PLTGOT16_DS, + BFD_RELOC_PPC64_PLTGOT16_LO_DS, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -2938,7 +2970,7 @@ boolean bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count)); void -bfd_print_symbol_vandf PARAMS ((PTR file, asymbol *symbol)); +bfd_print_symbol_vandf PARAMS ((bfd *abfd, PTR file, asymbol *symbol)); #define bfd_make_empty_symbol(abfd) \ BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) @@ -3122,6 +3154,7 @@ typedef enum bfd_error bfd_error_system_call, bfd_error_invalid_target, bfd_error_wrong_format, + bfd_error_wrong_object_format, bfd_error_invalid_operation, bfd_error_no_memory, bfd_error_no_symbols, @@ -3194,11 +3227,11 @@ bfd_get_mtime PARAMS ((bfd *abfd)); long bfd_get_size PARAMS ((bfd *abfd)); -int +unsigned int bfd_get_gp_size PARAMS ((bfd *abfd)); void -bfd_set_gp_size PARAMS ((bfd *abfd, int i)); +bfd_set_gp_size PARAMS ((bfd *abfd, unsigned int i)); bfd_vma bfd_scan_vma PARAMS ((const char *string, const char **end, int base)); @@ -3288,6 +3321,9 @@ extern bfd_byte *bfd_get_relocated_secti struct bfd_link_order *, bfd_byte *, boolean, asymbol **)); +boolean +bfd_alt_mach_code PARAMS ((bfd *abfd, int index)); + symindex bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym)); @@ -3627,7 +3663,7 @@ bfd_check_format_matches PARAMS ((bfd *a boolean bfd_set_format PARAMS ((bfd *abfd, bfd_format format)); -CONST char * +const char * bfd_format_string PARAMS ((bfd_format format)); #ifdef __cplusplus diff -uprN binutils-2.11.90.0.27/bfd/bfd.c binutils-2.11.90.0.29/bfd/bfd.c --- binutils-2.11.90.0.27/bfd/bfd.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/bfd.c Mon Aug 27 11:44:50 2001 @@ -248,6 +248,7 @@ CODE_FRAGMENT . bfd_error_system_call, . bfd_error_invalid_target, . bfd_error_wrong_format, +. bfd_error_wrong_object_format, . bfd_error_invalid_operation, . bfd_error_no_memory, . bfd_error_no_symbols, @@ -275,6 +276,7 @@ const char *const bfd_errmsgs[] = N_("System call error"), N_("Invalid bfd target"), N_("File in wrong format"), + N_("Archive object file in wrong format"), N_("Invalid operation"), N_("Memory exhausted"), N_("No symbols"), @@ -889,7 +891,7 @@ FUNCTION bfd_get_gp_size SYNOPSIS - int bfd_get_gp_size(bfd *abfd); + unsigned int bfd_get_gp_size(bfd *abfd); DESCRIPTION Return the maximum size of objects to be optimized using the GP @@ -897,7 +899,7 @@ DESCRIPTION argument to the compiler, assembler or linker. */ -int +unsigned int bfd_get_gp_size (abfd) bfd *abfd; { @@ -916,7 +918,7 @@ FUNCTION bfd_set_gp_size SYNOPSIS - void bfd_set_gp_size(bfd *abfd, int i); + void bfd_set_gp_size(bfd *abfd, unsigned int i); DESCRIPTION Set the maximum size of objects to be optimized using the GP @@ -927,7 +929,7 @@ DESCRIPTION void bfd_set_gp_size (abfd, i) bfd *abfd; - int i; + unsigned int i; { /* Don't try to set GP size on an archive or core file! */ if (abfd->format != bfd_object) @@ -1270,7 +1272,7 @@ bfd_sprintf_vma (abfd, buf, value) bfd_vma value; { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) - bfd_elf_sprintf_vma (abfd, buf, value); + get_elf_backend_data (abfd)->elf_backend_sprintf_vma (abfd, buf, value); else sprintf_vma (buf, value); } @@ -1282,7 +1284,62 @@ bfd_fprintf_vma (abfd, stream, value) bfd_vma value; { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) - bfd_elf_fprintf_vma (abfd, stream, value); + get_elf_backend_data (abfd)->elf_backend_fprintf_vma (abfd, stream, value); else fprintf_vma ((FILE *) stream, value); } + +/* +FUNCTION + bfd_alt_mach_code + +SYNOPSIS + boolean bfd_alt_mach_code(bfd *abfd, int index); + +DESCRIPTION + + When more than one machine code number is available for the + same machine type, this function can be used to switch between + the preferred one (index == 0) and any others. Currently, + only ELF supports this feature, with up to two alternate + machine codes. +*/ + +boolean +bfd_alt_mach_code (abfd, index) + bfd *abfd; + int index; +{ + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + { + int code; + + switch (index) + { + case 0: + code = get_elf_backend_data (abfd)->elf_machine_code; + break; + + case 1: + code = get_elf_backend_data (abfd)->elf_machine_alt1; + if (code == 0) + return false; + break; + + case 2: + code = get_elf_backend_data (abfd)->elf_machine_alt2; + if (code == 0) + return false; + break; + + default: + return false; + } + + elf_elfheader (abfd)->e_machine = code; + + return true; + } + + return false; +} diff -uprN binutils-2.11.90.0.27/bfd/bout.c binutils-2.11.90.0.29/bfd/bout.c --- binutils-2.11.90.0.27/bfd/bout.c Sat May 12 00:57:53 2001 +++ binutils-2.11.90.0.29/bfd/bout.c Mon Aug 27 11:44:50 2001 @@ -1,6 +1,6 @@ /* BFD back-end for Intel 960 b.out binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000 + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -28,30 +28,32 @@ Foundation, Inc., 59 Temple Place - Suit #include "bout.h" #include "aout/stab_gnu.h" -#include "libaout.h" /* BFD a.out internal data structures */ +#include "libaout.h" /* BFD a.out internal data structures. */ -static int aligncode PARAMS ((bfd *abfd, asection *input_section, - arelent *r, unsigned int shrink)); -static void perform_slip PARAMS ((bfd *abfd, unsigned int slip, - asection *input_section, bfd_vma value)); -static boolean b_out_squirt_out_relocs PARAMS ((bfd *abfd, asection *section)); -static const bfd_target *b_out_callback PARAMS ((bfd *)); -static bfd_reloc_status_type calljx_callback - PARAMS ((bfd *, struct bfd_link_info *, arelent *, PTR src, PTR dst, - asection *)); -static bfd_reloc_status_type callj_callback - PARAMS ((bfd *, struct bfd_link_info *, arelent *, PTR data, - unsigned int srcidx, unsigned int dstidx, asection *, boolean)); -static bfd_vma get_value PARAMS ((arelent *, struct bfd_link_info *, - asection *)); -static int abs32code PARAMS ((bfd *, asection *, arelent *, - unsigned int, struct bfd_link_info *)); -static boolean b_out_bfd_relax_section PARAMS ((bfd *, asection *, - struct bfd_link_info *, - boolean *)); -static bfd_byte *b_out_bfd_get_relocated_section_contents - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, boolean, asymbol **)); +static int aligncode PARAMS ((bfd *abfd, asection *input_section, arelent *r, unsigned int shrink)); +static void perform_slip PARAMS ((bfd *abfd, unsigned int slip, asection *input_section, bfd_vma value)); +static boolean b_out_squirt_out_relocs PARAMS ((bfd *abfd, asection *section)); +static const bfd_target * b_out_callback PARAMS ((bfd *)); +static bfd_reloc_status_type calljx_callback PARAMS ((bfd *, struct bfd_link_info *, arelent *, PTR src, PTR dst, asection *)); +static bfd_reloc_status_type callj_callback PARAMS ((bfd *, struct bfd_link_info *, arelent *, PTR data, unsigned int srcidx, unsigned int dstidx, asection *, boolean)); +static bfd_vma get_value PARAMS ((arelent *, struct bfd_link_info *, asection *)); +static int abs32code PARAMS ((bfd *, asection *, arelent *, unsigned int, struct bfd_link_info *)); +static boolean b_out_bfd_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); +static bfd_byte * b_out_bfd_get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, boolean, asymbol **)); +static int b_out_sizeof_headers PARAMS ((bfd *, boolean)); +static boolean b_out_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); +static boolean b_out_set_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); +static long b_out_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); +static long b_out_canonicalize_reloc PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); +static boolean b_out_slurp_reloc_table PARAMS ((bfd *, sec_ptr, asymbol **)); +static reloc_howto_type * b_out_bfd_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); +static boolean b_out_write_object_contents PARAMS ((bfd *)); +static int b_out_symbol_cmp PARAMS ((const void *, const void *)); +static boolean b_out_mkobject PARAMS ((bfd *)); +static const bfd_target * b_out_object_p PARAMS ((bfd *)); + +void bout_swap_exec_header_in PARAMS ((bfd *, struct external_exec *, struct internal_exec *)); +void bout_swap_exec_header_out PARAMS ((bfd *, struct internal_exec *, struct external_exec *)); /* Swaps the information in an executable header taken from a raw byte stream memory image, into the internal exec_header structure. */ @@ -84,10 +86,6 @@ bout_swap_exec_header_in (abfd, raw_byte /* Swaps the information in an internal exec header structure into the supplied buffer ready for writing to disk. */ -PROTO(void, bout_swap_exec_header_out, - (bfd *abfd, - struct internal_exec *execp, - struct external_exec *raw_bytes)); void bout_swap_exec_header_out (abfd, execp, raw_bytes) bfd *abfd; @@ -121,18 +119,20 @@ b_out_object_p (abfd) struct external_exec exec_bytes; if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd) - != EXEC_BYTES_SIZE) { - if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return 0; - } + != EXEC_BYTES_SIZE) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return 0; + } anexec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info); - if (N_BADMAG (anexec)) { - bfd_set_error (bfd_error_wrong_format); - return 0; - } + if (N_BADMAG (anexec)) + { + bfd_set_error (bfd_error_wrong_format); + return 0; + } bout_swap_exec_header_in (abfd, &exec_bytes, &anexec); return aout_32_some_aout_object_p (abfd, &anexec, b_out_callback); @@ -148,7 +148,7 @@ b_out_callback (abfd) struct internal_exec *execp = exec_hdr (abfd); unsigned long bss_start; - /* Architecture and machine type */ + /* Architecture and machine type. */ bfd_set_arch_mach(abfd, bfd_arch_i960, /* B.out only used on i960 */ bfd_mach_i960_core /* Default */ @@ -158,7 +158,7 @@ b_out_callback (abfd) obj_str_filepos (abfd) = N_STROFF (*execp); obj_sym_filepos (abfd) = N_SYMOFF (*execp); - /* The alignments of the sections */ + /* The alignments of the sections. */ obj_textsec (abfd)->alignment_power = execp->a_talign; obj_datasec (abfd)->alignment_power = execp->a_dalign; obj_bsssec (abfd)->alignment_power = execp->a_balign; @@ -170,7 +170,7 @@ b_out_callback (abfd) obj_textsec (abfd)->lma = obj_textsec (abfd)->vma; obj_datasec (abfd)->lma = obj_datasec (abfd)->vma; - /* And reload the sizes, since the aout module zaps them */ + /* And reload the sizes, since the aout module zaps them. */ obj_textsec (abfd)->_raw_size = execp->a_text; bss_start = execp->a_dload + execp->a_data; /* BSS = end of data section */ @@ -178,11 +178,11 @@ b_out_callback (abfd) obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma; - /* The file positions of the sections */ + /* The file positions of the sections. */ obj_textsec (abfd)->filepos = N_TXTOFF(*execp); obj_datasec (abfd)->filepos = N_DATOFF(*execp); - /* The file positions of the relocation info */ + /* The file positions of the relocation info. */ obj_textsec (abfd)->rel_filepos = N_TROFF(*execp); obj_datasec (abfd)->rel_filepos = N_DROFF(*execp); @@ -195,10 +195,11 @@ b_out_callback (abfd) return abfd->xvec; } -struct bout_data_struct { +struct bout_data_struct + { struct aoutdata a; struct internal_exec e; -}; + }; static boolean b_out_mkobject (abfd) @@ -221,13 +222,16 @@ b_out_mkobject (abfd) } static int -b_out_symbol_cmp (a, b) - struct aout_symbol **a, **b; +b_out_symbol_cmp (a_ptr, b_ptr) + const void * a_ptr; + const void * b_ptr; { + struct aout_symbol ** a = (struct aout_symbol **) a_ptr; + struct aout_symbol ** b = (struct aout_symbol **) b_ptr; asection *sec; bfd_vma av, bv; - /* Primary key is address */ + /* Primary key is address. */ sec = bfd_get_section (&(*a)->symbol); av = sec->output_section->vma + sec->output_offset + (*a)->symbol.value; sec = bfd_get_section (&(*b)->symbol); @@ -310,7 +314,6 @@ b_out_write_object_contents (abfd) qsort (outsyms, q - outsyms, sizeof (asymbol*), b_out_symbol_cmp); /* Back to your regularly scheduled program. */ - if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*exec_hdr(abfd))), SEEK_SET) != 0) return false; @@ -331,10 +334,10 @@ b_out_write_object_contents (abfd) return true; } -/** Some reloc hackery */ +/* Some reloc hackery. */ #define CALLS 0x66003800 /* Template for 'calls' instruction */ -#define BAL 0x0b000000 /* Template for 'bal' instruction */ +#define BAL 0x0b000000 /* Template for 'bal' instruction */ #define BAL_MASK 0x00ffffff #define BALX 0x85f00000 /* Template for 'balx' instruction */ #define BALX_MASK 0x0007ffff @@ -343,7 +346,8 @@ b_out_write_object_contents (abfd) #define output_addr(sec) ((sec)->output_offset+(sec)->output_section->vma) -/* Magic to turn callx into calljx */ +/* Magic to turn callx into calljx. */ + static bfd_reloc_status_type calljx_callback (abfd, link_info, reloc_entry, src, dst, input_section) bfd *abfd; @@ -364,7 +368,7 @@ calljx_callback (abfd, link_info, reloc_ { aout_symbol_type *balsym = symbol+1; int inst = bfd_get_32 (abfd, (bfd_byte *) src-4); - /* The next symbol should be an N_BALNAME */ + /* The next symbol should be an N_BALNAME. */ BFD_ASSERT (IS_BALNAME (balsym->other)); inst &= BALX_MASK; inst |= BALX; @@ -380,7 +384,8 @@ calljx_callback (abfd, link_info, reloc_ return bfd_reloc_ok; } -/* Magic to turn call into callj */ +/* Magic to turn call into callj. */ + static bfd_reloc_status_type callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx, input_section, shrinking) @@ -506,7 +511,7 @@ b_out_bfd_reloc_type_lookup (abfd, code) } } -/* Allocate enough room for all the reloc entries, plus pointers to them all */ +/* Allocate enough room for all the reloc entries, plus pointers to them all. */ static boolean b_out_slurp_reloc_table (abfd, asect, symbols) @@ -528,23 +533,27 @@ b_out_slurp_reloc_table (abfd, asect, sy if (asect->relocation) return true; + if (!aout_32_slurp_symbol_table (abfd)) return false; - if (asect == obj_datasec (abfd)) { - reloc_size = exec_hdr(abfd)->a_drsize; - goto doit; - } + if (asect == obj_datasec (abfd)) + { + reloc_size = exec_hdr(abfd)->a_drsize; + goto doit; + } - if (asect == obj_textsec (abfd)) { - reloc_size = exec_hdr(abfd)->a_trsize; - goto doit; - } + if (asect == obj_textsec (abfd)) + { + reloc_size = exec_hdr(abfd)->a_trsize; + goto doit; + } - if (asect == obj_bsssec (abfd)) { - reloc_size = 0; - goto doit; - } + if (asect == obj_bsssec (abfd)) + { + reloc_size = 0; + goto doit; + } bfd_set_error (bfd_error_invalid_operation); return false; @@ -557,37 +566,43 @@ b_out_slurp_reloc_table (abfd, asect, sy relocs = (struct relocation_info *) bfd_malloc (reloc_size); if (!relocs && reloc_size != 0) return false; + reloc_cache = (arelent *) bfd_malloc ((count+1) * sizeof (arelent)); - if (!reloc_cache) { - if (relocs != NULL) - free ((char*)relocs); - return false; - } + if (!reloc_cache) + { + if (relocs != NULL) + free ((char*)relocs); + return false; + } - if (bfd_read ((PTR) relocs, 1, reloc_size, abfd) != reloc_size) { - free (reloc_cache); - if (relocs != NULL) - free (relocs); - return false; - } + if (bfd_read ((PTR) relocs, 1, reloc_size, abfd) != reloc_size) + { + free (reloc_cache); + if (relocs != NULL) + free (relocs); + return false; + } - if (bfd_header_big_endian (abfd)) { - /* big-endian bit field allocation order */ - pcrel_mask = 0x80; - extern_mask = 0x10; - incode_mask = 0x08; - callj_mask = 0x02; - size_mask = 0x20; - length_shift = 5; - } else { - /* little-endian bit field allocation order */ - pcrel_mask = 0x01; - extern_mask = 0x08; - incode_mask = 0x10; - callj_mask = 0x40; - size_mask = 0x02; - length_shift = 1; - } + if (bfd_header_big_endian (abfd)) + { + /* Big-endian bit field allocation order. */ + pcrel_mask = 0x80; + extern_mask = 0x10; + incode_mask = 0x08; + callj_mask = 0x02; + size_mask = 0x20; + length_shift = 5; + } + else + { + /* Little-endian bit field allocation order. */ + pcrel_mask = 0x01; + extern_mask = 0x08; + incode_mask = 0x10; + callj_mask = 0x40; + size_mask = 0x02; + length_shift = 1; + } for (rptr = relocs, cache_ptr = reloc_cache, counter = 0; counter < count; @@ -595,129 +610,124 @@ b_out_slurp_reloc_table (abfd, asect, sy { unsigned char *raw = (unsigned char *)rptr; unsigned int symnum; + cache_ptr->address = bfd_h_get_32 (abfd, raw + 0); cache_ptr->howto = 0; + if (bfd_header_big_endian (abfd)) - { symnum = (raw[4] << 16) | (raw[5] << 8) | raw[6]; - } else - { symnum = (raw[6] << 16) | (raw[5] << 8) | raw[4]; - } if (raw[7] & extern_mask) - { - /* if this is set then the r_index is a index into the symbol table; - * if the bit is not set then r_index contains a section map. - * we either fill in the sym entry with a pointer to the symbol, - * or point to the correct section - */ + { + /* If this is set then the r_index is a index into the symbol table; + if the bit is not set then r_index contains a section map. + We either fill in the sym entry with a pointer to the symbol, + or point to the correct section. */ cache_ptr->sym_ptr_ptr = symbols + symnum; cache_ptr->addend = 0; - } else - { - /* in a.out symbols are relative to the beginning of the - * file rather than sections ? - * (look in translate_from_native_sym_flags) - * the reloc entry addend has added to it the offset into the - * file of the data, so subtract the base to make the reloc - * section relative */ - int s; + } + else { - /* sign-extend symnum from 24 bits to whatever host uses */ + /* In a.out symbols are relative to the beginning of the + file rather than sections ? + (look in translate_from_native_sym_flags) + The reloc entry addend has added to it the offset into the + file of the data, so subtract the base to make the reloc + section relative. */ + int s; + + /* Sign-extend symnum from 24 bits to whatever host uses. */ s = symnum; if (s & (1 << 23)) s |= (~0) << 24; - } - cache_ptr->sym_ptr_ptr = (asymbol **)NULL; - switch (s) - { - case N_TEXT: - case N_TEXT | N_EXT: - cache_ptr->sym_ptr_ptr = obj_textsec(abfd)->symbol_ptr_ptr; - cache_ptr->addend = - obj_textsec(abfd)->vma; - break; - case N_DATA: - case N_DATA | N_EXT: - cache_ptr->sym_ptr_ptr = obj_datasec(abfd)->symbol_ptr_ptr; - cache_ptr->addend = - obj_datasec(abfd)->vma; - break; - case N_BSS: - case N_BSS | N_EXT: - cache_ptr->sym_ptr_ptr = obj_bsssec(abfd)->symbol_ptr_ptr; - cache_ptr->addend = - obj_bsssec(abfd)->vma; - break; - case N_ABS: - case N_ABS | N_EXT: - cache_ptr->sym_ptr_ptr = obj_bsssec(abfd)->symbol_ptr_ptr; - cache_ptr->addend = 0; - break; - case -2: /* .align */ - if (raw[7] & pcrel_mask) + + cache_ptr->sym_ptr_ptr = (asymbol **)NULL; + switch (s) { - cache_ptr->howto = &howto_align_table[(raw[7] >> length_shift) & 3]; - cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; + case N_TEXT: + case N_TEXT | N_EXT: + cache_ptr->sym_ptr_ptr = obj_textsec (abfd)->symbol_ptr_ptr; + cache_ptr->addend = - obj_textsec (abfd)->vma; + break; + case N_DATA: + case N_DATA | N_EXT: + cache_ptr->sym_ptr_ptr = obj_datasec (abfd)->symbol_ptr_ptr; + cache_ptr->addend = - obj_datasec (abfd)->vma; + break; + case N_BSS: + case N_BSS | N_EXT: + cache_ptr->sym_ptr_ptr = obj_bsssec (abfd)->symbol_ptr_ptr; + cache_ptr->addend = - obj_bsssec (abfd)->vma; + break; + case N_ABS: + case N_ABS | N_EXT: + cache_ptr->sym_ptr_ptr = obj_bsssec (abfd)->symbol_ptr_ptr; + cache_ptr->addend = 0; + break; + case -2: /* .align */ + if (raw[7] & pcrel_mask) + { + cache_ptr->howto = &howto_align_table[(raw[7] >> length_shift) & 3]; + cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; + } + else + { + /* .org? */ + abort (); + } + cache_ptr->addend = 0; + break; + default: + BFD_ASSERT(0); + break; } - else - { - /* .org? */ - abort (); - } - cache_ptr->addend = 0; - break; - default: - BFD_ASSERT(0); - break; } - } - - /* the i960 only has a few relocation types: + /* The i960 only has a few relocation types: abs 32-bit and pcrel 24bit. except for callj's! */ if (cache_ptr->howto != 0) ; else if (raw[7] & callj_mask) - { - cache_ptr->howto = &howto_reloc_callj; - } + { + cache_ptr->howto = &howto_reloc_callj; + } else if ( raw[7] & pcrel_mask) - { - if (raw[7] & size_mask) - cache_ptr->howto = &howto_reloc_pcrel13; - else - cache_ptr->howto = &howto_reloc_pcrel24; - } - else - { - if (raw[7] & incode_mask) { - cache_ptr->howto = &howto_reloc_abs32code; + if (raw[7] & size_mask) + cache_ptr->howto = &howto_reloc_pcrel13; + else + cache_ptr->howto = &howto_reloc_pcrel24; } - else + else { - cache_ptr->howto = &howto_reloc_abs32; + if (raw[7] & incode_mask) + cache_ptr->howto = &howto_reloc_abs32code; + else + cache_ptr->howto = &howto_reloc_abs32; } - } + if (cache_ptr->address < prev_addr) - { - /* Ouch! this reloc is out of order, insert into the right place - */ - arelent tmp; - arelent *cursor = cache_ptr-1; - bfd_vma stop = cache_ptr->address; - tmp = *cache_ptr; - while (cursor->address > stop && cursor >= reloc_cache) { - cursor[1] = cursor[0]; - cursor--; + /* Ouch! this reloc is out of order, insert into the right place. */ + arelent tmp; + arelent *cursor = cache_ptr-1; + bfd_vma stop = cache_ptr->address; + + tmp = *cache_ptr; + while (cursor->address > stop && cursor >= reloc_cache) + { + cursor[1] = cursor[0]; + cursor--; + } + + cursor[1] = tmp; } - cursor[1] = tmp; - } else - { - prev_addr = cache_ptr->address; - } + { + prev_addr = cache_ptr->address; + } } if (relocs != NULL) @@ -742,131 +752,128 @@ b_out_squirt_out_relocs (abfd, section) struct relocation_info *native, *natptr; size_t natsize = count * sizeof (struct relocation_info); int extern_mask, pcrel_mask, len_2, callj_mask; - if (count == 0) return true; + + if (count == 0) + return true; + generic = section->orelocation; native = ((struct relocation_info *) bfd_malloc (natsize)); if (!native && natsize != 0) return false; if (bfd_header_big_endian (abfd)) - { - /* Big-endian bit field allocation order */ - pcrel_mask = 0x80; - extern_mask = 0x10; - len_2 = 0x40; - len_1 = 0x20; - callj_mask = 0x02; - incode_mask = 0x08; - } - else - { - /* Little-endian bit field allocation order */ - pcrel_mask = 0x01; - extern_mask = 0x08; - len_2 = 0x04; - len_1 = 0x02; - callj_mask = 0x40; - incode_mask = 0x10; - } - - for (natptr = native; count > 0; --count, ++natptr, ++generic) - { - arelent *g = *generic; - unsigned char *raw = (unsigned char *)natptr; - asymbol *sym = *(g->sym_ptr_ptr); - - asection *output_section = sym->section->output_section; - - bfd_h_put_32(abfd, g->address, raw); - /* Find a type in the output format which matches the input howto - - * at the moment we assume input format == output format FIXME!! - */ - r_idx = 0; - /* FIXME: Need callj stuff here, and to check the howto entries to - be sure they are real for this architecture. */ - if (g->howto== &howto_reloc_callj) { - raw[7] = callj_mask + pcrel_mask + len_2; + /* Big-endian bit field allocation order. */ + pcrel_mask = 0x80; + extern_mask = 0x10; + len_2 = 0x40; + len_1 = 0x20; + callj_mask = 0x02; + incode_mask = 0x08; } - else if (g->howto == &howto_reloc_pcrel24) - { - raw[7] = pcrel_mask + len_2; - } - else if (g->howto == &howto_reloc_pcrel13) - { - raw[7] = pcrel_mask + len_1; - } - else if (g->howto == &howto_reloc_abs32code) + else { - raw[7] = len_2 + incode_mask; - } - else if (g->howto >= howto_align_table - && g->howto <= (howto_align_table - + sizeof (howto_align_table) / sizeof (howto_align_table[0]) - - 1)) - { - /* symnum == -2; extern_mask not set, pcrel_mask set */ - r_idx = -2; - r_extern = 0; - raw[7] = (pcrel_mask - | ((g->howto - howto_align_table) << 1)); - } - else { - raw[7] = len_2; + /* Little-endian bit field allocation order. */ + pcrel_mask = 0x01; + extern_mask = 0x08; + len_2 = 0x04; + len_1 = 0x02; + callj_mask = 0x40; + incode_mask = 0x10; } - if (r_idx != 0) - /* already mucked with r_extern, r_idx */; - else if (bfd_is_com_section (output_section) - || bfd_is_abs_section (output_section) - || bfd_is_und_section (output_section)) + for (natptr = native; count > 0; --count, ++natptr, ++generic) { + arelent *g = *generic; + unsigned char *raw = (unsigned char *)natptr; + asymbol *sym = *(g->sym_ptr_ptr); + asection *output_section = sym->section->output_section; + + bfd_h_put_32(abfd, g->address, raw); + /* Find a type in the output format which matches the input howto - + at the moment we assume input format == output format FIXME!! */ + r_idx = 0; + /* FIXME: Need callj stuff here, and to check the howto entries to + be sure they are real for this architecture. */ + if (g->howto== &howto_reloc_callj) + raw[7] = callj_mask + pcrel_mask + len_2; + else if (g->howto == &howto_reloc_pcrel24) + raw[7] = pcrel_mask + len_2; + else if (g->howto == &howto_reloc_pcrel13) + raw[7] = pcrel_mask + len_1; + else if (g->howto == &howto_reloc_abs32code) + raw[7] = len_2 + incode_mask; + else if (g->howto >= howto_align_table + && g->howto <= (howto_align_table + + sizeof (howto_align_table) / sizeof (howto_align_table[0]) + - 1)) + { + /* symnum == -2; extern_mask not set, pcrel_mask set. */ + r_idx = -2; + r_extern = 0; + raw[7] = (pcrel_mask + | ((g->howto - howto_align_table) << 1)); + } + else + raw[7] = len_2; - if (bfd_abs_section_ptr->symbol == sym) - { - /* Whoops, looked like an abs symbol, but is really an offset - from the abs section */ - r_idx = 0; - r_extern = 0; - } + if (r_idx != 0) + /* Already mucked with r_extern, r_idx. */; + else if (bfd_is_com_section (output_section) + || bfd_is_abs_section (output_section) + || bfd_is_und_section (output_section)) + { + if (bfd_abs_section_ptr->symbol == sym) + { + /* Whoops, looked like an abs symbol, but is really an offset + from the abs section. */ + r_idx = 0; + r_extern = 0; + } + else + { + /* Fill in symbol. */ + r_extern = 1; + r_idx = (*g->sym_ptr_ptr)->udata.i; + } + } else - { - /* Fill in symbol */ + { + /* Just an ordinary section. */ + r_extern = 0; + r_idx = output_section->target_index; + } - r_extern = 1; - r_idx = (*g->sym_ptr_ptr)->udata.i; - } + if (bfd_header_big_endian (abfd)) + { + raw[4] = (unsigned char) (r_idx >> 16); + raw[5] = (unsigned char) (r_idx >> 8); + raw[6] = (unsigned char) (r_idx ); + } + else + { + raw[6] = (unsigned char) (r_idx >> 16); + raw[5] = (unsigned char) (r_idx>> 8); + raw[4] = (unsigned char) (r_idx ); + } + + if (r_extern) + raw[7] |= extern_mask; } - else + + if (bfd_write ((PTR) native, 1, natsize, abfd) != natsize) { - /* Just an ordinary section */ - r_extern = 0; - r_idx = output_section->target_index; - } - - if (bfd_header_big_endian (abfd)) { - raw[4] = (unsigned char) (r_idx >> 16); - raw[5] = (unsigned char) (r_idx >> 8); - raw[6] = (unsigned char) (r_idx ); - } else { - raw[6] = (unsigned char) (r_idx >> 16); - raw[5] = (unsigned char) (r_idx>> 8); - raw[4] = (unsigned char) (r_idx ); + free ((PTR)native); + return false; } - if (r_extern) - raw[7] |= extern_mask; - } - if (bfd_write ((PTR) native, 1, natsize, abfd) != natsize) { - free((PTR)native); - return false; - } free ((PTR)native); return true; } -/* This is stupid. This function should be a boolean predicate */ +/* This is stupid. This function should be a boolean predicate. */ + static long b_out_canonicalize_reloc (abfd, section, relptr, symbols) bfd *abfd; @@ -880,6 +887,7 @@ b_out_canonicalize_reloc (abfd, section, if ((section->flags & SEC_CONSTRUCTOR) != 0) { arelent_chain *chain = section->constructor_chain; + for (count = 0; count < section->reloc_count; count++) { *relptr++ = &chain->relent; @@ -907,10 +915,11 @@ b_out_get_reloc_upper_bound (abfd, asect bfd *abfd; sec_ptr asect; { - if (bfd_get_format (abfd) != bfd_object) { - bfd_set_error (bfd_error_invalid_operation); - return -1; - } + if (bfd_get_format (abfd) != bfd_object) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } if (asect->flags & SEC_CONSTRUCTOR) return sizeof (arelent *) * (asect->reloc_count + 1); @@ -931,6 +940,7 @@ b_out_get_reloc_upper_bound (abfd, asect bfd_set_error (bfd_error_invalid_operation); return -1; } + static boolean b_out_set_section_contents (abfd, section, location, offset, count) @@ -940,23 +950,24 @@ b_out_set_section_contents (abfd, sectio file_ptr offset; bfd_size_type count; { + if (abfd->output_has_begun == false) + { + /* Set by bfd.c handler. */ + if (! aout_32_make_sections (abfd)) + return false; - if (abfd->output_has_begun == false) { /* set by bfd.c handler */ - if (! aout_32_make_sections (abfd)) - return false; - - obj_textsec (abfd)->filepos = sizeof (struct internal_exec); - obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos - + obj_textsec (abfd)->_raw_size; + obj_textsec (abfd)->filepos = sizeof (struct internal_exec); + obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos + + obj_textsec (abfd)->_raw_size; + } - } - /* regardless, once we know what we're doing, we might as well get going */ + /* Regardless, once we know what we're doing, we might as well get going. */ if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0) return false; - if (count != 0) { - return (bfd_write ((PTR)location, 1, count, abfd) == count) ?true:false; - } + if (count != 0) + return (bfd_write ((PTR)location, 1, count, abfd) == count) ? true : false; + return true; } @@ -968,23 +979,25 @@ b_out_set_arch_mach (abfd, arch, machine { bfd_default_set_arch_mach(abfd, arch, machine); - if (arch == bfd_arch_unknown) /* Unknown machine arch is OK */ + if (arch == bfd_arch_unknown) /* Unknown machine arch is OK. */ return true; - if (arch == bfd_arch_i960) /* i960 default is OK */ - switch (machine) { - case bfd_mach_i960_core: - case bfd_mach_i960_kb_sb: - case bfd_mach_i960_mc: - case bfd_mach_i960_xa: - case bfd_mach_i960_ca: - case bfd_mach_i960_ka_sa: - case bfd_mach_i960_jx: - case bfd_mach_i960_hx: - case 0: - return true; - default: - return false; - } + + if (arch == bfd_arch_i960) /* i960 default is OK. */ + switch (machine) + { + case bfd_mach_i960_core: + case bfd_mach_i960_kb_sb: + case bfd_mach_i960_mc: + case bfd_mach_i960_xa: + case bfd_mach_i960_ca: + case bfd_mach_i960_ka_sa: + case bfd_mach_i960_jx: + case bfd_mach_i960_hx: + case 0: + return true; + default: + return false; + } return false; } @@ -996,8 +1009,8 @@ b_out_sizeof_headers (ignore_abfd, ignor { return sizeof (struct internal_exec); } + -/************************************************************************/ static bfd_vma get_value (reloc, link_info, input_section) arelent *reloc; @@ -1009,8 +1022,7 @@ get_value (reloc, link_info, input_secti /* A symbol holds a pointer to a section, and an offset from the base of the section. To relocate, we find where the section will - live in the output and add that in */ - + live in the output and add that in. */ if (bfd_is_und_section (symbol->section)) { struct bfd_link_hash_entry *h; @@ -1045,7 +1057,7 @@ get_value (reloc, link_info, input_secti value = symbol->value + output_addr (symbol->section); } - /* Add the value contained in the relocation */ + /* Add the value contained in the relocation. */ value += reloc->addend; return value; @@ -1064,35 +1076,36 @@ perform_slip (abfd, slip, input_section, BFD_ASSERT (s != (asymbol **) NULL); /* Find all symbols past this point, and make them know - what's happened */ + what's happened. */ while (*s) - { - asymbol *p = *s; - if (p->section == input_section) { - /* This was pointing into this section, so mangle it */ - if (p->value > value) - { - p->value -=slip; - if (p->udata.p != NULL) - { - struct generic_link_hash_entry *h; + asymbol *p = *s; - h = (struct generic_link_hash_entry *) p->udata.p; - BFD_ASSERT (h->root.type == bfd_link_hash_defined); - h->root.u.def.value -= slip; - BFD_ASSERT (h->root.u.def.value == p->value); - } - } - } - s++; + if (p->section == input_section) + { + /* This was pointing into this section, so mangle it. */ + if (p->value > value) + { + p->value -=slip; - } + if (p->udata.p != NULL) + { + struct generic_link_hash_entry *h; + + h = (struct generic_link_hash_entry *) p->udata.p; + BFD_ASSERT (h->root.type == bfd_link_hash_defined); + h->root.u.def.value -= slip; + BFD_ASSERT (h->root.u.def.value == p->value); + } + } + } + s++; + } } /* This routine works out if the thing we want to get to can be reached with a 24bit offset instead of a 32 bit one. - If it can, then it changes the amode */ + If it can, then it changes the amode. */ static int abs32code (abfd, input_section, r, shrink, link_info) @@ -1108,23 +1121,22 @@ abs32code (abfd, input_section, r, shrin /* See if the address we're looking at within 2^23 bytes of where we are, if so then we can use a small branch rather than the - jump we were going to */ - + jump we were going to. */ gap = value - (dot - shrink); - if (-1<<23 < (long)gap && (long)gap < 1<<23 ) - { - /* Change the reloc type from 32bitcode possible 24, to 24bit - possible 32 */ + if (-1 << 23 < (long)gap && (long)gap < 1 << 23) + { + /* Change the reloc type from 32bitcode possible 24, to 24bit + possible 32. */ + r->howto = &howto_reloc_abs32codeshrunk; + /* The place to relc moves back by four bytes. */ + r->address -=4; + + /* This will be four bytes smaller in the long run. */ + shrink += 4 ; + perform_slip (abfd, 4, input_section, r->address-shrink + 4); + } - r->howto = &howto_reloc_abs32codeshrunk; - /* The place to relc moves back by four bytes */ - r->address -=4; - - /* This will be four bytes smaller in the long run */ - shrink += 4 ; - perform_slip (abfd, 4, input_section, r->address-shrink + 4); - } return shrink; } @@ -1146,30 +1158,31 @@ aligncode (abfd, input_section, r, shrin smaller - the current size is already the same size as or bigger than the alignment required. */ - /* calculate the first byte following the padding before we optimize */ + /* Calculate the first byte following the padding before we optimize. */ old_end = ((dot + size ) & ~size) + size+1; - /* work out where the new end will be - remember that we're smaller - than we used to be */ + /* Work out where the new end will be - remember that we're smaller + than we used to be. */ new_end = ((dot - shrink + size) & ~size); - /* This is the new end */ + /* This is the new end. */ gap = old_end - ((dot + size) & ~size); shrink_delta = (old_end - new_end) - shrink; if (shrink_delta) - { - /* Change the reloc so that it knows how far to align to */ - r->howto = howto_done_align_table + (r->howto - howto_align_table); + { + /* Change the reloc so that it knows how far to align to. */ + r->howto = howto_done_align_table + (r->howto - howto_align_table); + + /* Encode the stuff into the addend - for future use we need to + know how big the reloc used to be. */ + r->addend = old_end - dot + r->address; + + /* This will be N bytes smaller in the long run, adjust all the symbols. */ + perform_slip (abfd, shrink_delta, input_section, r->address - shrink); + shrink += shrink_delta; + } - /* Encode the stuff into the addend - for future use we need to - know how big the reloc used to be */ - r->addend = old_end - dot + r->address; - - /* This will be N bytes smaller in the long run, adjust all the symbols */ - perform_slip (abfd, shrink_delta, input_section, r->address - shrink); - shrink += shrink_delta; - } return shrink; } @@ -1180,7 +1193,7 @@ b_out_bfd_relax_section (abfd, i, link_i struct bfd_link_info *link_info; boolean *again; { - /* Get enough memory to hold the stuff */ + /* Get enough memory to hold the stuff. */ bfd *input_bfd = i->owner; asection *input_section = i; int shrink = 0 ; @@ -1203,7 +1216,7 @@ b_out_bfd_relax_section (abfd, i, link_i if (reloc_vector == NULL && reloc_size != 0) goto error_return; - /* Get the relocs and think about them */ + /* Get the relocs and think about them. */ reloc_count = bfd_canonicalize_reloc (input_bfd, input_section, reloc_vector, _bfd_generic_link_get_symbols (input_bfd)); @@ -1212,17 +1225,19 @@ b_out_bfd_relax_section (abfd, i, link_i if (reloc_count > 0) { arelent **parent; + for (parent = reloc_vector; *parent; parent++) { arelent *r = *parent; + switch (r->howto->type) { case ALIGNER: - /* An alignment reloc */ + /* An alignment reloc. */ shrink = aligncode (abfd, input_section, r, shrink); break; case ABS32CODE: - /* A 32bit reloc in an addressing mode */ + /* A 32bit reloc in an addressing mode. */ shrink = abs32code (input_bfd, input_section, r, shrink, link_info); break; @@ -1254,7 +1269,7 @@ b_out_bfd_get_relocated_section_contents boolean relocateable; asymbol **symbols; { - /* Get enough memory to hold the stuff */ + /* Get enough memory to hold the stuff. */ bfd *input_bfd = link_order->u.indirect.section->owner; asection *input_section = link_order->u.indirect.section; long reloc_size = bfd_get_reloc_upper_bound (input_bfd, @@ -1278,7 +1293,7 @@ b_out_bfd_get_relocated_section_contents input_section->reloc_done = 1; - /* read in the section */ + /* Read in the section. */ BFD_ASSERT (true == bfd_get_section_contents (input_bfd, input_section, data, @@ -1295,13 +1310,12 @@ b_out_bfd_get_relocated_section_contents { arelent **parent = reloc_vector; arelent *reloc ; - unsigned int dst_address = 0; unsigned int src_address = 0; unsigned int run; unsigned int idx; - /* Find how long a run we can do */ + /* Find how long a run we can do. */ while (dst_address < link_order->size) { reloc = *parent; @@ -1309,7 +1323,7 @@ b_out_bfd_get_relocated_section_contents { /* Note that the relaxing didn't tie up the addresses in the relocation, so we use the original address to work out the - run of non-relocated data */ + run of non-relocated data. */ BFD_ASSERT (reloc->address >= src_address); run = reloc->address - src_address; parent++; @@ -1318,14 +1332,12 @@ b_out_bfd_get_relocated_section_contents { run = link_order->size - dst_address; } - /* Copy the bytes */ - for (idx = 0; idx < run; idx++) - { - data[dst_address++] = data[src_address++]; - } - /* Now do the relocation */ + /* Copy the bytes. */ + for (idx = 0; idx < run; idx++) + data[dst_address++] = data[src_address++]; + /* Now do the relocation. */ if (reloc) { switch (reloc->howto->type) @@ -1334,23 +1346,23 @@ b_out_bfd_get_relocated_section_contents calljx_callback (input_bfd, link_info, reloc, src_address + data, dst_address + data, input_section); - src_address+=4; - dst_address+=4; + src_address += 4; + dst_address += 4; break; case ABS32: bfd_put_32 (input_bfd, (bfd_get_32 (input_bfd, data + src_address) + get_value (reloc, link_info, input_section)), data + dst_address); - src_address+=4; - dst_address+=4; + src_address += 4; + dst_address += 4; break; case CALLJ: callj_callback (input_bfd, link_info, reloc, data, src_address, dst_address, input_section, false); - src_address+=4; - dst_address+=4; + src_address += 4; + dst_address += 4; break; case ALIGNDONE: BFD_ASSERT (reloc->addend >= src_address); @@ -1365,8 +1377,8 @@ b_out_bfd_get_relocated_section_contents callj_callback (input_bfd, link_info, reloc, data, src_address + 4, dst_address, input_section, true); - dst_address+=4; - src_address+=8; + dst_address += 4; + src_address += 8; break; case PCREL24: { @@ -1383,12 +1395,11 @@ b_out_bfd_get_relocated_section_contents & BAL_MASK)); bfd_put_32 (input_bfd, word, data + dst_address); - dst_address+=4; - src_address+=4; + dst_address += 4; + src_address += 4; } break; - case PCREL13: { long int word = bfd_get_32 (input_bfd, @@ -1404,9 +1415,8 @@ b_out_bfd_get_relocated_section_contents & PCREL13_MASK)); bfd_put_32 (input_bfd, word, data + dst_address); - dst_address+=4; - src_address+=4; - + dst_address += 4; + src_address += 4; } break; @@ -1424,7 +1434,7 @@ b_out_bfd_get_relocated_section_contents free (reloc_vector); return NULL; } -/***********************************************************************/ + /* Build the transfer vectors for Big and Little-Endian B.OUT files. */ diff -uprN binutils-2.11.90.0.27/bfd/coff-a29k.c binutils-2.11.90.0.29/bfd/coff-a29k.c --- binutils-2.11.90.0.27/bfd/coff-a29k.c Fri Mar 9 11:37:54 2001 +++ binutils-2.11.90.0.29/bfd/coff-a29k.c Mon Aug 27 11:44:51 2001 @@ -37,6 +37,8 @@ static boolean coff_a29k_relocate_sectio static boolean coff_a29k_adjust_symndx PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, struct internal_reloc *, boolean *)); +static void reloc_processing + PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) @@ -47,7 +49,8 @@ static boolean coff_a29k_adjust_symndx #define SIGN_EXTEND_HWORD(HWORD) \ (((HWORD) ^ 0x8000) - 0x8000) -/* Provided the symbol, returns the value reffed */ +/* Provided the symbol, returns the value reffed. */ + static long get_symbol_value (symbol) asymbol *symbol; @@ -55,20 +58,16 @@ get_symbol_value (symbol) long relocation = 0; if (bfd_is_com_section (symbol->section)) - { - relocation = 0; - } + relocation = 0; else - { - relocation = symbol->value + - symbol->section->output_section->vma + - symbol->section->output_offset; - } + relocation = symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset; - return(relocation); + return relocation; } -/* this function is in charge of performing all the 29k relocations */ +/* This function is in charge of performing all the 29k relocations. */ static bfd_reloc_status_type a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, @@ -81,17 +80,15 @@ a29k_reloc (abfd, reloc_entry, symbol_in bfd *output_bfd; char **error_message; { - /* the consth relocation comes in two parts, we have to remember - the state between calls, in these variables */ + /* The consth relocation comes in two parts, we have to remember + the state between calls, in these variables. */ static boolean part1_consth_active = false; static unsigned long part1_consth_value; - unsigned long insn; unsigned long sym_value; unsigned long unsigned_value; unsigned short r_type; long signed_value; - unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/ bfd_byte *hit_data =addr + (bfd_byte *) (data); @@ -99,29 +96,29 @@ a29k_reloc (abfd, reloc_entry, symbol_in if (output_bfd) { - /* Partial linking - do nothing */ + /* Partial linking - do nothing. */ reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; - } if (symbol_in != NULL && bfd_is_und_section (symbol_in->section)) { - /* Keep the state machine happy in case we're called again */ + /* Keep the state machine happy in case we're called again. */ if (r_type == R_IHIHALF) { part1_consth_active = true; part1_consth_value = 0; } - return(bfd_reloc_undefined); + return bfd_reloc_undefined; } if ((part1_consth_active) && (r_type != R_IHCONST)) { part1_consth_active = false; *error_message = (char *) _("Missing IHCONST"); - return(bfd_reloc_dangerous); + + return bfd_reloc_dangerous; } sym_value = get_symbol_value(symbol_in); @@ -130,7 +127,7 @@ a29k_reloc (abfd, reloc_entry, symbol_in { case R_IREL: insn = bfd_get_32 (abfd, hit_data); - /* Take the value in the field and sign extend it */ + /* Take the value in the field and sign extend it. */ signed_value = EXTRACT_HWORD(insn); signed_value = SIGN_EXTEND_HWORD(signed_value); signed_value <<= 2; @@ -142,21 +139,21 @@ a29k_reloc (abfd, reloc_entry, symbol_in signed_value += sym_value + reloc_entry->addend; if ((signed_value & ~0x3ffff) == 0) { /* Absolute jmp/call */ - insn |= (1<<24); /* Make it absolute */ - /* FIXME: Should we change r_type to R_IABS */ + insn |= (1 << 24); /* Make it absolute */ + /* FIXME: Should we change r_type to R_IABS. */ } else { /* Relative jmp/call, so subtract from the value the - address of the place we're coming from */ + address of the place we're coming from. */ signed_value -= (reloc_entry->address + input_section->output_section->vma + input_section->output_offset); - if (signed_value>0x1ffff || signed_value<-0x20000) - return(bfd_reloc_overflow); + if (signed_value > 0x1ffff || signed_value < -0x20000) + return bfd_reloc_overflow; } signed_value >>= 2; - insn = INSERT_HWORD(insn, signed_value); + insn = INSERT_HWORD (insn, signed_value); bfd_put_32 (abfd, insn ,hit_data); break; case R_ILOHALF: @@ -169,19 +166,19 @@ a29k_reloc (abfd, reloc_entry, symbol_in case R_IHIHALF: insn = bfd_get_32 (abfd, hit_data); /* consth, part 1 - Just get the symbol value that is referenced */ + Just get the symbol value that is referenced. */ part1_consth_active = true; part1_consth_value = sym_value + reloc_entry->addend; - /* Don't modify insn until R_IHCONST */ + /* Don't modify insn until R_IHCONST. */ break; case R_IHCONST: insn = bfd_get_32 (abfd, hit_data); /* consth, part 2 - Now relocate the reference */ + Now relocate the reference. */ if (part1_consth_active == false) { *error_message = (char *) _("Missing IHIHALF"); - return(bfd_reloc_dangerous); + return bfd_reloc_dangerous; } /* sym_ptr_ptr = r_symndx, in coff_slurp_reloc_table() */ unsigned_value = 0; /*EXTRACT_HWORD(insn) << 16;*/ @@ -196,14 +193,14 @@ a29k_reloc (abfd, reloc_entry, symbol_in insn = bfd_get_8 (abfd, hit_data); unsigned_value = insn + sym_value + reloc_entry->addend; if (unsigned_value & 0xffffff00) - return(bfd_reloc_overflow); + return bfd_reloc_overflow; bfd_put_8 (abfd, unsigned_value, hit_data); break; case R_HWORD: insn = bfd_get_16 (abfd, hit_data); unsigned_value = insn + sym_value + reloc_entry->addend; if (unsigned_value & 0xffff0000) - return(bfd_reloc_overflow); + return bfd_reloc_overflow; bfd_put_16 (abfd, insn, hit_data); break; case R_WORD: @@ -213,61 +210,48 @@ a29k_reloc (abfd, reloc_entry, symbol_in break; default: *error_message = _("Unrecognized reloc"); - return (bfd_reloc_dangerous); + return bfd_reloc_dangerous; } return(bfd_reloc_ok); } -/* type rightshift - size - bitsize - pc-relative - bitpos - absolute - complain_on_overflow - special_function - relocation name - partial_inplace - src_mask -*/ - -/*FIXME: I'm not real sure about this table */ +/*FIXME: I'm not real sure about this table. */ static reloc_howto_type howto_table[] = -{ - {R_ABS, 0, 3, 32, false, 0, complain_overflow_bitfield,a29k_reloc,"ABS", true, 0xffffffff,0xffffffff, false}, - EMPTY_HOWTO (1), - EMPTY_HOWTO (2), - EMPTY_HOWTO (3), - EMPTY_HOWTO (4), - EMPTY_HOWTO (5), - EMPTY_HOWTO (6), - EMPTY_HOWTO (7), - EMPTY_HOWTO (8), - EMPTY_HOWTO (9), - EMPTY_HOWTO (10), - EMPTY_HOWTO (11), - EMPTY_HOWTO (12), - EMPTY_HOWTO (13), - EMPTY_HOWTO (14), - EMPTY_HOWTO (15), - EMPTY_HOWTO (16), - EMPTY_HOWTO (17), - EMPTY_HOWTO (18), - EMPTY_HOWTO (19), - EMPTY_HOWTO (20), - EMPTY_HOWTO (21), - EMPTY_HOWTO (22), - EMPTY_HOWTO (23), - {R_IREL, 0, 3, 32, true, 0, complain_overflow_signed,a29k_reloc,"IREL", true, 0xffffffff,0xffffffff, false}, - {R_IABS, 0, 3, 32, false, 0, complain_overflow_bitfield, a29k_reloc,"IABS", true, 0xffffffff,0xffffffff, false}, - {R_ILOHALF, 0, 3, 16, true, 0, complain_overflow_signed, a29k_reloc,"ILOHALF", true, 0x0000ffff,0x0000ffff, false}, - {R_IHIHALF, 0, 3, 16, true, 16, complain_overflow_signed, a29k_reloc,"IHIHALF", true, 0xffff0000,0xffff0000, false}, - {R_IHCONST, 0, 3, 16, true, 0, complain_overflow_signed, a29k_reloc,"IHCONST", true, 0xffff0000,0xffff0000, false}, - {R_BYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, a29k_reloc,"BYTE", true, 0x000000ff,0x000000ff, false}, - {R_HWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, a29k_reloc,"HWORD", true, 0x0000ffff,0x0000ffff, false}, - {R_WORD, 0, 2, 32, false, 0, complain_overflow_bitfield, a29k_reloc,"WORD", true, 0xffffffff,0xffffffff, false}, -}; + { + {R_ABS, 0, 3, 32, false, 0, complain_overflow_bitfield,a29k_reloc,"ABS", true, 0xffffffff,0xffffffff, false}, + EMPTY_HOWTO (1), + EMPTY_HOWTO (2), + EMPTY_HOWTO (3), + EMPTY_HOWTO (4), + EMPTY_HOWTO (5), + EMPTY_HOWTO (6), + EMPTY_HOWTO (7), + EMPTY_HOWTO (8), + EMPTY_HOWTO (9), + EMPTY_HOWTO (10), + EMPTY_HOWTO (11), + EMPTY_HOWTO (12), + EMPTY_HOWTO (13), + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), + EMPTY_HOWTO (16), + EMPTY_HOWTO (17), + EMPTY_HOWTO (18), + EMPTY_HOWTO (19), + EMPTY_HOWTO (20), + EMPTY_HOWTO (21), + EMPTY_HOWTO (22), + EMPTY_HOWTO (23), + {R_IREL, 0, 3, 32, true, 0, complain_overflow_signed,a29k_reloc,"IREL", true, 0xffffffff,0xffffffff, false}, + {R_IABS, 0, 3, 32, false, 0, complain_overflow_bitfield, a29k_reloc,"IABS", true, 0xffffffff,0xffffffff, false}, + {R_ILOHALF, 0, 3, 16, true, 0, complain_overflow_signed, a29k_reloc,"ILOHALF", true, 0x0000ffff,0x0000ffff, false}, + {R_IHIHALF, 0, 3, 16, true, 16, complain_overflow_signed, a29k_reloc,"IHIHALF", true, 0xffff0000,0xffff0000, false}, + {R_IHCONST, 0, 3, 16, true, 0, complain_overflow_signed, a29k_reloc,"IHCONST", true, 0xffff0000,0xffff0000, false}, + {R_BYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, a29k_reloc,"BYTE", true, 0x000000ff,0x000000ff, false}, + {R_HWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, a29k_reloc,"HWORD", true, 0x0000ffff,0x0000ffff, false}, + {R_WORD, 0, 2, 32, false, 0, complain_overflow_bitfield, a29k_reloc,"WORD", true, 0xffffffff,0xffffffff, false}, + }; #define BADMAG(x) A29KBADMAG(x) @@ -304,21 +288,18 @@ reloc_processing (relent,reloc, symbols, else { asymbol *ptr; - relent->sym_ptr_ptr = symbols + obj_convert(abfd)[reloc->r_symndx]; + + relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; ptr = *(relent->sym_ptr_ptr); if (ptr && bfd_asymbol_bfd(ptr) == abfd - - && ((ptr->flags & BSF_OLD_COMMON)== 0)) - { - relent->addend = 0; - } + && ((ptr->flags & BSF_OLD_COMMON) == 0)) + relent->addend = 0; else - { - relent->addend = 0; - } + relent->addend = 0; + relent->address-= section->vma; if (reloc->r_type == R_IHIHALF) ihihalf_vaddr = relent->address; @@ -404,7 +385,7 @@ coff_a29k_relocate_section (output_bfd, } else { - if (h->root.type == bfd_link_hash_defined + if ( h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; @@ -494,7 +475,6 @@ coff_a29k_relocate_section (output_bfd, insn = INSERT_HWORD (insn, signed_value); bfd_put_32 (input_bfd, (bfd_vma) insn, loc); - break; case R_ILOHALF: diff -uprN binutils-2.11.90.0.27/bfd/coff-alpha.c binutils-2.11.90.0.29/bfd/coff-alpha.c --- binutils-2.11.90.0.27/bfd/coff-alpha.c Sat May 12 00:57:53 2001 +++ binutils-2.11.90.0.29/bfd/coff-alpha.c Wed Aug 22 08:52:09 2001 @@ -1334,7 +1334,7 @@ alpha_convert_external_reloc (output_bfd break; } - if (r_symndx == -1) + if (r_symndx == (unsigned long) -1) abort (); /* Add the section VMA and the symbol value. */ @@ -1347,7 +1347,7 @@ alpha_convert_external_reloc (output_bfd /* Change the symndx value to the right one for the output BFD. */ r_symndx = h->indx; - if (r_symndx == -1) + if (r_symndx == (unsigned long) -1) { /* Caller must give an error. */ r_symndx = 0; diff -uprN binutils-2.11.90.0.27/bfd/coff-apollo.c binutils-2.11.90.0.29/bfd/coff-apollo.c --- binutils-2.11.90.0.27/bfd/coff-apollo.c Fri Mar 9 11:15:29 2001 +++ binutils-2.11.90.0.29/bfd/coff-apollo.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for Apollo 68000 COFF binaries. - Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc. By Troy Rollo (troy@cbme.unsw.edu.au) Based on m68k standard COFF version Written by Cygnus Support. @@ -33,15 +33,15 @@ Foundation, Inc., 59 Temple Place - Suit extern reloc_howto_type apollocoff_howto_table[]; #else reloc_howto_type apollocoff_howto_table[] = -{ - HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, 0x000000ff,0x000000ff, false), - HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, 0x0000ffff,0x0000ffff, false), - HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, 0xffffffff,0xffffffff, false), - HOWTO(R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, 0x000000ff,0x000000ff, false), - HOWTO(R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, 0x0000ffff,0x0000ffff, false), - HOWTO(R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, 0xffffffff,0xffffffff, false), - HOWTO(R_RELLONG_NEG, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "-32", true, 0xffffffff,0xffffffff, false), -}; + { + HOWTO (R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, 0x000000ff,0x000000ff, false), + HOWTO (R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, 0x0000ffff,0x0000ffff, false), + HOWTO (R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, 0xffffffff,0xffffffff, false), + HOWTO (R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, 0x000000ff,0x000000ff, false), + HOWTO (R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, 0x0000ffff,0x0000ffff, false), + HOWTO (R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, 0xffffffff,0xffffffff, false), + HOWTO (R_RELLONG_NEG, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "-32", true, 0xffffffff,0xffffffff, false), + }; #endif /* not ONLY_DECLARE_RELOCS */ #ifndef BADMAG @@ -49,27 +49,27 @@ reloc_howto_type apollocoff_howto_table[ #endif #define APOLLO_M68 1 /* Customize coffcode.h */ -/* Turn a howto into a reloc number */ +/* Turn a howto into a reloc number. */ + +extern void apollo_rtype2howto PARAMS ((arelent *, int)); +extern int apollo_howto2rtype PARAMS ((reloc_howto_type *)); +#ifndef ONLY_DECLARE_RELOCS -#ifdef ONLY_DECLARE_RELOCS -extern void apollo_rtype2howto PARAMS ((arelent *internal, int relocentry)); -extern int apollo_howto2rtype PARAMS ((reloc_howto_type *)); -#else void -apollo_rtype2howto(internal, relocentry) +apollo_rtype2howto (internal, relocentry) arelent *internal; int relocentry; { switch (relocentry) - { - case R_RELBYTE: internal->howto = apollocoff_howto_table + 0; break; - case R_RELWORD: internal->howto = apollocoff_howto_table + 1; break; - case R_RELLONG: internal->howto = apollocoff_howto_table + 2; break; - case R_PCRBYTE: internal->howto = apollocoff_howto_table + 3; break; - case R_PCRWORD: internal->howto = apollocoff_howto_table + 4; break; - case R_PCRLONG: internal->howto = apollocoff_howto_table + 5; break; - case R_RELLONG_NEG: internal->howto = apollocoff_howto_table + 6; break; - } + { + case R_RELBYTE: internal->howto = apollocoff_howto_table + 0; break; + case R_RELWORD: internal->howto = apollocoff_howto_table + 1; break; + case R_RELLONG: internal->howto = apollocoff_howto_table + 2; break; + case R_PCRBYTE: internal->howto = apollocoff_howto_table + 3; break; + case R_PCRWORD: internal->howto = apollocoff_howto_table + 4; break; + case R_PCRLONG: internal->howto = apollocoff_howto_table + 5; break; + case R_RELLONG_NEG: internal->howto = apollocoff_howto_table + 6; break; + } } int @@ -77,32 +77,32 @@ apollo_howto2rtype (internal) reloc_howto_type *internal; { if (internal->pc_relative) - { - switch (internal->bitsize) { - case 32: return R_PCRLONG; - case 16: return R_PCRWORD; - case 8: return R_PCRBYTE; + switch (internal->bitsize) + { + case 32: return R_PCRLONG; + case 16: return R_PCRWORD; + case 8: return R_PCRBYTE; + } } - } else - { - switch (internal->bitsize) - { - case 32: return R_RELLONG; - case 16: return R_RELWORD; - case 8: return R_RELBYTE; - } - } + { + switch (internal->bitsize) + { + case 32: return R_RELLONG; + case 16: return R_RELWORD; + case 8: return R_RELBYTE; + } + } return R_RELLONG; } #endif /* not ONLY_DECLARE_RELOCS */ #define RTYPE2HOWTO(internal, relocentry) \ - apollo_rtype2howto(internal, (relocentry)->r_type) + apollo_rtype2howto (internal, (relocentry)->r_type) #define SELECT_RELOC(external, internal) \ - external.r_type = apollo_howto2rtype(internal); + external.r_type = apollo_howto2rtype (internal); #include "coffcode.h" diff -uprN binutils-2.11.90.0.27/bfd/coff-arm.c binutils-2.11.90.0.29/bfd/coff-arm.c --- binutils-2.11.90.0.27/bfd/coff-arm.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/bfd/coff-arm.c Mon Aug 27 11:44:51 2001 @@ -113,12 +113,13 @@ static boolean coff_arm_link_output_has_ PARAMS ((bfd *, struct coff_final_link_info *)); static boolean coff_arm_final_link_postscript PARAMS ((bfd *, struct coff_final_link_info *)); +static void arm_emit_base_file_entry + PARAMS ((struct bfd_link_info *, bfd *, asection *, bfd_vma)); /* The linker script knows the section names for placement. The entry_names are used to do simple name mangling on the stubs. Given a function name, and its type, the stub can be found. The - name can be changed. The only requirement is the %s be present. - */ + name can be changed. The only requirement is the %s be present. */ #define THUMB2ARM_GLUE_SECTION_NAME ".glue_7t" #define THUMB2ARM_GLUE_ENTRY_NAME "__%s_from_thumb" @@ -127,6 +128,7 @@ static boolean coff_arm_final_link_posts #define ARM2THUMB_GLUE_ENTRY_NAME "__%s_from_arm" /* Used by the assembler. */ + static bfd_reloc_status_type coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -233,300 +235,300 @@ coff_arm_reloc (abfd, reloc_entry, symbo #endif static reloc_howto_type aoutarm_std_reloc_howto[] = -{ - /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ + { #ifdef ARM_WINCE - EMPTY_HOWTO (-1), - HOWTO (ARM_32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO (ARM_RVA32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_RVA32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO (ARM_26, - 2, - 2, - 24, - true, - 0, - complain_overflow_signed, - aoutarm_fix_pcrel_26 , - "ARM_26", - false, - 0x00ffffff, - 0x00ffffff, - PCRELOFFSET), - HOWTO (ARM_THUMB12, - 1, - 1, - 11, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_12 , - "ARM_THUMB12", - false, - 0x000007ff, - 0x000007ff, - PCRELOFFSET), - HOWTO (ARM_26D, - 2, - 2, - 24, - false, - 0, - complain_overflow_dont, - aoutarm_fix_pcrel_26_done, - "ARM_26D", - true, - 0x00ffffff, - 0x0, - false), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - HOWTO (ARM_SECTION, - 0, - 1, - 16, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_16", - true, - 0x0000ffff, - 0x0000ffff, - PCRELOFFSET), - HOWTO (ARM_SECREL, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), + EMPTY_HOWTO (-1), + HOWTO (ARM_32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_RVA32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_RVA32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_26, + 2, + 2, + 24, + true, + 0, + complain_overflow_signed, + aoutarm_fix_pcrel_26 , + "ARM_26", + false, + 0x00ffffff, + 0x00ffffff, + PCRELOFFSET), + HOWTO (ARM_THUMB12, + 1, + 1, + 11, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_12 , + "ARM_THUMB12", + false, + 0x000007ff, + 0x000007ff, + PCRELOFFSET), + HOWTO (ARM_26D, + 2, + 2, + 24, + false, + 0, + complain_overflow_dont, + aoutarm_fix_pcrel_26_done, + "ARM_26D", + true, + 0x00ffffff, + 0x0, + false), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + HOWTO (ARM_SECTION, + 0, + 1, + 16, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_16", + true, + 0x0000ffff, + 0x0000ffff, + PCRELOFFSET), + HOWTO (ARM_SECREL, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), #else /* not ARM_WINCE */ - HOWTO(ARM_8, /* type */ - 0, /* rightshift */ - 0, /* size */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - coff_arm_reloc, /* special_function */ - "ARM_8", /* name */ - true, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - PCRELOFFSET /* pcrel_offset */), - HOWTO(ARM_16, - 0, - 1, - 16, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_16", - true, - 0x0000ffff, - 0x0000ffff, - PCRELOFFSET), - HOWTO(ARM_32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO(ARM_26, - 2, - 2, - 24, - true, - 0, - complain_overflow_signed, - aoutarm_fix_pcrel_26 , - "ARM_26", - false, - 0x00ffffff, - 0x00ffffff, - PCRELOFFSET), - HOWTO(ARM_DISP8, - 0, - 0, - 8, - true, - 0, - complain_overflow_signed, - coff_arm_reloc, - "ARM_DISP8", - true, - 0x000000ff, - 0x000000ff, - true), - HOWTO( ARM_DISP16, - 0, - 1, - 16, - true, - 0, - complain_overflow_signed, - coff_arm_reloc, - "ARM_DISP16", - true, - 0x0000ffff, - 0x0000ffff, - true), - HOWTO( ARM_DISP32, - 0, - 2, - 32, - true, - 0, - complain_overflow_signed, - coff_arm_reloc, - "ARM_DISP32", - true, - 0xffffffff, - 0xffffffff, - true), - HOWTO( ARM_26D, - 2, - 2, - 24, - false, - 0, - complain_overflow_dont, - aoutarm_fix_pcrel_26_done, - "ARM_26D", - true, - 0x00ffffff, - 0x0, - false), - /* 8 is unused */ - EMPTY_HOWTO (-1), - HOWTO( ARM_NEG16, - 0, - -1, - 16, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_NEG16", - true, - 0x0000ffff, - 0x0000ffff, - false), - HOWTO( ARM_NEG32, - 0, - -2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_NEG32", - true, - 0xffffffff, - 0xffffffff, - false), - HOWTO( ARM_RVA32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_RVA32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO( ARM_THUMB9, - 1, - 1, - 8, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_9 , - "ARM_THUMB9", - false, - 0x000000ff, - 0x000000ff, - PCRELOFFSET), - HOWTO( ARM_THUMB12, - 1, - 1, - 11, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_12 , - "ARM_THUMB12", - false, - 0x000007ff, - 0x000007ff, - PCRELOFFSET), - HOWTO( ARM_THUMB23, - 1, - 2, - 22, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_23 , - "ARM_THUMB23", - false, - 0x07ff07ff, - 0x07ff07ff, - PCRELOFFSET) + HOWTO (ARM_8, /* type */ + 0, /* rightshift */ + 0, /* size */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + coff_arm_reloc, /* special_function */ + "ARM_8", /* name */ + true, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + PCRELOFFSET /* pcrel_offset */), + HOWTO (ARM_16, + 0, + 1, + 16, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_16", + true, + 0x0000ffff, + 0x0000ffff, + PCRELOFFSET), + HOWTO (ARM_32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_26, + 2, + 2, + 24, + true, + 0, + complain_overflow_signed, + aoutarm_fix_pcrel_26 , + "ARM_26", + false, + 0x00ffffff, + 0x00ffffff, + PCRELOFFSET), + HOWTO (ARM_DISP8, + 0, + 0, + 8, + true, + 0, + complain_overflow_signed, + coff_arm_reloc, + "ARM_DISP8", + true, + 0x000000ff, + 0x000000ff, + true), + HOWTO (ARM_DISP16, + 0, + 1, + 16, + true, + 0, + complain_overflow_signed, + coff_arm_reloc, + "ARM_DISP16", + true, + 0x0000ffff, + 0x0000ffff, + true), + HOWTO (ARM_DISP32, + 0, + 2, + 32, + true, + 0, + complain_overflow_signed, + coff_arm_reloc, + "ARM_DISP32", + true, + 0xffffffff, + 0xffffffff, + true), + HOWTO (ARM_26D, + 2, + 2, + 24, + false, + 0, + complain_overflow_dont, + aoutarm_fix_pcrel_26_done, + "ARM_26D", + true, + 0x00ffffff, + 0x0, + false), + /* 8 is unused */ + EMPTY_HOWTO (-1), + HOWTO (ARM_NEG16, + 0, + -1, + 16, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_NEG16", + true, + 0x0000ffff, + 0x0000ffff, + false), + HOWTO (ARM_NEG32, + 0, + -2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_NEG32", + true, + 0xffffffff, + 0xffffffff, + false), + HOWTO (ARM_RVA32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_RVA32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_THUMB9, + 1, + 1, + 8, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_9 , + "ARM_THUMB9", + false, + 0x000000ff, + 0x000000ff, + PCRELOFFSET), + HOWTO (ARM_THUMB12, + 1, + 1, + 11, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_12 , + "ARM_THUMB12", + false, + 0x000007ff, + 0x000007ff, + PCRELOFFSET), + HOWTO (ARM_THUMB23, + 1, + 2, + 22, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_23 , + "ARM_THUMB23", + false, + 0x07ff07ff, + 0x07ff07ff, + PCRELOFFSET) #endif /* not ARM_WINCE */ -}; + }; #define NUM_RELOCS NUM_ELEM (aoutarm_std_reloc_howto) #ifdef COFF_WITH_PE +static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); /* Return true if this relocation should appear in the output .reloc section. */ @@ -568,6 +570,7 @@ coff_arm_rtype_to_howto (abfd, sec, rel, return howto; } + /* Used by the assembler. */ static bfd_reloc_status_type @@ -603,7 +606,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, long target = bfd_get_32 (abfd, (bfd_byte *) data + addr); bfd_reloc_status_type flag = bfd_reloc_ok; - /* If this is an undefined symbol, return error */ + /* If this is an undefined symbol, return error. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_continue : bfd_reloc_undefined; @@ -615,7 +618,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, return bfd_reloc_continue; relocation = (target & 0x00ffffff) << 2; - relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend */ + relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend. */ relocation += symbol->value; relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; @@ -627,7 +630,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, if (relocation & 3) return bfd_reloc_overflow; - /* Check for overflow */ + /* Check for overflow. */ if (relocation & 0x02000000) { if ((relocation & ~ (bfd_vma) 0x03ffffff) != ~ (bfd_vma) 0x03ffffff) @@ -694,7 +697,7 @@ coff_thumb_pcrel_common (abfd, reloc_ent abort (); } - /* If this is an undefined symbol, return error */ + /* If this is an undefined symbol, return error. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_continue : bfd_reloc_undefined; @@ -723,7 +726,7 @@ coff_thumb_pcrel_common (abfd, reloc_ent abort (); } - relocation = (relocation ^ signbit) - signbit; /* Sign extend */ + relocation = (relocation ^ signbit) - signbit; /* Sign extend. */ relocation += symbol->value; relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; @@ -735,7 +738,7 @@ coff_thumb_pcrel_common (abfd, reloc_ent if (relocation & 1) return bfd_reloc_overflow; - /* Check for overflow */ + /* Check for overflow. */ if (relocation & signbit) { if ((relocation & ~offmsk) != ~offmsk) @@ -769,7 +772,7 @@ coff_thumb_pcrel_common (abfd, reloc_ent Strictly this is only necessary if we are doing a partial relocation. */ reloc_entry->howto = & aoutarm_std_reloc_howto [ARM_26D]; - /* TODO: We should possibly have DONE entries for the THUMB PCREL relocations */ + /* TODO: We should possibly have DONE entries for the THUMB PCREL relocations. */ return flag; } @@ -831,7 +834,8 @@ coff_arm_reloc_type_lookup (abfd, code) case 32: code = BFD_RELOC_32; break; - default: return (CONST struct reloc_howto_struct *) 0; + default: + return (CONST struct reloc_howto_struct *) 0; } switch (code) @@ -872,21 +876,21 @@ coff_arm_reloc_type_lookup (abfd, code) This allows us to store global data here without actually creating any global variables, which is a no-no in the BFD world. */ struct coff_arm_link_hash_table -{ - /* The original coff_link_hash_table structure. MUST be first field. */ - struct coff_link_hash_table root; + { + /* The original coff_link_hash_table structure. MUST be first field. */ + struct coff_link_hash_table root; - /* The size in bytes of the section containg the Thumb-to-ARM glue. */ - long int thumb_glue_size; + /* The size in bytes of the section containg the Thumb-to-ARM glue. */ + long int thumb_glue_size; - /* The size in bytes of the section containg the ARM-to-Thumb glue. */ - long int arm_glue_size; + /* The size in bytes of the section containg the ARM-to-Thumb glue. */ + long int arm_glue_size; - /* An arbitary input BFD chosen to hold the glue sections. */ - bfd * bfd_of_glue_owner; + /* An arbitary input BFD chosen to hold the glue sections. */ + bfd * bfd_of_glue_owner; - /* Support interworking with old, non-interworking aware ARM code. */ - int support_old_code; + /* Support interworking with old, non-interworking aware ARM code. */ + int support_old_code; }; /* Get the ARM coff linker hash table from a link_info structure. */ @@ -932,9 +936,9 @@ arm_emit_base_file_entry (info, output_b + input_section->output_offset + input_section->output_section->vma; - if (coff_data(output_bfd)->pe) - addr -= pe_data(output_bfd)->pe_opthdr.ImageBase; - fwrite (&addr, 1, sizeof (addr), (FILE *) info->base_file); + if (coff_data (output_bfd)->pe) + addr -= pe_data (output_bfd)->pe_opthdr.ImageBase; + fwrite (& addr, 1, sizeof (addr), (FILE *) info->base_file); } @@ -964,7 +968,7 @@ arm_emit_base_file_entry (info, output_b moves the computed address into the PC, so it must be the second one in the sequence. The problem, however is that whilst little endian code stores the instructions in HI then LOW order, big endian code does the - reverse. nickc@cygnus.com */ + reverse. nickc@cygnus.com. */ #define LOW_HI_ORDER 0xF800F000 #define HI_LOW_ORDER 0xF000F800 @@ -988,9 +992,8 @@ insert_thumb_branch (br_insn, rel_off) else if ((br_insn & HI_LOW_ORDER) == HI_LOW_ORDER) br_insn = HI_LOW_ORDER | (high_bits << 16) | low_bits; else - abort (); /* error - not a valid branch instruction form */ - - /* FIXME: abort is probably not the right call. krk@cygnus.com */ + /* FIXME: the BFD library should never abort - it should return an error status. */ + abort (); /* Error - not a valid branch instruction form. */ return br_insn; } @@ -1306,7 +1309,7 @@ coff_arm_relocate_section (output_bfd, i if ( h->class == C_THUMBSTATFUNC || h->class == C_THUMBEXTFUNC) { - /* Arm code calling a Thumb function */ + /* Arm code calling a Thumb function. */ unsigned long int tmp; long int my_offset; asection * s; @@ -1392,7 +1395,7 @@ coff_arm_relocate_section (output_bfd, i } #ifndef ARM_WINCE - /* Note: We used to check for ARM_THUMB9 and ARM_THUMB12 */ + /* Note: We used to check for ARM_THUMB9 and ARM_THUMB12. */ else if (howto->type == ARM_THUMB23) { if ( h->class == C_EXT @@ -1483,7 +1486,7 @@ coff_arm_relocate_section (output_bfd, i s->contents + my_offset + 2); ret_offset = - ((bfd_signed_vma) h_val) /* Address of destination of the stub */ + ((bfd_signed_vma) h_val) /* Address of destination of the stub. */ - ((bfd_signed_vma) (s->output_offset /* Offset from the start of the current section to the start of the stubs. */ + my_offset /* Offset of the start of this stub from the start of the stubs. */ diff -uprN binutils-2.11.90.0.27/bfd/coff-go32.c binutils-2.11.90.0.29/bfd/coff-go32.c --- binutils-2.11.90.0.27/bfd/coff-go32.c Fri Mar 9 11:15:29 2001 +++ binutils-2.11.90.0.29/bfd/coff-go32.c Mon Aug 27 11:44:51 2001 @@ -36,6 +36,10 @@ Foundation, Inc., 59 Temple Place - Suit { COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.t"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.r"), \ - COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 } + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 } #include "coff-i386.c" diff -uprN binutils-2.11.90.0.27/bfd/coff-h8300.c binutils-2.11.90.0.29/bfd/coff-h8300.c --- binutils-2.11.90.0.27/bfd/coff-h8300.c Fri Mar 9 11:15:29 2001 +++ binutils-2.11.90.0.29/bfd/coff-h8300.c Mon Aug 27 11:44:51 2001 @@ -1,6 +1,6 @@ /* BFD back-end for Hitachi H8/300 COFF binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000 + 2000, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain, . @@ -38,25 +38,25 @@ Foundation, Inc., 59 Temple Place - Suit the offset where we'll add the next entry. */ struct funcvec_hash_entry -{ - /* The basic hash table entry. */ - struct bfd_hash_entry root; - - /* The offset within the vectors section where - this entry lives. */ - bfd_vma offset; -}; + { + /* The basic hash table entry. */ + struct bfd_hash_entry root; + + /* The offset within the vectors section where + this entry lives. */ + bfd_vma offset; + }; struct funcvec_hash_table -{ - /* The basic hash table. */ - struct bfd_hash_table root; - - bfd *abfd; - - /* Offset at which we'll add the next entry. */ - unsigned int offset; -}; + { + /* The basic hash table. */ + struct bfd_hash_table root; + + bfd *abfd; + + /* Offset at which we'll add the next entry. */ + unsigned int offset; + }; static struct bfd_hash_entry * funcvec_hash_newfunc @@ -69,6 +69,15 @@ funcvec_hash_table_init struct bfd_hash_table *, const char *)))); +static bfd_reloc_status_type special PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static int select_reloc PARAMS ((reloc_howto_type *)); +static void rtype2howto PARAMS ((arelent *, struct internal_reloc *)); +static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); +static boolean h8300_symbol_address_p PARAMS ((bfd *, asection *, bfd_vma)); +static int h8300_reloc16_estimate PARAMS ((bfd *, asection *, arelent *, unsigned int, struct bfd_link_info *)); +static void h8300_reloc16_extra_cases PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, bfd_byte *, unsigned int *, unsigned int *)); +static boolean h8300_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); + /* To lookup a value in the function vector hash table. */ #define funcvec_hash_lookup(table, string, create, copy) \ ((struct funcvec_hash_entry *) \ diff -uprN binutils-2.11.90.0.27/bfd/coff-h8500.c binutils-2.11.90.0.29/bfd/coff-h8500.c --- binutils-2.11.90.0.27/bfd/coff-h8500.c Fri Mar 9 11:15:29 2001 +++ binutils-2.11.90.0.29/bfd/coff-h8500.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for Hitachi H8/500 COFF binaries. - Copyright 1993, 1994, 1995, 1997, 1999, 2000 + Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . @@ -28,6 +28,11 @@ Foundation, Inc., 59 Temple Place - Suit #include "coff/internal.h" #include "libcoff.h" +static int coff_h8500_select_reloc PARAMS ((reloc_howto_type *)); +static void rtype2howto PARAMS ((arelent *, struct internal_reloc *)); +static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); +static void extra_case PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, bfd_byte *, unsigned int *, unsigned int *)); + #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1) static reloc_howto_type r_imm8 = @@ -63,8 +68,8 @@ HOWTO (R_H8500_PCREL16, 0, 1, 16, true, static reloc_howto_type r_high16 = HOWTO (R_H8500_HIGH16, 0, 1, 8, false, 0, complain_overflow_dont, 0, "r_high16", true, 0x000ffff, 0x0000ffff, false); - -/* Turn a howto into a reloc number */ + +/* Turn a howto into a reloc number. */ static int coff_h8500_select_reloc (howto) @@ -80,18 +85,17 @@ coff_h8500_select_reloc (howto) #define __A_MAGIC_SET__ -/* Code to swap in the reloc */ +/* Code to swap in the reloc. */ #define SWAP_IN_RELOC_OFFSET bfd_h_get_32 #define SWAP_OUT_RELOC_OFFSET bfd_h_put_32 #define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) \ dst->r_stuff[0] = 'S'; \ dst->r_stuff[1] = 'C'; -/* Code to turn a r_type into a howto ptr, uses the above howto table - */ +/* Code to turn a r_type into a howto ptr, uses the above howto table. */ static void -rtype2howto(internal, dst) +rtype2howto (internal, dst) arelent * internal; struct internal_reloc *dst; { @@ -132,7 +136,7 @@ rtype2howto(internal, dst) #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) -/* Perform any necessary magic to the addend in a reloc entry */ +/* Perform any necessary magic to the addend in a reloc entry. */ #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ cache_ptr->addend = ext_reloc.r_offset; @@ -151,13 +155,9 @@ static void reloc_processing (relent, re rtype2howto (relent, reloc); if (reloc->r_symndx > 0) - { - relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; - } + relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; else - { - relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - } + relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; relent->addend = reloc->r_offset; relent->address -= section->vma; @@ -175,6 +175,7 @@ extra_case (in_abfd, link_info, link_ord { bfd_byte *d = data+*dst_ptr; asection *input_section = link_order->u.indirect.section; + switch (reloc->howto->type) { case R_H8500_IMM8: @@ -189,7 +190,7 @@ extra_case (in_abfd, link_info, link_ord bfd_put_8 (in_abfd, (bfd_coff_reloc16_get_value (reloc, link_info, input_section) >> 16), - d ); + d); (*dst_ptr) += 1; (*src_ptr) += 1; break; @@ -197,7 +198,7 @@ extra_case (in_abfd, link_info, link_ord case R_H8500_IMM16: bfd_put_16 (in_abfd, bfd_coff_reloc16_get_value (reloc, link_info, input_section), - d ); + d); (*dst_ptr) += 2; (*src_ptr) += 2; break; @@ -214,7 +215,7 @@ extra_case (in_abfd, link_info, link_ord case R_H8500_HIGH16: bfd_put_16 (in_abfd, (bfd_coff_reloc16_get_value (reloc, link_info, input_section) - >>16), + >> 16), d); (*dst_ptr) += 2; @@ -223,20 +224,20 @@ extra_case (in_abfd, link_info, link_ord case R_H8500_IMM24: { - int v = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + int v = bfd_coff_reloc16_get_value (reloc, link_info, input_section); int o = bfd_get_32 (in_abfd, data+ *dst_ptr -1); v = (v & 0x00ffffff) | (o & 0xff00000); bfd_put_32 (in_abfd, v, data + *dst_ptr -1); - (*dst_ptr) +=3; - (*src_ptr)+=3;; + (*dst_ptr) += 3; + (*src_ptr) += 3;; } break; case R_H8500_IMM32: { - int v = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + int v = bfd_coff_reloc16_get_value (reloc, link_info, input_section); bfd_put_32 (in_abfd, v, data + *dst_ptr); - (*dst_ptr) +=4; - (*src_ptr)+=4;; + (*dst_ptr) += 4; + (*src_ptr) += 4;; } break; @@ -248,7 +249,7 @@ extra_case (in_abfd, link_info, link_ord + *dst_ptr + link_order->u.indirect.section->output_section->vma; int gap = dst - dot - 1; /* -1 since were in the odd byte of the - word and the pc's been incremented */ + word and the pc's been incremented. */ if (gap > 128 || gap < -128) { @@ -271,7 +272,7 @@ extra_case (in_abfd, link_info, link_ord + *dst_ptr + link_order->u.indirect.section->output_section->vma; int gap = dst - dot - 1; /* -1 since were in the odd byte of the - word and the pc's been incremented */ + word and the pc's been incremented. */ if (gap > 32767 || gap < -32768) { @@ -282,8 +283,8 @@ extra_case (in_abfd, link_info, link_ord abort (); } bfd_put_16 (in_abfd, gap, data + *dst_ptr); - (*dst_ptr)+=2; - (*src_ptr)+=2; + (*dst_ptr) += 2; + (*src_ptr) += 2; break; } diff -uprN binutils-2.11.90.0.27/bfd/coff-i860.c binutils-2.11.90.0.29/bfd/coff-i860.c --- binutils-2.11.90.0.27/bfd/coff-i860.c Fri Mar 9 11:15:30 2001 +++ binutils-2.11.90.0.29/bfd/coff-i860.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for Intel 860 COFF files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001 Free Software Foundation, Inc. Created mostly by substituting "860" for "386" in coff-i386.c Harry Dolan , October 1995 @@ -36,6 +36,7 @@ static reloc_howto_type *coff_i860_rtype PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); +static const bfd_target * i3coff_object_p PARAMS ((bfd *)); #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) /* The page size is a guess based on ELF. */ @@ -342,7 +343,7 @@ coff_i860_rtype_to_howto (abfd, sec, rel with and without this section bypassed and then do a binary comparison, the addresses which are different can be looked up in the map. The case in which this section has been bypassed has addresses which correspond - to values I can find in the map */ + to values I can find in the map. */ *addendp -= sym->n_value; } @@ -363,7 +364,7 @@ static const bfd_target * i3coff_object_p(a) bfd *a; { - return coff_object_p(a); + return coff_object_p (a); } const bfd_target diff -uprN binutils-2.11.90.0.27/bfd/coff-ia64.c binutils-2.11.90.0.29/bfd/coff-ia64.c --- binutils-2.11.90.0.27/bfd/coff-ia64.c Sat Jun 2 23:14:38 2001 +++ binutils-2.11.90.0.29/bfd/coff-ia64.c Wed Aug 22 08:52:09 2001 @@ -52,6 +52,8 @@ static reloc_howto_type howto_table[] = /* Return true if this relocation should appear in the output .reloc section. */ +static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); + static boolean in_reloc_p(abfd, howto) bfd * abfd ATTRIBUTE_UNUSED; @@ -63,6 +65,8 @@ in_reloc_p(abfd, howto) #include "coffcode.h" +static const bfd_target *ia64coff_object_p PARAMS ((bfd *)); + static const bfd_target * ia64coff_object_p (abfd) bfd *abfd; diff -uprN binutils-2.11.90.0.27/bfd/coff-m68k.c binutils-2.11.90.0.29/bfd/coff-m68k.c --- binutils-2.11.90.0.27/bfd/coff-m68k.c Fri Mar 9 11:15:30 2001 +++ binutils-2.11.90.0.29/bfd/coff-m68k.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,6 @@ /* BFD back-end for Motorola 68000 COFF binaries. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -98,15 +99,15 @@ extern reloc_howto_type m68kcoff_howto_t static #endif reloc_howto_type m68kcoff_howto_table[] = -{ - HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "8", true, 0x000000ff,0x000000ff, false), - HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "16", true, 0x0000ffff,0x0000ffff, false), - HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "32", true, 0xffffffff,0xffffffff, false), - HOWTO(R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP8", true, 0x000000ff,0x000000ff, false), - HOWTO(R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP16", true, 0x0000ffff,0x0000ffff, false), - HOWTO(R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP32", true, 0xffffffff,0xffffffff, false), - HOWTO(R_RELLONG_NEG, 0, -2, 32, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "-32", true, 0xffffffff,0xffffffff, false), -}; + { + HOWTO (R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "8", true, 0x000000ff,0x000000ff, false), + HOWTO (R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "16", true, 0x0000ffff,0x0000ffff, false), + HOWTO (R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "32", true, 0xffffffff,0xffffffff, false), + HOWTO (R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP8", true, 0x000000ff,0x000000ff, false), + HOWTO (R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP16", true, 0x0000ffff,0x0000ffff, false), + HOWTO (R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP32", true, 0xffffffff,0xffffffff, false), + HOWTO (R_RELLONG_NEG, 0, -2, 32, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "-32", true, 0xffffffff,0xffffffff, false), + }; #endif /* not ONLY_DECLARE_RELOCS */ #ifndef BADMAG @@ -122,58 +123,61 @@ extern int m68k_howto2rtype PARAMS ((rel extern reloc_howto_type *m68k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); #else + #ifdef STATIC_RELOCS -static +#define STAT_REL static +#else +#define STAT_REL #endif -void + +STAT_REL reloc_howto_type * m68k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); +STAT_REL int m68k_howto2rtype PARAMS ((reloc_howto_type *)); +STAT_REL void m68k_rtype2howto PARAMS ((arelent *, int)); + + +STAT_REL void m68k_rtype2howto(internal, relocentry) arelent *internal; int relocentry; { switch (relocentry) - { - case R_RELBYTE: internal->howto = m68kcoff_howto_table + 0; break; - case R_RELWORD: internal->howto = m68kcoff_howto_table + 1; break; - case R_RELLONG: internal->howto = m68kcoff_howto_table + 2; break; - case R_PCRBYTE: internal->howto = m68kcoff_howto_table + 3; break; - case R_PCRWORD: internal->howto = m68kcoff_howto_table + 4; break; - case R_PCRLONG: internal->howto = m68kcoff_howto_table + 5; break; - case R_RELLONG_NEG: internal->howto = m68kcoff_howto_table + 6; break; - } + { + case R_RELBYTE: internal->howto = m68kcoff_howto_table + 0; break; + case R_RELWORD: internal->howto = m68kcoff_howto_table + 1; break; + case R_RELLONG: internal->howto = m68kcoff_howto_table + 2; break; + case R_PCRBYTE: internal->howto = m68kcoff_howto_table + 3; break; + case R_PCRWORD: internal->howto = m68kcoff_howto_table + 4; break; + case R_PCRLONG: internal->howto = m68kcoff_howto_table + 5; break; + case R_RELLONG_NEG: internal->howto = m68kcoff_howto_table + 6; break; + } } -#ifdef STATIC_RELOCS -static -#endif -int +STAT_REL int m68k_howto2rtype (internal) reloc_howto_type *internal; { if (internal->pc_relative) - { - switch (internal->bitsize) { - case 32: return R_PCRLONG; - case 16: return R_PCRWORD; - case 8: return R_PCRBYTE; + switch (internal->bitsize) + { + case 32: return R_PCRLONG; + case 16: return R_PCRWORD; + case 8: return R_PCRBYTE; + } } - } else - { - switch (internal->bitsize) - { - case 32: return R_RELLONG; - case 16: return R_RELWORD; - case 8: return R_RELBYTE; - } - } + { + switch (internal->bitsize) + { + case 32: return R_RELLONG; + case 16: return R_RELWORD; + case 8: return R_RELBYTE; + } + } return R_RELLONG; } -#ifdef STATIC_RELOCS -static -#endif -reloc_howto_type * +STAT_REL reloc_howto_type * m68k_reloc_type_lookup (abfd, code) bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; diff -uprN binutils-2.11.90.0.27/bfd/coff-rs6000.c binutils-2.11.90.0.29/bfd/coff-rs6000.c --- binutils-2.11.90.0.27/bfd/coff-rs6000.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/coff-rs6000.c Mon Aug 27 11:44:51 2001 @@ -56,10 +56,10 @@ extern unsigned int _bfd_xcoff_swap_sym_ extern void _bfd_xcoff_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR)); extern unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR)); -/* Forward declare _bfd_xcoff_rtype2howto for coffcode.h macro */ +/* Forward declare _bfd_xcoff_rtype2howto for coffcode.h macro. */ void _bfd_xcoff_rtype2howto PARAMS ((arelent *, struct internal_reloc *)); -/* coffcode.h needs these to be defined */ +/* coffcode.h needs these to be defined. */ #define RS6000COFF_C 1 #define SELECT_RELOC(internal, howto) \ @@ -249,21 +249,24 @@ _bfd_xcoff_swap_sym_in (abfd, ext1, in1) PTR in1; { SYMENT *ext = (SYMENT *)ext1; - struct internal_syment *in = (struct internal_syment *)in1; + struct internal_syment * in = (struct internal_syment *)in1; - if(ext->e.e_name[0] != 0) { - memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); - } else { - in->_n._n_n._n_zeroes = 0; - in->_n._n_n._n_offset = - bfd_h_get_32(abfd, (bfd_byte *) ext->e.e.e_offset); - } + if (ext->e.e_name[0] != 0) + { + memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); + } + else + { + in->_n._n_n._n_zeroes = 0; + in->_n._n_n._n_offset = + bfd_h_get_32 (abfd, (bfd_byte *) ext->e.e.e_offset); + } - in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value); - in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum); - in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type); - in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass); - in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux); + in->n_value = bfd_h_get_32 (abfd, (bfd_byte *) ext->e_value); + in->n_scnum = bfd_h_get_16 (abfd, (bfd_byte *) ext->e_scnum); + in->n_type = bfd_h_get_16 (abfd, (bfd_byte *) ext->e_type); + in->n_sclass = bfd_h_get_8 (abfd, ext->e_sclass); + in->n_numaux = bfd_h_get_8 (abfd, ext->e_numaux); } unsigned int @@ -275,19 +278,22 @@ _bfd_xcoff_swap_sym_out (abfd, inp, extp struct internal_syment *in = (struct internal_syment *)inp; SYMENT *ext =(SYMENT *)extp; - if(in->_n._n_name[0] != 0) { - memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); - } else { - bfd_h_put_32(abfd, 0, (bfd_byte *) ext->e.e.e_zeroes); - bfd_h_put_32(abfd, in->_n._n_n._n_offset, - (bfd_byte *) ext->e.e.e_offset); - } + if (in->_n._n_name[0] != 0) + { + memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); + } + else + { + bfd_h_put_32 (abfd, 0, (bfd_byte *) ext->e.e.e_zeroes); + bfd_h_put_32 (abfd, in->_n._n_n._n_offset, + (bfd_byte *) ext->e.e.e_offset); + } - bfd_h_put_32(abfd, in->n_value , (bfd_byte *) ext->e_value); - bfd_h_put_16(abfd, in->n_scnum , (bfd_byte *) ext->e_scnum); - bfd_h_put_16(abfd, in->n_type , (bfd_byte *) ext->e_type); - bfd_h_put_8(abfd, in->n_sclass , ext->e_sclass); - bfd_h_put_8(abfd, in->n_numaux , ext->e_numaux); + bfd_h_put_32 (abfd, in->n_value , (bfd_byte *) ext->e_value); + bfd_h_put_16 (abfd, in->n_scnum , (bfd_byte *) ext->e_scnum); + bfd_h_put_16 (abfd, in->n_type , (bfd_byte *) ext->e_type); + bfd_h_put_8 (abfd, in->n_sclass , ext->e_sclass); + bfd_h_put_8 (abfd, in->n_numaux , ext->e_numaux); return bfd_coff_symesz (abfd); } @@ -308,27 +314,31 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type int numaux; PTR in1; { - AUXENT *ext = (AUXENT *)ext1; + AUXENT * ext = (AUXENT *)ext1; union internal_auxent *in = (union internal_auxent *)in1; - switch (class) { + switch (class) + { case C_FILE: - if (ext->x_file.x_fname[0] == 0) { + if (ext->x_file.x_fname[0] == 0) + { in->x_file.x_n.x_zeroes = 0; in->x_file.x_n.x_offset = - bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset); - } else { - if (numaux > 1) - { - if (indx == 0) - memcpy (in->x_file.x_fname, ext->x_file.x_fname, - numaux * sizeof (AUXENT)); - } - else - { - memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); - } - } + bfd_h_get_32 (abfd, (bfd_byte *) ext->x_file.x_n.x_offset); + } + else + { + if (numaux > 1) + { + if (indx == 0) + memcpy (in->x_file.x_fname, ext->x_file.x_fname, + numaux * sizeof (AUXENT)); + } + else + { + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); + } + } goto end; /* RS/6000 "csect" auxents */ @@ -355,7 +365,8 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type case C_STAT: case C_LEAFSTAT: case C_HIDDEN: - if (type == T_NULL) { + if (type == T_NULL) + { in->x_scn.x_scnlen = bfd_h_get_32(abfd, (bfd_byte *) ext->x_scn.x_scnlen); in->x_scn.x_nreloc = bfd_h_get_16(abfd, @@ -394,33 +405,36 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type in->x_sym.x_fcnary.x_ary.x_dimen[3] = bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); } - if (ISFCN(type)) { - in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize); - } - else { - in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_16(abfd, (bfd_byte *) - ext->x_sym.x_misc.x_lnsz.x_lnno); - in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_16(abfd, (bfd_byte *) - ext->x_sym.x_misc.x_lnsz.x_size); - } -end: ; - /* the semicolon is because MSVC doesn't like labels at - end of block. */ + if (ISFCN (type)) + { + in->x_sym.x_misc.x_fsize = bfd_h_get_32 (abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize); + } + else + { + in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_16 (abfd, (bfd_byte *) + ext->x_sym.x_misc.x_lnsz.x_lnno); + in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_16 (abfd, (bfd_byte *) + ext->x_sym.x_misc.x_lnsz.x_size); + } + end: ; + /* The semicolon is because MSVC doesn't like labels at + end of block. */ } +unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR)); unsigned int _bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) - bfd *abfd; - PTR inp; + bfd * abfd; + PTR inp; int type; int class; int indx ATTRIBUTE_UNUSED; int numaux ATTRIBUTE_UNUSED; - PTR extp; + PTR extp; { union internal_auxent *in = (union internal_auxent *)inp; AUXENT *ext = (AUXENT *)extp; @@ -428,60 +442,61 @@ _bfd_xcoff_swap_aux_out (abfd, inp, type memset((PTR)ext, 0, bfd_coff_auxesz (abfd)); switch (class) { - case C_FILE: - if (in->x_file.x_fname[0] == 0) - { - PUTWORD(abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes); - PUTWORD(abfd, - in->x_file.x_n.x_offset, - (bfd_byte *) ext->x_file.x_n.x_offset); - } - else - { - memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); - } - goto end; - - /* RS/6000 "csect" auxents */ - case C_EXT: - case C_HIDEXT: - if (indx + 1 == numaux) - { - PUTWORD (abfd, in->x_csect.x_scnlen.l,ext->x_csect.x_scnlen); - PUTWORD (abfd, in->x_csect.x_parmhash, ext->x_csect.x_parmhash); - PUTHALF (abfd, in->x_csect.x_snhash, ext->x_csect.x_snhash); - /* We don't have to hack bitfields in x_smtyp because it's - defined by shifts-and-ands, which are equivalent on all - byte orders. */ - PUTBYTE (abfd, in->x_csect.x_smtyp, ext->x_csect.x_smtyp); - PUTBYTE (abfd, in->x_csect.x_smclas, ext->x_csect.x_smclas); - PUTWORD (abfd, in->x_csect.x_stab, ext->x_csect.x_stab); - PUTHALF (abfd, in->x_csect.x_snstab, ext->x_csect.x_snstab); - goto end; - } - break; - - case C_STAT: - case C_LEAFSTAT: - case C_HIDDEN: - if (type == T_NULL) { - bfd_h_put_32(abfd, in->x_scn.x_scnlen, (bfd_byte *) ext->x_scn.x_scnlen); - bfd_h_put_16(abfd, in->x_scn.x_nreloc, (bfd_byte *) ext->x_scn.x_nreloc); - bfd_h_put_16(abfd, in->x_scn.x_nlinno, (bfd_byte *) ext->x_scn.x_nlinno); + case C_FILE: + if (in->x_file.x_fname[0] == 0) + { + PUTWORD (abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes); + PUTWORD (abfd, + in->x_file.x_n.x_offset, + (bfd_byte *) ext->x_file.x_n.x_offset); + } + else + { + memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); + } goto end; + + /* RS/6000 "csect" auxents */ + case C_EXT: + case C_HIDEXT: + if (indx + 1 == numaux) + { + PUTWORD (abfd, in->x_csect.x_scnlen.l,ext->x_csect.x_scnlen); + PUTWORD (abfd, in->x_csect.x_parmhash, ext->x_csect.x_parmhash); + PUTHALF (abfd, in->x_csect.x_snhash, ext->x_csect.x_snhash); + /* We don't have to hack bitfields in x_smtyp because it's + defined by shifts-and-ands, which are equivalent on all + byte orders. */ + PUTBYTE (abfd, in->x_csect.x_smtyp, ext->x_csect.x_smtyp); + PUTBYTE (abfd, in->x_csect.x_smclas, ext->x_csect.x_smclas); + PUTWORD (abfd, in->x_csect.x_stab, ext->x_csect.x_stab); + PUTHALF (abfd, in->x_csect.x_snstab, ext->x_csect.x_snstab); + goto end; + } + break; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) + { + bfd_h_put_32(abfd, in->x_scn.x_scnlen, (bfd_byte *) ext->x_scn.x_scnlen); + bfd_h_put_16(abfd, in->x_scn.x_nreloc, (bfd_byte *) ext->x_scn.x_nreloc); + bfd_h_put_16(abfd, in->x_scn.x_nlinno, (bfd_byte *) ext->x_scn.x_nlinno); + goto end; + } + break; } - break; - } - PUTWORD(abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx); + PUTWORD (abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx); bfd_h_put_16 (abfd, in->x_sym.x_tvndx , (bfd_byte *) ext->x_sym.x_tvndx); if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) { - bfd_h_put_32(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, - (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); - PUTWORD(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, - (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx); + bfd_h_put_32 (abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); + PUTWORD (abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx); } else { @@ -500,10 +515,10 @@ _bfd_xcoff_swap_aux_out (abfd, inp, type (bfd_byte *) ext->x_sym.x_misc.x_fsize); else { - bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, - (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno); - bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_size, - (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_size); + bfd_h_put_16 (abfd, in->x_sym.x_misc.x_lnsz.x_lnno, + (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno); + bfd_h_put_16 (abfd, in->x_sym.x_misc.x_lnsz.x_size, + (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_size); } end: @@ -1527,6 +1542,7 @@ xcoff_write_armap_old (abfd, elength, ma } /* Write a single armap in the big format. */ + static boolean xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64, prevoff, nextoff) @@ -1544,7 +1560,7 @@ xcoff_write_one_armap_big (abfd, map, or unsigned char buf[4]; bfd *sub; file_ptr fileoff; - const bfd_arch_info_type *arch_info; + const bfd_arch_info_type *arch_info = NULL; bfd *object_bfd; unsigned int i; @@ -1553,13 +1569,16 @@ xcoff_write_one_armap_big (abfd, map, or machines) since the fields's width is 20 and there numbers with more than 32 bits can be represented. */ sprintf (hdr.size, "%ld", (long) (4 + orl_ccount * 4 + stridx)); - if (bits64) { - sprintf (hdr.nextoff, "%d", 0); - } else { - /* do explict cast to long to remove compiler warning */ - sprintf (hdr.nextoff, "%ld", (strtol (prevoff, (char **) NULL, 10) - + (long) (4 + orl_ccount * 4 + stridx))); - } + if (bits64) + { + sprintf (hdr.nextoff, "%d", 0); + } + else + { + /* Do explict cast to long to remove compiler warning. */ + sprintf (hdr.nextoff, "%ld", (strtol (prevoff, (char **) NULL, 10) + + (long) (4 + orl_ccount * 4 + stridx))); + } memcpy (hdr.prevoff, prevoff, sizeof (hdr.prevoff)); sprintf (hdr.date, "%d", 0); @@ -1642,7 +1661,6 @@ xcoff_write_one_armap_big (abfd, map, or return true; } -/*ARGSUSED*/ static boolean xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) bfd *abfd; @@ -1654,7 +1672,7 @@ xcoff_write_armap_big (abfd, elength, ma unsigned int i; unsigned int orl_count_32, orl_count_64; unsigned int stridx_32, stridx_64; - const bfd_arch_info_type *arch_info; + const bfd_arch_info_type *arch_info = NULL; bfd *object_bfd; /* First, we look through the symbols and work out which are @@ -1685,7 +1703,7 @@ xcoff_write_armap_big (abfd, elength, ma } /* A quick sanity check... */ BFD_ASSERT (orl_count_64 + orl_count_32 == orl_count); - /* explicit cast to int for compiler */ + /* Explicit cast to int for compiler. */ BFD_ASSERT ((int)(stridx_64 + stridx_32) == stridx); /* Now write out each map. */ @@ -1703,7 +1721,6 @@ xcoff_write_armap_big (abfd, elength, ma return true; } -/*ARGSUSED*/ boolean _bfd_xcoff_write_armap (abfd, elength, map, orl_count, stridx) bfd *abfd; @@ -2247,7 +2264,6 @@ _bfd_xcoff_write_archive_contents (abfd) /* We can't use the usual coff_sizeof_headers routine, because AIX always uses an a.out header. */ -/*ARGSUSED*/ int _bfd_xcoff_sizeof_headers (abfd, reloc) bfd *abfd; @@ -2490,17 +2506,17 @@ xcoff_ppc_relocate_section (output_bfd, if this reloc is against the TOC anchor. */ if (sec->name[3] == '0' - && strcmp (sec->name, ".tc0") == 0) { - - val = xcoff_data (output_bfd)->toc; - } else { - - val = (sec->output_section->vma - + sec->output_offset - + sym->n_value - - sec->vma); - } - + && strcmp (sec->name, ".tc0") == 0) + { + val = xcoff_data (output_bfd)->toc; + } + else + { + val = (sec->output_section->vma + + sec->output_offset + + sym->n_value + - sec->vma); + } } } else @@ -2735,7 +2751,6 @@ xcoff_ppc_relocate_section (output_bfd, name = h->root.root.string; else { - name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); if (name == NULL) @@ -2804,23 +2819,26 @@ _bfd_xcoff_put_ldsymbol_name (abfd, ldin static boolean _bfd_xcoff_put_symbol_name (bfd *abfd, struct bfd_strtab_hash *strtab, struct internal_syment *sym, - const char *name) { - - if (strlen (name) <= SYMNMLEN) { - strncpy (sym->_n._n_name, name, SYMNMLEN); - } else { - boolean hash; - bfd_size_type indx; + const char *name) +{ + if (strlen (name) <= SYMNMLEN) + { + strncpy (sym->_n._n_name, name, SYMNMLEN); + } + else + { + boolean hash; + bfd_size_type indx; - hash = true; - if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0) - hash = false; - indx = _bfd_stringtab_add (strtab, name, hash, false); - if (indx == (bfd_size_type) -1) - return false; - sym->_n._n_n._n_zeroes = 0; - sym->_n._n_n._n_offset = STRING_SIZE_SIZE + indx; - } + hash = true; + if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0) + hash = false; + indx = _bfd_stringtab_add (strtab, name, hash, false); + if (indx == (bfd_size_type) -1) + return false; + sym->_n._n_n._n_zeroes = 0; + sym->_n._n_n._n_offset = STRING_SIZE_SIZE + indx; + } return true; } @@ -2830,32 +2848,30 @@ xcoff_create_csect_from_smclas (abfd, au union internal_auxent *aux; const char *symbol_name; { - asection *return_value = NULL; - /* - * .sv64 = x_smclas == 17 - * This is an invalid csect for 32 bit apps. - */ - static const char *names[19] = { + /* .sv64 = x_smclas == 17 + This is an invalid csect for 32 bit apps. */ + static const char *names[19] = + { ".pr", ".ro", ".db", ".tc", ".ua", ".rw", ".gl", ".xo", ".sv", ".bs", ".ds", ".uc", ".ti", ".tb", NULL, ".tc0", ".td", NULL, ".sv3264" }; if ((19 >= aux->x_csect.x_smclas) && - (NULL != names[aux->x_csect.x_smclas])) { - - return_value = bfd_make_section_anyway - (abfd, names[aux->x_csect.x_smclas]); - - - } else { - (*_bfd_error_handler) - (_("%s: symbol `%s' has unrecognized smclas %d"), - bfd_get_filename (abfd), symbol_name, aux->x_csect.x_smclas); - bfd_set_error (bfd_error_bad_value); - } + (NULL != names[aux->x_csect.x_smclas])) + { + return_value = bfd_make_section_anyway + (abfd, names[aux->x_csect.x_smclas]); + } + else + { + (*_bfd_error_handler) + (_("%s: symbol `%s' has unrecognized smclas %d"), + bfd_get_filename (abfd), symbol_name, aux->x_csect.x_smclas); + bfd_set_error (bfd_error_bad_value); + } return return_value; } @@ -2865,9 +2881,9 @@ xcoff_is_lineno_count_overflow (abfd, va bfd *abfd ATTRIBUTE_UNUSED; bfd_vma value; { - if (0xffff <= value) { + if (0xffff <= value) return true; - } + return false; } @@ -2876,16 +2892,16 @@ xcoff_is_reloc_count_overflow (abfd, val bfd *abfd ATTRIBUTE_UNUSED; bfd_vma value; { - if (0xffff <= value) { + if (0xffff <= value) return true; - } + return false; } static bfd_vma xcoff_loader_symbol_offset (abfd, ldhdr) bfd *abfd; - struct internal_ldhdr *ldhdr ATTRIBUTE_UNUSED; + struct internal_ldhdr *ldhdr ATTRIBUTE_UNUSED; { return bfd_xcoff_ldhdrsz(abfd); } @@ -2893,7 +2909,7 @@ xcoff_loader_symbol_offset (abfd, ldhdr) static bfd_vma xcoff_loader_reloc_offset (abfd, ldhdr) bfd *abfd; - struct internal_ldhdr *ldhdr; + struct internal_ldhdr *ldhdr; { return bfd_xcoff_ldhdrsz(abfd) + (ldhdr->l_nsyms * bfd_xcoff_ldsymsz(abfd)); @@ -2915,121 +2931,117 @@ HOWTO (0, /* type */ 0xffffffff, /* dst_mask */ false); /* pcrel_offset */ -/* - * glink - * - * The first word of global linkage code must be modified by filling in - * the correct TOC offset. - */ +/* glink + + The first word of global linkage code must be modified by filling in + the correct TOC offset. */ + static unsigned long xcoff_glink_code[9] = -{ - 0x81820000, /* lwz r12,0(r2) */ - 0x90410014, /* stw r2,20(r1) */ - 0x800c0000, /* lwz r0,0(r12) */ - 0x804c0004, /* lwz r2,4(r12) */ - 0x7c0903a6, /* mtctr r0 */ - 0x4e800420, /* bctr */ - 0x00000000, /* start of traceback table */ - 0x000c8000, /* traceback table */ - 0x00000000, /* traceback table */ -}; + { + 0x81820000, /* lwz r12,0(r2) */ + 0x90410014, /* stw r2,20(r1) */ + 0x800c0000, /* lwz r0,0(r12) */ + 0x804c0004, /* lwz r2,4(r12) */ + 0x7c0903a6, /* mtctr r0 */ + 0x4e800420, /* bctr */ + 0x00000000, /* start of traceback table */ + 0x000c8000, /* traceback table */ + 0x00000000, /* traceback table */ + }; static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = -{ - { /* COFF backend, defined in libcoff.h */ - _bfd_xcoff_swap_aux_in, /* _bfd_coff_swap_aux_in */ - _bfd_xcoff_swap_sym_in, /* _bfd_coff_swap_sym_in */ - coff_swap_lineno_in, /* _bfd_coff_swap_lineno_in */ - _bfd_xcoff_swap_aux_out, /* _bfd_swap_aux_out */ - _bfd_xcoff_swap_sym_out, /* _bfd_swap_sym_out */ - coff_swap_lineno_out, /* _bfd_swap_lineno_out */ - coff_swap_reloc_out, /* _bfd_swap_reloc_out */ - coff_swap_filehdr_out, /* _bfd_swap_filehdr_out */ - coff_swap_aouthdr_out, /* _bfd_swap_aouthdr_out */ - coff_swap_scnhdr_out, /* _bfd_swap_scnhdr_out */ - FILHSZ, /* _bfd_filhsz */ - AOUTSZ, /* _bfd_aoutsz */ - SCNHSZ, /* _bfd_scnhsz */ - SYMESZ, /* _bfd_symesz */ - AUXESZ, /* _bfd_auxesz */ - RELSZ, /* _bfd_relsz */ - LINESZ, /* _bfd_linesz */ - FILNMLEN, /* _bfd_filnmlen */ - true, /* _bfd_coff_long_filenames */ - false, /* _bfd_coff_long_section_names */ - (3), /* _bfd_coff_default_section_alignment_power */ - false, /* _bfd_coff_force_symnames_in_strings */ - 2, /* _bfd_coff_debug_string_prefix_length */ - coff_swap_filehdr_in, /* _bfd_coff_swap_filehdr_in */ - coff_swap_aouthdr_in, /* _bfd_swap_aouthdr_in */ - coff_swap_scnhdr_in, /* _bfd_swap_scnhdr_in */ - coff_swap_reloc_in, /* _bfd_reloc_in */ - coff_bad_format_hook, /* _bfd_bad_format_hook */ - coff_set_arch_mach_hook, /* _bfd_set_arch_mach_hook */ - coff_mkobject_hook, /* _bfd_mkobject_hook */ - styp_to_sec_flags, /* _bfd_syp_to_sec_flags */ - coff_set_alignment_hook, /* _bfd_set_alignment_hook */ - coff_slurp_symbol_table, /* _bfd_coff_slurp_symbol_table */ - symname_in_debug_hook, /* _coff_symname_in_debug_hook */ - coff_pointerize_aux_hook, /* _bfd_coff_pointerize_aux_hook */ - coff_print_aux, /* bfd_coff_print_aux */ - dummy_reloc16_extra_cases, /* _bfd_coff_reloc16_extra_cases */ - dummy_reloc16_estimate, /* _bfd_coff_reloc16_estimate */ - NULL, /* bfd_coff_sym_is_global */ - /* _bfd_coff_compute_section_file_positions */ - coff_compute_section_file_positions, - NULL , /* _bfd_coff_start_final_link */ - xcoff_ppc_relocate_section, /* _bfd_coff_relocate_section */ - coff_rtype_to_howto, /* _bfd_coff_rtype_to_howto */ - NULL , /* _bfd_coff_addust_symndx */ - _bfd_generic_link_add_one_symbol, /* _bfd_coff_add_one_symbol */ - coff_link_output_has_begun, /* _bfd_coff_link_output_has_begun */ - coff_final_link_postscript /* _bfd_coff_final_link_postscript */ - }, - - 0x01DF, /* magic number */ - bfd_arch_rs6000, /* architecture */ - bfd_mach_rs6k, /* machine */ - - - /* function pointers to xcoff specific swap routines */ - xcoff_swap_ldhdr_in, /* _xcoff_swap_ldhdr_in */ - xcoff_swap_ldhdr_out, /* _xcoff_swap_ldhdr_out */ - xcoff_swap_ldsym_in, /* _xcoff_swap_ldsym_in */ - xcoff_swap_ldsym_out, /* _xcoff_swap_ldsym_out */ - xcoff_swap_ldrel_in, /* _xcoff_swap_ldrel_in */ - xcoff_swap_ldrel_out, /* _xcoff_swap_ldrel_out */ - - /* sizes */ - LDHDRSZ, /* _xcoff_ldhdrsz */ - LDSYMSZ, /* _xcoff_ldsymsz */ - LDRELSZ, /* _xcoff_ldrelsz */ - 12, /* _xcoff_function_descriptor_size */ - SMALL_AOUTSZ, /* _xcoff_small_aout_header_size */ - - /* versions */ - 1, /* _xcoff_ldhdr_version */ - - /* xcoff vs xcoff64 putting symbol names */ - _bfd_xcoff_put_symbol_name, /* _xcoff_put_symbol_name */ - _bfd_xcoff_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */ - - &xcoff_dynamic_reloc, /* dynamic reloc howto */ - - xcoff_create_csect_from_smclas, /* _xcoff_create_csect_from_smclas */ - - /* lineno and reloc count overflow */ - xcoff_is_lineno_count_overflow, - xcoff_is_reloc_count_overflow, - - xcoff_loader_symbol_offset, - xcoff_loader_reloc_offset, - - /* glink */ - &xcoff_glink_code[0], - (36), /* _xcoff_glink_size */ + { + { /* COFF backend, defined in libcoff.h. */ + _bfd_xcoff_swap_aux_in, /* _bfd_coff_swap_aux_in */ + _bfd_xcoff_swap_sym_in, /* _bfd_coff_swap_sym_in */ + coff_swap_lineno_in, /* _bfd_coff_swap_lineno_in */ + _bfd_xcoff_swap_aux_out, /* _bfd_swap_aux_out */ + _bfd_xcoff_swap_sym_out, /* _bfd_swap_sym_out */ + coff_swap_lineno_out, /* _bfd_swap_lineno_out */ + coff_swap_reloc_out, /* _bfd_swap_reloc_out */ + coff_swap_filehdr_out, /* _bfd_swap_filehdr_out */ + coff_swap_aouthdr_out, /* _bfd_swap_aouthdr_out */ + coff_swap_scnhdr_out, /* _bfd_swap_scnhdr_out */ + FILHSZ, /* _bfd_filhsz */ + AOUTSZ, /* _bfd_aoutsz */ + SCNHSZ, /* _bfd_scnhsz */ + SYMESZ, /* _bfd_symesz */ + AUXESZ, /* _bfd_auxesz */ + RELSZ, /* _bfd_relsz */ + LINESZ, /* _bfd_linesz */ + FILNMLEN, /* _bfd_filnmlen */ + true, /* _bfd_coff_long_filenames */ + false, /* _bfd_coff_long_section_names */ + (3), /* _bfd_coff_default_section_alignment_power */ + false, /* _bfd_coff_force_symnames_in_strings */ + 2, /* _bfd_coff_debug_string_prefix_length */ + coff_swap_filehdr_in, /* _bfd_coff_swap_filehdr_in */ + coff_swap_aouthdr_in, /* _bfd_swap_aouthdr_in */ + coff_swap_scnhdr_in, /* _bfd_swap_scnhdr_in */ + coff_swap_reloc_in, /* _bfd_reloc_in */ + coff_bad_format_hook, /* _bfd_bad_format_hook */ + coff_set_arch_mach_hook, /* _bfd_set_arch_mach_hook */ + coff_mkobject_hook, /* _bfd_mkobject_hook */ + styp_to_sec_flags, /* _bfd_syp_to_sec_flags */ + coff_set_alignment_hook, /* _bfd_set_alignment_hook */ + coff_slurp_symbol_table, /* _bfd_coff_slurp_symbol_table */ + symname_in_debug_hook, /* _coff_symname_in_debug_hook */ + coff_pointerize_aux_hook, /* _bfd_coff_pointerize_aux_hook */ + coff_print_aux, /* bfd_coff_print_aux */ + dummy_reloc16_extra_cases, /* _bfd_coff_reloc16_extra_cases */ + dummy_reloc16_estimate, /* _bfd_coff_reloc16_estimate */ + NULL, /* bfd_coff_sym_is_global */ + coff_compute_section_file_positions, /* _bfd_coff_compute_section_file_positions */ + NULL , /* _bfd_coff_start_final_link */ + xcoff_ppc_relocate_section, /* _bfd_coff_relocate_section */ + coff_rtype_to_howto, /* _bfd_coff_rtype_to_howto */ + NULL , /* _bfd_coff_addust_symndx */ + _bfd_generic_link_add_one_symbol, /* _bfd_coff_add_one_symbol */ + coff_link_output_has_begun, /* _bfd_coff_link_output_has_begun */ + coff_final_link_postscript /* _bfd_coff_final_link_postscript */ + }, + + 0x01DF, /* magic number */ + bfd_arch_rs6000, /* architecture */ + bfd_mach_rs6k, /* machine */ + /* Function pointers to xcoff specific swap routines. */ + xcoff_swap_ldhdr_in, /* _xcoff_swap_ldhdr_in */ + xcoff_swap_ldhdr_out, /* _xcoff_swap_ldhdr_out */ + xcoff_swap_ldsym_in, /* _xcoff_swap_ldsym_in */ + xcoff_swap_ldsym_out, /* _xcoff_swap_ldsym_out */ + xcoff_swap_ldrel_in, /* _xcoff_swap_ldrel_in */ + xcoff_swap_ldrel_out, /* _xcoff_swap_ldrel_out */ + + /* Sizes. */ + LDHDRSZ, /* _xcoff_ldhdrsz */ + LDSYMSZ, /* _xcoff_ldsymsz */ + LDRELSZ, /* _xcoff_ldrelsz */ + 12, /* _xcoff_function_descriptor_size */ + SMALL_AOUTSZ, /* _xcoff_small_aout_header_size */ + + /* Versions. */ + 1, /* _xcoff_ldhdr_version */ + + /* Xcoff vs xcoff64 putting symbol names. */ + _bfd_xcoff_put_symbol_name, /* _xcoff_put_symbol_name */ + _bfd_xcoff_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */ + + & xcoff_dynamic_reloc, /* dynamic reloc howto */ + + xcoff_create_csect_from_smclas, /* _xcoff_create_csect_from_smclas */ + + /* Lineno and reloc count overflow. */ + xcoff_is_lineno_count_overflow, + xcoff_is_reloc_count_overflow, + + xcoff_loader_symbol_offset, + xcoff_loader_reloc_offset, + + /* glink. */ + & xcoff_glink_code[0], + (36), /* _xcoff_glink_size */ }; /* The transfer vector that leads the outside world to all of the above. */ diff -uprN binutils-2.11.90.0.27/bfd/coff-sh.c binutils-2.11.90.0.29/bfd/coff-sh.c --- binutils-2.11.90.0.27/bfd/coff-sh.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/coff-sh.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for Hitachi Super-H COFF binaries. - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . @@ -65,6 +65,7 @@ static boolean sh_relocate_section static bfd_byte *sh_coff_get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, boolean, asymbol **)); +static reloc_howto_type * sh_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); #ifdef COFF_WITH_PE /* Can't build import tables with 2**4 alignment. */ @@ -83,6 +84,7 @@ static bfd_byte *sh_coff_get_relocated_s #define COFF_LONG_FILENAMES #ifdef COFF_WITH_PE +static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); /* Return true if this relocation should appear in the output .reloc section. */ static boolean in_reloc_p (abfd, howto) @@ -412,6 +414,7 @@ get_symbol_value (symbol) /* Convert an rtype to howto for the COFF backend linker. Copied from coff-i386. */ #define coff_rtype_to_howto coff_sh_rtype_to_howto +static reloc_howto_type * coff_sh_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); static reloc_howto_type * coff_sh_rtype_to_howto (abfd, sec, rel, h, sym, addendp) @@ -2074,6 +2077,7 @@ static const struct sh_minor_opcode sh_o { MAP (sh_opcodef1), 0xf0ff } }; +#ifndef COFF_IMAGE_WITH_PE static struct sh_major_opcode sh_opcodes[] = { { MAP (sh_opcode0) }, @@ -2093,6 +2097,7 @@ static struct sh_major_opcode sh_opcodes { MAP (sh_opcodee) }, { MAP (sh_opcodef) } }; +#endif /* The double data transfer / parallel processing insns are not described here. This will cause sh_align_load_span to leave them alone. */ @@ -3133,6 +3138,8 @@ CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SY #endif #ifndef TARGET_SHL_SYM +static const bfd_target * coff_small_object_p PARAMS ((bfd *)); +static boolean coff_small_new_section_hook PARAMS ((bfd *, asection *)); /* Some people want versions of the SH COFF target which do not align to 16 byte boundaries. We implement that by adding a couple of new target vectors. These are just like the ones above, but they diff -uprN binutils-2.11.90.0.27/bfd/coff-sparc.c binutils-2.11.90.0.29/bfd/coff-sparc.c --- binutils-2.11.90.0.27/bfd/coff-sparc.c Fri Mar 9 11:15:32 2001 +++ binutils-2.11.90.0.29/bfd/coff-sparc.c Wed Aug 22 08:52:09 2001 @@ -1,5 +1,5 @@ /* BFD back-end for Sparc COFF files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -33,6 +33,11 @@ Foundation, Inc., 59 Temple Place - Suit /* The page size is a guess based on ELF. */ #define COFF_PAGE_SIZE 0x10000 + +static reloc_howto_type *coff_sparc_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); +static void rtype2howto PARAMS ((arelent *, struct internal_reloc *)); + enum reloc_type { R_SPARC_NONE = 0, diff -uprN binutils-2.11.90.0.27/bfd/coff-stgo32.c binutils-2.11.90.0.29/bfd/coff-stgo32.c --- binutils-2.11.90.0.27/bfd/coff-stgo32.c Sat Feb 3 14:52:23 2001 +++ binutils-2.11.90.0.29/bfd/coff-stgo32.c Mon Aug 27 11:44:51 2001 @@ -47,7 +47,11 @@ { COFF_SECTION_NAME_EXACT_MATCH (".data"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".text"), \ - COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 } + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 } #include "bfd.h" diff -uprN binutils-2.11.90.0.27/bfd/coff-tic30.c binutils-2.11.90.0.29/bfd/coff-tic30.c --- binutils-2.11.90.0.27/bfd/coff-tic30.c Fri Mar 9 11:15:32 2001 +++ binutils-2.11.90.0.29/bfd/coff-tic30.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C30 coff binaries. - Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) This file is part of BFD, the Binary File Descriptor library. @@ -27,22 +27,28 @@ #include "coff/internal.h" #include "libcoff.h" +static int coff_tic30_select_reloc PARAMS ((reloc_howto_type *)); +static void rtype2howto PARAMS ((arelent *, struct internal_reloc *)); +static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); + +reloc_howto_type * tic30_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); + #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1) reloc_howto_type tic30_coff_howto_table[] = -{ - HOWTO (R_TIC30_ABS16, 2, 1, 16, false, 0, 0, NULL, - "16", false, 0x0000FFFF, 0x0000FFFF, false), - HOWTO (R_TIC30_ABS24, 2, 2, 24, false, 8, complain_overflow_bitfield, NULL, - "24", false, 0xFFFFFF00, 0xFFFFFF00, false), - HOWTO (R_TIC30_LDP, 18, 0, 24, false, 0, complain_overflow_bitfield, NULL, - "LDP", false, 0x00FF0000, 0x000000FF, false), - HOWTO (R_TIC30_ABS32, 2, 2, 32, false, 0, complain_overflow_bitfield, NULL, - "32", false, 0xFFFFFFFF, 0xFFFFFFFF, false), - HOWTO (R_TIC30_PC16, 2, 1, 16, true, 0, complain_overflow_signed, NULL, - "PCREL", false, 0x0000FFFF, 0x0000FFFF, false), - EMPTY_HOWTO (-1) -}; + { + HOWTO (R_TIC30_ABS16, 2, 1, 16, false, 0, 0, NULL, + "16", false, 0x0000FFFF, 0x0000FFFF, false), + HOWTO (R_TIC30_ABS24, 2, 2, 24, false, 8, complain_overflow_bitfield, NULL, + "24", false, 0xFFFFFF00, 0xFFFFFF00, false), + HOWTO (R_TIC30_LDP, 18, 0, 24, false, 0, complain_overflow_bitfield, NULL, + "LDP", false, 0x00FF0000, 0x000000FF, false), + HOWTO (R_TIC30_ABS32, 2, 2, 32, false, 0, complain_overflow_bitfield, NULL, + "32", false, 0xFFFFFFFF, 0xFFFFFFFF, false), + HOWTO (R_TIC30_PC16, 2, 1, 16, true, 0, complain_overflow_signed, NULL, + "PCREL", false, 0x0000FFFF, 0x0000FFFF, false), + EMPTY_HOWTO (-1) + }; #ifndef coff_bfd_reloc_type_lookup #define coff_bfd_reloc_type_lookup tic30_coff_reloc_type_lookup @@ -50,6 +56,7 @@ reloc_howto_type tic30_coff_howto_table[ /* For the case statement use the code values used in tc_gen_reloc to map to the howto table entries that match those in both the aout and coff implementations. */ + reloc_howto_type * tic30_coff_reloc_type_lookup (abfd, code) bfd *abfd ATTRIBUTE_UNUSED; @@ -75,7 +82,7 @@ tic30_coff_reloc_type_lookup (abfd, code #endif -/* Turn a howto into a reloc number */ +/* Turn a howto into a reloc number. */ static int coff_tic30_select_reloc (howto) @@ -126,7 +133,7 @@ rtype2howto (internal, dst) } } -#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) +#define RTYPE2HOWTO(internal, relocentry) rtype2howto (internal, relocentry) /* Perform any necessary magic to the addend in a reloc entry */ @@ -148,13 +155,10 @@ reloc_processing (relent, reloc, symbols rtype2howto (relent, reloc); if (reloc->r_symndx > 0) - { - relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; - } + relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; else - { - relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - } + relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; + relent->addend = reloc->r_offset; relent->address -= section->vma; } diff -uprN binutils-2.11.90.0.27/bfd/coff-tic54x.c binutils-2.11.90.0.29/bfd/coff-tic54x.c --- binutils-2.11.90.0.27/bfd/coff-tic54x.c Fri Mar 9 11:15:32 2001 +++ binutils-2.11.90.0.29/bfd/coff-tic54x.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C54X coff binaries. - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Timothy Wall (twall@cygnus.com) This file is part of BFD, the Binary File Descriptor library. @@ -27,23 +27,37 @@ #include "coff/internal.h" #include "libcoff.h" -#undef F_LSYMS +#undef F_LSYMS #define F_LSYMS F_LSYMS_TICOFF -/* - 32-bit operations - The octet order is screwy. words are LSB first (LS octet, actually), but - longwords are MSW first. For example, 0x12345678 is encoded 0x5678 in the - first word and 0x1234 in the second. When looking at the data as stored in - the COFF file, you would see the octets ordered as 0x78, 0x56, 0x34, 0x12. - Don't bother with 64-bits, as there aren't any. - */ +static void tic54x_reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); +static bfd_reloc_status_type tic54x_relocation PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static boolean tic54x_set_section_contents PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); +static reloc_howto_type * coff_tic54x_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); +static bfd_vma tic54x_getl32 PARAMS ((const bfd_byte *)); +static void tic54x_putl32 PARAMS ((bfd_vma, bfd_byte *)); +static bfd_signed_vma tic54x_getl_signed_32 PARAMS ((const bfd_byte *)); +static boolean tic54x_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); +static reloc_howto_type * tic54x_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); +static void tic54x_lookup_howto PARAMS ((arelent *, struct internal_reloc *)); +static boolean ticoff0_bad_format_hook PARAMS ((bfd *, PTR)); +static boolean ticoff1_bad_format_hook PARAMS ((bfd *, PTR)); +static boolean ticoff_bfd_is_local_label_name PARAMS ((bfd *, const char *)); + +/* 32-bit operations + The octet order is screwy. words are LSB first (LS octet, actually), but + longwords are MSW first. For example, 0x12345678 is encoded 0x5678 in the + first word and 0x1234 in the second. When looking at the data as stored in + the COFF file, you would see the octets ordered as 0x78, 0x56, 0x34, 0x12. + Don't bother with 64-bits, as there aren't any. */ + static bfd_vma -tic54x_getl32(addr) - register const bfd_byte *addr; +tic54x_getl32 (addr) + const bfd_byte *addr; { unsigned long v; - v = (unsigned long) addr[2]; + + v = (unsigned long) addr[2]; v |= (unsigned long) addr[3] << 8; v |= (unsigned long) addr[0] << 16; v |= (unsigned long) addr[1] << 24; @@ -53,7 +67,7 @@ tic54x_getl32(addr) static void tic54x_putl32 (data, addr) bfd_vma data; - register bfd_byte *addr; + bfd_byte *addr; { addr[2] = (bfd_byte)data; addr[3] = (bfd_byte) (data >> 8); @@ -67,7 +81,7 @@ tic54x_getl_signed_32 (addr) { unsigned long v; - v = (unsigned long) addr[2]; + v = (unsigned long) addr[2]; v |= (unsigned long) addr[3] << 8; v |= (unsigned long) addr[0] << 16; v |= (unsigned long) addr[1] << 24; @@ -110,6 +124,7 @@ bfd_ticoff_get_section_load_page (sect) /* Set the architecture appropriately. Allow unkown architectures (e.g. binary). */ + static boolean tic54x_set_arch_mach (abfd, arch, machine) bfd *abfd; @@ -136,7 +151,6 @@ tic54x_relocation (abfd, reloc_entry, sy bfd *output_bfd; char **error_message ATTRIBUTE_UNUSED; { - if (output_bfd != (bfd *) NULL) { /* This is a partial relocation, and we want to apply the @@ -149,73 +163,73 @@ tic54x_relocation (abfd, reloc_entry, sy } reloc_howto_type tic54x_howto_table[] = -{ -/* type,rightshift,size (0=byte, 1=short, 2=long), - bit size, pc_relative, bitpos, dont complain_on_overflow, - special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset */ - - /* NORMAL BANK */ - /* 16-bit direct reference to symbol's address */ - HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont, - tic54x_relocation,"REL16",false,0xFFFF,0xFFFF,false), - - /* 7 LSBs of an address */ - HOWTO (R_PARTLS7,0,1,7,false,0,complain_overflow_dont, - tic54x_relocation,"LS7",false,0x007F,0x007F,false), - - /* 9 MSBs of an address */ - /* TI assembler doesn't shift its encoding, and is thus incompatible */ - HOWTO (R_PARTMS9,7,1,9,false,0,complain_overflow_dont, - tic54x_relocation,"MS9",false,0x01FF,0x01FF,false), - - /* 23-bit relocation */ - HOWTO (R_EXTWORD,0,2,23,false,0,complain_overflow_dont, - tic54x_relocation,"RELEXT",false,0x7FFFFF,0x7FFFFF,false), - - /* 16 bits of 23-bit extended address */ - HOWTO (R_EXTWORD16,0,1,16,false,0,complain_overflow_dont, - tic54x_relocation,"RELEXT16",false,0x7FFFFF,0x7FFFFF,false), - - /* upper 7 bits of 23-bit extended address */ - HOWTO (R_EXTWORDMS7,16,1,7,false,0,complain_overflow_dont, - tic54x_relocation,"RELEXTMS7",false,0x7F,0x7F,false), - - /* ABSOLUTE BANK */ - /* 16-bit direct reference to symbol's address, absolute */ - HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont, - tic54x_relocation,"AREL16",false,0xFFFF,0xFFFF,false), - - /* 7 LSBs of an address, absolute */ - HOWTO (R_PARTLS7,0,1,7,false,0,complain_overflow_dont, - tic54x_relocation,"ALS7",false,0x007F,0x007F,false), - - /* 9 MSBs of an address, absolute */ - /* TI assembler doesn't shift its encoding, and is thus incompatible */ - HOWTO (R_PARTMS9,7,1,9,false,0,complain_overflow_dont, - tic54x_relocation,"AMS9",false,0x01FF,0x01FF,false), - - /* 23-bit direct reference, absolute */ - HOWTO (R_EXTWORD,0,2,23,false,0,complain_overflow_dont, - tic54x_relocation,"ARELEXT",false,0x7FFFFF,0x7FFFFF,false), - - /* 16 bits of 23-bit extended address, absolute */ - HOWTO (R_EXTWORD16,0,1,16,false,0,complain_overflow_dont, - tic54x_relocation,"ARELEXT16",false,0x7FFFFF,0x7FFFFF,false), - - /* upper 7 bits of 23-bit extended address, absolute */ - HOWTO (R_EXTWORDMS7,16,1,7,false,0,complain_overflow_dont, - tic54x_relocation,"ARELEXTMS7",false,0x7F,0x7F,false), - - /* 32-bit relocation exclusively for stabs */ - HOWTO (R_RELLONG,0,2,32,false,0,complain_overflow_dont, - tic54x_relocation,"STAB",false,0xFFFFFFFF,0xFFFFFFFF,false), - -}; + { + /* type,rightshift,size (0=byte, 1=short, 2=long), + bit size, pc_relative, bitpos, dont complain_on_overflow, + special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset. */ + + /* NORMAL BANK */ + /* 16-bit direct reference to symbol's address. */ + HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont, + tic54x_relocation,"REL16",false,0xFFFF,0xFFFF,false), + + /* 7 LSBs of an address */ + HOWTO (R_PARTLS7,0,1,7,false,0,complain_overflow_dont, + tic54x_relocation,"LS7",false,0x007F,0x007F,false), + + /* 9 MSBs of an address */ + /* TI assembler doesn't shift its encoding, and is thus incompatible */ + HOWTO (R_PARTMS9,7,1,9,false,0,complain_overflow_dont, + tic54x_relocation,"MS9",false,0x01FF,0x01FF,false), + + /* 23-bit relocation */ + HOWTO (R_EXTWORD,0,2,23,false,0,complain_overflow_dont, + tic54x_relocation,"RELEXT",false,0x7FFFFF,0x7FFFFF,false), + + /* 16 bits of 23-bit extended address */ + HOWTO (R_EXTWORD16,0,1,16,false,0,complain_overflow_dont, + tic54x_relocation,"RELEXT16",false,0x7FFFFF,0x7FFFFF,false), + + /* upper 7 bits of 23-bit extended address */ + HOWTO (R_EXTWORDMS7,16,1,7,false,0,complain_overflow_dont, + tic54x_relocation,"RELEXTMS7",false,0x7F,0x7F,false), + + /* ABSOLUTE BANK */ + /* 16-bit direct reference to symbol's address, absolute */ + HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont, + tic54x_relocation,"AREL16",false,0xFFFF,0xFFFF,false), + + /* 7 LSBs of an address, absolute */ + HOWTO (R_PARTLS7,0,1,7,false,0,complain_overflow_dont, + tic54x_relocation,"ALS7",false,0x007F,0x007F,false), + + /* 9 MSBs of an address, absolute */ + /* TI assembler doesn't shift its encoding, and is thus incompatible */ + HOWTO (R_PARTMS9,7,1,9,false,0,complain_overflow_dont, + tic54x_relocation,"AMS9",false,0x01FF,0x01FF,false), + + /* 23-bit direct reference, absolute */ + HOWTO (R_EXTWORD,0,2,23,false,0,complain_overflow_dont, + tic54x_relocation,"ARELEXT",false,0x7FFFFF,0x7FFFFF,false), + + /* 16 bits of 23-bit extended address, absolute */ + HOWTO (R_EXTWORD16,0,1,16,false,0,complain_overflow_dont, + tic54x_relocation,"ARELEXT16",false,0x7FFFFF,0x7FFFFF,false), + + /* upper 7 bits of 23-bit extended address, absolute */ + HOWTO (R_EXTWORDMS7,16,1,7,false,0,complain_overflow_dont, + tic54x_relocation,"ARELEXTMS7",false,0x7F,0x7F,false), + + /* 32-bit relocation exclusively for stabs */ + HOWTO (R_RELLONG,0,2,32,false,0,complain_overflow_dont, + tic54x_relocation,"STAB",false,0xFFFFFFFF,0xFFFFFFFF,false), + }; #define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup /* For the case statement use the code values used tc_gen_reloc (defined in - bfd/reloc.c) to map to the howto table entries */ + bfd/reloc.c) to map to the howto table entries. */ + reloc_howto_type * tic54x_coff_reloc_type_lookup (abfd, code) bfd *abfd ATTRIBUTE_UNUSED; @@ -243,7 +257,8 @@ tic54x_coff_reloc_type_lookup (abfd, cod } /* Code to turn a r_type into a howto ptr, uses the above howto table. - Called after some initial checking by the tic54x_rtype_to_howto fn below */ + Called after some initial checking by the tic54x_rtype_to_howto fn below. */ + static void tic54x_lookup_howto (internal, dst) arelent *internal; @@ -251,6 +266,7 @@ tic54x_lookup_howto (internal, dst) { unsigned i; int bank = (dst->r_symndx == -1) ? HOWTO_BANK : 0; + for (i = 0; i < sizeof tic54x_howto_table/sizeof tic54x_howto_table[0]; i++) { if (tic54x_howto_table[i].type == dst->r_type) @@ -268,8 +284,6 @@ tic54x_lookup_howto (internal, dst) #define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\ tic54x_reloc_processing(RELENT,RELOC,SYMS,ABFD,SECT) -static void tic54x_reloc_processing(); - #define coff_rtype_to_howto coff_tic54x_rtype_to_howto static reloc_howto_type * @@ -322,8 +336,9 @@ ticoff1_bad_format_hook (abfd, filehdr) return true; } -/* replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local - labels */ +/* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local + labels. */ + static boolean ticoff_bfd_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; @@ -339,8 +354,7 @@ ticoff_bfd_is_local_label_name (abfd, na /* Customize coffcode.h; the default coff_ functions are set up to use COFF2; coff_bad_format_hook uses BADMAG, so set that for COFF2. The COFF1 and COFF0 vectors use custom _bad_format_hook procs instead of setting - BADMAG. - */ + BADMAG. */ #define BADMAG(x) COFF2_BADMAG(x) #include "coffcode.h" @@ -396,365 +410,365 @@ tic54x_reloc_processing (relent, reloc, refering to the symbols in the raw data have not been modified, so we have to have a negative addend to compensate. - Note that symbols which used to be common must be left alone */ + Note that symbols which used to be common must be left alone. */ - /* Calculate any reloc addend by looking at the symbol */ + /* Calculate any reloc addend by looking at the symbol. */ CALC_ADDEND (abfd, ptr, *reloc, relent); relent->address -= section->vma; /* !! relent->section = (asection *) NULL;*/ - /* Fill in the relent->howto field from reloc->r_type */ + /* Fill in the relent->howto field from reloc->r_type. */ tic54x_lookup_howto (relent, reloc); } -/* COFF0 differs in file/section header size and relocation entry size */ +/* COFF0 differs in file/section header size and relocation entry size. */ static CONST bfd_coff_backend_data ticoff0_swap_table = -{ - coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, - coff_SWAP_aux_out, coff_SWAP_sym_out, - coff_SWAP_lineno_out, coff_SWAP_reloc_out, - coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, - coff_SWAP_scnhdr_out, - FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN, + { + coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, + coff_SWAP_aux_out, coff_SWAP_sym_out, + coff_SWAP_lineno_out, coff_SWAP_reloc_out, + coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, + coff_SWAP_scnhdr_out, + FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN, #ifdef COFF_LONG_FILENAMES - true, + true, #else - false, + false, #endif #ifdef COFF_LONG_SECTION_NAMES - true, + true, #else - false, + false, #endif #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS - true, + true, #else - false, + false, #endif #ifdef COFF_DEBUG_STRING_WIDE_PREFIX - 4, + 4, #else - 2, + 2, #endif - COFF_DEFAULT_SECTION_ALIGNMENT_POWER, - coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, - coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook, - coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, - coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, - coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, - coff_classify_symbol, coff_compute_section_file_positions, - coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, - coff_adjust_symndx, coff_link_add_one_symbol, - coff_link_output_has_begun, coff_final_link_postscript -}; + COFF_DEFAULT_SECTION_ALIGNMENT_POWER, + coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, + coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook, + coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, + coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, + coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, + coff_classify_symbol, coff_compute_section_file_positions, + coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, + coff_adjust_symndx, coff_link_add_one_symbol, + coff_link_output_has_begun, coff_final_link_postscript + }; -/* COFF1 differs in section header size */ +/* COFF1 differs in section header size. */ static CONST bfd_coff_backend_data ticoff1_swap_table = -{ - coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, - coff_SWAP_aux_out, coff_SWAP_sym_out, - coff_SWAP_lineno_out, coff_SWAP_reloc_out, - coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, - coff_SWAP_scnhdr_out, - FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN, + { + coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, + coff_SWAP_aux_out, coff_SWAP_sym_out, + coff_SWAP_lineno_out, coff_SWAP_reloc_out, + coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, + coff_SWAP_scnhdr_out, + FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN, #ifdef COFF_LONG_FILENAMES - true, + true, #else - false, + false, #endif #ifdef COFF_LONG_SECTION_NAMES - true, + true, #else - false, + false, #endif - COFF_DEFAULT_SECTION_ALIGNMENT_POWER, + COFF_DEFAULT_SECTION_ALIGNMENT_POWER, #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS - true, + true, #else - false, + false, #endif #ifdef COFF_DEBUG_STRING_WIDE_PREFIX - 4, + 4, #else - 2, + 2, #endif - coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, - coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook, - coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, - coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, - coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, - coff_classify_symbol, coff_compute_section_file_positions, - coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, - coff_adjust_symndx, coff_link_add_one_symbol, - coff_link_output_has_begun, coff_final_link_postscript -}; + coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, + coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook, + coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, + coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, + coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, + coff_classify_symbol, coff_compute_section_file_positions, + coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, + coff_adjust_symndx, coff_link_add_one_symbol, + coff_link_output_has_begun, coff_final_link_postscript + }; -/* TI COFF v0, DOS tools (little-endian headers) */ +/* TI COFF v0, DOS tools (little-endian headers). */ const bfd_target tic54x_coff0_vec = -{ - "coff0-c54x", /* name */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* data byte order is little */ - BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (tic54x), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - NULL, + { + "coff0-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + NULL, - (PTR)&ticoff0_swap_table -}; + (PTR) & ticoff0_swap_table + }; -/* TI COFF v0, SPARC tools (big-endian headers) */ +/* TI COFF v0, SPARC tools (big-endian headers). */ const bfd_target tic54x_coff0_beh_vec = -{ - "coff0-beh-c54x", /* name */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* data byte order is little */ - BFD_ENDIAN_BIG, /* header byte order is big */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (tic54x), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + { + "coff0-beh-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - &tic54x_coff0_vec, + & tic54x_coff0_vec, - (PTR)&ticoff0_swap_table -}; + (PTR) & ticoff0_swap_table + }; -/* TI COFF v1, DOS tools (little-endian headers) */ +/* TI COFF v1, DOS tools (little-endian headers). */ const bfd_target tic54x_coff1_vec = -{ - "coff1-c54x", /* name */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* data byte order is little */ - BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (tic54x), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + { + "coff1-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - &tic54x_coff0_beh_vec, + & tic54x_coff0_beh_vec, - (PTR)&ticoff1_swap_table + (PTR) & ticoff1_swap_table }; -/* TI COFF v1, SPARC tools (big-endian headers) */ +/* TI COFF v1, SPARC tools (big-endian headers). */ const bfd_target tic54x_coff1_beh_vec = -{ - "coff1-beh-c54x", /* name */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* data byte order is little */ - BFD_ENDIAN_BIG, /* header byte order is big */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (tic54x), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + { + "coff1-beh-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - &tic54x_coff1_vec, + & tic54x_coff1_vec, - (PTR)&ticoff1_swap_table -}; + (PTR) & ticoff1_swap_table + }; -/* TI COFF v2, TI DOS tools output (little-endian headers) */ +/* TI COFF v2, TI DOS tools output (little-endian headers). */ const bfd_target tic54x_coff2_vec = -{ - "coff2-c54x", /* name */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* data byte order is little */ - BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (tic54x), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + { + "coff2-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - &tic54x_coff1_beh_vec, + & tic54x_coff1_beh_vec, - COFF_SWAP_TABLE -}; + COFF_SWAP_TABLE + }; -/* TI COFF v2, TI SPARC tools output (big-endian headers) */ +/* TI COFF v2, TI SPARC tools output (big-endian headers). */ const bfd_target tic54x_coff2_beh_vec = -{ - "coff2-beh-c54x", /* name */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* data byte order is little */ - BFD_ENDIAN_BIG, /* header byte order is big */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (tic54x), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + { + "coff2-beh-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - &tic54x_coff2_vec, + & tic54x_coff2_vec, - COFF_SWAP_TABLE -}; + COFF_SWAP_TABLE + }; diff -uprN binutils-2.11.90.0.27/bfd/coff-tic80.c binutils-2.11.90.0.29/bfd/coff-tic80.c --- binutils-2.11.90.0.27/bfd/coff-tic80.c Fri Mar 9 11:37:54 2001 +++ binutils-2.11.90.0.29/bfd/coff-tic80.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP). - Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Fred Fish (fnf@cygnus.com) @@ -51,6 +51,10 @@ static bfd_reloc_status_type local16_rel static boolean coff_tic80_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); +static reloc_howto_type * coff_tic80_rtype_to_howto + PARAMS ((bfd *, asection *, struct internal_reloc *, + struct coff_link_hash_entry *, struct internal_syment *, + bfd_vma *)); static reloc_howto_type tic80_howto_table[] = { diff -uprN binutils-2.11.90.0.27/bfd/coff-w65.c binutils-2.11.90.0.29/bfd/coff-w65.c --- binutils-2.11.90.0.27/bfd/coff-w65.c Fri Mar 9 11:15:32 2001 +++ binutils-2.11.90.0.29/bfd/coff-w65.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for WDC 65816 COFF binaries. - Copyright 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain, . This file is part of BFD, the Binary File Descriptor library. @@ -26,23 +26,28 @@ Foundation, Inc., 59 Temple Place - Suit #include "coff/internal.h" #include "libcoff.h" +static int select_reloc PARAMS ((reloc_howto_type *)); +static void rtype2howto PARAMS ((arelent *, struct internal_reloc *)); +static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); +static int w65_reloc16_estimate PARAMS ((bfd *, asection *, arelent *, unsigned int, struct bfd_link_info *)); +static void w65_reloc16_extra_cases PARAMS ((bfd *,struct bfd_link_info *, struct bfd_link_order *, arelent *, bfd_byte *, unsigned int *, unsigned int *)); + #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1) static reloc_howto_type howto_table[] = -{ - HOWTO (R_W65_ABS8, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "abs8", true, 0x000000ff, 0x000000ff, false), - HOWTO (R_W65_ABS16, 1, 0, 16, false, 0, complain_overflow_bitfield, 0, "abs16", true, 0x0000ffff, 0x0000ffff, false), - HOWTO (R_W65_ABS24, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "abs24", true, 0x00ffffff, 0x00ffffff, false), - HOWTO (R_W65_ABS8S8, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, ">abs8", true, 0x000000ff, 0x000000ff, false), - HOWTO (R_W65_ABS8S16, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "^abs8", true, 0x000000ff, 0x000000ff, false), - HOWTO (R_W65_ABS16S8, 1, 0, 16, false, 0, complain_overflow_bitfield, 0, ">abs16", true, 0x0000ffff, 0x0000ffff, false), - HOWTO (R_W65_ABS16S16,1, 0, 16, false, 0, complain_overflow_bitfield, 0, "^abs16", true, 0x0000ffff, 0x0000ffff, false), - HOWTO (R_W65_PCR8, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "pcrel8", true, 0x000000ff, 0x000000ff, true), - HOWTO (R_W65_PCR16, 1, 0, 16, false, 0, complain_overflow_bitfield, 0, "pcrel16", true, 0x0000ffff, 0x0000ffff, true), - HOWTO (R_W65_DP, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "dp", true, 0x000000ff, 0x000000ff, false), - -}; + { + HOWTO (R_W65_ABS8, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "abs8", true, 0x000000ff, 0x000000ff, false), + HOWTO (R_W65_ABS16, 1, 0, 16, false, 0, complain_overflow_bitfield, 0, "abs16", true, 0x0000ffff, 0x0000ffff, false), + HOWTO (R_W65_ABS24, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "abs24", true, 0x00ffffff, 0x00ffffff, false), + HOWTO (R_W65_ABS8S8, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, ">abs8", true, 0x000000ff, 0x000000ff, false), + HOWTO (R_W65_ABS8S16, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "^abs8", true, 0x000000ff, 0x000000ff, false), + HOWTO (R_W65_ABS16S8, 1, 0, 16, false, 0, complain_overflow_bitfield, 0, ">abs16", true, 0x0000ffff, 0x0000ffff, false), + HOWTO (R_W65_ABS16S16,1, 0, 16, false, 0, complain_overflow_bitfield, 0, "^abs16", true, 0x0000ffff, 0x0000ffff, false), + HOWTO (R_W65_PCR8, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "pcrel8", true, 0x000000ff, 0x000000ff, true), + HOWTO (R_W65_PCR16, 1, 0, 16, false, 0, complain_overflow_bitfield, 0, "pcrel16", true, 0x0000ffff, 0x0000ffff, true), + HOWTO (R_W65_DP, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "dp", true, 0x000000ff, 0x000000ff, false), + }; -/* Turn a howto into a reloc number */ +/* Turn a howto into a reloc number. */ #define SELECT_RELOC(x,howto) \ { x.r_type = select_reloc(howto); } @@ -65,20 +70,19 @@ select_reloc (howto) return howto->type ; } -/* Code to turn a r_type into a howto ptr, uses the above howto table - */ +/* Code to turn a r_type into a howto ptr, uses the above howto table. */ static void rtype2howto (internal, dst) arelent *internal; struct internal_reloc *dst; { - internal->howto = howto_table + dst->r_type - 1; + internal->howto = howto_table + dst->r_type - 1; } #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) -/* Perform any necessary magic to the addend in a reloc entry */ +/* Perform any necessary magic to the addend in a reloc entry. */ #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ cache_ptr->addend = ext_reloc.r_offset; @@ -98,13 +102,9 @@ reloc_processing (relent, reloc, symbols rtype2howto (relent, reloc); if (((int) reloc->r_symndx) > 0) - { - relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; - } + relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; else - { - relent->sym_ptr_ptr = (asymbol **)&(bfd_abs_symbol); - } + relent->sym_ptr_ptr = (asymbol **)&(bfd_abs_symbol); relent->addend = reloc->r_offset; @@ -113,7 +113,7 @@ reloc_processing (relent, reloc, symbols } static int -h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) +w65_reloc16_estimate (abfd, input_section, reloc, shrink, link_info) bfd *abfd; asection *input_section; arelent *reloc; @@ -127,7 +127,7 @@ h8300_reloc16_estimate(abfd, input_secti /* The address of the thing to be relocated will have moved back by the size of the shrink - but we don't change reloc->address here, since we need it to know where the relocation lives in the source - uncooked section */ + uncooked section. */ /* reloc->address -= shrink; conceptual */ @@ -140,75 +140,69 @@ h8300_reloc16_estimate(abfd, input_secti shrink+=2; break; - /* Thing is a move one byte */ + /* Thing is a move one byte. */ case R_MOV16B1: - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); if (value >= 0xff00) { - /* Change the reloc type from 16bit, possible 8 to 8bit - possible 16 */ + possible 16. */ reloc->howto = reloc->howto + 1; - /* The place to relc moves back by one */ - /* This will be two bytes smaller in the long run */ - shrink +=2 ; - bfd_perform_slip(abfd, 2, input_section, address); + /* The place to relc moves back by one. */ + /* This will be two bytes smaller in the long run. */ + shrink += 2; + bfd_perform_slip (abfd, 2, input_section, address); } break; /* This is the 24 bit branch which could become an 8 bitter, - the relocation points to the first byte of the insn, not the - actual data */ + the relocation points to the first byte of the insn, not the + actual data. */ case R_JMPL1: - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); dot = input_section->output_section->vma + input_section->output_offset + address; /* See if the address we're looking at within 127 bytes of where we are, if so then we can use a small branch rather than the - jump we were going to */ - - gap = value - dot ; + jump we were going to. */ + gap = value - dot; - if (-120 < (long)gap && (long)gap < 120 ) + if (-120 < (long) gap && (long) gap < 120) { - /* Change the reloc type from 24bit, possible 8 to 8bit - possible 32 */ + possible 32. */ reloc->howto = reloc->howto + 1; - /* This will be two bytes smaller in the long run */ - shrink +=2 ; - bfd_perform_slip(abfd, 2, input_section, address); + /* This will be two bytes smaller in the long run. */ + shrink += 2; + bfd_perform_slip (abfd, 2, input_section, address); } break; case R_JMP1: - - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); dot = input_section->output_section->vma + input_section->output_offset + address; /* See if the address we're looking at within 127 bytes of where we are, if so then we can use a small branch rather than the - jump we were going to */ - + jump we were going to. */ gap = value - (dot - shrink); - if (-120 < (long)gap && (long)gap < 120 ) + if (-120 < (long) gap && (long) gap < 120) { - /* Change the reloc type from 16bit, possible 8 to 8bit - possible 16 */ + possible 16. */ reloc->howto = reloc->howto + 1; - /* The place to relc moves back by one */ + /* The place to relc moves back by one. */ - /* This will be two bytes smaller in the long run */ - shrink +=2 ; - bfd_perform_slip(abfd, 2, input_section, address); + /* This will be two bytes smaller in the long run. */ + shrink += 2; + bfd_perform_slip (abfd, 2, input_section, address); } break; } @@ -216,19 +210,17 @@ h8300_reloc16_estimate(abfd, input_secti return shrink; } -/* First phase of a relaxing link */ +/* First phase of a relaxing link. */ /* Reloc types large small R_MOV16B1 R_MOV16B2 mov.b with 16bit or 8 bit address R_JMP1 R_JMP2 jmp or pcrel branch R_JMPL1 R_JMPL_B8 24jmp or pcrel branch - R_MOV24B1 R_MOV24B2 24 or 8 bit reloc for mov.b - -*/ + R_MOV24B1 R_MOV24B2 24 or 8 bit reloc for mov.b */ static void -h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, +w65_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) bfd *abfd; struct bfd_link_info *link_info; @@ -270,7 +262,7 @@ h8300_reloc16_extra_cases (abfd, link_in { unsigned int gap = bfd_coff_reloc16_get_value (reloc, link_info, input_section); - gap >>=16; + gap >>= 16; bfd_put_8 (abfd, gap, data + dst_address); dst_address += 1; src_address += 1; @@ -313,7 +305,7 @@ h8300_reloc16_extra_cases (abfd, link_in unsigned int gap = bfd_coff_reloc16_get_value (reloc, link_info, input_section); bfd_put_16 (abfd, gap, data + dst_address); - bfd_put_8 (abfd, gap>>16, data+dst_address+2); + bfd_put_8 (abfd, gap >> 16, data+dst_address + 2); dst_address += 3; src_address += 3; } @@ -328,13 +320,14 @@ h8300_reloc16_extra_cases (abfd, link_in + link_order->u.indirect.section->output_section->vma; gap -= dot + 1; - if (gap < -128 || gap > 127) { - if (! ((*link_info->callbacks->reloc_overflow) - (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr), - reloc->howto->name, reloc->addend, input_section->owner, - input_section, reloc->address))) - abort (); - } + if (gap < -128 || gap > 127) + { + if (! ((*link_info->callbacks->reloc_overflow) + (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr), + reloc->howto->name, reloc->addend, input_section->owner, + input_section, reloc->address))) + abort (); + } bfd_put_8 (abfd, gap, data + dst_address); dst_address += 1; src_address += 1; @@ -350,14 +343,15 @@ h8300_reloc16_extra_cases (abfd, link_in + link_order->u.indirect.section->output_section->vma; /* This wraps within the page, so ignore the relativeness, look at the - high part */ - if ((gap & 0xf0000) != (dot & 0xf0000)) { - if (! ((*link_info->callbacks->reloc_overflow) - (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr), - reloc->howto->name, reloc->addend, input_section->owner, - input_section, reloc->address))) - abort (); - } + high part. */ + if ((gap & 0xf0000) != (dot & 0xf0000)) + { + if (! ((*link_info->callbacks->reloc_overflow) + (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr), + reloc->howto->name, reloc->addend, input_section->owner, + input_section, reloc->address))) + abort (); + } gap -= dot + 2; bfd_put_16 (abfd, gap, data + dst_address); @@ -372,11 +366,10 @@ h8300_reloc16_extra_cases (abfd, link_in } *src_ptr = src_address; *dst_ptr = dst_address; - } -#define coff_reloc16_extra_cases h8300_reloc16_extra_cases -#define coff_reloc16_estimate h8300_reloc16_estimate +#define coff_reloc16_extra_cases w65_reloc16_extra_cases +#define coff_reloc16_estimate w65_reloc16_estimate #include "coffcode.h" diff -uprN binutils-2.11.90.0.27/bfd/coff-z8k.c binutils-2.11.90.0.29/bfd/coff-z8k.c --- binutils-2.11.90.0.27/bfd/coff-z8k.c Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.29/bfd/coff-z8k.c Mon Aug 27 11:44:51 2001 @@ -28,6 +28,11 @@ Foundation, Inc., 59 Temple Place - Suit #include "coff/internal.h" #include "libcoff.h" +static void extra_case PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, bfd_byte *, unsigned int *, unsigned int *)); +static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); +static void rtype2howto PARAMS ((arelent *, struct internal_reloc *)); +static int coff_z8k_select_reloc PARAMS ((reloc_howto_type *)); + #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1) static reloc_howto_type r_imm32 = @@ -81,15 +86,14 @@ coff_z8k_select_reloc (howto) #define Z8K 1 /* Customize coffcode.h */ #define __A_MAGIC_SET__ -/* Code to swap in the reloc */ +/* Code to swap in the reloc. */ #define SWAP_IN_RELOC_OFFSET bfd_h_get_32 #define SWAP_OUT_RELOC_OFFSET bfd_h_put_32 #define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) \ dst->r_stuff[0] = 'S'; \ dst->r_stuff[1] = 'C'; -/* Code to turn a r_type into a howto ptr, uses the above howto table - */ +/* Code to turn a r_type into a howto ptr, uses the above howto table. */ static void rtype2howto (internal, dst) @@ -128,9 +132,9 @@ rtype2howto (internal, dst) } } -#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) +#define RTYPE2HOWTO(internal, relocentry) rtype2howto (internal, relocentry) -/* Perform any necessary magic to the addend in a reloc entry */ +/* Perform any necessary magic to the addend in a reloc entry. */ #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ cache_ptr->addend = ext_reloc.r_offset; diff -uprN binutils-2.11.90.0.27/bfd/coffcode.h binutils-2.11.90.0.29/bfd/coffcode.h --- binutils-2.11.90.0.27/bfd/coffcode.h Tue Jun 19 11:57:32 2001 +++ binutils-2.11.90.0.29/bfd/coffcode.h Wed Aug 22 08:52:09 2001 @@ -326,7 +326,7 @@ static boolean coff_set_flags static boolean coff_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); static boolean coff_compute_section_file_positions PARAMS ((bfd *)); -static boolean coff_write_object_contents PARAMS ((bfd *)); +static boolean coff_write_object_contents PARAMS ((bfd *)) ATTRIBUTE_UNUSED; static boolean coff_set_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); static PTR buy_and_read PARAMS ((bfd *, file_ptr, int, size_t)); diff -uprN binutils-2.11.90.0.27/bfd/coffgen.c binutils-2.11.90.0.29/bfd/coffgen.c --- binutils-2.11.90.0.27/bfd/coffgen.c Tue Jun 19 11:57:32 2001 +++ binutils-2.11.90.0.29/bfd/coffgen.c Mon Aug 27 11:44:51 2001 @@ -2106,16 +2106,18 @@ coff_print_symbol (abfd, filep, symbol, case C_EXT: if (ISFCN (combined->u.syment.n_type)) { + long next, llnos; + + if (auxp->fix_end) + next = (auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p + - root); + else + next = auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l; + llnos = auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_lnnoptr; fprintf (file, _("AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld"), - tagndx, - auxp->u.auxent.x_sym.x_misc.x_fsize, - auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_lnnoptr, - (auxp->fix_end - ? ((long) - (auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p - - root)) - : auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l)); + tagndx, auxp->u.auxent.x_sym.x_misc.x_fsize, + llnos, next); break; } /* else fall through */ @@ -2149,7 +2151,7 @@ coff_print_symbol (abfd, filep, symbol, } else { - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %-5s %s %s %s", symbol->section->name, coffsymbol (symbol)->native ? "n" : "g", @@ -2280,7 +2282,7 @@ coff_find_nearest_line (abfd, section, s /* Avoid endless loops on erroneous files by ensuring that we always move forward in the file. */ - if (p - cof->raw_syments >= p->u.syment.n_value) + if (p >= cof->raw_syments + p->u.syment.n_value) break; p = cof->raw_syments + p->u.syment.n_value; diff -uprN binutils-2.11.90.0.27/bfd/cofflink.c binutils-2.11.90.0.29/bfd/cofflink.c --- binutils-2.11.90.0.27/bfd/cofflink.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/bfd/cofflink.c Wed Aug 22 08:52:09 2001 @@ -1829,7 +1829,7 @@ _bfd_coff_link_input_bfd (finfo, input_b have to write the symbol out twice. */ if (finfo->last_file_index != -1 - && finfo->last_file.n_value != (long) output_index) + && finfo->last_file.n_value != (bfd_vma) output_index) { /* We must correct the value of the last C_FILE entry. */ diff -uprN binutils-2.11.90.0.27/bfd/config.bfd binutils-2.11.90.0.29/bfd/config.bfd --- binutils-2.11.90.0.27/bfd/config.bfd Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/bfd/config.bfd Mon Aug 27 11:44:51 2001 @@ -5,6 +5,8 @@ # Sets the following shell variables: # targ_defvec Default vector for this target # targ_selvecs Vectors to build for this target +# targ64_selvecs Vectors to build if --enable-64-bit-bfd is given +# or if host is 64 bit. # targ_archs Architectures for this target # targ_cflags $(CFLAGS) for this target (FIXME: pretty bogus) # targ_underscore Whether underscores are used: yes or no @@ -23,6 +25,7 @@ targ_defvec= targ_selvecs= +targ64_selvecs= targ_cflags= targ_underscore=no @@ -724,21 +727,28 @@ case "${targ}" in powerpc-*-aix* | powerpc-*-beos* | rs6000-*-*) targ_defvec=rs6000coff_vec -#ifdef BFD64 - targ_selvecs="rs6000coff64_vec" -#endif + targ64_selvecs="rs6000coff64_vec" ;; #ifdef BFD64 powerpc64-*-aix*) targ_defvec=rs6000coff64_vec targ_selvecs="rs6000coff_vec" ;; + powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux*) + targ_defvec=bfd_elf64_powerpc_vec + targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec" + ;; + powerpc64le-*-elf* | powerpcle-*-elf64*) + targ_defvec=bfd_elf64_powerpcle_vec + targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpcle_vec bfd_elf32_powerpc_vec rs6000coff_vec rs6000coff64_vec" + ;; #endif powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \ powerpc-*-chorus* | powerpc-*-vxworks*) targ_defvec=bfd_elf32_powerpc_vec targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" + targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" ;; powerpc-*-macos* | powerpc-*-mpw*) targ_defvec=pmac_xcoff_vec @@ -752,6 +762,7 @@ case "${targ}" in powerpcle-*-rtems*) targ_defvec=bfd_elf32_powerpcle_vec targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" + targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" ;; powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*) @@ -950,6 +961,12 @@ case "${targ}" in ;; esac +case "${host64}${want64}" in + *true*) + targ_selvecs="${targ_selvecs} ${targ64_selvecs}" + ;; +esac + # If we support any ELF target, then automatically add support for the # generic ELF targets. This permits an objdump with some ELF support # to be used on an arbitrary ELF file for anything other than diff -uprN binutils-2.11.90.0.27/bfd/configure binutils-2.11.90.0.29/bfd/configure --- binutils-2.11.90.0.27/bfd/configure Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/configure Mon Aug 27 11:44:51 2001 @@ -1116,7 +1116,7 @@ fi PACKAGE=bfd -VERSION=2.11.90.0.27 +VERSION=2.11.90.0.29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -2359,13 +2359,14 @@ ac_exeext=$EXEEXT host64=false target64=false +bfd_default_target_size=32 # host stuff: # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2369: checking for $ac_word" >&5 +echo "configure:2370: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2395,7 +2396,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2399: checking for $ac_word" >&5 +echo "configure:2400: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2446,7 +2447,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2450: checking for $ac_word" >&5 +echo "configure:2451: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2478,7 +2479,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2482: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2483: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2489,12 +2490,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2493 "configure" +#line 2494 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2520,12 +2521,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2524: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2525: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2529: checking whether we are using GNU C" >&5 +echo "configure:2530: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2534,7 +2535,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2539: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2553,7 +2554,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2557: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2558: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2587,7 +2588,7 @@ fi ALL_LINGUAS= echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2591: checking how to run the C preprocessor" >&5 +echo "configure:2592: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2602,13 +2603,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2619,13 +2620,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2630: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2636,13 +2637,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2669,7 +2670,7 @@ echo "$ac_t""$CPP" 1>&6 # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2673: checking for $ac_word" >&5 +echo "configure:2674: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2697,12 +2698,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2701: checking for ANSI C header files" >&5 +echo "configure:2702: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2710,7 +2711,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2714: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2727,7 +2728,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2745,7 +2746,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2766,7 +2767,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2777,7 +2778,7 @@ if (XOR (islower (i), ISLOWER (i)) || to exit (0); } EOF -if { (eval echo configure:2781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2801,12 +2802,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2805: checking for working const" >&5 +echo "configure:2806: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2876,21 +2877,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2880: checking for inline" >&5 +echo "configure:2881: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2916,12 +2917,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2920: checking for off_t" >&5 +echo "configure:2921: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2949,12 +2950,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2953: checking for size_t" >&5 +echo "configure:2954: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2984,19 +2985,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2988: checking for working alloca.h" >&5 +echo "configure:2989: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3017,12 +3018,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3021: checking for alloca" >&5 +echo "configure:3022: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3082,12 +3083,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3086: checking whether alloca needs Cray hooks" >&5 +echo "configure:3087: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3116: checking for $ac_func" >&5 +echo "configure:3117: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3167,7 +3168,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3171: checking stack direction for C alloca" >&5 +echo "configure:3172: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3175,7 +3176,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3219,17 +3220,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3223: checking for $ac_hdr" >&5 +echo "configure:3224: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3258,12 +3259,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3262: checking for $ac_func" >&5 +echo "configure:3263: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3311,7 +3312,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3315: checking for working mmap" >&5 +echo "configure:3316: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3319,7 +3320,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3487,17 +3488,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3491: checking for $ac_hdr" >&5 +echo "configure:3492: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3527,12 +3528,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3531: checking for $ac_func" >&5 +echo "configure:3532: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3584,12 +3585,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3588: checking for $ac_func" >&5 +echo "configure:3589: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3646,19 +3647,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3650: checking for LC_MESSAGES" >&5 +echo "configure:3651: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3679,7 +3680,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3683: checking whether NLS is requested" >&5 +echo "configure:3684: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3699,7 +3700,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3703: checking whether included gettext is requested" >&5 +echo "configure:3704: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3718,17 +3719,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3722: checking for libintl.h" >&5 +echo "configure:3723: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3745,19 +3746,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3749: checking for gettext in libc" >&5 +echo "configure:3750: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3773,7 +3774,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3777: checking for bindtextdomain in -lintl" >&5 +echo "configure:3778: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3781,7 +3782,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3808,19 +3809,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3812: checking for gettext in libintl" >&5 +echo "configure:3813: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3848,7 +3849,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3852: checking for $ac_word" >&5 +echo "configure:3853: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3882,12 +3883,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3886: checking for $ac_func" >&5 +echo "configure:3887: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3937,7 +3938,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3941: checking for $ac_word" >&5 +echo "configure:3942: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3973,7 +3974,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3977: checking for $ac_word" >&5 +echo "configure:3978: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4005,7 +4006,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4045,7 +4046,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4049: checking for $ac_word" >&5 +echo "configure:4050: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4079,7 +4080,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4083: checking for $ac_word" >&5 +echo "configure:4084: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4115,7 +4116,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4119: checking for $ac_word" >&5 +echo "configure:4120: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4205,7 +4206,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4209: checking for catalogs to be installed" >&5 +echo "configure:4210: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4233,17 +4234,17 @@ echo "configure:4209: checking for catal if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4237: checking for linux/version.h" >&5 +echo "configure:4238: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4321,7 +4322,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:4325: checking for a BSD compatible install" >&5 +echo "configure:4326: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4404,7 +4405,7 @@ if test "x$cross_compiling" = "xno"; the EXEEXT_FOR_BUILD='$(EXEEXT)' else echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6 -echo "configure:4408: checking for build system executable suffix" >&5 +echo "configure:4409: checking for build system executable suffix" >&5 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4432,17 +4433,17 @@ for ac_hdr in stddef.h string.h strings. do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4436: checking for $ac_hdr" >&5 +echo "configure:4437: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4472,17 +4473,17 @@ for ac_hdr in fcntl.h sys/file.h sys/tim do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4476: checking for $ac_hdr" >&5 +echo "configure:4477: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4509,12 +4510,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:4513: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:4514: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4523,7 +4524,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:4527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -4548,12 +4549,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/di do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:4552: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4553: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -4561,7 +4562,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4586,7 +4587,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4590: checking for opendir in -ldir" >&5 +echo "configure:4591: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4594,7 +4595,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4627,7 +4628,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4631: checking for opendir in -lx" >&5 +echo "configure:4632: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4635,7 +4636,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4671,12 +4672,12 @@ fi for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4675: checking for $ac_func" >&5 +echo "configure:4676: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4734,12 +4735,12 @@ EOF esac echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4738: checking whether strstr must be declared" >&5 +echo "configure:4739: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4760,7 +4761,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4781,12 +4782,12 @@ EOF fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4785: checking whether malloc must be declared" >&5 +echo "configure:4786: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4807,7 +4808,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:4811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -4828,12 +4829,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:4832: checking whether realloc must be declared" >&5 +echo "configure:4833: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4854,7 +4855,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:4858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -4875,12 +4876,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4879: checking whether free must be declared" >&5 +echo "configure:4880: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4901,7 +4902,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4922,12 +4923,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:4926: checking whether getenv must be declared" >&5 +echo "configure:4927: checking whether getenv must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4948,7 +4949,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:4952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -5005,6 +5006,9 @@ if test "${target}" = "${host}"; then COREFILE=trad-core.lo TRAD_HEADER='"hosts/symmetry.h"' ;; + i[3456]86-*-bsdi) + COREFILE= + ;; i[3456]86-*-bsd* | i[34567]86-*-freebsd[1234] | i[34567]86-*-freebsd[1234]\.* | i[34567]86-*-freebsd*aout*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386bsd.h"' @@ -5168,17 +5172,17 @@ if test "${target}" = "${host}"; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5172: checking for $ac_hdr" >&5 +echo "configure:5176: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5206,12 +5210,12 @@ done if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5210: checking for prstatus_t in sys/procfs.h" >&5 +echo "configure:5214: checking for prstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5228: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus_t=yes else @@ -5242,12 +5246,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6 echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5246: checking for prstatus32_t in sys/procfs.h" >&5 +echo "configure:5250: checking for prstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus32_t=yes else @@ -5278,12 +5282,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6 echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5282: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo "configure:5286: checking for prstatus_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes else @@ -5314,12 +5318,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6 echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5318: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 +echo "configure:5322: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes else @@ -5350,12 +5354,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6 echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5354: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:5358: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -5386,12 +5390,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5390: checking for pxstatus_t in sys/procfs.h" >&5 +echo "configure:5394: checking for pxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pxstatus_t=yes else @@ -5422,12 +5426,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6 echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5426: checking for pstatus32_t in sys/procfs.h" >&5 +echo "configure:5430: checking for pstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus32_t=yes else @@ -5458,12 +5462,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6 echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5462: checking for prpsinfo_t in sys/procfs.h" >&5 +echo "configure:5466: checking for prpsinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else @@ -5494,12 +5498,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6 echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5498: checking for prpsinfo32_t in sys/procfs.h" >&5 +echo "configure:5502: checking for prpsinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes else @@ -5530,12 +5534,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6 echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5534: checking for psinfo_t in sys/procfs.h" >&5 +echo "configure:5538: checking for psinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo_t=yes else @@ -5566,12 +5570,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6 echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5570: checking for psinfo32_t in sys/procfs.h" >&5 +echo "configure:5574: checking for psinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo32_t=yes else @@ -5602,12 +5606,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6 echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5606: checking for lwpstatus_t in sys/procfs.h" >&5 +echo "configure:5610: checking for lwpstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else @@ -5638,12 +5642,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6 echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5642: checking for lwpxstatus_t in sys/procfs.h" >&5 +echo "configure:5646: checking for lwpxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes else @@ -5674,12 +5678,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5678: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo "configure:5682: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes else @@ -5710,12 +5714,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5714: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo "configure:5718: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes else @@ -5746,12 +5750,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6 echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5750: checking for win32_pstatus_t in sys/procfs.h" >&5 +echo "configure:5754: checking for win32_pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes else @@ -5878,6 +5882,7 @@ elf="elf.lo elflink.lo dwarf1.lo" for vec in $selvecs do + target_size=32 case "$vec" in # This list is alphabetized to make it easy to compare # with the two vector lists in targets.c. @@ -5904,21 +5909,21 @@ do b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo" - target64=true ;; + target_size=64 ;; bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_ia64_aix_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_ia64_aix_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; @@ -5930,7 +5935,7 @@ do bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" - target64=true ;; + target_size=64 ;; bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; @@ -5941,14 +5946,14 @@ do bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" - target64=true ;; + target_size=64 ;; bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;; @@ -5963,6 +5968,10 @@ do bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; + bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" + target_size=64 ;; + bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" + target_size=64 ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; @@ -5973,27 +5982,27 @@ do bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" - target64=true ;; + target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" - target64=true ;; + target_size=64 ;; cisco_core_big_vec) tb="$tb cisco-core.lo" ;; cisco_core_little_vec) tb="$tb cisco-core.lo" ;; cris_aout_vec) tb="$tb aout-cris.lo" ;; demo_64_vec) tb="$tb demo64.lo aout64.lo" - target64=true ;; + target_size=64 ;; ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; ecoff_biglittle_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo" - target64=true ;; + target_size=64 ;; go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;; go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;; h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;; @@ -6038,10 +6047,10 @@ do newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;; nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo" - target64=true ;; + target_size=64 ;; nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;; nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo" - target64=true ;; + target_size=64 ;; riscix_vec) tb="$tb aout32.lo riscix.lo" ;; nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;; pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; @@ -6082,7 +6091,7 @@ do tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;; versados_vec) tb="$tb versados.lo" ;; vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" - target64=true ;; + target_size=64 ;; vms_vax_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;; w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;; we32kcoff_vec) tb="$tb coff-we32k.lo" ;; @@ -6091,6 +6100,13 @@ do "") ;; *) { echo "configure: error: *** unknown target vector $vec" 1>&2; exit 1; } ;; esac + + if test ${target_size} = 64; then + target64=true + fi + if test x"${vec}" = x"${defvec}"; then + bfd_default_target_size=${target_size} + fi done # Target architecture .o files. @@ -6157,6 +6173,7 @@ esac + tdefaults="" test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'" @@ -6168,17 +6185,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6172: checking for $ac_hdr" >&5 +echo "configure:6189: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6207,12 +6224,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6211: checking for $ac_func" >&5 +echo "configure:6228: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6260,7 +6277,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6264: checking for working mmap" >&5 +echo "configure:6281: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6268,7 +6285,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -6433,12 +6450,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6437: checking for $ac_func" >&5 +echo "configure:6454: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6702,6 +6719,7 @@ s%@wordsize@%$wordsize%g s%@all_backends@%$all_backends%g s%@bfd_backends@%$bfd_backends%g s%@bfd_machines@%$bfd_machines%g +s%@bfd_default_target_size@%$bfd_default_target_size%g s%@tdefaults@%$tdefaults%g CEOF diff -uprN binutils-2.11.90.0.27/bfd/configure.in binutils-2.11.90.0.29/bfd/configure.in --- binutils-2.11.90.0.27/bfd/configure.in Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/configure.in Mon Aug 27 11:44:51 2001 @@ -7,7 +7,7 @@ AC_INIT(libbfd.c) AC_CANONICAL_SYSTEM AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.11.90.0.27) +AM_INIT_AUTOMAKE(bfd, 2.11.90.0.29) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. @@ -82,6 +82,7 @@ AC_EXEEXT host64=false target64=false +bfd_default_target_size=32 # host stuff: @@ -169,6 +170,11 @@ changequote([,])dnl TRAD_HEADER='"hosts/symmetry.h"' ;; changequote(,)dnl + i[3456]86-*-bsdi) +changequote([,])dnl + COREFILE= + ;; +changequote(,)dnl i[3456]86-*-bsd* | i[34567]86-*-freebsd[1234] | i[34567]86-*-freebsd[1234]\.* | i[34567]86-*-freebsd*aout*) changequote([,])dnl COREFILE=trad-core.lo @@ -460,6 +466,7 @@ elf="elf.lo elflink.lo dwarf1.lo" for vec in $selvecs do + target_size=32 case "$vec" in # This list is alphabetized to make it easy to compare # with the two vector lists in targets.c. @@ -486,21 +493,21 @@ do b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo" - target64=true ;; + target_size=64 ;; bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_ia64_aix_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_ia64_aix_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; @@ -512,7 +519,7 @@ do bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" - target64=true ;; + target_size=64 ;; bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; @@ -523,14 +530,14 @@ do bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" - target64=true ;; + target_size=64 ;; bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;; @@ -545,6 +552,10 @@ do bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; + bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" + target_size=64 ;; + bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" + target_size=64 ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; @@ -555,27 +566,27 @@ do bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf" - target64=true ;; + target_size=64 ;; bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" - target64=true ;; + target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" - target64=true ;; + target_size=64 ;; cisco_core_big_vec) tb="$tb cisco-core.lo" ;; cisco_core_little_vec) tb="$tb cisco-core.lo" ;; cris_aout_vec) tb="$tb aout-cris.lo" ;; demo_64_vec) tb="$tb demo64.lo aout64.lo" - target64=true ;; + target_size=64 ;; ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; ecoff_biglittle_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo" - target64=true ;; + target_size=64 ;; go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;; go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;; h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;; @@ -620,10 +631,10 @@ do newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;; nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo" - target64=true ;; + target_size=64 ;; nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;; nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo" - target64=true ;; + target_size=64 ;; riscix_vec) tb="$tb aout32.lo riscix.lo" ;; nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;; pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; @@ -664,7 +675,7 @@ do tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;; versados_vec) tb="$tb versados.lo" ;; vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" - target64=true ;; + target_size=64 ;; vms_vax_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;; w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;; we32kcoff_vec) tb="$tb coff-we32k.lo" ;; @@ -673,6 +684,13 @@ do "") ;; *) AC_MSG_ERROR(*** unknown target vector $vec) ;; esac + + if test ${target_size} = 64; then + target64=true + fi + if test x"${vec}" = x"${defvec}"; then + bfd_default_target_size=${target_size} + fi done # Target architecture .o files. @@ -738,6 +756,7 @@ AC_SUBST(wordsize) AC_SUBST(all_backends) AC_SUBST(bfd_backends) AC_SUBST(bfd_machines) +AC_SUBST(bfd_default_target_size) tdefaults="" test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" diff -uprN binutils-2.11.90.0.27/bfd/cpu-powerpc.c binutils-2.11.90.0.29/bfd/cpu-powerpc.c --- binutils-2.11.90.0.27/bfd/cpu-powerpc.c Fri Mar 9 11:15:44 2001 +++ binutils-2.11.90.0.29/bfd/cpu-powerpc.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD PowerPC CPU definition - Copyright 1994, 1995, 1996, 2000 Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 2000, 2001 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -128,7 +128,7 @@ static const bfd_arch_info_type arch_inf "powerpc", "powerpc:620", 3, - false, /* not the default */ + BFD_DEFAULT_TARGET_SIZE == 64, /* default for 64 bit target */ powerpc_compatible, bfd_default_scan, &arch_info_struct[6] @@ -229,7 +229,7 @@ const bfd_arch_info_type bfd_powerpc_arc "powerpc", "powerpc:common", 3, - true, /* the default */ + BFD_DEFAULT_TARGET_SIZE != 64, /* default for 32 bit target */ powerpc_compatible, bfd_default_scan, &arch_info_struct[0] diff -uprN binutils-2.11.90.0.27/bfd/cpu-v850.c binutils-2.11.90.0.29/bfd/cpu-v850.c --- binutils-2.11.90.0.27/bfd/cpu-v850.c Fri Mar 9 11:15:44 2001 +++ binutils-2.11.90.0.29/bfd/cpu-v850.c Wed Aug 22 08:52:09 2001 @@ -1,5 +1,5 @@ /* BFD support for the NEC V850 processor - Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suit #include +static boolean scan PARAMS ((const struct bfd_arch_info *, const char *)); + static boolean scan (info, string) const struct bfd_arch_info * info; @@ -33,38 +35,34 @@ scan (info, string) unsigned long number; enum bfd_architecture arch; - /* First test for an exact match */ + /* First test for an exact match. */ if (strcasecmp (string, info->printable_name) == 0) return true; /* See how much of the supplied string matches with the architecture, eg the string m68k:68020 would match the m68k entry - up to the :, then we get left with the machine number */ - + up to the :, then we get left with the machine number. */ for (ptr_src = string, ptr_tst = info->arch_name; *ptr_src && *ptr_tst; ptr_src++, ptr_tst++) - { - if (*ptr_src != *ptr_tst) break; - } + if (*ptr_src != *ptr_tst) + break; - /* Chewed up as much of the architecture as will match, skip any - colons */ + /* Chewed up as much of the architecture as will match; + if there is a colon present skip it. */ if (*ptr_src == ':') - ptr_src++; + ptr_src ++; if (*ptr_src == 0) - { - /* nothing more, then only keep this one if it is the default - machine for this architecture */ - return info->the_default; - } + /* Nothing more, then only keep this one if it is + the default machine for this architecture. */ + return info->the_default; number = 0; while (isdigit ((unsigned char) *ptr_src)) { number = number * 10 + * ptr_src - '0'; - ptr_src++; + ptr_src ++; } switch (number) @@ -92,12 +90,12 @@ scan (info, string) static const bfd_arch_info_type arch_info_struct[] = { - N (bfd_mach_v850e, "v850e", false, &arch_info_struct[1]), + N (bfd_mach_v850e, "v850e", false, & arch_info_struct[1]), N (bfd_mach_v850ea, "v850ea", false, NULL) }; -#undef NEXT -#define NEXT &arch_info_struct[0] +#undef NEXT +#define NEXT & arch_info_struct[0] const bfd_arch_info_type bfd_v850_arch = N (bfd_mach_v850, "v850", true, NEXT); diff -uprN binutils-2.11.90.0.27/bfd/elf-bfd.h binutils-2.11.90.0.29/bfd/elf-bfd.h --- binutils-2.11.90.0.27/bfd/elf-bfd.h Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/elf-bfd.h Mon Aug 27 11:44:51 2001 @@ -281,6 +281,10 @@ struct elf_link_hash_table /* Get the ELF linker hash table from a link_info structure. */ #define elf_hash_table(p) ((struct elf_link_hash_table *) ((p)->hash)) + +/* Returns true if the hash table is a struct elf_link_hash_table. */ +#define is_elf_hash_table(p) \ + ((p)->hash->type == bfd_link_elf_hash_table) /* Constant information held for an ELF backend. */ @@ -339,6 +343,13 @@ struct elf_size_info { ? (elf_symbol_type *) (S) \ : 0) +enum elf_reloc_type_class { + reloc_class_normal, + reloc_class_relative, + reloc_class_plt, + reloc_class_copy +}; + struct elf_backend_data { /* The architecture for this backend. */ @@ -644,6 +655,13 @@ struct elf_backend_data note is found in a core file. */ boolean (*elf_backend_grok_psinfo) PARAMS ((bfd *, Elf_Internal_Note *)); + /* Functions to print VMAs. Special code to handle 64 bit ELF files. */ + void (* elf_backend_sprintf_vma) PARAMS ((bfd *, char *, bfd_vma)); + void (* elf_backend_fprintf_vma) PARAMS ((bfd *, PTR, bfd_vma)); + + /* This function returns class of a reloc type. */ + enum elf_reloc_type_class (* elf_backend_reloc_type_class) PARAMS ((int)); + /* The swapping table to use when dealing with ECOFF information. Used for the MIPS ELF .mdebug section. */ const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap; @@ -817,6 +835,7 @@ struct elf_obj_tdata struct bfd_strtab_hash *strtab_ptr; int num_locals; int num_globals; + int num_section_syms; asymbol **section_syms; /* STT_SECTION symbols for each section */ Elf_Internal_Shdr symtab_hdr; Elf_Internal_Shdr shstrtab_hdr; @@ -958,6 +977,7 @@ struct elf_obj_tdata #define elf_num_locals(bfd) (elf_tdata(bfd) -> num_locals) #define elf_num_globals(bfd) (elf_tdata(bfd) -> num_globals) #define elf_section_syms(bfd) (elf_tdata(bfd) -> section_syms) +#define elf_num_section_syms(bfd) (elf_tdata(bfd) -> num_section_syms) #define core_prpsinfo(bfd) (elf_tdata(bfd) -> prpsinfo) #define core_prstatus(bfd) (elf_tdata(bfd) -> prstatus) #define elf_gp(bfd) (elf_tdata(bfd) -> gp) @@ -1007,8 +1027,10 @@ extern void bfd_elf_print_symbol PARAMS #define bfd_elf32_print_symbol bfd_elf_print_symbol #define bfd_elf64_print_symbol bfd_elf_print_symbol -extern void bfd_elf_sprintf_vma PARAMS ((bfd *, char *, bfd_vma)); -extern void bfd_elf_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma)); +extern void _bfd_elf_sprintf_vma PARAMS ((bfd *, char *, bfd_vma)); +extern void _bfd_elf_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma)); + +extern enum elf_reloc_type_class _bfd_elf_reloc_type_class PARAMS ((int)); extern unsigned long bfd_elf_hash PARAMS ((const char *)); diff -uprN binutils-2.11.90.0.27/bfd/elf-m10200.c binutils-2.11.90.0.29/bfd/elf-m10200.c --- binutils-2.11.90.0.27/bfd/elf-m10200.c Fri Mar 9 11:37:56 2001 +++ binutils-2.11.90.0.29/bfd/elf-m10200.c Mon Aug 27 11:44:51 2001 @@ -31,6 +31,19 @@ static boolean mn10200_elf_relax_delete_ PARAMS ((bfd *, asection *, bfd_vma, int)); static boolean mn10200_elf_symbol_address_p PARAMS ((bfd *, asection *, Elf32_External_Sym *, bfd_vma)); +static bfd_reloc_status_type mn10200_elf_final_link_relocate + PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, + bfd_byte *, bfd_vma, bfd_vma, bfd_vma, + struct bfd_link_info *, asection *, int)); +static boolean mn10200_elf_relocate_section +PARAMS (( bfd *, struct bfd_link_info *, bfd *, asection *, + bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, + asection **)); +static boolean mn10200_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); +static bfd_byte * mn10200_elf_get_relocated_section_contents + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, boolean, asymbol **)); /* We have to use RELA instructions since md_apply_fix3 in the assembler does absolutely nothing. */ @@ -214,6 +227,7 @@ mn10200_info_to_howto (abfd, cache_ptr, } /* Perform a relocation as part of a final link. */ + static bfd_reloc_status_type mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd, input_section, contents, offset, value, diff -uprN binutils-2.11.90.0.27/bfd/elf-m10300.c binutils-2.11.90.0.29/bfd/elf-m10300.c --- binutils-2.11.90.0.27/bfd/elf-m10300.c Mon May 21 11:39:49 2001 +++ binutils-2.11.90.0.29/bfd/elf-m10300.c Mon Aug 27 11:44:51 2001 @@ -24,6 +24,24 @@ Foundation, Inc., 59 Temple Place - Suit #include "elf-bfd.h" #include "elf/mn10300.h" +static bfd_reloc_status_type mn10300_elf_final_link_relocate + PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *, + bfd_vma, bfd_vma, bfd_vma, struct bfd_link_info *, + asection *, int)); +static boolean mn10300_elf_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static boolean mn10300_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); +static bfd_byte * mn10300_elf_get_relocated_section_contents + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, boolean, asymbol **)); +static int elf_mn10300_mach PARAMS ((flagword)); + +void _bfd_mn10300_elf_final_write_processing PARAMS ((bfd *, boolean)); +boolean _bfd_mn10300_elf_object_p PARAMS ((bfd *)); +boolean _bfd_mn10300_elf_merge_private_bfd_data PARAMS ((bfd *,bfd *)); + struct elf32_mn10300_link_hash_entry { /* The basic elf link hash table entry. */ struct elf_link_hash_entry root; @@ -599,8 +617,8 @@ mn10300_elf_relocate_section (output_bfd else { h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - while (h->root.type == bfd_link_hash_indirect - || h->root.type == bfd_link_hash_warning) + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) h = (struct elf32_mn10300_link_hash_entry *) h->root.root.u.i.link; if (h->root.root.type == bfd_link_hash_defined || h->root.root.type == bfd_link_hash_defweak) diff -uprN binutils-2.11.90.0.27/bfd/elf.c binutils-2.11.90.0.29/bfd/elf.c --- binutils-2.11.90.0.27/bfd/elf.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/elf.c Mon Aug 27 11:44:51 2001 @@ -571,6 +571,8 @@ _bfd_elf_merge_sections (abfd, info) bfd *abfd; struct bfd_link_info *info; { + if (!is_elf_hash_table (info)) + return false; if (elf_hash_table (info)->merge_info) _bfd_merge_sections (abfd, elf_hash_table (info)->merge_info); return true; @@ -612,16 +614,16 @@ _bfd_elf_print_private_bfd_data (abfd, f default: sprintf (buf, "0x%lx", p->p_type); s = buf; break; } fprintf (f, "%8s off 0x", s); - fprintf_vma (f, p->p_offset); + bfd_fprintf_vma (abfd, f, p->p_offset); fprintf (f, " vaddr 0x"); - fprintf_vma (f, p->p_vaddr); + bfd_fprintf_vma (abfd, f, p->p_vaddr); fprintf (f, " paddr 0x"); - fprintf_vma (f, p->p_paddr); + bfd_fprintf_vma (abfd, f, p->p_paddr); fprintf (f, " align 2**%u\n", bfd_log2 (p->p_align)); fprintf (f, " filesz 0x"); - fprintf_vma (f, p->p_filesz); + bfd_fprintf_vma (abfd, f, p->p_filesz); fprintf (f, " memsz 0x"); - fprintf_vma (f, p->p_memsz); + bfd_fprintf_vma (abfd, f, p->p_memsz); fprintf (f, " flags %c%c%c", (p->p_flags & PF_R) != 0 ? 'r' : '-', (p->p_flags & PF_W) != 0 ? 'w' : '-', @@ -830,7 +832,7 @@ bfd_elf_print_symbol (abfd, filep, symbo break; case bfd_print_symbol_more: fprintf (file, "elf "); - fprintf_vma (file, symbol->value); + bfd_fprintf_vma (abfd, file, symbol->value); fprintf (file, " %lx", (long) symbol->flags); break; case bfd_print_symbol_all: @@ -849,7 +851,7 @@ bfd_elf_print_symbol (abfd, filep, symbo if (name == NULL) { name = symbol->name; - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); } fprintf (file, " %s\t", section_name); @@ -857,10 +859,10 @@ bfd_elf_print_symbol (abfd, filep, symbo we've already printed the size; now print the alignment. For other symbols, we have no specified alignment, and we've printed the address; now print the size. */ - fprintf_vma (file, - (bfd_is_com_section (symbol->section) - ? ((elf_symbol_type *) symbol)->internal_elf_sym.st_value - : ((elf_symbol_type *) symbol)->internal_elf_sym.st_size)); + bfd_fprintf_vma (abfd, file, + (bfd_is_com_section (symbol->section) + ? ((elf_symbol_type *) symbol)->internal_elf_sym.st_value + : ((elf_symbol_type *) symbol)->internal_elf_sym.st_size)); /* If we have version information, print it. */ if (elf_tdata (abfd)->dynversym_section != 0 @@ -1047,6 +1049,8 @@ _bfd_elf_link_hash_table_init (table, ab struct bfd_hash_table *, const char *)); { + boolean ret; + table->dynamic_sections_created = false; table->dynobj = NULL; /* The first dynamic symbol is a dummy. */ @@ -1060,7 +1064,10 @@ _bfd_elf_link_hash_table_init (table, ab table->stab_info = NULL; table->merge_info = NULL; table->dynlocal = NULL; - return _bfd_link_hash_table_init (&table->root, abfd, newfunc); + ret = _bfd_link_hash_table_init (& table->root, abfd, newfunc); + table->root.type = bfd_link_elf_hash_table; + + return ret; } /* Create an ELF linker hash table. */ @@ -2092,6 +2099,7 @@ elf_map_symbols (abfd) if (sect_syms == NULL) return false; elf_section_syms (abfd) = sect_syms; + elf_num_section_syms (abfd) = max_index; for (idx = 0; idx < symcount; idx++) { @@ -3386,7 +3394,10 @@ prep_headers (abfd) i_ehdrp->e_machine = EM_PARISC; break; case bfd_arch_powerpc: - i_ehdrp->e_machine = EM_PPC; + if (bed->s->arch_size == 64) + i_ehdrp->e_machine = EM_PPC64; + else + i_ehdrp->e_machine = EM_PPC; break; case bfd_arch_alpha: i_ehdrp->e_machine = EM_ALPHA; @@ -3652,7 +3663,8 @@ _bfd_elf_symbol_from_bfd_symbol (abfd, a indx = asym_ptr->section->output_section->index; else indx = asym_ptr->section->index; - if (elf_section_syms (abfd)[indx]) + if (indx < elf_num_section_syms (abfd) + && elf_section_syms (abfd)[indx] != NULL) asym_ptr->udata.i = elf_section_syms (abfd)[indx]->udata.i; } @@ -5344,12 +5356,6 @@ _bfd_elf_rel_vtable_reloc_fn (abfd, re, # include #endif -/* Define offsetof for those systems which lack it. */ - -#ifndef offsetof -# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) -#endif - /* FIXME: this is kinda wrong, but it's what gdb wants. */ static int @@ -5997,7 +6003,7 @@ bfd_get_elf_phdrs (abfd, phdrs) } void -bfd_elf_sprintf_vma (abfd, buf, value) +_bfd_elf_sprintf_vma (abfd, buf, value) bfd *abfd ATTRIBUTE_UNUSED; char *buf; bfd_vma value; @@ -6028,7 +6034,7 @@ bfd_elf_sprintf_vma (abfd, buf, value) } void -bfd_elf_fprintf_vma (abfd, stream, value) +_bfd_elf_fprintf_vma (abfd, stream, value) bfd *abfd ATTRIBUTE_UNUSED; PTR stream; bfd_vma value; @@ -6058,3 +6064,10 @@ bfd_elf_fprintf_vma (abfd, stream, value fprintf_vma ((FILE *) stream, value); #endif } + +enum elf_reloc_type_class +_bfd_elf_reloc_type_class (type) + int type ATTRIBUTE_UNUSED; +{ + return reloc_class_normal; +} diff -uprN binutils-2.11.90.0.27/bfd/elf32-arm.h binutils-2.11.90.0.29/bfd/elf32-arm.h --- binutils-2.11.90.0.27/bfd/elf32-arm.h Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/bfd/elf32-arm.h Mon Aug 27 11:44:51 2001 @@ -39,9 +39,9 @@ static bfd_reloc_status_type elf32_arm_f static insn32 insert_thumb_branch PARAMS ((insn32, int)); static struct elf_link_hash_entry *find_thumb_glue - PARAMS ((struct bfd_link_info *, CONST char *, bfd *)); + PARAMS ((struct bfd_link_info *, const char *, bfd *)); static struct elf_link_hash_entry *find_arm_glue - PARAMS ((struct bfd_link_info *, CONST char *, bfd *)); + PARAMS ((struct bfd_link_info *, const char *, bfd *)); static void record_arm_to_thumb_glue PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static void record_thumb_to_arm_glue @@ -54,6 +54,45 @@ static int elf32_arm_to_thumb_stub static int elf32_thumb_to_arm_stub PARAMS ((struct bfd_link_info *, const char *, bfd *, bfd *, asection *, bfd_byte *, asection *, bfd_vma, bfd_signed_vma, bfd_vma)); +static boolean elf32_arm_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static asection * elf32_arm_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_arm_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_arm_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_arm_find_nearest_line + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); +static boolean elf32_arm_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static boolean elf32_arm_size_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static boolean elf32_arm_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *)); +static boolean elf32_arm_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static struct bfd_hash_entry * elf32_arm_link_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +#ifdef USE_REL +static void arm_add_to_rel + PARAMS ((bfd *, bfd_byte *, reloc_howto_type *, bfd_signed_vma)); +#endif + +boolean bfd_elf32_arm_allocate_interworking_sections + PARAMS ((struct bfd_link_info *)); +boolean bfd_elf32_arm_get_bfd_for_interworking + PARAMS ((bfd *, struct bfd_link_info *)); +boolean bfd_elf32_arm_process_before_allocation + PARAMS ((bfd *, struct bfd_link_info *, int)); +static enum elf_reloc_type_class elf32_arm_reloc_type_class + PARAMS ((int)); #define INTERWORK_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK) @@ -79,22 +118,22 @@ static int elf32_thumb_to_arm_stub called before the relocation has been set up calls the dynamic linker first. */ static const unsigned long elf32_arm_plt0_entry [PLT_ENTRY_SIZE / 4] = -{ - 0xe52de004, /* str lr, [sp, #-4]! */ - 0xe59fe010, /* ldr lr, [pc, #16] */ - 0xe08fe00e, /* add lr, pc, lr */ - 0xe5bef008 /* ldr pc, [lr, #8]! */ -}; + { + 0xe52de004, /* str lr, [sp, #-4]! */ + 0xe59fe010, /* ldr lr, [pc, #16] */ + 0xe08fe00e, /* add lr, pc, lr */ + 0xe5bef008 /* ldr pc, [lr, #8]! */ + }; /* Subsequent entries in a procedure linkage table look like this. */ static const unsigned long elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] = -{ - 0xe59fc004, /* ldr ip, [pc, #4] */ - 0xe08fc00c, /* add ip, pc, ip */ - 0xe59cf000, /* ldr pc, [ip] */ - 0x00000000 /* offset to symbol in got */ -}; + { + 0xe59fc004, /* ldr ip, [pc, #4] */ + 0xe08fc00c, /* add ip, pc, ip */ + 0xe59cf000, /* ldr pc, [ip] */ + 0x00000000 /* offset to symbol in got */ + }; /* The ARM linker needs to keep track of the number of relocs that it decides to copy in check_relocs for each symbol. This is so that @@ -105,23 +144,23 @@ static const unsigned long elf32_arm_plt /* This structure keeps track of the number of PC relative relocs we have copied for a given symbol. */ struct elf32_arm_pcrel_relocs_copied -{ - /* Next section. */ - struct elf32_arm_pcrel_relocs_copied * next; - /* A section in dynobj. */ - asection * section; - /* Number of relocs copied in this section. */ - bfd_size_type count; -}; + { + /* Next section. */ + struct elf32_arm_pcrel_relocs_copied * next; + /* A section in dynobj. */ + asection * section; + /* Number of relocs copied in this section. */ + bfd_size_type count; + }; /* Arm ELF linker hash entry. */ struct elf32_arm_link_hash_entry -{ - struct elf_link_hash_entry root; + { + struct elf_link_hash_entry root; - /* Number of PC relative relocs copied for this symbol. */ - struct elf32_arm_pcrel_relocs_copied * pcrel_relocs_copied; -}; + /* Number of PC relative relocs copied for this symbol. */ + struct elf32_arm_pcrel_relocs_copied * pcrel_relocs_copied; + }; /* Declare this now that the above structures are defined. */ static boolean elf32_arm_discard_copies @@ -140,23 +179,23 @@ static boolean elf32_arm_discard_copies /* ARM ELF linker hash table. */ struct elf32_arm_link_hash_table -{ - /* The main hash table. */ - struct elf_link_hash_table root; - - /* The size in bytes of the section containg the Thumb-to-ARM glue. */ - long int thumb_glue_size; - - /* The size in bytes of the section containg the ARM-to-Thumb glue. */ - long int arm_glue_size; - - /* An arbitary input BFD chosen to hold the glue sections. */ - bfd * bfd_of_glue_owner; - - /* A boolean indicating whether knowledge of the ARM's pipeline - length should be applied by the linker. */ - int no_pipeline_knowledge; -}; + { + /* The main hash table. */ + struct elf_link_hash_table root; + + /* The size in bytes of the section containg the Thumb-to-ARM glue. */ + long int thumb_glue_size; + + /* The size in bytes of the section containg the ARM-to-Thumb glue. */ + long int arm_glue_size; + + /* An arbitary input BFD chosen to hold the glue sections. */ + bfd * bfd_of_glue_owner; + + /* A boolean indicating whether knowledge of the ARM's pipeline + length should be applied by the linker. */ + int no_pipeline_knowledge; + }; /* Create an entry in an ARM ELF linker hash table. */ @@ -221,7 +260,7 @@ elf32_arm_link_hash_table_create (abfd) static struct elf_link_hash_entry * find_thumb_glue (link_info, name, input_bfd) struct bfd_link_info *link_info; - CONST char *name; + const char *name; bfd *input_bfd; { char *tmp_name; @@ -256,7 +295,7 @@ find_thumb_glue (link_info, name, input_ static struct elf_link_hash_entry * find_arm_glue (link_info, name, input_bfd) struct bfd_link_info *link_info; - CONST char *name; + const char *name; bfd *input_bfd; { char *tmp_name; @@ -1022,7 +1061,7 @@ elf32_arm_final_link_relocate (howto, in /* If the start address has been set, then set the EF_ARM_HASENTRY flag. Setting this more than once is redundant, but the cost is not too high, and it keeps the code simple. - + The test is done here, rather than somewhere else, because the start address is only set just before the final link commences. @@ -1030,7 +1069,7 @@ elf32_arm_final_link_relocate (howto, in flag will not be set. */ if (bfd_get_start_address (output_bfd) != 0) elf_elfheader (output_bfd)->e_flags |= EF_ARM_HASENTRY; - + globals = elf32_arm_hash_table (info); dynobj = elf_hash_table (info)->dynobj; @@ -1074,7 +1113,7 @@ elf32_arm_final_link_relocate (howto, in into the output file to be resolved at run time. */ if (info->shared && (r_type != R_ARM_PC24 - || (h != NULL + || (h != NULL && h->dynindx != -1 && (! info->symbolic || (h->elf_link_hash_flags @@ -1457,7 +1496,7 @@ elf32_arm_final_link_relocate (howto, in corresponding bit one in the target address will be set from bit one of the source address. */ lower_insn &= ~1; -#endif +#endif /* Put the relocated value back in the object file: */ bfd_put_16 (input_bfd, upper_insn, hit_data); bfd_put_16 (input_bfd, lower_insn, hit_data + 2); @@ -1497,8 +1536,8 @@ elf32_arm_final_link_relocate (howto, in calculation. */ value -= sgot->output_section->vma; return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); + contents, rel->r_offset, value, + (bfd_vma) 0); case R_ARM_GOTPC: /* Use global offset table as symbol value. */ @@ -1509,8 +1548,8 @@ elf32_arm_final_link_relocate (howto, in value = sgot->output_section->vma; return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); + contents, rel->r_offset, value, + (bfd_vma) 0); case R_ARM_GOT32: /* Relocation is to the entry for this symbol in the @@ -1593,8 +1632,8 @@ elf32_arm_final_link_relocate (howto, in } return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); + contents, rel->r_offset, value, + (bfd_vma) 0); case R_ARM_PLT32: /* Relocation is to the entry for this symbol in the @@ -1604,8 +1643,8 @@ elf32_arm_final_link_relocate (howto, in without using the procedure linkage table. */ if (h == NULL) return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); + contents, rel->r_offset, value, + (bfd_vma) 0); if (h->plt.offset == (bfd_vma) -1) /* We didn't make a PLT entry for this symbol. This @@ -1623,8 +1662,8 @@ elf32_arm_final_link_relocate (howto, in + splt->output_offset + h->plt.offset); return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); + contents, rel->r_offset, value, + (bfd_vma) 0); case R_ARM_SBREL32: return bfd_reloc_notsupported; @@ -1836,7 +1875,7 @@ elf32_arm_relocate_section (output_bfd, case R_ARM_ABS32: if (info->shared && ( - (!info->symbolic && h->dynindx != -1) + (!info->symbolic && h->dynindx != -1) || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 ) && ((input_section->flags & SEC_ALLOC) != 0 @@ -2274,7 +2313,7 @@ elf32_arm_print_private_bfd_data (abfd, if (flags & EF_ARM_MAPSYMSFIRST) fprintf (file, _(" [mapping symbols precede others]")); - flags &= ~(EF_ARM_SYMSARESORTED | EF_ARM_DYNSYMSUSESEGIDX + flags &= ~(EF_ARM_SYMSARESORTED | EF_ARM_DYNSYMSUSESEGIDX | EF_ARM_MAPSYMSFIRST); break; @@ -2470,7 +2509,7 @@ elf32_arm_check_relocs (abfd, info, sec, srelgot = bfd_make_section (dynobj, ".rel.got"); if (srelgot == NULL || ! bfd_set_section_flags (dynobj, srelgot, - (SEC_ALLOC + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY @@ -2498,7 +2537,7 @@ elf32_arm_check_relocs (abfd, info, sec, } else { - /* This is a global offset table entry for a local + /* This is a global offset table entry for a local symbol. */ if (local_got_offsets == NULL) { @@ -2530,7 +2569,7 @@ elf32_arm_check_relocs (abfd, info, sec, sgot->_raw_size += 4; break; - case R_ARM_PLT32: + case R_ARM_PLT32: /* This symbol requires a procedure linkage table entry. We actually build the entry in adjust_dynamic_symbol, because this might be a case of linking PIC code which is @@ -2583,7 +2622,7 @@ elf32_arm_check_relocs (abfd, info, sec, return false; BFD_ASSERT (strncmp (name, ".rel", 4) == 0 - && strcmp (bfd_get_section_name (abfd, sec), + && strcmp (bfd_get_section_name (abfd, sec), name + 4) == 0); sreloc = bfd_get_section_by_name (dynobj, name); @@ -2601,6 +2640,8 @@ elf32_arm_check_relocs (abfd, info, sec, || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf32_External_Rel); @@ -2672,8 +2713,8 @@ elf32_arm_find_nearest_line asection * section; asymbol ** symbols; bfd_vma offset; - CONST char ** filename_ptr; - CONST char ** functionname_ptr; + const char ** filename_ptr; + const char ** functionname_ptr; unsigned int * line_ptr; { boolean found; @@ -2915,14 +2956,13 @@ elf32_arm_adjust_dynamic_symbol (info, h static boolean elf32_arm_size_dynamic_sections (output_bfd, info) - bfd * output_bfd; + bfd * output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info * info; { bfd * dynobj; asection * s; boolean plt; boolean relocs; - boolean reltext; dynobj = elf_hash_table (info)->dynobj; BFD_ASSERT (dynobj != NULL); @@ -2964,7 +3004,6 @@ elf32_arm_size_dynamic_sections (output_ memory for them. */ plt = false; relocs = false; - reltext = false; for (s = dynobj->sections; s != NULL; s = s->next) { const char * name; @@ -3010,30 +3049,10 @@ elf32_arm_size_dynamic_sections (output_ } else { - asection * target; - /* Remember whether there are any reloc sections other than .rel.plt. */ if (strcmp (name, ".rel.plt") != 0) - { - const char *outname; - - relocs = true; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL - entry. The entries in the .rel.plt section - really apply to the .got section, which we - created ourselves and so know is not readonly. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 4); - - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - } + relocs = true; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -3097,7 +3116,7 @@ elf32_arm_size_dynamic_sections (output_ return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; @@ -3421,29 +3440,48 @@ elf32_arm_post_process_headers (abfd, li i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION; } +static enum elf_reloc_type_class +elf32_arm_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_ARM_RELATIVE: + return reloc_class_relative; + case R_ARM_JUMP_SLOT: + return reloc_class_plt; + case R_ARM_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + + #define ELF_ARCH bfd_arch_arm #define ELF_MACHINE_CODE EM_ARM #define ELF_MAXPAGESIZE 0x8000 -#define bfd_elf32_bfd_copy_private_bfd_data elf32_arm_copy_private_bfd_data -#define bfd_elf32_bfd_merge_private_bfd_data elf32_arm_merge_private_bfd_data +#define bfd_elf32_bfd_copy_private_bfd_data elf32_arm_copy_private_bfd_data +#define bfd_elf32_bfd_merge_private_bfd_data elf32_arm_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags elf32_arm_set_private_flags #define bfd_elf32_bfd_print_private_bfd_data elf32_arm_print_private_bfd_data #define bfd_elf32_bfd_link_hash_table_create elf32_arm_link_hash_table_create -#define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup +#define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup #define bfd_elf32_find_nearest_line elf32_arm_find_nearest_line #define elf_backend_get_symbol_type elf32_arm_get_symbol_type #define elf_backend_gc_mark_hook elf32_arm_gc_mark_hook #define elf_backend_gc_sweep_hook elf32_arm_gc_sweep_hook #define elf_backend_check_relocs elf32_arm_check_relocs -#define elf_backend_relocate_section elf32_arm_relocate_section +#define elf_backend_relocate_section elf32_arm_relocate_section #define elf_backend_adjust_dynamic_symbol elf32_arm_adjust_dynamic_symbol #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections #define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections #define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections #define elf_backend_post_process_headers elf32_arm_post_process_headers +#define elf_backend_reloc_type_class elf32_arm_reloc_type_class #define elf_backend_can_gc_sections 1 #define elf_backend_plt_readonly 1 diff -uprN binutils-2.11.90.0.27/bfd/elf32-cris.c binutils-2.11.90.0.29/bfd/elf32-cris.c --- binutils-2.11.90.0.27/bfd/elf32-cris.c Tue Apr 24 09:11:45 2001 +++ binutils-2.11.90.0.29/bfd/elf32-cris.c Mon Aug 27 11:44:51 2001 @@ -72,6 +72,10 @@ static struct bfd_link_hash_table *elf_c PARAMS ((bfd *)); static boolean elf_cris_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static boolean cris_elf_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); + static boolean elf_cris_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static boolean elf_cris_finish_dynamic_symbol @@ -81,6 +85,8 @@ static boolean elf_cris_finish_dynamic_s PARAMS ((bfd *, struct bfd_link_info *)); static void elf_cris_hide_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static enum elf_reloc_type_class elf_cris_reloc_type_class + PARAMS ((int)); static reloc_howto_type cris_elf_howto_table [] = { @@ -2571,6 +2577,8 @@ cris_elf_check_relocs (abfd, info, sec, || !bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf32_External_Rela); @@ -2638,14 +2646,13 @@ cris_elf_check_relocs (abfd, info, sec, static boolean elf_cris_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; boolean plt; boolean relocs; - boolean reltext; dynobj = elf_hash_table (info)->dynobj; BFD_ASSERT (dynobj != NULL); @@ -2699,7 +2706,6 @@ elf_cris_size_dynamic_sections (output_b memory for them. */ plt = false; relocs = false; - reltext = false; for (s = dynobj->sections; s != NULL; s = s->next) { const char *name; @@ -2745,41 +2751,11 @@ elf_cris_size_dynamic_sections (output_b } else { - asection *target; - /* Remember whether there are any reloc sections other than .rela.plt. */ if (strcmp (name, ".rela.plt") != 0) - { - const char *outname; - relocs = true; - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. - The entries in the .rela.plt section are actually - associated with .got.plt, which we created ourselves - and so know is not readonly. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target - = bfd_get_section_by_name (output_bfd, - outname + strlen (".rela")); - - /* We have to test the .text section by name, becase for - some reason it does not have SEC_READONLY set at this - time. That flag is actually set in ldmain.c:main - specifically for ".text" at a time long after this - function is called. FIXME: This might be due to a - general bug. FIXME: Have testcase for this. */ - if (target != NULL - && (target->flags & SEC_ALLOC) != 0 - && ((target->flags & SEC_READONLY) != 0 - || strcmp (outname + strlen (".rela"), - ".text") == 0)) - reltext = true; - } - /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ s->reloc_count = 0; @@ -2838,7 +2814,7 @@ elf_cris_size_dynamic_sections (output_b return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { if (!bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; @@ -2908,7 +2884,7 @@ elf_cris_discard_excess_program_dynamics asection *srelgot; BFD_ASSERT (dynobj != NULL); - + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); BFD_ASSERT (srelgot != NULL); @@ -3016,6 +2992,24 @@ cris_elf_merge_private_bfd_data (ibfd, o return true; } + + +static enum elf_reloc_type_class +elf_cris_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_CRIS_RELATIVE: + return reloc_class_relative; + case R_CRIS_JUMP_SLOT: + return reloc_class_plt; + case R_CRIS_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} #define ELF_ARCH bfd_arch_cris #define ELF_MACHINE_CODE EM_CRIS @@ -3059,6 +3053,7 @@ cris_elf_merge_private_bfd_data (ibfd, o #define bfd_elf32_bfd_final_link \ _bfd_elf32_gc_common_final_link #define elf_backend_hide_symbol elf_cris_hide_symbol +#define elf_backend_reloc_type_class elf_cris_reloc_type_class #define elf_backend_want_got_plt 1 #define elf_backend_plt_readonly 1 diff -uprN binutils-2.11.90.0.27/bfd/elf32-d10v.c binutils-2.11.90.0.29/bfd/elf32-d10v.c --- binutils-2.11.90.0.27/bfd/elf32-d10v.c Fri Mar 9 11:37:57 2001 +++ binutils-2.11.90.0.29/bfd/elf32-d10v.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* D10V-specific support for 32-bit ELF - Copyright 1996, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -28,171 +28,183 @@ static reloc_howto_type *bfd_elf32_bfd_r PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); static void d10v_info_to_howto_rel PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); +static asection * elf32_d10v_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_d10v_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_d10v_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_d10v_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, + bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, + asection **)); -/* Use REL instead of RELA to save space */ +/* Use REL instead of RELA to save space. */ #define USE_REL static reloc_howto_type elf_d10v_howto_table[] = -{ - /* This reloc does nothing. */ - HOWTO (R_D10V_NONE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* An PC Relative 10-bit relocation, shifted by 2 */ - /* right container */ - HOWTO (R_D10V_10_PCREL_R, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 10, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_10_PCREL_R", /* name */ - false, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - true), /* pcrel_offset */ - - /* An PC Relative 10-bit relocation, shifted by 2 */ - /* left container */ - HOWTO (R_D10V_10_PCREL_L, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 10, /* bitsize */ - true, /* pc_relative */ - 15, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_10_PCREL_L", /* name */ - false, /* partial_inplace */ - 0x07f8000, /* src_mask */ - 0x07f8000, /* dst_mask */ - true), /* pcrel_offset */ - - /* A 16 bit absolute relocation */ - HOWTO (R_D10V_16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_16", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* An 18 bit absolute relocation, right shifted 2 */ - HOWTO (R_D10V_18, /* type */ - 2, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 18, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_18", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* A relative 18 bit relocation, right shifted by 2 */ - HOWTO (R_D10V_18_PCREL, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 18, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_18_PCREL", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* A 32 bit absolute relocation */ - HOWTO (R_D10V_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* GNU extension to record C++ vtable hierarchy */ - HOWTO (R_D10V_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_D10V_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* GNU extension to record C++ vtable member usage */ - HOWTO (R_D10V_GNU_VTENTRY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_elf_rel_vtable_reloc_fn, /* special_function */ - "R_D10V_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - -}; + { + /* This reloc does nothing. */ + HOWTO (R_D10V_NONE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* An PC Relative 10-bit relocation, shifted by 2 */ + /* right container */ + HOWTO (R_D10V_10_PCREL_R, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_10_PCREL_R", /* name */ + false, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + true), /* pcrel_offset */ + + /* An PC Relative 10-bit relocation, shifted by 2 */ + /* left container */ + HOWTO (R_D10V_10_PCREL_L, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + true, /* pc_relative */ + 15, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_10_PCREL_L", /* name */ + false, /* partial_inplace */ + 0x07f8000, /* src_mask */ + 0x07f8000, /* dst_mask */ + true), /* pcrel_offset */ + + /* A 16 bit absolute relocation */ + HOWTO (R_D10V_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* An 18 bit absolute relocation, right shifted 2 */ + HOWTO (R_D10V_18, /* type */ + 2, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_18", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A relative 18 bit relocation, right shifted by 2 */ + HOWTO (R_D10V_18_PCREL, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_18_PCREL", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* A 32 bit absolute relocation */ + HOWTO (R_D10V_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO (R_D10V_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_D10V_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO (R_D10V_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_D10V_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + }; /* Map BFD reloc types to D10V ELF reloc types. */ struct d10v_reloc_map -{ - bfd_reloc_code_real_type bfd_reloc_val; - unsigned char elf_reloc_val; -}; - - static const struct d10v_reloc_map d10v_reloc_map[] = -{ - { BFD_RELOC_NONE, R_D10V_NONE, }, - { BFD_RELOC_D10V_10_PCREL_R, R_D10V_10_PCREL_R }, - { BFD_RELOC_D10V_10_PCREL_L, R_D10V_10_PCREL_L }, - { BFD_RELOC_16, R_D10V_16 }, - { BFD_RELOC_D10V_18, R_D10V_18 }, - { BFD_RELOC_D10V_18_PCREL, R_D10V_18_PCREL }, - { BFD_RELOC_32, R_D10V_32 }, - { BFD_RELOC_VTABLE_INHERIT, R_D10V_GNU_VTINHERIT }, - { BFD_RELOC_VTABLE_ENTRY, R_D10V_GNU_VTENTRY }, -}; + { + bfd_reloc_code_real_type bfd_reloc_val; + unsigned char elf_reloc_val; + }; + +static const struct d10v_reloc_map d10v_reloc_map[] = + { + { BFD_RELOC_NONE, R_D10V_NONE, }, + { BFD_RELOC_D10V_10_PCREL_R, R_D10V_10_PCREL_R }, + { BFD_RELOC_D10V_10_PCREL_L, R_D10V_10_PCREL_L }, + { BFD_RELOC_16, R_D10V_16 }, + { BFD_RELOC_D10V_18, R_D10V_18 }, + { BFD_RELOC_D10V_18_PCREL, R_D10V_18_PCREL }, + { BFD_RELOC_32, R_D10V_32 }, + { BFD_RELOC_VTABLE_INHERIT, R_D10V_GNU_VTINHERIT }, + { BFD_RELOC_VTABLE_ENTRY, R_D10V_GNU_VTENTRY }, + }; static reloc_howto_type * bfd_elf32_bfd_reloc_type_lookup (abfd, code) diff -uprN binutils-2.11.90.0.27/bfd/elf32-i370.c binutils-2.11.90.0.29/bfd/elf32-i370.c --- binutils-2.11.90.0.27/bfd/elf32-i370.c Fri Mar 9 11:37:57 2001 +++ binutils-2.11.90.0.29/bfd/elf32-i370.c Wed Aug 22 08:52:09 2001 @@ -253,6 +253,9 @@ static reloc_howto_type i370_elf_howto_r }; static void i370_elf_howto_init PARAMS ((void)); +static reloc_howto_type *i370_elf_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); + static void i370_elf_info_to_howto PARAMS ((bfd *abfd, arelent *cache_ptr, Elf32_Internal_Rela *dst)); static boolean i370_elf_set_private_flags PARAMS ((bfd *, flagword)); @@ -309,6 +312,8 @@ static boolean i370_elf_relocate_section Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, asection **)); +static void i370_elf_post_process_headers + PARAMS ((bfd *, struct bfd_link_info *)); static boolean i370_elf_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); @@ -1709,7 +1714,7 @@ int i370_noop() #define elf_backend_add_symbol_hook \ (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \ const Elf_Internal_Sym *, const char **, flagword *, \ - asection **, bfd_vma *))) i370_noop + asection **, bfd_vma *))) i370_noop #define elf_backend_finish_dynamic_symbol \ (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \ struct elf_link_hash_entry *, \ diff -uprN binutils-2.11.90.0.27/bfd/elf32-i386.c binutils-2.11.90.0.29/bfd/elf32-i386.c --- binutils-2.11.90.0.27/bfd/elf32-i386.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/elf32-i386.c Mon Aug 27 11:44:51 2001 @@ -63,6 +63,7 @@ static boolean elf_i386_finish_dynamic_s PARAMS ((bfd *, struct bfd_link_info *)); static boolean elf_i386_fake_sections PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); +static enum elf_reloc_type_class elf_i386_reloc_type_class PARAMS ((int)); #define USE_REL 1 /* 386 uses REL relocations instead of RELA */ @@ -767,6 +768,8 @@ elf_i386_check_relocs (abfd, info, sec, || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf32_External_Rel); @@ -1243,14 +1246,13 @@ allocate_plt_and_got_and_discard_relocs static boolean elf_i386_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { struct elf_i386_link_hash_table *htab; bfd *dynobj; asection *s; boolean relocs; - boolean reltext; bfd *i; htab = elf_i386_hash_table (info); @@ -1315,7 +1317,6 @@ elf_i386_size_dynamic_sections (output_b /* We now have determined the sizes of the various dynamic sections. Allocate memory for them. */ relocs = false; - reltext = false; for (s = dynobj->sections; s != NULL; s = s->next) { if ((s->flags & SEC_LINKER_CREATED) == 0) @@ -1344,29 +1345,8 @@ elf_i386_size_dynamic_sections (output_b } else { - asection *target; - - /* Remember whether there are any reloc sections other - than .rel.plt. */ if (s != htab->srelplt) - { - const char *outname; - - relocs = true; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL - entry. The entries in the .rel.plt section - really apply to the .got section, which we - created ourselves and so know is not readonly. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 4); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - } + relocs = true; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -1426,11 +1406,10 @@ elf_i386_size_dynamic_sections (output_b return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; - info->flags |= DF_TEXTREL; } } @@ -2215,6 +2194,22 @@ elf_i386_fake_sections (abfd, hdr, sec) return true; } +static enum elf_reloc_type_class +elf_i386_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_386_RELATIVE: + return reloc_class_relative; + case R_386_JUMP_SLOT: + return reloc_class_plt; + case R_386_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} #define TARGET_LITTLE_SYM bfd_elf32_i386_vec #define TARGET_LITTLE_NAME "elf32-i386" @@ -2246,5 +2241,6 @@ elf_i386_fake_sections (abfd, hdr, sec) #define elf_backend_relocate_section elf_i386_relocate_section #define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections #define elf_backend_fake_sections elf_i386_fake_sections +#define elf_backend_reloc_type_class elf_i386_reloc_type_class #include "elf32-target.h" diff -uprN binutils-2.11.90.0.27/bfd/elf32-i960.c binutils-2.11.90.0.29/bfd/elf32-i960.c --- binutils-2.11.90.0.27/bfd/elf32-i960.c Fri Mar 9 11:15:51 2001 +++ binutils-2.11.90.0.29/bfd/elf32-i960.c Wed Aug 22 08:52:09 2001 @@ -1,5 +1,5 @@ /* Intel 860 specific support for 32-bit ELF - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -27,6 +27,10 @@ static bfd_reloc_status_type elf32_i960_ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static reloc_howto_type *elf32_i960_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); +static void elf32_i960_info_to_howto + PARAMS ((bfd *, arelent *cache_ptr, Elf32_Internal_Rela *)); +static void elf32_i960_info_to_howto_rel + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); #define USE_REL 1 diff -uprN binutils-2.11.90.0.27/bfd/elf32-m32r.c binutils-2.11.90.0.29/bfd/elf32-m32r.c --- binutils-2.11.90.0.27/bfd/elf32-m32r.c Fri Mar 9 11:37:57 2001 +++ binutils-2.11.90.0.29/bfd/elf32-m32r.c Mon Aug 27 11:44:51 2001 @@ -58,7 +58,6 @@ static boolean m32r_elf_relocate_section static boolean m32r_elf_relax_delete_bytes PARAMS ((bfd *, asection *, bfd_vma, int)); #endif - static bfd_reloc_status_type m32r_elf_final_sda_base PARAMS ((bfd *, struct bfd_link_info *, const char **, bfd_vma *)); static boolean m32r_elf_object_p @@ -73,6 +72,16 @@ static boolean m32r_elf_merge_private_bf PARAMS ((bfd *, bfd *)); static boolean m32r_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); +static boolean m32r_elf_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean m32r_elf_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); + +asection * m32r_elf_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); #define NOP_INSN 0x7000 #define MAKE_PARALLEL(insn) ((insn) | 0x8000) diff -uprN binutils-2.11.90.0.27/bfd/elf32-m68k.c binutils-2.11.90.0.29/bfd/elf32-m68k.c --- binutils-2.11.90.0.27/bfd/elf32-m68k.c Fri Mar 23 14:37:30 2001 +++ binutils-2.11.90.0.29/bfd/elf32-m68k.c Mon Aug 27 11:44:51 2001 @@ -63,6 +63,8 @@ static boolean elf32_m68k_merge_private_ PARAMS ((bfd *, bfd *)); static boolean elf32_m68k_print_private_bfd_data PARAMS ((bfd *, PTR)); +static enum elf_reloc_type_class elf32_m68k_reloc_type_class + PARAMS ((int)); static reloc_howto_type howto_table[] = { HOWTO(R_68K_NONE, 0, 0, 0, false,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_NONE", false, 0, 0x00000000,false), @@ -718,6 +720,8 @@ elf_m68k_check_relocs (abfd, info, sec, || !bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf32_External_Rela); @@ -1130,14 +1134,13 @@ elf_m68k_adjust_dynamic_symbol (info, h) static boolean elf_m68k_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; boolean plt; boolean relocs; - boolean reltext; dynobj = elf_hash_table (info)->dynobj; BFD_ASSERT (dynobj != NULL); @@ -1179,7 +1182,6 @@ elf_m68k_size_dynamic_sections (output_b memory for them. */ plt = false; relocs = false; - reltext = false; for (s = dynobj->sections; s != NULL; s = s->next) { const char *name; @@ -1225,28 +1227,7 @@ elf_m68k_size_dynamic_sections (output_b } else { - asection *target; - - /* Remember whether there are any reloc sections other - than .rela.plt. */ - if (strcmp (name, ".rela.plt") != 0) - { - const char *outname; - - relocs = true; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL - entry. .rela.plt is actually associated with - .got.plt, which is never readonly. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - } + relocs = true; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -1307,11 +1288,10 @@ elf_m68k_size_dynamic_sections (output_b return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { if (!bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; - info->flags |= DF_TEXTREL; } } @@ -2322,6 +2302,23 @@ error_return: return false; } +static enum elf_reloc_type_class +elf32_m68k_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_68K_RELATIVE: + return reloc_class_relative; + case R_68K_JMP_SLOT: + return reloc_class_plt; + case R_68K_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + #define TARGET_BIG_SYM bfd_elf32_m68k_vec #define TARGET_BIG_NAME "elf32-m68k" #define ELF_MACHINE_CODE EM_68K @@ -2352,6 +2349,7 @@ error_return: elf32_m68k_set_private_flags #define bfd_elf32_bfd_print_private_bfd_data \ elf32_m68k_print_private_bfd_data +#define elf_backend_reloc_type_class elf32_m68k_reloc_type_class #define elf_backend_can_gc_sections 1 #define elf_backend_want_got_plt 1 diff -uprN binutils-2.11.90.0.27/bfd/elf32-mcore.c binutils-2.11.90.0.29/bfd/elf32-mcore.c --- binutils-2.11.90.0.27/bfd/elf32-mcore.c Fri Mar 9 11:37:58 2001 +++ binutils-2.11.90.0.29/bfd/elf32-mcore.c Mon Aug 27 11:44:51 2001 @@ -48,6 +48,15 @@ static bfd_reloc_status_type mcore_elf_u static boolean mcore_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static asection * mcore_elf_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean mcore_elf_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean mcore_elf_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); static reloc_howto_type * mcore_elf_howto_table [(int) R_MCORE_max]; diff -uprN binutils-2.11.90.0.27/bfd/elf32-mips.c binutils-2.11.90.0.29/bfd/elf32-mips.c --- binutils-2.11.90.0.27/bfd/elf32-mips.c Fri Jul 6 09:26:10 2001 +++ binutils-2.11.90.0.29/bfd/elf32-mips.c Mon Aug 27 11:44:51 2001 @@ -210,6 +210,15 @@ static boolean mips_elf_stub_section_p PARAMS ((bfd *, asection *)); static int sort_dynamic_relocs PARAMS ((const void *, const void *)); +static void _bfd_mips_elf_hide_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static void _bfd_mips_elf_copy_indirect_symbol + PARAMS ((struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); +static boolean _bfd_elf32_mips_grok_prstatus + PARAMS ((bfd *, Elf_Internal_Note *)); +static boolean _bfd_elf32_mips_grok_psinfo + PARAMS ((bfd *, Elf_Internal_Note *)); extern const bfd_target bfd_elf32_tradbigmips_vec; extern const bfd_target bfd_elf32_tradlittlemips_vec; @@ -1928,16 +1937,16 @@ elf_mips_abi_name (abfd) { flagword flags; - if (ABI_N32_P (abfd)) - return "N32"; - else if (ABI_64_P (abfd)) - return "64"; - flags = elf_elfheader (abfd)->e_flags; switch (flags & EF_MIPS_ABI) { case 0: - return "none"; + if (ABI_N32_P (abfd)) + return "N32"; + else if (ABI_64_P (abfd)) + return "64"; + else + return "none"; case E_MIPS_ABI_O32: return "O32"; case E_MIPS_ABI_O64: @@ -3999,14 +4008,16 @@ mips_elf_link_hash_newfunc (entry, table return (struct bfd_hash_entry *) ret; } -void -_bfd_mips_elf_hide_symbol (info, h) +static void +_bfd_mips_elf_hide_symbol (info, entry) struct bfd_link_info *info; - struct mips_elf_link_hash_entry *h; + struct elf_link_hash_entry *entry; { bfd *dynobj; asection *got; struct mips_got_info *g; + struct mips_elf_link_hash_entry *h; + h = (struct mips_elf_link_hash_entry *) entry; dynobj = elf_hash_table (info)->dynobj; got = bfd_get_section_by_name (dynobj, ".got"); g = (struct mips_got_info *) elf_section_data (got)->tdata; @@ -5819,6 +5830,8 @@ mips_elf_create_dynamic_relocation (outp MIPS_ELF_REL_DYN_SECTION_NAME (output_bfd)); BFD_ASSERT (sreloc != NULL); BFD_ASSERT (sreloc->contents != NULL); + BFD_ASSERT (sreloc->reloc_count * MIPS_ELF_REL_SIZE (output_bfd) + < sreloc->_raw_size); skip = false; @@ -6319,8 +6332,9 @@ mips_elf_calculate_relocation (abfd, if ((info->shared || (elf_hash_table (info)->dynamic_sections_created && h != NULL - && ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) - != 0))) + && (h->root.type == bfd_link_hash_defweak + || (h->root.elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))) && (input_section->flags & SEC_ALLOC) != 0) { /* If we're creating a shared library, or this relocation is @@ -8065,7 +8079,7 @@ _bfd_mips_elf_gc_sweep_hook (abfd, info, hiding the old indirect symbol. Process additional relocation information. */ -void +static void _bfd_mips_elf_copy_indirect_symbol (dir, ind) struct elf_link_hash_entry *dir, *ind; { @@ -9170,7 +9184,8 @@ _bfd_elf32_mips_grok_prstatus (abfd, not raw_size, note->descpos + offset); } -static boolean _bfd_elf32_mips_grok_psinfo (abfd, note) +static boolean +_bfd_elf32_mips_grok_psinfo (abfd, note) bfd *abfd; Elf_Internal_Note *note; { diff -uprN binutils-2.11.90.0.27/bfd/elf32-openrisc.c binutils-2.11.90.0.29/bfd/elf32-openrisc.c --- binutils-2.11.90.0.27/bfd/elf32-openrisc.c Wed May 2 14:50:44 2001 +++ binutils-2.11.90.0.29/bfd/elf32-openrisc.c Mon Aug 27 11:44:51 2001 @@ -40,9 +40,16 @@ static bfd_reloc_status_type openrisc_fi static boolean openrisc_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static asection *openrisc_elf_gc_mark_hook +static asection * openrisc_elf_gc_mark_hook PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean openrisc_elf_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean openrisc_elf_object_p + PARAMS ((bfd *)); +static void openrisc_elf_final_write_processing + PARAMS ((bfd *, boolean)); static reloc_howto_type openrisc_elf_howto_table[] = diff -uprN binutils-2.11.90.0.27/bfd/elf32-ppc.c binutils-2.11.90.0.29/bfd/elf32-ppc.c --- binutils-2.11.90.0.27/bfd/elf32-ppc.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/elf32-ppc.c Mon Aug 27 11:44:51 2001 @@ -108,6 +108,7 @@ static boolean ppc_elf_finish_dynamic_sy Elf_Internal_Sym *)); static boolean ppc_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static enum elf_reloc_type_class ppc_elf_reloc_type_class PARAMS ((int)); #define BRANCH_PREDICT_BIT 0x200000 /* branch prediction bit for branch taken relocs */ #define RA_REGISTER_MASK 0x001f0000 /* mask to set RA in memory instructions */ @@ -1878,14 +1879,13 @@ ppc_elf_adjust_dynamic_symbol (info, h) static boolean ppc_elf_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; boolean plt; boolean relocs; - boolean reltext; #ifdef DEBUG fprintf (stderr, "ppc_elf_size_dynamic_sections called\n"); @@ -1930,7 +1930,6 @@ ppc_elf_size_dynamic_sections (output_bf memory for them. */ plt = false; relocs = false; - reltext = false; for (s = dynobj->sections; s != NULL; s = s->next) { const char *name; @@ -1976,22 +1975,9 @@ ppc_elf_size_dynamic_sections (output_bf } else { - asection *target; - const char *outname; - /* Remember whether there are any relocation sections. */ relocs = true; - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ s->reloc_count = 0; @@ -2048,7 +2034,7 @@ ppc_elf_size_dynamic_sections (output_bf return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; @@ -2433,6 +2419,8 @@ ppc_elf_check_relocs (abfd, info, sec, r || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf32_External_Rela); @@ -2578,7 +2566,7 @@ ppc_elf_add_symbol_hook (abfd, info, sym { if (sym->st_shndx == SHN_COMMON && !info->relocateable - && sym->st_size <= (bfd_vma) bfd_get_gp_size (abfd)) + && sym->st_size <= elf_gp_size (abfd)) { /* Common symbols less than or equal to -G nn bytes are automatically put into .sdata. */ @@ -3712,6 +3700,25 @@ ppc_elf_relocate_section (output_bfd, in return ret; } + +static enum elf_reloc_type_class +ppc_elf_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_PPC_RELATIVE: + return reloc_class_relative; + case R_PPC_REL24: + case R_PPC_ADDR24: + case R_PPC_JMP_SLOT: + return reloc_class_plt; + case R_PPC_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} #define TARGET_LITTLE_SYM bfd_elf32_powerpcle_vec #define TARGET_LITTLE_NAME "elf32-powerpcle" @@ -3757,5 +3764,6 @@ ppc_elf_relocate_section (output_bfd, in #define elf_backend_fake_sections ppc_elf_fake_sections #define elf_backend_additional_program_headers ppc_elf_additional_program_headers #define elf_backend_modify_segment_map ppc_elf_modify_segment_map +#define elf_backend_reloc_type_class ppc_elf_reloc_type_class #include "elf32-target.h" diff -uprN binutils-2.11.90.0.27/bfd/elf32-s390.c binutils-2.11.90.0.29/bfd/elf32-s390.c --- binutils-2.11.90.0.27/bfd/elf32-s390.c Fri Mar 9 11:15:54 2001 +++ binutils-2.11.90.0.29/bfd/elf32-s390.c Mon Aug 27 11:44:51 2001 @@ -37,6 +37,12 @@ static struct bfd_link_hash_table *elf_s static boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); +static asection *elf_s390_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *sym)); +static boolean elf_s390_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); static boolean elf_s390_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static boolean elf_s390_size_dynamic_sections @@ -49,6 +55,8 @@ static boolean elf_s390_finish_dynamic_s Elf_Internal_Sym *)); static boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static boolean elf_s390_object_p PARAMS ((bfd *)); +static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((int)); #define USE_RELA 1 /* We want RELA relocations, not REL. */ @@ -705,6 +713,8 @@ elf_s390_check_relocs (abfd, info, sec, || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf32_External_Rela); @@ -1082,12 +1092,11 @@ elf_s390_adjust_dynamic_symbol (info, h) static boolean elf_s390_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; - boolean reltext; boolean relocs; boolean plt; @@ -1130,7 +1139,6 @@ elf_s390_size_dynamic_sections (output_b determined the sizes of the various dynamic sections. Allocate memory for them. */ plt = false; - reltext = false; relocs = false; for (s = dynobj->sections; s != NULL; s = s->next) { @@ -1177,29 +1185,10 @@ elf_s390_size_dynamic_sections (output_b } else { - asection *target; - /* Remember whether there are any reloc sections other than .rela.plt. */ if (strcmp (name, ".rela.plt") != 0) - { - const char *outname; - - relocs = true; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL - entry. The entries in the .rela.plt section - really apply to the .got section, which we - created ourselves and so know is not readonly. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - } + relocs = true; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -1255,7 +1244,7 @@ elf_s390_size_dynamic_sections (output_b return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; @@ -2143,6 +2132,23 @@ elf_s390_object_p (abfd) return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_esa); } +static enum elf_reloc_type_class +elf_s390_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_390_RELATIVE: + return reloc_class_relative; + case R_390_JMP_SLOT: + return reloc_class_plt; + case R_390_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + #define TARGET_BIG_SYM bfd_elf32_s390_vec #define TARGET_BIG_NAME "elf32-s390" #define ELF_ARCH bfd_arch_s390 @@ -2173,6 +2179,7 @@ elf_s390_object_p (abfd) #define elf_backend_gc_sweep_hook elf_s390_gc_sweep_hook #define elf_backend_relocate_section elf_s390_relocate_section #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections +#define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_object_p elf_s390_object_p diff -uprN binutils-2.11.90.0.27/bfd/elf32-sh.c binutils-2.11.90.0.29/bfd/elf32-sh.c --- binutils-2.11.90.0.27/bfd/elf32-sh.c Wed May 23 11:36:03 2001 +++ binutils-2.11.90.0.29/bfd/elf32-sh.c Mon Aug 27 11:44:51 2001 @@ -72,6 +72,19 @@ static boolean sh_elf_finish_dynamic_sym Elf_Internal_Sym *)); static boolean sh_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_reloc_status_type sh_elf_reloc_loop + PARAMS ((int, bfd *, asection *, bfd_byte *, bfd_vma, asection *, + bfd_vma, bfd_vma)); +static boolean sh_elf_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static asection * sh_elf_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean sh_elf_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static enum elf_reloc_type_class sh_elf_reloc_type_class + PARAMS ((int)); /* The name of the dynamic interpreter. This is put in the .interp section. */ @@ -1100,11 +1113,11 @@ sh_elf_relax_section (abfd, sec, link_in } /* Get the address from which the register is being loaded. The - displacement in the mov.l instruction is quadrupled. It is a - displacement from four bytes after the movl instruction, but, - before adding in the PC address, two least significant bits - of the PC are cleared. We assume that the section is aligned - on a four byte boundary. */ + displacement in the mov.l instruction is quadrupled. It is a + displacement from four bytes after the movl instruction, but, + before adding in the PC address, two least significant bits + of the PC are cleared. We assume that the section is aligned + on a four byte boundary. */ paddr = insn & 0xff; paddr *= 4; paddr += (laddr + 4) & ~3; @@ -2750,14 +2763,13 @@ sh_elf_adjust_dynamic_symbol (info, h) static boolean sh_elf_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; boolean plt; boolean relocs; - boolean reltext; dynobj = elf_hash_table (info)->dynobj; BFD_ASSERT (dynobj != NULL); @@ -2799,7 +2811,6 @@ sh_elf_size_dynamic_sections (output_bfd memory for them. */ plt = false; relocs = false; - reltext = false; for (s = dynobj->sections; s != NULL; s = s->next) { const char *name; @@ -2845,29 +2856,10 @@ sh_elf_size_dynamic_sections (output_bfd } else { - asection *target; - /* Remember whether there are any reloc sections other than .rela.plt. */ if (strcmp (name, ".rela.plt") != 0) - { - const char *outname; - - relocs = true; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL - entry. The entries in the .rela.plt section - really apply to the .got section, which we - created ourselves and so know is not readonly. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - } + relocs = true; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -2923,7 +2915,7 @@ sh_elf_size_dynamic_sections (output_bfd return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; @@ -3641,6 +3633,7 @@ sh_elf_get_relocated_section_contents (o free (sections); return NULL; } + static asection * sh_elf_gc_mark_hook (abfd, info, rel, h, sym) bfd *abfd; @@ -3945,6 +3938,8 @@ sh_elf_check_relocs (abfd, info, sec, re || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf32_External_Rela); @@ -4429,6 +4424,23 @@ sh_elf_finish_dynamic_sections (output_b return true; } +static enum elf_reloc_type_class +sh_elf_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_SH_RELATIVE: + return reloc_class_relative; + case R_SH_JMP_SLOT: + return reloc_class_plt; + case R_SH_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + #ifndef ELF_ARCH #define TARGET_BIG_SYM bfd_elf32_sh_vec #define TARGET_BIG_NAME "elf32-sh" @@ -4472,6 +4484,7 @@ sh_elf_finish_dynamic_sections (output_b sh_elf_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ sh_elf_finish_dynamic_sections +#define elf_backend_reloc_type_class sh_elf_reloc_type_class #define elf_backend_want_got_plt 1 #define elf_backend_plt_readonly 1 diff -uprN binutils-2.11.90.0.27/bfd/elf32-sparc.c binutils-2.11.90.0.29/bfd/elf32-sparc.c --- binutils-2.11.90.0.27/bfd/elf32-sparc.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.29/bfd/elf32-sparc.c Mon Aug 27 11:44:51 2001 @@ -52,6 +52,14 @@ static boolean elf32_sparc_object_p PARAMS ((bfd *)); static void elf32_sparc_final_write_processing PARAMS ((bfd *, boolean)); +static enum elf_reloc_type_class elf32_sparc_reloc_type_class + PARAMS ((int)); +static asection * elf32_sparc_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_sparc_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); /* The relocation "howto" table. */ @@ -592,6 +600,8 @@ elf32_sparc_check_relocs (abfd, info, se || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf32_External_Rela); @@ -909,12 +919,11 @@ elf32_sparc_adjust_dynamic_symbol (info, static boolean elf32_sparc_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; - boolean reltext; boolean relplt; dynobj = elf_hash_table (info)->dynobj; @@ -952,7 +961,6 @@ elf32_sparc_size_dynamic_sections (outpu /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - reltext = false; relplt = false; for (s = dynobj->sections; s != NULL; s = s->next) { @@ -985,19 +993,6 @@ elf32_sparc_size_dynamic_sections (outpu } else { - const char *outname; - asection *target; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - if (strcmp (name, ".rela.plt") == 0) relplt = true; @@ -1058,11 +1053,10 @@ elf32_sparc_size_dynamic_sections (outpu sizeof (Elf32_External_Rela))) return false; - if (reltext) + if (info->flags & DF_TEXTREL) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; - info->flags |= DF_TEXTREL; } } @@ -2081,6 +2075,23 @@ elf32_sparc_final_write_processing (abfd break; } } + +static enum elf_reloc_type_class +elf32_sparc_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_SPARC_RELATIVE: + return reloc_class_relative; + case R_SPARC_JMP_SLOT: + return reloc_class_plt; + case R_SPARC_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} #define TARGET_BIG_SYM bfd_elf32_sparc_vec #define TARGET_BIG_NAME "elf32-sparc" @@ -2111,6 +2122,7 @@ elf32_sparc_final_write_processing (abfd elf32_sparc_final_write_processing #define elf_backend_gc_mark_hook elf32_sparc_gc_mark_hook #define elf_backend_gc_sweep_hook elf32_sparc_gc_sweep_hook +#define elf_backend_reloc_type_class elf32_sparc_reloc_type_class #define elf_backend_can_gc_sections 1 #define elf_backend_want_got_plt 0 diff -uprN binutils-2.11.90.0.27/bfd/elf32-v850.c binutils-2.11.90.0.29/bfd/elf32-v850.c --- binutils-2.11.90.0.27/bfd/elf32-v850.c Fri Mar 9 11:37:58 2001 +++ binutils-2.11.90.0.29/bfd/elf32-v850.c Mon Aug 27 11:44:51 2001 @@ -27,8 +27,9 @@ Foundation, Inc., 59 Temple Place - Suit #include "libbfd.h" #include "elf-bfd.h" #include "elf/v850.h" +#include "libiberty.h" -/* sign-extend a 24-bit number */ +/* Sign-extend a 24-bit number. */ #define SEXT24(x) ((((x) & 0xffffff) ^ (~ 0x7fffff)) + 0x800000) static reloc_howto_type *v850_elf_reloc_type_lookup @@ -81,9 +82,16 @@ static boolean v850_elf_link_output_symb Elf_Internal_Sym *, asection *)); static boolean v850_elf_section_from_shdr PARAMS ((bfd *, Elf_Internal_Shdr *, char *)); +static boolean v850_elf_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static asection * v850_elf_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, + Elf_Internal_Rela *, struct elf_link_hash_entry *, + Elf_Internal_Sym *)); -/* Note: It is REQUIRED that the 'type' value of each entry in this array - match the index of the entry in the array. */ +/* Note: It is REQUIRED that the 'type' value of each entry + in this array match the index of the entry in the array. */ static reloc_howto_type v850_elf_howto_table[] = { /* This reloc does nothing. */ @@ -470,7 +478,7 @@ struct v850_elf_reloc_map /* BFD_RELOC_V850_CALLT_16_16_OFFSET is 258, which will not fix in an unsigned char. */ bfd_reloc_code_real_type bfd_reloc_val; - unsigned char elf_reloc_val; + unsigned int elf_reloc_val; }; static const struct v850_elf_reloc_map v850_elf_reloc_map[] = @@ -503,7 +511,8 @@ static const struct v850_elf_reloc_map v }; -/* Map a bfd relocation into the appropriate howto structure */ +/* Map a bfd relocation into the appropriate howto structure. */ + static reloc_howto_type * v850_elf_reloc_type_lookup (abfd, code) bfd * abfd ATTRIBUTE_UNUSED; @@ -511,22 +520,21 @@ v850_elf_reloc_type_lookup (abfd, code) { unsigned int i; - for (i = 0; - i < sizeof (v850_elf_reloc_map) / sizeof (struct v850_elf_reloc_map); - i++) - { - if (v850_elf_reloc_map[i].bfd_reloc_val == code) - { - BFD_ASSERT (v850_elf_howto_table[v850_elf_reloc_map[i].elf_reloc_val].type == v850_elf_reloc_map[i].elf_reloc_val); + for (i = ARRAY_SIZE (v850_elf_reloc_map); i --;) + if (v850_elf_reloc_map[i].bfd_reloc_val == code) + { + unsigned int elf_reloc_val = v850_elf_reloc_map[i].elf_reloc_val; + + BFD_ASSERT (v850_elf_howto_table[elf_reloc_val].type == elf_reloc_val); - return & v850_elf_howto_table[v850_elf_reloc_map[i].elf_reloc_val]; - } - } + return v850_elf_howto_table + elf_reloc_val; + } return NULL; } /* Set the howto pointer for an V850 ELF reloc. */ + static void v850_elf_info_to_howto_rel (abfd, cache_ptr, dst) bfd * abfd ATTRIBUTE_UNUSED; @@ -626,8 +634,8 @@ v850_elf_check_relocs (abfd, info, sec, return false; break; - /* This relocation describes which C++ vtable entries are actually - used. Record for later use during GC. */ + /* This relocation describes which C++ vtable entries + are actually used. Record for later use during GC. */ case R_V850_GNU_VTENTRY: if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) return false; @@ -662,7 +670,8 @@ v850_elf_check_relocs (abfd, info, sec, small_data_common: if (h) { - h->other |= other; /* flag which type of relocation was used */ + /* Flag which type of relocation was used. */ + h->other |= other; if ((h->other & V850_OTHER_MASK) != (other & V850_OTHER_MASK) && (h->other & V850_OTHER_ERROR) == 0) { @@ -702,7 +711,9 @@ v850_elf_check_relocs (abfd, info, sec, && h->root.u.c.p && !strcmp (bfd_get_section_name (abfd, h->root.u.c.p->section), "COMMON")) { - asection *section = h->root.u.c.p->section = bfd_make_section_old_way (abfd, common); + asection * section; + + section = h->root.u.c.p->section = bfd_make_section_old_way (abfd, common); section->flags |= SEC_IS_COMMON; } @@ -719,20 +730,18 @@ v850_elf_check_relocs (abfd, info, sec, return ret; } -/* - * In the old version, when an entry was checked out from the table, - * it was deleted. This produced an error if the entry was needed - * more than once, as the second attempted retry failed. - * - * In the current version, the entry is not deleted, instead we set - * the field 'found' to true. If a second lookup matches the same - * entry, then we know that the hi16s reloc has already been updated - * and does not need to be updated a second time. - * - * TODO - TOFIX: If it is possible that we need to restore 2 different - * addresses from the same table entry, where the first generates an - * overflow, whilst the second do not, then this code will fail. - */ +/* In the old version, when an entry was checked out from the table, + it was deleted. This produced an error if the entry was needed + more than once, as the second attempted retry failed. + + In the current version, the entry is not deleted, instead we set + the field 'found' to true. If a second lookup matches the same + entry, then we know that the hi16s reloc has already been updated + and does not need to be updated a second time. + + TODO - TOFIX: If it is possible that we need to restore 2 different + addresses from the same table entry, where the first generates an + overflow, whilst the second do not, then this code will fail. */ typedef struct hi16s_location { @@ -825,6 +834,7 @@ find_remembered_hi16s_reloc (addend, alr /* FIXME: The code here probably ought to be removed and the code in reloc.c allowed to do its stuff instead. At least for most of the relocs, anwyay. */ + static bfd_reloc_status_type v850_elf_perform_relocation (abfd, r_type, addend, address) bfd * abfd; @@ -1029,9 +1039,7 @@ v850_elf_perform_relocation (abfd, r_typ 0x00000000 + 0x00006fff (bit 15 not set, so the top half is zero) ------------ - 0x00006fff which is wrong (assuming that fred is at 0xffff) - */ - + 0x00006fff which is wrong (assuming that fred is at 0xffff). */ { long result; @@ -1243,6 +1251,7 @@ v850_elf_perform_relocation (abfd, r_typ } /* Insert the addend into the instruction. */ + static bfd_reloc_status_type v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err) bfd * abfd ATTRIBUTE_UNUSED; @@ -1258,7 +1267,7 @@ v850_elf_reloc (abfd, reloc, symbol, dat /* If there is an output BFD, and the symbol is not a section name (which is only defined at final link time), and either we are not putting the addend into the instruction - or the addend is zero, so there is nothing to add into the instruction + or the addend is zero, so there is nothing to add into the instruction then just fixup the address and return. */ if (obfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 @@ -1270,9 +1279,7 @@ v850_elf_reloc (abfd, reloc, symbol, dat } #if 0 else if (obfd != NULL) - { - return bfd_reloc_continue; - } + return bfd_reloc_continue; #endif /* Catch relocs involving undefined symbols. */ @@ -1314,15 +1321,14 @@ v850_elf_reloc (abfd, reloc, symbol, dat .section ".foo","ax" nop foo: - nop - */ + nop */ if (reloc->howto->pc_relative == true) { /* Here the variable relocation holds the final address of the symbol we are relocating against, plus any addend. */ relocation -= isection->output_section->vma + isection->output_offset; - /* Deal with pcrel_offset */ + /* Deal with pcrel_offset. */ relocation -= reloc->address; } #endif @@ -1340,6 +1346,7 @@ v850_elf_is_local_label_name (abfd, name } /* Perform a relocation as part of a final link. */ + static bfd_reloc_status_type v850_elf_final_link_relocate (howto, input_bfd, output_bfd, input_section, contents, offset, value, @@ -1377,7 +1384,8 @@ v850_elf_final_link_relocate (howto, inp if (((value & 0xff000000) != 0x0) && ((value & 0xff000000) != 0xff000000)) return bfd_reloc_overflow; - value = SEXT24 (value); /* Only the bottom 24 bits of the PC are valid */ + /* Only the bottom 24 bits of the PC are valid */ + value = SEXT24 (value); break; case R_V850_HI16_S: @@ -1436,7 +1444,8 @@ v850_elf_final_link_relocate (howto, inp h = bfd_link_hash_lookup (info->hash, "__ep", false, false, true); if (h == (struct bfd_link_hash_entry *) NULL || h->type != bfd_link_hash_defined) - return bfd_reloc_continue; /* Actually this indicates that __ep could not be found. */ + /* Actually this indicates that __ep could not be found. */ + return bfd_reloc_continue; ep = (h->u.def.value + h->u.def.section->output_section->vma @@ -1455,7 +1464,8 @@ v850_elf_final_link_relocate (howto, inp h = bfd_link_hash_lookup (info->hash, "__ctbp", false, false, true); if (h == (struct bfd_link_hash_entry *) NULL || h->type != bfd_link_hash_defined) - return (bfd_reloc_dangerous + 1); /* Actually this indicates that __ctbp could not be found. */ + /* Actually this indicates that __ctbp could not be found. */ + return bfd_reloc_dangerous + 1; ctbp = (h->u.def.value + h->u.def.section->output_section->vma @@ -1501,6 +1511,7 @@ v850_elf_final_link_relocate (howto, inp } /* Relocate an V850 ELF section. */ + static boolean v850_elf_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections) @@ -1589,11 +1600,12 @@ v850_elf_relocate_section (output_bfd, i #if 0 { char * name; + name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); name = (name == NULL) ? "" : name; -fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n", - sec->name, name, sym->st_name, - sec->output_section->vma, sec->output_offset, sym->st_value, rel->r_addend); + fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n", + sec->name, name, sym->st_name, + sec->output_section->vma, sec->output_offset, sym->st_value, rel->r_addend); } #endif } @@ -1613,15 +1625,15 @@ fprintf (stderr, "local: sec: %s, sym: % + sec->output_section->vma + sec->output_offset); #if 0 -fprintf (stderr, "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n", - sec->name, h->root.root.string, h->root.u.def.value, sec->output_section->vma, sec->output_offset, relocation); + fprintf (stderr, "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n", + sec->name, h->root.root.string, h->root.u.def.value, sec->output_section->vma, sec->output_offset, relocation); #endif } else if (h->root.type == bfd_link_hash_undefweak) { #if 0 -fprintf (stderr, "undefined: sec: %s, name: %s\n", - sec->name, h->root.root.string); + fprintf (stderr, "undefined: sec: %s, name: %s\n", + sec->name, h->root.root.string); #endif relocation = 0; } @@ -1632,14 +1644,13 @@ fprintf (stderr, "undefined: sec: %s, na input_section, rel->r_offset, true))) return false; #if 0 -fprintf (stderr, "unknown: name: %s\n", h->root.root.string); + fprintf (stderr, "unknown: name: %s\n", h->root.root.string); #endif relocation = 0; } } - /* FIXME: We should use the addend, but the COFF relocations - don't. */ + /* FIXME: We should use the addend, but the COFF relocations don't. */ r = v850_elf_final_link_relocate (howto, input_bfd, output_bfd, input_section, contents, rel->r_offset, @@ -1725,7 +1736,7 @@ v850_elf_gc_sweep_hook (abfd, info, sec, asection *sec ATTRIBUTE_UNUSED; const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; { - /* No got and plt entries for v850-elf */ + /* No got and plt entries for v850-elf. */ return true; } @@ -1772,7 +1783,9 @@ v850_elf_gc_mark_hook (abfd, info, rel, } return NULL; } + /* Set the right machine number. */ + static boolean v850_elf_object_p (abfd) bfd *abfd; @@ -1788,6 +1801,7 @@ v850_elf_object_p (abfd) } /* Store the machine number in the flags field. */ + static void v850_elf_final_write_processing (abfd, linker) bfd * abfd; @@ -1808,6 +1822,7 @@ v850_elf_final_write_processing (abfd, l } /* Function to keep V850 specific file flags. */ + static boolean v850_elf_set_private_flags (abfd, flags) bfd * abfd; @@ -1821,7 +1836,8 @@ v850_elf_set_private_flags (abfd, flags) return true; } -/* Copy backend specific data from one object module to another */ +/* Copy backend specific data from one object module to another. */ + static boolean v850_elf_copy_private_bfd_data (ibfd, obfd) bfd * ibfd; @@ -1838,11 +1854,12 @@ v850_elf_copy_private_bfd_data (ibfd, ob elf_gp (obfd) = elf_gp (ibfd); elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; elf_flags_init (obfd) = true; + return true; } -/* Merge backend specific data from an object file to the output - object file when linking. */ +/* Merge backend specific data from an object file + to the output object file when linking. */ static boolean v850_elf_merge_private_bfd_data (ibfd, obfd) bfd * ibfd; @@ -1874,9 +1891,7 @@ v850_elf_merge_private_bfd_data (ibfd, o if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) && bfd_get_arch_info (obfd)->the_default) - { - return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd)); - } + return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd)); return true; } @@ -1892,7 +1907,8 @@ v850_elf_merge_private_bfd_data (ibfd, o return true; } -/* Display the flags field */ + +/* Display the flags field. */ static boolean v850_elf_print_private_bfd_data (abfd, ptr) @@ -1938,8 +1954,8 @@ static asection v850_elf_zcom_section; static asymbol v850_elf_zcom_symbol; static asymbol * v850_elf_zcom_symbol_ptr; -/* Given a BFD section, try to locate the corresponding ELF section - index. */ +/* Given a BFD section, try to locate the + corresponding ELF section index. */ static boolean v850_elf_section_from_bfd_section (abfd, hdr, sec, retval) @@ -2119,7 +2135,6 @@ v850_elf_add_symbol_hook (abfd, info, sy return true; } -/*ARGSIGNORED*/ static boolean v850_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec) bfd * abfd ATTRIBUTE_UNUSED; @@ -2173,8 +2188,9 @@ v850_elf_section_from_shdr (abfd, hdr, n return true; } -/* Set the correct type for a V850 ELF section. We do this by the - section name, which is a hack, but ought to work. */ +/* Set the correct type for a V850 ELF section. We do this + by the section name, which is a hack, but ought to work. */ + static boolean v850_elf_fake_sections (abfd, hdr, sec) bfd * abfd ATTRIBUTE_UNUSED; diff -uprN binutils-2.11.90.0.27/bfd/elf64-alpha.c binutils-2.11.90.0.29/bfd/elf64-alpha.c --- binutils-2.11.90.0.27/bfd/elf64-alpha.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.29/bfd/elf64-alpha.c Mon Aug 27 11:44:51 2001 @@ -133,6 +133,8 @@ static boolean elf64_alpha_merge_ind_sym PARAMS((struct alpha_elf_link_hash_entry *, PTR)); static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs PARAMS ((Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_vma, int)); +static enum elf_reloc_type_class elf64_alpha_reloc_type_class + PARAMS ((int)); struct alpha_elf_link_hash_entry { @@ -159,7 +161,7 @@ struct alpha_elf_link_hash_entry bfd *gotobj; /* the addend in effect for this entry. */ - bfd_vma addend; + bfd_signed_vma addend; /* the .got offset for this entry. */ int got_offset; @@ -182,7 +184,10 @@ struct alpha_elf_link_hash_entry asection *srel; /* what kind of relocation? */ - unsigned long rtype; + unsigned int rtype; + + /* is this against read-only section? */ + unsigned int reltext : 1; /* how many did we find? */ unsigned long count; @@ -1119,7 +1124,8 @@ elf64_alpha_find_reloc_at_ofs (rel, rele { while (rel < relend) { - if (rel->r_offset == offset && ELF64_R_TYPE (rel->r_info) == type) + if (rel->r_offset == offset + && ELF64_R_TYPE (rel->r_info) == (unsigned int) type) return rel; ++rel; } @@ -1615,7 +1621,6 @@ elf64_alpha_relax_section (abfd, sec, li continue; info.h = h; - info.gotent = gotent; info.tsec = h->root.root.u.def.section; info.other = h->root.other; gotent = h->got_entries; @@ -1855,7 +1860,7 @@ elf64_alpha_add_symbol_hook (abfd, info, { if (sym->st_shndx == SHN_COMMON && !info->relocateable - && sym->st_size <= bfd_get_gp_size (abfd)) + && sym->st_size <= elf_gp_size (abfd)) { /* Common symbols less than or equal to -G nn bytes are automatically put into .sbss. */ @@ -2627,6 +2632,7 @@ elf64_alpha_check_relocs (abfd, info, se rent->srel = sreloc; rent->rtype = r_type; rent->count = 1; + rent->reltext = (sec->flags & SEC_READONLY) != 0; rent->next = h->reloc_entries; h->reloc_entries = rent; @@ -2639,6 +2645,8 @@ elf64_alpha_check_relocs (abfd, info, se /* If this is a shared library, and the section is to be loaded into memory, we need a RELATIVE reloc. */ sreloc->_raw_size += sizeof (Elf64_External_Rela); + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } break; } @@ -2963,7 +2971,7 @@ elf64_alpha_merge_gots (a, b) static boolean elf64_alpha_calc_got_offsets_for_symbol (h, arg) struct alpha_elf_link_hash_entry *h; - PTR arg; + PTR arg ATTRIBUTE_UNUSED; { struct alpha_elf_got_entry *gotent; @@ -3029,10 +3037,10 @@ elf64_alpha_calc_got_offsets (info) static boolean elf64_alpha_size_got_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { - bfd *i, *got_list, *cur_got_obj; + bfd *i, *got_list, *cur_got_obj = NULL; int something_changed = 0; got_list = alpha_elf_hash_table (info)->got_list; @@ -3181,6 +3189,8 @@ elf64_alpha_calc_dynrel_sizes (h, info) { relent->srel->_raw_size += sizeof (Elf64_External_Rela) * relent->count; + if (relent->reltext) + info->flags |= DT_TEXTREL; } dynobj = elf_hash_table(info)->dynobj; @@ -3209,12 +3219,11 @@ elf64_alpha_calc_dynrel_sizes (h, info) static boolean elf64_alpha_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; - boolean reltext; boolean relplt; dynobj = elf_hash_table(info)->dynobj; @@ -3263,7 +3272,6 @@ elf64_alpha_size_dynamic_sections (outpu /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - reltext = false; relplt = false; for (s = dynobj->sections; s != NULL; s = s->next) { @@ -3293,19 +3301,6 @@ elf64_alpha_size_dynamic_sections (outpu if (!strip) { - const char *outname; - asection *target; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - if (strcmp(name, ".rela.plt") == 0) relplt = true; @@ -3361,11 +3356,10 @@ elf64_alpha_size_dynamic_sections (outpu sizeof (Elf64_External_Rela))) return false; - if (reltext) + if (info->flags & DF_TEXTREL) { if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; - info->flags |= DF_TEXTREL; } } @@ -3428,7 +3422,7 @@ elf64_alpha_relocate_section (output_bfd struct alpha_elf_link_hash_entry *h; Elf_Internal_Sym *sym; bfd_vma relocation; - bfd_vma addend; + bfd_signed_vma addend; bfd_reloc_status_type r; r_type = ELF64_R_TYPE(rel->r_info); @@ -4168,7 +4162,7 @@ elf64_alpha_final_link (abfd, info) { asection *s; EXTR esym; - bfd_vma last; + bfd_vma last = 0; unsigned int i; static const char * const name[] = { @@ -4650,6 +4644,23 @@ elf64_alpha_final_link (abfd, info) return true; } + +static enum elf_reloc_type_class +elf64_alpha_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_ALPHA_RELATIVE: + return reloc_class_relative; + case R_ALPHA_JMP_SLOT: + return reloc_class_plt; + case R_ALPHA_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} /* ECOFF swapping routines. These are used when dealing with the .mdebug section, which is in the ECOFF debugging format. Copied @@ -4777,6 +4788,8 @@ const struct elf_size_info alpha_elf_siz elf64_alpha_finish_dynamic_sections #define bfd_elf64_bfd_final_link \ elf64_alpha_final_link +#define elf_backend_reloc_type_class \ + elf64_alpha_reloc_type_class #define elf_backend_ecoff_debug_swap \ &elf64_alpha_ecoff_debug_swap diff -uprN binutils-2.11.90.0.27/bfd/elf64-hppa.c binutils-2.11.90.0.29/bfd/elf64-hppa.c --- binutils-2.11.90.0.27/bfd/elf64-hppa.c Sat Jun 2 23:14:57 2001 +++ binutils-2.11.90.0.29/bfd/elf64-hppa.c Wed Aug 22 08:52:09 2001 @@ -198,10 +198,18 @@ static boolean elf64_hppa_adjust_dynamic static boolean elf64_hppa_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static boolean elf64_hppa_link_output_symbol_hook +PARAMS ((bfd *abfd, struct bfd_link_info *, const char *, + Elf_Internal_Sym *, asection *input_sec)); + static boolean elf64_hppa_finish_dynamic_symbol PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static int elf64_hppa_additional_program_headers PARAMS ((bfd *)); + +static boolean elf64_hppa_modify_segment_map PARAMS ((bfd *)); + static boolean elf64_hppa_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); @@ -2658,7 +2666,7 @@ const struct elf_size_info hppa64_elf_si #define elf_backend_object_p elf64_hppa_object_p #define elf_backend_final_write_processing \ elf_hppa_final_write_processing -#define elf_backend_fake_sections elf_hppa_fake_sections +#define elf_backend_fake_sections elf_hppa_fake_sections #define elf_backend_add_symbol_hook elf_hppa_add_symbol_hook #define elf_backend_relocate_section elf_hppa_relocate_section diff -uprN binutils-2.11.90.0.27/bfd/elf64-mips.c binutils-2.11.90.0.29/bfd/elf64-mips.c --- binutils-2.11.90.0.27/bfd/elf64-mips.c Wed May 2 23:29:57 2001 +++ binutils-2.11.90.0.29/bfd/elf64-mips.c Wed Aug 22 08:52:09 2001 @@ -90,6 +90,8 @@ static boolean mips_elf64_write_armap /* The relocation table used for SHT_REL sections. */ +#define UNUSED_RELOC(num) { num, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + static reloc_howto_type mips_elf64_howto_table_rel[] = { /* No relocation. */ @@ -291,9 +293,9 @@ static reloc_howto_type mips_elf64_howto 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - { 13 }, - { 14 }, - { 15 }, + UNUSED_RELOC (13), + UNUSED_RELOC (14), + UNUSED_RELOC (15), /* A 5 bit shift field. */ HOWTO (R_MIPS_SHIFT5, /* type */ @@ -845,9 +847,9 @@ static reloc_howto_type mips_elf64_howto 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - { 13 }, - { 14 }, - { 15 }, + UNUSED_RELOC (13), + UNUSED_RELOC (14), + UNUSED_RELOC (15), /* A 5 bit shift field. */ HOWTO (R_MIPS_SHIFT5, /* type */ @@ -1813,7 +1815,7 @@ mips_elf64_write_relocs (abfd, sec, data } BFD_ASSERT (ext_rela - (Elf64_Mips_External_Rela *) rela_hdr->contents - == count); + == (int) count); } /* Irix 6 defines a brand new archive map format, so that they can diff -uprN binutils-2.11.90.0.27/bfd/elf64-ppc.c binutils-2.11.90.0.29/bfd/elf64-ppc.c --- binutils-2.11.90.0.27/bfd/elf64-ppc.c Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/bfd/elf64-ppc.c Mon Aug 27 11:44:51 2001 @@ -0,0 +1,3768 @@ +/* PowerPC64-specific support for 64-bit ELF. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + Written by Linus Nordberg, Swox AB , + based on elf32-ppc.c by Ian Lance Taylor. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* This file is based on the 64-bit PowerPC ELF ABI. It is also based + on the file elf32-ppc.c. */ + +#include "bfd.h" +#include "sysdep.h" +#include "bfdlink.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/ppc.h" + +#define USE_RELA /* we want RELA relocations, not REL. */ + + +static void ppc_howto_init + PARAMS ((void)); +static reloc_howto_type *ppc64_elf_reloc_type_lookup + PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); +static void ppc64_elf_info_to_howto + PARAMS ((bfd *abfd, arelent *cache_ptr, Elf64_Internal_Rela *dst)); +static bfd_reloc_status_type ppc64_elf_addr16_ha_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static boolean ppc64_elf_set_private_flags + PARAMS ((bfd *, flagword)); +static boolean ppc64_elf_copy_private_bfd_data + PARAMS ((bfd *, bfd *)); +static boolean ppc64_elf_merge_private_bfd_data + PARAMS ((bfd *, bfd *)); +static boolean ppc64_elf_section_from_shdr + PARAMS ((bfd *, Elf64_Internal_Shdr *, char *)); +static boolean ppc64_elf_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static boolean ppc64_elf_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static asection * ppc64_elf_gc_mark_hook + PARAMS ((bfd *abfd, struct bfd_link_info *info, Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)); +static boolean ppc64_elf_gc_sweep_hook + PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec, + const Elf_Internal_Rela *relocs)); +static boolean ppc64_elf_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static boolean ppc_adjust_dynindx + PARAMS ((struct elf_link_hash_entry *, PTR)); +static boolean ppc64_elf_size_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static boolean ppc64_elf_final_link + PARAMS ((bfd *, struct bfd_link_info *)); +static boolean ppc64_elf_fake_sections + PARAMS ((bfd *, Elf64_Internal_Shdr *, asection *)); +static boolean ppc64_elf_relocate_section + PARAMS ((bfd *, struct bfd_link_info *info, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, + asection **)); +static boolean ppc64_elf_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *)); +static boolean ppc64_elf_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + + +/* Branch prediction bit for branch taken relocs. */ +#define BRANCH_PREDICT_BIT 0x200000 + +/* Mask to set RA in memory instructions. */ +#define RA_REGISTER_MASK 0x001f0000 + +/* Value to shift register by to insert RA. */ +#define RA_REGISTER_SHIFT 16 + +/* The name of the dynamic interpreter. This is put in the .interp + section. */ +#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" + +/* The size in bytes of an entry in the procedure linkage table. */ +#define PLT_ENTRY_SIZE 24 + +/* The initial size of the plt reserved for the dynamic linker. */ +#define PLT_INITIAL_ENTRY_SIZE 96 + +/* TOC base pointers offset from start of TOC. */ +#define TOC_BASE_OFF (0x8000) + +/* Global linkage stub. The first instruction has its offset patched. */ +/* FIXME: Need traceback table? */ +static const unsigned int ppc64_elf_glink_code[] = { + 0xe9820000, /* ld %r12,0(%r2) */ + 0xf8410028, /* std %r2,40(%r1) */ + 0xe80c0000, /* ld %r0,0(%r12) */ + 0xe84c0008, /* ld %r2,8(%r12) */ + 0x7c0903a6, /* mtctr %r0 */ + 0x4e800420 /* bctr */ +}; + +#define PPC64_ELF_GLINK_SIZE \ + ((sizeof ppc64_elf_glink_code / sizeof ppc64_elf_glink_code[0]) * 4) + +/* Relocation HOWTO's. */ +static reloc_howto_type *ppc64_elf_howto_table[(int) R_PPC_max]; + +static reloc_howto_type ppc64_elf_howto_raw[] = { + /* This reloc does nothing. */ + HOWTO (R_PPC64_NONE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* A standard 32 bit relocation. */ + HOWTO (R_PPC64_ADDR32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* An absolute 26 bit branch; the lower two bits must be zero. + FIXME: we don't check that, we just clear them. */ + HOWTO (R_PPC64_ADDR24, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR24", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* A standard 16 bit relocation. */ + HOWTO (R_PPC64_ADDR16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16 bit relocation without overflow. */ + HOWTO (R_PPC64_ADDR16_LO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR16_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Bits 16-31 of an address. */ + HOWTO (R_PPC64_ADDR16_HI, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR16_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Bits 16-31 of an address, plus 1 if the contents of the low 16 + bits, treated as a signed number, is negative. */ + HOWTO (R_PPC64_ADDR16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_ADDR16_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* An absolute 16 bit branch; the lower two bits must be zero. + FIXME: we don't check that, we just clear them. */ + HOWTO (R_PPC64_ADDR14, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR14", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* An absolute 16 bit branch, for which bit 10 should be set to + indicate that the branch is expected to be taken. The lower two + bits must be zero. */ + HOWTO (R_PPC64_ADDR14_BRTAKEN, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR14_BRTAKEN",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* An absolute 16 bit branch, for which bit 10 should be set to + indicate that the branch is not expected to be taken. The lower + two bits must be zero. */ + HOWTO (R_PPC64_ADDR14_BRNTAKEN, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR14_BRNTAKEN",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* A relative 26 bit branch; the lower two bits must be zero. */ + HOWTO (R_PPC64_REL24, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL24", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffffc, /* dst_mask */ + true), /* pcrel_offset */ + + /* A relative 16 bit branch; the lower two bits must be zero. */ + HOWTO (R_PPC64_REL14, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL14", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + true), /* pcrel_offset */ + + /* A relative 16 bit branch. Bit 10 should be set to indicate that + the branch is expected to be taken. The lower two bits must be + zero. */ + HOWTO (R_PPC64_REL14_BRTAKEN, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL14_BRTAKEN", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + true), /* pcrel_offset */ + + /* A relative 16 bit branch. Bit 10 should be set to indicate that + the branch is not expected to be taken. The lower two bits must + be zero. */ + HOWTO (R_PPC64_REL14_BRNTAKEN, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL14_BRNTAKEN",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + true), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16, but referring to the GOT table entry for the + symbol. */ + HOWTO (R_PPC64_GOT16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_GOT16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_LO, but referring to the GOT table entry for + the symbol. */ + HOWTO (R_PPC64_GOT16_LO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_GOT16_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_HI, but referring to the GOT table entry for + the symbol. */ + HOWTO (R_PPC64_GOT16_HI, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_GOT16_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_HA, but referring to the GOT table entry for + the symbol. */ + HOWTO (R_PPC64_GOT16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_GOT16_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* This is used only by the dynamic linker. The symbol should exist + both in the object being run and in some shared library. The + dynamic linker copies the data addressed by the symbol from the + shared library into the object, because the object being + run has to have the data at some particular address. */ + HOWTO (R_PPC64_COPY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_COPY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR64, but used when setting global offset table + entries. */ + HOWTO (R_PPC64_GLOB_DAT, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_GLOB_DAT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Created by the link editor. Marks a procedure linkage table + entry for a symbol. */ + HOWTO (R_PPC64_JMP_SLOT, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_JMP_SLOT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* Used only by the dynamic linker. When the object is run, this + doubleword64 is set to the load address of the object, plus the + addend. */ + HOWTO (R_PPC64_RELATIVE, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_RELATIVE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR32, but may be unaligned. */ + HOWTO (R_PPC64_UADDR32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_UADDR32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16, but may be unaligned. */ + HOWTO (R_PPC64_UADDR16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_UADDR16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32-bit PC relative. */ + HOWTO (R_PPC64_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + /* FIXME: Verify. Was complain_overflow_bitfield. */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 32-bit relocation to the symbol's procedure linkage table. + FIXME: R_PPC64_PLT32 not supported. */ + HOWTO (R_PPC64_PLT32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLT32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32-bit PC relative relocation to the symbol's procedure linkage table. + FIXME: R_PPC64_PLTREL32 not supported. */ + HOWTO (R_PPC64_PLTREL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLTREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_LO, but referring to the PLT table entry for + the symbol. */ + HOWTO (R_PPC64_PLT16_LO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLT16_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_HI, but referring to the PLT table entry for + the symbol. */ + HOWTO (R_PPC64_PLT16_HI, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLT16_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_HA, but referring to the PLT table entry for + the symbol. */ + HOWTO (R_PPC64_PLT16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_PLT16_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32-bit section relative relocation. */ + /* FIXME: Verify R_PPC64_SECTOFF. Seems strange with size=2 and + dst_mask=0. */ + HOWTO (R_PPC64_SECTOFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_SECTOFF", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* 16-bit lower half section relative relocation. */ + HOWTO (R_PPC64_SECTOFF_LO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_SECTOFF_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16-bit upper half section relative relocation. */ + HOWTO (R_PPC64_SECTOFF_HI, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_SECTOFF_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16-bit upper half adjusted section relative relocation. */ + HOWTO (R_PPC64_SECTOFF_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_SECTOFF_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_REL24 without touching the two least significant + bits. */ + /* FIXME: Verify R_PPC64_ADDR30. */ + HOWTO (R_PPC64_ADDR30, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 30, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR30", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffffffc, /* dst_mask */ + true), /* pcrel_offset */ + + /* Relocs in the 64-bit PowerPC ELF ABI, not in the 32-bit ABI. */ + + /* A standard 64-bit relocation. */ + HOWTO (R_PPC64_ADDR64, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR64", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The bits 32-47 of an address. */ + HOWTO (R_PPC64_ADDR16_HIGHER, /* type */ + 32, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR16_HIGHER", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The bits 32-47 of an address, plus 1 if the contents of the low + 16 bits, treated as a signed number, is negative. */ + HOWTO (R_PPC64_ADDR16_HIGHERA, /* type */ + 32, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_ADDR16_HIGHERA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The bits 48-63 of an address. */ + HOWTO (R_PPC64_ADDR16_HIGHEST,/* type */ + 48, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR16_HIGHEST", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The bits 48-63 of an address, plus 1 if the contents of the low + 16 bits, treated as a signed number, is negative. */ + HOWTO (R_PPC64_ADDR16_HIGHESTA,/* type */ + 48, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_ADDR16_HIGHESTA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like ADDR64, but may be unaligned. */ + HOWTO (R_PPC64_UADDR64, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_UADDR64", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 64-bit relative relocation. */ + HOWTO (R_PPC64_REL64, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_REL64", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 64-bit relocation to the symbol's procedure linkage table. */ + /* FIXME: R_PPC64_PLT64 not supported. */ + HOWTO (R_PPC64_PLT64, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLT64", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 64-bit PC relative relocation to the symbol's procedure linkage + table. */ + /* FIXME: R_PPC64_PLTREL64 not supported. */ + HOWTO (R_PPC64_PLTREL64, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLTREL64", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* 16 bit TOC-relative relocation. */ + + /* R_PPC64_TOC16 47 half16* S + A - .TOC. */ + HOWTO (R_PPC64_TOC16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_TOC16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit TOC-relative relocation without overflow. */ + + /* R_PPC64_TOC16_LO 48 half16 #lo (S + A - .TOC.) */ + HOWTO (R_PPC64_TOC16_LO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_TOC16_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit TOC-relative relocation, high 16 bits. */ + + /* R_PPC64_TOC16_HI 49 half16 #hi (S + A - .TOC.) */ + HOWTO (R_PPC64_TOC16_HI, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_TOC16_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit TOC-relative relocation, high 16 bits, plus 1 if the + contents of the low 16 bits, treated as a signed number, is + negative. */ + + /* R_PPC64_TOC16_HA 50 half16 #ha (S + A - .TOC.) */ + HOWTO (R_PPC64_TOC16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_TOC16_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 64-bit relocation; insert value of TOC base (.TOC.). */ + + /* R_PPC64_TOC 51 doubleword64 .TOC. */ + HOWTO (R_PPC64_TOC, /* type */ + 0, /* rightshift */ + 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_TOC", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffffffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_GOT16, but also informs the link editor that the + value to relocate may (!) refer to a PLT entry which the link + editor (a) may replace with the symbol value. If the link editor + is unable to fully resolve the symbol, it may (b) create a PLT + entry and store the address to the new PLT entry in the GOT. + This permits lazy resolution of function symbols at run time. + The link editor may also skip all of this and just (c) emit a + R_PPC64_GLOB_DAT to tie the symbol to the GOT entry. */ + /* FIXME: R_PPC64_PLTGOT16 not implemented. */ + HOWTO (R_PPC64_PLTGOT16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLTGOT16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLTGOT16, but without overflow. */ + /* FIXME: R_PPC64_PLTGOT16_LO not implemented. */ + HOWTO (R_PPC64_PLTGOT16_LO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLTGOT16_LO", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLT_GOT16, but using bits 16-31 of the address. */ + /* FIXME: R_PPC64_PLTGOT16_HI not implemented. */ + HOWTO (R_PPC64_PLTGOT16_HI, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLTGOT16_HI", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLT_GOT16, but using bits 16-31 of the address, plus + 1 if the contents of the low 16 bits, treated as a signed number, + is negative. */ + /* FIXME: R_PPC64_PLTGOT16_HA not implemented. */ + HOWTO (R_PPC64_PLTGOT16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + ppc64_elf_addr16_ha_reloc, /* special_function */ + "R_PPC64_PLTGOT16_HA", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16, but for instructions with a DS field. */ + HOWTO (R_PPC64_ADDR16_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR16_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_ADDR16_LO, but for instructions with a DS field. */ + HOWTO (R_PPC64_ADDR16_LO_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_ADDR16_LO_DS",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_GOT16, but for instructions with a DS field. */ + HOWTO (R_PPC64_GOT16_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_GOT16_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_GOT16_LO, but for instructions with a DS field. */ + HOWTO (R_PPC64_GOT16_LO_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_GOT16_LO_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLT16_LO, but for instructions with a DS field. */ + HOWTO (R_PPC64_PLT16_LO_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLT16_LO_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_SECTOFF, but for instructions with a DS field. */ + /* FIXME: Verify R_PPC64_SECTOFF. Seems strange with size=2 and + dst_mask=0. */ + HOWTO (R_PPC64_SECTOFF_DS, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_SECTOFF_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* Like R_PPC64_SECTOFF_LO, but for instructions with a DS field. */ + HOWTO (R_PPC64_SECTOFF_LO_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_SECTOFF_LO_DS",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_TOC16, but for instructions with a DS field. */ + HOWTO (R_PPC64_TOC16_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_TOC16_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_TOC16_LO, but for instructions with a DS field. */ + HOWTO (R_PPC64_TOC16_LO_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_TOC16_LO_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLTGOT16, but for instructions with a DS field. */ + /* FIXME: R_PPC64_PLTGOT16_DS not implemented. */ + HOWTO (R_PPC64_PLTGOT16_DS, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLTGOT16_DS", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* Like R_PPC64_PLTGOT16_LO, but for instructions with a DS field. */ + /* FIXME: R_PPC64_PLTGOT16_LO not implemented. */ + HOWTO (R_PPC64_PLTGOT16_LO_DS,/* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_PLTGOT16_LO_DS",/* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy. */ + HOWTO (R_PPC64_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_PPC64_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage. */ + HOWTO (R_PPC64_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_PPC64_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ +}; + + +/* Initialize the ppc64_elf_howto_table, so that linear accesses can + be done. */ + +static void +ppc_howto_init () +{ + unsigned int i, type; + + for (i = 0; + i < sizeof (ppc64_elf_howto_raw) / sizeof (ppc64_elf_howto_raw[0]); + i++) + { + type = ppc64_elf_howto_raw[i].type; + BFD_ASSERT (type < (sizeof (ppc64_elf_howto_table) + / sizeof (ppc64_elf_howto_table[0]))); + ppc64_elf_howto_table[type] = &ppc64_elf_howto_raw[i]; + } +} + +static reloc_howto_type * +ppc64_elf_reloc_type_lookup (abfd, code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + enum elf_ppc_reloc_type ppc_reloc = R_PPC_NONE; + + if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) + /* Initialize howto table if needed. */ + ppc_howto_init (); + + switch ((int) code) + { + default: + return (reloc_howto_type *) NULL; + + case BFD_RELOC_NONE: ppc_reloc = R_PPC64_NONE; + break; + case BFD_RELOC_32: ppc_reloc = R_PPC64_ADDR32; + break; + case BFD_RELOC_PPC_BA26: ppc_reloc = R_PPC64_ADDR24; + break; + case BFD_RELOC_16: ppc_reloc = R_PPC64_ADDR16; + break; + case BFD_RELOC_LO16: ppc_reloc = R_PPC64_ADDR16_LO; + break; + case BFD_RELOC_HI16: ppc_reloc = R_PPC64_ADDR16_HI; + break; + case BFD_RELOC_HI16_S: ppc_reloc = R_PPC64_ADDR16_HA; + break; + case BFD_RELOC_PPC_BA16: ppc_reloc = R_PPC64_ADDR14; + break; + case BFD_RELOC_PPC_BA16_BRTAKEN: ppc_reloc = R_PPC64_ADDR14_BRTAKEN; + break; + case BFD_RELOC_PPC_BA16_BRNTAKEN: ppc_reloc = R_PPC64_ADDR14_BRNTAKEN; + break; + case BFD_RELOC_PPC_B26: ppc_reloc = R_PPC64_REL24; + break; + case BFD_RELOC_PPC_B16: ppc_reloc = R_PPC64_REL14; + break; + case BFD_RELOC_PPC_B16_BRTAKEN: ppc_reloc = R_PPC64_REL14_BRTAKEN; + break; + case BFD_RELOC_PPC_B16_BRNTAKEN: ppc_reloc = R_PPC64_REL14_BRNTAKEN; + break; + case BFD_RELOC_16_GOTOFF: ppc_reloc = R_PPC64_GOT16; + break; + case BFD_RELOC_LO16_GOTOFF: ppc_reloc = R_PPC64_GOT16_LO; + break; + case BFD_RELOC_HI16_GOTOFF: ppc_reloc = R_PPC64_GOT16_HI; + break; + case BFD_RELOC_HI16_S_GOTOFF: ppc_reloc = R_PPC64_GOT16_HA; + break; + case BFD_RELOC_PPC_COPY: ppc_reloc = R_PPC64_COPY; + break; + case BFD_RELOC_PPC_GLOB_DAT: ppc_reloc = R_PPC64_GLOB_DAT; + break; + case BFD_RELOC_32_PCREL: ppc_reloc = R_PPC64_REL32; + break; + case BFD_RELOC_32_PLTOFF: ppc_reloc = R_PPC64_PLT32; + break; + case BFD_RELOC_32_PLT_PCREL: ppc_reloc = R_PPC64_PLTREL32; + break; + case BFD_RELOC_LO16_PLTOFF: ppc_reloc = R_PPC64_PLT16_LO; + break; + case BFD_RELOC_HI16_PLTOFF: ppc_reloc = R_PPC64_PLT16_HI; + break; + case BFD_RELOC_HI16_S_PLTOFF: ppc_reloc = R_PPC64_PLT16_HA; + break; + case BFD_RELOC_32_BASEREL: ppc_reloc = R_PPC64_SECTOFF; + break; + case BFD_RELOC_LO16_BASEREL: ppc_reloc = R_PPC64_SECTOFF_LO; + break; + case BFD_RELOC_HI16_BASEREL: ppc_reloc = R_PPC64_SECTOFF_HI; + break; + case BFD_RELOC_HI16_S_BASEREL: ppc_reloc = R_PPC64_SECTOFF_HA; + break; + /* FIXME: Is CTOR 32 or 64 bits? Fix md_apply_fix3 in + gas/config/tc-ppc.c too. */ + case BFD_RELOC_CTOR: ppc_reloc = R_PPC64_ADDR32; + break; + case BFD_RELOC_64: ppc_reloc = R_PPC64_ADDR64; + break; + case BFD_RELOC_PPC64_HIGHER: ppc_reloc = R_PPC64_ADDR16_HIGHER; + break; + case BFD_RELOC_PPC64_HIGHER_S: ppc_reloc = R_PPC64_ADDR16_HIGHERA; + break; + case BFD_RELOC_PPC64_HIGHEST: ppc_reloc = R_PPC64_ADDR16_HIGHEST; + break; + case BFD_RELOC_PPC64_HIGHEST_S: ppc_reloc = R_PPC64_ADDR16_HIGHESTA; + break; + case BFD_RELOC_64_PCREL: ppc_reloc = R_PPC64_REL64; + break; + case BFD_RELOC_64_PLTOFF: ppc_reloc = R_PPC64_PLT64; + break; + case BFD_RELOC_64_PLT_PCREL: ppc_reloc = R_PPC64_PLTREL64; + break; + case BFD_RELOC_PPC_TOC16: ppc_reloc = R_PPC64_TOC16; + break; + case BFD_RELOC_PPC64_TOC16_LO: ppc_reloc = R_PPC64_TOC16_LO; + break; + case BFD_RELOC_PPC64_TOC16_HI: ppc_reloc = R_PPC64_TOC16_HI; + break; + case BFD_RELOC_PPC64_TOC16_HA: ppc_reloc = R_PPC64_TOC16_HA; + break; + case BFD_RELOC_PPC64_TOC: ppc_reloc = R_PPC64_TOC; + break; + case BFD_RELOC_PPC64_PLTGOT16: ppc_reloc = R_PPC64_PLTGOT16; + break; + case BFD_RELOC_PPC64_PLTGOT16_LO: ppc_reloc = R_PPC64_PLTGOT16_LO; + break; + case BFD_RELOC_PPC64_PLTGOT16_HI: ppc_reloc = R_PPC64_PLTGOT16_HI; + break; + case BFD_RELOC_PPC64_PLTGOT16_HA: ppc_reloc = R_PPC64_PLTGOT16_HA; + break; + case BFD_RELOC_PPC64_ADDR16_DS: ppc_reloc = R_PPC64_ADDR16_DS; + break; + case BFD_RELOC_PPC64_ADDR16_LO_DS: ppc_reloc = R_PPC64_ADDR16_LO_DS; + break; + case BFD_RELOC_PPC64_GOT16_DS: ppc_reloc = R_PPC64_GOT16_DS; + break; + case BFD_RELOC_PPC64_GOT16_LO_DS: ppc_reloc = R_PPC64_GOT16_LO_DS; + break; + case BFD_RELOC_PPC64_PLT16_LO_DS: ppc_reloc = R_PPC64_PLT16_LO_DS; + break; + case BFD_RELOC_PPC64_SECTOFF_DS: ppc_reloc = R_PPC64_SECTOFF_DS; + break; + case BFD_RELOC_PPC64_SECTOFF_LO_DS: ppc_reloc = R_PPC64_SECTOFF_LO_DS; + break; + case BFD_RELOC_PPC64_TOC16_DS: ppc_reloc = R_PPC64_TOC16_DS; + break; + case BFD_RELOC_PPC64_TOC16_LO_DS: ppc_reloc = R_PPC64_TOC16_LO_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16_DS: ppc_reloc = R_PPC64_PLTGOT16_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16_LO_DS: ppc_reloc = R_PPC64_PLTGOT16_LO_DS; + break; + case BFD_RELOC_VTABLE_INHERIT: ppc_reloc = R_PPC64_GNU_VTINHERIT; + break; + case BFD_RELOC_VTABLE_ENTRY: ppc_reloc = R_PPC64_GNU_VTENTRY; + break; + } + + return ppc64_elf_howto_table[(int) ppc_reloc]; +}; + +/* Set the howto pointer for a PowerPC ELF reloc. */ + +static void +ppc64_elf_info_to_howto (abfd, cache_ptr, dst) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *cache_ptr; + Elf64_Internal_Rela *dst; +{ + if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) + /* Initialize howto table if needed. */ + ppc_howto_init (); + + BFD_ASSERT (ELF64_R_TYPE (dst->r_info) < (unsigned int) R_PPC_max); + cache_ptr->howto = ppc64_elf_howto_table[ELF64_R_TYPE (dst->r_info)]; +} + +/* Handle the R_PPC_ADDR16_HA reloc. */ + +static bfd_reloc_status_type +ppc64_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + bfd_vma relocation; + + if (output_bfd != NULL) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; + + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + relocation += reloc_entry->addend; + + reloc_entry->addend += (relocation & 0x8000) << 1; + + return bfd_reloc_continue; +} + +/* Function to set whether a module needs the -mrelocatable bit set. */ + +static boolean +ppc64_elf_set_private_flags (abfd, flags) + bfd *abfd; + flagword flags; +{ + BFD_ASSERT (!elf_flags_init (abfd) + || elf_elfheader (abfd)->e_flags == flags); + + elf_elfheader (abfd)->e_flags = flags; + elf_flags_init (abfd) = true; + return true; +} + +/* Copy backend specific data from one object module to another. */ +static boolean +ppc64_elf_copy_private_bfd_data (ibfd, obfd) + bfd *ibfd; + bfd *obfd; +{ + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return true; + + BFD_ASSERT (!elf_flags_init (obfd) + || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags); + + elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + elf_flags_init (obfd) = true; + return true; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ +static boolean +ppc64_elf_merge_private_bfd_data (ibfd, obfd) + bfd *ibfd; + bfd *obfd; +{ + flagword old_flags; + flagword new_flags; + boolean error; + + /* Check if we have the same endianess. */ + if (ibfd->xvec->byteorder != obfd->xvec->byteorder + && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) + { + const char *msg; + + if (bfd_big_endian (ibfd)) + msg = _("%s: compiled for a big endian system and target is little endian"); + else + msg = _("%s: compiled for a little endian system and target is big endian"); + + (*_bfd_error_handler) (msg, bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_wrong_format); + return false; + } + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return true; + + new_flags = elf_elfheader (ibfd)->e_flags; + old_flags = elf_elfheader (obfd)->e_flags; + if (!elf_flags_init (obfd)) + { + /* First call, no flags set. */ + elf_flags_init (obfd) = true; + elf_elfheader (obfd)->e_flags = new_flags; + } + + else if (new_flags == old_flags) + /* Compatible flags are ok. */ + ; + + else + { + /* Incompatible flags. Warn about -mrelocatable mismatch. + Allow -mrelocatable-lib to be linked with either. */ + error = false; + if ((new_flags & EF_PPC_RELOCATABLE) != 0 + && (old_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0) + { + error = true; + (*_bfd_error_handler) + (_("%s: compiled with -mrelocatable and linked with modules compiled normally"), + bfd_get_filename (ibfd)); + } + else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0 + && (old_flags & EF_PPC_RELOCATABLE) != 0) + { + error = true; + (*_bfd_error_handler) + (_("%s: compiled normally and linked with modules compiled with -mrelocatable"), + bfd_get_filename (ibfd)); + } + + /* The output is -mrelocatable-lib iff both the input files are. */ + if (! (new_flags & EF_PPC_RELOCATABLE_LIB)) + elf_elfheader (obfd)->e_flags &= ~EF_PPC_RELOCATABLE_LIB; + + /* The output is -mrelocatable iff it can't be -mrelocatable-lib, + but each input file is either -mrelocatable or -mrelocatable-lib. */ + if (! (elf_elfheader (obfd)->e_flags & EF_PPC_RELOCATABLE_LIB) + && (new_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE)) + && (old_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE))) + elf_elfheader (obfd)->e_flags |= EF_PPC_RELOCATABLE; + + /* Do not warn about eabi vs. V.4 mismatch, just or in the bit + if any module uses it. */ + elf_elfheader (obfd)->e_flags |= (new_flags & EF_PPC_EMB); + + new_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); + old_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); + + /* Warn about any other mismatches. */ + if (new_flags != old_flags) + { + error = true; + (*_bfd_error_handler) + (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), + bfd_get_filename (ibfd), (long) new_flags, (long) old_flags); + } + + if (error) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + } + + return true; +} + +/* Handle a PowerPC specific section when reading an object file. This + is called when elfcode.h finds a section with an unknown type. */ + +static boolean +ppc64_elf_section_from_shdr (abfd, hdr, name) + bfd *abfd; + Elf64_Internal_Shdr *hdr; + char *name; +{ + asection *newsect; + flagword flags; + + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return false; + + newsect = hdr->bfd_section; + flags = bfd_get_section_flags (abfd, newsect); + if (hdr->sh_flags & SHF_EXCLUDE) + flags |= SEC_EXCLUDE; + + if (hdr->sh_type == SHT_ORDERED) + flags |= SEC_SORT_ENTRIES; + + bfd_set_section_flags (abfd, newsect, flags); + return true; +} + +/* The following routines are specific to the ELF linker, while + routines above are used generally. They appear in this file more + or less in the order in which they are called from external + routines. eg. ppc64_elf_check_relocs is called early in the link + process, ppc64_elf_finish_dynamic_sections is one of the last + functions called. */ + +/* Create the .glink section as well as the ordinary dynamic + sections. */ + +static boolean +ppc64_elf_create_dynamic_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + asection *s; + flagword flags; + + if (!_bfd_elf_create_dynamic_sections (abfd, info)) + return false; + + /* Our .plt just contains pointers, no code. */ + s = bfd_get_section_by_name (abfd, ".plt"); + if (s == NULL) + return false; + flags = bfd_get_section_flags (abfd, s); + flags &= ~SEC_CODE; + if (! bfd_set_section_flags (abfd, s, flags)) + return false; + + /* Create .glink for global linkage functions. */ + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_LINKER_CREATED); + s = bfd_make_section (abfd, ".glink"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags) + || ! bfd_set_section_alignment (abfd, s, 3)) + return false; + + return true; +} + +/* Look through the relocs for a section during the first phase, and + allocate space in the global offset table or procedure linkage + table. */ + +static boolean +ppc64_elf_check_relocs (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + bfd *dynobj; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; + bfd_signed_vma *local_got_refcounts; + asection *sreloc; + asection *sgot = NULL; + asection *srelgot = NULL; + + if (info->relocateable) + return true; + +#ifdef DEBUG + fprintf (stderr, "ppc64_elf_check_relocs called for section %s in %s\n", + bfd_get_section_name (abfd, sec), + bfd_get_filename (abfd)); +#endif + + dynobj = elf_hash_table (info)->dynobj; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + local_got_refcounts = elf_local_got_refcounts (abfd); + + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = (sym_hashes + + symtab_hdr->sh_size / sizeof (Elf64_External_Sym)); + if (!elf_bad_symtab (abfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + sreloc = NULL; + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) + { + unsigned long r_symndx; + struct elf_link_hash_entry *h; + + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + switch (ELF64_R_TYPE (rel->r_info)) + { + /* GOT16 relocations */ + case R_PPC64_GOT16: + case R_PPC64_GOT16_LO: + case R_PPC64_GOT16_HI: + case R_PPC64_GOT16_HA: + case R_PPC64_GOT16_DS: + case R_PPC64_GOT16_LO_DS: + /* This symbol requires a global offset table entry. */ + + if (sgot == NULL) + { + if (dynobj == NULL) + elf_hash_table (info)->dynobj = dynobj = abfd; + if (! _bfd_elf_create_got_section (dynobj, info)) + return false; + sgot = bfd_get_section_by_name (dynobj, ".got"); + BFD_ASSERT (sgot != NULL); + } + + if (srelgot == NULL + && (h != NULL || info->shared)) + { + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + if (srelgot == NULL) + { + srelgot = bfd_make_section (dynobj, ".rela.got"); + if (srelgot == NULL + || ! bfd_set_section_flags (dynobj, srelgot, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || ! bfd_set_section_alignment (dynobj, srelgot, 2)) + return false; + } + } + + if (h != NULL) + { + if (h->got.refcount == -1) + { + /* Make sure this symbol is output as a dynamic symbol. */ + if (h->dynindx == -1) + if (!bfd_elf64_link_record_dynamic_symbol (info, h)) + return false; + + /* Allocate space in the .got. */ + sgot->_raw_size += 8; + /* Allocate relocation space. */ + srelgot->_raw_size += sizeof (Elf64_External_Rela); + + h->got.refcount = 1; + } + else + h->got.refcount++; + } + else + { + /* This is a global offset table entry for a local symbol. */ + if (local_got_refcounts == NULL) + { + size_t size; + + size = symtab_hdr->sh_info * sizeof (bfd_signed_vma); + local_got_refcounts = (bfd_signed_vma *) + bfd_alloc (abfd, size); + if (local_got_refcounts == NULL) + return false; + elf_local_got_refcounts (abfd) = local_got_refcounts; + memset (local_got_refcounts, -1, size); + } + if (local_got_refcounts[r_symndx] == -1) + { + sgot->_raw_size += 8; + + /* If we are generating a shared object, we need to + output a R_PPC64_RELATIVE reloc so that the + dynamic linker can adjust this GOT entry. */ + if (info->shared) + srelgot->_raw_size += sizeof (Elf64_External_Rela); + + local_got_refcounts[r_symndx] = 1; + } + else + local_got_refcounts[r_symndx]++; + } + break; + + case R_PPC64_PLT64: + case R_PPC64_PLT32: + case R_PPC64_PLT16_LO: + case R_PPC64_PLT16_HI: + case R_PPC64_PLT16_HA: + case R_PPC64_PLTGOT16_DS: + case R_PPC64_PLTGOT16_LO_DS: +#ifdef DEBUG + fprintf (stderr, "Reloc requires a PLT entry\n"); +#endif + /* This symbol requires a procedure linkage table entry. We + actually build the entry in adjust_dynamic_symbol, + because this might be a case of linking PIC code without + linking in any dynamic objects, in which case we don't + need to generate a procedure linkage table after all. */ + + if (h == NULL) + { + /* It does not make sense to have a procedure linkage + table entry for a local symbol. */ + bfd_set_error (bfd_error_bad_value); + return false; + } + + /* Make sure this symbol is output as a dynamic symbol. */ + if (h->dynindx == -1) + { + if (! bfd_elf64_link_record_dynamic_symbol (info, h)) + return false; + } + if (h->plt.refcount == -1) + { + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount = 1; + } + else + h->plt.refcount++; + break; + + /* The following relocations don't need to propagate the + relocation if linking a shared object since they are + section relative. */ + case R_PPC64_SECTOFF: + case R_PPC64_SECTOFF_LO: + case R_PPC64_SECTOFF_HI: + case R_PPC64_SECTOFF_HA: + case R_PPC64_SECTOFF_DS: + case R_PPC64_SECTOFF_LO_DS: + case R_PPC64_TOC16: + case R_PPC64_TOC16_LO: + case R_PPC64_TOC16_HI: + case R_PPC64_TOC16_HA: + case R_PPC64_TOC16_DS: + case R_PPC64_TOC16_LO_DS: + break; + + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_PPC64_GNU_VTINHERIT: + if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return false; + break; + + /* This relocation describes which C++ vtable entries are actually + used. Record for later use during GC. */ + case R_PPC64_GNU_VTENTRY: + if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return false; + break; + + /* When creating a shared object, we must copy these + relocs into the output file. We create a reloc + section in dynobj and make room for the reloc. */ + case R_PPC64_REL64: + case R_PPC64_REL32: + case R_PPC64_REL24: + case R_PPC64_REL14: + case R_PPC64_REL14_BRTAKEN: + case R_PPC64_REL14_BRNTAKEN: + if (h == NULL) + break; + /* fall through */ + + case R_PPC64_TOC: + /* fall through */ + + default: + if (info->shared) + { +#ifdef DEBUG + fprintf (stderr, "ppc64_elf_check_relocs need to create relocation for %s\n", + (h && h->root.root.string + ? h->root.root.string + : "")); +#endif + if (sreloc == NULL) + { + const char *name; + + name = (bfd_elf_string_from_elf_section + (abfd, + elf_elfheader (abfd)->e_shstrndx, + elf_section_data (sec)->rel_hdr.sh_name)); + if (name == NULL) + return false; + + BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + name + 5) == 0); + + sreloc = bfd_get_section_by_name (dynobj, name); + if (sreloc == NULL) + { + flagword flags; + + sreloc = bfd_make_section (dynobj, name); + flags = (SEC_HAS_CONTENTS | SEC_READONLY + | SEC_IN_MEMORY | SEC_LINKER_CREATED); + if ((sec->flags & SEC_ALLOC) != 0) + flags |= SEC_ALLOC | SEC_LOAD; + if (sreloc == NULL + || ! bfd_set_section_flags (dynobj, sreloc, flags) + || ! bfd_set_section_alignment (dynobj, sreloc, 2)) + return false; + } + } + + sreloc->_raw_size += sizeof (Elf64_External_Rela); + + /* FIXME: We should here do what the m68k and i386 + backends do: if the reloc is pc-relative, record it + in case it turns out that the reloc is unnecessary + because the symbol is forced local by versioning or + we are linking with -Bdynamic. Fortunately this + case is not frequent. */ + } + + break; + } + } + + return true; +} + +/* Return the section that should be marked against GC for a given + relocation. */ + +static asection * +ppc64_elf_gc_mark_hook (abfd, info, rel, h, sym) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + if (h != NULL) + { + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_PPC64_GNU_VTINHERIT: + case R_PPC64_GNU_VTENTRY: + break; + + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + { + if (! (elf_bad_symtab (abfd) + && ELF_ST_BIND (sym->st_info) != STB_LOCAL) + && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) + && sym->st_shndx != SHN_COMMON)) + { + return bfd_section_from_elf_index (abfd, sym->st_shndx); + } + } + + return NULL; +} + +/* Update the got entry reference counts for the section being removed. */ + +static boolean +ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + bfd_signed_vma *local_got_refcounts; + const Elf_Internal_Rela *rel, *relend; + unsigned long r_symndx; + struct elf_link_hash_entry *h; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; rel++) + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_PPC64_GOT16: + case R_PPC64_GOT16_LO: + case R_PPC64_GOT16_HI: + case R_PPC64_GOT16_HA: + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->got.refcount > 0) + h->got.refcount--; + } + else + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx]--; + } + break; + + case R_PPC64_PLT32: + case R_PPC64_PLT16_LO: + case R_PPC64_PLT16_HI: + case R_PPC64_PLT16_HA: + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->plt.refcount > 0) + h->plt.refcount--; + } + break; + + default: + break; + } + + return true; +} + +/* Adjust a symbol defined by a dynamic object and referenced by a + regular object. The current definition is in some section of the + dynamic object, but we're not including those sections. We have to + change the definition to something the rest of the link can + understand. */ + +static boolean +ppc64_elf_adjust_dynamic_symbol (info, h) + struct bfd_link_info *info; + struct elf_link_hash_entry *h; +{ + bfd *dynobj = elf_hash_table (info)->dynobj; + asection *s; + unsigned int power_of_two; + bfd_vma plt_offset; + +#ifdef DEBUG + fprintf (stderr, "ppc64_elf_adjust_dynamic_symbol called for %s\n", + h->root.root.string); +#endif + + /* Make sure we know what is going on here. */ + BFD_ASSERT (dynobj != NULL + && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) + || h->weakdef != NULL + || ((h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_REF_REGULAR) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))); + + /* If this is a function, alter the symbol to refer to global + linkage code, which will be generated by ppc64_elf_relocate_section. + Also, allocate a slot in the PLT. */ + if (h->type == STT_FUNC + || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) + { + asection *splt, *sglink; + + if (! elf_hash_table (info)->dynamic_sections_created + || ((!info->shared || info->symbolic || h->dynindx == -1) + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) != 0)) + { + /* A PLT entry is not required/allowed when: + + 1. We are not using ld.so; because then the PLT entry + can't be set up, so we can't use one. + + 2. We know for certain that a symbol is defined in + this object, because this object is the application, + is linked with -Bsymbolic, or because the symbol is local. + + We used to end up here for GC if + (info->shared && h->plt.refcount <= 0) + We can't use plt.refcount here since + ppc64_elf_check_relocs can't detect all needs for + PLT. FIXME: Rewrite GC. */ + + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + return true; + } + + splt = bfd_get_section_by_name (dynobj, ".plt"); + sglink = bfd_get_section_by_name (dynobj, ".glink"); + BFD_ASSERT (splt != NULL && sglink != NULL); + + /* If it's a function entry point (the name starts with a dot) + (FIXME: Could it ever be anything else?), find its + corresponding function descriptor symbol and make sure it's + output as a dynamic symbol. Create it as undefined if + necessary. ppc64_elf_finish_dynamic_symbol will look it up + again and create a JMP_SLOT reloc for it. FIXME: The second + lookup could be avoided by adding a new flag to + elf_link_hash_entry->elf_link_hash_flags. */ + + if (h->root.root.string[0] == '.') + { + struct elf_link_hash_entry *fdh; + + /* FIXME: Follow bfd_link_hash_indirect? */ + fdh = elf_link_hash_lookup (elf_hash_table (info), + h->root.root.string + 1, + false, false, false); + + if (fdh == (struct elf_link_hash_entry *) NULL) + { + asymbol *newsym; + + /* Create it as undefined. */ + newsym = bfd_make_empty_symbol (dynobj); + BFD_ASSERT (newsym != NULL); + /* FIXME: Need own copy of name? */ + newsym->name = h->root.root.string + 1; + newsym->section = bfd_und_section_ptr; + newsym->value = 0; + newsym->flags = BSF_DYNAMIC | BSF_OBJECT; + + if ( ! (_bfd_generic_link_add_one_symbol + (info, dynobj, newsym->name, newsym->flags, + newsym->section, newsym->value, + NULL, /* string */ + true, /* copy */ + false, /*collect*/ + (struct bfd_link_hash_entry **) &fdh))) + { + /* FIXME: Print error message. */ + return false; + } + fdh->root.type = bfd_link_hash_undefined; +#ifdef DEBUG + fprintf (stderr, "\tcreated %s", newsym->name); +#endif + } +#ifdef DEBUG + else + fprintf (stderr, "\tfound %s", fdh->root.root.string); + fprintf (stderr, "\n"); +#endif + + BFD_ASSERT (fdh != NULL); + + /* Make sure it's output as a dynamic symbol. */ + if (fdh->dynindx == -1) + { + if (! bfd_elf64_link_record_dynamic_symbol (info, fdh)) + return false; + } + BFD_ASSERT (fdh->dynindx != -1); + } + + /* If this is the first .plt entry, make room for the special + first entry. */ + if (splt->_raw_size == 0) + splt->_raw_size = PLT_INITIAL_ENTRY_SIZE; + + plt_offset = splt->_raw_size; + + /* FIXME: What about function pointer comparisons in 64-bit PPC? + We can't use the same trick as 32-bit PPC, since we set the + symbol to the linkage function. This will make function entry + point comparison work as expected within one object, but not + across object boundaries. From the ABI: + + In this ABI, the address of a function is actually the address of a + function descriptor. A reference to a function, other than a function + call, will normally load the address of the function descriptor from + the global offset table. The dynamic linker will ensure that for a + given function, the same address is used for all references to the + function from any global offset table. Thus, function address + comparisons will work as expected. + + When making a call to the function, the code may refer to the + procedure linkage table entry, in order to permit lazy symbol + resolution at run time. In order to support correct function address + comparisons, the compiler should be careful to only generate + references to the procedure linkage table entry for function calls. + For any other use of a function, the compiler should use the real + address. + + I don't see how this could ever work when passing a pointer to + a function across an object boundary. The compiler has no + way of knowing how to find the function descriptor for a + function whose entrypoint is taken as an argument. + + Or should the compiler arrange so that the function descriptor + address is passed and make the callee dig out the entry point + from that? */ +#if 0 + /* If this symbol is not defined in a regular file, and we are + not generating a shared library, then set the symbol to this + location in the .plt. This is required to make function + pointers compare as equal between the normal executable and + the shared library. */ + if (! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + { + h->root.u.def.section = splt; + h->root.u.def.value = plt_offset; + } +#endif + + /* FIXME: How should a linkage symbol be defined? It shouldn't + be global, since it can't be used by any other object than + this one. Set ELF_LINK_FORCED_LOCAL? */ + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = sglink; + h->root.u.def.value = sglink->_raw_size; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.offset = plt_offset; + + /* Make room for global linkage code in .glink. */ + sglink->_raw_size += PPC64_ELF_GLINK_SIZE; + + /* Make room for this entry in PLT. */ + splt->_raw_size += PLT_ENTRY_SIZE; + + /* We also need to make an entry in the .rela.plt section. */ + s = bfd_get_section_by_name (dynobj, ".rela.plt"); + BFD_ASSERT (s != NULL); + s->_raw_size += sizeof (Elf64_External_Rela); + + return true; + } + + /* If this is a weak symbol, and there is a real definition, the + processor independent code will have arranged for us to see the + real definition first, and we can just use the same value. */ + if (h->weakdef != NULL) + { + BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined + || h->weakdef->root.type == bfd_link_hash_defweak); + h->root.u.def.section = h->weakdef->root.u.def.section; + h->root.u.def.value = h->weakdef->root.u.def.value; + return true; + } + + /* This is a reference to a symbol defined by a dynamic object which + is not a function. */ + + /* If we are creating a shared library, we must presume that the + only references to the symbol are via the global offset table. + For such cases we need not do anything here; the relocations will + be handled correctly by relocate_section. */ + if (info->shared) + return true; + + /* We must allocate the symbol in our .dynbss section, which will + become part of the .bss section of the executable. There will be + an entry for this symbol in the .dynsym section. The dynamic + object will contain position independent code, so all references + from the dynamic object to this symbol will go through the global + offset table. The dynamic linker will use the .dynsym entry to + determine the address it must put in the global offset table, so + both the dynamic object and the regular object will refer to the + same memory location for the variable. */ + s = bfd_get_section_by_name (dynobj, ".dynbss"); + BFD_ASSERT (s != NULL); + + /* We must generate a R_PPC_COPY reloc to tell the dynamic linker to + copy the initial value out of the dynamic object and into the + runtime process image. We need to remember the offset into the + .rela.bss section we are going to use. */ + if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) + { + asection *srel; + + srel = bfd_get_section_by_name (dynobj, ".rela.bss"); + BFD_ASSERT (srel != NULL); + srel->_raw_size += sizeof (Elf64_External_Rela); + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; + } + + /* We need to figure out the alignment required for this symbol. I + have no idea how ELF linkers handle this. */ + power_of_two = bfd_log2 (h->size); + if (power_of_two > 4) + power_of_two = 4; + + /* Apply the required alignment. */ + s->_raw_size = BFD_ALIGN (s->_raw_size, + (bfd_size_type) (1 << power_of_two)); + if (power_of_two > bfd_get_section_alignment (dynobj, s)) + { + if (! bfd_set_section_alignment (dynobj, s, power_of_two)) + return false; + } + + /* Define the symbol as being at this point in the section. */ + h->root.u.def.section = s; + h->root.u.def.value = s->_raw_size; + + /* Increment the section size to make room for the symbol. */ + s->_raw_size += h->size; + + return true; +} + +/* Increment the index of a dynamic symbol by a given amount. Called + via elf_link_hash_traverse. */ + +static boolean +ppc_adjust_dynindx (h, cparg) + struct elf_link_hash_entry *h; + PTR cparg; +{ + int *cp = (int *) cparg; + +#ifdef DEBUG + fprintf (stderr, + "ppc_adjust_dynindx: h->dynindx = %ld, *cp = %d (%s)\n", + h->dynindx, *cp, + h->root.root.string ? h->root.root.string : ""); +#endif + + if (h->dynindx != -1) + h->dynindx += *cp; + + return true; +} + +/* Set the sizes of the dynamic sections. */ + +static boolean +ppc64_elf_size_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + bfd *dynobj; + asection *s; + boolean plt; + boolean relocs; + boolean reltext; + +#ifdef DEBUG + fprintf (stderr, "ppc64_elf_size_dynamic_sections called\n"); +#endif + + dynobj = elf_hash_table (info)->dynobj; + BFD_ASSERT (dynobj != NULL); + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (! info->shared) + { + s = bfd_get_section_by_name (dynobj, ".interp"); + BFD_ASSERT (s != NULL); + s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER; + s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; + } + } + else + { + /* We may have created entries in the .rela.got section. + However, if we are not creating the dynamic sections, we will + not actually use these entries. Reset the size of .rela.got + which will cause it to get stripped from the output file + below. */ + s = bfd_get_section_by_name (dynobj, ".rela.got"); + if (s != NULL) + s->_raw_size = 0; + } + + /* The check_relocs and adjust_dynamic_symbol entry points have + determined the sizes of the various dynamic sections. Allocate + memory for them. */ + plt = false; + relocs = false; + reltext = false; + for (s = dynobj->sections; s != NULL; s = s->next) + { + const char *name; + boolean strip; + + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + + /* It's OK to base decisions on the section name, because none + of the dynobj section names depend upon the input files. */ + name = bfd_get_section_name (dynobj, s); + + strip = false; + + if (strcmp (name, ".plt") == 0) + { + if (s->_raw_size == 0) + { + /* Strip this section if we don't need it; see the + comment below. */ + strip = true; + } + else + { + /* Remember whether there is a PLT. */ + plt = true; + } + } + else if (strncmp (name, ".rela", 5) == 0) + { + if (s->_raw_size == 0) + { + /* If we don't need this section, strip it from the + output file. This is mostly to handle .rela.bss and + .rela.plt. We must create both sections in + create_dynamic_sections, because they must be created + before the linker maps input sections to output + sections. The linker does that before + adjust_dynamic_symbol is called, and it is that + function which decides whether anything needs to go + into these sections. */ + strip = true; + } + else + { + asection *target; + const char *outname; + + /* Remember whether there are any relocation sections. */ + relocs = true; + + /* If this relocation section applies to a read only + section, then we probably need a DT_TEXTREL entry. */ + outname = bfd_get_section_name (output_bfd, + s->output_section); + target = bfd_get_section_by_name (output_bfd, outname + 5); + if (target != NULL + && (target->flags & SEC_READONLY) != 0 + && (target->flags & SEC_ALLOC) != 0) + reltext = true; + + /* We use the reloc_count field as a counter if we need + to copy relocs into the output file. */ + s->reloc_count = 0; + } + } + else if (strcmp (name, ".got") != 0 + && strcmp (name, ".toc") != 0 + && strcmp (name, ".glink") != 0) + { + /* It's not one of our sections, so don't allocate space. */ + continue; + } + + if (strip) + { + _bfd_strip_section_from_output (info, s); + continue; + } + +#ifdef DEBUG + fprintf (stderr, "\tallocating %lu bytes for section %s\n", + (unsigned long) s->_raw_size, name); +#endif + + /* Allocate memory for the section contents. */ + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); + if (s->contents == NULL && s->_raw_size != 0) + return false; + } + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Add some entries to the .dynamic section. We fill in the + values later, in ppc64_elf_finish_dynamic_sections, but we + must add the entries now so that we get the correct size for + the .dynamic section. The DT_DEBUG entry is filled in by the + dynamic linker and used by the debugger. */ + if (! info->shared) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0)) + return false; + } + + if (plt) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA) + || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0)) + return false; + } + + if (relocs) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT, + sizeof (Elf64_External_Rela))) + return false; + } + + if (reltext) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) + return false; + } + } + + /* If we are generating a shared library, we generate a section + symbol for each output section. These are local symbols, which + means that they must come first in the dynamic symbol table. + That means we must increment the dynamic symbol index of every + other dynamic symbol. + + FIXME: We assume that there will never be relocations to + locations in linker-created sections that do not have + externally-visible names. Instead, we should work out precisely + which sections relocations are targetted at. */ + if (info->shared) + { + int c; + + for (c = 0, s = output_bfd->sections; s != NULL; s = s->next) + { + if ((s->flags & SEC_LINKER_CREATED) != 0 + || (s->flags & SEC_ALLOC) == 0) + { + elf_section_data (s)->dynindx = -1; + continue; + } + + /* These symbols will have no names, so we don't need to + fiddle with dynstr_index. */ + + elf_section_data (s)->dynindx = c + 1; + + c++; + } + + elf_link_hash_traverse (elf_hash_table (info), + ppc_adjust_dynindx, + (PTR) &c); + elf_hash_table (info)->dynsymcount += c; + } + + return true; +} + +/* Called after we have seen all the input files/sections, but before + final symbol resolution and section placement has been determined. + + We use this hook to provide a value for TOCstart, which we store in + the output bfd elf_gp, then we call the generic ELF final link + routine. */ + +static boolean +ppc64_elf_final_link (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + if (! info->relocateable) + { + asection *s; + bfd_vma TOCstart; + + /* The TOC consists of sections .got, .toc, .tocbss, .plt in this + order. The TOC starts where the first of these sections starts. */ + s = bfd_get_section_by_name (abfd, ".got"); + if (s == NULL) + s = bfd_get_section_by_name (abfd, ".toc"); + if (s == NULL) + s = bfd_get_section_by_name (abfd, ".tocbss"); + if (s == NULL) + s = bfd_get_section_by_name (abfd, ".plt"); + if (s == NULL) + { + /* This may happen for + o references to TOC base (SYM@toc / TOC[tc0]) without a + .toc directive + o bad linker script + o --gc-sections and empty TOC sections + + FIXME: Warn user? */ + + /* Look for a likely section. We probably won't even be + using TOCstart. */ + for (s = abfd->sections; s != NULL; s = s->next) + if ((s->flags & (SEC_ALLOC | SEC_SMALL_DATA | SEC_READONLY)) + == (SEC_ALLOC | SEC_SMALL_DATA)) + break; + if (s == NULL) + for (s = abfd->sections; s != NULL; s = s->next) + if ((s->flags & (SEC_ALLOC | SEC_SMALL_DATA)) + == (SEC_ALLOC | SEC_SMALL_DATA)) + break; + if (s == NULL) + for (s = abfd->sections; s != NULL; s = s->next) + if ((s->flags & (SEC_ALLOC | SEC_READONLY)) == SEC_ALLOC) + break; + if (s == NULL) + for (s = abfd->sections; s != NULL; s = s->next) + if ((s->flags & SEC_ALLOC) == SEC_ALLOC) + break; + } + + TOCstart = 0; + if (s != NULL) + TOCstart = s->output_section->vma + s->output_offset; + + elf_gp (abfd) = TOCstart; + } + + /* Invoke the regular gc ELF backend linker to do all the work. */ + return _bfd_elf64_gc_common_final_link (abfd, info); +} + +/* Set up any other section flags and such that may be necessary. */ + +static boolean +ppc64_elf_fake_sections (abfd, shdr, asect) + bfd *abfd ATTRIBUTE_UNUSED; + Elf64_Internal_Shdr *shdr; + asection *asect; +{ + if ((asect->flags & SEC_EXCLUDE) != 0) + shdr->sh_flags |= SHF_EXCLUDE; + + if ((asect->flags & SEC_SORT_ENTRIES) != 0) + shdr->sh_type = SHT_ORDERED; + + return true; +} + +/* The RELOCATE_SECTION function is called by the ELF backend linker + to handle the relocations for a section. + + The relocs are always passed as Rela structures; if the section + actually uses Rel structures, the r_addend field will always be + zero. + + This function is responsible for adjust the section contents as + necessary, and (if using Rela relocs and generating a + relocateable output file) adjusting the reloc addend as + necessary. + + This function does not have to worry about setting the reloc + address or the reloc symbol index. + + LOCAL_SYMS is a pointer to the swapped in local symbols. + + LOCAL_SECTIONS is an array giving the section in the input file + corresponding to the st_shndx field of each local symbol. + + The global hash table entry for the global symbols can be found + via elf_sym_hashes (input_bfd). + + When generating relocateable output, this function must handle + STB_LOCAL/STT_SECTION symbols specially. The output symbol is + going to be the section symbol corresponding to the output + section, which means that the addend must be adjusted + accordingly. */ + +static boolean +ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, + contents, relocs, local_syms, local_sections) + bfd *output_bfd; + struct bfd_link_info *info; + bfd *input_bfd; + asection *input_section; + bfd_byte *contents; + Elf_Internal_Rela *relocs; + Elf_Internal_Sym *local_syms; + asection **local_sections; +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + bfd *dynobj; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + asection *sreloc; + asection *splt; + asection *sgot; + bfd_vma *local_got_offsets; + bfd_vma TOCstart; + boolean ret = true; + long insn; + +#ifdef DEBUG + fprintf (stderr, "ppc64_elf_relocate_section called for %s section %s, %ld relocations%s\n", + bfd_get_filename (input_bfd), + bfd_section_name (input_bfd, input_section), + (long) input_section->reloc_count, + (info->relocateable) ? " (relocatable)" : ""); +#endif + + if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) + /* Initialize howto table if needed. */ + ppc_howto_init (); + + local_got_offsets = elf_local_got_offsets (input_bfd); + + sreloc = NULL; + splt = NULL; + sgot = NULL; + dynobj = elf_hash_table (info)->dynobj; + if (dynobj != NULL) + { + splt = bfd_get_section_by_name (dynobj, ".plt"); + sgot = bfd_get_section_by_name (dynobj, ".got"); + } + TOCstart = elf_gp (output_bfd); + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + enum elf_ppc_reloc_type r_type; + bfd_vma offset; + bfd_vma addend; + bfd_reloc_status_type r; + Elf_Internal_Sym *sym; + asection *sec; + struct elf_link_hash_entry *h; + const char *sym_name; + reloc_howto_type *howto; + unsigned long r_symndx; + bfd_vma relocation; + + r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + offset = rel->r_offset; + addend = rel->r_addend; + r = bfd_reloc_other; + sym = (Elf_Internal_Sym *) 0; + sec = (asection *) 0; + h = (struct elf_link_hash_entry *) 0; + sym_name = (const char *) 0; + + /* Unknown relocation handling. */ + if ((unsigned) r_type >= (unsigned) R_PPC_max + || !ppc64_elf_howto_table[(int) r_type]) + { + (*_bfd_error_handler) (_("%s: unknown relocation type %d"), + bfd_get_filename (input_bfd), + (int) r_type); + bfd_set_error (bfd_error_bad_value); + ret = false; + continue; + } + + howto = ppc64_elf_howto_table[(int) r_type]; + r_symndx = ELF64_R_SYM (rel->r_info); + + if (info->relocateable) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + if ((unsigned) ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sec = local_sections[r_symndx]; + addend = rel->r_addend += sec->output_offset + sym->st_value; + } + } + +#ifdef DEBUG + fprintf (stderr, "\ttype = %s (%d), symbol index = %ld, offset = %ld, addend = %ld\n", + howto->name, + (int) r_type, + r_symndx, + (long) offset, + (long) addend); +#endif + continue; + } + + /* This is a final link. */ + + /* Set `relocation'. */ + if (r_type == R_PPC64_TOC) + { + /* Relocation value is TOC base. Symbol is ignored. */ + relocation = TOCstart + TOC_BASE_OFF; + } + else if (r_symndx < symtab_hdr->sh_info) + { + /* It's a local symbol. */ + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + sym_name = ""; + + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + } + else + { + /* It's a global symbol. */ + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + sym_name = h->root.root.string; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + if ((r_type == R_PPC64_PLT32 + && h->plt.offset != (bfd_vma) -1) + || ((r_type == R_PPC64_GOT16 + || r_type == R_PPC64_GOT16_LO + || r_type == R_PPC64_GOT16_HI + || r_type == R_PPC64_GOT16_HA + || r_type == R_PPC64_GOT16_DS + || r_type == R_PPC64_GOT16_LO_DS) + && elf_hash_table (info)->dynamic_sections_created + && (! info->shared + || (! info->symbolic && h->dynindx != -1) + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)) + || (info->shared + && ((! info->symbolic && h->dynindx != -1) + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0) + && (input_section->flags & SEC_ALLOC) != 0 + && (r_type == R_PPC64_ADDR64 + || r_type == R_PPC64_ADDR32 + || r_type == R_PPC64_ADDR24 + || r_type == R_PPC64_ADDR16 + || r_type == R_PPC64_ADDR16_LO + || r_type == R_PPC64_ADDR16_DS + || r_type == R_PPC64_ADDR16_LO_DS + || r_type == R_PPC64_ADDR16_HI + || r_type == R_PPC64_ADDR16_HA + || r_type == R_PPC64_ADDR16_HIGHER + || r_type == R_PPC64_ADDR16_HIGHERA + || r_type == R_PPC64_ADDR16_HIGHEST + || r_type == R_PPC64_ADDR16_HIGHESTA + || r_type == R_PPC64_ADDR14 + || r_type == R_PPC64_ADDR14_BRTAKEN + || r_type == R_PPC64_ADDR14_BRNTAKEN + || r_type == R_PPC64_COPY + || r_type == R_PPC64_GLOB_DAT + || r_type == R_PPC64_JMP_SLOT + || r_type == R_PPC64_UADDR64 + || r_type == R_PPC64_UADDR32 + || r_type == R_PPC64_UADDR16))) + { + /* In these cases, we don't need the relocation + value. We check specially because in some + obscure cases sec->output_section will be NULL. */ + relocation = 0; + } + else + relocation = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); + } + else if (h->root.type == bfd_link_hash_undefweak) + relocation = 0; + else if (info->shared && !info->symbolic && !info->no_undefined) + relocation = 0; + else + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, input_section, + rel->r_offset, (!info->shared + || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) + return false; + relocation = 0; + } + } + + switch ((int) r_type) + { + case (int) R_PPC64_ADDR16_DS: + case (int) R_PPC64_ADDR16_LO_DS: + case (int) R_PPC64_GOT16_DS: + case (int) R_PPC64_GOT16_LO_DS: + case (int) R_PPC64_PLT16_LO_DS: + case (int) R_PPC64_SECTOFF_DS: + case (int) R_PPC64_SECTOFF_LO_DS: + case (int) R_PPC64_TOC16_DS: + case (int) R_PPC64_TOC16_LO_DS: + case (int) R_PPC64_PLTGOT16_DS: + case (int) R_PPC64_PLTGOT16_LO_DS: + if (((relocation + addend) & 3) != 0) + { + (*_bfd_error_handler) (_("%s: error: relocation %s not a multiple of 4"), + bfd_get_filename (input_bfd), + howto->name); + bfd_set_error (bfd_error_bad_value); + ret = false; + continue; + } + } + + /* Set `addend'. */ + switch ((int) r_type) + { + default: + (*_bfd_error_handler) (_("%s: unknown relocation type %d for symbol %s"), + bfd_get_filename (input_bfd), + (int) r_type, sym_name); + + bfd_set_error (bfd_error_bad_value); + ret = false; + continue; + + /* Relocations that may need to be propagated if this is a shared + object. */ + case (int) R_PPC64_REL24: + case (int) R_PPC64_ADDR24: + /* An ADDR24 or REL24 branching to a linkage function may be + followed by a nop that we have to replace with an ld in + order to restore the TOC base pointer. Only calls to + shared objects need to alter the TOC base. These are + recognized by their need for a PLT entry. */ + if (h != NULL + && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0 + /* Make sure that there really is an instruction after + the branch that we can decode. */ + && (rel->r_offset - input_section->vma + 8 + <= input_section->_cooked_size)) + { + bfd_byte *pnext; + unsigned long insn; + + pnext = contents + (rel->r_offset - input_section->vma) + 4; + insn = bfd_get_32 (input_bfd, pnext); + + if (insn == 0x60000000 /* nop (ori r0,r0,0) */ + || insn == 0x4def7b82 /* cror 15,15,15 */ + || insn == 0x4ffffb82) /* cror 31,31,31 */ + { + bfd_put_32 (input_bfd, 0xe8410028, pnext); /* ld r2,40(r1) */ +#ifdef DEBUG + fprintf (stderr, "ppc64_elf_relocate_section: " \ + "patched nop after call to %s\n", sym_name); +#endif + } + } + /* fall through */ + + case (int) R_PPC64_REL64: + case (int) R_PPC64_REL32: + case (int) R_PPC64_REL14: + /* If these relocations are not to a named symbol, they can be + handled right here, no need to bother the dynamic linker. */ + if (h == NULL && r_type != R_PPC64_ADDR24) + break; + /* fall through */ + + /* Relocations that always need to be propagated if this is a shared + object. */ + case (int) R_PPC64_NONE: + case (int) R_PPC64_ADDR64: + case (int) R_PPC64_ADDR32: + case (int) R_PPC64_ADDR16: + case (int) R_PPC64_ADDR16_LO: + case (int) R_PPC64_ADDR16_DS: + case (int) R_PPC64_ADDR16_LO_DS: + case (int) R_PPC64_ADDR16_HI: + case (int) R_PPC64_ADDR16_HA: + case (int) R_PPC64_ADDR16_HIGHER: + case (int) R_PPC64_ADDR16_HIGHERA: + case (int) R_PPC64_ADDR16_HIGHEST: + case (int) R_PPC64_ADDR16_HIGHESTA: + case (int) R_PPC64_ADDR14: + case (int) R_PPC64_UADDR64: + case (int) R_PPC64_UADDR32: + case (int) R_PPC64_UADDR16: + case (int) R_PPC64_TOC: + if (info->shared) + { + Elf_Internal_Rela outrel; + boolean skip; + +#ifdef DEBUG + fprintf (stderr, "ppc64_elf_relocate_section need to create relocation for %s\n", + (h && h->root.root.string + ? h->root.root.string + : "")); +#endif + + /* When generating a shared object, these relocations + are copied into the output file to be resolved at run + time. */ + + if (sreloc == NULL) + { + const char *name; + + name = (bfd_elf_string_from_elf_section + (input_bfd, + elf_elfheader (input_bfd)->e_shstrndx, + elf_section_data (input_section)->rel_hdr.sh_name)); + if (name == NULL) + return false; + + BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (input_bfd, + input_section), + name + 5) == 0); + + sreloc = bfd_get_section_by_name (dynobj, name); + BFD_ASSERT (sreloc != NULL); + } + + skip = false; + + if (elf_section_data (input_section)->stab_info == NULL) + outrel.r_offset = rel->r_offset; + else + { + bfd_vma off; + + off = (_bfd_stab_section_offset + (output_bfd, &elf_hash_table (info)->stab_info, + input_section, + &elf_section_data (input_section)->stab_info, + rel->r_offset)); + if (off == (bfd_vma) -1) + skip = true; + outrel.r_offset = off; + } + + outrel.r_offset += (input_section->output_section->vma + + input_section->output_offset); + + if (skip) + memset (&outrel, 0, sizeof outrel); + /* h->dynindx may be -1 if this symbol was marked to + become local. */ + else if (h != NULL + && ((! info->symbolic && h->dynindx != -1) + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)) + { + BFD_ASSERT (h->dynindx != -1); + outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); + outrel.r_addend = rel->r_addend; + } + else + { + if (r_type == R_PPC64_ADDR64) + { + outrel.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); + outrel.r_addend = relocation + rel->r_addend; + } + else + { + long indx; + + if (h == NULL) + sec = local_sections[r_symndx]; + else + { + BFD_ASSERT (h->root.type == bfd_link_hash_defined + || (h->root.type + == bfd_link_hash_defweak)); + sec = h->root.u.def.section; + } + + if (r_type == R_PPC64_TOC + || (sec != NULL && bfd_is_abs_section (sec))) + { + indx = 0; + } + else if (sec == NULL || sec->owner == NULL) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + else + { + asection *osec; + + osec = sec->output_section; + indx = elf_section_data (osec)->dynindx; + BFD_ASSERT (indx > 0); +#ifdef DEBUG + if (indx <= 0) + { + printf ("indx=%ld section=%s flags=%08x name=%s\n", + indx, osec->name, osec->flags, + h->root.root.string); + } +#endif + } + + outrel.r_info = ELF64_R_INFO (indx, r_type); + outrel.r_addend = relocation + rel->r_addend; + } + } + + bfd_elf64_swap_reloca_out (output_bfd, &outrel, + (((Elf64_External_Rela *) + sreloc->contents) + + sreloc->reloc_count)); + ++sreloc->reloc_count; + + /* This reloc will be computed at runtime, so there's no + need to do anything now, unless this is a RELATIVE + reloc in an unallocated section. */ + if (skip + || (input_section->flags & SEC_ALLOC) != 0 + || ELF64_R_TYPE (outrel.r_info) != R_PPC64_RELATIVE) + continue; + } + + /* Arithmetic adjust relocations that aren't going into a + shared object. */ + if ((r_type == R_PPC64_ADDR16_HA + || r_type == R_PPC64_ADDR16_HIGHERA + || r_type == R_PPC64_ADDR16_HIGHESTA) + /* It's just possible that this symbol is a weak symbol + that's not actually defined anywhere. In that case, + 'sec' would be NULL, and we should leave the symbol + alone (it will be set to zero elsewhere in the link). */ + && sec != NULL) + { + addend += ((relocation + addend) & 0x8000) << 1; + } + break; + + /* Branch taken prediction relocations. */ + case (int) R_PPC64_ADDR14_BRTAKEN: + case (int) R_PPC64_REL14_BRTAKEN: + insn = bfd_get_32 (output_bfd, contents + offset); + if ((relocation - offset) & 0x8000) + insn &= ~BRANCH_PREDICT_BIT; + else + insn |= BRANCH_PREDICT_BIT; + bfd_put_32 (output_bfd, insn, contents + offset); + break; + + /* Branch not taken predicition relocations. */ + case (int) R_PPC64_ADDR14_BRNTAKEN: + case (int) R_PPC64_REL14_BRNTAKEN: + insn = bfd_get_32 (output_bfd, contents + offset); + if ((relocation - offset) & 0x8000) + insn |= BRANCH_PREDICT_BIT; + else + insn &= ~BRANCH_PREDICT_BIT; + bfd_put_32 (output_bfd, insn, contents + offset); + break; + + + /* GOT16 relocations. Like an ADDR16 using the symbol's + address in the GOT as relocation value instead of the + symbols value itself. Also, create a GOT entry for the + symbol and put the symbol value there. */ + /* FIXME: If the symbol is not in the .got section + (typically in the .toc section) we fail (h->got.offset is + 0). */ + /* NOTE: Sets `relocation'. */ + case (int) R_PPC64_GOT16: + case (int) R_PPC64_GOT16_LO: + case (int) R_PPC64_GOT16_HI: + case (int) R_PPC64_GOT16_HA: + case (int) R_PPC64_GOT16_DS: + case (int) R_PPC64_GOT16_LO_DS: + { + /* Relocation is to the entry for this symbol in the global + offset table. */ + bfd_vma off; + BFD_ASSERT (sgot != NULL); + + if (h != NULL) + { + off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) -1); + + if (! elf_hash_table (info)->dynamic_sections_created + || (info->shared + && (info->symbolic || h->dynindx == -1) + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR))) + { + /* This is actually a static link, or it is a + -Bsymbolic link and the symbol is defined + locally. We must initialize this entry in the + global offset table. Since the offset must + always be a multiple of 4, we use the least + significant bit to record whether we have + initialized it already. + + When doing a dynamic link, we create a .rela.got + relocation entry to initialize the value. This + is done in the finish_dynamic_symbol routine. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_64 (output_bfd, relocation, + sgot->contents + off); + h->got.offset |= 1; + } + } + } + else + { + BFD_ASSERT (local_got_offsets != NULL + && local_got_offsets[r_symndx] != (bfd_vma) -1); + + off = local_got_offsets[r_symndx]; + + /* The offset must always be a multiple of 4. We use + the least significant bit to record whether we have + already processed this entry. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_64 (output_bfd, relocation, sgot->contents + off); + + if (info->shared) + { + asection *srelgot; + Elf_Internal_Rela outrel; + + /* We need to generate a R_PPC64_RELATIVE reloc + for the dynamic linker. */ + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + BFD_ASSERT (srelgot != NULL); + + outrel.r_offset = (sgot->output_section->vma + + sgot->output_offset + + off); + outrel.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); + outrel.r_addend = relocation; + bfd_elf64_swap_reloca_out (output_bfd, &outrel, + (((Elf64_External_Rela *) + srelgot->contents) + + srelgot->reloc_count)); + ++srelgot->reloc_count; + } + + local_got_offsets[r_symndx] |= 1; + } + } + + relocation = sgot->output_offset + off; + /* TOC base (r2) is TOC start plus 0x8000. */ + addend -= TOC_BASE_OFF; + break; + } + + /* TOC16 relocs. We want the offset relative to the TOC base, + which is the address of the start of the TOC plus 0x8000. + The TOC consists of sections .got, .toc, .tocbss, and .plt, + in this order. */ + + case (int) R_PPC64_TOC16: + case (int) R_PPC64_TOC16_LO: + case (int) R_PPC64_TOC16_HI: + case (int) R_PPC64_TOC16_DS: + case (int) R_PPC64_TOC16_LO_DS: + BFD_ASSERT (sec != (asection *) 0); + /* Only .got, .toc and *UND* symbols are allowed. */ + BFD_ASSERT (bfd_is_und_section (sec) + || strcmp (bfd_get_section_name (abfd, sec), + ".got") == 0 + || strcmp (bfd_get_section_name (abfd, sec), + ".toc") == 0); + + addend -= TOCstart + TOC_BASE_OFF; + break; + + case (int) R_PPC64_TOC16_HA: + BFD_ASSERT (sec != (asection *) 0); + BFD_ASSERT (bfd_is_und_section (sec) + || strcmp (bfd_get_section_name (abfd, sec), + ".got") == 0 + || strcmp (bfd_get_section_name (abfd, sec), + ".toc") == 0); + + addend -= TOCstart + TOC_BASE_OFF; + /* Add 1 to 16-bit word 16:31 if sign bit in 0:15 is set. */ + addend += ((relocation + addend) & 0x8000) << 1; + break; + + /* Relocate against the beginning of the section. */ + case (int) R_PPC64_SECTOFF: + case (int) R_PPC64_SECTOFF_LO: + case (int) R_PPC64_SECTOFF_HI: + case (int) R_PPC64_SECTOFF_DS: + case (int) R_PPC64_SECTOFF_LO_DS: + BFD_ASSERT (sec != (asection *) 0); + addend -= sec->output_section->vma; + break; + + case (int) R_PPC64_SECTOFF_HA: + BFD_ASSERT (sec != (asection *) 0); + addend -= sec->output_section->vma; + addend += ((relocation + addend) & 0x8000) << 1; + break; + + case (int) R_PPC64_COPY: + case (int) R_PPC64_GLOB_DAT: + case (int) R_PPC64_JMP_SLOT: + case (int) R_PPC64_RELATIVE: + case (int) R_PPC64_PLT32: + case (int) R_PPC64_PLTREL32: + case (int) R_PPC64_PLT16_LO: + case (int) R_PPC64_PLT16_LO_DS: + case (int) R_PPC64_PLT16_HI: + case (int) R_PPC64_PLT16_HA: + case (int) R_PPC64_PLT64: + case (int) R_PPC64_PLTREL64: + case (int) R_PPC64_PLTGOT16: + case (int) R_PPC64_PLTGOT16_LO: + case (int) R_PPC64_PLTGOT16_DS: + case (int) R_PPC64_PLTGOT16_LO_DS: + case (int) R_PPC64_PLTGOT16_HI: + case (int) R_PPC64_PLTGOT16_HA: + (*_bfd_error_handler) (_("%s: Relocation %s is not yet supported for symbol %s."), + bfd_get_filename (input_bfd), + ppc64_elf_howto_table[(int) r_type]->name, + sym_name); + + bfd_set_error (bfd_error_invalid_operation); + ret = false; + continue; + + case (int) R_PPC_GNU_VTINHERIT: + case (int) R_PPC_GNU_VTENTRY: + /* These are no-ops in the end. */ + continue; + } + +#ifdef DEBUG + fprintf (stderr, " type = %s (%d), name = %s, sym index = %ld, offset = %ld, addend = %ld\n", + howto->name, + (int) r_type, + sym_name, + r_symndx, + (long) offset, + (long) addend); +#endif + + r = _bfd_final_link_relocate (howto, + input_bfd, + input_section, + contents, + offset, + relocation, + addend); + + if (r == bfd_reloc_ok) + ; + else if (r == bfd_reloc_overflow) + { + const char *name; + + if (h != NULL) + { + if (h->root.type == bfd_link_hash_undefweak + && howto->pc_relative) + { + /* Assume this is a call protected by other code that + detects the symbol is undefined. If this is the case, + we can safely ignore the overflow. If not, the + program is hosed anyway, and a little warning isn't + going to help. */ + + continue; + } + + name = h->root.root.string; + } + else + { + name = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); + if (name == NULL) + continue; + if (*name == '\0') + name = bfd_section_name (input_bfd, sec); + } + + if (! (*info->callbacks->reloc_overflow) (info, + name, + howto->name, + (bfd_vma) 0, + input_bfd, + input_section, + offset)) + return false; + } + else + ret = false; + } + +#ifdef DEBUG + fprintf (stderr, "\n"); +#endif + + return ret; +} + +/* Finish up dynamic symbol handling. We set the contents of various + dynamic sections here. */ + +static boolean +ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) + bfd *output_bfd; + struct bfd_link_info *info; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + bfd *dynobj; + +#ifdef DEBUG + fprintf (stderr, "ppc64_elf_finish_dynamic_symbol called for %s", + h->root.root.string); +#endif + + dynobj = elf_hash_table (info)->dynobj; + BFD_ASSERT (dynobj != NULL); + + if (h->plt.offset != (bfd_vma) -1) + { + asection *splt, *srela, *sglink; + Elf_Internal_Rela rela; + bfd_vma reloc_index, plt_offset; + struct elf_link_hash_entry *funcdesc_h; + +#ifdef DEBUG + fprintf (stderr, ", plt_offset = 0x%lx", (unsigned long) h->plt.offset); +#endif + + /* This symbol has an entry in the procedure linkage table. Set + it up. */ + + BFD_ASSERT (h->dynindx != -1); + + splt = bfd_get_section_by_name (dynobj, ".plt"); + srela = bfd_get_section_by_name (dynobj, ".rela.plt"); + BFD_ASSERT (splt != NULL && srela != NULL); + + /* We don't need to fill in the .plt. The dynamic linker will + fill it in. */ + + /* We may need to create a linkage function. */ + sglink = bfd_get_section_by_name (dynobj, ".glink"); + if (sglink != NULL && h->root.u.def.section == sglink) + { + bfd_byte *p; + bfd_vma pltoff; + const unsigned int *stub; + + /* Where to write it. */ + p = h->root.u.def.section->contents + h->root.u.def.value; + + /* The function descriptor is in the PLT. */ + pltoff = splt->output_section->vma + + splt->output_section->output_offset + + h->plt.offset + - elf_gp (output_bfd) - TOC_BASE_OFF; + + if (pltoff + 0x8000 > 0xffff) + { + (*_bfd_error_handler) + (_("linkage table overflow against `%s'"), + h->root.root.string); + } + + /* Write it out. */ + stub = ppc64_elf_glink_code; + bfd_put_32 (output_bfd, *stub | (pltoff & 0xfffc), p); + while (p += 4, ++stub < (ppc64_elf_glink_code + + (sizeof (ppc64_elf_glink_code) + / sizeof (*ppc64_elf_glink_code)))); + { + bfd_put_32 (output_bfd, *stub, p); + } +#ifdef DEBUG + fprintf (stderr, ", linkage function"); +#endif + } + + /* Create a JMP_SLOT reloc to inform the dynamic linker to fix + the PLT entry. */ + + /* Save the PLT offset, since `h' may be changed below. */ + plt_offset = h->plt.offset; + + /* If it's a function entry point, find its corresponding + function descriptor. ppc64_elf_adjust_dynamic_symbol have + already set it up for us. */ + + /* FIXME: Is it safe to assume that this symbol is a function? */ + BFD_ASSERT (h->root.root.string[0] == '.'); + + /* FIXME: Follow bfd_link_hash_indirect? */ + funcdesc_h = elf_link_hash_lookup (elf_hash_table (info), + h->root.root.string + 1, + false, false, false); + BFD_ASSERT (funcdesc_h != NULL); + BFD_ASSERT (funcdesc_h->dynindx != -1); + + /* FIXME: Rename the symbol for the function entry point to + `linkage_for_FUNC'? */ + + rela.r_offset = (splt->output_section->vma + + splt->output_offset + + plt_offset); + rela.r_info = ELF64_R_INFO (funcdesc_h->dynindx, R_PPC64_JMP_SLOT); + rela.r_addend = 0; + + reloc_index = (plt_offset - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE; + bfd_elf64_swap_reloca_out (output_bfd, &rela, + ((Elf64_External_Rela *) srela->contents + + reloc_index)); +#ifdef DEBUG + fprintf (stderr, ", JMP_SLOT for %s", funcdesc_h->root.root.string); +#endif + +#if 0 + /* FIXME: Really do this? */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + { + /* Mark the symbol as undefined, rather than as defined in + the .plt section. Leave the value alone. */ + sym->st_shndx = SHN_UNDEF; + } +#endif + } + + if (h->got.offset != (bfd_vma) -1) + { + asection *sgot; + asection *srela; + Elf_Internal_Rela rela; + +#ifdef DEBUG + fprintf (stderr, ", got.offset = %08lx", (unsigned long) h->got.offset); +#endif + + /* This symbol has an entry in the global offset table. Set it + up. */ + + sgot = bfd_get_section_by_name (dynobj, ".got"); + srela = bfd_get_section_by_name (dynobj, ".rela.got"); + BFD_ASSERT (sgot != NULL && srela != NULL); + + rela.r_offset = (sgot->output_section->vma + + sgot->output_offset + + (h->got.offset &~ 1)); + + /* If this is a -Bsymbolic link, and the symbol is defined + locally, we just want to emit a RELATIVE reloc. The entry in + the global offset table will already have been initialized in + the relocate_section function. */ + if (info->shared + && (info->symbolic || h->dynindx == -1) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + { + rela.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); + rela.r_addend = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } + else + { + BFD_ASSERT ((h->got.offset & 1) == 0); + bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset); + rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_GLOB_DAT); + rela.r_addend = 0; + } + + bfd_elf64_swap_reloca_out (output_bfd, &rela, + ((Elf64_External_Rela *) srela->contents + + srela->reloc_count)); + ++srela->reloc_count; + } + + if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) + { + asection *s; + Elf_Internal_Rela rela; + + /* This symbols needs a copy reloc. Set it up. */ + +#ifdef DEBUG + fprintf (stderr, ", copy"); +#endif + + BFD_ASSERT (h->dynindx != -1); + + s = bfd_get_section_by_name (h->root.u.def.section->owner, + ".rela.bss"); + BFD_ASSERT (s != NULL); + + rela.r_offset = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_COPY); + rela.r_addend = 0; + bfd_elf64_swap_reloca_out (output_bfd, &rela, + ((Elf64_External_Rela *) s->contents + + s->reloc_count)); + ++s->reloc_count; + } + +#ifdef DEBUG + fprintf (stderr, "\n"); +#endif + + /* Mark some specially defined symbols as absolute. */ + if (strcmp (h->root.root.string, "_DYNAMIC") == 0) + sym->st_shndx = SHN_ABS; + + return true; +} + +/* Finish up the dynamic sections. */ + +static boolean +ppc64_elf_finish_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + asection *sdyn; + bfd *dynobj = elf_hash_table (info)->dynobj; + +#ifdef DEBUG + fprintf (stderr, "ppc64_elf_finish_dynamic_sections called\n"); +#endif + + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + + if (elf_hash_table (info)->dynamic_sections_created) + { + asection *splt; + Elf64_External_Dyn *dyncon, *dynconend; + + splt = bfd_get_section_by_name (dynobj, ".plt"); + BFD_ASSERT (splt != NULL && sdyn != NULL); + + dyncon = (Elf64_External_Dyn *) sdyn->contents; + dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size); + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + const char *name; + boolean size; + + bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); + + switch (dyn.d_tag) + { + case DT_PLTGOT: name = ".plt"; size = false; break; + case DT_PLTRELSZ: name = ".rela.plt"; size = true; break; + case DT_JMPREL: name = ".rela.plt"; size = false; break; + default: name = NULL; size = false; break; + } + + if (name != NULL) + { + asection *s; + + s = bfd_get_section_by_name (output_bfd, name); + if (s == NULL) + dyn.d_un.d_val = 0; + else + { + if (! size) + dyn.d_un.d_ptr = s->vma; + else + { + if (s->_cooked_size != 0) + dyn.d_un.d_val = s->_cooked_size; + else + dyn.d_un.d_val = s->_raw_size; + } + } + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + } + } + } + + if (info->shared) + { + asection *sdynsym; + asection *s; + Elf_Internal_Sym sym; + int maxdindx = 0; + + /* Set up the section symbols for the output sections. */ + + sdynsym = bfd_get_section_by_name (dynobj, ".dynsym"); + BFD_ASSERT (sdynsym != NULL); + + sym.st_size = 0; + sym.st_name = 0; + sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION); + sym.st_other = 0; + + for (s = output_bfd->sections; s != NULL; s = s->next) + { + int indx, dindx; + + sym.st_value = s->vma; + + indx = elf_section_data (s)->this_idx; + dindx = elf_section_data (s)->dynindx; + if (dindx != -1) + { + BFD_ASSERT (indx > 0); + BFD_ASSERT (dindx > 0); + + if (dindx > maxdindx) + maxdindx = dindx; + + sym.st_shndx = indx; + + bfd_elf64_swap_symbol_out (output_bfd, &sym, + (PTR) (((Elf64_External_Sym *) + sdynsym->contents) + + dindx)); + } + } + + /* Set the sh_info field of the output .dynsym section to the + index of the first global symbol. */ + elf_section_data (sdynsym->output_section)->this_hdr.sh_info = + maxdindx + 1; + } + + return true; +} + +#define TARGET_LITTLE_SYM bfd_elf64_powerpcle_vec +#define TARGET_LITTLE_NAME "elf64-powerpcle" +#define TARGET_BIG_SYM bfd_elf64_powerpc_vec +#define TARGET_BIG_NAME "elf64-powerpc" +#define ELF_ARCH bfd_arch_powerpc +#define ELF_MACHINE_CODE EM_PPC64 +#define ELF_MAXPAGESIZE 0x10000 +#define elf_info_to_howto ppc64_elf_info_to_howto + +#ifdef EM_CYGNUS_POWERPC +#define ELF_MACHINE_ALT1 EM_CYGNUS_POWERPC +#endif + +#ifdef EM_PPC_OLD +#define ELF_MACHINE_ALT2 EM_PPC_OLD +#endif + +#define elf_backend_want_got_sym 0 +#define elf_backend_want_plt_sym 0 +#define elf_backend_plt_alignment 3 +#define elf_backend_plt_not_loaded 1 +#define elf_backend_got_symbol_offset 0 +#define elf_backend_got_header_size 0 +#define elf_backend_can_gc_sections 1 + +#define elf_backend_plt_header_size PLT_INITIAL_ENTRY_SIZE + +#define bfd_elf64_bfd_copy_private_bfd_data ppc64_elf_copy_private_bfd_data +#define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data +#define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup +#define bfd_elf64_bfd_set_private_flags ppc64_elf_set_private_flags +#define bfd_elf64_bfd_final_link ppc64_elf_final_link + +#define elf_backend_gc_mark_hook ppc64_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook ppc64_elf_gc_sweep_hook +#define elf_backend_section_from_shdr ppc64_elf_section_from_shdr +#define elf_backend_relocate_section ppc64_elf_relocate_section +#define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections +#define elf_backend_check_relocs ppc64_elf_check_relocs +#define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol +#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections +#define elf_backend_finish_dynamic_symbol ppc64_elf_finish_dynamic_symbol +#define elf_backend_finish_dynamic_sections ppc64_elf_finish_dynamic_sections +#define elf_backend_fake_sections ppc64_elf_fake_sections + +#include "elf64-target.h" diff -uprN binutils-2.11.90.0.27/bfd/elf64-s390.c binutils-2.11.90.0.29/bfd/elf64-s390.c --- binutils-2.11.90.0.27/bfd/elf64-s390.c Fri Mar 9 11:15:56 2001 +++ binutils-2.11.90.0.29/bfd/elf64-s390.c Mon Aug 27 11:44:51 2001 @@ -37,6 +37,12 @@ static struct bfd_link_hash_table *elf_s static boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); +static asection *elf_s390_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf_s390_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); static boolean elf_s390_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static boolean elf_s390_size_dynamic_sections @@ -49,6 +55,8 @@ static boolean elf_s390_finish_dynamic_s Elf_Internal_Sym *)); static boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static boolean elf_s390_object_p PARAMS ((bfd *)); +static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((int)); #define USE_RELA 1 /* We want RELA relocations, not REL. */ @@ -107,7 +115,7 @@ static reloc_howto_type elf_howto_table[ static reloc_howto_type elf64_s390_vtinherit_howto = HOWTO (R_390_GNU_VTINHERIT, 0,4,0,false,0,complain_overflow_dont, NULL, "R_390_GNU_VTINHERIT", false,0, 0, false); static reloc_howto_type elf64_s390_vtentry_howto = - HOWTO (R_390_GNU_VTENTRY, 0,4,0,false,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", false,0,0, false); + HOWTO (R_390_GNU_VTENTRY, 0,4,0,false,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", false,0,0, false); static reloc_howto_type * elf_s390_reloc_type_lookup (abfd, code) @@ -176,7 +184,7 @@ elf_s390_reloc_type_lookup (abfd, code) case BFD_RELOC_390_GOTENT: return &elf_howto_table[(int) R_390_GOTENT]; default: - break; + break; } return 0; } @@ -203,7 +211,7 @@ elf_s390_info_to_howto (abfd, cache_ptr, default: BFD_ASSERT (ELF64_R_TYPE(dst->r_info) < (unsigned int) R_390_max); cache_ptr->howto = &elf_howto_table[ELF64_R_TYPE(dst->r_info)]; - } + } } static boolean @@ -232,7 +240,7 @@ elf_s390_is_local_label_name (abfd, name /* The size in bytes of the first entry in the procedure linkage table. */ #define PLT_FIRST_ENTRY_SIZE 32 /* The size in bytes of an entry in the procedure linkage table. */ -#define PLT_ENTRY_SIZE 32 +#define PLT_ENTRY_SIZE 32 #define GOT_ENTRY_SIZE 8 @@ -246,7 +254,7 @@ elf_s390_is_local_label_name (abfd, name are needed to load an address in a register and execute a branch( or just saving the address) - Furthermore, only r 0 and 1 are free to use!!! */ + Furthermore, only r 0 and 1 are free to use!!! */ /* The first 3 words in the GOT are then reserved. Word 0 is the address of the dynamic table. @@ -258,7 +266,7 @@ elf_s390_is_local_label_name (abfd, name The GOT holds the address in the PLT to be executed. The loader then gets: 24(15) = Pointer to the structure describing the object. - 28(15) = Offset in symbol table + 28(15) = Offset in symbol table The loader must then find the module where the function is and insert the address in the GOT. @@ -468,7 +476,7 @@ elf_s390_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; /* Some relocs require a global offset table. */ if (dynobj == NULL) @@ -542,7 +550,7 @@ elf_s390_check_relocs (abfd, info, sec, if (! bfd_elf64_link_record_dynamic_symbol (info, h)) return false; } - + sgot->_raw_size += 8; srelgot->_raw_size += sizeof (Elf64_External_Rela); } @@ -551,7 +559,7 @@ elf_s390_check_relocs (abfd, info, sec, } else { - /* This is a global offset table entry for a local symbol. */ + /* This is a global offset table entry for a local symbol. */ if (local_got_refcounts == NULL) { size_t size; @@ -635,7 +643,7 @@ elf_s390_check_relocs (abfd, info, sec, if (info->shared && (sec->flags & SEC_ALLOC) != 0 && (ELF64_R_TYPE (rel->r_info) == R_390_8 - || ELF64_R_TYPE (rel->r_info) == R_390_16 + || ELF64_R_TYPE (rel->r_info) == R_390_16 || ELF64_R_TYPE (rel->r_info) == R_390_32 || ELF64_R_TYPE (rel->r_info) == R_390_64 || (h != NULL @@ -677,6 +685,8 @@ elf_s390_check_relocs (abfd, info, sec, || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf64_External_Rela); @@ -736,7 +746,7 @@ elf_s390_check_relocs (abfd, info, sec, if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) return false; break; - + default: break; } @@ -1062,12 +1072,11 @@ elf_s390_adjust_dynamic_symbol (info, h) static boolean elf_s390_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; - boolean reltext; boolean relocs; boolean plt; @@ -1110,7 +1119,6 @@ elf_s390_size_dynamic_sections (output_b determined the sizes of the various dynamic sections. Allocate memory for them. */ plt = false; - reltext = false; relocs = false; for (s = dynobj->sections; s != NULL; s = s->next) { @@ -1157,29 +1165,10 @@ elf_s390_size_dynamic_sections (output_b } else { - asection *target; - /* Remember whether there are any reloc sections other than .rela.plt. */ if (strcmp (name, ".rela.plt") != 0) - { - const char *outname; - - relocs = true; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL - entry. The entries in the .rela.plt section - really apply to the .got section, which we - created ourselves and so know is not readonly. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - } + relocs = true; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -1235,7 +1224,7 @@ elf_s390_size_dynamic_sections (output_b return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; @@ -1448,8 +1437,8 @@ elf_s390_relocate_section (output_bfd, i { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, - (!info->shared || info->no_undefined + input_section, rel->r_offset, + (!info->shared || info->no_undefined || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; @@ -1556,7 +1545,7 @@ elf_s390_relocate_section (output_bfd, i relocation += sgot->output_section->vma; break; - + case R_390_GOTOFF: /* Relocation is relative to the start of the global offset table. */ @@ -1692,7 +1681,7 @@ elf_s390_relocate_section (output_bfd, i } else if (r_type == R_390_PC16 || r_type == R_390_PC16DBL || - r_type == R_390_PC32 || + r_type == R_390_PC32 || r_type == R_390_PC32DBL || r_type == R_390_PC64) { @@ -1816,7 +1805,7 @@ elf_s390_finish_dynamic_symbol (output_b srela = bfd_get_section_by_name (dynobj, ".rela.plt"); BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL); - /* Calc. index no. + /* Calc. index no. Current offset - size first entry / entry size. */ plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; @@ -2072,7 +2061,7 @@ elf_s390_finish_dynamic_sections (output splt->contents + 8); } - elf_section_data (splt->output_section)->this_hdr.sh_entsize = + elf_section_data (splt->output_section)->this_hdr.sh_entsize = PLT_ENTRY_SIZE; } @@ -2105,6 +2094,24 @@ elf_s390_object_p (abfd) return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_esame); } + +static enum elf_reloc_type_class +elf_s390_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_390_RELATIVE: + return reloc_class_relative; + case R_390_JMP_SLOT: + return reloc_class_plt; + case R_390_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + /* * Why was the hash table entry size definition changed from * ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and @@ -2172,6 +2179,7 @@ const struct elf_size_info s390_elf64_si #define elf_backend_gc_sweep_hook elf_s390_gc_sweep_hook #define elf_backend_relocate_section elf_s390_relocate_section #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections +#define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_object_p elf_s390_object_p diff -uprN binutils-2.11.90.0.27/bfd/elf64-sparc.c binutils-2.11.90.0.29/bfd/elf64-sparc.c --- binutils-2.11.90.0.27/bfd/elf64-sparc.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.29/bfd/elf64-sparc.c Mon Aug 27 11:44:51 2001 @@ -35,31 +35,37 @@ Foundation, Inc., 59 Temple Place - Suit #define MINUS_ONE (~ (bfd_vma) 0) static struct bfd_link_hash_table * sparc64_elf_bfd_link_hash_table_create - PARAMS((bfd *)); + PARAMS ((bfd *)); +static bfd_reloc_status_type init_insn_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, + bfd *, bfd_vma *, bfd_vma *)); static reloc_howto_type *sparc64_elf_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static void sparc64_elf_info_to_howto PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); static void sparc64_elf_build_plt - PARAMS((bfd *, unsigned char *, int)); + PARAMS ((bfd *, unsigned char *, int)); static bfd_vma sparc64_elf_plt_entry_offset - PARAMS((int)); + PARAMS ((int)); static bfd_vma sparc64_elf_plt_ptr_offset - PARAMS((int, int)); + PARAMS ((int, int)); static boolean sparc64_elf_check_relocs - PARAMS((bfd *, struct bfd_link_info *, asection *sec, - const Elf_Internal_Rela *)); + PARAMS ((bfd *, struct bfd_link_info *, asection *sec, + const Elf_Internal_Rela *)); static boolean sparc64_elf_adjust_dynamic_symbol - PARAMS((struct bfd_link_info *, struct elf_link_hash_entry *)); + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static boolean sparc64_elf_size_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *)); static int sparc64_elf_get_symbol_type PARAMS (( Elf_Internal_Sym *, int)); static boolean sparc64_elf_add_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, - const char **, flagword *, asection **, bfd_vma *)); + const char **, flagword *, asection **, bfd_vma *)); +static boolean sparc64_elf_output_arch_syms + PARAMS ((bfd *, struct bfd_link_info *, PTR, + boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *))); static void sparc64_elf_symbol_processing PARAMS ((bfd *, asymbol *)); @@ -68,11 +74,18 @@ static boolean sparc64_elf_copy_private_ static boolean sparc64_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +static const char *sparc64_elf_print_symbol_all + PARAMS ((bfd *, PTR, asymbol *)); static boolean sparc64_elf_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static boolean sparc64_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static boolean sparc64_elf_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *)); +static boolean sparc64_elf_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); static boolean sparc64_elf_object_p PARAMS ((bfd *)); static long sparc64_elf_get_reloc_upper_bound PARAMS ((bfd *, asection *)); static long sparc64_elf_get_dynamic_reloc_upper_bound PARAMS ((bfd *)); @@ -83,6 +96,7 @@ static boolean sparc64_elf_slurp_reloc_t static long sparc64_elf_canonicalize_dynamic_reloc PARAMS ((bfd *, arelent **, asymbol **)); static void sparc64_elf_write_relocs PARAMS ((bfd *, asection *, PTR)); +static enum elf_reloc_type_class sparc64_elf_reloc_type_class PARAMS ((int)); /* The relocation "howto" table. */ @@ -1235,6 +1249,8 @@ sparc64_elf_check_relocs (abfd, info, se || ! bfd_set_section_alignment (dynobj, sreloc, 3)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf64_External_Rela); @@ -1653,7 +1669,6 @@ sparc64_elf_size_dynamic_sections (outpu { bfd *dynobj; asection *s; - boolean reltext; boolean relplt; dynobj = elf_hash_table (info)->dynobj; @@ -1685,7 +1700,6 @@ sparc64_elf_size_dynamic_sections (outpu /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - reltext = false; relplt = false; for (s = dynobj->sections; s != NULL; s = s->next) { @@ -1718,18 +1732,6 @@ sparc64_elf_size_dynamic_sections (outpu } else { - const char *outname; - asection *target; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0) - reltext = true; - if (strcmp (name, ".rela.plt") == 0) relplt = true; @@ -1792,11 +1794,10 @@ sparc64_elf_size_dynamic_sections (outpu sizeof (Elf64_External_Rela))) return false; - if (reltext) + if (info->flags & DF_TEXTREL) { if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; - info->flags |= DF_TEXTREL; } /* Add dynamic STT_REGISTER symbols and corresponding DT_SPARC_REGISTER @@ -2896,6 +2897,23 @@ sparc64_elf_finish_dynamic_sections (out return true; } + +static enum elf_reloc_type_class +sparc64_elf_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_SPARC_RELATIVE: + return reloc_class_relative; + case R_SPARC_JMP_SLOT: + return reloc_class_plt; + case R_SPARC_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} /* Functions for dealing with the e_flags field. */ @@ -3025,8 +3043,8 @@ sparc64_elf_print_symbol_all (abfd, file fprintf (file, "REG_%c%c%11s%c%c R", "GOLI" [reg / 8], '0' + (reg & 7), "", ((type & BSF_LOCAL) ? (type & BSF_GLOBAL) ? '!' : 'l' - : (type & BSF_GLOBAL) ? 'g' : ' '), - (type & BSF_WEAK) ? 'w' : ' '); + : (type & BSF_GLOBAL) ? 'g' : ' '), + (type & BSF_WEAK) ? 'w' : ' '); if (symbol->name == NULL || symbol->name [0] == '\0') return "#scratch"; else @@ -3147,6 +3165,8 @@ const struct elf_size_info sparc64_elf_s sparc64_elf_size_info #define elf_backend_object_p \ sparc64_elf_object_p +#define elf_backend_reloc_type_class \ + sparc64_elf_reloc_type_class #define elf_backend_want_got_plt 0 #define elf_backend_plt_readonly 0 diff -uprN binutils-2.11.90.0.27/bfd/elf64-x86-64.c binutils-2.11.90.0.29/bfd/elf64-x86-64.c --- binutils-2.11.90.0.27/bfd/elf64-x86-64.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/elf64-x86-64.c Mon Aug 27 11:44:51 2001 @@ -153,6 +153,7 @@ static boolean elf64_x86_64_finish_dynam Elf_Internal_Sym *sym)); static boolean elf64_x86_64_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static enum elf_reloc_type_class elf64_x86_64_reloc_type_class PARAMS ((int)); /* Given a BFD reloc type, return a HOWTO structure. */ static reloc_howto_type * @@ -576,6 +577,8 @@ elf64_x86_64_check_relocs (abfd, info, s || ! bfd_set_section_alignment (dynobj, sreloc, 3)) return false; } + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; } sreloc->_raw_size += sizeof (Elf64_External_Rela); @@ -946,14 +949,13 @@ elf64_x86_64_adjust_dynamic_symbol (info static boolean elf64_x86_64_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; boolean plt; boolean relocs; - boolean reltext; dynobj = elf_hash_table (info)->dynobj; BFD_ASSERT (dynobj != NULL); @@ -993,7 +995,7 @@ elf64_x86_64_size_dynamic_sections (outp /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - plt = relocs = reltext = false; + plt = relocs = false; for (s = dynobj->sections; s != NULL; s = s->next) { const char *name; @@ -1038,29 +1040,8 @@ elf64_x86_64_size_dynamic_sections (outp } else { - asection *target; - - /* Remember whether there are any reloc sections other - than .rela.plt. */ if (strcmp (name, ".rela.plt") != 0) - { - const char *outname; - - relocs = true; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL - entry. The entries in the .rela.plt section - really apply to the .got section, which we - created ourselves and so know is not readonly. */ - outname = bfd_get_section_name (output_bfd, - s->output_section); - target = bfd_get_section_by_name (output_bfd, outname + 5); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - } + relocs = true; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -1120,11 +1101,10 @@ elf64_x86_64_size_dynamic_sections (outp return false; } - if (reltext) + if ((info->flags & DF_TEXTREL) != 0) { if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; - info->flags |= DF_TEXTREL; } } @@ -1949,6 +1929,23 @@ elf64_x86_64_finish_dynamic_sections (ou return true; } +static enum elf_reloc_type_class +elf64_x86_64_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_X86_64_RELATIVE: + return reloc_class_relative; + case R_X86_64_JUMP_SLOT: + return reloc_class_plt; + case R_X86_64_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + #define TARGET_LITTLE_SYM bfd_elf64_x86_64_vec #define TARGET_LITTLE_NAME "elf64-x86-64" #define ELF_ARCH bfd_arch_i386 @@ -1980,5 +1977,6 @@ elf64_x86_64_finish_dynamic_sections (ou #define elf_backend_relocate_section elf64_x86_64_relocate_section #define elf_backend_size_dynamic_sections elf64_x86_64_size_dynamic_sections #define elf_backend_object_p elf64_x86_64_elf_object_p +#define elf_backend_reloc_type_class elf64_x86_64_reloc_type_class #include "elf64-target.h" diff -uprN binutils-2.11.90.0.27/bfd/elfarm-nabi.c binutils-2.11.90.0.29/bfd/elfarm-nabi.c --- binutils-2.11.90.0.27/bfd/elfarm-nabi.c Fri Mar 9 11:15:57 2001 +++ binutils-2.11.90.0.29/bfd/elfarm-nabi.c Mon Aug 27 11:44:51 2001 @@ -578,6 +578,9 @@ static reloc_howto_type elf32_arm_thm_pc 0x000000ff, /* dst_mask */ true); /* pcrel_offset */ +static void elf32_arm_info_to_howto + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + static void elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd * abfd ATTRIBUTE_UNUSED; @@ -622,27 +625,27 @@ struct elf32_arm_reloc_map }; static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = -{ - {BFD_RELOC_NONE, R_ARM_NONE}, - {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24}, - {BFD_RELOC_ARM_PCREL_BLX, R_ARM_XPC25}, - {BFD_RELOC_THUMB_PCREL_BLX, R_ARM_THM_XPC22}, - {BFD_RELOC_32, R_ARM_ABS32}, - {BFD_RELOC_32_PCREL, R_ARM_REL32}, - {BFD_RELOC_8, R_ARM_ABS8}, - {BFD_RELOC_16, R_ARM_ABS16}, - {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12}, - {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5}, - {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22}, - {BFD_RELOC_ARM_COPY, R_ARM_COPY}, - {BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT}, - {BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT}, - {BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE}, - {BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF}, - {BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC}, - {BFD_RELOC_ARM_GOT32, R_ARM_GOT32}, - {BFD_RELOC_ARM_PLT32, R_ARM_PLT32} -}; + { + {BFD_RELOC_NONE, R_ARM_NONE}, + {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24}, + {BFD_RELOC_ARM_PCREL_BLX, R_ARM_XPC25}, + {BFD_RELOC_THUMB_PCREL_BLX, R_ARM_THM_XPC22}, + {BFD_RELOC_32, R_ARM_ABS32}, + {BFD_RELOC_32_PCREL, R_ARM_REL32}, + {BFD_RELOC_8, R_ARM_ABS8}, + {BFD_RELOC_16, R_ARM_ABS16}, + {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12}, + {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5}, + {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22}, + {BFD_RELOC_ARM_COPY, R_ARM_COPY}, + {BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT}, + {BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT}, + {BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE}, + {BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF}, + {BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC}, + {BFD_RELOC_ARM_GOT32, R_ARM_GOT32}, + {BFD_RELOC_ARM_PLT32, R_ARM_PLT32} + }; static reloc_howto_type * elf32_arm_reloc_type_lookup (abfd, code) diff -uprN binutils-2.11.90.0.27/bfd/elfarm-oabi.c binutils-2.11.90.0.29/bfd/elfarm-oabi.c --- binutils-2.11.90.0.27/bfd/elfarm-oabi.c Fri Mar 9 11:15:57 2001 +++ binutils-2.11.90.0.29/bfd/elfarm-oabi.c Mon Aug 27 11:44:51 2001 @@ -42,305 +42,310 @@ #define ARM_ELF_ABI_VERSION 0 #define ARM_ELF_OS_ABI_VERSION 0 +static reloc_howto_type * find_howto PARAMS ((unsigned int)); +static void elf32_arm_info_to_howto PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); +static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); + static reloc_howto_type elf32_arm_howto_table[] = -{ - /* No relocation */ - HOWTO (R_ARM_NONE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_PC24, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 24, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_PC24", /* name */ - false, /* partial_inplace */ - 0x00ffffff, /* src_mask */ - 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 32 bit absolute */ - HOWTO (R_ARM_ABS32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* standard 32bit pc-relative reloc */ - HOWTO (R_ARM_REL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_REL32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 8 bit absolute */ - HOWTO (R_ARM_ABS8, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS8", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit absolute */ - HOWTO (R_ARM_ABS16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* 12 bit absolute */ - HOWTO (R_ARM_ABS12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS12", /* name */ - false, /* partial_inplace */ - 0x000008ff, /* src_mask */ - 0x000008ff, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_THM_ABS5, /* type */ - 6, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 5, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_ABS5", /* name */ - false, /* partial_inplace */ - 0x000007e0, /* src_mask */ - 0x000007e0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_THM_PC22, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 23, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC22", /* name */ - false, /* partial_inplace */ - 0x07ff07ff, /* src_mask */ - 0x07ff07ff, /* dst_mask */ - true), /* pcrel_offset */ - - HOWTO (R_ARM_SBREL32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_SBREL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_AMP_VCALL9, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_AMP_VCALL9", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 12 bit pc relative */ - HOWTO (R_ARM_THM_PC11, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 11, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC11", /* name */ - false, /* partial_inplace */ - 0x000007ff, /* src_mask */ - 0x000007ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 12 bit pc relative */ - HOWTO (R_ARM_THM_PC9, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC9", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* GNU extension to record C++ vtable hierarchy */ - HOWTO (R_ARM_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_ARM_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* GNU extension to record C++ vtable member usage */ - HOWTO (R_ARM_GNU_VTENTRY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_elf_rel_vtable_reloc_fn, /* special_function */ - "R_ARM_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* XXX - gap in index numbering here. */ - - HOWTO (R_ARM_PLT32, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_PLT32", /* name */ - true, /* partial_inplace */ - 0x00ffffff, /* src_mask */ - 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* XXX - gap in index numbering here. */ - - HOWTO (R_ARM_RREL32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RREL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RABS32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RABS32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RPC24, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RPC24", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RBASE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RBASE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false) /* pcrel_offset */ -}; + { + /* No relocation. */ + HOWTO (R_ARM_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_PC24, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_PC24", /* name */ + false, /* partial_inplace */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 32 bit absolute. */ + HOWTO (R_ARM_ABS32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Standard 32bit pc-relative reloc. */ + HOWTO (R_ARM_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_REL32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 8 bit absolute. */ + HOWTO (R_ARM_ABS8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS8", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit absolute. */ + HOWTO (R_ARM_ABS16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 12 bit absolute. */ + HOWTO (R_ARM_ABS12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS12", /* name */ + false, /* partial_inplace */ + 0x000008ff, /* src_mask */ + 0x000008ff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_THM_ABS5, /* type */ + 6, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_ABS5", /* name */ + false, /* partial_inplace */ + 0x000007e0, /* src_mask */ + 0x000007e0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_THM_PC22, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 23, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC22", /* name */ + false, /* partial_inplace */ + 0x07ff07ff, /* src_mask */ + 0x07ff07ff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_ARM_SBREL32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_SBREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_AMP_VCALL9, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_AMP_VCALL9", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 12 bit pc relative. */ + HOWTO (R_ARM_THM_PC11, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC11", /* name */ + false, /* partial_inplace */ + 0x000007ff, /* src_mask */ + 0x000007ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 12 bit pc relative. */ + HOWTO (R_ARM_THM_PC9, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC9", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy. */ + HOWTO (R_ARM_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_ARM_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage. */ + HOWTO (R_ARM_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_ARM_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* XXX - gap in index numbering here. */ + + HOWTO (R_ARM_PLT32, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_PLT32", /* name */ + true, /* partial_inplace */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* XXX - gap in index numbering here. */ + + HOWTO (R_ARM_RREL32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RABS32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RABS32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RPC24, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RPC24", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RBASE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RBASE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false) /* pcrel_offset */ + }; /* Locate a reloc in the howto table. This function must be used when the entry number is is > R_ARM_GNU_VTINHERIT. */ + static reloc_howto_type * find_howto (r_type) unsigned int r_type; @@ -377,23 +382,23 @@ struct elf32_arm_reloc_map }; static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = -{ - {BFD_RELOC_NONE, R_ARM_NONE }, - {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24 }, - {BFD_RELOC_32, R_ARM_ABS32 }, - {BFD_RELOC_32_PCREL, R_ARM_REL32 }, - {BFD_RELOC_8, R_ARM_ABS8 }, - {BFD_RELOC_16, R_ARM_ABS16 }, - {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12 }, - {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5 }, - {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22 }, - {BFD_RELOC_NONE, R_ARM_SBREL32 }, - {BFD_RELOC_NONE, R_ARM_AMP_VCALL9 }, - {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 }, - {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 }, - {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT }, - {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY } -}; + { + {BFD_RELOC_NONE, R_ARM_NONE }, + {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24 }, + {BFD_RELOC_32, R_ARM_ABS32 }, + {BFD_RELOC_32_PCREL, R_ARM_REL32 }, + {BFD_RELOC_8, R_ARM_ABS8 }, + {BFD_RELOC_16, R_ARM_ABS16 }, + {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12 }, + {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5 }, + {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22 }, + {BFD_RELOC_NONE, R_ARM_SBREL32 }, + {BFD_RELOC_NONE, R_ARM_AMP_VCALL9 }, + {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 }, + {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 }, + {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT }, + {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY } + }; static reloc_howto_type * elf32_arm_reloc_type_lookup (abfd, code) diff -uprN binutils-2.11.90.0.27/bfd/elflink.h binutils-2.11.90.0.29/bfd/elflink.h --- binutils-2.11.90.0.27/bfd/elflink.h Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/elflink.h Mon Aug 27 11:44:51 2001 @@ -67,6 +67,12 @@ static boolean elf_link_size_reloc_secti static void elf_link_adjust_relocs PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned int, struct elf_link_hash_entry **)); +static int elf_link_sort_cmp1 + PARAMS ((const void *, const void *)); +static int elf_link_sort_cmp2 + PARAMS ((const void *, const void *)); +static size_t elf_link_sort_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection **)); static boolean elf_link_check_versioned_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); @@ -1062,6 +1068,9 @@ elf_link_add_object_symbols (abfd, info) Elf_External_Sym *esymend; struct elf_backend_data *bed; boolean dt_needed; + struct elf_link_hash_table * hash_table; + + hash_table = elf_hash_table (info); bed = get_elf_backend_data (abfd); add_symbol_hook = bed->elf_add_symbol_hook; @@ -1116,7 +1125,7 @@ elf_link_add_object_symbols (abfd, info) { struct elf_link_hash_entry *h; - h = elf_link_hash_lookup (elf_hash_table (info), name, + h = elf_link_hash_lookup (hash_table, name, false, false, true); /* FIXME: What about bfd_link_hash_common? */ @@ -1231,13 +1240,16 @@ elf_link_add_object_symbols (abfd, info) format. FIXME: If there are no input BFD's of the same format as the output, we can't make a shared library. */ if (info->shared - && ! elf_hash_table (info)->dynamic_sections_created + && is_elf_hash_table (info) + && ! hash_table->dynamic_sections_created && abfd->xvec == info->hash->creator) { if (! elf_link_create_dynamic_sections (abfd, info)) goto error_return; } } + else if (! is_elf_hash_table (info)) + goto error_return; else { asection *s; @@ -1340,7 +1352,7 @@ elf_link_add_object_symbols (abfd, info) n->name = anm; n->by = abfd; n->next = NULL; - for (pn = &elf_hash_table (info)->needed; + for (pn = & hash_table->needed; *pn != NULL; pn = &(*pn)->next) ; @@ -1355,8 +1367,8 @@ elf_link_add_object_symbols (abfd, info) to clear runpath. Do _NOT_ bfd_release, as that frees all more recently bfd_alloc'd blocks as well. */ - if (rpath && elf_hash_table (info)->runpath) - elf_hash_table (info)->runpath = NULL; + if (rpath && hash_table->runpath) + hash_table->runpath = NULL; n = ((struct bfd_link_needed_list *) bfd_alloc (abfd, sizeof (struct bfd_link_needed_list))); @@ -1371,7 +1383,7 @@ elf_link_add_object_symbols (abfd, info) n->name = anm; n->by = abfd; n->next = NULL; - for (pn = &elf_hash_table (info)->runpath; + for (pn = & hash_table->runpath; *pn != NULL; pn = &(*pn)->next) ; @@ -1398,7 +1410,7 @@ elf_link_add_object_symbols (abfd, info) n->name = anm; n->by = abfd; n->next = NULL; - for (pn = &elf_hash_table (info)->runpath; + for (pn = & hash_table->runpath; *pn != NULL; pn = &(*pn)->next) ; @@ -1423,22 +1435,20 @@ elf_link_add_object_symbols (abfd, info) /* If this is the first dynamic object found in the link, create the special sections required for dynamic linking. */ - if (! elf_hash_table (info)->dynamic_sections_created) - { - if (! elf_link_create_dynamic_sections (abfd, info)) - goto error_return; - } + if (! hash_table->dynamic_sections_created) + if (! elf_link_create_dynamic_sections (abfd, info)) + goto error_return; if (add_needed) { /* Add a DT_NEEDED entry for this dynamic object. */ - oldsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr); - strindex = _bfd_stringtab_add (elf_hash_table (info)->dynstr, name, + oldsize = _bfd_stringtab_size (hash_table->dynstr); + strindex = _bfd_stringtab_add (hash_table->dynstr, name, true, false); if (strindex == (bfd_size_type) -1) goto error_return; - if (oldsize == _bfd_stringtab_size (elf_hash_table (info)->dynstr)) + if (oldsize == _bfd_stringtab_size (hash_table->dynstr)) { asection *sdyn; Elf_External_Dyn *dyncon, *dynconend; @@ -1448,8 +1458,7 @@ elf_link_add_object_symbols (abfd, info) have already included this dynamic object in the link, just ignore it. There is no reason to include a particular dynamic object more than once. */ - sdyn = bfd_get_section_by_name (elf_hash_table (info)->dynobj, - ".dynamic"); + sdyn = bfd_get_section_by_name (hash_table->dynobj, ".dynamic"); BFD_ASSERT (sdyn != NULL); dyncon = (Elf_External_Dyn *) sdyn->contents; @@ -1459,8 +1468,7 @@ elf_link_add_object_symbols (abfd, info) { Elf_Internal_Dyn dyn; - elf_swap_dyn_in (elf_hash_table (info)->dynobj, dyncon, - &dyn); + elf_swap_dyn_in (hash_table->dynobj, dyncon, & dyn); if (dyn.d_tag == DT_NEEDED && dyn.d_un.d_val == strindex) { @@ -2115,25 +2123,28 @@ elf_link_add_object_symbols (abfd, info) bfd_size_type oldsize; bfd_size_type strindex; + if (! is_elf_hash_table (info)) + goto error_return; + /* The symbol from a DT_NEEDED object is referenced from the regular object to create a dynamic executable. We have to make sure there is a DT_NEEDED entry for it. */ dt_needed = false; - oldsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr); - strindex = _bfd_stringtab_add (elf_hash_table (info)->dynstr, + oldsize = _bfd_stringtab_size (hash_table->dynstr); + strindex = _bfd_stringtab_add (hash_table->dynstr, elf_dt_soname (abfd), true, false); if (strindex == (bfd_size_type) -1) goto error_return; if (oldsize - == _bfd_stringtab_size (elf_hash_table (info)->dynstr)) + == _bfd_stringtab_size (hash_table->dynstr)) { asection *sdyn; Elf_External_Dyn *dyncon, *dynconend; - sdyn = bfd_get_section_by_name (elf_hash_table (info)->dynobj, + sdyn = bfd_get_section_by_name (hash_table->dynobj, ".dynamic"); BFD_ASSERT (sdyn != NULL); @@ -2144,7 +2155,7 @@ elf_link_add_object_symbols (abfd, info) { Elf_Internal_Dyn dyn; - elf_swap_dyn_in (elf_hash_table (info)->dynobj, + elf_swap_dyn_in (hash_table->dynobj, dyncon, &dyn); BFD_ASSERT (dyn.d_tag != DT_NEEDED || dyn.d_un.d_val != strindex); @@ -2301,6 +2312,7 @@ elf_link_add_object_symbols (abfd, info) && ! info->relocateable && ! info->traditional_format && info->hash->creator->flavour == bfd_target_elf_flavour + && is_elf_hash_table (info) && (info->strip != strip_all && info->strip != strip_debugger)) { asection *stab, *stabstr; @@ -2316,7 +2328,7 @@ elf_link_add_object_symbols (abfd, info) secdata = elf_section_data (stab); if (! _bfd_link_section_stabs (abfd, - &elf_hash_table (info)->stab_info, + & hash_table->stab_info, stab, stabstr, &secdata->stab_info)) goto error_return; @@ -2324,33 +2336,33 @@ elf_link_add_object_symbols (abfd, info) } } - if (! info->relocateable && ! dynamic) + if (! info->relocateable && ! dynamic + && is_elf_hash_table (info)) { asection *s; for (s = abfd->sections; s != NULL; s = s->next) if ((s->flags & SEC_MERGE) - && ! _bfd_merge_section (abfd, - &elf_hash_table (info)->merge_info, - s, &elf_section_data (s)->merge_info)) + && ! _bfd_merge_section (abfd, & hash_table->merge_info, s, + & elf_section_data (s)->merge_info)) goto error_return; } - { - /* We add this to the loaded list. */ - struct elf_link_loaded_list *n, **pn; - - n = ((struct elf_link_loaded_list *) - bfd_alloc (abfd, sizeof (struct elf_link_loaded_list))); - if (n == NULL) - goto error_return; - n->next = NULL; - n->abfd = abfd; - for (pn = &elf_hash_table (info)->loaded; *pn != NULL; - pn = &(*pn)->next) - ; - *pn = n; - } + if (is_elf_hash_table (info)) + { + /* We add this to the loaded list. */ + struct elf_link_loaded_list *n, **pn; + + n = (struct elf_link_loaded_list *) + bfd_alloc (abfd, sizeof (struct elf_link_loaded_list)); + if (n == NULL) + goto error_return; + n->next = NULL; + n->abfd = abfd; + for (pn = &hash_table->loaded; *pn != NULL; pn = &(*pn)->next) + ; + *pn = n; + } return true; @@ -2381,6 +2393,9 @@ elf_link_create_dynamic_sections (abfd, struct elf_link_hash_entry *h; struct elf_backend_data *bed; + if (! is_elf_hash_table (info)) + return false; + if (elf_hash_table (info)->dynamic_sections_created) return true; @@ -2505,6 +2520,9 @@ elf_add_dynamic_entry (info, tag, val) size_t newsize; bfd_byte *newcontents; + if (! is_elf_hash_table (info)) + return false; + dynobj = elf_hash_table (info)->dynobj; s = bfd_get_section_by_name (dynobj, ".dynamic"); @@ -2541,6 +2559,9 @@ elf_link_record_local_dynamic_symbol (in unsigned long dynstr_index; char *name; + if (! is_elf_hash_table (info)) + return false; + /* See if the entry exists already. */ for (entry = elf_hash_table (info)->dynlocal; entry ; entry = entry->next) if (entry->input_bfd == input_bfd && entry->input_indx == input_indx) @@ -3057,6 +3078,9 @@ NAME(bfd_elf,size_dynamic_sections) (out if (info->hash->creator->flavour != bfd_target_elf_flavour) return true; + if (! is_elf_hash_table (info)) + return false; + /* The backend may have to create some sections regardless of whether we're dynamic or not. */ bed = get_elf_backend_data (output_bfd); @@ -3233,6 +3257,7 @@ NAME(bfd_elf,size_dynamic_sections) (out asection *s; size_t bucketcount = 0; size_t hash_entry_size; + unsigned int dtagcount; /* Set up the version definition section. */ s = bfd_get_section_by_name (dynobj, ".gnu.version_d"); @@ -3607,8 +3632,9 @@ NAME(bfd_elf,size_dynamic_sections) (out BFD_ASSERT (s != NULL); s->_raw_size = _bfd_stringtab_size (elf_hash_table (info)->dynstr); - if (! elf_add_dynamic_entry (info, DT_NULL, 0)) - return false; + for (dtagcount = 0; dtagcount <= info->spare_dynamic_tags; ++dtagcount) + if (! elf_add_dynamic_entry (info, DT_NULL, 0)) + return false; } return true; @@ -3702,12 +3728,14 @@ elf_fix_symbol_flags (h, eif) backend specifically; we can't just clear PLT-related data here. */ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0 && eif->info->shared + && is_elf_hash_table (eif->info) && (eif->info->symbolic || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) { struct elf_backend_data *bed; + bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); if (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) @@ -3762,6 +3790,9 @@ elf_adjust_dynamic_symbol (h, data) if (h->root.type == bfd_link_hash_indirect) return true; + if (! is_elf_hash_table (eif->info)) + return false; + /* Fix the symbol flags. */ if (! elf_fix_symbol_flags (h, eif)) return false; @@ -4438,6 +4469,211 @@ elf_link_adjust_relocs (abfd, rel_hdr, c free (irela); } +struct elf_link_sort_rela { + bfd_vma offset; + enum elf_reloc_type_class type; + union { + Elf_Internal_Rel rel; + Elf_Internal_Rela rela; + } u; +}; + +static int +elf_link_sort_cmp1 (A, B) + const PTR A; + const PTR B; +{ + struct elf_link_sort_rela *a = (struct elf_link_sort_rela *)A; + struct elf_link_sort_rela *b = (struct elf_link_sort_rela *)B; + int relativea, relativeb; + + relativea = a->type == reloc_class_relative; + relativeb = b->type == reloc_class_relative; + + if (relativea < relativeb) + return 1; + if (relativea > relativeb) + return -1; + if (ELF_R_SYM (a->u.rel.r_info) < ELF_R_SYM (b->u.rel.r_info)) + return -1; + if (ELF_R_SYM (a->u.rel.r_info) > ELF_R_SYM (b->u.rel.r_info)) + return 1; + if (a->u.rel.r_offset < b->u.rel.r_offset) + return -1; + if (a->u.rel.r_offset > b->u.rel.r_offset) + return 1; + return 0; +} + +static int +elf_link_sort_cmp2 (A, B) + const PTR A; + const PTR B; +{ + struct elf_link_sort_rela *a = (struct elf_link_sort_rela *)A; + struct elf_link_sort_rela *b = (struct elf_link_sort_rela *)B; + int copya, copyb; + + if (a->offset < b->offset) + return -1; + if (a->offset > b->offset) + return 1; + copya = a->type == reloc_class_copy; + copyb = b->type == reloc_class_copy; + if (copya < copyb) + return -1; + if (copya > copyb) + return 1; + if (a->u.rel.r_offset < b->u.rel.r_offset) + return -1; + if (a->u.rel.r_offset > b->u.rel.r_offset) + return 1; + return 0; +} + +static size_t +elf_link_sort_relocs (abfd, info, psec) + bfd *abfd; + struct bfd_link_info *info; + asection **psec; +{ + bfd *dynobj = elf_hash_table (info)->dynobj; + asection *reldyn, *o; + boolean rel = false; + size_t count, size, i, j, ret; + struct elf_link_sort_rela *rela; + struct elf_backend_data *bed = get_elf_backend_data (abfd); + + reldyn = bfd_get_section_by_name (abfd, ".rela.dyn"); + if (reldyn == NULL || reldyn->_raw_size == 0) + { + reldyn = bfd_get_section_by_name (abfd, ".rel.dyn"); + if (reldyn == NULL || reldyn->_raw_size == 0) + return 0; + rel = true; + count = reldyn->_raw_size / sizeof (Elf_External_Rel); + } + else + count = reldyn->_raw_size / sizeof (Elf_External_Rela); + + size = 0; + for (o = dynobj->sections; o != NULL; o = o->next) + if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)) + == (SEC_HAS_CONTENTS|SEC_LINKER_CREATED) + && o->output_section == reldyn) + size += o->_raw_size; + + if (size != reldyn->_raw_size) + return 0; + + rela = (struct elf_link_sort_rela *) calloc (sizeof (*rela), count); + if (rela == NULL) + { + (*info->callbacks->warning) + (info, _("Not enough memory to sort relocations"), 0, abfd, 0, 0); + return 0; + } + + for (o = dynobj->sections; o != NULL; o = o->next) + if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)) + == (SEC_HAS_CONTENTS|SEC_LINKER_CREATED) + && o->output_section == reldyn) + { + if (rel) + { + Elf_External_Rel *erel, *erelend; + struct elf_link_sort_rela *s; + + erel = (Elf_External_Rel *) o->contents; + erelend = (Elf_External_Rel *) ((PTR) o->contents + o->_raw_size); + s = rela + o->output_offset / sizeof (Elf_External_Rel); + for (; erel < erelend; erel++, s++) + { + if (bed->s->swap_reloc_in) + (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, &s->u.rel); + else + elf_swap_reloc_in (abfd, erel, &s->u.rel); + + s->type = (*bed->elf_backend_reloc_type_class) + (ELF_R_TYPE (s->u.rel.r_info)); + } + } + else + { + Elf_External_Rela *erela, *erelaend; + struct elf_link_sort_rela *s; + + erela = (Elf_External_Rela *) o->contents; + erelaend = (Elf_External_Rela *) ((PTR) o->contents + o->_raw_size); + s = rela + o->output_offset / sizeof (Elf_External_Rela); + for (; erela < erelaend; erela++, s++) + { + if (bed->s->swap_reloca_in) + (*bed->s->swap_reloca_in) (dynobj, (bfd_byte *) erela, &s->u.rela); + else + elf_swap_reloca_in (dynobj, erela, &s->u.rela); + + s->type = (*bed->elf_backend_reloc_type_class) + (ELF_R_TYPE (s->u.rel.r_info)); + } + } + } + + qsort (rela, count, sizeof (*rela), elf_link_sort_cmp1); + for (ret = 0; ret < count && rela[ret].type == reloc_class_relative; ret++) + ; + for (i = ret, j = ret; i < count; i++) + { + if (ELF_R_SYM (rela[i].u.rel.r_info) != ELF_R_SYM (rela[j].u.rel.r_info)) + j = i; + rela[i].offset = rela[j].u.rel.r_offset; + } + qsort (rela + ret, count - ret, sizeof (*rela), elf_link_sort_cmp2); + + for (o = dynobj->sections; o != NULL; o = o->next) + if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)) + == (SEC_HAS_CONTENTS|SEC_LINKER_CREATED) + && o->output_section == reldyn) + { + if (rel) + { + Elf_External_Rel *erel, *erelend; + struct elf_link_sort_rela *s; + + erel = (Elf_External_Rel *) o->contents; + erelend = (Elf_External_Rel *) ((PTR) o->contents + o->_raw_size); + s = rela + o->output_offset / sizeof (Elf_External_Rel); + for (; erel < erelend; erel++, s++) + { + if (bed->s->swap_reloc_out) + (*bed->s->swap_reloc_out) (abfd, &s->u.rel, (bfd_byte *) erel); + else + elf_swap_reloc_out (abfd, &s->u.rel, erel); + } + } + else + { + Elf_External_Rela *erela, *erelaend; + struct elf_link_sort_rela *s; + + erela = (Elf_External_Rela *) o->contents; + erelaend = (Elf_External_Rela *) ((PTR) o->contents + o->_raw_size); + s = rela + o->output_offset / sizeof (Elf_External_Rela); + for (; erela < erelaend; erela++, s++) + { + if (bed->s->swap_reloca_out) + (*bed->s->swap_reloca_out) (dynobj, &s->u.rela, (bfd_byte *) erela); + else + elf_swap_reloca_out (dynobj, &s->u.rela, erela); + } + } + } + + free (rela); + *psec = reldyn; + return ret; +} + /* Do the final step of an ELF link. */ boolean @@ -4464,6 +4700,11 @@ elf_bfd_final_link (abfd, info) struct elf_backend_data *bed = get_elf_backend_data (abfd); struct elf_outext_info eoinfo; boolean merged; + size_t relativecount = 0; + asection *reldyn = 0; + + if (! is_elf_hash_table (info)) + return false; if (info->shared) abfd->flags |= DYNAMIC; @@ -5034,6 +5275,9 @@ elf_bfd_final_link (abfd, info) o->reloc_count = 0; } + if (dynamic && info->combreloc && dynobj != NULL) + relativecount = elf_link_sort_relocs (abfd, info, &reldyn); + /* If we are linking against a dynamic object, or generating a shared library, finish up the dynamic linking information. */ if (dynamic) @@ -5058,6 +5302,23 @@ elf_bfd_final_link (abfd, info) { default: break; + case DT_NULL: + if (relativecount > 0 && dyncon + 1 < dynconend) + { + switch (elf_section_data (reldyn)->this_hdr.sh_type) + { + case SHT_REL: dyn.d_tag = DT_RELCOUNT; break; + case SHT_RELA: dyn.d_tag = DT_RELACOUNT; break; + default: break; + } + if (dyn.d_tag != DT_NULL) + { + dyn.d_un.d_val = relativecount; + elf_swap_dyn_out (dynobj, &dyn, dyncon); + relativecount = 0; + } + } + break; case DT_INIT: name = info->init_function; goto get_sym; diff -uprN binutils-2.11.90.0.27/bfd/elfxx-ia64.c binutils-2.11.90.0.29/bfd/elfxx-ia64.c --- binutils-2.11.90.0.27/bfd/elfxx-ia64.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.29/bfd/elfxx-ia64.c Mon Aug 27 11:44:51 2001 @@ -138,6 +138,7 @@ struct elfNN_ia64_link_hash_table asection *rel_pltoff_sec; /* dynamic relocation section for same */ bfd_size_type minplt_entries; /* number of minplt entries */ + unsigned reltext : 1; /* are there relocs against readonly sections? */ struct elfNN_ia64_local_hash_table loc_hash_table; }; @@ -161,6 +162,8 @@ static boolean is_unwind_section_name PARAMS ((const char *)); static boolean elfNN_ia64_section_from_shdr PARAMS ((bfd *, ElfNN_Internal_Shdr *, char *)); +static boolean elfNN_ia64_section_flags + PARAMS ((flagword *, ElfNN_Internal_Shdr *)); static boolean elfNN_ia64_fake_sections PARAMS ((bfd *abfd, ElfNN_Internal_Shdr *hdr, asection *sec)); static void elfNN_ia64_final_write_processing @@ -179,6 +182,8 @@ static boolean elfNN_ia64_aix_link_add_s PARAMS ((bfd *abfd, struct bfd_link_info *info)); static int elfNN_ia64_additional_program_headers PARAMS ((bfd *abfd)); +static boolean elfNN_ia64_modify_segment_map + PARAMS ((bfd *)); static boolean elfNN_ia64_is_local_label_name PARAMS ((bfd *abfd, const char *name)); static boolean elfNN_ia64_dynamic_symbol_p @@ -192,11 +197,19 @@ static struct bfd_hash_entry *elfNN_ia64 static struct bfd_hash_entry *elfNN_ia64_new_elf_hash_entry PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, const char *string)); +static void elfNN_ia64_hash_copy_indirect + PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); +static void elfNN_ia64_hash_hide_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static struct bfd_link_hash_table *elfNN_ia64_hash_table_create PARAMS ((bfd *abfd)); static struct elfNN_ia64_local_hash_entry *elfNN_ia64_local_hash_lookup PARAMS ((struct elfNN_ia64_local_hash_table *table, const char *string, boolean create, boolean copy)); +static boolean elfNN_ia64_global_dyn_sym_thunk + PARAMS ((struct bfd_hash_entry *, PTR)); +static boolean elfNN_ia64_local_dyn_sym_thunk + PARAMS ((struct bfd_hash_entry *, PTR)); static void elfNN_ia64_dyn_sym_traverse PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info, boolean (*func) (struct elfNN_ia64_dyn_sym_info *, PTR), @@ -265,6 +278,8 @@ static bfd_vma set_pltoff_entry PARAMS ((bfd *abfd, struct bfd_link_info *info, struct elfNN_ia64_dyn_sym_info *dyn_i, bfd_vma value, boolean)); +static int elfNN_ia64_unwind_entry_compare + PARAMS ((const PTR, const PTR)); static boolean elfNN_ia64_final_link PARAMS ((bfd *abfd, struct bfd_link_info *info)); static boolean elfNN_ia64_relocate_section @@ -285,6 +300,8 @@ static boolean elfNN_ia64_merge_private_ PARAMS ((bfd *ibfd, bfd *obfd)); static boolean elfNN_ia64_print_private_bfd_data PARAMS ((bfd *abfd, PTR ptr)); +static enum elf_reloc_type_class elfNN_ia64_reloc_type_class + PARAMS ((int)); /* ia64-specific relocation */ @@ -1116,7 +1133,7 @@ elfNN_ia64_add_symbol_hook (abfd, info, { if (sym->st_shndx == SHN_COMMON && !info->relocateable - && sym->st_size <= (unsigned) bfd_get_gp_size (abfd)) + && sym->st_size <= elf_gp_size (abfd)) { /* Common symbols less than or equal to -G nn bytes are automatically put into .sbss. */ @@ -1557,7 +1574,7 @@ elfNN_ia64_hash_table_create (abfd) { struct elfNN_ia64_link_hash_table *ret; - ret = bfd_alloc (abfd, sizeof (*ret)); + ret = bfd_zalloc (abfd, sizeof (*ret)); if (!ret) return 0; if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, @@ -1723,7 +1740,8 @@ get_dyn_sym_info (ia64_info, h, abfd, re len += 10; /* %p slop */ addr_name = alloca (len); - sprintf (addr_name, "%p:%lx", (void *) abfd, ELFNN_R_SYM (rel->r_info)); + sprintf (addr_name, "%p:%lx", + (void *) abfd, (unsigned long) ELFNN_R_SYM (rel->r_info)); /* Collect the canonical entry data for this address. */ loc_h = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table, @@ -1901,6 +1919,9 @@ get_reloc_section (abfd, ia64_info, sec, return NULL; } + if (sec->flags & SEC_READONLY) + ia64_info->reltext = 1; + return srel; } @@ -2520,7 +2541,6 @@ elfNN_ia64_size_dynamic_sections (output struct elfNN_ia64_link_hash_table *ia64_info; asection *sec; bfd *dynobj; - boolean reltext = false; boolean relplt = false; dynobj = elf_hash_table(info)->dynobj; @@ -2677,24 +2697,6 @@ elfNN_ia64_size_dynamic_sections (output { if (!strip) { - const char *outname; - asection *target; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. */ - outname = bfd_get_section_name (output_bfd, - sec->output_section); - if (outname[4] == 'a') - outname += 5; - else - outname += 4; - - target = bfd_get_section_by_name (output_bfd, outname); - if (target != NULL - && (target->flags & SEC_READONLY) != 0 - && (target->flags & SEC_ALLOC) != 0) - reltext = true; - /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ sec->reloc_count = 0; @@ -2748,7 +2750,7 @@ elfNN_ia64_size_dynamic_sections (output sizeof (ElfNN_External_Rela))) return false; - if (reltext) + if (ia64_info->reltext) { if (! bfd_elfNN_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; @@ -3188,8 +3190,8 @@ static bfd *elfNN_ia64_unwind_entry_comp static int elfNN_ia64_unwind_entry_compare (a, b) - PTR a; - PTR b; + const PTR a; + const PTR b; { bfd_vma av, bv; @@ -4309,6 +4311,27 @@ elfNN_ia64_print_private_bfd_data (abfd, _bfd_elf_print_private_bfd_data (abfd, ptr); return true; } + +static enum elf_reloc_type_class +elfNN_ia64_reloc_type_class (type) + int type; +{ + switch (type) + { + case R_IA64_REL32MSB: + case R_IA64_REL32LSB: + case R_IA64_REL64MSB: + case R_IA64_REL64LSB: + return reloc_class_relative; + case R_IA64_IPLTMSB: + case R_IA64_IPLTLSB: + return reloc_class_plt; + case R_IA64_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} #define TARGET_LITTLE_SYM bfd_elfNN_ia64_little_vec #define TARGET_LITTLE_NAME "elfNN-ia64-little" @@ -4385,6 +4408,7 @@ elfNN_ia64_print_private_bfd_data (abfd, #define elf_backend_want_dynbss 0 #define elf_backend_copy_indirect_symbol elfNN_ia64_hash_copy_indirect #define elf_backend_hide_symbol elfNN_ia64_hash_hide_symbol +#define elf_backend_reloc_type_class elfNN_ia64_reloc_type_class #include "elfNN-target.h" diff -uprN binutils-2.11.90.0.27/bfd/elfxx-target.h binutils-2.11.90.0.29/bfd/elfxx-target.h --- binutils-2.11.90.0.27/bfd/elfxx-target.h Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/elfxx-target.h Mon Aug 27 11:44:51 2001 @@ -167,7 +167,11 @@ Foundation, Inc., 59 Temple Place - Suit #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create #endif #else /* ! defined (elf_backend_relocate_section) */ -/* If no backend relocate_section routine, use the generic linker. */ +/* If no backend relocate_section routine, use the generic linker. + Note - this will prevent the port from being able to use some of + the other features of the ELF linker, because the generic hash structure + does not have the fields needed by the ELF linker. In particular it + means that linking directly to S-records will not work. */ #ifndef bfd_elfNN_bfd_link_hash_table_create #define bfd_elfNN_bfd_link_hash_table_create \ _bfd_generic_link_hash_table_create @@ -338,6 +342,15 @@ Foundation, Inc., 59 Temple Place - Suit #ifndef elf_backend_grok_psinfo #define elf_backend_grok_psinfo NULL #endif +#ifndef elf_backend_sprintf_vma +#define elf_backend_sprintf_vma _bfd_elf_sprintf_vma +#endif +#ifndef elf_backend_fprintf_vma +#define elf_backend_fprintf_vma _bfd_elf_fprintf_vma +#endif +#ifndef elf_backend_reloc_type_class +#define elf_backend_reloc_type_class _bfd_elf_reloc_type_class +#endif /* Previously, backends could only use SHT_REL or SHT_RELA relocation sections, but not both. They defined USE_REL to indicate SHT_REL @@ -423,6 +436,9 @@ static CONST struct elf_backend_data elf elf_backend_count_relocs, elf_backend_grok_prstatus, elf_backend_grok_psinfo, + elf_backend_sprintf_vma, + elf_backend_fprintf_vma, + elf_backend_reloc_type_class, elf_backend_ecoff_debug_swap, ELF_MACHINE_ALT1, ELF_MACHINE_ALT2, diff -uprN binutils-2.11.90.0.27/bfd/format.c binutils-2.11.90.0.29/bfd/format.c --- binutils-2.11.90.0.27/bfd/format.c Fri Mar 9 11:15:59 2001 +++ binutils-2.11.90.0.29/bfd/format.c Wed Aug 22 08:52:10 2001 @@ -119,38 +119,39 @@ bfd_check_format_matches (abfd, format, char ***matching; { extern const bfd_target binary_vec; - const bfd_target * const *target, *save_targ, *right_targ; + const bfd_target * const *target, *save_targ, *right_targ, *ar_right_targ; char **matching_vector = NULL; int match_count; + int ar_match_index; - if (!bfd_read_p (abfd) || - ((int)(abfd->format) < (int)bfd_unknown) || - ((int)(abfd->format) >= (int)bfd_type_end)) + if (!bfd_read_p (abfd) + || (unsigned int) abfd->format >= (unsigned int) bfd_type_end) { bfd_set_error (bfd_error_invalid_operation); return false; } if (abfd->format != bfd_unknown) - return (abfd->format == format)? true: false; + return abfd->format == format; /* Since the target type was defaulted, check them all in the hope that one will be uniquely recognized. */ save_targ = abfd->xvec; match_count = 0; + ar_match_index = _bfd_target_vector_entries; if (matching) { + *matching = NULL; matching_vector = - (char **) bfd_malloc (sizeof (char *) * - (_bfd_target_vector_entries + 1)); + (char **) bfd_malloc (sizeof (char *) + * 2 * _bfd_target_vector_entries); if (!matching_vector) return false; - matching_vector[0] = NULL; - *matching = matching_vector; } right_targ = 0; + ar_right_targ = 0; /* Presume the answer is yes. */ abfd->format = format; @@ -202,6 +203,7 @@ bfd_check_format_matches (abfd, format, for (target = bfd_target_vector; *target != NULL; target++) { const bfd_target *temp; + bfd_error_type err; if (*target == &binary_vec) continue; @@ -223,27 +225,20 @@ bfd_check_format_matches (abfd, format, { /* This format checks out as ok! */ right_targ = temp; - if (matching) - { - matching_vector[match_count] = temp->name; - matching_vector[match_count + 1] = NULL; - } - - match_count++; - /* If this is the default target, accept it, even if other targets might match. People who want those other targets have to set the GNUTARGET variable. */ if (temp == bfd_default_vector[0]) { - if (matching) - { - matching_vector[0] = temp->name; - matching_vector[1] = NULL; - } match_count = 1; break; } + + if (matching) + matching_vector[match_count] = temp->name; + + match_count++; + #ifdef GNU960 /* Big- and little-endian b.out archives look the same, but it doesn't matter: there is no difference in their headers, and @@ -254,19 +249,50 @@ bfd_check_format_matches (abfd, format, break; #endif } - else if (bfd_get_error () != bfd_error_wrong_format) + else if ((err = bfd_get_error ()) == bfd_error_wrong_object_format + || err == bfd_error_file_ambiguously_recognized) + { + /* An archive with objects of the wrong type, or an + ambiguous match. We want this target to match if we get + no better matches. */ + if (ar_right_targ != bfd_default_vector[0]) + ar_right_targ = *target; + if (matching) + matching_vector[ar_match_index] = (*target)->name; + ar_match_index++; + } + else if (err != bfd_error_wrong_format) { abfd->xvec = save_targ; abfd->format = bfd_unknown; - if (matching && bfd_get_error () - != bfd_error_file_ambiguously_recognized) + if (matching) free (matching_vector); return false; } } + if (match_count == 0) + { + /* Try partial matches. */ + right_targ = ar_right_targ; + if (right_targ == bfd_default_vector[0]) + { + match_count = 1; + } + else + { + match_count = ar_match_index - _bfd_target_vector_entries; + if (matching && match_count > 1) + { + memcpy (matching_vector, + matching_vector + _bfd_target_vector_entries, + sizeof (char *) * match_count); + } + } + } + if (match_count == 1) { abfd->xvec = right_targ; /* Change BFD's target permanently. */ @@ -288,7 +314,15 @@ bfd_check_format_matches (abfd, format, free (matching_vector); } else - bfd_set_error (bfd_error_file_ambiguously_recognized); + { + bfd_set_error (bfd_error_file_ambiguously_recognized); + + if (matching) + { + *matching = matching_vector; + matching_vector[match_count] = NULL; + } + } return false; } @@ -312,9 +346,8 @@ bfd_set_format (abfd, format) bfd *abfd; bfd_format format; { - if (bfd_read_p (abfd) || - ((int)abfd->format < (int)bfd_unknown) || - ((int)abfd->format >= (int)bfd_type_end)) + if (bfd_read_p (abfd) + || (unsigned int) abfd->format >= (unsigned int) bfd_type_end) { bfd_set_error (bfd_error_invalid_operation); return false; @@ -340,7 +373,7 @@ FUNCTION bfd_format_string SYNOPSIS - CONST char *bfd_format_string(bfd_format format); + const char *bfd_format_string(bfd_format format); DESCRIPTION Return a pointer to a const string @@ -348,7 +381,7 @@ DESCRIPTION depending upon the value of @var{format}. */ -CONST char * +const char * bfd_format_string (format) bfd_format format; { diff -uprN binutils-2.11.90.0.27/bfd/hp300hpux.c binutils-2.11.90.0.29/bfd/hp300hpux.c --- binutils-2.11.90.0.27/bfd/hp300hpux.c Fri Mar 9 11:16:00 2001 +++ binutils-2.11.90.0.29/bfd/hp300hpux.c Mon Aug 27 11:44:51 2001 @@ -20,7 +20,6 @@ along with this program; if not, write t Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* - hpux native ------------> | | | hp300hpux bfd | ----------> hpux w/gnu ext hpux w/gnu extension ----> | | @@ -191,6 +190,17 @@ Foundation, Inc., 59 Temple Place - Suit #include "aoutx.h" +static const bfd_target * MY (callback) PARAMS ((bfd *)); +static boolean MY (write_object_contents) PARAMS ((bfd *)); +static void convert_sym_type PARAMS ((struct external_nlist *, aout_symbol_type *, bfd *)); + +boolean MY (slurp_symbol_table) PARAMS ((bfd *)); +void MY (swap_std_reloc_in) PARAMS ((bfd *, struct hp300hpux_reloc *, arelent *, asymbol **, bfd_size_type)); +boolean MY (slurp_reloc_table) PARAMS ((bfd *, sec_ptr, asymbol **)); +long MY (get_symtab) PARAMS ((bfd *, asymbol **)); +long MY (get_symtab_upper_bound) PARAMS ((bfd *)); +long MY (canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); + /* Since the hpux symbol table has nlist elements interspersed with strings and we need to insert som strings for secondary symbols, we give ourselves a little extra padding up front to account for diff -uprN binutils-2.11.90.0.27/bfd/i386aout.c binutils-2.11.90.0.29/bfd/i386aout.c --- binutils-2.11.90.0.27/bfd/i386aout.c Fri Mar 9 11:16:00 2001 +++ binutils-2.11.90.0.29/bfd/i386aout.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for i386 a.out binaries. - Copyright 1990, 1991, 1992, 1994, 1996, 1997 + Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -51,6 +51,9 @@ Foundation, Inc., 59 Temple Place - Suit #include "aout/aout64.h" #include "libaout.h" +static boolean i386aout_write_object_contents PARAMS ((bfd *)); +static boolean MY (set_sizes) PARAMS ((bfd *)); + /* Set the machine type correctly. */ static boolean @@ -71,7 +74,6 @@ i386aout_write_object_contents (abfd) #define MY_write_object_contents i386aout_write_object_contents -static boolean MY(set_sizes)(); #define MY_backend_data &MY(backend_data) static CONST struct aout_backend_data MY(backend_data) = { 0, /* zmagic contiguous */ diff -uprN binutils-2.11.90.0.27/bfd/i386lynx.c binutils-2.11.90.0.29/bfd/i386lynx.c --- binutils-2.11.90.0.27/bfd/i386lynx.c Fri Mar 9 11:16:00 2001 +++ binutils-2.11.90.0.29/bfd/i386lynx.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for i386 a.out binaries under LynxOS. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -83,6 +83,14 @@ Foundation, Inc., 59 Temple Place - Suit #include "libaout.h" #include "aout/aout64.h" +void NAME (lynx,swap_std_reloc_out) PARAMS ((bfd *, arelent *, struct reloc_std_external *)); +void NAME (lynx,swap_ext_reloc_out) PARAMS ((bfd *, arelent *, struct reloc_ext_external *)); +void NAME (lynx,swap_ext_reloc_in) PARAMS ((bfd *, struct reloc_ext_external *, arelent *, asymbol **, bfd_size_type)); +void NAME (lynx,swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *, arelent *, asymbol **, bfd_size_type)); +boolean NAME (lynx,slurp_reloc_table) PARAMS ((bfd *, sec_ptr, asymbol **)); +boolean NAME (lynx,squirt_out_relocs) PARAMS ((bfd *, asection *)); +long NAME (lynx,canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); + #ifdef LYNX_CORE char *lynx_core_file_failing_command (); diff -uprN binutils-2.11.90.0.27/bfd/i386mach3.c binutils-2.11.90.0.29/bfd/i386mach3.c --- binutils-2.11.90.0.27/bfd/i386mach3.c Fri Mar 9 11:16:00 2001 +++ binutils-2.11.90.0.29/bfd/i386mach3.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for i386 a.out binaries. - Copyright 1990, 1991, 1993, 1994, 1995, 1997 + Copyright 1990, 1991, 1993, 1994, 1995, 1997, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -46,7 +46,7 @@ Foundation, Inc., 59 Temple Place - Suit #define MY(OP) CAT(i386mach3_,OP) #define TARGETNAME "a.out-mach3" -static boolean MY(set_sizes)(); +static boolean MY (set_sizes) PARAMS ((bfd *)); #define MY_backend_data &MY(backend_data) static CONST struct aout_backend_data MY(backend_data) = { 0, /* zmagic contiguous */ diff -uprN binutils-2.11.90.0.27/bfd/i386msdos.c binutils-2.11.90.0.29/bfd/i386msdos.c --- binutils-2.11.90.0.27/bfd/i386msdos.c Sat May 12 00:05:31 2001 +++ binutils-2.11.90.0.29/bfd/i386msdos.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for MS-DOS executables. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001 Free Software Foundation, Inc. Written by Bryan Ford of the University of Utah. @@ -31,23 +31,23 @@ #if 0 struct exe_header { - unsigned short magic; - unsigned short bytes_in_last_page; - unsigned short npages; /* number of 512-byte "pages" including this header */ - unsigned short nrelocs; - unsigned short header_paras; /* number of 16-byte paragraphs in header */ - unsigned short reserved; - unsigned short load_switch; - unsigned short ss_ofs; - unsigned short sp; - unsigned short checksum; - unsigned short ip; - unsigned short cs_ofs; - unsigned short reloc_ofs; - unsigned short reserved2; - unsigned short something1; - unsigned short something2; - unsigned short something3; + unsigned short magic; + unsigned short bytes_in_last_page; + unsigned short npages; /* number of 512-byte "pages" including this header */ + unsigned short nrelocs; + unsigned short header_paras; /* number of 16-byte paragraphs in header */ + unsigned short reserved; + unsigned short load_switch; + unsigned short ss_ofs; + unsigned short sp; + unsigned short checksum; + unsigned short ip; + unsigned short cs_ofs; + unsigned short reloc_ofs; + unsigned short reserved2; + unsigned short something1; + unsigned short something2; + unsigned short something3; }; #endif @@ -56,6 +56,9 @@ struct exe_header #define EXE_LOAD_LOW 0xffff #define EXE_PAGE_SIZE 512 +static int msdos_sizeof_headers PARAMS ((bfd *, boolean)); +static boolean msdos_write_object_contents PARAMS ((bfd *)); +static boolean msdos_set_section_contents PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); static int msdos_sizeof_headers (abfd, exec) @@ -103,7 +106,7 @@ msdos_write_object_contents (abfd) return false; } - /* constants */ + /* Constants. */ bfd_h_put_16(abfd, EXE_MAGIC, &hdr[0]); bfd_h_put_16(abfd, EXE_PAGE_SIZE / 16, &hdr[8]); bfd_h_put_16(abfd, EXE_LOAD_LOW, &hdr[12]); @@ -112,10 +115,10 @@ msdos_write_object_contents (abfd) bfd_h_put_16(abfd, 0x30fb, &hdr[30]); /* XXX??? */ bfd_h_put_16(abfd, 0x726a, &hdr[32]); /* XXX??? */ - /* bytes in last page (0 = full page) */ + /* Bytes in last page (0 = full page). */ bfd_h_put_16(abfd, outfile_size & (EXE_PAGE_SIZE - 1), &hdr[2]); - /* number of pages */ + /* Number of pages. */ bfd_h_put_16(abfd, (outfile_size + EXE_PAGE_SIZE - 1) / EXE_PAGE_SIZE, &hdr[4]); @@ -193,56 +196,56 @@ msdos_set_section_contents (abfd, sectio #define msdos_32_bfd_link_split_section _bfd_generic_link_split_section const bfd_target i386msdos_vec = -{ - "msdos", /* name */ - bfd_target_msdos_flavour, - BFD_ENDIAN_LITTLE, /* target byte order */ - BFD_ENDIAN_LITTLE, /* target headers byte order */ - (EXEC_P), /* object flags */ - (SEC_CODE | SEC_DATA | SEC_HAS_CONTENTS - | SEC_ALLOC | SEC_LOAD), /* section flags */ - 0, /* leading underscore */ - ' ', /* ar_pad_char */ - 16, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - { - _bfd_dummy_target, - _bfd_dummy_target, /* bfd_check_format */ - _bfd_dummy_target, - _bfd_dummy_target, - }, - { - bfd_false, - msdos_mkobject, - _bfd_generic_mkarchive, - bfd_false, - }, - { /* bfd_write_contents */ - bfd_false, - msdos_write_object_contents, - _bfd_write_archive_contents, - bfd_false, - }, - - BFD_JUMP_TABLE_GENERIC (msdos), - BFD_JUMP_TABLE_COPY (_bfd_generic), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), - BFD_JUMP_TABLE_SYMBOLS (msdos), - BFD_JUMP_TABLE_RELOCS (msdos), - BFD_JUMP_TABLE_WRITE (msdos), - BFD_JUMP_TABLE_LINK (msdos), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + "msdos", /* name */ + bfd_target_msdos_flavour, + BFD_ENDIAN_LITTLE, /* target byte order */ + BFD_ENDIAN_LITTLE, /* target headers byte order */ + (EXEC_P), /* object flags */ + (SEC_CODE | SEC_DATA | SEC_HAS_CONTENTS + | SEC_ALLOC | SEC_LOAD), /* section flags */ + 0, /* leading underscore */ + ' ', /* ar_pad_char */ + 16, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - NULL, + { + _bfd_dummy_target, + _bfd_dummy_target, /* bfd_check_format */ + _bfd_dummy_target, + _bfd_dummy_target, + }, + { + bfd_false, + msdos_mkobject, + _bfd_generic_mkarchive, + bfd_false, + }, + { /* bfd_write_contents */ + bfd_false, + msdos_write_object_contents, + _bfd_write_archive_contents, + bfd_false, + }, + + BFD_JUMP_TABLE_GENERIC (msdos), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (msdos), + BFD_JUMP_TABLE_RELOCS (msdos), + BFD_JUMP_TABLE_WRITE (msdos), + BFD_JUMP_TABLE_LINK (msdos), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + NULL, - (PTR) 0 -}; + (PTR) 0 + }; diff -uprN binutils-2.11.90.0.27/bfd/i386os9k.c binutils-2.11.90.0.29/bfd/i386os9k.c --- binutils-2.11.90.0.27/bfd/i386os9k.c Sat May 12 00:05:31 2001 +++ binutils-2.11.90.0.29/bfd/i386os9k.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for os9000 i386 binaries. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -27,7 +27,10 @@ Foundation, Inc., 59 Temple Place - Suit #include "libaout.h" /* BFD a.out internal data structures */ #include "os9k.h" -static const bfd_target *os9k_callback PARAMS ((bfd *)); +static const bfd_target * os9k_callback PARAMS ((bfd *)); +static const bfd_target * os9k_object_p PARAMS ((bfd *)); +static int os9k_sizeof_headers PARAMS ((bfd *, boolean)); +boolean os9k_swap_exec_header_in PARAMS ((bfd *, mh_com *, struct internal_exec *)); /* Swaps the information in an executable header taken from a raw byte stream memory image, into the internal exec_header structure. */ @@ -147,14 +150,14 @@ os9k_callback (abfd) struct internal_exec *execp = exec_hdr (abfd); unsigned long bss_start; - /* Architecture and machine type */ + /* Architecture and machine type. */ bfd_set_arch_mach (abfd, bfd_arch_i386, 0); /* The positions of the string table and symbol table. */ obj_str_filepos (abfd) = 0; obj_sym_filepos (abfd) = 0; - /* The alignments of the sections */ + /* The alignments of the sections. */ obj_textsec (abfd)->alignment_power = execp->a_talign; obj_datasec (abfd)->alignment_power = execp->a_dalign; obj_bsssec (abfd)->alignment_power = execp->a_balign; @@ -163,23 +166,22 @@ os9k_callback (abfd) obj_textsec (abfd)->vma = execp->a_tload; obj_datasec (abfd)->vma = execp->a_dload; - /* And reload the sizes, since the aout module zaps them */ + /* And reload the sizes, since the aout module zaps them. */ obj_textsec (abfd)->_raw_size = execp->a_text; - bss_start = execp->a_dload + execp->a_data; /* BSS = end of data section */ + bss_start = execp->a_dload + execp->a_data; /* BSS = end of data section. */ obj_bsssec (abfd)->vma = align_power (bss_start, execp->a_balign); - /* The file positions of the sections */ + /* The file positions of the sections. */ obj_textsec (abfd)->filepos = execp->a_entry; obj_datasec (abfd)->filepos = execp->a_dload; /* The file positions of the relocation info *** obj_textsec (abfd)->rel_filepos = N_TROFF(*execp); - obj_datasec (abfd)->rel_filepos = N_DROFF(*execp); - */ + obj_datasec (abfd)->rel_filepos = N_DROFF(*execp); */ - adata (abfd).page_size = 1; /* Not applicable. */ - adata (abfd).segment_size = 1;/* Not applicable. */ + adata (abfd).page_size = 1; /* Not applicable. */ + adata (abfd).segment_size = 1;/* Not applicable. */ adata (abfd).exec_bytes_size = MHCOM_BYTES_SIZE; return abfd->xvec; @@ -247,7 +249,7 @@ os9k_write_object_contents (abfd) != EXEC_BYTES_SIZE)) return false; - /* Now write out reloc info, followed by syms and strings */ + /* Now write out reloc info, followed by syms and strings. */ if (bfd_get_symcount (abfd) != 0) { if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*exec_hdr (abfd))), SEEK_SET) @@ -292,14 +294,13 @@ os9k_set_section_contents (abfd, section + obj_textsec (abfd)->_raw_size; } - /* regardless, once we know what we're doing, we might as well get going */ + /* Regardless, once we know what we're doing, we might as well get going. */ if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0) return false; if (count != 0) - { - return (bfd_write ((PTR) location, 1, count, abfd) == count) ? true : false; - } + return (bfd_write ((PTR) location, 1, count, abfd) == count) ? true : false; + return true; } #endif /* 0 */ @@ -312,8 +313,7 @@ os9k_sizeof_headers (ignore_abfd, ignore return sizeof (struct internal_exec); } - -/***********************************************************************/ + #define aout_32_close_and_cleanup aout_32_bfd_free_cached_info @@ -335,41 +335,41 @@ os9k_sizeof_headers (ignore_abfd, ignore #define os9k_bfd_link_split_section _bfd_generic_link_split_section const bfd_target i386os9k_vec = -{ - "i386os9k", /* name */ - bfd_target_os9k_flavour, - BFD_ENDIAN_LITTLE, /* data byte order is little */ - BFD_ENDIAN_LITTLE, /* hdr byte order is little */ - (HAS_RELOC | EXEC_P | WP_TEXT), /* object flags */ - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD), /* section flags */ - 0, /* symbol leading char */ - ' ', /* ar_pad_char */ - 16, /* ar_max_namelen */ - - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, os9k_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, bfd_false, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, bfd_false, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (aout_32), - BFD_JUMP_TABLE_COPY (_bfd_generic), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), - BFD_JUMP_TABLE_SYMBOLS (aout_32), - BFD_JUMP_TABLE_RELOCS (aout_32), - BFD_JUMP_TABLE_WRITE (aout_32), - BFD_JUMP_TABLE_LINK (os9k), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - NULL, - - (PTR) 0, -}; + { + "i386os9k", /* name */ + bfd_target_os9k_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_LITTLE, /* hdr byte order is little */ + (HAS_RELOC | EXEC_P | WP_TEXT), /* object flags */ + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD), /* section flags */ + 0, /* symbol leading char */ + ' ', /* ar_pad_char */ + 16, /* ar_max_namelen */ + + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + {_bfd_dummy_target, os9k_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, bfd_false, /* bfd_set_format */ + _bfd_generic_mkarchive, bfd_false}, + {bfd_false, bfd_false, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (aout_32), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), + BFD_JUMP_TABLE_SYMBOLS (aout_32), + BFD_JUMP_TABLE_RELOCS (aout_32), + BFD_JUMP_TABLE_WRITE (aout_32), + BFD_JUMP_TABLE_LINK (os9k), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + NULL, + + (PTR) 0, + }; diff -uprN binutils-2.11.90.0.27/bfd/ieee.c binutils-2.11.90.0.29/bfd/ieee.c --- binutils-2.11.90.0.27/bfd/ieee.c Sat May 12 00:05:31 2001 +++ binutils-2.11.90.0.29/bfd/ieee.c Mon Aug 27 11:44:51 2001 @@ -35,26 +35,94 @@ Foundation, Inc., 59 Temple Place - Suit #include +struct output_buffer_struct +{ + unsigned char *ptrp; + int buffer; +}; + static boolean ieee_write_byte PARAMS ((bfd *, int)); static boolean ieee_write_2bytes PARAMS ((bfd *, int)); static boolean ieee_write_int PARAMS ((bfd *, bfd_vma)); static boolean ieee_write_id PARAMS ((bfd *, const char *)); +static unsigned short read_2bytes PARAMS ((common_header_type *)); +static void bfd_get_string PARAMS ((common_header_type *, char *, size_t)); +static char *read_id PARAMS ((common_header_type *)); static boolean ieee_write_expression PARAMS ((bfd *, bfd_vma, asymbol *, boolean, unsigned int)); static void ieee_write_int5 PARAMS ((bfd_byte *, bfd_vma)); static boolean ieee_write_int5_out PARAMS ((bfd *, bfd_vma)); +static boolean parse_int PARAMS ((common_header_type *, bfd_vma *)); +static int parse_i PARAMS ((common_header_type *, boolean *)); +static bfd_vma must_parse_int PARAMS ((common_header_type *)); +static void parse_expression + PARAMS ((ieee_data_type *, bfd_vma *, ieee_symbol_index_type *, + boolean *, unsigned int *, asection **)); +static file_ptr ieee_part_after PARAMS ((ieee_data_type *, file_ptr)); +static ieee_symbol_type *get_symbol + PARAMS ((bfd *, ieee_data_type *, ieee_symbol_type *, unsigned int *, + ieee_symbol_type ***, unsigned int *, char)); +static boolean ieee_slurp_external_symbols PARAMS ((bfd *)); +static boolean ieee_slurp_symbol_table PARAMS ((bfd *)); +static long ieee_get_symtab_upper_bound PARAMS ((bfd *)); +static long ieee_get_symtab PARAMS ((bfd *, asymbol **)); +static asection *get_section_entry + PARAMS ((bfd *, ieee_data_type *i, unsigned int)); +static void ieee_slurp_sections PARAMS ((bfd *)); +static boolean ieee_slurp_debug PARAMS ((bfd *)); +const bfd_target *ieee_archive_p PARAMS ((bfd *)); +const bfd_target *ieee_object_p PARAMS ((bfd *)); +static void ieee_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); +static void ieee_print_symbol + PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); +static boolean do_one + PARAMS ((ieee_data_type *, ieee_per_section_type *, unsigned char *, + asection *, int)); +static boolean ieee_slurp_section_data PARAMS ((bfd *)); +static boolean ieee_new_section_hook PARAMS ((bfd *, asection *)); +static long ieee_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); +static boolean ieee_get_section_contents + PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); +static long ieee_canonicalize_reloc + PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); +static int comp PARAMS ((const PTR, const PTR)); static boolean ieee_write_section_part PARAMS ((bfd *)); static boolean do_with_relocs PARAMS ((bfd *, asection *)); static boolean do_as_repeat PARAMS ((bfd *, asection *)); static boolean do_without_relocs PARAMS ((bfd *, asection *)); -static boolean ieee_write_external_part PARAMS ((bfd *)); -static boolean ieee_write_data_part PARAMS ((bfd *)); +static boolean ieee_mkobject PARAMS ((bfd *)); +static void fill PARAMS ((void)); +static void flush PARAMS ((void)); +static void write_int PARAMS ((int)); +static void copy_id PARAMS ((void)); +static void copy_expression PARAMS ((void)); +static void fill_int PARAMS ((struct output_buffer_struct *)); +static void drop_int PARAMS ((struct output_buffer_struct *)); +static void copy_int PARAMS ((void)); +static void f1_record PARAMS ((void)); +static void f0_record PARAMS ((void)); +static void copy_till_end PARAMS ((void)); +static void f2_record PARAMS ((void)); +static void f8_record PARAMS ((void)); +static void e2_record PARAMS ((void)); +static void block PARAMS ((void)); +static void relocate_debug PARAMS ((bfd *, bfd *)); static boolean ieee_write_debug_part PARAMS ((bfd *)); +static boolean ieee_write_data_part PARAMS ((bfd *)); +static boolean init_for_output PARAMS ((bfd *)); +static boolean ieee_set_section_contents + PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); +static boolean ieee_write_external_part PARAMS ((bfd *)); static boolean ieee_write_me_part PARAMS ((bfd *)); static boolean ieee_write_processor PARAMS ((bfd *)); - -static boolean ieee_slurp_debug PARAMS ((bfd *)); -static boolean ieee_slurp_section_data PARAMS ((bfd *)); +static boolean ieee_write_object_contents PARAMS ((bfd *)); +static asymbol *ieee_make_empty_symbol PARAMS ((bfd *)); +static bfd *ieee_openr_next_archived_file PARAMS ((bfd *, bfd *)); +static boolean ieee_find_nearest_line + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); +static int ieee_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); +static int ieee_sizeof_headers PARAMS ((bfd *, boolean)); /* Functions for writing to ieee files in the strange way that the standard requires. */ @@ -543,8 +611,9 @@ parse_expression (ieee, value, symbol, p #define PUSH(x,y,z) TOS.symbol=x;TOS.section=y;TOS.value=z;INC; #define POP(x,y,z) DEC;x=TOS.symbol;y=TOS.section;z=TOS.value; ieee_value_type *sp = stack; + asection *dummy; - while (loop) + while (loop && ieee->h.input_p < ieee->h.last_byte) { switch (this_byte (&(ieee->h))) { @@ -637,63 +706,76 @@ parse_expression (ieee, value, symbol, p } else { - /* - Thats all that we can understand. As far as I can see - there is a bug in the Microtec IEEE output which I'm - using to scan, whereby the comma operator is omitted - sometimes in an expression, giving expressions with too - many terms. We can tell if that's the case by ensuring - that sp == stack here. If not, then we've pushed - something too far, so we keep adding. */ - - while (sp != stack + 1) - { - asection *section1; - ieee_symbol_index_type sy1; - POP (sy1, section1, *extra); - } - { - asection *dummy; - - POP (*symbol, dummy, *value); - if (section) - *section = dummy; - } - + /* Thats all that we can understand. */ loop = false; } } } } + + /* As far as I can see there is a bug in the Microtec IEEE output + which I'm using to scan, whereby the comma operator is omitted + sometimes in an expression, giving expressions with too many + terms. We can tell if that's the case by ensuring that + sp == stack here. If not, then we've pushed something too far, + so we keep adding. */ + + while (sp != stack + 1) + { + asection *section1; + ieee_symbol_index_type sy1; + POP (sy1, section1, *extra); + } + + POP (*symbol, dummy, *value); + if (section) + *section = dummy; } -#define ieee_seek(abfd, offset) \ - IEEE_DATA(abfd)->h.input_p = IEEE_DATA(abfd)->h.first_byte + offset +#define ieee_seek(ieee, offset) \ + do \ + { \ + ieee->h.input_p = ieee->h.first_byte + offset; \ + ieee->h.last_byte = (ieee->h.first_byte \ + + ieee_part_after (ieee, offset)); \ + } \ + while (0) + +#define ieee_pos(ieee) \ + (ieee->h.input_p - ieee->h.first_byte) + +/* Find the first part of the ieee file after HERE. */ + +static file_ptr +ieee_part_after (ieee, here) + ieee_data_type *ieee; + file_ptr here; +{ + int part; + file_ptr after = ieee->w.r.me_record; + + /* File parts can come in any order, except that module end is + guaranteed to be last (and the header first). */ + for (part = 0; part < N_W_VARIABLES; part++) + if (ieee->w.offset[part] > here && after > ieee->w.offset[part]) + after = ieee->w.offset[part]; -#define ieee_pos(abfd) \ - (IEEE_DATA(abfd)->h.input_p - IEEE_DATA(abfd)->h.first_byte) + return after; +} static unsigned int last_index; static char last_type; /* is the index for an X or a D */ static ieee_symbol_type * -get_symbol (abfd, - ieee, - last_symbol, - symbol_count, - pptr, - max_index, - this_type -) +get_symbol (abfd, ieee, last_symbol, symbol_count, pptr, max_index, this_type) bfd *abfd ATTRIBUTE_UNUSED; ieee_data_type *ieee; ieee_symbol_type *last_symbol; unsigned int *symbol_count; ieee_symbol_type ***pptr; unsigned int *max_index; - char this_type - ; + char this_type; { /* Need a new symbol */ unsigned int new_index = must_parse_int (&(ieee->h)); @@ -735,7 +817,7 @@ ieee_slurp_external_symbols (abfd) last_index = 0xffffff; ieee->symbol_table_full = true; - ieee_seek (abfd, offset); + ieee_seek (ieee, offset); while (loop) { @@ -777,7 +859,7 @@ ieee_slurp_external_symbols (abfd) unsigned int symbol_type_index; unsigned int symbol_attribute_def; bfd_vma value; - switch (read_2bytes (ieee)) + switch (read_2bytes (&ieee->h)) { case ieee_attribute_record_enum: symbol_name_index = must_parse_int (&(ieee->h)); @@ -829,7 +911,7 @@ ieee_slurp_external_symbols (abfd) --value; - switch (read_2bytes (ieee)) + switch (read_2bytes (&ieee->h)) { case ieee_asn_record_enum: parse_int (&ieee->h, &val1); @@ -984,7 +1066,7 @@ ieee_slurp_symbol_table (abfd) return true; } -long +static long ieee_get_symtab_upper_bound (abfd) bfd *abfd; { @@ -1002,7 +1084,7 @@ symbol index order extern const bfd_target ieee_vec; -long +static long ieee_get_symtab (abfd, location) bfd *abfd; asymbol **location; @@ -1127,7 +1209,7 @@ ieee_slurp_sections (abfd) if (offset != 0) { bfd_byte section_type[3]; - ieee_seek (abfd, offset); + ieee_seek (ieee, offset); while (true) { switch (this_byte (&(ieee->h))) @@ -1301,11 +1383,7 @@ ieee_slurp_debug (abfd) sec->flags |= SEC_DEBUGGING | SEC_HAS_CONTENTS; sec->filepos = ieee->w.r.debug_information_part; - debug_end = ieee->w.r.data_part; - if (debug_end == 0) - debug_end = ieee->w.r.trailer_part; - if (debug_end == 0) - debug_end = ieee->w.r.me_record; + debug_end = ieee_part_after (ieee, ieee->w.r.debug_information_part); sec->_raw_size = debug_end - ieee->w.r.debug_information_part; return true; @@ -1334,8 +1412,8 @@ ieee_archive_p (abfd) goto error_return; ieee = IEEE_AR_DATA (abfd); - /* FIXME: Check return value. I'm not sure whether it needs to read - the entire buffer or not. */ + /* Ignore the return value here. It doesn't matter if we don't read + the entire buffer. We might have a very small ieee file. */ bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd); ieee->h.first_byte = buffer; @@ -1396,15 +1474,14 @@ ieee_archive_p (abfd) t->abfd = (bfd *) NULL; /* Make sure that we don't go over the end of the buffer. */ - if ((size_t) ieee_pos (abfd) > sizeof (buffer) / 2) + if ((size_t) ieee_pos (IEEE_DATA (abfd)) > sizeof (buffer) / 2) { /* Past half way, reseek and reprime. */ - buffer_offset += ieee_pos (abfd); + buffer_offset += ieee_pos (IEEE_DATA (abfd)); if (bfd_seek (abfd, buffer_offset, SEEK_SET) != 0) goto error_return; - /* FIXME: Check return value. I'm not sure whether it needs - to read the entire buffer or not. */ + /* Again ignore return value of bfd_read. */ bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd); ieee->h.first_byte = buffer; ieee->h.input_p = buffer; @@ -1428,8 +1505,7 @@ ieee_archive_p (abfd) if (bfd_seek (abfd, ieee->elements[i].file_offset, SEEK_SET) != 0) goto error_return; - /* FIXME: Check return value. I'm not sure whether it needs to - read the entire buffer or not. */ + /* Again ignore return value of bfd_read. */ bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd); ieee->h.first_byte = buffer; ieee->h.input_p = buffer; @@ -1461,14 +1537,6 @@ ieee_archive_p (abfd) return NULL; } -static boolean -ieee_mkobject (abfd) - bfd *abfd; -{ - abfd->tdata.ieee_data = (ieee_data_type *) bfd_zalloc (abfd, sizeof (ieee_data_type)); - return abfd->tdata.ieee_data ? true : false; -} - const bfd_target * ieee_object_p (abfd) bfd *abfd; @@ -1485,9 +1553,8 @@ ieee_object_p (abfd) ieee = IEEE_DATA (abfd); if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) goto fail; - /* Read the first few bytes in to see if it makes sense */ - /* FIXME: Check return value. I'm not sure whether it needs to read - the entire buffer or not. */ + /* Read the first few bytes in to see if it makes sense. Ignore + bfd_read return value; The file might be very small. */ bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd); ieee->h.input_p = buffer; @@ -1509,7 +1576,7 @@ ieee_object_p (abfd) if (strcmp (processor, "LIBRARY") == 0) goto got_wrong_format; ieee->mb.module_name = read_id (&(ieee->h)); - if (abfd->filename == (CONST char *) NULL) + if (abfd->filename == (const char *) NULL) { abfd->filename = ieee->mb.module_name; } @@ -1664,7 +1731,7 @@ fail: return (const bfd_target *) NULL; } -void +static void ieee_get_symbol_info (ignore_abfd, symbol, ret) bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; @@ -1677,9 +1744,9 @@ ieee_get_symbol_info (ignore_abfd, symbo ret->type = (symbol->flags & BSF_LOCAL) ? 'a' : 'A'; } -void -ieee_print_symbol (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +static void +ieee_print_symbol (abfd, afile, symbol, how) + bfd *abfd; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -1710,7 +1777,7 @@ ieee_print_symbol (ignore_abfd, afile, s } else { - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %-5s %04x %02x %s", section_name, @@ -1934,7 +2001,7 @@ ieee_slurp_section_data (abfd) if (ieee->read_data == true) return true; ieee->read_data = true; - ieee_seek (abfd, ieee->w.r.data_part); + ieee_seek (ieee, ieee->w.r.data_part); /* Allocate enough space for all the section contents */ @@ -1983,7 +2050,7 @@ ieee_slurp_section_data (abfd) unsigned int extra; boolean pcrel; next_byte (&(ieee->h)); - must_parse_int (&(ieee->h)); /* Thow away section #*/ + must_parse_int (&(ieee->h)); /* Throw away section #*/ parse_expression (ieee, &value, &symbol, &pcrel, &extra, @@ -2053,7 +2120,7 @@ ieee_slurp_section_data (abfd) } } -boolean +static boolean ieee_new_section_hook (abfd, newsect) bfd *abfd; asection *newsect; @@ -2067,7 +2134,7 @@ ieee_new_section_hook (abfd, newsect) return true; } -long +static long ieee_get_reloc_upper_bound (abfd, asect) bfd *abfd; sec_ptr asect; @@ -2096,7 +2163,7 @@ ieee_get_section_contents (abfd, section return true; } -long +static long ieee_canonicalize_reloc (abfd, section, relptr, symbols) bfd *abfd; sec_ptr section; @@ -2141,8 +2208,8 @@ ieee_canonicalize_reloc (abfd, section, static int comp (ap, bp) - CONST PTR ap; - CONST PTR bp; + const PTR ap; + const PTR bp; { arelent *a = *((arelent **) ap); arelent *b = *((arelent **) bp); @@ -2269,6 +2336,7 @@ do_with_relocs (abfd, s) || ! ieee_write_byte (abfd, (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE))) return false; + if ((abfd->flags & EXEC_P) != 0 && relocs_to_go == 0) { if (! ieee_write_int (abfd, s->lma)) @@ -2471,9 +2539,21 @@ do_as_repeat (abfd, s) || ! ieee_write_byte (abfd, ieee_set_current_pc_enum & 0xff) || ! ieee_write_byte (abfd, (bfd_byte) (s->index - + IEEE_SECTION_NUMBER_BASE)) - || ! ieee_write_int (abfd, s->lma) - || ! ieee_write_byte (abfd, ieee_repeat_data_enum) + + IEEE_SECTION_NUMBER_BASE))) + return false; + + if ((abfd->flags & EXEC_P) != 0) + { + if (! ieee_write_int (abfd, s->lma)) + return false; + } + else + { + if (! ieee_write_expression (abfd, 0, s->symbol, 0, 0)) + return false; + } + + if (! ieee_write_byte (abfd, ieee_repeat_data_enum) || ! ieee_write_int (abfd, s->_raw_size) || ! ieee_write_byte (abfd, ieee_load_constant_bytes_enum) || ! ieee_write_byte (abfd, 1) @@ -2526,6 +2606,23 @@ static bfd *input_bfd; static bfd *output_bfd; static int output_buffer; +static boolean +ieee_mkobject (abfd) + bfd *abfd; +{ + output_ptr_start = NULL; + output_ptr = NULL; + output_ptr_end = NULL; + input_ptr_start = NULL; + input_ptr = NULL; + input_ptr_end = NULL; + input_bfd = NULL; + output_bfd = NULL; + output_buffer = 0; + abfd->tdata.ieee_data = (ieee_data_type *) bfd_zalloc (abfd, sizeof (ieee_data_type)); + return abfd->tdata.ieee_data ? true : false; +} + static void fill () { @@ -2534,6 +2631,7 @@ fill () bfd_read ((PTR) input_ptr_start, 1, input_ptr_end - input_ptr_start, input_bfd); input_ptr = input_ptr_start; } + static void flush () { @@ -2719,12 +2817,6 @@ copy_expression () /* Drop the int in the buffer, and copy a null into the gap, which we will overwrite later */ -struct output_buffer_struct -{ - unsigned char *ptrp; - int buffer; -}; - static void fill_int (buf) struct output_buffer_struct *buf; @@ -2812,7 +2904,6 @@ copy_int () #define ID copy_id() #define INT copy_int() #define EXP copy_expression() -static void copy_till_end (); #define INTn(q) copy_int() #define EXPn(q) copy_expression() @@ -2978,7 +3069,6 @@ f2_record () } -static void block (); static void f8_record () { @@ -3318,7 +3408,7 @@ init_for_output (abfd) /* set section contents is complicated with IEEE since the format is * not a byte image, but a record stream. */ -boolean +static boolean ieee_set_section_contents (abfd, section, location, offset, count) bfd *abfd; sec_ptr section; @@ -3467,7 +3557,7 @@ ieee_write_external_part (abfd) } -static CONST unsigned char exten[] = +static const unsigned char exten[] = { 0xf0, 0x20, 0x00, 0xf1, 0xce, 0x20, 0x00, 37, 3, 3, /* Set version 3 rev 3 */ @@ -3475,7 +3565,7 @@ static CONST unsigned char exten[] = 0xf1, 0xce, 0x20, 0x00, 38 /* set object type relocateable to x */ }; -static CONST unsigned char envi[] = +static const unsigned char envi[] = { 0xf0, 0x21, 0x00, @@ -3597,7 +3687,7 @@ ieee_write_processor (abfd) return true; } -boolean +static boolean ieee_write_object_contents (abfd) bfd *abfd; { @@ -3720,7 +3810,7 @@ ieee_write_object_contents (abfd) function exits. We read the strings into a buffer large enough to hold them all plus all the cached symbol entries. */ -asymbol * +static asymbol * ieee_make_empty_symbol (abfd) bfd *abfd; { @@ -3770,13 +3860,8 @@ ieee_openr_next_archived_file (arch, pre } static boolean -ieee_find_nearest_line (abfd, - section, - symbols, - offset, - filename_ptr, - functionname_ptr, - line_ptr) +ieee_find_nearest_line (abfd, section, symbols, offset, filename_ptr, + functionname_ptr, line_ptr) bfd *abfd ATTRIBUTE_UNUSED; asection *section ATTRIBUTE_UNUSED; asymbol **symbols ATTRIBUTE_UNUSED; @@ -3972,14 +4057,40 @@ const bfd_target ieee_vec = bfd_false, }, + /* ieee_close_and_cleanup, ieee_bfd_free_cached_info, ieee_new_section_hook, + ieee_get_section_contents, ieee_get_section_contents_in_window */ BFD_JUMP_TABLE_GENERIC (ieee), + BFD_JUMP_TABLE_COPY (_bfd_generic), BFD_JUMP_TABLE_CORE (_bfd_nocore), + + /* ieee_slurp_armap, ieee_slurp_extended_name_table, + ieee_construct_extended_name_table, ieee_truncate_arname, + ieee_write_armap, ieee_read_ar_hdr, ieee_openr_next_archived_file, + ieee_get_elt_at_index, ieee_generic_stat_arch_elt, + ieee_update_armap_timestamp */ BFD_JUMP_TABLE_ARCHIVE (ieee), + + /* ieee_get_symtab_upper_bound, ieee_get_symtab, ieee_make_empty_symbol, + ieee_print_symbol, ieee_get_symbol_info, ieee_bfd_is_local_label_name, + ieee_get_lineno, ieee_find_nearest_line, ieee_bfd_make_debug_symbol, + ieee_read_minisymbols, ieee_minisymbol_to_symbol */ BFD_JUMP_TABLE_SYMBOLS (ieee), + + /* ieee_get_reloc_upper_bound, ieee_canonicalize_reloc, + ieee_bfd_reloc_type_lookup */ BFD_JUMP_TABLE_RELOCS (ieee), + + /* ieee_set_arch_mach, ieee_set_section_contents */ BFD_JUMP_TABLE_WRITE (ieee), + + /* ieee_sizeof_headers, ieee_bfd_get_relocated_section_contents, + ieee_bfd_relax_section, ieee_bfd_link_hash_table_create, + ieee_bfd_link_add_symbols, ieee_bfd_final_link, + ieee_bfd_link_split_section, ieee_bfd_gc_sections, + ieee_bfd_merge_sections */ BFD_JUMP_TABLE_LINK (ieee), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, diff -uprN binutils-2.11.90.0.27/bfd/libaout.h binutils-2.11.90.0.29/bfd/libaout.h --- binutils-2.11.90.0.27/bfd/libaout.h Fri Mar 9 11:16:01 2001 +++ binutils-2.11.90.0.29/bfd/libaout.h Mon Aug 27 11:44:51 2001 @@ -290,7 +290,7 @@ enum machine_type { #ifndef N_SET_DYNAMIC # define N_SET_DYNAMIC(exec, dynamic) \ -((exec).a_info = (dynamic) ? ((exec).a_info | 0x80000000) : \ +((exec).a_info = (dynamic) ? (long) ((exec).a_info | 0x80000000) : \ ((exec).a_info & 0x7fffffff)) #endif diff -uprN binutils-2.11.90.0.27/bfd/libbfd.h binutils-2.11.90.0.29/bfd/libbfd.h --- binutils-2.11.90.0.27/bfd/libbfd.h Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.29/bfd/libbfd.h Mon Aug 27 11:44:51 2001 @@ -628,10 +628,12 @@ static const char *const bfd_reloc_code_ "BFD_RELOC_HI16_GOTOFF", "BFD_RELOC_HI16_S_GOTOFF", "BFD_RELOC_8_GOTOFF", + "BFD_RELOC_64_PLT_PCREL", "BFD_RELOC_32_PLT_PCREL", "BFD_RELOC_24_PLT_PCREL", "BFD_RELOC_16_PLT_PCREL", "BFD_RELOC_8_PLT_PCREL", + "BFD_RELOC_64_PLTOFF", "BFD_RELOC_32_PLTOFF", "BFD_RELOC_16_PLTOFF", "BFD_RELOC_LO16_PLTOFF", @@ -811,6 +813,29 @@ static const char *const bfd_reloc_code_ "BFD_RELOC_PPC_EMB_RELST_HA", "BFD_RELOC_PPC_EMB_BIT_FLD", "BFD_RELOC_PPC_EMB_RELSDA", + "BFD_RELOC_PPC64_HIGHER", + "BFD_RELOC_PPC64_HIGHER_S", + "BFD_RELOC_PPC64_HIGHEST", + "BFD_RELOC_PPC64_HIGHEST_S", + "BFD_RELOC_PPC64_TOC16_LO", + "BFD_RELOC_PPC64_TOC16_HI", + "BFD_RELOC_PPC64_TOC16_HA", + "BFD_RELOC_PPC64_TOC", + "BFD_RELOC_PPC64_PLTGOT16 ", + "BFD_RELOC_PPC64_PLTGOT16_LO", + "BFD_RELOC_PPC64_PLTGOT16_HI", + "BFD_RELOC_PPC64_PLTGOT16_HA", + "BFD_RELOC_PPC64_ADDR16_DS", + "BFD_RELOC_PPC64_ADDR16_LO_DS", + "BFD_RELOC_PPC64_GOT16_DS", + "BFD_RELOC_PPC64_GOT16_LO_DS", + "BFD_RELOC_PPC64_PLT16_LO_DS", + "BFD_RELOC_PPC64_SECTOFF_DS", + "BFD_RELOC_PPC64_SECTOFF_LO_DS", + "BFD_RELOC_PPC64_TOC16_DS", + "BFD_RELOC_PPC64_TOC16_LO_DS", + "BFD_RELOC_PPC64_PLTGOT16_DS", + "BFD_RELOC_PPC64_PLTGOT16_LO_DS", "BFD_RELOC_I370_D12", "BFD_RELOC_CTOR", "BFD_RELOC_ARM_PCREL_BRANCH", diff -uprN binutils-2.11.90.0.27/bfd/libieee.h binutils-2.11.90.0.29/bfd/libieee.h --- binutils-2.11.90.0.27/bfd/libieee.h Fri Mar 9 11:16:02 2001 +++ binutils-2.11.90.0.29/bfd/libieee.h Wed Aug 22 08:52:10 2001 @@ -1,5 +1,6 @@ /* IEEE-695 object file formats: definitions internal to BFD. - Copyright 1990, 1991, 1992, 1994, 1996 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1996, 2001 + Free Software Foundation, Inc. Written by Cygnus Support. Mostly Steve Chamberlain's fault. This file is part of BFD, the Binary File Descriptor library. @@ -62,8 +63,9 @@ typedef struct ieee_per_section #define ieee_per_section(x) ((ieee_per_section_type *)((x)->used_by_bfd)) typedef struct { - unsigned char *input_p; + unsigned char *input_p; unsigned char *first_byte; + unsigned char *last_byte; bfd *abfd; } common_header_type ; diff -uprN binutils-2.11.90.0.27/bfd/linker.c binutils-2.11.90.0.29/bfd/linker.c --- binutils-2.11.90.0.27/bfd/linker.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/bfd/linker.c Mon Aug 27 11:44:51 2001 @@ -483,6 +483,8 @@ _bfd_link_hash_table_init (table, abfd, table->creator = abfd->xvec; table->undefs = NULL; table->undefs_tail = NULL; + table->type = bfd_link_generic_hash_table; + return bfd_hash_table_init (&table->table, newfunc); } @@ -1007,9 +1009,13 @@ _bfd_generic_link_add_archive_symbols (a let's look for its import thunk */ if (info->pei386_auto_import) { - char *buf = alloca (strlen (h->root.string) + 10); + char *buf = (char *) bfd_malloc (strlen (h->root.string) + 10); + if (buf == NULL) + return false; + sprintf (buf, "__imp_%s", h->root.string); arh = archive_hash_lookup (&arsym_hash, buf, false, false); + free(buf); } if (arh == (struct archive_hash_entry *) NULL) { @@ -2655,28 +2661,35 @@ default_fill_link_order (abfd, info, sec struct bfd_link_order *link_order; { size_t size; - char *space; + unsigned char *space; size_t i; - int fill; + unsigned int fill; + file_ptr loc; boolean result; BFD_ASSERT ((sec->flags & SEC_HAS_CONTENTS) != 0); size = (size_t) link_order->size; - space = (char *) bfd_malloc (size); - if (space == NULL && size != 0) + if (size == 0) + return true; + + space = (unsigned char *) bfd_malloc (size); + if (space == NULL) return false; fill = link_order->u.fill.value; - for (i = 0; i < size; i += 2) + for (i = 0; i < size; i += 4) + space[i] = fill >> 24; + for (i = 1; i < size; i += 4) + space[i] = fill >> 16; + for (i = 2; i < size; i += 4) space[i] = fill >> 8; - for (i = 1; i < size; i += 2) + for (i = 3; i < size; i += 4) space[i] = fill; - result = bfd_set_section_contents (abfd, sec, space, - (file_ptr) - (link_order->offset * - bfd_octets_per_byte (abfd)), - link_order->size); + + loc = (file_ptr) (link_order->offset * bfd_octets_per_byte (abfd)); + result = bfd_set_section_contents (abfd, sec, space, loc, link_order->size); + free (space); return result; } diff -uprN binutils-2.11.90.0.27/bfd/mipsbsd.c binutils-2.11.90.0.29/bfd/mipsbsd.c --- binutils-2.11.90.0.27/bfd/mipsbsd.c Fri Mar 9 11:16:03 2001 +++ binutils-2.11.90.0.29/bfd/mipsbsd.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD backend for MIPS BSD (a.out) binaries. - Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000 + Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Ralph Campbell. @@ -67,6 +67,11 @@ static boolean MY(write_object_contents) #include "aout-target.h" +static bfd_reloc_status_type mips_fix_jmp_addr PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, bfd *)); +static reloc_howto_type * MY(reloc_howto_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); + +long MY(canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); + static void MY(set_arch_mach) (abfd, machtype) bfd *abfd; @@ -76,41 +81,43 @@ MY(set_arch_mach) (abfd, machtype) long machine; /* Determine the architecture and machine type of the object file. */ - switch (machtype) { + switch (machtype) + { + case M_MIPS1: + arch = bfd_arch_mips; + machine = 3000; + break; - case M_MIPS1: - arch = bfd_arch_mips; - machine = 3000; - break; - - case M_MIPS2: - arch = bfd_arch_mips; - machine = 4000; - break; - - default: - arch = bfd_arch_obscure; - machine = 0; - break; - } - bfd_set_arch_mach(abfd, arch, machine); + case M_MIPS2: + arch = bfd_arch_mips; + machine = 4000; + break; + + default: + arch = bfd_arch_obscure; + machine = 0; + break; + } + + bfd_set_arch_mach (abfd, arch, machine); } /* Determine the size of a relocation entry, based on the architecture */ static void -MY(choose_reloc_size) (abfd) +MY (choose_reloc_size) (abfd) bfd *abfd; { - switch (bfd_get_arch(abfd)) { - case bfd_arch_sparc: - case bfd_arch_a29k: - case bfd_arch_mips: - obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; - break; - default: - obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; - break; - } + switch (bfd_get_arch (abfd)) + { + case bfd_arch_sparc: + case bfd_arch_a29k: + case bfd_arch_mips: + obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; + break; + default: + obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; + break; + } } /* Write an object file in BSD a.out format. @@ -118,59 +125,60 @@ MY(choose_reloc_size) (abfd) file header, symbols, and relocation. */ static boolean -MY(write_object_contents) (abfd) +MY (write_object_contents) (abfd) bfd *abfd; { struct external_exec exec_bytes; struct internal_exec *execp = exec_hdr (abfd); /* Magic number, maestro, please! */ - switch (bfd_get_arch(abfd)) { - case bfd_arch_m68k: - switch (bfd_get_mach(abfd)) { - case bfd_mach_m68010: - N_SET_MACHTYPE(*execp, M_68010); + switch (bfd_get_arch (abfd)) + { + case bfd_arch_m68k: + switch (bfd_get_mach (abfd)) + { + case bfd_mach_m68010: + N_SET_MACHTYPE (*execp, M_68010); + break; + default: + case bfd_mach_m68020: + N_SET_MACHTYPE (*execp, M_68020); + break; + } break; - default: - case bfd_mach_m68020: - N_SET_MACHTYPE(*execp, M_68020); + case bfd_arch_sparc: + N_SET_MACHTYPE (*execp, M_SPARC); break; - } - break; - case bfd_arch_sparc: - N_SET_MACHTYPE(*execp, M_SPARC); - break; - case bfd_arch_i386: - N_SET_MACHTYPE(*execp, M_386); - break; - case bfd_arch_a29k: - N_SET_MACHTYPE(*execp, M_29K); - break; - case bfd_arch_mips: - switch (bfd_get_mach(abfd)) { - case 4000: - case 6000: - N_SET_MACHTYPE(*execp, M_MIPS2); + case bfd_arch_i386: + N_SET_MACHTYPE (*execp, M_386); break; - default: - N_SET_MACHTYPE(*execp, M_MIPS1); + case bfd_arch_a29k: + N_SET_MACHTYPE (*execp, M_29K); break; + case bfd_arch_mips: + switch (bfd_get_mach (abfd)) + { + case 4000: + case 6000: + N_SET_MACHTYPE (*execp, M_MIPS2); + break; + default: + N_SET_MACHTYPE (*execp, M_MIPS1); + break; + } + break; + default: + N_SET_MACHTYPE (*execp, M_UNKNOWN); } - break; - default: - N_SET_MACHTYPE(*execp, M_UNKNOWN); - } - MY(choose_reloc_size) (abfd); + MY (choose_reloc_size) (abfd); - WRITE_HEADERS(abfd, execp); + WRITE_HEADERS (abfd, execp); return true; } -/* - * MIPS relocation types. - */ +/* MIPS relocation types. */ #define MIPS_RELOC_32 0 #define MIPS_RELOC_JMP 1 #define MIPS_RELOC_WDISP16 2 @@ -178,14 +186,13 @@ MY(write_object_contents) (abfd) #define MIPS_RELOC_HI16_S 4 #define MIPS_RELOC_LO16 5 -/* - * This is only called when performing a BFD_RELOC_MIPS_JMP relocation. - * The jump destination address is formed from the upper 4 bits of the - * "current" program counter concatenated with the jump instruction's - * 26 bit field and two trailing zeros. - * If the destination address is not in the same segment as the "current" - * program counter, then we need to signal an error. - */ +/* This is only called when performing a BFD_RELOC_MIPS_JMP relocation. + The jump destination address is formed from the upper 4 bits of the + "current" program counter concatenated with the jump instruction's + 26 bit field and two trailing zeros. + If the destination address is not in the same segment as the "current" + program counter, then we need to signal an error. */ + static bfd_reloc_status_type mips_fix_jmp_addr (abfd,reloc_entry,symbol,data,input_section,output_bfd) bfd *abfd ATTRIBUTE_UNUSED; @@ -206,10 +213,8 @@ mips_fix_jmp_addr (abfd,reloc_entry,symb && (symbol->flags & BSF_WEAK) == 0) return bfd_reloc_undefined; - /* - * Work out which section the relocation is targetted at and the - * initial relocation command value. - */ + /* Work out which section the relocation is targetted at and the + initial relocation command value. */ if (bfd_is_com_section (symbol->section)) relocation = 0; else @@ -228,12 +233,11 @@ mips_fix_jmp_addr (abfd,reloc_entry,symb return bfd_reloc_continue; } -/* - * This is only called when performing a BFD_RELOC_HI16_S relocation. - * We need to see if bit 15 is set in the result. If it is, we add - * 0x10000 and continue normally. This will compensate for the sign extension - * when the low bits are added at run time. - */ +/* This is only called when performing a BFD_RELOC_HI16_S relocation. + We need to see if bit 15 is set in the result. If it is, we add + 0x10000 and continue normally. This will compensate for the sign extension + when the low bits are added at run time. */ + static bfd_reloc_status_type mips_fix_hi16_s PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); @@ -255,15 +259,13 @@ mips_fix_hi16_s (abfd, reloc_entry, symb if (output_bfd != (bfd *)NULL) return bfd_reloc_continue; - /* If this is an undefined symbol, return error */ + /* If this is an undefined symbol, return error. */ if (bfd_is_und_section (symbol->section) && (symbol->flags & BSF_WEAK) == 0) return bfd_reloc_undefined; - /* - * Work out which section the relocation is targetted at and the - * initial relocation command value. - */ + /* Work out which section the relocation is targetted at and the + initial relocation command value. */ if (bfd_is_com_section (symbol->section)) relocation = 0; else @@ -325,10 +327,8 @@ MY(reloc_howto_type_lookup) (abfd, code) } } -/* - * This is just like the standard aoutx.h version but we need to do our - * own mapping of external reloc type values to howto entries. - */ +/* This is just like the standard aoutx.h version but we need to do our + own mapping of external reloc type values to howto entries. */ long MY(canonicalize_reloc) (abfd, section, relptr, symbols) bfd *abfd; @@ -341,28 +341,32 @@ MY(canonicalize_reloc) (abfd, section, r extern reloc_howto_type NAME(aout,ext_howto_table)[]; /* If we have already read in the relocation table, return the values. */ - if (section->flags & SEC_CONSTRUCTOR) { - arelent_chain *chain = section->constructor_chain; + if (section->flags & SEC_CONSTRUCTOR) + { + arelent_chain *chain = section->constructor_chain; - for (count = 0; count < section->reloc_count; count++) { - *relptr++ = &chain->relent; - chain = chain->next; + for (count = 0; count < section->reloc_count; count++) + { + *relptr++ = &chain->relent; + chain = chain->next; + } + *relptr = 0; + return section->reloc_count; + } + + if (tblptr && section->reloc_count) + { + for (count = 0; count++ < section->reloc_count;) + *relptr++ = tblptr++; + *relptr = 0; + return section->reloc_count; } - *relptr = 0; - return section->reloc_count; - } - if (tblptr && section->reloc_count) { - for (count = 0; count++ < section->reloc_count;) - *relptr++ = tblptr++; - *relptr = 0; - return section->reloc_count; - } if (!NAME(aout,slurp_reloc_table) (abfd, section, symbols)) return -1; tblptr = section->relocation; - /* fix up howto entries */ + /* fix up howto entries. */ for (count = 0; count++ < section->reloc_count;) { c = tblptr->howto - NAME(aout,ext_howto_table); @@ -393,83 +397,83 @@ static CONST struct aout_backend_data MY extern const bfd_target aout_mips_big_vec; const bfd_target aout_mips_little_vec = -{ - "a.out-mips-little", /* name */ - bfd_target_aout_flavour, - BFD_ENDIAN_LITTLE, /* target byte order (little) */ - BFD_ENDIAN_LITTLE, /* target headers byte order (little) */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), - MY_symbol_leading_char, - ' ', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + { + "a.out-mips-little", /* name */ + bfd_target_aout_flavour, + BFD_ENDIAN_LITTLE, /* target byte order (little) */ + BFD_ENDIAN_LITTLE, /* target headers byte order (little) */ + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), + MY_symbol_leading_char, + ' ', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ {_bfd_dummy_target, MY_object_p, /* bfd_check_format */ - bfd_generic_archive_p, MY_core_file_p}, + bfd_generic_archive_p, MY_core_file_p}, {bfd_false, MY_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, + _bfd_generic_mkarchive, bfd_false}, {bfd_false, MY_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + _bfd_write_archive_contents, bfd_false}, - BFD_JUMP_TABLE_GENERIC (MY), - BFD_JUMP_TABLE_COPY (MY), - BFD_JUMP_TABLE_CORE (MY), - BFD_JUMP_TABLE_ARCHIVE (MY), - BFD_JUMP_TABLE_SYMBOLS (MY), - BFD_JUMP_TABLE_RELOCS (MY), - BFD_JUMP_TABLE_WRITE (MY), - BFD_JUMP_TABLE_LINK (MY), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + BFD_JUMP_TABLE_GENERIC (MY), + BFD_JUMP_TABLE_COPY (MY), + BFD_JUMP_TABLE_CORE (MY), + BFD_JUMP_TABLE_ARCHIVE (MY), + BFD_JUMP_TABLE_SYMBOLS (MY), + BFD_JUMP_TABLE_RELOCS (MY), + BFD_JUMP_TABLE_WRITE (MY), + BFD_JUMP_TABLE_LINK (MY), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - & aout_mips_big_vec, + & aout_mips_big_vec, - (PTR) MY_backend_data -}; + (PTR) MY_backend_data + }; const bfd_target aout_mips_big_vec = -{ - "a.out-mips-big", /* name */ - bfd_target_aout_flavour, - BFD_ENDIAN_BIG, /* target byte order (big) */ - BFD_ENDIAN_BIG, /* target headers byte order (big) */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), - MY_symbol_leading_char, - ' ', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + { + "a.out-mips-big", /* name */ + bfd_target_aout_flavour, + BFD_ENDIAN_BIG, /* target byte order (big) */ + BFD_ENDIAN_BIG, /* target headers byte order (big) */ + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), + MY_symbol_leading_char, + ' ', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ {_bfd_dummy_target, MY_object_p, /* bfd_check_format */ - bfd_generic_archive_p, MY_core_file_p}, + bfd_generic_archive_p, MY_core_file_p}, {bfd_false, MY_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, + _bfd_generic_mkarchive, bfd_false}, {bfd_false, MY_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + _bfd_write_archive_contents, bfd_false}, - BFD_JUMP_TABLE_GENERIC (MY), - BFD_JUMP_TABLE_COPY (MY), - BFD_JUMP_TABLE_CORE (MY), - BFD_JUMP_TABLE_ARCHIVE (MY), - BFD_JUMP_TABLE_SYMBOLS (MY), - BFD_JUMP_TABLE_RELOCS (MY), - BFD_JUMP_TABLE_WRITE (MY), - BFD_JUMP_TABLE_LINK (MY), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + BFD_JUMP_TABLE_GENERIC (MY), + BFD_JUMP_TABLE_COPY (MY), + BFD_JUMP_TABLE_CORE (MY), + BFD_JUMP_TABLE_ARCHIVE (MY), + BFD_JUMP_TABLE_SYMBOLS (MY), + BFD_JUMP_TABLE_RELOCS (MY), + BFD_JUMP_TABLE_WRITE (MY), + BFD_JUMP_TABLE_LINK (MY), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - & aout_mips_little_vec, + & aout_mips_little_vec, - (PTR) MY_backend_data -}; + (PTR) MY_backend_data + }; diff -uprN binutils-2.11.90.0.27/bfd/nlm32-alpha.c binutils-2.11.90.0.29/bfd/nlm32-alpha.c --- binutils-2.11.90.0.27/bfd/nlm32-alpha.c Wed May 2 23:30:03 2001 +++ binutils-2.11.90.0.29/bfd/nlm32-alpha.c Wed Aug 22 08:52:10 2001 @@ -822,7 +822,7 @@ nlm_alpha_write_external (abfd, count, s asymbol *sym; struct reloc_and_sec *relocs; { - int i; + bfd_size_type i; bfd_byte len; unsigned char temp[NLM_TARGET_LONG_SIZE]; arelent r; diff -uprN binutils-2.11.90.0.27/bfd/nlmcode.h binutils-2.11.90.0.29/bfd/nlmcode.h --- binutils-2.11.90.0.27/bfd/nlmcode.h Fri Mar 9 11:16:04 2001 +++ binutils-2.11.90.0.29/bfd/nlmcode.h Mon Aug 27 11:44:51 2001 @@ -981,7 +981,7 @@ nlm_get_symbol_info (ignore_abfd, symbol void nlm_print_symbol (abfd, afile, symbol, how) - bfd *abfd ATTRIBUTE_UNUSED; + bfd *abfd; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -996,7 +996,7 @@ nlm_print_symbol (abfd, afile, symbol, h fprintf (file, "%s", symbol->name); break; case bfd_print_symbol_all: - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %-5s", symbol->section->name); if (symbol->name) fprintf (file, " %s", symbol->name); diff -uprN binutils-2.11.90.0.27/bfd/oasys.c binutils-2.11.90.0.29/bfd/oasys.c --- binutils-2.11.90.0.27/bfd/oasys.c Sat May 12 00:05:34 2001 +++ binutils-2.11.90.0.29/bfd/oasys.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for oasys objects. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support, . @@ -27,14 +27,6 @@ Foundation, Inc., 59 Temple Place - Suit #include "oasys.h" #include "liboasys.h" -/* XXX - FIXME. offsetof belongs in the system-specific files in - ../include/sys. */ -/* Define offsetof for those systems which lack it */ - -#ifndef offsetof -#define offsetof(type, identifier) (size_t) &(((type *) 0)->identifier) -#endif - static boolean oasys_read_record PARAMS ((bfd *, oasys_record_union_type *)); static boolean oasys_write_sections PARAMS ((bfd *)); @@ -46,6 +38,28 @@ static boolean oasys_write_syms PARAMS ( static boolean oasys_write_header PARAMS ((bfd *)); static boolean oasys_write_end PARAMS ((bfd *)); static boolean oasys_write_data PARAMS ((bfd *)); +static size_t oasys_string_length PARAMS ((oasys_record_union_type *)); +static boolean oasys_slurp_symbol_table PARAMS ((bfd *const)); +static long int oasys_get_symtab_upper_bound PARAMS ((bfd *const)); +static const bfd_target *oasys_archive_p PARAMS ((bfd *)); +static boolean oasys_mkobject PARAMS ((bfd *)); +static const bfd_target *oasys_object_p PARAMS ((bfd *)); +static void oasys_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); +static void oasys_print_symbol PARAMS ((bfd *, void *, asymbol *, bfd_print_symbol_type)); +static boolean oasys_new_section_hook PARAMS ((bfd *, asection *)); +static long int oasys_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); +static boolean oasys_get_section_contents + PARAMS ((bfd *, sec_ptr, void *, file_ptr, bfd_size_type)); +static int comp PARAMS ((const void *, const void *)); +static boolean oasys_write_object_contents PARAMS ((bfd *)); +static boolean oasys_set_section_contents + PARAMS ((bfd *, sec_ptr, void *, file_ptr, bfd_size_type)); +static asymbol *oasys_make_empty_symbol PARAMS ((bfd *)); +static bfd *oasys_openr_next_archived_file PARAMS ((bfd *, bfd *)); +static boolean oasys_find_nearest_line + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, char **, char **, unsigned int *)); +static int oasys_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); +static int oasys_sizeof_headers PARAMS ((bfd *, boolean)); /* Read in all the section data and relocation stuff too */ PROTO (static boolean, oasys_slurp_section_data, (bfd * CONST abfd)); @@ -525,8 +539,8 @@ oasys_get_symbol_info (ignore_abfd, symb } static void -oasys_print_symbol (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +oasys_print_symbol (abfd, afile, symbol, how) + bfd *abfd; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -544,7 +558,7 @@ oasys_print_symbol (ignore_abfd, afile, CONST char *section_name = symbol->section == (asection *) NULL ? (CONST char *) "*abs" : symbol->section->name; - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %-5s %s", section_name, diff -uprN binutils-2.11.90.0.27/bfd/pdp11.c binutils-2.11.90.0.29/bfd/pdp11.c --- binutils-2.11.90.0.27/bfd/pdp11.c Fri Apr 13 11:18:48 2001 +++ binutils-2.11.90.0.29/bfd/pdp11.c Mon Aug 27 11:44:51 2001 @@ -2461,7 +2461,7 @@ NAME(aout,get_symbol_info) (abfd, symbol /*ARGSUSED*/ void NAME(aout,print_symbol) (abfd, afile, symbol, how) - bfd * abfd ATTRIBUTE_UNUSED; + bfd * abfd; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -2483,7 +2483,7 @@ NAME(aout,print_symbol) (abfd, afile, sy { CONST char *section_name = symbol->section->name; - bfd_print_symbol_vandf ((PTR)file,symbol); + bfd_print_symbol_vandf (abfd, (PTR)file, symbol); fprintf (file," %-5s %04x %02x %02x", section_name, diff -uprN binutils-2.11.90.0.27/bfd/peXXigen.c binutils-2.11.90.0.29/bfd/peXXigen.c --- binutils-2.11.90.0.27/bfd/peXXigen.c Fri Mar 9 11:16:05 2001 +++ binutils-2.11.90.0.29/bfd/peXXigen.c Wed Aug 22 08:52:10 2001 @@ -95,8 +95,9 @@ static void add_data_entry PARAMS ((bfd *, struct internal_extra_pe_aouthdr *, int, char *, bfd_vma)); static boolean pe_print_pdata PARAMS ((bfd *, PTR)); static boolean pe_print_reloc PARAMS ((bfd *, PTR)); - -/**********************************************************************/ +static boolean pe_print_idata PARAMS ((bfd *, PTR)); +static boolean pe_print_edata PARAMS ((bfd *, PTR)); + void _bfd_XXi_swap_sym_in (abfd, ext1, in1) @@ -114,20 +115,16 @@ _bfd_XXi_swap_sym_in (abfd, ext1, in1) bfd_h_get_32 (abfd, (bfd_byte *) ext->e.e.e_offset); } else - { - memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN); - } + memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN); in->n_value = bfd_h_get_32 (abfd, (bfd_byte *) ext->e_value); in->n_scnum = bfd_h_get_16 (abfd, (bfd_byte *) ext->e_scnum); + if (sizeof (ext->e_type) == 2) - { - in->n_type = bfd_h_get_16 (abfd, (bfd_byte *) ext->e_type); - } + in->n_type = bfd_h_get_16 (abfd, (bfd_byte *) ext->e_type); else - { - in->n_type = bfd_h_get_32 (abfd, (bfd_byte *) ext->e_type); - } + in->n_type = bfd_h_get_32 (abfd, (bfd_byte *) ext->e_type); + in->n_sclass = bfd_h_get_8 (abfd, ext->e_sclass); in->n_numaux = bfd_h_get_8 (abfd, ext->e_numaux); @@ -166,6 +163,7 @@ _bfd_XXi_swap_sym_in (abfd, ext1, in1) if (in->n_scnum == 0) { asection *sec; + for (sec = abfd->sections; sec; sec = sec->next) { if (strcmp (sec->name, in->n_name) == 0) @@ -175,11 +173,13 @@ _bfd_XXi_swap_sym_in (abfd, ext1, in1) } } } + if (in->n_scnum == 0) { int unused_section_number = 0; asection *sec; char *name; + for (sec = abfd->sections; sec; sec = sec->next) if (unused_section_number <= sec->target_index) unused_section_number = sec->target_index + 1; @@ -229,26 +229,23 @@ _bfd_XXi_swap_sym_out (abfd, inp, extp) { struct internal_syment *in = (struct internal_syment *) inp; SYMENT *ext = (SYMENT *) extp; + if (in->_n._n_name[0] == 0) { bfd_h_put_32 (abfd, 0, (bfd_byte *) ext->e.e.e_zeroes); bfd_h_put_32 (abfd, in->_n._n_n._n_offset, (bfd_byte *) ext->e.e.e_offset); } else - { - memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN); - } + memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN); bfd_h_put_32 (abfd, in->n_value, (bfd_byte *) ext->e_value); bfd_h_put_16 (abfd, in->n_scnum, (bfd_byte *) ext->e_scnum); + if (sizeof (ext->e_type) == 2) - { - bfd_h_put_16 (abfd, in->n_type, (bfd_byte *) ext->e_type); - } + bfd_h_put_16 (abfd, in->n_type, (bfd_byte *) ext->e_type); else - { - bfd_h_put_32 (abfd, in->n_type, (bfd_byte *) ext->e_type); - } + bfd_h_put_32 (abfd, in->n_type, (bfd_byte *) ext->e_type); + bfd_h_put_8 (abfd, in->n_sclass, ext->e_sclass); bfd_h_put_8 (abfd, in->n_numaux, ext->e_numaux); @@ -278,9 +275,7 @@ _bfd_XXi_swap_aux_in (abfd, ext1, type, bfd_h_get_32 (abfd, (bfd_byte *) ext->x_file.x_n.x_offset); } else - { - memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); - } + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); return; case C_STAT: @@ -359,9 +354,8 @@ _bfd_XXi_swap_aux_out (abfd, inp, type, (bfd_byte *) ext->x_file.x_n.x_offset); } else - { - memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); - } + memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); + return AUXESZ; case C_STAT: @@ -499,6 +493,7 @@ _bfd_XXi_swap_aouthdr_in (abfd, aouthdr_ { int idx; + for (idx = 0; idx < 16; idx++) { /* If data directory is empty, rva also should be 0. */ @@ -507,10 +502,8 @@ _bfd_XXi_swap_aouthdr_in (abfd, aouthdr_ a->DataDirectory[idx].Size = size; if (size) - { - a->DataDirectory[idx].VirtualAddress = - bfd_h_get_32 (abfd, (bfd_byte *) src->DataDirectory[idx][0]); - } + a->DataDirectory[idx].VirtualAddress = + bfd_h_get_32 (abfd, (bfd_byte *) src->DataDirectory[idx][0]); else a->DataDirectory[idx].VirtualAddress = 0; } @@ -523,6 +516,7 @@ _bfd_XXi_swap_aouthdr_in (abfd, aouthdr_ aouthdr_int->entry &= 0xffffffff; #endif } + if (aouthdr_int->tsize) { aouthdr_int->text_start += a->ImageBase; @@ -530,6 +524,7 @@ _bfd_XXi_swap_aouthdr_in (abfd, aouthdr_ aouthdr_int->text_start &= 0xffffffff; #endif } + #ifndef COFF_WITH_pep /* PE32+ does not have data_start member! */ if (aouthdr_int->dsize) @@ -547,7 +542,6 @@ _bfd_XXi_swap_aouthdr_in (abfd, aouthdr_ thunk_size = a->DataDirectory[12].Size; import_table_size = a->DataDirectory[1].Size; #endif - } /* A support function for below. */ @@ -562,12 +556,12 @@ add_data_entry (abfd, aout, idx, name, b { asection *sec = bfd_get_section_by_name (abfd, name); - /* add import directory information if it exists */ + /* Add import directory information if it exists. */ if ((sec != NULL) && (coff_section_data (abfd, sec) != NULL) && (pei_section_data (abfd, sec) != NULL)) { - /* If data directory is empty, rva also should be 0 */ + /* If data directory is empty, rva also should be 0. */ int size = pei_section_data (abfd, sec)->virt_size; aout->DataDirectory[idx].Size = size; @@ -614,6 +608,7 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out aouthdr_in->text_start &= 0xffffffff; #endif } + if (aouthdr_in->dsize) { aouthdr_in->data_start -= ib; @@ -621,6 +616,7 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out aouthdr_in->data_start &= 0xffffffff; #endif } + if (aouthdr_in->entry) { aouthdr_in->entry -= ib; @@ -758,6 +754,7 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out (bfd_byte *) aouthdr_out->NumberOfRvaAndSizes); { int idx; + for (idx = 0; idx < 16; idx++) { bfd_h_put_32 (abfd, extra->DataDirectory[idx].VirtualAddress, @@ -842,9 +839,9 @@ _bfd_XXi_only_swap_filehdr_out (abfd, in bfd_h_put_16 (abfd, filehdr_in->f_opthdr, (bfd_byte *) filehdr_out->f_opthdr); bfd_h_put_16 (abfd, filehdr_in->f_flags, (bfd_byte *) filehdr_out->f_flags); - /* put in extra dos header stuff. This data remains essentially + /* Put in extra dos header stuff. This data remains essentially constant, it just has to be tacked on to the beginning of all exes - for NT */ + for NT. */ bfd_h_put_16 (abfd, filehdr_in->pe.e_magic, (bfd_byte *) filehdr_out->e_magic); bfd_h_put_16 (abfd, filehdr_in->pe.e_cblp, (bfd_byte *) filehdr_out->e_cblp); bfd_h_put_16 (abfd, filehdr_in->pe.e_cp, (bfd_byte *) filehdr_out->e_cp); @@ -862,29 +859,24 @@ _bfd_XXi_only_swap_filehdr_out (abfd, in bfd_h_put_16 (abfd, filehdr_in->pe.e_cs, (bfd_byte *) filehdr_out->e_cs); bfd_h_put_16 (abfd, filehdr_in->pe.e_lfarlc, (bfd_byte *) filehdr_out->e_lfarlc); bfd_h_put_16 (abfd, filehdr_in->pe.e_ovno, (bfd_byte *) filehdr_out->e_ovno); - { - int idx; - for (idx = 0; idx < 4; idx++) - bfd_h_put_16 (abfd, filehdr_in->pe.e_res[idx], - (bfd_byte *) filehdr_out->e_res[idx]); - } + + for (idx = 0; idx < 4; idx++) + bfd_h_put_16 (abfd, filehdr_in->pe.e_res[idx], + (bfd_byte *) filehdr_out->e_res[idx]); + bfd_h_put_16 (abfd, filehdr_in->pe.e_oemid, (bfd_byte *) filehdr_out->e_oemid); bfd_h_put_16 (abfd, filehdr_in->pe.e_oeminfo, (bfd_byte *) filehdr_out->e_oeminfo); - { - int idx; - for (idx = 0; idx < 10; idx++) - bfd_h_put_16 (abfd, filehdr_in->pe.e_res2[idx], - (bfd_byte *) filehdr_out->e_res2[idx]); - } + + for (idx = 0; idx < 10; idx++) + bfd_h_put_16 (abfd, filehdr_in->pe.e_res2[idx], + (bfd_byte *) filehdr_out->e_res2[idx]); + bfd_h_put_32 (abfd, filehdr_in->pe.e_lfanew, (bfd_byte *) filehdr_out->e_lfanew); - { - int idx; - for (idx = 0; idx < 16; idx++) - bfd_h_put_32 (abfd, filehdr_in->pe.dos_message[idx], - (bfd_byte *) filehdr_out->dos_message[idx]); - } + for (idx = 0; idx < 16; idx++) + bfd_h_put_32 (abfd, filehdr_in->pe.dos_message[idx], + (bfd_byte *) filehdr_out->dos_message[idx]); /* Also put in the NT signature. */ bfd_h_put_32 (abfd, filehdr_in->pe.nt_signature, @@ -937,7 +929,6 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) /* NT wants the size data to be rounded up to the next NT_FILE_ALIGNMENT, but zero if it has no content (as in .bss, sometimes). */ - if ((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0) { ps = scnhdr_int->s_size; @@ -978,6 +969,7 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) { int flags = scnhdr_int->s_flags; + bfd_h_put_32 (abfd, flags, (bfd_byte *) scnhdr_ext->s_flags); } @@ -1013,12 +1005,13 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno); ret = 0; } + if (scnhdr_int->s_nreloc <= 0xffff) bfd_h_put_16 (abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc); else { - /* PE can deal with large #s of relocs, but not here */ + /* PE can deal with large #s of relocs, but not here. */ bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); scnhdr_int->s_flags |= IMAGE_SCN_LNK_NRELOC_OVFL; bfd_h_put_32 (abfd, scnhdr_int->s_flags, @@ -1036,26 +1029,26 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) return ret; } -static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] = { - N_("Export Directory [.edata (or where ever we found it)]"), - N_("Import Directory [parts of .idata]"), - N_("Resource Directory [.rsrc]"), - N_("Exception Directory [.pdata]"), - N_("Security Directory"), - N_("Base Relocation Directory [.reloc]"), - N_("Debug Directory"), - N_("Description Directory"), - N_("Special Directory"), - N_("Thread Storage Directory [.tls]"), - N_("Load Configuration Directory"), - N_("Bound Import Directory"), - N_("Import Address Table Directory"), - N_("Delay Import Directory"), - N_("Reserved"), - N_("Reserved") -}; +static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] = + { + N_("Export Directory [.edata (or where ever we found it)]"), + N_("Import Directory [parts of .idata]"), + N_("Resource Directory [.rsrc]"), + N_("Exception Directory [.pdata]"), + N_("Security Directory"), + N_("Base Relocation Directory [.reloc]"), + N_("Debug Directory"), + N_("Description Directory"), + N_("Special Directory"), + N_("Thread Storage Directory [.tls]"), + N_("Load Configuration Directory"), + N_("Bound Import Directory"), + N_("Import Address Table Directory"), + N_("Delay Import Directory"), + N_("Reserved"), + N_("Reserved") + }; -/**********************************************************************/ #ifdef POWERPC_LE_PE /* The code for the PPC really falls in the "architecture dependent" category. However, it's not clear that anyone will ever care, so @@ -1064,7 +1057,6 @@ static char * dir_names[IMAGE_NUMBEROF_D PPC- specific code. */ #endif -/**********************************************************************/ static boolean pe_print_idata (abfd, vfile) bfd *abfd; @@ -1205,13 +1197,11 @@ pe_print_idata (abfd, vfile) /* print (i + extra->DataDirectory[1].VirtualAddress) */ fprintf (file, " %08lx\t", (unsigned long) (i + adj + dataoff)); - +#if 0 if (i + 20 > datasize) - { - /* Check stuff. */ - ; - } - + /* Check stuff. */ + ; +#endif hint_addr = bfd_get_32 (abfd, data + i + dataoff); time_stamp = bfd_get_32 (abfd, data + i + 4 + dataoff); forward_chain = bfd_get_32 (abfd, data + i + 8 + dataoff); @@ -1299,11 +1289,10 @@ pe_print_idata (abfd, vfile) fprintf (file, _("\tvma: Hint/Ord Member-Name\n")); differ = 1; } + if (iat_member == 0) - { - fprintf (file, - _("\t>>> Ran out of IAT members!\n")); - } + fprintf (file, + _("\t>>> Ran out of IAT members!\n")); else { ordinal = bfd_get_16 (abfd, data + iat_member - adj); @@ -1318,15 +1307,13 @@ pe_print_idata (abfd, vfile) if (hint_addr != 0 && hint_member == 0) break; } + if (differ == 0) - { - fprintf (file, - _("\tThe Import Address Table is identical\n")); - } + fprintf (file, + _("\tThe Import Address Table is identical\n")); } fprintf (file, "\n"); - } free (data); @@ -1342,24 +1329,23 @@ pe_print_edata (abfd, vfile) FILE *file = (FILE *) vfile; bfd_byte *data; asection *section; - bfd_size_type datasize = 0; bfd_size_type dataoff; bfd_size_type i; - bfd_signed_vma adj; - struct EDT_type { - long export_flags; /* reserved - should be zero */ + struct EDT_type + { + long export_flags; /* reserved - should be zero */ long time_stamp; short major_ver; short minor_ver; - bfd_vma name; /* rva - relative to image base */ - long base; /* ordinal base */ - unsigned long num_functions; /* Number in the export address table */ - unsigned long num_names; /* Number in the name pointer table */ - bfd_vma eat_addr; /* rva to the export address table */ - bfd_vma npt_addr; /* rva to the Export Name Pointer Table */ - bfd_vma ot_addr; /* rva to the Ordinal Table */ + bfd_vma name; /* rva - relative to image base */ + long base; /* ordinal base */ + unsigned long num_functions;/* Number in the export address table */ + unsigned long num_names; /* Number in the name pointer table */ + bfd_vma eat_addr; /* rva to the export address table */ + bfd_vma npt_addr; /* rva to the Export Name Pointer Table */ + bfd_vma ot_addr; /* rva to the Ordinal Table */ } edt; pe_data_type *pe = pe_data (abfd); @@ -1384,9 +1370,11 @@ pe_print_edata (abfd, vfile) else { addr += extra->ImageBase; + for (section = abfd->sections; section != NULL; section = section->next) { datasize = bfd_section_size (abfd, section); + if (addr >= section->vma && addr < section->vma + datasize) break; } @@ -1428,7 +1416,7 @@ pe_print_edata (abfd, vfile) adj = section->vma - extra->ImageBase + dataoff; - /* Dump the EDT first first */ + /* Dump the EDT first. */ fprintf (file, _("\nThe Export Tables (interpreted %s section contents)\n\n"), section->name); @@ -1482,7 +1470,8 @@ pe_print_edata (abfd, vfile) /* The next table to find is the Export Address Table. It's basically a list of pointers that either locate a function in this dll, or forward the call to another dll. Something like: - typedef union { + typedef union + { long export_rva; long forwarder_rva; } export_address_table_entry; @@ -1631,10 +1620,8 @@ pe_print_pdata (abfd, vfile) if (begin_addr == 0 && end_addr == 0 && eh_handler == 0 && eh_data == 0 && prolog_end_addr == 0) - { - /* We are probably into the padding of the section now. */ - break; - } + /* We are probably into the padding of the section now. */ + break; em_data = ((eh_handler & 0x1) << 2) | (prolog_end_addr & 0x3); eh_handler &= ~(bfd_vma) 0x3; @@ -1687,21 +1674,22 @@ pe_print_pdata (abfd, vfile) } #define IMAGE_REL_BASED_HIGHADJ 4 -static const char * const tbl[] = { - "ABSOLUTE", - "HIGH", - "LOW", - "HIGHLOW", - "HIGHADJ", - "MIPS_JMPADDR", - "SECTION", - "REL32", - "RESERVED1", - "MIPS_JMPADDR16", - "DIR64", - "HIGH3ADJ" - "UNKNOWN", /* MUST be last */ -}; +static const char * const tbl[] = + { + "ABSOLUTE", + "HIGH", + "LOW", + "HIGHLOW", + "HIGHADJ", + "MIPS_JMPADDR", + "SECTION", + "REL32", + "RESERVED1", + "MIPS_JMPADDR16", + "DIR64", + "HIGH3ADJ" + "UNKNOWN", /* MUST be last */ + }; static boolean pe_print_reloc (abfd, vfile) @@ -1745,16 +1733,13 @@ pe_print_reloc (abfd, vfile) long number, size; /* The .reloc section is a sequence of blocks, with a header consisting - of two 32 bit quantities, followed by a number of 16 bit entries */ - + of two 32 bit quantities, followed by a number of 16 bit entries. */ virtual_address = bfd_get_32 (abfd, data+i); size = bfd_get_32 (abfd, data+i+4); number = (size - 8) / 2; if (size == 0) - { - break; - } + break; fprintf (file, _("\nVirtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"), @@ -1785,6 +1770,7 @@ pe_print_reloc (abfd, vfile) fprintf (file, "\n"); } + i += size; } @@ -1842,6 +1828,7 @@ _bfd_XX_print_private_bfd_data_common (a fprintf (file, "SizeOfImage\t\t%08lx\n", i->SizeOfImage); fprintf (file, "SizeOfHeaders\t\t%08lx\n", i->SizeOfHeaders); fprintf (file, "CheckSum\t\t%08lx\n", i->CheckSum); + switch (i->Subsystem) { case IMAGE_SUBSYSTEM_UNKNOWN: @@ -1872,6 +1859,7 @@ _bfd_XX_print_private_bfd_data_common (a subsystem_name = "EFI runtime driver"; break; } + fprintf (file, "Subsystem\t\t%08x", i->Subsystem); if (subsystem_name) fprintf (file, "\t(%s)", subsystem_name); @@ -1919,7 +1907,7 @@ _bfd_XX_bfd_copy_private_bfd_data_common pe_data (obfd)->pe_opthdr = pe_data (ibfd)->pe_opthdr; pe_data (obfd)->dll = pe_data (ibfd)->dll; - /* for strip: if we removed .reloc, we'll make a real mess of things + /* For strip: if we removed .reloc, we'll make a real mess of things if we don't remove this entry as well. */ if (! pe_data (obfd)->has_reloc_section) { @@ -1930,6 +1918,7 @@ _bfd_XX_bfd_copy_private_bfd_data_common } /* Copy private section data. */ + boolean _bfd_XX_bfd_copy_private_section_data (ibfd, isec, obfd, osec) bfd *ibfd; @@ -1951,6 +1940,7 @@ _bfd_XX_bfd_copy_private_section_data (i if (osec->used_by_bfd == NULL) return false; } + if (pei_section_data (obfd, osec) == NULL) { coff_section_data (obfd, osec)->tdata = @@ -1958,6 +1948,7 @@ _bfd_XX_bfd_copy_private_section_data (i if (coff_section_data (obfd, osec)->tdata == NULL) return false; } + pei_section_data (obfd, osec)->virt_size = pei_section_data (ibfd, isec)->virt_size; pei_section_data (obfd, osec)->pe_flags = diff -uprN binutils-2.11.90.0.27/bfd/reloc.c binutils-2.11.90.0.29/bfd/reloc.c --- binutils-2.11.90.0.27/bfd/reloc.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.29/bfd/reloc.c Mon Aug 27 11:44:51 2001 @@ -1681,6 +1681,8 @@ ENUMX ENUMX BFD_RELOC_8_GOTOFF ENUMX + BFD_RELOC_64_PLT_PCREL +ENUMX BFD_RELOC_32_PLT_PCREL ENUMX BFD_RELOC_24_PLT_PCREL @@ -1689,6 +1691,8 @@ ENUMX ENUMX BFD_RELOC_8_PLT_PCREL ENUMX + BFD_RELOC_64_PLTOFF +ENUMX BFD_RELOC_32_PLTOFF ENUMX BFD_RELOC_16_PLTOFF @@ -2216,6 +2220,52 @@ ENUMX BFD_RELOC_PPC_EMB_BIT_FLD ENUMX BFD_RELOC_PPC_EMB_RELSDA +ENUMX + BFD_RELOC_PPC64_HIGHER +ENUMX + BFD_RELOC_PPC64_HIGHER_S +ENUMX + BFD_RELOC_PPC64_HIGHEST +ENUMX + BFD_RELOC_PPC64_HIGHEST_S +ENUMX + BFD_RELOC_PPC64_TOC16_LO +ENUMX + BFD_RELOC_PPC64_TOC16_HI +ENUMX + BFD_RELOC_PPC64_TOC16_HA +ENUMX + BFD_RELOC_PPC64_TOC +ENUMX + BFD_RELOC_PPC64_PLTGOT16 +ENUMX + BFD_RELOC_PPC64_PLTGOT16_LO +ENUMX + BFD_RELOC_PPC64_PLTGOT16_HI +ENUMX + BFD_RELOC_PPC64_PLTGOT16_HA +ENUMX + BFD_RELOC_PPC64_ADDR16_DS +ENUMX + BFD_RELOC_PPC64_ADDR16_LO_DS +ENUMX + BFD_RELOC_PPC64_GOT16_DS +ENUMX + BFD_RELOC_PPC64_GOT16_LO_DS +ENUMX + BFD_RELOC_PPC64_PLT16_LO_DS +ENUMX + BFD_RELOC_PPC64_SECTOFF_DS +ENUMX + BFD_RELOC_PPC64_SECTOFF_LO_DS +ENUMX + BFD_RELOC_PPC64_TOC16_DS +ENUMX + BFD_RELOC_PPC64_TOC16_LO_DS +ENUMX + BFD_RELOC_PPC64_PLTGOT16_DS +ENUMX + BFD_RELOC_PPC64_PLTGOT16_LO_DS ENUMDOC Power(rs6000) and PowerPC relocations. diff -uprN binutils-2.11.90.0.27/bfd/som.c binutils-2.11.90.0.29/bfd/som.c --- binutils-2.11.90.0.27/bfd/som.c Sat May 12 00:05:36 2001 +++ binutils-2.11.90.0.29/bfd/som.c Mon Aug 27 11:44:51 2001 @@ -4499,8 +4499,8 @@ som_make_empty_symbol (abfd) /* Print symbol information. */ static void -som_print_symbol (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +som_print_symbol (abfd, afile, symbol, how) + bfd *abfd; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -4520,7 +4520,7 @@ som_print_symbol (ignore_abfd, afile, sy { CONST char *section_name; section_name = symbol->section ? symbol->section->name : "(*none*)"; - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %s\t%s", section_name, symbol->name); break; } diff -uprN binutils-2.11.90.0.27/bfd/srec.c binutils-2.11.90.0.29/bfd/srec.c --- binutils-2.11.90.0.27/bfd/srec.c Sat May 12 00:05:37 2001 +++ binutils-2.11.90.0.29/bfd/srec.c Mon Aug 27 11:44:51 2001 @@ -1217,8 +1217,8 @@ srec_get_symbol_info (ignore_abfd, symbo } static void -srec_print_symbol (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +srec_print_symbol (abfd, afile, symbol, how) + bfd *abfd; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -1230,7 +1230,7 @@ srec_print_symbol (ignore_abfd, afile, s fprintf (file, "%s", symbol->name); break; default: - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %-5s %s", symbol->section->name, symbol->name); diff -uprN binutils-2.11.90.0.27/bfd/syms.c binutils-2.11.90.0.29/bfd/syms.c --- binutils-2.11.90.0.27/bfd/syms.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/bfd/syms.c Mon Aug 27 11:44:51 2001 @@ -433,14 +433,15 @@ FUNCTION bfd_print_symbol_vandf SYNOPSIS - void bfd_print_symbol_vandf(PTR file, asymbol *symbol); + void bfd_print_symbol_vandf(bfd *abfd, PTR file, asymbol *symbol); DESCRIPTION Print the value and flags of the @var{symbol} supplied to the stream @var{file}. */ void -bfd_print_symbol_vandf (arg, symbol) +bfd_print_symbol_vandf (abfd, arg, symbol) + bfd *abfd; PTR arg; asymbol *symbol; { @@ -448,11 +449,12 @@ bfd_print_symbol_vandf (arg, symbol) flagword type = symbol->flags; if (symbol->section != (asection *) NULL) { - fprintf_vma (file, symbol->value + symbol->section->vma); + bfd_fprintf_vma (abfd, file, + symbol->value + symbol->section->vma); } else { - fprintf_vma (file, symbol->value); + bfd_fprintf_vma (abfd, file, symbol->value); } /* This presumes that a symbol can not be both BSF_DEBUGGING and diff -uprN binutils-2.11.90.0.27/bfd/sysdep.h binutils-2.11.90.0.29/bfd/sysdep.h --- binutils-2.11.90.0.27/bfd/sysdep.h Fri Mar 9 11:16:08 2001 +++ binutils-2.11.90.0.29/bfd/sysdep.h Wed Aug 22 08:52:10 2001 @@ -125,6 +125,12 @@ extern void free (); extern char *getenv (); #endif +/* Define offsetof for those systems which lack it */ + +#ifndef offsetof +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif + #ifdef ENABLE_NLS #include /* Note the use of dgetext() and PACKAGE here, rather than gettext(). diff -uprN binutils-2.11.90.0.27/bfd/targets.c binutils-2.11.90.0.29/bfd/targets.c --- binutils-2.11.90.0.27/bfd/targets.c Sat May 12 00:57:58 2001 +++ binutils-2.11.90.0.29/bfd/targets.c Mon Aug 27 11:44:51 2001 @@ -571,6 +571,8 @@ extern const bfd_target bfd_elf64_little extern const bfd_target bfd_elf64_littlemips_vec; extern const bfd_target bfd_elf64_tradbigmips_vec; extern const bfd_target bfd_elf64_tradlittlemips_vec; +extern const bfd_target bfd_elf64_powerpc_vec; +extern const bfd_target bfd_elf64_powerpcle_vec; extern const bfd_target bfd_elf64_s390_vec; extern const bfd_target bfd_elf64_sparc_vec; extern const bfd_target bfd_elf64_x86_64_vec; @@ -782,6 +784,10 @@ static const bfd_target * const _bfd_tar &bfd_elf32_pjl_vec, &bfd_elf32_powerpc_vec, &bfd_elf32_powerpcle_vec, +#ifdef BFD64 + &bfd_elf64_powerpc_vec, + &bfd_elf64_powerpcle_vec, +#endif &bfd_elf32_sparc_vec, &bfd_elf32_v850_vec, &bfd_elf32_fr30_vec, diff -uprN binutils-2.11.90.0.27/bfd/tekhex.c binutils-2.11.90.0.29/bfd/tekhex.c --- binutils-2.11.90.0.27/bfd/tekhex.c Sat May 12 00:05:38 2001 +++ binutils-2.11.90.0.29/bfd/tekhex.c Mon Aug 27 11:44:51 2001 @@ -957,8 +957,8 @@ tekhex_get_symbol_info (ignore_abfd, sym } static void -tekhex_print_symbol (ignore_abfd, filep, symbol, how) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +tekhex_print_symbol (abfd, filep, symbol, how) + bfd *abfd; PTR filep; asymbol *symbol; bfd_print_symbol_type how; @@ -977,7 +977,7 @@ tekhex_print_symbol (ignore_abfd, filep, { CONST char *section_name = symbol->section->name; - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %-5s %s", section_name, diff -uprN binutils-2.11.90.0.27/bfd/versados.c binutils-2.11.90.0.29/bfd/versados.c --- binutils-2.11.90.0.27/bfd/versados.c Sat May 12 00:05:38 2001 +++ binutils-2.11.90.0.29/bfd/versados.c Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* BFD back-end for VERSAdos-E objects. - Copyright 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . Versados is a Motorola trademark. @@ -46,6 +46,18 @@ static boolean versados_mkobject PARAMS ((bfd *)); static boolean versados_scan PARAMS ((bfd *)); static const bfd_target *versados_object_p PARAMS ((bfd *)); +static asymbol *versados_new_symbol PARAMS ((bfd *, int, const char *, bfd_vma, asection *)); +static char *new_symbol_string PARAMS ((bfd *, char *)); +static const bfd_target *versados_object_p PARAMS ((bfd *)); +static boolean versados_pass_2 PARAMS ((bfd *)); +static boolean versados_get_section_contents + PARAMS ((bfd *, asection *, void *, file_ptr, bfd_size_type)); +static boolean versados_set_section_contents + PARAMS ((bfd *, sec_ptr, void *, file_ptr, bfd_size_type)); +static int versados_sizeof_headers PARAMS ((bfd *, boolean)); +static asymbol *versados_make_empty_symbol PARAMS ((bfd *)); +static long int versados_get_symtab_upper_bound PARAMS ((bfd *)); +static long int versados_get_symtab PARAMS ((bfd *, asymbol **)); #define VHEADER '1' #define VESTDEF '2' @@ -141,6 +153,13 @@ union ext_any struct ext_otr otr; }; +static int get_record PARAMS ((bfd *, union ext_any *)); +static int get_4 PARAMS ((unsigned char **)); +static void get_10 PARAMS ((unsigned char **, char *)); +static void process_esd PARAMS ((bfd *, struct ext_esd *, int)); +static int get_offset PARAMS ((int, unsigned char *)); +static void process_otr PARAMS ((bfd *, struct ext_otr *, int)); + /* Initialize by filling in the hex conversion array. */ /* Set up the tdata information. */ @@ -195,7 +214,7 @@ get_record (abfd, ptr) return 1; } -int +static int get_4 (pp) unsigned char **pp; { @@ -204,7 +223,7 @@ get_4 (pp) return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3] << 0); } -void +static void get_10 (pp, name) unsigned char **pp; char *name; @@ -276,7 +295,7 @@ process_esd (abfd, esd, pass) asymbol *s; char *n = new_symbol_string (abfd, name); s = versados_new_symbol (abfd, snum, n, 0, - &bfd_und_section, scn); + &bfd_und_section); esidx = VDATA (abfd)->es_done++; RDATA (abfd, esidx - ES_BASE) = s; } @@ -311,7 +330,7 @@ process_esd (abfd, esd, pass) { asymbol *s; char *n = new_symbol_string (abfd, name); - s = versados_new_symbol (abfd, snum + VDATA (abfd)->nrefs, n, val, sec, scn); + s = versados_new_symbol (abfd, snum + VDATA (abfd)->nrefs, n, val, sec); s->flags |= BSF_GLOBAL; } } @@ -742,8 +761,8 @@ versados_get_symbol_info (ignore_abfd, s } void -versados_print_symbol (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +versados_print_symbol (abfd, afile, symbol, how) + bfd *abfd; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -755,7 +774,7 @@ versados_print_symbol (ignore_abfd, afil fprintf (file, "%s", symbol->name); break; default: - bfd_print_symbol_vandf ((PTR) file, symbol); + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); fprintf (file, " %-5s %s", symbol->section->name, symbol->name); diff -uprN binutils-2.11.90.0.27/bfd/vms.c binutils-2.11.90.0.29/bfd/vms.c --- binutils-2.11.90.0.27/bfd/vms.c Sat May 12 00:05:39 2001 +++ binutils-2.11.90.0.29/bfd/vms.c Mon Aug 27 11:44:51 2001 @@ -1170,7 +1170,7 @@ _bfd_vms_make_empty_symbol (abfd) static void vms_print_symbol (abfd, file, symbol, how) - bfd *abfd ATTRIBUTE_UNUSED; + bfd *abfd; PTR file; asymbol *symbol; bfd_print_symbol_type how; @@ -1190,7 +1190,7 @@ vms_print_symbol (abfd, file, symbol, ho { CONST char *section_name = symbol->section->name; - bfd_print_symbol_vandf((PTR)file,symbol); + bfd_print_symbol_vandf (abfd, (PTR)file, symbol); fprintf ((FILE *)file," %-8s %s", section_name, symbol->name); } diff -uprN binutils-2.11.90.0.27/binutils/ChangeLog binutils-2.11.90.0.29/binutils/ChangeLog --- binutils-2.11.90.0.27/binutils/ChangeLog Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/binutils/ChangeLog Mon Aug 27 11:44:51 2001 @@ -1,3 +1,53 @@ +2001-08-27 Alan Modra + + * readelf.c (dump_relocations): Recognise EM_PPC64. + +2001-08-26 Thiemo Seufer + + * readelf.c (get_machine_flags): Add detection of EF_MIPS_32BITMODE. + +2001-08-25 H.J. Lu + + * nm.c (print_width): New. + (display_rel_file): Set `print_width' according to + bfd_sprintf_vma. + (print_symbol_info_bsd): Check `print_width' instead of BFD64. + +2001-08-24 Alexandre Oliva + + * objcopy.c (use_alt_mach_code): New variable. + (OPTION_ALT_MACH_CODE): Define. + (copy_options): Added --alt-machine-code. + (copy_main): Handle it. + (copy_object): Switch to alternate machine code if requested. + * doc/binutils.texi: Document new option. + * NEWS: Likewise. + +2001-08-22 Thiemo Seufer + + * readelf.c (get_machine_flags): Add detection of EF_MIPS_UCODE. + +2001-08-21 H.J. Lu + + * readelf.c (dump_relocations): Support ELF64 on 32bit hosts. + (display_debug_info): Cast for 64bit hosts. + (display_debug_frames): Likewise. + (process_mips_specific): Likewise. + +2001-08-21 Andreas Jaeger + + * coffgrok.h: Add missing parameter for prototype of coff_grok. + + * sysdump.c: Add missing prototypes. + * srconv.c: Likewise. + * unwind-ia64.c: Likewise. + * coffdump.c: Likewise. + + * sysinfo.y: Print prototypes, include . + + * coffgrok.c: Add missing prototypes, include libiberty.h instead + of declaring xcalloc. + 2001-08-10 H.J. Lu * nm.c (print_value): Add one arg, bfd *. diff -uprN binutils-2.11.90.0.27/binutils/NEWS binutils-2.11.90.0.29/binutils/NEWS --- binutils-2.11.90.0.27/binutils/NEWS Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/binutils/NEWS Mon Aug 27 11:44:51 2001 @@ -11,6 +11,10 @@ * Support for OpenRISC by Johan Rydberg. +* New command line switch to objcopy --alt-machine-code which creates a binary + with an alternate machine code if one is defined in the architecture + description. Only supported for ELF targets. By Alexandre Oliva. + * New command line switch to objcopy -B (or --binary-architecture) which sets the architecture of the output file to the given argument. This option only makes sense, if the input target is binary. Otherwise it is ignored. diff -uprN binutils-2.11.90.0.27/binutils/coffdump.c binutils-2.11.90.0.29/binutils/coffdump.c --- binutils-2.11.90.0.27/binutils/coffdump.c Thu Mar 15 14:51:44 2001 +++ binutils-2.11.90.0.29/binutils/coffdump.c Wed Aug 22 08:52:10 2001 @@ -1,5 +1,5 @@ /* Coff file dumper. - Copyright 1994, 1995, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1994, 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -33,7 +33,21 @@ Foundation, Inc., 59 Temple Place - Suit #define PROGRAM_VERSION "1.0" static int atnl; -static void dump_coff_scope (); + +static void tab PARAMS ((int)); +static void nl PARAMS ((void)); +static void dump_coff_lines PARAMS ((struct coff_line *)); +static void dump_coff_type PARAMS ((struct coff_type *)); +static void dump_coff_where PARAMS ((struct coff_where *)); +static void dump_coff_visible PARAMS ((struct coff_visible *)); +extern void dump_coff_symbol PARAMS ((struct coff_symbol *)); +static void dump_coff_scope PARAMS ((struct coff_scope *)); +static void dump_coff_sfile PARAMS ((struct coff_sfile *)); +static void dump_coff_section PARAMS ((struct coff_section *)); +extern void coff_dump PARAMS ((struct coff_ofile *)); +static void show_usage PARAMS ((FILE *, int)); +static void show_help PARAMS ((void)); +extern int main PARAMS ((int, char **)); static void tab (x) diff -uprN binutils-2.11.90.0.27/binutils/coffgrok.c binutils-2.11.90.0.29/binutils/coffgrok.c --- binutils-2.11.90.0.27/binutils/coffgrok.c Thu Mar 15 14:51:44 2001 +++ binutils-2.11.90.0.29/binutils/coffgrok.c Wed Aug 22 08:52:10 2001 @@ -1,5 +1,5 @@ /* coffgrok.c - Copyright 1994, 1995, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suit */ #include +#include #include "bucomm.h" #include "coff/internal.h" @@ -53,7 +54,7 @@ static long symcount; static struct coff_ptr_struct *rawsyms; static int rawcount; static bfd *abfd; -extern char *xcalloc (); + #define PTR_SIZE 4 #define SHORT_SIZE 2 #define INT_SIZE 4 @@ -63,6 +64,19 @@ extern char *xcalloc (); #define INDEXOF(p) ((struct coff_ptr_struct *)(p)-(rawsyms)) +static struct coff_scope *empty_scope PARAMS ((void)); +static struct coff_symbol *empty_symbol PARAMS ((void)); +static void push_scope PARAMS ((int)); +static void pop_scope PARAMS ((void)); +static void do_sections_p1 PARAMS ((struct coff_ofile *)); +static void do_sections_p2 PARAMS ((struct coff_ofile *)); +static struct coff_where *do_where PARAMS ((int)); +static struct coff_line *do_lines PARAMS ((int, char *)); +static struct coff_type *do_type PARAMS ((int)); +static struct coff_visible *do_visible PARAMS ((int)); +static int do_define PARAMS ((int, struct coff_scope *)); +static struct coff_ofile *doit PARAMS ((void)); + static struct coff_scope * empty_scope () { diff -uprN binutils-2.11.90.0.27/binutils/coffgrok.h binutils-2.11.90.0.29/binutils/coffgrok.h --- binutils-2.11.90.0.27/binutils/coffgrok.h Thu Mar 15 14:51:44 2001 +++ binutils-2.11.90.0.29/binutils/coffgrok.h Wed Aug 22 08:52:10 2001 @@ -222,4 +222,4 @@ struct coff_sfile struct coff_sfile *sfile; }; -struct coff_ofile *coff_grok(); +struct coff_ofile *coff_grok PARAMS ((bfd *)); diff -uprN binutils-2.11.90.0.27/binutils/doc/binutils.texi binutils-2.11.90.0.29/binutils/doc/binutils.texi --- binutils-2.11.90.0.27/binutils/doc/binutils.texi Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/binutils/doc/binutils.texi Mon Aug 27 11:44:51 2001 @@ -954,6 +954,7 @@ objcopy [@option{-F} @var{bfdname}|@opti [@option{--keep-global-symbols=}@var{filename}] [@option{--localize-symbols=}@var{filename}] [@option{--weaken-symbols=}@var{filename}] + [@option{--alt-machine-code=@var{index}}] [@option{-v}|@option{--verbose}] [@option{-V}|@option{--version}] [@option{--help}] @@ -1306,6 +1307,13 @@ Apply @option{--weaken-symbol} option to name per line. Line comments may be introduced by the hash character. This option may be given more than once. +@item --alt-machine-code=@var{index} +If the output architecture has alternate machine codes, use the +@var{index}th code instead of the default one. This is useful in case +a machine is assigned an official code and the tool-chain adopts the +new code, but other applications still depend on the original code +being used. + @item -V @itemx --version Show the version number of @command{objcopy}. diff -uprN binutils-2.11.90.0.27/binutils/nm.c binutils-2.11.90.0.29/binutils/nm.c --- binutils-2.11.90.0.27/binutils/nm.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/binutils/nm.c Mon Aug 27 11:44:51 2001 @@ -245,6 +245,11 @@ static char value_format[] = "%016lx"; /* We don't use value_format for this case. */ #endif #endif +#ifdef BFD64 +static int print_width = 16; +#else +static int print_width = 8; +#endif static int print_radix = 16; /* Print formats for printing stab info. */ static char other_format[] = "%02x"; @@ -940,6 +945,7 @@ display_rel_file (abfd, archive_bfd) PTR minisyms; unsigned int size; struct size_sym *symsizes; + char buf[30]; if (! dynamic) { @@ -960,6 +966,9 @@ display_rel_file (abfd, archive_bfd) return; } + bfd_sprintf_vma (abfd, buf, (bfd_vma) -1); + print_width = strlen (buf); + /* Discard the symbols we don't want to print. It's OK to do this in place; we'll free the storage anyway (after printing). */ @@ -1476,9 +1485,8 @@ print_symbol_info_bsd (info, abfd) { if (bfd_is_undefined_symclass (info->type)) { -#ifdef BFD64 - printf (" "); -#endif + if (print_width == 16) + printf (" "); printf (" "); } else diff -uprN binutils-2.11.90.0.27/binutils/objcopy.c binutils-2.11.90.0.29/binutils/objcopy.c --- binutils-2.11.90.0.27/binutils/objcopy.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/binutils/objcopy.c Mon Aug 27 11:44:51 2001 @@ -171,6 +171,9 @@ static bfd_byte gap_fill = 0; static boolean pad_to_set = false; static bfd_vma pad_to; +/* Use alternate machine code? */ +static int use_alt_mach_code = 0; + /* List of sections to add. */ struct section_add { @@ -240,6 +243,7 @@ static boolean weaken = false; #define OPTION_KEEPGLOBAL_SYMBOLS (OPTION_LOCALIZE_SYMBOLS + 1) #define OPTION_WEAKEN_SYMBOLS (OPTION_KEEPGLOBAL_SYMBOLS + 1) #define OPTION_RENAME_SECTION (OPTION_WEAKEN_SYMBOLS + 1) +#define OPTION_ALT_MACH_CODE (OPTION_RENAME_SECTION + 1) /* Options to handle if running as "strip". */ @@ -326,6 +330,7 @@ static struct option copy_options[] = {"keep-global-symbols", required_argument, 0, OPTION_KEEPGLOBAL_SYMBOLS}, {"localize-symbols", required_argument, 0, OPTION_LOCALIZE_SYMBOLS}, {"weaken-symbols", required_argument, 0, OPTION_WEAKEN_SYMBOLS}, + {"alt-machine-code", required_argument, 0, OPTION_ALT_MACH_CODE}, {0, no_argument, 0, 0} }; @@ -408,6 +413,7 @@ copy_usage (stream, exit_status) --localize-symbols -L for all symbols listed in \n\ --keep-global-symbols -G for all symbols listed in \n\ --weaken-symbols -W for all symbols listed in \n\ + --alt-machine-code Use alternate machine code for output\n\ -v --verbose List all object files modified\n\ -V --version Display this program's version number\n\ -h --help Display this output\n\ @@ -1244,6 +1250,15 @@ copy_object (ibfd, obfd) status = 1; return; } + + /* Switch to the alternate machine code. We have to do this at the + very end, because we only initialize the header when we create + the first section. */ + if (use_alt_mach_code != 0) + { + if (!bfd_alt_mach_code (obfd, use_alt_mach_code)) + non_fatal (_("unknown alternate machine code, ignored")); + } } /* Read each archive element in turn from IBFD, copy the @@ -2462,6 +2477,12 @@ copy_main (argc, argv) add_specific_symbols (optarg, &weaken_specific_list); break; + case OPTION_ALT_MACH_CODE: + use_alt_mach_code = atoi (optarg); + if (use_alt_mach_code <= 0) + fatal (_("alternate machine code index must be positive")); + break; + case 0: break; /* we've been given a long option */ diff -uprN binutils-2.11.90.0.27/binutils/readelf.c binutils-2.11.90.0.29/binutils/readelf.c --- binutils-2.11.90.0.27/binutils/readelf.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/binutils/readelf.c Mon Aug 27 11:44:51 2001 @@ -810,12 +810,24 @@ dump_relocations (file, rel_offset, rel_ return 0; } - if (is_rela) - printf - (_(" Offset Info Type Symbol's Value Symbol's Name Addend\n")); + if (is_32bit_elf) + { + if (is_rela) + printf + (_(" Offset Info Type Symbol's Value Symbol's Name Addend\n")); + else + printf + (_(" Offset Info Type Symbol's Value Symbol's Name\n")); + } else - printf - (_(" Offset Info Type Symbol's Value Symbol's Name\n")); + { + if (is_rela) + printf + (_(" Offset Info Type Symbol's Value Symbol's Name Addend\n")); + else + printf + (_(" Offset Info Type Symbol's Value Symbol's Name\n")); + } for (i = 0; i < rel_size; i++) { @@ -855,11 +867,26 @@ dump_relocations (file, rel_offset, rel_ #endif } + if (is_32bit_elf) + { #ifdef _bfd_int64_low - printf (" %8.8lx %5.5lx ", _bfd_int64_low (offset), _bfd_int64_low (info)); + printf ("%8.8lx %8.8lx ", _bfd_int64_low (offset), _bfd_int64_low (info)); #else - printf (" %8.8lx %5.5lx ", offset, info); + printf ("%8.8lx %8.8lx ", offset, info); #endif + } + else + { +#ifdef _bfd_int64_low + printf ("%8.8lx%8.8lx %8.8lx%8.8lx ", + _bfd_int64_high (offset), + _bfd_int64_low (offset), + _bfd_int64_high (info), + _bfd_int64_low (info)); +#else + printf ("%16.16lx %16.16lx ", offset, info); +#endif + } switch (elf_header.e_machine) { @@ -928,6 +955,7 @@ dump_relocations (file, rel_offset, rel_ break; case EM_PPC: + case EM_PPC64: rtype = elf_ppc_reloc_type (type); break; @@ -1574,9 +1602,15 @@ get_machine_flags (e_flags, e_machine) if (e_flags & EF_MIPS_CPIC) strcat (buf, ", cpic"); + if (e_flags & EF_MIPS_UCODE) + strcat (buf, ", ugen_reserved"); + if (e_flags & EF_MIPS_ABI2) strcat (buf, ", abi2"); + if (e_flags & EF_MIPS_32BITMODE) + strcat (buf, ", 32bitmode"); + if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1) strcat (buf, ", mips1"); @@ -7189,8 +7223,9 @@ display_debug_info (section, start, file return 0; } - printf (_(" <%d><%x>: Abbrev Number: %lu (%s)\n"), - level, tags - section_begin - bytes_read, + printf (_(" <%d><%lx>: Abbrev Number: %lu (%s)\n"), + level, + (unsigned long) (tags - section_begin - bytes_read), abbrev_number, get_TAG_name (entry->tag)); @@ -7609,10 +7644,10 @@ display_debug_frames (section, start, fi start += augmentation_data_len; } - printf ("\n%08lx %08lx %08lx FDE cie=%08x pc=%08lx..%08lx\n", + printf ("\n%08lx %08lx %08lx FDE cie=%08lx pc=%08lx..%08lx\n", (unsigned long)(saved_start - section_start), length, cie_id, - cie->chunk_start - section_start, fc->pc_begin, - fc->pc_begin + fc->pc_range); + (unsigned long)(cie->chunk_start - section_start), + fc->pc_begin, fc->pc_begin + fc->pc_range); if (! do_debug_frames_interp && augmentation_data_len) { unsigned long i; @@ -8511,7 +8546,8 @@ process_mips_specific (file) free (econf64); } - printf (_("\nSection '.conflict' contains %d entries:\n"), conflictsno); + printf (_("\nSection '.conflict' contains %ld entries:\n"), + (long) conflictsno); puts (_(" Num: Index Value Name")); for (cnt = 0; cnt < conflictsno; ++cnt) diff -uprN binutils-2.11.90.0.27/binutils/srconv.c binutils-2.11.90.0.29/binutils/srconv.c --- binutils-2.11.90.0.27/binutils/srconv.c Thu Mar 15 14:51:53 2001 +++ binutils-2.11.90.0.29/binutils/srconv.c Wed Aug 22 08:52:10 2001 @@ -1,5 +1,5 @@ /* srconv.c -- Sysroff conversion program - Copyright 1994, 1995, 1996, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -43,10 +43,62 @@ static int addrsize; static char *toolname; static char **rnames; -static void wr_cs (); -static void walk_tree_scope (); -static void wr_globals (); -static int find_base (); +static int get_member_id PARAMS ((int)); +static int get_ordinary_id PARAMS ((int)); +static char *section_translate PARAMS ((char *)); +static char *strip_suffix PARAMS ((char *)); +static void checksum PARAMS ((FILE *, char *, int, int)); +static void writeINT PARAMS ((int, char *, int *, int, FILE *)); +static void writeBITS PARAMS ((int, char *, int *, int)); +static void writeBARRAY PARAMS ((barray, char *, int *, int, FILE *)); +static void writeCHARS PARAMS ((char *, char *, int *, int, FILE *)); +static void wr_tr PARAMS ((void)); +static void wr_un PARAMS ((struct coff_ofile *, struct coff_sfile *, int, int)); +static void wr_hd PARAMS ((struct coff_ofile *)); +static void wr_sh PARAMS ((struct coff_ofile *, struct coff_section *)); +static void wr_ob PARAMS ((struct coff_ofile *, struct coff_section *)); +static void wr_rl PARAMS ((struct coff_ofile *, struct coff_section *)); +static void wr_object_body PARAMS ((struct coff_ofile *)); +static void wr_dps_start + PARAMS ((struct coff_sfile *, struct coff_section *, struct coff_scope *, + int, int)); +static void wr_dps_end + PARAMS ((struct coff_section *, struct coff_scope *, int)); +static int *nints PARAMS ((int)); +static void walk_tree_type_1 + PARAMS ((struct coff_sfile *, struct coff_symbol *, struct coff_type *, + int)); +static void walk_tree_type + PARAMS ((struct coff_sfile *, struct coff_symbol *, struct coff_type *, + int)); +static void walk_tree_symbol + PARAMS ((struct coff_sfile *, struct coff_section *, + struct coff_symbol *, int)); +static void walk_tree_scope + PARAMS ((struct coff_section *, struct coff_sfile *, struct coff_scope *, + int, int)); +static void walk_tree_sfile + PARAMS ((struct coff_section *, struct coff_sfile *)); +static void wr_program_structure + PARAMS ((struct coff_ofile *, struct coff_sfile *)); +static void wr_du PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); +static void wr_dus PARAMS ((struct coff_ofile *, struct coff_sfile *)); +static int find_base PARAMS ((struct coff_sfile *, struct coff_section *)); +static void wr_dln PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); +static void wr_globals + PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); +static void wr_debug PARAMS ((struct coff_ofile *)); +static void wr_cs PARAMS ((void)); +static int wr_sc PARAMS ((struct coff_ofile *, struct coff_sfile *)); +static void wr_er PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); +static void wr_ed PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); +static void wr_unit_info PARAMS ((struct coff_ofile *)); +static void wr_module PARAMS ((struct coff_ofile *)); +static int align PARAMS ((int)); +static void prescan PARAMS ((struct coff_ofile *)); +static void show_usage PARAMS ((FILE *, int)); +static void show_help PARAMS ((void)); +extern int main PARAMS ((int, char **)); static FILE *file; static bfd *abfd; @@ -641,7 +693,6 @@ nints (x) return (int *) (xcalloc (sizeof (int), x)); } -static void walk_tree_symbol (); static void walk_tree_type_1 (sfile, symbol, type, nest) struct coff_sfile *sfile; diff -uprN binutils-2.11.90.0.27/binutils/sysdump.c binutils-2.11.90.0.29/binutils/sysdump.c --- binutils-2.11.90.0.27/binutils/sysdump.c Thu Mar 15 14:51:54 2001 +++ binutils-2.11.90.0.29/binutils/sysdump.c Wed Aug 22 08:52:10 2001 @@ -1,5 +1,5 @@ /* Sysroff object format dumper. - Copyright 1994, 1995, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1994, 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -41,6 +41,30 @@ static int code; static int addrsize = 4; static FILE *file; +static void dh PARAMS ((unsigned char *, int)); +static void itheader PARAMS ((char *, int)); +static void p PARAMS ((void)); +static void tabout PARAMS ((void)); +static void pbarray PARAMS ((barray *)); +static int getone PARAMS ((int)); +static int opt PARAMS ((int)); +static void must PARAMS ((int)); +static void tab PARAMS ((int, char *)); +static void dump_symbol_info PARAMS ((void)); +static void derived_type PARAMS ((void)); +static void module PARAMS ((void)); +static void show_usage PARAMS ((FILE *, int)); +static void show_help PARAMS ((void)); + +extern char *getCHARS PARAMS ((unsigned char *, int *, int, int)); +extern int fillup PARAMS ((char *)); +extern barray getBARRAY PARAMS ((unsigned char *, int *, int, int)); +extern int getINT PARAMS ((unsigned char *, int *, int, int)); +extern int getBITS PARAMS ((char *, int *, int, int)); +extern void sysroff_swap_tr_in PARAMS ((void)); +extern void sysroff_print_tr_out PARAMS ((void)); +extern int main PARAMS ((int, char **)); + char * getCHARS (ptr, idx, size, max) unsigned char *ptr; @@ -548,8 +572,6 @@ tab (i, s) } } -static void derived_type (); - static void dump_symbol_info () { diff -uprN binutils-2.11.90.0.27/binutils/sysinfo.y binutils-2.11.90.0.29/binutils/sysinfo.y --- binutils-2.11.90.0.27/binutils/sysinfo.y Thu Mar 15 14:51:54 2001 +++ binutils-2.11.90.0.29/binutils/sysinfo.y Wed Aug 22 08:52:10 2001 @@ -72,6 +72,7 @@ top: { printf("#ifdef SYSROFF_PRINT\n"); printf("#include \n"); printf("#include \n"); + printf("#include \n"); break; } } @@ -103,6 +104,13 @@ it: { case 'd': printf("\n\n\n#define IT_%s_CODE 0x%x\n", it,code); + printf("struct IT_%s;\n", it); + printf("extern void sysroff_swap_%s_in PARAMS ((struct IT_%s *));\n", + $2, it); + printf("extern void sysroff_swap_%s_out PARAMS ((FILE *, struct IT_%s *));\n", + $2, it); + printf("extern void sysroff_print_%s_out PARAMS ((struct IT_%s *));\n", + $2, it); printf("struct IT_%s { \n", it); break; case 'i': diff -uprN binutils-2.11.90.0.27/binutils/testsuite/ChangeLog binutils-2.11.90.0.29/binutils/testsuite/ChangeLog --- binutils-2.11.90.0.27/binutils/testsuite/ChangeLog Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/binutils/testsuite/ChangeLog Mon Aug 27 11:44:51 2001 @@ -1,3 +1,15 @@ +2001-08-27 Alan Modra + + * binutils-all/readelf.s-64: Adjust offsets for powerpc64. Don't + use constructs like [45][08] when all combinations are not valid. + Instead use (48|50) to explicitly state which values are correct. + +2001-08-21 H.J. Lu + + * binutils-all/readelf.r: Updated for the readelf change. + + * binutils-all/readelf.r-64: New for the readelf change. + 2001-07-27 H.J. Lu * binutils-all/windres/windres.exp: Don't set xfail for diff -uprN binutils-2.11.90.0.27/binutils/testsuite/binutils-all/readelf.exp binutils-2.11.90.0.29/binutils/testsuite/binutils-all/readelf.exp --- binutils-2.11.90.0.27/binutils/testsuite/binutils-all/readelf.exp Sat Jun 23 00:05:22 2001 +++ binutils-2.11.90.0.29/binutils/testsuite/binutils-all/readelf.exp Mon Aug 27 11:44:51 2001 @@ -192,7 +192,7 @@ proc readelf_test { options binary_file set target_machine "" if [istarget "mips*-*-*"] then { - if { [istarget mips*el-*-*] || [istarget "mips*-*-*linux*"] } then { + if { [istarget "mips*-*-*linux*"] } then { set target_machine tmips } else { set target_machine mips diff -uprN binutils-2.11.90.0.27/binutils/testsuite/binutils-all/readelf.r binutils-2.11.90.0.29/binutils/testsuite/binutils-all/readelf.r --- binutils-2.11.90.0.27/binutils/testsuite/binutils-all/readelf.r Tue Jun 19 11:57:57 2001 +++ binutils-2.11.90.0.29/binutils/testsuite/binutils-all/readelf.r Wed Aug 22 08:52:10 2001 @@ -1,4 +1,4 @@ Relocation section '.rel.*text' at offset 0x.* contains 1 entries: - Offset Info Type Symbol's Value Symbol's Name.* - 00000004 [0-9A-Fa-f]+ *R_.*00000000 external_symbol.* + Offset Info Type Symbol's Value Symbol's Name.* +00000004 [0-9A-Fa-f]+ *R_.*00000000 external_symbol.* diff -uprN binutils-2.11.90.0.27/binutils/testsuite/binutils-all/readelf.r-64 binutils-2.11.90.0.29/binutils/testsuite/binutils-all/readelf.r-64 --- binutils-2.11.90.0.27/binutils/testsuite/binutils-all/readelf.r-64 Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/binutils/testsuite/binutils-all/readelf.r-64 Wed Aug 22 08:52:10 2001 @@ -0,0 +1,4 @@ + +Relocation section '.rel.*text' at offset 0x.* contains 1 entries: + Offset Info Type Symbol's Value Symbol's Name.* +0000000000000004 [0-9A-Fa-f]+ *R_.*0000000000000000 external_symbol.* diff -uprN binutils-2.11.90.0.27/binutils/testsuite/binutils-all/readelf.s-64 binutils-2.11.90.0.29/binutils/testsuite/binutils-all/readelf.s-64 --- binutils-2.11.90.0.27/binutils/testsuite/binutils-all/readelf.s-64 Tue Jan 23 10:59:26 2001 +++ binutils-2.11.90.0.29/binutils/testsuite/binutils-all/readelf.s-64 Mon Aug 27 11:44:51 2001 @@ -9,11 +9,11 @@ Section Headers: 00000000000000.. 0000000000000000 AX 0 0 .* \[ 2\] .rel.+text +REL. +0+ 0+.* 000000000000001. 000000000000001. . 1 8 - \[ 3\] .data PROGBITS 0000000000000000 000000[45][08] - 0000000000000004 0000000000000000 WA 0 0 .* - \[ 4\] .bss NOBITS 0000000000000000 000000[45][c4] + \[ 3\] .data PROGBITS 0000000000000000 000000(48|50) + 000000000000000[48] 0000000000000000 WA 0 0 .* + \[ 4\] .bss NOBITS 0000000000000000 000000(4c|50|54|58) 0000000000000000 0000000000000000 WA 0 0 .* - \[ 5\] .shstrtab STRTAB 0000000000000000 000000[45][c4] + \[ 5\] .shstrtab STRTAB 0000000000000000 000000(4c|50|54|58) 00000000000000.. 0000000000000000 0 0 .* \[ 6\] .symtab SYMTAB 0000000000000000 0+.* 0+.* 0000000000000018 7 6 8 diff -uprN binutils-2.11.90.0.27/binutils/unwind-ia64.c binutils-2.11.90.0.29/binutils/unwind-ia64.c --- binutils-2.11.90.0.27/binutils/unwind-ia64.c Sat Jun 23 17:49:21 2001 +++ binutils-2.11.90.0.29/binutils/unwind-ia64.c Wed Aug 22 08:52:10 2001 @@ -33,6 +33,12 @@ Foundation, 59 Temple Place - Suite 330, static bfd_vma unw_rlen = 0; +static void unw_print_brmask PARAMS ((char *, unsigned char)); +static void unw_print_grmask PARAMS ((char *, unsigned char)); +static void unw_print_frmask PARAMS ((char *, long unsigned int)); +static void unw_print_abreg PARAMS ((char *, unsigned char)); +static void unw_print_xyreg PARAMS ((char *, unsigned char, unsigned char)); + static void unw_print_brmask (cp, mask) char * cp; diff -uprN binutils-2.11.90.0.27/binutils.spec binutils-2.11.90.0.29/binutils.spec --- binutils-2.11.90.0.27/binutils.spec Fri Aug 10 13:55:09 2001 +++ binutils-2.11.90.0.29/binutils.spec Mon Aug 27 08:56:43 2001 @@ -9,7 +9,7 @@ Summary: A GNU collection of binary utilities. Name: binutils -Version: 2.11.90.0.27 +Version: 2.11.90.0.29 Release: 1 Copyright: GPL Group: Development/Tools diff -uprN binutils-2.11.90.0.27/config.guess binutils-2.11.90.0.29/config.guess --- binutils-2.11.90.0.27/config.guess Fri Mar 23 13:52:00 2001 +++ binutils-2.11.90.0.29/config.guess Wed Aug 22 08:52:09 2001 @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. -timestamp='2001-03-16' +timestamp='2001-08-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -52,7 +52,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -95,25 +95,25 @@ trap 'rm -f $dummy.c $dummy.o $dummy.rel # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int dummy(){}" > $dummy.c +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 ; do - ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then - CC_FOR_BUILD="$c"; break - fi - done - rm -f $dummy.c $dummy.o $dummy.rel + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found + CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac +esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) +# (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi @@ -150,6 +150,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ # to ELF recently, or will in the future. case "${UNAME_MACHINE}" in i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then @@ -204,6 +205,7 @@ main: jsr \$26,exit .end main EOF + eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in @@ -225,6 +227,9 @@ EOF 2-307) UNAME_MACHINE="alphaev67" ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; esac fi rm -f $dummy.s $dummy @@ -406,12 +411,16 @@ EOF exit (-1); } EOF + eval $set_cc_for_build $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; @@ -459,7 +468,7 @@ EOF ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) + i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) @@ -483,6 +492,7 @@ EOF exit(0); } EOF + eval $set_cc_for_build $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 @@ -583,6 +593,7 @@ EOF exit (0); } EOF + eval $set_cc_for_build (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy @@ -620,6 +631,7 @@ EOF exit (0); } EOF + eval $set_cc_for_build $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 @@ -630,7 +642,7 @@ EOF 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; - *9??*:MPE/iX:*:*) + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) @@ -639,7 +651,7 @@ EOF hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; - i?86:OSF1:*:*) + i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else @@ -674,12 +686,13 @@ EOF echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' @@ -705,7 +718,7 @@ EOF hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) @@ -760,97 +773,29 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) - cat >$dummy.c < /* for printf() prototype */ -int main (int argc, char *argv[]) { -#else -int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __MIPSEB__ - printf ("%s-unknown-linux-gnu\n", argv[1]); -#endif -#ifdef __MIPSEL__ - printf ("%sel-unknown-linux-gnu\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in + big) echo mips-unknown-linux-gnu && exit 0 ;; + little) echo mipsel-unknown-linux-gnu && exit 0 ;; + esac ;; ppc:Linux:*:*) - # Determine Lib Version - cat >$dummy.c < -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif -main(argc, argv) - int argc; - char *argv[]; -{ -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); -#else - printf("unknown\n"); -#endif - return 0; -} -EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then LIBC="libc1" ; fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) - cat <$dummy.s - .data - \$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - .text - .globl main - .align 4 - .ent main - main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) UNAME_MACHINE="alpha" ;; - 1-0) UNAME_MACHINE="alphaev5" ;; - 1-1) UNAME_MACHINE="alphaev56" ;; - 1-101) UNAME_MACHINE="alphapca56" ;; - 2-303) UNAME_MACHINE="alphaev6" ;; - 2-307) UNAME_MACHINE="alphaev67" ;; - esac - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) @@ -876,42 +821,31 @@ EOF x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; - i?86:Linux:*:*) + i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. - ld_supported_emulations=`cd /; ld --help 2>&1 \ - | sed -ne '/supported emulations:/!d + ld_supported_targets=`cd /; ld --help 2>&1 \ + | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g - s/.*supported emulations: *// + s/.*supported targets: *// s/ .*// p'` - case "$ld_supported_emulations" in - i?86linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 - ;; - elf_i?86) + case "$ld_supported_targets" in + elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; - i?86coff) + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 - ;; - esac - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; esac # Determine whether the default compiler is a.out or elf cat >$dummy.c <= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); + printf ("%s-pc-linux-gnu\n", argv[1]); # else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); + printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif # else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); + printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif #else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); + printf ("%s-pc-linux-gnuaout\n", argv[1]); #endif return 0; } EOF + eval $set_cc_for_build $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) + i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, @@ -955,7 +891,7 @@ EOF # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} @@ -963,16 +899,15 @@ EOF echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; - i?86:*:5:7*) - # Fixed at (any) Pentium or better - UNAME_MACHINE=i586 - if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then - echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; - i?86:*:3.2:*) + i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) @@ -1044,7 +979,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) @@ -1064,8 +999,8 @@ EOF echo ns32k-sni-sysv fi exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) @@ -1077,6 +1012,10 @@ EOF # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; @@ -1146,7 +1085,7 @@ EOF fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; - i?86:OS/2:*:*) + i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx @@ -1169,6 +1108,9 @@ EOF *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1288,6 +1230,7 @@ main () } EOF +eval $set_cc_for_build $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy diff -uprN binutils-2.11.90.0.27/config.sub binutils-2.11.90.0.29/config.sub --- binutils-2.11.90.0.27/config.sub Fri Mar 23 14:37:24 2001 +++ binutils-2.11.90.0.29/config.sub Wed Aug 22 08:52:09 2001 @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. -timestamp='2001-03-19' +timestamp='2001-08-13' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -117,7 +117,7 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*) + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -157,6 +157,14 @@ case $os in os=-vxworks basic_machine=$1 ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; -hiux*) os=-hiuxwe2 ;; @@ -219,25 +227,35 @@ esac case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \ - | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \ - | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | x86 | ppcbe | mipsbe | mipsle | shbe | shle \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | hppa64 \ - | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ - | alphaev6[78] \ - | we32k | ns16k | clipper | i370 | sh | sh[34] \ - | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp10 | pdp11 \ - | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \ - | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \ - | pj | pjl | h8500) + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dsp16xx \ + | fr30 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipsel | mipsle | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | s390 | s390x \ + | sh | sh[34] | sh[34]eb | shbe | shle \ + | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 \ + | we32k \ + | x86 | xscale \ + | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -245,13 +263,13 @@ case $basic_machine in basic_machine=$basic_machine-unknown os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[234567]86 | x86_64) + i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -260,30 +278,43 @@ case $basic_machine in exit 1 ;; # Recognize the basic CPU types with company name. - # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \ - | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ - | hppa2.0n-* | hppa64-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ - | alphaev6[78]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* | mcore-* \ - | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \ - | [cjt]90-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \ - | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*) + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alphapca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cray2-* | cydra-* \ + | d10v-* | d30v-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | m32r-* \ + | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipsel-* \ + | mipsle-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | s390-* | s390x-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \ + | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ + | ymp-* \ + | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -510,19 +541,19 @@ case $basic_machine in basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) + i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[34567]86v4*) + i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[34567]86v) + i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[34567]86sol2) + i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; @@ -729,6 +760,16 @@ case $basic_machine in ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; ps2) basic_machine=i386-ibm ;; @@ -883,6 +924,10 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; xmp) basic_machine=xmp-cray os=-unicos @@ -936,10 +981,10 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4) + sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; - sparc | sparcv9) + sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -961,6 +1006,9 @@ case $basic_machine in basic_machine=c4x-none os=-coff ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -1017,16 +1065,18 @@ case $os in | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*) + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in - x86-* | i[34567]86-*) + x86-* | i*86-*) ;; *) os=-nto$os @@ -1345,6 +1395,9 @@ case $basic_machine in -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; + -vos*) + vendor=stratus + ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; diff -uprN binutils-2.11.90.0.27/gas/ChangeLog binutils-2.11.90.0.29/gas/ChangeLog --- binutils-2.11.90.0.27/gas/ChangeLog Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/gas/ChangeLog Mon Aug 27 11:44:51 2001 @@ -1,3 +1,146 @@ +2001-08-27 Torbjorn Granlund + Staffan Ulfberg + Linus Nordberg + Alan Modra + + * configure.in: Recognise powerpc*le*, not just powerpcle*. + * configure: Regenerate. + * config/tc-ppc.c (PPC_LO, PPC_HI, PPC_HA, PPC_HIGHER, + PPC_HIGHERA, PPC_HIGHEST, PPC_HIGHESTA, SEX16): New macros. + (md_assemble): Use them. + (ppc_machine): Support stub for ELF64 as well as XCOFF. + (md_pseudo_table): Add "llong", "quad". + (md_parse_option): Match default_cpu of powerpc*. + (ppc_arch): Likewise. + (ppc_subseg_align): Only for OBJ_XCOFF. + (ppc_target_format): Return elf64-powerpc strings for 64 bit ELF. + (md_begin): Select PPC_OPCODE_64 for 64 bit. + (ppc_insert_operand): Don't bother testing 'file' before calling + as_bad_where. Use as_bad_where for operand->insert errors. + (mapping): Add ELF64 relocation modifiers. + (ppc_elf_suffix): Replace symbol on BFD_RELOC_PPC64_TOC reloc + expressions with abs_symbol. + (ppc_elf_cons): Correct offset for little endian targets. + (ppc_elf_frob_symbol): New. + (md_assemble): Add support for 64 bit ELF relocs. + (ppc_tc): Ensure 8 byte alignment when 64 bit. + (ppc_is_toc_sym): Only define for OBJ_XCOFF and OBJ_ELF. Match + ".toc" section for 64 bit ELF. + (ppc_fix_adjustable): New. Macro body moved from tc-ppc.h. + (md_apply_fix3): Silence warning with ATTRIBUTE_UNUSED. Only do + the ppc_is_toc_sym check for OBJ_XCOFF and OBJ_ELF. For 64 bit, + use BFD_RELOC_PPC64_TOC16_DS instead of BFD_RELOC_PPC_TOC16. + Expand on comments, error message. Add support for 64 bit relocs, + and use PPC_HI etc. macros. + * config/tc-ppc.h (MAX_MEM_FOR_RS_ALIGN_CODE): Define. + (HANDLE_ALIGN): Define to generate nops in code sections rather + than zeros. + (TC_FORCE_RELOCATION): Force for BFD_RELOC_PPC64_TOC. + (ELF_TC_SPECIAL_SECTIONS): Add 64 bit ELF sections. + (tc_fix_adjustable): Move body of macro to tc-ppc.c. + (ppc_fix_adjustable): Declare. + (tc_frob_symbol): Define. + (ppc_elf_frob_symbol): Declare. + +2001-08-26 Andreas Jaeger + + * config/tc-s390.c: Add missing prototypes + (md_gather_operands): Make static. + +2001-08-26 Thiemo Seufer + + * tc_mips.h (MAX_GPREL_OFFSET): Change it to the maximum allowed + value, not the word beyond maximum. + * tc_mips.c (macro_build_lui): Code cleanup. + (macro): Reflect change to MAX_GPREL_OFFSET. + (mips_ip): Check explicitly against S_EX_NONE. + (my_get_SmallExpression): parse for %gp_rel, not %gprel. + (md_apply_fix): Code cleanup. + +2001-08-24 Andreas Jaeger + + * config/tc-ppc.h: Fix prototype declaration. + +2001-08-23 Jakub Jelinek + + * config/tc-ia64.c (dot_endp): Set function symbol sizes. + * config/obj-elf.c (obj_elf_size): When size is constant, free + and clear symbol_get_obj(sym)->size if any. + +2001-08-21 Thiemo Seufer + + * tc_mips.c (md_begin): Warn about incompatibility between -march=FOO + and -mipsN option, continue with default ISA. + +2001-08-21 Thiemo Seufer + + * config/tc-mips.c (md_parse_option): #ifdef the + traditional/non-traditional names as it is done in mips_target_format. + +2001-08-20 Richard Henderson + + * config/tc-alpha.h (MD_APPLY_FIX3): Define. + * config/tc-alpha.c (md_apply_fix3): Rename from md_apply_fix; + use seg parameter instead of now_seg. + +2001-08-18 H.J. Lu + + * config/tc-mips.c (show): Add the missing prototype. + +2001-08-18 Thiemo Seufer + + * config/tc-mips.c (S_EX_*): New enum for my_getSmallExpression() + return values. + (mips_ip): Use the new return values instead of characters. Add + support for %higher and %highest. + (LP): Remove. + (RP): Remove. + (my_getSmallExpression): Make parsing case insensitive and more + reliable. Add support for %higher and %highest. Further support to + parse %gprel and %neg is implemented but currently deactivated. + +2001-08-17 Alan Modra + + * ecoff.c (ecoff_frob_symbol): Remove casts from bfd_get_gp_size. + (ecoff_build_symbols): Likewise. + * read.c (s_lcomm_internal): Fix signed/unsigned warning. + +2001-08-16 Thiemo Seufer + + * config/tc-mips.c (mips_elf_final_processing): Set elf header flags + for n32 ABI if appropriate. + +2001-08-16 Thiemo Seufer + + * config/tc-mips.c (cons_fix_new_mips): Remove. + * config/tc-mips.h (TC_CONS_FIX_NEW): Remove. + (cons_fix_new_mips): Remove. + +2001-08-14 Jeff Johnston + + * expr.c (operand)[LITERAL_PREFIXDOLLAR_HEX]: Treat $L as + a label, not a hex constant. + +2001-08-13 Nick Clifton + + * config/tc-v850.h: Add missing prototypes. + +2001-08-12 Martin Schwidefsky + + * config/tc-s390.c (s390_elf_cons): Correct fixups for PLT + relocations. + +2001-08-12 TAKAI Kousuke + + * config/tc-sparc.c (cons_fix_new_sparc): Move + `sparc_no_align_cons = 0;' to... + (s_uacons): ...here so that sparc_no_align_cons will get + cleared properly. + +2001-08-11 Kazu Hirata + + * config/tc-mips.c: Fix a comment typo. + 2001-08-10 Richard Sandiford * config/tc-mips.c (move_register): New function. @@ -1502,7 +1645,7 @@ * dwarf2dbg.c (dwarf2_directive_file): Call s_app_file (0) if BFD_ASSEMBLER is not defined. -2001-02-23 Richard Sandiford +2001-02-23 Richard Sandiford * config/tc-mn10300.c (md_apply_fix3): Don't mark a fixup as done if it's against a symbol. @@ -1706,7 +1849,7 @@ Mon Feb 12 17:45:50 CET 2001 Jan Hubick * config/tc-sh.c (md_pseudo_table): Add uaquad. Use s_uacons for 2byte, 4byte and 8byte. -2001-02-08 Alan Modra +2001-02-08 Alan Modra * config/tc-hppa.c (pa_build_unwind_subspace): Don't call md_number_to_chars with size > sizeof (valueT). @@ -2409,7 +2552,7 @@ Mon Dec 11 14:35:42 MET 2000 Jan hubick * doc/as.texinfo: Correct description of MIPS -mcpu option, by copying some of the text from doc/c-mips.texi. -2000-12-01 Joel Sherrill +2000-12-01 Joel Sherrill * configure.in (arm-*-rtems*, a29k-*rtems*, h8300-*-rtems*): New targets. @@ -5920,7 +6063,7 @@ Fri Feb 11 14:21:51 2000 Jeffrey A Law * config/tc-ppc.c (ppc_fix_adjustable): Don't look at the frag of a symbol when we really care about its value. -2000-01-19 Chandra Chavva +2000-01-19 Chandra Chavva * config/tc-mcore.c (md_assemble): Give warning message if operands passes to instruction are more than the spec. @@ -5929,7 +6072,7 @@ Fri Feb 11 14:21:51 2000 Jeffrey A Law * config/tc-arm.c (armadjust_symtab): If the assembler is in Thumb mode but the label seen was not declared as '.thumb_func' - then set the ST_INFO type to STT_ARM_16BIT mode. This allows + then set the ST_INFO type to STT_ARM_16BIT mode. This allows correct disassembly of Thumb code bounded by non function labels. 2000-01-27 Alan Modra diff -uprN binutils-2.11.90.0.27/gas/config/obj-elf.c binutils-2.11.90.0.29/gas/config/obj-elf.c --- binutils-2.11.90.0.27/gas/config/obj-elf.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/gas/config/obj-elf.c Mon Aug 27 11:44:51 2001 @@ -1453,7 +1453,14 @@ obj_elf_size (ignore) sym = symbol_find_or_make (name); *p = c; if (exp.X_op == O_constant) - S_SET_SIZE (sym, exp.X_add_number); + { + S_SET_SIZE (sym, exp.X_add_number); + if (symbol_get_obj (sym)->size) + { + xfree (symbol_get_obj (sym)->size); + symbol_get_obj (sym)->size = NULL; + } + } else { symbol_get_obj (sym)->size = diff -uprN binutils-2.11.90.0.27/gas/config/tc-alpha.c binutils-2.11.90.0.29/gas/config/tc-alpha.c --- binutils-2.11.90.0.27/gas/config/tc-alpha.c Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.29/gas/config/tc-alpha.c Wed Aug 22 08:52:10 2001 @@ -1159,9 +1159,10 @@ md_pcrel_from (fixP) GPDISP. */ int -md_apply_fix (fixP, valueP) +md_apply_fix3 (fixP, valueP, seg) fixS *fixP; valueT *valueP; + segT seg; { char * const fixpos = fixP->fx_frag->fr_literal + fixP->fx_where; valueT value = *valueP; @@ -1196,7 +1197,7 @@ md_apply_fix (fixP, valueP) #endif do_reloc_gp: - fixP->fx_addsy = section_symbol (now_seg); + fixP->fx_addsy = section_symbol (seg); md_number_to_chars (fixpos, value, 2); break; diff -uprN binutils-2.11.90.0.27/gas/config/tc-alpha.h binutils-2.11.90.0.29/gas/config/tc-alpha.h --- binutils-2.11.90.0.27/gas/config/tc-alpha.h Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/gas/config/tc-alpha.h Wed Aug 22 08:52:10 2001 @@ -49,6 +49,7 @@ extern valueT alpha_gp_value; #define TC_FORCE_RELOCATION(FIXP) alpha_force_relocation (FIXP) #define tc_fix_adjustable(FIXP) alpha_fix_adjustable (FIXP) #define RELOC_REQUIRES_SYMBOL +#define MD_APPLY_FIX3 /* This expression evaluates to false if the relocation is for a local object for which we still want to do the relocation at runtime. diff -uprN binutils-2.11.90.0.27/gas/config/tc-ia64.c binutils-2.11.90.0.29/gas/config/tc-ia64.c --- binutils-2.11.90.0.27/gas/config/tc-ia64.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/gas/config/tc-ia64.c Mon Aug 27 11:44:51 2001 @@ -3841,6 +3841,8 @@ dot_endp (dummy) segT saved_seg; subsegT saved_subseg; const char *sec_name, *text_name; + char *name, *p, c; + symbolS *sym; if (unwind.saved_text_seg) { @@ -3897,9 +3899,6 @@ dot_endp (dummy) if (strcmp (text_name, ".text") == 0) text_name = ""; - expression (&e); - demand_empty_rest_of_line (); - insn_group_break (1, 0, 0); /* If there wasn't a .handlerdata, we haven't generated an image yet. */ @@ -3955,6 +3954,50 @@ dot_endp (dummy) } subseg_set (saved_seg, saved_subseg); + + /* Parse names of main and alternate entry points and set symbol sizes. */ + while (1) + { + SKIP_WHITESPACE (); + name = input_line_pointer; + c = get_symbol_end (); + p = input_line_pointer; + sym = symbol_find (name); + if (sym && unwind.proc_start + && (symbol_get_bfdsym (sym)->flags & BSF_FUNCTION) + && S_GET_SIZE (sym) == 0 && symbol_get_obj (sym)->size == NULL) + { + fragS *fr = symbol_get_frag (unwind.proc_start); + fragS *frag = symbol_get_frag (sym); + + /* Check whether the function label is at or beyond last + .proc directive. */ + while (fr && fr != frag) + fr = fr->fr_next; + if (fr) + { + if (frag == frag_now && SEG_NORMAL (now_seg)) + S_SET_SIZE (sym, frag_now_fix () - S_GET_VALUE (sym)); + else + { + symbol_get_obj (sym)->size = + (expressionS *) xmalloc (sizeof (expressionS)); + symbol_get_obj (sym)->size->X_op = O_subtract; + symbol_get_obj (sym)->size->X_add_symbol + = symbol_new (FAKE_LABEL_NAME, now_seg, + frag_now_fix (), frag_now); + symbol_get_obj (sym)->size->X_op_symbol = sym; + symbol_get_obj (sym)->size->X_add_number = 0; + } + } + } + *p = c; + SKIP_WHITESPACE (); + if (*input_line_pointer != ',') + break; + ++input_line_pointer; + } + demand_empty_rest_of_line (); unwind.proc_start = unwind.proc_end = unwind.info = 0; } diff -uprN binutils-2.11.90.0.27/gas/config/tc-mips.c binutils-2.11.90.0.29/gas/config/tc-mips.c --- binutils-2.11.90.0.27/gas/config/tc-mips.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/gas/config/tc-mips.c Mon Aug 27 11:44:51 2001 @@ -727,6 +727,20 @@ static int mips16_extended_frag PARAMS ( static const char *mips_isa_to_str PARAMS ((int)); static const char *mips_cpu_to_str PARAMS ((int)); static int validate_mips_insn PARAMS ((const struct mips_opcode *)); +static void show PARAMS ((FILE *, char *, int *, int *)); + +/* Return values of my_getSmallExpression() */ + +enum +{ + S_EX_NONE = 0, + S_EX_LO, + S_EX_HI, + S_EX_HIGHER, + S_EX_HIGHEST, + S_EX_GPREL, + S_EX_NEG +}; /* Table and functions used to map between CPU/ISA names, and ISA levels, and CPU numbers. */ @@ -996,7 +1010,23 @@ md_begin () the command line, or will be set otherwise if one was. */ if (mips_arch != CPU_UNKNOWN && mips_opts.isa != ISA_UNKNOWN) { - /* We have it all. There's nothing to do. */ + /* We have to check if the isa is the default isa of arch. Otherwise + we'll get invalid object file headers. */ + ci = mips_cpu_info_from_cpu (mips_arch); + assert (ci != NULL); + if (mips_opts.isa != ci->isa) + { + /* This really should be an error instead of a warning, but old + compilers only have -mcpu which sets both arch and tune. For + now, we discard arch and preserve tune. */ + as_warn (_("The -march option is incompatible to -mipsN and " + "therefore ignored.")); + if (mips_tune == CPU_UNKNOWN) + mips_tune = mips_arch; + ci = mips_cpu_info_from_isa (mips_opts.isa); + assert (ci != NULL); + mips_arch = ci->cpu; + } } else if (mips_arch != CPU_UNKNOWN && mips_opts.isa == ISA_UNKNOWN) { @@ -2847,10 +2877,8 @@ macro_build_lui (place, counter, ep, reg if (high_expr.X_op == O_constant) { /* we can compute the instruction now without a relocation entry */ - if (high_expr.X_add_number & 0x8000) - high_expr.X_add_number += 0x10000; - high_expr.X_add_number = - ((unsigned long) high_expr.X_add_number >> 16) & 0xffff; + high_expr.X_add_number = ((high_expr.X_add_number + 0x8000) + >> 16) & 0xffff; r = BFD_RELOC_UNUSED; } else @@ -4952,7 +4980,7 @@ macro (ip) With a constant we always use the latter case. */ if (breg == 0) { - if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET + if ((valueT) offset_expr.X_add_number > MAX_GPREL_OFFSET || nopic_need_relax (offset_expr.X_add_symbol, 1)) p = NULL; else @@ -4977,7 +5005,7 @@ macro (ip) } else { - if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET + if ((valueT) offset_expr.X_add_number > MAX_GPREL_OFFSET || nopic_need_relax (offset_expr.X_add_symbol, 1)) p = NULL; else @@ -5472,7 +5500,7 @@ macro (ip) If there is a base register, we add it to $at after the lui instruction. If there is a constant, we always use the last case. */ - if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET + if ((valueT) offset_expr.X_add_number > MAX_GPREL_OFFSET || nopic_need_relax (offset_expr.X_add_symbol, 1)) { p = NULL; @@ -5789,7 +5817,7 @@ macro (ip) R4000 uses interlocks to handle coproc delays. Other chips (like the R3000) require nops to be inserted for delays. - FIXME: Currently, we require that the user handles delays. + FIXME: Currently, we require that the user handle delays. In order to fill delay slots for non-interlocked chips, we must have a way to specify delays based on the coprocessor. Eg. 4 cycles if load coproc reg from memory, 1 if in cache, etc. @@ -7655,14 +7683,18 @@ mips_ip (str, ip) case 'j': /* 16 bit signed immediate */ imm_reloc = BFD_RELOC_LO16; c = my_getSmallExpression (&imm_expr, s); - if (c != '\0') + if (c != S_EX_NONE) { - if (c != 'l') + if (c != S_EX_LO) { if (imm_expr.X_op == O_constant) imm_expr.X_add_number = (imm_expr.X_add_number >> 16) & 0xffff; - else if (c == 'h') + else if (c == S_EX_HIGHEST) + imm_reloc = BFD_RELOC_MIPS_HIGHEST; + else if (c == S_EX_HIGHER) + imm_reloc = BFD_RELOC_MIPS_HIGHER; + else if (c == S_EX_HI) { imm_reloc = BFD_RELOC_HI16_S; imm_unmatched_hi = true; @@ -7675,7 +7707,7 @@ mips_ip (str, ip) } if (*args == 'i') { - if ((c == '\0' && imm_expr.X_op != O_constant) + if ((c == S_EX_NONE && imm_expr.X_op != O_constant) || ((imm_expr.X_add_number < 0 || imm_expr.X_add_number >= 0x10000) && imm_expr.X_op == O_constant)) @@ -7708,7 +7740,7 @@ mips_ip (str, ip) max = 0x8000; else max = 0x10000; - if ((c == '\0' && imm_expr.X_op != O_constant) + if ((c == S_EX_NONE && imm_expr.X_op != O_constant) || ((imm_expr.X_add_number < -0x8000 || imm_expr.X_add_number >= max) && imm_expr.X_op == O_constant) @@ -7742,7 +7774,7 @@ mips_ip (str, ip) fashion is that the macro function doesn't expect to see anything which can be handled in a single constant instruction. */ - if (c == 0 + if (c == S_EX_NONE && (offset_expr.X_op != O_constant || offset_expr.X_add_number >= 0x8000 || offset_expr.X_add_number < -0x8000) @@ -7752,7 +7784,7 @@ mips_ip (str, ip) != S_GET_SEGMENT (offset_expr.X_op_symbol)))) break; - if (c == 'h' || c == 'H') + if (c == S_EX_HI) { if (offset_expr.X_op != O_constant) break; @@ -7772,14 +7804,16 @@ mips_ip (str, ip) case 'u': /* upper 16 bits */ c = my_getSmallExpression (&imm_expr, s); imm_reloc = BFD_RELOC_LO16; - if (c) + if (c != S_EX_NONE) { - if (c != 'l') + if (c != S_EX_LO) { if (imm_expr.X_op == O_constant) imm_expr.X_add_number = (imm_expr.X_add_number >> 16) & 0xffff; - else if (c == 'h') + else if (c == S_EX_HIGHEST) + imm_reloc = BFD_RELOC_MIPS_HIGHEST; + else if (c == S_EX_HI) { imm_reloc = BFD_RELOC_HI16_S; imm_unmatched_hi = true; @@ -8581,8 +8615,6 @@ mips16_immed (file, line, type, val, war } } -#define LP '(' -#define RP ')' static int my_getSmallExpression (ep, str) @@ -8590,85 +8622,145 @@ my_getSmallExpression (ep, str) char *str; { char *sp; - int c = 0; + char *oldstr = str; + int c = S_EX_NONE; if (*str == ' ') str++; - if (*str == LP - || (*str == '%' && - ((str[1] == 'h' && str[2] == 'i') - || (str[1] == 'H' && str[2] == 'I') - || (str[1] == 'l' && str[2] == 'o')) - && str[3] == LP)) + if (*str == '(') + c = S_EX_NONE; + else if (str[0] == '%' + && tolower(str[1]) == 'l' + && tolower(str[2]) == 'o' + && str[3] == '(') + { + c = S_EX_LO; + str += sizeof ("%lo(") - 2; + } + else if (str[0] == '%' + && tolower(str[1]) == 'h' + && tolower(str[2]) == 'i' + && str[3] == '(') + { + c = S_EX_HI; + str += sizeof ("%hi(") - 2; + } + else if (str[0] == '%' + && tolower(str[1]) == 'h' + && tolower(str[2]) == 'i' + && tolower(str[3]) == 'g' + && tolower(str[4]) == 'h' + && tolower(str[5]) == 'e' + && tolower(str[6]) == 'r' + && str[7] == '(') + { + c = S_EX_HIGHER; + str += sizeof ("%higher(") - 2; + } + else if (str[0] == '%' + && tolower(str[1]) == 'h' + && tolower(str[2]) == 'i' + && tolower(str[3]) == 'g' + && tolower(str[4]) == 'h' + && tolower(str[5]) == 'e' + && tolower(str[6]) == 's' + && tolower(str[7]) == 't' + && str[8] == '(') { - if (*str == LP) - c = 0; - else + c = S_EX_HIGHEST; + str += sizeof ("%highest(") - 2; + } +/* currently unsupported */ +#if 0 + else if (str[0] == '%' + && tolower(str[1]) == 'g' + && tolower(str[2]) == 'p' + && tolower(str[3]) == '_' + && tolower(str[4]) == 'r' + && tolower(str[5]) == 'e' + && tolower(str[6]) == 'l' + && str[7] == '(') + { + c = S_EX_GPREL; + str += sizeof ("%gp_rel(") - 2; + } + else if (str[0] == '%' + && tolower(str[1]) == 'n' + && tolower(str[2]) == 'e' + && tolower(str[3]) == 'g' + && str[4] == '(') + { + c = S_EX_NEG; + str += sizeof ("%neg(") - 2; + } +#endif + else + { + my_getExpression (ep, str); + return c; + } + + /* + * A small expression may be followed by a base register. + * Scan to the end of this operand, and then back over a possible + * base register. Then scan the small expression up to that + * point. (Based on code in sparc.c...) + */ + for (sp = str; *sp && *sp != ','; sp++) + ; + if (sp - 4 >= str && sp[-1] == ')') + { + if (isdigit ((unsigned char) sp[-2])) { - c = str[1]; - str += 3; + for (sp -= 3; sp >= str && isdigit ((unsigned char) *sp); sp--) + ; + if (*sp == '$' && sp > str && sp[-1] == '(') + { + sp--; + goto do_it; + } } - - /* - * A small expression may be followed by a base register. - * Scan to the end of this operand, and then back over a possible - * base register. Then scan the small expression up to that - * point. (Based on code in sparc.c...) - */ - for (sp = str; *sp && *sp != ','; sp++) - ; - if (sp - 4 >= str && sp[-1] == RP) - { - if (isdigit ((unsigned char) sp[-2])) - { - for (sp -= 3; sp >= str && isdigit ((unsigned char) *sp); sp--) - ; - if (*sp == '$' && sp > str && sp[-1] == LP) - { - sp--; - goto do_it; - } - } - else if (sp - 5 >= str - && sp[-5] == LP - && sp[-4] == '$' - && ((sp[-3] == 'f' && sp[-2] == 'p') - || (sp[-3] == 's' && sp[-2] == 'p') - || (sp[-3] == 'g' && sp[-2] == 'p') - || (sp[-3] == 'a' && sp[-2] == 't'))) - { - sp -= 5; - do_it: - if (sp == str) + else if (sp - 5 >= str + && sp[-5] == '(' + && sp[-4] == '$' + && ((sp[-3] == 'f' && sp[-2] == 'p') + || (sp[-3] == 's' && sp[-2] == 'p') + || (sp[-3] == 'g' && sp[-2] == 'p') + || (sp[-3] == 'a' && sp[-2] == 't'))) + { + sp -= 5; + do_it: + if (sp == str) + { + /* no expression means zero offset */ + if (c != S_EX_NONE) { - /* no expression means zero offset */ - if (c) - { - /* %xx(reg) is an error */ - ep->X_op = O_absent; - expr_end = str - 3; - } - else - { - ep->X_op = O_constant; - expr_end = sp; - } - ep->X_add_symbol = NULL; - ep->X_op_symbol = NULL; - ep->X_add_number = 0; + /* %xx(reg) is an error */ + ep->X_op = O_absent; + expr_end = oldstr; } else { - *sp = '\0'; - my_getExpression (ep, str); - *sp = LP; + ep->X_op = O_constant; + expr_end = sp; } - return c; + ep->X_add_symbol = NULL; + ep->X_op_symbol = NULL; + ep->X_add_number = 0; + } + else + { + *sp = '\0'; + my_getExpression (ep, str); + *sp = '('; } + return c; } } my_getExpression (ep, str); - return c; /* => %hi or %lo encountered */ + + /* => %highest, %higher, %hi, %lo, %gprel, %neg encountered */ + return c; } static void @@ -9129,10 +9221,14 @@ md_parse_option (c, arg) list = bfd_target_list (); for (l = list; *l != NULL; l++) - if (strcmp (*l, "elf64-bigmips") == 0 - || strcmp (*l, "elf64-littlemips") == 0 - || strcmp (*l, "elf64-tradbigmips") == 0 +#ifdef TE_TMIPS + /* This is traditional mips */ + if (strcmp (*l, "elf64-tradbigmips") == 0 || strcmp (*l, "elf64-tradlittlemips") == 0) +#else + if (strcmp (*l, "elf64-bigmips") == 0 + || strcmp (*l, "elf64-littlemips") == 0) +#endif break; if (*l == NULL) as_fatal (_("No compiled in support for 64 bit object file format")); @@ -9340,37 +9436,6 @@ md_pcrel_from (fixP) return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address; } -/* This is called by emit_expr via TC_CONS_FIX_NEW when creating a - reloc for a cons. We could use the definition there, except that - we want to handle 64 bit relocs specially. */ - -void -cons_fix_new_mips (frag, where, nbytes, exp) - fragS *frag ATTRIBUTE_UNUSED; - int where; - unsigned int nbytes; - expressionS *exp; -{ -#ifndef OBJ_ELF - /* If we are assembling in 32 bit mode, turn an 8 byte reloc into a - 4 byte reloc. */ - if (nbytes == 8 && ! mips_64) - { - if (target_big_endian) - where += 4; - nbytes = 4; - } -#endif - - if (nbytes != 2 && nbytes != 4 && nbytes != 8) - as_bad (_("Unsupported reloc size %d"), nbytes); - - fix_new_exp (frag_now, where, (int) nbytes, exp, 0, - (nbytes == 2 - ? BFD_RELOC_16 - : (nbytes == 4 ? BFD_RELOC_32 : BFD_RELOC_64))); -} - /* This is called before the symbol table is processed. In order to work with gcc when using mips-tfile, we must keep all local labels. However, in other cases, we want to discard them. If we were @@ -9657,9 +9722,7 @@ md_apply_fix (fixP, valueP) value += (fixP->fx_next->fx_frag->fr_address + fixP->fx_next->fx_where); } - if (value & 0x8000) - value += 0x10000; - value >>= 16; + value = ((value + 0x8000) >> 16) & 0xffff; buf = (unsigned char *) fixP->fx_frag->fr_literal + fixP->fx_where; if (target_big_endian) buf += 2; @@ -11587,6 +11650,10 @@ mips_elf_final_processing () else elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_EABI32; } + else if (strcmp (mips_abi_string, "n32") == 0) + elf_elfheader (stdoutput)->e_flags |= EF_MIPS_ABI2; + + /* Nothing to do for "64". */ if (mips_32bitmode) elf_elfheader (stdoutput)->e_flags |= EF_MIPS_32BITMODE; diff -uprN binutils-2.11.90.0.27/gas/config/tc-mips.h binutils-2.11.90.0.29/gas/config/tc-mips.h --- binutils-2.11.90.0.27/gas/config/tc-mips.h Fri Mar 9 11:17:06 2001 +++ binutils-2.11.90.0.29/gas/config/tc-mips.h Mon Aug 27 11:44:51 2001 @@ -47,7 +47,7 @@ struct expressionS; /* Maximum symbol offset that can be encoded in a BFD_RELOC_MIPS_GPREL relocation: */ -#define MAX_GPREL_OFFSET (0x7FF4) +#define MAX_GPREL_OFFSET (0x7FF0) #define md_relax_frag(segment, fragp, stretch) mips_relax_frag(fragp, stretch) extern int mips_relax_frag PARAMS ((struct frag *, long)); @@ -103,10 +103,6 @@ extern void mips_frob_file PARAMS ((void extern void mips_frob_file_after_relocs PARAMS ((void)); #endif -#define TC_CONS_FIX_NEW cons_fix_new_mips -extern void cons_fix_new_mips - PARAMS ((struct frag *, int, unsigned int, struct expressionS *)); - #define tc_fix_adjustable(fixp) mips_fix_adjustable (fixp) extern int mips_fix_adjustable PARAMS ((struct fix *)); diff -uprN binutils-2.11.90.0.27/gas/config/tc-ppc.c binutils-2.11.90.0.29/gas/config/tc-ppc.c --- binutils-2.11.90.0.27/gas/config/tc-ppc.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/gas/config/tc-ppc.c Mon Aug 27 11:44:51 2001 @@ -53,6 +53,41 @@ static int set_target_endian = 0; #endif #endif +/* Macros for calculating LO, HI, HA, HIGHER, HIGHERA, HIGHEST, + HIGHESTA. */ + +/* #lo(value) denotes the least significant 16 bits of the indicated. */ +#define PPC_LO(v) ((v) & 0xffff) + +/* #hi(value) denotes bits 16 through 31 of the indicated value. */ +#define PPC_HI(v) (((v) >> 16) & 0xffff) + +/* #ha(value) denotes the high adjusted value: bits 16 through 31 of + the indicated value, compensating for #lo() being treated as a + signed number. */ +#define PPC_HA(v) ((((v) >> 16) + (((v) >> 15) & 1)) & 0xffff) + +/* #higher(value) denotes bits 32 through 47 of the indicated value. */ +#define PPC_HIGHER(v) (((v) >> 32) & 0xffff) + +/* #highera(value) denotes bits 32 through 47 of the indicated value, + compensating for #lo() being treated as a signed number. */ +#define PPC_HIGHERA(v) \ + ((((v) >> 32) + (((v) & 0xffff8000) == 0xffff8000)) & 0xffff) + +/* #highest(value) denotes bits 48 through 63 of the indicated value. */ +#define PPC_HIGHEST(v) (((v) >> 48) & 0xffff) + +/* #highesta(value) denotes bits 48 through 63 of the indicated value, + compensating for #lo being treated as a signed number. + Generate 0xffffffff8000 with arithmetic here, for portability. */ +#define PPC_HIGHESTA(v) \ + ((((v) >> 48) \ + + (((v) & (((valueT) 1 << 48) - 0x8000)) == ((valueT) 1 << 48) - 0x8000)) \ + & 0xffff) + +#define SEX16(val) ((((val) & 0xffff) ^ 0x8000) - 0x8000) + static boolean reg_names_p = TARGET_REG_NAMES_P; static boolean register_name PARAMS ((expressionS *)); @@ -62,8 +97,12 @@ static unsigned long ppc_insert_operand offsetT val, char *file, unsigned int line)); static void ppc_macro PARAMS ((char *str, const struct powerpc_macro *macro)); static void ppc_byte PARAMS ((int)); + +#if defined (OBJ_XCOFF) || defined (OBJ_ELF) static int ppc_is_toc_sym PARAMS ((symbolS *sym)); static void ppc_tc PARAMS ((int)); +static void ppc_machine PARAMS ((int)); +#endif #ifdef OBJ_XCOFF static void ppc_comm PARAMS ((int)); @@ -87,7 +126,6 @@ static void ppc_stabx PARAMS ((int)); static void ppc_rename PARAMS ((int)); static void ppc_toc PARAMS ((int)); static void ppc_xcoff_cons PARAMS ((int)); -static void ppc_machine PARAMS ((int)); static void ppc_vbyte PARAMS ((int)); #endif @@ -188,10 +226,11 @@ const pseudo_typeS md_pseudo_table[] = { "word", ppc_xcoff_cons, 1 }, { "short", ppc_xcoff_cons, 1 }, { "vbyte", ppc_vbyte, 0 }, - { "machine", ppc_machine, 0 }, #endif #ifdef OBJ_ELF + { "llong", ppc_elf_cons, 8 }, + { "quad", ppc_elf_cons, 8 }, { "long", ppc_elf_cons, 4 }, { "word", ppc_elf_cons, 2 }, { "short", ppc_elf_cons, 2 }, @@ -218,8 +257,10 @@ const pseudo_typeS md_pseudo_table[] = { "tocd", ppc_pe_tocd, 0 }, #endif - /* This pseudo-op is used even when not generating XCOFF output. */ +#if defined (OBJ_XCOFF) || defined (OBJ_ELF) { "tc", ppc_tc, 0 }, + { "machine", ppc_machine, 0 }, +#endif { NULL, NULL, 0 } }; @@ -828,6 +869,9 @@ md_parse_option (c, arg) break; case 'm': + /* Most CPU's are 32 bit. Exceptions are listed below. */ + ppc_size = PPC_OPCODE_32; + /* -mpwrx and -mpwr2 mean to assemble for the IBM POWER/2 (RIOS2). */ if (strcmp (arg, "pwrx") == 0 || strcmp (arg, "pwr2") == 0) @@ -1007,8 +1051,7 @@ ppc_set_cpu () ppc_cpu = PPC_OPCODE_POWER; else if (strcmp (default_cpu, "rs6000") == 0) ppc_cpu = PPC_OPCODE_POWER; - else if (strcmp (default_cpu, "powerpc") == 0 - || strcmp (default_cpu, "powerpcle") == 0) + else if (strncmp (default_cpu, "powerpc", 7) == 0) ppc_cpu = PPC_OPCODE_PPC; else as_fatal (_("Unknown default cpu = %s, os = %s"), @@ -1032,8 +1075,7 @@ ppc_arch () { if (strcmp (default_cpu, "rs6000") == 0) return bfd_arch_rs6000; - else if (strcmp (default_cpu, "powerpc") == 0 - || strcmp (default_cpu, "powerpcle") == 0) + else if (strncmp (default_cpu, "powerpc", 7) == 0) return bfd_arch_powerpc; } @@ -1047,11 +1089,13 @@ ppc_mach () return ppc_size == PPC_OPCODE_64 ? 620 : 0; } +#ifdef OBJ_XCOFF int ppc_subseg_align () { return ppc_xcoff64 ? 3 : 2; } +#endif extern char* ppc_target_format () @@ -1060,15 +1104,15 @@ ppc_target_format () #ifdef TE_PE return target_big_endian ? "pe-powerpc" : "pe-powerpcle"; #elif TE_POWERMAC + return "xcoff-powermac"; #else return ppc_xcoff64 ? "aixcoff64-rs6000" : "aixcoff-rs6000"; #endif -#ifdef TE_POWERMAC - return "xcoff-powermac"; -#endif #endif #ifdef OBJ_ELF - return target_big_endian ? "elf32-powerpc" : "elf32-powerpcle"; + return (target_big_endian + ? (BFD_DEFAULT_TARGET_SIZE == 64 ? "elf64-powerpc" : "elf32-powerpc") + : (BFD_DEFAULT_TARGET_SIZE == 64 ? "elf64-powerpcle" : "elf32-powerpcle")); #endif } @@ -1088,6 +1132,11 @@ md_begin () ppc_set_cpu (); #ifdef OBJ_ELF + /* If we're going to generate a 64-bit ABI file, then we need + the 64-bit capable instructions. */ + if (BFD_DEFAULT_TARGET_SIZE == 64) + ppc_size = PPC_OPCODE_64; + /* Set the ELF flags if desired. */ if (ppc_flags && !msolaris) bfd_set_private_flags (stdoutput, ppc_flags); @@ -1229,10 +1278,7 @@ ppc_insert_operand (insn, operand, val, char buf[100]; sprint_value (buf, test); - if (file == (char *) NULL) - as_bad (err, buf, min, max); - else - as_bad_where (file, line, err, buf, min, max); + as_bad_where (file, line, err, buf, min, max); } } @@ -1243,7 +1289,7 @@ ppc_insert_operand (insn, operand, val, errmsg = NULL; insn = (*operand->insert) (insn, (long) val, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad_where (file, line, errmsg); } else insn |= (((long) val & ((1 << operand->bits) - 1)) @@ -1318,7 +1364,17 @@ ppc_elf_suffix (str_p, exp_p) MAP ("bitfld", BFD_RELOC_PPC_EMB_BIT_FLD), MAP ("relsda", BFD_RELOC_PPC_EMB_RELSDA), MAP ("xgot", BFD_RELOC_PPC_TOC16), - +#if BFD_DEFAULT_TARGET_SIZE == 64 + MAP ("higher", BFD_RELOC_PPC64_HIGHER), + MAP ("highera", BFD_RELOC_PPC64_HIGHER_S), + MAP ("highest", BFD_RELOC_PPC64_HIGHEST), + MAP ("highesta", BFD_RELOC_PPC64_HIGHEST_S), + MAP ("tocbase", BFD_RELOC_PPC64_TOC), + MAP ("toc", BFD_RELOC_PPC_TOC16), + MAP ("toc@l", BFD_RELOC_PPC64_TOC16_LO), + MAP ("toc@h", BFD_RELOC_PPC64_TOC16_HI), + MAP ("toc@ha", BFD_RELOC_PPC64_TOC16_HA), +#endif { (char *) 0, 0, BFD_RELOC_UNUSED } }; @@ -1366,8 +1422,18 @@ ppc_elf_suffix (str_p, exp_p) if (&input_line_pointer != str_p) input_line_pointer = orig_line; } - *str_p = str; + + if (BFD_DEFAULT_TARGET_SIZE == 64 + && ptr->reloc == BFD_RELOC_PPC64_TOC + && exp_p->X_op == O_symbol) + { + /* This reloc type ignores the symbol. Change the symbol + so that the dummy .TOC. symbol can be omitted from the + object file. */ + exp_p->X_add_symbol = &abs_symbol; + } + return ptr->reloc; } @@ -1378,7 +1444,7 @@ ppc_elf_suffix (str_p, exp_p) Clobbers input_line_pointer, checks end-of-line. */ static void ppc_elf_cons (nbytes) - register int nbytes; /* 1=.byte, 2=.word, 4=.long */ + register int nbytes; /* 1=.byte, 2=.word, 4=.long, 8=.llong. */ { expressionS exp; bfd_reloc_code_real_type reloc; @@ -1404,14 +1470,19 @@ ppc_elf_cons (nbytes) size = bfd_get_reloc_size (reloc_howto); if (size > nbytes) - as_bad (_("%s relocations do not fit in %d bytes\n"), - reloc_howto->name, nbytes); - + { + as_bad (_("%s relocations do not fit in %d bytes\n"), + reloc_howto->name, nbytes); + } else { - register char *p = frag_more ((int) nbytes); - int offset = nbytes - size; + char *p; + int offset; + p = frag_more (nbytes); + offset = 0; + if (target_big_endian) + offset = nbytes - size; fix_new_exp (frag_now, p - frag_now->fr_literal + offset, size, &exp, 0, reloc); } @@ -1595,6 +1666,25 @@ ppc_elf_validate_fix (fixp, seg) return; } } + +#if BFD_DEFAULT_TARGET_SIZE == 64 +/* Don't emit .TOC. symbol. */ +int +ppc_elf_frob_symbol (sym) + symbolS *sym; +{ + const char *name; + + name = S_GET_NAME (sym); + if (name != NULL && strcmp (name, ".TOC.") == 0) + { + S_CLEAR_EXTERNAL (sym); + return 1; + } + + return 0; +} +#endif #endif /* OBJ_ELF */ #ifdef TE_PE @@ -2003,28 +2093,59 @@ md_assemble (str) case BFD_RELOC_LO16: /* X_unsigned is the default, so if the user has done - something which cleared it, we always produce a - signed value. */ - if (ex.X_unsigned - && (operand->flags & PPC_OPERAND_SIGNED) == 0) + something which cleared it, we always produce a + signed value. */ + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) ex.X_add_number &= 0xffff; else - ex.X_add_number = (((ex.X_add_number & 0xffff) - ^ 0x8000) - - 0x8000); + ex.X_add_number = SEX16 (ex.X_add_number); break; case BFD_RELOC_HI16: - ex.X_add_number = (ex.X_add_number >> 16) & 0xffff; + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HI (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HI (ex.X_add_number)); break; case BFD_RELOC_HI16_S: - ex.X_add_number = ((((ex.X_add_number >> 16) & 0xffff) - + ((ex.X_add_number >> 15) & 1)) - & 0xffff); + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HA (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HA (ex.X_add_number)); + break; + +#if BFD_DEFAULT_TARGET_SIZE == 64 + case BFD_RELOC_PPC64_HIGHER: + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HIGHER (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HIGHER (ex.X_add_number)); + break; + + case BFD_RELOC_PPC64_HIGHER_S: + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HIGHERA (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HIGHERA (ex.X_add_number)); + break; + + case BFD_RELOC_PPC64_HIGHEST: + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HIGHEST (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HIGHEST (ex.X_add_number)); break; + + case BFD_RELOC_PPC64_HIGHEST_S: + if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED)) + ex.X_add_number = PPC_HIGHESTA (ex.X_add_number); + else + ex.X_add_number = SEX16 (PPC_HIGHESTA (ex.X_add_number)); + break; +#endif /* BFD_DEFAULT_TARGET_SIZE == 64 */ } -#endif +#endif /* OBJ_ELF */ insn = ppc_insert_operand (insn, operand, ex.X_add_number, (char *) NULL, 0); } @@ -2054,6 +2175,50 @@ md_assemble (str) } } + if (BFD_DEFAULT_TARGET_SIZE == 64 + && (operand->flags & PPC_OPERAND_DS) != 0) + { + switch (reloc) + { + case BFD_RELOC_16: + reloc = BFD_RELOC_PPC64_ADDR16_DS; + break; + case BFD_RELOC_LO16: + reloc = BFD_RELOC_PPC64_ADDR16_LO_DS; + break; + case BFD_RELOC_16_GOTOFF: + reloc = BFD_RELOC_PPC64_GOT16_DS; + break; + case BFD_RELOC_LO16_GOTOFF: + reloc = BFD_RELOC_PPC64_GOT16_LO_DS; + break; + case BFD_RELOC_LO16_PLTOFF: + reloc = BFD_RELOC_PPC64_PLT16_LO_DS; + break; + case BFD_RELOC_32_BASEREL: + reloc = BFD_RELOC_PPC64_SECTOFF_DS; + break; + case BFD_RELOC_LO16_BASEREL: + reloc = BFD_RELOC_PPC64_SECTOFF_LO_DS; + break; + case BFD_RELOC_PPC_TOC16: + reloc = BFD_RELOC_PPC64_TOC16_DS; + break; + case BFD_RELOC_PPC64_TOC16_LO: + reloc = BFD_RELOC_PPC64_TOC16_LO_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16: + reloc = BFD_RELOC_PPC64_PLTGOT16_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16_LO: + reloc = BFD_RELOC_PPC64_PLTGOT16_LO_DS; + break; + default: + as_bad (_("unsupported relocation for DS offset field")); + break; + } + } + /* We need to generate a fixup for this expression. */ if (fc >= MAX_INSN_FIXUPS) as_fatal (_("too many fixups")); @@ -2159,6 +2324,14 @@ md_assemble (str) case BFD_RELOC_LO16: case BFD_RELOC_HI16: case BFD_RELOC_HI16_S: +#ifdef OBJ_ELF +#if BFD_DEFAULT_TARGET_SIZE == 64 + case BFD_RELOC_PPC64_HIGHER: + case BFD_RELOC_PPC64_HIGHER_S: + case BFD_RELOC_PPC64_HIGHEST: + case BFD_RELOC_PPC64_HIGHEST_S: +#endif +#endif fixP->fx_no_overflow = 1; break; default: @@ -2874,7 +3047,7 @@ ppc_stabx (ignore) resolve_symbol_value will copy the exp's "within" into sym's when the offset is 0. Since this seems to be corner case problem, only do the correction for storage class C_STSYM. A better solution - would be to have the tc field updated in ppc_symbol_new_hook. */ + would be to have the tc field updated in ppc_symbol_new_hook. */ if (exp.X_op == O_symbol) { @@ -3310,14 +3483,6 @@ ppc_xcoff_cons (log_size) } static void -ppc_machine(dummy) - int dummy ATTRIBUTE_UNUSED; -{ - discard_rest_of_line(); - /* What does aix use this for? */ -} - -static void ppc_vbyte (dummy) int dummy ATTRIBUTE_UNUSED; { @@ -3345,15 +3510,18 @@ ppc_vbyte (dummy) } #endif /* OBJ_XCOFF */ +#if defined (OBJ_XCOFF) || defined (OBJ_ELF) /* The .tc pseudo-op. This is used when generating either XCOFF or ELF. This takes two or more arguments. When generating XCOFF output, the first argument is the name to give to this location in the toc; this will be a symbol with class - TC. The rest of the arguments are 4 byte values to actually put at + TC. The rest of the arguments are N-byte values to actually put at this location in the TOC; often there is just one more argument, a - relocateable symbol reference. + relocateable symbol reference. The size of the value to store + depends on target word size. A 32-bit target uses 4-byte values, a + 64-bit target uses 8-byte values. When not generating XCOFF output, the arguments are the same, but the first argument is simply ignored. */ @@ -3416,7 +3584,8 @@ ppc_tc (ignore) ppc_frob_label (sym); } -#else /* ! defined (OBJ_XCOFF) */ +#endif /* OBJ_XCOFF */ +#ifdef OBJ_ELF /* Skip the TOC symbol name. */ while (is_part_of_name (*input_line_pointer) @@ -3426,11 +3595,10 @@ ppc_tc (ignore) || *input_line_pointer == '}') ++input_line_pointer; - /* Align to a four byte boundary. */ - frag_align (2, 0, 0); - record_alignment (now_seg, 2); - -#endif /* ! defined (OBJ_XCOFF) */ + /* Align to a four/eight byte boundary. */ + frag_align (BFD_DEFAULT_TARGET_SIZE == 64 ? 3 : 2, 0, 0); + record_alignment (now_seg, BFD_DEFAULT_TARGET_SIZE == 64 ? 3 : 2); +#endif /* OBJ_ELF */ if (*input_line_pointer != ',') demand_empty_rest_of_line (); @@ -3440,6 +3608,35 @@ ppc_tc (ignore) cons ((ppc_size == PPC_OPCODE_64) ? 8 : 4); } } + +/* Pseudo-op .machine. */ +/* FIXME: `.machine' is a nop for the moment. */ + +static void +ppc_machine (ignore) + int ignore ATTRIBUTE_UNUSED; +{ + discard_rest_of_line (); +} + +/* See whether a symbol is in the TOC section. */ + +static int +ppc_is_toc_sym (sym) + symbolS *sym; +{ +#ifdef OBJ_XCOFF + return symbol_get_tc (sym)->class == XMC_TC; +#endif +#ifdef OBJ_ELF + const char *sname = segment_name (S_GET_SEGMENT (sym)); + if (BFD_DEFAULT_TARGET_SIZE == 64) + return strcmp (sname, ".toc") == 0; + else + return strcmp (sname, ".got") == 0; +#endif +} +#endif /* defined (OBJ_XCOFF) || defined (OBJ_ELF) */ #ifdef TE_PE @@ -4801,18 +4998,27 @@ ppc_force_relocation (fix) #endif /* OBJ_XCOFF */ -/* See whether a symbol is in the TOC section. */ - -static int -ppc_is_toc_sym (sym) - symbolS *sym; +#ifdef OBJ_ELF +int +ppc_fix_adjustable (fix) + fixS *fix; { -#ifdef OBJ_XCOFF - return symbol_get_tc (sym)->class == XMC_TC; -#else - return strcmp (segment_name (S_GET_SEGMENT (sym)), ".got") == 0; -#endif + return (fix->fx_r_type != BFD_RELOC_16_GOTOFF + && fix->fx_r_type != BFD_RELOC_LO16_GOTOFF + && fix->fx_r_type != BFD_RELOC_HI16_GOTOFF + && fix->fx_r_type != BFD_RELOC_HI16_S_GOTOFF + && fix->fx_r_type != BFD_RELOC_GPREL16 + && fix->fx_r_type != BFD_RELOC_VTABLE_INHERIT + && fix->fx_r_type != BFD_RELOC_VTABLE_ENTRY + && ! S_IS_EXTERNAL (fix->fx_addsy) + && ! S_IS_WEAK (fix->fx_addsy) + && (fix->fx_pcrel + || (fix->fx_subsy != NULL + && (S_GET_SEGMENT (fix->fx_subsy) + == S_GET_SEGMENT (fix->fx_addsy))) + || S_IS_LOCAL (fix->fx_addsy))); } +#endif /* Apply a fixup to the object code. This is called for all the fixups we generated by the call to fix_new_exp, above. In the call @@ -4827,7 +5033,7 @@ int md_apply_fix3 (fixp, valuep, seg) fixS *fixp; valueT *valuep; - segT seg; + segT seg ATTRIBUTE_UNUSED; { valueT value; @@ -4900,13 +5106,10 @@ md_apply_fix3 (fixp, valuep, seg) operand = &powerpc_operands[opindex]; #ifdef OBJ_XCOFF - /* It appears that an instruction like - l 9,LC..1(30) - when LC..1 is not a TOC symbol does not generate a reloc. It - uses the offset of LC..1 within its csect. However, .long - LC..1 will generate a reloc. I can't find any documentation - on how these cases are to be distinguished, so this is a wild - guess. These cases are generated by gcc -mminimal-toc. */ + /* An instruction like `lwz 9,sym(30)' when `sym' is not a TOC symbol + does not generate a reloc. It uses the offset of `sym' within its + csect. Other usages, such as `.long sym', generate relocs. This + is the documented behaviour of non-TOC symbols. */ if ((operand->flags & PPC_OPERAND_PARENS) != 0 && operand->bits == 16 && operand->shift == 0 @@ -4942,12 +5145,11 @@ md_apply_fix3 (fixp, valuep, seg) return 1; } + assert (fixp->fx_addsy != NULL); + /* Determine a BFD reloc value based on the operand information. We are only prepared to turn a few of the operands into - relocs. - FIXME: We need to handle the DS field at the very least. - FIXME: Selecting the reloc type is a bit haphazard; perhaps - there should be a new field in the operand table. */ + relocs. */ if ((operand->flags & PPC_OPERAND_RELATIVE) != 0 && operand->bits == 26 && operand->shift == 0) @@ -4964,30 +5166,37 @@ md_apply_fix3 (fixp, valuep, seg) && operand->bits == 16 && operand->shift == 0) fixp->fx_r_type = BFD_RELOC_PPC_BA16; +#if defined (OBJ_XCOFF) || defined (OBJ_ELF) else if ((operand->flags & PPC_OPERAND_PARENS) != 0 && operand->bits == 16 && operand->shift == 0 - && fixp->fx_addsy != NULL && ppc_is_toc_sym (fixp->fx_addsy)) { + fixp->fx_r_type = BFD_RELOC_PPC_TOC16; +#ifdef OBJ_ELF + if (BFD_DEFAULT_TARGET_SIZE == 64 + && (operand->flags & PPC_OPERAND_DS) != 0) + fixp->fx_r_type = BFD_RELOC_PPC64_TOC16_DS; +#endif fixp->fx_size = 2; if (target_big_endian) fixp->fx_where += 2; - fixp->fx_r_type = BFD_RELOC_PPC_TOC16; } +#endif /* defined (OBJ_XCOFF) || defined (OBJ_ELF) */ else { char *sfile; unsigned int sline; /* Use expr_symbol_where to see if this is an expression - symbol. */ + symbol. */ if (expr_symbol_where (fixp->fx_addsy, &sfile, &sline)) as_bad_where (fixp->fx_file, fixp->fx_line, _("unresolved expression that must be resolved")); else as_bad_where (fixp->fx_file, fixp->fx_line, - _("unsupported relocation type")); + _("unsupported relocation against %s"), + S_GET_NAME (fixp->fx_addsy)); fixp->fx_done = 1; return 1; } @@ -4999,8 +5208,9 @@ md_apply_fix3 (fixp, valuep, seg) #endif switch (fixp->fx_r_type) { - case BFD_RELOC_32: case BFD_RELOC_CTOR: + /* FIXME: 32 bits even for 64-bit targets? */ + case BFD_RELOC_32: if (fixp->fx_pcrel) fixp->fx_r_type = BFD_RELOC_32_PCREL; /* fall through */ @@ -5017,10 +5227,12 @@ md_apply_fix3 (fixp, valuep, seg) if (fixp->fx_pcrel) fixp->fx_r_type = BFD_RELOC_64_PCREL; /* fall through */ + case BFD_RELOC_64_PCREL: md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, value, 8); break; + case BFD_RELOC_LO16: case BFD_RELOC_16: case BFD_RELOC_GPREL16: @@ -5045,6 +5257,13 @@ md_apply_fix3 (fixp, valuep, seg) case BFD_RELOC_PPC_EMB_RELST_HA: case BFD_RELOC_PPC_EMB_RELSDA: case BFD_RELOC_PPC_TOC16: +#ifdef OBJ_ELF +#if BFD_DEFAULT_TARGET_SIZE == 64 + case BFD_RELOC_PPC64_TOC16_LO: + case BFD_RELOC_PPC64_TOC16_HI: + case BFD_RELOC_PPC64_TOC16_HA: +#endif +#endif if (fixp->fx_pcrel) { if (fixp->fx_addsy != NULL) @@ -5069,15 +5288,76 @@ md_apply_fix3 (fixp, valuep, seg) if (fixp->fx_pcrel) abort (); md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, - value >> 16, 2); + PPC_HI (value), 2); break; + case BFD_RELOC_HI16_S: if (fixp->fx_pcrel) abort (); md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, - (value + 0x8000) >> 16, 2); + PPC_HA (value), 2); + break; + +#ifdef OBJ_ELF +#if BFD_DEFAULT_TARGET_SIZE == 64 + case BFD_RELOC_PPC64_HIGHER: + if (fixp->fx_pcrel) + abort (); + md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, + PPC_HIGHER (value), 2); + break; + + case BFD_RELOC_PPC64_HIGHER_S: + if (fixp->fx_pcrel) + abort (); + md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, + PPC_HIGHERA (value), 2); + break; + + case BFD_RELOC_PPC64_HIGHEST: + if (fixp->fx_pcrel) + abort (); + md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, + PPC_HIGHEST (value), 2); break; + case BFD_RELOC_PPC64_HIGHEST_S: + if (fixp->fx_pcrel) + abort (); + md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, + PPC_HIGHESTA (value), 2); + break; + + case BFD_RELOC_PPC64_ADDR16_DS: + case BFD_RELOC_PPC64_ADDR16_LO_DS: + case BFD_RELOC_PPC64_GOT16_DS: + case BFD_RELOC_PPC64_GOT16_LO_DS: + case BFD_RELOC_PPC64_PLT16_LO_DS: + case BFD_RELOC_PPC64_SECTOFF_DS: + case BFD_RELOC_PPC64_SECTOFF_LO_DS: + case BFD_RELOC_PPC64_TOC16_DS: + case BFD_RELOC_PPC64_TOC16_LO_DS: + case BFD_RELOC_PPC64_PLTGOT16_DS: + case BFD_RELOC_PPC64_PLTGOT16_LO_DS: + if (fixp->fx_pcrel) + abort (); + { + unsigned char *where = fixp->fx_frag->fr_literal + fixp->fx_where; + unsigned long val; + + if (target_big_endian) + val = bfd_getb16 (where); + else + val = bfd_getl16 (where); + val |= (value & 0xfffc); + if (target_big_endian) + bfd_putb16 ((bfd_vma) val, where); + else + bfd_putl16 ((bfd_vma) val, where); + } + break; +#endif +#endif /* Because SDA21 modifies the register field, the size is set to 4 bytes, rather than 2, so offset it here appropriately. */ case BFD_RELOC_PPC_EMB_SDA21: @@ -5142,6 +5422,15 @@ md_apply_fix3 (fixp, valuep, seg) fixp->fx_done = 0; break; +#ifdef OBJ_ELF +#if BFD_DEFAULT_TARGET_SIZE == 64 + /* Generated by reference to `sym@tocbase'. The sym is + ignored by the linker. */ + case BFD_RELOC_PPC64_TOC: + fixp->fx_done = 0; + break; +#endif +#endif default: fprintf (stderr, _("Gas failure, reloc value %d\n"), fixp->fx_r_type); diff -uprN binutils-2.11.90.0.27/gas/config/tc-ppc.h binutils-2.11.90.0.29/gas/config/tc-ppc.h --- binutils-2.11.90.0.27/gas/config/tc-ppc.h Fri Apr 13 11:19:47 2001 +++ binutils-2.11.90.0.29/gas/config/tc-ppc.h Mon Aug 27 11:44:51 2001 @@ -1,5 +1,5 @@ /* tc-ppc.h -- Header file for tc-ppc.c. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. @@ -56,7 +56,7 @@ extern int target_big_endian; /* The target BFD format. */ #define TARGET_FORMAT (ppc_target_format ()) -extern char* ppc_target_format (); +extern char *ppc_target_format PARAMS ((void)); /* Permit temporary numeric labels. */ #define LOCAL_LABELS_FB 1 @@ -84,6 +84,35 @@ extern char* ppc_target_format (); /* We set the fx_done field appropriately in md_apply_fix. */ #define TC_HANDLES_FX_DONE + +#define MAX_MEM_FOR_RS_ALIGN_CODE 4 +#define HANDLE_ALIGN(FRAGP) \ + if ((FRAGP)->fr_type == rs_align_code) \ + { \ + valueT count = ((FRAGP)->fr_next->fr_address \ + - ((FRAGP)->fr_address + (FRAGP)->fr_fix)); \ + if (count != 0 && (count & 3) == 0) \ + { \ + unsigned char *dest = (FRAGP)->fr_literal + (FRAGP)->fr_fix; \ + \ + (FRAGP)->fr_var = 4; \ + if (target_big_endian) \ + { \ + *dest++ = 0x60; \ + *dest++ = 0; \ + *dest++ = 0; \ + *dest++ = 0; \ + } \ + else \ + { \ + *dest++ = 0; \ + *dest++ = 0; \ + *dest++ = 0; \ + *dest++ = 0x60; \ + } \ + } \ + } + #ifdef TE_PE @@ -197,6 +226,8 @@ do { \ || (FIXP)->fx_r_type == BFD_RELOC_PPC_B16_BRNTAKEN \ || (FIXP)->fx_r_type == BFD_RELOC_PPC_BA16_BRTAKEN \ || (FIXP)->fx_r_type == BFD_RELOC_PPC_BA16_BRNTAKEN \ + || (BFD_DEFAULT_TARGET_SIZE == 64 \ + && (FIXP)->fx_r_type == BFD_RELOC_PPC64_TOC) \ || (FIXP)->fx_r_type == BFD_RELOC_VTABLE_INHERIT \ || (FIXP)->fx_r_type == BFD_RELOC_VTABLE_ENTRY) @@ -216,6 +247,12 @@ extern int ppc_section_flags PARAMS ((in #define md_elf_section_word(STR, LEN) ppc_section_word (STR, LEN) #define md_elf_section_flags(FLAGS, ATTR, TYPE) ppc_section_flags (FLAGS, ATTR, TYPE) +#if BFD_DEFAULT_TARGET_SIZE == 64 +/* Extra sections for 64-bit ELF PPC. */ +#define ELF_TC_SPECIAL_SECTIONS \ + { ".toc", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE}, \ + { ".tocbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE}, +#else /* Add extra PPC sections -- Note, for now, make .sbss2 and .PPC.EMB.sbss0 a normal section, and not a bss section so that the linker doesn't crater when trying to make more than 2 sections. */ @@ -227,26 +264,14 @@ extern int ppc_section_flags PARAMS ((in { ".sbss2", SHT_PROGBITS, SHF_ALLOC }, \ { ".PPC.EMB.sdata0", SHT_PROGBITS, SHF_ALLOC }, \ { ".PPC.EMB.sbss0", SHT_PROGBITS, SHF_ALLOC }, +#endif #define tc_comment_chars ppc_comment_chars extern const char *ppc_comment_chars; /* Keep relocations relative to the GOT, or non-PC relative. */ -#define tc_fix_adjustable(FIX) \ - ((FIX)->fx_r_type != BFD_RELOC_16_GOTOFF \ - && (FIX)->fx_r_type != BFD_RELOC_LO16_GOTOFF \ - && (FIX)->fx_r_type != BFD_RELOC_HI16_GOTOFF \ - && (FIX)->fx_r_type != BFD_RELOC_HI16_S_GOTOFF \ - && (FIX)->fx_r_type != BFD_RELOC_GPREL16 \ - && (FIX)->fx_r_type != BFD_RELOC_VTABLE_INHERIT \ - && (FIX)->fx_r_type != BFD_RELOC_VTABLE_ENTRY \ - && ! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && ((FIX)->fx_pcrel \ - || ((FIX)->fx_subsy != NULL \ - && (S_GET_SEGMENT ((FIX)->fx_subsy) \ - == S_GET_SEGMENT ((FIX)->fx_addsy))) \ - || S_IS_LOCAL ((FIX)->fx_addsy))) +#define tc_fix_adjustable(fixp) ppc_fix_adjustable (fixp) +extern int ppc_fix_adjustable PARAMS ((struct fix *)); /* We must never ever try to resolve references to externally visible symbols in the assembler, because the .o file might go into a shared @@ -258,6 +283,12 @@ extern const char *ppc_comment_chars; && S_IS_DEFINED ((FIX)->fx_addsy) \ && ! S_IS_COMMON ((FIX)->fx_addsy))) +#if BFD_DEFAULT_TARGET_SIZE == 64 +/* Finish up the symbol. */ +#define tc_frob_symbol(sym, punt) punt = ppc_elf_frob_symbol (sym) +extern int ppc_elf_frob_symbol PARAMS ((symbolS *)); +#endif + #define DWARF2_LINE_MIN_INSN_LENGTH 4 #endif /* OBJ_ELF */ diff -uprN binutils-2.11.90.0.27/gas/config/tc-s390.c binutils-2.11.90.0.29/gas/config/tc-s390.c --- binutils-2.11.90.0.27/gas/config/tc-s390.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/gas/config/tc-s390.c Mon Aug 27 11:44:52 2001 @@ -80,7 +80,7 @@ const pseudo_typeS md_pseudo_table[] = { { "align", s_align_bytes, 0 }, /* Pseudo-ops which must be defined. */ - { "bss", s390_bss, 0 }, + { "bss", s390_bss, 0 }, { "insn", s390_insn, 0 }, /* Pseudo-ops which must be overridden. */ { "byte", s390_byte, 0 }, @@ -157,21 +157,21 @@ static const struct pd_reg pre_defined_r { "c9", 9 }, { "f0", 0 }, /* Floating point registers */ - { "f1", 1 }, - { "f10", 10 }, - { "f11", 11 }, - { "f12", 12 }, - { "f13", 13 }, - { "f14", 14 }, - { "f15", 15 }, - { "f2", 2 }, - { "f3", 3 }, - { "f4", 4 }, - { "f5", 5 }, - { "f6", 6 }, - { "f7", 7 }, - { "f8", 8 }, - { "f9", 9 }, + { "f1", 1 }, + { "f10", 10 }, + { "f11", 11 }, + { "f12", 12 }, + { "f13", 13 }, + { "f14", 14 }, + { "f15", 15 }, + { "f2", 2 }, + { "f3", 3 }, + { "f4", 4 }, + { "f5", 5 }, + { "f6", 6 }, + { "f7", 7 }, + { "f8", 8 }, + { "f9", 9 }, { "lit", 13 }, /* Pointer to literal pool */ @@ -198,6 +198,16 @@ static const struct pd_reg pre_defined_r #define REG_NAME_CNT (sizeof (pre_defined_registers) / sizeof (struct pd_reg)) +static int reg_name_search + PARAMS ((const struct pd_reg *, int, const char *)); +static boolean register_name PARAMS ((expressionS *)); +static void init_default_arch PARAMS ((void)); +static void s390_insert_operand + PARAMS ((unsigned char *, const struct s390_operand *, offsetT, char *, + unsigned int)); +static char *md_gather_operands + PARAMS ((char *, unsigned char *, const struct s390_opcode *)); + /* Given NAME, find the register number associated with that name, return the integer value associated with the given name or -1 on failure. */ @@ -265,11 +275,11 @@ register_name (expressionP) *input_line_pointer = c; /* Look to see if it's in the register table. */ - if (reg_number >= 0) + if (reg_number >= 0) { expressionP->X_op = O_register; expressionP->X_add_number = reg_number; - + /* Make the rest nice. */ expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; @@ -353,17 +363,17 @@ md_parse_option (c, arg) case 'm': if (arg != NULL && strcmp (arg, "regnames") == 0) reg_names_p = true; - + else if (arg != NULL && strcmp (arg, "no-regnames") == 0) reg_names_p = false; - + else { as_bad (_("invalid switch -m%s"), arg); return 0; } break; - + case 'A': if (arg != NULL && strcmp (arg, "esa") == 0) { @@ -385,16 +395,16 @@ md_parse_option (c, arg) case 'V': print_version_id (); break; - + /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section should be emitted or not. FIXME: Not implemented. */ case 'Q': break; - + default: return 0; } - + return 1; } @@ -536,7 +546,7 @@ s390_insert_operand (insn, operand, val, else { addressT min, max; - + max = (((addressT) 1 << (operand->bits - 1))<<1) - 1; min = (offsetT) 0; uval = (addressT) val; @@ -549,7 +559,7 @@ s390_insert_operand (insn, operand, val, const char *err = "operand out of range (%s not between %ld and %ld)"; char buf[100]; - + if (operand->flags & S390_OPERAND_LENGTH) { uval++; @@ -593,6 +603,12 @@ struct map_bfd elf_suffix_type suffix; }; +static elf_suffix_type s390_elf_suffix PARAMS ((char **, expressionS *)); +static int s390_exp_compare PARAMS ((expressionS *exp1, expressionS *exp2)); +static elf_suffix_type s390_lit_suffix + PARAMS ((char **, expressionS *, elf_suffix_type)); + + /* Parse @got/@plt/@gotoff. and return the desired relocation. */ static elf_suffix_type s390_elf_suffix (str_p, exp_p) @@ -709,7 +725,7 @@ s390_exp_compare(exp1, exp2) return exp1->X_add_number == exp2->X_add_number; case O_big: - as_bad (_("Can't handle O_big in s390_exp_compare")); + as_bad (_("Can't handle O_big in s390_exp_compare")); case O_symbol: /* X_add_symbol & X_add_number must be equal. */ case O_symbol_rva: @@ -763,7 +779,7 @@ s390_lit_suffix (str_p, exp_p, suffix) if (*str++ != ':') return suffix; /* No modification. */ - + /* We look for a suffix of the form "@lit1", "@lit2", "@lit4" or "@lit8". */ ident = str; while (isalnum (*str)) @@ -877,7 +893,7 @@ s390_lit_suffix (str_p, exp_p, suffix) else lpe_list = lpe_list_tail = lpe; } - + /* Now change exp_p to the offset into the literal pool. Thats the expression: .L^Ax^By-.L^Ax */ exp_p->X_add_symbol = lpe->sym; @@ -942,8 +958,10 @@ s390_elf_cons (nbytes) reloc_howto->name, nbytes); where = frag_more (nbytes); md_number_to_chars (where, 0, size); - fix_new_exp (frag_now, where - frag_now->fr_literal, - size, &exp, reloc_howto->pc_relative, reloc); + /* To make fixup_segment do the pc relative conversion the + pcrel parameter on the fix_new_exp call needs to be false. */ + fix_new_exp (frag_now, where - frag_now->fr_literal, + size, &exp, false, reloc); } else as_bad (_("relocation not applicable")); @@ -972,7 +990,7 @@ struct s390_fixup /* This routine is called for each instruction to be assembled. */ -char * +static char * md_gather_operands (str, insn, opcode) char *str; unsigned char *insn; @@ -1001,27 +1019,27 @@ md_gather_operands (str, insn, opcode) char *hold; operand = s390_operands + *opindex_ptr; - + if (skip_optional && (operand->flags & S390_OPERAND_INDEX)) { /* We do an early skip. For D(X,B) constructions the index - register is skipped (X is optional). For D(L,B) the base + register is skipped (X is optional). For D(L,B) the base register will be the skipped operand, because L is NOT optional. */ skip_optional = 0; continue; } - + /* Gather the operand. */ hold = input_line_pointer; input_line_pointer = str; if (! register_name (&ex)) /* parse the operand */ expression (&ex); - + str = input_line_pointer; input_line_pointer = hold; - + /* Write the operand to the insn. */ if (ex.X_op == O_illegal) as_bad (_("illegal operand")); @@ -1095,7 +1113,7 @@ md_gather_operands (str, insn, opcode) fixups[fc].reloc = reloc; ++fc; } - + /* Check the next character. The call to expression has advanced str past any whitespace. */ if (operand->flags & S390_OPERAND_DISP) @@ -1113,7 +1131,7 @@ md_gather_operands (str, insn, opcode) /* Ok, skip all operands until S390_OPERAND_BASE. */ while (!(operand->flags & S390_OPERAND_BASE)) operand = s390_operands + *(++opindex_ptr); - + /* If there is a next operand it must be seperated by a comma. */ if (opindex_ptr[1] != '\0') { @@ -1208,18 +1226,18 @@ md_gather_operands (str, insn, opcode) reloc_howto_type *reloc_howto; fixS *fixP; int size; - + reloc_howto = bfd_reloc_type_lookup (stdoutput, fixups[i].reloc); if (!reloc_howto) abort (); - + size = bfd_get_reloc_size (reloc_howto); if (size < 1 || size > 4) abort (); - - fixP = fix_new_exp (frag_now, - f - frag_now->fr_literal + (operand->shift/8), + + fixP = fix_new_exp (frag_now, + f - frag_now->fr_literal + (operand->shift/8), size, &fixups[i].exp, reloc_howto->pc_relative, fixups[i].reloc); /* Turn off overflow checking in fixup_segment. This is necessary @@ -1344,7 +1362,7 @@ s390_insn (ignore) } else if (exp.X_op == O_big) { - if (exp.X_add_number > 0 && + if (exp.X_add_number > 0 && opformat->oplen == 6 && generic_bignum[3] == 0) { @@ -1404,7 +1422,7 @@ s390_byte (ignore) } /* The .ltorg pseudo-op.This emits all literals defined since the last - .ltorg or the invocation of gas. Literals are defined with the + .ltorg or the invocation of gas. Literals are defined with the @lit suffix. */ static void @@ -1432,7 +1450,7 @@ s390_literals (ignore) /* Emit literal pool entry. */ if (lpe->reloc != BFD_RELOC_UNUSED) { - reloc_howto_type *reloc_howto = + reloc_howto_type *reloc_howto = bfd_reloc_type_lookup (stdoutput, lpe->reloc); int size = bfd_get_reloc_size (reloc_howto); char *where; @@ -1509,7 +1527,7 @@ md_atof (type, litp, sizep) md_number_to_chars (litp, (valueT) words[i], 2); litp += 2; } - + return NULL; } @@ -1647,7 +1665,7 @@ md_apply_fix3 (fixp, valuep, seg) && S_GET_SEGMENT (fixp->fx_addsy) != undefined_section && ! bfd_is_com_section (S_GET_SEGMENT (fixp->fx_addsy))) value -= S_GET_VALUE (fixp->fx_addsy); - + if (fixp->fx_pcrel) value += fixp->fx_frag->fr_address + fixp->fx_where; } @@ -1658,10 +1676,10 @@ md_apply_fix3 (fixp, valuep, seg) { const struct s390_operand *operand; int opindex; - + opindex = (int) fixp->fx_r_type - (int) BFD_RELOC_UNUSED; operand = &s390_operands[opindex]; - + if (fixp->fx_done) { /* Insert the fully resolved operand value. */ @@ -1670,7 +1688,7 @@ md_apply_fix3 (fixp, valuep, seg) return 1; } - + /* Determine a BFD reloc value based on the operand information. We are only prepared to turn a few of the operands into relocs. */ @@ -1717,7 +1735,7 @@ md_apply_fix3 (fixp, valuep, seg) { char *sfile; unsigned int sline; - + /* Use expr_symbol_where to see if this is an expression symbol. */ if (expr_symbol_where (fixp->fx_addsy, &sfile, &sline)) @@ -1749,9 +1767,9 @@ md_apply_fix3 (fixp, valuep, seg) mop = bfd_getb16 ((unsigned char *) where); mop |= (unsigned short) (value & 0xfff); bfd_putb16 ((bfd_vma) mop, (unsigned char *) where); - } + } break; - + case BFD_RELOC_16: case BFD_RELOC_GPREL16: case BFD_RELOC_16_GOT_PCREL: @@ -1840,7 +1858,7 @@ md_apply_fix3 (fixp, valuep, seg) default: { const char *reloc_name = bfd_get_reloc_code_name (fixp->fx_r_type); - + if (reloc_name != NULL) fprintf (stderr, "Gas failure, reloc type %s\n", reloc_name); else diff -uprN binutils-2.11.90.0.27/gas/config/tc-sparc.c binutils-2.11.90.0.29/gas/config/tc-sparc.c --- binutils-2.11.90.0.27/gas/config/tc-sparc.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/gas/config/tc-sparc.c Wed Aug 22 08:52:10 2001 @@ -3920,6 +3920,7 @@ s_uacons (bytes) /* Tell sparc_cons_align not to align this value. */ sparc_no_align_cons = 1; cons (bytes); + sparc_no_align_cons = 0; } /* This handles the native word allocation pseudo-op .nword. @@ -4213,8 +4214,7 @@ cons_fix_new_sparc (frag, where, nbytes, case 8: r = BFD_RELOC_SPARC_UA64; break; default: abort (); } - sparc_no_align_cons = 0; - } + } fix_new_exp (frag, where, (int) nbytes, exp, 0, r); } diff -uprN binutils-2.11.90.0.27/gas/config/tc-v850.h binutils-2.11.90.0.29/gas/config/tc-v850.h --- binutils-2.11.90.0.27/gas/config/tc-v850.h Fri Mar 9 11:17:11 2001 +++ binutils-2.11.90.0.29/gas/config/tc-v850.h Wed Aug 22 08:52:10 2001 @@ -1,5 +1,5 @@ /* tc-v850.h -- Header file for tc-v850.c. - Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -38,7 +38,10 @@ #define md_operand(x) #define obj_fix_adjustable(fixP) v850_fix_adjustable(fixP) +extern boolean v850_fix_adjustable PARAMS ((struct fix *)); + #define TC_FORCE_RELOCATION(fixp) v850_force_relocation(fixp) +extern int v850_force_relocation PARAMS ((struct fix *)); #ifdef OBJ_ELF /* This arranges for gas/write.c to not apply a relocation if @@ -46,12 +49,10 @@ #define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP) #endif -extern int v850_force_relocation PARAMS ((struct fix *)); - /* Permit temporary numeric labels. */ #define LOCAL_LABELS_FB 1 -#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */ +#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs. */ /* We don't need to handle .word strangely. */ #define WORKING_DOT_WORD @@ -61,9 +62,13 @@ extern int v850_force_relocation PARAMS /* We need to handle lo(), hi(), etc etc in .hword, .word, etc directives, so we have to parse "cons" expressions ourselves. */ #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) parse_cons_expression_v850 (EXP) +extern void parse_cons_expression_v850 PARAMS ((expressionS *)); + #define TC_CONS_FIX_NEW cons_fix_new_v850 -extern const struct relax_type md_relax_table[]; +extern void cons_fix_new_v850 PARAMS ((fragS *, int, int, expressionS *)); + #define TC_GENERIC_RELAX_TABLE md_relax_table +extern const struct relax_type md_relax_table[]; /* This section must be in the small data area (pointed to by GP). */ #define SHF_V850_GPREL 0x10000000 diff -uprN binutils-2.11.90.0.27/gas/configure binutils-2.11.90.0.29/gas/configure --- binutils-2.11.90.0.27/gas/configure Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/gas/configure Mon Aug 27 11:44:51 2001 @@ -55,6 +55,7 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -169,6 +170,7 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -339,6 +341,11 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -504,12 +511,16 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi +else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -548,12 +559,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:552: checking for Cygwin environment" >&5 +echo "configure:563: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -581,19 +592,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:585: checking for mingw32 environment" >&5 +echo "configure:596: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -658,7 +669,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:662: checking host system type" >&5 +echo "configure:673: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -679,7 +690,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)- echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:683: checking target system type" >&5 +echo "configure:694: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -697,7 +708,7 @@ target_os=`echo $target | sed 's/^\([^-] echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:701: checking build system type" >&5 +echo "configure:712: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -722,7 +733,7 @@ test "$host_alias" != "$target_alias" && # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:726: checking for $ac_word" >&5 +echo "configure:737: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -752,7 +763,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:756: checking for $ac_word" >&5 +echo "configure:767: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -803,7 +814,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:807: checking for $ac_word" >&5 +echo "configure:818: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -835,7 +846,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:839: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:850: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -846,12 +857,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 850 "configure" +#line 861 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -877,12 +888,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:881: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:892: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:886: checking whether we are using GNU C" >&5 +echo "configure:897: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -891,7 +902,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -910,7 +921,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:914: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:925: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -942,7 +953,7 @@ else fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:946: checking for POSIXized ISC" >&5 +echo "configure:957: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -976,7 +987,7 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOM # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:980: checking for a BSD compatible install" >&5 +echo "configure:991: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1029,7 +1040,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:1033: checking whether build environment is sane" >&5 +echo "configure:1044: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1086,7 +1097,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1090: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1101: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1132,7 +1143,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1136: checking for working aclocal" >&5 +echo "configure:1147: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1145,7 +1156,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1149: checking for working autoconf" >&5 +echo "configure:1160: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1158,7 +1169,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1162: checking for working automake" >&5 +echo "configure:1173: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1171,7 +1182,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1175: checking for working autoheader" >&5 +echo "configure:1186: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1184,7 +1195,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1188: checking for working makeinfo" >&5 +echo "configure:1199: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1279,7 +1290,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1283: checking for ld used by GCC" >&5 +echo "configure:1294: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1309,10 +1320,10 @@ echo "configure:1283: checking for ld us esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1313: checking for GNU ld" >&5 +echo "configure:1324: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1316: checking for non-GNU ld" >&5 +echo "configure:1327: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1347,7 +1358,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1351: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1362: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1364,7 +1375,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1368: checking for $LD option to reload object files" >&5 +echo "configure:1379: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1376,7 +1387,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1380: checking for BSD-compatible nm" >&5 +echo "configure:1391: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1414,7 +1425,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1418: checking whether ln -s works" >&5 +echo "configure:1429: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1435,7 +1446,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1439: checking how to recognise dependant libraries" >&5 +echo "configure:1450: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1599,13 +1610,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1603: checking for object suffix" >&5 +echo "configure:1614: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1625,7 +1636,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1629: checking for executable suffix" >&5 +echo "configure:1640: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1635,10 +1646,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1668,7 +1679,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1672: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1683: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1730,7 +1741,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1734: checking for file" >&5 +echo "configure:1745: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1801,7 +1812,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1805: checking for $ac_word" >&5 +echo "configure:1816: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1833,7 +1844,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1837: checking for $ac_word" >&5 +echo "configure:1848: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1868,7 +1879,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1872: checking for $ac_word" >&5 +echo "configure:1883: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1900,7 +1911,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1904: checking for $ac_word" >&5 +echo "configure:1915: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1967,8 +1978,8 @@ test x"$pic_mode" = xno && libtool_flags case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1971 "configure"' > conftest.$ac_ext - if { (eval echo configure:1972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 1982 "configure"' > conftest.$ac_ext + if { (eval echo configure:1983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -1989,7 +2000,7 @@ case $host in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1993: checking whether the C compiler needs -belf" >&5 +echo "configure:2004: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2002,14 +2013,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2264,7 +2275,7 @@ for this_target in $target $canon_target mips*) cpu_type=mips endian=big ;; pjl*) cpu_type=pj endian=little ;; pj*) cpu_type=pj endian=big ;; - powerpcle*) cpu_type=ppc endian=little ;; + powerpc*le*) cpu_type=ppc endian=little ;; powerpc*) cpu_type=ppc endian=big ;; rs6000*) cpu_type=ppc ;; s390x*) cpu_type=s390 arch=s390x ;; @@ -3098,7 +3109,7 @@ EOF # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3102: checking for $ac_word" >&5 +echo "configure:3113: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3128,7 +3139,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3132: checking for $ac_word" >&5 +echo "configure:3143: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3179,7 +3190,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3183: checking for $ac_word" >&5 +echo "configure:3194: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3211,7 +3222,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:3215: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:3226: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -3222,12 +3233,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 3226 "configure" +#line 3237 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:3231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -3253,12 +3264,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:3257: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:3268: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:3262: checking whether we are using GNU C" >&5 +echo "configure:3273: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3267,7 +3278,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -3286,7 +3297,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:3290: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:3301: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3323,7 +3334,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3327: checking for $ac_word" >&5 +echo "configure:3338: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3354,7 +3365,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3358: checking how to run the C preprocessor" >&5 +echo "configure:3369: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3369,13 +3380,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3386,13 +3397,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3407: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3403,13 +3414,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3439,7 +3450,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3443: checking for $ac_word" >&5 +echo "configure:3454: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3472,7 +3483,7 @@ test -n "$LEX" || LEX=""$missing_dir/mis # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3476: checking for $ac_word" >&5 +echo "configure:3487: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3506,7 +3517,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:3510: checking for yywrap in -l$ac_lib" >&5 +echo "configure:3521: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3514,7 +3525,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3548,7 +3559,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:3552: checking lex output file root" >&5 +echo "configure:3563: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3569,7 +3580,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:3573: checking whether yytext is a pointer" >&5 +echo "configure:3584: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3581,14 +3592,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPU ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -3614,7 +3625,7 @@ ALL_LINGUAS= # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3618: checking for $ac_word" >&5 +echo "configure:3629: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3642,12 +3653,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3646: checking for ANSI C header files" >&5 +echo "configure:3657: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3655,7 +3666,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3672,7 +3683,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3690,7 +3701,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3711,7 +3722,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3722,7 +3733,7 @@ if (XOR (islower (i), ISLOWER (i)) || to exit (0); } EOF -if { (eval echo configure:3726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3746,12 +3757,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3750: checking for working const" >&5 +echo "configure:3761: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3821,21 +3832,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3825: checking for inline" >&5 +echo "configure:3836: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3861,12 +3872,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3865: checking for off_t" >&5 +echo "configure:3876: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3894,12 +3905,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3898: checking for size_t" >&5 +echo "configure:3909: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3929,19 +3940,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3933: checking for working alloca.h" >&5 +echo "configure:3944: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3962,12 +3973,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3966: checking for alloca" >&5 +echo "configure:3977: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4027,12 +4038,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4031: checking whether alloca needs Cray hooks" >&5 +echo "configure:4042: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4061: checking for $ac_func" >&5 +echo "configure:4072: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4112,7 +4123,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4116: checking stack direction for C alloca" >&5 +echo "configure:4127: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4120,7 +4131,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4164,17 +4175,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4168: checking for $ac_hdr" >&5 +echo "configure:4179: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4203,12 +4214,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4207: checking for $ac_func" >&5 +echo "configure:4218: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4256,7 +4267,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:4260: checking for working mmap" >&5 +echo "configure:4271: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4264,7 +4275,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -4432,17 +4443,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4436: checking for $ac_hdr" >&5 +echo "configure:4447: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4472,12 +4483,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4476: checking for $ac_func" >&5 +echo "configure:4487: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4529,12 +4540,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4533: checking for $ac_func" >&5 +echo "configure:4544: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4591,19 +4602,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:4595: checking for LC_MESSAGES" >&5 +echo "configure:4606: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:4607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -4624,7 +4635,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:4628: checking whether NLS is requested" >&5 +echo "configure:4639: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -4644,7 +4655,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:4648: checking whether included gettext is requested" >&5 +echo "configure:4659: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -4663,17 +4674,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:4667: checking for libintl.h" >&5 +echo "configure:4678: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4690,19 +4701,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:4694: checking for gettext in libc" >&5 +echo "configure:4705: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:4706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -4718,7 +4729,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:4722: checking for bindtextdomain in -lintl" >&5 +echo "configure:4733: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4726,7 +4737,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4753,19 +4764,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:4757: checking for gettext in libintl" >&5 +echo "configure:4768: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -4793,7 +4804,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4797: checking for $ac_word" >&5 +echo "configure:4808: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4827,12 +4838,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4831: checking for $ac_func" >&5 +echo "configure:4842: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4882,7 +4893,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4886: checking for $ac_word" >&5 +echo "configure:4897: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4918,7 +4929,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4922: checking for $ac_word" >&5 +echo "configure:4933: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4950,7 +4961,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4990,7 +5001,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4994: checking for $ac_word" >&5 +echo "configure:5005: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5024,7 +5035,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5028: checking for $ac_word" >&5 +echo "configure:5039: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5060,7 +5071,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5064: checking for $ac_word" >&5 +echo "configure:5075: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5150,7 +5161,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:5154: checking for catalogs to be installed" >&5 +echo "configure:5165: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -5178,17 +5189,17 @@ echo "configure:5154: checking for catal if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:5182: checking for linux/version.h" >&5 +echo "configure:5193: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5251,7 +5262,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:5255: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:5266: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -5276,7 +5287,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:5280: checking for executable suffix" >&5 +echo "configure:5291: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5286,10 +5297,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:5290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:5301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -5311,17 +5322,17 @@ for ac_hdr in string.h stdlib.h memory.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5315: checking for $ac_hdr" >&5 +echo "configure:5326: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5351,7 +5362,7 @@ done # Put this here so that autoconf's "cross-compiling" message doesn't confuse # people who are not cross-compiling but are compiling cross-assemblers. echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6 -echo "configure:5355: checking whether compiling a cross-assembler" >&5 +echo "configure:5366: checking whether compiling a cross-assembler" >&5 if test "${host}" = "${target}"; then cross_gas=no else @@ -5366,19 +5377,19 @@ echo "$ac_t""$cross_gas" 1>&6 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:5370: checking for working alloca.h" >&5 +echo "configure:5381: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:5382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -5399,12 +5410,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5403: checking for alloca" >&5 +echo "configure:5414: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -5464,12 +5475,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5468: checking whether alloca needs Cray hooks" >&5 +echo "configure:5479: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5498: checking for $ac_func" >&5 +echo "configure:5509: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5549,7 +5560,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5553: checking stack direction for C alloca" >&5 +echo "configure:5564: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5557,7 +5568,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -5598,21 +5609,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5602: checking for inline" >&5 +echo "configure:5613: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -5642,12 +5653,12 @@ esac for ac_func in unlink remove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5646: checking for $ac_func" >&5 +echo "configure:5657: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5699,12 +5710,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5703: checking for $ac_func" >&5 +echo "configure:5714: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5762,7 +5773,7 @@ case $host in ;; *-ncr-sysv4.3*) echo $ac_n "checking for _mwvalidcheckl in -lmw""... $ac_c" 1>&6 -echo "configure:5766: checking for _mwvalidcheckl in -lmw" >&5 +echo "configure:5777: checking for _mwvalidcheckl in -lmw" >&5 ac_lib_var=`echo mw'_'_mwvalidcheckl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5770,7 +5781,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5802,7 +5813,7 @@ else fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5806: checking for main in -lm" >&5 +echo "configure:5817: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5810,14 +5821,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5840,7 +5851,7 @@ fi ;; *) echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5844: checking for main in -lm" >&5 +echo "configure:5855: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5848,14 +5859,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5886,12 +5897,12 @@ esac # enough, but on some of those systems, the assert macro relies on requoting # working properly! echo $ac_n "checking for working assert macro""... $ac_c" 1>&6 -echo "configure:5890: checking for working assert macro" >&5 +echo "configure:5901: checking for working assert macro" >&5 if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5907,7 +5918,7 @@ assert (a == b ; return 0; } EOF -if { (eval echo configure:5911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_assert_ok=yes else @@ -5948,12 +5959,12 @@ gas_test_headers=" " echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6 -echo "configure:5952: checking whether declaration is required for strstr" >&5 +echo "configure:5963: checking whether declaration is required for strstr" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_strstr=no else @@ -5985,12 +5996,12 @@ fi echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6 -echo "configure:5989: checking whether declaration is required for malloc" >&5 +echo "configure:6000: checking whether declaration is required for malloc" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_malloc=no else @@ -6022,12 +6033,12 @@ fi echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6 -echo "configure:6026: checking whether declaration is required for free" >&5 +echo "configure:6037: checking whether declaration is required for free" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_free=no else @@ -6059,12 +6070,12 @@ fi echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6 -echo "configure:6063: checking whether declaration is required for sbrk" >&5 +echo "configure:6074: checking whether declaration is required for sbrk" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_sbrk=no else @@ -6096,12 +6107,12 @@ fi echo $ac_n "checking whether declaration is required for environ""... $ac_c" 1>&6 -echo "configure:6100: checking whether declaration is required for environ" >&5 +echo "configure:6111: checking whether declaration is required for environ" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_environ=no else @@ -6136,12 +6147,12 @@ fi # for it? echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6 -echo "configure:6140: checking whether declaration is required for errno" >&5 +echo "configure:6151: checking whether declaration is required for errno" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_errno=no else diff -uprN binutils-2.11.90.0.27/gas/configure.in binutils-2.11.90.0.29/gas/configure.in --- binutils-2.11.90.0.27/gas/configure.in Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/gas/configure.in Mon Aug 27 11:44:51 2001 @@ -139,7 +139,7 @@ changequote([,])dnl mips*) cpu_type=mips endian=big ;; pjl*) cpu_type=pj endian=little ;; pj*) cpu_type=pj endian=big ;; - powerpcle*) cpu_type=ppc endian=little ;; + powerpc*le*) cpu_type=ppc endian=little ;; powerpc*) cpu_type=ppc endian=big ;; rs6000*) cpu_type=ppc ;; s390x*) cpu_type=s390 arch=s390x ;; diff -uprN binutils-2.11.90.0.27/gas/ecoff.c binutils-2.11.90.0.29/gas/ecoff.c --- binutils-2.11.90.0.27/gas/ecoff.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/gas/ecoff.c Wed Aug 22 08:52:10 2001 @@ -3616,7 +3616,7 @@ ecoff_frob_symbol (sym) { if (S_IS_COMMON (sym) && S_GET_VALUE (sym) > 0 - && S_GET_VALUE (sym) <= (unsigned) bfd_get_gp_size (stdoutput)) + && S_GET_VALUE (sym) <= bfd_get_gp_size (stdoutput)) { static asection scom_section; static asymbol scom_symbol; @@ -4081,7 +4081,7 @@ ecoff_build_symbols (backend, buf, bufen s = symbol_get_obj (as_sym)->ecoff_extern_size; if (s == 0 - || s > (unsigned) bfd_get_gp_size (stdoutput)) + || s > bfd_get_gp_size (stdoutput)) sc = sc_Undefined; else { @@ -4096,7 +4096,7 @@ ecoff_build_symbols (backend, buf, bufen { if (S_GET_VALUE (as_sym) > 0 && (S_GET_VALUE (as_sym) - <= (unsigned) bfd_get_gp_size (stdoutput))) + <= bfd_get_gp_size (stdoutput))) sc = sc_SCommon; else sc = sc_Common; diff -uprN binutils-2.11.90.0.27/gas/expr.c binutils-2.11.90.0.29/gas/expr.c --- binutils-2.11.90.0.27/gas/expr.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/gas/expr.c Wed Aug 22 08:52:10 2001 @@ -811,6 +811,9 @@ operand (expressionP) #ifdef LITERAL_PREFIXDOLLAR_HEX case '$': + /* $L is the start of a local label, not a hex constant. */ + if (* input_line_pointer == 'L') + goto isname; integer_constant (16, expressionP); break; #endif diff -uprN binutils-2.11.90.0.27/gas/read.c binutils-2.11.90.0.29/gas/read.c --- binutils-2.11.90.0.27/gas/read.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/gas/read.c Wed Aug 22 08:52:10 2001 @@ -1988,7 +1988,7 @@ s_lcomm_internal (needs_align, bytes_p) || OUTPUT_FLAVOR == bfd_target_elf_flavour) { /* For MIPS and Alpha ECOFF or ELF, small objects are put in .sbss. */ - if (temp <= bfd_get_gp_size (stdoutput)) + if ((unsigned) temp <= bfd_get_gp_size (stdoutput)) { bss_seg = subseg_new (".sbss", 1); seg_info (bss_seg)->bss = 1; diff -uprN binutils-2.11.90.0.27/gas/testsuite/ChangeLog binutils-2.11.90.0.29/gas/testsuite/ChangeLog --- binutils-2.11.90.0.27/gas/testsuite/ChangeLog Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/gas/testsuite/ChangeLog Mon Aug 27 11:44:52 2001 @@ -1,3 +1,55 @@ +2001-08-27 Staffan Ulfberg + Alan Modra + + * gas/macros/macros.exp: xfail powerpc-*-aix. + * gas/ppc/astest64.s: New. + * gas/ppc/astest64.d: New. + * gas/ppc/astest2_64.s: New. + * gas/ppc/astest2_64.d: New. + * gas/ppc/test1elf.asm: New. + * gas/ppc/test1xcoff.asm: New. + * gas/ppc/generate.sh: New. Generate new files below from above .asm + * gas/ppc/test1elf32.s: New. + * gas/ppc/test1elf32.d: New. + * gas/ppc/test1elf64.s: New. + * gas/ppc/test1elf64.d: New. + * gas/ppc/test1xcoff32.s: New. + * gas/ppc/test1xcoff32.d: New. + * gas/ppc/ppc.exp: Run new tests. + * gas/ppc/simpshft.s: Tweak align now that we get nops. + +2001-08-24 Thiemo Seufer + + * binutils-all/readelf.exp: Don't regard mips*el-*-* as traditional + mips. + * gas/mips/mips.exp: Likewise. Use traditional testcases for + mips${el}16-f if needed. + * gas/mips/elempic.d: New file, testcase for little endian empic. + * gas/mips/elfel-rel2.d: Don't test trailing zeroes in dump. + * gas/mips/mips16-f.d: Use non-traditional symbol sorting. + * gas/mips/mipsel16-f.d: Likewise. + * gas/mips/mipsel16-e.d: New file, testcase for little endian MIPS16 + relocations. + * gas/mips/tmipsel16-f.d: New file, testcase for little endian MIPS16 + relocations, traditional variant. + +2001-08-17 H.J. Lu + + * gas/sparc/unalign.d: Support Sparc V9. + +2001-08-16 Thiemo Seufer + + * gas/mips/mips.exp: Added performance counter test. + * gas/mips/perfcount.s: New File. Test of performance counter opcodes. + * gas/mips/perfcount.d: Likewise. + +2001-08-12 Nick Clifton + + * gas/sparc/unalign.s: Extend test to check .uaword with multiple + arguments. + * gas/sparc/unalign.d: Extend to expect unaligned relocs for both + arguments to .uaword. + 2001-08-10 H.J. Lu * gas/mips/e32-rel2.d: Updated for the objdump output change. diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/macros/macros.exp binutils-2.11.90.0.29/gas/testsuite/gas/macros/macros.exp --- binutils-2.11.90.0.27/gas/testsuite/gas/macros/macros.exp Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.29/gas/testsuite/gas/macros/macros.exp Mon Aug 27 11:44:52 2001 @@ -26,9 +26,10 @@ case $target_triplet in { } } -if { ![istarget hppa*-*-*] || [istarget *-*-linux*] } { +if { ![istarget hppa*-*-*] || [istarget *-*-linux*]} { # FIXME: Due to macro mishandling of ONLY_STANDARD_ESCAPES. setup_xfail cris-*-* + setup_xfail powerpc-*-aix* setup_xfail sh*-*-* setup_xfail z8k*-*-* run_dump_test strings diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/mips/elempic.d binutils-2.11.90.0.29/gas/testsuite/gas/mips/elempic.d --- binutils-2.11.90.0.27/gas/testsuite/gas/mips/elempic.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/mips/elempic.d Mon Aug 27 11:44:52 2001 @@ -0,0 +1,152 @@ +#objdump: -rst -mmips:4000 +#name: MIPS empic +#as: -membedded-pic -mips3 +#source: empic.s + +# Check GNU-specific embedded relocs, for ELF. + +.*: +file format elf.*mips.* + +SYMBOL TABLE: +0+0000000 l d \.text 0+0000000 +0+0000000 l d \.data 0+0000000 +0+0000000 l d \.bss 0+0000000 +0+0000000 l d \.foo 0+0000000 +0+0000000 l d \.reginfo 0+0000000 +0+0000000 l d \.(mdebug|pdr) 0+0000000 +0+0000004 l \.text 0+0000000 l2 +0+0000000 \*UND\* 0+0000000 g1 +0+0000000 \*UND\* 0+0000000 g2 +0+0000100 l \.foo 0+0000000 l1 +0+0000034 l \.text 0+0000000 l3 +0+0000098 l \.text 0+0000000 l5 +0+0000004 l \.foo 0+0000000 l4 + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET [ ]+ TYPE VALUE +0+0000004 R_MIPS_GNU_REL16_S2 g1 +0+000000c R_MIPS_GNU_REL16_S2 g2 +0+0000014 R_MIPS_GNU_REL16_S2 g2 +0+000001c R_MIPS_GNU_REL16_S2 \.foo +0+0000024 R_MIPS_GNU_REL16_S2 \.text +0+000002c R_MIPS_GNU_REL16_S2 \.foo +0+0000034 R_MIPS_GNU_REL16_S2 \.text +0+000003c R_MIPS_GNU_REL_HI16 g1 +0+0000040 R_MIPS_GNU_REL_LO16 g1 +0+0000044 R_MIPS_GNU_REL_HI16 \.foo +0+0000048 R_MIPS_GNU_REL_LO16 \.foo +0+0000050 R_MIPS_32 g1 +0+0000054 R_MIPS_32 \.foo +0+0000058 R_MIPS_32 \.text +0+000005c R_MIPS_PC32 g1 +0+0000060 R_MIPS_PC32 \.foo +0+0000068 R_MIPS_64 g1 +0+0000070 R_MIPS_64 \.foo +0+0000078 R_MIPS_64 \.text +0+0000080 R_MIPS_PC64 g1 +0+0000088 R_MIPS_PC64 \.foo +0+0000098 R_MIPS_GNU_REL16_S2 \.text +0+000009c R_MIPS_GNU_REL16_S2 \.text +0+00000a0 R_MIPS_GNU_REL_HI16 \.text +0+00000a4 R_MIPS_GNU_REL_LO16 \.text +0+00000a8 R_MIPS_GNU_REL_HI16 \.text +0+00000ac R_MIPS_GNU_REL_LO16 \.text +0+00000b0 R_MIPS_32 \.text +0+00000b8 R_MIPS_64 \.text +0+00000cc R_MIPS_GNU_REL16_S2 \.text +0+00000d0 R_MIPS_GNU_REL16_S2 \.text +0+00000dc R_MIPS_32 \.text +0+00000e8 R_MIPS_64 \.text + + +RELOCATION RECORDS FOR \[\.foo\]: +OFFSET [ ]+ TYPE VALUE +0+0000004 R_MIPS_GNU_REL_HI16 g1 +0+0000008 R_MIPS_GNU_REL_LO16 g1 +0+000000c R_MIPS_GNU_REL_HI16 \.foo +0+0000010 R_MIPS_GNU_REL_LO16 \.foo +0+0000014 R_MIPS_GNU_REL_HI16 \.text +0+0000018 R_MIPS_GNU_REL_LO16 \.text +0+000001c R_MIPS_GNU_REL_HI16 g1 +0+0000020 R_MIPS_GNU_REL_LO16 g1 +0+0000024 R_MIPS_GNU_REL_HI16 g1 +0+0000028 R_MIPS_GNU_REL_LO16 g1 +0+000002c R_MIPS_GNU_REL_HI16 \.foo +0+0000030 R_MIPS_GNU_REL_LO16 \.foo +0+0000034 R_MIPS_GNU_REL_HI16 \.text +0+0000038 R_MIPS_GNU_REL_LO16 \.text +0+000003c R_MIPS_32 g1 +0+0000040 R_MIPS_32 \.foo +0+0000044 R_MIPS_32 \.text +0+0000048 R_MIPS_PC32 g1 +0+0000050 R_MIPS_PC32 \.text +0+0000058 R_MIPS_64 g1 +0+0000060 R_MIPS_64 \.foo +0+0000068 R_MIPS_64 \.text +0+0000070 R_MIPS_PC64 g1 +0+0000080 R_MIPS_PC64 \.text +0+0000088 R_MIPS_GNU_REL_HI16 g1 +0+000008c R_MIPS_GNU_REL_LO16 g1 +0+0000090 R_MIPS_GNU_REL_HI16 \.foo +0+0000094 R_MIPS_GNU_REL_LO16 \.foo +0+0000098 R_MIPS_GNU_REL_HI16 \.text +0+000009c R_MIPS_GNU_REL_LO16 \.text +0+00000a0 R_MIPS_GNU_REL_HI16 g1 +0+00000a4 R_MIPS_GNU_REL_LO16 g1 +0+00000a8 R_MIPS_GNU_REL_HI16 \.foo +0+00000ac R_MIPS_GNU_REL_LO16 \.foo +0+00000b0 R_MIPS_GNU_REL_HI16 \.text +0+00000b4 R_MIPS_GNU_REL_LO16 \.text +0+00000b8 R_MIPS_32 g1 +0+00000bc R_MIPS_32 \.foo +0+00000c0 R_MIPS_32 \.text +0+00000c4 R_MIPS_PC32 g1 +0+00000cc R_MIPS_PC32 \.text +0+00000d0 R_MIPS_64 g1 +0+00000d8 R_MIPS_64 \.foo +0+00000e0 R_MIPS_64 \.text +0+00000e8 R_MIPS_PC64 g1 +0+00000f8 R_MIPS_PC64 \.text + +Contents of section \.text: + 0000 00000000 ffff1104 00000000 ffff0010 .* + 0010 00000000 ffff0010 00000000 3f001104 .* + 0020 00000000 00001104 00000000 41000010 .* + 0030 00000000 00000010 00000000 0000033c .* + 0040 0c0063[26]4 0000033c 140163[26]4 d0ff0324 .* + 0050 00000000 00010000 04000000 28000000 .* + 0060 2c010000 d0ffffff 00000000 00000000 .* + 0070 00010000 00000000 04000000 00000000 .* + 0080 4c000000 00000000 54010000 00000000 .* + 0090 d0ffffff ffffffff 32000010 33000010 .* + 00a0 0000033c d8006364 0000033c e8006364 .* + 00b0 cc000000 34000000 cc000000 00000000 .* + 00c0 34000000 00000000 00000000 32000010 .* + 00d0 33000010 34000324 3c000324 cc000000 .* + 00e0 34000000 00000000 cc000000 00000000 .* + 00f0 34000000 00000000 00000000 00000000 .* +Contents of section \.data: +Contents of section \.reginfo: + 0000 08000080 00000000 00000000 00000000 .* + 0010 00000000 00000000 .* +Contents of section \.(mdebug|pdr): +#... +Contents of section \.foo: + 0000 00000000 0000033c 040063[26]4 0000033c .* + 0010 0c0163[26]4 0000033c 180063[26]4 0000033c .* + 0020 1c0063[26]4 0000033c 240063[26]4 0000033c .* + 0030 2c0163[26]4 0000033c 380063[26]4 00000000 .* + 0040 00010000 04000000 44000000 fc000000 .* + 0050 50000000 00000000 00000000 00000000 .* + 0060 00010000 00000000 04000000 00000000 .* + 0070 6c000000 00000000 fc000000 00000000 .* + 0080 80000000 00000000 0000033c 8c0063[26]4 .* + 0090 0000033c 940163[26]4 0000033c a00063[26]4 .* + 00a0 0000033c a40063[26]4 0000033c ac0163[26]4 .* + 00b0 0000033c b80063[26]4 04000000 04010000 .* + 00c0 08000000 c4000000 00010000 d0000000 .* + 00d0 04000000 00000000 04010000 00000000 .* + 00e0 08000000 00000000 e8000000 00000000 .* + 00f0 00010000 00000000 fc000000 00000000 .* + 0100 00000000 00000000 00000000 00000000 .* diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/mips/elfel-rel2.d binutils-2.11.90.0.29/gas/testsuite/gas/mips/elfel-rel2.d --- binutils-2.11.90.0.27/gas/testsuite/gas/mips/elfel-rel2.d Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/gas/testsuite/gas/mips/elfel-rel2.d Mon Aug 27 11:44:52 2001 @@ -24,4 +24,4 @@ OFFSET [ ]+ TYPE VALUE Contents of section \.text: 0000 00c082d7 08c082d7 10c082d7 00c082c7 .* 0010 04c082c7 08c082c7 00c0828f 04c0828f .* - 0020 08c0828f 00000000 00000000 00000000 .* + 0020 08c0828f .* diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips.exp binutils-2.11.90.0.29/gas/testsuite/gas/mips/mips.exp --- binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips.exp Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/gas/testsuite/gas/mips/mips.exp Mon Aug 27 11:44:52 2001 @@ -24,7 +24,7 @@ if { [istarget mips*-*-*] } then { set gpr_ilocks [expr [istarget mipstx39*-*-*]] set addr32 [expr [istarget mipstx39*-*-*]] - if { [istarget mips*el-*-*] || [istarget "mips*-*-*linux*"] } then { + if { [istarget "mips*-*-*linux*"] } then { set tmips "t" } else { set tmips "" @@ -111,6 +111,7 @@ if { [istarget mips*-*-*] } then { run_dump_test "mips4010" run_dump_test "mips4650" run_dump_test "mips4100" + run_dump_test "perfcount" # Linux uses ELF stabs, which doesn't support line number. setup_xfail "mips*-*-*linux*" run_dump_test "lineno" @@ -160,7 +161,7 @@ if { [istarget mips*-*-*] } then { run_dump_test "${tmips}${el}empic" if { !$no_mips16 } { run_dump_test "${tmips}mips${el}16-e" - run_dump_test "mips${el}16-f" + run_dump_test "${tmips}mips${el}16-f" } } } diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips16-f.d binutils-2.11.90.0.29/gas/testsuite/gas/mips/mips16-f.d --- binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips16-f.d Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/gas/testsuite/gas/mips/mips16-f.d Mon Aug 27 11:44:52 2001 @@ -10,10 +10,10 @@ SYMBOL TABLE: 0+0000000 l d \.text 0+0000000 0+0000000 l d \.data 0+0000000 0+0000000 l d \.bss 0+0000000 -0+0000002 l \.text 0+0000000 0xf0 l1 0+0000000 l d foo 0+0000000 0+0000000 l d \.reginfo 0+0000000 0+0000000 l d \.(mdebug|pdr) 0+0000000 +0+0000002 l \.text 0+0000000 0xf0 l1 RELOCATION RECORDS FOR \[foo\]: diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/mips/mipsel16-e.d binutils-2.11.90.0.29/gas/testsuite/gas/mips/mipsel16-e.d --- binutils-2.11.90.0.27/gas/testsuite/gas/mips/mipsel16-e.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/mips/mipsel16-e.d Mon Aug 27 11:44:52 2001 @@ -0,0 +1,42 @@ +#objdump: -rst -mips16 +#name: MIPS16 reloc +#as: -mips16 +#source: mips16-e.s + +# Check MIPS16 reloc processing + +.*: +file format elf.*mips.* + +SYMBOL TABLE: +0+0000000 l d \.text 0+0000000 +0+0000000 l d \.data 0+0000000 +0+0000000 l d \.bss 0+0000000 +0+0000000 l d foo 0+0000000 +0+0000000 l d \.reginfo 0+0000000 +0+0000000 l d \.(mdebug|pdr) 0+0000000 +0+0000002 l \.text 0+0000000 0xf0 l1 +0+0000004 l \.text 0+0000000 0xf0 L1.1 +0+0000000 \*UND\* 0+0000000 g1 + + +RELOCATION RECORDS FOR \[foo\]: +OFFSET [ ]+ TYPE VALUE +0+0000000 R_MIPS_32 l1 +0+0000004 R_MIPS_32 l1 +0+0000008 R_MIPS_32 L1.1 +0+000000c R_MIPS_32 L1.1 +0+0000010 R_MIPS_32 g1 +0+0000014 R_MIPS_32 g1 + + +Contents of section \.text: + 0000 00650065 00650065 00650065 00650065 .* +Contents of section \.data: +Contents of section \.reginfo: + 0000 01000000 00000000 00000000 00000000 .* + 0010 00000000 00000000 .* +Contents of section \.(mdebug|pdr): +#... +Contents of section foo: + 0000 00000000 08000000 00000000 03000000 .* + 0010 00000000 08000000 00000000 00000000 .* diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/mips/mipsel16-f.d binutils-2.11.90.0.29/gas/testsuite/gas/mips/mipsel16-f.d --- binutils-2.11.90.0.27/gas/testsuite/gas/mips/mipsel16-f.d Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/gas/testsuite/gas/mips/mipsel16-f.d Mon Aug 27 11:44:52 2001 @@ -11,10 +11,10 @@ SYMBOL TABLE: 0+0000000 l d \.text 0+0000000 0+0000000 l d \.data 0+0000000 0+0000000 l d \.bss 0+0000000 -0+0000002 l \.text 0+0000000 0xf0 l1 0+0000000 l d foo 0+0000000 0+0000000 l d \.reginfo 0+0000000 0+0000000 l d \.(mdebug|pdr) 0+0000000 +0+0000002 l \.text 0+0000000 0xf0 l1 RELOCATION RECORDS FOR \[foo\]: diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/mips/perfcount.d binutils-2.11.90.0.29/gas/testsuite/gas/mips/perfcount.d --- binutils-2.11.90.0.27/gas/testsuite/gas/mips/perfcount.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/mips/perfcount.d Wed Aug 22 08:52:10 2001 @@ -0,0 +1,11 @@ +#objdump: -dr --prefix-addresses -mmips:10000 +#name: MIPS R1[20]000 performance counters +#as: -mips4 -march=r10000 + +.*: +file format .*mips.* + +Disassembly of section .text: +0+0000 <[^>]*> mtps a0,0 +0+0004 <[^>]*> mfps a0,1 +0+0008 <[^>]*> mtpc a0,1 +0+000c <[^>]*> mfpc a0,0 diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/mips/perfcount.s binutils-2.11.90.0.29/gas/testsuite/gas/mips/perfcount.s --- binutils-2.11.90.0.27/gas/testsuite/gas/mips/perfcount.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/mips/perfcount.s Wed Aug 22 08:52:10 2001 @@ -0,0 +1,7 @@ +# source file to test assembly of R1[20]000 performance counter instructions. + +foo: + mtps $4, 0 + mfps $4, 1 + mtpc $4, 1 + mfpc $4, 0 diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/mips/tmipsel16-f.d binutils-2.11.90.0.29/gas/testsuite/gas/mips/tmipsel16-f.d --- binutils-2.11.90.0.27/gas/testsuite/gas/mips/tmipsel16-f.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/mips/tmipsel16-f.d Mon Aug 27 11:44:52 2001 @@ -0,0 +1,34 @@ +#objdump: -rst -mips16 +#name: MIPS16 reloc 2 +#as: -mips16 +#source: mips16-f.s + +# Check MIPS16 reloc processing + +.*: +file format elf.*mips.* + +SYMBOL TABLE: +0+0000000 l d \.text 0+0000000 +0+0000000 l d \.data 0+0000000 +0+0000000 l d \.bss 0+0000000 +0+0000002 l \.text 0+0000000 0xf0 l1 +0+0000000 l d foo 0+0000000 +0+0000000 l d \.reginfo 0+0000000 +0+0000000 l d \.(mdebug|pdr) 0+0000000 + + +RELOCATION RECORDS FOR \[foo\]: +OFFSET [ ]+ TYPE VALUE +0+0000000 R_MIPS_32 l1 + + +Contents of section \.text: + 0000 00650065 00650065 00650065 00650065 .* +Contents of section \.data: +Contents of section \.reginfo: + 0000 01000000 00000000 00000000 00000000 .* + 0010 00000000 00000000 .* +Contents of section \.(mdebug|pdr): +#... +Contents of section foo: + 0000 03000000 00000000 00000000 00000000 .* diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/astest2_64.d binutils-2.11.90.0.29/gas/testsuite/gas/ppc/astest2_64.d --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/astest2_64.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/astest2_64.d Mon Aug 27 11:44:52 2001 @@ -0,0 +1,70 @@ +#objdump: -Dr +#name: PowerPC 64-bit test 2 + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +0000000000000000 : + 0: 60 00 00 00 nop + 4: 60 00 00 00 nop + 8: 60 00 00 00 nop + c: 48 00 00 04 b 10 + 10: 48 00 00 08 b 18 + 14: 48 00 00 00 b 14 + 14: R_PPC64_REL24 x + 18: 48 00 00 04 b 1c + 18: R_PPC64_REL24 \.data\+0x4 + 1c: 48 00 00 00 b 1c + 1c: R_PPC64_REL24 z + 20: 48 00 00 14 b 34 + 20: R_PPC64_REL24 z\+0x14 + 24: 48 00 00 04 b 28 + 28: 48 00 00 00 b 28 + 28: R_PPC64_REL24 a + 2c: 48 00 00 48 b 74 + 30: 48 00 00 04 b 34 + 30: R_PPC64_REL24 a\+0x4 + 34: 48 00 00 44 b 78 + 38: 00 00 00 38 \.long 0x38 + 38: R_PPC64_ADDR32 \.text\+0x38 + 3c: 00 00 00 44 \.long 0x44 + 3c: R_PPC64_ADDR32 \.text\+0x44 + 40: 00 00 00 00 \.long 0x0 + 40: R_PPC64_REL32 x + 44: 00 00 00 04 \.long 0x4 + 44: R_PPC64_REL32 x\+0x4 + \.\.\. + 48: R_PPC64_REL32 z + 4c: R_PPC64_REL32 y + 50: R_PPC64_ADDR32 x + 54: R_PPC64_ADDR32 y + 58: R_PPC64_ADDR32 z + 5c: ff ff ff fc fnmsub f31,f31,f31,f31 + 5c: R_PPC64_ADDR32 x\+0xfffffffffffffffc + 60: ff ff ff fc fnmsub f31,f31,f31,f31 + 60: R_PPC64_ADDR32 y\+0xfffffffffffffffc + 64: ff ff ff fc fnmsub f31,f31,f31,f31 + 64: R_PPC64_ADDR32 z\+0xfffffffffffffffc + 68: 00 00 00 08 \.long 0x8 + 6c: 00 00 00 08 \.long 0x8 + +0000000000000070 : + 70: 00 00 00 00 \.long 0x0 + 70: R_PPC64_ADDR32 a + +0000000000000074 : + \.\.\. + 74: R_PPC64_ADDR32 b + 78: R_PPC64_ADDR32 apfour + 7c: ff ff ff fc fnmsub f31,f31,f31,f31 + 80: 00 00 00 02 \.long 0x2 + 80: R_PPC64_ADDR32 apfour\+0x2 + 84: 00 00 00 00 \.long 0x0 +Disassembly of section \.data: + +0000000000000000 : + 0: 00 00 00 00 \.long 0x0 + +0000000000000004 : + 4: 00 00 00 00 \.long 0x0 diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/astest2_64.s binutils-2.11.90.0.29/gas/testsuite/gas/ppc/astest2_64.s --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/astest2_64.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/astest2_64.s Mon Aug 27 11:44:52 2001 @@ -0,0 +1,50 @@ +four = 4 + .section ".text" +foo: + nop ; nop ; nop + .globl a + b .+4 + b .+8 + b x + b y + b z + b z+20 + b .+four + b a + b b + b a+4 + b b+4 + .long . + .long .+8 + .long x-. + .long x+4-. + .long z-. + .long y-. + .long x + .long y + .long z + .long x-four + .long y-four + .long z-four + .long a-. + .long b-. +a: .long a +b: .long b + +apfour = a + four + .long apfour + .long a-apfour + .long apfour+2 + .long apfour-b + + .section ".data" + .globl x + .globl z +x: .long 0 +z = . + 4 +y: .long 0 + + .type foo,@function + .type a,@function + .type b,@function + .type apfour,@function diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/astest64.d binutils-2.11.90.0.29/gas/testsuite/gas/ppc/astest64.d --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/astest64.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/astest64.d Mon Aug 27 11:44:52 2001 @@ -0,0 +1,69 @@ +#objdump: -Dr +#name: PowerPC 64-bit test 1 + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +0000000000000000 : + 0: 60 00 00 00 nop + 4: 60 00 00 00 nop + 8: 60 00 00 00 nop + +000000000000000c : + c: 48 00 00 04 b 10 + +0000000000000010 : + 10: 48 00 00 08 b 18 + 14: 48 00 00 00 b 14 + 14: R_PPC64_REL24 x + 18: 48 00 00 04 b 1c + 18: R_PPC64_REL24 \.data\+0x4 + 1c: 48 00 00 00 b 1c + 1c: R_PPC64_REL24 z + 20: 48 00 00 14 b 34 + 20: R_PPC64_REL24 z\+0x14 + 24: 48 00 00 04 b 28 + 28: 48 00 00 00 b 28 + 28: R_PPC64_REL24 a + 2c: 4b ff ff e4 b 10 + 30: 48 00 00 04 b 34 + 30: R_PPC64_REL24 a\+0x4 + 34: 4b ff ff e0 b 14 + 38: 00 00 00 38 \.long 0x38 + 38: R_PPC64_ADDR32 \.text\+0x38 + 3c: 00 00 00 44 \.long 0x44 + 3c: R_PPC64_ADDR32 \.text\+0x44 + 40: 00 00 00 00 \.long 0x0 + 40: R_PPC64_REL32 x + 44: 00 00 00 04 \.long 0x4 + 44: R_PPC64_REL32 x\+0x4 + \.\.\. + 48: R_PPC64_REL32 z + 4c: R_PPC64_REL32 y + 50: R_PPC64_ADDR32 x + 54: R_PPC64_ADDR32 y + 58: R_PPC64_ADDR32 z + 5c: ff ff ff fc fnmsub f31,f31,f31,f31 + 5c: R_PPC64_ADDR32 x\+0xfffffffffffffffc + 60: ff ff ff fc fnmsub f31,f31,f31,f31 + 60: R_PPC64_ADDR32 y\+0xfffffffffffffffc + 64: ff ff ff fc fnmsub f31,f31,f31,f31 + 64: R_PPC64_ADDR32 z\+0xfffffffffffffffc + 68: ff ff ff a4 \.long 0xffffffa4 + 6c: ff ff ff a4 \.long 0xffffffa4 + \.\.\. + 70: R_PPC64_ADDR32 a + 74: R_PPC64_ADDR32 b + 78: R_PPC64_ADDR32 apfour + 7c: ff ff ff fc fnmsub f31,f31,f31,f31 + 80: 00 00 00 02 \.long 0x2 + 80: R_PPC64_ADDR32 apfour\+0x2 + 84: 00 00 00 00 \.long 0x0 +Disassembly of section \.data: + +0000000000000000 : + 0: 00 00 00 00 \.long 0x0 + +0000000000000004 : + 4: 00 00 00 00 \.long 0x0 diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/astest64.s binutils-2.11.90.0.29/gas/testsuite/gas/ppc/astest64.s --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/astest64.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/astest64.s Mon Aug 27 11:44:52 2001 @@ -0,0 +1,50 @@ + .section ".data" + .globl x + .globl z +x: .long 0 +z = . + 4 +four = z - x - 4 +y: .long 0 + + .section ".text" +foo: + nop ; nop ; nop + .globl a +a: b .+4 +b: b .+8 + b x + b y + b z + b z+20 + b .+four + b a + b b + b a+4 + b b+4 + .long . + .long .+8 + .long x-. + .long x+4-. + .long z-. + .long y-. + .long x + .long y + .long z + .long x-four + .long y-four + .long z-four + .long a-. + .long b-. + .long a + .long b + +apfour = a + four + .long apfour + .long a-apfour + .long apfour+2 + .long apfour-b + + .type foo,@function + .type a,@function + .type b,@function + .type apfour,@function diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/generate.sh binutils-2.11.90.0.29/gas/testsuite/gas/ppc/generate.sh --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/generate.sh Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/generate.sh Mon Aug 27 11:44:52 2001 @@ -0,0 +1,6 @@ +#! /bin/sh + +m4 -DELF32 test1elf.asm >test1elf32.s +m4 -DELF64 test1elf.asm >test1elf64.s +m4 -DXCOFF32 test1xcoff.asm >test1xcoff32.s +#m4 -DXCOFF64 test1xcoff.asm >test1xcoff64.s diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/ppc.exp binutils-2.11.90.0.29/gas/testsuite/gas/ppc/ppc.exp --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/ppc.exp Thu Jun 3 11:02:04 1999 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/ppc.exp Mon Aug 27 11:44:52 2001 @@ -5,7 +5,14 @@ # These tests are currently ELF specific, only because nobody has # converted them to look for XCOFF relocations. -if { [istarget powerpc*-*-*bsd*] \ +if { [istarget powerpc64*-*-*] || [istarget *-*-elf64*]} then { +# FIXME: Pass -x to objdump as well as -Dr for astest64 and astest2_64. + run_dump_test "astest64" + run_dump_test "astest2_64" + run_dump_test "test1elf64" +} elseif { [istarget powerpc*-*aix*] } then { + run_dump_test "test1xcoff32" +} elseif { [istarget powerpc*-*-*bsd*] \ || [istarget powerpc*-*-elf*] \ || [istarget powerpc*-*-eabi*] \ || [istarget powerpc*-*-sysv4*] \ @@ -14,6 +21,7 @@ if { [istarget powerpc*-*-*bsd*] \ || [istarget powerpc*-*-rtems*] } then { run_dump_test "astest" run_dump_test "astest2" + run_dump_test "test1elf32" } if { [istarget powerpc*-*-*] } then { diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/simpshft.s binutils-2.11.90.0.29/gas/testsuite/gas/ppc/simpshft.s --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/simpshft.s Thu Jun 3 11:02:04 1999 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/simpshft.s Mon Aug 27 11:44:52 2001 @@ -107,4 +107,4 @@ clrlslwi %r4,%r3,31,31 # Force alignment so that we pass the test on AIX - .p2align 3 + .p2align 3,0 diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1elf.asm binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1elf.asm --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1elf.asm Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1elf.asm Mon Aug 27 11:44:52 2001 @@ -0,0 +1,95 @@ +dnl divert(-1) +ifdef(`ELF64', +` define(`WORD',`.llong') + define(`LDW',`ld')') +ifdef(`ELF32', +` define(`WORD',`.long') + define(`LDW',`lwz')') +dnl divert(0) dnl + +define(`nl',` +') nl nl nl nl nl nl + + .section ".data" +dsym0: WORD 0xdeadbeef +dsym1: + +ifdef(`ELF64',` + .section ".toc" +.L_tsym0: + .tc ignored0[TC],dsym0 +.L_tsym1: + .tc ignored1[TC],dsym1 +.L_tsym2: + .tc ignored2[TC],usym0 +.L_tsym3: + .tc ignored3[TC],usym1 +.L_tsym4: + .tc ignored4[TC],esym0 +.L_tsym5: + .tc ignored5[TC],esym1 +') + + .section ".text" + LDW 3,dsym0@l(3) + LDW 3,dsym1@l(3) + LDW 3,usym0@l(3) + LDW 3,usym1@l(3) + LDW 3,esym0@l(3) + LDW 3,esym1@l(3) + +ifdef(`ELF64',` + LDW 3,.L_tsym0@toc(2) + LDW 3,.L_tsym1@toc(2) + LDW 3,.L_tsym2@toc(2) + LDW 3,.L_tsym3@toc(2) + LDW 3,.L_tsym4@toc(2) + LDW 3,.L_tsym5@toc(2) + + lis 4,.L_tsym5@toc@ha + LDW 3,.L_tsym5@toc@l(2) +') + + li 3,dsym1-dsym0 + li 3,dsym0-dsym1 + li 3,usym1-usym0 + li 3,usym0-usym1 + li 3,dsym0-usym0 + li 3,usym0-dsym0 + + li 3,dsym0@l + li 3,dsym0@h + li 3,dsym0@ha +ifdef(`ELF64',` + li 3,dsym0@higher + li 3,dsym0@highera + li 3,dsym0@highest + li 3,dsym0@highesta +') + + li 3,usym0-usym1@l + li 3,usym0-usym1@h + li 3,usym0-usym1@ha +ifdef(`ELF64',` + li 3,usym0-usym1@higher + li 3,usym0-usym1@highera + li 3,usym0-usym1@highest + li 3,usym0-usym1@highesta +') + + LDW 3,dsym1-dsym0@l(4) + + LDW 3,.text@l(0) + + .section ".data" +usym0: WORD 0xcafebabe +usym1: + +datpt: .long jk-.+10000000 +dat0: .long jk-dat1 +dat1: .long jk-dat1 +dat2: .long jk-dat1 +ifdef(`ELF64',` +dat3: .llong jk-dat1 +dat4: .llong jk-dat1 +') diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1elf32.d binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1elf32.d --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1elf32.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1elf32.d Mon Aug 27 11:44:52 2001 @@ -0,0 +1,90 @@ +#objdump: -Drx +#name: PowerPC Test 1, 32 bit elf + +.*: +file format elf32-powerpc +.* +architecture: powerpc:common, flags 0x00000011: +HAS_RELOC, HAS_SYMS +start address 0x00000000 + +Sections: +Idx Name +Size +VMA +LMA +File off +Algn + 0 \.text +00000050 0+0000 0+0000 .* + +CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE + 1 \.data +00000018 0+0000 0+0000 .* + +CONTENTS, ALLOC, LOAD, RELOC, DATA + 2 \.bss +00000000 0+0000 0+0000 .* + +ALLOC +SYMBOL TABLE: +0+0000 l d \.text 0+0000 +0+0000 l d \.data 0+0000 +0+0000 l d \.bss 0+0000 +0+0000 l \.data 0+0000 dsym0 +0+0004 l \.data 0+0000 dsym1 +0+0004 l \.data 0+0000 usym0 +0+0008 l \.data 0+0000 usym1 +0+0008 l \.data 0+0000 datpt +0+000c l \.data 0+0000 dat0 +0+0010 l \.data 0+0000 dat1 +0+0014 l \.data 0+0000 dat2 +0+0000 \*UND\* 0+0000 esym0 +0+0000 \*UND\* 0+0000 esym1 +0+0000 \*UND\* 0+0000 jk + + +Disassembly of section \.text: + +0+0000 <\.text>: + 0: 80 63 00 00 lwz r3,0\(r3\) + 2: R_PPC_ADDR16_LO dsym0 + 4: 80 63 00 00 lwz r3,0\(r3\) + 6: R_PPC_ADDR16_LO dsym1 + 8: 80 63 00 00 lwz r3,0\(r3\) + a: R_PPC_ADDR16_LO usym0 + c: 80 63 00 00 lwz r3,0\(r3\) + e: R_PPC_ADDR16_LO usym1 + 10: 80 63 00 00 lwz r3,0\(r3\) + 12: R_PPC_ADDR16_LO esym0 + 14: 80 63 00 00 lwz r3,0\(r3\) + 16: R_PPC_ADDR16_LO esym1 + 18: 38 60 00 04 li r3,4 + 1c: 38 60 ff fc li r3,-4 + 20: 38 60 00 04 li r3,4 + 24: 38 60 ff fc li r3,-4 + 28: 38 60 ff fc li r3,-4 + 2c: 38 60 00 04 li r3,4 + 30: 38 60 00 00 li r3,0 + 32: R_PPC_ADDR16_LO dsym0 + 34: 38 60 00 00 li r3,0 + 36: R_PPC_ADDR16_HI dsym0 + 38: 38 60 00 00 li r3,0 + 3a: R_PPC_ADDR16_HA dsym0 + 3c: 38 60 ff fc li r3,-4 + 40: 38 60 ff ff li r3,-1 + 44: 38 60 00 00 li r3,0 + 48: 80 64 00 04 lwz r3,4\(r4\) + 4c: 80 60 00 00 lwz r3,0\(r0\) + 4e: R_PPC_ADDR16_LO \.text +Disassembly of section \.data: + +0+0000 : + 0: de ad be ef stfdu f21,-16657\(r13\) + +0+0004 : + 4: ca fe ba be lfd f23,-17730\(r30\) + +0+0008 : + 8: 00 98 96 80 \.long 0x989680 + 8: R_PPC_REL32 jk\+0x989680 + +0+000c : + c: ff ff ff fc fnmsub f31,f31,f31,f31 + c: R_PPC_REL32 jk\+0xf+fffc + +0+0010 : + 10: 00 00 00 00 \.long 0x0 + 10: R_PPC_REL32 jk + +0+0014 : + 14: 00 00 00 04 \.long 0x4 + 14: R_PPC_REL32 jk\+0x4 diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1elf32.s binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1elf32.s --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1elf32.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1elf32.s Mon Aug 27 11:44:52 2001 @@ -0,0 +1,58 @@ + + + + + + + + + + + + + .section ".data" +dsym0: .long 0xdeadbeef +dsym1: + + + + .section ".text" + lwz 3,dsym0@l(3) + lwz 3,dsym1@l(3) + lwz 3,usym0@l(3) + lwz 3,usym1@l(3) + lwz 3,esym0@l(3) + lwz 3,esym1@l(3) + + + + li 3,dsym1-dsym0 + li 3,dsym0-dsym1 + li 3,usym1-usym0 + li 3,usym0-usym1 + li 3,dsym0-usym0 + li 3,usym0-dsym0 + + li 3,dsym0@l + li 3,dsym0@h + li 3,dsym0@ha + + + li 3,usym0-usym1@l + li 3,usym0-usym1@h + li 3,usym0-usym1@ha + + + lwz 3,dsym1-dsym0@l(4) + + lwz 3,.text@l(0) + + .section ".data" +usym0: .long 0xcafebabe +usym1: + +datpt: .long jk-.+10000000 +dat0: .long jk-dat1 +dat1: .long jk-dat1 +dat2: .long jk-dat1 + diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1elf64.d binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1elf64.d --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1elf64.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1elf64.d Mon Aug 27 11:44:52 2001 @@ -0,0 +1,145 @@ +#objdump: -Drx +#name: PowerPC Test 1, 64 bit elf + +.*: +file format elf64-powerpc +.* +architecture: powerpc:common, flags 0x00000011: +HAS_RELOC, HAS_SYMS +start address 0x0000000000000000 + +Sections: +Idx Name Size VMA LMA File off Algn + 0 \.text 00000090 0000000000000000 0000000000000000 .* + CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE + 1 \.data 00000030 0000000000000000 0000000000000000 .* + CONTENTS, ALLOC, LOAD, RELOC, DATA + 2 \.bss 00000000 0000000000000000 0000000000000000 .* + ALLOC + 3 \.toc 00000030 0000000000000000 0000000000000000 .* + CONTENTS, ALLOC, LOAD, RELOC, DATA +SYMBOL TABLE: +0000000000000000 l d \.text 0000000000000000 +0000000000000000 l d \.data 0000000000000000 +0000000000000000 l d \.bss 0000000000000000 +0000000000000000 l \.data 0000000000000000 dsym0 +0000000000000008 l \.data 0000000000000000 dsym1 +0000000000000000 l d \.toc 0000000000000000 +0000000000000008 l \.data 0000000000000000 usym0 +0000000000000010 l \.data 0000000000000000 usym1 +0000000000000010 l \.data 0000000000000000 datpt +0000000000000014 l \.data 0000000000000000 dat0 +0000000000000018 l \.data 0000000000000000 dat1 +000000000000001c l \.data 0000000000000000 dat2 +0000000000000020 l \.data 0000000000000000 dat3 +0000000000000028 l \.data 0000000000000000 dat4 +0000000000000000 \*UND\* 0000000000000000 esym0 +0000000000000000 \*UND\* 0000000000000000 esym1 +0000000000000000 \*UND\* 0000000000000000 jk + + +Disassembly of section \.text: + +0000000000000000 <\.text>: + 0: e8 63 00 00 ld r3,0\(r3\) + 2: R_PPC64_ADDR16_LO_DS dsym0 + 4: e8 63 00 00 ld r3,0\(r3\) + 6: R_PPC64_ADDR16_LO_DS dsym1 + 8: e8 63 00 00 ld r3,0\(r3\) + a: R_PPC64_ADDR16_LO_DS usym0 + c: e8 63 00 00 ld r3,0\(r3\) + e: R_PPC64_ADDR16_LO_DS usym1 + 10: e8 63 00 00 ld r3,0\(r3\) + 12: R_PPC64_ADDR16_LO_DS esym0 + 14: e8 63 00 00 ld r3,0\(r3\) + 16: R_PPC64_ADDR16_LO_DS esym1 + 18: e8 62 00 00 ld r3,0\(r2\) + 1a: R_PPC64_TOC16_DS \.toc + 1c: e8 62 00 08 ld r3,8\(r2\) + 1e: R_PPC64_TOC16_DS \.toc\+0x8 + 20: e8 62 00 10 ld r3,16\(r2\) + 22: R_PPC64_TOC16_DS \.toc\+0x10 + 24: e8 62 00 18 ld r3,24\(r2\) + 26: R_PPC64_TOC16_DS \.toc\+0x18 + 28: e8 62 00 20 ld r3,32\(r2\) + 2a: R_PPC64_TOC16_DS \.toc\+0x20 + 2c: e8 62 00 28 ld r3,40\(r2\) + 2e: R_PPC64_TOC16_DS \.toc\+0x28 + 30: 3c 80 00 28 lis r4,40 + 32: R_PPC64_TOC16_HA \.toc\+0x28 + 34: e8 62 00 28 ld r3,40\(r2\) + 36: R_PPC64_TOC16_LO_DS \.toc\+0x28 + 38: 38 60 00 08 li r3,8 + 3c: 38 60 ff f8 li r3,-8 + 40: 38 60 00 08 li r3,8 + 44: 38 60 ff f8 li r3,-8 + 48: 38 60 ff f8 li r3,-8 + 4c: 38 60 00 08 li r3,8 + 50: 38 60 00 00 li r3,0 + 52: R_PPC64_ADDR16_LO dsym0 + 54: 38 60 00 00 li r3,0 + 56: R_PPC64_ADDR16_HI dsym0 + 58: 38 60 00 00 li r3,0 + 5a: R_PPC64_ADDR16_HA dsym0 + 5c: 38 60 00 00 li r3,0 + 5e: R_PPC64_ADDR16_HIGHER dsym0 + 60: 38 60 00 00 li r3,0 + 62: R_PPC64_ADDR16_HIGHERA dsym0 + 64: 38 60 00 00 li r3,0 + 66: R_PPC64_ADDR16_HIGHEST dsym0 + 68: 38 60 00 00 li r3,0 + 6a: R_PPC64_ADDR16_HIGHESTA dsym0 + 6c: 38 60 ff f8 li r3,-8 + 70: 38 60 ff ff li r3,-1 + 74: 38 60 00 00 li r3,0 + 78: 38 60 ff ff li r3,-1 + 7c: 38 60 00 00 li r3,0 + 80: 38 60 ff ff li r3,-1 + 84: 38 60 00 00 li r3,0 + 88: e8 64 00 08 ld r3,8\(r4\) + 8c: e8 60 00 00 ld r3,0\(r0\) + 8e: R_PPC64_ADDR16_LO_DS \.text +Disassembly of section \.data: + +0000000000000000 : + 0: 00 00 00 00 \.long 0x0 + 4: de ad be ef stfdu f21,-16657\(r13\) + +0000000000000008 : + 8: 00 00 00 00 \.long 0x0 + c: ca fe ba be lfd f23,-17730\(r30\) + +0000000000000010 : + 10: 00 98 96 80 \.long 0x989680 + 10: R_PPC64_REL32 jk\+0x989680 + +0000000000000014 : + 14: ff ff ff fc fnmsub f31,f31,f31,f31 + 14: R_PPC64_REL32 jk\+0xfffffffffffffffc + +0000000000000018 : + 18: 00 00 00 00 \.long 0x0 + 18: R_PPC64_REL32 jk + +000000000000001c : + 1c: 00 00 00 04 \.long 0x4 + 1c: R_PPC64_REL32 jk\+0x4 + +0000000000000020 : + 20: 00 00 00 00 \.long 0x0 + 20: R_PPC64_REL64 jk\+0x8 + 24: 00 00 00 08 \.long 0x8 + +0000000000000028 : + 28: 00 00 00 00 \.long 0x0 + 28: R_PPC64_REL64 jk\+0x10 + 2c: 00 00 00 10 \.long 0x10 +Disassembly of section \.toc: + +0000000000000000 <\.toc>: + \.\.\. + 0: R_PPC64_ADDR64 dsym0 + 8: R_PPC64_ADDR64 dsym1 + 10: R_PPC64_ADDR64 usym0 + 18: R_PPC64_ADDR64 usym1 + 20: R_PPC64_ADDR64 esym0 + 28: R_PPC64_ADDR64 esym1 diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1elf64.s binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1elf64.s --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1elf64.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1elf64.s Mon Aug 27 11:44:52 2001 @@ -0,0 +1,95 @@ + + + + + + + + + + + + + .section ".data" +dsym0: .llong 0xdeadbeef +dsym1: + + + .section ".toc" +.L_tsym0: + .tc ignored0[TC],dsym0 +.L_tsym1: + .tc ignored1[TC],dsym1 +.L_tsym2: + .tc ignored2[TC],usym0 +.L_tsym3: + .tc ignored3[TC],usym1 +.L_tsym4: + .tc ignored4[TC],esym0 +.L_tsym5: + .tc ignored5[TC],esym1 + + + .section ".text" + ld 3,dsym0@l(3) + ld 3,dsym1@l(3) + ld 3,usym0@l(3) + ld 3,usym1@l(3) + ld 3,esym0@l(3) + ld 3,esym1@l(3) + + + ld 3,.L_tsym0@toc(2) + ld 3,.L_tsym1@toc(2) + ld 3,.L_tsym2@toc(2) + ld 3,.L_tsym3@toc(2) + ld 3,.L_tsym4@toc(2) + ld 3,.L_tsym5@toc(2) + + lis 4,.L_tsym5@toc@ha + ld 3,.L_tsym5@toc@l(2) + + + li 3,dsym1-dsym0 + li 3,dsym0-dsym1 + li 3,usym1-usym0 + li 3,usym0-usym1 + li 3,dsym0-usym0 + li 3,usym0-dsym0 + + li 3,dsym0@l + li 3,dsym0@h + li 3,dsym0@ha + + li 3,dsym0@higher + li 3,dsym0@highera + li 3,dsym0@highest + li 3,dsym0@highesta + + + li 3,usym0-usym1@l + li 3,usym0-usym1@h + li 3,usym0-usym1@ha + + li 3,usym0-usym1@higher + li 3,usym0-usym1@highera + li 3,usym0-usym1@highest + li 3,usym0-usym1@highesta + + + ld 3,dsym1-dsym0@l(4) + + ld 3,.text@l(0) + + .section ".data" +usym0: .llong 0xcafebabe +usym1: + +datpt: .long jk-.+10000000 +dat0: .long jk-dat1 +dat1: .long jk-dat1 +dat2: .long jk-dat1 + +dat3: .llong jk-dat1 +dat4: .llong jk-dat1 + diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1xcoff.asm binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1xcoff.asm --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1xcoff.asm Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1xcoff.asm Mon Aug 27 11:44:52 2001 @@ -0,0 +1,82 @@ +dnl divert(-1) +ifdef(`XCOFF64', +` define(`WORD',`.llong') + define(`LDW',`ld')') +ifdef(`XCOFF32', +` define(`WORD',`.long') + define(`LDW',`lwz')') +dnl divert(0) dnl + +define(`nl',` +') nl nl nl nl nl nl + + .csect [RW] +dsym0: WORD 0xdeadbeef +dsym1: + + .toc +.L_tsym0: + .tc ignored0[TC],dsym0 +.L_tsym1: + .tc ignored1[TC],dsym1 +.L_tsym2: + .tc ignored2[TC],usym0 +.L_tsym3: + .tc ignored3[TC],usym1 +.L_tsym4: + .tc ignored4[TC],esym0 +.L_tsym5: + .tc ignored5[TC],esym1 +.L_tsym6: + .tc ignored6[TC],.text + + .csect .crazy_table[RO] +xdsym0: WORD 0xbeefed +xdsym1: + .csect [PR] + .lglobl reference_csect_relative_symbols +reference_csect_relative_symbols: + LDW 3,xdsym0(3) + LDW 3,xdsym1(3) + LDW 3,xusym0(3) + LDW 3,xusym1(3) + + .lglobl dubious_references_to_default_RW_csect +dubious_references_to_default_RW_csect: + LDW 3,dsym0(3) + LDW 3,dsym1(3) + LDW 3,usym0(3) + LDW 3,usym1(3) + + .lglobl reference_via_toc +reference_via_toc: + LDW 3,.L_tsym0(2) + LDW 3,.L_tsym1(2) + LDW 3,.L_tsym2(2) + LDW 3,.L_tsym3(2) + LDW 3,.L_tsym4(2) + LDW 3,.L_tsym5(2) + + .lglobl subtract_symbols +subtract_symbols: + li 3,dsym1-dsym0 + li 3,dsym0-dsym1 + li 3,usym1-usym0 + li 3,usym0-usym1 + li 3,dsym0-usym0 + li 3,usym0-dsym0 + LDW 3,dsym1-dsym0(4) + + .lglobl load_addresses +load_addresses: + la 3,xdsym0(0) + la 3,xusym0(0) + + la 3,.L_tsym6(2) + + .csect [RW] +usym0: WORD 0xcafebabe +usym1: WORD 0xbaad + .csect .crazy_table[RO] +xusym0: WORD 0xbeefed +xusym1: diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1xcoff32.d binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1xcoff32.d --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1xcoff32.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1xcoff32.d Mon Aug 27 11:44:52 2001 @@ -0,0 +1,139 @@ +#objdump: -Drx +#as: +#name: PowerPC Test 1, 32 bit XCOFF + +.*: +file format aixcoff-rs6000 +.* +architecture: rs6000:6000, flags 0x00000031: +HAS_RELOC, HAS_SYMS, HAS_LOCALS +start address 0x0+0000 + +Sections: +Idx Name +Size +VMA +LMA +File off +Algn + 0 \.text +00000068 0+0000 0+0000 000000a8 2\*\*3 + +CONTENTS, ALLOC, LOAD, RELOC, CODE + 1 \.data +00000028 0+0068 0+0068 00000110 2\*\*3 + +CONTENTS, ALLOC, LOAD, RELOC, DATA + 2 \.bss +00000000 0+0090 0+0090 00000000 2\*\*3 + +ALLOC +SYMBOL TABLE: +\[ 0\]\(sec -2\)\(fl 0x00\)\(ty 0\)\(scl 103\) \(nx 1\) 0x00000000 fake +File +\[ 2\]\(sec 1\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000000 \.crazy_table +AUX val 8 prmhsh 0 snhsh 0 typ 1 algn 2 clss 1 stb 0 snstb 0 +\[ 4\]\(sec 1\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000008 +AUX val 96 prmhsh 0 snhsh 0 typ 1 algn 2 clss 0 stb 0 snstb 0 +\[ 6\]\(sec 1\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000008 reference_csect_relative_symbols +AUX indx 4 prmhsh 0 snhsh 0 typ 2 algn 0 clss 0 stb 0 snstb 0 +\[ 8\]\(sec 1\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000018 dubious_references_to_default_RW_csect +AUX indx 4 prmhsh 0 snhsh 0 typ 2 algn 0 clss 0 stb 0 snstb 0 +\[ 10\]\(sec 1\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000028 reference_via_toc +AUX indx 4 prmhsh 0 snhsh 0 typ 2 algn 0 clss 0 stb 0 snstb 0 +\[ 12\]\(sec 1\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000040 subtract_symbols +AUX indx 4 prmhsh 0 snhsh 0 typ 2 algn 0 clss 0 stb 0 snstb 0 +\[ 14\]\(sec 1\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x0000005c load_addresses +AUX indx 4 prmhsh 0 snhsh 0 typ 2 algn 0 clss 0 stb 0 snstb 0 +\[ 16\]\(sec 2\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000068 +AUX val 12 prmhsh 0 snhsh 0 typ 1 algn 2 clss 5 stb 0 snstb 0 +\[ 18\]\(sec 2\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000074 TOC +AUX val 0 prmhsh 0 snhsh 0 typ 1 algn 2 clss 15 stb 0 snstb 0 +\[ 20\]\(sec 2\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000074 ignored0 +AUX val 4 prmhsh 0 snhsh 0 typ 1 algn 2 clss 3 stb 0 snstb 0 +\[ 22\]\(sec 2\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000078 ignored1 +AUX val 4 prmhsh 0 snhsh 0 typ 1 algn 2 clss 3 stb 0 snstb 0 +\[ 24\]\(sec 2\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x0000007c ignored2 +AUX val 4 prmhsh 0 snhsh 0 typ 1 algn 2 clss 3 stb 0 snstb 0 +\[ 26\]\(sec 2\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000080 ignored3 +AUX val 4 prmhsh 0 snhsh 0 typ 1 algn 2 clss 3 stb 0 snstb 0 +\[ 28\]\(sec 2\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000084 ignored4 +AUX val 4 prmhsh 0 snhsh 0 typ 1 algn 2 clss 3 stb 0 snstb 0 +\[ 30\]\(sec 2\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x00000088 ignored5 +AUX val 4 prmhsh 0 snhsh 0 typ 1 algn 2 clss 3 stb 0 snstb 0 +\[ 32\]\(sec 2\)\(fl 0x00\)\(ty 0\)\(scl 107\) \(nx 1\) 0x0000008c ignored6 +AUX val 4 prmhsh 0 snhsh 0 typ 1 algn 2 clss 3 stb 0 snstb 0 +\[ 34\]\(sec 0\)\(fl 0x00\)\(ty 0\)\(scl 2\) \(nx 1\) 0x00000000 esym0 +AUX val 0 prmhsh 0 snhsh 0 typ 0 algn 0 clss 0 stb 0 snstb 0 +\[ 36\]\(sec 0\)\(fl 0x00\)\(ty 0\)\(scl 2\) \(nx 1\) 0x00000000 esym1 +AUX val 0 prmhsh 0 snhsh 0 typ 0 algn 0 clss 0 stb 0 snstb 0 + + +Disassembly of section \.text: + +0+0000 <\.crazy_table>: + 0: 00 be ef ed \.long 0xbeefed + 4: 00 be ef ed \.long 0xbeefed + +0+0008 : + 8: 80 63 00 00 l r3,0\(r3\) + c: 80 63 00 04 l r3,4\(r3\) + 10: 80 63 00 04 l r3,4\(r3\) + 14: 80 63 00 00 l r3,0\(r3\) + +0+0018 : + 18: 80 63 00 00 l r3,0\(r3\) + 1c: 80 63 00 04 l r3,4\(r3\) + 20: 80 63 00 04 l r3,4\(r3\) + 24: 80 63 00 08 l r3,8\(r3\) + +0+0028 : + 28: 80 62 00 0c l r3,12\(r2\) + 2a: R_TOC ignored0\+0xf+ff8c + 2c: 80 62 00 10 l r3,16\(r2\) + 2e: R_TOC ignored1\+0xf+ff88 + 30: 80 62 00 14 l r3,20\(r2\) + 32: R_TOC ignored2\+0xf+ff84 + 34: 80 62 00 18 l r3,24\(r2\) + 36: R_TOC ignored3\+0xf+ff80 + 38: 80 62 00 1c l r3,28\(r2\) + 3a: R_TOC ignored4\+0xf+ff7c + 3c: 80 62 00 20 l r3,32\(r2\) + 3e: R_TOC ignored5\+0xf+ff78 + +0+0040 : + 40: 38 60 00 04 lil r3,4 + 44: 38 60 ff fc lil r3,-4 + 48: 38 60 00 04 lil r3,4 + 4c: 38 60 ff fc lil r3,-4 + 50: 38 60 ff fc lil r3,-4 + 54: 38 60 00 04 lil r3,4 + 58: 80 64 00 04 l r3,4\(r4\) + +0+005c : + 5c: 38 60 00 00 lil r3,0 + 60: 38 60 00 04 lil r3,4 + 64: 38 62 00 24 cal r3,36\(r2\) + 66: R_TOC ignored6\+0xf+ff74 +Disassembly of section \.data: + +0+0068 : + 68: de ad be ef stfdu f21,-16657\(r13\) + 6c: ca fe ba be lfd f23,-17730\(r30\) + 70: 00 00 ba ad \.long 0xbaad + +0+0074 : + 74: 00 00 00 68 \.long 0x68 + 74: R_POS \.data\+0xf+ff98 + +0+0078 : + 78: 00 00 00 6c \.long 0x6c + 78: R_POS \.data\+0xf+ff98 + +0+007c : + 7c: 00 00 00 6c \.long 0x6c + 7c: R_POS \.data\+0xf+ff98 + +0+0080 : + 80: 00 00 00 70 \.long 0x70 + 80: R_POS \.data\+0xf+ff98 + +0+0084 : + 84: 00 00 00 00 \.long 0x0 + 84: R_POS esym0 + +0+0088 : + 88: 00 00 00 00 \.long 0x0 + 88: R_POS esym1 + +0+008c : + 8c: 00 00 00 00 \.long 0x0 + 8c: R_POS \.crazy_table diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1xcoff32.s binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1xcoff32.s --- binutils-2.11.90.0.27/gas/testsuite/gas/ppc/test1xcoff32.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/gas/testsuite/gas/ppc/test1xcoff32.s Mon Aug 27 11:44:52 2001 @@ -0,0 +1,82 @@ + + + + + + + + + + + + + .csect [RW] +dsym0: .long 0xdeadbeef +dsym1: + + .toc +.L_tsym0: + .tc ignored0[TC],dsym0 +.L_tsym1: + .tc ignored1[TC],dsym1 +.L_tsym2: + .tc ignored2[TC],usym0 +.L_tsym3: + .tc ignored3[TC],usym1 +.L_tsym4: + .tc ignored4[TC],esym0 +.L_tsym5: + .tc ignored5[TC],esym1 +.L_tsym6: + .tc ignored6[TC],.text + + .csect .crazy_table[RO] +xdsym0: .long 0xbeefed +xdsym1: + .csect [PR] + .lglobl reference_csect_relative_symbols +reference_csect_relative_symbols: + lwz 3,xdsym0(3) + lwz 3,xdsym1(3) + lwz 3,xusym0(3) + lwz 3,xusym1(3) + + .lglobl dubious_references_to_default_RW_csect +dubious_references_to_default_RW_csect: + lwz 3,dsym0(3) + lwz 3,dsym1(3) + lwz 3,usym0(3) + lwz 3,usym1(3) + + .lglobl reference_via_toc +reference_via_toc: + lwz 3,.L_tsym0(2) + lwz 3,.L_tsym1(2) + lwz 3,.L_tsym2(2) + lwz 3,.L_tsym3(2) + lwz 3,.L_tsym4(2) + lwz 3,.L_tsym5(2) + + .lglobl subtract_symbols +subtract_symbols: + li 3,dsym1-dsym0 + li 3,dsym0-dsym1 + li 3,usym1-usym0 + li 3,usym0-usym1 + li 3,dsym0-usym0 + li 3,usym0-dsym0 + lwz 3,dsym1-dsym0(4) + + .lglobl load_addresses +load_addresses: + la 3,xdsym0(0) + la 3,xusym0(0) + + la 3,.L_tsym6(2) + + .csect [RW] +usym0: .long 0xcafebabe +usym1: .long 0xbaad + .csect .crazy_table[RO] +xusym0: .long 0xbeefed +xusym1: diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/sparc/unalign.d binutils-2.11.90.0.29/gas/testsuite/gas/sparc/unalign.d --- binutils-2.11.90.0.27/gas/testsuite/gas/sparc/unalign.d Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.29/gas/testsuite/gas/sparc/unalign.d Wed Aug 22 08:52:10 2001 @@ -12,4 +12,8 @@ Disassembly of section .data: 1: R_SPARC_UA32 fred 4: 00 02 00 00 (unimp|illtrap) 0x20000 6: R_SPARC_UA16 jim - 8: 03 04 05 06 sethi %hi\(0x10141800\), %g1 + 8: 03 04 05 00 sethi %hi\(0x10140000\), %g1 + b: R_SPARC_UA32 baz + c: 00 00 00 00 (unimp|illtrap) 0 + f: R_SPARC_UA32 bar + 10: 00 00 00 06 (unimp|illtrap) 0x6 diff -uprN binutils-2.11.90.0.27/gas/testsuite/gas/sparc/unalign.s binutils-2.11.90.0.29/gas/testsuite/gas/sparc/unalign.s --- binutils-2.11.90.0.27/gas/testsuite/gas/sparc/unalign.s Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.29/gas/testsuite/gas/sparc/unalign.s Wed Aug 22 08:52:10 2001 @@ -9,4 +9,5 @@ foo: .byte 0x3 .byte 0x4 .byte 0x5 + .uaword baz, bar .byte 0x6 diff -uprN binutils-2.11.90.0.27/include/ChangeLog binutils-2.11.90.0.29/include/ChangeLog --- binutils-2.11.90.0.27/include/ChangeLog Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/include/ChangeLog Mon Aug 27 11:44:52 2001 @@ -1,3 +1,59 @@ +2001-08-25 Nick Clifton + + * bfdlink.h (struct bfd_link_info): Change 'spare_dynamic_tags' to + unsigned to remove a compile time warning message. + +2001-08-24 H.J. Lu + + * bfdlink.h (bfd_link_hash_table_type): New. The linker hash + table type, bfd_link_generic_hash_table and + bfd_link_elf_hash_table. + (bfd_link_hash_table): Add a new field, type, for the linker + hash table type. + +2001-08-23 Jakub Jelinek + + * bfdlink.h (struct bfd_link_info): Add combreloc and + spare_dynamic_tags fields. + +2001-08-23 Lars Brinkhoff + + * dyn-string.h, fibheap.h, partition.h, sort.h, splay-tree.h: + replace "GNU CC" with "GCC". + +2001-08-21 Richard Henderson + + * fibheap.h: Tidy formatting. + (fibnode_t): Limit degree to 31 bits to avoid warning. + +2001-08-20 Daniel Berlin + + * fibheap.h: New file. Fibonacci heap. + +2001-08-20 Andrew Cagney + + * floatformat.h (floatformat_arm_ext): Document as deprecated. + (floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword) + (floatformat_ia64_spill_little, floatformat_ia64_quad_little) + (floatformat_ia64_spill_big, floatformat_ia64_quad_big) + (floatformat_m88110_harris_ext): Declare. + +2001-08-18 Zack Weinberg + + * ansidecl.h: Reorganize for readability, remove documentation + of obsolete macros, document PARAMS and VPARAMS. Add new + macros VA_OPEN, VA_CLOSE, and VA_FIXEDARG for nicer variadic + function implementation. + +2001-08-16 Richard Henderson + + * hashtab.h (htab_hash_string): Declare. + +2001-06-13 Andrew Cagney + + * libiberty.h (lbasename): Change function declaration to return a + const char pointer. + 2001-08-10 Richard Sandiford * opcode/mips.h (INSN_GP32): Remove. diff -uprN binutils-2.11.90.0.27/include/ansidecl.h binutils-2.11.90.0.29/include/ansidecl.h --- binutils-2.11.90.0.27/include/ansidecl.h Sat May 12 00:05:51 2001 +++ binutils-2.11.90.0.29/include/ansidecl.h Wed Aug 22 08:52:10 2001 @@ -1,5 +1,5 @@ /* ANSI and traditional C compatability macros - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -21,164 +21,214 @@ Foundation, Inc., 59 Temple Place - Suit ANSI C is assumed if __STDC__ is #defined. - Macro ANSI C definition Traditional C definition - ----- ---- - ---------- ----------- - ---------- - PTR `void *' `char *' - LONG_DOUBLE `long double' `double' - VOLATILE `volatile' `' - SIGNED `signed' `' - PTRCONST `void *const' `char *' - ANSI_PROTOTYPES 1 not defined - - CONST is also defined, but is obsolete. Just use const. - - obsolete -- DEFUN (name, arglist, args) - - Defines function NAME. - - ARGLIST lists the arguments, separated by commas and enclosed in - parentheses. ARGLIST becomes the argument list in traditional C. - - ARGS list the arguments with their types. It becomes a prototype in - ANSI C, and the type declarations in traditional C. Arguments should - be separated with `AND'. For functions with a variable number of - arguments, the last thing listed should be `DOTS'. - - obsolete -- DEFUN_VOID (name) - - Defines a function NAME, which takes no arguments. - - obsolete -- EXFUN (name, (prototype)) -- obsolete. - - Replaced by PARAMS. Do not use; will disappear someday soon. - Was used in external function declarations. - In ANSI C it is `NAME PROTOTYPE' (so PROTOTYPE should be enclosed in - parentheses). In traditional C it is `NAME()'. - For a function that takes no arguments, PROTOTYPE should be `(void)'. - - obsolete -- PROTO (type, name, (prototype) -- obsolete. - - This one has also been replaced by PARAMS. Do not use. - - PARAMS ((args)) - - We could use the EXFUN macro to handle prototype declarations, but - the name is misleading and the result is ugly. So we just define a - simple macro to handle the parameter lists, as in: - - static int foo PARAMS ((int, char)); - - This produces: `static int foo();' or `static int foo (int, char);' - - EXFUN would have done it like this: - - static int EXFUN (foo, (int, char)); - - but the function is not external...and it's hard to visually parse - the function name out of the mess. EXFUN should be considered - obsolete; new code should be written to use PARAMS. - - DOTS is also obsolete. - - Examples: - - extern int printf PARAMS ((const char *format, ...)); -*/ + Macro ANSI C definition Traditional C definition + ----- ---- - ---------- ----------- - ---------- + ANSI_PROTOTYPES 1 not defined + PTR `void *' `char *' + PTRCONST `void *const' `char *' + LONG_DOUBLE `long double' `double' + const not defined `' + volatile not defined `' + signed not defined `' + VA_START(ap, var) va_start(ap, var) va_start(ap) + + Note that it is safe to write "void foo();" indicating a function + with no return value, in all K+R compilers we have been able to test. + + For declaring functions with prototypes, we also provide these: + + PARAMS ((prototype)) + -- for functions which take a fixed number of arguments. Use this + when declaring the function. When defining the function, write a + K+R style argument list. For example: + + char *strcpy PARAMS ((char *dest, char *source)); + ... + char * + strcpy (dest, source) + char *dest; + char *source; + { ... } + + + VPARAMS ((prototype, ...)) + -- for functions which take a variable number of arguments. Use + PARAMS to declare the function, VPARAMS to define it. For example: + + int printf PARAMS ((const char *format, ...)); + ... + int + printf VPARAMS ((const char *format, ...)) + { + ... + } + + For writing functions which take variable numbers of arguments, we + also provide the VA_OPEN, VA_CLOSE, and VA_FIXEDARG macros. These + hide the differences between K+R and C89 more + thoroughly than the simple VA_START() macro mentioned above. + + VA_OPEN and VA_CLOSE are used *instead of* va_start and va_end. + Immediately after VA_OPEN, put a sequence of VA_FIXEDARG calls + corresponding to the list of fixed arguments. Then use va_arg + normally to get the variable arguments, or pass your va_list object + around. You do not declare the va_list yourself; VA_OPEN does it + for you. + + Here is a complete example: + + int + printf VPARAMS ((const char *format, ...)) + { + int result; + + VA_OPEN (ap, format); + VA_FIXEDARG (ap, const char *, format); + + result = vfprintf (stdout, format, ap); + VA_CLOSE (ap); + + return result; + } + + + You can declare variables either before or after the VA_OPEN, + VA_FIXEDARG sequence. You can _not_ put statements before VA_OPEN. + Also, VA_OPEN and VA_CLOSE are the beginning and end of a block. + They must appear at the same nesting level, and any variables + declared after VA_OPEN go out of scope at VA_CLOSE. Unfortunately, + with a K+R compiler, that includes the argument list. + + For ease of writing code which uses GCC extensions but needs to be + portable to other compilers, we provide the GCC_VERSION macro that + simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various + wrappers around __attribute__. Also, __extension__ will be #defined + to nothing if it doesn't work. See below. + + This header also defines a lot of obsolete macros: + CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID, + AND, DOTS, NOARGS. Don't use them. */ #ifndef _ANSIDECL_H - -#define _ANSIDECL_H 1 - +#define _ANSIDECL_H 1 /* Every source file includes this file, so they will all get the switch for lint. */ /* LINTLIBRARY */ +/* Using MACRO(x,y) in cpp #if conditionals does not work with some + older preprocessors. Thus we can't define something like this: + +#define HAVE_GCC_VERSION(MAJOR, MINOR) \ + (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR))) + +and then test "#if HAVE_GCC_VERSION(2,7)". + +So instead we use the macro below and test it against specific values. */ + +/* This macro simplifies testing whether we are using gcc, and if it + is of a particular minimum version. (Both major & minor numbers are + significant.) This macro will evaluate to 0 if we are not using + gcc at all. */ +#ifndef GCC_VERSION +#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) +#endif /* GCC_VERSION */ #if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) /* All known AIX compilers implement these things (but don't always define __STDC__). The RISC/OS MIPS compiler defines these things in SVR4 mode, but does not define __STDC__. */ -#define PTR void * -#define PTRCONST void *CONST -#define LONG_DOUBLE long double - -#ifndef IN_GCC -#define AND , -#define NOARGS void -#define VOLATILE volatile -#define SIGNED signed -#endif /* ! IN_GCC */ - -#define PARAMS(paramlist) paramlist -#define ANSI_PROTOTYPES 1 - -#define VPARAMS(ARGS) ARGS -#define VA_START(va_list,var) va_start(va_list,var) +#define ANSI_PROTOTYPES 1 +#define PTR void * +#define PTRCONST void *const +#define LONG_DOUBLE long double + +#define PARAMS(ARGS) ARGS +#define VPARAMS(ARGS) ARGS +#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR) + +/* variadic function helper macros */ +/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's + use without inhibiting further decls and without declaring an + actual variable. */ +#define VA_OPEN(AP, VAR) va_list AP; va_start(AP, VAR); { struct Qdmy +#define VA_CLOSE(AP) } va_end(AP) +#define VA_FIXEDARG(AP, T, N) struct Qdmy + +#undef const +#undef volatile +#undef signed + +/* inline requires special treatment; it's in C99, and GCC >=2.7 supports + it too, but it's not in C89. */ +#undef inline +#if __STDC_VERSION__ > 199901L +/* it's a keyword */ +#else +# if GCC_VERSION >= 2007 +# define inline __inline__ /* __inline__ prevents -pedantic warnings */ +# else +# define inline /* nothing */ +# endif +#endif /* These are obsolete. Do not use. */ #ifndef IN_GCC -#define CONST const -#define DOTS , ... +#define CONST const +#define VOLATILE volatile +#define SIGNED signed + #define PROTO(type, name, arglist) type name arglist #define EXFUN(name, proto) name proto #define DEFUN(name, arglist, args) name(args) #define DEFUN_VOID(name) name(void) +#define AND , +#define DOTS , ... +#define NOARGS void #endif /* ! IN_GCC */ #else /* Not ANSI C. */ -#define PTR char * -#define PTRCONST PTR -#define LONG_DOUBLE double - -#ifndef IN_GCC -#define AND ; -#define NOARGS -#define VOLATILE -#define SIGNED -#endif /* !IN_GCC */ - -#ifndef const /* some systems define it in header files for non-ansi mode */ -#define const -#endif - -#define PARAMS(paramlist) () - -#define VPARAMS(ARGS) (va_alist) va_dcl -#define VA_START(va_list,var) va_start(va_list) +#undef ANSI_PROTOTYPES +#define PTR char * +#define PTRCONST PTR +#define LONG_DOUBLE double + +#define PARAMS(args) () +#define VPARAMS(args) (va_alist) va_dcl +#define VA_START(va_list, var) va_start(va_list) + +#define VA_OPEN(AP, VAR) va_list AP; va_start(AP); { struct Qdmy +#define VA_CLOSE(AP) } va_end(AP) +#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE) + +/* some systems define these in header files for non-ansi mode */ +#undef const +#undef volatile +#undef signed +#undef inline +#define const +#define volatile +#define signed +#define inline -/* These are obsolete. Do not use. */ #ifndef IN_GCC #define CONST -#define DOTS +#define VOLATILE +#define SIGNED + #define PROTO(type, name, arglist) type name () #define EXFUN(name, proto) name() #define DEFUN(name, arglist, args) name arglist args; #define DEFUN_VOID(name) name() +#define AND ; +#define DOTS +#define NOARGS #endif /* ! IN_GCC */ #endif /* ANSI C. */ -/* Using MACRO(x,y) in cpp #if conditionals does not work with some - older preprocessors. Thus we can't define something like this: - -#define HAVE_GCC_VERSION(MAJOR, MINOR) \ - (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR))) - -and then test "#if HAVE_GCC_VERSION(2,7)". - -So instead we use the macro below and test it against specific values. */ - -/* This macro simplifies testing whether we are using gcc, and if it - is of a particular minimum version. (Both major & minor numbers are - significant.) This macro will evaluate to 0 if we are not using - gcc at all. */ -#ifndef GCC_VERSION -#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) -#endif /* GCC_VERSION */ - /* Define macros for some gcc attributes. This permits us to use the macros freely, and know that they will come into play for the version of gcc in which they are supported. */ @@ -229,20 +279,12 @@ So instead we use the macro below and te #define __extension__ #endif -/* Bootstrap support: Autoconf will possibly define the `inline' or - `const' keywords as macros, however this is only valid for the - stage1 compiler. If we detect a modern version of gcc, - unconditionally reset the values. This makes sure the right thing - happens in stage2 and later. We need to do this very early; - i.e. before any header files that might use these keywords. - Otherwise conflicts might occur. */ - +/* Bootstrap support: Adjust certain macros defined by Autoconf, + which are only valid for the stage1 compiler. If we detect + a modern version of GCC, we are probably in stage2 or beyond, + so unconditionally reset the values. Note that const, inline, + etc. have been dealt with above. */ #if (GCC_VERSION >= 2007) -# ifdef __STDC__ -# undef const -# endif -# undef inline -# define inline __inline__ /* __inline__ prevents -pedantic warnings */ # ifndef HAVE_LONG_DOUBLE # define HAVE_LONG_DOUBLE 1 # endif diff -uprN binutils-2.11.90.0.27/include/bfdlink.h binutils-2.11.90.0.29/include/bfdlink.h --- binutils-2.11.90.0.27/include/bfdlink.h Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/include/bfdlink.h Mon Aug 27 11:44:52 2001 @@ -41,6 +41,15 @@ enum bfd_link_discard discard_l, /* Discard local temporary symbols. */ discard_all /* Discard all locals. */ }; + +/* Describes the type of hash table entry structure being used. + Different hash table structure have different fields and so + support different linking features. */ +enum bfd_link_hash_table_type + { + bfd_link_generic_hash_table, + bfd_link_elf_hash_table + }; /* These are the possible types of an entry in the BFD link hash table. */ @@ -146,6 +155,8 @@ struct bfd_link_hash_table struct bfd_link_hash_entry *undefs; /* Entries are added to the tail of the undefs list. */ struct bfd_link_hash_entry *undefs_tail; + /* The type of the ink hash table. */ + enum bfd_link_hash_table_type type; }; /* Look up an entry in a link hash table. If FOLLOW is true, this @@ -275,9 +286,16 @@ struct bfd_link_info /* May be used to set DT_FLAGS_1 for ELF. */ bfd_vma flags_1; - /* true if auto-import thunks for DATA items in pei386 DLLs + /* True if auto-import thunks for DATA items in pei386 DLLs should be generated/linked against. */ boolean pei386_auto_import; + + /* True if non-PLT relocs should be merged into one reloc section + and sorted so that relocs against the same symbol come together. */ + boolean combreloc; + + /* How many spare .dynamic DT_NULL entries should be added? */ + unsigned int spare_dynamic_tags; }; /* This structures holds a set of callback functions. These are diff -uprN binutils-2.11.90.0.27/include/coff/ChangeLog binutils-2.11.90.0.29/include/coff/ChangeLog --- binutils-2.11.90.0.27/include/coff/ChangeLog Thu May 24 21:23:27 2001 +++ binutils-2.11.90.0.29/include/coff/ChangeLog Mon Aug 27 11:44:52 2001 @@ -1,3 +1,11 @@ +2001-08-27 Andreas Jaeger + + * xcoff.h (struct __rtinit): Make proper prototype for rtl. + +Fri Aug 24 01:18:51 2001 J"orn Rennecke + + * internal.h (R_JMP2, R_JMPL2, R_MOVL2): Comment spelling fix. + 2001-04-05 Tom Rix * rs6000.h : move xcoff32 external structures from xcofflink. diff -uprN binutils-2.11.90.0.27/include/coff/internal.h binutils-2.11.90.0.29/include/coff/internal.h --- binutils-2.11.90.0.27/include/coff/internal.h Thu May 24 21:23:29 2001 +++ binutils-2.11.90.0.29/include/coff/internal.h Mon Aug 27 11:44:52 2001 @@ -639,7 +639,7 @@ struct internal_reloc #define R_JMP1 0x43 /* This reloc identifies a bra with an 8-bit pc-relative - target that was formerlly a jmp insn with a 16bit target. */ + target that was formerly a jmp insn with a 16bit target. */ #define R_JMP2 0x44 /* ??? */ @@ -651,7 +651,7 @@ struct internal_reloc #define R_JMPL1 0x46 /* This reloc identifies a bra with an 8-bit pc-relative - target that was formerlly a jmp insn with a 24bit target. */ + target that was formerly a jmp insn with a 24bit target. */ #define R_JMPL2 0x47 /* This reloc identifies mov.b instructions with a 24bit absolute @@ -679,7 +679,7 @@ struct internal_reloc insn with a 16bit absolute address. */ #define R_MOVL1 0x4c -/* This reloc identifies mov.[wl] insns which formerlly had +/* This reloc identifies mov.[wl] insns which formerly had a 32/24bit absolute address and now have a 16bit absolute address. */ #define R_MOVL2 0x4d diff -uprN binutils-2.11.90.0.27/include/coff/xcoff.h binutils-2.11.90.0.29/include/coff/xcoff.h --- binutils-2.11.90.0.27/include/coff/xcoff.h Thu May 24 21:23:30 2001 +++ binutils-2.11.90.0.29/include/coff/xcoff.h Mon Aug 27 11:44:52 2001 @@ -1,6 +1,6 @@ /* Internal format of XCOFF object file data structures for BFD. - Copyright 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor , Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -425,7 +425,8 @@ struct xcoff_loader_info * from /usr/include/rtinit.h */ struct __rtinit { - int (*rtl)(); /* Pointer to runtime linker */ + int (*rtl) PARAMS ((void)); /* Pointer to runtime linker. + XXX: Is the parameter really void? */ int init_offset; /* Offset to array of init functions (0 if none). */ int fini_offset; /* Offset to array of fini functions diff -uprN binutils-2.11.90.0.27/include/dyn-string.h binutils-2.11.90.0.29/include/dyn-string.h --- binutils-2.11.90.0.27/include/dyn-string.h Sun Sep 17 16:01:57 2000 +++ binutils-2.11.90.0.29/include/dyn-string.h Mon Aug 27 11:44:52 2001 @@ -2,20 +2,20 @@ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. Contributed by Mark Mitchell (mark@markmitchell.com). -This file is part of GNU CC. +This file is part of GCC. -GNU CC is free software; you can redistribute it and/or modify +GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. -GNU CC is distributed in the hope that it will be useful, +GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to +along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff -uprN binutils-2.11.90.0.27/include/elf/ChangeLog binutils-2.11.90.0.29/include/elf/ChangeLog --- binutils-2.11.90.0.27/include/elf/ChangeLog Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.29/include/elf/ChangeLog Mon Aug 27 11:44:52 2001 @@ -1,3 +1,7 @@ +2001-08-27 Staffan Ulfberg + + * ppc.h: Add relocs from the 64-bit PowerPC ELF ABI revision 1.2. + 2001-06-30 Daniel Berlin * dwarf2.h: Remerge with gcc version, diff -uprN binutils-2.11.90.0.27/include/elf/ppc.h binutils-2.11.90.0.29/include/elf/ppc.h --- binutils-2.11.90.0.27/include/elf/ppc.h Thu Mar 15 14:53:08 2001 +++ binutils-2.11.90.0.29/include/elf/ppc.h Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* PPC ELF support for BFD. - Copyright 1995, 1996, 1998, 2000 Free Software Foundation, Inc. + Copyright 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc. By Michael Meissner, Cygnus Support, , from information in the System V Application Binary Interface, PowerPC Processor Supplement @@ -68,6 +68,40 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type) RELOC_NUMBER (R_PPC_SECTOFF_LO, 34) RELOC_NUMBER (R_PPC_SECTOFF_HI, 35) RELOC_NUMBER (R_PPC_SECTOFF_HA, 36) + RELOC_NUMBER (R_PPC_ADDR30, 37) + +/* The following relocs are from the 64-bit PowerPC ELF ABI. */ + RELOC_NUMBER (R_PPC64_ADDR64, 38) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHER, 39) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHERA, 40) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHEST, 41) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHESTA, 42) + RELOC_NUMBER (R_PPC64_UADDR64, 43) + RELOC_NUMBER (R_PPC64_REL64, 44) + RELOC_NUMBER (R_PPC64_PLT64, 45) + RELOC_NUMBER (R_PPC64_PLTREL64, 46) + RELOC_NUMBER (R_PPC64_TOC16, 47) + RELOC_NUMBER (R_PPC64_TOC16_LO, 48) + RELOC_NUMBER (R_PPC64_TOC16_HI, 49) + RELOC_NUMBER (R_PPC64_TOC16_HA, 50) + RELOC_NUMBER (R_PPC64_TOC, 51) + RELOC_NUMBER (R_PPC64_PLTGOT16, 52) + RELOC_NUMBER (R_PPC64_PLTGOT16_LO, 53) + RELOC_NUMBER (R_PPC64_PLTGOT16_HI, 54) + RELOC_NUMBER (R_PPC64_PLTGOT16_HA, 55) + +/* The following relocs were added in the 64-bit PowerPC ELF ABI revision 1.2. */ + RELOC_NUMBER (R_PPC64_ADDR16_DS, 56) + RELOC_NUMBER (R_PPC64_ADDR16_LO_DS, 57) + RELOC_NUMBER (R_PPC64_GOT16_DS, 58) + RELOC_NUMBER (R_PPC64_GOT16_LO_DS, 59) + RELOC_NUMBER (R_PPC64_PLT16_LO_DS, 60) + RELOC_NUMBER (R_PPC64_SECTOFF_DS, 61) + RELOC_NUMBER (R_PPC64_SECTOFF_LO_DS, 62) + RELOC_NUMBER (R_PPC64_TOC16_DS, 63) + RELOC_NUMBER (R_PPC64_TOC16_LO_DS, 64) + RELOC_NUMBER (R_PPC64_PLTGOT16_DS, 65) + RELOC_NUMBER (R_PPC64_PLTGOT16_LO_DS, 66) /* The remaining relocs are from the Embedded ELF ABI, and are not in the SVR4 ELF ABI. */ @@ -98,6 +132,44 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type) END_RELOC_NUMBERS (R_PPC_max) +/* Aliases for R_PPC64-relocs. */ +#define R_PPC64_NONE R_PPC_NONE +#define R_PPC64_ADDR32 R_PPC_ADDR32 +#define R_PPC64_ADDR24 R_PPC_ADDR24 +#define R_PPC64_ADDR16 R_PPC_ADDR16 +#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO +#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI +#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA +#define R_PPC64_ADDR14 R_PPC_ADDR14 +#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN +#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN +#define R_PPC64_REL24 R_PPC_REL24 +#define R_PPC64_REL14 R_PPC_REL14 +#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN +#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN +#define R_PPC64_GOT16 R_PPC_GOT16 +#define R_PPC64_GOT16_LO R_PPC_GOT16_LO +#define R_PPC64_GOT16_HI R_PPC_GOT16_HI +#define R_PPC64_GOT16_HA R_PPC_GOT16_HA +#define R_PPC64_COPY R_PPC_COPY +#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT +#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT +#define R_PPC64_RELATIVE R_PPC_RELATIVE +#define R_PPC64_UADDR32 R_PPC_UADDR32 +#define R_PPC64_UADDR16 R_PPC_UADDR16 +#define R_PPC64_REL32 R_PPC_REL32 +#define R_PPC64_PLT32 R_PPC_PLT32 +#define R_PPC64_PLTREL32 R_PPC_PLTREL32 +#define R_PPC64_PLT16_LO R_PPC_PLT16_LO +#define R_PPC64_PLT16_HI R_PPC_PLT16_HI +#define R_PPC64_PLT16_HA R_PPC_PLT16_HA +#define R_PPC64_SECTOFF R_PPC_SECTOFF +#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO +#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI +#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA +#define R_PPC64_ADDR30 R_PPC_ADDR30 +#define R_PPC64_GNU_VTINHERIT R_PPC_GNU_VTINHERIT +#define R_PPC64_GNU_VTENTRY R_PPC_GNU_VTENTRY /* Processor specific flags for the ELF header e_flags field. */ diff -uprN binutils-2.11.90.0.27/include/fibheap.h binutils-2.11.90.0.29/include/fibheap.h --- binutils-2.11.90.0.27/include/fibheap.h Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/include/fibheap.h Mon Aug 27 11:44:52 2001 @@ -0,0 +1,81 @@ +/* A Fibonacci heap datatype. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by Daniel Berlin (dan@cgsoftware.com). + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Fibonacci heaps are somewhat complex, but, there's an article in + DDJ that explains them pretty well: + + http://www.ddj.com/articles/1997/9701/9701o/9701o.htm?topic=algoritms + + Introduction to algorithms by Corman and Rivest also goes over them. + + The original paper that introduced them is "Fibonacci heaps and their + uses in improved network optimization algorithms" by Tarjan and + Fredman (JACM 34(3), July 1987). + + Amortized and real worst case time for operations: + + ExtractMin: O(lg n) amortized. O(n) worst case. + DecreaseKey: O(1) amortized. O(lg n) worst case. + Insert: O(2) amortized. O(1) actual. + Union: O(1) amortized. O(1) actual. */ + +#ifndef _FIBHEAP_H_ +#define _FIBHEAP_H_ + +#include + +typedef long fibheapkey_t; + +typedef struct fibheap +{ + size_t nodes; + struct fibnode *min; + struct fibnode *root; +} *fibheap_t; + +typedef struct fibnode +{ + struct fibnode *parent; + struct fibnode *child; + struct fibnode *left; + struct fibnode *right; + fibheapkey_t key; + void *data; + unsigned int degree : 31; + unsigned int mark : 1; +} *fibnode_t; + +extern fibheap_t fibheap_new PARAMS ((void)); +extern fibnode_t fibheap_insert PARAMS ((fibheap_t, fibheapkey_t, void *)); +extern int fibheap_empty PARAMS ((fibheap_t)); +extern fibheapkey_t fibheap_min_key PARAMS ((fibheap_t)); +extern fibheapkey_t fibheap_replace_key PARAMS ((fibheap_t, fibnode_t, + fibheapkey_t)); +extern void *fibheap_replace_key_data PARAMS ((fibheap_t, fibnode_t, + fibheapkey_t, void *)); +extern void *fibheap_extract_min PARAMS ((fibheap_t)); +extern void *fibheap_min PARAMS ((fibheap_t)); +extern void *fibheap_replace_data PARAMS ((fibheap_t, fibnode_t, void *)); +extern void *fibheap_delete_node PARAMS ((fibheap_t, fibnode_t)); +extern void fibheap_delete PARAMS ((fibheap_t)); +extern fibheap_t fibheap_union PARAMS ((fibheap_t, fibheap_t)); + +#endif /* _FIBHEAP_H_ */ diff -uprN binutils-2.11.90.0.27/include/floatformat.h binutils-2.11.90.0.29/include/floatformat.h --- binutils-2.11.90.0.27/include/floatformat.h Thu Mar 15 14:53:00 2001 +++ binutils-2.11.90.0.29/include/floatformat.h Wed Aug 22 08:52:10 2001 @@ -95,7 +95,15 @@ extern const struct floatformat floatfor extern const struct floatformat floatformat_m68881_ext; extern const struct floatformat floatformat_i960_ext; extern const struct floatformat floatformat_m88110_ext; -extern const struct floatformat floatformat_arm_ext; +extern const struct floatformat floatformat_m88110_harris_ext; +extern const struct floatformat floatformat_arm_ext; /* deprecated. */ +extern const struct floatformat floatformat_arm_ext_big; +extern const struct floatformat floatformat_arm_ext_littlebyte_bigword; +/* IA-64 Floating Point register spilt into memory. */ +extern const struct floatformat floatformat_ia64_spill_big; +extern const struct floatformat floatformat_ia64_spill_little; +extern const struct floatformat floatformat_ia64_quad_big; +extern const struct floatformat floatformat_ia64_quad_little; /* Convert from FMT to a double. FROM is the address of the extended float. diff -uprN binutils-2.11.90.0.27/include/hashtab.h binutils-2.11.90.0.29/include/hashtab.h --- binutils-2.11.90.0.27/include/hashtab.h Tue Nov 7 16:30:14 2000 +++ binutils-2.11.90.0.29/include/hashtab.h Wed Aug 22 08:52:10 2001 @@ -145,6 +145,9 @@ extern htab_hash htab_hash_pointer; /* An equality function for pointers. */ extern htab_eq htab_eq_pointer; +/* A hash function for null-terminated strings. */ +extern hashval_t htab_hash_string PARAMS ((const PTR)); + #ifdef __cplusplus } #endif /* __cplusplus */ diff -uprN binutils-2.11.90.0.27/include/libiberty.h binutils-2.11.90.0.29/include/libiberty.h --- binutils-2.11.90.0.27/include/libiberty.h Sat Mar 31 19:48:00 2001 +++ binutils-2.11.90.0.29/include/libiberty.h Wed Aug 22 08:52:10 2001 @@ -83,7 +83,7 @@ extern char *basename (); /* A well-defined basename () that is always compiled in. */ -extern char *lbasename PARAMS ((const char *)); +extern const char *lbasename PARAMS ((const char *)); /* Concatenate an arbitrary number of strings, up to (char *) NULL. Allocates memory using xmalloc. */ diff -uprN binutils-2.11.90.0.27/include/opcode/ChangeLog binutils-2.11.90.0.29/include/opcode/ChangeLog --- binutils-2.11.90.0.27/include/opcode/ChangeLog Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/include/opcode/ChangeLog Mon Aug 27 11:44:52 2001 @@ -1,3 +1,20 @@ +2001-08-27 Torbjorn Granlund + + * ppc.h (PPC_OPERAND_DS): Define. + +2001-08-25 Andreas Jaeger + + * d30v.h: Fix declaration of reg_name_cnt. + + * d10v.h: Fix declaration of d10v_reg_name_cnt. + + * arc.h: Add prototypes from opcodes/arc-opc.c. + +2001-08-16 Thiemo Seufer + + * mips.h (INSN_10000): Define. + (OPCODE_IS_MEMBER): Check for INSN_10000. + 2001-08-10 Alan Modra * ppc.h: Revert 2001-08-08. @@ -27,7 +44,7 @@ 2001-05-23 John Healy * cgen.h: Increased CGEN_MAX_SYNTAX_ELEMENTS to 48. - + 2001-05-15 Thiemo Seufer * mips.h (INSN_ISA_MASK): Define. @@ -164,7 +181,7 @@ * i386.h (i386_optab): Replace "Imm" with "EncImm". (i386_regtab): Add flags field. - + 2000-12-12 Nick Clifton * mips.h: Fix formatting. @@ -189,7 +206,7 @@ (ISA_UNKNOWN): New constant to indicate unknown ISA. (ISA_MIPS1, ISA_MIPS2, ISA_MIPS3, ISA_MIPS4, ISA_MIPS5, ISA_MIPS32): New constants, defined to be the mask of INSN_* - constants available at that ISA level. + constants available at that ISA level. (CPU_UNKNOWN): New constant to indicate unknown CPU. (CPU_4K, CPU_MIPS32_4K): Rename the former to the latter, define it with a unique value. @@ -197,7 +214,7 @@ constant meanings. * mips.h (INSN_ISA64, ISA_MIPS5, ISA_MIPS64): New - definitions. + definitions. * mips.h (CPU_SB1): New constant. @@ -211,21 +228,21 @@ * ia64.h (enum ia64_dependency_semantics): Add IA64_DVS_STOP. 2000-09-13 Anders Norlander - + * mips.h: Use defines instead of hard-coded processor numbers. (CPU_R2000, CPU_R3000, CPU_R3900, CPU_R4000, CPU_R4010, - CPU_VR4100, CPU_R4111, CPU_R4300, CPU_R4400, CPU_R4600, CPU_R4650, + CPU_VR4100, CPU_R4111, CPU_R4300, CPU_R4400, CPU_R4600, CPU_R4650, CPU_R5000, CPU_R6000, CPU_R8000, CPU_R10000, CPU_MIPS32, CPU_4K, CPU_4KC, CPU_4KM, CPU_4KP): Define.. (OPCODE_IS_MEMBER): Use new defines. - (OP_MASK_SEL, OP_SH_SEL): Define. + (OP_MASK_SEL, OP_SH_SEL): Define. (OP_MASK_CODE20, OP_SH_CODE20): Define. - Add 'P' to used characters. - Use 'H' for coprocessor select field. + Add 'P' to used characters. + Use 'H' for coprocessor select field. Use 'm' for 20 bit breakpoint code. - Document new arg characters and add to used characters. - (INSN_MIPS32): New define for MIPS32 extensions. - (OPCODE_IS_MEMBER): Recognize MIPS32 instructions. + Document new arg characters and add to used characters. + (INSN_MIPS32): New define for MIPS32 extensions. + (OPCODE_IS_MEMBER): Recognize MIPS32 instructions. 2000-09-05 Alan Modra @@ -405,7 +422,7 @@ Fri Apr 21 13:20:53 2000 Richard Hender * cgen.h (CGEN_INSN_MACH_HAS_P): New macro. (CGEN_CPU_TABLE): flags: new field. Add prototypes for new functions. - + 2000-02-24 Alan Modra * i386.h: Add some more UNIXWARE_COMPAT comments. @@ -523,7 +540,7 @@ Sun Sep 19 10:40:59 1999 Jeffrey A Law Sat Sep 18 11:41:16 1999 Jeffrey A Law (law@cygnus.com) * hppa.h (pa_opcodes): Use 'fX' for first register operand - in xmpyu. + in xmpyu. * hppa.h (pa_opcodes): Fix mask for probe and probei. @@ -609,7 +626,7 @@ Wed Jul 28 02:04:24 1999 Jerry Quinn @@ -637,7 +654,7 @@ Fri Jun 25 04:22:04 1999 Jerry Quinn @@ -654,7 +671,7 @@ Thu May 27 04:13:54 1999 Joel Sherrill Wed May 26 16:57:44 1999 Jeffrey A Law (law@cygnus.com) - * hppa.h (pa_opcodes): Add second entry for "comb", "comib", + * hppa.h (pa_opcodes): Add second entry for "comb", "comib", "addb", and "addib" to be used by the disassembler. 1999-05-12 Alan Modra @@ -765,7 +782,7 @@ Sat Feb 13 14:13:44 1999 Richard Hender (CGEN_INSN_ATTR): New type. Mon Feb 1 21:09:14 1999 Catherine Moore - + * i386.h (d_Suf, x_Suf, sld_Suf, sldx_Suf, bwld_Suf): Define. (x_FP, d_FP, dls_FP, sldx_FP): Define. Change *Suf definitions to include x and d suffixes. @@ -806,16 +823,16 @@ Mon Feb 1 21:09:14 1999 Catherine Moor Wed Dec 9 10:38:48 1998 David Taylor The following is part of a change made by Edith Epstein - as part of a project to merge in - changes by HP; HP did not create ChangeLog entries. + as part of a project to merge in + changes by HP; HP did not create ChangeLog entries. * hppa.h (completer_chars): list of chars to not put a space - after. + after. Sun Dec 6 13:21:34 1998 Ian Lance Taylor * i386.h (i386_optab): Permit w suffix on processor control and - status word instructions. + status word instructions. 1998-11-30 Doug Evans @@ -876,7 +893,7 @@ Fri Oct 9 13:38:13 1998 Doug Evans From Robert Andrew Dale @@ -930,7 +947,7 @@ Fri Jun 26 11:09:06 1998 Jeffrey A Law * mn10300.h: Add "machine" field for instructions. (MN103, AM30): Define machine types. - + Fri Jun 19 16:09:09 1998 Alan Modra * i386.h: Use FP, not sl_Suf, for fxsave and fxrstor. @@ -1535,9 +1552,9 @@ Mon Nov 4 12:52:48 1996 Jeffrey A Law Fri Nov 1 10:31:02 1996 Richard Henderson * alpha.h: Don't include "bfd.h"; private relocation types are now - negative to minimize problems with shared libraries. Organize - instruction subsets by AMASK extensions and PALcode - implementation. + negative to minimize problems with shared libraries. Organize + instruction subsets by AMASK extensions and PALcode + implementation. (struct alpha_operand): Move flags slot for better packing. Tue Oct 29 12:19:10 1996 Jeffrey A Law (law@cygnus.com) @@ -1590,9 +1607,9 @@ Fri Aug 23 10:39:08 1996 Jeffrey A Law Thu Aug 22 16:51:25 1996 J.T. Conklin * v850.h (v850_operands): Add insert and extract fields, pointers - to functions used to handle unusual operand encoding. + to functions used to handle unusual operand encoding. (V850_OPERAND_REG, V850_OPERAND_SRG, V850_OPERAND_CC, - V850_OPERAND_SIGNED): Defined. + V850_OPERAND_SIGNED): Defined. Wed Aug 21 17:45:10 1996 J.T. Conklin @@ -1606,11 +1623,11 @@ Tue Aug 20 14:52:02 1996 J.T. Conklin Fri Aug 16 14:44:15 1996 James G. Smith * mips.h (OP_SH_LOCC, OP_SH_HICC, OP_MASK_CC, OP_SH_COP1NORM, - OP_MASK_COP1NORM, OP_SH_COP1SPEC, OP_MASK_COP1SPEC, - OP_MASK_COP1SCLR, OP_MASK_COP1CMP, OP_SH_COP1CMP, OP_SH_FORMAT, - OP_MASK_FORMAT, OP_SH_TRUE, OP_MASK_TRUE, OP_SH_GE, OP_MASK_GE, - OP_SH_UNSIGNED, OP_MASK_UNSIGNED, OP_SH_HINT, OP_MASK_HINT): - Defined. + OP_MASK_COP1NORM, OP_SH_COP1SPEC, OP_MASK_COP1SPEC, + OP_MASK_COP1SCLR, OP_MASK_COP1CMP, OP_SH_COP1CMP, OP_SH_FORMAT, + OP_MASK_FORMAT, OP_SH_TRUE, OP_MASK_TRUE, OP_SH_GE, OP_MASK_GE, + OP_SH_UNSIGNED, OP_MASK_UNSIGNED, OP_SH_HINT, OP_MASK_HINT): + Defined. Fri Aug 16 00:15:15 1996 Jeffrey A Law (law@cygnus.com) @@ -1620,7 +1637,7 @@ Fri Aug 16 00:15:15 1996 Jeffrey A Law Thu Aug 15 13:11:46 1996 Martin M. Hunt * d10v.h: Add some additional defines to support the - assembler in determining which operations can be done in parallel. + assembler in determining which operations can be done in parallel. Tue Aug 6 11:13:22 1996 Jeffrey A Law (law@cygnus.com) @@ -1636,7 +1653,7 @@ Fri Jul 26 11:47:10 1996 Martin M. Hunt Thu Jul 25 12:06:22 1996 Martin M. Hunt * d10v.h: Changes for divs, parallel-only instructions, and - signed numbers. + signed numbers. Mon Jul 22 11:21:15 1996 Martin M. Hunt @@ -1658,7 +1675,7 @@ Thu Jul 11 12:09:15 1996 Jeffrey A Law Wed Jul 3 14:30:12 1996 J.T. Conklin - * m68k.h (mcf5200): New macro. + * m68k.h (mcf5200): New macro. Document names of coldfire control registers. Tue Jul 2 23:05:45 1996 Jeffrey A Law (law@cygnus.com) @@ -1808,7 +1825,7 @@ Tue Oct 24 10:49:10 1995 Jeffrey A Law Mon Oct 23 11:09:16 1995 James G. Smith * mips.h: Added INSN_4100 flag to mark NEC VR4100 specific - instructions. + instructions. Mon Oct 16 10:28:15 1995 Michael Meissner diff -uprN binutils-2.11.90.0.27/include/opcode/arc.h binutils-2.11.90.0.29/include/opcode/arc.h --- binutils-2.11.90.0.27/include/opcode/arc.h Thu Mar 15 14:53:11 2001 +++ binutils-2.11.90.0.29/include/opcode/arc.h Mon Aug 27 11:44:52 2001 @@ -313,3 +313,9 @@ const struct arc_operand_value *arc_opco PARAMS ((const struct arc_operand *type, int value)); int arc_opcode_supported PARAMS ((const struct arc_opcode *)); int arc_opval_supported PARAMS ((const struct arc_operand_value *)); +int arc_limm_fixup_adjust PARAMS ((arc_insn)); +int arc_insn_is_j PARAMS ((arc_insn)); +int arc_insn_not_jl PARAMS ((arc_insn)); +int arc_operand_type PARAMS ((int)); +struct arc_operand_value *get_ext_suffix PARAMS ((char *)); +int arc_get_noshortcut_flag PARAMS ((void)); diff -uprN binutils-2.11.90.0.27/include/opcode/d10v.h binutils-2.11.90.0.29/include/opcode/d10v.h --- binutils-2.11.90.0.27/include/opcode/d10v.h Thu Mar 15 14:53:12 2001 +++ binutils-2.11.90.0.29/include/opcode/d10v.h Mon Aug 27 11:44:52 2001 @@ -190,7 +190,7 @@ struct pd_reg }; extern const struct pd_reg d10v_predefined_registers[]; -int d10v_reg_name_cnt(); +int d10v_reg_name_cnt PARAMS ((void)); /* an expressionS only has one register type, so we fake it */ /* by setting high bits to indicate type */ diff -uprN binutils-2.11.90.0.27/include/opcode/d30v.h binutils-2.11.90.0.29/include/opcode/d30v.h --- binutils-2.11.90.0.27/include/opcode/d30v.h Thu Mar 15 14:53:12 2001 +++ binutils-2.11.90.0.29/include/opcode/d30v.h Mon Aug 27 11:44:52 2001 @@ -32,7 +32,7 @@ struct pd_reg }; extern const struct pd_reg pre_defined_registers[]; -int reg_name_cnt(); +int reg_name_cnt PARAMS ((void)); /* the number of control registers */ #define MAX_CONTROL_REG 64 diff -uprN binutils-2.11.90.0.27/include/opcode/mips.h binutils-2.11.90.0.29/include/opcode/mips.h --- binutils-2.11.90.0.27/include/opcode/mips.h Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/include/opcode/mips.h Wed Aug 22 08:52:10 2001 @@ -326,6 +326,8 @@ struct mips_opcode #define INSN_4100 0x00040000 /* Toshiba R3900 instruction. */ #define INSN_3900 0x00080000 +/* MIPS R10000 instruction. */ +#define INSN_10000 0x00100000 /* MIPS ISA defines, use instead of hardcoding ISA level. */ @@ -375,7 +377,9 @@ struct mips_opcode || (cpu == CPU_R4010 && ((insn)->membership & INSN_4010) != 0) \ || ((cpu == CPU_VR4100 || cpu == CPU_R4111) \ && ((insn)->membership & INSN_4100) != 0) \ - || (cpu == CPU_R3900 && ((insn)->membership & INSN_3900) != 0)) + || (cpu == CPU_R3900 && ((insn)->membership & INSN_3900) != 0) \ + || ((cpu == CPU_R10000 || cpu == CPU_R12000) \ + && ((insn)->membership & INSN_10000) != 0)) /* This is a list of macro expanded instructions. diff -uprN binutils-2.11.90.0.27/include/opcode/ppc.h binutils-2.11.90.0.29/include/opcode/ppc.h --- binutils-2.11.90.0.27/include/opcode/ppc.h Thu Mar 15 14:53:16 2001 +++ binutils-2.11.90.0.29/include/opcode/ppc.h Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* ppc.h -- Header file for PowerPC opcode table - Copyright 1994, 1995, 1999, 2000 Free Software Foundation, Inc. + Copyright 1994, 1995, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support This file is part of GDB, GAS, and the GNU binutils. @@ -229,6 +229,8 @@ extern const struct powerpc_operand powe prints these with a leading 'v'. */ #define PPC_OPERAND_VR (010000) +/* This operand is for the DS field in a DS form instruction. */ +#define PPC_OPERAND_DS (020000) /* The POWER and PowerPC assemblers use a few macros. We keep them with the operands table for simplicity. The macro table is an diff -uprN binutils-2.11.90.0.27/include/partition.h binutils-2.11.90.0.29/include/partition.h --- binutils-2.11.90.0.27/include/partition.h Mon May 21 10:35:21 2001 +++ binutils-2.11.90.0.29/include/partition.h Mon Aug 27 11:44:52 2001 @@ -2,20 +2,20 @@ Copyright (C) 2000, 2001 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. - This file is part of GNU CC. + This file is part of GCC. - GNU CC is free software; you can redistribute it and/or modify + GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - GNU CC is distributed in the hope that it will be useful, + GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with GNU CC; see the file COPYING. If not, write to + along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff -uprN binutils-2.11.90.0.27/include/sort.h binutils-2.11.90.0.29/include/sort.h --- binutils-2.11.90.0.27/include/sort.h Thu Jun 15 14:07:56 2000 +++ binutils-2.11.90.0.29/include/sort.h Mon Aug 27 11:44:52 2001 @@ -2,20 +2,20 @@ Copyright (C) 2000 Free Software Foundation, Inc. Contributed by Mark Mitchell . -This file is part of GNU CC. +This file is part of GCC. -GNU CC is free software; you can redistribute it and/or modify it +GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. -GNU CC is distributed in the hope that it will be useful, but +GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to +along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff -uprN binutils-2.11.90.0.27/include/splay-tree.h binutils-2.11.90.0.29/include/splay-tree.h --- binutils-2.11.90.0.27/include/splay-tree.h Sat May 12 00:05:52 2001 +++ binutils-2.11.90.0.29/include/splay-tree.h Mon Aug 27 11:44:52 2001 @@ -2,20 +2,20 @@ Copyright 1998, 1999, 2000 Free Software Foundation, Inc. Contributed by Mark Mitchell (mark@markmitchell.com). -This file is part of GNU CC. +This file is part of GCC. -GNU CC is free software; you can redistribute it and/or modify it +GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. -GNU CC is distributed in the hope that it will be useful, but +GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to +along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff -uprN binutils-2.11.90.0.27/ld/ChangeLog binutils-2.11.90.0.29/ld/ChangeLog --- binutils-2.11.90.0.27/ld/ChangeLog Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/ld/ChangeLog Mon Aug 27 11:44:52 2001 @@ -1,3 +1,194 @@ +2001-08-27 Linus Nordberg + Alan Modra + + * Makefile.am (ALL_EMULATIONS): Add eelf64ppc.o and eelf64lppc.o. + (eelf64ppc.c, eelf64lppc.c): Add make targets. + Run "make dep-am" + * Makefile.in: Regenerate. + * configure.tgt: Add powerpc64 support. Move pdp11, pjl, pj + entries to correct alphabetical position. + * emulparams/elf64ppc.sh: New. + * emulparams/elf64lppc.sh: New. + +2001-08-27 Nick Clifton + + * ldmain.c (main): Declare BSIZE as static. + +2001-08-23 Jakub Jelinek + + * emultempl/elf32.em (place_orphan): Place orphan .rel* sections + into .rel.dyn resp. .rela.dyn if combreloc. + (get_script): If .x linker script is equal to .xn, only put it + once into the binary. + Add .xc and .xsc scripts. + (parse_args): Handle -z combreloc and -z nocombreloc. + * scripttempl/elf.sc (.rela.sbss): Fix a typo. + For .xc and .xsc scripts put all .rel* or .rela* input sections + but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. + * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME + is elf. + Strip trailing whitespace from script. + Generate .xc and .xsc scripts if requested. + * ldmain.c (main): Initialize link_info.combreloc and + link_info.spare_dynamic_tags. + * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. + (ld_options): Add --spare-dynamic-tags option. + (parse_args): Likewise. + * ld.texinfo: Document -z combreloc and -z nocombreloc. + * ldint.texinfo: Document .xc and .xsc linker scripts. + * NEWS: Add notes about -z combreloc and SHF_MERGE. + +2001-08-22 H.J. Lu + + * emulparams/elf32fr30.sh: Add a newline. + +2001-08-21 Andreas Jaeger + + * deffilep.y: Add missing prototypes. + * pe-dll.c: Likewise. + +2001-08-20 Alan Modra + + * ldlang.c (insert_pad): Fix typos in last patch. + + * ldlang.c: When traversing lang_statement_union_type lists, + consistently use "header.next" rather than "next". + * mpw-eppcmac.c: Likewise. + * emultempl/beos.em: Likewise. + * emultempl/hppaelf.em: Likewise. + * emultempl/pe.em: Likewise. + * ldlang.h (union lang_statement_union): Remove "next" field. + + * ldlang.c (insert_pad): Use offsetof macro. + (lang_size_sections): Always neuter padding statements. + * emultempl/hppaelf.em (hppaelf_delete_padding_statements): Delete. + + * pe-dll.c (pe_dll_fill_sections): Correct type of "relax" param + passed to lang_size_sections. + (pe_exe_fill_sections): Likewise. + * emultempl/pe.em (output_prev_sec_find): Copied from elf32.em. + (gld_${EMULATION_NAME}_place_orphan): Merge from elf32.em. + +2001-08-18 Alan Modra + + * emultempl/aix.em: Formatting fixes. + +2001-08-18 Alan Modra + + * ldlang.c (insert_pad): Make use of an existing pad statement if + available. Move code calculating alignment, adjusting section + alignment power, and adjusting dot to .. + (size_input_section): .. here. Remove unused relax param. + (lang_size_sections): Change boolean `relax' param to boolean *. + Adjust call to size_input_section. Make use of insert_pad to + place pad after the assignment statement. If relaxing, zap + padding statements. + (reset_memory_regions): Reset output_bfd section sizes too. + (relax_again): Move to.. + (lang_process): ..here. Adjust call to lang_size_sections, and + remove duplicated code. + * ldlang.h (lang_size_sections): Change `relax' param to boolean *. + +2001-08-17 Alan Modra + + * ld.texinfo: Document that fill values now use the four least + significant bytes. + * emulparams/elf32fr30.sh (NOP): Update. + * emulparams/elf32mcore.sh: Likewise. + * emulparams/elf64_s390.sh: Likewise. + * emulparams/elf_i386.sh: Likewise. + * emulparams/elf_i386_be.sh: Likewise. + * emulparams/elf_i386_chaos.sh: Likewise. + * emulparams/elf_i386_ldso.sh: Likewise. + * emulparams/elf_s390.sh: Likewise. + * emulparams/elf_x86_64.sh: Likewise. + * emulparams/i386moss.sh: Likewise. + * emulparams/i386nw.sh: Likewise. + * emulparams/m68kelf.sh: Likewise. + * scripttempl/elf.sc: Update NOP comment. + * scripttempl/elfi370.sc: Likewise. + * scripttempl/elfm68hc11.sc: Likewise. + * scripttempl/elfm68hc12.sc: Likewise. + * scripttempl/nw.sc: Likewise. + +2001-08-15 Tom Rix + + * ldgram.y (saved_script_handle): Initialize to NULL. + * ldmain.c (main): Change check on saved_script_handle. + +2001-08-14 Alan Modra + + * emultempl/elf32.em: Formatting fixes. + (output_prev_sec_find): Test for bfd_ind_section too; do so by + looking at sec->owner. + (output_rel_find): Move function inside LDEMUL_PLACE_ORPHAN test. + (gld${EMULATION_NAME}_place_orphan): Add a few comments. Remove + unused code, and reorganize orphan section placement code. + + * ldlang.c (wild_doit): Rename to lang_add_section. + * ldlang.h: Here too. + * mpw-elfmips.c: And here. + * emultempl/beos.em: And here. + * emultempl/elf32.em: And here. + * emultempl/hppaelf.em: And here. + * emultempl/pe.em: And here. + +2001-08-13 Richard Henderson + + * emultempl/needrelax.em: New file. + * emulparams/elf64_ia64.sh (EXTRA_EM_FILE): Reference it. + * Makefile.am (eelf64_ia64.c): Depend on it. + * Makefile.in: Rebuild. + +2001-08-13 Alan Modra + + * emultempl/elf32.em: For SEC_EXCLUDE sections, ensure that + output_section is set non-NULL. + + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Return + `true' for SEC_EXCLUDE sections so that the generic code doesn't + needlessly create an output_section_statement. Treat a correctly + named output_section_statement with NULL bfd_section as compatible. + +2001-08-13 Hans-Peter Nilsson + + * emultempl/generic.em: Support EXTRA_EM_FILE. + (ld_${EMULATION_NAME}_emulation): Support emulation parameters + LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL, + LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION, + LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET, + LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH, + LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS, + LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN, + LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE, + LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE, + LDEMUL_FIND_POTENTIAL_LIBRARIES. + +2001-08-12 Richard Henderson + + * scripttempl/elf.sc, scripttempl/elfd30v.sc, + scripttempl/elfm68hc11.sc, scripttempl/elfm68hc12.sc, + scripttempl/v850.sc: Keep .jcr data. + +2001-08-12 H.J. Lu + Andrew Haley + Nick Clifton + + * ldgram.y (had_script): Change name to saved_script_handle. + Change type to file handle. + * ld.h (had_script): Rename and retype. + * ldfile.c (ldfile_open_command_file): Save the file handle + used in saved_script_handle. + * lexsup.c (parse_args): Do not allow -c option to alter + saved_script_handle. + * ldmain.c (main): Print out the linker script used if + --verbose is given. Check saved_script_handle to obtain the + external linker script used, or if NULL, dump the builtin + script. + * ld.texinfo: Document that --verbose now dumps the linker + script used, regardless of whether it was an internal or an + external script. + 2001-08-10 Andreas Jaeger * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes @@ -183,7 +374,7 @@ 2001-07-14 Nick Clifton - * Makefile.am (em32relf.c): Chnage dependencu from generic.em to + * Makefile.am (em32relf.c): Change dependency from generic.em to elf32.em. * Makefile.in: Regenerate. @@ -300,7 +491,7 @@ * ldlang.c (walk_wild): Only call walk_wild_file if lookup_name returns something. (lookup_name): If load_symbols fails, return NULL. - (load_symbols): Chnage to a boolean function. + (load_symbols): Change to a boolean function. (open_input_bfds): If load_symbols fails then do not make the executable. diff -uprN binutils-2.11.90.0.27/ld/ChangeLog.linux binutils-2.11.90.0.29/ld/ChangeLog.linux --- binutils-2.11.90.0.27/ld/ChangeLog.linux Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/ld/ChangeLog.linux Wed Aug 22 08:52:10 2001 @@ -1,3 +1,9 @@ +2001-08-17 H.J. Lu + + * ldfile.h (ldfile_open_command_file): Return void again; + * ldfile.c (ldfile_open_command_file): Return if failed to open + the file and command_line.multilib_dir is not NULL. + 2001-08-10 H.J. Lu * ldmain.c (main): Fix a typo in comments. diff -uprN binutils-2.11.90.0.27/ld/Makefile.am binutils-2.11.90.0.29/ld/Makefile.am --- binutils-2.11.90.0.27/ld/Makefile.am Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/ld/Makefile.am Mon Aug 27 11:44:52 2001 @@ -159,6 +159,8 @@ ALL_EMULATIONS = \ eelf32ppc.o \ eelf32ppclinux.o \ eelf32ppcsim.o \ + eelf64ppc.o \ + eelf64lppc.o \ eelf_i386.o \ eelf_i386_be.o \ eelf_i386_chaos.o \ @@ -501,6 +503,12 @@ eelf32ppcsim.c: $(srcdir)/emulparams/elf eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)" +eelf64ppc.c: $(srcdir)/emulparams/elf64ppc.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64ppc "$(tdir_elf64ppc)" +eelf64lppc.c: $(srcdir)/emulparams/elf64lppc.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64lppc "$(tdir_elf64lppc)" eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32i370 "$(tdir_elf32i370)" @@ -514,7 +522,8 @@ eelf64_aix.c: $(srcdir)/emulparams/elf64 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_aix "$(tdir_elf64_aix)" eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \ - $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)" eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} diff -uprN binutils-2.11.90.0.27/ld/Makefile.in binutils-2.11.90.0.29/ld/Makefile.in --- binutils-2.11.90.0.27/ld/Makefile.in Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/ld/Makefile.in Mon Aug 27 11:44:52 2001 @@ -267,6 +267,8 @@ ALL_EMULATIONS = \ eelf32ppc.o \ eelf32ppclinux.o \ eelf32ppcsim.o \ + eelf64ppc.o \ + eelf64lppc.o \ eelf_i386.o \ eelf_i386_be.o \ eelf_i386_chaos.o \ @@ -1215,6 +1217,12 @@ eelf32ppcsim.c: $(srcdir)/emulparams/elf eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)" +eelf64ppc.c: $(srcdir)/emulparams/elf64ppc.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64ppc "$(tdir_elf64ppc)" +eelf64lppc.c: $(srcdir)/emulparams/elf64lppc.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64lppc "$(tdir_elf64lppc)" eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32i370 "$(tdir_elf32i370)" @@ -1228,7 +1236,8 @@ eelf64_aix.c: $(srcdir)/emulparams/elf64 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_aix "$(tdir_elf64_aix)" eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \ - $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)" eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} diff -uprN binutils-2.11.90.0.27/ld/NEWS binutils-2.11.90.0.29/ld/NEWS --- binutils-2.11.90.0.27/ld/NEWS Mon Dec 11 11:51:37 2000 +++ binutils-2.11.90.0.29/ld/NEWS Mon Aug 27 11:44:52 2001 @@ -1,5 +1,11 @@ -*- text -*- +* Support for -z combreloc in the ELF linker, which puts dynamic + relocations against the same symbol together, so that dynamic linker + can use an one-entry symbol lookup cache. + +* Support for ELF SHF_MERGE section merging, by Jakub Jelinek. + * Support for AMD x86-64 architecture, by Jan Hubicka, SuSE Labs. * Support added for eliminating duplicate DWARF2 debug information by diff -uprN binutils-2.11.90.0.27/ld/configure.tgt binutils-2.11.90.0.29/ld/configure.tgt --- binutils-2.11.90.0.27/ld/configure.tgt Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.29/ld/configure.tgt Mon Aug 27 11:44:52 2001 @@ -314,23 +314,38 @@ z8k-*-coff) targ_emul=z8002; targ_extr ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha ;; ns32k-pc532-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;; openrisc-*-*) targ_emul=elf32openrisc ;; +pdp11-*-*) targ_emul=pdp11 ;; +pjl*-*-*) targ_emul=pjlelf ; targ_extra_emuls="elf_i386" ;; +pj*-*-*) targ_emul=pjelf ;; powerpc-*-freebsd*) targ_emul=elf32ppc; targ_extra_emuls=elf32ppcsim; targ_extra_libpath=elf32ppc; tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'` ;; -powerpc-*-linux-gnu*) targ_emul=elf32ppclinux; - targ_extra_emuls="elf32ppc elf32ppcsim"; - targ_extra_libpath=elf32ppc ;; -pdp11-*-*) targ_emul=pdp11 ;; -pjl*-*-*) targ_emul=pjlelf ; targ_extra_emuls="elf_i386" ;; -pj*-*-*) targ_emul=pjelf ;; -powerpc-*-elf* | powerpc-*-eabi* | powerpc-*-sysv* \ - | powerpc-*-netbsd* | powerpc-*-vxworks*) - targ_emul=elf32ppc targ_extra_emuls="elf32ppclinux elf32ppcsim";; -powerpcle-*-elf* | powerpcle-*-eabi* | powerpcle-*-solaris* \ - | powerpcle-*-sysv* | powerpcle-*-vxworks*) - targ_emul=elf32lppc targ_extra_emuls="elf32ppcsim";; +powerpc*-*-linux*) + case "${targ}" in + *64*) targ_emul=elf64ppc + targ_extra_emuls="elf32ppclinux elf32ppc elf32ppcsim" ;; + *) targ_emul=elf32ppclinux + targ_extra_emuls="elf32ppc elf32ppcsim" + targ_extra_libpath=elf32ppc ;; + esac ;; +powerpc*le-*-elf* | powerpc*le-*-eabi* | powerpc*le-*-solaris* \ + | powerpc*le-*-sysv* | powerpc*le-*-vxworks*) + case "${targ}" in + *64*) targ_emul=elf64lppc + targ_extra_emuls="elf32lppc elf32ppcsim" ;; + *) targ_emul=elf32lppc + targ_extra_emuls="elf32ppcsim" ;; + esac ;; +powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \ + | powerpc*-*-netbsd* | powerpc*-*-vxworks*) + case "${targ}" in + *64*) targ_emul=elf64ppc + targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim" ;; + *) targ_emul=elf32ppc + targ_extra_emuls="elf32ppclinux elf32ppcsim" ;; + esac ;; powerpcle-*-rtems*) targ_emul=elf32leppc ;; powerpc-*-rtems*) targ_emul=elf32ppc ;; powerpc-*-macos*) targ_emul=ppcmacos ;; diff -uprN binutils-2.11.90.0.27/ld/deffilep.y binutils-2.11.90.0.29/ld/deffilep.y --- binutils-2.11.90.0.27/ld/deffilep.y Thu Mar 15 14:56:48 2001 +++ binutils-2.11.90.0.29/ld/deffilep.y Wed Aug 22 08:52:10 2001 @@ -1,6 +1,6 @@ %{ /* deffilep.y - parser for .def files */ -/* Copyright 1995, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright 1995, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -77,14 +77,13 @@ Foundation, Inc., 59 Temple Place - Suit #define yytable def_yytable #define yycheck def_yycheck -static int def_lex (); - static void def_description PARAMS ((const char *)); static void def_exports PARAMS ((const char *, const char *, int, int)); static void def_heapsize PARAMS ((int, int)); static void def_import PARAMS ((const char *, const char *, const char *, const char *, int)); static void def_library PARAMS ((const char *, int)); +static def_file_module *def_stash_module PARAMS ((def_file *, char *)); static void def_name PARAMS ((const char *, int)); static void def_section PARAMS ((const char *, int)); static void def_section_alt PARAMS ((const char *, const char *)); @@ -93,6 +92,9 @@ static void def_version PARAMS ((int, in static void def_directive PARAMS ((char *)); static int def_parse PARAMS ((void)); static int def_error PARAMS ((const char *)); +static void put_buf PARAMS ((char)); +static int def_getc PARAMS ((void)); +static int def_ungetc PARAMS ((int)); static int def_lex PARAMS ((void)); static int lex_forced_token = 0; diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf32fr30.sh binutils-2.11.90.0.29/ld/emulparams/elf32fr30.sh --- binutils-2.11.90.0.27/ld/emulparams/elf32fr30.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.29/ld/emulparams/elf32fr30.sh Mon Aug 27 11:44:52 2001 @@ -6,5 +6,5 @@ ARCH=fr30 MAXPAGESIZE=256 ENTRY=_start EMBEDDED=yes -NOP=0x9fa0 -OTHER_RELOCATING_SECTIONS='PROVIDE (__stack = 0x200000);' \ No newline at end of file +NOP=0x9fa09fa0 +OTHER_RELOCATING_SECTIONS='PROVIDE (__stack = 0x200000);' diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf32mcore.sh binutils-2.11.90.0.29/ld/emulparams/elf32mcore.sh --- binutils-2.11.90.0.27/ld/emulparams/elf32mcore.sh Wed Jul 19 20:29:18 2000 +++ binutils-2.11.90.0.29/ld/emulparams/elf32mcore.sh Wed Aug 22 08:52:10 2001 @@ -19,7 +19,7 @@ EMBEDDED=yes # explicitly set first, and since the NOP code is only used as a # fill value between independantly viable peices of code, it should # not matter. -NOP=0x0e0e +NOP=0x0e0e0e0e OTHER_BSS_SYMBOLS="__bss_start__ = . ;" OTHER_BSS_END_SYMBOLS="__bss_end__ = . ;" diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf64_ia64.sh binutils-2.11.90.0.29/ld/emulparams/elf64_ia64.sh --- binutils-2.11.90.0.27/ld/emulparams/elf64_ia64.sh Sat May 12 00:08:13 2001 +++ binutils-2.11.90.0.29/ld/emulparams/elf64_ia64.sh Wed Aug 22 08:52:10 2001 @@ -2,6 +2,7 @@ SCRIPT_NAME=elf ELFSIZE=64 TEMPLATE_NAME=elf32 +EXTRA_EM_FILE=needrelax OUTPUT_FORMAT="elf64-ia64-little" ARCH=ia64 MACHINE= diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf64_s390.sh binutils-2.11.90.0.29/ld/emulparams/elf64_s390.sh --- binutils-2.11.90.0.27/ld/emulparams/elf64_s390.sh Sat Feb 10 15:37:41 2001 +++ binutils-2.11.90.0.29/ld/emulparams/elf64_s390.sh Wed Aug 22 08:52:10 2001 @@ -6,6 +6,6 @@ MAXPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x80000000 ARCH="s390:esame" MACHINE= -NOP=0x0707 +NOP=0x07070707 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf64lppc.sh binutils-2.11.90.0.29/ld/emulparams/elf64lppc.sh --- binutils-2.11.90.0.27/ld/emulparams/elf64lppc.sh Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/ld/emulparams/elf64lppc.sh Mon Aug 27 11:44:52 2001 @@ -0,0 +1,3 @@ +. ${srcdir}/emulparams/elf64ppc.sh +OUTPUT_FORMAT="elf64-powerpcle" +NOP=0x00000060 diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf64ppc.sh binutils-2.11.90.0.29/ld/emulparams/elf64ppc.sh --- binutils-2.11.90.0.27/ld/emulparams/elf64ppc.sh Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/ld/emulparams/elf64ppc.sh Mon Aug 27 11:44:52 2001 @@ -0,0 +1,28 @@ +TEMPLATE_NAME=elf32 +ELFSIZE=64 +GENERATE_SHLIB_SCRIPT=yes +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf64-powerpc" +TEXT_START_ADDR=0x10000000 +MAXPAGESIZE=0x40000 +ARCH=powerpc +MACHINE= +NOP=0x60000000 +EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' +OTHER_BSS_END_SYMBOLS='__end = .;' +CTOR_START='PROVIDE (__CTOR_LIST__ = .); PROVIDE (___CTOR_LIST__ = .);' +CTOR_END='PROVIDE (__CTOR_END__ = .); PROVIDE (___CTOR_END__ = .);' +DTOR_START='PROVIDE (__DTOR_LIST__ = .); PROVIDE (___DTOR_LIST__ = .);' +DTOR_END='PROVIDE (__DTOR_END__ = .); PROVIDE (___DTOR_END__ = .);' +BSS_PLT= +OTHER_BSS_SYMBOLS=" + .tocbss ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.tocbss)}" +OTHER_PLT_RELOC_SECTIONS=" + .rela.tocbss ${RELOCATING-0} : { *(.rela.tocbss) }" +OTHER_GOT_SECTIONS=" + .toc ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.toc) }" +OTHER_GOT_RELOC_SECTIONS=" + .rela.toc ${RELOCATING-0} : { *(.rela.toc) }" +OTHER_READWRITE_SECTIONS=" + .toc1 ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.toc1) } + .opd ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.opd) }" diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf_i386.sh binutils-2.11.90.0.29/ld/emulparams/elf_i386.sh --- binutils-2.11.90.0.27/ld/emulparams/elf_i386.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.29/ld/emulparams/elf_i386.sh Wed Aug 22 08:52:10 2001 @@ -5,6 +5,6 @@ MAXPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x08048000 ARCH=i386 MACHINE= -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf_i386_be.sh binutils-2.11.90.0.29/ld/emulparams/elf_i386_be.sh --- binutils-2.11.90.0.27/ld/emulparams/elf_i386_be.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.29/ld/emulparams/elf_i386_be.sh Wed Aug 22 08:52:10 2001 @@ -6,6 +6,6 @@ NONPAGED_TEXT_START_ADDR=0x80000000 MAXPAGESIZE=0x1000 ARCH=i386 MACHINE= -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf_i386_chaos.sh binutils-2.11.90.0.29/ld/emulparams/elf_i386_chaos.sh --- binutils-2.11.90.0.27/ld/emulparams/elf_i386_chaos.sh Tue Nov 7 16:30:53 2000 +++ binutils-2.11.90.0.29/ld/emulparams/elf_i386_chaos.sh Wed Aug 22 08:52:10 2001 @@ -5,6 +5,6 @@ MAXPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x40000000 ARCH=i386 MACHINE= -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf_i386_ldso.sh binutils-2.11.90.0.29/ld/emulparams/elf_i386_ldso.sh --- binutils-2.11.90.0.27/ld/emulparams/elf_i386_ldso.sh Wed May 23 10:57:02 2001 +++ binutils-2.11.90.0.29/ld/emulparams/elf_i386_ldso.sh Wed Aug 22 08:52:10 2001 @@ -5,7 +5,7 @@ MAXPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x08048000 ARCH=i386 MACHINE= -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes ELF_INTERPRETER_NAME=\"/usr/lib/ld.so.1\" diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf_s390.sh binutils-2.11.90.0.29/ld/emulparams/elf_s390.sh --- binutils-2.11.90.0.27/ld/emulparams/elf_s390.sh Sat Feb 10 15:37:41 2001 +++ binutils-2.11.90.0.29/ld/emulparams/elf_s390.sh Wed Aug 22 08:52:10 2001 @@ -5,6 +5,6 @@ MAXPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x00400000 ARCH=s390 MACHINE= -NOP=0x0707 +NOP=0x07070707 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes diff -uprN binutils-2.11.90.0.27/ld/emulparams/elf_x86_64.sh binutils-2.11.90.0.29/ld/emulparams/elf_x86_64.sh --- binutils-2.11.90.0.27/ld/emulparams/elf_x86_64.sh Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.29/ld/emulparams/elf_x86_64.sh Wed Aug 22 08:52:10 2001 @@ -6,6 +6,6 @@ MAXPAGESIZE=0x100000 NONPAGED_TEXT_START_ADDR=0x400000 ARCH=i386 MACHINE= -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes diff -uprN binutils-2.11.90.0.27/ld/emulparams/i386moss.sh binutils-2.11.90.0.29/ld/emulparams/i386moss.sh --- binutils-2.11.90.0.27/ld/emulparams/i386moss.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.29/ld/emulparams/i386moss.sh Wed Aug 22 08:52:10 2001 @@ -5,6 +5,6 @@ MAXPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x00002000 ARCH=i386 MACHINE= -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes diff -uprN binutils-2.11.90.0.27/ld/emulparams/i386nw.sh binutils-2.11.90.0.29/ld/emulparams/i386nw.sh --- binutils-2.11.90.0.27/ld/emulparams/i386nw.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.29/ld/emulparams/i386nw.sh Wed Aug 22 08:52:10 2001 @@ -4,6 +4,6 @@ TEXT_START_ADDR=0x08000000 MAXPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x08000000 ARCH=i386 -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes diff -uprN binutils-2.11.90.0.27/ld/emulparams/m68kelf.sh binutils-2.11.90.0.29/ld/emulparams/m68kelf.sh --- binutils-2.11.90.0.27/ld/emulparams/m68kelf.sh Sun Sep 17 16:02:30 2000 +++ binutils-2.11.90.0.29/ld/emulparams/m68kelf.sh Wed Aug 22 08:52:10 2001 @@ -5,7 +5,7 @@ MAXPAGESIZE=0x2000 NONPAGED_TEXT_START_ADDR=${TEXT_START_ADDR} ARCH=m68k MACHINE= -NOP=0x4e75 +NOP=0x4e754e75 TEMPLATE_NAME=elf32 EXTRA_EM_FILE=m68kelf GENERATE_SHLIB_SCRIPT=yes diff -uprN binutils-2.11.90.0.27/ld/emultempl/aix.em binutils-2.11.90.0.29/ld/emultempl/aix.em --- binutils-2.11.90.0.27/ld/emultempl/aix.em Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/emultempl/aix.em Wed Aug 22 08:52:10 2001 @@ -117,7 +117,7 @@ static unsigned int symbol_mode = 0x04; /* This routine is called before anything else is done. */ static void -gld${EMULATION_NAME}_before_parse() +gld${EMULATION_NAME}_before_parse () { #ifndef TARGET_ /* I.e., if not generic. */ const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}"); @@ -136,7 +136,7 @@ gld${EMULATION_NAME}_before_parse() * The link_info.[init|fini]_functions are initialized in ld/lexsup.c. * Override them here so we can use the link_info.init_function as a * state flag that lets the backend know that -binitfini has been done. - */ + */ link_info.init_function = NULL; link_info.fini_function = NULL; @@ -159,72 +159,72 @@ gld${EMULATION_NAME}_parse_args (argc, a enum { OPTION_IGNORE = 300, - OPTION_AUTOIMP, - OPTION_ERNOTOK, - OPTION_EROK, - OPTION_EXPORT, - OPTION_IMPORT, - OPTION_INITFINI, - OPTION_LOADMAP, - OPTION_MAXDATA, - OPTION_MAXSTACK, - OPTION_MODTYPE, - OPTION_NOAUTOIMP, - OPTION_NOSTRCMPCT, - OPTION_PD, - OPTION_PT, - OPTION_STRCMPCT, + OPTION_AUTOIMP, + OPTION_ERNOTOK, + OPTION_EROK, + OPTION_EXPORT, + OPTION_IMPORT, + OPTION_INITFINI, + OPTION_LOADMAP, + OPTION_MAXDATA, + OPTION_MAXSTACK, + OPTION_MODTYPE, + OPTION_NOAUTOIMP, + OPTION_NOSTRCMPCT, + OPTION_PD, + OPTION_PT, + OPTION_STRCMPCT, OPTION_UNIX }; /* b64 is an empty option. The native linker uses -b64 for xcoff64 support - Our linker uses -m aixppc64 for xcoff64 support. The choice for the + Our linker uses -m aixppc64 for xcoff64 support. The choice for the correct emulation is done in collect2.c via the environmental varible LDEMULATION. - + binitfini has special handling in the linker backend. The native linker uses the arguemnts to generate a table of init and fini functions for the executable. The important use for this option is to support aix 4.2+ c++ constructors and destructors. This is tied into gcc via collect2.c. - The function table is accessed by the runtime linker/loader by checking if - the first symbol in the loader symbol table is "__rtinit". The native - linker generates this table and the loader symbol. The gnu linker looks - for the symbol "__rtinit" and makes it the first loader symbol. It is the - responsiblity of the user to define the __rtinit symbol. The format for - __rtinit is given by the aix system file /usr/include/rtinit.h. You can - look at collect2.c to see an example of how this is done for 32 and 64 bit. - Below is an exmaple of a 32 bit assembly file that defines __rtinit. - - .file "my_rtinit.s" - - .csect .data[RW],3 - .globl __rtinit - .extern init_function - .extern fini_function - - __rtinit: - .long 0 - .long f1i - __rtinit - .long f1f - __rtinit - .long f2i - f1i - .align 3 - f1i: .long init_function - .long s1i - __rtinit - .long 0 - f2i: .long 0 - .long 0 - .long 0 - f1f: .long fini_function - .long s1f - __rtinit - .long 0 - f2f: .long 0 - .long 0 - .long 0 - .align 3 - s1i: .string "init_function" - .align 3 - s1f: .string "fini_function" + The function table is accessed by the runtime linker/loader by checking if + the first symbol in the loader symbol table is "__rtinit". The native + linker generates this table and the loader symbol. The gnu linker looks + for the symbol "__rtinit" and makes it the first loader symbol. It is the + responsiblity of the user to define the __rtinit symbol. The format for + __rtinit is given by the aix system file /usr/include/rtinit.h. You can + look at collect2.c to see an example of how this is done for 32 and 64 bit. + Below is an exmaple of a 32 bit assembly file that defines __rtinit. + + .file "my_rtinit.s" + + .csect .data[RW],3 + .globl __rtinit + .extern init_function + .extern fini_function + + __rtinit: + .long 0 + .long f1i - __rtinit + .long f1f - __rtinit + .long f2i - f1i + .align 3 + f1i: .long init_function + .long s1i - __rtinit + .long 0 + f2i: .long 0 + .long 0 + .long 0 + f1f: .long fini_function + .long s1f - __rtinit + .long 0 + f2f: .long 0 + .long 0 + .long 0 + .align 3 + s1i: .string "init_function" + .align 3 + s1f: .string "fini_function" */ @@ -287,20 +287,24 @@ gld${EMULATION_NAME}_parse_args (argc, a The AIX linker uses : to separate the option from the argument; changing it to = lets us treat it as a getopt option. */ indx = optind; - if (indx == 0) { - indx = 1; - } - - if (indx < argc && strncmp (argv[indx], "-b", 2) == 0) { - char *s; - - for (s = argv[indx]; *s != '\0'; s++) { - if (*s == ':') { - *s = '='; - break; - } + if (indx == 0) + { + indx = 1; + } + + if (indx < argc && strncmp (argv[indx], "-b", 2) == 0) + { + char *s; + + for (s = argv[indx]; *s != '\0'; s++) + { + if (*s == ':') + { + *s = '='; + break; + } + } } - } /* We add s and u so to the short options list so that -s and -u on @@ -362,39 +366,45 @@ gld${EMULATION_NAME}_parse_args (argc, a case OPTION_IGNORE: break; - case OPTION_INITFINI: { - /* - * The aix linker init fini has the format : - * - * -binitfini:[ Initial][:Termination][:Priority] - * - * it allows the Termination and Priority to be optional. - * - * Since we support only one init/fini pair, we ignore the Priority. - * - * Define the special symbol __rtinit. - * - * strtok does not correctly handle the case of -binitfini::fini: so - * do it by hand - */ - char *t, *i, *f; - - i = t = optarg; - while (*t && ':' != *t) t++; - if (*t) *t++ = 0; + case OPTION_INITFINI: + { + /* + * The aix linker init fini has the format : + * + * -binitfini:[ Initial][:Termination][:Priority] + * + * it allows the Termination and Priority to be optional. + * + * Since we support only one init/fini pair, we ignore the Priority. + * + * Define the special symbol __rtinit. + * + * strtok does not correctly handle the case of -binitfini::fini: so + * do it by hand + */ + char *t, *i, *f; + + i = t = optarg; + while (*t && ':' != *t) + t++; + if (*t) + *t++ = 0; - if (0 != strlen(i)) { - link_info.init_function = i; - } + if (0 != strlen (i)) + { + link_info.init_function = i; + } - f = t; - while (*t && ':' != *t) t++; - *t = 0; + f = t; + while (*t && ':' != *t) + t++; + *t = 0; - if (0 != strlen(f)) { - link_info.fini_function = f; + if (0 != strlen (f)) + { + link_info.fini_function = f; + } } - } break; case OPTION_AUTOIMP: @@ -435,8 +445,7 @@ gld${EMULATION_NAME}_parse_args (argc, a case OPTION_MAXDATA: val = strtoull (optarg, &end, 0); if (*end != '\0') - einfo ("%P: warning: ignoring invalid -bmaxdata number %s\n", - optarg); + einfo ("%P: warning: ignoring invalid -bmaxdata number %s\n", optarg); else maxdata = val; break; @@ -444,8 +453,7 @@ gld${EMULATION_NAME}_parse_args (argc, a case OPTION_MAXSTACK: val = strtoull (optarg, &end, 0); if (*end != '\0') - einfo ("%P: warning: ignoring invalid -bmaxstack number %s\n", - optarg); + einfo ("%P: warning: ignoring invalid -bmaxstack number %s\n", optarg); else maxstack = val; break; @@ -625,15 +633,16 @@ gld${EMULATION_NAME}_before_allocation ( /* Handle the import and export files, if any. */ for (fl = import_files; fl != NULL; fl = fl->next) gld${EMULATION_NAME}_read_file (fl->name, true); - for (el = export_symbols; el != NULL; el = el->next) { - struct bfd_link_hash_entry *h; - - h = bfd_link_hash_lookup (link_info.hash, el->name, false, false, false); - if (h == NULL) - einfo ("%P%F: bfd_link_hash_lookup of export symbol failed: %E\n"); - if (! bfd_xcoff_export_symbol (output_bfd, &link_info, h, el->syscall)) - einfo ("%P%F: bfd_xcoff_export_symbol failed: %E\n"); - } + for (el = export_symbols; el != NULL; el = el->next) + { + struct bfd_link_hash_entry *h; + + h = bfd_link_hash_lookup (link_info.hash, el->name, false, false, false); + if (h == NULL) + einfo ("%P%F: bfd_link_hash_lookup of export symbol failed: %E\n"); + if (! bfd_xcoff_export_symbol (output_bfd, &link_info, h, el->syscall)) + einfo ("%P%F: bfd_xcoff_export_symbol failed: %E\n"); + } /* Track down all relocations called for by the linker script (these are typically constructor/destructor entries created by @@ -681,113 +690,124 @@ gld${EMULATION_NAME}_before_allocation ( /* Look through the special sections, and put them in the right place in the link ordering. This is especially magic. */ - for (i = 0; i < XCOFF_NUMBER_OF_SPECIAL_SECTIONS; i++) { - asection *sec; - lang_output_section_statement_type *os; - lang_statement_union_type **pls; - lang_input_section_type *is; - const char *oname; - boolean start; - - sec = special_sections[i]; - if (sec == NULL) - continue; - - /* Remove this section from the list of the output section. - This assumes we know what the script looks like. */ - is = NULL; - os = lang_output_section_find (sec->output_section->name); - if (os == NULL) { - einfo ("%P%F: can't find output section %s\n", - sec->output_section->name); - } + for (i = 0; i < XCOFF_NUMBER_OF_SPECIAL_SECTIONS; i++) + { + asection *sec; + lang_output_section_statement_type *os; + lang_statement_union_type **pls; + lang_input_section_type *is; + const char *oname; + boolean start; - for (pls = &os->children.head; *pls != NULL; pls = &(*pls)->next) { + sec = special_sections[i]; + if (sec == NULL) + continue; - if ((*pls)->header.type == lang_input_section_enum && - (*pls)->input_section.section == sec) { - is = (lang_input_section_type *) *pls; - *pls = (*pls)->next; - break; + /* Remove this section from the list of the output section. + This assumes we know what the script looks like. */ + is = NULL; + os = lang_output_section_find (sec->output_section->name); + if (os == NULL) { + einfo ("%P%F: can't find output section %s\n", + sec->output_section->name); } - - if ((*pls)->header.type == lang_wild_statement_enum) { - lang_statement_union_type **pwls; - - for (pwls = &(*pls)->wild_statement.children.head; - *pwls != NULL; - pwls = &(*pwls)->next) { - if ((*pwls)->header.type == lang_input_section_enum && - (*pwls)->input_section.section == sec) { + for (pls = &os->children.head; *pls != NULL; pls = &(*pls)->header.next) + { - is = (lang_input_section_type *) *pwls; - *pwls = (*pwls)->next; + if ((*pls)->header.type == lang_input_section_enum && + (*pls)->input_section.section == sec) + { + is = (lang_input_section_type *) *pls; + *pls = (*pls)->header.next; break; - } + } + + if ((*pls)->header.type == lang_wild_statement_enum) + { + lang_statement_union_type **pwls; + + for (pwls = &(*pls)->wild_statement.children.head; + *pwls != NULL; + pwls = &(*pwls)->header.next) + { + + if ((*pwls)->header.type == lang_input_section_enum && + (*pwls)->input_section.section == sec) + { + + is = (lang_input_section_type *) *pwls; + *pwls = (*pwls)->header.next; + break; + } + } + + if (is != NULL) + break; + } + } + + if (is == NULL) + { + einfo ("%P%F: can't find %s in output section\n", + bfd_get_section_name (sec->owner, sec)); } - - if (is != NULL) + + /* Now figure out where the section should go. */ + switch (i) + { + + default: /* to avoid warnings */ + case XCOFF_SPECIAL_SECTION_TEXT: + /* _text */ + oname = ".text"; + start = true; break; - } - } - if (is == NULL) { - einfo ("%P%F: can't find %s in output section\n", - bfd_get_section_name (sec->owner, sec)); - } - - /* Now figure out where the section should go. */ - switch (i) { - - default: /* to avoid warnings */ - case XCOFF_SPECIAL_SECTION_TEXT: - /* _text */ - oname = ".text"; - start = true; - break; - - case XCOFF_SPECIAL_SECTION_ETEXT: - /* _etext */ - oname = ".text"; - start = false; - break; - - case XCOFF_SPECIAL_SECTION_DATA: - /* _data */ - oname = ".data"; - start = true; - break; - - case XCOFF_SPECIAL_SECTION_EDATA: - /* _edata */ - oname = ".data"; - start = false; - break; - - case XCOFF_SPECIAL_SECTION_END: - case XCOFF_SPECIAL_SECTION_END2: - /* _end and end */ - oname = ".bss"; - start = false; - break; - } + case XCOFF_SPECIAL_SECTION_ETEXT: + /* _etext */ + oname = ".text"; + start = false; + break; + + case XCOFF_SPECIAL_SECTION_DATA: + /* _data */ + oname = ".data"; + start = true; + break; + + case XCOFF_SPECIAL_SECTION_EDATA: + /* _edata */ + oname = ".data"; + start = false; + break; - os = lang_output_section_find (oname); + case XCOFF_SPECIAL_SECTION_END: + case XCOFF_SPECIAL_SECTION_END2: + /* _end and end */ + oname = ".bss"; + start = false; + break; + } - if (start) { - is->header.next = os->children.head; - os->children.head = (lang_statement_union_type *) is; - } else { - is->header.next = NULL; - lang_statement_append (&os->children, - (lang_statement_union_type *) is, - &is->header.next); + os = lang_output_section_find (oname); + + if (start) + { + is->header.next = os->children.head; + os->children.head = (lang_statement_union_type *) is; + } + else + { + is->header.next = NULL; + lang_statement_append (&os->children, + (lang_statement_union_type *) is, + &is->header.next); + } } - } } -static int change_symbol_mode (char *input) +static int change_symbol_mode (char *input) { /* * 1 : state changed @@ -804,22 +824,24 @@ static int change_symbol_mode (char *inp unsigned int bit; char *string; - for (bit = 0; ; bit++) { - string = symbol_mode_string[bit]; - if (NULL == string) - return 0; - - if (0 == strcmp(input, string)) { - symbol_mode = (1 << bit); - return 1; + for (bit = 0; ; bit++) + { + string = symbol_mode_string[bit]; + if (NULL == string) + return 0; + + if (0 == strcmp (input, string)) + { + symbol_mode = (1 << bit); + return 1; + } } - } /* should not be here */ return 0; } -static int is_syscall(char *input) +static int is_syscall (char *input) { /* * 1 : yes @@ -828,7 +850,7 @@ static int is_syscall(char *input) */ unsigned int bit; char *string; - + char *syscall_string[] = { "svc", /* 0x01 */ "svc32", /* 0x02 */ @@ -841,21 +863,27 @@ static int is_syscall(char *input) NULL }; - for (bit = 0; ;bit++) { - - string = syscall_string[bit]; - if (NULL == string) { - return -1; - } + for (bit = 0; ;bit++) + { - if (0 == strcmp(input, string)) { - if (1 << bit & ${SYSCALL_MASK}) { - return 1; - } else { - return 0; - } + string = syscall_string[bit]; + if (NULL == string) + { + return -1; + } + + if (0 == strcmp (input, string)) + { + if (1 << bit & ${SYSCALL_MASK}) + { + return 1; + } + else + { + return 0; + } + } } - } /* should not be here */ return -1; } @@ -897,7 +925,7 @@ gld${EMULATION_NAME}_read_file (filename lineno = 0; - /* + /* * default to 32 and 64 bit mode * symbols at top of /lib/syscalls.exp do not have a mode modifier and they * are not repeated, assume 64 bit routines also want to use them. @@ -925,11 +953,11 @@ gld${EMULATION_NAME}_read_file (filename s = (char *) obstack_base (o); while (isspace ((unsigned char) *s)) ++s; - if (*s == '\0' || - *s == '*' || - change_symbol_mode (s) || - (*s == '#' && s[1] == ' ') || - (! import && *s == '#' && s[1] == '!')) + if (*s == '\0' + || *s == '*' + || change_symbol_mode (s) + || (*s == '#' && s[1] == ' ') + || (! import && *s == '#' && s[1] == '!')) { obstack_free (o, obstack_base (o)); continue; @@ -1008,111 +1036,115 @@ gld${EMULATION_NAME}_read_file (filename continue; } - if (symbol_mode & ${SYMBOL_MODE_MASK}) { + if (symbol_mode & ${SYMBOL_MODE_MASK}) + { + /* This is a symbol to be imported or exported. */ + symname = s; + syscall = false; + address = (bfd_vma) -1; - /* This is a symbol to be imported or exported. */ - symname = s; - syscall = false; - address = (bfd_vma) -1; - - while (! isspace ((unsigned char) *s) && *s != '\0') - ++s; - if (*s != '\0') - { - char *se; - - *s++ = '\0'; - - while (isspace ((unsigned char) *s)) - ++s; - - se = s; - while (! isspace ((unsigned char) *se) && *se != '\0') - ++se; - if (*se != '\0') - { - *se++ = '\0'; - while (isspace ((unsigned char) *se)) - ++se; - if (*se != '\0') - einfo ("%s%d: warning: syntax error in import/export file\n", - filename, lineno); - } - - if (s != se) { - int status; - char *end; - - status = is_syscall(s); - - switch (status) { - case 1: - /* this is a system call */ - syscall = true; - break; - - case 0: - /* ignore this system call */ - break; - - default: - /* not a system call, check for address */ - address = strtoul (s, &end, 0); - if (*end != '\0') { - einfo ("%s:%d: warning: syntax error in import/export file\n", filename, lineno); - + while (! isspace ((unsigned char) *s) && *s != '\0') + ++s; + if (*s != '\0') + { + char *se; + + *s++ = '\0'; + + while (isspace ((unsigned char) *s)) + ++s; + + se = s; + while (! isspace ((unsigned char) *se) && *se != '\0') + ++se; + if (*se != '\0') + { + *se++ = '\0'; + while (isspace ((unsigned char) *se)) + ++se; + if (*se != '\0') + einfo ("%s%d: warning: syntax error in import/export file\n", + filename, lineno); + } + + if (s != se) + { + int status; + char *end; + + status = is_syscall (s); + + switch (status) + { + case 1: + /* this is a system call */ + syscall = true; + break; + + case 0: + /* ignore this system call */ + break; + + default: + /* not a system call, check for address */ + address = strtoul (s, &end, 0); + if (*end != '\0') + { + einfo ("%s:%d: warning: syntax error in import/export file\n", + filename, lineno); + + } + } } - } } - } - if (! import) - { - struct export_symbol_list *n; + if (! import) + { + struct export_symbol_list *n; - ldlang_add_undef (symname); - n = ((struct export_symbol_list *) - xmalloc (sizeof (struct export_symbol_list))); - n->next = export_symbols; - n->name = xstrdup (symname); - n->syscall = syscall; - export_symbols = n; - } - else - { - h = bfd_link_hash_lookup (link_info.hash, symname, false, false, - true); - if (h == NULL || h->type == bfd_link_hash_new) - { - /* We can just ignore attempts to import an unreferenced - symbol. */ - } - else - { - if (! bfd_xcoff_import_symbol (output_bfd, &link_info, h, - address, imppath, impfile, - impmember)) - einfo ("%X%s:%d: failed to import symbol %s: %E\n", - filename, lineno, symname); - } - } - } + ldlang_add_undef (symname); + n = ((struct export_symbol_list *) + xmalloc (sizeof (struct export_symbol_list))); + n->next = export_symbols; + n->name = xstrdup (symname); + n->syscall = syscall; + export_symbols = n; + } + else + { + h = bfd_link_hash_lookup (link_info.hash, symname, false, false, + true); + if (h == NULL || h->type == bfd_link_hash_new) + { + /* We can just ignore attempts to import an unreferenced + symbol. */ + } + else + { + if (! bfd_xcoff_import_symbol (output_bfd, &link_info, h, + address, imppath, impfile, + impmember)) + einfo ("%X%s:%d: failed to import symbol %s: %E\n", + filename, lineno, symname); + } + } + } obstack_free (o, obstack_base (o)); } - + if (obstack_object_size (o) > 0) { - einfo ("%s:%d: warning: ignoring unterminated last line\n", - filename, lineno); - obstack_free (o, obstack_base (o)); - } + einfo ("%s:%d: warning: ignoring unterminated last line\n", + filename, lineno); + obstack_free (o, obstack_base (o)); + } - if (! keep) - { - obstack_free (o, NULL); - free (o); - } + if (! keep) + { + obstack_free (o, NULL); + free (o); } +} /* This routine saves us from worrying about declaring free. */ @@ -1194,7 +1226,7 @@ gld${EMULATION_NAME}_find_exp_assignment } static char * -gld${EMULATION_NAME}_get_script(isfile) +gld${EMULATION_NAME}_get_script (isfile) int *isfile; EOF @@ -1206,7 +1238,7 @@ then sc="-f ${srcdir}/emultempl/ostring.sed" cat >>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <e${EMULATION_NAME}.c <next) + for (p = *startptr, i = 0; i < count; i++, p = p->header.next) vec[i] = p; qsort (vec, count, sizeof (vec[0]), sort_func); @@ -586,7 +587,7 @@ static void sort_sections (s) lang_statement_union_type *s; { - for (; s ; s = s->next) + for (; s ; s = s->header.next) switch (s->header.type) { case lang_output_section_statement_enum: @@ -624,7 +625,7 @@ sort_sections (s) for (end = start, count = 0; end && (end->header.type == lang_input_section_enum); - end = end->next) + end = end->header.next) count++; p = sort_sections_1 (p, end, count, @@ -651,7 +652,7 @@ sort_sections (s) lang_statement_union_type *end; int count; - for (end = *p, count = 0; end; end = end->next) + for (end = *p, count = 0; end; end = end->header.next) { if (end->header.type != lang_input_section_enum) abort (); @@ -771,7 +772,7 @@ gld${EMULATION_NAME}_place_orphan (file, ps[0] = '\$'; ps[1] = 0; - for (l = os->children.head; l; l = l->next) + for (l = os->children.head; l; l = l->header.next) if (l->header.type == lang_wild_statement_enum) { struct wildcard_list *sec; @@ -813,7 +814,7 @@ gld${EMULATION_NAME}_place_orphan (file, The sections still have to be sorted, but that has to wait until all such sections have been processed by us. The sorting is done by sort_sections. */ - wild_doit (&l->wild_statement.children, s, os, file); + lang_add_section (&l->wild_statement.children, s, os, file); return true; } diff -uprN binutils-2.11.90.0.27/ld/emultempl/elf32.em binutils-2.11.90.0.29/ld/emultempl/elf32.em --- binutils-2.11.90.0.27/ld/emultempl/elf32.em Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/ld/emultempl/elf32.em Mon Aug 27 11:44:52 2001 @@ -53,29 +53,36 @@ Foundation, Inc., 59 Temple Place - Suit #include "ldgram.h" #include "elf/common.h" -static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); +static void gld${EMULATION_NAME}_before_parse + PARAMS ((void)); static void gld${EMULATION_NAME}_vercheck PARAMS ((lang_input_statement_type *)); static void gld${EMULATION_NAME}_stat_needed PARAMS ((lang_input_statement_type *)); -static boolean gld${EMULATION_NAME}_try_needed PARAMS ((const char *, int)); +static boolean gld${EMULATION_NAME}_try_needed + PARAMS ((const char *, int)); static boolean gld${EMULATION_NAME}_search_needed PARAMS ((const char *, const char *, int)); static void gld${EMULATION_NAME}_check_needed PARAMS ((lang_input_statement_type *)); -static void gld${EMULATION_NAME}_after_open PARAMS ((void)); -static void gld${EMULATION_NAME}_find_exp_assignment PARAMS ((etree_type *)); +static void gld${EMULATION_NAME}_after_open + PARAMS ((void)); +static void gld${EMULATION_NAME}_find_exp_assignment + PARAMS ((etree_type *)); static void gld${EMULATION_NAME}_find_statement_assignment PARAMS ((lang_statement_union_type *)); -static void gld${EMULATION_NAME}_before_allocation PARAMS ((void)); +static void gld${EMULATION_NAME}_before_allocation + PARAMS ((void)); static boolean gld${EMULATION_NAME}_open_dynamic_archive PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *)); -static lang_output_section_statement_type *output_rel_find PARAMS ((void)); +static lang_output_section_statement_type *output_rel_find + PARAMS ((void)); static asection *output_prev_sec_find PARAMS ((lang_output_section_statement_type *)); static boolean gld${EMULATION_NAME}_place_orphan PARAMS ((lang_input_statement_type *, asection *)); -static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); +static char *gld${EMULATION_NAME}_get_script + PARAMS ((int *isfile)); EOF @@ -241,8 +248,7 @@ gld${EMULATION_NAME}_stat_needed (s) if (soname == NULL) soname = basename (s->filename); - if (strncmp (soname, global_needed->name, - suffix - global_needed->name) == 0) + if (strncmp (soname, global_needed->name, suffix - global_needed->name) == 0) einfo ("%P: warning: %s, needed by %B, may conflict with %s\n", global_needed->name, global_needed->by, soname); } @@ -265,12 +271,12 @@ gld${EMULATION_NAME}_try_needed (name, f return false; if (! bfd_check_format (abfd, bfd_object)) { - (void) bfd_close (abfd); + bfd_close (abfd); return false; } if ((bfd_get_file_flags (abfd) & DYNAMIC) == 0) { - (void) bfd_close (abfd); + bfd_close (abfd); return false; } @@ -293,7 +299,7 @@ gld${EMULATION_NAME}_try_needed (name, f lang_for_each_input_file (gld${EMULATION_NAME}_vercheck); if (global_vercheck_failed) { - (void) bfd_close (abfd); + bfd_close (abfd); /* Return false to force the caller to move on to try another file on the search path. */ return false; @@ -318,7 +324,7 @@ case ${target} in break; if (l == NULL) { - (void) bfd_close (abfd); + bfd_close (abfd); return false; } } @@ -994,6 +1000,8 @@ gld${EMULATION_NAME}_open_dynamic_archiv EOF fi + +if test x"$LDEMUL_PLACE_ORPHAN" != xgld"$EMULATION_NAME"_place_orphan; then cat >>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <output_section_statement; if (lookup == os) - break; - if (lookup->bfd_section != NULL - && lookup->bfd_section != bfd_abs_section_ptr - && lookup->bfd_section != bfd_com_section_ptr - && lookup->bfd_section != bfd_und_section_ptr) + return s; + + if (lookup->bfd_section != NULL && lookup->bfd_section->owner != NULL) s = lookup->bfd_section; } - if (u == NULL) - return NULL; - - return s; + return NULL; } - /* Place an orphan section. We use this to put random SHF_ALLOC sections in the right segment. */ @@ -1095,12 +1092,13 @@ gld${EMULATION_NAME}_place_orphan (file, os = lang_output_section_find (secname); if (os != NULL - && os->bfd_section != NULL - && ((s->flags ^ os->bfd_section->flags) - & (SEC_LOAD | SEC_ALLOC)) == 0) + && (os->bfd_section == NULL + || ((s->flags ^ os->bfd_section->flags) + & (SEC_LOAD | SEC_ALLOC)) == 0)) { - /* We have already placed a section with this name. */ - wild_doit (&os->children, s, os, file); + /* We already have an output section statement with this + name, and its bfd section, if any, has compatible flags. */ + lang_add_section (&os->children, s, os, file); return true; } } @@ -1115,7 +1113,7 @@ gld${EMULATION_NAME}_place_orphan (file, && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0 && hold_text.os != NULL) { - wild_doit (&hold_text.os->children, s, hold_text.os, file); + lang_add_section (&hold_text.os->children, s, hold_text.os, file); return true; } @@ -1128,7 +1126,11 @@ gld${EMULATION_NAME}_place_orphan (file, (hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL) if (s->flags & SEC_EXCLUDE) - return false; + { + if (s->output_section == NULL) + s->output_section = bfd_abs_section_ptr; + return true; + } place = NULL; if ((s->flags & SEC_ALLOC) == 0) @@ -1149,7 +1151,25 @@ gld${EMULATION_NAME}_place_orphan (file, else if (strncmp (secname, ".rel", 4) == 0 && (hold_rel.os != NULL || (hold_rel.os = output_rel_find ()) != NULL)) - place = &hold_rel; + { + if (! link_info.relocateable && link_info.combreloc) + { + if (strncmp (secname, ".rela", 5) == 0) + os = lang_output_section_find (".rela.dyn"); + else + os = lang_output_section_find (".rel.dyn"); + + if (os != NULL + && os->bfd_section != NULL + && ((s->flags ^ os->bfd_section->flags) + & (SEC_LOAD | SEC_ALLOC)) == 0) + { + lang_add_section (&os->children, s, os, file); + return true; + } + } + place = &hold_rel; + } else if ((s->flags & (SEC_CODE | SEC_READONLY)) == SEC_READONLY && HAVE_SECTION (hold_rodata, ".rodata")) place = &hold_rodata; @@ -1216,7 +1236,7 @@ gld${EMULATION_NAME}_place_orphan (file, (etree_type *) NULL, (etree_type *) NULL); - wild_doit (&os->children, s, os, file); + lang_add_section (&os->children, s, os, file); lang_leave_output_section_statement ((bfd_vma) 0, "*default*", @@ -1242,36 +1262,29 @@ gld${EMULATION_NAME}_place_orphan (file, if (place != NULL) { - asection *snew, **pps, *bfd_section; + asection *snew, **pps; snew = os->bfd_section; - bfd_section = place->os->bfd_section; - if (place->section == NULL && bfd_section == NULL) - bfd_section = output_prev_sec_find (place->os); - - if (place->section != NULL - || (bfd_section != NULL - && bfd_section != snew)) + + /* Shuffle the bfd section list to make the output file look + neater. This is really only cosmetic. */ + if (place->section == NULL) { - /* Shuffle the section to make the output file look neater. - This is really only cosmetic. */ - if (place->section == NULL) - { -#if 0 - /* Finding the end of the list is a little tricky. We - make a wild stab at it by comparing section flags. */ - flagword first_flags = bfd_section->flags; - for (pps = &bfd_section->next; - *pps != NULL && (*pps)->flags == first_flags; - pps = &(*pps)->next) - ; - place->section = pps; -#else - /* Put orphans after the first section on the list. */ - place->section = &bfd_section->next; -#endif - } + asection *bfd_section = place->os->bfd_section; + + /* If the output statement hasn't been used to place + any input sections (and thus doesn't have an output + bfd_section), look for the closest prior output statement + having an output section. */ + if (bfd_section == NULL) + bfd_section = output_prev_sec_find (place->os); + + if (bfd_section != NULL && bfd_section != snew) + place->section = &bfd_section->next; + } + if (place->section != NULL) + { /* Unlink the section. */ for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next) ; @@ -1281,13 +1294,22 @@ gld${EMULATION_NAME}_place_orphan (file, snew->next = *place->section; *place->section = snew; } - place->section = &snew->next; /* Save the end of this list. */ + /* Save the end of this list. Further ophans of this type will + follow the one we've just added. */ + place->section = &snew->next; + + /* The following is non-cosmetic. We try to put the output + statements in some sort of reasonable order here, because + they determine the final load addresses of the orphan + sections. In addition, placing output statements in the + wrong order may require extra segments. For instance, + given a typical situation of all read-only sections placed + in one segment and following that a segment containing all + the read-write sections, we wouldn't want to place an orphan + read/write section before or amongst the read-only ones. */ if (add.head != NULL) { - /* We try to put the output statements in some sort of - reasonable order here, because they determine the final - load addresses of the orphan sections. */ if (place->stmt == NULL) { /* Put the new statement list right at the head. */ @@ -1346,14 +1368,18 @@ echo ' ; else if (link_info.relocateabl sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +if ! cmp -s ldscripts/${EMULATION_NAME}.x ldscripts/${EMULATION_NAME}.xn; then echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c - +fi if test -n "$GENERATE_SHLIB_SCRIPT" ; then +echo ' ; else if (link_info.shared && link_info.combreloc) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xsc >> e${EMULATION_NAME}.c echo ' ; else if (link_info.shared) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c fi - +echo ' ; else if (link_info.combreloc) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xc >> e${EMULATION_NAME}.c echo ' ; else return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c echo '; }' >> e${EMULATION_NAME}.c @@ -1511,6 +1537,10 @@ cat >>e${EMULATION_NAME}.c <e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <head; (s = *ps) != NULL; ps = &s->next) - { - switch (s->header.type) - { - - /* We want to recursively walk these sections. */ - case lang_constructors_statement_enum: - hppaelf_delete_padding_statements (&constructor_list); - break; - - case lang_output_section_statement_enum: - hppaelf_delete_padding_statements (&s->output_section_statement.children); - break; - - case lang_group_statement_enum: - hppaelf_delete_padding_statements (&s->group_statement.children); - break; - - case lang_wild_statement_enum: - hppaelf_delete_padding_statements (&s->wild_statement.children); - break; - - /* Here's what we are really looking for. Splice these out of - the list. */ - case lang_padding_statement_enum: - *ps = s->next; - if (*ps == NULL) - list->tail = ps; - break; - - /* We don't care about these cases. */ - case lang_data_statement_enum: - case lang_object_symbols_statement_enum: - case lang_output_statement_enum: - case lang_target_statement_enum: - case lang_input_section_enum: - case lang_input_statement_enum: - case lang_assignment_statement_enum: - case lang_address_statement_enum: - break; - - default: - abort (); - break; - } - } -} - struct hook_stub_info { @@ -165,7 +106,7 @@ hook_in_stub (info, lp) lang_statement_union_type *l; boolean ret; - for (; (l = *lp) != NULL; lp = &l->next) + for (; (l = *lp) != NULL; lp = &l->header.next) { switch (l->header.type) { @@ -258,7 +199,7 @@ hppaelf_add_stub_section (stub_sec_name, info.input_section = input_section; lang_list_init (&info.add); - wild_doit (&info.add, stub_sec, os, stub_file); + lang_add_section (&info.add, stub_sec, os, stub_file); if (info.add.head == NULL) goto err_ret; @@ -281,9 +222,6 @@ hppaelf_layaout_sections_again () to recalculate all the section offsets. This may mean we need to add even more stubs. */ - /* Delete all the padding statements, they're no longer valid. */ - hppaelf_delete_padding_statements (stat_ptr); - /* Resize the sections. */ lang_size_sections (stat_ptr->head, abs_output_section, &stat_ptr->head, 0, (bfd_vma) 0, false); diff -uprN binutils-2.11.90.0.27/ld/emultempl/needrelax.em binutils-2.11.90.0.29/ld/emultempl/needrelax.em --- binutils-2.11.90.0.27/ld/emultempl/needrelax.em Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/ld/emultempl/needrelax.em Wed Aug 22 08:52:10 2001 @@ -0,0 +1,40 @@ +# This shell script emits a C file. -*- C -*- +# Copyright (C) 2001 Free Software Foundation, Inc. +# +# This file is part of GLD, the Gnu Linker. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +# This file is sourced from elf32.em. It is used by targets for +# which relaxation is not just an optimization, but for correctness. + +LDEMUL_BEFORE_ALLOCATION=need_relax_${EMULATION_NAME}_before_allocation + +cat >>e${EMULATION_NAME}.c <e${EMULATION_NAME}.c # there, now line numbers match ;-) cat >>e${EMULATION_NAME}.c <next) + { + lookup = &u->output_section_statement; + if (lookup == os) + return s; + + if (lookup->bfd_section != NULL && lookup->bfd_section->owner != NULL) + s = lookup->bfd_section; + } + + return NULL; +} + /* Place an orphan section. We use this to put sections in a reasonable place in the file, and @@ -1455,10 +1483,13 @@ gld_${EMULATION_NAME}_place_orphan (file lang_list_init (&add_child); if (os != NULL - && os->bfd_section != NULL - && ((s->flags ^ os->bfd_section->flags) & (SEC_LOAD | SEC_ALLOC)) == 0) - { - wild_doit (&add_child, s, os, file); + && (os->bfd_section == NULL + || ((s->flags ^ os->bfd_section->flags) + & (SEC_LOAD | SEC_ALLOC)) == 0)) + { + /* We already have an output section statement with this + name, and its bfd section, if any, has compatible flags. */ + lang_add_section (&add_child, s, os, file); } else { @@ -1498,7 +1529,7 @@ gld_${EMULATION_NAME}_place_orphan (file /* Choose a unique name for the section. This will be needed if the same section name appears in the input file with - different loadable or allocateable characteristics. */ + different loadable or allocatable characteristics. */ outsecname = xstrdup (hold_section_name); if (bfd_get_section_by_name (output_bfd, outsecname) != NULL) { @@ -1562,7 +1593,7 @@ gld_${EMULATION_NAME}_place_orphan (file (etree_type *) NULL, (etree_type *) NULL); - wild_doit (&add_child, s, os, file); + lang_add_section (&add_child, s, os, file); lang_leave_output_section_statement ((bfd_vma) 0, "*default*", @@ -1590,28 +1621,30 @@ gld_${EMULATION_NAME}_place_orphan (file asection *snew, **pps; snew = os->bfd_section; - if (place->os->bfd_section != NULL || place->section != NULL) + + /* Shuffle the bfd section list to make the output file look + neater. This is really only cosmetic. */ + if (place->section == NULL) { - /* Shuffle the section to make the output file look neater. */ - if (place->section == NULL) - { -#if 0 - /* Finding the end of the list is a little tricky. We - make a wild stab at it by comparing section flags. */ - flagword first_flags = place->os->bfd_section->flags; - for (pps = &place->os->bfd_section->next; - *pps != NULL && (*pps)->flags == first_flags; - pps = &(*pps)->next) - ; - place->section = pps; -#else - /* Put orphans after the first section on the list. */ - place->section = &place->os->bfd_section->next; -#endif - } + asection *bfd_section = place->os->bfd_section; + + /* If the output statement hasn't been used to place + any input sections (and thus doesn't have an output + bfd_section), look for the closest prior output statement + having an output section. */ + if (bfd_section == NULL) + bfd_section = output_prev_sec_find (place->os); + + if (bfd_section != NULL && bfd_section != snew) + place->section = &bfd_section->next; + } + if (place->section != NULL) + { /* Unlink the section. */ - for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next) + for (pps = &output_bfd->sections; + *pps != snew; + pps = &(*pps)->next) ; *pps = snew->next; @@ -1619,21 +1652,43 @@ gld_${EMULATION_NAME}_place_orphan (file snew->next = *place->section; *place->section = snew; } - place->section = &snew->next; /* Save the end of this list. */ - if (place->stmt == NULL) - { - /* Put the new statement list right at the head. */ - *add.tail = place->os->header.next; - place->os->header.next = add.head; - } - else + /* Save the end of this list. Further ophans of this type will + follow the one we've just added. */ + place->section = &snew->next; + + /* The following is non-cosmetic. We try to put the output + statements in some sort of reasonable order here, because + they determine the final load addresses of the orphan + sections. In addition, placing output statements in the + wrong order may require extra segments. For instance, + given a typical situation of all read-only sections placed + in one segment and following that a segment containing all + the read-write sections, we wouldn't want to place an orphan + read/write section before or amongst the read-only ones. */ + if (add.head != NULL) { - /* Put it after the last orphan statement we added. */ - *add.tail = *place->stmt; - *place->stmt = add.head; + if (place->stmt == NULL) + { + /* Put the new statement list right at the head. */ + *add.tail = place->os->header.next; + place->os->header.next = add.head; + } + else + { + /* Put it after the last orphan statement we added. */ + *add.tail = *place->stmt; + *place->stmt = add.head; + } + + /* Fix the global list pointer if we happened to tack our + new list at the tail. */ + if (*old->tail == add.head) + old->tail = add.tail; + + /* Save the end of this list. */ + place->stmt = add.tail; } - place->stmt = add.tail; /* Save the end of this list. */ } } @@ -1648,7 +1703,7 @@ gld_${EMULATION_NAME}_place_orphan (file sections. */ found_dollar = false; - for ( ; *pl != NULL; pl = &(*pl)->next) + for ( ; *pl != NULL; pl = &(*pl)->header.next) { lang_input_section_type *ls; const char *lname; @@ -1675,7 +1730,7 @@ gld_${EMULATION_NAME}_place_orphan (file if (add_child.head != NULL) { - add_child.head->next = *pl; + add_child.head->header.next = *pl; *pl = add_child.head; } } diff -uprN binutils-2.11.90.0.27/ld/genscripts.sh binutils-2.11.90.0.29/ld/genscripts.sh --- binutils-2.11.90.0.27/ld/genscripts.sh Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/ld/genscripts.sh Mon Aug 27 11:44:52 2001 @@ -84,6 +84,17 @@ LIB_SEARCH_DIRS=`echo ${LIB_PATH} | tr ' # A .xs script is for generating a shared library with the --shared # flag; it is only generated if $GENERATE_SHLIB_SCRIPT is set by the # emulation parameters. +# A .xc script is for linking with -z combreloc; it is only generated if +# $GENERATE_COMBRELOC_SCRIPT is set by the emulation parameters or +# $SCRIPT_NAME is "elf". +# A .xsc script is for linking with --shared -z combreloc; it is generated +# if $GENERATE_COMBRELOC_SCRIPT is set by the emulation parameters or +# $SCRIPT_NAME is "elf" and $GENERATE_SHLIB_SCRIPT is set by the emulation +# parameters too. + +if [ "x$SCRIPT_NAME" = "xelf" ]; then + GENERATE_COMBRELOC_SCRIPT=yes +fi SEGMENT_SIZE=${SEGMENT_SIZE-${TARGET_PAGE_SIZE}} @@ -101,34 +112,45 @@ DATA_ALIGNMENT=${DATA_ALIGNMENT_r} DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" ( . ${srcdir}/emulparams/${EMULATION_NAME}.sh . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.xr +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xr LD_FLAG=u DATA_ALIGNMENT=${DATA_ALIGNMENT_u} CONSTRUCTING=" " ( . ${srcdir}/emulparams/${EMULATION_NAME}.sh . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.xu +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu LD_FLAG= DATA_ALIGNMENT=${DATA_ALIGNMENT_} RELOCATING=" " ( . ${srcdir}/emulparams/${EMULATION_NAME}.sh . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.x +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.x LD_FLAG=n DATA_ALIGNMENT=${DATA_ALIGNMENT_n} TEXT_START_ADDR=${NONPAGED_TEXT_START_ADDR-${TEXT_START_ADDR}} ( . ${srcdir}/emulparams/${EMULATION_NAME}.sh . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.xn +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xn LD_FLAG=N DATA_ALIGNMENT=${DATA_ALIGNMENT_N} ( . ${srcdir}/emulparams/${EMULATION_NAME}.sh . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.xbn +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xbn + +if test -n "$GENERATE_COMBRELOC_SCRIPT"; then + DATA_ALIGNMENT=${DATA_ALIGNMENT_c-${DATA_ALIGNMENT_}} + LD_FLAG=c + COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp + ( . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xc + rm -f ${COMBRELOC} + COMBRELOC= +fi if test -n "$GENERATE_SHLIB_SCRIPT"; then LD_FLAG=shared @@ -137,7 +159,17 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; the # Note that TEXT_START_ADDR is set to NONPAGED_TEXT_START_ADDR. ( . ${srcdir}/emulparams/${EMULATION_NAME}.sh . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.xs + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xs + if test -n "$GENERATE_COMBRELOC_SCRIPT"; then + LD_FLAG=cshared + DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} + COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp + ( . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsc + rm -f ${COMBRELOC} + COMBRELOC= + fi fi for i in $EMULATION_LIBPATH ; do diff -uprN binutils-2.11.90.0.27/ld/ld.h binutils-2.11.90.0.29/ld/ld.h --- binutils-2.11.90.0.27/ld/ld.h Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/ld.h Wed Aug 22 08:52:10 2001 @@ -223,7 +223,7 @@ typedef enum { lang_final_phase_enum } lang_phase_type; -extern boolean had_script; +extern FILE * saved_script_handle; extern boolean force_make_executable; /* Non-zero if we are processing a --defsym from the command line. */ diff -uprN binutils-2.11.90.0.27/ld/ld.texinfo binutils-2.11.90.0.29/ld/ld.texinfo --- binutils-2.11.90.0.27/ld/ld.texinfo Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/ld.texinfo Mon Aug 27 11:44:52 2001 @@ -840,7 +840,8 @@ for Solaris compatibility. @item -z @var{keyword} The recognized keywords are @code{initfirst}, @code{interpose}, @code{loadfltr}, @code{nodefaultlib}, @code{nodelete}, @code{nodlopen}, -@code{nodump}, @code{now} and @code{origin}. The other keywords are +@code{nodump}, @code{now}, @code{origin}, @code{combreloc} and +@code{nocombreloc}. The other keywords are ignored for Solaris compatibility. @code{initfirst} marks the object to be initialized first at runtime before any other objects. @code{interpose} marks the object that its symbol table interposes @@ -854,6 +855,9 @@ of this object will ignore any default l @code{now} marks the object with the non-lazy runtime binding. @code{origin} marks the object may contain $ORIGIN. @code{defs} disallows undefined symbols. +@code{combreloc} combines multiple reloc sections and sorts them +to make dynamic symbol lookup caching possible. +@code{nocombreloc} disables multiple reloc sections combining. @kindex -( @cindex groups of archives @@ -1265,7 +1269,7 @@ undefined symbols in the link. @kindex --sort-common This option tells @code{ld} to sort the common symbols by size when it places them in the appropriate output sections. First come all the one -byte symbols, then all the two bytes, then all the four bytes, and then +byte symbols, then all the two byte, then all the four byte, and then everything else. This is to prevent gaps between symbols due to alignment constraints. @@ -1339,7 +1343,7 @@ for compatibility with other linkers, yo @itemx --verbose Display the version number for @code{ld} and list the linker emulations supported. Display which input files can and cannot be opened. Display -the linker script if using a default builtin script. +the linker script being used by the linker. @kindex --version-script=@var{version-scriptfile} @cindex version script, symbol versions @@ -2781,16 +2785,16 @@ You may use the @code{FILL} command to s current section. It is followed by an expression in parentheses. Any otherwise unspecified regions of memory within the section (for example, gaps left due to the required alignment of input sections) are filled -with the two least significant bytes of the expression, repeated as +with the four least significant bytes of the expression, repeated as necessary. A @code{FILL} statement covers memory locations after the point at which it occurs in the section definition; by including more than one @code{FILL} statement, you can have different fill patterns in different parts of an output section. This example shows how to fill unspecified regions of memory with the -value @samp{0x9090}: +value @samp{0x90}: @smallexample -FILL(0x9090) +FILL(0x90909090) @end smallexample The @code{FILL} command is similar to the @samp{=@var{fillexp}} output @@ -3076,7 +3080,7 @@ You can set the fill pattern for an enti @samp{=@var{fillexp}}. @var{fillexp} is an expression (@pxref{Expressions}). Any otherwise unspecified regions of memory within the output section (for example, gaps left due to the required -alignment of input sections) will be filled with the two least +alignment of input sections) will be filled with the four least significant bytes of the value, repeated as necessary. You can also change the fill value with a @code{FILL} command in the @@ -3085,7 +3089,7 @@ output section commands; see @ref{Output Here is a simple example: @smallexample @group -SECTIONS @{ .text : @{ *(.text) @} =0x9090 @} +SECTIONS @{ .text : @{ *(.text) @} =0x90909090 @} @end group @end smallexample @@ -3728,7 +3732,7 @@ SECTIONS file2(.text) . += 1000; file3(.text) - @} = 0x1234; + @} = 0x12345678; @} @end smallexample @noindent @@ -3736,7 +3740,7 @@ In the previous example, the @samp{.text located at the beginning of the output section @samp{output}. It is followed by a 1000 byte gap. Then the @samp{.text} section from @file{file2} appears, also with a 1000 byte gap following before the -@samp{.text} section from @file{file3}. The notation @samp{= 0x1234} +@samp{.text} section from @file{file3}. The notation @samp{= 0x12345678} specifies what data to write in the gaps (@pxref{Output Section Fill}). @cindex dot inside sections diff -uprN binutils-2.11.90.0.27/ld/ldfile.c binutils-2.11.90.0.29/ld/ldfile.c --- binutils-2.11.90.0.27/ld/ldfile.c Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.29/ld/ldfile.c Wed Aug 22 08:52:10 2001 @@ -387,7 +387,7 @@ ldfile_find_command_file (name, extend) return result; } -FILE * +void ldfile_open_command_file (name) const char *name; { @@ -403,15 +403,15 @@ ldfile_open_command_file (name) name); } else - return NULL; + return; } lex_push_file (ldlex_input_stack, name); ldfile_input_filename = name; lineno = 1; - had_script = true; - return ldlex_input_stack; + + saved_script_handle = ldlex_input_stack; } #ifdef GNU960 diff -uprN binutils-2.11.90.0.27/ld/ldfile.h binutils-2.11.90.0.29/ld/ldfile.h --- binutils-2.11.90.0.27/ld/ldfile.h Wed Apr 25 15:54:15 2001 +++ binutils-2.11.90.0.29/ld/ldfile.h Wed Aug 22 08:52:10 2001 @@ -45,7 +45,7 @@ extern search_dirs_type *search_head; extern void ldfile_add_arch PARAMS ((CONST char *)); extern void ldfile_add_library_path PARAMS ((const char *, boolean cmdline, boolean append)); -extern FILE *ldfile_open_command_file PARAMS ((const char *name)); +extern void ldfile_open_command_file PARAMS ((const char *name)); extern void ldfile_open_file PARAMS ((struct lang_input_statement_struct *)); extern boolean ldfile_try_open_bfd PARAMS ((const char *, struct lang_input_statement_struct *)); diff -uprN binutils-2.11.90.0.27/ld/ldgram.y binutils-2.11.90.0.29/ld/ldgram.y --- binutils-2.11.90.0.27/ld/ldgram.y Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/ldgram.y Wed Aug 22 08:52:10 2001 @@ -50,7 +50,7 @@ static enum section_type sectype; lang_memory_region_type *region; boolean ldgram_want_filename = true; -boolean had_script = false; +FILE * saved_script_handle = NULL; boolean force_make_executable = false; boolean ldgram_in_script = false; diff -uprN binutils-2.11.90.0.27/ld/ldint.texinfo binutils-2.11.90.0.29/ld/ldint.texinfo --- binutils-2.11.90.0.27/ld/ldint.texinfo Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/ldint.texinfo Mon Aug 27 11:44:52 2001 @@ -239,7 +239,7 @@ If @code{SCRIPT_NAME} is set to @var{scr invoke @file{scripttempl/@var{script}.sc}. The @file{genscripts.sh} script will invoke the @file{scripttempl} -script 5 or 6 times. Each time it will set the shell variable +script 5 to 8 times. Each time it will set the shell variable @code{LD_FLAG} to a different value. When the linker is run, the options used will direct it to select a particular script. (Script selection is controlled by the @code{get_script} emulation entry point; @@ -278,6 +278,22 @@ this value if @code{GENERATE_SHLIB_SCRIP this script at the appropriate time, normally when the linker is invoked with the @code{-shared} option. The output has an extension of @file{.xs}. +@item c +The @file{scripttempl} script is only invoked with @code{LD_FLAG} set to +this value if @code{GENERATE_COMBRELOC_SCRIPT} is defined in the +@file{emulparams} file or if @code{SCRIPT_NAME} is @code{elf}. The +@file{emultempl} script must arrange to use this script at the appropriate +time, normally when the linker is invoked with the @code{-z combreloc} +option. The output has an extension of +@file{.xc}. +@item cshared +The @file{scripttempl} script is only invoked with @code{LD_FLAG} set to +this value if @code{GENERATE_COMBRELOC_SCRIPT} is defined in the +@file{emulparams} file or if @code{SCRIPT_NAME} is @code{elf} and +@code{GENERATE_SHLIB_SCRIPT} is defined in the @file{emulparms} file. +The @file{emultempl} script must arrange to use this script at the +appropriate time, normally when the linker is invoked with the @code{-shared +-z combreloc} option. The output has an extension of @file{.xsc}. @end table Besides the shell variables set by the @file{emulparams} script, and the @@ -301,6 +317,10 @@ page aligned, or to @samp{.} when genera @item CREATE_SHLIB This will be set to a non-empty string when generating a @code{-shared} script. + +@item COMBRELOC +This will be set to a non-empty string when generating @code{-z combreloc} +scripts to a temporary file name which can be used during script generation. @end table The conventional way to write a @file{scripttempl} script is to first diff -uprN binutils-2.11.90.0.27/ld/ldlang.c binutils-2.11.90.0.29/ld/ldlang.c --- binutils-2.11.90.0.27/ld/ldlang.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/ldlang.c Wed Aug 22 08:52:10 2001 @@ -119,12 +119,12 @@ static void print_statement static void print_statement_list PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *)); static void print_statements PARAMS ((void)); -static bfd_vma insert_pad +static void insert_pad PARAMS ((lang_statement_union_type **, fill_type, unsigned int, asection *, bfd_vma)); static bfd_vma size_input_section PARAMS ((lang_statement_union_type **, lang_output_section_statement_type *, - fill_type, bfd_vma, boolean)); + fill_type, bfd_vma)); static void lang_finish PARAMS ((void)); static void ignore_bfd_errors PARAMS ((const char *, ...)); static void lang_check PARAMS ((void)); @@ -377,7 +377,7 @@ lang_for_each_statement_worker (func, s) void (*func) PARAMS ((lang_statement_union_type *)); lang_statement_union_type *s; { - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { func (s); @@ -1012,11 +1012,11 @@ section_already_linked (abfd, sec, data) break; } - /* Set the output_section field so that wild_doit does not - create a lang_input_section structure for this section. - Since there might be a symbol in the section being - discarded, we must retain a pointer to the section which - we are really going to use. */ + /* Set the output_section field so that lang_add_section + does not create a lang_input_section structure for this + section. Since there might be a symbol in the section + being discarded, we must retain a pointer to the section + which we are really going to use. */ sec->output_section = bfd_abs_section_ptr; sec->kept_section = l->sec; @@ -1098,7 +1098,7 @@ wildcardp (pattern) input file which holds SECTION. */ void -wild_doit (ptr, section, output, file) +lang_add_section (ptr, section, output, file) lang_statement_list_type *ptr; asection *section; lang_output_section_statement_type *output; @@ -1259,7 +1259,7 @@ wild_sort (wild, sec, file, section) return NULL; section_name = bfd_get_section_name (file->the_bfd, section); - for (l = wild->children.head; l != NULL; l = l->next) + for (l = wild->children.head; l != NULL; l = l->header.next) { lang_input_section_type *ls; @@ -1372,31 +1372,31 @@ output_section_callback (ptr, sec, secti of the current list. */ if (before == NULL) - wild_doit (&ptr->children, section, - (lang_output_section_statement_type *) output, - file); + lang_add_section (&ptr->children, section, + (lang_output_section_statement_type *) output, + file); else { lang_statement_list_type list; lang_statement_union_type **pp; lang_list_init (&list); - wild_doit (&list, section, - (lang_output_section_statement_type *) output, - file); + lang_add_section (&list, section, + (lang_output_section_statement_type *) output, + file); /* If we are discarding the section, LIST.HEAD will be NULL. */ if (list.head != NULL) { - ASSERT (list.head->next == NULL); + ASSERT (list.head->header.next == NULL); for (pp = &ptr->children.head; *pp != before; - pp = &(*pp)->next) + pp = &(*pp)->header.next) ASSERT (*pp != NULL); - list.head->next = *pp; + list.head->header.next = *pp; *pp = list.head; } } @@ -1906,7 +1906,7 @@ open_input_bfds (s, force) lang_statement_union_type *s; boolean force; { - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { @@ -1967,8 +1967,8 @@ open_input_bfds (s, force) if (add.head != NULL) { - *add.tail = s->next; - s->next = add.head; + *add.tail = s->header.next; + s->header.next = add.head; } } break; @@ -2062,7 +2062,7 @@ map_input_to_output_sections (s, target, const char *target; lang_output_section_statement_type *output_section_statement; { - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { @@ -2513,7 +2513,7 @@ print_statement_list (s, os) while (s != NULL) { print_statement (s, os); - s = s->next; + s = s->header.next; } } @@ -2619,94 +2619,97 @@ dprint_statement (s, n) while (s && --n >= 0) { print_statement (s, abs_output_section); - s = s->next; + s = s->header.next; } } config.map_file = map_save; } -static bfd_vma -insert_pad (this_ptr, fill, power, output_section_statement, dot) - lang_statement_union_type **this_ptr; +static void +insert_pad (ptr, fill, alignment_needed, output_section, dot) + lang_statement_union_type **ptr; fill_type fill; - unsigned int power; - asection *output_section_statement; + unsigned int alignment_needed; + asection *output_section; bfd_vma dot; { - /* Align this section first to the - input sections requirement, then - to the output section's requirement. - If this alignment is > than any seen before, - then record it too. Perform the alignment by - inserting a magic 'padding' statement. */ - - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); - unsigned int alignment_needed = align_power (dot, power) - dot; + lang_statement_union_type *pad; - if (alignment_needed != 0) + pad = ((lang_statement_union_type *) + ((char *) ptr - offsetof (lang_statement_union_type, header.next))); + if (ptr != &statement_list.head + && pad->header.type == lang_padding_statement_enum + && pad->padding_statement.output_section == output_section) { - lang_statement_union_type *new = - ((lang_statement_union_type *) - stat_alloc (sizeof (lang_padding_statement_type))); - - /* Link into existing chain. */ - new->header.next = *this_ptr; - *this_ptr = new; - new->header.type = lang_padding_statement_enum; - new->padding_statement.output_section = output_section_statement; - new->padding_statement.output_offset = - dot - output_section_statement->vma; - new->padding_statement.fill = fill; - new->padding_statement.size = alignment_needed * opb; + /* Use the existing pad statement. The above test on output + section is probably redundant, but it doesn't hurt to check. */ } - - /* Remember the most restrictive alignment. */ - if (power > output_section_statement->alignment_power) + else { - output_section_statement->alignment_power = power; - } - output_section_statement->_raw_size += alignment_needed * opb; - - return dot + alignment_needed; + /* Make a new padding statement, linked into existing chain. */ + pad = ((lang_statement_union_type *) + stat_alloc (sizeof (lang_padding_statement_type))); + pad->header.next = *ptr; + *ptr = pad; + pad->header.type = lang_padding_statement_enum; + pad->padding_statement.output_section = output_section; + pad->padding_statement.fill = fill; + } + pad->padding_statement.output_offset = dot - output_section->vma; + pad->padding_statement.size = alignment_needed; + output_section->_raw_size += alignment_needed; } /* Work out how much this section will move the dot point. */ static bfd_vma -size_input_section (this_ptr, output_section_statement, fill, dot, relax) +size_input_section (this_ptr, output_section_statement, fill, dot) lang_statement_union_type **this_ptr; lang_output_section_statement_type *output_section_statement; fill_type fill; bfd_vma dot; - boolean relax ATTRIBUTE_UNUSED; { lang_input_section_type *is = &((*this_ptr)->input_section); asection *i = is->section; - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); if (is->ifile->just_syms_flag == false) { + unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, + ldfile_output_machine); + unsigned int alignment_needed; + asection *o; + + /* Align this section first to the input sections requirement, + then to the output section's requirement. If this alignment + is greater than any seen before, then record it too. Perform + the alignment by inserting a magic 'padding' statement. */ + if (output_section_statement->subsection_alignment != -1) - i->alignment_power = - output_section_statement->subsection_alignment; + i->alignment_power = output_section_statement->subsection_alignment; + + o = output_section_statement->bfd_section; + if (o->alignment_power < i->alignment_power) + o->alignment_power = i->alignment_power; + + alignment_needed = align_power (dot, i->alignment_power) - dot; - dot = insert_pad (this_ptr, fill, i->alignment_power, - output_section_statement->bfd_section, dot); + if (alignment_needed != 0) + { + insert_pad (this_ptr, fill, alignment_needed * opb, o, dot); + dot += alignment_needed; + } /* Remember where in the output section this input section goes. */ - i->output_offset = dot - output_section_statement->bfd_section->vma; + i->output_offset = dot - o->vma; /* Mark how big the output section must be to contain this now. */ if (i->_cooked_size != 0) dot += i->_cooked_size / opb; else dot += i->_raw_size / opb; - output_section_statement->bfd_section->_raw_size = - (dot - output_section_statement->bfd_section->vma) * opb; + o->_raw_size = (dot - o->vma) * opb; } else { @@ -2777,11 +2780,6 @@ _("%X%P: section %s [%V -> %V] overlaps } } -/* This variable indicates whether bfd_relax_section should be called - again. */ - -static boolean relax_again; - /* Make sure the new address is within the region. We explicitly permit the current address to be at the exact end of the region when the address is non-zero, in case the region is at the end of addressable memory and the @@ -2828,13 +2826,13 @@ lang_size_sections (s, output_section_st lang_statement_union_type **prev; fill_type fill; bfd_vma dot; - boolean relax; + boolean *relax; { unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); /* Size up the sections from their constituent parts. */ - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { @@ -2857,7 +2855,7 @@ lang_size_sections (s, output_section_st asection *input; if (os->children.head == NULL - || os->children.head->next != NULL + || os->children.head->header.next != NULL || os->children.head->header.type != lang_input_section_enum) einfo (_("%P%X: Internal error on COFF shared library section %s\n"), os->name); @@ -2947,9 +2945,8 @@ lang_size_sections (s, output_section_st os->bfd_section->output_offset = 0; } - (void) lang_size_sections (os->children.head, os, - &os->children.head, - os->fill, dot, relax); + lang_size_sections (os->children.head, os, &os->children.head, + os->fill, dot, relax); /* Put the section within the requested block size, or align at the block boundary. */ @@ -3020,8 +3017,7 @@ lang_size_sections (s, output_section_st dot = lang_size_sections (constructor_list.head, output_section_statement, &s->wild_statement.children.head, - fill, - dot, relax); + fill, dot, relax); break; case lang_data_statement_enum: @@ -3113,12 +3109,10 @@ lang_size_sections (s, output_section_st if (! bfd_relax_section (i->owner, i, &link_info, &again)) einfo (_("%P%F: can't relax section: %E\n")); if (again) - relax_again = true; + *relax = true; } - dot = size_input_section (prev, - output_section_statement, - output_section_statement->fill, - dot, relax); + dot = size_input_section (prev, output_section_statement, + output_section_statement->fill, dot); } break; case lang_input_statement_enum: @@ -3141,31 +3135,22 @@ lang_size_sections (s, output_section_st if (newdot != dot) { - /* The assignment changed dot. Insert a pad. */ if (output_section_statement == abs_output_section) { /* If we don't have an output section, then just adjust the default memory address. */ lang_memory_region_lookup ("*default*")->current = newdot; } - else if (!relax) + else { - lang_statement_union_type *new = - ((lang_statement_union_type *) - stat_alloc (sizeof (lang_padding_statement_type))); - - /* Link into existing chain. */ - new->header.next = *prev; - *prev = new; - new->header.type = lang_padding_statement_enum; - new->padding_statement.output_section = - output_section_statement->bfd_section; - new->padding_statement.output_offset = - dot - output_section_statement->bfd_section->vma; - new->padding_statement.fill = fill; - new->padding_statement.size = (newdot - dot) * opb; - output_section_statement->bfd_section->_raw_size += - new->padding_statement.size; + /* Insert a pad after this statement. We can't + put the pad before when relaxing, in case the + assignment references dot. */ + insert_pad (&s->header.next, fill, (newdot - dot) * opb, + output_section_statement->bfd_section, dot); + + /* Don't neuter the pad below when relaxing. */ + s = s->header.next; } dot = newdot; @@ -3174,16 +3159,12 @@ lang_size_sections (s, output_section_st break; case lang_padding_statement_enum: - /* If we are relaxing, and this is not the first pass, some - padding statements may have been inserted during previous - passes. We may have to move the padding statement to a new - location if dot has a different value at this point in this - pass than it did at this point in the previous pass. */ - s->padding_statement.output_offset = - dot - output_section_statement->bfd_section->vma; - dot += s->padding_statement.size / opb; - output_section_statement->bfd_section->_raw_size += - s->padding_statement.size; + /* If this is the first time lang_size_sections is called, + we won't have any padding statements. If this is the + second or later passes when relaxing, we should allow + padding to shrink. If padding is needed on this pass, it + will be added back in. */ + s->padding_statement.size = 0; break; case lang_group_statement_enum: @@ -3197,8 +3178,7 @@ lang_size_sections (s, output_section_st FAIL (); break; - /* This can only get here when relaxing is turned on. */ - + /* We can only get here when relaxing is turned on. */ case lang_address_statement_enum: break; } @@ -3217,7 +3197,7 @@ lang_do_assignments (s, output_section_s unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { @@ -3739,18 +3719,18 @@ lang_place_orphans () lang_output_section_statement_lookup (".bss"); } - wild_doit (&default_common_section->children, s, - default_common_section, file); + lang_add_section (&default_common_section->children, s, + default_common_section, file); } } else if (ldemul_place_orphan (file, s)) ; else { - lang_output_section_statement_type *os = - lang_output_section_statement_lookup (s->name); + lang_output_section_statement_type *os; - wild_doit (&os->children, s, os, file); + os = lang_output_section_statement_lookup (s->name); + lang_add_section (&os->children, s, os, file); } } } @@ -3982,6 +3962,7 @@ static void reset_memory_regions () { lang_memory_region_type *p = lang_memory_region_list; + asection *o; for (p = lang_memory_region_list; p != (lang_memory_region_type *) NULL; @@ -3990,6 +3971,9 @@ reset_memory_regions () p->old_length = (bfd_size_type) (p->current - p->origin); p->current = p->origin; } + + for (o = output_bfd->sections; o != NULL; o = o->next) + o->_raw_size = 0; } /* If the wild pattern was marked KEEP, the member sections @@ -4022,7 +4006,7 @@ static void lang_gc_sections_1 (s) lang_statement_union_type *s; { - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { @@ -4148,16 +4132,17 @@ lang_process () section positions, since they will affect SIZEOF_HEADERS. */ lang_record_phdrs (); + /* Size up the sections. */ + lang_size_sections (statement_list.head, + abs_output_section, + &statement_list.head, 0, (bfd_vma) 0, NULL); + /* Now run around and relax if we can. */ if (command_line.relax) { - /* First time round is a trial run to get the 'worst case' - addresses of the objects if there was no relaxing. */ - lang_size_sections (statement_list.head, - abs_output_section, - &(statement_list.head), 0, (bfd_vma) 0, false); - /* Keep relaxing until bfd_relax_section gives up. */ + boolean relax_again; + do { reset_memory_regions (); @@ -4178,17 +4163,11 @@ lang_process () globals are, so can make better guess. */ lang_size_sections (statement_list.head, abs_output_section, - &(statement_list.head), 0, (bfd_vma) 0, true); + &(statement_list.head), 0, (bfd_vma) 0, + &relax_again); } while (relax_again); } - else - { - /* Size up the sections. */ - lang_size_sections (statement_list.head, - abs_output_section, - &(statement_list.head), 0, (bfd_vma) 0, false); - } /* See if anything special should be done now we know how big everything is. */ diff -uprN binutils-2.11.90.0.27/ld/ldlang.h binutils-2.11.90.0.29/ld/ldlang.h --- binutils-2.11.90.0.27/ld/ldlang.h Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/ldlang.h Wed Aug 22 08:52:10 2001 @@ -290,7 +290,6 @@ typedef struct { typedef union lang_statement_union { lang_statement_header_type header; - union lang_statement_union *next; lang_wild_statement_type wild_statement; lang_data_statement_type data_statement; lang_reloc_statement_type reloc_statement; @@ -441,10 +440,10 @@ extern bfd_vma lang_size_sections PARAMS ((lang_statement_union_type *s, lang_output_section_statement_type *output_section_statement, lang_statement_union_type **prev, fill_type fill, - bfd_vma dot, boolean relax)); + bfd_vma dot, boolean *relax)); extern void lang_enter_group PARAMS ((void)); extern void lang_leave_group PARAMS ((void)); -extern void wild_doit +extern void lang_add_section PARAMS ((lang_statement_list_type *ptr, asection *section, lang_output_section_statement_type *output, lang_input_statement_type *file)); diff -uprN binutils-2.11.90.0.27/ld/ldmain.c binutils-2.11.90.0.29/ld/ldmain.c --- binutils-2.11.90.0.27/ld/ldmain.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/ld/ldmain.c Mon Aug 27 11:44:52 2001 @@ -245,6 +245,8 @@ main (argc, argv) link_info.flags = (bfd_vma) 0; link_info.flags_1 = (bfd_vma) 0; link_info.pei386_auto_import = false; + link_info.combreloc = false; + link_info.spare_dynamic_tags = 5; ldfile_add_arch (""); @@ -297,37 +299,21 @@ main (argc, argv) the -L's in argv have been processed. */ set_scripts_dir (); - if (had_script == false) + /* If we have not already opened and parsed a linker script + read the emulation's appropriate default script. */ + if (saved_script_handle == NULL) { - /* Read the emulation's appropriate default script. */ int isfile; - char *s = ldemul_get_script (&isfile); - FILE *script; + char *s = ldemul_get_script (& isfile); if (isfile) { - script = ldfile_open_command_file (s); - if (script) - { - if (trace_file_tries) - { - const int bsize = 8192; - char *buf = xmalloc (bsize); + ldfile_open_command_file (s); - info_msg (_("using external linker script:\n")); - info_msg ("==================================================\n"); - rewind (script); - while (fread (buf, 1, bsize, script) > 0) - info_msg (buf); - free (buf); - rewind (script); - info_msg ("\n==================================================\n"); - } - } - else + if (saved_script_handle == NULL) { /* We thought there was an external linker script. But - we couldn't find it. Let's try again for the internal + we couldn't find it. Let's try again for the internal one without command_line.multilib_dir. */ char *saved = command_line.multilib_dir; command_line.multilib_dir = NULL; @@ -344,22 +330,47 @@ main (argc, argv) } if (!isfile) - { - if (trace_file_tries) - { - info_msg (_("using internal linker script:\n")); - info_msg ("==================================================\n"); - info_msg (s); - info_msg ("\n==================================================\n"); - } + { lex_string = s; lex_redirect (s); } + parser_input = input_script; yyparse (); lex_string = NULL; } + if (trace_file_tries) + { + info_msg (_("using %s linker script:\n"), + saved_script_handle ? "external" : "internal"); + info_msg ("==================================================\n"); + + if (saved_script_handle) + { + static const int BSIZE = 8192; + size_t n; + char *buf = xmalloc (BSIZE); + + rewind (saved_script_handle); + while ((n = fread (buf, 1, BSIZE - 1, saved_script_handle)) > 0) + { + buf [n] = 0; + info_msg (buf); + } + rewind (saved_script_handle); + free (buf); + } + else + { + int isfile; + + info_msg (ldemul_get_script (& isfile)); + } + + info_msg ("\n==================================================\n"); + } + lang_final (); if (lang_has_input_file == false) diff -uprN binutils-2.11.90.0.27/ld/lexsup.c binutils-2.11.90.0.29/ld/lexsup.c --- binutils-2.11.90.0.27/ld/lexsup.c Tue Jun 19 11:57:59 2001 +++ binutils-2.11.90.0.29/ld/lexsup.c Mon Aug 27 11:44:52 2001 @@ -132,7 +132,8 @@ int parsing_defsym = 0; #define OPTION_TARGET_HELP (OPTION_UNIQUE + 1) #define OPTION_ALLOW_SHLIB_UNDEFINED (OPTION_TARGET_HELP + 1) #define OPTION_DISCARD_NONE (OPTION_ALLOW_SHLIB_UNDEFINED + 1) -#define OPTION_MULTILIB_DIR (OPTION_DISCARD_NONE + 1) +#define OPTION_SPARE_DYNAMIC_TAGS (OPTION_DISCARD_NONE + 1) +#define OPTION_MULTILIB_DIR (OPTION_SPARE_DYNAMIC_TAGS + 1) /* The long options. This structure is used for both the option parsing and the help text. */ @@ -353,6 +354,8 @@ static const struct ld_option ld_options '\0', NULL, N_("Sort common symbols by size"), TWO_DASHES }, { {"sort_common", no_argument, NULL, OPTION_SORT_COMMON}, '\0', NULL, NULL, NO_HELP }, + { {"spare-dynamic-tags", required_argument, NULL, OPTION_SPARE_DYNAMIC_TAGS}, + '\0', N_("COUNT"), N_("How many tags to reserve in .dynamic section"), TWO_DASHES }, { {"split-by-file", optional_argument, NULL, OPTION_SPLIT_BY_FILE}, '\0', N_("[=SIZE]"), N_("Split output sections every SIZE octets"), TWO_DASHES }, { {"split-by-reloc", optional_argument, NULL, OPTION_SPLIT_BY_RELOC}, @@ -1022,11 +1025,11 @@ the GNU General Public License. This pr version information. Read it, but don't assume that we've seen a linker script. */ { - boolean hold_had_script; + FILE * hold_script_handle; - hold_had_script = had_script; + hold_script_handle = saved_script_handle; ldfile_open_command_file (optarg); - had_script = hold_had_script; + saved_script_handle = hold_script_handle; parser_input = input_version_script; yyparse (); } @@ -1078,6 +1081,9 @@ the GNU General Public License. This pr case 'y': add_ysym (optarg); break; + case OPTION_SPARE_DYNAMIC_TAGS: + link_info.spare_dynamic_tags = strtoul (optarg, NULL, 0); + break; case OPTION_SPLIT_BY_RELOC: if (optarg != NULL) config.split_by_reloc = strtoul (optarg, NULL, 0); diff -uprN binutils-2.11.90.0.27/ld/mpw-elfmips.c binutils-2.11.90.0.29/ld/mpw-elfmips.c --- binutils-2.11.90.0.27/ld/mpw-elfmips.c Tue Jun 19 11:57:59 2001 +++ binutils-2.11.90.0.29/ld/mpw-elfmips.c Wed Aug 22 08:52:10 2001 @@ -605,7 +605,7 @@ gldelf32ebmip_place_orphan (file, s) if (hold_use != NULL) { /* We have already placed a section with this name. */ - wild_doit (&hold_use->children, s, hold_use, file); + lang_add_section (&hold_use->children, s, hold_use, file); return true; } @@ -618,7 +618,7 @@ gldelf32ebmip_place_orphan (file, s) && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0 && hold_text != NULL) { - wild_doit (&hold_text->children, s, hold_text, file); + lang_add_section (&hold_text->children, s, hold_text, file); return true; } @@ -693,7 +693,7 @@ gldelf32ebmip_place_orphan (file, s) (etree_type *) NULL); os = lang_output_section_statement_lookup (secname); - wild_doit (&os->children, s, os, file); + lang_add_section (&os->children, s, os, file); lang_leave_output_section_statement ((bfd_vma) 0, "*default*", diff -uprN binutils-2.11.90.0.27/ld/mpw-eppcmac.c binutils-2.11.90.0.29/ld/mpw-eppcmac.c --- binutils-2.11.90.0.27/ld/mpw-eppcmac.c Wed May 2 14:53:16 2001 +++ binutils-2.11.90.0.29/ld/mpw-eppcmac.c Wed Aug 22 08:52:10 2001 @@ -572,13 +572,13 @@ gldppcmacos_before_allocation () if (os == NULL) einfo (_("%P%F: can't find output section %s\n"), sec->output_section->name); - for (pls = &os->children.head; *pls != NULL; pls = &(*pls)->next) + for (pls = &os->children.head; *pls != NULL; pls = &(*pls)->header.next) { if ((*pls)->header.type == lang_input_section_enum && (*pls)->input_section.section == sec) { is = (lang_input_section_type *) *pls; - *pls = (*pls)->next; + *pls = (*pls)->header.next; break; } if ((*pls)->header.type == lang_wild_statement_enum) @@ -587,13 +587,13 @@ gldppcmacos_before_allocation () for (pwls = &(*pls)->wild_statement.children.head; *pwls != NULL; - pwls = &(*pwls)->next) + pwls = &(*pwls)->header.next) { if ((*pwls)->header.type == lang_input_section_enum && (*pwls)->input_section.section == sec) { is = (lang_input_section_type *) *pwls; - *pwls = (*pwls)->next; + *pwls = (*pwls)->header.next; break; } } diff -uprN binutils-2.11.90.0.27/ld/pe-dll.c binutils-2.11.90.0.29/ld/pe-dll.c --- binutils-2.11.90.0.27/ld/pe-dll.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/pe-dll.c Wed Aug 22 08:52:10 2001 @@ -1,5 +1,5 @@ /* Routines to help build PEI-format DLLs (Win32 etc) - Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by DJ Delorie This file is part of GLD, the Gnu Linker. @@ -260,6 +260,30 @@ static autofilter_entry_type autofilter_ #define U(str) (pe_details->underscored ? "_" str : str) +static int reloc_sort PARAMS ((const void *, const void *)); +static int pe_export_sort PARAMS ((const void *, const void *)); +static int auto_export PARAMS ((bfd *, def_file *, const char *)); +static void process_def_file PARAMS ((bfd *, struct bfd_link_info *)); +static void build_filler_bfd PARAMS ((int)); +static void generate_edata PARAMS ((bfd *, struct bfd_link_info *)); +static void fill_exported_offsets PARAMS ((bfd *, struct bfd_link_info *)); +static void fill_edata PARAMS ((bfd *, struct bfd_link_info *)); +static void generate_reloc PARAMS ((bfd *, struct bfd_link_info *)); +static void quoteput PARAMS ((char *, FILE *, int)); +static asection *quick_section PARAMS ((bfd *, const char *, int, int)); +static void quick_symbol + PARAMS ((bfd *, char *, char *, char *, asection *, int, int)); +static void quick_reloc PARAMS ((bfd *, int, int, int)); +static bfd *make_head PARAMS ((bfd *)); +static bfd *make_tail PARAMS ((bfd *)); +static bfd *make_one PARAMS ((def_file_export *, bfd *)); +static bfd *make_singleton_name_thunk PARAMS ((char *, bfd *)); +static char *make_import_fixup_mark PARAMS ((arelent *)); +static bfd *make_import_fixup_entry PARAMS ((char *, char *, char *, bfd *)); +static unsigned int pe_get16 PARAMS ((bfd *, int)); +static unsigned int pe_get32 PARAMS ((bfd *, int)); +static unsigned int pe_as32 PARAMS ((void *)); + void pe_dll_id_target (target) const char *target; @@ -2361,7 +2385,7 @@ pe_dll_fill_sections (abfd, info) /* Resize the sections. */ lang_size_sections (stat_ptr->head, abs_output_section, - &stat_ptr->head, 0, (bfd_vma) 0, false); + &stat_ptr->head, 0, (bfd_vma) 0, NULL); /* Redo special stuff. */ ldemul_after_allocation (); @@ -2395,7 +2419,7 @@ pe_exe_fill_sections (abfd, info) /* Resize the sections. */ lang_size_sections (stat_ptr->head, abs_output_section, - &stat_ptr->head, 0, (bfd_vma) 0, false); + &stat_ptr->head, 0, (bfd_vma) 0, NULL); /* Redo special stuff. */ ldemul_after_allocation (); diff -uprN binutils-2.11.90.0.27/ld/scripttempl/elf.sc binutils-2.11.90.0.29/ld/scripttempl/elf.sc --- binutils-2.11.90.0.27/ld/scripttempl/elf.sc Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/ld/scripttempl/elf.sc Mon Aug 27 11:44:52 2001 @@ -1,6 +1,6 @@ # # Unusual variables checked by this code: -# NOP - two byte opcode for no-op (defaults to 0) +# NOP - four byte opcode for no-op (defaults to 0) # DATA_ADDR - if end-of-text-plus-one-page isn't right for data start # INITIAL_READONLY_SECTIONS - at start of text segment # OTHER_READONLY_SECTIONS - other than .text .init .rodata ... @@ -145,6 +145,13 @@ SECTIONS .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } +EOF +if [ "x$COMBRELOC" = x ]; then + COMBRELOCCAT=cat +else + COMBRELOCCAT="cat > $COMBRELOC" +fi +eval $COMBRELOCCAT < ${DATA_MEMORY}} .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } ${RELOCATING+ > ${DATA_MEMORY}} + /* Java class registration support. */ + .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } ${RELOCATING+ >${DATA_MEMORY}} + ${RELOCATING+${CTOR}} ${RELOCATING+${DTOR}} diff -uprN binutils-2.11.90.0.27/ld/scripttempl/elfi370.sc binutils-2.11.90.0.29/ld/scripttempl/elfi370.sc --- binutils-2.11.90.0.27/ld/scripttempl/elfi370.sc Tue Sep 5 17:31:58 2000 +++ binutils-2.11.90.0.29/ld/scripttempl/elfi370.sc Wed Aug 22 08:52:10 2001 @@ -2,7 +2,7 @@ # This is just a raw copy of elfppc.sc and has not been otherwise modified # # Unusual variables checked by this code: -# NOP - two byte opcode for no-op (defaults to 0) +# NOP - four byte opcode for no-op (defaults to 0) # DATA_ADDR - if end-of-text-plus-one-page isn't right for data start # OTHER_READONLY_SECTIONS - other than .text .init .rodata ... # (e.g., .PARISC.milli) diff -uprN binutils-2.11.90.0.27/ld/scripttempl/elfm68hc11.sc binutils-2.11.90.0.29/ld/scripttempl/elfm68hc11.sc --- binutils-2.11.90.0.27/ld/scripttempl/elfm68hc11.sc Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/scripttempl/elfm68hc11.sc Wed Aug 22 08:52:10 2001 @@ -1,6 +1,6 @@ # # Unusual variables checked by this code: -# NOP - two byte opcode for no-op (defaults to 0) +# NOP - four byte opcode for no-op (defaults to 0) # DATA_ADDR - if end-of-text-plus-one-page isn't right for data start # OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ... # (e.g., .PARISC.global) @@ -331,7 +331,7 @@ SECTIONS .eh_frame ${RELOCATING-0} : { - *(.eh_frame) + KEEP (*(.eh_frame)) } ${RELOCATING+ > ${TEXT_MEMORY}} .rodata ${RELOCATING-0} : @@ -350,6 +350,11 @@ SECTIONS ${RELOCATING+${CTOR}} ${RELOCATING+${DTOR}} + .jcr ${RELOCATING-0} : + { + KEEP (*(.jcr)) + } ${RELOCATING+ > ${TEXT_MEMORY}} + /* Start of the data section image in ROM. */ ${RELOCATING+__data_image = .;} ${RELOCATING+PROVIDE (__data_image = .);} diff -uprN binutils-2.11.90.0.27/ld/scripttempl/elfm68hc12.sc binutils-2.11.90.0.29/ld/scripttempl/elfm68hc12.sc --- binutils-2.11.90.0.27/ld/scripttempl/elfm68hc12.sc Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/scripttempl/elfm68hc12.sc Wed Aug 22 08:52:10 2001 @@ -1,6 +1,6 @@ # # Unusual variables checked by this code: -# NOP - two byte opcode for no-op (defaults to 0) +# NOP - four byte opcode for no-op (defaults to 0) # DATA_ADDR - if end-of-text-plus-one-page isn't right for data start # OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ... # (e.g., .PARISC.global) @@ -331,7 +331,7 @@ SECTIONS .eh_frame ${RELOCATING-0} : { - *(.eh_frame) + KEEP (*(.eh_frame)) } ${RELOCATING+ > ${TEXT_MEMORY}} .rodata ${RELOCATING-0} : @@ -350,6 +350,11 @@ SECTIONS ${RELOCATING+${CTOR}} ${RELOCATING+${DTOR}} + .jcr ${RELOCATING-0} : + { + KEEP (*(.jcr)) + } ${RELOCATING+ > ${TEXT_MEMORY}} + /* Start of the data section image in ROM. */ ${RELOCATING+__data_image = .;} ${RELOCATING+PROVIDE (__data_image = .);} diff -uprN binutils-2.11.90.0.27/ld/scripttempl/nw.sc binutils-2.11.90.0.29/ld/scripttempl/nw.sc --- binutils-2.11.90.0.27/ld/scripttempl/nw.sc Thu Jun 3 11:02:11 1999 +++ binutils-2.11.90.0.29/ld/scripttempl/nw.sc Wed Aug 22 08:52:10 2001 @@ -1,6 +1,6 @@ # # Unusual variables checked by this code: -# NOP - two byte opcode for no-op (defaults to 0) +# NOP - four byte opcode for no-op (defaults to 0) # DATA_ADDR - if end-of-text-plus-one-page isn't right for data start # OTHER_READONLY_SECTIONS - other than .text .init .ctors .rodata ... # (e.g., .PARISC.milli) diff -uprN binutils-2.11.90.0.27/ld/scripttempl/v850.sc binutils-2.11.90.0.29/ld/scripttempl/v850.sc --- binutils-2.11.90.0.27/ld/scripttempl/v850.sc Tue Nov 7 16:30:53 2000 +++ binutils-2.11.90.0.29/ld/scripttempl/v850.sc Wed Aug 22 08:52:10 2001 @@ -115,6 +115,10 @@ SECTIONS KEEP (*crtend.o(.dtors)) ${CONSTRUCTING+___dtors_end = .;} } + .jcr : + { + KEEP (*(.jcr)) + } .got : { *(.got.plt) *(.got) } .dynamic : { *(.dynamic) } diff -uprN binutils-2.11.90.0.27/ld/testsuite/ChangeLog binutils-2.11.90.0.29/ld/testsuite/ChangeLog --- binutils-2.11.90.0.27/ld/testsuite/ChangeLog Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/testsuite/ChangeLog Mon Aug 27 11:44:52 2001 @@ -1,3 +1,17 @@ +2001-08-27 Alan Modra + Linus Nordberg + + * ld-checks/checks.exp: .lcomm is incompatible with ppc coff. + * ld-scripts/cross1.t: Add .toc section. + * ld-scripts/cross2.t: Likewise. + * ld-scripts/phdrs.exp: powerpc64 is 64 bit. + * ld-srec/srec.exp: xfail powerpc64 + +2001-08-21 John David Anglin + + * ld-selective/selective.exp: Return if target is `vax-*-ultrix*'. + Continue with other tests when there is a compilation error. + 2001-08-01 Loren J. Rittle * ld-cdtest/cdtest-nrv.dat: New file. diff -uprN binutils-2.11.90.0.27/ld/testsuite/ld-checks/checks.exp binutils-2.11.90.0.29/ld/testsuite/ld-checks/checks.exp --- binutils-2.11.90.0.27/ld/testsuite/ld-checks/checks.exp Sat Mar 17 12:48:15 2001 +++ binutils-2.11.90.0.29/ld/testsuite/ld-checks/checks.exp Mon Aug 27 11:44:52 2001 @@ -24,9 +24,10 @@ proc section_check {} { global srcdir global subdir - # The usage of .lcomm in asm.s is incompatible with ia64. - if { [istarget ia64-*-elf*] - || [istarget ia64-*-linux*] } { + # The usage of .lcomm in asm.s is incompatible with ia64 and ppc coff. + if { [istarget ia64-*-elf*] || [istarget ia64-*-linux*] + || [istarget powerpc*-*-aix*] || [istarget powerpc-*-beos*] + || [istarget rs6000-*-*] } { return } set test "check sections 1" diff -uprN binutils-2.11.90.0.27/ld/testsuite/ld-scripts/cross1.t binutils-2.11.90.0.29/ld/testsuite/ld-scripts/cross1.t --- binutils-2.11.90.0.27/ld/testsuite/ld-scripts/cross1.t Thu Jun 3 11:02:11 1999 +++ binutils-2.11.90.0.29/ld/testsuite/ld-scripts/cross1.t Mon Aug 27 11:44:52 2001 @@ -1,6 +1,7 @@ NOCROSSREFS ( .text .data ) SECTIONS { + .toc : { *(.toc) } .text : { tmpdir/cross1.o } .data : { tmpdir/cross2.o } } diff -uprN binutils-2.11.90.0.27/ld/testsuite/ld-scripts/cross2.t binutils-2.11.90.0.29/ld/testsuite/ld-scripts/cross2.t --- binutils-2.11.90.0.27/ld/testsuite/ld-scripts/cross2.t Fri Mar 9 11:18:30 2001 +++ binutils-2.11.90.0.29/ld/testsuite/ld-scripts/cross2.t Mon Aug 27 11:44:52 2001 @@ -2,5 +2,5 @@ NOCROSSREFS ( .text .data ) SECTIONS { .text : { *(.text) *(.text.*) *(.pr) } - .data : { *(.data) *(.data.*) *(.sdata) *(.rw) *(.tc0) *(.tc) } + .data : { *(.data) *(.data.*) *(.sdata) *(.rw) *(.tc0) *(.tc) *(.toc) } } diff -uprN binutils-2.11.90.0.27/ld/testsuite/ld-scripts/phdrs.exp binutils-2.11.90.0.29/ld/testsuite/ld-scripts/phdrs.exp --- binutils-2.11.90.0.27/ld/testsuite/ld-scripts/phdrs.exp Thu May 24 22:45:37 2001 +++ binutils-2.11.90.0.29/ld/testsuite/ld-scripts/phdrs.exp Mon Aug 27 11:44:52 2001 @@ -49,7 +49,8 @@ set phdrs_regexp \ # On a 64 bit ELF format, we need different numbers. if { [istarget alpha*-*-*] || [istarget "ia64*-*-*"] || [istarget "hppa*64*-*-*"] || [istarget "x86_64*-*-*"] - || [istarget "s390x*-*-*"] || [istarget "sparc64*-*-*"]} then { + || [istarget "s390x*-*-*"] || [istarget "sparc64*-*-*"] + || [istarget "powerpc64*-*-*"] || [istarget "*-*-*elf64*"] } then { set phdrs_regexp \ ".*Program Header:.*PHDR *off *0x00*40 *vaddr *0x00*800040 *paddr *0x00*800040.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* flags r--.*LOAD *off *0x00* *vaddr *0x00*800000 *paddr *0x00*800000.*filesz *0x00*\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags r-x.*LOAD *off *0x0\[0-9a-f\]* *vaddr *0x00*80*\[0-9a-f\]* *paddr *0x00*80*\[0-9a-f\]*.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags *rw-.*" } diff -uprN binutils-2.11.90.0.27/ld/testsuite/ld-selective/selective.exp binutils-2.11.90.0.29/ld/testsuite/ld-selective/selective.exp --- binutils-2.11.90.0.27/ld/testsuite/ld-selective/selective.exp Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/testsuite/ld-selective/selective.exp Mon Aug 27 11:44:52 2001 @@ -19,6 +19,11 @@ # Make sure that constructors are handled correctly. +# AOUT based ports do not support selective linking +if {[istarget "vax-*-ultrix*"]} { + return +} + # COFF based ports do not support selective linking if {[istarget "*-*-coff"]} { return @@ -38,12 +43,12 @@ if {[istarget "*-*-pe"]} { # # FIXME: Instead of table, read settings from each source-file. set seltests { - {selective1 C 1.c {} {} {dropme1 dropme2} {alpha*-*}} - {selective2 C 2.c {} {} {foo} {alpha*-* mips*-*}} - {selective3 C 2.c {-u foo} {foo} {{foo 0}} {mips*-*}} - {selective4 C++ 3.cc {} {start a A::foo() B::foo()} {A::bar()} {alpha*-* mips*-*}} - {selective5 C++ 4.cc {} {start a A::bar()} {A::foo() B::foo()} {alpha*-* mips*-*}} - {selective6 C++ 5.cc {} {start a A::bar()} + {selective1 C 1.c {} {} {dropme1 dropme2} {alpha*-*}} + {selective2 C 2.c {} {} {foo} {alpha*-* mips*-*}} + {selective3 C 2.c {-u foo} {foo} {{foo 0}} {mips*-*}} + {selective4 C++ 3.cc {} {start a A::foo() B::foo()} {A::bar()} {alpha*-* mips*-*}} + {selective5 C++ 4.cc {} {start a A::bar()} {A::foo() B::foo()} {alpha*-* mips*-*}} + {selective6 C++ 5.cc {} {start a A::bar()} {A::foo() B::foo() dropme1() dropme2()} {*-*-*}} } @@ -88,7 +93,7 @@ foreach testitem $seltests { # leave as is. if { ![ld_compile "$CC $testflags" $srcdir/$subdir/$testfile $objfile] } { unresolved $testname - return + continue } # V850 targets need libgcc.a diff -uprN binutils-2.11.90.0.27/ld/testsuite/ld-srec/srec.exp binutils-2.11.90.0.29/ld/testsuite/ld-srec/srec.exp --- binutils-2.11.90.0.27/ld/testsuite/ld-srec/srec.exp Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/ld/testsuite/ld-srec/srec.exp Mon Aug 27 11:44:52 2001 @@ -282,6 +282,9 @@ proc run_srec_test { test objs } { if { ![ld_simple_link $ld tmpdir/sr1 "$flags $objs"] \ || ![ld_simple_link $ld tmpdir/sr2.sr "$flags --oformat srec $objs"] } { + # PowerPc64 srec linker can't handle .toc relocations. + setup_xfail "powerpc64*-*-*" + setup_xfail "powerpc*-*-*64*" setup_xfail "hppa*-*-*elf*" fail $test return diff -uprN binutils-2.11.90.0.27/libiberty/ChangeLog binutils-2.11.90.0.29/libiberty/ChangeLog --- binutils-2.11.90.0.27/libiberty/ChangeLog Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/libiberty/ChangeLog Mon Aug 27 11:44:52 2001 @@ -1,3 +1,75 @@ +2001-08-23 Ulrich Drepper + + * regex.c (truncate_wchar): Use wcrtomb not wctomb. + +2001-08-23 Ulrich Drepper + + * posix/regex.c [_LIBC] (convert_mbs_to_wcs): Use __mbrtowc + instead of mbrtowc. + [_LIBC]: Use __iswctype instead of iswctype, __wcslen instead of + wcslen, and __wcscoll instead of wcscoll. + +2001-08-22 Matt Kraai + + * fibheap.c (fibheap_init, fibnode_init): Remove. + (fibheap_new, fibnode_new): Use xcalloc to allocate and + initialize memory. + (fibheap_insert): Remove check for node allocation failure. + +2001-08-21 Richard Henderson + + * Makefile.in (fibheap.o): Depend on config.h. + * fibheap.c: Tidy formatting. Use config.h.` Rearrange some + functions for inlining. + +Tue Aug 21 12:35:04 2001 Christopher Faylor + + * configure.in: Need to set HAVE_SYS_ERRLIST and HAVE_SYS_NERR whenever + hosting on cygwin. + * configure: Regenerate. + +2001-08-20 Daniel Berlin + + * fibheap.c: New file. Fibonacci heap. + + * Makefile.in (CFILES): Add fibheap.c. + (REQUIRED_OFILES): Add fibheap.o. + (fibheap.o): Add dependencies for fibheap.o. + +2001-08-20 Andrew Cagney + + * floatformat.c (floatformat_m88110_ext): Remove #ifdef + HARRIS_FLOAT_FORMAT. + (floatformat_ia64_spill_little, floatformat_ia64_quad_little) + (floatformat_ia64_spill_big, floatformat_ia64_quad_big) + (floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword) + (floatformat_m88110_harris_ext): New float formats. + +2001-08-17 Christopher Faylor + + * configure.in: Always set HAVE_SYS_ERRLIST when targetting cygwin. + * configure: Regenerate. + +2001-08-16 Richard Henderson + + * hashtab.c (htab_hash_string): New. + +2001-08-13 Andrew Cagney + + * floatformat.c (floatformat_ieee_double_littlebyte_bigword): Fix + name. + +2001-08-12 Isamu Hasegawa + + * regex.c (wcs_regex_compile): Use appropriate string + to compare with collating element. + Fix the padding for the alignment. + +2001-08-10 Andrew Cagney + + * lbasename.c (lbasename): Change function definition to return a + const char pointer. + 2001-08-07 Jason Merrill * cp-demangle.c (demangle_special_name): "GR" -> "reference temporary @@ -9,6 +81,10 @@ 2001-07-30 Andreas Jaeger + * concat.c: Include "config.h". + +2001-07-30 Andreas Jaeger + * regex.c: Declare wcs functions only if compiling with MBS_SUPPORT. Don't use #elif for traditional C. @@ -158,7 +234,7 @@ * libiberty/lbasename.c: New file. * libiberty/Makefile.in: Update for lbasename. - + 2001-03-06 Zack Weinberg * aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New. @@ -186,6 +262,10 @@ * cplus-dem.c (main): Initialize style. +2001-02-02 Phil Edwards + + * COPYING.LIB: Update to LGPL 2.1 from the FSF. + 2001-01-31 Bryce McKinlay Add support for Java demangling under the v3 ABI: @@ -208,10 +288,6 @@ parameter in cplus_demangle flags as gdb does. * testsuite/demangle.expected: Add some Java test cases. -2001-01-29 Phil Edwards - - * COPYING.LIB: Update to LGPL 2.1 from the FSF. - 2000-12-29 DJ Delorie * fnmatch.c: Make the note about the origins of this file more @@ -325,12 +401,12 @@ 2000-11-04 Hans-Peter Nilsson * hashtab.c (htab_expand): Change to return int. Use calloc or - xcalloc depending on htab->return_allocation_failure. Return zero - if calloc fails. + xcalloc depending on htab->return_allocation_failure. Return zero + if calloc fails. (htab_create): Update comment to cover memory allocation. (htab_try_create): New. (htab_find_slot_with_hash): Return NULL if htab_expand fails. - Update comment to cover this. + Update comment to cover this. 2000-11-03 Hans-Peter Nilsson @@ -833,7 +909,7 @@ Tue May 30 15:07:52 2000 Jeffrey A Law 2000-05-23 Mike Stump * Makefile.in (xmalloc.o): Add dependency for config.h, fixes make - -j3. + -j3. 2000-05-18 J. David Anglin @@ -1466,9 +1542,9 @@ Tue Dec 22 09:43:35 1998 Kaveh R. Ghazi * choose-temp.c: Include stdlib.h. * cplus-dem.c (demangle_arm_pt): Remove unused prototype. - (snarf_numeric_literal): Constify first parameter. - (code_for_qualifier): Avoid a gcc extension, make the parameter an - int, not a char. + (snarf_numeric_literal): Constify first parameter. + (code_for_qualifier): Avoid a gcc extension, make the parameter an + int, not a char. (demangle_qualifier): Likewise. (demangle_signature): Cast the argument of a ctype function to unsigned char. @@ -1481,11 +1557,11 @@ Tue Dec 22 09:43:35 1998 Kaveh R. Ghazi Cast the argument of a ctype function to unsigned char. * floatformat.c (floatformat_to_double): Add explicit braces to - avoid ambiguous `else'. + avoid ambiguous `else'. * fnmatch.c (fnmatch): Change type of variables `c', `c1', - `cstart' and `cend' to unsigned char. Cast the argument of macro - `FOLD', which uses ctype functions, to unsigned char. + `cstart' and `cend' to unsigned char. Cast the argument of macro + `FOLD', which uses ctype functions, to unsigned char. * objalloc.c (free): Add prototype. @@ -1496,7 +1572,7 @@ Sun Dec 20 16:03:46 1998 Hans-Peter Nil Fri Dec 18 17:50:18 1998 David Taylor * cplus-dem.c (demangle_arm_pt): remove declaration -- function - doesn't exist. + doesn't exist. (do_hpacc_template_literal): remove unused variable `i'. Fri Dec 18 16:11:43 EST 1998 Andrew MacLeod @@ -1540,48 +1616,48 @@ Fri Dec 4 13:51:04 1998 David Taylor * HP aCC demangling support. * cplus-dem.c (main): Remove default to HP style demangling, set to EDG - demangling correctly when -edg specified; set the demangling style - when user specifies 'edg'. Set strip_underscore to - prepends_underscore, if not HPUXHPPA. Set - current_demangling_style to hp_demangling if HPUXHPPA. Set - current demangling style correctly if the switch is hp. Read - label correctly also in the HP style case. + demangling correctly when -edg specified; set the demangling style + when user specifies 'edg'. Set strip_underscore to + prepends_underscore, if not HPUXHPPA. Set + current_demangling_style to hp_demangling if HPUXHPPA. Set + current demangling style correctly if the switch is hp. Read + label correctly also in the HP style case. (work_stuff): add temp_start field; add field for volatile member - function. + function. (arm_pt): handle ARM_DEMANGLING and EDG_DEMANGLING styles; HP - style for this case is the same as ARM. + style for this case is the same as ARM. (demangle_args): handle EDG_DEMANGLING style; support HP style. (demangle_arm_hp_template): new function. (It was - demangle_arm_pt.); check and set value of temp_start field in - multiple places. Also, when ceching for end of template args, - check to see if at end of static member of template class. + demangle_arm_pt.); check and set value of temp_start field in + multiple places. Also, when ceching for end of template args, + check to see if at end of static member of template class. (demangle_class): new local variable : save_class_name_end Don't - include template args in string defining class. + include template args in string defining class. (demangle_class_name): use demangel_arm_hp_template. (demangle_function_name): handle case where demangling style is - HP_DEMANGLING and currently point at an 'X' in the mangled name. - Handle EDG_DEMANGLING style. Handle constructor and destructor - ops for HP style. + HP_DEMANGLING and currently point at an 'X' in the mangled name. + Handle EDG_DEMANGLING style. Handle constructor and destructor + ops for HP style. (demangle_prefix): handle EDG_DEMANGLING and ARM_DEMANGLING - styles. global destructor and constructor for HP style are same - as for ARM style. Same for local variables. + styles. global destructor and constructor for HP style are same + as for ARM style. Same for local variables. (demangle_qualified): handle EDG_DEMANGLING style. (demangle_signature): add case for volatile member function. For - cases '1' - '9' : initialize the temp_start field to -1 and handle - the EDG_DEMANGLING style. for case 'F' : handle EDG_DEMANGLING - and AUTO_DEMANGLING styles. If expecting a function and managed - to demangle the funct args, then handle the LUCID_DEMANGLING, - ARM_DEMANGLING, and EDG_DEMANGLING styles. Add case for local - class name after "Lnnn_ in HP style case. HP style too needs to - forget types. _nnn is OK for HP style, so don't report failure. + cases '1' - '9' : initialize the temp_start field to -1 and handle + the EDG_DEMANGLING style. for case 'F' : handle EDG_DEMANGLING + and AUTO_DEMANGLING styles. If expecting a function and managed + to demangle the funct args, then handle the LUCID_DEMANGLING, + ARM_DEMANGLING, and EDG_DEMANGLING styles. Add case for local + class name after "Lnnn_ in HP style case. HP style too needs to + forget types. _nnn is OK for HP style, so don't report failure. (do_hpacc_template_const_value): new function. Handle template's - value param for HP/aCC. + value param for HP/aCC. (do_hpacc_template_literal): new function. Handle a template's - literal parameter for HP aCC. + literal parameter for HP aCC. (recursively_demangle): new function (snarf_numeric_literal): new function. (usage): add 'edg' to the list of demangling styles; add hp switch - to message. + to message. Sat Nov 28 17:25:22 1998 Christopher Faylor @@ -1663,13 +1739,13 @@ Mon Nov 2 15:05:33 1998 Geoffrey Noer Mon Nov 2 10:22:01 1998 Kaveh R. Ghazi * pexecute.c: Check HAVE_CONFIG_H, not IN_GCC, when determining - whether to include config.h. Possibly include unistd.h in the - !IN_GCC case. Define VFORK_STRING as a printable function call - for error messages (either "vfork" or "fork".) If HAVE_VFORK_H is - defined, include vfork.h. If VMS is defined, define vfork() - appropriately. Remove vfork check on USG, we're using autoconf. - (pexecute): Set `errmsg_fmt' to VFORK_STRING instead of checking - locally what string to use. + whether to include config.h. Possibly include unistd.h in the + !IN_GCC case. Define VFORK_STRING as a printable function call + for error messages (either "vfork" or "fork".) If HAVE_VFORK_H is + defined, include vfork.h. If VMS is defined, define vfork() + appropriately. Remove vfork check on USG, we're using autoconf. + (pexecute): Set `errmsg_fmt' to VFORK_STRING instead of checking + locally what string to use. 1998-10-26 Mark Mitchell @@ -1775,8 +1851,8 @@ Thu Oct 8 23:42:08 1998 Jeffrey A Law Mon Sep 7 23:29:01 1998 Kaveh R. Ghazi * mkstemp.c: Include config.h even when not IN_GCC. Wrap header - inclusions inside HAVE_*_H macros. Include ansidecl.h when not - IN_GCC. + inclusions inside HAVE_*_H macros. Include ansidecl.h when not + IN_GCC. * vasprintf.c: Include stdarg.h/varargs.h first. @@ -2090,7 +2166,7 @@ Mon May 4 13:00:28 1998 Ian Lance Tayl * config/mh-sysv4 (RANLIB, INSTALL): Don't define. * config.table: Change config_shell to CONFIG_SHELL, and use libiberty_topdir to find move-if-change. - (m68k-apollo-bsd*, m68k-apollo-sysv*): Remove. + (m68k-apollo-bsd*, m68k-apollo-sysv*): Remove. (i[3456]86-ncr-sysv4*, *-*-dgux*, hppa*-hp-bsd*): Remove. (*-*-irix*, *-*-m88kbcs*, *-*-sysv*): Remove. * Makefile.in (srcdir): Set to @srcdir@. @@ -2307,7 +2383,7 @@ Wed Sep 24 00:31:59 1997 Felix Lee @@ -4349,7 +4425,7 @@ Thu Jan 30 22:48:41 1992 Stu Grossman Mon Jan 20 18:53:23 1992 Stu Grossman (grossman at cygnus.com) - * getopt.c, getopt1.c, ../include/getopt.h: Get latest versions. + * getopt.c, getopt1.c, ../include/getopt.h: Get latest versions. Sat Jan 18 16:53:01 1992 Fred Fish (fnf at cygnus.com) diff -uprN binutils-2.11.90.0.27/libiberty/Makefile.in binutils-2.11.90.0.29/libiberty/Makefile.in --- binutils-2.11.90.0.27/libiberty/Makefile.in Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/libiberty/Makefile.in Mon Aug 27 11:44:52 2001 @@ -134,7 +134,7 @@ CFILES = asprintf.c alloca.c argv.c atex strncasecmp.c strchr.c strdup.c strerror.c strncmp.c strrchr.c \ strsignal.c strstr.c strtod.c strtol.c strtoul.c tmpnam.c vasprintf.c \ vfork.c vfprintf.c vprintf.c vsprintf.c waitpid.c xatexit.c xexit.c \ - xmalloc.c xmemdup.c xstrdup.c xstrerror.c ternary.c + xmalloc.c xmemdup.c xstrdup.c xstrerror.c ternary.c fibheap.c # These are always included in the library. REQUIRED_OFILES = argv.o alloca.o choose-temp.o concat.o cplus-dem.o \ @@ -143,7 +143,7 @@ REQUIRED_OFILES = argv.o alloca.o choose md5.o make-temp-file.o objalloc.o \ obstack.o partition.o pexecute.o regex.o safe-ctype.o sort.o spaces.o \ splay-tree.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o \ - xmemdup.o xstrdup.o xstrerror.o ternary.o + xmemdup.o xstrdup.o xstrerror.o ternary.o fibheap.o $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) -rm -f $(TARGETLIB) @@ -266,6 +266,7 @@ cplus-dem.o: config.h $(INCDIR)/demangle cp-demangle.o: config.h $(INCDIR)/dyn-string.h $(INCDIR)/demangle.h dyn-string.o: config.h $(INCDIR)/dyn-string.h fdmatch.o: $(INCDIR)/libiberty.h +fibheap.o: config.h $(INCDIR)/libiberty.h $(INCDIR)/fibheap.h fnmatch.o: config.h $(INCDIR)/fnmatch.h getcwd.o: config.h getopt.o: config.h $(INCDIR)/getopt.h diff -uprN binutils-2.11.90.0.27/libiberty/configure binutils-2.11.90.0.29/libiberty/configure --- binutils-2.11.90.0.27/libiberty/configure Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.29/libiberty/configure Mon Aug 27 11:44:52 2001 @@ -1482,12 +1482,12 @@ if test "x" = "y"; then for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1485: checking for $ac_func" >&5 +echo "configure:1486: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1537,12 +1537,12 @@ done for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1540: checking for $ac_func" >&5 +echo "configure:1541: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1592,12 +1592,12 @@ done for ac_func in memmove memset putenv random rename rindex sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1595: checking for $ac_func" >&5 +echo "configure:1596: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1647,12 +1647,12 @@ done for ac_func in strcasecmp setenv strchr strdup strncasecmp strrchr strstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1650: checking for $ac_func" >&5 +echo "configure:1651: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1702,12 +1702,12 @@ done for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1705: checking for $ac_func" >&5 +echo "configure:1706: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1757,12 +1757,12 @@ done for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1760: checking for $ac_func" >&5 +echo "configure:1761: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1812,12 +1812,12 @@ done for ac_func in sysconf times sbrk gettimeofday ffs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1815: checking for $ac_func" >&5 +echo "configure:1816: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1933,6 +1933,19 @@ fi +case "${host}" in + *-*-cygwin*) + cat >> confdefs.h <<\EOF +#define HAVE_SYS_ERRLIST 1 +EOF + + cat >> confdefs.h <<\EOF +#define HAVE_SYS_NERR 1 +EOF + + ;; +esac + if test -z "${setobjs}"; then case "${host}" in @@ -2024,7 +2037,7 @@ if test -z "${setobjs}"; then # We haven't set the list of objects yet. Use the standard autoconf # tests. This will only work if the compiler works. echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2027: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2041: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2035,12 +2048,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2038 "configure" +#line 2052 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2066,19 +2079,19 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2069: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2083: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross for ac_func in $funcs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2076: checking for $ac_func" >&5 +echo "configure:2090: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2128,12 +2141,12 @@ done echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2131: checking whether alloca needs Cray hooks" >&5 +echo "configure:2145: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2161: checking for $ac_func" >&5 +echo "configure:2175: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2212,7 +2225,7 @@ fi fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2215: checking stack direction for C alloca" >&5 +echo "configure:2229: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2220,7 +2233,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2260,12 +2273,12 @@ EOF echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2263: checking for ANSI C header files" >&5 +echo "configure:2277: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2273,7 +2286,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2290,7 +2303,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2308,7 +2321,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2329,7 +2342,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2340,7 +2353,7 @@ if (XOR (islower (i), ISLOWER (i)) || to exit (0); } EOF -if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2364,12 +2377,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2367: checking for pid_t" >&5 +echo "configure:2381: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2398,17 +2411,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2401: checking for vfork.h" >&5 +echo "configure:2415: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2433,18 +2446,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2436: checking for working vfork" >&5 +echo "configure:2450: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:2442: checking for vfork" >&5 +echo "configure:2456: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -2489,7 +2502,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -2584,7 +2597,7 @@ main() { } } EOF -if { (eval echo configure:2587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -2611,19 +2624,19 @@ fi fi for v in $vars; do echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:2614: checking for $v" >&5 +echo "configure:2628: checking for $v" >&5 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "libiberty_cv_var_$v=yes" else @@ -2649,12 +2662,12 @@ EOF for ac_func in $checkfuncs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2652: checking for $ac_func" >&5 +echo "configure:2666: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2707,17 +2720,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2710: checking for $ac_hdr" >&5 +echo "configure:2724: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2746,12 +2759,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2749: checking for $ac_func" >&5 +echo "configure:2763: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2799,7 +2812,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2802: checking for working mmap" >&5 +echo "configure:2816: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2807,7 +2820,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2971,7 +2984,7 @@ fi echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 -echo "configure:2974: checking for working strncmp" >&5 +echo "configure:2988: checking for working strncmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2979,7 +2992,7 @@ else ac_cv_func_strncmp_works=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strncmp_works=yes else diff -uprN binutils-2.11.90.0.27/libiberty/configure.in binutils-2.11.90.0.29/libiberty/configure.in --- binutils-2.11.90.0.27/libiberty/configure.in Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.29/libiberty/configure.in Mon Aug 27 11:44:52 2001 @@ -202,6 +202,13 @@ fi AC_SUBST(CHECK) +case "${host}" in + *-*-cygwin*) + AC_DEFINE(HAVE_SYS_ERRLIST) + AC_DEFINE(HAVE_SYS_NERR) + ;; +esac + if test -z "${setobjs}"; then case "${host}" in diff -uprN binutils-2.11.90.0.27/libiberty/fibheap.c binutils-2.11.90.0.29/libiberty/fibheap.c --- binutils-2.11.90.0.27/libiberty/fibheap.c Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.29/libiberty/fibheap.c Mon Aug 27 11:44:52 2001 @@ -0,0 +1,523 @@ +/* A Fibonacci heap datatype. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by Daniel Berlin (dan@cgsoftware.com). + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#ifdef HAVE_LIMITS_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#include "libiberty.h" +#include "fibheap.h" + + +#define FIBHEAPKEY_MIN LONG_MIN + +static void fibheap_ins_root PARAMS ((fibheap_t, fibnode_t)); +static void fibheap_rem_root PARAMS ((fibheap_t, fibnode_t)); +static void fibheap_consolidate PARAMS ((fibheap_t)); +static void fibheap_link PARAMS ((fibheap_t, fibnode_t, fibnode_t)); +static void fibheap_cut PARAMS ((fibheap_t, fibnode_t, fibnode_t)); +static void fibheap_cascading_cut PARAMS ((fibheap_t, fibnode_t)); +static fibnode_t fibheap_extr_min_node PARAMS ((fibheap_t)); +static int fibheap_compare PARAMS ((fibheap_t, fibnode_t, fibnode_t)); +static int fibheap_comp_data PARAMS ((fibheap_t, fibheapkey_t, void *, + fibnode_t)); +static fibnode_t fibnode_new PARAMS ((void)); +static void fibnode_insert_after PARAMS ((fibnode_t, fibnode_t)); +#define fibnode_insert_before(a, b) fibnode_insert_after (a->left, b) +static fibnode_t fibnode_remove PARAMS ((fibnode_t)); + + +/* Create a new fibonacci heap. */ +fibheap_t +fibheap_new () +{ + return (fibheap_t) xcalloc (1, sizeof (struct fibheap)); +} + +/* Create a new fibonacci heap node. */ +static fibnode_t +fibnode_new () +{ + fibnode_t node; + + node = xcalloc (1, sizeof *node); + node->left = node; + node->right = node; + + return node; +} + +static inline int +fibheap_compare (heap, a, b) + fibheap_t heap ATTRIBUTE_UNUSED; + fibnode_t a; + fibnode_t b; +{ + if (a->key < b->key) + return -1; + if (a->key > b->key) + return 1; + return 0; +} + +static inline int +fibheap_comp_data (heap, key, data, b) + fibheap_t heap; + fibheapkey_t key; + void *data; + fibnode_t b; +{ + struct fibnode a; + + a.key = key; + a.data = data; + + return fibheap_compare (heap, &a, b); +} + +/* Insert DATA, with priority KEY, into HEAP. */ +fibnode_t +fibheap_insert (heap, key, data) + fibheap_t heap; + fibheapkey_t key; + void *data; +{ + fibnode_t node; + + /* Create the new node. */ + node = fibnode_new (); + + /* Set the node's data. */ + node->data = data; + node->key = key; + + /* Insert it into the root list. */ + fibheap_ins_root (heap, node); + + /* If their was no minimum, or this key is less than the min, + it's the new min. */ + if (heap->min == NULL || node->key < heap->min->key) + heap->min = node; + + heap->nodes++; + + return node; +} + +/* Return the data of the minimum node (if we know it). */ +void * +fibheap_min (heap) + fibheap_t heap; +{ + /* If there is no min, we can't easily return it. */ + if (heap->min == NULL) + return NULL; + return heap->min->data; +} + +/* Return the key of the minimum node (if we know it). */ +fibheapkey_t +fibheap_min_key (heap) + fibheap_t heap; +{ + /* If there is no min, we can't easily return it. */ + if (heap->min == NULL) + return 0; + return heap->min->key; +} + +/* Union HEAPA and HEAPB into a new heap. */ +fibheap_t +fibheap_union (heapa, heapb) + fibheap_t heapa; + fibheap_t heapb; +{ + fibnode_t a_root, b_root, temp; + + /* If one of the heaps is empty, the union is just the other heap. */ + if ((a_root = heapa->root) == NULL) + { + free (heapa); + return heapb; + } + if ((b_root = heapb->root) == NULL) + { + free (heapb); + return heapa; + } + + /* Merge them to the next nodes on the opposite chain. */ + a_root->left->right = b_root; + b_root->left->right = a_root; + temp = a_root->left; + a_root->left = b_root->left; + b_root->left = temp; + heapa->nodes += heapb->nodes; + + /* And set the new minimum, if it's changed. */ + if (fibheap_compare (heapa, heapb->min, heapa->min) < 0) + heapa->min = heapb->min; + + free (heapb); + return heapa; +} + +/* Extract the data of the minimum node from HEAP. */ +void * +fibheap_extract_min (heap) + fibheap_t heap; +{ + fibnode_t z; + void *ret = NULL; + + /* If we don't have a min set, it means we have no nodes. */ + if (heap->min != NULL) + { + /* Otherwise, extract the min node, free the node, and return the + node's data. */ + z = fibheap_extr_min_node (heap); + ret = z->data; + free (z); + } + + return ret; +} + +/* Replace both the KEY and the DATA associated with NODE. */ +void * +fibheap_replace_key_data (heap, node, key, data) + fibheap_t heap; + fibnode_t node; + fibheapkey_t key; + void *data; +{ + void *odata; + int okey; + fibnode_t y; + + /* If we wanted to, we could actually do a real increase by redeleting and + inserting. However, this would require O (log n) time. So just bail out + for now. */ + if (fibheap_comp_data (heap, key, data, node) > 0) + return NULL; + + odata = node->data; + okey = node->key; + node->data = data; + node->key = key; + y = node->parent; + + if (okey == key) + return odata; + + /* These two compares are specifically <= 0 to make sure that in the case + of equality, a node we replaced the data on, becomes the new min. This + is needed so that delete's call to extractmin gets the right node. */ + if (y != NULL && fibheap_compare (heap, node, y) <= 0) + { + fibheap_cut (heap, node, y); + fibheap_cascading_cut (heap, y); + } + + if (fibheap_compare (heap, node, heap->min) <= 0) + heap->min = node; + + return odata; +} + +/* Replace the DATA associated with NODE. */ +void * +fibheap_replace_data (heap, node, data) + fibheap_t heap; + fibnode_t node; + void *data; +{ + return fibheap_replace_key_data (heap, node, node->key, data); +} + +/* Replace the KEY associated with NODE. */ +fibheapkey_t +fibheap_replace_key (heap, node, key) + fibheap_t heap; + fibnode_t node; + fibheapkey_t key; +{ + int okey = node->key; + fibheap_replace_key_data (heap, node, key, node->data); + return okey; +} + +/* Delete NODE from HEAP. */ +void * +fibheap_delete_node (heap, node) + fibheap_t heap; + fibnode_t node; +{ + void *ret = node->data; + + /* To perform delete, we just make it the min key, and extract. */ + fibheap_replace_key (heap, node, FIBHEAPKEY_MIN); + fibheap_extract_min (heap); + + return ret; +} + +/* Delete HEAP. */ +void +fibheap_delete (heap) + fibheap_t heap; +{ + while (heap->min != NULL) + free (fibheap_extr_min_node (heap)); + + free (heap); +} + +/* Determine if HEAP is empty. */ +int +fibheap_empty (heap) + fibheap_t heap; +{ + return heap->nodes == 0; +} + +/* Extract the minimum node of the heap. */ +static fibnode_t +fibheap_extr_min_node (heap) + fibheap_t heap; +{ + fibnode_t ret = heap->min; + fibnode_t x, y, orig; + + /* Attach the child list of the minimum node to the root list of the heap. + If there is no child list, we don't do squat. */ + for (x = ret->child, orig = NULL; x != orig && x != NULL; x = y) + { + if (orig == NULL) + orig = x; + y = x->right; + x->parent = NULL; + fibheap_ins_root (heap, x); + } + + /* Remove the old root. */ + fibheap_rem_root (heap, ret); + heap->nodes--; + + /* If we are left with no nodes, then the min is NULL. */ + if (heap->nodes == 0) + heap->min = NULL; + else + { + /* Otherwise, consolidate to find new minimum, as well as do the reorg + work that needs to be done. */ + heap->min = ret->right; + fibheap_consolidate (heap); + } + + return ret; +} + +/* Insert NODE into the root list of HEAP. */ +static void +fibheap_ins_root (heap, node) + fibheap_t heap; + fibnode_t node; +{ + /* If the heap is currently empty, the new node becomes the singleton + circular root list. */ + if (heap->root == NULL) + { + heap->root = node; + node->left = node; + node->right = node; + return; + } + + /* Otherwise, insert it in the circular root list between the root + and it's right node. */ + fibnode_insert_after (heap->root, node); +} + +/* Remove NODE from the rootlist of HEAP. */ +static void +fibheap_rem_root (heap, node) + fibheap_t heap; + fibnode_t node; +{ + if (node->left == node) + heap->root = NULL; + else + heap->root = fibnode_remove (node); +} + +/* Consolidate the heap. */ +static void +fibheap_consolidate (heap) + fibheap_t heap; +{ + fibnode_t a[1 + 8 * sizeof (long)]; + fibnode_t w; + fibnode_t y; + fibnode_t x; + int i; + int d; + int D; + + D = 1 + 8 * sizeof (long); + + memset (a, 0, sizeof (fibnode_t) * D); + + while ((w = heap->root) != NULL) + { + x = w; + fibheap_rem_root (heap, w); + d = x->degree; + while (a[d] != NULL) + { + y = a[d]; + if (fibheap_compare (heap, x, y) > 0) + { + fibnode_t temp; + temp = x; + x = y; + y = temp; + } + fibheap_link (heap, y, x); + a[d] = NULL; + d++; + } + a[d] = x; + } + heap->min = NULL; + for (i = 0; i < D; i++) + if (a[i] != NULL) + { + fibheap_ins_root (heap, a[i]); + if (heap->min == NULL || fibheap_compare (heap, a[i], heap->min) < 0) + heap->min = a[i]; + } +} + +/* Make NODE a child of PARENT. */ +static void +fibheap_link (heap, node, parent) + fibheap_t heap ATTRIBUTE_UNUSED; + fibnode_t node; + fibnode_t parent; +{ + if (parent->child == NULL) + parent->child = node; + else + fibnode_insert_before (parent->child, node); + node->parent = parent; + parent->degree++; + node->mark = 0; +} + +/* Remove NODE from PARENT's child list. */ +static void +fibheap_cut (heap, node, parent) + fibheap_t heap; + fibnode_t node; + fibnode_t parent; +{ + fibnode_remove (node); + parent->degree--; + fibheap_ins_root (heap, node); + node->parent = NULL; + node->mark = 0; +} + +static void +fibheap_cascading_cut (heap, y) + fibheap_t heap; + fibnode_t y; +{ + fibnode_t z; + + while ((z = y->parent) != NULL) + { + if (y->mark == 0) + { + y->mark = 1; + return; + } + else + { + fibheap_cut (heap, y, z); + y = z; + } + } +} + +static void +fibnode_insert_after (a, b) + fibnode_t a; + fibnode_t b; +{ + if (a == a->right) + { + a->right = b; + a->left = b; + b->right = a; + b->left = a; + } + else + { + b->right = a->right; + a->right->left = b; + a->right = b; + b->left = a; + } +} + +static fibnode_t +fibnode_remove (node) + fibnode_t node; +{ + fibnode_t ret; + + if (node == node->left) + ret = NULL; + else + ret = node->left; + + if (node->parent != NULL && node->parent->child == node) + node->parent->child = ret; + + node->right->left = node->left; + node->left->right = node->right; + + node->parent = NULL; + node->left = node; + node->right = node; + + return ret; +} diff -uprN binutils-2.11.90.0.27/libiberty/floatformat.c binutils-2.11.90.0.29/libiberty/floatformat.c --- binutils-2.11.90.0.27/libiberty/floatformat.c Thu Jun 1 11:10:03 2000 +++ binutils-2.11.90.0.29/libiberty/floatformat.c Wed Aug 22 08:52:10 2001 @@ -66,7 +66,7 @@ const struct floatformat floatformat_iee { floatformat_littlebyte_bigword, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no, - "floatformat_ieee_double_little" + "floatformat_ieee_double_littlebyte_bigword" }; const struct floatformat floatformat_i387_ext = @@ -91,17 +91,17 @@ const struct floatformat floatformat_i96 }; const struct floatformat floatformat_m88110_ext = { -#ifdef HARRIS_FLOAT_FORMAT + floatformat_big, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64, + floatformat_intbit_yes, + "floatformat_m88110_ext" +}; +const struct floatformat floatformat_m88110_harris_ext = +{ /* Harris uses raw format 128 bytes long, but the number is just an ieee double, and the last 64 bits are wasted. */ floatformat_big,128, 0, 1, 11, 0x3ff, 0x7ff, 12, 52, floatformat_intbit_no, - "floatformat_m88110_ext(harris)" -#else - floatformat_big, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64, - floatformat_intbit_yes, - "floatformat_m88110_ext" -#endif /* HARRIS_FLOAT_FORMAT */ + "floatformat_m88110_ext_harris" }; const struct floatformat floatformat_arm_ext = { @@ -110,6 +110,44 @@ const struct floatformat floatformat_arm floatformat_intbit_yes, "floatformat_arm_ext" }; +const struct floatformat floatformat_arm_ext_big = +{ + /* Bits 1 to 16 are unused. */ + floatformat_big, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64, + floatformat_intbit_yes, + "floatformat_arm_ext_big" +}; +const struct floatformat floatformat_arm_ext_littlebyte_bigword = +{ + /* Bits 1 to 16 are unused. */ + floatformat_littlebyte_bigword, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64, + floatformat_intbit_yes, + "floatformat_arm_ext_littlebyte_bigword" +}; +const struct floatformat floatformat_ia64_spill_big = +{ + floatformat_big, 128, 0, 1, 17, 65535, 0x1ffff, 18, 64, + floatformat_intbit_yes, + "floatformat_ia64_spill_big" +}; +const struct floatformat floatformat_ia64_spill_little = +{ + floatformat_little, 128, 0, 1, 17, 65535, 0x1ffff, 18, 64, + floatformat_intbit_yes, + "floatformat_ia64_spill_little" +}; +const struct floatformat floatformat_ia64_quad_big = +{ + floatformat_big, 128, 0, 1, 15, 16383, 0x7fff, 16, 112, + floatformat_intbit_no, + "floatformat_ia64_quad_big" +}; +const struct floatformat floatformat_ia64_quad_little = +{ + floatformat_little, 128, 0, 1, 15, 16383, 0x7fff, 16, 112, + floatformat_intbit_no, + "floatformat_ia64_quad_little" +}; static unsigned long get_field PARAMS ((unsigned char *, enum floatformat_byteorders, diff -uprN binutils-2.11.90.0.27/libiberty/hashtab.c binutils-2.11.90.0.29/libiberty/hashtab.c --- binutils-2.11.90.0.27/libiberty/hashtab.c Thu Mar 15 14:52:56 2001 +++ binutils-2.11.90.0.29/libiberty/hashtab.c Wed Aug 22 08:52:10 2001 @@ -561,3 +561,42 @@ htab_collisions (htab) return (double) htab->collisions / (double) htab->searches; } + +/* Hash P as a null-terminated string. + + Copied from gcc/hashtable.c. Zack had the following to say with respect + to applicability, though note that unlike hashtable.c, this hash table + implementation re-hashes rather than chain buckets. + + http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01021.html + From: Zack Weinberg + Date: Fri, 17 Aug 2001 02:15:56 -0400 + + I got it by extracting all the identifiers from all the source code + I had lying around in mid-1999, and testing many recurrences of + the form "H_n = H_{n-1} * K + c_n * L + M" where K, L, M were either + prime numbers or the appropriate identity. This was the best one. + I don't remember exactly what constituted "best", except I was + looking at bucket-length distributions mostly. + + So it should be very good at hashing identifiers, but might not be + as good at arbitrary strings. + + I'll add that it thoroughly trounces the hash functions recommended + for this use at http://burtleburtle.net/bob/hash/index.html, both + on speed and bucket distribution. I haven't tried it against the + function they just started using for Perl's hashes. */ + +hashval_t +htab_hash_string (p) + const PTR p; +{ + const unsigned char *str = (const unsigned char *) p; + hashval_t r = 0; + unsigned char c; + + while ((c = *str++) != 0) + r = r * 67 + c - 113; + + return r; +} diff -uprN binutils-2.11.90.0.27/libiberty/lbasename.c binutils-2.11.90.0.29/libiberty/lbasename.c --- binutils-2.11.90.0.27/libiberty/lbasename.c Thu Mar 15 14:52:58 2001 +++ binutils-2.11.90.0.29/libiberty/lbasename.c Wed Aug 22 08:52:10 2001 @@ -23,7 +23,7 @@ NAME lbasename -- return pointer to last component of a pathname SYNOPSIS - char *lbasename (const char *name) + const char *lbasename (const char *name) DESCRIPTION Given a pointer to a string containing a typical pathname @@ -69,7 +69,7 @@ DESCRIPTION # endif #endif -char * +const char * lbasename (name) const char *name; { @@ -85,5 +85,5 @@ lbasename (name) if (IS_DIR_SEPARATOR (*name)) base = name + 1; - return (char *) base; + return base; } diff -uprN binutils-2.11.90.0.27/libiberty/regex.c binutils-2.11.90.0.29/libiberty/regex.c --- binutils-2.11.90.0.27/libiberty/regex.c Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/libiberty/regex.c Mon Aug 27 11:44:52 2001 @@ -1288,7 +1288,11 @@ convert_mbs_to_wcs (dest, src, len, offs for( ; mb_remain > 0 ; ++wc_count, ++pdest, mb_remain -= consumed, psrc += consumed) { +#ifdef _LIBC + consumed = __mbrtowc (pdest, psrc, mb_remain, &mbs); +#else consumed = mbrtowc (pdest, psrc, mb_remain, &mbs); +#endif if (consumed <= 0) /* failed to convert. maybe src contains binary data. @@ -3059,7 +3063,7 @@ PREFIX(regex_compile) (ARG_PREFIX(patter /* First compare the hashing value. */ if (symb_table[2 * elem] == hash && c1 == extra[symb_table[2 * elem + 1]] - && memcmp (str, + && memcmp (char_str, &extra[symb_table[2 * elem + 1] + 1], c1) == 0) { @@ -3079,7 +3083,7 @@ PREFIX(regex_compile) (ARG_PREFIX(patter in the table. */ idx += 1 + extra[idx]; /* Adjust for the alignment. */ - idx = (idx + 3) & ~4; + idx = (idx + 3) & ~3; str[0] = (wchar_t) idx + 4; } @@ -4627,9 +4631,16 @@ static unsigned char truncate_wchar (c) CHAR_T c; { - unsigned char buf[MB_LEN_MAX]; - int retval = wctomb(buf, c); - return retval > 0 ? buf[0] : (unsigned char)c; + unsigned char buf[MB_CUR_MAX]; + mbstate_t state; + int retval; + memset (&state, '\0', sizeof (state)); +# ifdef _LIBC + retval = __wcrtomb (buf, c, &state); +# else + retval = wcrtomb (buf, c, &state); +# endif + return retval > 0 ? buf[0] : (unsigned char) c; } #endif /* WCHAR */ @@ -6337,8 +6348,13 @@ byte_re_match_2_internal (bufp, string1, & ~(uintptr_t)(__alignof__(wctype_t) - 1); wctype = *((wctype_t*)alignedp); workp += CHAR_CLASS_SIZE; +# ifdef _LIBC + if (__iswctype((wint_t)c, wctype)) + goto char_set_matched; +# else if (iswctype((wint_t)c, wctype)) goto char_set_matched; +# endif } /* match with collating_symbol? */ @@ -6374,12 +6390,20 @@ byte_re_match_2_internal (bufp, string1, for (workp2 = workp + coll_symbol_length ; workp < workp2 ;) { const CHAR_T *backup_d = d, *backup_dend = dend; - length = wcslen(workp); +# ifdef _LIBC + length = __wcslen (workp); +# else + length = wcslen (workp); +# endif /* If wcscoll(the collating symbol, whole string) > 0, any substring of the string never match with the collating symbol. */ - if (wcscoll(workp, d) > 0) +# ifdef _LIBC + if (__wcscoll (workp, d) > 0) +# else + if (wcscoll (workp, d) > 0) +# endif { workp += length + 1; continue; @@ -6404,7 +6428,11 @@ byte_re_match_2_internal (bufp, string1, str_buf[i] = TRANSLATE(*d); str_buf[i+1] = '\0'; - match = wcscoll(workp, str_buf); +# ifdef _LIBC + match = __wcscoll (workp, str_buf); +# else + match = wcscoll (workp, str_buf); +# endif if (match == 0) goto char_set_matched; @@ -6515,12 +6543,20 @@ byte_re_match_2_internal (bufp, string1, for (workp2 = workp + equiv_class_length ; workp < workp2 ;) { const CHAR_T *backup_d = d, *backup_dend = dend; - length = wcslen(workp); +# ifdef _LIBC + length = __wcslen (workp); +# else + length = wcslen (workp); +# endif /* If wcscoll(the collating symbol, whole string) > 0, any substring of the string never match with the collating symbol. */ - if (wcscoll(workp, d) > 0) +# ifdef _LIBC + if (__wcscoll (workp, d) > 0) +# else + if (wcscoll (workp, d) > 0) +# endif { workp += length + 1; break; @@ -6545,7 +6581,11 @@ byte_re_match_2_internal (bufp, string1, str_buf[i] = TRANSLATE(*d); str_buf[i+1] = '\0'; - match = wcscoll(workp, str_buf); +# ifdef _LIBC + match = __wcscoll (workp, str_buf); +# else + match = wcscoll (workp, str_buf); +# endif if (match == 0) goto char_set_matched; @@ -6568,7 +6608,7 @@ byte_re_match_2_internal (bufp, string1, } /* match with char_range? */ -#ifdef _LIBC +# ifdef _LIBC if (nrules != 0) { uint32_t collseqval; @@ -6591,7 +6631,7 @@ byte_re_match_2_internal (bufp, string1, } } else -#endif +# endif { /* We set range_start_char at str_buf[0], range_end_char at str_buf[4], and compared char at str_buf[2]. */ @@ -6627,9 +6667,13 @@ byte_re_match_2_internal (bufp, string1, range_end_char = str_buf + 4; } - if (wcscoll(range_start_char, str_buf+2) <= 0 && - wcscoll(str_buf+2, range_end_char) <= 0) - +# ifdef _LIBC + if (__wcscoll (range_start_char, str_buf+2) <= 0 + && __wcscoll (str_buf+2, range_end_char) <= 0) +# else + if (wcscoll (range_start_char, str_buf+2) <= 0 + && wcscoll (str_buf+2, range_end_char) <= 0) +# endif goto char_set_matched; } } diff -uprN binutils-2.11.90.0.27/mips/ChangeLog binutils-2.11.90.0.29/mips/ChangeLog --- binutils-2.11.90.0.27/mips/ChangeLog Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/mips/ChangeLog Mon Aug 27 11:44:52 2001 @@ -1,3 +1,17 @@ +2001-08-27 H.J. Lu + + * gas-mips-dwarf2.patch: Removed. + +2001-08-27 H.J. Lu + + * binutils-mips-reloc.patch: Removed. + + * binutils-mips64.patch: Updated. + +2001-08-21 H.J. Lu + + * binutils-mips64.patch: Updated. + 2001-08-10 H.J. Lu * binutils-mips64.patch: Updated. diff -uprN binutils-2.11.90.0.27/mips/binutils-mips-reloc.patch binutils-2.11.90.0.29/mips/binutils-mips-reloc.patch --- binutils-2.11.90.0.27/mips/binutils-mips-reloc.patch Tue Jun 19 11:57:59 2001 +++ binutils-2.11.90.0.29/mips/binutils-mips-reloc.patch Wed Dec 31 16:00:00 1969 @@ -1,934 +0,0 @@ ---- binutils/bfd/elf32-mips.c.reloc Thu May 24 10:15:17 2001 -+++ binutils/bfd/elf32-mips.c Thu May 24 12:22:20 2001 -@@ -487,7 +487,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -502,7 +502,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ -@@ -517,7 +517,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ -@@ -532,7 +532,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_REL32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ -@@ -550,7 +550,7 @@ static reloc_howto_type elf_mips_howto_t - /* This needs complex overflow - detection, because the upper four - bits must match the PC + 4. */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_26", /* name */ - true, /* partial_inplace */ - 0x3ffffff, /* src_mask */ -@@ -640,7 +640,7 @@ static reloc_howto_type elf_mips_howto_t - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_PC16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ -@@ -655,7 +655,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_CALL16", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ -@@ -691,7 +691,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT5", /* name */ - true, /* partial_inplace */ - 0x000007c0, /* src_mask */ -@@ -708,7 +708,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT6", /* name */ - true, /* partial_inplace */ - 0x000007c4, /* src_mask */ -@@ -738,7 +738,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_DISP", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -753,7 +753,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_PAGE", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -768,7 +768,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_OFST", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -783,7 +783,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_HI16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -798,7 +798,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_LO16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -813,7 +813,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SUB", /* name */ - true, /* partial_inplace */ - MINUS_ONE, /* src_mask */ -@@ -833,7 +833,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_HIGHER", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -848,7 +848,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_HIGHEST", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -863,7 +863,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_CALL_HI16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -878,7 +878,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_CALL_LO16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -893,7 +893,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SCN_DISP", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ -@@ -914,7 +914,7 @@ static reloc_howto_type elf_mips_howto_t - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_JALR", /* name */ - false, /* partial_inplace */ - 0x00000000, /* src_mask */ -@@ -1016,7 +1016,7 @@ static reloc_howto_type elf_mips_gnu_rel - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GNU_REL16_S2", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ -@@ -1032,7 +1032,7 @@ static reloc_howto_type elf_mips_gnu_pcr - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_PC64", /* name */ - true, /* partial_inplace */ - MINUS_ONE, /* src_mask */ -@@ -1048,7 +1048,7 @@ static reloc_howto_type elf_mips_gnu_pcr - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_PC32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ -@@ -1087,6 +1087,33 @@ static reloc_howto_type elf_mips_gnu_vte - 0, /* dst_mask */ - false); /* pcrel_offset */ - -+/* We cannot use bfd_elf_generic_reloc. See comments in md_apply_fix -+ in gas/config/tc-mips.c. */ -+ -+bfd_reloc_status_type -+_bfd_mips_elf_generic_reloc (abfd, reloc_entry, symbol, data, -+ input_section, output_bfd, error_message) -+ bfd *abfd ATTRIBUTE_UNUSED; -+ arelent *reloc_entry; -+ asymbol *symbol; -+ PTR data ATTRIBUTE_UNUSED; -+ asection *input_section; -+ bfd *output_bfd; -+ char **error_message ATTRIBUTE_UNUSED; -+{ -+ if (output_bfd != (bfd *) NULL -+ && (symbol->flags & BSF_SECTION_SYM) == 0 -+ && (! reloc_entry->howto->partial_inplace -+ || (! reloc_entry->addend_in_obj_file_only -+ && reloc_entry->addend == 0))) -+ { -+ reloc_entry->address += input_section->output_offset; -+ return bfd_reloc_ok; -+ } -+ -+ return bfd_reloc_continue; -+} -+ - /* Do a R_MIPS_HI16 relocation. This has to be done in combination - with a R_MIPS_LO16 reloc, because there is a carry from the LO16 to - the HI16. Here we just save the information we need; we do the -@@ -1292,8 +1319,9 @@ _bfd_mips_elf_lo16_reloc (abfd, - } - - /* Now do the LO16 reloc in the usual way. */ -- return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, -- input_section, output_bfd, error_message); -+ return _bfd_mips_elf_generic_reloc (abfd, reloc_entry, symbol, data, -+ input_section, output_bfd, -+ error_message); - } - - /* Do a R_MIPS_GOT16 reloc. This is a reloc against the global offset -@@ -1686,8 +1714,9 @@ mips32_64bit_reloc (abfd, reloc_entry, s - unsigned long val; - bfd_size_type addr; - -- r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, -- input_section, output_bfd, error_message); -+ r = _bfd_mips_elf_generic_reloc (abfd, reloc_entry, symbol, data, -+ input_section, output_bfd, -+ error_message); - if (r != bfd_reloc_continue) - return r; - ---- binutils/bfd/elf64-mips.c.reloc Thu May 24 10:15:17 2001 -+++ binutils/bfd/elf64-mips.c Thu May 24 12:18:26 2001 -@@ -100,7 +100,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -115,7 +115,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ -@@ -130,7 +130,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ -@@ -145,7 +145,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_REL32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ -@@ -163,7 +163,7 @@ static reloc_howto_type mips_elf64_howto - /* This needs complex overflow - detection, because the upper four - bits must match the PC + 4. */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_26", /* name */ - true, /* partial_inplace */ - 0x3ffffff, /* src_mask */ -@@ -253,7 +253,7 @@ static reloc_howto_type mips_elf64_howto - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_PC16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ -@@ -269,7 +269,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_CALL16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -303,7 +303,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT5", /* name */ - true, /* partial_inplace */ - 0x000007c0, /* src_mask */ -@@ -320,7 +320,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT6", /* name */ - true, /* partial_inplace */ - 0x000007c4, /* src_mask */ -@@ -335,7 +335,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_64", /* name */ - true, /* partial_inplace */ - MINUS_ONE, /* src_mask */ -@@ -351,7 +351,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_DISP", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -367,7 +367,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_PAGE", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -383,7 +383,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_OFST", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -399,7 +399,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_HI16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -415,7 +415,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_LO16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -431,7 +431,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SUB", /* name */ - true, /* partial_inplace */ - MINUS_ONE, /* src_mask */ -@@ -447,7 +447,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_INSERT_A", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -464,7 +464,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_INSERT_B", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -480,7 +480,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_DELETE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -496,7 +496,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_HIGHER", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ -@@ -512,7 +512,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_HIGHEST", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ -@@ -528,7 +528,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_CALL_HI16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -544,7 +544,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_CALL_LO16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ -@@ -561,7 +561,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SCN_DISP", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -575,7 +575,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_REL16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -589,7 +589,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_ADD_IMMEDIATE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -603,7 +603,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_PJUMP", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -617,7 +617,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_RELGOT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -633,7 +633,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_JALR", /* name */ - false, /* partial_inplace */ - 0x00000000, /* src_mask */ -@@ -653,7 +653,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -668,7 +668,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_16", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -683,7 +683,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_32", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -698,7 +698,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_REL32", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -716,7 +716,7 @@ static reloc_howto_type mips_elf64_howto - /* This needs complex overflow - detection, because the upper four - bits must match the PC + 4. */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_26", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -731,7 +731,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_HI16", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -746,7 +746,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_LO16", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -792,7 +792,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -807,7 +807,7 @@ static reloc_howto_type mips_elf64_howto - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_PC16", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -823,7 +823,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_CALL16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -857,7 +857,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT5", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -874,7 +874,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT6", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -889,7 +889,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_64", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -905,7 +905,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_DISP", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -921,7 +921,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_PAGE", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -937,7 +937,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_OFST", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -953,7 +953,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_HI16", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -969,7 +969,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_GOT_LO16", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -985,7 +985,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SUB", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -1001,7 +1001,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_INSERT_A", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -1018,7 +1018,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_INSERT_B", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -1034,7 +1034,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_DELETE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -1050,7 +1050,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_HIGHER", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -1066,7 +1066,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_HIGHEST", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -1082,7 +1082,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_CALL_HI16", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -1098,7 +1098,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_CALL_LO16", /* name */ - true, /* partial_inplace */ - 0, /* src_mask */ -@@ -1115,7 +1115,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_SCN_DISP", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -1129,7 +1129,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_REL16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -1143,7 +1143,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_ADD_IMMEDIATE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -1157,7 +1157,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_PJUMP", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -1171,7 +1171,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_RELGOT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ -@@ -1187,7 +1187,7 @@ static reloc_howto_type mips_elf64_howto - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -+ _bfd_mips_elf_generic_reloc, /* special_function */ - "R_MIPS_JALR", /* name */ - false, /* partial_inplace */ - 0x00000000, /* src_mask */ -@@ -1500,6 +1500,8 @@ mips_elf64_slurp_one_reloc_table (abfd, - { - enum elf_mips_reloc_type type; - -+ relent->addend_in_obj_file_only = 0; -+ - switch (ir) - { - default: -@@ -1608,6 +1610,8 @@ mips_elf64_slurp_one_reloc_table (abfd, - relent->addend = rela.r_addend; - - relent->howto = &howto_table[(int) type]; -+ -+ relent->addend_in_obj_file_only = 0; - - ++relent; - } ---- binutils/bfd/elf-bfd.h.reloc Thu May 24 10:15:17 2001 -+++ binutils/bfd/elf-bfd.h Thu May 24 11:22:59 2001 -@@ -1296,6 +1296,8 @@ extern void _bfd_mips_elf_symbol_process - extern boolean _bfd_mips_elf_read_ecoff_info - PARAMS ((bfd *, asection *, struct ecoff_debug_info *)); - extern void _bfd_mips_elf_final_write_processing PARAMS ((bfd *, boolean)); -+extern bfd_reloc_status_type _bfd_mips_elf_generic_reloc -+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); - extern bfd_reloc_status_type _bfd_mips_elf_hi16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); - extern bfd_reloc_status_type _bfd_mips_elf_lo16_reloc ---- binutils/bfd/elfcode.h.reloc Wed May 23 10:59:24 2001 -+++ binutils/bfd/elfcode.h Thu May 24 12:20:48 2001 -@@ -1303,6 +1303,8 @@ elf_slurp_reloc_table_from_section (abfd - rela.r_addend = 0; - } - -+ relent->addend_in_obj_file_only = 0; -+ - /* The address of an ELF reloc is section relative for an object - file, and absolute for an executable file or shared library. - The address of a normal BFD reloc is always section relative, ---- binutils/bfd/reloc.c.reloc Wed May 23 10:59:31 2001 -+++ binutils/bfd/reloc.c Thu May 24 11:21:32 2001 -@@ -106,6 +106,9 @@ CODE_FRAGMENT - . {* addend for relocation value *} - . bfd_vma addend; - . -+. {* if addend appears in the object file only. *} -+. boolean addend_in_obj_file_only; -+. - . {* Pointer to how to perform the required relocation *} - . reloc_howto_type *howto; - . ---- binutils/gas/config/tc-mips.c.reloc Thu Jun 7 23:58:02 2001 -+++ binutils/gas/config/tc-mips.c Fri Jun 8 00:00:26 2001 -@@ -9708,6 +9708,8 @@ md_apply_fix (fixP, valueP) - - value = *valueP; - -+ fixP->fx_addend_in_obj_file_only = 0; -+ - /* If we aren't adjusting this fixup to be against the section - symbol, we need to adjust the value. */ - #ifdef OBJ_ELF -@@ -9732,9 +9734,9 @@ md_apply_fix (fixP, valueP) - { - /* In this case, the bfd_install_relocation routine will - incorrectly add the symbol value back in. We just want -- the addend to appear in the object file. -- FIXME: If this makes VALUE zero, we're toast. */ -+ the addend to appear in the object file. */ - value -= symval; -+ fixP->fx_addend_in_obj_file_only = 1; - } - } - -@@ -11307,6 +11309,7 @@ tc_gen_reloc (section, fixp) - - fixp_prev = fixp; - -+ reloc->addend_in_obj_file_only = 0; - reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; - - if (mips_pic == EMBEDDED_PIC -@@ -11321,7 +11324,10 @@ tc_gen_reloc (section, fixp) - fixp->fx_r_type = BFD_RELOC_GPREL32; - } - else if (fixp->fx_pcrel == 0 || OUTPUT_FLAVOR == bfd_target_elf_flavour) -- reloc->addend = fixp->fx_addnumber; -+ { -+ reloc->addend = fixp->fx_addnumber; -+ reloc->addend_in_obj_file_only = fixp->fx_addend_in_obj_file_only; -+ } - else if (fixp->fx_r_type == BFD_RELOC_PCREL_LO16) - { - /* We use a special addend for an internal RELLO reloc. */ ---- binutils/gas/write.h.reloc Fri Mar 30 07:39:50 2001 -+++ binutils/gas/write.h Thu May 24 11:51:49 2001 -@@ -90,6 +90,9 @@ struct fix - /* The value is signed when checking for overflow. */ - unsigned fx_signed : 1; - -+ /* Does addend appear in the object file only? */ -+ unsigned fx_addend_in_obj_file_only: 1; -+ - /* Which frag does this fix apply to? */ - fragS *fx_frag; - diff -uprN binutils-2.11.90.0.27/mips/binutils-mips64.patch binutils-2.11.90.0.29/mips/binutils-mips64.patch --- binutils-2.11.90.0.27/mips/binutils-mips64.patch Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/mips/binutils-mips64.patch Mon Aug 27 11:44:52 2001 @@ -1,6 +1,6 @@ ---- binutils/bfd/config.bfd.mips64 Fri Aug 3 08:47:34 2001 -+++ binutils/bfd/config.bfd Fri Aug 10 10:07:12 2001 -@@ -674,6 +674,16 @@ case "${targ}" in +--- binutils/bfd/config.bfd.mips64 Mon Aug 27 08:51:39 2001 ++++ binutils/bfd/config.bfd Mon Aug 27 09:08:29 2001 +@@ -677,6 +677,16 @@ case "${targ}" in targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec" ;; @@ -17,9 +17,9 @@ mips*el*-*-linux-gnu*) targ_defvec=bfd_elf32_tradlittlemips_vec targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec ecoff_little_vec ecoff_big_vec" ---- binutils/bfd/elf32-mips.c.mips64 Wed Jul 4 10:21:18 2001 -+++ binutils/bfd/elf32-mips.c Fri Aug 10 10:07:12 2001 -@@ -1980,7 +1980,9 @@ static CONST struct elf_reloc_map mips_r +--- binutils/bfd/elf32-mips.c.mips64 Mon Aug 27 08:51:56 2001 ++++ binutils/bfd/elf32-mips.c Mon Aug 27 09:08:29 2001 +@@ -1989,7 +1989,9 @@ static CONST struct elf_reloc_map mips_r { BFD_RELOC_MIPS_SUB, R_MIPS_SUB }, { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE }, { BFD_RELOC_MIPS_GOT_OFST, R_MIPS_GOT_OFST }, @@ -30,7 +30,7 @@ }; /* Given a BFD reloc type, return a howto structure. */ -@@ -5589,7 +5591,7 @@ mips_elf_sort_hash_table (info, max_loca +@@ -5600,7 +5602,7 @@ mips_elf_sort_hash_table (info, max_loca mips_elf_sort_hash_table_f, &hsd); @@ -39,9 +39,9 @@ accomodate both the GOT and non-GOT symbols. */ BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx); ---- binutils/bfd/elf64-mips.c.mips64 Thu May 3 09:27:24 2001 -+++ binutils/bfd/elf64-mips.c Fri Aug 10 10:07:12 2001 -@@ -1276,11 +1276,11 @@ mips_elf64_be_swap_reloc_in (abfd, src, +--- binutils/bfd/elf64-mips.c.mips64 Fri Aug 17 09:17:31 2001 ++++ binutils/bfd/elf64-mips.c Mon Aug 27 09:08:29 2001 +@@ -1278,11 +1278,11 @@ mips_elf64_be_swap_reloc_in (abfd, src, &mirel); dst[0].r_offset = mirel.r_offset; @@ -56,7 +56,7 @@ } /* Swap in a MIPS 64-bit Rela reloc. */ -@@ -1298,14 +1298,16 @@ mips_elf64_be_swap_reloca_in (abfd, src, +@@ -1300,14 +1300,16 @@ mips_elf64_be_swap_reloca_in (abfd, src, &mirela); dst[0].r_offset = mirela.r_offset; @@ -76,7 +76,7 @@ } /* Swap out a MIPS 64-bit Rel reloc. */ -@@ -1319,8 +1321,8 @@ mips_elf64_be_swap_reloc_out (abfd, src, +@@ -1321,8 +1323,8 @@ mips_elf64_be_swap_reloc_out (abfd, src, Elf64_Mips_Internal_Rel mirel; mirel.r_offset = src->r_offset; @@ -87,7 +87,7 @@ mirel.r_type2 = R_MIPS_NONE; mirel.r_ssym = STN_UNDEF; mirel.r_type3 = R_MIPS_NONE; -@@ -1340,9 +1342,9 @@ mips_elf64_be_swap_reloca_out (abfd, src +@@ -1342,9 +1344,9 @@ mips_elf64_be_swap_reloca_out (abfd, src Elf64_Mips_Internal_Rela mirela; mirela.r_offset = src->r_offset; @@ -99,7 +99,7 @@ mirela.r_type2 = R_MIPS_NONE; mirela.r_ssym = STN_UNDEF; mirela.r_type3 = R_MIPS_NONE; -@@ -1383,7 +1385,9 @@ static CONST struct elf_reloc_map mips_r +@@ -1385,7 +1387,9 @@ static CONST struct elf_reloc_map mips_r { BFD_RELOC_MIPS_SUB, R_MIPS_SUB }, { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE }, { BFD_RELOC_MIPS_GOT_OFST, R_MIPS_GOT_OFST }, @@ -110,7 +110,7 @@ }; /* Given a BFD reloc type, return a howto structure. */ -@@ -2083,7 +2087,7 @@ const struct elf_size_info mips_elf64_si +@@ -2085,7 +2089,7 @@ const struct elf_size_info mips_elf64_si sizeof (Elf64_External_Dyn), sizeof (Elf_External_Note), 4, /* hash-table entry size */ @@ -119,7 +119,7 @@ 64, /* arch_size */ 8, /* file_align */ ELFCLASS64, -@@ -2187,6 +2191,10 @@ const struct elf_size_info mips_elf64_si +@@ -2189,6 +2193,10 @@ const struct elf_size_info mips_elf64_si _bfd_archive_coff_generic_stat_arch_elt #define bfd_elf64_archive_update_armap_timestamp \ _bfd_archive_coff_update_armap_timestamp @@ -131,7 +131,7 @@ #include "elf64-target.h" --- binutils/configure.in.mips64 Thu May 24 23:17:50 2001 -+++ binutils/configure.in Fri Aug 10 10:07:12 2001 ++++ binutils/configure.in Mon Aug 27 09:08:29 2001 @@ -854,13 +854,12 @@ case "${target}" in noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss" ;; @@ -147,8 +147,8 @@ ;; mips*-dec-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi" ---- binutils/gas/config/tc-mips.c.mips64 Fri Aug 10 09:55:06 2001 -+++ binutils/gas/config/tc-mips.c Fri Aug 10 10:11:07 2001 +--- binutils/gas/config/tc-mips.c.mips64 Mon Aug 27 08:52:38 2001 ++++ binutils/gas/config/tc-mips.c Mon Aug 27 09:26:54 2001 @@ -109,6 +109,10 @@ extern int target_big_endian; 64 bit [e.g. --target=mips64-elf]. */ static int mips_64; @@ -232,7 +232,27 @@ static symbolS *get_symbol PARAMS ((void)); static void mips_align PARAMS ((int to, int fill, symbolS *label)); static void s_align PARAMS ((int)); -@@ -874,12 +910,15 @@ static expressionS offset_expr; +@@ -729,19 +765,6 @@ static const char *mips_cpu_to_str PARAM + static int validate_mips_insn PARAMS ((const struct mips_opcode *)); + static void show PARAMS ((FILE *, char *, int *, int *)); + +-/* Return values of my_getSmallExpression() */ +- +-enum +-{ +- S_EX_NONE = 0, +- S_EX_LO, +- S_EX_HI, +- S_EX_HIGHER, +- S_EX_HIGHEST, +- S_EX_GPREL, +- S_EX_NEG +-}; +- + /* Table and functions used to map between CPU/ISA names, and + ISA levels, and CPU numbers. */ + +@@ -888,12 +911,15 @@ static expressionS offset_expr; /* Relocs associated with imm_expr and offset_expr. */ @@ -251,7 +271,7 @@ /* These are set by mips16_ip if an explicit extension is used. */ -@@ -1187,7 +1226,7 @@ md_begin () +@@ -1217,7 +1243,7 @@ md_begin () if (strcmp (TARGET_OS, "elf") != 0) flags |= SEC_ALLOC | SEC_LOAD; @@ -260,7 +280,7 @@ { sec = subseg_new (".reginfo", (subsegT) 0); -@@ -1263,10 +1302,13 @@ md_assemble (str) +@@ -1293,10 +1319,13 @@ md_assemble (str) struct mips_cl_insn insn; imm_expr.X_op = O_absent; @@ -276,7 +296,7 @@ if (mips_opts.mips16) mips16_ip (str, &insn); -@@ -1293,12 +1335,13 @@ md_assemble (str) +@@ -1323,12 +1352,13 @@ md_assemble (str) else { if (imm_expr.X_op != O_absent) @@ -293,7 +313,7 @@ } } -@@ -1450,12 +1493,12 @@ append_insn (place, ip, address_expr, re +@@ -1480,12 +1510,12 @@ append_insn (place, ip, address_expr, re char *place; struct mips_cl_insn *ip; expressionS *address_expr; @@ -308,7 +328,7 @@ int nops = 0; /* Mark instruction labels in mips16 mode. */ -@@ -1801,16 +1844,16 @@ append_insn (place, ip, address_expr, re +@@ -1831,16 +1861,16 @@ append_insn (place, ip, address_expr, re } } @@ -328,7 +348,7 @@ == BFD_RELOC_MIPS16_JMP)), make_expr_symbol (address_expr), (offsetT) 0, (char *) NULL); -@@ -1819,7 +1862,7 @@ append_insn (place, ip, address_expr, re +@@ -1849,7 +1879,7 @@ append_insn (place, ip, address_expr, re f = place; else if (mips_opts.mips16 && ! ip->use_extend @@ -337,7 +357,7 @@ { /* Make sure there is enough room to swap this instruction with a following jump instruction. */ -@@ -1836,12 +1879,13 @@ append_insn (place, ip, address_expr, re +@@ -1866,12 +1896,13 @@ append_insn (place, ip, address_expr, re f = frag_more (4); } @@ -354,7 +374,7 @@ { case BFD_RELOC_32: ip->insn_opcode |= address_expr->X_add_number; -@@ -1878,33 +1922,52 @@ append_insn (place, ip, address_expr, re +@@ -1908,33 +1939,52 @@ append_insn (place, ip, address_expr, re else { need_reloc: @@ -416,7 +436,7 @@ { md_number_to_chars (f, ip->insn_opcode >> 16, 2); md_number_to_chars (f + 2, ip->insn_opcode & 0xffff, 2); -@@ -2188,7 +2251,7 @@ append_insn (place, ip, address_expr, re +@@ -2218,7 +2268,7 @@ append_insn (place, ip, address_expr, re /* If the previous instruction had a fixup in mips16 mode, we can not swap. This normally means that the previous instruction was a 4 byte branch anyhow. */ @@ -425,7 +445,7 @@ /* If the previous instruction is a sync, sync.l, or sync.p, we can not swap. */ || (prev_pinfo & INSN_SYNC)) -@@ -2214,15 +2277,36 @@ append_insn (place, ip, address_expr, re +@@ -2244,15 +2294,36 @@ append_insn (place, ip, address_expr, re memcpy (temp, prev_f, 4); memcpy (prev_f, f, 4); memcpy (f, temp, 4); @@ -468,7 +488,7 @@ } } else -@@ -2230,13 +2314,13 @@ append_insn (place, ip, address_expr, re +@@ -2260,13 +2331,13 @@ append_insn (place, ip, address_expr, re char *prev_f; char temp[2]; @@ -485,7 +505,7 @@ memcpy (f, temp, 2); } else -@@ -2244,10 +2328,18 @@ append_insn (place, ip, address_expr, re +@@ -2274,10 +2345,18 @@ append_insn (place, ip, address_expr, re memcpy (f, f + 2, 2); memcpy (f + 2, temp, 2); } @@ -507,7 +527,7 @@ } } -@@ -2265,8 +2357,10 @@ append_insn (place, ip, address_expr, re +@@ -2295,8 +2374,10 @@ append_insn (place, ip, address_expr, re prev_insn.insn_mo = &dummy_opcode; } @@ -520,7 +540,7 @@ prev_insn_extended = 0; } else if (pinfo & INSN_COND_BRANCH_LIKELY) -@@ -2279,8 +2373,10 @@ append_insn (place, ip, address_expr, re +@@ -2309,8 +2390,10 @@ append_insn (place, ip, address_expr, re /* Update the previous insn information. */ prev_prev_insn = *ip; prev_insn.insn_mo = &dummy_opcode; @@ -533,7 +553,7 @@ prev_insn_extended = 0; } else -@@ -2297,11 +2393,11 @@ append_insn (place, ip, address_expr, re +@@ -2327,11 +2410,11 @@ append_insn (place, ip, address_expr, re is not in a delay slot. */ prev_insn_is_delay_slot = 0; @@ -548,7 +568,7 @@ } prev_prev_insn_unreordered = prev_insn_unreordered; -@@ -2317,7 +2413,7 @@ append_insn (place, ip, address_expr, re +@@ -2347,7 +2430,7 @@ append_insn (place, ip, address_expr, re PC relative relocs. */ prev_prev_insn = prev_insn; prev_insn = *ip; @@ -557,7 +577,7 @@ prev_prev_insn_unreordered = prev_insn_unreordered; prev_insn_unreordered = 1; } -@@ -2357,7 +2453,8 @@ mips_no_prev_insn (preserve) +@@ -2387,7 +2470,8 @@ mips_no_prev_insn (preserve) prev_insn_is_delay_slot = 0; prev_insn_unreordered = 0; prev_insn_extended = 0; @@ -567,7 +587,7 @@ prev_prev_insn_unreordered = 0; mips_clear_insn_labels (); } -@@ -2497,6 +2594,7 @@ macro_build (place, counter, ep, name, f +@@ -2527,6 +2611,7 @@ macro_build (place, counter, ep, name, f #endif { struct mips_cl_insn insn; @@ -575,7 +595,7 @@ bfd_reloc_code_real_type r; va_list args; -@@ -2626,6 +2724,8 @@ macro_build (place, counter, ep, name, f +@@ -2656,6 +2741,8 @@ macro_build (place, counter, ep, name, f r = (bfd_reloc_code_real_type) va_arg (args, int); assert (r == BFD_RELOC_MIPS_GPREL || r == BFD_RELOC_MIPS_LITERAL @@ -584,7 +604,7 @@ || r == BFD_RELOC_LO16 || r == BFD_RELOC_MIPS_GOT16 || r == BFD_RELOC_MIPS_CALL16 -@@ -2642,6 +2742,7 @@ macro_build (place, counter, ep, name, f +@@ -2672,6 +2759,7 @@ macro_build (place, counter, ep, name, f || (ep->X_op == O_symbol && (r == BFD_RELOC_HI16_S || r == BFD_RELOC_HI16 @@ -592,7 +612,7 @@ || r == BFD_RELOC_MIPS_GOT_HI16 || r == BFD_RELOC_MIPS_CALL_HI16)) || (ep->X_op == O_subtract -@@ -2689,7 +2790,10 @@ macro_build (place, counter, ep, name, f +@@ -2719,7 +2807,10 @@ macro_build (place, counter, ep, name, f va_end (args); assert (r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL); @@ -604,7 +624,7 @@ } static void -@@ -2702,6 +2806,7 @@ mips16_macro_build (place, counter, ep, +@@ -2732,6 +2823,7 @@ mips16_macro_build (place, counter, ep, va_list args; { struct mips_cl_insn insn; @@ -612,7 +632,7 @@ bfd_reloc_code_real_type r; r = BFD_RELOC_UNUSED; -@@ -2815,7 +2920,10 @@ mips16_macro_build (place, counter, ep, +@@ -2845,7 +2937,10 @@ mips16_macro_build (place, counter, ep, assert (r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL); @@ -624,7 +644,7 @@ } /* -@@ -2830,6 +2938,7 @@ macro_build_lui (place, counter, ep, reg +@@ -2860,6 +2955,7 @@ macro_build_lui (place, counter, ep, reg { expressionS high_expr; struct mips_cl_insn insn; @@ -632,7 +652,7 @@ bfd_reloc_code_real_type r; CONST char *name = "lui"; CONST char *fmt = "t,u"; -@@ -2878,14 +2987,17 @@ macro_build_lui (place, counter, ep, reg +@@ -2906,14 +3002,17 @@ macro_build_lui (place, counter, ep, reg assert (strcmp (name, insn.insn_mo->name) == 0); assert (strcmp (fmt, insn.insn_mo->args) == 0); @@ -652,7 +672,16 @@ } /* set_at() -@@ -3338,7 +3450,7 @@ load_address (counter, reg, ep) +@@ -3330,7 +3429,7 @@ load_address (counter, reg, ep) + lui $reg, (BFD_RELOC_HI16_S) + addiu $reg,$reg, (BFD_RELOC_LO16) + If we have an addend, we always use the latter form. */ +- if ((valueT) ep->X_add_number >= MAX_GPREL_OFFSET ++ if ((valueT) ep->X_add_number > MAX_GPREL_OFFSET + || nopic_need_relax (ep->X_add_symbol, 1)) + p = NULL; + else +@@ -3366,7 +3465,7 @@ load_address (counter, reg, ep) ep->X_add_number = 0; frag_grow (20); macro_build ((char *) NULL, counter, ep, @@ -661,7 +690,7 @@ "t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT16, GP); macro_build ((char *) NULL, counter, (expressionS *) NULL, "nop", ""); p = frag_var (rs_machine_dependent, 4, 0, -@@ -3385,7 +3497,7 @@ load_address (counter, reg, ep) +@@ -3413,7 +3512,7 @@ load_address (counter, reg, ep) HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", reg, reg, GP); macro_build ((char *) NULL, counter, ep, @@ -670,7 +699,7 @@ "t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT_LO16, reg); p = frag_var (rs_machine_dependent, 12 + off, 0, RELAX_ENCODE (12, 12 + off, off, 8 + off, 0, -@@ -3400,7 +3512,7 @@ load_address (counter, reg, ep) +@@ -3428,7 +3527,7 @@ load_address (counter, reg, ep) macro_build (p, counter, (expressionS *) NULL, "nop", ""); p += 4; } @@ -679,7 +708,16 @@ "t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT16, GP); p += 4; macro_build (p, counter, (expressionS *) NULL, "nop", ""); -@@ -4213,12 +4325,48 @@ macro (ip) +@@ -4226,7 +4325,7 @@ macro (ip) + addiu $tempreg,$tempreg, (BFD_RELOC_LO16) + If we have a constant, we need two instructions anyhow, + so we may as well always use the latter form. */ +- if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET ++ if ((valueT) offset_expr.X_add_number > MAX_GPREL_OFFSET + || nopic_need_relax (offset_expr.X_add_symbol, 1)) + p = NULL; + else +@@ -4241,12 +4340,48 @@ macro (ip) offset_expr.X_add_symbol, (offsetT) 0, (char *) NULL); } @@ -734,7 +772,7 @@ } else if (mips_pic == SVR4_PIC && ! mips_big_got) { -@@ -4620,7 +4768,9 @@ macro (ip) +@@ -4648,7 +4783,9 @@ macro (ip) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "jalr", "d,s", dreg, sreg); @@ -745,7 +783,7 @@ as_warn (_("No .cprestore pseudo-op used in PIC code")); else { -@@ -4667,7 +4817,7 @@ macro (ip) +@@ -4695,7 +4832,7 @@ macro (ip) if (! mips_big_got) { macro_build ((char *) NULL, &icnt, &offset_expr, @@ -754,7 +792,7 @@ "t,o(b)", PIC_CALL_REG, (int) BFD_RELOC_MIPS_CALL16, GP); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, -@@ -4691,7 +4841,7 @@ macro (ip) +@@ -4719,7 +4856,7 @@ macro (ip) HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", PIC_CALL_REG, PIC_CALL_REG, GP); macro_build ((char *) NULL, &icnt, &offset_expr, @@ -763,7 +801,7 @@ "t,o(b)", PIC_CALL_REG, (int) BFD_RELOC_MIPS_CALL_LO16, PIC_CALL_REG); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, -@@ -4707,7 +4857,7 @@ macro (ip) +@@ -4735,7 +4872,7 @@ macro (ip) p += 4; } macro_build (p, &icnt, &offset_expr, @@ -772,7 +810,7 @@ "t,o(b)", PIC_CALL_REG, (int) BFD_RELOC_MIPS_GOT16, GP); p += 4; -@@ -4969,11 +5119,41 @@ macro (ip) +@@ -4997,11 +5134,41 @@ macro (ip) (char *) NULL); used_at = 0; } @@ -819,7 +857,7 @@ } else { -@@ -5030,7 +5210,7 @@ macro (ip) +@@ -5058,7 +5225,7 @@ macro (ip) as_bad (_("PIC code offset overflow (max 16 signed bits)")); frag_grow (20); macro_build ((char *) NULL, &icnt, &offset_expr, @@ -828,7 +866,7 @@ "t,o(b)", tempreg, (int) BFD_RELOC_MIPS_GOT16, GP); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", ""); p = frag_var (rs_machine_dependent, 4, 0, -@@ -7004,7 +7184,7 @@ mips_ip (str, ip) +@@ -7032,7 +7199,7 @@ mips_ip (str, ip) insn_error = NULL; for (args = insn->args;; ++args) { @@ -837,25 +875,29 @@ ++s; switch (*args) { -@@ -7653,29 +7833,32 @@ mips_ip (str, ip) +@@ -7681,33 +7848,32 @@ mips_ip (str, ip) case 'i': /* 16 bit unsigned immediate */ case 'j': /* 16 bit signed immediate */ - imm_reloc = BFD_RELOC_LO16; - c = my_getSmallExpression (&imm_expr, s); -- if (c != '\0') +- if (c != S_EX_NONE) + my_getSmallExpression (&imm_expr, &imm_relocs, s); + + if (imm_reloc != BFD_RELOC_UNUSED + && imm_expr.X_op == O_constant) { -- if (c != 'l') +- if (c != S_EX_LO) + if (imm_reloc == BFD_RELOC_HI16_S) { - if (imm_expr.X_op == O_constant) - imm_expr.X_add_number = - (imm_expr.X_add_number >> 16) & 0xffff; -- else if (c == 'h') +- else if (c == S_EX_HIGHEST) +- imm_reloc = BFD_RELOC_MIPS_HIGHEST; +- else if (c == S_EX_HIGHER) +- imm_reloc = BFD_RELOC_MIPS_HIGHER; +- else if (c == S_EX_HI) - { - imm_reloc = BFD_RELOC_HI16_S; - imm_unmatched_hi = true; @@ -880,23 +922,23 @@ + if (*args == 'i') { -- if ((c == '\0' && imm_expr.X_op != O_constant) +- if ((c == S_EX_NONE && imm_expr.X_op != O_constant) + if ((imm_reloc == BFD_RELOC_UNUSED + && imm_expr.X_op != O_constant) || ((imm_expr.X_add_number < 0 || imm_expr.X_add_number >= 0x10000) && imm_expr.X_op == O_constant)) -@@ -7708,7 +7891,8 @@ mips_ip (str, ip) +@@ -7740,7 +7906,8 @@ mips_ip (str, ip) max = 0x8000; else max = 0x10000; -- if ((c == '\0' && imm_expr.X_op != O_constant) +- if ((c == S_EX_NONE && imm_expr.X_op != O_constant) + if ((imm_reloc == BFD_RELOC_UNUSED + && imm_expr.X_op != O_constant) || ((imm_expr.X_add_number < -0x8000 || imm_expr.X_add_number >= max) && imm_expr.X_op == O_constant) -@@ -7725,11 +7909,14 @@ mips_ip (str, ip) +@@ -7757,11 +7924,14 @@ mips_ip (str, ip) as_bad (_("16 bit expression not in range -32768..32767")); } } @@ -912,20 +954,20 @@ /* If this value won't fit into a 16 bit offset, then go find a macro that will generate the 32 bit offset -@@ -7742,7 +7929,7 @@ mips_ip (str, ip) +@@ -7774,7 +7944,7 @@ mips_ip (str, ip) fashion is that the macro function doesn't expect to see anything which can be handled in a single constant instruction. */ -- if (c == 0 +- if (c == S_EX_NONE + if (offset_reloc == BFD_RELOC_UNUSED && (offset_expr.X_op != O_constant || offset_expr.X_add_number >= 0x8000 || offset_expr.X_add_number < -0x8000) -@@ -7752,14 +7939,28 @@ mips_ip (str, ip) +@@ -7784,14 +7954,28 @@ mips_ip (str, ip) != S_GET_SEGMENT (offset_expr.X_op_symbol)))) break; -- if (c == 'h' || c == 'H') +- if (c == S_EX_HI) + if (offset_expr.X_op == O_constant + && offset_reloc != BFD_RELOC_UNUSED) { @@ -956,25 +998,27 @@ s = expr_end; continue; -@@ -7770,30 +7971,36 @@ mips_ip (str, ip) +@@ -7802,32 +7986,36 @@ mips_ip (str, ip) continue; case 'u': /* upper 16 bits */ - c = my_getSmallExpression (&imm_expr, s); - imm_reloc = BFD_RELOC_LO16; -- if (c) +- if (c != S_EX_NONE) + my_getSmallExpression (&imm_expr, &imm_relocs, s); + + if (imm_reloc != BFD_RELOC_UNUSED + && imm_expr.X_op == O_constant) { -- if (c != 'l') +- if (c != S_EX_LO) + if (imm_reloc == BFD_RELOC_HI16_S) { - if (imm_expr.X_op == O_constant) - imm_expr.X_add_number = - (imm_expr.X_add_number >> 16) & 0xffff; -- else if (c == 'h') +- else if (c == S_EX_HIGHEST) +- imm_reloc = BFD_RELOC_MIPS_HIGHEST; +- else if (c == S_EX_HI) - { - imm_reloc = BFD_RELOC_HI16_S; - imm_unmatched_hi = true; @@ -1008,7 +1052,7 @@ s = expr_end; continue; -@@ -8226,7 +8433,7 @@ mips16_ip (str, ip) +@@ -8260,7 +8448,7 @@ mips16_ip (str, ip) explicit extensions correctly. */ imm_expr.X_op = O_constant; imm_expr.X_add_number = 0; @@ -1017,7 +1061,7 @@ continue; } -@@ -8234,7 +8441,7 @@ mips16_ip (str, ip) +@@ -8268,7 +8456,7 @@ mips16_ip (str, ip) } /* We need to relax this instruction. */ @@ -1026,12 +1070,9 @@ s = expr_end; continue; -@@ -8581,94 +8788,35 @@ mips16_immed (file, line, type, val, war - } +@@ -8616,151 +8804,34 @@ mips16_immed (file, line, type, val, war } --#define LP '(' --#define RP ')' -static int -my_getSmallExpression (ep, str) @@ -1042,91 +1083,150 @@ char *str; { - char *sp; -- int c = 0; +- char *oldstr = str; +- int c = S_EX_NONE; - - if (*str == ' ') + get_op_reloc (reloc, str); + while (*str == ' ') str++; -- if (*str == LP -- || (*str == '%' && -- ((str[1] == 'h' && str[2] == 'i') -- || (str[1] == 'H' && str[2] == 'I') -- || (str[1] == 'l' && str[2] == 'o')) -- && str[3] == LP)) -+ +- if (*str == '(') +- c = S_EX_NONE; +- else if (str[0] == '%' +- && tolower(str[1]) == 'l' +- && tolower(str[2]) == 'o' +- && str[3] == '(') +- { +- c = S_EX_LO; +- str += sizeof ("%lo(") - 2; +- } +- else if (str[0] == '%' +- && tolower(str[1]) == 'h' +- && tolower(str[2]) == 'i' +- && str[3] == '(') +- { +- c = S_EX_HI; +- str += sizeof ("%hi(") - 2; +- } +- else if (str[0] == '%' +- && tolower(str[1]) == 'h' +- && tolower(str[2]) == 'i' +- && tolower(str[3]) == 'g' +- && tolower(str[4]) == 'h' +- && tolower(str[5]) == 'e' +- && tolower(str[6]) == 'r' +- && str[7] == '(') +- { +- c = S_EX_HIGHER; +- str += sizeof ("%higher(") - 2; +- } +- else if (str[0] == '%' +- && tolower(str[1]) == 'h' +- && tolower(str[2]) == 'i' +- && tolower(str[3]) == 'g' +- && tolower(str[4]) == 'h' +- && tolower(str[5]) == 'e' +- && tolower(str[6]) == 's' +- && tolower(str[7]) == 't' +- && str[8] == '(') +- { +- c = S_EX_HIGHEST; +- str += sizeof ("%highest(") - 2; +- } +-/* currently unsupported */ +-#if 0 +- else if (str[0] == '%' +- && tolower(str[1]) == 'g' +- && tolower(str[2]) == 'p' +- && tolower(str[3]) == '_' +- && tolower(str[4]) == 'r' +- && tolower(str[5]) == 'e' +- && tolower(str[6]) == 'l' +- && str[7] == '(') +- { +- c = S_EX_GPREL; +- str += sizeof ("%gp_rel(") - 2; +- } +- else if (str[0] == '%' +- && tolower(str[1]) == 'n' +- && tolower(str[2]) == 'e' +- && tolower(str[3]) == 'g' +- && str[4] == '(') +- { +- c = S_EX_NEG; +- str += sizeof ("%neg(") - 2; +- } +-#endif +- else +- { +- my_getExpression (ep, str); +- return c; +- } + +- /* +- * A small expression may be followed by a base register. +- * Scan to the end of this operand, and then back over a possible +- * base register. Then scan the small expression up to that +- * point. (Based on code in sparc.c...) +- */ +- for (sp = str; *sp && *sp != ','; sp++) +- ; +- if (sp - 4 >= str && sp[-1] == ')') + /* Handle the case with no explicit offset */ + if (str[0] == '(' && str[1] == '$') { -- if (*str == LP) -- c = 0; -+ if (reloc->r1 != BFD_RELOC_UNUSED) -+ /* %reloc(reg) is an error */ -+ ep->X_op = O_absent; - else +- if (isdigit ((unsigned char) sp[-2])) - { -- c = str[1]; -- str += 3; -- } -+ ep->X_op = O_constant; - -- /* -- * A small expression may be followed by a base register. -- * Scan to the end of this operand, and then back over a possible -- * base register. Then scan the small expression up to that -- * point. (Based on code in sparc.c...) -- */ -- for (sp = str; *sp && *sp != ','; sp++) -- ; -- if (sp - 4 >= str && sp[-1] == RP) -- { -- if (isdigit ((unsigned char) sp[-2])) +- for (sp -= 3; sp >= str && isdigit ((unsigned char) *sp); sp--) +- ; +- if (*sp == '$' && sp > str && sp[-1] == '(') - { -- for (sp -= 3; sp >= str && isdigit ((unsigned char) *sp); sp--) -- ; -- if (*sp == '$' && sp > str && sp[-1] == LP) -- { -- sp--; -- goto do_it; -- } +- sp--; +- goto do_it; - } -- else if (sp - 5 >= str -- && sp[-5] == LP -- && sp[-4] == '$' -- && ((sp[-3] == 'f' && sp[-2] == 'p') -- || (sp[-3] == 's' && sp[-2] == 'p') -- || (sp[-3] == 'g' && sp[-2] == 'p') -- || (sp[-3] == 'a' && sp[-2] == 't'))) +- } +- else if (sp - 5 >= str +- && sp[-5] == '(' +- && sp[-4] == '$' +- && ((sp[-3] == 'f' && sp[-2] == 'p') +- || (sp[-3] == 's' && sp[-2] == 'p') +- || (sp[-3] == 'g' && sp[-2] == 'p') +- || (sp[-3] == 'a' && sp[-2] == 't'))) +- { +- sp -= 5; +- do_it: +- if (sp == str) - { -- sp -= 5; -- do_it: -- if (sp == str) +- /* no expression means zero offset */ +- if (c != S_EX_NONE) - { -- /* no expression means zero offset */ -- if (c) -- { -- /* %xx(reg) is an error */ -- ep->X_op = O_absent; -- expr_end = str - 3; -- } -- else -- { -- ep->X_op = O_constant; -- expr_end = sp; -- } -- ep->X_add_symbol = NULL; -- ep->X_op_symbol = NULL; -- ep->X_add_number = 0; +- /* %xx(reg) is an error */ +- ep->X_op = O_absent; +- expr_end = oldstr; - } - else - { -- *sp = '\0'; -- my_getExpression (ep, str); -- *sp = LP; +- ep->X_op = O_constant; +- expr_end = sp; - } -- return c; +- ep->X_add_symbol = NULL; +- ep->X_op_symbol = NULL; +- ep->X_add_number = 0; +- } +- else +- { +- *sp = '\0'; +- my_getExpression (ep, str); +- *sp = '('; - } +- return c; - } ++ if (reloc->r1 != BFD_RELOC_UNUSED) ++ /* %reloc(reg) is an error */ ++ ep->X_op = O_absent; ++ else ++ ep->X_op = O_constant; ++ + ep->X_add_symbol = NULL; + ep->X_op_symbol = NULL; + ep->X_add_number = 0; @@ -1134,13 +1234,15 @@ + expr_end = str; + return; } -+ - my_getExpression (ep, str); -- return c; /* => %hi or %lo encountered */ +- my_getExpression (ep, str); + +- /* => %highest, %higher, %hi, %lo, %gprel, %neg encountered */ +- return c; ++ my_getExpression (ep, str); } static void -@@ -8846,13 +8994,15 @@ struct option md_longopts[] = +@@ -8938,13 +9009,15 @@ struct option md_longopts[] = #define OPTION_CALL_SHARED (OPTION_ELF_BASE + 0) #define OPTION_NON_SHARED (OPTION_ELF_BASE + 1) #define OPTION_XGOT (OPTION_ELF_BASE + 2) @@ -1158,26 +1260,37 @@ {"64", no_argument, NULL, OPTION_64}, #endif -@@ -9123,6 +9273,10 @@ md_parse_option (c, arg) +@@ -9215,6 +9288,11 @@ md_parse_option (c, arg) mips_64 = 0; break; + case OPTION_N32: + mips_abi2 = 1; ++ mips_abi_string = "n32"; + break; + case OPTION_64: { const char **list, **l; -@@ -9138,6 +9292,7 @@ md_parse_option (c, arg) +@@ -9233,7 +9311,9 @@ md_parse_option (c, arg) + if (*l == NULL) as_fatal (_("No compiled in support for 64 bit object file format")); free (list); ++ mips_abi_string = "64"; mips_64 = 1; + mips_abi2 = 1; } break; #endif /* OBJ_ELF */ -@@ -9311,7 +9466,8 @@ MIPS options:\n\ +@@ -9277,6 +9357,7 @@ md_parse_option (c, arg) + { + mips_abi_string = arg; + mips_32bit_abi = (strcmp (arg, "32") == 0); ++ mips_abi2 = (strcmp (arg, "n32") == 0); + } + break; + +@@ -9407,7 +9488,8 @@ MIPS options:\n\ -non_shared do not generate position independent code\n\ -xgot assume a 32 bit GOT\n\ -32 create 32 bit object file (default)\n\ @@ -1187,7 +1300,7 @@ #endif } -@@ -9487,7 +9643,10 @@ mips_frob_file () +@@ -9552,7 +9634,10 @@ mips_frob_file () /* When generating embedded PIC code we must keep all PC relative relocations, in case the linker has to relax a call. We also need @@ -1199,7 +1312,7 @@ int mips_force_relocation (fixp) -@@ -9497,6 +9656,10 @@ mips_force_relocation (fixp) +@@ -9562,6 +9647,10 @@ mips_force_relocation (fixp) || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 1; @@ -1210,7 +1323,7 @@ return (mips_pic == EMBEDDED_PIC && (fixp->fx_pcrel || SWITCH_TABLE (fixp) -@@ -9618,6 +9781,8 @@ md_apply_fix (fixP, valueP) +@@ -9683,6 +9772,8 @@ md_apply_fix (fixP, valueP) case BFD_RELOC_MIPS_JMP: case BFD_RELOC_HI16: case BFD_RELOC_HI16_S: @@ -1219,7 +1332,7 @@ case BFD_RELOC_MIPS_GPREL: case BFD_RELOC_MIPS_LITERAL: case BFD_RELOC_MIPS_CALL16: -@@ -9627,6 +9792,7 @@ md_apply_fix (fixP, valueP) +@@ -9692,6 +9783,7 @@ md_apply_fix (fixP, valueP) case BFD_RELOC_MIPS_GOT_LO16: case BFD_RELOC_MIPS_CALL_HI16: case BFD_RELOC_MIPS_CALL_LO16: @@ -1227,7 +1340,7 @@ case BFD_RELOC_MIPS16_GPREL: if (fixP->fx_pcrel) as_bad_where (fixP->fx_file, fixP->fx_line, -@@ -10423,8 +10589,9 @@ s_cpload (ignore) +@@ -10486,8 +10578,9 @@ s_cpload (ignore) expressionS ex; int icnt = 0; @@ -1239,7 +1352,7 @@ { s_ignore (0); return; -@@ -10463,8 +10630,9 @@ s_cprestore (ignore) +@@ -10526,8 +10619,9 @@ s_cprestore (ignore) expressionS ex; int icnt = 0; @@ -1251,7 +1364,7 @@ { s_ignore (0); return; -@@ -10715,7 +10883,7 @@ nopic_need_relax (sym, before_relaxing) +@@ -10778,7 +10872,7 @@ nopic_need_relax (sym, before_relaxing) if (sym == 0) return 0; @@ -1260,7 +1373,7 @@ { const char *symname; int change; -@@ -11120,6 +11288,8 @@ tc_gen_reloc (section, fixp) +@@ -11183,6 +11277,8 @@ tc_gen_reloc (section, fixp) asection *section ATTRIBUTE_UNUSED; fixS *fixp; { @@ -1269,7 +1382,7 @@ static arelent *retval[4]; arelent *reloc; bfd_reloc_code_real_type code; -@@ -11127,8 +11297,21 @@ tc_gen_reloc (section, fixp) +@@ -11190,8 +11286,21 @@ tc_gen_reloc (section, fixp) reloc = retval[0] = (arelent *) xmalloc (sizeof (arelent)); retval[1] = NULL; @@ -1291,7 +1404,7 @@ reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; if (mips_pic == EMBEDDED_PIC -@@ -11187,7 +11370,8 @@ tc_gen_reloc (section, fixp) +@@ -11250,7 +11359,8 @@ tc_gen_reloc (section, fixp) || fixp->fx_r_type == BFD_RELOC_MIPS_GOT_HI16 || fixp->fx_r_type == BFD_RELOC_MIPS_GOT_LO16 || fixp->fx_r_type == BFD_RELOC_MIPS_CALL_HI16 @@ -1301,7 +1414,7 @@ { arelent *reloc2; -@@ -11470,6 +11654,188 @@ md_convert_frag (abfd, asec, fragp) +@@ -11533,6 +11643,188 @@ md_convert_frag (abfd, asec, fragp) } } @@ -1490,29 +1603,8 @@ #ifdef OBJ_ELF /* This function is called after the relocs have been generated. -@@ -11578,6 +11944,8 @@ mips_elf_final_processing () - ; - else if (strcmp (mips_abi_string, "32") == 0) - elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_O32; -+ else if (strcmp (mips_abi_string, "n32") == 0) -+ elf_elfheader (stdoutput)->e_flags |= EF_MIPS_ABI2; - else if (strcmp (mips_abi_string, "o64") == 0) - elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_O64; - else if (strcmp (mips_abi_string, "eabi") == 0) -@@ -11587,6 +11955,11 @@ mips_elf_final_processing () - else - elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_EABI32; - } -+ -+ /* FIXME: Add N64 */ -+ -+ if (mips_abi2) -+ elf_elfheader (stdoutput)->e_flags |= EF_MIPS_ABI2; - - if (mips_32bitmode) - elf_elfheader (stdoutput)->e_flags |= EF_MIPS_32BITMODE; ---- binutils/ld/configure.tgt.mips64 Sat Jul 14 10:19:28 2001 -+++ binutils/ld/configure.tgt Fri Aug 10 10:07:12 2001 +--- binutils/ld/configure.tgt.mips64 Mon Aug 27 08:53:03 2001 ++++ binutils/ld/configure.tgt Mon Aug 27 09:08:29 2001 @@ -286,6 +286,12 @@ mips*el-*-rtems*) targ_emul=elf32elmip ; mips*-*-rtems*) targ_emul=elf32ebmip ;; mips*el-*-vxworks*) targ_emul=elf32elmip ;; diff -uprN binutils-2.11.90.0.27/mips/gas-mips-dwarf2.patch binutils-2.11.90.0.29/mips/gas-mips-dwarf2.patch --- binutils-2.11.90.0.27/mips/gas-mips-dwarf2.patch Sat Aug 4 19:52:15 2001 +++ binutils-2.11.90.0.29/mips/gas-mips-dwarf2.patch Wed Dec 31 16:00:00 1969 @@ -1,33 +0,0 @@ -2001-08-02 H.J. Lu - - * config/tc-mips.c: Include "dwarf2dbg.h" for ELF. - (mips_nonecoff_pseudo_table): Use dwarf2_directive_loc on - "loc" for ELF. - -Index: gas/config/tc-mips.c -=================================================================== -RCS file: /work/cvs/gnu/binutils/gas/config/tc-mips.c,v -retrieving revision 1.46 -diff -u -p -r1.46 tc-mips.c ---- gas/config/tc-mips.c 2001/07/26 16:59:13 1.46 -+++ gas/config/tc-mips.c 2001/08/03 05:01:22 -@@ -80,6 +80,7 @@ static int mips_output_flavor () { retur - #include "ecoff.h" - - #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) -+#include "dwarf2dbg.h" - static char *mips_regmask_frag; - #endif - -@@ -800,7 +801,11 @@ static const pseudo_typeS mips_nonecoff_ - {"file", s_file, 0}, - {"fmask", s_mips_mask, 'F'}, - {"frame", s_mips_frame, 0}, -+#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) -+ {"loc", dwarf2_directive_loc, 0}, -+#else - {"loc", s_ignore, 0}, -+#endif - {"mask", s_mips_mask, 'R'}, - {"verstamp", s_ignore, 0}, - { NULL, NULL, 0 }, diff -uprN binutils-2.11.90.0.27/opcodes/ChangeLog binutils-2.11.90.0.29/opcodes/ChangeLog --- binutils-2.11.90.0.27/opcodes/ChangeLog Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/opcodes/ChangeLog Mon Aug 27 11:44:52 2001 @@ -1,3 +1,94 @@ +2001-08-27 David Edelsohn + Torbjorn Granlund + + * ppc-opc.c (DS): Add PPC_OPERAND_DS flag. + (LS): Define. + (insert_ds): Complain if not a multiple of 4. + (XSYNC): Define. + (XSYNC_MASK): Define. + (powerpc_opcodes): Add "slbmte", "lwsync", "ptesync", "slbmfev", + "slbmfee". Modify "sync" to use XSYNC_MASK and LS. + +2001-08-26 Andreas Jaeger + + * h8500-opc.h: Add default initializers to h8500_table to shut up + GCC warnings. + +2001-08-25 Andreas Jaeger + + * tic54x-dis.c: Add unused attributes where needed. + + * z8k-dis.c (output_instr): Add unused attribute. + + * h8300-dis.c: Add missing prototypes. + (bfd_h8_disassemble): Make static. + + * cris-dis.c: Add missing prototype. + * h8500-dis.c: Likewise. + * m68hc11-dis.c: Likewise. + * pj-dis.c: Likewise. + * tic54x-dis.c: Likewise. + * v850-dis.c: Likewise. + * vax-dis.c: Likewise. + * w65-dis.c: Likewise. + * z8k-dis.c: Likewise. + + * d10v-dis.c: Add missing prototype. + (dis_long): Remove unused variable. + (dis_2_short): Likewise. + + * sh-dis.c: Add missing prototypes. + * v850-opc.c: Likewise. + Add unused attributes where needed. + + * ns32k-dis.c: Add missing prototypes. + (bit_extract_simple): Remove unused variable. + +2001-08-23 Martin Schwidefsky + + * opcodes/s390-opc.c: Add "low or high" and "not low or high" + branch instructions for gcc 3.0. + * opcodes/s390-opc.txt: Likewise. + +2001-08-21 Andreas Jaeger + + * i960-dis.c: Add parameters for prototypes + (ctrl): Add unused attributes. + (cobr): Likewise. + (put_abs): Likewise. + + * mips-dis.c: Add missing prototypes. + * a29k-dis.c: Likewise. + * arc-dis.c: Likewise. + * ia64-opc.c: Likewise. + + * s390-dis.c: Add missing prototypes. + (init_disasm): Remove unused attribute since the parameter is + used. + +2001-08-16 Thiemo Seufer + + * mips-opc.c (M1): Define. Reformatted Code. + (mips_builtin_opcodes): Added performance counter opcodes mfpc, mfps, + mtps, mtps. Typo. + +2001-08-16 Jonathan Larmour + + * mips-opc.c: R3900s can support all branch likely INSN_MACROs where + the corresponding non-likely insn is in MIPS I. + +2001-08-13 Kazu Hirata + + * mcore-dis.c: Fix formatting. + * mips-dis.c: Likewise. + * pj-dis.c: Likewise. + * z8k-dis.c: Likewise. + +2001-08-12 Richard Henderson + + * cgen-ibld.in (extract_normal): Match type of VALUE and MASK + to *VALUEP. Regenerate all cgen files. + 2001-08-10 Richard Sandiford * mips-dis.c (print_insn_mips): Remove OPCODE_IS_MEMBER's gp32 @@ -49,8 +140,8 @@ 2001-07-28 Matthias Kramm - * i386-dis.c: Change formatting conventions for architecture - i386:intel to better match the format of various intel i386 + * i386-dis.c: Change formatting conventions for architecture + i386:intel to better match the format of various intel i386 assemblers, like nasm, tasm or masm. 2001-07-24 Alan Modra @@ -93,9 +184,9 @@ * cgen-asm.in: Include "xregex.h" always to enable the libiberty regex support. (@arch@_cgen_build_insn_regex): New routine from Graydon. - (@arch@_cgen_assemble_insn): Add Graydon's code to use regex + (@arch@_cgen_assemble_insn): Add Graydon's code to use regex to verify if it is worth parsing the insn as insn "x". Also update - error message when insn is not a recognized format of the insn vs + error message when insn is not a recognized format of the insn vs when the insn is completely unrecognized. 2001-07-11 Frank Ch. Eigler diff -uprN binutils-2.11.90.0.27/opcodes/a29k-dis.c binutils-2.11.90.0.29/opcodes/a29k-dis.c --- binutils-2.11.90.0.27/opcodes/a29k-dis.c Thu Mar 15 14:51:59 2001 +++ binutils-2.11.90.0.29/opcodes/a29k-dis.c Wed Aug 22 08:52:10 2001 @@ -1,5 +1,5 @@ /* Instruction printing code for the AMD 29000 - Copyright 1990, 1993, 1994, 1995, 1998, 2000 + Copyright 1990, 1993, 1994, 1995, 1998, 2000, 2001 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Jim Kingdon. @@ -23,6 +23,18 @@ Foundation, Inc., 59 Temple Place - Suit #include "dis-asm.h" #include "opcode/a29k.h" +static void print_general PARAMS ((int, struct disassemble_info *)); +static void print_special PARAMS ((unsigned int, struct disassemble_info *)); +static int is_delayed_branch PARAMS ((int)); +static void find_bytes_little + PARAMS ((char *, unsigned char *, unsigned char *, unsigned char *, + unsigned char *)); +static void find_bytes_big + PARAMS ((char *, unsigned char *, unsigned char *, unsigned char *, + unsigned char *)); +static int print_insn PARAMS ((bfd_vma, struct disassemble_info *)); + + /* Print a symbolic representation of a general-purpose register number NUM on STREAM. NUM is a number as found in the instruction, not as found in @@ -39,7 +51,7 @@ print_general (num, info) } /* Like print_general but a special-purpose register. - + The mnemonics used by the AMD assembler are not quite the same as the ones in the User's Manual. We use the ones that the assembler uses. */ @@ -171,7 +183,7 @@ print_insn (memaddr, info) if (((unsigned long) insn24 << 24) == opcode->opcode) { char *s; - + (*info->fprintf_func) (info->stream, "%s ", opcode->name); for (s = opcode->args; *s != '\0'; ++s) { @@ -180,7 +192,7 @@ print_insn (memaddr, info) case 'a': print_general (insn8, info); break; - + case 'b': print_general (insn0, info); break; @@ -281,7 +293,7 @@ print_insn (memaddr, info) int errcode; char prev_insn[4]; unsigned char prev_insn0, prev_insn8, prev_insn16, prev_insn24; - + errcode = (*info->read_memory_func) (memaddr - 4, (bfd_byte *) &prev_insn[0], 4, @@ -291,7 +303,7 @@ print_insn (memaddr, info) /* If it is a delayed branch, we need to look at the instruction before the delayed brach to handle things like - + const _foo call _printf consth _foo @@ -306,7 +318,7 @@ print_insn (memaddr, info) &prev_insn16, &prev_insn24); } } - + /* If there was a problem reading memory, then assume the previous instruction was not const. */ if (errcode == 0) diff -uprN binutils-2.11.90.0.27/opcodes/arc-dis.c binutils-2.11.90.0.29/opcodes/arc-dis.c --- binutils-2.11.90.0.27/opcodes/arc-dis.c Thu Mar 15 14:52:00 2001 +++ binutils-2.11.90.0.29/opcodes/arc-dis.c Wed Aug 22 08:52:10 2001 @@ -35,16 +35,16 @@ #define dbg (0) #endif -#define BIT(word,n) ((word) & (1 << n)) -#define BITS(word,s,e) (((word) << (31 - e)) >> (s + (31 - e))) -#define OPCODE(word) (BITS ((word), 27, 31)) -#define FIELDA(word) (BITS ((word), 21, 26)) -#define FIELDB(word) (BITS ((word), 15, 20)) -#define FIELDC(word) (BITS ((word), 9, 14)) +#define BIT(word,n) ((word) & (1 << n)) +#define BITS(word,s,e) (((word) << (31 - e)) >> (s + (31 - e))) +#define OPCODE(word) (BITS ((word), 27, 31)) +#define FIELDA(word) (BITS ((word), 21, 26)) +#define FIELDB(word) (BITS ((word), 15, 20)) +#define FIELDC(word) (BITS ((word), 9, 14)) /* FIELD D is signed in all of its uses, so we make sure argument is treated as signed for bit shifting purposes: */ -#define FIELDD(word) (BITS (((signed int)word), 0, 8)) +#define FIELDD(word) (BITS (((signed int)word), 0, 8)) #define PUT_NEXT_WORD_IN(a) \ do \ @@ -136,20 +136,35 @@ (IS_REG (x) ? cb1"%r"ca1 : \ usesAuxReg ? cb"%a"ca : \ IS_SMALL (x) ? cb"%d"ca : cb"%h"ca)) -#define WRITE_FORMAT_RB() strcat (formatString, "]") +#define WRITE_FORMAT_RB() strcat (formatString, "]") #define WRITE_COMMENT(str) (state->comm[state->commNum++] = (str)) -#define WRITE_NOP_COMMENT() if (!fieldAisReg && !flag) WRITE_COMMENT ("nop"); +#define WRITE_NOP_COMMENT() if (!fieldAisReg && !flag) WRITE_COMMENT ("nop"); -#define NEXT_WORD(x) (offset += 4, state->words[x]) +#define NEXT_WORD(x) (offset += 4, state->words[x]) -#define add_target(x) (state->targets[state->tcnt++] = (x)) +#define add_target(x) (state->targets[state->tcnt++] = (x)) static char comment_prefix[] = "\t; "; +static const char *core_reg_name PARAMS ((struct arcDisState *, int)); +static const char *aux_reg_name PARAMS ((struct arcDisState *, int)); +static const char *cond_code_name PARAMS ((struct arcDisState *, int)); +static const char *instruction_name + PARAMS ((struct arcDisState *, int, int, int *)); +static void mwerror PARAMS ((struct arcDisState *, const char *)); +static const char *post_address PARAMS ((struct arcDisState *, int)); +static void write_comments_ + PARAMS ((struct arcDisState *, int, int, long int)); +static void write_instr_name_ + PARAMS ((struct arcDisState *, const char *, int, int, int, int, int, int)); +static int dsmOneArcInst PARAMS ((bfd_vma, struct arcDisState *)); +static const char *_coreRegName PARAMS ((void *, int)); +static int decodeInstr PARAMS ((bfd_vma, disassemble_info *)); + static const char * core_reg_name (state, val) struct arcDisState * state; - int val; + int val; { if (state->coreRegName) return (*state->coreRegName)(state->_this, val); @@ -159,7 +174,7 @@ core_reg_name (state, val) static const char * aux_reg_name (state, val) struct arcDisState * state; - int val; + int val; { if (state->auxRegName) return (*state->auxRegName)(state->_this, val); @@ -169,7 +184,7 @@ aux_reg_name (state, val) static const char * cond_code_name (state, val) struct arcDisState * state; - int val; + int val; { if (state->condCodeName) return (*state->condCodeName)(state->_this, val); @@ -181,7 +196,7 @@ instruction_name (state, op1, op2, flags struct arcDisState * state; int op1; int op2; - int * flags; + int * flags; { if (state->instName) return (*state->instName)(state->_this, op1, op2, flags); @@ -191,7 +206,7 @@ instruction_name (state, op1, op2, flags static void mwerror (state, msg) struct arcDisState * state; - const char * msg; + const char * msg; { if (state->err != 0) (*state->err)(state->_this, (msg)); @@ -200,7 +215,7 @@ mwerror (state, msg) static const char * post_address (state, addr) struct arcDisState * state; - int addr; + int addr; { static char id[3 * ARRAY_SIZE (state->addresses)]; int j, i = state->acnt; @@ -213,47 +228,47 @@ post_address (state, addr) id[j+0] = '@'; id[j+1] = '0'+i; id[j+2] = 0; - + return id + j; } return ""; } -static void +static void my_sprintf ( struct arcDisState * state, char * buf, const char * format, ...) { - char *bp; + char *bp; const char *p; int size, leading_zero, regMap[2]; long auxNum; va_list ap; - + va_start (ap, format); - - bp = buf; + + bp = buf; *bp = 0; p = format; auxNum = -1; regMap[0] = 0; regMap[1] = 0; - - while (1) + + while (1) switch (*p++) { case 0: goto DOCOMM; /* (return) */ - default: - *bp++ = p[-1]; + default: + *bp++ = p[-1]; break; case '%': size = 0; leading_zero = 0; RETRY: ; - switch (*p++) + switch (*p++) { case '0': case '1': @@ -279,25 +294,25 @@ my_sprintf ( } #define inc_bp() bp = bp + strlen (bp) - case 'h': + case 'h': { unsigned u = va_arg (ap, int); /* Hex. We can change the format to 0x%08x in one place, here, if we wish. We add underscores for easy reading. */ - if (u > 65536) + if (u > 65536) sprintf (bp, "0x%x_%04x", u >> 16, u & 0xffff); - else + else sprintf (bp, "0x%x", u); inc_bp (); - } + } break; - case 'X': case 'x': + case 'X': case 'x': { int val = va_arg (ap, int); - if (size != 0) + if (size != 0) if (leading_zero) sprintf (bp, "%0*x", size, val); else @@ -307,10 +322,10 @@ my_sprintf ( inc_bp (); } break; - case 'd': + case 'd': { int val = va_arg (ap, int); - + if (size != 0) sprintf (bp, "%*d", size, val); else @@ -318,15 +333,15 @@ my_sprintf ( inc_bp (); } break; - case 'r': + case 'r': { /* Register. */ int val = va_arg (ap, int); - + #define REG2NAME(num, name) case num: sprintf (bp, ""name); \ regMap[(num < 32) ? 0 : 1] |= 1 << (num - ((num < 32) ? 0 : 32)); break; - - switch (val) + + switch (val) { REG2NAME (26, "gp"); REG2NAME (27, "fp"); @@ -349,15 +364,15 @@ my_sprintf ( } inc_bp (); } break; - - case 'a': + + case 'a': { /* Aux Register. */ int val = va_arg (ap, int); #define AUXREG2NAME(num, name) case num: sprintf (bp,name); break; - switch (val) + switch (val) { AUXREG2NAME (0x0, "status"); AUXREG2NAME (0x1, "semaphore"); @@ -380,14 +395,14 @@ my_sprintf ( inc_bp (); } break; - - case 's': + + case 's': { sprintf (bp, "%s", va_arg (ap, char *)); inc_bp (); } break; - + default: fprintf (stderr, "?? format %c\n", p[-1]); break; @@ -397,30 +412,30 @@ my_sprintf ( DOCOMM: *bp = 0; } -static void +static void write_comments_(state, shimm, is_limm, limm_value) struct arcDisState * state; int shimm; int is_limm; long limm_value; { - if (state->commentBuffer != 0) + if (state->commentBuffer != 0) { int i; - if (is_limm) + if (is_limm) { const char *name = post_address (state, limm_value + shimm); if (*name != 0) WRITE_COMMENT (name); } - for (i = 0; i < state->commNum; i++) + for (i = 0; i < state->commNum; i++) { if (i == 0) strcpy (state->commentBuffer, comment_prefix); else - strcat (state->commentBuffer, ", "); + strcat (state->commentBuffer, ", "); strncat (state->commentBuffer, state->comm[i], sizeof (state->commentBuffer)); } } @@ -431,11 +446,11 @@ write_comments_(state, shimm, is_limm, l static const char *condName[] = { /* 0..15. */ - "" , "z" , "nz" , "p" , "n" , "c" , "nc" , "v" , + "" , "z" , "nz" , "p" , "n" , "c" , "nc" , "v" , "nv" , "gt" , "ge" , "lt" , "le" , "hi" , "ls" , "pnz" }; -static void +static void write_instr_name_(state, instrName, cond, condCodeIsPartOfName, flag, signExtend, addrWriteBack, directMem) struct arcDisState * state; const char * instrName; @@ -448,7 +463,7 @@ write_instr_name_(state, instrName, cond { strcpy (state->instrBuffer, instrName); - if (cond > 0) + if (cond > 0) { const char *cc = 0; @@ -469,7 +484,7 @@ write_instr_name_(state, instrName, cond if (flag) strcat (state->instrBuffer, ".f"); - switch (state->nullifyMode) + switch (state->nullifyMode) { case BR_exec_always: strcat (state->instrBuffer, ".d"); @@ -498,16 +513,16 @@ write_instr_name_(state, instrName, cond } \ while (0) -enum { - op_LD0 = 0, op_LD1 = 1, op_ST = 2, op_3 = 3, +enum { + op_LD0 = 0, op_LD1 = 1, op_ST = 2, op_3 = 3, op_BC = 4, op_BLC = 5, op_LPC = 6, op_JC = 7, - op_ADD = 8, op_ADC = 9, op_SUB = 10, op_SBC = 11, + op_ADD = 8, op_ADC = 9, op_SUB = 10, op_SBC = 11, op_AND = 12, op_OR = 13, op_BIC = 14, op_XOR = 15 }; extern disassemble_info tm_print_insn_info; -static int +static int dsmOneArcInst (addr, state) bfd_vma addr; struct arcDisState * state; @@ -536,22 +551,22 @@ dsmOneArcInst (addr, state) int flags; int ignoreFirstOpd; char formatString[60]; - + state->instructionLen = 4; state->nullifyMode = BR_exec_when_no_jump; state->opWidth = 12; state->isBranch = 0; - + state->_mem_load = 0; state->_ea_present = 0; state->_load_len = 0; state->ea_reg1 = no_reg; state->ea_reg2 = no_reg; state->_offset = 0; - + if (! NEXT_WORD (0)) return 0; - + state->_opcode = OPCODE (state->words[0]); instrName = 0; decodingClass = 0; /* default! */ @@ -566,10 +581,10 @@ dsmOneArcInst (addr, state) if (state->commentBuffer) state->commentBuffer[0] = '\0'; - switch (state->_opcode) + switch (state->_opcode) { - case op_LD0: - switch (BITS (state->words[0],1,2)) + case op_LD0: + switch (BITS (state->words[0],1,2)) { case 0: instrName = "ld"; @@ -584,22 +599,22 @@ dsmOneArcInst (addr, state) state->_load_len = 2; break; default: - instrName = "??? (0[3])"; + instrName = "??? (0[3])"; state->flow = invalid_instr; break; } - decodingClass = 5; + decodingClass = 5; break; - - case op_LD1: - if (BIT (state->words[0],13)) + + case op_LD1: + if (BIT (state->words[0],13)) { - instrName = "lr"; + instrName = "lr"; decodingClass = 10; } - else + else { - switch (BITS (state->words[0],10,11)) + switch (BITS (state->words[0],10,11)) { case 0: instrName = "ld"; @@ -614,23 +629,23 @@ dsmOneArcInst (addr, state) state->_load_len = 2; break; default: - instrName = "??? (1[3])"; + instrName = "??? (1[3])"; state->flow = invalid_instr; break; } decodingClass = 6; } break; - + case op_ST: - if (BIT (state->words[0],25)) + if (BIT (state->words[0],25)) { instrName = "sr"; decodingClass = 8; } - else + else { - switch (BITS (state->words[0],22,23)) + switch (BITS (state->words[0],22,23)) { case 0: instrName = "st"; @@ -642,20 +657,20 @@ dsmOneArcInst (addr, state) instrName = "stw"; break; default: - instrName = "??? (2[3])"; + instrName = "??? (2[3])"; state->flow = invalid_instr; break; } decodingClass = 7; } break; - + case op_3: decodingClass = 1; /* default for opcode 3... */ - switch (FIELDC (state->words[0])) + switch (FIELDC (state->words[0])) { case 0: - instrName = "flag"; + instrName = "flag"; decodingClass = 2; break; case 1: @@ -682,10 +697,10 @@ dsmOneArcInst (addr, state) case 8: instrName = "extw"; break; - case 0x3f: + case 0x3f: { decodingClass = 9; - switch( FIELDD (state->words[0]) ) + switch( FIELDD (state->words[0]) ) { case 0: instrName = "brk"; @@ -703,7 +718,7 @@ dsmOneArcInst (addr, state) } } break; - + /* ARC Extension Library Instructions NOTE: We assume that extension codes are these instrs. */ default: @@ -723,24 +738,24 @@ dsmOneArcInst (addr, state) break; case op_BC: - instrName = "b"; + instrName = "b"; case op_BLC: if (!instrName) - instrName = "bl"; + instrName = "bl"; case op_LPC: if (!instrName) - instrName = "lp"; + instrName = "lp"; case op_JC: if (!instrName) { - if (BITS (state->words[0],9,9)) + if (BITS (state->words[0],9,9)) { - instrName = "jl"; + instrName = "jl"; is_linked = 1; } - else + else { - instrName = "j"; + instrName = "j"; is_linked = 0; } } @@ -748,14 +763,14 @@ dsmOneArcInst (addr, state) decodingClass = ((state->_opcode == op_JC) ? 4 : 3); state->isBranch = 1; break; - + case op_ADD: case op_ADC: case op_AND: repeatsOp = (FIELDC (state->words[0]) == FIELDB (state->words[0])); decodingClass = 0; - switch (state->_opcode) + switch (state->_opcode) { case op_ADD: instrName = (repeatsOp ? "asl" : "add"); @@ -768,7 +783,7 @@ dsmOneArcInst (addr, state) break; } break; - + case op_SUB: instrName = "sub"; break; case op_SBC: instrName = "sbc"; @@ -785,10 +800,10 @@ dsmOneArcInst (addr, state) instrName = "nop"; decodingClass = 9; } - else + else instrName = "xor"; break; - + default: instrName = instruction_name (state,state->_opcode,0,&flags); /* if (instrName) printf("FLAGS=0x%x\n", flags); */ @@ -801,14 +816,14 @@ dsmOneArcInst (addr, state) ignoreFirstOpd = 1; break; } - + fieldAisReg = fieldBisReg = fieldCisReg = 1; /* Assume regs for now. */ flag = cond = is_shimm = is_limm = 0; state->nullifyMode = BR_exec_when_no_jump; /* 0 */ signExtend = addrWriteBack = directMem = 0; usesAuxReg = 0; - - switch (decodingClass) + + switch (decodingClass) { case 0: CHECK_FIELD_A (); @@ -816,9 +831,9 @@ dsmOneArcInst (addr, state) if (!repeatsOp) CHECK_FIELD_C (); CHECK_FLAG_COND_NULLIFY (); - + write_instr_name (); - if (!ignoreFirstOpd) + if (!ignoreFirstOpd) { WRITE_FORMAT_x (A); WRITE_FORMAT_COMMA_x (B); @@ -827,7 +842,7 @@ dsmOneArcInst (addr, state) WRITE_NOP_COMMENT (); my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB, fieldC); } - else + else { WRITE_FORMAT_x (B); if (!repeatsOp) @@ -836,49 +851,49 @@ dsmOneArcInst (addr, state) } write_comments (); break; - + case 1: CHECK_FIELD_A (); CHECK_FIELD_B (); CHECK_FLAG_COND_NULLIFY (); - + write_instr_name (); - if (!ignoreFirstOpd) + if (!ignoreFirstOpd) { WRITE_FORMAT_x (A); WRITE_FORMAT_COMMA_x (B); WRITE_NOP_COMMENT (); - my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB); + my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB); } - else + else { WRITE_FORMAT_x (B); - my_sprintf (state, state->operandBuffer, formatString, fieldB); + my_sprintf (state, state->operandBuffer, formatString, fieldB); } write_comments (); break; - + case 2: CHECK_FIELD_B (); CHECK_FLAG_COND_NULLIFY (); flag = 0; /* this is the FLAG instruction -- it's redundant */ - + write_instr_name (); WRITE_FORMAT_x (B); my_sprintf (state, state->operandBuffer, formatString, fieldB); write_comments (); break; - + case 3: fieldA = BITS (state->words[0],7,26) << 2; fieldA = (fieldA << 10) >> 10; /* make it signed */ fieldA += addr + 4; CHECK_FLAG_COND_NULLIFY (); flag = 0; - + write_instr_name (); /* This address could be a label we know. Convert it. */ - if (state->_opcode != op_LPC /* LP */) + if (state->_opcode != op_LPC /* LP */) { add_target (fieldA); /* For debugger. */ state->flow = state->_opcode == op_BLC /* BL */ @@ -886,13 +901,13 @@ dsmOneArcInst (addr, state) : direct_jump; /* indirect calls are achieved by "lr blink,[status]; lr dest<- func addr; j [dest]" */ - } - + } + strcat (formatString, "%s"); /* address/label name */ my_sprintf (state, state->operandBuffer, formatString, post_address (state, fieldA)); write_comments (); break; - + case 4: /* For op_JC -- jump to address specified. Also covers jump and link--bit 9 of the instr. word @@ -900,8 +915,8 @@ dsmOneArcInst (addr, state) fieldA = 0; CHECK_FIELD_B (); CHECK_FLAG_COND_NULLIFY (); - - if (!fieldBisReg) + + if (!fieldBisReg) { fieldAisReg = 0; fieldA = (fieldB >> 25) & 0x7F; /* flags */ @@ -913,7 +928,7 @@ dsmOneArcInst (addr, state) if (is_linked && state->nullifyMode == BR_exec_when_jump) state->nullifyMode = BR_exec_when_no_jump; } - else + else { state->flow = is_linked ? indirect_call : indirect_jump; /* We should also treat this as indirect call if NOT linked @@ -922,11 +937,11 @@ dsmOneArcInst (addr, state) * For now we can't detect such. */ state->register_for_indirect_jump = fieldB; } - + write_instr_name (); - strcat (formatString, + strcat (formatString, IS_REG (B) ? "[%r]" : "%s"); /* address/label name */ - if (fieldA != 0) + if (fieldA != 0) { fieldAisReg = 0; WRITE_FORMAT_COMMA_x (A); @@ -934,11 +949,11 @@ dsmOneArcInst (addr, state) if (IS_REG (B)) my_sprintf (state, state->operandBuffer, formatString, fieldB, fieldA); else - my_sprintf (state, state->operandBuffer, formatString, + my_sprintf (state, state->operandBuffer, formatString, post_address (state, fieldB), fieldA); write_comments (); break; - + case 5: /* LD instruction. B and C can be regs, or one (both?) can be limm. */ @@ -959,29 +974,29 @@ dsmOneArcInst (addr, state) else state->_offset += fieldC; state->_mem_load = 1; - + directMem = BIT (state->words[0],5); addrWriteBack = BIT (state->words[0],3); signExtend = BIT (state->words[0],0); - + write_instr_name (); WRITE_FORMAT_x_COMMA_LB(A); if (fieldBisReg || fieldB != 0) WRITE_FORMAT_x_COMMA (B); else fieldB = fieldC; - + WRITE_FORMAT_x_RB (C); my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB, fieldC); write_comments (); break; - + case 6: /* LD instruction. */ CHECK_FIELD_B (); CHECK_FIELD_A (); fieldC = FIELDD (state->words[0]); - + if (dbg) printf ("6:b reg %d %d c 0x%x \n", fieldBisReg, fieldB, fieldC); @@ -994,22 +1009,22 @@ dsmOneArcInst (addr, state) Say ea is not present, so only one of us will do the name lookup. */ else state->_offset += fieldB, state->_ea_present = 0; - + directMem = BIT (state->words[0],14); addrWriteBack = BIT (state->words[0],12); signExtend = BIT (state->words[0],9); - + write_instr_name (); WRITE_FORMAT_x_COMMA_LB (A); - if (!fieldBisReg) + if (!fieldBisReg) { fieldB = state->_offset; WRITE_FORMAT_x_RB (B); } - else + else { WRITE_FORMAT_x (B); - if (fieldC != 0 && !BIT (state->words[0],13)) + if (fieldC != 0 && !BIT (state->words[0],13)) { fieldCisReg = 0; WRITE_FORMAT_COMMA_x_RB (C); @@ -1020,13 +1035,13 @@ dsmOneArcInst (addr, state) my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB, fieldC); write_comments (); break; - + case 7: /* ST instruction. */ CHECK_FIELD_B(); CHECK_FIELD_C(); fieldA = FIELDD(state->words[0]); /* shimm */ - + /* [B,A offset] */ if (dbg) printf("7:b reg %d %x off %x\n", fieldBisReg,fieldB,fieldA); @@ -1034,27 +1049,27 @@ dsmOneArcInst (addr, state) state->_offset = fieldA; if (fieldBisReg) state->ea_reg1 = fieldB; - /* field B is either a shimm (same as fieldA) or limm (different!) + /* field B is either a shimm (same as fieldA) or limm (different!) Say ea is not present, so only one of us will do the name lookup. (for is_limm we do the name translation here). */ - else + else state->_offset += fieldB, state->_ea_present = 0; - + directMem = BIT(state->words[0],26); addrWriteBack = BIT(state->words[0],24); - + write_instr_name(); WRITE_FORMAT_x_COMMA_LB(C); - - if (!fieldBisReg) + + if (!fieldBisReg) { fieldB = state->_offset; WRITE_FORMAT_x_RB(B); } - else + else { WRITE_FORMAT_x(B); - if (fieldBisReg && fieldA != 0) + if (fieldBisReg && fieldA != 0) { fieldAisReg = 0; WRITE_FORMAT_COMMA_x_RB(A); @@ -1069,7 +1084,7 @@ dsmOneArcInst (addr, state) /* SR instruction */ CHECK_FIELD_B(); CHECK_FIELD_C(); - + write_instr_name(); WRITE_FORMAT_x_COMMA_LB(C); /* Try to print B as an aux reg if it is not a core reg. */ @@ -1079,17 +1094,17 @@ dsmOneArcInst (addr, state) my_sprintf (state, state->operandBuffer, formatString, fieldC, fieldB); write_comments(); break; - + case 9: write_instr_name(); state->operandBuffer[0] = '\0'; break; - + case 10: /* LR instruction */ CHECK_FIELD_A(); CHECK_FIELD_B(); - + write_instr_name(); WRITE_FORMAT_x_COMMA_LB(A); /* Try to print B as an aux reg if it is not a core reg. */ @@ -1099,18 +1114,18 @@ dsmOneArcInst (addr, state) my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB); write_comments(); break; - + case 11: CHECK_COND(); write_instr_name(); state->operandBuffer[0] = '\0'; break; - + default: mwerror (state, "Bad decoding class in ARC disassembler"); break; } - + state->_cond = cond; return state->instructionLen = offset; } @@ -1158,11 +1173,11 @@ decodeInstr (address, info) bfd_byte buffer[4]; struct arcDisState s; /* ARC Disassembler state */ void *stream = info->stream; /* output stream */ - fprintf_ftype func = info->fprintf_func; + fprintf_ftype func = info->fprintf_func; int bytes; - + memset (&s, 0, sizeof(struct arcDisState)); - + /* read first instruction */ status = (*info->read_memory_func) (address, buffer, 4, info); if (status != 0) @@ -1195,9 +1210,9 @@ decodeInstr (address, info) /* display the disassembly instruction */ (*func) (stream, "%08x ", s.words[0]); (*func) (stream, " "); - + (*func) (stream, "%-10s ", s.instrBuffer); - + if (__TRANSLATION_REQUIRED(s)) { bfd_vma addr = s.addresses[s.operandBuffer[1] - '0']; diff -uprN binutils-2.11.90.0.27/opcodes/cgen-ibld.in binutils-2.11.90.0.29/opcodes/cgen-ibld.in --- binutils-2.11.90.0.27/opcodes/cgen-ibld.in Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.29/opcodes/cgen-ibld.in Wed Aug 22 08:52:10 2001 @@ -415,7 +415,7 @@ extract_normal (cd, ex_info, insn_value, #endif long *valuep; { - CGEN_INSN_INT value, mask; + long value, mask; /* If LENGTH is zero, this operand doesn't contribute to the value so give it a standard value of zero. */ diff -uprN binutils-2.11.90.0.27/opcodes/cris-dis.c binutils-2.11.90.0.29/opcodes/cris-dis.c --- binutils-2.11.90.0.27/opcodes/cris-dis.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/opcodes/cris-dis.c Mon Aug 27 11:44:52 2001 @@ -7,7 +7,7 @@ This file is part of the GNU binutils an This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your option) +Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT @@ -97,6 +97,8 @@ static int print_insn_cris_with_register PARAMS ((bfd_vma, disassemble_info *)); static int print_insn_cris_without_register_prefix PARAMS ((bfd_vma, disassemble_info *)); +static const struct cris_opcode *get_opcode_entry + PARAMS ((unsigned int, unsigned int)); /* Return the descriptor of a special register. FIXME: Depend on a CPU-version specific argument when all machinery diff -uprN binutils-2.11.90.0.27/opcodes/d10v-dis.c binutils-2.11.90.0.29/opcodes/d10v-dis.c --- binutils-2.11.90.0.27/opcodes/d10v-dis.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/opcodes/d10v-dis.c Mon Aug 27 11:44:52 2001 @@ -29,6 +29,9 @@ static void dis_2_short PARAMS ((unsigne struct disassemble_info *info, int order)); static void dis_long PARAMS ((unsigned long insn, bfd_vma memaddr, struct disassemble_info *info)); +static void print_operand + PARAMS ((struct d10v_operand *, long unsigned int, struct d10v_opcode *, + bfd_vma, struct disassemble_info *)); int print_insn_d10v (memaddr, info) @@ -192,7 +195,6 @@ dis_long (insn, memaddr, info) struct disassemble_info *info; { int i; - char buf[32]; struct d10v_opcode *op = (struct d10v_opcode *) d10v_opcodes; struct d10v_operand *oper; int need_paren = 0; @@ -235,10 +237,8 @@ dis_2_short (insn, memaddr, info, order) int order; { int i, j; - char astr[2][32]; unsigned int ins[2]; struct d10v_opcode *op; - char buf[32]; int match, num_match = 0; struct d10v_operand *oper; int need_paren = 0; diff -uprN binutils-2.11.90.0.27/opcodes/fr30-asm.c binutils-2.11.90.0.29/opcodes/fr30-asm.c --- binutils-2.11.90.0.27/opcodes/fr30-asm.c Thu Mar 15 14:52:03 2001 +++ binutils-2.11.90.0.29/opcodes/fr30-asm.c Wed Aug 22 08:52:10 2001 @@ -34,6 +34,7 @@ along with this program; if not, write t #include "fr30-desc.h" #include "fr30-opc.h" #include "opintl.h" +#include "xregex.h" #undef min #define min(a,b) ((a) < (b) ? (a) : (b)) @@ -325,6 +326,104 @@ fr30_cgen_init_asm (cd) } + +/* + Regex construction routine. + + This translates an opcode syntax string into a regex string, + by replacing any non-character syntax element (such as an + opcode) with the pattern '.*' + + It then compiles the regex and stores it in the opcode, for + later use by fr30_cgen_assemble_insn + + returns NULL for success, an error message for failure +*/ + +char * +fr30_cgen_build_insn_regex (insn) + CGEN_INSN *insn; +{ + CGEN_OPCODE *opc = CGEN_INSN_OPCODE (insn); + const char *mnem = CGEN_INSN_MNEMONIC (insn); + int mnem_len; + char rxbuf[CGEN_MAX_RX_ELEMENTS]; + char *rx = rxbuf; + const CGEN_SYNTAX_CHAR_TYPE *syn; + int reg_err; + + syn = CGEN_SYNTAX_STRING (CGEN_OPCODE_SYNTAX (opc)); + + /* Mnemonics come first in the syntax string */ + if (! CGEN_SYNTAX_MNEMONIC_P (* syn)) return "missing mnemonic in syntax string"; + ++syn; + + /* copy the literal mnemonic out of the insn */ + memset (rx, 0, CGEN_MAX_RX_ELEMENTS); + mnem_len = strlen(mnem); + memcpy (rx, mnem, mnem_len); + rx += mnem_len; + + /* copy any remaining literals from the syntax string into the rx */ + for(; * syn != 0 && rx < rxbuf + (CGEN_MAX_RX_ELEMENTS - 9); ++syn, ++rx) + { + if (CGEN_SYNTAX_CHAR_P (* syn)) + { + char tmp = CGEN_SYNTAX_CHAR (* syn); + switch (tmp) + { + /* escape any regex metacharacters in the syntax */ + case '.': case '[': case '\\': + case '*': case '^': case '$': + +#ifdef CGEN_ESCAPE_EXTENDED_REGEX + case '?': case '{': case '}': + case '(': case ')': case '*': + case '|': case '+': case ']': +#endif + + * rx++ = '\\'; + break; + } + /* insert syntax char into rx */ + * rx = tmp; + } + else + { + /* replace non-syntax fields with globs */ + * rx = '.'; + * ++rx = '*'; + } + } + + /* trailing whitespace ok */ + * rx++ = '['; + * rx++ = ' '; + * rx++ = '\t'; + * rx++ = ']'; + * rx++ = '*'; + + /* but anchor it after that */ + * rx++ = '$'; + * rx = '\0'; + + CGEN_INSN_RX (insn) = xmalloc (sizeof (regex_t)); + reg_err = regcomp ((regex_t *) CGEN_INSN_RX (insn), rxbuf, REG_NOSUB|REG_ICASE); + + if (reg_err == 0) + return NULL; + else + { + static char msg[80]; + regerror (reg_err, (regex_t *) CGEN_INSN_RX (insn), msg, 80); + regfree ((regex_t *) CGEN_INSN_RX (insn)); + free (CGEN_INSN_RX (insn)); + (CGEN_INSN_RX (insn)) = NULL; + return msg; + } +} + + /* Default insn parser. The syntax string is scanned and operands are parsed and stored in FIELDS. @@ -491,6 +590,7 @@ fr30_cgen_assemble_insn (cd, str, fields CGEN_INSN_LIST *ilist; const char *parse_errmsg = NULL; const char *insert_errmsg = NULL; + int recognized_mnemonic = 0; /* Skip leading white space. */ while (isspace (* str)) @@ -506,6 +606,7 @@ fr30_cgen_assemble_insn (cd, str, fields for ( ; ilist != NULL ; ilist = CGEN_ASM_NEXT_INSN (ilist)) { const CGEN_INSN *insn = ilist->insn; + recognized_mnemonic = 1; #ifdef CGEN_VALIDATE_INSN_SUPPORTED /* not usually needed as unsupported opcodes shouldn't be in the hash lists */ @@ -522,6 +623,11 @@ fr30_cgen_assemble_insn (cd, str, fields str = start; + /* skip this insn if str doesn't look right lexically */ + if (CGEN_INSN_RX (insn) != NULL && + regexec ((regex_t *) CGEN_INSN_RX (insn), str, 0, NULL, 0) == REG_NOMATCH) + continue; + /* Allow parse/insert handlers to obtain length of insn. */ CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn); @@ -542,13 +648,14 @@ fr30_cgen_assemble_insn (cd, str, fields { static char errbuf[150]; +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS /* If requesting verbose error messages, use insert_errmsg. Failing that, use parse_errmsg */ tmp_errmsg = (insert_errmsg ? insert_errmsg : parse_errmsg ? parse_errmsg : + recognized_mnemonic ? _("unrecognized form of instruction") : _("unrecognized instruction")); if (strlen (start) > 50) diff -uprN binutils-2.11.90.0.27/opcodes/fr30-desc.c binutils-2.11.90.0.29/opcodes/fr30-desc.c --- binutils-2.11.90.0.27/opcodes/fr30-desc.c Fri Mar 23 13:52:21 2001 +++ binutils-2.11.90.0.29/opcodes/fr30-desc.c Wed Aug 22 08:52:10 2001 @@ -122,8 +122,8 @@ static const CGEN_ISA fr30_cgen_isa_tabl /* Machine variants. */ static const CGEN_MACH fr30_cgen_mach_table[] = { - { "fr30", "fr30", MACH_FR30 }, - { 0, 0, 0 } + { "fr30", "fr30", MACH_FR30, 0 }, + { 0, 0, 0, 0 } }; static CGEN_KEYWORD_ENTRY fr30_cgen_opval_gr_names_entries[] = @@ -153,7 +153,7 @@ CGEN_KEYWORD fr30_cgen_opval_gr_names = { & fr30_cgen_opval_gr_names_entries[0], 19, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; static CGEN_KEYWORD_ENTRY fr30_cgen_opval_cr_names_entries[] = @@ -180,7 +180,7 @@ CGEN_KEYWORD fr30_cgen_opval_cr_names = { & fr30_cgen_opval_cr_names_entries[0], 16, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; static CGEN_KEYWORD_ENTRY fr30_cgen_opval_dr_names_entries[] = @@ -197,7 +197,7 @@ CGEN_KEYWORD fr30_cgen_opval_dr_names = { & fr30_cgen_opval_dr_names_entries[0], 6, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; static CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_ps_entries[] = @@ -209,7 +209,7 @@ CGEN_KEYWORD fr30_cgen_opval_h_ps = { & fr30_cgen_opval_h_ps_entries[0], 1, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; static CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r13_entries[] = @@ -221,7 +221,7 @@ CGEN_KEYWORD fr30_cgen_opval_h_r13 = { & fr30_cgen_opval_h_r13_entries[0], 1, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; static CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r14_entries[] = @@ -233,7 +233,7 @@ CGEN_KEYWORD fr30_cgen_opval_h_r14 = { & fr30_cgen_opval_h_r14_entries[0], 1, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; static CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r15_entries[] = @@ -245,7 +245,7 @@ CGEN_KEYWORD fr30_cgen_opval_h_r15 = { & fr30_cgen_opval_h_r15_entries[0], 1, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; @@ -1476,11 +1476,9 @@ static void fr30_cgen_rebuild_tables (cd) CGEN_CPU_TABLE *cd; { - int i,n_isas; + int i; unsigned int isas = cd->isas; -#if 0 unsigned int machs = cd->machs; -#endif cd->int_insn_p = CGEN_INT_INSN_P; @@ -1518,20 +1516,26 @@ fr30_cgen_rebuild_tables (cd) cd->min_insn_bitsize = isa->min_insn_bitsize; if (isa->max_insn_bitsize > cd->max_insn_bitsize) cd->max_insn_bitsize = isa->max_insn_bitsize; - - ++n_isas; } -#if 0 /* Does nothing?? */ /* Data derived from the mach spec. */ for (i = 0; i < MAX_MACHS; ++i) if (((1 << i) & machs) != 0) { const CGEN_MACH *mach = & fr30_cgen_mach_table[i]; - ++n_machs; + if (mach->insn_chunk_bitsize != 0) + { + if (cd->insn_chunk_bitsize != 0 && cd->insn_chunk_bitsize != mach->insn_chunk_bitsize) + { + fprintf (stderr, "fr30_cgen_rebuild_tables: conflicting insn-chunk-bitsize values: `%d' vs. `%d'\n", + cd->insn_chunk_bitsize, mach->insn_chunk_bitsize); + abort (); + } + + cd->insn_chunk_bitsize = mach->insn_chunk_bitsize; + } } -#endif /* Determine which hw elements are used by MACH. */ build_hw_table (cd); diff -uprN binutils-2.11.90.0.27/opcodes/fr30-dis.c binutils-2.11.90.0.29/opcodes/fr30-dis.c --- binutils-2.11.90.0.27/opcodes/fr30-dis.c Fri Mar 23 13:52:21 2001 +++ binutils-2.11.90.0.29/opcodes/fr30-dis.c Wed Aug 22 08:52:10 2001 @@ -495,13 +495,19 @@ print_insn (cd, pc, info, buf, buflen) char *buf; int buflen; { - unsigned long insn_value; + CGEN_INSN_INT insn_value; const CGEN_INSN_LIST *insn_list; CGEN_EXTRACT_INFO ex_info; - int rc = read_insn (cd, pc, info, buf, buflen, & ex_info, & insn_value); - if (rc != 0) - return rc; + /* Extract base part of instruction, just in case CGEN_DIS_* uses it. */ + insn_value = cgen_get_insn_value (cd, buf, buflen * 8); + + /* Fill in ex_info fields like read_insn would. Don't actually call + read_insn, since the incoming buffer is already read (and possibly + modified a la m32r). */ + ex_info.valid = (1 << buflen) - 1; + ex_info.dis_info = info; + ex_info.insn_bytes = buf; /* The instructions are stored in hash lists. Pick the first one and keep trying until we find the right one. */ @@ -512,6 +518,7 @@ print_insn (cd, pc, info, buf, buflen) const CGEN_INSN *insn = insn_list->insn; CGEN_FIELDS fields; int length; + unsigned long insn_value_cropped; #ifdef CGEN_VALIDATE_INSN_SUPPORTED /* not needed as insn shouldn't be in hash lists if not supported */ @@ -526,7 +533,17 @@ print_insn (cd, pc, info, buf, buflen) /* Basic bit mask must be correct. */ /* ??? May wish to allow target to defer this check until the extract handler. */ - if ((insn_value & CGEN_INSN_BASE_MASK (insn)) + + /* Base size may exceed this instruction's size. Extract the + relevant part from the buffer. */ + if ((CGEN_INSN_BITSIZE (insn) / 8) < buflen && + (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) + insn_value_cropped = bfd_get_bits (buf, CGEN_INSN_BITSIZE (insn), + info->endian == BFD_ENDIAN_BIG); + else + insn_value_cropped = insn_value; + + if ((insn_value_cropped & CGEN_INSN_BASE_MASK (insn)) == CGEN_INSN_BASE_VALUE (insn)) { /* Printing is handled in two passes. The first pass parses the @@ -549,7 +566,7 @@ print_insn (cd, pc, info, buf, buflen) } else length = CGEN_EXTRACT_FN (cd, insn) - (cd, insn, &ex_info, insn_value, &fields, pc); + (cd, insn, &ex_info, insn_value_cropped, &fields, pc); /* length < 0 -> error */ if (length < 0) @@ -583,18 +600,27 @@ default_print_insn (cd, pc, info) disassemble_info *info; { char buf[CGEN_MAX_INSN_SIZE]; + int buflen; int status; - /* Read the base part of the insn. */ + /* Attempt to read the base part of the insn. */ + buflen = cd->base_insn_bitsize / 8; + status = (*info->read_memory_func) (pc, buf, buflen, info); + + /* Try again with the minimum part, if min < base. */ + if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize)) + { + buflen = cd->min_insn_bitsize / 8; + status = (*info->read_memory_func) (pc, buf, buflen, info); + } - status = (*info->read_memory_func) (pc, buf, cd->base_insn_bitsize / 8, info); if (status != 0) { (*info->memory_error_func) (status, pc, info); return -1; } - return print_insn (cd, pc, info, buf, cd->base_insn_bitsize / 8); + return print_insn (cd, pc, info, buf, buflen); } /* Main entry point. diff -uprN binutils-2.11.90.0.27/opcodes/fr30-ibld.c binutils-2.11.90.0.29/opcodes/fr30-ibld.c --- binutils-2.11.90.0.27/opcodes/fr30-ibld.c Thu Mar 15 14:52:04 2001 +++ binutils-2.11.90.0.29/opcodes/fr30-ibld.c Wed Aug 22 08:52:10 2001 @@ -145,7 +145,22 @@ insert_normal (cd, value, attrs, word_of } /* Ensure VALUE will fit. */ - if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)) + if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT)) + { + long minval = - (1L << (length - 1)); + unsigned long maxval = mask; + + if ((value > 0 && (unsigned long) value > maxval) + || value < minval) + { + /* xgettext:c-format */ + sprintf (errbuf, + _("operand out of range (%ld not between %ld and %lu)"), + value, minval, maxval); + return errbuf; + } + } + else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)) { unsigned long maxval = mask; @@ -202,10 +217,10 @@ insert_normal (cd, value, attrs, word_of } /* Default insn builder (insert handler). - The instruction is recorded in CGEN_INT_INSN_P byte order - (meaning that if CGEN_INT_INSN_P BUFFER is an int * and thus the value is - recorded in host byte order, otherwise BUFFER is an array of bytes and the - value is recorded in target byte order). + The instruction is recorded in CGEN_INT_INSN_P byte order (meaning + that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is + recorded in host byte order, otherwise BUFFER is an array of bytes + and the value is recorded in target byte order). The result is an error message or NULL if success. */ static const char * @@ -265,7 +280,7 @@ insert_insn_normal (cd, insn, fields, bu static void put_insn_int_value (cd, buf, length, insn_length, value) - CGEN_CPU_DESC cd; + CGEN_CPU_DESC cd ATTRIBUTE_UNUSED; CGEN_INSN_BYTES_PTR buf; int length; int insn_length; @@ -400,7 +415,7 @@ extract_normal (cd, ex_info, insn_value, #endif long *valuep; { - CGEN_INSN_INT value, mask; + long value, mask; /* If LENGTH is zero, this operand doesn't contribute to the value so give it a standard value of zero. */ @@ -428,9 +443,9 @@ extract_normal (cd, ex_info, insn_value, word_length = total_length; } - /* Does the value reside in INSN_VALUE? */ + /* Does the value reside in INSN_VALUE, and at the right alignment? */ - if (CGEN_INT_INSN_P || word_offset == 0) + if (CGEN_INT_INSN_P || (word_offset == 0 && word_length == total_length)) { if (CGEN_INSN_LSB0_P) value = insn_value >> ((word_offset + start + 1) - length); diff -uprN binutils-2.11.90.0.27/opcodes/fr30-opc.c binutils-2.11.90.0.29/opcodes/fr30-opc.c --- binutils-2.11.90.0.27/opcodes/fr30-opc.c Thu Mar 15 14:52:04 2001 +++ binutils-2.11.90.0.29/opcodes/fr30-opc.c Wed Aug 22 08:52:10 2001 @@ -1368,6 +1368,7 @@ fr30_cgen_init_opcode_table (cd) { insns[i].base = &ib[i]; insns[i].opcode = &oc[i]; + fr30_cgen_build_insn_regex (& insns[i]); } cd->macro_insn_table.init_entries = insns; cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE); @@ -1376,7 +1377,10 @@ fr30_cgen_init_opcode_table (cd) oc = & fr30_cgen_insn_opcode_table[0]; insns = (CGEN_INSN *) cd->insn_table.init_entries; for (i = 0; i < MAX_INSNS; ++i) - insns[i].opcode = &oc[i]; + { + insns[i].opcode = &oc[i]; + fr30_cgen_build_insn_regex (& insns[i]); + } cd->sizeof_fields = sizeof (CGEN_FIELDS); cd->set_fields_bitsize = set_fields_bitsize; diff -uprN binutils-2.11.90.0.27/opcodes/h8300-dis.c binutils-2.11.90.0.29/opcodes/h8300-dis.c --- binutils-2.11.90.0.27/opcodes/h8300-dis.c Thu Mar 15 14:52:04 2001 +++ binutils-2.11.90.0.29/opcodes/h8300-dis.c Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* Disassemble h8300 instructions. - Copyright 1993, 1994, 1996, 1998, 2000 Free Software Foundation, Inc. + Copyright 1993, 1994, 1996, 1998, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,10 @@ Foundation, Inc., 59 Temple Place - Suit #include "dis-asm.h" #include "opintl.h" +static void bfd_h8_disassemble_init PARAMS ((void)); +static unsigned int bfd_h8_disassemble + PARAMS ((bfd_vma, disassemble_info *, int)); + /* Run through the opcodes and sort them into order to make them easy to disassemble. */ static void @@ -58,7 +62,7 @@ bfd_h8_disassemble_init () } } -unsigned int +static unsigned int bfd_h8_disassemble (addr, info, mode) bfd_vma addr; disassemble_info *info; diff -uprN binutils-2.11.90.0.27/opcodes/h8500-dis.c binutils-2.11.90.0.29/opcodes/h8500-dis.c --- binutils-2.11.90.0.27/opcodes/h8500-dis.c Thu Mar 15 14:52:05 2001 +++ binutils-2.11.90.0.29/opcodes/h8500-dis.c Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* Disassemble h8500 instructions. - Copyright 1993, 1998, 2000 Free Software Foundation, Inc. + Copyright 1993, 1998, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,8 @@ Foundation, Inc., 59 Temple Place - Suit #include +static int fetch_data PARAMS ((struct disassemble_info *, bfd_byte *)); + struct private { /* Points to first byte not fetched. */ diff -uprN binutils-2.11.90.0.27/opcodes/h8500-opc.h binutils-2.11.90.0.29/opcodes/h8500-opc.h --- binutils-2.11.90.0.27/opcodes/h8500-opc.h Thu Mar 15 14:52:05 2001 +++ binutils-2.11.90.0.29/opcodes/h8500-opc.h Mon Aug 27 11:44:52 2001 @@ -24,7 +24,7 @@ typedef enum { GR0,GR1,GR2,GR3,GR4,GR5,GR6,GR7, GPR0, GPR1, GPR2, GPR3, GPR4, GPR5, GPR6, GPR7, - GCCR, GPC, + GCCR, GPC, GSEGC, GSEGD, GSEGE, GSEGT,GLAST } gdbreg_type; #define O_XORC 1 @@ -146,7 +146,7 @@ typedef enum #define RS 39 #define SP 40 typedef enum { AC_BAD, AC_EI, AC_RI, AC_D, AC_,AC_ERR, AC_X,AC_B, AC_EE,AC_RR,AC_IE, - AC_RE,AC_E, AC_I, AC_ER,AC_IRR, AC_IR, AC_RER, AC_ERE,AC_EIE } addr_class_type; + AC_RE,AC_E, AC_I, AC_ER,AC_IRR, AC_IR, AC_RER, AC_ERE,AC_EIE } addr_class_type; typedef struct { short int idx; char flags,src1,src2,dst; @@ -1631,45 +1631,45 @@ h8500_opcode_info h8500_table[] {4,'m','E','D','D',O_XOR|O_BYTE,"xor.b",2,{RNIND_D8,RD},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x60,0xf8,RD }}}, {29,'s','C','!','E',O_STC|O_BYTE,"stc.b",2,{CRB,RNIND_D8},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x98,0xf8,CRB }}}, {3,'m','E','D','D',O_XOR|O_WORD,"xor.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x60,0xf8,RD }}}, -{25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x30,0xf8,RD }}}, -{4,'m','E','D','D',O_XOR|O_BYTE,"xor.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x60,0xf8,RD }}}, -{29,'s','C','!','E',O_STC|O_BYTE,"stc.b",2,{CRB,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x98,0xf8,CRB }}}, -{3,'m','E','D','D',O_XOR|O_WORD,"xor.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x60,0xf8,RD }}}, +{25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x30,0xf8,RD }}}, +{4,'m','E','D','D',O_XOR|O_BYTE,"xor.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x60,0xf8,RD }}}, +{29,'s','C','!','E',O_STC|O_BYTE,"stc.b",2,{CRB,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x98,0xf8,CRB }}}, +{3,'m','E','D','D',O_XOR|O_WORD,"xor.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x60,0xf8,RD }}}, {25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{RN,RD},2, {{0xa0,0xf8,RN },{0x30,0xf8,RD }}}, -{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x16,0xff, }}}, +{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x16,0xff,0}}}, {6,'-','X','!','!',O_XCH|O_WORD,"xch.w",2,{RS,RD},2, {{0xa8,0xf8,RS },{0x90,0xf8,RD }}}, -{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x16,0xff, }}}, +{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x16,0xff,0}}}, {25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{RNDEC,RD},2, {{0xb0,0xf8,RN },{0x30,0xf8,RD }}}, -{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x16,0xff, }}}, +{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x16,0xff,0}}}, {24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{RNDEC,RD},2, {{0xb8,0xf8,RN },{0x30,0xf8,RD }}}, -{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x16,0xff, }}}, +{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x16,0xff,0}}}, {25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{RNINC,RD},2, {{0xc0,0xf8,RN },{0x30,0xf8,RD }}}, -{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x16,0xff, }}}, -{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x16,0xff, }}}, +{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x16,0xff,0}}}, +{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x16,0xff,0}}}, {25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{RNIND,RD},2, {{0xd0,0xf8,RN },{0x30,0xf8,RD }}}, -{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x16,0xff, }}}, +{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x16,0xff,0}}}, {24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{RNIND,RD},2, {{0xd8,0xf8,RN },{0x30,0xf8,RD }}}, -{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x16,0xff, }}}, -{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x16,0xff, }}}, +{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x16,0xff,0}}}, +{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x16,0xff,0}}}, {24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x30,0xf8,RD }}}, -{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x16,0xff, }}}, -{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x16,0xff, }}}, -{24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x30,0xf8,RD }}}, -{16,'m','D','!','D',O_SWAP|O_WORD,"swap.b",1,{RD,0},2, {{0xa0,0xf8,RD },{0x10,0xff, }}}, -{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x17,0xff, }}}, +{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x16,0xff,0}}}, +{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x16,0xff,0}}}, +{24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x30,0xf8,RD }}}, +{16,'m','D','!','D',O_SWAP|O_WORD,"swap.b",1,{RD,0},2, {{0xa0,0xf8,RD },{0x10,0xff,0}}}, +{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x17,0xff,0}}}, {24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{RN,RD},2, {{0xa8,0xf8,RN },{0x30,0xf8,RD }}}, {18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{RN,RD},2, {{0xa8,0xf8,RN },{0xb0,0xf8,RD }}}, -{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x17,0xff, }}}, +{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x17,0xff,0}}}, {18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{RNDEC,RD},2, {{0xb8,0xf8,RN },{0xb0,0xf8,RD }}}, -{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x17,0xff, }}}, +{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x17,0xff,0}}}, {24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{RNINC,RD},2, {{0xc8,0xf8,RN },{0x30,0xf8,RD }}}, {22,'-','E','D','D',O_SUBS|O_BYTE,"subs.b",2,{RNIND,RD},2, {{0xd0,0xf8,RN },{0x38,0xf8,RD }}}, -{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x17,0xff, }}}, +{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x17,0xff,0}}}, {18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{RNIND,RD},2, {{0xd8,0xf8,RN },{0xb0,0xf8,RD }}}, -{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x17,0xff, }}}, +{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x17,0xff,0}}}, {22,'-','E','D','D',O_SUBS|O_BYTE,"subs.b",2,{RNIND_D8,RD},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x38,0xf8,RD }}}, -{22,'-','E','D','D',O_SUBS|O_BYTE,"subs.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x38,0xf8,RD }}}, -{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x17,0xff, }}}, +{22,'-','E','D','D',O_SUBS|O_BYTE,"subs.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x38,0xf8,RD }}}, +{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x17,0xff,0}}}, {22,'-','E','D','D',O_SUBS|O_BYTE,"subs.b",2,{RN,RD},2, {{0xa0,0xf8,RN },{0x38,0xf8,RD }}}, {19,'a','E','D','D',O_SUBX|O_BYTE,"subx.b",2,{RN,RD},2, {{0xa0,0xf8,RN },{0xb0,0xf8,RD }}}, {21,'-','E','D','D',O_SUBS|O_WORD,"subs.w",2,{RN,RD},2, {{0xa8,0xf8,RN },{0x38,0xf8,RD }}}, @@ -1683,410 +1683,410 @@ h8500_opcode_info h8500_table[] {19,'a','E','D','D',O_SUBX|O_BYTE,"subx.b",2,{RNIND,RD},2, {{0xd0,0xf8,RN },{0xb0,0xf8,RD }}}, {19,'a','E','D','D',O_SUBX|O_BYTE,"subx.b",2,{RNIND_D8,RD},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0xb0,0xf8,RD }}}, {21,'-','E','D','D',O_SUBS|O_WORD,"subs.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x38,0xf8,RD }}}, -{19,'a','E','D','D',O_SUBX|O_BYTE,"subx.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xb0,0xf8,RD }}}, -{21,'-','E','D','D',O_SUBS|O_WORD,"subs.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x38,0xf8,RD }}}, +{19,'a','E','D','D',O_SUBX|O_BYTE,"subx.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xb0,0xf8,RD }}}, +{21,'-','E','D','D',O_SUBS|O_WORD,"subs.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x38,0xf8,RD }}}, {21,'-','E','D','D',O_SUBS|O_WORD,"subs.w",2,{RNIND,RD},2, {{0xd8,0xf8,RN },{0x38,0xf8,RD }}}, {18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0xb0,0xf8,RD }}}, -{18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xb0,0xf8,RD }}}, -{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x16,0xff, }}}, -{25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x30,0xf8,RD }}}, -{22,'-','E','D','D',O_SUBS|O_BYTE,"subs.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x38,0xf8,RD }}}, -{4,'m','E','D','D',O_XOR|O_BYTE,"xor.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x60,0xf8,RD }}}, -{2,'s','E','C','C',O_XORC|O_BYTE,"xorc.b",2,{IMM8,CRB},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x68,0xf8,CRB }}}, -{19,'a','E','D','D',O_SUBX|O_BYTE,"subx.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0xb0,0xf8,RD }}}, -{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x16,0xff, }}}, -{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x17,0xff, }}}, -{25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x30,0xf8,RD }}}, -{22,'-','E','D','D',O_SUBS|O_BYTE,"subs.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x38,0xf8,RD }}}, -{4,'m','E','D','D',O_XOR|O_BYTE,"xor.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x60,0xf8,RD }}}, -{29,'s','C','!','E',O_STC|O_BYTE,"stc.b",2,{CRB,ABS8},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x98,0xf8,CRB }}}, -{19,'a','E','D','D',O_SUBX|O_BYTE,"subx.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0xb0,0xf8,RD }}}, -{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x16,0xff, }}}, -{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x17,0xff, }}}, -{12,'-','I','!','!',O_TRAPA|O_UNSZ,"trapa",1,{IMM4,0},2, {{0x08,0xff, },{0x10,0xf0,IMM4 }}}, -{13,'-','B','!','!',O_TRAP_VS|O_UNSZ,"trap/vs",0,{0,0},1, {{0x09,0xff, }}}, -{24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x30,0xf8,RD }}}, -{21,'-','E','D','D',O_SUBS|O_WORD,"subs.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x38,0xf8,RD }}}, -{3,'m','E','D','D',O_XOR|O_WORD,"xor.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x60,0xf8,RD }}}, -{1,'s','E','C','C',O_XORC|O_WORD,"xorc.w",2,{IMM16,CRW},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x68,0xf8,CRW }}}, -{18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0xb0,0xf8,RD }}}, -{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x16,0xff, }}}, -{24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x30,0xf8,RD }}}, -{21,'-','E','D','D',O_SUBS|O_WORD,"subs.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x38,0xf8,RD }}}, -{3,'m','E','D','D',O_XOR|O_WORD,"xor.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x60,0xf8,RD }}}, -{18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0xb0,0xf8,RD }}}, -{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x16,0xff, }}}, -{8,'-','B','!','!',O_UNLK|O_UNSZ,"unlk",1,{FP,0},1, {{0x0f,0xff, }}}, -{25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x30,0xf8,RD }}}, -{22,'-','E','D','D',O_SUBS|O_BYTE,"subs.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x38,0xf8,RD }}}, -{4,'m','E','D','D',O_XOR|O_BYTE,"xor.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x60,0xf8,RD }}}, -{29,'s','C','!','E',O_STC|O_BYTE,"stc.b",2,{CRB,ABS16},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x98,0xf8,CRB }}}, -{27,'-','I','!','E',O_STM|O_UNSZ,"stm",2,{RLIST,SPDEC},2, {{0x12,0xff, },{0x00,0x00,RLIST }}}, -{19,'a','E','D','D',O_SUBX|O_BYTE,"subx.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xb0,0xf8,RD }}}, -{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x16,0xff, }}}, -{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x17,0xff, }}}, -{24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x30,0xf8,RD }}}, -{21,'-','E','D','D',O_SUBS|O_WORD,"subs.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x38,0xf8,RD }}}, -{3,'m','E','D','D',O_XOR|O_WORD,"xor.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x60,0xf8,RD }}}, -{18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xb0,0xf8,RD }}}, -{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x16,0xff, }}}, -{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x19,0xff, }}}, -{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x19,0xff, }}}, -{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1b,0xff, }}}, -{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x19,0xff, }}}, -{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x19,0xff, }}}, -{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x19,0xff, }}}, -{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1b,0xff, }}}, -{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x19,0xff, }}}, -{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1b,0xff, }}}, -{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1a,0xff, }}}, -{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1b,0xff, }}}, -{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x19,0xff, }}}, -{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1a,0xff, }}}, -{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1b,0xff, }}}, -{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x19,0xff, }}}, -{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1a,0xff, }}}, -{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1b,0xff, }}}, -{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1a,0xff, }}}, -{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1b,0xff, }}}, -{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1a,0xff, }}}, -{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1a,0xff, }}}, -{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1a,0xff, }}}, -{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1a,0xff, }}}, -{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1a,0xff, }}}, -{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1b,0xff, }}}, -{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1a,0xff, }}}, -{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1a,0xff, }}}, -{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1b,0xff, }}}, -{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1a,0xff, }}}, -{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x1a,0xff, }}}, -{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x1b,0xff, }}}, -{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x1a,0xff, }}}, -{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x1a,0xff, }}}, -{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x1a,0xff, }}}, -{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1a,0xff, }}}, -{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1b,0xff, }}}, -{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1a,0xff, }}}, -{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1b,0xff, }}}, -{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x19,0xff, }}}, -{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x19,0xff, }}}, -{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1b,0xff, }}}, -{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x19,0xff, }}}, -{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x19,0xff, }}}, -{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1b,0xff, }}}, -{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x19,0xff, }}}, -{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x19,0xff, }}}, -{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x1b,0xff, }}}, -{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x19,0xff, }}}, -{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x1b,0xff, }}}, -{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x19,0xff, }}}, -{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x1b,0xff, }}}, -{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x19,0xff, }}}, -{31,'-','!','!','!',O_SLEEP|O_UNSZ,"sleep",0,{0,0},1, {{0x1a,0xff, }}}, -{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x19,0xff, }}}, -{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1b,0xff, }}}, -{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x18,0xff, }}}, -{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x18,0xff, }}}, -{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x18,0xff, }}}, -{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x18,0xff, }}}, -{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1e,0xff, }}}, -{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x18,0xff, }}}, -{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x18,0xff, }}}, -{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x18,0xff, }}}, -{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x18,0xff, }}}, -{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x18,0xff, }}}, -{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1e,0xff, }}}, -{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x18,0xff, }}}, -{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1e,0xff, }}}, -{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x18,0xff, }}}, -{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1e,0xff, }}}, -{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x18,0xff, }}}, -{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1e,0xff, }}}, -{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x18,0xff, }}}, -{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1f,0xff, }}}, -{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1e,0xff, }}}, -{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1f,0xff, }}}, -{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1e,0xff, }}}, -{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1f,0xff, }}}, -{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1e,0xff, }}}, -{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1f,0xff, }}}, -{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1e,0xff, }}}, -{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1f,0xff, }}}, -{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1e,0xff, }}}, -{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1f,0xff, }}}, -{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1e,0xff, }}}, -{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1f,0xff, }}}, -{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1e,0xff, }}}, -{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1f,0xff, }}}, -{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1f,0xff, }}}, -{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1f,0xff, }}}, -{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1f,0xff, }}}, -{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1f,0xff, }}}, -{45,'-','B','S','S',O_SCB_F|O_UNSZ,"scb/f",2,{RS,PCREL8},3, {{0x01,0xff, },{0xb8,0xf8,RS },{0x00,0x00,PCREL8 }}}, -{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x1e,0xff, }}}, -{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x1f,0xff, }}}, -{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x1f,0xff, }}}, -{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x1f,0xff, }}}, -{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x18,0xff, }}}, -{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x1e,0xff, }}}, -{44,'-','B','S','S',O_SCB_NE|O_UNSZ,"scb/ne",2,{RS,PCREL8},3, {{0x06,0xff, },{0xb8,0xf8,RS },{0x00,0x00,PCREL8 }}}, -{46,'-','B','S','S',O_SCB_EQ|O_UNSZ,"scb/eq",2,{RS,PCREL8},3, {{0x07,0xff, },{0xb8,0xf8,RS },{0x00,0x00,PCREL8 }}}, -{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x18,0xff, }}}, -{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x1e,0xff, }}}, -{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x18,0xff, }}}, -{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x1e,0xff, }}}, -{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x1f,0xff, }}}, -{48,'-','B','!','!',O_RTD|O_UNSZ,"rtd",1,{IMM16,0},3, {{0x14,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, -{48,'-','B','!','!',O_RTD|O_UNSZ,"rtd",1,{IMM8,0},2, {{0x14,0xff, },{0x00,0x00,IMM8 }}}, -{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x18,0xff, }}}, -{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1e,0xff, }}}, -{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1f,0xff, }}}, -{47,'-','B','!','!',O_RTS|O_UNSZ,"rts",0,{0,0},1, {{0x19,0xff, }}}, -{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x18,0xff, }}}, -{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1e,0xff, }}}, -{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1f,0xff, }}}, +{18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xb0,0xf8,RD }}}, +{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x16,0xff,0}}}, +{25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x30,0xf8,RD }}}, +{22,'-','E','D','D',O_SUBS|O_BYTE,"subs.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x38,0xf8,RD }}}, +{4,'m','E','D','D',O_XOR|O_BYTE,"xor.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x60,0xf8,RD }}}, +{2,'s','E','C','C',O_XORC|O_BYTE,"xorc.b",2,{IMM8,CRB},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x68,0xf8,CRB }}}, +{19,'a','E','D','D',O_SUBX|O_BYTE,"subx.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0xb0,0xf8,RD }}}, +{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x16,0xff,0}}}, +{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x17,0xff,0}}}, +{25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x30,0xf8,RD }}}, +{22,'-','E','D','D',O_SUBS|O_BYTE,"subs.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x38,0xf8,RD }}}, +{4,'m','E','D','D',O_XOR|O_BYTE,"xor.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x60,0xf8,RD }}}, +{29,'s','C','!','E',O_STC|O_BYTE,"stc.b",2,{CRB,ABS8},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x98,0xf8,CRB }}}, +{19,'a','E','D','D',O_SUBX|O_BYTE,"subx.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0xb0,0xf8,RD }}}, +{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x16,0xff,0}}}, +{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x17,0xff,0}}}, +{12,'-','I','!','!',O_TRAPA|O_UNSZ,"trapa",1,{IMM4,0},2, {{0x08,0xff,0},{0x10,0xf0,IMM4 }}}, +{13,'-','B','!','!',O_TRAP_VS|O_UNSZ,"trap/vs",0,{0,0},1, {{0x09,0xff,0}}}, +{24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x30,0xf8,RD }}}, +{21,'-','E','D','D',O_SUBS|O_WORD,"subs.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x38,0xf8,RD }}}, +{3,'m','E','D','D',O_XOR|O_WORD,"xor.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x60,0xf8,RD }}}, +{1,'s','E','C','C',O_XORC|O_WORD,"xorc.w",2,{IMM16,CRW},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x68,0xf8,CRW }}}, +{18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0xb0,0xf8,RD }}}, +{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x16,0xff,0}}}, +{24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x30,0xf8,RD }}}, +{21,'-','E','D','D',O_SUBS|O_WORD,"subs.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x38,0xf8,RD }}}, +{3,'m','E','D','D',O_XOR|O_WORD,"xor.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x60,0xf8,RD }}}, +{18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0xb0,0xf8,RD }}}, +{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x16,0xff,0}}}, +{8,'-','B','!','!',O_UNLK|O_UNSZ,"unlk",1,{FP,0},1, {{0x0f,0xff,0}}}, +{25,'a','E','D','D',O_SUB|O_BYTE,"sub.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x30,0xf8,RD }}}, +{22,'-','E','D','D',O_SUBS|O_BYTE,"subs.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x38,0xf8,RD }}}, +{4,'m','E','D','D',O_XOR|O_BYTE,"xor.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x60,0xf8,RD }}}, +{29,'s','C','!','E',O_STC|O_BYTE,"stc.b",2,{CRB,ABS16},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x98,0xf8,CRB }}}, +{27,'-','I','!','E',O_STM|O_UNSZ,"stm",2,{RLIST,SPDEC},2, {{0x12,0xff,0},{0x00,0x00,RLIST }}}, +{19,'a','E','D','D',O_SUBX|O_BYTE,"subx.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xb0,0xf8,RD }}}, +{10,'a','E','!','!',O_TST|O_BYTE,"tst.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x16,0xff,0}}}, +{14,'s','E','!','E',O_TAS|O_BYTE,"tas.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x17,0xff,0}}}, +{24,'a','E','D','D',O_SUB|O_WORD,"sub.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x30,0xf8,RD }}}, +{21,'-','E','D','D',O_SUBS|O_WORD,"subs.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x38,0xf8,RD }}}, +{3,'m','E','D','D',O_XOR|O_WORD,"xor.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x60,0xf8,RD }}}, +{18,'a','E','D','D',O_SUBX|O_WORD,"subx.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xb0,0xf8,RD }}}, +{9,'a','E','!','!',O_TST|O_WORD,"tst.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x16,0xff,0}}}, +{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x19,0xff,0}}}, +{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x19,0xff,0}}}, +{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1b,0xff,0}}}, +{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x19,0xff,0}}}, +{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x19,0xff,0}}}, +{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x19,0xff,0}}}, +{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1b,0xff,0}}}, +{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x19,0xff,0}}}, +{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1b,0xff,0}}}, +{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1a,0xff,0}}}, +{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1b,0xff,0}}}, +{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x19,0xff,0}}}, +{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1a,0xff,0}}}, +{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1b,0xff,0}}}, +{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x19,0xff,0}}}, +{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1a,0xff,0}}}, +{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1b,0xff,0}}}, +{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1a,0xff,0}}}, +{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1b,0xff,0}}}, +{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1a,0xff,0}}}, +{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1a,0xff,0}}}, +{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1a,0xff,0}}}, +{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1a,0xff,0}}}, +{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1a,0xff,0}}}, +{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1b,0xff,0}}}, +{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1a,0xff,0}}}, +{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1a,0xff,0}}}, +{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1b,0xff,0}}}, +{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1a,0xff,0}}}, +{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x1a,0xff,0}}}, +{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x1b,0xff,0}}}, +{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x1a,0xff,0}}}, +{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x1a,0xff,0}}}, +{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x1a,0xff,0}}}, +{36,'h','E','!','E',O_SHLL|O_BYTE,"shll.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1a,0xff,0}}}, +{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1b,0xff,0}}}, +{35,'h','E','!','E',O_SHLL|O_WORD,"shll.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1a,0xff,0}}}, +{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1b,0xff,0}}}, +{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x19,0xff,0}}}, +{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x19,0xff,0}}}, +{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1b,0xff,0}}}, +{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x19,0xff,0}}}, +{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x19,0xff,0}}}, +{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1b,0xff,0}}}, +{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x19,0xff,0}}}, +{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x19,0xff,0}}}, +{33,'h','E','!','E',O_SHLR|O_BYTE,"shlr.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x1b,0xff,0}}}, +{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x19,0xff,0}}}, +{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x1b,0xff,0}}}, +{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x19,0xff,0}}}, +{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x1b,0xff,0}}}, +{39,'h','E','!','E',O_SHAR|O_BYTE,"shar.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x19,0xff,0}}}, +{31,'-','!','!','!',O_SLEEP|O_UNSZ,"sleep",0,{0,0},1, {{0x1a,0xff,0}}}, +{38,'h','E','!','E',O_SHAR|O_WORD,"shar.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x19,0xff,0}}}, +{32,'h','E','!','E',O_SHLR|O_WORD,"shlr.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1b,0xff,0}}}, +{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x18,0xff,0}}}, +{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x18,0xff,0}}}, +{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x18,0xff,0}}}, +{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x18,0xff,0}}}, +{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1e,0xff,0}}}, +{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x18,0xff,0}}}, +{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x18,0xff,0}}}, +{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x18,0xff,0}}}, +{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x18,0xff,0}}}, +{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x18,0xff,0}}}, +{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1e,0xff,0}}}, +{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x18,0xff,0}}}, +{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1e,0xff,0}}}, +{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x18,0xff,0}}}, +{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1e,0xff,0}}}, +{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x18,0xff,0}}}, +{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1e,0xff,0}}}, +{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x18,0xff,0}}}, +{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1f,0xff,0}}}, +{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1e,0xff,0}}}, +{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1f,0xff,0}}}, +{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1e,0xff,0}}}, +{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1f,0xff,0}}}, +{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1e,0xff,0}}}, +{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1f,0xff,0}}}, +{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1e,0xff,0}}}, +{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1f,0xff,0}}}, +{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1e,0xff,0}}}, +{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1f,0xff,0}}}, +{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1e,0xff,0}}}, +{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1f,0xff,0}}}, +{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1e,0xff,0}}}, +{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1f,0xff,0}}}, +{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1f,0xff,0}}}, +{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1f,0xff,0}}}, +{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1f,0xff,0}}}, +{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1f,0xff,0}}}, +{45,'-','B','S','S',O_SCB_F|O_UNSZ,"scb/f",2,{RS,PCREL8},3, {{0x01,0xff,0},{0xb8,0xf8,RS },{0x00,0x00,PCREL8 }}}, +{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x1e,0xff,0}}}, +{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x1f,0xff,0}}}, +{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x1f,0xff,0}}}, +{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x1f,0xff,0}}}, +{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x18,0xff,0}}}, +{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x1e,0xff,0}}}, +{44,'-','B','S','S',O_SCB_NE|O_UNSZ,"scb/ne",2,{RS,PCREL8},3, {{0x06,0xff,0},{0xb8,0xf8,RS },{0x00,0x00,PCREL8 }}}, +{46,'-','B','S','S',O_SCB_EQ|O_UNSZ,"scb/eq",2,{RS,PCREL8},3, {{0x07,0xff,0},{0xb8,0xf8,RS },{0x00,0x00,PCREL8 }}}, +{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x18,0xff,0}}}, +{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x1e,0xff,0}}}, +{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x18,0xff,0}}}, +{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x1e,0xff,0}}}, +{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x1f,0xff,0}}}, +{48,'-','B','!','!',O_RTD|O_UNSZ,"rtd",1,{IMM16,0},3, {{0x14,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, +{48,'-','B','!','!',O_RTD|O_UNSZ,"rtd",1,{IMM8,0},2, {{0x14,0xff,0},{0x00,0x00,IMM8 }}}, +{42,'h','E','!','E',O_SHAL|O_BYTE,"shal.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x18,0xff,0}}}, +{53,'h','E','!','E',O_ROTXL|O_BYTE,"rotxl.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1e,0xff,0}}}, +{50,'h','E','!','E',O_ROTXR|O_BYTE,"rotxr.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1f,0xff,0}}}, +{47,'-','B','!','!',O_RTS|O_UNSZ,"rts",0,{0,0},1, {{0x19,0xff,0}}}, +{41,'h','E','!','E',O_SHAL|O_WORD,"shal.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x18,0xff,0}}}, +{52,'h','E','!','E',O_ROTXL|O_WORD,"rotxl.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1e,0xff,0}}}, +{49,'h','E','!','E',O_ROTXR|O_WORD,"rotxr.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1f,0xff,0}}}, {99,'m','I','!','D',O_MOV|O_BYTE,"mov:e.b",2,{IMM8,RD},2, {{0x50,0xf8,RD },{0x00,0x00,IMM8 }}}, {97,'m','E','!','D',O_MOV|O_BYTE,"mov:f.b",2,{FPIND_D8,RD},2, {{0x80,0xf8,RD },{0x00,0x00,FPIND_D8 }}}, {96,'m','E','!','D',O_MOV|O_WORD,"mov:f.w",2,{FPIND_D8,RD},2, {{0x88,0xf8,RD },{0x00,0x00,FPIND_D8 }}}, {97,'m','S','!','E',O_MOV|O_BYTE,"mov:f.b",2,{RS,FPIND_D8},2, {{0x90,0xf8,RS },{0x00,0x00,FPIND_D8 }}}, {96,'m','S','!','E',O_MOV|O_WORD,"mov:f.w",2,{RS,FPIND_D8},2, {{0x98,0xf8,RS },{0x00,0x00,FPIND_D8 }}}, {94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{RN,RD},2, {{0xa0,0xf8,RN },{0x80,0xf8,RD }}}, -{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1d,0xff, }}}, +{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1d,0xff,0}}}, {94,'m','S','!','E',O_MOV|O_BYTE,"mov:g.b",2,{RS,RNDEC},2, {{0xb0,0xf8,RN },{0x90,0xf8,RS }}}, -{91,'m','I','!','D',O_MOV|O_WORD,"mov:i.w",2,{IMM16,RD},3, {{0x58,0xf8,RD },{0x00,0x00,IMM16 },{0x00,0x00, }}}, +{91,'m','I','!','D',O_MOV|O_WORD,"mov:i.w",2,{IMM16,RD},3, {{0x58,0xf8,RD },{0x00,0x00,IMM16 },{0x00,0x00,0}}}, {89,'m','E','!','D',O_MOV|O_BYTE,"mov:l.b",2,{ABS8,RD},2, {{0x60,0xf8,RD },{0x00,0x00,ABS8 }}}, {88,'m','E','!','D',O_MOV|O_WORD,"mov:l.w",2,{ABS8,RD},2, {{0x68,0xf8,RD },{0x00,0x00,ABS8 }}}, {86,'m','S','!','E',O_MOV|O_BYTE,"mov:s.b",2,{RS,ABS8},2, {{0x70,0xf8,RS },{0x00,0x00,ABS8 }}}, {85,'m','S','!','E',O_MOV|O_WORD,"mov:s.w",2,{RS,ABS8},2, {{0x78,0xf8,RS },{0x00,0x00,ABS8 }}}, -{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RN,RD},3, {{0xa0,0xf8,RN },{0x00,0xff, },{0x80,0xf8,RD }}}, -{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1d,0xff, }}}, +{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RN,RD},3, {{0xa0,0xf8,RN },{0x00,0xff,0},{0x80,0xf8,RD }}}, +{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1d,0xff,0}}}, {93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{RN,RD},2, {{0xa8,0xf8,RN },{0x80,0xf8,RD }}}, {94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{RNDEC,RD},2, {{0xb0,0xf8,RN },{0x80,0xf8,RD }}}, -{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RNDEC,RD},3, {{0xb0,0xf8,RN },{0x00,0xff, },{0x80,0xf8,RD }}}, +{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RNDEC,RD},3, {{0xb0,0xf8,RN },{0x00,0xff,0},{0x80,0xf8,RD }}}, {79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{RNDEC,RD},2, {{0xb0,0xf8,RN },{0xa8,0xf8,RD }}}, -{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RN},3, {{0xa0,0xf8,RN },{0x00,0xff, },{0x90,0xf8,RS }}}, -{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1c,0xff, }}}, -{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RN,RD},2, {{0xa0,0xf8,RN },{0x40,0xf8,RD }}}, -{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{RN,RD},2, {{0xa0,0xf8,RN },{0xa8,0xf8,RD }}}, -{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x14,0xff, }}}, -{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x15,0xff, }}}, -{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1c,0xff, }}}, -{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RN,RD},2, {{0xa8,0xf8,RN },{0x40,0xf8,RD }}}, -{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RN,RD},2, {{0xa8,0xf8,RN },{0xa8,0xf8,RD }}}, -{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x14,0xff, }}}, -{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x15,0xff, }}}, -{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RNDEC,RD},2, {{0xb0,0xf8,RN },{0x40,0xf8,RD }}}, -{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RNDEC},3, {{0xb0,0xf8,RN },{0x00,0xff, },{0x90,0xf8,RS }}}, -{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1c,0xff, }}}, -{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x14,0xff, }}}, -{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RNINC,RD},2, {{0xc0,0xf8,RN },{0x40,0xf8,RD }}}, -{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1c,0xff, }}}, -{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x14,0xff, }}}, -{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x15,0xff, }}}, -{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RNDEC,RD},2, {{0xb8,0xf8,RN },{0x40,0xf8,RD }}}, -{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x15,0xff, }}}, -{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1d,0xff, }}}, -{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x14,0xff, }}}, -{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x15,0xff, }}}, -{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RNINC,RD},2, {{0xc8,0xf8,RN },{0x40,0xf8,RD }}}, -{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x14,0xff, }}}, -{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x15,0xff, }}}, -{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1d,0xff, }}}, -{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RNIND,RD},2, {{0xd0,0xf8,RN },{0x40,0xf8,RD }}}, -{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x14,0xff, }}}, -{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x15,0xff, }}}, -{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1c,0xff, }}}, -{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RNIND,RD},2, {{0xd8,0xf8,RN },{0x40,0xf8,RD }}}, -{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x14,0xff, }}}, -{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x15,0xff, }}}, -{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1d,0xff, }}}, -{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RNIND_D8,RD},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x40,0xf8,RD }}}, -{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x14,0xff, }}}, -{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x15,0xff, }}}, -{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1c,0xff, }}}, -{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x40,0xf8,RD }}}, -{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x14,0xff, }}}, -{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x15,0xff, }}}, -{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1d,0xff, }}}, -{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x40,0xf8,RD }}}, -{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x40,0xf8,RD }}}, -{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x14,0xff, }}}, -{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x15,0xff, }}}, -{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1c,0xff, }}}, -{63,'-','J','!','!',O_PJSR|O_UNSZ,"pjsr",1,{ABS24,0},4, {{0x03,0xff, },{0x00,0x00,ABS24 },{0x00,0x00, },{0x00,0x00, }}}, -{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x40,0xf8,RD }}}, -{66,'s','I','C','C',O_ORC|O_BYTE,"orc.b",2,{IMM8,CRB},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x48,0xf8,CRB }}}, -{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x14,0xff, }}}, -{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x1c,0xff, }}}, -{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x40,0xf8,RD }}}, -{94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x80,0xf8,RD }}}, -{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x14,0xff, }}}, -{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x15,0xff, }}}, -{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1c,0xff, }}}, -{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x15,0xff, }}}, -{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x14,0xff, }}}, -{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x15,0xff, }}}, -{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RNIND_D16},5, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x06,0xff, },{0x00,0x00,IMM8 }}}, -{74,'-','!','!','!',O_NOP|O_UNSZ,"nop",0,{0,0},1, {{0x00,0xff, }}}, -{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x1c,0xff, }}}, -{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x40,0xf8,RD }}}, -{65,'s','I','C','C',O_ORC|O_WORD,"orc.w",2,{IMM16,CRW},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x48,0xf8,CRW }}}, -{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x14,0xff, }}}, -{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x15,0xff, }}}, -{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x1c,0xff, }}}, -{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x40,0xf8,RD }}}, -{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x14,0xff, }}}, -{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x15,0xff, }}}, -{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x1d,0xff, }}}, -{64,'-','J','!','!',O_PJMP|O_UNSZ,"pjmp",1,{RDIND,0},2, {{0x11,0xff, },{0xc0,0xf8,RDIND }}}, -{63,'-','J','!','!',O_PJSR|O_UNSZ,"pjsr",1,{RDIND,0},2, {{0x11,0xff, },{0xc8,0xf8,RDIND }}}, -{62,'-','B','!','!',O_PRTD|O_UNSZ,"prtd",1,{IMM8,0},3, {{0x11,0xff, },{0x14,0xff, },{0x00,0x00,IMM8 }}}, -{61,'-','B','!','!',O_PRTS|O_UNSZ,"prts",0,{0,0},2, {{0x11,0xff, },{0x19,0xff, }}}, -{62,'-','B','!','!',O_PRTD|O_UNSZ,"prtd",1,{IMM16,0},4, {{0x11,0xff, },{0x1c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, -{64,'-','J','!','!',O_PJMP|O_UNSZ,"pjmp",1,{ABS24,0},4, {{0x13,0xff, },{0x00,0x00,ABS24 },{0x00,0x00, },{0x00,0x00, }}}, -{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x40,0xf8,RD }}}, -{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RNDEC,RD},2, {{0xb8,0xf8,RN },{0xa8,0xf8,RD }}}, -{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1c,0xff, }}}, -{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{RNINC,RD},2, {{0xc0,0xf8,RN },{0xa8,0xf8,RD }}}, -{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RNINC,RD},2, {{0xc8,0xf8,RN },{0xa8,0xf8,RD }}}, -{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{RNIND,RD},2, {{0xd0,0xf8,RN },{0xa8,0xf8,RD }}}, -{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RNIND,RD},2, {{0xd8,0xf8,RN },{0xa8,0xf8,RD }}}, -{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{RNIND_D8,RD},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0xa8,0xf8,RD }}}, -{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0xa8,0xf8,RD }}}, -{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1c,0xff, }}}, -{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xa8,0xf8,RD }}}, -{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xa8,0xf8,RD }}}, -{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0xa8,0xf8,RD }}}, -{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0xa8,0xf8,RD }}}, -{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0xa8,0xf8,RD }}}, -{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0xa8,0xf8,RD }}}, -{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x1c,0xff, }}}, -{94,'m','S','!','E',O_MOV|O_BYTE,"mov:g.b",2,{RS,ABS16},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x90,0xf8,RS }}}, -{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xa8,0xf8,RD }}}, -{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RNINC},3, {{0xc0,0xf8,RN },{0x00,0xff, },{0x90,0xf8,RS }}}, -{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1c,0xff, }}}, -{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RNIND},3, {{0xd0,0xf8,RN },{0x00,0xff, },{0x90,0xf8,RS }}}, -{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1c,0xff, }}}, -{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RNIND_D8},4, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x00,0xff, },{0x90,0xf8,RS }}}, -{94,'m','S','!','E',O_MOV|O_BYTE,"mov:g.b",2,{RS,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x90,0xf8,RS }}}, -{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RNIND_D16},5, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x00,0xff, },{0x90,0xf8,RS }}}, -{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,ABS8},4, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x00,0xff, },{0x90,0xf8,RS }}}, -{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RNIND,RD},3, {{0xd0,0xf8,RN },{0x00,0xff, },{0x80,0xf8,RD }}}, -{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RNINC,RD},3, {{0xc0,0xf8,RN },{0x00,0xff, },{0x80,0xf8,RD }}}, -{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1d,0xff, }}}, -{94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x80,0xf8,RD }}}, -{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RNIND_D8,RD},4, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x00,0xff, },{0x80,0xf8,RD }}}, -{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RNIND_D8},4, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x06,0xff, },{0x00,0x00,IMM8 }}}, -{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RNIND_D16,RD},5, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x00,0xff, },{0x80,0xf8,RD }}}, -{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{IMM8,RD},4, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x00,0xff, },{0x80,0xf8,RD }}}, -{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{ABS8,RD},4, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x00,0xff, },{0x80,0xf8,RD }}}, -{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1d,0xff, }}}, -{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1d,0xff, }}}, -{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1d,0xff, }}}, +{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RN},3, {{0xa0,0xf8,RN },{0x00,0xff,0},{0x90,0xf8,RS }}}, +{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x1c,0xff,0}}}, +{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RN,RD},2, {{0xa0,0xf8,RN },{0x40,0xf8,RD }}}, +{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{RN,RD},2, {{0xa0,0xf8,RN },{0xa8,0xf8,RD }}}, +{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x14,0xff,0}}}, +{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x15,0xff,0}}}, +{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x1c,0xff,0}}}, +{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RN,RD},2, {{0xa8,0xf8,RN },{0x40,0xf8,RD }}}, +{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RN,RD},2, {{0xa8,0xf8,RN },{0xa8,0xf8,RD }}}, +{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x14,0xff,0}}}, +{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x15,0xff,0}}}, +{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RNDEC,RD},2, {{0xb0,0xf8,RN },{0x40,0xf8,RD }}}, +{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RNDEC},3, {{0xb0,0xf8,RN },{0x00,0xff,0},{0x90,0xf8,RS }}}, +{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1c,0xff,0}}}, +{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x14,0xff,0}}}, +{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RNINC,RD},2, {{0xc0,0xf8,RN },{0x40,0xf8,RD }}}, +{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1c,0xff,0}}}, +{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x14,0xff,0}}}, +{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x15,0xff,0}}}, +{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RNDEC,RD},2, {{0xb8,0xf8,RN },{0x40,0xf8,RD }}}, +{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x15,0xff,0}}}, +{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1d,0xff,0}}}, +{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x14,0xff,0}}}, +{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x15,0xff,0}}}, +{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RNINC,RD},2, {{0xc8,0xf8,RN },{0x40,0xf8,RD }}}, +{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x14,0xff,0}}}, +{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x15,0xff,0}}}, +{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1d,0xff,0}}}, +{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RNIND,RD},2, {{0xd0,0xf8,RN },{0x40,0xf8,RD }}}, +{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x14,0xff,0}}}, +{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x15,0xff,0}}}, +{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1c,0xff,0}}}, +{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RNIND,RD},2, {{0xd8,0xf8,RN },{0x40,0xf8,RD }}}, +{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x14,0xff,0}}}, +{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x15,0xff,0}}}, +{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1d,0xff,0}}}, +{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RNIND_D8,RD},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x40,0xf8,RD }}}, +{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x14,0xff,0}}}, +{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x15,0xff,0}}}, +{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1c,0xff,0}}}, +{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x40,0xf8,RD }}}, +{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x14,0xff,0}}}, +{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x15,0xff,0}}}, +{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1d,0xff,0}}}, +{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x40,0xf8,RD }}}, +{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x40,0xf8,RD }}}, +{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x14,0xff,0}}}, +{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x15,0xff,0}}}, +{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1c,0xff,0}}}, +{63,'-','J','!','!',O_PJSR|O_UNSZ,"pjsr",1,{ABS24,0},4, {{0x03,0xff,0},{0x00,0x00,ABS24 },{0x00,0x00,0},{0x00,0x00,0}}}, +{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x40,0xf8,RD }}}, +{66,'s','I','C','C',O_ORC|O_BYTE,"orc.b",2,{IMM8,CRB},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x48,0xf8,CRB }}}, +{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x14,0xff,0}}}, +{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x1c,0xff,0}}}, +{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x40,0xf8,RD }}}, +{94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x80,0xf8,RD }}}, +{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x14,0xff,0}}}, +{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x15,0xff,0}}}, +{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1c,0xff,0}}}, +{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x15,0xff,0}}}, +{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x14,0xff,0}}}, +{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x15,0xff,0}}}, +{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RNIND_D16},5, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x06,0xff,0},{0x00,0x00,IMM8 }}}, +{74,'-','!','!','!',O_NOP|O_UNSZ,"nop",0,{0,0},1, {{0x00,0xff,0}}}, +{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x1c,0xff,0}}}, +{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x40,0xf8,RD }}}, +{65,'s','I','C','C',O_ORC|O_WORD,"orc.w",2,{IMM16,CRW},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x48,0xf8,CRW }}}, +{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x14,0xff,0}}}, +{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x15,0xff,0}}}, +{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x1c,0xff,0}}}, +{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x40,0xf8,RD }}}, +{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x14,0xff,0}}}, +{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x15,0xff,0}}}, +{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x1d,0xff,0}}}, +{64,'-','J','!','!',O_PJMP|O_UNSZ,"pjmp",1,{RDIND,0},2, {{0x11,0xff,0},{0xc0,0xf8,RDIND }}}, +{63,'-','J','!','!',O_PJSR|O_UNSZ,"pjsr",1,{RDIND,0},2, {{0x11,0xff,0},{0xc8,0xf8,RDIND }}}, +{62,'-','B','!','!',O_PRTD|O_UNSZ,"prtd",1,{IMM8,0},3, {{0x11,0xff,0},{0x14,0xff,0},{0x00,0x00,IMM8 }}}, +{61,'-','B','!','!',O_PRTS|O_UNSZ,"prts",0,{0,0},2, {{0x11,0xff,0},{0x19,0xff,0}}}, +{62,'-','B','!','!',O_PRTD|O_UNSZ,"prtd",1,{IMM16,0},4, {{0x11,0xff,0},{0x1c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, +{64,'-','J','!','!',O_PJMP|O_UNSZ,"pjmp",1,{ABS24,0},4, {{0x13,0xff,0},{0x00,0x00,ABS24 },{0x00,0x00,0},{0x00,0x00,0}}}, +{69,'m','E','D','D',O_OR|O_BYTE,"or.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x40,0xf8,RD }}}, +{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RNDEC,RD},2, {{0xb8,0xf8,RN },{0xa8,0xf8,RD }}}, +{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x1c,0xff,0}}}, +{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{RNINC,RD},2, {{0xc0,0xf8,RN },{0xa8,0xf8,RD }}}, +{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RNINC,RD},2, {{0xc8,0xf8,RN },{0xa8,0xf8,RD }}}, +{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{RNIND,RD},2, {{0xd0,0xf8,RN },{0xa8,0xf8,RD }}}, +{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RNIND,RD},2, {{0xd8,0xf8,RN },{0xa8,0xf8,RD }}}, +{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{RNIND_D8,RD},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0xa8,0xf8,RD }}}, +{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0xa8,0xf8,RD }}}, +{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x1c,0xff,0}}}, +{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xa8,0xf8,RD }}}, +{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xa8,0xf8,RD }}}, +{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0xa8,0xf8,RD }}}, +{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0xa8,0xf8,RD }}}, +{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0xa8,0xf8,RD }}}, +{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0xa8,0xf8,RD }}}, +{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x1c,0xff,0}}}, +{94,'m','S','!','E',O_MOV|O_BYTE,"mov:g.b",2,{RS,ABS16},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x90,0xf8,RS }}}, +{79,'p','E','D','D',O_MULXU|O_BYTE,"mulxu.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xa8,0xf8,RD }}}, +{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RNINC},3, {{0xc0,0xf8,RN },{0x00,0xff,0},{0x90,0xf8,RS }}}, +{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x1c,0xff,0}}}, +{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RNIND},3, {{0xd0,0xf8,RN },{0x00,0xff,0},{0x90,0xf8,RS }}}, +{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x1c,0xff,0}}}, +{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RNIND_D8},4, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x00,0xff,0},{0x90,0xf8,RS }}}, +{94,'m','S','!','E',O_MOV|O_BYTE,"mov:g.b",2,{RS,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x90,0xf8,RS }}}, +{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,RNIND_D16},5, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x00,0xff,0},{0x90,0xf8,RS }}}, +{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,ABS8},4, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x00,0xff,0},{0x90,0xf8,RS }}}, +{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RNIND,RD},3, {{0xd0,0xf8,RN },{0x00,0xff,0},{0x80,0xf8,RD }}}, +{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RNINC,RD},3, {{0xc0,0xf8,RN },{0x00,0xff,0},{0x80,0xf8,RD }}}, +{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1d,0xff,0}}}, +{94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x80,0xf8,RD }}}, +{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RNIND_D8,RD},4, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x00,0xff,0},{0x80,0xf8,RD }}}, +{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RNIND_D8},4, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x06,0xff,0},{0x00,0x00,IMM8 }}}, +{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{RNIND_D16,RD},5, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x00,0xff,0},{0x80,0xf8,RD }}}, +{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{IMM8,RD},4, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x00,0xff,0},{0x80,0xf8,RD }}}, +{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{ABS8,RD},4, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x00,0xff,0},{0x80,0xf8,RD }}}, +{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x1d,0xff,0}}}, +{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x1d,0xff,0}}}, +{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x1d,0xff,0}}}, {93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{RNDEC,RD},2, {{0xb8,0xf8,RN },{0x80,0xf8,RD }}}, {93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{RNINC,RD},2, {{0xc8,0xf8,RN },{0x80,0xf8,RD }}}, -{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1d,0xff, }}}, +{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x1d,0xff,0}}}, {93,'m','S','!','E',O_MOV|O_WORD,"mov:g.w",2,{RS,RNDEC},2, {{0xb8,0xf8,RN },{0x90,0xf8,RS }}}, {93,'m','S','!','E',O_MOV|O_WORD,"mov:g.w",2,{RS,RNINC},2, {{0xc8,0xf8,RN },{0x90,0xf8,RS }}}, {93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{RNIND,RD},2, {{0xd8,0xf8,RN },{0x80,0xf8,RD }}}, {93,'m','S','!','E',O_MOV|O_WORD,"mov:g.w",2,{RS,RNIND},2, {{0xd8,0xf8,RN },{0x90,0xf8,RS }}}, {93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x80,0xf8,RD }}}, {93,'m','S','!','E',O_MOV|O_WORD,"mov:g.w",2,{RS,RNIND_D8},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x90,0xf8,RS }}}, -{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x1d,0xff, }}}, -{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x1d,0xff, }}}, -{93,'m','S','!','E',O_MOV|O_WORD,"mov:g.w",2,{RS,ABS8},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x90,0xf8,RS }}}, -{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RNDEC},3, {{0xb0,0xf8,RN },{0x06,0xff, },{0x00,0x00,IMM8 }}}, -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RNDEC},4, {{0xb8,0xf8,RN },{0x07,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, +{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x1d,0xff,0}}}, +{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x1d,0xff,0}}}, +{93,'m','S','!','E',O_MOV|O_WORD,"mov:g.w",2,{RS,ABS8},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x90,0xf8,RS }}}, +{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RNDEC},3, {{0xb0,0xf8,RN },{0x06,0xff,0},{0x00,0x00,IMM8 }}}, +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RNDEC},4, {{0xb8,0xf8,RN },{0x07,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,RNDEC},4, {{0xb8,0xf8,RN },{0x06,0xff, },{0x00,0x00,IMM8 },{0x00,0x00, }}}, +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,RNDEC},4, {{0xb8,0xf8,RN },{0x06,0xff,0},{0x00,0x00,IMM8 },{0x00,0x00,0}}}, {94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{RNINC,RD},2, {{0xc0,0xf8,RN },{0x80,0xf8,RD }}}, {94,'m','S','!','E',O_MOV|O_BYTE,"mov:g.b",2,{RS,RNINC},2, {{0xc0,0xf8,RN },{0x90,0xf8,RS }}}, -{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RNINC},3, {{0xc0,0xf8,RN },{0x06,0xff, },{0x00,0x00,IMM8 }}}, -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RNINC},4, {{0xc8,0xf8,RN },{0x07,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, +{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RNINC},3, {{0xc0,0xf8,RN },{0x06,0xff,0},{0x00,0x00,IMM8 }}}, +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RNINC},4, {{0xc8,0xf8,RN },{0x07,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,RNINC},4, {{0xc8,0xf8,RN },{0x06,0xff, },{0x00,0x00,IMM8 },{0x00,0x00, }}}, +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,RNINC},4, {{0xc8,0xf8,RN },{0x06,0xff,0},{0x00,0x00,IMM8 },{0x00,0x00,0}}}, {94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{RNIND,RD},2, {{0xd0,0xf8,RN },{0x80,0xf8,RD }}}, {94,'m','S','!','E',O_MOV|O_BYTE,"mov:g.b",2,{RS,RNIND},2, {{0xd0,0xf8,RN },{0x90,0xf8,RS }}}, -{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RNIND},3, {{0xd0,0xf8,RN },{0x06,0xff, },{0x00,0x00,IMM8 }}}, +{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RNIND},3, {{0xd0,0xf8,RN },{0x06,0xff,0},{0x00,0x00,IMM8 }}}, -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RNIND},4, {{0xd8,0xf8,RN },{0x07,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,RNIND},4, {{0xd8,0xf8,RN },{0x06,0xff, },{0x00,0x00,IMM8 },{0x00,0x00, }}}, +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RNIND},4, {{0xd8,0xf8,RN },{0x07,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,RNIND},4, {{0xd8,0xf8,RN },{0x06,0xff,0},{0x00,0x00,IMM8 },{0x00,0x00,0}}}, {94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{RNIND_D8,RD},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x80,0xf8,RD }}}, {94,'m','S','!','E',O_MOV|O_BYTE,"mov:g.b",2,{RS,RNIND_D8},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x90,0xf8,RS }}}, -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RNIND_D8},5, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x07,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, - -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,RNIND_D8},5, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x06,0xff, },{0x00,0x00,IMM8 },{0x00,0x00, }}}, - - -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RNIND_D16},6, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x07,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RNIND_D8},5, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x07,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,RNIND_D16},6, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x06,0xff, },{0x00,0x00,IMM8 },{0x00,0x00, }}}, +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,RNIND_D8},5, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x06,0xff,0},{0x00,0x00,IMM8 },{0x00,0x00,0}}}, -{93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x80,0xf8,RD }}}, -{93,'m','S','!','E',O_MOV|O_WORD,"mov:g.w",2,{RS,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x90,0xf8,RS }}}, -{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x1d,0xff, }}}, -{94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x80,0xf8,RD }}}, -{94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x80,0xf8,RD }}}, -{94,'m','S','!','E',O_MOV|O_BYTE,"mov:g.b",2,{RS,ABS8},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x90,0xf8,RS }}}, -{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,ABS8},4, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x06,0xff, },{0x00,0x00,IMM8 }}}, -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,ABS8},5, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x07,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, -{93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x80,0xf8,RD }}}, - -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,ABS8},5, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x06,0xff, },{0x00,0x00,IMM8 },{0x00,0x00, }}}, - - -{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x1d,0xff, }}}, -{93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x80,0xf8,RD }}}, -{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{ABS16,RD},5, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x00,0xff, },{0x80,0xf8,RD }}}, -{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,ABS16},5, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x00,0xff, },{0x90,0xf8,RS }}}, -{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,ABS16},5, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x06,0xff, },{0x00,0x00,IMM8 }}}, -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,ABS16},6, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x07,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RNIND_D16},6, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x07,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, -{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,ABS16},6, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x06,0xff, },{0x00,0x00,IMM8 },{0x00,0x00, }}}, +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,RNIND_D16},6, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x06,0xff,0},{0x00,0x00,IMM8 },{0x00,0x00,0}}}, -{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x14,0xff, }}}, -{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1d,0xff, }}}, -{93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x80,0xf8,RD }}}, -{93,'m','S','!','E',O_MOV|O_WORD,"mov:g.w",2,{RS,ABS16},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x90,0xf8,RS }}}, -{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xa8,0xf8,RD }}}, -{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x14,0xff, }}}, -{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1d,0xff, }}}, -{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x15,0xff, }}}, -{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x40,0xf8,RD }}}, -{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x15,0xff, }}}, -{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1c,0xff, }}}, -{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x1c,0xff, }}}, +{93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x80,0xf8,RD }}}, +{93,'m','S','!','E',O_MOV|O_WORD,"mov:g.w",2,{RS,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x90,0xf8,RS }}}, +{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x1d,0xff,0}}}, +{94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x80,0xf8,RD }}}, +{94,'m','E','!','D',O_MOV|O_BYTE,"mov:g.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x80,0xf8,RD }}}, +{94,'m','S','!','E',O_MOV|O_BYTE,"mov:g.b",2,{RS,ABS8},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x90,0xf8,RS }}}, +{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,ABS8},4, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x06,0xff,0},{0x00,0x00,IMM8 }}}, +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,ABS8},5, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x07,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, +{93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x80,0xf8,RD }}}, + +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,ABS8},5, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x06,0xff,0},{0x00,0x00,IMM8 },{0x00,0x00,0}}}, + + +{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x1d,0xff,0}}}, +{93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x80,0xf8,RD }}}, +{83,'-','E','!','D',O_MOVFPE|O_BYTE,"movfpe.b",2,{ABS16,RD},5, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x00,0xff,0},{0x80,0xf8,RD }}}, +{81,'-','S','!','E',O_MOVTPE|O_BYTE,"movtpe.b",2,{RS,ABS16},5, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x00,0xff,0},{0x90,0xf8,RS }}}, +{94,'m','I','!','E',O_MOV|O_BYTE,"mov:g.b",2,{IMM8,ABS16},5, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x06,0xff,0},{0x00,0x00,IMM8 }}}, + +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM16,ABS16},6, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x07,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, + +{93,'m','I','!','E',O_MOV|O_WORD,"mov:g.w",2,{IMM8,ABS16},6, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x06,0xff,0},{0x00,0x00,IMM8 },{0x00,0x00,0}}}, + +{76,'a','E','!','E',O_NEG|O_BYTE,"neg.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x14,0xff,0}}}, +{56,'h','E','!','E',O_ROTR|O_BYTE,"rotr.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1d,0xff,0}}}, +{93,'m','E','!','D',O_MOV|O_WORD,"mov:g.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x80,0xf8,RD }}}, +{93,'m','S','!','E',O_MOV|O_WORD,"mov:g.w",2,{RS,ABS16},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x90,0xf8,RS }}}, +{78,'p','E','D','D',O_MULXU|O_WORD,"mulxu.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xa8,0xf8,RD }}}, +{75,'a','E','!','E',O_NEG|O_WORD,"neg.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x14,0xff,0}}}, +{55,'h','E','!','E',O_ROTR|O_WORD,"rotr.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1d,0xff,0}}}, +{72,'m','E','!','E',O_NOT|O_BYTE,"not.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x15,0xff,0}}}, +{68,'m','E','D','D',O_OR|O_WORD,"or.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x40,0xf8,RD }}}, +{71,'m','E','!','E',O_NOT|O_WORD,"not.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x15,0xff,0}}}, +{58,'h','E','!','E',O_ROTL|O_WORD,"rotl.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1c,0xff,0}}}, +{59,'h','E','!','E',O_ROTL|O_BYTE,"rotl.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x1c,0xff,0}}}, {125,'a','D','I','!',O_CMP|O_BYTE,"cmp:e.b",2,{IMM8,RD},2, {{0x40,0xf8,RD },{0x00,0x00,IMM8 }}}, {123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{RN,RD},2, {{0xa0,0xf8,RN },{0x70,0xf8,RD }}}, -{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RN},3, {{0xa0,0xf8,RN },{0x04,0xff, },{0x00,0x00,IMM8 }}}, +{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RN},3, {{0xa0,0xf8,RN },{0x04,0xff,0},{0x00,0x00,IMM8 }}}, {122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{RN,RD},2, {{0xa8,0xf8,RN },{0x70,0xf8,RD }}}, -{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RN},4, {{0xa8,0xf8,RN },{0x05,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, +{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RN},4, {{0xa8,0xf8,RN },{0x05,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, {107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{RN,CRB},2, {{0xa0,0xf8,RN },{0x88,0xf8,CRB }}}, -{120,'a','D','I','!',O_CMP|O_WORD,"cmp:i.w",2,{IMM16,RD},3, {{0x48,0xf8,RD },{0x00,0x00,IMM16 },{0x00,0x00, }}}, +{120,'a','D','I','!',O_CMP|O_WORD,"cmp:i.w",2,{IMM16,RD},3, {{0x48,0xf8,RD },{0x00,0x00,IMM16 },{0x00,0x00,0}}}, {117,'s','E','D','D',O_DIVXU|O_BYTE,"divxu.b",2,{RN,RD},2, {{0xa0,0xf8,RN },{0xb8,0xf8,RD }}}, -{119,'s','D','!','!',O_DADD|O_UNSZ,"dadd",2,{RS,RD},3, {{0xa0,0xf8,RS },{0x00,0xff, },{0xa0,0xf8,RD }}}, -{115,'s','D','!','!',O_DSUB|O_UNSZ,"dsub",2,{RS,RD},3, {{0xa0,0xf8,RS },{0x00,0xff, },{0xb0,0xf8,RD }}}, -{113,'s','D','!','D',O_EXTS|O_BYTE,"exts.b",1,{RD,0},2, {{0xa0,0xf8,RD },{0x11,0xff, }}}, -{111,'s','D','!','D',O_EXTU|O_BYTE,"extu.b",1,{RD,0},2, {{0xa0,0xf8,RD },{0x12,0xff, }}}, +{119,'s','D','!','!',O_DADD|O_UNSZ,"dadd",2,{RS,RD},3, {{0xa0,0xf8,RS },{0x00,0xff,0},{0xa0,0xf8,RD }}}, +{115,'s','D','!','!',O_DSUB|O_UNSZ,"dsub",2,{RS,RD},3, {{0xa0,0xf8,RS },{0x00,0xff,0},{0xb0,0xf8,RD }}}, +{113,'s','D','!','D',O_EXTS|O_BYTE,"exts.b",1,{RD,0},2, {{0xa0,0xf8,RD },{0x11,0xff,0}}}, +{111,'s','D','!','D',O_EXTU|O_BYTE,"extu.b",1,{RD,0},2, {{0xa0,0xf8,RD },{0x12,0xff,0}}}, {116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{RN,RD},2, {{0xa8,0xf8,RN },{0xb8,0xf8,RD }}}, {107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{RNIND_D8,CRB},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x88,0xf8,CRB }}}, -{107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{RNIND_D16,CRB},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x88,0xf8,CRB }}}, -{110,'-','B','!','!',O_JMP|O_UNSZ,"jmp",1,{ABS16,0},3, {{0x10,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, }}}, -{110,'-','B','!','!',O_JMP|O_UNSZ,"jmp",1,{RDIND,0},2, {{0x11,0xff, },{0xd0,0xf8,RD }}}, -{109,'-','B','!','!',O_JSR|O_UNSZ,"jsr",1,{RDIND,0},2, {{0x11,0xff, },{0xd8,0xf8,RD }}}, -{110,'-','B','!','!',O_JMP|O_UNSZ,"jmp",1,{RDIND_D8,0},3, {{0x11,0xff, },{0xe0,0xf8,RDIND_D8 },{0x00,0x00, }}}, -{109,'-','B','!','!',O_JSR|O_UNSZ,"jsr",1,{RDIND_D8,0},3, {{0x11,0xff, },{0xe8,0xf8,RDIND_D8 },{0x00,0x00, }}}, -{110,'-','B','!','!',O_JMP|O_UNSZ,"jmp",1,{RDIND_D16,0},4, {{0x11,0xff, },{0xf0,0xf8,RDIND_D16 },{0x00,0x00, },{0x00,0x00, }}}, -{109,'-','B','!','!',O_JSR|O_UNSZ,"jsr",1,{RDIND_D16,0},4, {{0x11,0xff, },{0xf8,0xf8,RDIND_D16 },{0x00,0x00, },{0x00,0x00, }}}, -{109,'-','B','!','!',O_JSR|O_UNSZ,"jsr",1,{ABS16,0},3, {{0x18,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, }}}, -{107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{ABS16,CRB},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x88,0xf8,CRB }}}, +{107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{RNIND_D16,CRB},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x88,0xf8,CRB }}}, +{110,'-','B','!','!',O_JMP|O_UNSZ,"jmp",1,{ABS16,0},3, {{0x10,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0}}}, +{110,'-','B','!','!',O_JMP|O_UNSZ,"jmp",1,{RDIND,0},2, {{0x11,0xff,0},{0xd0,0xf8,RD }}}, +{109,'-','B','!','!',O_JSR|O_UNSZ,"jsr",1,{RDIND,0},2, {{0x11,0xff,0},{0xd8,0xf8,RD }}}, +{110,'-','B','!','!',O_JMP|O_UNSZ,"jmp",1,{RDIND_D8,0},3, {{0x11,0xff,0},{0xe0,0xf8,RDIND_D8 },{0x00,0x00,0}}}, +{109,'-','B','!','!',O_JSR|O_UNSZ,"jsr",1,{RDIND_D8,0},3, {{0x11,0xff,0},{0xe8,0xf8,RDIND_D8 },{0x00,0x00,0}}}, +{110,'-','B','!','!',O_JMP|O_UNSZ,"jmp",1,{RDIND_D16,0},4, {{0x11,0xff,0},{0xf0,0xf8,RDIND_D16 },{0x00,0x00,0},{0x00,0x00,0}}}, +{109,'-','B','!','!',O_JSR|O_UNSZ,"jsr",1,{RDIND_D16,0},4, {{0x11,0xff,0},{0xf8,0xf8,RDIND_D16 },{0x00,0x00,0},{0x00,0x00,0}}}, +{109,'-','B','!','!',O_JSR|O_UNSZ,"jsr",1,{ABS16,0},3, {{0x18,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0}}}, +{107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{ABS16,CRB},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x88,0xf8,CRB }}}, {117,'s','E','D','D',O_DIVXU|O_BYTE,"divxu.b",2,{RNDEC,RD},2, {{0xb0,0xf8,RN },{0xb8,0xf8,RD }}}, {116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{RNDEC,RD},2, {{0xb8,0xf8,RN },{0xb8,0xf8,RD }}}, {107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{RNINC,CRB},2, {{0xc0,0xf8,RN },{0x88,0xf8,CRB }}}, @@ -2097,77 +2097,77 @@ h8500_opcode_info h8500_table[] {116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{RNIND,RD},2, {{0xd8,0xf8,RN },{0xb8,0xf8,RD }}}, {117,'s','E','D','D',O_DIVXU|O_BYTE,"divxu.b",2,{RNIND_D8,RD},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0xb8,0xf8,RD }}}, {116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0xb8,0xf8,RD }}}, -{117,'s','E','D','D',O_DIVXU|O_BYTE,"divxu.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xb8,0xf8,RD }}}, -{116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xb8,0xf8,RD }}}, -{107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{IMM8,CRB},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x88,0xf8,CRB }}}, -{117,'s','E','D','D',O_DIVXU|O_BYTE,"divxu.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0xb8,0xf8,RD }}}, -{117,'s','E','D','D',O_DIVXU|O_BYTE,"divxu.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0xb8,0xf8,RD }}}, -{116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0xb8,0xf8,RD }}}, -{117,'s','E','D','D',O_DIVXU|O_BYTE,"divxu.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xb8,0xf8,RD }}}, -{116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xb8,0xf8,RD }}}, -{107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{ABS8,CRB},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x88,0xf8,CRB }}}, -{116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0xb8,0xf8,RD }}}, +{117,'s','E','D','D',O_DIVXU|O_BYTE,"divxu.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xb8,0xf8,RD }}}, +{116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xb8,0xf8,RD }}}, +{107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{IMM8,CRB},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x88,0xf8,CRB }}}, +{117,'s','E','D','D',O_DIVXU|O_BYTE,"divxu.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0xb8,0xf8,RD }}}, +{117,'s','E','D','D',O_DIVXU|O_BYTE,"divxu.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0xb8,0xf8,RD }}}, +{116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0xb8,0xf8,RD }}}, +{117,'s','E','D','D',O_DIVXU|O_BYTE,"divxu.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xb8,0xf8,RD }}}, +{116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xb8,0xf8,RD }}}, +{107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{ABS8,CRB},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x88,0xf8,CRB }}}, +{116,'s','E','D','D',O_DIVXU|O_WORD,"divxu.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0xb8,0xf8,RD }}}, {123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{RNDEC,RD},2, {{0xb0,0xf8,RN },{0x70,0xf8,RD }}}, {107,'s','E','!','C',O_LDC|O_BYTE,"ldc.b",2,{RNDEC,CRB},2, {{0xb0,0xf8,RN },{0x88,0xf8,CRB }}}, -{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RNDEC},3, {{0xb0,0xf8,RN },{0x04,0xff, },{0x00,0x00,IMM8 }}}, -{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RNDEC},4, {{0xb8,0xf8,RN },{0x05,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, +{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RNDEC},3, {{0xb0,0xf8,RN },{0x04,0xff,0},{0x00,0x00,IMM8 }}}, +{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RNDEC},4, {{0xb8,0xf8,RN },{0x05,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, {122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{RNDEC,RD},2, {{0xb8,0xf8,RN },{0x70,0xf8,RD }}}, {123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{RNINC,RD},2, {{0xc0,0xf8,RN },{0x70,0xf8,RD }}}, -{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RNINC},3, {{0xc0,0xf8,RN },{0x04,0xff, },{0x00,0x00,IMM8 }}}, -{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RNINC},4, {{0xc8,0xf8,RN },{0x05,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, +{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RNINC},3, {{0xc0,0xf8,RN },{0x04,0xff,0},{0x00,0x00,IMM8 }}}, +{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RNINC},4, {{0xc8,0xf8,RN },{0x05,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, {122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{RNINC,RD},2, {{0xc8,0xf8,RN },{0x70,0xf8,RD }}}, {123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{RNIND,RD},2, {{0xd0,0xf8,RN },{0x70,0xf8,RD }}}, -{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RNIND},3, {{0xd0,0xf8,RN },{0x04,0xff, },{0x00,0x00,IMM8 }}}, -{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RNIND},4, {{0xd8,0xf8,RN },{0x05,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, +{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RNIND},3, {{0xd0,0xf8,RN },{0x04,0xff,0},{0x00,0x00,IMM8 }}}, +{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RNIND},4, {{0xd8,0xf8,RN },{0x05,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, {122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{RNIND,RD},2, {{0xd8,0xf8,RN },{0x70,0xf8,RD }}}, {123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{RNIND_D8,RD},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x70,0xf8,RD }}}, -{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RNIND_D8},4, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x04,0xff, },{0x00,0x00,IMM8 }}}, -{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RNIND_D8},5, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x05,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, +{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RNIND_D8},4, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x04,0xff,0},{0x00,0x00,IMM8 }}}, +{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RNIND_D8},5, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x05,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, {122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x70,0xf8,RD }}}, -{123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x70,0xf8,RD }}}, -{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RNIND_D16},5, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x04,0xff, },{0x00,0x00,IMM8 }}}, -{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RNIND_D16},6, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x05,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, -{122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x70,0xf8,RD }}}, -{105,'-','E','!','C',O_LDM|O_UNSZ,"ldm",2,{SPINC,RLIST},2, {{0x02,0xff, },{0x00,0x00,RLIST }}}, -{123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x70,0xf8,RD }}}, -{123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x70,0xf8,RD }}}, -{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,ABS8},4, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x04,0xff, },{0x00,0x00,IMM8 }}}, -{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,ABS8},5, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x05,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, -{122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x70,0xf8,RD }}}, -{106,'s','E','!','C',O_LDC|O_WORD,"ldc.w",2,{IMM16,CRW},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x88,0xf8,CRW }}}, -{122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x70,0xf8,RD }}}, -{123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x70,0xf8,RD }}}, -{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,ABS16},5, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x04,0xff, },{0x00,0x00,IMM8 }}}, -{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,ABS16},6, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x05,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, -{122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x70,0xf8,RD }}}, -{104,'-','S','I','!',O_LINK|O_UNSZ,"link",2,{FP,IMM16},3, {{0x1f,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, }}}, -{104,'-','S','I','!',O_LINK|O_UNSZ,"link",2,{FP,IMM8},2, {{0x17,0xff, },{0x00,0x00,IMM8 }}}, +{123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x70,0xf8,RD }}}, +{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RNIND_D16},5, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x04,0xff,0},{0x00,0x00,IMM8 }}}, +{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RNIND_D16},6, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x05,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, +{122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x70,0xf8,RD }}}, +{105,'-','E','!','C',O_LDM|O_UNSZ,"ldm",2,{SPINC,RLIST},2, {{0x02,0xff,0},{0x00,0x00,RLIST }}}, +{123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x70,0xf8,RD }}}, +{123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x70,0xf8,RD }}}, +{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,ABS8},4, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x04,0xff,0},{0x00,0x00,IMM8 }}}, +{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,ABS8},5, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x05,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, +{122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x70,0xf8,RD }}}, +{106,'s','E','!','C',O_LDC|O_WORD,"ldc.w",2,{IMM16,CRW},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x88,0xf8,CRW }}}, +{122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x70,0xf8,RD }}}, +{123,'a','D','E','!',O_CMP|O_BYTE,"cmp:g.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x70,0xf8,RD }}}, +{123,'a','E','I','!',O_CMP|O_BYTE,"cmp:g.b",2,{IMM8,ABS16},5, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x04,0xff,0},{0x00,0x00,IMM8 }}}, +{122,'a','E','I','!',O_CMP|O_WORD,"cmp:g.w",2,{IMM16,ABS16},6, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x05,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, +{122,'a','D','E','!',O_CMP|O_WORD,"cmp:g.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x70,0xf8,RD }}}, +{104,'-','S','I','!',O_LINK|O_UNSZ,"link",2,{FP,IMM16},3, {{0x1f,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0}}}, +{104,'-','S','I','!',O_LINK|O_UNSZ,"link",2,{FP,IMM8},2, {{0x17,0xff,0},{0x00,0x00,IMM8 }}}, {149,'b','E','I','E',O_BSET|O_BYTE,"bset.b",2,{IMM4,RN},2, {{0xa0,0xf8,RN },{0xc0,0xf0,IMM4 }}}, {140,'b','E','I','E',O_BTST|O_BYTE,"btst.b",2,{IMM4,RN},2, {{0xa0,0xf8,RN },{0xf0,0xf0,IMM4 }}}, {149,'b','E','S','E',O_BSET|O_BYTE,"bset.b",2,{RS,RN},2, {{0xa0,0xf8,RN },{0x48,0xf8,RS }}}, {140,'b','E','S','E',O_BTST|O_BYTE,"btst.b",2,{RS,RN},2, {{0xa0,0xf8,RN },{0x78,0xf8,RS }}}, -{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x13,0xff, }}}, +{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RN,0},2, {{0xa0,0xf8,RN },{0x13,0xff,0}}}, {148,'b','E','I','E',O_BSET|O_WORD,"bset.w",2,{IMM4,RN},2, {{0xa8,0xf8,RN },{0xc0,0xf0,IMM4 }}}, {139,'b','E','I','E',O_BTST|O_WORD,"btst.w",2,{IMM4,RN},2, {{0xa8,0xf8,RN },{0xf0,0xf0,IMM4 }}}, -{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x13,0xff, }}}, -{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x13,0xff, }}}, -{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x13,0xff, }}}, +{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RNDEC,0},2, {{0xb0,0xf8,RN },{0x13,0xff,0}}}, +{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RNINC,0},2, {{0xc0,0xf8,RN },{0x13,0xff,0}}}, +{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RNIND,0},2, {{0xd0,0xf8,RN },{0x13,0xff,0}}}, {139,'b','E','S','E',O_BTST|O_WORD,"btst.w",2,{RS,RNIND},2, {{0xd8,0xf8,RN },{0x78,0xf8,RS }}}, -{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x13,0xff, }}}, -{140,'b','E','I','E',O_BTST|O_BYTE,"btst.b",2,{IMM4,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xf0,0xf0,IMM4 }}}, -{140,'b','E','S','E',O_BTST|O_BYTE,"btst.b",2,{RS,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x78,0xf8,RS }}}, -{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x13,0xff, }}}, -{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x13,0xff, }}}, -{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{IMM8,0},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x13,0xff, }}}, -{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{ABS8,0},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x13,0xff, }}}, -{140,'b','E','I','E',O_BTST|O_BYTE,"btst.b",2,{IMM4,ABS8},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0xf0,0xf0,IMM4 }}}, -{140,'b','E','S','E',O_BTST|O_BYTE,"btst.b",2,{RS,ABS8},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x78,0xf8,RS }}}, +{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RNIND_D8,0},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x13,0xff,0}}}, +{140,'b','E','I','E',O_BTST|O_BYTE,"btst.b",2,{IMM4,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xf0,0xf0,IMM4 }}}, +{140,'b','E','S','E',O_BTST|O_BYTE,"btst.b",2,{RS,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x78,0xf8,RS }}}, +{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{RNIND_D16,0},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x13,0xff,0}}}, +{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RNIND_D16,0},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x13,0xff,0}}}, +{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{IMM8,0},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x13,0xff,0}}}, +{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{ABS8,0},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x13,0xff,0}}}, +{140,'b','E','I','E',O_BTST|O_BYTE,"btst.b",2,{IMM4,ABS8},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0xf0,0xf0,IMM4 }}}, +{140,'b','E','S','E',O_BTST|O_BYTE,"btst.b",2,{RS,ABS8},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x78,0xf8,RS }}}, {139,'b','E','S','E',O_BTST|O_WORD,"btst.w",2,{RS,RN},2, {{0xa8,0xf8,RN },{0x78,0xf8,RS }}}, {140,'b','E','I','E',O_BTST|O_BYTE,"btst.b",2,{IMM4,RNDEC},2, {{0xb0,0xf8,RN },{0xf0,0xf0,IMM4 }}}, {140,'b','E','S','E',O_BTST|O_BYTE,"btst.b",2,{RS,RNDEC},2, {{0xb0,0xf8,RN },{0x78,0xf8,RS }}}, {139,'b','E','I','E',O_BTST|O_WORD,"btst.w",2,{IMM4,RNDEC},2, {{0xb8,0xf8,RN },{0xf0,0xf0,IMM4 }}}, {139,'b','E','S','E',O_BTST|O_WORD,"btst.w",2,{RS,RNDEC},2, {{0xb8,0xf8,RN },{0x78,0xf8,RS }}}, -{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x13,0xff, }}}, +{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RNDEC,0},2, {{0xb8,0xf8,RN },{0x13,0xff,0}}}, {140,'b','E','I','E',O_BTST|O_BYTE,"btst.b",2,{IMM4,RNINC},2, {{0xc0,0xf8,RN },{0xf0,0xf0,IMM4 }}}, {140,'b','E','S','E',O_BTST|O_BYTE,"btst.b",2,{RS,RNINC},2, {{0xc0,0xf8,RN },{0x78,0xf8,RS }}}, {139,'b','E','I','E',O_BTST|O_WORD,"btst.w",2,{IMM4,RNINC},2, {{0xc8,0xf8,RN },{0xf0,0xf0,IMM4 }}}, @@ -2179,57 +2179,57 @@ h8500_opcode_info h8500_table[] {140,'b','E','S','E',O_BTST|O_BYTE,"btst.b",2,{RS,RNIND_D8},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x78,0xf8,RS }}}, {139,'b','E','I','E',O_BTST|O_WORD,"btst.w",2,{IMM4,RNIND_D8},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0xf0,0xf0,IMM4 }}}, {139,'b','E','S','E',O_BTST|O_WORD,"btst.w",2,{RS,RNIND_D8},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x78,0xf8,RS }}}, -{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x13,0xff, }}}, -{139,'b','E','I','E',O_BTST|O_WORD,"btst.w",2,{IMM4,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xf0,0xf0,IMM4 }}}, -{139,'b','E','S','E',O_BTST|O_WORD,"btst.w",2,{RS,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x78,0xf8,RS }}}, -{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{IMM16,0},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x13,0xff, }}}, -{139,'b','E','I','E',O_BTST|O_WORD,"btst.w",2,{IMM4,ABS8},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0xf0,0xf0,IMM4 }}}, -{139,'b','E','S','E',O_BTST|O_WORD,"btst.w",2,{RS,ABS8},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x78,0xf8,RS }}}, -{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{ABS8,0},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x13,0xff, }}}, -{140,'b','E','I','E',O_BTST|O_BYTE,"btst.b",2,{IMM4,ABS16},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xf0,0xf0,IMM4 }}}, -{140,'b','E','S','E',O_BTST|O_BYTE,"btst.b",2,{RS,ABS16},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x78,0xf8,RS }}}, -{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{ABS16,0},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x13,0xff, }}}, -{139,'b','E','I','E',O_BTST|O_WORD,"btst.w",2,{IMM4,ABS16},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xf0,0xf0,IMM4 }}}, -{139,'b','E','S','E',O_BTST|O_WORD,"btst.w",2,{RS,ABS16},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x78,0xf8,RS }}}, -{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{ABS16,0},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x13,0xff, }}}, -{137,'-','B','!','!',O_BVC|O_BYTE,"bvc.b",1,{PCREL8,0},2, {{0x28,0xff, },{0x00,0x00,PCREL8 }}}, -{134,'-','B','!','!',O_BVS|O_BYTE,"bvs.b",1,{PCREL8,0},2, {{0x29,0xff, },{0x00,0x00,PCREL8 }}}, -{136,'-','B','!','!',O_BVC|O_WORD,"bvc.w",1,{PCREL16,0},3, {{0x38,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{133,'-','B','!','!',O_BVS|O_WORD,"bvs.w",1,{PCREL16,0},3, {{0x39,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, +{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RNIND_D8,0},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x13,0xff,0}}}, +{139,'b','E','I','E',O_BTST|O_WORD,"btst.w",2,{IMM4,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xf0,0xf0,IMM4 }}}, +{139,'b','E','S','E',O_BTST|O_WORD,"btst.w",2,{RS,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x78,0xf8,RS }}}, +{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{IMM16,0},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x13,0xff,0}}}, +{139,'b','E','I','E',O_BTST|O_WORD,"btst.w",2,{IMM4,ABS8},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0xf0,0xf0,IMM4 }}}, +{139,'b','E','S','E',O_BTST|O_WORD,"btst.w",2,{RS,ABS8},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x78,0xf8,RS }}}, +{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{ABS8,0},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x13,0xff,0}}}, +{140,'b','E','I','E',O_BTST|O_BYTE,"btst.b",2,{IMM4,ABS16},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xf0,0xf0,IMM4 }}}, +{140,'b','E','S','E',O_BTST|O_BYTE,"btst.b",2,{RS,ABS16},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x78,0xf8,RS }}}, +{131,'c','!','!','E',O_CLR|O_BYTE,"clr.b",1,{ABS16,0},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x13,0xff,0}}}, +{139,'b','E','I','E',O_BTST|O_WORD,"btst.w",2,{IMM4,ABS16},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xf0,0xf0,IMM4 }}}, +{139,'b','E','S','E',O_BTST|O_WORD,"btst.w",2,{RS,ABS16},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x78,0xf8,RS }}}, +{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{ABS16,0},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x13,0xff,0}}}, +{137,'-','B','!','!',O_BVC|O_BYTE,"bvc.b",1,{PCREL8,0},2, {{0x28,0xff,0},{0x00,0x00,PCREL8 }}}, +{134,'-','B','!','!',O_BVS|O_BYTE,"bvs.b",1,{PCREL8,0},2, {{0x29,0xff,0},{0x00,0x00,PCREL8 }}}, +{136,'-','B','!','!',O_BVC|O_WORD,"bvc.w",1,{PCREL16,0},3, {{0x38,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{133,'-','B','!','!',O_BVS|O_WORD,"bvs.w",1,{PCREL16,0},3, {{0x39,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, {149,'b','E','I','E',O_BSET|O_BYTE,"bset.b",2,{IMM4,RNDEC},2, {{0xb0,0xf8,RN },{0xc0,0xf0,IMM4 }}}, {149,'b','E','S','E',O_BSET|O_BYTE,"bset.b",2,{RS,RNDEC},2, {{0xb0,0xf8,RN },{0x48,0xf8,RS }}}, {148,'b','E','S','E',O_BSET|O_WORD,"bset.w",2,{RS,RN},2, {{0xa8,0xf8,RN },{0x48,0xf8,RS }}}, -{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x13,0xff, }}}, +{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RN,0},2, {{0xa8,0xf8,RN },{0x13,0xff,0}}}, {148,'b','E','I','E',O_BSET|O_WORD,"bset.w",2,{IMM4,RNDEC},2, {{0xb8,0xf8,RN },{0xc0,0xf0,IMM4 }}}, {148,'b','E','S','E',O_BSET|O_WORD,"bset.w",2,{RS,RNDEC},2, {{0xb8,0xf8,RN },{0x48,0xf8,RS }}}, {149,'b','E','I','E',O_BSET|O_BYTE,"bset.b",2,{IMM4,RNINC},2, {{0xc0,0xf8,RN },{0xc0,0xf0,IMM4 }}}, {149,'b','E','S','E',O_BSET|O_BYTE,"bset.b",2,{RS,RNINC},2, {{0xc0,0xf8,RN },{0x48,0xf8,RS }}}, {148,'b','E','I','E',O_BSET|O_WORD,"bset.w",2,{IMM4,RNINC},2, {{0xc8,0xf8,RN },{0xc0,0xf0,IMM4 }}}, {148,'b','E','S','E',O_BSET|O_WORD,"bset.w",2,{RS,RNINC},2, {{0xc8,0xf8,RN },{0x48,0xf8,RS }}}, -{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x13,0xff, }}}, +{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RNINC,0},2, {{0xc8,0xf8,RN },{0x13,0xff,0}}}, {149,'b','E','I','E',O_BSET|O_BYTE,"bset.b",2,{IMM4,RNIND},2, {{0xd0,0xf8,RN },{0xc0,0xf0,IMM4 }}}, {149,'b','E','S','E',O_BSET|O_BYTE,"bset.b",2,{RS,RNIND},2, {{0xd0,0xf8,RN },{0x48,0xf8,RS }}}, {148,'b','E','I','E',O_BSET|O_WORD,"bset.w",2,{IMM4,RNIND},2, {{0xd8,0xf8,RN },{0xc0,0xf0,IMM4 }}}, {148,'b','E','S','E',O_BSET|O_WORD,"bset.w",2,{RS,RNIND},2, {{0xd8,0xf8,RN },{0x48,0xf8,RS }}}, -{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x13,0xff, }}}, +{130,'c','!','!','E',O_CLR|O_WORD,"clr.w",1,{RNIND,0},2, {{0xd8,0xf8,RN },{0x13,0xff,0}}}, {149,'b','E','I','E',O_BSET|O_BYTE,"bset.b",2,{IMM4,RNIND_D8},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0xc0,0xf0,IMM4 }}}, {149,'b','E','S','E',O_BSET|O_BYTE,"bset.b",2,{RS,RNIND_D8},3, {{0xe0,0xf8,RN },{0x00,0x00,DISP8 },{0x48,0xf8,RS }}}, {148,'b','E','I','E',O_BSET|O_WORD,"bset.w",2,{IMM4,RNIND_D8},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0xc0,0xf0,IMM4 }}}, {148,'b','E','S','E',O_BSET|O_WORD,"bset.w",2,{RS,RNIND_D8},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x48,0xf8,RS }}}, -{149,'b','E','I','E',O_BSET|O_BYTE,"bset.b",2,{IMM4,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xc0,0xf0,IMM4 }}}, -{149,'b','E','S','E',O_BSET|O_BYTE,"bset.b",2,{RS,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x48,0xf8,RS }}}, -{148,'b','E','I','E',O_BSET|O_WORD,"bset.w",2,{IMM4,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xc0,0xf0,IMM4 }}}, -{148,'b','E','S','E',O_BSET|O_WORD,"bset.w",2,{RS,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x48,0xf8,RS }}}, -{149,'b','E','I','E',O_BSET|O_BYTE,"bset.b",2,{IMM4,ABS8},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0xc0,0xf0,IMM4 }}}, -{149,'b','E','S','E',O_BSET|O_BYTE,"bset.b",2,{RS,ABS8},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x48,0xf8,RS }}}, -{148,'b','E','I','E',O_BSET|O_WORD,"bset.w",2,{IMM4,ABS8},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0xc0,0xf0,IMM4 }}}, -{148,'b','E','S','E',O_BSET|O_WORD,"bset.w",2,{RS,ABS8},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x48,0xf8,RS }}}, -{146,'-','B','!','!',O_BSR|O_BYTE,"bsr.b",1,{PCREL8,0},2, {{0x0e,0xff, },{0x00,0x00,PCREL8 }}}, -{149,'b','E','I','E',O_BSET|O_BYTE,"bset.b",2,{IMM4,ABS16},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xc0,0xf0,IMM4 }}}, -{149,'b','E','S','E',O_BSET|O_BYTE,"bset.b",2,{RS,ABS16},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x48,0xf8,RS }}}, -{148,'b','E','I','E',O_BSET|O_WORD,"bset.w",2,{IMM4,ABS16},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xc0,0xf0,IMM4 }}}, -{148,'b','E','S','E',O_BSET|O_WORD,"bset.w",2,{RS,ABS16},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x48,0xf8,RS }}}, -{145,'-','B','!','!',O_BSR|O_WORD,"bsr.w",1,{PCREL16,0},3, {{0x1e,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, +{149,'b','E','I','E',O_BSET|O_BYTE,"bset.b",2,{IMM4,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xc0,0xf0,IMM4 }}}, +{149,'b','E','S','E',O_BSET|O_BYTE,"bset.b",2,{RS,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x48,0xf8,RS }}}, +{148,'b','E','I','E',O_BSET|O_WORD,"bset.w",2,{IMM4,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xc0,0xf0,IMM4 }}}, +{148,'b','E','S','E',O_BSET|O_WORD,"bset.w",2,{RS,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x48,0xf8,RS }}}, +{149,'b','E','I','E',O_BSET|O_BYTE,"bset.b",2,{IMM4,ABS8},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0xc0,0xf0,IMM4 }}}, +{149,'b','E','S','E',O_BSET|O_BYTE,"bset.b",2,{RS,ABS8},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x48,0xf8,RS }}}, +{148,'b','E','I','E',O_BSET|O_WORD,"bset.w",2,{IMM4,ABS8},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0xc0,0xf0,IMM4 }}}, +{148,'b','E','S','E',O_BSET|O_WORD,"bset.w",2,{RS,ABS8},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x48,0xf8,RS }}}, +{146,'-','B','!','!',O_BSR|O_BYTE,"bsr.b",1,{PCREL8,0},2, {{0x0e,0xff,0},{0x00,0x00,PCREL8 }}}, +{149,'b','E','I','E',O_BSET|O_BYTE,"bset.b",2,{IMM4,ABS16},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xc0,0xf0,IMM4 }}}, +{149,'b','E','S','E',O_BSET|O_BYTE,"bset.b",2,{RS,ABS16},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x48,0xf8,RS }}}, +{148,'b','E','I','E',O_BSET|O_WORD,"bset.w",2,{IMM4,ABS16},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xc0,0xf0,IMM4 }}}, +{148,'b','E','S','E',O_BSET|O_WORD,"bset.w",2,{RS,ABS16},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x48,0xf8,RS }}}, +{145,'-','B','!','!',O_BSR|O_WORD,"bsr.w",1,{PCREL16,0},3, {{0x1e,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, {204,'b','E','I','E',O_BCLR|O_BYTE,"bclr.b",2,{IMM4,RN},2, {{0xa0,0xf8,RN },{0xd0,0xf0,IMM4 }}}, {162,'b','E','I','E',O_BNOT|O_BYTE,"bnot.b",2,{IMM4,RN},2, {{0xa0,0xf8,RN },{0xe0,0xf0,IMM4 }}}, {222,'a','I','E','E',O_ADD|O_BYTE,"add:q.b",2,{QIM,RN},2, {{0xa0,0xf8,RN },{0x08,0xf8,QIM }}}, @@ -2318,102 +2318,102 @@ h8500_opcode_info h8500_table[] {218,'-','E','D','D',O_ADDS|O_WORD,"adds.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x28,0xf8,RD }}}, {212,'m','E','D','D',O_AND|O_WORD,"and.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x50,0xf8,RD }}}, {203,'b','E','S','E',O_BCLR|O_WORD,"bclr.w",2,{RS,RNIND_D8},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x58,0xf8,RS }}}, -{204,'b','E','I','E',O_BCLR|O_BYTE,"bclr.b",2,{IMM4,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xd0,0xf0,IMM4 }}}, -{222,'a','I','E','E',O_ADD|O_BYTE,"add:q.b",2,{QIM,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x08,0xf8,QIM }}}, -{204,'b','E','S','E',O_BCLR|O_BYTE,"bclr.b",2,{RS,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x58,0xf8,RS }}}, +{204,'b','E','I','E',O_BCLR|O_BYTE,"bclr.b",2,{IMM4,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xd0,0xf0,IMM4 }}}, +{222,'a','I','E','E',O_ADD|O_BYTE,"add:q.b",2,{QIM,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x08,0xf8,QIM }}}, +{204,'b','E','S','E',O_BCLR|O_BYTE,"bclr.b",2,{RS,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x58,0xf8,RS }}}, {161,'b','E','S','E',O_BNOT|O_WORD,"bnot.w",2,{RS,RNIND_D8},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0x68,0xf8,RS }}}, -{216,'a','E','D','D',O_ADDX|O_BYTE,"addx.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xa0,0xf8,RD }}}, -{225,'a','E','D','D',O_ADD|O_BYTE,"add:g.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x20,0xf8,RD }}}, -{224,'a','E','D','D',O_ADD|O_WORD,"add:g.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x20,0xf8,RD }}}, +{216,'a','E','D','D',O_ADDX|O_BYTE,"addx.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xa0,0xf8,RD }}}, +{225,'a','E','D','D',O_ADD|O_BYTE,"add:g.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x20,0xf8,RD }}}, +{224,'a','E','D','D',O_ADD|O_WORD,"add:g.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x20,0xf8,RD }}}, {215,'a','E','D','D',O_ADDX|O_WORD,"addx.w",2,{RNIND_D8,RD},3, {{0xe8,0xf8,RN },{0x00,0x00,DISP8 },{0xa0,0xf8,RD }}}, -{162,'b','E','I','E',O_BNOT|O_BYTE,"bnot.b",2,{IMM4,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xe0,0xf0,IMM4 }}}, -{219,'-','E','D','D',O_ADDS|O_BYTE,"adds.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x28,0xf8,RD }}}, -{213,'m','E','D','D',O_AND|O_BYTE,"and.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x50,0xf8,RD }}}, -{162,'b','E','S','E',O_BNOT|O_BYTE,"bnot.b",2,{RS,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x68,0xf8,RS }}}, -{203,'b','E','I','E',O_BCLR|O_WORD,"bclr.w",2,{IMM4,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xd0,0xf0,IMM4 }}}, -{161,'b','E','I','E',O_BNOT|O_WORD,"bnot.w",2,{IMM4,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xe0,0xf0,IMM4 }}}, -{221,'a','I','E','E',O_ADD|O_WORD,"add:q.w",2,{QIM,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x08,0xf8,QIM }}}, -{218,'-','E','D','D',O_ADDS|O_WORD,"adds.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x28,0xf8,RD }}}, -{212,'m','E','D','D',O_AND|O_WORD,"and.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x50,0xf8,RD }}}, -{203,'b','E','S','E',O_BCLR|O_WORD,"bclr.w",2,{RS,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x58,0xf8,RS }}}, -{161,'b','E','S','E',O_BNOT|O_WORD,"bnot.w",2,{RS,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0x68,0xf8,RS }}}, -{215,'a','E','D','D',O_ADDX|O_WORD,"addx.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00, },{0xa0,0xf8,RD }}}, -{225,'a','E','D','D',O_ADD|O_BYTE,"add:g.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x20,0xf8,RD }}}, -{219,'-','E','D','D',O_ADDS|O_BYTE,"adds.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x28,0xf8,RD }}}, -{213,'m','E','D','D',O_AND|O_BYTE,"and.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x50,0xf8,RD }}}, -{210,'s','I','S','S',O_ANDC|O_BYTE,"andc.b",2,{IMM8,CRB},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0x58,0xf8,CRB }}}, -{216,'a','E','D','D',O_ADDX|O_BYTE,"addx.b",2,{IMM8,RD},3, {{0x04,0xff, },{0x00,0x00,IMM8 },{0xa0,0xf8,RD }}}, -{204,'b','E','I','E',O_BCLR|O_BYTE,"bclr.b",2,{IMM4,ABS8},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0xd0,0xf0,IMM4 }}}, -{162,'b','E','I','E',O_BNOT|O_BYTE,"bnot.b",2,{IMM4,ABS8},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0xe0,0xf0,IMM4 }}}, -{222,'a','I','E','E',O_ADD|O_BYTE,"add:q.b",2,{QIM,ABS8},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x08,0xf8,QIM }}}, -{225,'a','E','D','D',O_ADD|O_BYTE,"add:g.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x20,0xf8,RD }}}, -{219,'-','E','D','D',O_ADDS|O_BYTE,"adds.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x28,0xf8,RD }}}, -{213,'m','E','D','D',O_AND|O_BYTE,"and.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x50,0xf8,RD }}}, -{204,'b','E','S','E',O_BCLR|O_BYTE,"bclr.b",2,{RS,ABS8},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x58,0xf8,RS }}}, -{162,'b','E','S','E',O_BNOT|O_BYTE,"bnot.b",2,{RS,ABS8},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0x68,0xf8,RS }}}, -{216,'a','E','D','D',O_ADDX|O_BYTE,"addx.b",2,{ABS8,RD},3, {{0x05,0xff, },{0x00,0x00,ABS8 },{0xa0,0xf8,RD }}}, -{224,'a','E','D','D',O_ADD|O_WORD,"add:g.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x20,0xf8,RD }}}, -{218,'-','E','D','D',O_ADDS|O_WORD,"adds.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x28,0xf8,RD }}}, -{212,'m','E','D','D',O_AND|O_WORD,"and.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x50,0xf8,RD }}}, -{209,'s','I','S','S',O_ANDC|O_WORD,"andc.w",2,{IMM16,CRW},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0x58,0xf8,CRW }}}, -{215,'a','E','D','D',O_ADDX|O_WORD,"addx.w",2,{IMM16,RD},4, {{0x0c,0xff, },{0x00,0x00,IMM16 },{0x00,0x00, },{0xa0,0xf8,RD }}}, -{161,'b','E','I','E',O_BNOT|O_WORD,"bnot.w",2,{IMM4,ABS8},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0xe0,0xf0,IMM4 }}}, -{221,'a','I','E','E',O_ADD|O_WORD,"add:q.w",2,{QIM,ABS8},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x08,0xf8,QIM }}}, -{224,'a','E','D','D',O_ADD|O_WORD,"add:g.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x20,0xf8,RD }}}, -{218,'-','E','D','D',O_ADDS|O_WORD,"adds.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x28,0xf8,RD }}}, -{157,'-','!','!','!',O_BPT|O_UNSZ,"bpt",0,{0,0},1, {{0x0b,0xff, }}}, -{203,'b','E','I','E',O_BCLR|O_WORD,"bclr.w",2,{IMM4,ABS8},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0xd0,0xf0,IMM4 }}}, -{212,'m','E','D','D',O_AND|O_WORD,"and.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x50,0xf8,RD }}}, -{203,'b','E','S','E',O_BCLR|O_WORD,"bclr.w",2,{RS,ABS8},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x58,0xf8,RS }}}, -{161,'b','E','S','E',O_BNOT|O_WORD,"bnot.w",2,{RS,ABS8},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0x68,0xf8,RS }}}, -{215,'a','E','D','D',O_ADDX|O_WORD,"addx.w",2,{ABS8,RD},3, {{0x0d,0xff, },{0x00,0x00,ABS8 },{0xa0,0xf8,RD }}}, -{204,'b','E','I','E',O_BCLR|O_BYTE,"bclr.b",2,{IMM4,ABS16},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xd0,0xf0,IMM4 }}}, -{225,'a','E','D','D',O_ADD|O_BYTE,"add:g.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x20,0xf8,RD }}}, -{219,'-','E','D','D',O_ADDS|O_BYTE,"adds.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x28,0xf8,RD }}}, -{213,'m','E','D','D',O_AND|O_BYTE,"and.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x50,0xf8,RD }}}, -{204,'b','E','S','E',O_BCLR|O_BYTE,"bclr.b",2,{RS,ABS16},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x58,0xf8,RS }}}, -{216,'a','E','D','D',O_ADDX|O_BYTE,"addx.b",2,{ABS16,RD},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xa0,0xf8,RD }}}, -{203,'b','E','I','E',O_BCLR|O_WORD,"bclr.w",2,{IMM4,ABS16},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xd0,0xf0,IMM4 }}}, -{218,'-','E','D','D',O_ADDS|O_WORD,"adds.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x28,0xf8,RD }}}, -{212,'m','E','D','D',O_AND|O_WORD,"and.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x50,0xf8,RD }}}, -{203,'b','E','S','E',O_BCLR|O_WORD,"bclr.w",2,{RS,ABS16},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x58,0xf8,RS }}}, -{215,'a','E','D','D',O_ADDX|O_WORD,"addx.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xa0,0xf8,RD }}}, -{155,'-','B','!','!',O_BRA|O_BYTE,"bra.b",1,{PCREL8,0},2, {{0x20,0xff, },{0x00,0x00,PCREL8 }}}, -{162,'b','E','I','E',O_BNOT|O_BYTE,"bnot.b",2,{IMM4,ABS16},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xe0,0xf0,IMM4 }}}, -{222,'a','I','E','E',O_ADD|O_BYTE,"add:q.b",2,{QIM,ABS16},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x08,0xf8,QIM }}}, -{162,'b','E','S','E',O_BNOT|O_BYTE,"bnot.b",2,{RS,ABS16},4, {{0x15,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x68,0xf8,RS }}}, -{161,'b','E','I','E',O_BNOT|O_WORD,"bnot.w",2,{IMM4,ABS16},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0xe0,0xf0,IMM4 }}}, -{221,'a','I','E','E',O_ADD|O_WORD,"add:q.w",2,{QIM,ABS16},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x08,0xf8,QIM }}}, -{224,'a','E','D','D',O_ADD|O_WORD,"add:g.w",2,{ABS16,RD},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x20,0xf8,RD }}}, -{161,'b','E','S','E',O_BNOT|O_WORD,"bnot.w",2,{RS,ABS16},4, {{0x1d,0xff, },{0x00,0x00,ABS16 },{0x00,0x00, },{0x68,0xf8,RS }}}, -{152,'-','B','!','!',O_BRN|O_BYTE,"brn.b",1,{PCREL8,0},2, {{0x21,0xff, },{0x00,0x00,PCREL8 }}}, -{186,'-','B','!','!',O_BHI|O_BYTE,"bhi.b",1,{PCREL8,0},2, {{0x22,0xff, },{0x00,0x00,PCREL8 }}}, -{174,'-','B','!','!',O_BLS|O_BYTE,"bls.b",1,{PCREL8,0},2, {{0x23,0xff, },{0x00,0x00,PCREL8 }}}, -{207,'-','B','!','!',O_BCC|O_BYTE,"bcc.b",1,{PCREL8,0},2, {{0x24,0xff, },{0x00,0x00,PCREL8 }}}, -{201,'-','B','!','!',O_BCS|O_BYTE,"bcs.b",1,{PCREL8,0},2, {{0x25,0xff, },{0x00,0x00,PCREL8 }}}, -{165,'-','B','!','!',O_BNE|O_BYTE,"bne.b",1,{PCREL8,0},2, {{0x26,0xff, },{0x00,0x00,PCREL8 }}}, -{198,'-','B','!','!',O_BEQ|O_BYTE,"beq.b",1,{PCREL8,0},2, {{0x27,0xff, },{0x00,0x00,PCREL8 }}}, -{159,'-','B','!','!',O_BPL|O_BYTE,"bpl.b",1,{PCREL8,0},2, {{0x2a,0xff, },{0x00,0x00,PCREL8 }}}, -{168,'-','B','!','!',O_BMI|O_BYTE,"bmi.b",1,{PCREL8,0},2, {{0x2b,0xff, },{0x00,0x00,PCREL8 }}}, -{192,'-','B','!','!',O_BGE|O_BYTE,"bge.b",1,{PCREL8,0},2, {{0x2c,0xff, },{0x00,0x00,PCREL8 }}}, -{171,'-','B','!','!',O_BLT|O_BYTE,"blt.b",1,{PCREL8,0},2, {{0x2d,0xff, },{0x00,0x00,PCREL8 }}}, -{189,'-','B','!','!',O_BGT|O_BYTE,"bgt.b",1,{PCREL8,0},2, {{0x2e,0xff, },{0x00,0x00,PCREL8 }}}, -{180,'-','B','!','!',O_BLE|O_BYTE,"ble.b",1,{PCREL8,0},2, {{0x2f,0xff, },{0x00,0x00,PCREL8 }}}, -{154,'-','B','!','!',O_BRA|O_WORD,"bra.w",1,{PCREL16,0},3, {{0x30,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{151,'-','B','!','!',O_BRN|O_WORD,"brn.w",1,{PCREL16,0},3, {{0x31,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{185,'-','B','!','!',O_BHI|O_WORD,"bhi.w",1,{PCREL16,0},3, {{0x32,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{173,'-','B','!','!',O_BLS|O_WORD,"bls.w",1,{PCREL16,0},3, {{0x33,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{206,'-','B','!','!',O_BCC|O_WORD,"bcc.w",1,{PCREL16,0},3, {{0x34,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{200,'-','B','!','!',O_BCS|O_WORD,"bcs.w",1,{PCREL16,0},3, {{0x35,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{164,'-','B','!','!',O_BNE|O_WORD,"bne.w",1,{PCREL16,0},3, {{0x36,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{197,'-','B','!','!',O_BEQ|O_WORD,"beq.w",1,{PCREL16,0},3, {{0x37,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{158,'-','B','!','!',O_BPL|O_WORD,"bpl.w",1,{PCREL16,0},3, {{0x3a,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{167,'-','B','!','!',O_BMI|O_WORD,"bmi.w",1,{PCREL16,0},3, {{0x3b,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{191,'-','B','!','!',O_BGE|O_WORD,"bge.w",1,{PCREL16,0},3, {{0x3c,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{170,'-','B','!','!',O_BLT|O_WORD,"blt.w",1,{PCREL16,0},3, {{0x3d,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{188,'-','B','!','!',O_BGT|O_WORD,"bgt.w",1,{PCREL16,0},3, {{0x3e,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -{179,'-','B','!','!',O_BLE|O_WORD,"ble.w",1,{PCREL16,0},3, {{0x3f,0xff, },{0x00,0x00,PCREL16 },{0x00,0x00, }}}, -/* +{162,'b','E','I','E',O_BNOT|O_BYTE,"bnot.b",2,{IMM4,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xe0,0xf0,IMM4 }}}, +{219,'-','E','D','D',O_ADDS|O_BYTE,"adds.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x28,0xf8,RD }}}, +{213,'m','E','D','D',O_AND|O_BYTE,"and.b",2,{RNIND_D16,RD},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x50,0xf8,RD }}}, +{162,'b','E','S','E',O_BNOT|O_BYTE,"bnot.b",2,{RS,RNIND_D16},4, {{0xf0,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x68,0xf8,RS }}}, +{203,'b','E','I','E',O_BCLR|O_WORD,"bclr.w",2,{IMM4,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xd0,0xf0,IMM4 }}}, +{161,'b','E','I','E',O_BNOT|O_WORD,"bnot.w",2,{IMM4,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xe0,0xf0,IMM4 }}}, +{221,'a','I','E','E',O_ADD|O_WORD,"add:q.w",2,{QIM,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x08,0xf8,QIM }}}, +{218,'-','E','D','D',O_ADDS|O_WORD,"adds.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x28,0xf8,RD }}}, +{212,'m','E','D','D',O_AND|O_WORD,"and.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x50,0xf8,RD }}}, +{203,'b','E','S','E',O_BCLR|O_WORD,"bclr.w",2,{RS,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x58,0xf8,RS }}}, +{161,'b','E','S','E',O_BNOT|O_WORD,"bnot.w",2,{RS,RNIND_D16},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0x68,0xf8,RS }}}, +{215,'a','E','D','D',O_ADDX|O_WORD,"addx.w",2,{RNIND_D16,RD},4, {{0xf8,0xf8,RN },{0x00,0x00,DISP16 },{0x00,0x00,0},{0xa0,0xf8,RD }}}, +{225,'a','E','D','D',O_ADD|O_BYTE,"add:g.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x20,0xf8,RD }}}, +{219,'-','E','D','D',O_ADDS|O_BYTE,"adds.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x28,0xf8,RD }}}, +{213,'m','E','D','D',O_AND|O_BYTE,"and.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x50,0xf8,RD }}}, +{210,'s','I','S','S',O_ANDC|O_BYTE,"andc.b",2,{IMM8,CRB},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0x58,0xf8,CRB }}}, +{216,'a','E','D','D',O_ADDX|O_BYTE,"addx.b",2,{IMM8,RD},3, {{0x04,0xff,0},{0x00,0x00,IMM8 },{0xa0,0xf8,RD }}}, +{204,'b','E','I','E',O_BCLR|O_BYTE,"bclr.b",2,{IMM4,ABS8},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0xd0,0xf0,IMM4 }}}, +{162,'b','E','I','E',O_BNOT|O_BYTE,"bnot.b",2,{IMM4,ABS8},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0xe0,0xf0,IMM4 }}}, +{222,'a','I','E','E',O_ADD|O_BYTE,"add:q.b",2,{QIM,ABS8},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x08,0xf8,QIM }}}, +{225,'a','E','D','D',O_ADD|O_BYTE,"add:g.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x20,0xf8,RD }}}, +{219,'-','E','D','D',O_ADDS|O_BYTE,"adds.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x28,0xf8,RD }}}, +{213,'m','E','D','D',O_AND|O_BYTE,"and.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x50,0xf8,RD }}}, +{204,'b','E','S','E',O_BCLR|O_BYTE,"bclr.b",2,{RS,ABS8},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x58,0xf8,RS }}}, +{162,'b','E','S','E',O_BNOT|O_BYTE,"bnot.b",2,{RS,ABS8},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0x68,0xf8,RS }}}, +{216,'a','E','D','D',O_ADDX|O_BYTE,"addx.b",2,{ABS8,RD},3, {{0x05,0xff,0},{0x00,0x00,ABS8 },{0xa0,0xf8,RD }}}, +{224,'a','E','D','D',O_ADD|O_WORD,"add:g.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x20,0xf8,RD }}}, +{218,'-','E','D','D',O_ADDS|O_WORD,"adds.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x28,0xf8,RD }}}, +{212,'m','E','D','D',O_AND|O_WORD,"and.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x50,0xf8,RD }}}, +{209,'s','I','S','S',O_ANDC|O_WORD,"andc.w",2,{IMM16,CRW},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0x58,0xf8,CRW }}}, +{215,'a','E','D','D',O_ADDX|O_WORD,"addx.w",2,{IMM16,RD},4, {{0x0c,0xff,0},{0x00,0x00,IMM16 },{0x00,0x00,0},{0xa0,0xf8,RD }}}, +{161,'b','E','I','E',O_BNOT|O_WORD,"bnot.w",2,{IMM4,ABS8},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0xe0,0xf0,IMM4 }}}, +{221,'a','I','E','E',O_ADD|O_WORD,"add:q.w",2,{QIM,ABS8},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x08,0xf8,QIM }}}, +{224,'a','E','D','D',O_ADD|O_WORD,"add:g.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x20,0xf8,RD }}}, +{218,'-','E','D','D',O_ADDS|O_WORD,"adds.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x28,0xf8,RD }}}, +{157,'-','!','!','!',O_BPT|O_UNSZ,"bpt",0,{0,0},1, {{0x0b,0xff,0}}}, +{203,'b','E','I','E',O_BCLR|O_WORD,"bclr.w",2,{IMM4,ABS8},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0xd0,0xf0,IMM4 }}}, +{212,'m','E','D','D',O_AND|O_WORD,"and.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x50,0xf8,RD }}}, +{203,'b','E','S','E',O_BCLR|O_WORD,"bclr.w",2,{RS,ABS8},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x58,0xf8,RS }}}, +{161,'b','E','S','E',O_BNOT|O_WORD,"bnot.w",2,{RS,ABS8},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0x68,0xf8,RS }}}, +{215,'a','E','D','D',O_ADDX|O_WORD,"addx.w",2,{ABS8,RD},3, {{0x0d,0xff,0},{0x00,0x00,ABS8 },{0xa0,0xf8,RD }}}, +{204,'b','E','I','E',O_BCLR|O_BYTE,"bclr.b",2,{IMM4,ABS16},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xd0,0xf0,IMM4 }}}, +{225,'a','E','D','D',O_ADD|O_BYTE,"add:g.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x20,0xf8,RD }}}, +{219,'-','E','D','D',O_ADDS|O_BYTE,"adds.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x28,0xf8,RD }}}, +{213,'m','E','D','D',O_AND|O_BYTE,"and.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x50,0xf8,RD }}}, +{204,'b','E','S','E',O_BCLR|O_BYTE,"bclr.b",2,{RS,ABS16},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x58,0xf8,RS }}}, +{216,'a','E','D','D',O_ADDX|O_BYTE,"addx.b",2,{ABS16,RD},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xa0,0xf8,RD }}}, +{203,'b','E','I','E',O_BCLR|O_WORD,"bclr.w",2,{IMM4,ABS16},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xd0,0xf0,IMM4 }}}, +{218,'-','E','D','D',O_ADDS|O_WORD,"adds.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x28,0xf8,RD }}}, +{212,'m','E','D','D',O_AND|O_WORD,"and.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x50,0xf8,RD }}}, +{203,'b','E','S','E',O_BCLR|O_WORD,"bclr.w",2,{RS,ABS16},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x58,0xf8,RS }}}, +{215,'a','E','D','D',O_ADDX|O_WORD,"addx.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xa0,0xf8,RD }}}, +{155,'-','B','!','!',O_BRA|O_BYTE,"bra.b",1,{PCREL8,0},2, {{0x20,0xff,0},{0x00,0x00,PCREL8 }}}, +{162,'b','E','I','E',O_BNOT|O_BYTE,"bnot.b",2,{IMM4,ABS16},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xe0,0xf0,IMM4 }}}, +{222,'a','I','E','E',O_ADD|O_BYTE,"add:q.b",2,{QIM,ABS16},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x08,0xf8,QIM }}}, +{162,'b','E','S','E',O_BNOT|O_BYTE,"bnot.b",2,{RS,ABS16},4, {{0x15,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x68,0xf8,RS }}}, +{161,'b','E','I','E',O_BNOT|O_WORD,"bnot.w",2,{IMM4,ABS16},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0xe0,0xf0,IMM4 }}}, +{221,'a','I','E','E',O_ADD|O_WORD,"add:q.w",2,{QIM,ABS16},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x08,0xf8,QIM }}}, +{224,'a','E','D','D',O_ADD|O_WORD,"add:g.w",2,{ABS16,RD},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x20,0xf8,RD }}}, +{161,'b','E','S','E',O_BNOT|O_WORD,"bnot.w",2,{RS,ABS16},4, {{0x1d,0xff,0},{0x00,0x00,ABS16 },{0x00,0x00,0},{0x68,0xf8,RS }}}, +{152,'-','B','!','!',O_BRN|O_BYTE,"brn.b",1,{PCREL8,0},2, {{0x21,0xff,0},{0x00,0x00,PCREL8 }}}, +{186,'-','B','!','!',O_BHI|O_BYTE,"bhi.b",1,{PCREL8,0},2, {{0x22,0xff,0},{0x00,0x00,PCREL8 }}}, +{174,'-','B','!','!',O_BLS|O_BYTE,"bls.b",1,{PCREL8,0},2, {{0x23,0xff,0},{0x00,0x00,PCREL8 }}}, +{207,'-','B','!','!',O_BCC|O_BYTE,"bcc.b",1,{PCREL8,0},2, {{0x24,0xff,0},{0x00,0x00,PCREL8 }}}, +{201,'-','B','!','!',O_BCS|O_BYTE,"bcs.b",1,{PCREL8,0},2, {{0x25,0xff,0},{0x00,0x00,PCREL8 }}}, +{165,'-','B','!','!',O_BNE|O_BYTE,"bne.b",1,{PCREL8,0},2, {{0x26,0xff,0},{0x00,0x00,PCREL8 }}}, +{198,'-','B','!','!',O_BEQ|O_BYTE,"beq.b",1,{PCREL8,0},2, {{0x27,0xff,0},{0x00,0x00,PCREL8 }}}, +{159,'-','B','!','!',O_BPL|O_BYTE,"bpl.b",1,{PCREL8,0},2, {{0x2a,0xff,0},{0x00,0x00,PCREL8 }}}, +{168,'-','B','!','!',O_BMI|O_BYTE,"bmi.b",1,{PCREL8,0},2, {{0x2b,0xff,0},{0x00,0x00,PCREL8 }}}, +{192,'-','B','!','!',O_BGE|O_BYTE,"bge.b",1,{PCREL8,0},2, {{0x2c,0xff,0},{0x00,0x00,PCREL8 }}}, +{171,'-','B','!','!',O_BLT|O_BYTE,"blt.b",1,{PCREL8,0},2, {{0x2d,0xff,0},{0x00,0x00,PCREL8 }}}, +{189,'-','B','!','!',O_BGT|O_BYTE,"bgt.b",1,{PCREL8,0},2, {{0x2e,0xff,0},{0x00,0x00,PCREL8 }}}, +{180,'-','B','!','!',O_BLE|O_BYTE,"ble.b",1,{PCREL8,0},2, {{0x2f,0xff,0},{0x00,0x00,PCREL8 }}}, +{154,'-','B','!','!',O_BRA|O_WORD,"bra.w",1,{PCREL16,0},3, {{0x30,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{151,'-','B','!','!',O_BRN|O_WORD,"brn.w",1,{PCREL16,0},3, {{0x31,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{185,'-','B','!','!',O_BHI|O_WORD,"bhi.w",1,{PCREL16,0},3, {{0x32,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{173,'-','B','!','!',O_BLS|O_WORD,"bls.w",1,{PCREL16,0},3, {{0x33,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{206,'-','B','!','!',O_BCC|O_WORD,"bcc.w",1,{PCREL16,0},3, {{0x34,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{200,'-','B','!','!',O_BCS|O_WORD,"bcs.w",1,{PCREL16,0},3, {{0x35,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{164,'-','B','!','!',O_BNE|O_WORD,"bne.w",1,{PCREL16,0},3, {{0x36,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{197,'-','B','!','!',O_BEQ|O_WORD,"beq.w",1,{PCREL16,0},3, {{0x37,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{158,'-','B','!','!',O_BPL|O_WORD,"bpl.w",1,{PCREL16,0},3, {{0x3a,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{167,'-','B','!','!',O_BMI|O_WORD,"bmi.w",1,{PCREL16,0},3, {{0x3b,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{191,'-','B','!','!',O_BGE|O_WORD,"bge.w",1,{PCREL16,0},3, {{0x3c,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{170,'-','B','!','!',O_BLT|O_WORD,"blt.w",1,{PCREL16,0},3, {{0x3d,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{188,'-','B','!','!',O_BGT|O_WORD,"bgt.w",1,{PCREL16,0},3, {{0x3e,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +{179,'-','B','!','!',O_BLE|O_WORD,"ble.w",1,{PCREL16,0},3, {{0x3f,0xff,0},{0x00,0x00,PCREL16 },{0x00,0x00,0}}}, +/* RN,RD 'm','E','D','D' CRB,RN 's','C','!','E' RN,RD 'm','E','D','D' @@ -3851,8 +3851,8 @@ QIM,RNIND_D16 'a','I','E','E' IMM16,RD 'a','E','D','D' QIM,ABS16 'a','I','E','E' RNIND_D16,RD 'a','E','D','D' -*/ -{0,0,0}} +*/ +{0,0,0,0,0,0,"",0,{0,0},0,{}}} #endif ; #endif diff -uprN binutils-2.11.90.0.27/opcodes/i960-dis.c binutils-2.11.90.0.29/opcodes/i960-dis.c --- binutils-2.11.90.0.27/opcodes/i960-dis.c Thu Mar 15 14:52:07 2001 +++ binutils-2.11.90.0.29/opcodes/i960-dis.c Wed Aug 22 08:52:10 2001 @@ -1,5 +1,5 @@ /* Disassemble i80960 instructions. - Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000 + Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -21,27 +21,27 @@ Free Software Foundation, 59 Temple Plac #include "dis-asm.h" static const char *const reg_names[] = { -/* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", +/* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", -/* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", -/* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", -/* 32 */ "pc", "ac", "ip", "tc", "fp0", "fp1", "fp2", "fp3" +/* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", +/* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", +/* 32 */ "pc", "ac", "ip", "tc", "fp0", "fp1", "fp2", "fp3" }; static FILE *stream; /* Output goes here */ static struct disassemble_info *info; -static void print_addr(); -static void ctrl(); -static void cobr(); -static void reg(); -static int mem(); -static void ea(); -static void dstop(); -static void regop(); -static void invalid(); -static int pinsn(); -static void put_abs(); +static void print_addr PARAMS ((bfd_vma)); +static void ctrl PARAMS ((bfd_vma, unsigned long, unsigned long)); +static void cobr PARAMS ((bfd_vma, unsigned long, unsigned long)); +static void reg PARAMS ((unsigned long)); +static int mem PARAMS ((bfd_vma, unsigned long, unsigned long, int)); +static void ea PARAMS ((bfd_vma, int, char *, char *, int, unsigned int)); +static void dstop PARAMS ((int, int, int)); +static void regop PARAMS ((int, int, int, int)); +static void invalid PARAMS ((int)); +static int pinsn PARAMS ((bfd_vma, unsigned long, unsigned long)); +static void put_abs PARAMS ((unsigned long, unsigned long)); /* Print the i960 instruction at address 'memaddr' in debugged memory, @@ -150,7 +150,7 @@ pinsn( memaddr, word1, word2 ) instr_len = mem( memaddr, word1, word2, 0 ); break; default: - /* invalid instruction, print as data word */ + /* invalid instruction, print as data word */ invalid( word1 ); break; } @@ -163,7 +163,8 @@ pinsn( memaddr, word1, word2 ) static void ctrl( memaddr, word1, word2 ) bfd_vma memaddr; - unsigned long word1, word2; + unsigned long word1; + unsigned long word2 ATTRIBUTE_UNUSED; { int i; static const struct tabent ctrl_tab[] = { @@ -229,7 +230,8 @@ ctrl( memaddr, word1, word2 ) static void cobr( memaddr, word1, word2 ) bfd_vma memaddr; - unsigned long word1, word2; + unsigned long word1; + unsigned long word2 ATTRIBUTE_UNUSED; { int src1; int src2; @@ -493,33 +495,33 @@ reg( word1 ) { 0x58d, "notor", 3 }, { 0x58e, "nand", 3 }, { 0x58f, "alterbit", 3 }, - { 0x590, "addo", 3 }, - { 0x591, "addi", 3 }, - { 0x592, "subo", 3 }, - { 0x593, "subi", 3 }, + { 0x590, "addo", 3 }, + { 0x591, "addi", 3 }, + { 0x592, "subo", 3 }, + { 0x593, "subi", 3 }, { 0x594, "cmpob", 2 }, { 0x595, "cmpib", 2 }, { 0x596, "cmpos", 2 }, { 0x597, "cmpis", 2 }, - { 0x598, "shro", 3 }, - { 0x59a, "shrdi", 3 }, - { 0x59b, "shri", 3 }, - { 0x59c, "shlo", 3 }, - { 0x59d, "rotate", 3 }, - { 0x59e, "shli", 3 }, - { 0x5a0, "cmpo", 2 }, - { 0x5a1, "cmpi", 2 }, - { 0x5a2, "concmpo", 2 }, - { 0x5a3, "concmpi", 2 }, - { 0x5a4, "cmpinco", 3 }, - { 0x5a5, "cmpinci", 3 }, - { 0x5a6, "cmpdeco", 3 }, - { 0x5a7, "cmpdeci", 3 }, - { 0x5ac, "scanbyte", 2 }, + { 0x598, "shro", 3 }, + { 0x59a, "shrdi", 3 }, + { 0x59b, "shri", 3 }, + { 0x59c, "shlo", 3 }, + { 0x59d, "rotate", 3 }, + { 0x59e, "shli", 3 }, + { 0x5a0, "cmpo", 2 }, + { 0x5a1, "cmpi", 2 }, + { 0x5a2, "concmpo", 2 }, + { 0x5a3, "concmpi", 2 }, + { 0x5a4, "cmpinco", 3 }, + { 0x5a5, "cmpinci", 3 }, + { 0x5a6, "cmpdeco", 3 }, + { 0x5a7, "cmpdeci", 3 }, + { 0x5ac, "scanbyte", 2 }, { 0x5ad, "bswap", -2 }, - { 0x5ae, "chkbit", 2 }, - { 0x5b0, "addc", 3 }, - { 0x5b2, "subc", 3 }, + { 0x5ae, "chkbit", 2 }, + { 0x5b0, "addc", 3 }, + { 0x5b2, "subc", 3 }, { 0x5b4, "intdis", 0 }, { 0x5b5, "inten", 0 }, { 0x5cc, "mov", -2 }, @@ -573,7 +575,7 @@ reg( word1 ) { 0x66f, "syncf", 0 }, { 0x670, "emul", 3 }, { 0x671, "ediv", 3 }, - { 0x673, "ldtime", -1 }, + { 0x673, "ldtime", -1 }, { 0x674, "Fcvtir", -2 }, { 0x675, "Fcvtilr", -2 }, { 0x676, "Fscalerl", 3 }, @@ -612,9 +614,9 @@ reg( word1 ) { 0x6c3, "Fcvtzril", -2 }, { 0x6c9, "Fmovr", -2 }, { 0x6d9, "Fmovrl", -2 }, - { 0x6e1, "Fmovre", -2 }, - { 0x6e2, "Fcpysre", 3 }, - { 0x6e3, "Fcpyrsre", 3 }, + { 0x6e1, "Fmovre", -2 }, + { 0x6e2, "Fcpysre", 3 }, + { 0x6e3, "Fcpyrsre", 3 }, { 0x701, "mulo", 3 }, { 0x708, "remo", 3 }, { 0x70b, "divo", 3 }, @@ -765,7 +767,7 @@ ea( memaddr, mode, reg2, reg3, word1, wo scale = scale_tab[scale]; switch (mode) { - case 4: /* (reg) */ + case 4: /* (reg) */ (*info->fprintf_func)( stream, "(%s)", reg2 ); break; case 5: /* displ+8(ip) */ @@ -809,7 +811,7 @@ ea( memaddr, mode, reg2, reg3, word1, wo /************************************************/ -/* Register Instruction Operand */ +/* Register Instruction Operand */ /************************************************/ static void regop( mode, spec, reg, fp ) @@ -873,7 +875,7 @@ invalid( word1 ) int word1; { (*info->fprintf_func)( stream, ".word\t0x%08x", (unsigned) word1 ); -} +} static void print_addr(a) @@ -884,7 +886,8 @@ bfd_vma a; static void put_abs( word1, word2 ) - unsigned long word1, word2; + unsigned long word1 ATTRIBUTE_UNUSED; + unsigned long word2 ATTRIBUTE_UNUSED; { #ifdef IN_GDB return; diff -uprN binutils-2.11.90.0.27/opcodes/ia64-opc.c binutils-2.11.90.0.29/opcodes/ia64-opc.c --- binutils-2.11.90.0.27/opcodes/ia64-opc.c Thu Mar 15 14:52:10 2001 +++ binutils-2.11.90.0.29/opcodes/ia64-opc.c Wed Aug 22 08:52:10 2001 @@ -25,6 +25,20 @@ #include "ia64-asmtab.h" #include "ia64-asmtab.c" +static void get_opc_prefix PARAMS ((const char **, char *)); +static short int find_string_ent PARAMS ((const char *)); +static short int find_main_ent PARAMS ((short int)); +static short int find_completer PARAMS ((short int, short int, const char *)); +static ia64_insn apply_completer PARAMS ((ia64_insn, int)); +static int extract_op_bits PARAMS ((int, int, int)); +static int extract_op PARAMS ((int, int *, unsigned int *)); +static int opcode_verify PARAMS ((ia64_insn, int, enum ia64_insn_type)); +static int locate_opcode_ent PARAMS ((ia64_insn, enum ia64_insn_type)); +static struct ia64_opcode *make_ia64_opcode + PARAMS ((ia64_insn, const char *, int, int)); +static struct ia64_opcode *ia64_find_matching_opcode + PARAMS ((const char *, short int)); + const struct ia64_templ_desc ia64_templ_desc[16] = { { 0, { IA64_UNIT_M, IA64_UNIT_I, IA64_UNIT_I }, "MII" }, /* 0 */ @@ -149,7 +163,7 @@ find_main_ent (nameindex) MAIN_ENT (starting from PREV_COMPLETER) that matches NAME, or return -1 if one does not exist. */ -static short +static short find_completer (main_ent, prev_completer, name) short main_ent; short prev_completer; @@ -312,7 +326,7 @@ opcode_verify (opcode, place, type) { return 0; } - if (main_table[place].flags + if (main_table[place].flags & (IA64_OPCODE_F2_EQ_F3 | IA64_OPCODE_LEN_EQ_64MCNT)) { const struct ia64_operand *o1, *o2; @@ -481,7 +495,7 @@ locate_opcode_ent (opcode, type) priority = ia64_dis_names[disent].priority; - if (opcode_verify (opcode, place, type) + if (opcode_verify (opcode, place, type) && priority > found_priority) { break; @@ -610,7 +624,7 @@ ia64_dis_opcode (insn, type) { abort (); } - return make_ia64_opcode (insn, name, place, + return make_ia64_opcode (insn, name, place, completer_table[ci].dependencies); } } @@ -646,7 +660,7 @@ ia64_find_matching_opcode (name, place) short completer = -1; do { - if (suffix[0] == '\0') + if (suffix[0] == '\0') { completer = find_completer (place, completer, suffix); } diff -uprN binutils-2.11.90.0.27/opcodes/m32r-asm.c binutils-2.11.90.0.29/opcodes/m32r-asm.c --- binutils-2.11.90.0.27/opcodes/m32r-asm.c Sat May 12 00:04:51 2001 +++ binutils-2.11.90.0.29/opcodes/m32r-asm.c Wed Aug 22 08:52:10 2001 @@ -34,6 +34,7 @@ along with this program; if not, write t #include "m32r-desc.h" #include "m32r-opc.h" #include "opintl.h" +#include "xregex.h" #undef min #define min(a,b) ((a) < (b) ? (a) : (b)) @@ -333,6 +334,104 @@ m32r_cgen_init_asm (cd) } + +/* + Regex construction routine. + + This translates an opcode syntax string into a regex string, + by replacing any non-character syntax element (such as an + opcode) with the pattern '.*' + + It then compiles the regex and stores it in the opcode, for + later use by m32r_cgen_assemble_insn + + returns NULL for success, an error message for failure +*/ + +char * +m32r_cgen_build_insn_regex (insn) + CGEN_INSN *insn; +{ + CGEN_OPCODE *opc = CGEN_INSN_OPCODE (insn); + const char *mnem = CGEN_INSN_MNEMONIC (insn); + int mnem_len; + char rxbuf[CGEN_MAX_RX_ELEMENTS]; + char *rx = rxbuf; + const CGEN_SYNTAX_CHAR_TYPE *syn; + int reg_err; + + syn = CGEN_SYNTAX_STRING (CGEN_OPCODE_SYNTAX (opc)); + + /* Mnemonics come first in the syntax string */ + if (! CGEN_SYNTAX_MNEMONIC_P (* syn)) return "missing mnemonic in syntax string"; + ++syn; + + /* copy the literal mnemonic out of the insn */ + memset (rx, 0, CGEN_MAX_RX_ELEMENTS); + mnem_len = strlen(mnem); + memcpy (rx, mnem, mnem_len); + rx += mnem_len; + + /* copy any remaining literals from the syntax string into the rx */ + for(; * syn != 0 && rx < rxbuf + (CGEN_MAX_RX_ELEMENTS - 9); ++syn, ++rx) + { + if (CGEN_SYNTAX_CHAR_P (* syn)) + { + char tmp = CGEN_SYNTAX_CHAR (* syn); + switch (tmp) + { + /* escape any regex metacharacters in the syntax */ + case '.': case '[': case '\\': + case '*': case '^': case '$': + +#ifdef CGEN_ESCAPE_EXTENDED_REGEX + case '?': case '{': case '}': + case '(': case ')': case '*': + case '|': case '+': case ']': +#endif + + * rx++ = '\\'; + break; + } + /* insert syntax char into rx */ + * rx = tmp; + } + else + { + /* replace non-syntax fields with globs */ + * rx = '.'; + * ++rx = '*'; + } + } + + /* trailing whitespace ok */ + * rx++ = '['; + * rx++ = ' '; + * rx++ = '\t'; + * rx++ = ']'; + * rx++ = '*'; + + /* but anchor it after that */ + * rx++ = '$'; + * rx = '\0'; + + CGEN_INSN_RX (insn) = xmalloc (sizeof (regex_t)); + reg_err = regcomp ((regex_t *) CGEN_INSN_RX (insn), rxbuf, REG_NOSUB|REG_ICASE); + + if (reg_err == 0) + return NULL; + else + { + static char msg[80]; + regerror (reg_err, (regex_t *) CGEN_INSN_RX (insn), msg, 80); + regfree ((regex_t *) CGEN_INSN_RX (insn)); + free (CGEN_INSN_RX (insn)); + (CGEN_INSN_RX (insn)) = NULL; + return msg; + } +} + + /* Default insn parser. The syntax string is scanned and operands are parsed and stored in FIELDS. @@ -499,6 +598,7 @@ m32r_cgen_assemble_insn (cd, str, fields CGEN_INSN_LIST *ilist; const char *parse_errmsg = NULL; const char *insert_errmsg = NULL; + int recognized_mnemonic = 0; /* Skip leading white space. */ while (isspace (* str)) @@ -514,6 +614,7 @@ m32r_cgen_assemble_insn (cd, str, fields for ( ; ilist != NULL ; ilist = CGEN_ASM_NEXT_INSN (ilist)) { const CGEN_INSN *insn = ilist->insn; + recognized_mnemonic = 1; #ifdef CGEN_VALIDATE_INSN_SUPPORTED /* not usually needed as unsupported opcodes shouldn't be in the hash lists */ @@ -530,6 +631,11 @@ m32r_cgen_assemble_insn (cd, str, fields str = start; + /* skip this insn if str doesn't look right lexically */ + if (CGEN_INSN_RX (insn) != NULL && + regexec ((regex_t *) CGEN_INSN_RX (insn), str, 0, NULL, 0) == REG_NOMATCH) + continue; + /* Allow parse/insert handlers to obtain length of insn. */ CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn); @@ -557,6 +663,7 @@ m32r_cgen_assemble_insn (cd, str, fields Failing that, use parse_errmsg */ tmp_errmsg = (insert_errmsg ? insert_errmsg : parse_errmsg ? parse_errmsg : + recognized_mnemonic ? _("unrecognized form of instruction") : _("unrecognized instruction")); if (strlen (start) > 50) diff -uprN binutils-2.11.90.0.27/opcodes/m32r-desc.c binutils-2.11.90.0.29/opcodes/m32r-desc.c --- binutils-2.11.90.0.27/opcodes/m32r-desc.c Fri Mar 23 13:52:29 2001 +++ binutils-2.11.90.0.29/opcodes/m32r-desc.c Wed Aug 22 08:52:10 2001 @@ -136,9 +136,9 @@ static const CGEN_ISA m32r_cgen_isa_tabl /* Machine variants. */ static const CGEN_MACH m32r_cgen_mach_table[] = { - { "m32r", "m32r", MACH_M32R }, - { "m32rx", "m32rx", MACH_M32RX }, - { 0, 0, 0 } + { "m32r", "m32r", MACH_M32R, 0 }, + { "m32rx", "m32rx", MACH_M32RX, 0 }, + { 0, 0, 0, 0 } }; static CGEN_KEYWORD_ENTRY m32r_cgen_opval_gr_names_entries[] = @@ -168,7 +168,7 @@ CGEN_KEYWORD m32r_cgen_opval_gr_names = { & m32r_cgen_opval_gr_names_entries[0], 19, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; static CGEN_KEYWORD_ENTRY m32r_cgen_opval_cr_names_entries[] = @@ -202,7 +202,7 @@ CGEN_KEYWORD m32r_cgen_opval_cr_names = { & m32r_cgen_opval_cr_names_entries[0], 23, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; static CGEN_KEYWORD_ENTRY m32r_cgen_opval_h_accums_entries[] = @@ -215,7 +215,7 @@ CGEN_KEYWORD m32r_cgen_opval_h_accums = { & m32r_cgen_opval_h_accums_entries[0], 2, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; @@ -1200,11 +1200,9 @@ static void m32r_cgen_rebuild_tables (cd) CGEN_CPU_TABLE *cd; { - int i,n_isas; + int i; unsigned int isas = cd->isas; -#if 0 unsigned int machs = cd->machs; -#endif cd->int_insn_p = CGEN_INT_INSN_P; @@ -1242,20 +1240,26 @@ m32r_cgen_rebuild_tables (cd) cd->min_insn_bitsize = isa->min_insn_bitsize; if (isa->max_insn_bitsize > cd->max_insn_bitsize) cd->max_insn_bitsize = isa->max_insn_bitsize; - - ++n_isas; } -#if 0 /* Does nothing?? */ /* Data derived from the mach spec. */ for (i = 0; i < MAX_MACHS; ++i) if (((1 << i) & machs) != 0) { const CGEN_MACH *mach = & m32r_cgen_mach_table[i]; - ++n_machs; + if (mach->insn_chunk_bitsize != 0) + { + if (cd->insn_chunk_bitsize != 0 && cd->insn_chunk_bitsize != mach->insn_chunk_bitsize) + { + fprintf (stderr, "m32r_cgen_rebuild_tables: conflicting insn-chunk-bitsize values: `%d' vs. `%d'\n", + cd->insn_chunk_bitsize, mach->insn_chunk_bitsize); + abort (); + } + + cd->insn_chunk_bitsize = mach->insn_chunk_bitsize; + } } -#endif /* Determine which hw elements are used by MACH. */ build_hw_table (cd); diff -uprN binutils-2.11.90.0.27/opcodes/m32r-dis.c binutils-2.11.90.0.29/opcodes/m32r-dis.c --- binutils-2.11.90.0.27/opcodes/m32r-dis.c Sat May 12 00:04:51 2001 +++ binutils-2.11.90.0.29/opcodes/m32r-dis.c Wed Aug 22 08:52:10 2001 @@ -434,12 +434,12 @@ print_insn (cd, pc, info, buf, buflen) char *buf; int buflen; { - unsigned long insn_value; + CGEN_INSN_INT insn_value; const CGEN_INSN_LIST *insn_list; CGEN_EXTRACT_INFO ex_info; /* Extract base part of instruction, just in case CGEN_DIS_* uses it. */ - insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG); + insn_value = cgen_get_insn_value (cd, buf, buflen * 8); /* Fill in ex_info fields like read_insn would. Don't actually call read_insn, since the incoming buffer is already read (and possibly @@ -505,7 +505,7 @@ print_insn (cd, pc, info, buf, buflen) } else length = CGEN_EXTRACT_FN (cd, insn) - (cd, insn, &ex_info, insn_value, &fields, pc); + (cd, insn, &ex_info, insn_value_cropped, &fields, pc); /* length < 0 -> error */ if (length < 0) @@ -539,18 +539,27 @@ default_print_insn (cd, pc, info) disassemble_info *info; { char buf[CGEN_MAX_INSN_SIZE]; + int buflen; int status; - /* Read the base part of the insn. */ + /* Attempt to read the base part of the insn. */ + buflen = cd->base_insn_bitsize / 8; + status = (*info->read_memory_func) (pc, buf, buflen, info); + + /* Try again with the minimum part, if min < base. */ + if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize)) + { + buflen = cd->min_insn_bitsize / 8; + status = (*info->read_memory_func) (pc, buf, buflen, info); + } - status = (*info->read_memory_func) (pc, buf, cd->base_insn_bitsize / 8, info); if (status != 0) { (*info->memory_error_func) (status, pc, info); return -1; } - return print_insn (cd, pc, info, buf, cd->base_insn_bitsize / 8); + return print_insn (cd, pc, info, buf, buflen); } /* Main entry point. diff -uprN binutils-2.11.90.0.27/opcodes/m32r-ibld.c binutils-2.11.90.0.29/opcodes/m32r-ibld.c --- binutils-2.11.90.0.27/opcodes/m32r-ibld.c Sat May 12 00:04:51 2001 +++ binutils-2.11.90.0.29/opcodes/m32r-ibld.c Wed Aug 22 08:52:10 2001 @@ -145,7 +145,22 @@ insert_normal (cd, value, attrs, word_of } /* Ensure VALUE will fit. */ - if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)) + if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT)) + { + long minval = - (1L << (length - 1)); + unsigned long maxval = mask; + + if ((value > 0 && (unsigned long) value > maxval) + || value < minval) + { + /* xgettext:c-format */ + sprintf (errbuf, + _("operand out of range (%ld not between %ld and %lu)"), + value, minval, maxval); + return errbuf; + } + } + else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)) { unsigned long maxval = mask; @@ -400,7 +415,7 @@ extract_normal (cd, ex_info, insn_value, #endif long *valuep; { - CGEN_INSN_INT value, mask; + long value, mask; /* If LENGTH is zero, this operand doesn't contribute to the value so give it a standard value of zero. */ @@ -428,9 +443,9 @@ extract_normal (cd, ex_info, insn_value, word_length = total_length; } - /* Does the value reside in INSN_VALUE? */ + /* Does the value reside in INSN_VALUE, and at the right alignment? */ - if (CGEN_INT_INSN_P || word_offset == 0) + if (CGEN_INT_INSN_P || (word_offset == 0 && word_length == total_length)) { if (CGEN_INSN_LSB0_P) value = insn_value >> ((word_offset + start + 1) - length); diff -uprN binutils-2.11.90.0.27/opcodes/m32r-opc.c binutils-2.11.90.0.29/opcodes/m32r-opc.c --- binutils-2.11.90.0.27/opcodes/m32r-opc.c Thu Mar 15 14:52:11 2001 +++ binutils-2.11.90.0.29/opcodes/m32r-opc.c Wed Aug 22 08:52:10 2001 @@ -1685,6 +1685,7 @@ m32r_cgen_init_opcode_table (cd) { insns[i].base = &ib[i]; insns[i].opcode = &oc[i]; + m32r_cgen_build_insn_regex (& insns[i]); } cd->macro_insn_table.init_entries = insns; cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE); @@ -1693,7 +1694,10 @@ m32r_cgen_init_opcode_table (cd) oc = & m32r_cgen_insn_opcode_table[0]; insns = (CGEN_INSN *) cd->insn_table.init_entries; for (i = 0; i < MAX_INSNS; ++i) - insns[i].opcode = &oc[i]; + { + insns[i].opcode = &oc[i]; + m32r_cgen_build_insn_regex (& insns[i]); + } cd->sizeof_fields = sizeof (CGEN_FIELDS); cd->set_fields_bitsize = set_fields_bitsize; diff -uprN binutils-2.11.90.0.27/opcodes/m32r-opinst.c binutils-2.11.90.0.29/opcodes/m32r-opinst.c --- binutils-2.11.90.0.27/opcodes/m32r-opinst.c Fri Mar 23 13:52:30 2001 +++ binutils-2.11.90.0.29/opcodes/m32r-opinst.c Wed Aug 22 08:52:10 2001 @@ -137,7 +137,7 @@ static const CGEN_OPINST sfmt_beqz_ops[] static const CGEN_OPINST sfmt_bl8_ops[] = { { INPUT, "disp8", HW_H_IADDR, CGEN_MODE_USI, OP_ENT (DISP8), 0, 0 }, { INPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 }, - { OUTPUT, "h_gr_14", HW_H_GR, CGEN_MODE_SI, 0, 14, 0 }, + { OUTPUT, "h_gr_SI_14", HW_H_GR, CGEN_MODE_SI, 0, 14, 0 }, { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 }, { END } }; @@ -145,7 +145,7 @@ static const CGEN_OPINST sfmt_bl8_ops[] static const CGEN_OPINST sfmt_bl24_ops[] = { { INPUT, "disp24", HW_H_IADDR, CGEN_MODE_USI, OP_ENT (DISP24), 0, 0 }, { INPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 }, - { OUTPUT, "h_gr_14", HW_H_GR, CGEN_MODE_SI, 0, 14, 0 }, + { OUTPUT, "h_gr_SI_14", HW_H_GR, CGEN_MODE_SI, 0, 14, 0 }, { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 }, { END } }; @@ -154,7 +154,7 @@ static const CGEN_OPINST sfmt_bcl8_ops[] { INPUT, "condbit", HW_H_COND, CGEN_MODE_BI, 0, 0, 0 }, { INPUT, "disp8", HW_H_IADDR, CGEN_MODE_USI, OP_ENT (DISP8), 0, COND_REF }, { INPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, COND_REF }, - { OUTPUT, "h_gr_14", HW_H_GR, CGEN_MODE_SI, 0, 14, COND_REF }, + { OUTPUT, "h_gr_SI_14", HW_H_GR, CGEN_MODE_SI, 0, 14, COND_REF }, { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, COND_REF }, { END } }; @@ -163,7 +163,7 @@ static const CGEN_OPINST sfmt_bcl24_ops[ { INPUT, "condbit", HW_H_COND, CGEN_MODE_BI, 0, 0, 0 }, { INPUT, "disp24", HW_H_IADDR, CGEN_MODE_USI, OP_ENT (DISP24), 0, COND_REF }, { INPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, COND_REF }, - { OUTPUT, "h_gr_14", HW_H_GR, CGEN_MODE_SI, 0, 14, COND_REF }, + { OUTPUT, "h_gr_SI_14", HW_H_GR, CGEN_MODE_SI, 0, 14, COND_REF }, { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, COND_REF }, { END } }; @@ -217,7 +217,7 @@ static const CGEN_OPINST sfmt_jc_ops[] = static const CGEN_OPINST sfmt_jl_ops[] = { { INPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 }, { INPUT, "sr", HW_H_GR, CGEN_MODE_SI, OP_ENT (SR), 0, 0 }, - { OUTPUT, "h_gr_14", HW_H_GR, CGEN_MODE_SI, 0, 14, 0 }, + { OUTPUT, "h_gr_SI_14", HW_H_GR, CGEN_MODE_SI, 0, 14, 0 }, { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 }, { END } }; @@ -229,14 +229,44 @@ static const CGEN_OPINST sfmt_jmp_ops[] }; static const CGEN_OPINST sfmt_ld_ops[] = { - { INPUT, "h_memory_sr", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, + { INPUT, "h_memory_SI_sr", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, { INPUT, "sr", HW_H_GR, CGEN_MODE_USI, OP_ENT (SR), 0, 0 }, { OUTPUT, "dr", HW_H_GR, CGEN_MODE_SI, OP_ENT (DR), 0, 0 }, { END } }; static const CGEN_OPINST sfmt_ld_d_ops[] = { - { INPUT, "h_memory_add__DFLT_sr_slo16", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, + { INPUT, "h_memory_SI_add__DFLT_sr_slo16", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, + { INPUT, "slo16", HW_H_SLO16, CGEN_MODE_INT, OP_ENT (SLO16), 0, 0 }, + { INPUT, "sr", HW_H_GR, CGEN_MODE_SI, OP_ENT (SR), 0, 0 }, + { OUTPUT, "dr", HW_H_GR, CGEN_MODE_SI, OP_ENT (DR), 0, 0 }, + { END } +}; + +static const CGEN_OPINST sfmt_ldb_ops[] = { + { INPUT, "h_memory_QI_sr", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 }, + { INPUT, "sr", HW_H_GR, CGEN_MODE_USI, OP_ENT (SR), 0, 0 }, + { OUTPUT, "dr", HW_H_GR, CGEN_MODE_SI, OP_ENT (DR), 0, 0 }, + { END } +}; + +static const CGEN_OPINST sfmt_ldb_d_ops[] = { + { INPUT, "h_memory_QI_add__DFLT_sr_slo16", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 }, + { INPUT, "slo16", HW_H_SLO16, CGEN_MODE_INT, OP_ENT (SLO16), 0, 0 }, + { INPUT, "sr", HW_H_GR, CGEN_MODE_SI, OP_ENT (SR), 0, 0 }, + { OUTPUT, "dr", HW_H_GR, CGEN_MODE_SI, OP_ENT (DR), 0, 0 }, + { END } +}; + +static const CGEN_OPINST sfmt_ldh_ops[] = { + { INPUT, "h_memory_HI_sr", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 }, + { INPUT, "sr", HW_H_GR, CGEN_MODE_USI, OP_ENT (SR), 0, 0 }, + { OUTPUT, "dr", HW_H_GR, CGEN_MODE_SI, OP_ENT (DR), 0, 0 }, + { END } +}; + +static const CGEN_OPINST sfmt_ldh_d_ops[] = { + { INPUT, "h_memory_HI_add__DFLT_sr_slo16", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 }, { INPUT, "slo16", HW_H_SLO16, CGEN_MODE_INT, OP_ENT (SLO16), 0, 0 }, { INPUT, "sr", HW_H_GR, CGEN_MODE_SI, OP_ENT (SR), 0, 0 }, { OUTPUT, "dr", HW_H_GR, CGEN_MODE_SI, OP_ENT (DR), 0, 0 }, @@ -244,7 +274,7 @@ static const CGEN_OPINST sfmt_ld_d_ops[] }; static const CGEN_OPINST sfmt_ld_plus_ops[] = { - { INPUT, "h_memory_sr", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, + { INPUT, "h_memory_SI_sr", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, { INPUT, "sr", HW_H_GR, CGEN_MODE_USI, OP_ENT (SR), 0, 0 }, { OUTPUT, "dr", HW_H_GR, CGEN_MODE_SI, OP_ENT (DR), 0, 0 }, { OUTPUT, "sr", HW_H_GR, CGEN_MODE_SI, OP_ENT (SR), 0, 0 }, @@ -270,10 +300,10 @@ static const CGEN_OPINST sfmt_ldi16_ops[ }; static const CGEN_OPINST sfmt_lock_ops[] = { - { INPUT, "h_memory_sr", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, + { INPUT, "h_memory_SI_sr", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, { INPUT, "sr", HW_H_GR, CGEN_MODE_USI, OP_ENT (SR), 0, 0 }, { OUTPUT, "dr", HW_H_GR, CGEN_MODE_SI, OP_ENT (DR), 0, 0 }, - { OUTPUT, "h_lock", HW_H_LOCK, CGEN_MODE_BI, 0, 0, 0 }, + { OUTPUT, "h_lock_BI", HW_H_LOCK, CGEN_MODE_BI, 0, 0, 0 }, { END } }; @@ -369,13 +399,13 @@ static const CGEN_OPINST sfmt_rac_dsi_op }; static const CGEN_OPINST sfmt_rte_ops[] = { - { INPUT, "h_bbpsw", HW_H_BBPSW, CGEN_MODE_UQI, 0, 0, 0 }, - { INPUT, "h_bpsw", HW_H_BPSW, CGEN_MODE_UQI, 0, 0, 0 }, - { INPUT, "h_cr_14", HW_H_CR, CGEN_MODE_USI, 0, 14, 0 }, - { INPUT, "h_cr_6", HW_H_CR, CGEN_MODE_USI, 0, 6, 0 }, - { OUTPUT, "h_bpsw", HW_H_BPSW, CGEN_MODE_UQI, 0, 0, 0 }, - { OUTPUT, "h_cr_6", HW_H_CR, CGEN_MODE_USI, 0, 6, 0 }, - { OUTPUT, "h_psw", HW_H_PSW, CGEN_MODE_UQI, 0, 0, 0 }, + { INPUT, "h_bbpsw_UQI", HW_H_BBPSW, CGEN_MODE_UQI, 0, 0, 0 }, + { INPUT, "h_bpsw_UQI", HW_H_BPSW, CGEN_MODE_UQI, 0, 0, 0 }, + { INPUT, "h_cr_USI_14", HW_H_CR, CGEN_MODE_USI, 0, 14, 0 }, + { INPUT, "h_cr_USI_6", HW_H_CR, CGEN_MODE_USI, 0, 6, 0 }, + { OUTPUT, "h_bpsw_UQI", HW_H_BPSW, CGEN_MODE_UQI, 0, 0, 0 }, + { OUTPUT, "h_cr_USI_6", HW_H_CR, CGEN_MODE_USI, 0, 6, 0 }, + { OUTPUT, "h_psw_UQI", HW_H_PSW, CGEN_MODE_UQI, 0, 0, 0 }, { OUTPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 }, { END } }; @@ -403,7 +433,7 @@ static const CGEN_OPINST sfmt_slli_ops[] static const CGEN_OPINST sfmt_st_ops[] = { { INPUT, "src1", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC1), 0, 0 }, { INPUT, "src2", HW_H_GR, CGEN_MODE_USI, OP_ENT (SRC2), 0, 0 }, - { OUTPUT, "h_memory_src2", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, + { OUTPUT, "h_memory_SI_src2", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, { END } }; @@ -411,14 +441,14 @@ static const CGEN_OPINST sfmt_st_d_ops[] { INPUT, "slo16", HW_H_SLO16, CGEN_MODE_INT, OP_ENT (SLO16), 0, 0 }, { INPUT, "src1", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC1), 0, 0 }, { INPUT, "src2", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC2), 0, 0 }, - { OUTPUT, "h_memory_add__DFLT_src2_slo16", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, + { OUTPUT, "h_memory_SI_add__DFLT_src2_slo16", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, { END } }; static const CGEN_OPINST sfmt_stb_ops[] = { { INPUT, "src1", HW_H_GR, CGEN_MODE_QI, OP_ENT (SRC1), 0, 0 }, { INPUT, "src2", HW_H_GR, CGEN_MODE_USI, OP_ENT (SRC2), 0, 0 }, - { OUTPUT, "h_memory_src2", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 }, + { OUTPUT, "h_memory_QI_src2", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 }, { END } }; @@ -426,14 +456,14 @@ static const CGEN_OPINST sfmt_stb_d_ops[ { INPUT, "slo16", HW_H_SLO16, CGEN_MODE_INT, OP_ENT (SLO16), 0, 0 }, { INPUT, "src1", HW_H_GR, CGEN_MODE_QI, OP_ENT (SRC1), 0, 0 }, { INPUT, "src2", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC2), 0, 0 }, - { OUTPUT, "h_memory_add__DFLT_src2_slo16", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 }, + { OUTPUT, "h_memory_QI_add__DFLT_src2_slo16", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 }, { END } }; static const CGEN_OPINST sfmt_sth_ops[] = { { INPUT, "src1", HW_H_GR, CGEN_MODE_HI, OP_ENT (SRC1), 0, 0 }, { INPUT, "src2", HW_H_GR, CGEN_MODE_USI, OP_ENT (SRC2), 0, 0 }, - { OUTPUT, "h_memory_src2", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 }, + { OUTPUT, "h_memory_HI_src2", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 }, { END } }; @@ -441,39 +471,39 @@ static const CGEN_OPINST sfmt_sth_d_ops[ { INPUT, "slo16", HW_H_SLO16, CGEN_MODE_INT, OP_ENT (SLO16), 0, 0 }, { INPUT, "src1", HW_H_GR, CGEN_MODE_HI, OP_ENT (SRC1), 0, 0 }, { INPUT, "src2", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC2), 0, 0 }, - { OUTPUT, "h_memory_add__DFLT_src2_slo16", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 }, + { OUTPUT, "h_memory_HI_add__DFLT_src2_slo16", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 }, { END } }; static const CGEN_OPINST sfmt_st_plus_ops[] = { { INPUT, "src1", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC1), 0, 0 }, { INPUT, "src2", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC2), 0, 0 }, - { OUTPUT, "h_memory_new_src2", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, + { OUTPUT, "h_memory_SI_new_src2", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, { OUTPUT, "src2", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC2), 0, 0 }, { END } }; static const CGEN_OPINST sfmt_trap_ops[] = { - { INPUT, "h_bpsw", HW_H_BPSW, CGEN_MODE_UQI, 0, 0, 0 }, - { INPUT, "h_cr_6", HW_H_CR, CGEN_MODE_USI, 0, 6, 0 }, - { INPUT, "h_psw", HW_H_PSW, CGEN_MODE_UQI, 0, 0, 0 }, + { INPUT, "h_bpsw_UQI", HW_H_BPSW, CGEN_MODE_UQI, 0, 0, 0 }, + { INPUT, "h_cr_USI_6", HW_H_CR, CGEN_MODE_USI, 0, 6, 0 }, + { INPUT, "h_psw_UQI", HW_H_PSW, CGEN_MODE_UQI, 0, 0, 0 }, { INPUT, "pc", HW_H_PC, CGEN_MODE_USI, 0, 0, 0 }, { INPUT, "uimm4", HW_H_UINT, CGEN_MODE_UINT, OP_ENT (UIMM4), 0, 0 }, - { OUTPUT, "h_bbpsw", HW_H_BBPSW, CGEN_MODE_UQI, 0, 0, 0 }, - { OUTPUT, "h_bpsw", HW_H_BPSW, CGEN_MODE_UQI, 0, 0, 0 }, - { OUTPUT, "h_cr_14", HW_H_CR, CGEN_MODE_USI, 0, 14, 0 }, - { OUTPUT, "h_cr_6", HW_H_CR, CGEN_MODE_USI, 0, 6, 0 }, - { OUTPUT, "h_psw", HW_H_PSW, CGEN_MODE_UQI, 0, 0, 0 }, + { OUTPUT, "h_bbpsw_UQI", HW_H_BBPSW, CGEN_MODE_UQI, 0, 0, 0 }, + { OUTPUT, "h_bpsw_UQI", HW_H_BPSW, CGEN_MODE_UQI, 0, 0, 0 }, + { OUTPUT, "h_cr_USI_14", HW_H_CR, CGEN_MODE_USI, 0, 14, 0 }, + { OUTPUT, "h_cr_USI_6", HW_H_CR, CGEN_MODE_USI, 0, 6, 0 }, + { OUTPUT, "h_psw_UQI", HW_H_PSW, CGEN_MODE_UQI, 0, 0, 0 }, { OUTPUT, "pc", HW_H_PC, CGEN_MODE_SI, 0, 0, 0 }, { END } }; static const CGEN_OPINST sfmt_unlock_ops[] = { - { INPUT, "h_lock", HW_H_LOCK, CGEN_MODE_BI, 0, 0, 0 }, + { INPUT, "h_lock_BI", HW_H_LOCK, CGEN_MODE_BI, 0, 0, 0 }, { INPUT, "src1", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC1), 0, COND_REF }, { INPUT, "src2", HW_H_GR, CGEN_MODE_USI, OP_ENT (SRC2), 0, COND_REF }, - { OUTPUT, "h_lock", HW_H_LOCK, CGEN_MODE_BI, 0, 0, 0 }, - { OUTPUT, "h_memory_src2", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, COND_REF }, + { OUTPUT, "h_lock_BI", HW_H_LOCK, CGEN_MODE_BI, 0, 0, 0 }, + { OUTPUT, "h_memory_SI_src2", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, COND_REF }, { END } }; @@ -491,24 +521,24 @@ static const CGEN_OPINST sfmt_sat_ops[] }; static const CGEN_OPINST sfmt_sadd_ops[] = { - { INPUT, "h_accums_0", HW_H_ACCUMS, CGEN_MODE_DI, 0, 0, 0 }, - { INPUT, "h_accums_1", HW_H_ACCUMS, CGEN_MODE_DI, 0, 1, 0 }, - { OUTPUT, "h_accums_0", HW_H_ACCUMS, CGEN_MODE_DI, 0, 0, 0 }, + { INPUT, "h_accums_DI_0", HW_H_ACCUMS, CGEN_MODE_DI, 0, 0, 0 }, + { INPUT, "h_accums_DI_1", HW_H_ACCUMS, CGEN_MODE_DI, 0, 1, 0 }, + { OUTPUT, "h_accums_DI_0", HW_H_ACCUMS, CGEN_MODE_DI, 0, 0, 0 }, { END } }; static const CGEN_OPINST sfmt_macwu1_ops[] = { - { INPUT, "h_accums_1", HW_H_ACCUMS, CGEN_MODE_DI, 0, 1, 0 }, + { INPUT, "h_accums_DI_1", HW_H_ACCUMS, CGEN_MODE_DI, 0, 1, 0 }, { INPUT, "src1", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC1), 0, 0 }, { INPUT, "src2", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC2), 0, 0 }, - { OUTPUT, "h_accums_1", HW_H_ACCUMS, CGEN_MODE_DI, 0, 1, 0 }, + { OUTPUT, "h_accums_DI_1", HW_H_ACCUMS, CGEN_MODE_DI, 0, 1, 0 }, { END } }; static const CGEN_OPINST sfmt_mulwu1_ops[] = { { INPUT, "src1", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC1), 0, 0 }, { INPUT, "src2", HW_H_GR, CGEN_MODE_SI, OP_ENT (SRC2), 0, 0 }, - { OUTPUT, "h_accums_1", HW_H_ACCUMS, CGEN_MODE_DI, 0, 1, 0 }, + { OUTPUT, "h_accums_DI_1", HW_H_ACCUMS, CGEN_MODE_DI, 0, 1, 0 }, { END } }; @@ -576,14 +606,14 @@ static const CGEN_OPINST *m32r_cgen_opin & sfmt_jmp_ops[0], & sfmt_ld_ops[0], & sfmt_ld_d_ops[0], - & sfmt_ld_ops[0], - & sfmt_ld_d_ops[0], - & sfmt_ld_ops[0], - & sfmt_ld_d_ops[0], - & sfmt_ld_ops[0], - & sfmt_ld_d_ops[0], - & sfmt_ld_ops[0], - & sfmt_ld_d_ops[0], + & sfmt_ldb_ops[0], + & sfmt_ldb_d_ops[0], + & sfmt_ldh_ops[0], + & sfmt_ldh_d_ops[0], + & sfmt_ldb_ops[0], + & sfmt_ldb_d_ops[0], + & sfmt_ldh_ops[0], + & sfmt_ldh_d_ops[0], & sfmt_ld_plus_ops[0], & sfmt_ld24_ops[0], & sfmt_ldi8_ops[0], diff -uprN binutils-2.11.90.0.27/opcodes/mcore-dis.c binutils-2.11.90.0.29/opcodes/mcore-dis.c --- binutils-2.11.90.0.27/opcodes/mcore-dis.c Sat Mar 17 12:48:21 2001 +++ binutils-2.11.90.0.29/opcodes/mcore-dis.c Wed Aug 22 08:52:10 2001 @@ -24,8 +24,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "dis-asm.h" /* Mask for each mcore_opclass: */ -static const unsigned short imsk[] = -{ +static const unsigned short imsk[] = { /* O0 */ 0xFFFF, /* OT */ 0xFFFC, /* O1 */ 0xFFF0, @@ -34,7 +33,7 @@ static const unsigned short imsk[] = /* X1 */ 0xFFF0, /* OI */ 0xFE00, /* OB */ 0xFE00, - + /* OMa */ 0xFFF0, /* SI */ 0xFE00, /* I7 */ 0xF800, @@ -43,7 +42,7 @@ static const unsigned short imsk[] = /* BL */ 0xFF00, /* LR */ 0xF000, /* LJ */ 0xFF00, - + /* RM */ 0xFFF0, /* RQ */ 0xFFF0, /* JSR */ 0xFFF0, @@ -52,33 +51,31 @@ static const unsigned short imsk[] = /* OBRb*/ 0xFF80, /* OBRc*/ 0xFF00, /* OBR2*/ 0xFE00, - + /* O1R1*/ 0xFFF0, /* OMb */ 0xFF80, /* OMc */ 0xFF00, /* SIa */ 0xFE00, - /* MULSH */ 0xFF00, + /* MULSH */ 0xFF00, /* OPSR */ 0xFFF8, /* psrset/psrclr */ - + /* JC */ 0, /* JC,JU,JL don't appear in object */ /* JU */ 0, /* JL */ 0, /* RSI */ 0, /* DO21*/ 0, - /* OB2 */ 0 /* OB2 won't appear in object. */ + /* OB2 */ 0 /* OB2 won't appear in object. */ }; -static const char * grname[] = -{ +static const char *grname[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }; static const char X[] = "??"; -static const char * crname[] = -{ +static const char *crname[] = { "psr", "vbr", "epsr", "fpsr", "epc", "fpc", "ss0", "ss1", "ss2", "ss3", "ss4", "gcr", "gsr", X, X, X, X, X, X, X, X, X, X, X, @@ -87,10 +84,10 @@ static const char * crname[] = static const unsigned isiz[] = { 2, 0, 1, 0 }; -int +int print_insn_mcore (memaddr, info) bfd_vma memaddr; - struct disassemble_info * info; + struct disassemble_info *info; { unsigned char ibytes[4]; fprintf_ftype fprintf = info->fprintf_func; @@ -103,7 +100,7 @@ print_insn_mcore (memaddr, info) status = info->read_memory_func (memaddr, ibytes, 2, info); - if (status != 0) + if (status != 0) { info->memory_error_func (status, memaddr, info); return -1; @@ -117,7 +114,7 @@ print_insn_mcore (memaddr, info) abort (); /* Just a linear search of the table. */ - for (op = mcore_table; op->name != 0; op ++) + for (op = mcore_table; op->name != 0; op++) if (op->inst == (inst & imsk[op->opclass])) break; @@ -125,10 +122,10 @@ print_insn_mcore (memaddr, info) fprintf (stream, ".short 0x%04x", inst); else { - const char * name = grname[inst & 0x0F]; - + const char *name = grname[inst & 0x0F]; + fprintf (stream, "%s", op->name); - + switch (op->opclass) { case O0: break; @@ -157,21 +154,21 @@ print_insn_mcore (memaddr, info) case LS: fprintf (stream, "\t%s, (%s, %d)", grname[(inst >> 8) & 0xF], name, ((inst >> 4) & 0xF) << isiz[(inst >> 13) & 3]); break; - + case BR: { long val = inst & 0x3FF; - + if (inst & 0x400) val |= 0xFFFFFC00; - - fprintf (stream, "\t0x%x", memaddr + 2 + (val<<1)); - + + fprintf (stream, "\t0x%x", memaddr + 2 + (val << 1)); + if (strcmp (op->name, "bsr") == 0) { /* For bsr, we'll try to get a symbol for the target. */ val = memaddr + 2 + (val << 1); - + if (info->print_address_func && val != 0) { fprintf (stream, "\t// "); @@ -180,36 +177,36 @@ print_insn_mcore (memaddr, info) } } break; - + case BL: { long val; val = (inst & 0x000F); fprintf (stream, "\t%s, 0x%x", - grname[(inst >> 4) & 0xF], memaddr - (val << 1)); + grname[(inst >> 4) & 0xF], memaddr - (val << 1)); } break; - + case LR: { unsigned long val; - + val = (memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC; - + status = info->read_memory_func (val, ibytes, 4, info); - if (status != 0) + if (status != 0) { info->memory_error_func (status, memaddr, info); break; } - + if (info->endian == BFD_ENDIAN_LITTLE) val = (ibytes[3] << 24) | (ibytes[2] << 16) | (ibytes[1] << 8) | (ibytes[0]); else val = (ibytes[0] << 24) | (ibytes[1] << 16) | (ibytes[2] << 8) | (ibytes[3]); - + /* Removed [] around literal value to match ABI syntax 12/95. */ fprintf (stream, "\t%s, 0x%X", grname[(inst >> 8) & 0xF], val); @@ -218,15 +215,15 @@ print_insn_mcore (memaddr, info) (memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC); } break; - + case LJ: { unsigned long val; - + val = (memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC; - + status = info->read_memory_func (val, ibytes, 4, info); - if (status != 0) + if (status != 0) { info->memory_error_func (status, memaddr, info); break; @@ -238,7 +235,7 @@ print_insn_mcore (memaddr, info) else val = (ibytes[0] << 24) | (ibytes[1] << 16) | (ibytes[2] << 8) | (ibytes[3]); - + /* Removed [] around literal value to match ABI syntax 12/95. */ fprintf (stream, "\t0x%X", val); /* For jmpi/jsri, we'll try to get a symbol for the target. */ @@ -254,26 +251,25 @@ print_insn_mcore (memaddr, info) } } break; - + case OPSR: { - static char * fields[] = - { - "af", "ie", "fe", "fe,ie", + static char *fields[] = { + "af", "ie", "fe", "fe,ie", "ee", "ee,ie", "ee,fe", "ee,fe,ie" }; - + fprintf (stream, "\t%s", fields[inst & 0x7]); } break; - + default: /* If the disassembler lags the instruction set. */ fprintf (stream, "\tundecoded operands, inst is 0x%04x", inst); break; } } - + /* Say how many bytes we consumed. */ return 2; } diff -uprN binutils-2.11.90.0.27/opcodes/mips-dis.c binutils-2.11.90.0.29/opcodes/mips-dis.c --- binutils-2.11.90.0.27/opcodes/mips-dis.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/opcodes/mips-dis.c Wed Aug 22 08:52:10 2001 @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suit /* FIXME: These are needed to figure out if the code is mips16 or not. The low bit of the address is often a good indicator. No symbol table is available when this code runs out in an embedded - system as when it is used for disassembler support in a monitor. */ + system as when it is used for disassembler support in a monitor. */ #if !defined(EMBEDDED_ENV) #define SYMTAB_AVAILABLE 1 @@ -45,8 +45,12 @@ static int print_insn_mips PARAMS ((bfd_vma, unsigned long int, struct disassemble_info *)); static void print_insn_arg PARAMS ((const char *, unsigned long, bfd_vma, struct disassemble_info *)); +static void mips_isa_type + PARAMS ((int, int *, int *)); static int print_insn_mips16 PARAMS ((bfd_vma, struct disassemble_info *)); +static int is_newabi + PARAMS ((Elf_Internal_Ehdr *)); static void print_mips16_insn_arg PARAMS ((int, const struct mips_opcode *, int, boolean, int, bfd_vma, struct disassemble_info *)); @@ -54,13 +58,11 @@ static void print_mips16_insn_arg /* FIXME: These should be shared with gdb somehow. */ /* The mips16 register names. */ -static const char * const mips16_reg_names[] = -{ +static const char * const mips16_reg_names[] = { "s0", "s1", "v0", "v1", "a0", "a1", "a2", "a3" }; -static const char * const mips32_reg_names[] = -{ +static const char * const mips32_reg_names[] = { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", @@ -74,8 +76,7 @@ static const char * const mips32_reg_nam "epc", "prid" }; -static const char * const mips64_reg_names[] = -{ +static const char * const mips64_reg_names[] = { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", @@ -93,7 +94,7 @@ static const char * const mips64_reg_nam table to use. */ static const char * const *reg_names = NULL; -/* Print insn arguments for 32/64-bit code */ +/* Print insn arguments for 32/64-bit code. */ static void print_insn_arg (d, l, pc, info) @@ -129,10 +130,10 @@ print_insn_arg (d, l, pc, info) case 'i': case 'u': (*info->fprintf_func) (info->stream, "0x%x", - (l >> OP_SH_IMMEDIATE) & OP_MASK_IMMEDIATE); + (l >> OP_SH_IMMEDIATE) & OP_MASK_IMMEDIATE); break; - case 'j': /* same as i, but sign-extended */ + case 'j': /* Same as i, but sign-extended. */ case 'o': delta = (l >> OP_SH_DELTA) & OP_MASK_DELTA; if (delta & 0x8000) @@ -155,13 +156,13 @@ print_insn_arg (d, l, pc, info) case 'a': (*info->print_address_func) - ((((pc + 4) & ~ (bfd_vma) 0x0fffffff) + ((((pc + 4) & ~(bfd_vma) 0x0fffffff) | (((l >> OP_SH_TARGET) & OP_MASK_TARGET) << 2)), info); break; case 'p': - /* sign extend the displacement */ + /* Sign extend the displacement. */ delta = (l >> OP_SH_DELTA) & OP_MASK_DELTA; if (delta & 0x8000) delta |= ~0xffff; @@ -177,25 +178,25 @@ print_insn_arg (d, l, pc, info) case 'U': { - /* First check for both rd and rt being equal. */ - unsigned int reg = (l >> OP_SH_RD) & OP_MASK_RD; - if (reg == ((l >> OP_SH_RT) & OP_MASK_RT)) - (*info->fprintf_func) (info->stream, "%s", - reg_names[reg]); - else - { - /* If one is zero use the other. */ - if (reg == 0) - (*info->fprintf_func) (info->stream, "%s", - reg_names[(l >> OP_SH_RT) & OP_MASK_RT]); - else if (((l >> OP_SH_RT) & OP_MASK_RT) == 0) - (*info->fprintf_func) (info->stream, "%s", - reg_names[reg]); - else /* Bogus, result depends on processor. */ - (*info->fprintf_func) (info->stream, "%s or %s", - reg_names[reg], - reg_names[(l >> OP_SH_RT) & OP_MASK_RT]); - } + /* First check for both rd and rt being equal. */ + unsigned int reg = (l >> OP_SH_RD) & OP_MASK_RD; + if (reg == ((l >> OP_SH_RT) & OP_MASK_RT)) + (*info->fprintf_func) (info->stream, "%s", + reg_names[reg]); + else + { + /* If one is zero use the other. */ + if (reg == 0) + (*info->fprintf_func) (info->stream, "%s", + reg_names[(l >> OP_SH_RT) & OP_MASK_RT]); + else if (((l >> OP_SH_RT) & OP_MASK_RT) == 0) + (*info->fprintf_func) (info->stream, "%s", + reg_names[reg]); + else /* Bogus, result depends on processor. */ + (*info->fprintf_func) (info->stream, "%s or %s", + reg_names[reg], + reg_names[(l >> OP_SH_RT) & OP_MASK_RT]); + } } break; @@ -294,7 +295,7 @@ print_insn_arg (d, l, pc, info) } } -/* Figure out the MIPS ISA and CPU based on the machine number. */ +/* Figure out the MIPS ISA and CPU based on the machine number. */ static void mips_isa_type (mach, isa, cputype) @@ -398,7 +399,7 @@ mips_isa_type (mach, isa, cputype) /* Check if the object uses NewABI conventions. */ static int -is_newabi(header) +is_newabi (header) Elf_Internal_Ehdr *header; { if ((header->e_flags @@ -443,7 +444,7 @@ print_insn_mips (memaddr, word, info) break; } } - } + } init = 1; } @@ -477,9 +478,9 @@ print_insn_mips (memaddr, word, info) d = op->args; if (d != NULL && *d != '\0') { - (*info->fprintf_func) (info->stream, "\t"); + (*info->fprintf_func) (info->stream, "\t"); for (; *d != '\0'; d++) - print_insn_arg (d, word, memaddr, info); + print_insn_arg (d, word, memaddr, info); } return INSNLEN; @@ -530,8 +531,8 @@ _print_insn_mips (memaddr, info, endiann { Elf_Internal_Ehdr *header; - header = elf_elfheader(bfd_asymbol_bfd(*(info->symbols))); - if (is_newabi(header)) + header = elf_elfheader (bfd_asymbol_bfd (*(info->symbols))); + if (is_newabi (header)) reg_names = mips64_reg_names; } @@ -541,7 +542,7 @@ _print_insn_mips (memaddr, info, endiann unsigned long insn; if (endianness == BFD_ENDIAN_BIG) - insn = (unsigned long) bfd_getb32 (buffer); + insn = (unsigned long) bfd_getb32 (buffer); else insn = (unsigned long) bfd_getl32 (buffer); @@ -791,7 +792,7 @@ print_mips16_insn_arg (type, op, l, use_ case 'X': (*info->fprintf_func) (info->stream, "%s", mips32_reg_names[((l >> MIPS16OP_SH_REGR32) - & MIPS16OP_MASK_REGR32)]); + & MIPS16OP_MASK_REGR32)]); break; case 'Y': @@ -1051,7 +1052,7 @@ print_mips16_insn_arg (type, op, l, use_ baseaddr = memaddr - 2; } } - val = (baseaddr & ~ ((1 << shift) - 1)) + immed; + val = (baseaddr & ~((1 << shift) - 1)) + immed; (*info->print_address_func) (val, info); info->target = val; } diff -uprN binutils-2.11.90.0.27/opcodes/mips-opc.c binutils-2.11.90.0.29/opcodes/mips-opc.c --- binutils-2.11.90.0.27/opcodes/mips-opc.c Fri Aug 10 14:08:01 2001 +++ binutils-2.11.90.0.29/opcodes/mips-opc.c Wed Aug 22 08:52:10 2001 @@ -86,15 +86,16 @@ Software Foundation, 59 Temple Place - S #define L1 INSN_4010 #define V1 INSN_4100 #define T3 INSN_3900 +#define M1 INSN_10000 #define G1 (T3 \ ) -#define G2 (T3 \ +#define G2 (T3 \ ) -#define G3 (I4 \ - ) +#define G3 (I4 \ + ) /* The order of overloaded instructions matters. Label arguments and register arguments look the same. Instructions that can have either @@ -171,47 +172,47 @@ const struct mips_opcode mips_builtin_op {"beq", "s,t,p", 0x10000000, 0xfc000000, CBD|RD_s|RD_t, I1 }, {"beq", "s,I,p", 0, (int) M_BEQ_I, INSN_MACRO, I1 }, {"beql", "s,t,p", 0x50000000, 0xfc000000, CBL|RD_s|RD_t, I2|T3 }, -{"beql", "s,I,p", 0, (int) M_BEQL_I, INSN_MACRO, I2 }, +{"beql", "s,I,p", 0, (int) M_BEQL_I, INSN_MACRO, I2|T3 }, {"bge", "s,t,p", 0, (int) M_BGE, INSN_MACRO, I1 }, {"bge", "s,I,p", 0, (int) M_BGE_I, INSN_MACRO, I1 }, -{"bgel", "s,t,p", 0, (int) M_BGEL, INSN_MACRO, I2 }, -{"bgel", "s,I,p", 0, (int) M_BGEL_I, INSN_MACRO, I2 }, +{"bgel", "s,t,p", 0, (int) M_BGEL, INSN_MACRO, I2|T3 }, +{"bgel", "s,I,p", 0, (int) M_BGEL_I, INSN_MACRO, I2|T3 }, {"bgeu", "s,t,p", 0, (int) M_BGEU, INSN_MACRO, I1 }, {"bgeu", "s,I,p", 0, (int) M_BGEU_I, INSN_MACRO, I1 }, -{"bgeul", "s,t,p", 0, (int) M_BGEUL, INSN_MACRO, I2 }, -{"bgeul", "s,I,p", 0, (int) M_BGEUL_I, INSN_MACRO, I2 }, +{"bgeul", "s,t,p", 0, (int) M_BGEUL, INSN_MACRO, I2|T3 }, +{"bgeul", "s,I,p", 0, (int) M_BGEUL_I, INSN_MACRO, I2|T3 }, {"bgez", "s,p", 0x04010000, 0xfc1f0000, CBD|RD_s, I1 }, {"bgezl", "s,p", 0x04030000, 0xfc1f0000, CBL|RD_s, I2|T3 }, {"bgezal", "s,p", 0x04110000, 0xfc1f0000, CBD|RD_s|WR_31, I1 }, {"bgezall", "s,p", 0x04130000, 0xfc1f0000, CBL|RD_s, I2|T3 }, {"bgt", "s,t,p", 0, (int) M_BGT, INSN_MACRO, I1 }, {"bgt", "s,I,p", 0, (int) M_BGT_I, INSN_MACRO, I1 }, -{"bgtl", "s,t,p", 0, (int) M_BGTL, INSN_MACRO, I2 }, -{"bgtl", "s,I,p", 0, (int) M_BGTL_I, INSN_MACRO, I2 }, +{"bgtl", "s,t,p", 0, (int) M_BGTL, INSN_MACRO, I2|T3 }, +{"bgtl", "s,I,p", 0, (int) M_BGTL_I, INSN_MACRO, I2|T3 }, {"bgtu", "s,t,p", 0, (int) M_BGTU, INSN_MACRO, I1 }, {"bgtu", "s,I,p", 0, (int) M_BGTU_I, INSN_MACRO, I1 }, -{"bgtul", "s,t,p", 0, (int) M_BGTUL, INSN_MACRO, I2 }, -{"bgtul", "s,I,p", 0, (int) M_BGTUL_I, INSN_MACRO, I2 }, +{"bgtul", "s,t,p", 0, (int) M_BGTUL, INSN_MACRO, I2|T3 }, +{"bgtul", "s,I,p", 0, (int) M_BGTUL_I, INSN_MACRO, I2|T3 }, {"bgtz", "s,p", 0x1c000000, 0xfc1f0000, CBD|RD_s, I1 }, {"bgtzl", "s,p", 0x5c000000, 0xfc1f0000, CBL|RD_s, I2|T3 }, {"ble", "s,t,p", 0, (int) M_BLE, INSN_MACRO, I1 }, {"ble", "s,I,p", 0, (int) M_BLE_I, INSN_MACRO, I1 }, -{"blel", "s,t,p", 0, (int) M_BLEL, INSN_MACRO, I2 }, -{"blel", "s,I,p", 0, (int) M_BLEL_I, INSN_MACRO, I2 }, +{"blel", "s,t,p", 0, (int) M_BLEL, INSN_MACRO, I2|T3 }, +{"blel", "s,I,p", 0, (int) M_BLEL_I, INSN_MACRO, I2|T3 }, {"bleu", "s,t,p", 0, (int) M_BLEU, INSN_MACRO, I1 }, {"bleu", "s,I,p", 0, (int) M_BLEU_I, INSN_MACRO, I1 }, -{"bleul", "s,t,p", 0, (int) M_BLEUL, INSN_MACRO, I2 }, -{"bleul", "s,I,p", 0, (int) M_BLEUL_I, INSN_MACRO, I2 }, +{"bleul", "s,t,p", 0, (int) M_BLEUL, INSN_MACRO, I2|T3 }, +{"bleul", "s,I,p", 0, (int) M_BLEUL_I, INSN_MACRO, I2|T3 }, {"blez", "s,p", 0x18000000, 0xfc1f0000, CBD|RD_s, I1 }, {"blezl", "s,p", 0x58000000, 0xfc1f0000, CBL|RD_s, I2|T3 }, {"blt", "s,t,p", 0, (int) M_BLT, INSN_MACRO, I1 }, {"blt", "s,I,p", 0, (int) M_BLT_I, INSN_MACRO, I1 }, -{"bltl", "s,t,p", 0, (int) M_BLTL, INSN_MACRO, I2 }, -{"bltl", "s,I,p", 0, (int) M_BLTL_I, INSN_MACRO, I2 }, +{"bltl", "s,t,p", 0, (int) M_BLTL, INSN_MACRO, I2|T3 }, +{"bltl", "s,I,p", 0, (int) M_BLTL_I, INSN_MACRO, I2|T3 }, {"bltu", "s,t,p", 0, (int) M_BLTU, INSN_MACRO, I1 }, {"bltu", "s,I,p", 0, (int) M_BLTU_I, INSN_MACRO, I1 }, -{"bltul", "s,t,p", 0, (int) M_BLTUL, INSN_MACRO, I2 }, -{"bltul", "s,I,p", 0, (int) M_BLTUL_I, INSN_MACRO, I2 }, +{"bltul", "s,t,p", 0, (int) M_BLTUL, INSN_MACRO, I2|T3 }, +{"bltul", "s,I,p", 0, (int) M_BLTUL_I, INSN_MACRO, I2|T3 }, {"bltz", "s,p", 0x04000000, 0xfc1f0000, CBD|RD_s, I1 }, {"bltzl", "s,p", 0x04020000, 0xfc1f0000, CBL|RD_s, I2|T3 }, {"bltzal", "s,p", 0x04100000, 0xfc1f0000, CBD|RD_s|WR_31, I1 }, @@ -221,7 +222,7 @@ const struct mips_opcode mips_builtin_op {"bne", "s,t,p", 0x14000000, 0xfc000000, CBD|RD_s|RD_t, I1 }, {"bne", "s,I,p", 0, (int) M_BNE_I, INSN_MACRO, I1 }, {"bnel", "s,t,p", 0x54000000, 0xfc000000, CBL|RD_s|RD_t, I2|T3 }, -{"bnel", "s,I,p", 0, (int) M_BNEL_I, INSN_MACRO, I2 }, +{"bnel", "s,I,p", 0, (int) M_BNEL_I, INSN_MACRO, I2|T3 }, {"break", "", 0x0000000d, 0xffffffff, TRAP, I1 }, {"break", "B", 0x0000000d, 0xfc00003f, TRAP, I32 }, {"break", "c", 0x0000000d, 0xfc00ffff, TRAP, I1 }, @@ -557,6 +558,8 @@ const struct mips_opcode mips_builtin_op {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, G1 }, {"maddu", "d,s,t", 0x70000001, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, G1 }, {"madd16", "s,t", 0x00000028, 0xfc00ffff, RD_s|RD_t|MOD_HILO, V1 }, +{"mfpc", "t,P", 0x4000c801, 0xffe0ffc1, LCD|WR_t|RD_C0, M1 }, +{"mfps", "t,P", 0x4000c800, 0xffe0ffc1, LCD|WR_t|RD_C0, M1 }, {"mfc0", "t,G", 0x40000000, 0xffe007ff, LCD|WR_t|RD_C0, I1 }, {"mfc0", "t,G,H", 0x40000000, 0xffe007f8, LCD|WR_t|RD_C0, I32 }, {"mfc1", "t,S", 0x44000000, 0xffe007ff, LCD|WR_t|RD_S|FP_S, I1 }, @@ -594,6 +597,8 @@ const struct mips_opcode mips_builtin_op {"msub", "s,t", 0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO, I32 }, {"msubu", "s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, L1 }, {"msubu", "s,t", 0x70000005, 0xfc00ffff, RD_s|RD_t|MOD_HILO, I32 }, +{"mtpc", "t,P", 0x4080c801, 0xffe0ffc1, COD|RD_t|WR_C0, M1 }, +{"mtps", "t,P", 0x4080c800, 0xffe0ffc1, COD|RD_t|WR_C0, M1 }, {"mtc0", "t,G", 0x40800000, 0xffe007ff, COD|RD_t|WR_C0|WR_CC, I1 }, {"mtc0", "t,G,H", 0x40800000, 0xffe007f8, COD|RD_t|WR_C0|WR_CC, I32 }, {"mtc1", "t,S", 0x44800000, 0xffe007ff, COD|RD_t|WR_S|FP_S, I1 }, @@ -836,7 +841,7 @@ const struct mips_opcode mips_builtin_op /* No hazard protection on coprocessor instructions--they shouldn't change the state of the processor and if they do it's up to the user to put in nops as necessary. These are at the end so that the - disasembler recognizes more specific versions first. */ + disassembler recognizes more specific versions first. */ {"c0", "C", 0x42000000, 0xfe000000, 0, I1 }, {"c1", "C", 0x46000000, 0xfe000000, 0, I1 }, {"c2", "C", 0x4a000000, 0xfe000000, 0, I1 }, diff -uprN binutils-2.11.90.0.27/opcodes/ns32k-dis.c binutils-2.11.90.0.29/opcodes/ns32k-dis.c --- binutils-2.11.90.0.27/opcodes/ns32k-dis.c Thu Mar 15 14:52:13 2001 +++ binutils-2.11.90.0.29/opcodes/ns32k-dis.c Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* Print National Semiconductor 32000 instructions. - Copyright 1986, 1988, 1991, 1992, 1994, 1998 + Copyright 1986, 1988, 1991, 1992, 1994, 1998, 2001 Free Software Foundation, Inc. This file is part of opcodes library. @@ -39,6 +39,16 @@ static int print_insn_arg PARAMS ((int, int, int *, char *, bfd_vma, char *, int)); static int get_displacement PARAMS ((char *, int *)); static int invalid_float PARAMS ((char *, int)); +static long int read_memory_integer PARAMS ((unsigned char *, int)); +static int fetch_data PARAMS ((struct disassemble_info *, bfd_byte *)); +struct ns32k_option; +static void optlist PARAMS ((int, const struct ns32k_option *, char *)); +static void list_search PARAMS ((int, const struct ns32k_option *, char *)); +static int bit_extract PARAMS ((bfd_byte *, int, int)); +static int bit_extract_simple PARAMS ((bfd_byte *, int, int)); +static void bit_copy PARAMS ((char *, int, int, char *)); +static int sign_extend PARAMS ((int, int)); +static void flip_bytes PARAMS ((char *, int)); static long read_memory_integer(addr, nr) unsigned char *addr; @@ -308,7 +318,6 @@ bit_extract_simple (buffer, offset, coun int count; { int result; - int mask; int bit; buffer += offset >> 3; diff -uprN binutils-2.11.90.0.27/opcodes/openrisc-asm.c binutils-2.11.90.0.29/opcodes/openrisc-asm.c --- binutils-2.11.90.0.27/opcodes/openrisc-asm.c Fri Apr 27 13:48:38 2001 +++ binutils-2.11.90.0.29/opcodes/openrisc-asm.c Wed Aug 22 08:52:10 2001 @@ -34,6 +34,7 @@ along with this program; if not, write t #include "openrisc-desc.h" #include "openrisc-opc.h" #include "opintl.h" +#include "xregex.h" #undef min #define min(a,b) ((a) < (b) ? (a) : (b)) @@ -257,6 +258,104 @@ openrisc_cgen_init_asm (cd) } + +/* + Regex construction routine. + + This translates an opcode syntax string into a regex string, + by replacing any non-character syntax element (such as an + opcode) with the pattern '.*' + + It then compiles the regex and stores it in the opcode, for + later use by openrisc_cgen_assemble_insn + + returns NULL for success, an error message for failure +*/ + +char * +openrisc_cgen_build_insn_regex (insn) + CGEN_INSN *insn; +{ + CGEN_OPCODE *opc = CGEN_INSN_OPCODE (insn); + const char *mnem = CGEN_INSN_MNEMONIC (insn); + int mnem_len; + char rxbuf[CGEN_MAX_RX_ELEMENTS]; + char *rx = rxbuf; + const CGEN_SYNTAX_CHAR_TYPE *syn; + int reg_err; + + syn = CGEN_SYNTAX_STRING (CGEN_OPCODE_SYNTAX (opc)); + + /* Mnemonics come first in the syntax string */ + if (! CGEN_SYNTAX_MNEMONIC_P (* syn)) return "missing mnemonic in syntax string"; + ++syn; + + /* copy the literal mnemonic out of the insn */ + memset (rx, 0, CGEN_MAX_RX_ELEMENTS); + mnem_len = strlen(mnem); + memcpy (rx, mnem, mnem_len); + rx += mnem_len; + + /* copy any remaining literals from the syntax string into the rx */ + for(; * syn != 0 && rx < rxbuf + (CGEN_MAX_RX_ELEMENTS - 9); ++syn, ++rx) + { + if (CGEN_SYNTAX_CHAR_P (* syn)) + { + char tmp = CGEN_SYNTAX_CHAR (* syn); + switch (tmp) + { + /* escape any regex metacharacters in the syntax */ + case '.': case '[': case '\\': + case '*': case '^': case '$': + +#ifdef CGEN_ESCAPE_EXTENDED_REGEX + case '?': case '{': case '}': + case '(': case ')': case '*': + case '|': case '+': case ']': +#endif + + * rx++ = '\\'; + break; + } + /* insert syntax char into rx */ + * rx = tmp; + } + else + { + /* replace non-syntax fields with globs */ + * rx = '.'; + * ++rx = '*'; + } + } + + /* trailing whitespace ok */ + * rx++ = '['; + * rx++ = ' '; + * rx++ = '\t'; + * rx++ = ']'; + * rx++ = '*'; + + /* but anchor it after that */ + * rx++ = '$'; + * rx = '\0'; + + CGEN_INSN_RX (insn) = xmalloc (sizeof (regex_t)); + reg_err = regcomp ((regex_t *) CGEN_INSN_RX (insn), rxbuf, REG_NOSUB|REG_ICASE); + + if (reg_err == 0) + return NULL; + else + { + static char msg[80]; + regerror (reg_err, (regex_t *) CGEN_INSN_RX (insn), msg, 80); + regfree ((regex_t *) CGEN_INSN_RX (insn)); + free (CGEN_INSN_RX (insn)); + (CGEN_INSN_RX (insn)) = NULL; + return msg; + } +} + + /* Default insn parser. The syntax string is scanned and operands are parsed and stored in FIELDS. @@ -423,6 +522,7 @@ openrisc_cgen_assemble_insn (cd, str, fi CGEN_INSN_LIST *ilist; const char *parse_errmsg = NULL; const char *insert_errmsg = NULL; + int recognized_mnemonic = 0; /* Skip leading white space. */ while (isspace (* str)) @@ -438,6 +538,7 @@ openrisc_cgen_assemble_insn (cd, str, fi for ( ; ilist != NULL ; ilist = CGEN_ASM_NEXT_INSN (ilist)) { const CGEN_INSN *insn = ilist->insn; + recognized_mnemonic = 1; #ifdef CGEN_VALIDATE_INSN_SUPPORTED /* not usually needed as unsupported opcodes shouldn't be in the hash lists */ @@ -454,6 +555,11 @@ openrisc_cgen_assemble_insn (cd, str, fi str = start; + /* skip this insn if str doesn't look right lexically */ + if (CGEN_INSN_RX (insn) != NULL && + regexec ((regex_t *) CGEN_INSN_RX (insn), str, 0, NULL, 0) == REG_NOMATCH) + continue; + /* Allow parse/insert handlers to obtain length of insn. */ CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn); @@ -481,6 +587,7 @@ openrisc_cgen_assemble_insn (cd, str, fi Failing that, use parse_errmsg */ tmp_errmsg = (insert_errmsg ? insert_errmsg : parse_errmsg ? parse_errmsg : + recognized_mnemonic ? _("unrecognized form of instruction") : _("unrecognized instruction")); if (strlen (start) > 50) diff -uprN binutils-2.11.90.0.27/opcodes/openrisc-desc.c binutils-2.11.90.0.29/opcodes/openrisc-desc.c --- binutils-2.11.90.0.27/opcodes/openrisc-desc.c Fri Apr 27 13:48:38 2001 +++ binutils-2.11.90.0.29/opcodes/openrisc-desc.c Wed Aug 22 08:52:10 2001 @@ -129,9 +129,9 @@ static const CGEN_ISA openrisc_cgen_isa_ /* Machine variants. */ static const CGEN_MACH openrisc_cgen_mach_table[] = { - { "openrisc", "openrisc", MACH_OPENRISC }, - { "or1300", "openrisc:1300", MACH_OR1300 }, - { 0, 0, 0 } + { "openrisc", "openrisc", MACH_OPENRISC, 0 }, + { "or1300", "openrisc:1300", MACH_OR1300, 0 }, + { 0, 0, 0, 0 } }; static CGEN_KEYWORD_ENTRY openrisc_cgen_opval_h_gr_entries[] = @@ -177,7 +177,7 @@ CGEN_KEYWORD openrisc_cgen_opval_h_gr = { & openrisc_cgen_opval_h_gr_entries[0], 35, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; @@ -779,11 +779,9 @@ static void openrisc_cgen_rebuild_tables (cd) CGEN_CPU_TABLE *cd; { - int i,n_isas; + int i; unsigned int isas = cd->isas; -#if 0 unsigned int machs = cd->machs; -#endif cd->int_insn_p = CGEN_INT_INSN_P; @@ -821,20 +819,26 @@ openrisc_cgen_rebuild_tables (cd) cd->min_insn_bitsize = isa->min_insn_bitsize; if (isa->max_insn_bitsize > cd->max_insn_bitsize) cd->max_insn_bitsize = isa->max_insn_bitsize; - - ++n_isas; } -#if 0 /* Does nothing?? */ /* Data derived from the mach spec. */ for (i = 0; i < MAX_MACHS; ++i) if (((1 << i) & machs) != 0) { const CGEN_MACH *mach = & openrisc_cgen_mach_table[i]; - ++n_machs; + if (mach->insn_chunk_bitsize != 0) + { + if (cd->insn_chunk_bitsize != 0 && cd->insn_chunk_bitsize != mach->insn_chunk_bitsize) + { + fprintf (stderr, "openrisc_cgen_rebuild_tables: conflicting insn-chunk-bitsize values: `%d' vs. `%d'\n", + cd->insn_chunk_bitsize, mach->insn_chunk_bitsize); + abort (); + } + + cd->insn_chunk_bitsize = mach->insn_chunk_bitsize; + } } -#endif /* Determine which hw elements are used by MACH. */ build_hw_table (cd); diff -uprN binutils-2.11.90.0.27/opcodes/openrisc-dis.c binutils-2.11.90.0.29/opcodes/openrisc-dis.c --- binutils-2.11.90.0.27/opcodes/openrisc-dis.c Fri Apr 27 13:48:38 2001 +++ binutils-2.11.90.0.29/opcodes/openrisc-dis.c Wed Aug 22 08:52:10 2001 @@ -325,13 +325,19 @@ print_insn (cd, pc, info, buf, buflen) char *buf; int buflen; { - unsigned long insn_value; + CGEN_INSN_INT insn_value; const CGEN_INSN_LIST *insn_list; CGEN_EXTRACT_INFO ex_info; - int rc = read_insn (cd, pc, info, buf, buflen, & ex_info, & insn_value); - if (rc != 0) - return rc; + /* Extract base part of instruction, just in case CGEN_DIS_* uses it. */ + insn_value = cgen_get_insn_value (cd, buf, buflen * 8); + + /* Fill in ex_info fields like read_insn would. Don't actually call + read_insn, since the incoming buffer is already read (and possibly + modified a la m32r). */ + ex_info.valid = (1 << buflen) - 1; + ex_info.dis_info = info; + ex_info.insn_bytes = buf; /* The instructions are stored in hash lists. Pick the first one and keep trying until we find the right one. */ @@ -342,6 +348,7 @@ print_insn (cd, pc, info, buf, buflen) const CGEN_INSN *insn = insn_list->insn; CGEN_FIELDS fields; int length; + unsigned long insn_value_cropped; #ifdef CGEN_VALIDATE_INSN_SUPPORTED /* not needed as insn shouldn't be in hash lists if not supported */ @@ -356,7 +363,17 @@ print_insn (cd, pc, info, buf, buflen) /* Basic bit mask must be correct. */ /* ??? May wish to allow target to defer this check until the extract handler. */ - if ((insn_value & CGEN_INSN_BASE_MASK (insn)) + + /* Base size may exceed this instruction's size. Extract the + relevant part from the buffer. */ + if ((CGEN_INSN_BITSIZE (insn) / 8) < buflen && + (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) + insn_value_cropped = bfd_get_bits (buf, CGEN_INSN_BITSIZE (insn), + info->endian == BFD_ENDIAN_BIG); + else + insn_value_cropped = insn_value; + + if ((insn_value_cropped & CGEN_INSN_BASE_MASK (insn)) == CGEN_INSN_BASE_VALUE (insn)) { /* Printing is handled in two passes. The first pass parses the @@ -379,7 +396,7 @@ print_insn (cd, pc, info, buf, buflen) } else length = CGEN_EXTRACT_FN (cd, insn) - (cd, insn, &ex_info, insn_value, &fields, pc); + (cd, insn, &ex_info, insn_value_cropped, &fields, pc); /* length < 0 -> error */ if (length < 0) @@ -413,18 +430,27 @@ default_print_insn (cd, pc, info) disassemble_info *info; { char buf[CGEN_MAX_INSN_SIZE]; + int buflen; int status; - /* Read the base part of the insn. */ + /* Attempt to read the base part of the insn. */ + buflen = cd->base_insn_bitsize / 8; + status = (*info->read_memory_func) (pc, buf, buflen, info); + + /* Try again with the minimum part, if min < base. */ + if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize)) + { + buflen = cd->min_insn_bitsize / 8; + status = (*info->read_memory_func) (pc, buf, buflen, info); + } - status = (*info->read_memory_func) (pc, buf, cd->base_insn_bitsize / 8, info); if (status != 0) { (*info->memory_error_func) (status, pc, info); return -1; } - return print_insn (cd, pc, info, buf, cd->base_insn_bitsize / 8); + return print_insn (cd, pc, info, buf, buflen); } /* Main entry point. diff -uprN binutils-2.11.90.0.27/opcodes/openrisc-ibld.c binutils-2.11.90.0.29/opcodes/openrisc-ibld.c --- binutils-2.11.90.0.27/opcodes/openrisc-ibld.c Fri Apr 27 13:48:38 2001 +++ binutils-2.11.90.0.29/opcodes/openrisc-ibld.c Wed Aug 22 08:52:10 2001 @@ -145,7 +145,22 @@ insert_normal (cd, value, attrs, word_of } /* Ensure VALUE will fit. */ - if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)) + if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT)) + { + long minval = - (1L << (length - 1)); + unsigned long maxval = mask; + + if ((value > 0 && (unsigned long) value > maxval) + || value < minval) + { + /* xgettext:c-format */ + sprintf (errbuf, + _("operand out of range (%ld not between %ld and %lu)"), + value, minval, maxval); + return errbuf; + } + } + else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)) { unsigned long maxval = mask; @@ -400,7 +415,7 @@ extract_normal (cd, ex_info, insn_value, #endif long *valuep; { - CGEN_INSN_INT value, mask; + long value, mask; /* If LENGTH is zero, this operand doesn't contribute to the value so give it a standard value of zero. */ @@ -428,9 +443,9 @@ extract_normal (cd, ex_info, insn_value, word_length = total_length; } - /* Does the value reside in INSN_VALUE? */ + /* Does the value reside in INSN_VALUE, and at the right alignment? */ - if (CGEN_INT_INSN_P || word_offset == 0) + if (CGEN_INT_INSN_P || (word_offset == 0 && word_length == total_length)) { if (CGEN_INSN_LSB0_P) value = insn_value >> ((word_offset + start + 1) - length); diff -uprN binutils-2.11.90.0.27/opcodes/openrisc-opc.c binutils-2.11.90.0.29/opcodes/openrisc-opc.c --- binutils-2.11.90.0.27/opcodes/openrisc-opc.c Fri Apr 27 13:48:38 2001 +++ binutils-2.11.90.0.29/opcodes/openrisc-opc.c Wed Aug 22 08:52:10 2001 @@ -678,6 +678,7 @@ openrisc_cgen_init_opcode_table (cd) { insns[i].base = &ib[i]; insns[i].opcode = &oc[i]; + openrisc_cgen_build_insn_regex (& insns[i]); } cd->macro_insn_table.init_entries = insns; cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE); @@ -686,7 +687,10 @@ openrisc_cgen_init_opcode_table (cd) oc = & openrisc_cgen_insn_opcode_table[0]; insns = (CGEN_INSN *) cd->insn_table.init_entries; for (i = 0; i < MAX_INSNS; ++i) - insns[i].opcode = &oc[i]; + { + insns[i].opcode = &oc[i]; + openrisc_cgen_build_insn_regex (& insns[i]); + } cd->sizeof_fields = sizeof (CGEN_FIELDS); cd->set_fields_bitsize = set_fields_bitsize; diff -uprN binutils-2.11.90.0.27/opcodes/pj-dis.c binutils-2.11.90.0.29/opcodes/pj-dis.c --- binutils-2.11.90.0.27/opcodes/pj-dis.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/opcodes/pj-dis.c Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* pj-dis.c -- Disassemble picoJava instructions. - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Steve Chamberlain, of Transmeta (sac@pobox.com). This program is free software; you can redistribute it and/or modify @@ -23,6 +23,9 @@ Foundation, Inc., 59 Temple Place - Suit extern const pj_opc_info_t pj_opc_info[512]; +static int get_int PARAMS ((bfd_vma, int *, struct disassemble_info *)); + + static int get_int (memaddr, iptr, info) bfd_vma memaddr; @@ -33,10 +36,10 @@ get_int (memaddr, iptr, info) int status = info->read_memory_func (memaddr, ival, 4, info); - *iptr = (ival[0] << 24) - | (ival[1] << 16) - | (ival[2] << 8) - | (ival[3] << 0) ; + *iptr = (ival[0] << 24) + | (ival[1] << 16) + | (ival[2] << 8) + | (ival[3] << 0); return status; } @@ -72,7 +75,7 @@ print_insn_pj (addr, info) fprintf_fn (stream, "%s", op->name); /* The tableswitch instruction is followed by the default - address, low value, high value and the destinations. */ + address, low value, high value and the destinations. */ if (strcmp (op->name, "tableswitch") == 0) { @@ -111,8 +114,8 @@ print_insn_pj (addr, info) /* The lookupswitch instruction is followed by the default address, element count and pairs of values and - addresses. */ - + addresses. */ + if (strcmp (op->name, "lookupswitch") == 0) { int count; diff -uprN binutils-2.11.90.0.27/opcodes/ppc-opc.c binutils-2.11.90.0.29/opcodes/ppc-opc.c --- binutils-2.11.90.0.27/opcodes/ppc-opc.c Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.29/opcodes/ppc-opc.c Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* ppc-opc.c -- PowerPC opcode list - Copyright 1994, 1995, 1996, 1997, 1998, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support @@ -198,7 +198,8 @@ const struct powerpc_operand powerpc_ope /* The DS field in a DS form instruction. This is like D, but the lower two bits are forced to zero. */ #define DS D + 1 - { 16, 0, insert_ds, extract_ds, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED }, + { 16, 0, insert_ds, extract_ds, + PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED | PPC_OPERAND_DS }, /* The E field in a wrteei instruction. */ #define E DS + 1 @@ -260,8 +261,12 @@ const struct powerpc_operand powerpc_ope #define LIA LI + 1 { 26, 0, insert_li, extract_li, PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED }, + /* The LS field in an X (sync) form instruction. */ +#define LS LIA + 1 + { 2, 21, 0, 0, PPC_OPERAND_OPTIONAL }, + /* The MB field in an M form instruction. */ -#define MB LIA + 1 +#define MB LS + 1 #define MB_MASK (0x1f << 6) { 5, 6, 0, 0, 0 }, @@ -401,23 +406,23 @@ const struct powerpc_operand powerpc_ope /* The VA field in a VA, VX or VXR form instruction. */ #define VA UI + 1 #define VA_MASK (0x1f << 16) - {5, 16, 0, 0, PPC_OPERAND_VR}, + { 5, 16, 0, 0, PPC_OPERAND_VR }, /* The VB field in a VA, VX or VXR form instruction. */ #define VB VA + 1 #define VB_MASK (0x1f << 11) - {5, 11, 0, 0, PPC_OPERAND_VR}, + { 5, 11, 0, 0, PPC_OPERAND_VR }, /* The VC field in a VA form instruction. */ #define VC VB + 1 #define VC_MASK (0x1f << 6) - {5, 6, 0, 0, PPC_OPERAND_VR}, + { 5, 6, 0, 0, PPC_OPERAND_VR }, /* The VD or VS field in a VA, VX, VXR or X form instruction. */ #define VD VC + 1 #define VS VD #define VD_MASK (0x1f << 21) - {5, 21, 0, 0, PPC_OPERAND_VR}, + { 5, 21, 0, 0, PPC_OPERAND_VR }, /* The SIMM field in a VX form instruction. */ #define SIMM VD + 1 @@ -679,6 +684,8 @@ insert_ds (insn, value, errmsg) long value; const char **errmsg ATTRIBUTE_UNUSED; { + if ((value & 3) != 0 && errmsg != NULL) + *errmsg = _("offset not a multiple of 4"); return insn | (value & 0xfffc); } @@ -1199,6 +1206,12 @@ extract_tbr (insn, invalid) #define XTLB(op, xop, sh) (X ((op), (xop)) | ((((unsigned long)(sh)) & 0x1f) << 11)) #define XTLB_MASK (X_MASK | SH_MASK) +/* An X form sync instruction. */ +#define XSYNC(op, xop, l) (X ((op), (xop)) | ((((unsigned long)(l)) & 3) << 21)) + +/* An X form sync instruction with everything filled in except the LS field. */ +#define XSYNC_MASK (0xff9fffff) + /* An XFL form instruction. */ #define XFL(op, xop, rc) (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1) | (((unsigned long)(rc)) & 1)) #define XFL_MASK (XFL (0x3f, 0x3ff, 1) | (((unsigned long)1) << 25) | (((unsigned long)1) << 16)) @@ -2846,6 +2859,8 @@ const struct powerpc_opcode powerpc_opco { "lhaux", X(31,375), X_MASK, COM, { RT, RAL, RB } }, +{ "slbmte", X(31,402), XRA_MASK, PPC64, { RS, RB } }, + { "sthx", X(31,407), X_MASK, COM, { RS, RA, RB } }, { "lfqx", X(31,791), X_MASK, POWER2, { FRT, RA, RB } }, @@ -3084,7 +3099,9 @@ const struct powerpc_opcode powerpc_opco { "lswi", X(31,597), X_MASK, PPCCOM, { RT, RA, NB } }, { "lsi", X(31,597), X_MASK, PWRCOM, { RT, RA, NB } }, -{ "sync", X(31,598), 0xffffffff, PPCCOM, { 0 } }, +{ "lwsync", XSYNC(31,598,1), 0xffffffff, PPCONLY, { 0 } }, +{ "ptesync", XSYNC(31,598,2), 0xffffffff, PPC64, { 0 } }, +{ "sync", X(31,598), XSYNC_MASK, PPCCOM, { LS } }, { "dcs", X(31,598), 0xffffffff, PWRCOM, { 0 } }, { "lfdx", X(31,599), X_MASK, COM, { FRT, RA, RB } }, @@ -3151,11 +3168,15 @@ const struct powerpc_opcode powerpc_opco { "srawi.", XRC(31,824,1), X_MASK, PPCCOM, { RA, RS, SH } }, { "srai.", XRC(31,824,1), X_MASK, PWRCOM, { RA, RS, SH } }, +{ "slbmfev", X(31,851), XRA_MASK, PPC64, { RT, RB } }, + { "eieio", X(31,854), 0xffffffff, PPC, { 0 } }, { "tlbsx", XRC(31,914,0), X_MASK, PPC403, { RT, RA, RB } }, { "tlbsx.", XRC(31,914,1), X_MASK, PPC403, { RT, RA, RB } }, +{ "slbmfee", X(31,915), XRA_MASK, PPC64, { RT, RB } }, + { "sthbrx", X(31,918), X_MASK, COM, { RS, RA, RB } }, { "sraq", XRC(31,920,0), X_MASK, M601, { RA, RS, RB } }, diff -uprN binutils-2.11.90.0.27/opcodes/s390-dis.c binutils-2.11.90.0.29/opcodes/s390-dis.c --- binutils-2.11.90.0.27/opcodes/s390-dis.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/opcodes/s390-dis.c Wed Aug 22 08:52:10 2001 @@ -29,11 +29,15 @@ static int init_flag = 0; static int opc_index[256]; static int current_arch_mask = 0; +static void init_disasm PARAMS ((struct disassemble_info *)); +static unsigned int s390_extract_operand + PARAMS ((unsigned char *, const struct s390_operand *)); + /* Set up index table for first opcode byte. */ static void init_disasm (info) - struct disassemble_info *info ATTRIBUTE_UNUSED; + struct disassemble_info *info; { const struct s390_opcode *opcode; const struct s390_opcode *opcode_end; diff -uprN binutils-2.11.90.0.27/opcodes/s390-opc.c binutils-2.11.90.0.29/opcodes/s390-opc.c --- binutils-2.11.90.0.27/opcodes/s390-opc.c Tue Jun 19 11:57:59 2001 +++ binutils-2.11.90.0.29/opcodes/s390-opc.c Mon Aug 27 11:44:52 2001 @@ -45,15 +45,15 @@ const struct s390_operand s390_operands[ #define R_8 1 /* GPR starting at position 8 */ { 4, 8, S390_OPERAND_GPR }, #define R_12 2 /* GPR starting at position 12 */ - { 4, 12, S390_OPERAND_GPR }, + { 4, 12, S390_OPERAND_GPR }, #define R_16 3 /* GPR starting at position 16 */ - { 4, 16, S390_OPERAND_GPR }, + { 4, 16, S390_OPERAND_GPR }, #define R_20 4 /* GPR starting at position 20 */ - { 4, 20, S390_OPERAND_GPR }, + { 4, 20, S390_OPERAND_GPR }, #define R_24 5 /* GPR starting at position 24 */ - { 4, 24, S390_OPERAND_GPR }, + { 4, 24, S390_OPERAND_GPR }, #define R_28 6 /* GPR starting at position 28 */ - { 4, 28, S390_OPERAND_GPR }, + { 4, 28, S390_OPERAND_GPR }, #define R_32 7 /* GPR starting at position 32 */ { 4, 32, S390_OPERAND_GPR }, @@ -87,24 +87,24 @@ const struct s390_operand s390_operands[ { 4, 12, S390_OPERAND_CR }, #define B_16 21 /* Base register starting at position 16 */ - { 4, 16, S390_OPERAND_BASE|S390_OPERAND_GPR }, + { 4, 16, S390_OPERAND_BASE|S390_OPERAND_GPR }, #define B_32 22 /* Base register starting at position 32 */ - { 4, 32, S390_OPERAND_BASE|S390_OPERAND_GPR }, + { 4, 32, S390_OPERAND_BASE|S390_OPERAND_GPR }, #define X_12 23 /* Index register starting at position 12 */ - { 4, 12, S390_OPERAND_INDEX|S390_OPERAND_GPR }, + { 4, 12, S390_OPERAND_INDEX|S390_OPERAND_GPR }, #define D_20 24 /* Displacement starting at position 20 */ - { 12, 20, S390_OPERAND_DISP }, + { 12, 20, S390_OPERAND_DISP }, #define D_36 25 /* Displacement starting at position 36 */ - { 12, 36, S390_OPERAND_DISP }, + { 12, 36, S390_OPERAND_DISP }, #define L4_8 26 /* 4 bit length starting at position 8 */ - { 4, 8, S390_OPERAND_LENGTH }, + { 4, 8, S390_OPERAND_LENGTH }, #define L4_12 27 /* 4 bit length starting at position 12 */ { 4, 12, S390_OPERAND_LENGTH }, #define L8_8 28 /* 8 bit length starting at position 8 */ - { 8, 8, S390_OPERAND_LENGTH }, + { 8, 8, S390_OPERAND_LENGTH }, #define U4_8 29 /* 4 bit unsigned value starting at 8 */ { 4, 8, 0 }, @@ -115,15 +115,15 @@ const struct s390_operand s390_operands[ #define U4_20 32 /* 4 bit unsigned value starting at 20 */ { 4, 20, 0 }, #define U8_8 33 /* 8 bit unsigned value starting at 8 */ - { 8, 8, 0 }, + { 8, 8, 0 }, #define U8_16 34 /* 8 bit unsigned value starting at 16 */ { 8, 16, 0 }, #define I16_16 35 /* 16 bit signed value starting at 16 */ { 16, 16, S390_OPERAND_SIGNED }, #define U16_16 36 /* 16 bit unsigned value starting at 16 */ - { 16, 16, 0 }, + { 16, 16, 0 }, #define J16_16 37 /* PC relative jump offset at 16 */ - { 16, 16, S390_OPERAND_PCREL }, + { 16, 16, S390_OPERAND_PCREL }, #define J32_16 38 /* PC relative long offset at 16 */ { 32, 16, S390_OPERAND_PCREL } }; @@ -204,7 +204,7 @@ const struct s390_operand s390_operands[ #define INSTR_RIL_A 6, { R_8,J32_16,0,0,0,0 } /* e.g. brasl */ #define INSTR_RIL_B 6, { J32_16,0,0,0,0,0 } /* e.g. jg */ #define INSTR_RIL_MA 6, { R_8,J32_16,0,0,0,0 } /* e.g. brcl */ - + #define MASK_E { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } #define MASK_RR { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } #define MASK_RR_M { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } @@ -273,7 +273,7 @@ const struct s390_operand s390_operands[ #define MASK_RIL_B { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } #define MASK_RIL_M { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } #define MASK_RIL_MA { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } - + /* The opcode formats table (blueprints for .insn pseudo mnemonic). */ const struct s390_opcode s390_opformats[] = @@ -506,10 +506,12 @@ const struct s390_opcode s390_opcodes[] { "jgnl", OP16(0xc0b4LL), MASK_RIL_B, INSTR_RIL_B, 2}, { "jgnm", OP16(0xc0b4LL), MASK_RIL_B, INSTR_RIL_B, 2}, { "jghe", OP16(0xc0a4LL), MASK_RIL_B, INSTR_RIL_B, 2}, + { "jgnlh", OP16(0xc094LL), MASK_RIL_B, INSTR_RIL_B, 2}, { "jge", OP16(0xc084LL), MASK_RIL_B, INSTR_RIL_B, 2}, { "jgz", OP16(0xc084LL), MASK_RIL_B, INSTR_RIL_B, 2}, { "jgne", OP16(0xc074LL), MASK_RIL_B, INSTR_RIL_B, 2}, { "jgnz", OP16(0xc074LL), MASK_RIL_B, INSTR_RIL_B, 2}, + { "jglh", OP16(0xc064LL), MASK_RIL_B, INSTR_RIL_B, 2}, { "jgnhe", OP16(0xc054LL), MASK_RIL_B, INSTR_RIL_B, 2}, { "jgl", OP16(0xc044LL), MASK_RIL_B, INSTR_RIL_B, 2}, { "jgm", OP16(0xc044LL), MASK_RIL_B, INSTR_RIL_B, 2}, @@ -751,10 +753,12 @@ const struct s390_opcode s390_opcodes[] { "jnl", OP16(0xa7b4LL), MASK_RI_B, INSTR_RI_B, 3}, { "jnm", OP16(0xa7b4LL), MASK_RI_B, INSTR_RI_B, 3}, { "jhe", OP16(0xa7a4LL), MASK_RI_B, INSTR_RI_B, 3}, + { "jnlh", OP16(0xa794LL), MASK_RI_B, INSTR_RI_B, 3}, { "je", OP16(0xa784LL), MASK_RI_B, INSTR_RI_B, 3}, { "jz", OP16(0xa784LL), MASK_RI_B, INSTR_RI_B, 3}, { "jne", OP16(0xa774LL), MASK_RI_B, INSTR_RI_B, 3}, { "jnz", OP16(0xa774LL), MASK_RI_B, INSTR_RI_B, 3}, + { "jlh", OP16(0xa764LL), MASK_RI_B, INSTR_RI_B, 3}, { "jnhe", OP16(0xa754LL), MASK_RI_B, INSTR_RI_B, 3}, { "jl", OP16(0xa744LL), MASK_RI_B, INSTR_RI_B, 3}, { "jm", OP16(0xa744LL), MASK_RI_B, INSTR_RI_B, 3}, @@ -873,10 +877,12 @@ const struct s390_opcode s390_opcodes[] { "bnl", OP16(0x47b0LL), MASK_RX_B, INSTR_RX_B, 3}, { "bnm", OP16(0x47b0LL), MASK_RX_B, INSTR_RX_B, 3}, { "bhe", OP16(0x47a0LL), MASK_RX_B, INSTR_RX_B, 3}, + { "bnlh", OP16(0x4790LL), MASK_RX_B, INSTR_RX_B, 3}, { "be", OP16(0x4780LL), MASK_RX_B, INSTR_RX_B, 3}, { "bz", OP16(0x4780LL), MASK_RX_B, INSTR_RX_B, 3}, { "bne", OP16(0x4770LL), MASK_RX_B, INSTR_RX_B, 3}, { "bnz", OP16(0x4770LL), MASK_RX_B, INSTR_RX_B, 3}, + { "blh", OP16(0x4760LL), MASK_RX_B, INSTR_RX_B, 3}, { "bnhe", OP16(0x4750LL), MASK_RX_B, INSTR_RX_B, 3}, { "bl", OP16(0x4740LL), MASK_RX_B, INSTR_RX_B, 3}, { "bm", OP16(0x4740LL), MASK_RX_B, INSTR_RX_B, 3}, @@ -955,10 +961,12 @@ const struct s390_opcode s390_opcodes[] { "bnlr", OP16(0x07b0LL), MASK_RR_B, INSTR_RR_B, 3}, { "bnmr", OP16(0x07b0LL), MASK_RR_B, INSTR_RR_B, 3}, { "bher", OP16(0x07a0LL), MASK_RR_B, INSTR_RR_B, 3}, + { "bnlhr", OP16(0x0790LL), MASK_RR_B, INSTR_RR_B, 3}, { "ber", OP16(0x0780LL), MASK_RR_B, INSTR_RR_B, 3}, { "bzr", OP16(0x0780LL), MASK_RR_B, INSTR_RR_B, 3}, { "bner", OP16(0x0770LL), MASK_RR_B, INSTR_RR_B, 3}, { "bnzr", OP16(0x0770LL), MASK_RR_B, INSTR_RR_B, 3}, + { "blhr", OP16(0x0760LL), MASK_RR_B, INSTR_RR_B, 3}, { "bnher", OP16(0x0750LL), MASK_RR_B, INSTR_RR_B, 3}, { "blr", OP16(0x0740LL), MASK_RR_B, INSTR_RR_B, 3}, { "bmr", OP16(0x0740LL), MASK_RR_B, INSTR_RR_B, 3}, @@ -983,6 +991,3 @@ const struct s390_opcode s390_opcodes[] const int s390_num_opcodes = sizeof (s390_opcodes) / sizeof (s390_opcodes[0]); - - - diff -uprN binutils-2.11.90.0.27/opcodes/s390-opc.txt binutils-2.11.90.0.29/opcodes/s390-opc.txt --- binutils-2.11.90.0.27/opcodes/s390-opc.txt Tue Jun 19 11:57:59 2001 +++ binutils-2.11.90.0.29/opcodes/s390-opc.txt Mon Aug 27 11:44:52 2001 @@ -265,10 +265,12 @@ a701 tml RI_U "test under mask low" esa 0740 blr RR_B "branch on low" esa 0740 bmr RR_B "branch on minus / if mixed" esa 0750 bnher RR_B "branch on not high or equal" esa +0760 blhr RR_B "branch on low or high" esa 0770 bner RR_B "branch on not equal" esa 0770 bnzr RR_B "branch on not zero / if not zeros" esa 0780 ber RR_B "branch on equal" esa 0780 bzr RR_B "branch on zero / if zeros" esa +0790 bnlhr RR_B "branch on not low or high" esa 07a0 bher RR_B "branch on high or equal" esa 07b0 bnlr RR_B "branch on not low" esa 07b0 bnmr RR_B "branch on not minus / if not mixed" esa @@ -285,10 +287,12 @@ a701 tml RI_U "test under mask low" esa 4740 bl RX_B "branch on low" esa 4740 bm RX_B "branch on minus / if mixed" esa 4750 bnhe RX_B "branch on not high or equal" esa +4760 blh RX_B "branch on low or high" esa 4770 bne RX_B "branch on not equal" esa 4770 bnz RX_B "branch on not zero / if not zeros" esa 4780 be RX_B "branch on equal" esa 4780 bz RX_B "branch on zero / if zeros" esa +4790 bnlh RX_B "branch on not low or high" esa 47a0 bhe RX_B "branch on high or equal" esa 47b0 bnl RX_B "branch on not low" esa 47b0 bnm RX_B "branch on not minus / if not mixed" esa @@ -304,10 +308,12 @@ a734 jnle RI_B "jump on not low or equal a744 jl RI_B "jump on A low" esa a744 jm RI_B "jump on minus / if mixed" esa a754 jnhe RI_B "jump on not high or equal" esa +a764 jlh RI_B "jump on low or high" esa a774 jne RI_B "jump on A not equal B" esa a774 jnz RI_B "jump on not zero / if not zeros" esa a784 je RI_B "jump on A equal B" esa a784 jz RI_B "jump on zero / if zeros" esa +a794 jnlh RI_B "jump on not low or high" esa a7a4 jhe RI_B "jump on high or equal" esa a7b4 jnl RI_B "jump on A not low" esa a7b4 jnm RI_B "jump on not minus / if not mixed" esa @@ -500,10 +506,12 @@ c034 jgnle RIL_B "jump long on not low o c044 jgl RIL_B "jump long on low" esame c044 jgm RIL_B "jump long on minus / if mixed" esame c054 jgnhe RIL_B "jump long on not high or equal" esame +c064 jglh RIL_B "jump long on low or high" esame c074 jgne RIL_B "jump long on not equal" esame c074 jgnz RIL_B "jump long on not zero / if not zeros" esame c084 jge RIL_B "jump long on equal" esame c084 jgz RIL_B "jump long on zero / if zeros" esame +c094 jgnlh RIL_B "jump long on not low or high" esame c0a4 jghe RIL_B "jump long on high or equal" esame c0b4 jgnl RIL_B "jump long on not low" esame c0b4 jgnm RIL_B "jump long on not minus / if not mixed" esame diff -uprN binutils-2.11.90.0.27/opcodes/sh-dis.c binutils-2.11.90.0.29/opcodes/sh-dis.c --- binutils-2.11.90.0.27/opcodes/sh-dis.c Thu Mar 15 14:52:14 2001 +++ binutils-2.11.90.0.29/opcodes/sh-dis.c Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* Disassemble SH instructions. - Copyright 1993, 1994, 1995, 1997, 1998, 2000 + Copyright 1993, 1994, 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -26,6 +26,13 @@ Foundation, Inc., 59 Temple Place - Suit #define LITTLE_BIT 2 +static void print_movxy + PARAMS ((sh_opcode_info *, int, int, fprintf_ftype, void *)); +static void print_insn_ddt PARAMS ((int, struct disassemble_info *)); +static void print_dsp_reg PARAMS ((int, fprintf_ftype, void *)); +static void print_insn_ppi PARAMS ((int, struct disassemble_info *)); +static int print_insn_shx PARAMS ((bfd_vma, struct disassemble_info *)); + static void print_movxy (op, rn, rm, fprintf_fn, stream) sh_opcode_info *op; diff -uprN binutils-2.11.90.0.27/opcodes/tic54x-dis.c binutils-2.11.90.0.29/opcodes/tic54x-dis.c --- binutils-2.11.90.0.27/opcodes/tic54x-dis.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/opcodes/tic54x-dis.c Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* Disassembly routines for TMS320C54X architecture - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Timothy Wall (twall@cygnus.com) This program is free software; you can redistribute it and/or modify @@ -31,20 +31,21 @@ typedef struct _instruction { partemplate *ptm; } instruction; +static int has_lkaddr PARAMS ((unsigned short, template *)); static int get_insn_size PARAMS ((unsigned short, instruction *)); -static int get_instruction PARAMS ((disassemble_info *, bfd_vma, +static int get_instruction PARAMS ((disassemble_info *, bfd_vma, unsigned short, instruction *)); -static int print_instruction PARAMS ((disassemble_info *, bfd_vma, - unsigned short, char *, +static int print_instruction PARAMS ((disassemble_info *, bfd_vma, + unsigned short, char *, enum optype [], int, int)); static int print_parallel_instruction PARAMS ((disassemble_info *, bfd_vma, unsigned short, partemplate *, - int)); -static int sprint_dual_address (disassemble_info *,char [], + int)); +static int sprint_dual_address (disassemble_info *,char [], unsigned short); -static int sprint_indirect_address (disassemble_info *,char [], +static int sprint_indirect_address (disassemble_info *,char [], unsigned short); -static int sprint_direct_address (disassemble_info *,char [], +static int sprint_direct_address (disassemble_info *,char [], unsigned short); static int sprint_mmr (disassemble_info *,char [],int); static int sprint_condition (disassemble_info *,char *,unsigned short); @@ -55,7 +56,7 @@ print_insn_tic54x (memaddr, info) bfd_vma memaddr; disassemble_info *info; { - bfd_byte opbuf[2]; + bfd_byte opbuf[2]; unsigned short opcode; int status, size; instruction insn; @@ -84,8 +85,8 @@ print_insn_tic54x (memaddr, info) } else { - if (!print_instruction (info, memaddr, opcode, - (char *) insn.tm->name, + if (!print_instruction (info, memaddr, opcode, + (char *) insn.tm->name, insn.tm->operand_types, size, (insn.tm->flags & FL_EXT))) return -1; @@ -108,7 +109,7 @@ has_lkaddr (opcode, tm) /* always returns 1 (whether an insn template was found) since we provide an "unknown instruction" template */ -static int +static int get_instruction (info, addr, opcode, insn) disassemble_info *info; bfd_vma addr; @@ -162,7 +163,7 @@ get_instruction (info, addr, opcode, ins return 1; } -static int +static int get_insn_size (opcode, insn) unsigned short opcode; instruction *insn; @@ -248,11 +249,11 @@ print_instruction (info, memaddr, opcode if (mod == 15) info->fprintf_func (info->stream, "*("); else - info->fprintf_func (info->stream, "*%sar%d(", + info->fprintf_func (info->stream, "*%sar%d(", (mod == 13 || mod == 14 ? "+" : ""), arf); (*(info->print_address_func)) ((bfd_vma) addr, info); - info->fprintf_func (info->stream, ")%s", + info->fprintf_func (info->stream, ")%s", mod == 14 ? "%" : ""); } else @@ -407,7 +408,7 @@ print_instruction (info, memaddr, opcode break; } case OP_k5: - sprintf (operand[i], "#%d", + sprintf (operand[i], "#%d", (int) (((signed char) opcode & 0x1F) << 3) >> 3); info->fprintf_func (info->stream, "%s%s", comma, operand[i]); break; @@ -431,15 +432,15 @@ print_instruction (info, memaddr, opcode case OP_SBIT: { const char *status0[] = { - "0", "1", "2", "3", "4", "5", "6", "7", "8", + "0", "1", "2", "3", "4", "5", "6", "7", "8", "ovb", "ova", "c", "tc", "13", "14", "15" }; const char *status1[] = { - "0", "1", "2", "3", "4", + "0", "1", "2", "3", "4", "cmpt", "frct", "c16", "sxm", "ovm", "10", "intm", "hm", "xf", "cpl", "braf" }; - sprintf (operand[i], "%s", + sprintf (operand[i], "%s", n ? status1[SBIT (opcode)] : status0[SBIT (opcode)]); info->fprintf_func (info->stream, "%s%s", comma, operand[i]); break; @@ -487,16 +488,16 @@ print_parallel_instruction (info, memadd partemplate *ptm; int size; { - print_instruction (info, memaddr, opcode, + print_instruction (info, memaddr, opcode, ptm->name, ptm->operand_types, size, 0); info->fprintf_func (info->stream, " || "); - return print_instruction (info, memaddr, opcode, + return print_instruction (info, memaddr, opcode, ptm->parname, ptm->paroperand_types, size, 0); } static int sprint_dual_address (info, buf, code) - disassemble_info *info; + disassemble_info *info ATTRIBUTE_UNUSED; char buf[]; unsigned short code; { @@ -511,7 +512,7 @@ sprint_dual_address (info, buf, code) static int sprint_indirect_address (info, buf, opcode) - disassemble_info *info; + disassemble_info *info ATTRIBUTE_UNUSED; char buf[]; unsigned short opcode; { @@ -534,7 +535,7 @@ sprint_indirect_address (info, buf, opco static int sprint_direct_address (info, buf, opcode) - disassemble_info *info; + disassemble_info *info ATTRIBUTE_UNUSED; char buf[]; unsigned short opcode; { @@ -544,7 +545,7 @@ sprint_direct_address (info, buf, opcode static int sprint_mmr (info, buf, mmr) - disassemble_info *info; + disassemble_info *info ATTRIBUTE_UNUSED; char buf[]; int mmr; { @@ -564,7 +565,7 @@ sprint_mmr (info, buf, mmr) static int sprint_cc2 (info, buf, opcode) - disassemble_info *info; + disassemble_info *info ATTRIBUTE_UNUSED; char *buf; unsigned short opcode; { @@ -577,7 +578,7 @@ sprint_cc2 (info, buf, opcode) static int sprint_condition (info, buf, opcode) - disassemble_info *info; + disassemble_info *info ATTRIBUTE_UNUSED; char *buf; unsigned short opcode; { @@ -597,15 +598,15 @@ sprint_condition (info, buf, opcode) else if (opcode & 0x3F) { if (opcode & 0x30) - buf += sprintf (buf, "%s%s", + buf += sprintf (buf, "%s%s", ((opcode & 0x30) == 0x30) ? "tc" : "ntc", (opcode & 0x0F) ? ", " : ""); if (opcode & 0x0C) - buf += sprintf (buf, "%s%s", + buf += sprintf (buf, "%s%s", ((opcode & 0x0C) == 0x0C) ? "c" : "nc", (opcode & 0x03) ? ", " : ""); if (opcode & 0x03) - buf += sprintf (buf, "%s", + buf += sprintf (buf, "%s", ((opcode & 0x03) == 0x03) ? "bio" : "nbio"); } else diff -uprN binutils-2.11.90.0.27/opcodes/v850-dis.c binutils-2.11.90.0.29/opcodes/v850-dis.c --- binutils-2.11.90.0.27/opcodes/v850-dis.c Thu Mar 15 14:52:15 2001 +++ binutils-2.11.90.0.29/opcodes/v850-dis.c Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* Disassemble V850 instructions. - Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,6 +41,9 @@ static const char *const v850_cc_names[] { "v", "c/l", "z", "nh", "s/n", "t", "lt", "le", "nv", "nc/nl", "nz", "h", "ns/p", "sa", "ge", "gt" }; +static int disassemble + PARAMS ((bfd_vma, struct disassemble_info *, unsigned long)); + static int disassemble (memaddr, info, insn) bfd_vma memaddr; diff -uprN binutils-2.11.90.0.27/opcodes/v850-opc.c binutils-2.11.90.0.29/opcodes/v850-opc.c --- binutils-2.11.90.0.27/opcodes/v850-opc.c Thu Mar 15 14:52:16 2001 +++ binutils-2.11.90.0.29/opcodes/v850-opc.c Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* Assemble V850 instructions. - Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,6 +34,42 @@ Foundation, Inc., 59 Temple Place - Suit /* two-word opcodes */ #define two(x,y) ((unsigned int) (x) | ((unsigned int) (y) << 16)) +static long unsigned int insert_d9 + PARAMS ((long unsigned int, long int, const char **)); +static long unsigned int extract_d9 + PARAMS ((long unsigned int, int *)); +static long unsigned int insert_d22 + PARAMS ((long unsigned int, long int, const char **)); +static long unsigned int extract_d22 + PARAMS ((long unsigned int, int *)); +static long unsigned int insert_d16_15 + PARAMS ((long unsigned int, long int, const char **)); +static long unsigned int extract_d16_15 + PARAMS ((long unsigned int, int *)); +static long unsigned int insert_d8_7 + PARAMS ((long unsigned int, long int, const char **)); +static long unsigned int extract_d8_7 PARAMS ((long unsigned int, int *)); +static long unsigned int insert_d8_6 + PARAMS ((long unsigned int, long int, const char **)); +static long unsigned int extract_d8_6 PARAMS ((long unsigned int, int *)); +static long unsigned int insert_d5_4 + PARAMS ((long unsigned int, long int, const char **)); +static long unsigned int extract_d5_4 PARAMS ((long unsigned int, int *)); +static long unsigned int insert_d16_16 + PARAMS ((long unsigned int, long int, const char **)); +static long unsigned int extract_d16_16 PARAMS ((long unsigned int, int *)); +static long unsigned int insert_i9 + PARAMS ((long unsigned int, long int, const char **)); +static long unsigned int extract_i9 PARAMS ((long unsigned int, int *)); +static long unsigned int insert_u9 + PARAMS ((long unsigned int, long unsigned int, const char **)); +static long unsigned int extract_u9 PARAMS ((long unsigned int, int *)); +static long unsigned int insert_spe + PARAMS ((long unsigned int, long unsigned int, const char **)); +static long unsigned int extract_spe PARAMS ((long unsigned int, int *)); +static long unsigned int insert_i5div + PARAMS ((long unsigned int, long unsigned int, const char **)); +static long unsigned int extract_i5div PARAMS ((long unsigned int, int *)); /* The functions used to insert and extract complicated operands. */ @@ -71,7 +107,7 @@ insert_d9 (insn, value, errmsg) static unsigned long extract_d9 (insn, invalid) unsigned long insn; - int * invalid; + int * invalid ATTRIBUTE_UNUSED; { unsigned long ret = ((insn & 0xf800) >> 7) | ((insn & 0x0070) >> 3); @@ -103,7 +139,7 @@ insert_d22 (insn, value, errmsg) static unsigned long extract_d22 (insn, invalid) unsigned long insn; - int * invalid; + int * invalid ATTRIBUTE_UNUSED; { signed long ret = ((insn & 0xfffe0000) >> 16) | ((insn & 0x3f) << 16); @@ -132,7 +168,7 @@ insert_d16_15 (insn, value, errmsg) static unsigned long extract_d16_15 (insn, invalid) unsigned long insn; - int * invalid; + int * invalid ATTRIBUTE_UNUSED; { signed long ret = (insn & 0xfffe0000); @@ -163,7 +199,7 @@ insert_d8_7 (insn, value, errmsg) static unsigned long extract_d8_7 (insn, invalid) unsigned long insn; - int * invalid; + int * invalid ATTRIBUTE_UNUSED; { unsigned long ret = (insn & 0x7f); @@ -194,7 +230,7 @@ insert_d8_6 (insn, value, errmsg) static unsigned long extract_d8_6 (insn, invalid) unsigned long insn; - int * invalid; + int * invalid ATTRIBUTE_UNUSED; { unsigned long ret = (insn & 0x7e); @@ -225,7 +261,7 @@ insert_d5_4 (insn, value, errmsg) static unsigned long extract_d5_4 (insn, invalid) unsigned long insn; - int * invalid; + int * invalid ATTRIBUTE_UNUSED; { unsigned long ret = (insn & 0x0f); @@ -247,7 +283,7 @@ insert_d16_16 (insn, value, errmsg) static unsigned long extract_d16_16 (insn, invalid) unsigned long insn; - int * invalid; + int * invalid ATTRIBUTE_UNUSED; { signed long ret = insn & 0xfffe0000; @@ -273,7 +309,7 @@ insert_i9 (insn, value, errmsg) static unsigned long extract_i9 (insn, invalid) unsigned long insn; - int * invalid; + int * invalid ATTRIBUTE_UNUSED; { signed long ret = insn & 0x003c0000; @@ -300,7 +336,7 @@ insert_u9 (insn, value, errmsg) static unsigned long extract_u9 (insn, invalid) unsigned long insn; - int * invalid; + int * invalid ATTRIBUTE_UNUSED; { unsigned long ret = insn & 0x003c0000; @@ -325,8 +361,8 @@ insert_spe (insn, value, errmsg) static unsigned long extract_spe (insn, invalid) - unsigned long insn; - int * invalid; + unsigned long insn ATTRIBUTE_UNUSED; + int * invalid ATTRIBUTE_UNUSED; { return 3; } @@ -355,7 +391,7 @@ insert_i5div (insn, value, errmsg) static unsigned long extract_i5div (insn, invalid) unsigned long insn; - int * invalid; + int * invalid ATTRIBUTE_UNUSED; { unsigned long ret = insn & 0x3c0000; diff -uprN binutils-2.11.90.0.27/opcodes/vax-dis.c binutils-2.11.90.0.29/opcodes/vax-dis.c --- binutils-2.11.90.0.27/opcodes/vax-dis.c Fri Mar 23 13:52:32 2001 +++ binutils-2.11.90.0.29/opcodes/vax-dis.c Mon Aug 27 11:44:52 2001 @@ -21,12 +21,12 @@ Foundation, Inc., 59 Temple Place - Suit #include "dis-asm.h" /* Local function prototypes */ -static int -print_insn_arg PARAMS ((const char *, unsigned char *, bfd_vma, - disassemble_info *)); +static int fetch_data PARAMS ((struct disassemble_info *, bfd_byte *)); +static int print_insn_arg + PARAMS ((const char *, unsigned char *, bfd_vma, disassemble_info *)); +static int print_insn_mode + PARAMS ((int, unsigned char *, bfd_vma, disassemble_info *)); -static int -print_insn_mode PARAMS ((int, unsigned char *, bfd_vma, disassemble_info *)); static char *reg_names[] = { diff -uprN binutils-2.11.90.0.27/opcodes/w65-dis.c binutils-2.11.90.0.29/opcodes/w65-dis.c --- binutils-2.11.90.0.27/opcodes/w65-dis.c Thu Mar 15 14:52:16 2001 +++ binutils-2.11.90.0.29/opcodes/w65-dis.c Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* Disassemble WDC 65816 instructions. - Copyright 1995, 1998, 2000 Free Software Foundation, Inc. + Copyright 1995, 1998, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,6 +26,9 @@ Foundation, Inc., 59 Temple Place - Suit static fprintf_ftype fpr; static void *stream; static struct disassemble_info *local_info; + +static void print_operand PARAMS ((int, char *, unsigned int *)); + #if 0 static char *lname[] = { "r0","r1","r2","r3","r4","r5","r6","r7","s0" }; diff -uprN binutils-2.11.90.0.27/opcodes/z8k-dis.c binutils-2.11.90.0.29/opcodes/z8k-dis.c --- binutils-2.11.90.0.27/opcodes/z8k-dis.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.29/opcodes/z8k-dis.c Mon Aug 27 11:44:52 2001 @@ -1,5 +1,5 @@ /* Disassemble z8000 code. - Copyright 1992, 1993, 1998, 2000 + Copyright 1992, 1993, 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -50,6 +50,9 @@ typedef struct { unsigned long interrupts; } instr_data_s; +static int fetch_data PARAMS ((struct disassemble_info *, int)); + + /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive) to ADDR (exclusive) are valid. Returns 1 for success, longjmps on error. */ @@ -134,6 +137,7 @@ static char *ctrl_names[8] = { }; static int seg_length; +static int print_insn_z8k PARAMS ((bfd_vma, disassemble_info *, int)); int z8k_lookup_instr PARAMS ((unsigned char *, disassemble_info *)); static void output_instr PARAMS ((instr_data_s *, unsigned long, disassemble_info *)); @@ -269,13 +273,12 @@ z8k_lookup_instr (nibbles, info) tabl_index++; } return -1; - } static void output_instr (instr_data, addr, info) instr_data_s *instr_data; - unsigned long addr; + unsigned long addr ATTRIBUTE_UNUSED; disassemble_info *info; { int loop, loop_limit; @@ -334,22 +337,22 @@ unpack_instr (instr_data, is_segmented, switch (datum_value) { case ARG_DISP16: - instr_data->displacement = instr_data->insn_start + 4 + - (signed short) (instr_word & 0xffff); + instr_data->displacement = instr_data->insn_start + 4 + + (signed short) (instr_word & 0xffff); nibl_count += 3; break; case ARG_DISP12: - if (instr_word & 0x800) + if (instr_word & 0x800) { /* neg. 12 bit displacement */ instr_data->displacement = instr_data->insn_start + 2 - (signed short) ((instr_word & 0xfff) | 0xf000) * 2; } - else + else { instr_data->displacement = instr_data->insn_start + 2 - (instr_word & 0x0fff) * 2; - } + } nibl_count += 2; break; default: @@ -411,15 +414,15 @@ unpack_instr (instr_data, is_segmented, FETCH_DATA (info, nibl_count + 8); instr_long = (instr_data->words[nibl_count] << 16) | (instr_data->words[nibl_count + 4]); - instr_data->address = ((instr_word & 0x7f00) << 8) + - (instr_long & 0xffff); + instr_data->address = ((instr_word & 0x7f00) << 8) + + (instr_long & 0xffff); nibl_count += 7; - seg_length = 2; + seg_length = 2; } else { - instr_data->address = ((instr_word & 0x7f00) << 8) + - (instr_word & 0x00ff); + instr_data->address = ((instr_word & 0x7f00) << 8) + + (instr_word & 0x00ff); nibl_count += 3; } } @@ -434,11 +437,13 @@ unpack_instr (instr_data, is_segmented, instr_data->ctrl_code = instr_nibl & 0x7; break; case CLASS_0DISP7: - instr_data->displacement = instr_data->insn_start + 2 - (instr_byte & 0x7f) * 2; + instr_data->displacement = + instr_data->insn_start + 2 - (instr_byte & 0x7f) * 2; nibl_count += 1; break; case CLASS_1DISP7: - instr_data->displacement = instr_data->insn_start + 2 - (instr_byte & 0x7f) * 2; + instr_data->displacement = + instr_data->insn_start + 2 - (instr_byte & 0x7f) * 2; nibl_count += 1; break; case CLASS_01II: @@ -459,12 +464,13 @@ unpack_instr (instr_data, is_segmented, case CLASS_REGN0: instr_data->arg_reg[datum_value] = instr_nibl; break; - case CLASS_DISP8: - instr_data->displacement = instr_data->insn_start + 2 + (signed char)instr_byte * 2; + case CLASS_DISP8: + instr_data->displacement = + instr_data->insn_start + 2 + (signed char) instr_byte * 2; nibl_count += 1; - break; + break; default: - abort (); + abort (); break; } @@ -566,14 +572,14 @@ unparse_instr (instr_data, is_segmented) strcat (out_str, tmp_str); break; case CLASS_PR: - if (is_segmented) - sprintf (tmp_str, "rr%ld", instr_data->arg_reg[datum_value]); - else - sprintf (tmp_str, "r%ld", instr_data->arg_reg[datum_value]); + if (is_segmented) + sprintf (tmp_str, "rr%ld", instr_data->arg_reg[datum_value]); + else + sprintf (tmp_str, "r%ld", instr_data->arg_reg[datum_value]); strcat (out_str, tmp_str); break; default: - abort (); + abort (); break; } }