diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 2002-10-11 09:15:12 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 2002-10-11 09:15:12 +0000 |
commit | 0132d4cb2ae935098c241708e367891c918d6467 (patch) | |
tree | 828df2f84d92f3d966243dfb68017c75b46398dd | |
parent | 03206231152ffe0138bdf8eec9428d8fc12c6ec9 (diff) |
This commit was manufactured by cvs2svn to create tagvendor/binutils/2.13.20021011
'binutils-vendor-binutils_2_13_20021011'.
Notes
Notes:
svn path=/vendor/binutils/dist/; revision=104871
svn path=/vendor/binutils/2.13.20021011/; revision=104873; tag=vendor/binutils/2.13.20021011
148 files changed, 0 insertions, 84363 deletions
diff --git a/contrib/binutils/bfd/VERSION b/contrib/binutils/bfd/VERSION deleted file mode 100644 index dbe590065479..000000000000 --- a/contrib/binutils/bfd/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.8.1 diff --git a/contrib/binutils/bfd/acconfig.h b/contrib/binutils/bfd/acconfig.h deleted file mode 100644 index 1d5e819ec24e..000000000000 --- a/contrib/binutils/bfd/acconfig.h +++ /dev/null @@ -1,34 +0,0 @@ - -/* Name of package. */ -#undef PACKAGE - -/* Version of package. */ -#undef VERSION - -/* Whether strstr must be declared even if <string.h> is included. */ -#undef NEED_DECLARATION_STRSTR - -/* Whether malloc must be declared even if <stdlib.h> is included. */ -#undef NEED_DECLARATION_MALLOC - -/* Whether realloc must be declared even if <stdlib.h> is included. */ -#undef NEED_DECLARATION_REALLOC - -/* Whether free must be declared even if <stdlib.h> is included. */ -#undef NEED_DECLARATION_FREE - -/* Whether getenv must be declared even if <stdlib.h> is included. */ -#undef NEED_DECLARATION_GETENV -@TOP@ - -/* Do we need to use the b modifier when opening binary files? */ -#undef USE_BINARY_FOPEN - -/* Name of host specific header file to include in trad-core.c. */ -#undef TRAD_HEADER - -/* Define only if <sys/procfs.h> is available *and* it defines prstatus_t. */ -#undef HAVE_SYS_PROCFS_H - -/* Do we really want to use mmap if it's available? */ -#undef USE_MMAP diff --git a/contrib/binutils/bfd/aout-tic30.c b/contrib/binutils/bfd/aout-tic30.c deleted file mode 100644 index e3c74faf0534..000000000000 --- a/contrib/binutils/bfd/aout-tic30.c +++ /dev/null @@ -1,1089 +0,0 @@ -/* BFD back-end for TMS320C30 a.out binaries. - 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. - - 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. */ - -#define TARGET_IS_BIG_ENDIAN_P -#define N_HEADER_IN_TEXT(x) 1 -#define BYTES_IN_WORD 4 -#define TEXT_START_ADDR 1024 -#define TARGET_PAGE_SIZE 128 -#define SEGMENT_SIZE TARGET_PAGE_SIZE -#define DEFAULT_ARCH bfd_arch_tic30 -#define ARCH_SIZE 32 - -/* Do not "beautify" the CONCAT* macro args. Traditional C will not - remove whitespace added here, and thus will fail to concatenate - the tokens. */ -#define MY(OP) CONCAT2 (tic30_aout_,OP) -#define TARGETNAME "a.out-tic30" -#define NAME(x,y) CONCAT3 (tic30_aout,_32_,y) - -#include "bfd.h" -#include "sysdep.h" -#include "libaout.h" - -#include "aout/aout64.h" -#include "aout/stab_gnu.h" -#include "aout/ar.h" - -static bfd_reloc_status_type tic30_aout_fix_16 - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type tic30_aout_fix_32 - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type tic30_aout_fix_pcrel_16 - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static reloc_howto_type *tic30_aout_reloc_howto - PARAMS ((bfd *, struct reloc_std_external *, int *, int *, int *)); -static bfd_reloc_status_type tic30_aout_relocate_contents - PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *)); -static bfd_reloc_status_type tic30_aout_final_link_relocate - PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma, - bfd_vma, bfd_vma)); -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 -#define MY_object_p tic30_aout_object_p -#define MY_mkobject NAME(aout,mkobject) -#define MY_write_object_contents tic30_aout_write_object_contents -#define MY_set_sizes tic30_aout_set_sizes - -#ifndef MY_exec_hdr_flags -#define MY_exec_hdr_flags 1 -#endif - -#ifndef MY_backend_data - -#ifndef MY_zmagic_contiguous -#define MY_zmagic_contiguous 0 -#endif -#ifndef MY_text_includes_header -#define MY_text_includes_header 0 -#endif -#ifndef MY_entry_is_text_address -#define MY_entry_is_text_address 0 -#endif -#ifndef MY_exec_header_not_counted -#define MY_exec_header_not_counted 1 -#endif -#ifndef MY_add_dynamic_symbols -#define MY_add_dynamic_symbols 0 -#endif -#ifndef MY_add_one_symbol -#define MY_add_one_symbol 0 -#endif -#ifndef MY_link_dynamic_object -#define MY_link_dynamic_object 0 -#endif -#ifndef MY_write_dynamic_symbol -#define MY_write_dynamic_symbol 0 -#endif -#ifndef MY_check_dynamic_reloc -#define MY_check_dynamic_reloc 0 -#endif -#ifndef MY_finish_dynamic_link -#define MY_finish_dynamic_link 0 -#endif - -static const struct aout_backend_data tic30_aout_backend_data = -{ - MY_zmagic_contiguous, - MY_text_includes_header, - MY_entry_is_text_address, - MY_exec_hdr_flags, - 0, /* text vma? */ - MY_set_sizes, - MY_exec_header_not_counted, - MY_add_dynamic_symbols, - MY_add_one_symbol, - MY_link_dynamic_object, - MY_write_dynamic_symbol, - MY_check_dynamic_reloc, - MY_finish_dynamic_link -}; -#define MY_backend_data &tic30_aout_backend_data -#endif - -/* FIXME: This is wrong. aoutx.h should really only be included by - aout32.c. */ - -#include "aoutx.h" - -/* This table lists the relocation types for the TMS320C30. There are - only a few relocations required, and all must be divided by 4 (>> - 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) - }; - -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) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; -{ - switch (code) - { - case BFD_RELOC_8: - case BFD_RELOC_TIC30_LDP: - return &tic30_aout_howto_table[3]; - case BFD_RELOC_16: - return &tic30_aout_howto_table[1]; - case BFD_RELOC_24: - return &tic30_aout_howto_table[2]; - case BFD_RELOC_16_PCREL: - return &tic30_aout_howto_table[5]; - case BFD_RELOC_32: - return &tic30_aout_howto_table[4]; - default: - return (reloc_howto_type *) NULL; - } -} - -static reloc_howto_type * -tic30_aout_reloc_howto (abfd, relocs, r_index, r_extern, r_pcrel) - bfd *abfd; - struct reloc_std_external *relocs; - int *r_index; - int *r_extern; - int *r_pcrel; -{ - unsigned int r_length; - unsigned int r_pcrel_done; - int index; - - *r_pcrel = 0; - if (bfd_header_big_endian (abfd)) - { - *r_index = ((relocs->r_index[0] << 16) | (relocs->r_index[1] << 8) | relocs->r_index[2]); - *r_extern = (0 != (relocs->r_type[0] & RELOC_STD_BITS_EXTERN_BIG)); - r_pcrel_done = (0 != (relocs->r_type[0] & RELOC_STD_BITS_PCREL_BIG)); - r_length = ((relocs->r_type[0] & RELOC_STD_BITS_LENGTH_BIG) >> RELOC_STD_BITS_LENGTH_SH_BIG); - } - else - { - *r_index = ((relocs->r_index[2] << 16) | (relocs->r_index[1] << 8) | relocs->r_index[0]); - *r_extern = (0 != (relocs->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE)); - r_pcrel_done = (0 != (relocs->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE)); - r_length = ((relocs->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE) >> RELOC_STD_BITS_LENGTH_SH_LITTLE); - } - index = r_length + 4 * r_pcrel_done; - return tic30_aout_howto_table + index; -} - -/* This function is used as a callback for 16-bit relocs. This is - required for relocations between segments. A line in aoutx.h - requires that any relocations for the data section should point to - the end of the aligned text section, plus an offset. By default, - this does not happen, therefore this function takes care of - that. */ - -static bfd_reloc_status_type -tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section ATTRIBUTE_UNUSED; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - bfd_vma relocation; - - /* Make sure that the symbol's section is defined. */ - if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) - return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined; - /* Get the size of the input section and turn it into the TMS320C30 - 32-bit address format. */ - relocation = (symbol->section->vma >> 2); - relocation += bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); - bfd_put_16 (abfd, relocation, (bfd_byte *) data + reloc_entry->address); - return bfd_reloc_ok; -} - -/* This function does the same thing as tic30_aout_fix_16 except for 32 - bit relocations. */ - -static bfd_reloc_status_type -tic30_aout_fix_32 (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section ATTRIBUTE_UNUSED; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - bfd_vma relocation; - - /* Make sure that the symbol's section is defined. */ - if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) - return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined; - /* Get the size of the input section and turn it into the TMS320C30 - 32-bit address format. */ - relocation = (symbol->section->vma >> 2); - relocation += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - bfd_put_32 (abfd, relocation, (bfd_byte *) data + reloc_entry->address); - return bfd_reloc_ok; -} - -/* This function is used to work out pc-relative offsets for the - TMS320C30. The data already placed by md_pcrel_from within gas is - useless for a relocation, so we just get the offset value and place - a version of this within the object code. - tic30_aout_final_link_relocate will then calculate the required - relocation to add on to the value in the object code. */ - -static bfd_reloc_status_type -tic30_aout_fix_pcrel_16 (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol ATTRIBUTE_UNUSED; - PTR data; - asection *input_section ATTRIBUTE_UNUSED; - bfd *output_bfd ATTRIBUTE_UNUSED; - char **error_message ATTRIBUTE_UNUSED; -{ - bfd_vma relocation = 1; - bfd_byte offset_data = bfd_get_8 (abfd, (bfd_byte *) data + reloc_entry->address - 1); - - /* The byte before the location of the fix contains bits 23-16 of - the pcrel instruction. Bit 21 is set for a delayed instruction - which requires on offset of 3 instead of 1. */ - if (offset_data & 0x20) - relocation -= 3; - else - relocation -= 1; - bfd_put_16 (abfd, relocation, (bfd_byte *) data + reloc_entry->address); - return bfd_reloc_ok; -} - -/* These macros will get 24-bit values from the bfd definition. - Big-endian only. */ -#define bfd_getb_24(BFD,ADDR) \ - (bfd_get_8 (BFD, ADDR ) << 16) | \ - (bfd_get_8 (BFD, ADDR + 1) << 8) | \ - (bfd_get_8 (BFD, ADDR + 2) ) - -#define bfd_putb_24(BFD,DATA,ADDR) \ - bfd_put_8 (BFD, (bfd_byte) ((DATA >> 16) & 0xFF), ADDR ); \ - bfd_put_8 (BFD, (bfd_byte) ((DATA >> 8) & 0xFF), ADDR + 1); \ - bfd_put_8 (BFD, (bfd_byte) ( DATA & 0xFF), ADDR + 2) - -/* Set parameters about this a.out file that are machine-dependent. - This routine is called from some_aout_object_p just before it returns. */ - -static const bfd_target * -tic30_aout_callback (abfd) - bfd *abfd; -{ - struct internal_exec *execp = exec_hdr (abfd); - unsigned int arch_align_power; - unsigned long arch_align; - - /* 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. */ - obj_textsec (abfd)->vma = N_TXTADDR (*execp); - obj_datasec (abfd)->vma = N_DATADDR (*execp); - obj_bsssec (abfd)->vma = N_BSSADDR (*execp); - - obj_textsec (abfd)->lma = obj_textsec (abfd)->vma; - obj_datasec (abfd)->lma = obj_datasec (abfd)->vma; - obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma; - - /* 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. */ - obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp); - obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp); - - /* The file offsets of the string table and symbol table. */ - obj_sym_filepos (abfd) = N_SYMOFF (*execp); - obj_str_filepos (abfd) = N_STROFF (*execp); - - /* Determine the architecture and machine type of the object file. */ -#ifdef SET_ARCH_MACH - SET_ARCH_MACH (abfd, *execp); -#else - bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0L); -#endif - - /* Now that we know the architecture, set the alignments of the - sections. This is normally done by NAME(aout,new_section_hook), - but when the initial sections were created the architecture had - not yet been set. However, for backward compatibility, we don't - set the alignment power any higher than as required by the size - of the section. */ - arch_align_power = bfd_get_arch_info (abfd)->section_align_power; - arch_align = 1 << arch_align_power; - if ((BFD_ALIGN (obj_textsec (abfd)->_raw_size, arch_align) - == obj_textsec (abfd)->_raw_size) - && (BFD_ALIGN (obj_datasec (abfd)->_raw_size, arch_align) - == obj_datasec (abfd)->_raw_size) - && (BFD_ALIGN (obj_bsssec (abfd)->_raw_size, arch_align) - == obj_bsssec (abfd)->_raw_size)) - { - obj_textsec (abfd)->alignment_power = arch_align_power; - obj_datasec (abfd)->alignment_power = arch_align_power; - obj_bsssec (abfd)->alignment_power = arch_align_power; - } - return abfd->xvec; -} - -static bfd_reloc_status_type -tic30_aout_final_link_relocate (howto, input_bfd, input_section, contents, - address, value, addend) - reloc_howto_type *howto; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - bfd_vma address; - bfd_vma value; - bfd_vma addend; -{ - bfd_vma relocation; - - if (address > input_section->_raw_size) - return bfd_reloc_outofrange; - - relocation = value + addend; - if (howto->pc_relative) - { - relocation -= (input_section->output_section->vma + input_section->output_offset); - if (howto->pcrel_offset) - relocation -= address; - } - return tic30_aout_relocate_contents (howto, input_bfd, relocation, - contents + address); -} - -bfd_reloc_status_type -tic30_aout_relocate_contents (howto, input_bfd, relocation, location) - reloc_howto_type *howto; - bfd *input_bfd; - bfd_vma relocation; - bfd_byte *location; -{ - bfd_vma x; - boolean overflow; - - if (howto->size < 0) - relocation = -relocation; - - switch (howto->size) - { - default: - case 0: - abort (); - break; - case 1: - x = bfd_get_16 (input_bfd, location); - break; - case 2: - x = bfd_getb_24 (input_bfd, location); - break; - case 3: - x = bfd_get_8 (input_bfd, location); - break; - case 4: - x = bfd_get_32 (input_bfd, location); - break; - } - - overflow = false; - - if (howto->complain_on_overflow != complain_overflow_dont) - { - bfd_vma check; - bfd_signed_vma signed_check; - bfd_vma add; - bfd_signed_vma signed_add; - - if (howto->rightshift == 0) - { - check = relocation; - signed_check = (bfd_signed_vma) relocation; - } - else - { - check = relocation >> howto->rightshift; - if ((bfd_signed_vma) relocation >= 0) - signed_check = check; - else - signed_check = (check | ((bfd_vma) - 1 & ~((bfd_vma) - 1 >> howto->rightshift))); - } - add = x & howto->src_mask; - signed_add = add; - if ((add & (((~howto->src_mask) >> 1) & howto->src_mask)) != 0) - signed_add -= (((~howto->src_mask) >> 1) & howto->src_mask) << 1; - if (howto->bitpos == 0) - { - check += add; - signed_check += signed_add; - } - else - { - check += add >> howto->bitpos; - if (signed_add >= 0) - signed_check += add >> howto->bitpos; - else - signed_check += ((add >> howto->bitpos) | ((bfd_vma) - 1 & ~((bfd_vma) - 1 >> howto->bitpos))); - } - switch (howto->complain_on_overflow) - { - case complain_overflow_signed: - { - bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1; - bfd_signed_vma reloc_signed_min = ~reloc_signed_max; - if (signed_check > reloc_signed_max || signed_check < reloc_signed_min) - overflow = true; - } - break; - case complain_overflow_unsigned: - { - bfd_vma reloc_unsigned_max = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1; - if (check > reloc_unsigned_max) - overflow = true; - } - break; - case complain_overflow_bitfield: - { - bfd_vma reloc_bits = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1; - if ((check & ~reloc_bits) != 0 - && (((bfd_vma) signed_check & ~reloc_bits) - != ((bfd_vma) -1 & ~reloc_bits))) - overflow = true; - } - break; - default: - abort (); - } - } - relocation >>= (bfd_vma) howto->rightshift; - relocation <<= (bfd_vma) howto->bitpos; - x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask)); - switch (howto->size) - { - default: - case 0: - abort (); - break; - case 1: - bfd_put_16 (input_bfd, x, location); - break; - case 2: - bfd_putb_24 (input_bfd, x, location); - break; - case 3: - bfd_put_8 (input_bfd, x, location); - break; - case 4: - bfd_put_32 (input_bfd, x, location); - break; - } - return overflow ? bfd_reloc_overflow : bfd_reloc_ok; -} - -/* 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. */ - const bfd_target *target; - bfd_size_type amt = EXEC_BYTES_SIZE; - - if (bfd_bread ((PTR) &exec_bytes, amt, abfd) != amt) - { - if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return 0; - } - -#ifdef SWAP_MAGIC - exec.a_info = SWAP_MAGIC (exec_bytes.e_info); -#else - exec.a_info = H_GET_32 (abfd, exec_bytes.e_info); -#endif /* SWAP_MAGIC */ - - if (N_BADMAG (exec)) - return 0; -#ifdef MACHTYPE_OK - if (!(MACHTYPE_OK (N_MACHTYPE (exec)))) - return 0; -#endif - - NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec); - -#ifdef SWAP_MAGIC - /* swap_exec_header_in read in a_info with the wrong byte order */ - exec.a_info = SWAP_MAGIC (exec_bytes.e_info); -#endif /* SWAP_MAGIC */ - - target = NAME (aout, some_aout_object_p) (abfd, &exec, tic30_aout_callback); - -#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. */ - - if (exec.a_trsize + exec.a_drsize == 0 - && bfd_get_format (abfd) == bfd_object && abfd->my_archive == NULL) - { - struct stat buf; -#ifndef S_IXUSR -#define S_IXUSR 0100 /* Execute by owner. */ -#endif - if (stat (abfd->filename, &buf) == 0 && (buf.st_mode & S_IXUSR)) - abfd->flags |= EXEC_P; - } -#endif /* ENTRY_CAN_BE_ZERO */ - - return target; -} - -/* Copy private section data. This actually does nothing with the - sections. It copies the subformat field. We copy it here, because - we need to know whether this is a QMAGIC file before we set the - section contents, and copy_private_bfd_data is not called until - after the section contents have been set. */ - -static boolean -MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) - bfd *ibfd; - asection *isec ATTRIBUTE_UNUSED; - bfd *obfd; - asection *osec ATTRIBUTE_UNUSED; -{ - if (bfd_get_flavour (obfd) == bfd_target_aout_flavour) - obj_aout_subformat (obfd) = obj_aout_subformat (ibfd); - return true; -} - -/* Write an object file. - Section contents have already been written. We write the - file header, symbols, and relocation. */ - -static boolean -tic30_aout_write_object_contents (abfd) - bfd *abfd; -{ - struct external_exec exec_bytes; - struct internal_exec *execp = exec_hdr (abfd); - - obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; - - { - 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); - - execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE; - execp->a_entry = bfd_get_start_address (abfd); - - execp->a_trsize = ((obj_textsec (abfd)->reloc_count) * obj_reloc_entry_size (abfd)); - execp->a_drsize = ((obj_datasec (abfd)->reloc_count) * obj_reloc_entry_size (abfd)); - NAME (aout, swap_exec_header_out) (abfd, execp, &exec_bytes); - - if (adata (abfd).exec_bytes_size > 0) - { - bfd_size_type amt; - if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) - return false; - amt = adata (abfd).exec_bytes_size; - if (bfd_bwrite ((PTR) &exec_bytes, amt, abfd) != amt) - return false; - } - - /* Now write out reloc info, followed by syms and strings. */ - if (bfd_get_outsymbols (abfd) != (asymbol **) NULL - && bfd_get_symcount (abfd) != 0) - { - if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*execp)), SEEK_SET) != 0) - return false; - - if (!NAME (aout, write_syms) (abfd)) - return false; - } - - if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*execp)), SEEK_SET) != 0) - return false; - if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd))) - return false; - - if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*execp)), SEEK_SET) != 0) - return false; - if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd))) - return false; - } - - return true; -} - -static boolean -tic30_aout_set_sizes (abfd) - bfd *abfd; -{ - adata (abfd).page_size = TARGET_PAGE_SIZE; - -#ifdef SEGMENT_SIZE - adata (abfd).segment_size = SEGMENT_SIZE; -#else - adata (abfd).segment_size = TARGET_PAGE_SIZE; -#endif - -#ifdef ZMAGIC_DISK_BLOCK_SIZE - adata (abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE; -#else - adata (abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE; -#endif - - adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE; - - return true; -} - -#ifndef MY_final_link_callback - -/* Callback for the final_link routine to set the section offsets. */ - -static void MY_final_link_callback - PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *)); - -static void -MY_final_link_callback (abfd, ptreloff, pdreloff, psymoff) - bfd *abfd; - file_ptr *ptreloff; - file_ptr *pdreloff; - file_ptr *psymoff; -{ - struct internal_exec *execp = exec_hdr (abfd); - - *ptreloff = obj_datasec (abfd)->filepos + execp->a_data; - *pdreloff = *ptreloff + execp->a_trsize; - *psymoff = *pdreloff + execp->a_drsize;; -} - -#endif - -#ifndef MY_bfd_final_link - -/* Final link routine. We need to use a call back to get the correct - offsets in the output file. */ - -static boolean -MY_bfd_final_link (abfd, info) - bfd *abfd; - struct bfd_link_info *info; -{ - struct internal_exec *execp = exec_hdr (abfd); - file_ptr pos; - bfd_vma vma = 0; - int pad; - - /* Set the executable header size to 0, as we don't want one for an - output. */ - adata (abfd).exec_bytes_size = 0; - pos = adata (abfd).exec_bytes_size; - /* Text. */ - vma = info->create_object_symbols_section->vma; - pos += vma; - obj_textsec (abfd)->filepos = pos; - obj_textsec (abfd)->vma = vma; - obj_textsec (abfd)->user_set_vma = 1; - pos += obj_textsec (abfd)->_raw_size; - vma += obj_textsec (abfd)->_raw_size; - - /* Data. */ - if (abfd->flags & D_PAGED) - { - if (info->create_object_symbols_section->next->vma > 0) - obj_datasec (abfd)->vma = info->create_object_symbols_section->next->vma; - else - obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size); - } - else - { - 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)->user_set_vma = 1; - vma = obj_datasec (abfd)->vma; - obj_datasec (abfd)->filepos = vma + adata (abfd).exec_bytes_size; - execp->a_text = vma - obj_textsec (abfd)->vma; - obj_textsec (abfd)->_raw_size = execp->a_text; - - /* Since BSS follows data immediately, see if it needs alignment. */ - vma += obj_datasec (abfd)->_raw_size; - pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma; - obj_datasec (abfd)->_raw_size += pad; - pos += obj_datasec (abfd)->_raw_size; - execp->a_data = obj_datasec (abfd)->_raw_size; - - /* BSS. */ - obj_bsssec (abfd)->vma = vma; - obj_bsssec (abfd)->user_set_vma = 1; - - /* We are fully resized, so don't readjust in final_link. */ - adata (abfd).magic = z_magic; - - return NAME (aout, final_link) (abfd, info, MY_final_link_callback); -} - -#endif - -enum machine_type -tic30_aout_machine_type (arch, machine, unknown) - enum bfd_architecture arch; - unsigned long machine ATTRIBUTE_UNUSED; - boolean *unknown; -{ - enum machine_type arch_flags; - - arch_flags = M_UNKNOWN; - *unknown = true; - - switch (arch) - { - case bfd_arch_tic30: - *unknown = false; - break; - default: - arch_flags = M_UNKNOWN; - } - if (arch_flags != M_UNKNOWN) - *unknown = false; - return arch_flags; -} - -boolean -tic30_aout_set_arch_mach (abfd, arch, machine) - bfd *abfd; - enum bfd_architecture arch; - unsigned long machine; -{ - if (!bfd_default_set_arch_mach (abfd, arch, machine)) - return false; - if (arch != bfd_arch_unknown) - { - boolean unknown; - tic30_aout_machine_type (arch, machine, &unknown); - if (unknown) - return false; - } - obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; - return (*aout_backend_info (abfd)->set_sizes) (abfd); -} - -/* We assume BFD generic archive files. */ -#ifndef MY_openr_next_archived_file -#define MY_openr_next_archived_file bfd_generic_openr_next_archived_file -#endif -#ifndef MY_get_elt_at_index -#define MY_get_elt_at_index _bfd_generic_get_elt_at_index -#endif -#ifndef MY_generic_stat_arch_elt -#define MY_generic_stat_arch_elt bfd_generic_stat_arch_elt -#endif -#ifndef MY_slurp_armap -#define MY_slurp_armap bfd_slurp_bsd_armap -#endif -#ifndef MY_slurp_extended_name_table -#define MY_slurp_extended_name_table _bfd_slurp_extended_name_table -#endif -#ifndef MY_construct_extended_name_table -#define MY_construct_extended_name_table \ - _bfd_archive_bsd_construct_extended_name_table -#endif -#ifndef MY_write_armap -#define MY_write_armap bsd_write_armap -#endif -#ifndef MY_read_ar_hdr -#define MY_read_ar_hdr _bfd_generic_read_ar_hdr -#endif -#ifndef MY_truncate_arname -#define MY_truncate_arname bfd_bsd_truncate_arname -#endif -#ifndef MY_update_armap_timestamp -#define MY_update_armap_timestamp _bfd_archive_bsd_update_armap_timestamp -#endif - -/* No core file defined here -- configure in trad-core.c separately. */ -#ifndef MY_core_file_failing_command -#define MY_core_file_failing_command _bfd_nocore_core_file_failing_command -#endif -#ifndef MY_core_file_failing_signal -#define MY_core_file_failing_signal _bfd_nocore_core_file_failing_signal -#endif -#ifndef MY_core_file_matches_executable_p -#define MY_core_file_matches_executable_p \ - _bfd_nocore_core_file_matches_executable_p -#endif -#ifndef MY_core_file_p -#define MY_core_file_p _bfd_dummy_target -#endif - -#ifndef MY_bfd_debug_info_start -#define MY_bfd_debug_info_start bfd_void -#endif -#ifndef MY_bfd_debug_info_end -#define MY_bfd_debug_info_end bfd_void -#endif -#ifndef MY_bfd_debug_info_accumulate -#define MY_bfd_debug_info_accumulate \ - (void (*) PARAMS ((bfd*, struct sec *))) bfd_void -#endif - -#ifndef MY_core_file_failing_command -#define MY_core_file_failing_command NAME(aout,core_file_failing_command) -#endif -#ifndef MY_core_file_failing_signal -#define MY_core_file_failing_signal NAME(aout,core_file_failing_signal) -#endif -#ifndef MY_core_file_matches_executable_p -#define MY_core_file_matches_executable_p NAME(aout,core_file_matches_executable_p) -#endif -#ifndef MY_set_section_contents -#define MY_set_section_contents NAME(aout,set_section_contents) -#endif -#ifndef MY_get_section_contents -#define MY_get_section_contents aout_32_get_section_contents -#endif -#ifndef MY_get_section_contents_in_window -#define MY_get_section_contents_in_window _bfd_generic_get_section_contents_in_window -#endif -#ifndef MY_new_section_hook -#define MY_new_section_hook NAME(aout,new_section_hook) -#endif -#ifndef MY_get_symtab_upper_bound -#define MY_get_symtab_upper_bound NAME(aout,get_symtab_upper_bound) -#endif -#ifndef MY_get_symtab -#define MY_get_symtab NAME(aout,get_symtab) -#endif -#ifndef MY_get_reloc_upper_bound -#define MY_get_reloc_upper_bound NAME(aout,get_reloc_upper_bound) -#endif -#ifndef MY_canonicalize_reloc -#define MY_canonicalize_reloc NAME(aout,canonicalize_reloc) -#endif -#ifndef MY_make_empty_symbol -#define MY_make_empty_symbol NAME(aout,make_empty_symbol) -#endif -#ifndef MY_print_symbol -#define MY_print_symbol NAME(aout,print_symbol) -#endif -#ifndef MY_get_symbol_info -#define MY_get_symbol_info NAME(aout,get_symbol_info) -#endif -#ifndef MY_get_lineno -#define MY_get_lineno NAME(aout,get_lineno) -#endif -#ifndef MY_set_arch_mach -#define MY_set_arch_mach tic30_aout_set_arch_mach -#endif -#ifndef MY_find_nearest_line -#define MY_find_nearest_line NAME(aout,find_nearest_line) -#endif -#ifndef MY_sizeof_headers -#define MY_sizeof_headers NAME(aout,sizeof_headers) -#endif -#ifndef MY_bfd_get_relocated_section_contents -#define MY_bfd_get_relocated_section_contents \ - bfd_generic_get_relocated_section_contents -#endif -#ifndef MY_bfd_relax_section -#define MY_bfd_relax_section bfd_generic_relax_section -#endif -#ifndef MY_bfd_gc_sections -#define MY_bfd_gc_sections bfd_generic_gc_sections -#endif -#ifndef MY_bfd_merge_sections -#define MY_bfd_merge_sections bfd_generic_merge_sections -#endif -#ifndef MY_bfd_reloc_type_lookup -#define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup -#endif -#ifndef MY_bfd_make_debug_symbol -#define MY_bfd_make_debug_symbol 0 -#endif -#ifndef MY_read_minisymbols -#define MY_read_minisymbols NAME(aout,read_minisymbols) -#endif -#ifndef MY_minisymbol_to_symbol -#define MY_minisymbol_to_symbol NAME(aout,minisymbol_to_symbol) -#endif -#ifndef MY_bfd_link_hash_table_create -#define MY_bfd_link_hash_table_create NAME(aout,link_hash_table_create) -#endif -#ifndef MY_bfd_link_add_symbols -#define MY_bfd_link_add_symbols NAME(aout,link_add_symbols) -#endif -#ifndef MY_bfd_link_split_section -#define MY_bfd_link_split_section _bfd_generic_link_split_section -#endif - -#ifndef MY_bfd_copy_private_bfd_data -#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data -#endif - -#ifndef MY_bfd_merge_private_bfd_data -#define MY_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data -#endif - -#ifndef MY_bfd_copy_private_symbol_data -#define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data -#endif - -#ifndef MY_bfd_print_private_bfd_data -#define MY_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data -#endif - -#ifndef MY_bfd_set_private_flags -#define MY_bfd_set_private_flags _bfd_generic_bfd_set_private_flags -#endif - -#ifndef MY_bfd_is_local_label_name -#define MY_bfd_is_local_label_name bfd_generic_is_local_label_name -#endif - -#ifndef MY_bfd_free_cached_info -#define MY_bfd_free_cached_info NAME(aout,bfd_free_cached_info) -#endif - -#ifndef MY_close_and_cleanup -#define MY_close_and_cleanup MY_bfd_free_cached_info -#endif - -#ifndef MY_get_dynamic_symtab_upper_bound -#define MY_get_dynamic_symtab_upper_bound \ - _bfd_nodynamic_get_dynamic_symtab_upper_bound -#endif -#ifndef MY_canonicalize_dynamic_symtab -#define MY_canonicalize_dynamic_symtab \ - _bfd_nodynamic_canonicalize_dynamic_symtab -#endif -#ifndef MY_get_dynamic_reloc_upper_bound -#define MY_get_dynamic_reloc_upper_bound \ - _bfd_nodynamic_get_dynamic_reloc_upper_bound -#endif -#ifndef MY_canonicalize_dynamic_reloc -#define MY_canonicalize_dynamic_reloc \ - _bfd_nodynamic_canonicalize_dynamic_reloc -#endif - -/* Aout symbols normally have leading underscores */ -#ifndef MY_symbol_leading_char -#define MY_symbol_leading_char '_' -#endif - -/* Aout archives normally use spaces for padding */ -#ifndef AR_PAD_CHAR -#define AR_PAD_CHAR ' ' -#endif - -#ifndef MY_BFD_TARGET -const bfd_target tic30_aout_vec = -{ - TARGETNAME, /* name */ - bfd_target_aout_flavour, - BFD_ENDIAN_BIG, /* target byte order (big) */ - BFD_ENDIAN_BIG, /* target headers byte order (big) */ - (HAS_RELOC | /* object flags */ - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 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), - - NULL, - - (PTR) MY_backend_data -}; -#endif /* MY_BFD_TARGET */ diff --git a/contrib/binutils/bfd/coff-mips.c b/contrib/binutils/bfd/coff-mips.c deleted file mode 100644 index 672b07f7762b..000000000000 --- a/contrib/binutils/bfd/coff-mips.c +++ /dev/null @@ -1,2736 +0,0 @@ -/* BFD back-end for MIPS Extended-Coff files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001 - Free Software Foundation, Inc. - Original version by Per Bothner. - Full support added by Ian Lance Taylor, ian@cygnus.com. - -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. */ - -#include "bfd.h" -#include "sysdep.h" -#include "bfdlink.h" -#include "libbfd.h" -#include "coff/internal.h" -#include "coff/sym.h" -#include "coff/symconst.h" -#include "coff/ecoff.h" -#include "coff/mips.h" -#include "libcoff.h" -#include "libecoff.h" - -/* Prototypes for static functions. */ - -static boolean mips_ecoff_bad_format_hook PARAMS ((bfd *abfd, PTR filehdr)); -static void mips_ecoff_swap_reloc_in PARAMS ((bfd *, PTR, - struct internal_reloc *)); -static void mips_ecoff_swap_reloc_out PARAMS ((bfd *, - const struct internal_reloc *, - PTR)); -static void mips_adjust_reloc_in PARAMS ((bfd *, - const struct internal_reloc *, - arelent *)); -static void mips_adjust_reloc_out PARAMS ((bfd *, const arelent *, - struct internal_reloc *)); -static bfd_reloc_status_type mips_generic_reloc PARAMS ((bfd *abfd, - arelent *reloc, - asymbol *symbol, - PTR data, - asection *section, - bfd *output_bfd, - char **error)); -static bfd_reloc_status_type mips_refhi_reloc PARAMS ((bfd *abfd, - arelent *reloc, - asymbol *symbol, - PTR data, - asection *section, - bfd *output_bfd, - char **error)); -static bfd_reloc_status_type mips_reflo_reloc PARAMS ((bfd *abfd, - arelent *reloc, - asymbol *symbol, - PTR data, - asection *section, - bfd *output_bfd, - char **error)); -static bfd_reloc_status_type mips_gprel_reloc PARAMS ((bfd *abfd, - arelent *reloc, - asymbol *symbol, - PTR data, - asection *section, - bfd *output_bfd, - char **error)); -static bfd_reloc_status_type mips_relhi_reloc PARAMS ((bfd *abfd, - arelent *reloc, - asymbol *symbol, - PTR data, - asection *section, - bfd *output_bfd, - char **error)); -static bfd_reloc_status_type mips_rello_reloc PARAMS ((bfd *abfd, - arelent *reloc, - asymbol *symbol, - PTR data, - asection *section, - bfd *output_bfd, - char **error)); -static bfd_reloc_status_type mips_switch_reloc PARAMS ((bfd *abfd, - arelent *reloc, - asymbol *symbol, - PTR data, - asection *section, - bfd *output_bfd, - char **error)); -static void mips_relocate_hi PARAMS ((struct internal_reloc *refhi, - struct internal_reloc *reflo, - bfd *input_bfd, - asection *input_section, - bfd_byte *contents, - size_t adjust, - bfd_vma relocation, - boolean pcrel)); -static boolean mips_relocate_section PARAMS ((bfd *, struct bfd_link_info *, - bfd *, asection *, - bfd_byte *, PTR)); -static boolean mips_read_relocs PARAMS ((bfd *, asection *)); -static boolean mips_relax_section PARAMS ((bfd *, asection *, - struct bfd_link_info *, - boolean *)); -static boolean mips_relax_pcrel16 PARAMS ((struct bfd_link_info *, bfd *, - asection *, - struct ecoff_link_hash_entry *, - bfd_byte *, bfd_vma)); -static reloc_howto_type *mips_bfd_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); - -/* ECOFF has COFF sections, but the debugging information is stored in - a completely different format. ECOFF targets use some of the - swapping routines from coffswap.h, and some of the generic COFF - routines in coffgen.c, but, unlike the real COFF targets, do not - use coffcode.h itself. - - Get the generic COFF swapping routines, except for the reloc, - symbol, and lineno ones. Give them ECOFF names. */ -#define MIPSECOFF -#define NO_COFF_RELOCS -#define NO_COFF_SYMBOLS -#define NO_COFF_LINENOS -#define coff_swap_filehdr_in mips_ecoff_swap_filehdr_in -#define coff_swap_filehdr_out mips_ecoff_swap_filehdr_out -#define coff_swap_aouthdr_in mips_ecoff_swap_aouthdr_in -#define coff_swap_aouthdr_out mips_ecoff_swap_aouthdr_out -#define coff_swap_scnhdr_in mips_ecoff_swap_scnhdr_in -#define coff_swap_scnhdr_out mips_ecoff_swap_scnhdr_out -#include "coffswap.h" - -/* Get the ECOFF swapping routines. */ -#define ECOFF_32 -#include "ecoffswap.h" - -/* How to process the various relocs types. */ - -static reloc_howto_type mips_howto_table[] = -{ - /* Reloc type 0 is ignored. The reloc reading code ensures that - this is a reference to the .abs section, which will cause - bfd_perform_relocation to do nothing. */ - HOWTO (MIPS_R_IGNORE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - 0, /* special_function */ - "IGNORE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 16 bit reference to a symbol, normally from a data section. */ - HOWTO (MIPS_R_REFHALF, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - mips_generic_reloc, /* special_function */ - "REFHALF", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 32 bit reference to a symbol, normally from a data section. */ - HOWTO (MIPS_R_REFWORD, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - mips_generic_reloc, /* special_function */ - "REFWORD", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 26 bit absolute jump address. */ - HOWTO (MIPS_R_JMPADDR, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - /* This needs complex overflow - detection, because the upper four - bits must match the PC. */ - mips_generic_reloc, /* special_function */ - "JMPADDR", /* name */ - true, /* partial_inplace */ - 0x3ffffff, /* src_mask */ - 0x3ffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* The high 16 bits of a symbol value. Handled by the function - mips_refhi_reloc. */ - HOWTO (MIPS_R_REFHI, /* type */ - 16, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - mips_refhi_reloc, /* special_function */ - "REFHI", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* The low 16 bits of a symbol value. */ - HOWTO (MIPS_R_REFLO, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - mips_reflo_reloc, /* special_function */ - "REFLO", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* A reference to an offset from the gp register. Handled by the - function mips_gprel_reloc. */ - HOWTO (MIPS_R_GPREL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - mips_gprel_reloc, /* special_function */ - "GPREL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* A reference to a literal using an offset from the gp register. - Handled by the function mips_gprel_reloc. */ - HOWTO (MIPS_R_LITERAL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - mips_gprel_reloc, /* special_function */ - "LITERAL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - EMPTY_HOWTO (8), - EMPTY_HOWTO (9), - EMPTY_HOWTO (10), - EMPTY_HOWTO (11), - - /* This reloc is a Cygnus extension used when generating position - independent code for embedded systems. It represents a 16 bit PC - relative reloc rightshifted twice as used in the MIPS branch - instructions. */ - HOWTO (MIPS_R_PCREL16, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - mips_generic_reloc, /* special_function */ - "PCREL16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* This reloc is a Cygnus extension used when generating position - independent code for embedded systems. It represents the high 16 - bits of a PC relative reloc. The next reloc must be - MIPS_R_RELLO, and the addend is formed from the addends of the - two instructions, just as in MIPS_R_REFHI and MIPS_R_REFLO. The - final value is actually PC relative to the location of the - MIPS_R_RELLO reloc, not the MIPS_R_RELHI reloc. */ - HOWTO (MIPS_R_RELHI, /* type */ - 16, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - mips_relhi_reloc, /* special_function */ - "RELHI", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* This reloc is a Cygnus extension used when generating position - independent code for embedded systems. It represents the low 16 - bits of a PC relative reloc. */ - HOWTO (MIPS_R_RELLO, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - mips_rello_reloc, /* special_function */ - "RELLO", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - true), /* pcrel_offset */ - - EMPTY_HOWTO (15), - EMPTY_HOWTO (16), - EMPTY_HOWTO (17), - EMPTY_HOWTO (18), - EMPTY_HOWTO (19), - EMPTY_HOWTO (20), - EMPTY_HOWTO (21), - - /* This reloc is a Cygnus extension used when generating position - independent code for embedded systems. It represents an entry in - a switch table, which is the difference between two symbols in - the .text section. The symndx is actually the offset from the - reloc address to the subtrahend. See include/coff/mips.h for - more details. */ - HOWTO (MIPS_R_SWITCH, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - mips_switch_reloc, /* special_function */ - "SWITCH", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - true) /* pcrel_offset */ -}; - -#define MIPS_HOWTO_COUNT \ - (sizeof mips_howto_table / sizeof mips_howto_table[0]) - -/* When the linker is doing relaxing, it may change an external PCREL16 - reloc. This typically represents an instruction like - bal foo - We change it to - .set noreorder - bal $L1 - lui $at,%hi(foo - $L1) - $L1: - addiu $at,%lo(foo - $L1) - addu $at,$at,$31 - jalr $at - PCREL16_EXPANSION_ADJUSTMENT is the number of bytes this changes the - instruction by. */ - -#define PCREL16_EXPANSION_ADJUSTMENT (4 * 4) - -/* See whether the magic number matches. */ - -static boolean -mips_ecoff_bad_format_hook (abfd, filehdr) - bfd *abfd; - PTR filehdr; -{ - struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; - - switch (internal_f->f_magic) - { - case MIPS_MAGIC_1: - /* I don't know what endianness this implies. */ - return true; - - case MIPS_MAGIC_BIG: - case MIPS_MAGIC_BIG2: - case MIPS_MAGIC_BIG3: - return bfd_big_endian (abfd); - - case MIPS_MAGIC_LITTLE: - case MIPS_MAGIC_LITTLE2: - case MIPS_MAGIC_LITTLE3: - return bfd_little_endian (abfd); - - default: - return false; - } -} - -/* Reloc handling. MIPS ECOFF relocs are packed into 8 bytes in - external form. They use a bit which indicates whether the symbol - is external. */ - -/* Swap a reloc in. */ - -static void -mips_ecoff_swap_reloc_in (abfd, ext_ptr, intern) - bfd *abfd; - PTR ext_ptr; - struct internal_reloc *intern; -{ - const RELOC *ext = (RELOC *) ext_ptr; - - intern->r_vaddr = H_GET_32 (abfd, ext->r_vaddr); - if (bfd_header_big_endian (abfd)) - { - intern->r_symndx = (((int) ext->r_bits[0] - << RELOC_BITS0_SYMNDX_SH_LEFT_BIG) - | ((int) ext->r_bits[1] - << RELOC_BITS1_SYMNDX_SH_LEFT_BIG) - | ((int) ext->r_bits[2] - << RELOC_BITS2_SYMNDX_SH_LEFT_BIG)); - intern->r_type = ((ext->r_bits[3] & RELOC_BITS3_TYPE_BIG) - >> RELOC_BITS3_TYPE_SH_BIG); - intern->r_extern = (ext->r_bits[3] & RELOC_BITS3_EXTERN_BIG) != 0; - } - else - { - intern->r_symndx = (((int) ext->r_bits[0] - << RELOC_BITS0_SYMNDX_SH_LEFT_LITTLE) - | ((int) ext->r_bits[1] - << RELOC_BITS1_SYMNDX_SH_LEFT_LITTLE) - | ((int) ext->r_bits[2] - << RELOC_BITS2_SYMNDX_SH_LEFT_LITTLE)); - intern->r_type = (((ext->r_bits[3] & RELOC_BITS3_TYPE_LITTLE) - >> RELOC_BITS3_TYPE_SH_LITTLE) - | ((ext->r_bits[3] & RELOC_BITS3_TYPEHI_LITTLE) - << RELOC_BITS3_TYPEHI_SH_LITTLE)); - intern->r_extern = (ext->r_bits[3] & RELOC_BITS3_EXTERN_LITTLE) != 0; - } - - /* If this is a MIPS_R_SWITCH reloc, or an internal MIPS_R_RELHI or - MIPS_R_RELLO reloc, r_symndx is actually the offset from the - reloc address to the base of the difference (see - include/coff/mips.h for more details). We copy symndx into the - r_offset field so as not to confuse ecoff_slurp_reloc_table in - ecoff.c. In adjust_reloc_in we then copy r_offset into the reloc - addend. */ - if (intern->r_type == MIPS_R_SWITCH - || (! intern->r_extern - && (intern->r_type == MIPS_R_RELLO - || intern->r_type == MIPS_R_RELHI))) - { - BFD_ASSERT (! intern->r_extern); - intern->r_offset = intern->r_symndx; - if (intern->r_offset & 0x800000) - intern->r_offset -= 0x1000000; - intern->r_symndx = RELOC_SECTION_TEXT; - } -} - -/* Swap a reloc out. */ - -static void -mips_ecoff_swap_reloc_out (abfd, intern, dst) - bfd *abfd; - const struct internal_reloc *intern; - PTR dst; -{ - RELOC *ext = (RELOC *) dst; - long r_symndx; - - BFD_ASSERT (intern->r_extern - || (intern->r_symndx >= 0 && intern->r_symndx <= 12)); - - /* If this is a MIPS_R_SWITCH reloc, or an internal MIPS_R_RELLO or - MIPS_R_RELHI reloc, we actually want to write the contents of - r_offset out as the symbol index. This undoes the change made by - mips_ecoff_swap_reloc_in. */ - if (intern->r_type != MIPS_R_SWITCH - && (intern->r_extern - || (intern->r_type != MIPS_R_RELHI - && intern->r_type != MIPS_R_RELLO))) - r_symndx = intern->r_symndx; - else - { - BFD_ASSERT (intern->r_symndx == RELOC_SECTION_TEXT); - r_symndx = intern->r_offset & 0xffffff; - } - - H_PUT_32 (abfd, intern->r_vaddr, ext->r_vaddr); - if (bfd_header_big_endian (abfd)) - { - ext->r_bits[0] = r_symndx >> RELOC_BITS0_SYMNDX_SH_LEFT_BIG; - ext->r_bits[1] = r_symndx >> RELOC_BITS1_SYMNDX_SH_LEFT_BIG; - ext->r_bits[2] = r_symndx >> RELOC_BITS2_SYMNDX_SH_LEFT_BIG; - ext->r_bits[3] = (((intern->r_type << RELOC_BITS3_TYPE_SH_BIG) - & RELOC_BITS3_TYPE_BIG) - | (intern->r_extern ? RELOC_BITS3_EXTERN_BIG : 0)); - } - else - { - ext->r_bits[0] = r_symndx >> RELOC_BITS0_SYMNDX_SH_LEFT_LITTLE; - ext->r_bits[1] = r_symndx >> RELOC_BITS1_SYMNDX_SH_LEFT_LITTLE; - ext->r_bits[2] = r_symndx >> RELOC_BITS2_SYMNDX_SH_LEFT_LITTLE; - ext->r_bits[3] = (((intern->r_type << RELOC_BITS3_TYPE_SH_LITTLE) - & RELOC_BITS3_TYPE_LITTLE) - | ((intern->r_type >> RELOC_BITS3_TYPEHI_SH_LITTLE - & RELOC_BITS3_TYPEHI_LITTLE)) - | (intern->r_extern ? RELOC_BITS3_EXTERN_LITTLE : 0)); - } -} - -/* Finish canonicalizing a reloc. Part of this is generic to all - ECOFF targets, and that part is in ecoff.c. The rest is done in - this backend routine. It must fill in the howto field. */ - -static void -mips_adjust_reloc_in (abfd, intern, rptr) - bfd *abfd; - const struct internal_reloc *intern; - arelent *rptr; -{ - if (intern->r_type > MIPS_R_SWITCH) - abort (); - - if (! intern->r_extern - && (intern->r_type == MIPS_R_GPREL - || intern->r_type == MIPS_R_LITERAL)) - rptr->addend += ecoff_data (abfd)->gp; - - /* If the type is MIPS_R_IGNORE, make sure this is a reference to - the absolute section so that the reloc is ignored. */ - if (intern->r_type == MIPS_R_IGNORE) - rptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - - /* If this is a MIPS_R_SWITCH reloc, or an internal MIPS_R_RELHI or - MIPS_R_RELLO reloc, we want the addend field of the BFD relocto - hold the value which was originally in the symndx field of the - internal MIPS ECOFF reloc. This value was copied into - intern->r_offset by mips_swap_reloc_in, and here we copy it into - the addend field. */ - if (intern->r_type == MIPS_R_SWITCH - || (! intern->r_extern - && (intern->r_type == MIPS_R_RELHI - || intern->r_type == MIPS_R_RELLO))) - rptr->addend = intern->r_offset; - - rptr->howto = &mips_howto_table[intern->r_type]; -} - -/* Make any adjustments needed to a reloc before writing it out. None - are needed for MIPS. */ - -static void -mips_adjust_reloc_out (abfd, rel, intern) - bfd *abfd ATTRIBUTE_UNUSED; - const arelent *rel; - struct internal_reloc *intern; -{ - /* For a MIPS_R_SWITCH reloc, or an internal MIPS_R_RELHI or - MIPS_R_RELLO reloc, we must copy rel->addend into - intern->r_offset. This will then be written out as the symbol - index by mips_ecoff_swap_reloc_out. This operation parallels the - action of mips_adjust_reloc_in. */ - if (intern->r_type == MIPS_R_SWITCH - || (! intern->r_extern - && (intern->r_type == MIPS_R_RELHI - || intern->r_type == MIPS_R_RELLO))) - intern->r_offset = rel->addend; -} - -/* ECOFF relocs are either against external symbols, or against - sections. If we are producing relocateable output, and the reloc - is against an external symbol, and nothing has given us any - additional addend, the resulting reloc will also be against the - same symbol. In such a case, we don't want to change anything - about the way the reloc is handled, since it will all be done at - final link time. Rather than put special case code into - bfd_perform_relocation, all the reloc types use this howto - function. It just short circuits the reloc if producing - relocateable output against an external symbol. */ - -static bfd_reloc_status_type -mips_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->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - return bfd_reloc_continue; -} - -/* Do a REFHI relocation. This has to be done in combination with a - REFLO reloc, because there is a carry from the REFLO to the REFHI. - Here we just save the information we need; we do the actual - relocation when we see the REFLO. MIPS ECOFF requires that the - REFLO immediately follow the REFHI. As a GNU extension, we permit - an arbitrary number of HI relocs to be associated with a single LO - reloc. This extension permits gcc to output the HI and LO relocs - itself. */ - -struct mips_hi -{ - struct mips_hi *next; - bfd_byte *addr; - bfd_vma addend; -}; - -/* FIXME: This should not be a static variable. */ - -static struct mips_hi *mips_refhi_list; - -static bfd_reloc_status_type -mips_refhi_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - bfd_reloc_status_type ret; - bfd_vma relocation; - struct mips_hi *n; - - /* If we're relocating, and this an external symbol, we don't want - to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - ret = bfd_reloc_ok; - if (bfd_is_und_section (symbol->section) - && output_bfd == (bfd *) NULL) - ret = bfd_reloc_undefined; - - 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; - - if (reloc_entry->address > input_section->_cooked_size) - return bfd_reloc_outofrange; - - /* Save the information, and let REFLO do the actual relocation. */ - n = (struct mips_hi *) bfd_malloc ((bfd_size_type) sizeof *n); - if (n == NULL) - return bfd_reloc_outofrange; - n->addr = (bfd_byte *) data + reloc_entry->address; - n->addend = relocation; - n->next = mips_refhi_list; - mips_refhi_list = n; - - if (output_bfd != (bfd *) NULL) - reloc_entry->address += input_section->output_offset; - - return ret; -} - -/* Do a REFLO relocation. This is a straightforward 16 bit inplace - relocation; this function exists in order to do the REFHI - relocation described above. */ - -static bfd_reloc_status_type -mips_reflo_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - if (mips_refhi_list != NULL) - { - struct mips_hi *l; - - l = mips_refhi_list; - while (l != NULL) - { - unsigned long insn; - unsigned long val; - unsigned long vallo; - struct mips_hi *next; - - /* Do the REFHI relocation. Note that we actually don't - need to know anything about the REFLO itself, except - where to find the low 16 bits of the addend needed by the - REFHI. */ - insn = bfd_get_32 (abfd, l->addr); - vallo = (bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address) - & 0xffff); - val = ((insn & 0xffff) << 16) + vallo; - val += l->addend; - - /* The low order 16 bits are always treated as a signed - value. Therefore, a negative value in the low order bits - requires an adjustment in the high order bits. We need - to make this adjustment in two ways: once for the bits we - took from the data, and once for the bits we are putting - back in to the data. */ - if ((vallo & 0x8000) != 0) - val -= 0x10000; - if ((val & 0x8000) != 0) - val += 0x10000; - - insn = (insn &~ (unsigned) 0xffff) | ((val >> 16) & 0xffff); - bfd_put_32 (abfd, (bfd_vma) insn, l->addr); - - next = l->next; - free (l); - l = next; - } - - mips_refhi_list = NULL; - } - - /* Now do the REFLO reloc in the usual way. */ - return mips_generic_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message); -} - -/* Do a GPREL relocation. This is a 16 bit value which must become - the offset from the gp register. */ - -static bfd_reloc_status_type -mips_gprel_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - boolean relocateable; - bfd_vma gp; - bfd_vma relocation; - unsigned long val; - unsigned long insn; - - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ECOFF - file. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - if (output_bfd != (bfd *) NULL) - relocateable = true; - else - { - relocateable = false; - output_bfd = symbol->section->output_section->owner; - } - - if (bfd_is_und_section (symbol->section) - && relocateable == false) - return bfd_reloc_undefined; - - /* We have to figure out the gp value, so that we can adjust the - symbol value correctly. We look up the symbol _gp in the output - BFD. If we can't find it, we're stuck. We cache it in the ECOFF - target data. We don't need to adjust the symbol value for an - external symbol if we are producing relocateable output. */ - gp = _bfd_get_gp_value (output_bfd); - if (gp == 0 - && (relocateable == false - || (symbol->flags & BSF_SECTION_SYM) != 0)) - { - if (relocateable != false) - { - /* Make up a value. */ - gp = symbol->section->output_section->vma + 0x4000; - _bfd_set_gp_value (output_bfd, gp); - } - else - { - unsigned int count; - asymbol **sym; - unsigned int i; - - count = bfd_get_symcount (output_bfd); - sym = bfd_get_outsymbols (output_bfd); - - if (sym == (asymbol **) NULL) - i = count; - else - { - for (i = 0; i < count; i++, sym++) - { - register const char *name; - - name = bfd_asymbol_name (*sym); - if (*name == '_' && strcmp (name, "_gp") == 0) - { - gp = bfd_asymbol_value (*sym); - _bfd_set_gp_value (output_bfd, gp); - break; - } - } - } - - if (i >= count) - { - /* Only get the error once. */ - gp = 4; - _bfd_set_gp_value (output_bfd, gp); - *error_message = - (char *) _("GP relative relocation when _gp not defined"); - return bfd_reloc_dangerous; - } - } - } - - if (bfd_is_com_section (symbol->section)) - relocation = 0; - else - relocation = symbol->value; - - relocation += symbol->section->output_section->vma; - relocation += symbol->section->output_offset; - - if (reloc_entry->address > input_section->_cooked_size) - return bfd_reloc_outofrange; - - insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - - /* Set val to the offset into the section or symbol. */ - val = ((insn & 0xffff) + reloc_entry->addend) & 0xffff; - if (val & 0x8000) - val -= 0x10000; - - /* Adjust val for the final section location and GP value. If we - are producing relocateable output, we don't want to do this for - an external symbol. */ - if (relocateable == false - || (symbol->flags & BSF_SECTION_SYM) != 0) - val += relocation - gp; - - insn = (insn &~ (unsigned) 0xffff) | (val & 0xffff); - bfd_put_32 (abfd, (bfd_vma) insn, (bfd_byte *) data + reloc_entry->address); - - if (relocateable != false) - reloc_entry->address += input_section->output_offset; - - /* Make sure it fit in 16 bits. */ - if ((long) val >= 0x8000 || (long) val < -0x8000) - return bfd_reloc_overflow; - - return bfd_reloc_ok; -} - -/* Do a RELHI relocation. We do this in conjunction with a RELLO - reloc, just as REFHI and REFLO are done together. RELHI and RELLO - are Cygnus extensions used when generating position independent - code for embedded systems. */ - -/* FIXME: This should not be a static variable. */ - -static struct mips_hi *mips_relhi_list; - -static bfd_reloc_status_type -mips_relhi_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - bfd_reloc_status_type ret; - bfd_vma relocation; - struct mips_hi *n; - - /* If this is a reloc against a section symbol, then it is correct - in the object file. The only time we want to change this case is - when we are relaxing, and that is handled entirely by - mips_relocate_section and never calls this function. */ - if ((symbol->flags & BSF_SECTION_SYM) != 0) - { - if (output_bfd != (bfd *) NULL) - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* This is an external symbol. If we're relocating, we don't want - to change anything. */ - if (output_bfd != (bfd *) NULL) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - ret = bfd_reloc_ok; - if (bfd_is_und_section (symbol->section) - && output_bfd == (bfd *) NULL) - ret = bfd_reloc_undefined; - - 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; - - if (reloc_entry->address > input_section->_cooked_size) - return bfd_reloc_outofrange; - - /* Save the information, and let RELLO do the actual relocation. */ - n = (struct mips_hi *) bfd_malloc ((bfd_size_type) sizeof *n); - if (n == NULL) - return bfd_reloc_outofrange; - n->addr = (bfd_byte *) data + reloc_entry->address; - n->addend = relocation; - n->next = mips_relhi_list; - mips_relhi_list = n; - - if (output_bfd != (bfd *) NULL) - reloc_entry->address += input_section->output_offset; - - return ret; -} - -/* Do a RELLO relocation. This is a straightforward 16 bit PC - relative relocation; this function exists in order to do the RELHI - relocation described above. */ - -static bfd_reloc_status_type -mips_rello_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - if (mips_relhi_list != NULL) - { - struct mips_hi *l; - - l = mips_relhi_list; - while (l != NULL) - { - unsigned long insn; - unsigned long val; - unsigned long vallo; - struct mips_hi *next; - - /* Do the RELHI relocation. Note that we actually don't - need to know anything about the RELLO itself, except - where to find the low 16 bits of the addend needed by the - RELHI. */ - insn = bfd_get_32 (abfd, l->addr); - vallo = (bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address) - & 0xffff); - val = ((insn & 0xffff) << 16) + vallo; - val += l->addend; - - /* If the symbol is defined, make val PC relative. If the - symbol is not defined we don't want to do this, because - we don't want the value in the object file to incorporate - the address of the reloc. */ - if (! bfd_is_und_section (bfd_get_section (symbol)) - && ! bfd_is_com_section (bfd_get_section (symbol))) - val -= (input_section->output_section->vma - + input_section->output_offset - + reloc_entry->address); - - /* The low order 16 bits are always treated as a signed - value. Therefore, a negative value in the low order bits - requires an adjustment in the high order bits. We need - to make this adjustment in two ways: once for the bits we - took from the data, and once for the bits we are putting - back in to the data. */ - if ((vallo & 0x8000) != 0) - val -= 0x10000; - if ((val & 0x8000) != 0) - val += 0x10000; - - insn = (insn &~ (unsigned) 0xffff) | ((val >> 16) & 0xffff); - bfd_put_32 (abfd, (bfd_vma) insn, l->addr); - - next = l->next; - free (l); - l = next; - } - - mips_relhi_list = NULL; - } - - /* If this is a reloc against a section symbol, then it is correct - in the object file. The only time we want to change this case is - when we are relaxing, and that is handled entirely by - mips_relocate_section and never calls this function. */ - if ((symbol->flags & BSF_SECTION_SYM) != 0) - { - if (output_bfd != (bfd *) NULL) - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* bfd_perform_relocation does not handle pcrel_offset relocations - correctly when generating a relocateable file, so handle them - directly here. */ - if (output_bfd != (bfd *) NULL) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* Now do the RELLO reloc in the usual way. */ - return mips_generic_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message); -} - -/* This is the special function for the MIPS_R_SWITCH reloc. This - special reloc is normally correct in the object file, and only - requires special handling when relaxing. We don't want - bfd_perform_relocation to tamper with it at all. */ - -static bfd_reloc_status_type -mips_switch_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry ATTRIBUTE_UNUSED; - asymbol *symbol ATTRIBUTE_UNUSED; - PTR data ATTRIBUTE_UNUSED; - asection *input_section ATTRIBUTE_UNUSED; - bfd *output_bfd ATTRIBUTE_UNUSED; - char **error_message ATTRIBUTE_UNUSED; -{ - return bfd_reloc_ok; -} - -/* Get the howto structure for a generic reloc type. */ - -static reloc_howto_type * -mips_bfd_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; -{ - int mips_type; - - switch (code) - { - case BFD_RELOC_16: - mips_type = MIPS_R_REFHALF; - break; - case BFD_RELOC_32: - case BFD_RELOC_CTOR: - mips_type = MIPS_R_REFWORD; - break; - case BFD_RELOC_MIPS_JMP: - mips_type = MIPS_R_JMPADDR; - break; - case BFD_RELOC_HI16_S: - mips_type = MIPS_R_REFHI; - break; - case BFD_RELOC_LO16: - mips_type = MIPS_R_REFLO; - break; - case BFD_RELOC_GPREL16: - mips_type = MIPS_R_GPREL; - break; - case BFD_RELOC_MIPS_LITERAL: - mips_type = MIPS_R_LITERAL; - break; - case BFD_RELOC_16_PCREL_S2: - mips_type = MIPS_R_PCREL16; - break; - case BFD_RELOC_PCREL_HI16_S: - mips_type = MIPS_R_RELHI; - break; - case BFD_RELOC_PCREL_LO16: - mips_type = MIPS_R_RELLO; - break; - case BFD_RELOC_GPREL32: - mips_type = MIPS_R_SWITCH; - break; - default: - return (reloc_howto_type *) NULL; - } - - return &mips_howto_table[mips_type]; -} - -/* A helper routine for mips_relocate_section which handles the REFHI - and RELHI relocations. The REFHI relocation must be followed by a - REFLO relocation (and RELHI by a RELLO), and the addend used is - formed from the addends of both instructions. */ - -static void -mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents, adjust, - relocation, pcrel) - struct internal_reloc *refhi; - struct internal_reloc *reflo; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - size_t adjust; - bfd_vma relocation; - boolean pcrel; -{ - unsigned long insn; - unsigned long val; - unsigned long vallo; - - if (refhi == NULL) - return; - - insn = bfd_get_32 (input_bfd, - contents + adjust + refhi->r_vaddr - input_section->vma); - if (reflo == NULL) - vallo = 0; - else - vallo = (bfd_get_32 (input_bfd, - contents + adjust + reflo->r_vaddr - input_section->vma) - & 0xffff); - - val = ((insn & 0xffff) << 16) + vallo; - val += relocation; - - /* The low order 16 bits are always treated as a signed value. - Therefore, a negative value in the low order bits requires an - adjustment in the high order bits. We need to make this - adjustment in two ways: once for the bits we took from the data, - and once for the bits we are putting back in to the data. */ - if ((vallo & 0x8000) != 0) - val -= 0x10000; - - if (pcrel) - val -= (input_section->output_section->vma - + input_section->output_offset - + (reflo->r_vaddr - input_section->vma + adjust)); - - if ((val & 0x8000) != 0) - val += 0x10000; - - insn = (insn &~ (unsigned) 0xffff) | ((val >> 16) & 0xffff); - bfd_put_32 (input_bfd, (bfd_vma) insn, - contents + adjust + refhi->r_vaddr - input_section->vma); -} - -/* Relocate a section while linking a MIPS ECOFF file. */ - -static boolean -mips_relocate_section (output_bfd, info, input_bfd, input_section, - contents, external_relocs) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - PTR external_relocs; -{ - asection **symndx_to_section; - struct ecoff_link_hash_entry **sym_hashes; - bfd_vma gp; - boolean gp_undefined; - size_t adjust; - long *offsets; - struct external_reloc *ext_rel; - struct external_reloc *ext_rel_end; - unsigned int i; - boolean got_lo; - struct internal_reloc lo_int_rel; - bfd_size_type amt; - - BFD_ASSERT (input_bfd->xvec->byteorder - == output_bfd->xvec->byteorder); - - /* We keep a table mapping the symndx found in an internal reloc to - the appropriate section. This is faster than looking up the - section by name each time. */ - symndx_to_section = ecoff_data (input_bfd)->symndx_to_section; - if (symndx_to_section == (asection **) NULL) - { - amt = NUM_RELOC_SECTIONS * sizeof (asection *); - symndx_to_section = (asection **) bfd_alloc (input_bfd, amt); - if (!symndx_to_section) - return false; - - symndx_to_section[RELOC_SECTION_NONE] = NULL; - symndx_to_section[RELOC_SECTION_TEXT] = - bfd_get_section_by_name (input_bfd, ".text"); - symndx_to_section[RELOC_SECTION_RDATA] = - bfd_get_section_by_name (input_bfd, ".rdata"); - symndx_to_section[RELOC_SECTION_DATA] = - bfd_get_section_by_name (input_bfd, ".data"); - symndx_to_section[RELOC_SECTION_SDATA] = - bfd_get_section_by_name (input_bfd, ".sdata"); - symndx_to_section[RELOC_SECTION_SBSS] = - bfd_get_section_by_name (input_bfd, ".sbss"); - symndx_to_section[RELOC_SECTION_BSS] = - bfd_get_section_by_name (input_bfd, ".bss"); - symndx_to_section[RELOC_SECTION_INIT] = - bfd_get_section_by_name (input_bfd, ".init"); - symndx_to_section[RELOC_SECTION_LIT8] = - bfd_get_section_by_name (input_bfd, ".lit8"); - symndx_to_section[RELOC_SECTION_LIT4] = - bfd_get_section_by_name (input_bfd, ".lit4"); - symndx_to_section[RELOC_SECTION_XDATA] = NULL; - symndx_to_section[RELOC_SECTION_PDATA] = NULL; - symndx_to_section[RELOC_SECTION_FINI] = - bfd_get_section_by_name (input_bfd, ".fini"); - symndx_to_section[RELOC_SECTION_LITA] = NULL; - symndx_to_section[RELOC_SECTION_ABS] = NULL; - - ecoff_data (input_bfd)->symndx_to_section = symndx_to_section; - } - - sym_hashes = ecoff_data (input_bfd)->sym_hashes; - - gp = _bfd_get_gp_value (output_bfd); - if (gp == 0) - gp_undefined = true; - else - gp_undefined = false; - - got_lo = false; - - adjust = 0; - - if (ecoff_section_data (input_bfd, input_section) == NULL) - offsets = NULL; - else - offsets = ecoff_section_data (input_bfd, input_section)->offsets; - - ext_rel = (struct external_reloc *) external_relocs; - ext_rel_end = ext_rel + input_section->reloc_count; - for (i = 0; ext_rel < ext_rel_end; ext_rel++, i++) - { - struct internal_reloc int_rel; - boolean use_lo = false; - bfd_vma addend; - reloc_howto_type *howto; - struct ecoff_link_hash_entry *h = NULL; - asection *s = NULL; - bfd_vma relocation; - bfd_reloc_status_type r; - - if (! got_lo) - mips_ecoff_swap_reloc_in (input_bfd, (PTR) ext_rel, &int_rel); - else - { - int_rel = lo_int_rel; - got_lo = false; - } - - BFD_ASSERT (int_rel.r_type - < sizeof mips_howto_table / sizeof mips_howto_table[0]); - - /* The REFHI and RELHI relocs requires special handling. they - must be followed by a REFLO or RELLO reloc, respectively, and - the addend is formed from both relocs. */ - if (int_rel.r_type == MIPS_R_REFHI - || int_rel.r_type == MIPS_R_RELHI) - { - struct external_reloc *lo_ext_rel; - - /* As a GNU extension, permit an arbitrary number of REFHI - or RELHI relocs before the REFLO or RELLO reloc. This - permits gcc to emit the HI and LO relocs itself. */ - for (lo_ext_rel = ext_rel + 1; - lo_ext_rel < ext_rel_end; - lo_ext_rel++) - { - mips_ecoff_swap_reloc_in (input_bfd, (PTR) lo_ext_rel, - &lo_int_rel); - if (lo_int_rel.r_type != int_rel.r_type) - break; - } - - if (lo_ext_rel < ext_rel_end - && (lo_int_rel.r_type - == (int_rel.r_type == MIPS_R_REFHI - ? MIPS_R_REFLO - : MIPS_R_RELLO)) - && int_rel.r_extern == lo_int_rel.r_extern - && int_rel.r_symndx == lo_int_rel.r_symndx) - { - use_lo = true; - if (lo_ext_rel == ext_rel + 1) - got_lo = true; - } - } - - howto = &mips_howto_table[int_rel.r_type]; - - /* The SWITCH reloc must be handled specially. This reloc is - marks the location of a difference between two portions of an - object file. The symbol index does not reference a symbol, - but is actually the offset from the reloc to the subtrahend - of the difference. This reloc is correct in the object file, - and needs no further adjustment, unless we are relaxing. If - we are relaxing, we may have to add in an offset. Since no - symbols are involved in this reloc, we handle it completely - here. */ - if (int_rel.r_type == MIPS_R_SWITCH) - { - if (offsets != NULL - && offsets[i] != 0) - { - r = _bfd_relocate_contents (howto, input_bfd, - (bfd_vma) offsets[i], - (contents - + adjust - + int_rel.r_vaddr - - input_section->vma)); - BFD_ASSERT (r == bfd_reloc_ok); - } - - continue; - } - - if (int_rel.r_extern) - { - h = sym_hashes[int_rel.r_symndx]; - /* If h is NULL, that means that there is a reloc against an - external symbol which we thought was just a debugging - symbol. This should not happen. */ - if (h == (struct ecoff_link_hash_entry *) NULL) - abort (); - } - else - { - if (int_rel.r_symndx < 0 || int_rel.r_symndx >= NUM_RELOC_SECTIONS) - s = NULL; - else - s = symndx_to_section[int_rel.r_symndx]; - - if (s == (asection *) NULL) - abort (); - } - - /* The GPREL reloc uses an addend: the difference in the GP - values. */ - if (int_rel.r_type != MIPS_R_GPREL - && int_rel.r_type != MIPS_R_LITERAL) - addend = 0; - else - { - if (gp_undefined) - { - if (! ((*info->callbacks->reloc_dangerous) - (info, _("GP relative relocation used when GP not defined"), - input_bfd, input_section, - int_rel.r_vaddr - input_section->vma))) - return false; - /* Only give the error once per link. */ - gp = 4; - _bfd_set_gp_value (output_bfd, gp); - gp_undefined = false; - } - if (! int_rel.r_extern) - { - /* This is a relocation against a section. The current - addend in the instruction is the difference between - INPUT_SECTION->vma and the GP value of INPUT_BFD. We - must change this to be the difference between the - final definition (which will end up in RELOCATION) - and the GP value of OUTPUT_BFD (which is in GP). */ - addend = ecoff_data (input_bfd)->gp - gp; - } - else if (! info->relocateable - || h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - /* This is a relocation against a defined symbol. The - current addend in the instruction is simply the - desired offset into the symbol (normally zero). We - are going to change this into a relocation against a - defined symbol, so we want the instruction to hold - the difference between the final definition of the - symbol (which will end up in RELOCATION) and the GP - value of OUTPUT_BFD (which is in GP). */ - addend = - gp; - } - else - { - /* This is a relocation against an undefined or common - symbol. The current addend in the instruction is - simply the desired offset into the symbol (normally - zero). We are generating relocateable output, and we - aren't going to define this symbol, so we just leave - the instruction alone. */ - addend = 0; - } - } - - /* If we are relaxing, mips_relax_section may have set - offsets[i] to some value. A value of 1 means we must expand - a PC relative branch into a multi-instruction of sequence, - and any other value is an addend. */ - if (offsets != NULL - && offsets[i] != 0) - { - BFD_ASSERT (! info->relocateable); - BFD_ASSERT (int_rel.r_type == MIPS_R_PCREL16 - || int_rel.r_type == MIPS_R_RELHI - || int_rel.r_type == MIPS_R_RELLO); - if (offsets[i] != 1) - addend += offsets[i]; - else - { - bfd_byte *here; - - BFD_ASSERT (int_rel.r_extern - && int_rel.r_type == MIPS_R_PCREL16); - - /* Move the rest of the instructions up. */ - here = (contents - + adjust - + int_rel.r_vaddr - - input_section->vma); - memmove (here + PCREL16_EXPANSION_ADJUSTMENT, here, - (size_t) (input_section->_raw_size - - (int_rel.r_vaddr - input_section->vma))); - - /* Generate the new instructions. */ - if (! mips_relax_pcrel16 (info, input_bfd, input_section, - h, here, - (input_section->output_section->vma - + input_section->output_offset - + (int_rel.r_vaddr - - input_section->vma) - + adjust))) - return false; - - /* We must adjust everything else up a notch. */ - adjust += PCREL16_EXPANSION_ADJUSTMENT; - - /* mips_relax_pcrel16 handles all the details of this - relocation. */ - continue; - } - } - - /* If we are relaxing, and this is a reloc against the .text - segment, we may need to adjust it if some branches have been - expanded. The reloc types which are likely to occur in the - .text section are handled efficiently by mips_relax_section, - and thus do not need to be handled here. */ - if (ecoff_data (input_bfd)->debug_info.adjust != NULL - && ! int_rel.r_extern - && int_rel.r_symndx == RELOC_SECTION_TEXT - && (strcmp (bfd_get_section_name (input_bfd, input_section), - ".text") != 0 - || (int_rel.r_type != MIPS_R_PCREL16 - && int_rel.r_type != MIPS_R_SWITCH - && int_rel.r_type != MIPS_R_RELHI - && int_rel.r_type != MIPS_R_RELLO))) - { - bfd_vma adr; - struct ecoff_value_adjust *a; - - /* We need to get the addend so that we know whether we need - to adjust the address. */ - BFD_ASSERT (int_rel.r_type == MIPS_R_REFWORD); - - adr = bfd_get_32 (input_bfd, - (contents - + adjust - + int_rel.r_vaddr - - input_section->vma)); - - for (a = ecoff_data (input_bfd)->debug_info.adjust; - a != (struct ecoff_value_adjust *) NULL; - a = a->next) - { - if (adr >= a->start && adr < a->end) - addend += a->adjust; - } - } - - if (info->relocateable) - { - /* We are generating relocateable output, and must convert - the existing reloc. */ - if (int_rel.r_extern) - { - if ((h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - && ! bfd_is_abs_section (h->root.u.def.section)) - { - const char *name; - - /* This symbol is defined in the output. Convert - the reloc from being against the symbol to being - against the section. */ - - /* Clear the r_extern bit. */ - int_rel.r_extern = 0; - - /* Compute a new r_symndx value. */ - s = h->root.u.def.section; - name = bfd_get_section_name (output_bfd, - s->output_section); - - int_rel.r_symndx = -1; - switch (name[1]) - { - case 'b': - if (strcmp (name, ".bss") == 0) - int_rel.r_symndx = RELOC_SECTION_BSS; - break; - case 'd': - if (strcmp (name, ".data") == 0) - int_rel.r_symndx = RELOC_SECTION_DATA; - break; - case 'f': - if (strcmp (name, ".fini") == 0) - int_rel.r_symndx = RELOC_SECTION_FINI; - break; - case 'i': - if (strcmp (name, ".init") == 0) - int_rel.r_symndx = RELOC_SECTION_INIT; - break; - case 'l': - if (strcmp (name, ".lit8") == 0) - int_rel.r_symndx = RELOC_SECTION_LIT8; - else if (strcmp (name, ".lit4") == 0) - int_rel.r_symndx = RELOC_SECTION_LIT4; - break; - case 'r': - if (strcmp (name, ".rdata") == 0) - int_rel.r_symndx = RELOC_SECTION_RDATA; - break; - case 's': - if (strcmp (name, ".sdata") == 0) - int_rel.r_symndx = RELOC_SECTION_SDATA; - else if (strcmp (name, ".sbss") == 0) - int_rel.r_symndx = RELOC_SECTION_SBSS; - break; - case 't': - if (strcmp (name, ".text") == 0) - int_rel.r_symndx = RELOC_SECTION_TEXT; - break; - } - - if (int_rel.r_symndx == -1) - abort (); - - /* Add the section VMA and the symbol value. */ - relocation = (h->root.u.def.value - + s->output_section->vma - + s->output_offset); - - /* For a PC relative relocation, the object file - currently holds just the addend. We must adjust - by the address to get the right value. */ - if (howto->pc_relative) - { - relocation -= int_rel.r_vaddr - input_section->vma; - - /* If we are converting a RELHI or RELLO reloc - from being against an external symbol to - being against a section, we must put a - special value into the r_offset field. This - value is the old addend. The r_offset for - both the RELHI and RELLO relocs are the same, - and we set both when we see RELHI. */ - if (int_rel.r_type == MIPS_R_RELHI) - { - long addhi, addlo; - - addhi = bfd_get_32 (input_bfd, - (contents - + adjust - + int_rel.r_vaddr - - input_section->vma)); - addhi &= 0xffff; - if (addhi & 0x8000) - addhi -= 0x10000; - addhi <<= 16; - - if (! use_lo) - addlo = 0; - else - { - addlo = bfd_get_32 (input_bfd, - (contents - + adjust - + lo_int_rel.r_vaddr - - input_section->vma)); - addlo &= 0xffff; - if (addlo & 0x8000) - addlo -= 0x10000; - - lo_int_rel.r_offset = addhi + addlo; - } - - int_rel.r_offset = addhi + addlo; - } - } - - h = NULL; - } - else - { - /* Change the symndx value to the right one for the - output BFD. */ - int_rel.r_symndx = h->indx; - if (int_rel.r_symndx == -1) - { - /* This symbol is not being written out. */ - if (! ((*info->callbacks->unattached_reloc) - (info, h->root.root.string, input_bfd, - input_section, - int_rel.r_vaddr - input_section->vma))) - return false; - int_rel.r_symndx = 0; - } - relocation = 0; - } - } - else - { - /* This is a relocation against a section. Adjust the - value by the amount the section moved. */ - relocation = (s->output_section->vma - + s->output_offset - - s->vma); - } - - relocation += addend; - addend = 0; - - /* Adjust a PC relative relocation by removing the reference - to the original address in the section and including the - reference to the new address. However, external RELHI - and RELLO relocs are PC relative, but don't include any - reference to the address. The addend is merely an - addend. */ - if (howto->pc_relative - && (! int_rel.r_extern - || (int_rel.r_type != MIPS_R_RELHI - && int_rel.r_type != MIPS_R_RELLO))) - relocation -= (input_section->output_section->vma - + input_section->output_offset - - input_section->vma); - - /* Adjust the contents. */ - if (relocation == 0) - r = bfd_reloc_ok; - else - { - if (int_rel.r_type != MIPS_R_REFHI - && int_rel.r_type != MIPS_R_RELHI) - r = _bfd_relocate_contents (howto, input_bfd, relocation, - (contents - + adjust - + int_rel.r_vaddr - - input_section->vma)); - else - { - mips_relocate_hi (&int_rel, - use_lo ? &lo_int_rel : NULL, - input_bfd, input_section, contents, - adjust, relocation, - int_rel.r_type == MIPS_R_RELHI); - r = bfd_reloc_ok; - } - } - - /* Adjust the reloc address. */ - int_rel.r_vaddr += (input_section->output_section->vma - + input_section->output_offset - - input_section->vma); - - /* Save the changed reloc information. */ - mips_ecoff_swap_reloc_out (input_bfd, &int_rel, (PTR) ext_rel); - } - else - { - /* We are producing a final executable. */ - if (int_rel.r_extern) - { - /* This is a reloc against a symbol. */ - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - asection *hsec; - - hsec = h->root.u.def.section; - relocation = (h->root.u.def.value - + hsec->output_section->vma - + hsec->output_offset); - } - else - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, - int_rel.r_vaddr - input_section->vma, true))) - return false; - relocation = 0; - } - } - else - { - /* This is a reloc against a section. */ - relocation = (s->output_section->vma - + s->output_offset - - s->vma); - - /* A PC relative reloc is already correct in the object - file. Make it look like a pcrel_offset relocation by - adding in the start address. */ - if (howto->pc_relative) - { - if (int_rel.r_type != MIPS_R_RELHI || ! use_lo) - relocation += int_rel.r_vaddr + adjust; - else - relocation += lo_int_rel.r_vaddr + adjust; - } - } - - if (int_rel.r_type != MIPS_R_REFHI - && int_rel.r_type != MIPS_R_RELHI) - r = _bfd_final_link_relocate (howto, - input_bfd, - input_section, - contents, - (int_rel.r_vaddr - - input_section->vma - + adjust), - relocation, - addend); - else - { - mips_relocate_hi (&int_rel, - use_lo ? &lo_int_rel : NULL, - input_bfd, input_section, contents, adjust, - relocation, - int_rel.r_type == MIPS_R_RELHI); - r = bfd_reloc_ok; - } - } - - /* MIPS_R_JMPADDR requires peculiar overflow detection. The - instruction provides a 28 bit address (the two lower bits are - implicit zeroes) which is combined with the upper four bits - of the instruction address. */ - if (r == bfd_reloc_ok - && int_rel.r_type == MIPS_R_JMPADDR - && (((relocation - + addend - + (int_rel.r_extern ? 0 : s->vma)) - & 0xf0000000) - != ((input_section->output_section->vma - + input_section->output_offset - + (int_rel.r_vaddr - input_section->vma) - + adjust) - & 0xf0000000))) - r = bfd_reloc_overflow; - - if (r != bfd_reloc_ok) - { - switch (r) - { - default: - case bfd_reloc_outofrange: - abort (); - case bfd_reloc_overflow: - { - const char *name; - - if (int_rel.r_extern) - name = h->root.root.string; - else - name = bfd_section_name (input_bfd, s); - if (! ((*info->callbacks->reloc_overflow) - (info, name, howto->name, (bfd_vma) 0, - input_bfd, input_section, - int_rel.r_vaddr - input_section->vma))) - return false; - } - break; - } - } - } - - return true; -} - -/* Read in the relocs for a section. */ - -static boolean -mips_read_relocs (abfd, sec) - bfd *abfd; - asection *sec; -{ - struct ecoff_section_tdata *section_tdata; - bfd_size_type amt; - - section_tdata = ecoff_section_data (abfd, sec); - if (section_tdata == (struct ecoff_section_tdata *) NULL) - { - amt = sizeof (struct ecoff_section_tdata); - sec->used_by_bfd = (PTR) bfd_alloc (abfd, amt); - if (sec->used_by_bfd == NULL) - return false; - - section_tdata = ecoff_section_data (abfd, sec); - section_tdata->external_relocs = NULL; - section_tdata->contents = NULL; - section_tdata->offsets = NULL; - } - - if (section_tdata->external_relocs == NULL) - { - amt = ecoff_backend (abfd)->external_reloc_size; - amt *= sec->reloc_count; - section_tdata->external_relocs = (PTR) bfd_alloc (abfd, amt); - if (section_tdata->external_relocs == NULL && amt != 0) - return false; - - if (bfd_seek (abfd, sec->rel_filepos, SEEK_SET) != 0 - || bfd_bread (section_tdata->external_relocs, amt, abfd) != amt) - return false; - } - - return true; -} - -/* Relax a section when linking a MIPS ECOFF file. This is used for - embedded PIC code, which always uses PC relative branches which - only have an 18 bit range on MIPS. If a branch is not in range, we - generate a long instruction sequence to compensate. Each time we - find a branch to expand, we have to check all the others again to - make sure they are still in range. This is slow, but it only has - to be done when -relax is passed to the linker. - - This routine figures out which branches need to expand; the actual - expansion is done in mips_relocate_section when the section - contents are relocated. The information is stored in the offsets - field of the ecoff_section_tdata structure. An offset of 1 means - that the branch must be expanded into a multi-instruction PC - relative branch (such an offset will only occur for a PC relative - branch to an external symbol). Any other offset must be a multiple - of four, and is the amount to change the branch by (such an offset - will only occur for a PC relative branch within the same section). - - We do not modify the section relocs or contents themselves so that - if memory usage becomes an issue we can discard them and read them - again. The only information we must save in memory between this - routine and the mips_relocate_section routine is the table of - offsets. */ - -static boolean -mips_relax_section (abfd, sec, info, again) - bfd *abfd; - asection *sec; - struct bfd_link_info *info; - boolean *again; -{ - struct ecoff_section_tdata *section_tdata; - bfd_byte *contents = NULL; - long *offsets; - struct external_reloc *ext_rel; - struct external_reloc *ext_rel_end; - unsigned int i; - - /* Assume we are not going to need another pass. */ - *again = false; - - /* If we are not generating an ECOFF file, this is much too - confusing to deal with. */ - if (info->hash->creator->flavour != bfd_get_flavour (abfd)) - return true; - - /* If there are no relocs, there is nothing to do. */ - if (sec->reloc_count == 0) - return true; - - /* We are only interested in PC relative relocs, and why would there - ever be one from anything but the .text section? */ - if (strcmp (bfd_get_section_name (abfd, sec), ".text") != 0) - return true; - - /* Read in the relocs, if we haven't already got them. */ - section_tdata = ecoff_section_data (abfd, sec); - if (section_tdata == (struct ecoff_section_tdata *) NULL - || section_tdata->external_relocs == NULL) - { - if (! mips_read_relocs (abfd, sec)) - goto error_return; - section_tdata = ecoff_section_data (abfd, sec); - } - - if (sec->_cooked_size == 0) - { - /* We must initialize _cooked_size only the first time we are - called. */ - sec->_cooked_size = sec->_raw_size; - } - - contents = section_tdata->contents; - offsets = section_tdata->offsets; - - /* Look for any external PC relative relocs. Internal PC relative - relocs are already correct in the object file, so they certainly - can not overflow. */ - ext_rel = (struct external_reloc *) section_tdata->external_relocs; - ext_rel_end = ext_rel + sec->reloc_count; - for (i = 0; ext_rel < ext_rel_end; ext_rel++, i++) - { - struct internal_reloc int_rel; - struct ecoff_link_hash_entry *h; - asection *hsec; - bfd_signed_vma relocation; - struct external_reloc *adj_ext_rel; - unsigned int adj_i; - unsigned long ext_count; - struct ecoff_link_hash_entry **adj_h_ptr; - struct ecoff_link_hash_entry **adj_h_ptr_end; - struct ecoff_value_adjust *adjust; - bfd_size_type amt; - - /* If we have already expanded this reloc, we certainly don't - need to do it again. */ - if (offsets != (long *) NULL && offsets[i] == 1) - continue; - - /* Quickly check that this reloc is external PCREL16. */ - if (bfd_header_big_endian (abfd)) - { - if ((ext_rel->r_bits[3] & RELOC_BITS3_EXTERN_BIG) == 0 - || (((ext_rel->r_bits[3] & RELOC_BITS3_TYPE_BIG) - >> RELOC_BITS3_TYPE_SH_BIG) - != MIPS_R_PCREL16)) - continue; - } - else - { - if ((ext_rel->r_bits[3] & RELOC_BITS3_EXTERN_LITTLE) == 0 - || (((ext_rel->r_bits[3] & RELOC_BITS3_TYPE_LITTLE) - >> RELOC_BITS3_TYPE_SH_LITTLE) - != MIPS_R_PCREL16)) - continue; - } - - mips_ecoff_swap_reloc_in (abfd, (PTR) ext_rel, &int_rel); - - h = ecoff_data (abfd)->sym_hashes[int_rel.r_symndx]; - if (h == (struct ecoff_link_hash_entry *) NULL) - abort (); - - if (h->root.type != bfd_link_hash_defined - && h->root.type != bfd_link_hash_defweak) - { - /* Just ignore undefined symbols. These will presumably - generate an error later in the link. */ - continue; - } - - /* Get the value of the symbol. */ - hsec = h->root.u.def.section; - relocation = (h->root.u.def.value - + hsec->output_section->vma - + hsec->output_offset); - - /* Subtract out the current address. */ - relocation -= (sec->output_section->vma - + sec->output_offset - + (int_rel.r_vaddr - sec->vma)); - - /* The addend is stored in the object file. In the normal case - of ``bal symbol'', the addend will be -4. It will only be - different in the case of ``bal symbol+constant''. To avoid - always reading in the section contents, we don't check the - addend in the object file (we could easily check the contents - if we happen to have already read them in, but I fear that - this could be confusing). This means we will screw up if - there is a branch to a symbol that is in range, but added to - a constant which puts it out of range; in such a case the - link will fail with a reloc overflow error. Since the - compiler will never generate such code, it should be easy - enough to work around it by changing the assembly code in the - source file. */ - relocation -= 4; - - /* Now RELOCATION is the number we want to put in the object - file. See whether it fits. */ - if (relocation >= -0x20000 && relocation < 0x20000) - continue; - - /* Now that we know this reloc needs work, which will rarely - happen, go ahead and grab the section contents. */ - if (contents == (bfd_byte *) NULL) - { - if (info->keep_memory) - contents = (bfd_byte *) bfd_alloc (abfd, sec->_raw_size); - else - contents = (bfd_byte *) bfd_malloc (sec->_raw_size); - if (contents == (bfd_byte *) NULL) - goto error_return; - if (! bfd_get_section_contents (abfd, sec, (PTR) contents, - (file_ptr) 0, sec->_raw_size)) - goto error_return; - if (info->keep_memory) - section_tdata->contents = contents; - } - - /* We only support changing the bal instruction. It would be - possible to handle other PC relative branches, but some of - them (the conditional branches) would require a different - length instruction sequence which would complicate both this - routine and mips_relax_pcrel16. It could be written if - somebody felt it were important. Ignoring this reloc will - presumably cause a reloc overflow error later on. */ - if (bfd_get_32 (abfd, contents + int_rel.r_vaddr - sec->vma) - != 0x0411ffff) /* bgezal $0,. == bal . */ - continue; - - /* Bother. We need to expand this reloc, and we will need to - make another relaxation pass since this change may put other - relocs out of range. We need to examine the local branches - and we need to allocate memory to hold the offsets we must - add to them. We also need to adjust the values of all - symbols in the object file following this location. */ - - sec->_cooked_size += PCREL16_EXPANSION_ADJUSTMENT; - *again = true; - - if (offsets == (long *) NULL) - { - bfd_size_type size; - - size = (bfd_size_type) sec->reloc_count * sizeof (long); - offsets = (long *) bfd_alloc (abfd, size); - if (offsets == (long *) NULL) - goto error_return; - memset (offsets, 0, (size_t) size); - section_tdata->offsets = offsets; - } - - offsets[i] = 1; - - /* Now look for all PC relative references that cross this reloc - and adjust their offsets. */ - adj_ext_rel = (struct external_reloc *) section_tdata->external_relocs; - for (adj_i = 0; adj_ext_rel < ext_rel_end; adj_ext_rel++, adj_i++) - { - struct internal_reloc adj_int_rel; - bfd_vma start, stop; - int change; - - mips_ecoff_swap_reloc_in (abfd, (PTR) adj_ext_rel, &adj_int_rel); - - if (adj_int_rel.r_type == MIPS_R_PCREL16) - { - unsigned long insn; - - /* We only care about local references. External ones - will be relocated correctly anyhow. */ - if (adj_int_rel.r_extern) - continue; - - /* We are only interested in a PC relative reloc within - this section. FIXME: Cross section PC relative - relocs may not be handled correctly; does anybody - care? */ - if (adj_int_rel.r_symndx != RELOC_SECTION_TEXT) - continue; - - start = adj_int_rel.r_vaddr; - - insn = bfd_get_32 (abfd, - contents + adj_int_rel.r_vaddr - sec->vma); - - stop = (insn & 0xffff) << 2; - if ((stop & 0x20000) != 0) - stop -= 0x40000; - stop += adj_int_rel.r_vaddr + 4; - } - else if (adj_int_rel.r_type == MIPS_R_RELHI) - { - struct internal_reloc rello; - long addhi, addlo; - - /* The next reloc must be MIPS_R_RELLO, and we handle - them together. */ - BFD_ASSERT (adj_ext_rel + 1 < ext_rel_end); - - mips_ecoff_swap_reloc_in (abfd, (PTR) (adj_ext_rel + 1), &rello); - - BFD_ASSERT (rello.r_type == MIPS_R_RELLO); - - addhi = bfd_get_32 (abfd, - contents + adj_int_rel.r_vaddr - sec->vma); - addhi &= 0xffff; - if (addhi & 0x8000) - addhi -= 0x10000; - addhi <<= 16; - - addlo = bfd_get_32 (abfd, contents + rello.r_vaddr - sec->vma); - addlo &= 0xffff; - if (addlo & 0x8000) - addlo -= 0x10000; - - if (adj_int_rel.r_extern) - { - /* The value we want here is - sym - RELLOaddr + addend - which we can express as - sym - (RELLOaddr - addend) - Therefore if we are expanding the area between - RELLOaddr and RELLOaddr - addend we must adjust - the addend. This is admittedly ambiguous, since - we might mean (sym + addend) - RELLOaddr, but in - practice we don't, and there is no way to handle - that case correctly since at this point we have - no idea whether any reloc is being expanded - between sym and sym + addend. */ - start = rello.r_vaddr - (addhi + addlo); - stop = rello.r_vaddr; - } - else - { - /* An internal RELHI/RELLO pair represents the - difference between two addresses, $LC0 - foo. - The symndx value is actually the difference - between the reloc address and $LC0. This lets us - compute $LC0, and, by considering the addend, - foo. If the reloc we are expanding falls between - those two relocs, we must adjust the addend. At - this point, the symndx value is actually in the - r_offset field, where it was put by - mips_ecoff_swap_reloc_in. */ - start = rello.r_vaddr - adj_int_rel.r_offset; - stop = start + addhi + addlo; - } - } - else if (adj_int_rel.r_type == MIPS_R_SWITCH) - { - /* A MIPS_R_SWITCH reloc represents a word of the form - .word $L3-$LS12 - The value in the object file is correct, assuming the - original value of $L3. The symndx value is actually - the difference between the reloc address and $LS12. - This lets us compute the original value of $LS12 as - vaddr - symndx - and the original value of $L3 as - vaddr - symndx + addend - where addend is the value from the object file. At - this point, the symndx value is actually found in the - r_offset field, since it was moved by - mips_ecoff_swap_reloc_in. */ - start = adj_int_rel.r_vaddr - adj_int_rel.r_offset; - stop = start + bfd_get_32 (abfd, - (contents - + adj_int_rel.r_vaddr - - sec->vma)); - } - else - continue; - - /* If the range expressed by this reloc, which is the - distance between START and STOP crosses the reloc we are - expanding, we must adjust the offset. The sign of the - adjustment depends upon the direction in which the range - crosses the reloc being expanded. */ - if (start <= int_rel.r_vaddr && stop > int_rel.r_vaddr) - change = PCREL16_EXPANSION_ADJUSTMENT; - else if (start > int_rel.r_vaddr && stop <= int_rel.r_vaddr) - change = - PCREL16_EXPANSION_ADJUSTMENT; - else - change = 0; - - offsets[adj_i] += change; - - if (adj_int_rel.r_type == MIPS_R_RELHI) - { - adj_ext_rel++; - adj_i++; - offsets[adj_i] += change; - } - } - - /* Find all symbols in this section defined by this object file - and adjust their values. Note that we decide whether to - adjust the value based on the value stored in the ECOFF EXTR - structure, because the value stored in the hash table may - have been changed by an earlier expanded reloc and thus may - no longer correctly indicate whether the symbol is before or - after the expanded reloc. */ - ext_count = ecoff_data (abfd)->debug_info.symbolic_header.iextMax; - adj_h_ptr = ecoff_data (abfd)->sym_hashes; - adj_h_ptr_end = adj_h_ptr + ext_count; - for (; adj_h_ptr < adj_h_ptr_end; adj_h_ptr++) - { - struct ecoff_link_hash_entry *adj_h; - - adj_h = *adj_h_ptr; - if (adj_h != (struct ecoff_link_hash_entry *) NULL - && (adj_h->root.type == bfd_link_hash_defined - || adj_h->root.type == bfd_link_hash_defweak) - && adj_h->root.u.def.section == sec - && adj_h->esym.asym.value > int_rel.r_vaddr) - adj_h->root.u.def.value += PCREL16_EXPANSION_ADJUSTMENT; - } - - /* Add an entry to the symbol value adjust list. This is used - by bfd_ecoff_debug_accumulate to adjust the values of - internal symbols and FDR's. */ - amt = sizeof (struct ecoff_value_adjust); - adjust = (struct ecoff_value_adjust *) bfd_alloc (abfd, amt); - if (adjust == (struct ecoff_value_adjust *) NULL) - goto error_return; - - adjust->start = int_rel.r_vaddr; - adjust->end = sec->vma + sec->_raw_size; - adjust->adjust = PCREL16_EXPANSION_ADJUSTMENT; - - adjust->next = ecoff_data (abfd)->debug_info.adjust; - ecoff_data (abfd)->debug_info.adjust = adjust; - } - - if (contents != (bfd_byte *) NULL && ! info->keep_memory) - free (contents); - - return true; - - error_return: - if (contents != (bfd_byte *) NULL && ! info->keep_memory) - free (contents); - return false; -} - -/* This routine is called from mips_relocate_section when a PC - relative reloc must be expanded into the five instruction sequence. - It handles all the details of the expansion, including resolving - the reloc. */ - -static boolean -mips_relax_pcrel16 (info, input_bfd, input_section, h, location, address) - struct bfd_link_info *info ATTRIBUTE_UNUSED; - bfd *input_bfd; - asection *input_section ATTRIBUTE_UNUSED; - struct ecoff_link_hash_entry *h; - bfd_byte *location; - bfd_vma address; -{ - bfd_vma relocation; - - /* 0x0411ffff is bgezal $0,. == bal . */ - BFD_ASSERT (bfd_get_32 (input_bfd, location) == 0x0411ffff); - - /* We need to compute the distance between the symbol and the - current address plus eight. */ - relocation = (h->root.u.def.value - + h->root.u.def.section->output_section->vma - + h->root.u.def.section->output_offset); - relocation -= address + 8; - - /* If the lower half is negative, increment the upper 16 half. */ - if ((relocation & 0x8000) != 0) - relocation += 0x10000; - - bfd_put_32 (input_bfd, (bfd_vma) 0x04110001, location); /* bal .+8 */ - bfd_put_32 (input_bfd, - 0x3c010000 | ((relocation >> 16) & 0xffff), /* lui $at,XX */ - location + 4); - bfd_put_32 (input_bfd, - 0x24210000 | (relocation & 0xffff), /* addiu $at,$at,XX */ - location + 8); - bfd_put_32 (input_bfd, - (bfd_vma) 0x003f0821, location + 12); /* addu $at,$at,$ra */ - bfd_put_32 (input_bfd, - (bfd_vma) 0x0020f809, location + 16); /* jalr $at */ - - return true; -} - -/* Given a .sdata section and a .rel.sdata in-memory section, store - relocation information into the .rel.sdata section which can be - used at runtime to relocate the section. This is called by the - linker when the --embedded-relocs switch is used. This is called - after the add_symbols entry point has been called for all the - objects, and before the final_link entry point is called. This - function presumes that the object was compiled using - -membedded-pic. */ - -boolean -bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) - bfd *abfd; - struct bfd_link_info *info; - asection *datasec; - asection *relsec; - char **errmsg; -{ - struct ecoff_link_hash_entry **sym_hashes; - struct ecoff_section_tdata *section_tdata; - struct external_reloc *ext_rel; - struct external_reloc *ext_rel_end; - bfd_byte *p; - bfd_size_type amt; - - BFD_ASSERT (! info->relocateable); - - *errmsg = NULL; - - if (datasec->reloc_count == 0) - return true; - - sym_hashes = ecoff_data (abfd)->sym_hashes; - - if (! mips_read_relocs (abfd, datasec)) - return false; - - amt = (bfd_size_type) datasec->reloc_count * 4; - relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt); - if (relsec->contents == NULL) - return false; - - p = relsec->contents; - - section_tdata = ecoff_section_data (abfd, datasec); - ext_rel = (struct external_reloc *) section_tdata->external_relocs; - ext_rel_end = ext_rel + datasec->reloc_count; - for (; ext_rel < ext_rel_end; ext_rel++, p += 4) - { - struct internal_reloc int_rel; - boolean text_relative; - - mips_ecoff_swap_reloc_in (abfd, (PTR) ext_rel, &int_rel); - - /* We are going to write a four byte word into the runtime reloc - section. The word will be the address in the data section - which must be relocated. This must be on a word boundary, - which means the lower two bits must be zero. We use the - least significant bit to indicate how the value in the data - section must be relocated. A 0 means that the value is - relative to the text section, while a 1 indicates that the - value is relative to the data section. Given that we are - assuming the code was compiled using -membedded-pic, there - should not be any other possibilities. */ - - /* We can only relocate REFWORD relocs at run time. */ - if (int_rel.r_type != MIPS_R_REFWORD) - { - *errmsg = _("unsupported reloc type"); - bfd_set_error (bfd_error_bad_value); - return false; - } - - if (int_rel.r_extern) - { - struct ecoff_link_hash_entry *h; - - h = sym_hashes[int_rel.r_symndx]; - /* If h is NULL, that means that there is a reloc against an - external symbol which we thought was just a debugging - symbol. This should not happen. */ - if (h == (struct ecoff_link_hash_entry *) NULL) - abort (); - if ((h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - && (h->root.u.def.section->flags & SEC_CODE) != 0) - text_relative = true; - else - text_relative = false; - } - else - { - switch (int_rel.r_symndx) - { - case RELOC_SECTION_TEXT: - text_relative = true; - break; - case RELOC_SECTION_SDATA: - case RELOC_SECTION_SBSS: - case RELOC_SECTION_LIT8: - text_relative = false; - break; - default: - /* No other sections should appear in -membedded-pic - code. */ - *errmsg = _("reloc against unsupported section"); - bfd_set_error (bfd_error_bad_value); - return false; - } - } - - if ((int_rel.r_offset & 3) != 0) - { - *errmsg = _("reloc not properly aligned"); - bfd_set_error (bfd_error_bad_value); - return false; - } - - bfd_put_32 (abfd, - (int_rel.r_vaddr - datasec->vma + datasec->output_offset - + (text_relative ? 0 : 1)), - p); - } - - return true; -} - -/* This is the ECOFF backend structure. The backend field of the - target vector points to this. */ - -static const struct ecoff_backend_data mips_ecoff_backend_data = -{ - /* COFF backend structure. */ - { - (void (*) PARAMS ((bfd *,PTR,int,int,int,int,PTR))) bfd_void, /* aux_in */ - (void (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* sym_in */ - (void (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* lineno_in */ - (unsigned (*) PARAMS ((bfd *,PTR,int,int,int,int,PTR)))bfd_void,/*aux_out*/ - (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* sym_out */ - (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* lineno_out */ - (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */ - mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out, - mips_ecoff_swap_scnhdr_out, - FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, false, 2, - mips_ecoff_swap_filehdr_in, mips_ecoff_swap_aouthdr_in, - mips_ecoff_swap_scnhdr_in, NULL, - mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook, - _bfd_ecoff_mkobject_hook, _bfd_ecoff_styp_to_sec_flags, - _bfd_ecoff_set_alignment_hook, _bfd_ecoff_slurp_symbol_table, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL - }, - /* Supported architecture. */ - bfd_arch_mips, - /* Initial portion of armap string. */ - "__________", - /* The page boundary used to align sections in a demand-paged - executable file. E.g., 0x1000. */ - 0x1000, - /* True if the .rdata section is part of the text segment, as on the - Alpha. False if .rdata is part of the data segment, as on the - MIPS. */ - false, - /* Bitsize of constructor entries. */ - 32, - /* Reloc to use for constructor entries. */ - &mips_howto_table[MIPS_R_REFWORD], - { - /* Symbol table magic number. */ - magicSym, - /* Alignment of debugging information. E.g., 4. */ - 4, - /* Sizes of external symbolic information. */ - sizeof (struct hdr_ext), - sizeof (struct dnr_ext), - sizeof (struct pdr_ext), - sizeof (struct sym_ext), - sizeof (struct opt_ext), - sizeof (struct fdr_ext), - sizeof (struct rfd_ext), - sizeof (struct ext_ext), - /* Functions to swap in external symbolic data. */ - ecoff_swap_hdr_in, - ecoff_swap_dnr_in, - ecoff_swap_pdr_in, - ecoff_swap_sym_in, - ecoff_swap_opt_in, - ecoff_swap_fdr_in, - ecoff_swap_rfd_in, - ecoff_swap_ext_in, - _bfd_ecoff_swap_tir_in, - _bfd_ecoff_swap_rndx_in, - /* Functions to swap out external symbolic data. */ - ecoff_swap_hdr_out, - ecoff_swap_dnr_out, - ecoff_swap_pdr_out, - ecoff_swap_sym_out, - ecoff_swap_opt_out, - ecoff_swap_fdr_out, - ecoff_swap_rfd_out, - ecoff_swap_ext_out, - _bfd_ecoff_swap_tir_out, - _bfd_ecoff_swap_rndx_out, - /* Function to read in symbolic data. */ - _bfd_ecoff_slurp_symbolic_info - }, - /* External reloc size. */ - RELSZ, - /* Reloc swapping functions. */ - mips_ecoff_swap_reloc_in, - mips_ecoff_swap_reloc_out, - /* Backend reloc tweaking. */ - mips_adjust_reloc_in, - mips_adjust_reloc_out, - /* Relocate section contents while linking. */ - mips_relocate_section, - /* Do final adjustments to filehdr and aouthdr. */ - NULL, - /* Read an element from an archive at a given file position. */ - _bfd_get_elt_at_filepos -}; - -/* Looking up a reloc type is MIPS specific. */ -#define _bfd_ecoff_bfd_reloc_type_lookup mips_bfd_reloc_type_lookup - -/* Getting relocated section contents is generic. */ -#define _bfd_ecoff_bfd_get_relocated_section_contents \ - bfd_generic_get_relocated_section_contents - -/* Handling file windows is generic. */ -#define _bfd_ecoff_get_section_contents_in_window \ - _bfd_generic_get_section_contents_in_window - -/* Relaxing sections is MIPS specific. */ -#define _bfd_ecoff_bfd_relax_section mips_relax_section - -/* GC of sections is not done. */ -#define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections - -/* Merging of sections is not done. */ -#define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections - -extern const bfd_target ecoff_big_vec; - -const bfd_target ecoff_little_vec = -{ - "ecoff-littlemips", /* name */ - bfd_target_ecoff_flavour, - BFD_ENDIAN_LITTLE, /* data byte order is little */ - BFD_ENDIAN_LITTLE, /* header byte order is 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), - 0, /* leading underscore */ - ' ', /* 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, coff_object_p, /* bfd_check_format */ - _bfd_ecoff_archive_p, _bfd_dummy_target}, - {bfd_false, _bfd_ecoff_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, _bfd_ecoff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (_bfd_ecoff), - BFD_JUMP_TABLE_COPY (_bfd_ecoff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff), - BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff), - BFD_JUMP_TABLE_RELOCS (_bfd_ecoff), - BFD_JUMP_TABLE_WRITE (_bfd_ecoff), - BFD_JUMP_TABLE_LINK (_bfd_ecoff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - & ecoff_big_vec, - - (PTR) &mips_ecoff_backend_data -}; - -const bfd_target ecoff_big_vec = -{ - "ecoff-bigmips", /* name */ - bfd_target_ecoff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is 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), - 0, /* leading underscore */ - ' ', /* 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, - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - _bfd_ecoff_archive_p, _bfd_dummy_target}, - {bfd_false, _bfd_ecoff_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, _bfd_ecoff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (_bfd_ecoff), - BFD_JUMP_TABLE_COPY (_bfd_ecoff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff), - BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff), - BFD_JUMP_TABLE_RELOCS (_bfd_ecoff), - BFD_JUMP_TABLE_WRITE (_bfd_ecoff), - BFD_JUMP_TABLE_LINK (_bfd_ecoff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - & ecoff_little_vec, - - (PTR) &mips_ecoff_backend_data -}; - -const bfd_target ecoff_biglittle_vec = -{ - "ecoff-biglittlemips", /* name */ - bfd_target_ecoff_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 | D_PAGED), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), - 0, /* leading underscore */ - ' ', /* 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_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_ecoff_archive_p, _bfd_dummy_target}, - {bfd_false, _bfd_ecoff_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, _bfd_ecoff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (_bfd_ecoff), - BFD_JUMP_TABLE_COPY (_bfd_ecoff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff), - BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff), - BFD_JUMP_TABLE_RELOCS (_bfd_ecoff), - BFD_JUMP_TABLE_WRITE (_bfd_ecoff), - BFD_JUMP_TABLE_LINK (_bfd_ecoff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - NULL, - - (PTR) &mips_ecoff_backend_data -}; diff --git a/contrib/binutils/bfd/coff-tic30.c b/contrib/binutils/bfd/coff-tic30.c deleted file mode 100644 index a3bbc4c8d23b..000000000000 --- a/contrib/binutils/bfd/coff-tic30.c +++ /dev/null @@ -1,210 +0,0 @@ -/* BFD back-end for TMS320C30 coff binaries. - 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. - - 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. */ - -#include "bfd.h" -#include "sysdep.h" -#include "libbfd.h" -#include "bfdlink.h" -#include "coff/tic30.h" -#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) - }; - -#ifndef coff_bfd_reloc_type_lookup -#define coff_bfd_reloc_type_lookup tic30_coff_reloc_type_lookup - -/* 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; - bfd_reloc_code_real_type code; -{ - switch (code) - { - case BFD_RELOC_8: - case BFD_RELOC_TIC30_LDP: - return &tic30_coff_howto_table[2]; - case BFD_RELOC_16: - return &tic30_coff_howto_table[0]; - case BFD_RELOC_24: - return &tic30_coff_howto_table[1]; - case BFD_RELOC_16_PCREL: - return &tic30_coff_howto_table[4]; - case BFD_RELOC_32: - return &tic30_coff_howto_table[3]; - default: - return (reloc_howto_type *) NULL; - } -} - -#endif - -/* Turn a howto into a reloc number. */ - -static int -coff_tic30_select_reloc (howto) - reloc_howto_type *howto; -{ - return howto->type; -} - -#define SELECT_RELOC(x,howto) x.r_type = coff_tic30_select_reloc(howto) - -#define BADMAG(x) TIC30BADMAG(x) -#define TIC30 1 /* Customize coffcode.h */ -#define __A_MAGIC_SET__ - -/* Code to swap in the reloc */ -#define SWAP_IN_RELOC_OFFSET H_GET_32 -#define SWAP_OUT_RELOC_OFFSET 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. */ - -static void -rtype2howto (internal, dst) - arelent *internal; - struct internal_reloc *dst; -{ - switch (dst->r_type) - { - case R_TIC30_ABS16: - internal->howto = &tic30_coff_howto_table[0]; - break; - case R_TIC30_ABS24: - internal->howto = &tic30_coff_howto_table[1]; - break; - case R_TIC30_ABS32: - internal->howto = &tic30_coff_howto_table[3]; - break; - case R_TIC30_LDP: - internal->howto = &tic30_coff_howto_table[2]; - break; - case R_TIC30_PC16: - internal->howto = &tic30_coff_howto_table[4]; - break; - default: - abort (); - break; - } -} - -#define RTYPE2HOWTO(internal, relocentry) rtype2howto (internal, relocentry) - -/* 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; - -#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ - reloc_processing(relent, reloc, symbols, abfd, section) - -static void -reloc_processing (relent, reloc, symbols, abfd, section) - arelent *relent; - struct internal_reloc *reloc; - asymbol **symbols; - bfd *abfd; - asection *section; -{ - relent->address = reloc->r_vaddr; - rtype2howto (relent, reloc); - - if (reloc->r_symndx > 0) - relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; - else - relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - - relent->addend = reloc->r_offset; - relent->address -= section->vma; -} - -#include "coffcode.h" - -const bfd_target tic30_coff_vec = -{ - "coff-tic30", /* name */ - bfd_target_coff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_LITTLE, /* header byte order is little */ - - (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_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_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 (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - NULL, - - COFF_SWAP_TABLE -}; diff --git a/contrib/binutils/bfd/coff-z8k.c b/contrib/binutils/bfd/coff-z8k.c deleted file mode 100644 index c626cd75257d..000000000000 --- a/contrib/binutils/bfd/coff-z8k.c +++ /dev/null @@ -1,338 +0,0 @@ -/* BFD back-end for Zilog Z800n COFF binaries. - Copyright 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001 - Free Software Foundation, Inc. - Contributed by Cygnus Support. - Written by Steve Chamberlain, <sac@cygnus.com>. - -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. */ - -#include "bfd.h" -#include "sysdep.h" -#include "libbfd.h" -#include "bfdlink.h" -#include "coff/z8k.h" -#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 = -HOWTO (R_IMM32, 0, 2, 32, false, 0, - complain_overflow_bitfield, 0, "r_imm32", true, 0xffffffff, - 0xffffffff, false); - -static reloc_howto_type r_imm4l = -HOWTO (R_IMM4L, 0, 0, 4, false, 0, - complain_overflow_bitfield, 0, "r_imm4l", true, 0xf, 0xf, false); - -static reloc_howto_type r_da = -HOWTO (R_IMM16, 0, 1, 16, false, 0, - complain_overflow_bitfield, 0, "r_da", true, 0x0000ffff, 0x0000ffff, - false); - -static reloc_howto_type r_imm8 = -HOWTO (R_IMM8, 0, 0, 8, false, 0, - complain_overflow_bitfield, 0, "r_imm8", true, 0x000000ff, 0x000000ff, - false); - -static reloc_howto_type r_rel16 = -HOWTO (R_REL16, 0, 1, 16, false, 0, - complain_overflow_bitfield, 0, "r_rel16", true, 0x0000ffff, 0x0000ffff, - true); - -static reloc_howto_type r_jr = -HOWTO (R_JR, 0, 0, 8, true, 0, complain_overflow_signed, 0, - "r_jr", true, 0, 0, true); - -static reloc_howto_type r_disp7 = -HOWTO (R_DISP7, 0, 0, 7, true, 0, complain_overflow_bitfield, 0, - "r_disp7", true, 0, 0, true); - -static reloc_howto_type r_callr = -HOWTO (R_CALLR, 0, 1, 12, true, 0, complain_overflow_signed, 0, - "r_callr", true, 0xfff, 0xfff, true); - -/* Turn a howto into a reloc number */ - -static int -coff_z8k_select_reloc (howto) - reloc_howto_type *howto; -{ - return howto->type; -} - -#define SELECT_RELOC(x,howto) x.r_type = coff_z8k_select_reloc(howto) - -#define BADMAG(x) Z8KBADMAG(x) -#define Z8K 1 /* Customize coffcode.h */ -#define __A_MAGIC_SET__ - -/* Code to swap in the reloc. */ -#define SWAP_IN_RELOC_OFFSET H_GET_32 -#define SWAP_OUT_RELOC_OFFSET 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. */ - -static void -rtype2howto (internal, dst) - arelent * internal; - struct internal_reloc *dst; -{ - switch (dst->r_type) - { - default: - abort (); - break; - case R_IMM8: - internal->howto = &r_imm8; - break; - case R_IMM16: - internal->howto = &r_da; - break; - case R_JR: - internal->howto = &r_jr; - break; - case R_DISP7: - internal->howto = &r_disp7; - break; - case R_CALLR: - internal->howto = &r_callr; - break; - case R_REL16: - internal->howto = &r_rel16; - break; - case R_IMM32: - internal->howto = &r_imm32; - break; - case R_IMM4L: - internal->howto = &r_imm4l; - break; - } -} - -#define RTYPE2HOWTO(internal, relocentry) rtype2howto (internal, relocentry) - -/* 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; - -#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ - reloc_processing(relent, reloc, symbols, abfd, section) - -static void -reloc_processing (relent, reloc, symbols, abfd, section) - arelent * relent; - struct internal_reloc * reloc; - asymbol ** symbols; - bfd * abfd; - asection * section; -{ - relent->address = reloc->r_vaddr; - rtype2howto (relent, reloc); - - if (reloc->r_symndx > 0) - relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; - else - relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - - relent->addend = reloc->r_offset; - relent->address -= section->vma; -} - -static void -extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) - bfd * in_abfd; - struct bfd_link_info * link_info; - struct bfd_link_order * link_order; - arelent * reloc; - bfd_byte * data; - unsigned int * src_ptr; - unsigned int * dst_ptr; -{ - asection * input_section = link_order->u.indirect.section; - - switch (reloc->howto->type) - { - case R_IMM8: - bfd_put_8 (in_abfd, - bfd_coff_reloc16_get_value (reloc, link_info, input_section), - data + *dst_ptr); - (*dst_ptr) += 1; - (*src_ptr) += 1; - break; - - case R_IMM32: - bfd_put_32 (in_abfd, - /* 0x80000000 indicates a long segmented address. */ - bfd_coff_reloc16_get_value (reloc, link_info, input_section) | 0x80000000, - data + *dst_ptr); - (*dst_ptr) += 4; - (*src_ptr) += 4; - break; - - case R_IMM4L: - bfd_put_8 (in_abfd, - ((bfd_get_8 (in_abfd, data + *dst_ptr) & 0xf0) - | (0x0f - & bfd_coff_reloc16_get_value (reloc, link_info, - input_section))), - data + *dst_ptr); - (*dst_ptr) += 1; - (*src_ptr) += 1; - break; - - case R_IMM16: - bfd_put_16 (in_abfd, - bfd_coff_reloc16_get_value (reloc, link_info, input_section), - data + *dst_ptr); - (*dst_ptr) += 2; - (*src_ptr) += 2; - break; - - case R_JR: - { - bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - bfd_vma dot = (link_order->offset - + *dst_ptr - + input_section->output_section->vma); - int gap = dst - dot - 1; /* -1, since we're in the odd byte of the - word and the pc's been incremented. */ - - if (gap & 1) - abort (); - gap /= 2; - if (gap > 128 || gap < -128) - { - 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 (in_abfd, gap, data + *dst_ptr); - (*dst_ptr)++; - (*src_ptr)++; - break; - } - - case R_DISP7: - { - bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - bfd_vma dot = (link_order->offset - + *dst_ptr - + input_section->output_section->vma); - int gap = dst - dot - 1; /* -1, since we're in the odd byte of the - word and the pc's been incremented. */ - - if (gap & 1) - abort (); - gap /= 2; - - if (gap > 0 || gap < -128) - { - 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 (in_abfd, - (bfd_get_8 ( in_abfd, data + *dst_ptr) & 0x80) + (-gap & 0x7f), - data + *dst_ptr); - (*dst_ptr)++; - (*src_ptr)++; - break; - } - - case R_CALLR: - { - bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - bfd_vma dot = (link_order->offset - + *dst_ptr - + input_section->output_section->vma); - int gap = dst - dot - 2; - - if (gap & 1) - abort (); - gap /= 2; - if (gap > 8191 || gap < -8192) - { - 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_16 (in_abfd, - (bfd_get_16 ( in_abfd, data + *dst_ptr) & 0xf000) | (-gap & 0x0fff), - data + *dst_ptr); - (*dst_ptr) += 2; - (*src_ptr) += 2; - break; - } - - case R_REL16: - { - bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - bfd_vma dot = (link_order->offset - + *dst_ptr - + input_section->output_section->vma); - int gap = dst - dot - 2; - - if (gap > 32767 || gap < -32768) - { - 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_16 (in_abfd, (bfd_vma) gap, data + *dst_ptr); - (*dst_ptr) += 2; - (*src_ptr) += 2; - break; - } - - default: - abort (); - } -} - -#define coff_reloc16_extra_cases extra_case - -#include "coffcode.h" - -#undef coff_bfd_get_relocated_section_contents -#undef coff_bfd_relax_section -#define coff_bfd_get_relocated_section_contents \ - bfd_coff_reloc16_get_relocated_section_contents -#define coff_bfd_relax_section bfd_coff_reloc16_relax_section - -CREATE_BIG_COFF_TARGET_VEC (z8kcoff_vec, "coff-z8k", 0, 0, '_', NULL) diff --git a/contrib/binutils/bfd/cpu-mips.c b/contrib/binutils/bfd/cpu-mips.c deleted file mode 100644 index d54b0a558914..000000000000 --- a/contrib/binutils/bfd/cpu-mips.c +++ /dev/null @@ -1,120 +0,0 @@ -/* bfd back-end for mips support - Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002 - Free Software Foundation, Inc. - Written by Steve Chamberlain of Cygnus Support. - -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. */ - -#include "bfd.h" -#include "sysdep.h" -#include "libbfd.h" - -static const bfd_arch_info_type *mips_compatible - PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); - -/* The default routine tests bits_per_word, which is wrong on mips as - mips word size doesn't correlate with reloc size. */ - -static const bfd_arch_info_type * -mips_compatible (a, b) - const bfd_arch_info_type *a; - const bfd_arch_info_type *b; -{ - if (a->arch != b->arch) - return NULL; - - if (a->mach > b->mach) - return a; - - if (b->mach > a->mach) - return b; - - return a; -} - -#define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \ - { \ - BITS_WORD, /* bits in a word */ \ - BITS_ADDR, /* bits in an address */ \ - 8, /* 8 bits in a byte */ \ - bfd_arch_mips, \ - NUMBER, \ - "mips", \ - PRINT, \ - 3, \ - DEFAULT, \ - mips_compatible, \ - bfd_default_scan, \ - NEXT, \ - } - -enum -{ - I_mips3000, - I_mips3900, - I_mips4000, - I_mips4010, - I_mips4100, - I_mips4111, - I_mips4300, - I_mips4400, - I_mips4600, - I_mips4650, - I_mips5000, - I_mips6000, - I_mips8000, - I_mips10000, - I_mips12000, - I_mips16, - I_mips5, - I_mipsisa32, - I_mipsisa64, - I_sb1, -}; - -#define NN(index) (&arch_info_struct[(index) + 1]) - -static const bfd_arch_info_type arch_info_struct[] = -{ - N (32, 32, bfd_mach_mips3000, "mips:3000", false, NN(I_mips3000)), - N (32, 32, bfd_mach_mips3900, "mips:3900", false, NN(I_mips3900)), - N (64, 64, bfd_mach_mips4000, "mips:4000", false, NN(I_mips4000)), - N (64, 64, bfd_mach_mips4010, "mips:4010", false, NN(I_mips4010)), - N (64, 64, bfd_mach_mips4100, "mips:4100", false, NN(I_mips4100)), - N (64, 64, bfd_mach_mips4111, "mips:4111", false, NN(I_mips4111)), - N (64, 64, bfd_mach_mips4300, "mips:4300", false, NN(I_mips4300)), - N (64, 64, bfd_mach_mips4400, "mips:4400", false, NN(I_mips4400)), - N (64, 64, bfd_mach_mips4600, "mips:4600", false, NN(I_mips4600)), - N (64, 64, bfd_mach_mips4650, "mips:4650", false, NN(I_mips4650)), - N (64, 64, bfd_mach_mips5000, "mips:5000", false, NN(I_mips5000)), - N (32, 32, bfd_mach_mips6000, "mips:6000", false, NN(I_mips6000)), - N (64, 64, bfd_mach_mips8000, "mips:8000", false, NN(I_mips8000)), - N (64, 64, bfd_mach_mips10000,"mips:10000", false, NN(I_mips10000)), - N (64, 64, bfd_mach_mips12000,"mips:12000", false, NN(I_mips12000)), - N (64, 64, bfd_mach_mips16, "mips:16", false, NN(I_mips16)), - N (64, 64, bfd_mach_mips5, "mips:mips5", false, NN(I_mips5)), - N (32, 32, bfd_mach_mipsisa32, "mips:isa32", false, NN(I_mipsisa32)), - N (64, 64, bfd_mach_mipsisa64, "mips:isa64", false, NN(I_mipsisa64)), - N (64, 64, bfd_mach_mips_sb1, "mips:sb1", false, 0), -}; - -/* The default architecture is mips:3000, but with a machine number of - zero. This lets the linker distinguish between a default setting - of mips, and an explicit setting of mips:3000. */ - -const bfd_arch_info_type bfd_mips_arch = -N (32, 32, 0, "mips", true, &arch_info_struct[0]); diff --git a/contrib/binutils/bfd/cpu-s390.c b/contrib/binutils/bfd/cpu-s390.c deleted file mode 100644 index ac0d45e0c75d..000000000000 --- a/contrib/binutils/bfd/cpu-s390.c +++ /dev/null @@ -1,56 +0,0 @@ -/* BFD support for the s390 processor. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. - Contributed by Carl B. Pedersen and Martin Schwidefsky. - - 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. */ - -#include "bfd.h" -#include "sysdep.h" -#include "libbfd.h" - -const bfd_arch_info_type bfd_s390_64_arch = -{ - 64, /* bits in a word */ - 64, /* bits in an address */ - 8, /* bits in a byte */ - bfd_arch_s390, - bfd_mach_s390_64, - "s390", - "s390:64-bit", - 3, /* section alignment power */ - true, /* the default */ - bfd_default_compatible, - bfd_default_scan, - NULL -}; - -const bfd_arch_info_type bfd_s390_arch = -{ - 32, /* bits in a word */ - 32, /* bits in an address */ - 8, /* bits in a byte */ - bfd_arch_s390, - bfd_mach_s390_31, - "s390", - "s390:31-bit", - 3, /* section alignment power */ - true, /* the default */ - bfd_default_compatible, - bfd_default_scan, - &bfd_s390_64_arch -}; diff --git a/contrib/binutils/bfd/cpu-tic30.c b/contrib/binutils/bfd/cpu-tic30.c deleted file mode 100644 index dd723f7b4a59..000000000000 --- a/contrib/binutils/bfd/cpu-tic30.c +++ /dev/null @@ -1,39 +0,0 @@ -/* BFD support for the Texas Instruments TMS320C30 architecture. - Copyright 1998 Free Software Foundation, Inc. - - 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. */ - -#include "bfd.h" -#include "sysdep.h" -#include "libbfd.h" - -const bfd_arch_info_type bfd_tic30_arch = -{ - 32, /* 32 bits in a word */ - 32, /* 32 bits in an address */ - 8, /* 8 bits in a byte */ - bfd_arch_tic30, - 0, /* only 1 machine */ - "tic30", - "tms320c30", - 2, - true, /* the one and only */ - bfd_default_compatible, - bfd_default_scan, - 0, -}; diff --git a/contrib/binutils/bfd/cpu-v850.c b/contrib/binutils/bfd/cpu-v850.c deleted file mode 100644 index 883636202663..000000000000 --- a/contrib/binutils/bfd/cpu-v850.c +++ /dev/null @@ -1,100 +0,0 @@ -/* BFD support for the NEC V850 processor - Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. - -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. */ - -#include "bfd.h" -#include "sysdep.h" -#include "libbfd.h" -#include "safe-ctype.h" - -static boolean scan PARAMS ((const struct bfd_arch_info *, const char *)); - -static boolean -scan (info, string) - const struct bfd_arch_info * info; - const char * string; -{ - const char *ptr_src; - const char *ptr_tst; - unsigned long number; - enum bfd_architecture arch; - - /* 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. */ - for (ptr_src = string, ptr_tst = info->arch_name; - *ptr_src && *ptr_tst; - ptr_src++, ptr_tst++) - if (*ptr_src != *ptr_tst) - break; - - /* Chewed up as much of the architecture as will match; - if there is a colon present skip it. */ - if (*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; - - number = 0; - while (ISDIGIT (*ptr_src)) - { - number = number * 10 + * ptr_src - '0'; - ptr_src ++; - } - - switch (number) - { - case bfd_mach_v850e: arch = bfd_arch_v850; break; - case bfd_mach_v850ea: arch = bfd_arch_v850; break; - default: - return false; - } - - if (arch != info->arch) - return false; - - if (number != info->mach) - return false; - - return true; -} - -#define N(number, print, default, next) \ -{ 32, 32, 8, bfd_arch_v850, number, "v850", print, 2, default, \ - bfd_default_compatible, scan, next } - -#define NEXT NULL - -static const bfd_arch_info_type arch_info_struct[] = -{ - 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] - -const bfd_arch_info_type bfd_v850_arch = - N (bfd_mach_v850, "v850", true, NEXT); diff --git a/contrib/binutils/bfd/cpu-z8k.c b/contrib/binutils/bfd/cpu-z8k.c deleted file mode 100644 index 0afdfc7560a3..000000000000 --- a/contrib/binutils/bfd/cpu-z8k.c +++ /dev/null @@ -1,193 +0,0 @@ -/* BFD library support routines for the Z800n architecture. - Copyright 1992, 1993, 1994, 2000, 2001 Free Software Foundation, Inc. - Hacked by Steve Chamberlain of Cygnus Support. - -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. */ - -#include "bfd.h" -#include "sysdep.h" -#include "libbfd.h" - -static boolean scan_mach - PARAMS ((const struct bfd_arch_info *, const char *)); -static const bfd_arch_info_type *compatible - PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); - -#if 0 /* not used currently */ -/* -Relocations for the Z8K - -*/ -static bfd_reloc_status_type -howto16_callback (abfd, reloc_entry, symbol_in, data, - ignore_input_section, ignore_bfd) - bfd *abfd; - arelent *reloc_entry; - struct symbol_cache_entry *symbol_in; - PTR data; - asection *ignore_input_section; - bfd *ignore_bfd; -{ - long relocation = 0; - bfd_vma addr = reloc_entry->address; - long x = bfd_get_16 (abfd, (bfd_byte *) data + addr); - - HOWTO_PREPARE (relocation, symbol_in); - - x = (x + relocation + reloc_entry->addend); - - bfd_put_16 (abfd, x, (bfd_byte *) data + addr); - return bfd_reloc_ok; -} - -static bfd_reloc_status_type -howto8_callback (abfd, reloc_entry, symbol_in, data, - ignore_input_section, ignore_bfd) - bfd *abfd; - arelent *reloc_entry; - struct symbol_cache_entry *symbol_in; - PTR data; - asection *ignore_input_section; - bfd *ignore_bfd; -{ - long relocation = 0; - bfd_vma addr = reloc_entry->address; - long x = bfd_get_8 (abfd, (bfd_byte *) data + addr); - - HOWTO_PREPARE (relocation, symbol_in); - - x = (x + relocation + reloc_entry->addend); - - bfd_put_8 (abfd, x, (bfd_byte *) data + addr); - return bfd_reloc_ok; -} - -static bfd_reloc_status_type -howto8_FFnn_callback (abfd, reloc_entry, symbol_in, data, - ignore_input_section, ignore_bfd) - bfd *abfd; - arelent *reloc_entry; - struct symbol_cache_entry *symbol_in; - PTR data; - asection *ignore_input_section; - bfd *ignore_bfd; -{ - long relocation = 0; - bfd_vma addr = reloc_entry->address; - - long x = bfd_get_8 (abfd, (bfd_byte *) data + addr); - abort (); - HOWTO_PREPARE (relocation, symbol_in); - - x = (x + relocation + reloc_entry->addend); - - bfd_put_8 (abfd, x, (bfd_byte *) data + addr); - return bfd_reloc_ok; -} - -static bfd_reloc_status_type -howto8_pcrel_callback (abfd, reloc_entry, symbol_in, data, - ignore_input_section, ignore_bfd) - bfd *abfd; - arelent *reloc_entry; - struct symbol_cache_entry *symbol_in; - PTR data; - asection *ignore_input_section; - bfd *ignore_bfd; -{ - long relocation = 0; - bfd_vma addr = reloc_entry->address; - long x = bfd_get_8 (abfd, (bfd_byte *) data + addr); - abort (); - HOWTO_PREPARE (relocation, symbol_in); - - x = (x + relocation + reloc_entry->addend); - - bfd_put_8 (abfd, x, (bfd_byte *) data + addr); - return bfd_reloc_ok; -} - -static reloc_howto_type howto_16 -= NEWHOWTO (howto16_callback, "abs16", 1, false, false); -static reloc_howto_type howto_8 -= NEWHOWTO (howto8_callback, "abs8", 0, false, false); - -static reloc_howto_type howto_8_FFnn -= NEWHOWTO (howto8_FFnn_callback, "ff00+abs8", 0, false, false); - -static reloc_howto_type howto_8_pcrel -= NEWHOWTO (howto8_pcrel_callback, "pcrel8", 0, false, true); - -static reloc_howto_type * -local_bfd_reloc_type_lookup (arch, code) - const struct bfd_arch_info *arch; - bfd_reloc_code_real_type code; -{ - switch (code) - { - case BFD_RELOC_16: - return &howto_16; - case BFD_RELOC_8_FFnn: - return &howto_8_FFnn; - case BFD_RELOC_8: - return &howto_8; - case BFD_RELOC_8_PCREL: - return &howto_8_pcrel; - default: - return (reloc_howto_type *) NULL; - } -} -#endif - -static boolean -scan_mach (info, string) - const struct bfd_arch_info *info; - const char *string; -{ - if (strcmp (string, "z8001") == 0 || strcmp (string, "z8k") == 0) - { - return bfd_mach_z8001 == info->mach; - } - if (strcmp (string, "z8002") == 0) - { - return bfd_mach_z8002 == info->mach; - } - return false; -} - -/* This routine is provided two arch_infos and returns whether - they'd be compatible */ - -static const bfd_arch_info_type * -compatible (a, b) - const bfd_arch_info_type *a; - const bfd_arch_info_type *b; -{ - if (a->arch != b->arch || a->mach != b->mach) - return NULL; - return a; -} - -static const bfd_arch_info_type arch_info_struct[] = -{ - {32, 32, 8, bfd_arch_z8k, bfd_mach_z8001, "z8k", "z8001", 1, false, compatible, scan_mach, 0,}, -}; - -const bfd_arch_info_type bfd_z8k_arch = -{ - 32, 16, 8, bfd_arch_z8k, bfd_mach_z8002, "z8k", "z8002", 1, true, compatible, scan_mach, &arch_info_struct[0], -}; diff --git a/contrib/binutils/bfd/doc/bfd.texi b/contrib/binutils/bfd/doc/bfd.texi deleted file mode 100644 index ea0ca9e56dc9..000000000000 --- a/contrib/binutils/bfd/doc/bfd.texi +++ /dev/null @@ -1,585 +0,0 @@ -@section @code{typedef bfd} -A BFD has type @code{bfd}; objects of this type are the -cornerstone of any application using BFD. Using BFD -consists of making references though the BFD and to data in the BFD. - -Here is the structure that defines the type @code{bfd}. It -contains the major data about the file and pointers -to the rest of the data. -@* -. -@example -struct _bfd -@{ - /* The filename the application opened the BFD with. */ - CONST char *filename; - - /* A pointer to the target jump table. */ - const struct bfd_target *xvec; - - /* To avoid dragging too many header files into every file that - includes `@code{bfd.h}', IOSTREAM has been declared as a "char - *", and MTIME as a "long". Their correct types, to which they - are cast when used, are "FILE *" and "time_t". The iostream - is the result of an fopen on the filename. However, if the - BFD_IN_MEMORY flag is set, then iostream is actually a pointer - to a bfd_in_memory struct. */ - PTR iostream; - - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - - boolean cacheable; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - - boolean target_defaulted; - - /* The caching routines use these to maintain a - least-recently-used list of BFDs */ - - struct _bfd *lru_prev, *lru_next; - - /* When a file is closed by the caching routines, BFD retains - state information on the file here: */ - - file_ptr where; - - /* and here: (``once'' means at least once) */ - - boolean opened_once; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time: */ - - boolean mtime_set; - - /* File modified time, if mtime_set is true: */ - - long mtime; - - /* Reserved for an unimplemented file locking extension.*/ - - int ifd; - - /* The format which belongs to the BFD. (object, core, etc.) */ - - bfd_format format; - - /* The direction the BFD was opened with*/ - - enum bfd_direction @{no_direction = 0, - read_direction = 1, - write_direction = 2, - both_direction = 3@} direction; - - /* Format_specific flags*/ - - flagword flags; - - /* Currently my_archive is tested before adding origin to - anything. I believe that this can become always an add of - origin, with origin set to 0 for non archive files. */ - - file_ptr origin; - - /* Remember when output has begun, to stop strange things - from happening. */ - boolean output_has_begun; - - /* Pointer to linked list of sections*/ - struct sec *sections; - - /* The number of sections */ - unsigned int section_count; - - /* Stuff only useful for object files: - The start address. */ - bfd_vma start_address; - - /* Used for input and output*/ - unsigned int symcount; - - /* Symbol table for output BFD (with symcount entries) */ - struct symbol_cache_entry **outsymbols; - - /* Pointer to structure which contains architecture information*/ - const struct bfd_arch_info *arch_info; - - /* Stuff only useful for archives:*/ - PTR arelt_data; - struct _bfd *my_archive; /* The containing archive BFD. */ - struct _bfd *next; /* The next BFD in the archive. */ - struct _bfd *archive_head; /* The first BFD in the archive. */ - boolean has_armap; - - /* A chain of BFD structures involved in a link. */ - struct _bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; - - /* Used by the back end to hold private data. */ - - union - @{ - struct aout_data_struct *aout_data; - struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; - struct coff_tdata *coff_obj_data; - struct pe_tdata *pe_obj_data; - struct xcoff_tdata *xcoff_obj_data; - struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; - struct srec_data_struct *srec_data; - struct ihex_data_struct *ihex_data; - struct tekhex_data_struct *tekhex_data; - struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; - struct sun_core_struct *sun_core_data; - struct trad_core_struct *trad_core_data; - struct som_data_struct *som_data; - struct hpux_core_struct *hpux_core_data; - struct hppabsd_core_struct *hppabsd_core_data; - struct sgi_core_struct *sgi_core_data; - struct lynx_core_struct *lynx_core_data; - struct osf_core_struct *osf_core_data; - struct cisco_core_struct *cisco_core_data; - struct versados_data_struct *versados_data; - struct netbsd_core_struct *netbsd_core_data; - PTR any; - @} tdata; - - /* Used by the application to hold private data*/ - PTR usrdata; - - /* Where all the allocated stuff under this BFD goes. This is a - struct objalloc *, but we use PTR to avoid requiring the inclusion of - objalloc.h. */ - PTR memory; -@}; - -@end example -@section Error reporting -Most BFD functions return nonzero on success (check their -individual documentation for precise semantics). On an error, -they call @code{bfd_set_error} to set an error condition that callers -can check by calling @code{bfd_get_error}. -If that returns @code{bfd_error_system_call}, then check -@code{errno}. - -The easiest way to report a BFD error to the user is to -use @code{bfd_perror}. -@* -@subsection Type @code{bfd_error_type} -The values returned by @code{bfd_get_error} are defined by the -enumerated type @code{bfd_error_type}. -@* -. -@example -typedef enum bfd_error -@{ - bfd_error_no_error = 0, - bfd_error_system_call, - bfd_error_invalid_target, - bfd_error_wrong_format, - bfd_error_invalid_operation, - bfd_error_no_memory, - bfd_error_no_symbols, - bfd_error_no_armap, - bfd_error_no_more_archived_files, - bfd_error_malformed_archive, - bfd_error_file_not_recognized, - bfd_error_file_ambiguously_recognized, - bfd_error_no_contents, - bfd_error_nonrepresentable_section, - bfd_error_no_debug_section, - bfd_error_bad_value, - bfd_error_file_truncated, - bfd_error_file_too_big, - bfd_error_invalid_error_code -@} bfd_error_type; - -@end example -@findex bfd_get_error -@subsubsection @code{bfd_get_error} -@strong{Synopsis} -@example -bfd_error_type bfd_get_error (void); -@end example -@strong{Description}@* -Return the current BFD error condition. -@* -@findex bfd_set_error -@subsubsection @code{bfd_set_error} -@strong{Synopsis} -@example -void bfd_set_error (bfd_error_type error_tag); -@end example -@strong{Description}@* -Set the BFD error condition to be @var{error_tag}. -@* -@findex bfd_errmsg -@subsubsection @code{bfd_errmsg} -@strong{Synopsis} -@example -CONST char *bfd_errmsg (bfd_error_type error_tag); -@end example -@strong{Description}@* -Return a string describing the error @var{error_tag}, or -the system error if @var{error_tag} is @code{bfd_error_system_call}. -@* -@findex bfd_perror -@subsubsection @code{bfd_perror} -@strong{Synopsis} -@example -void bfd_perror (CONST char *message); -@end example -@strong{Description}@* -Print to the standard error stream a string describing the -last BFD error that occurred, or the last system error if -the last BFD error was a system call failure. If @var{message} -is non-NULL and non-empty, the error string printed is preceded -by @var{message}, a colon, and a space. It is followed by a newline. -@* -@subsection BFD error handler -Some BFD functions want to print messages describing the -problem. They call a BFD error handler function. This -function may be overriden by the program. - -The BFD error handler acts like printf. -@* -. -@example -typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...)); - -@end example -@findex bfd_set_error_handler -@subsubsection @code{bfd_set_error_handler} -@strong{Synopsis} -@example -bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); -@end example -@strong{Description}@* -Set the BFD error handler function. Returns the previous -function. -@* -@findex bfd_set_error_program_name -@subsubsection @code{bfd_set_error_program_name} -@strong{Synopsis} -@example -void bfd_set_error_program_name (const char *); -@end example -@strong{Description}@* -Set the program name to use when printing a BFD error. This -is printed before the error message followed by a colon and -space. The string must not be changed after it is passed to -this function. -@* -@section Symbols - -@* -@findex bfd_get_reloc_upper_bound -@subsubsection @code{bfd_get_reloc_upper_bound} -@strong{Synopsis} -@example -long bfd_get_reloc_upper_bound(bfd *abfd, asection *sect); -@end example -@strong{Description}@* -Return the number of bytes required to store the -relocation information associated with section @var{sect} -attached to bfd @var{abfd}. If an error occurs, return -1. -@* -@findex bfd_canonicalize_reloc -@subsubsection @code{bfd_canonicalize_reloc} -@strong{Synopsis} -@example -long bfd_canonicalize_reloc - (bfd *abfd, - asection *sec, - arelent **loc, - asymbol **syms); -@end example -@strong{Description}@* -Call the back end associated with the open BFD -@var{abfd} and translate the external form of the relocation -information attached to @var{sec} into the internal canonical -form. Place the table into memory at @var{loc}, which has -been preallocated, usually by a call to -@code{bfd_get_reloc_upper_bound}. Returns the number of relocs, or --1 on error. - -The @var{syms} table is also needed for horrible internal magic -reasons. -@* -@findex bfd_set_reloc -@subsubsection @code{bfd_set_reloc} -@strong{Synopsis} -@example -void bfd_set_reloc - (bfd *abfd, asection *sec, arelent **rel, unsigned int count) -@end example -@strong{Description}@* -Set the relocation pointer and count within -section @var{sec} to the values @var{rel} and @var{count}. -The argument @var{abfd} is ignored. -@* -@findex bfd_set_file_flags -@subsubsection @code{bfd_set_file_flags} -@strong{Synopsis} -@example -boolean bfd_set_file_flags(bfd *abfd, flagword flags); -@end example -@strong{Description}@* -Set the flag word in the BFD @var{abfd} to the value @var{flags}. - -Possible errors are: -@itemize @bullet - -@item -@code{bfd_error_wrong_format} - The target bfd was not of object format. -@item -@code{bfd_error_invalid_operation} - The target bfd was open for reading. -@item -@code{bfd_error_invalid_operation} - -The flag word contained a bit which was not applicable to the -type of file. E.g., an attempt was made to set the @code{D_PAGED} bit -on a BFD format which does not support demand paging. -@end itemize -@* -@findex bfd_set_start_address -@subsubsection @code{bfd_set_start_address} -@strong{Synopsis} -@example -boolean bfd_set_start_address(bfd *abfd, bfd_vma vma); -@end example -@strong{Description}@* -Make @var{vma} the entry point of output BFD @var{abfd}. -@* -@strong{Returns}@* -Returns @code{true} on success, @code{false} otherwise. -@* -@findex bfd_get_mtime -@subsubsection @code{bfd_get_mtime} -@strong{Synopsis} -@example -long bfd_get_mtime(bfd *abfd); -@end example -@strong{Description}@* -Return the file modification time (as read from the file system, or -from the archive header for archive members). -@* -@findex bfd_get_size -@subsubsection @code{bfd_get_size} -@strong{Synopsis} -@example -long bfd_get_size(bfd *abfd); -@end example -@strong{Description}@* -Return the file size (as read from file system) for the file -associated with BFD @var{abfd}. - -The initial motivation for, and use of, this routine is not -so we can get the exact size of the object the BFD applies to, since -that might not be generally possible (archive members for example). -It would be ideal if someone could eventually modify -it so that such results were guaranteed. - -Instead, we want to ask questions like "is this NNN byte sized -object I'm about to try read from file offset YYY reasonable?" -As as example of where we might do this, some object formats -use string tables for which the first @code{sizeof(long)} bytes of the -table contain the size of the table itself, including the size bytes. -If an application tries to read what it thinks is one of these -string tables, without some way to validate the size, and for -some reason the size is wrong (byte swapping error, wrong location -for the string table, etc.), the only clue is likely to be a read -error when it tries to read the table, or a "virtual memory -exhausted" error when it tries to allocate 15 bazillon bytes -of space for the 15 bazillon byte table it is about to read. -This function at least allows us to answer the quesion, "is the -size reasonable?". -@* -@findex bfd_get_gp_size -@subsubsection @code{bfd_get_gp_size} -@strong{Synopsis} -@example -int bfd_get_gp_size(bfd *abfd); -@end example -@strong{Description}@* -Return the maximum size of objects to be optimized using the GP -register under MIPS ECOFF. This is typically set by the @code{-G} -argument to the compiler, assembler or linker. -@* -@findex bfd_set_gp_size -@subsubsection @code{bfd_set_gp_size} -@strong{Synopsis} -@example -void bfd_set_gp_size(bfd *abfd, int i); -@end example -@strong{Description}@* -Set the maximum size of objects to be optimized using the GP -register under ECOFF or MIPS ELF. This is typically set by -the @code{-G} argument to the compiler, assembler or linker. -@* -@findex bfd_scan_vma -@subsubsection @code{bfd_scan_vma} -@strong{Synopsis} -@example -bfd_vma bfd_scan_vma(CONST char *string, CONST char **end, int base); -@end example -@strong{Description}@* -Convert, like @code{strtoul}, a numerical expression -@var{string} into a @code{bfd_vma} integer, and return that integer. -(Though without as many bells and whistles as @code{strtoul}.) -The expression is assumed to be unsigned (i.e., positive). -If given a @var{base}, it is used as the base for conversion. -A base of 0 causes the function to interpret the string -in hex if a leading "0x" or "0X" is found, otherwise -in octal if a leading zero is found, otherwise in decimal. - -Overflow is not detected. -@* -@findex bfd_copy_private_bfd_data -@subsubsection @code{bfd_copy_private_bfd_data} -@strong{Synopsis} -@example -boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd); -@end example -@strong{Description}@* -Copy private BFD information from the BFD @var{ibfd} to the -the BFD @var{obfd}. Return @code{true} on success, @code{false} on error. -Possible error returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{obfd}. -@end itemize -@example -#define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -@end example -@* -@findex bfd_merge_private_bfd_data -@subsubsection @code{bfd_merge_private_bfd_data} -@strong{Synopsis} -@example -boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd); -@end example -@strong{Description}@* -Merge private BFD information from the BFD @var{ibfd} to the -the output file BFD @var{obfd} when linking. Return @code{true} -on success, @code{false} on error. Possible error returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{obfd}. -@end itemize -@example -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) -@end example -@* -@findex bfd_set_private_flags -@subsubsection @code{bfd_set_private_flags} -@strong{Synopsis} -@example -boolean bfd_set_private_flags(bfd *abfd, flagword flags); -@end example -@strong{Description}@* -Set private BFD flag information in the BFD @var{abfd}. -Return @code{true} on success, @code{false} on error. Possible error -returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{obfd}. -@end itemize -@example -#define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, \ - (abfd, flags)) -@end example -@* -@findex stuff -@subsubsection @code{stuff} -@strong{Description}@* -Stuff which should be documented: -@example -#define bfd_sizeof_headers(abfd, reloc) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) - -#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ - BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line)) - - /* Do these three do anything useful at all, for any back end? */ -#define bfd_debug_info_start(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) - -#define bfd_debug_info_end(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) - -#define bfd_debug_info_accumulate(abfd, section) \ - BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) - - -#define bfd_stat_arch_elt(abfd, stat) \ - BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) - -#define bfd_update_armap_timestamp(abfd) \ - BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) - -#define bfd_set_arch_mach(abfd, arch, mach)\ - BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) - -#define bfd_relax_section(abfd, section, link_info, again) \ - BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) - -#define bfd_link_hash_table_create(abfd) \ - BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) - -#define bfd_link_add_symbols(abfd, info) \ - BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) - -#define bfd_final_link(abfd, info) \ - BFD_SEND (abfd, _bfd_final_link, (abfd, info)) - -#define bfd_free_cached_info(abfd) \ - BFD_SEND (abfd, _bfd_free_cached_info, (abfd)) - -#define bfd_get_dynamic_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd)) - -#define bfd_print_private_bfd_data(abfd, file)\ - BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file)) - -#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \ - BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols)) - -#define bfd_get_dynamic_reloc_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd)) - -#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \ - BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) - -extern bfd_byte *bfd_get_relocated_section_contents - PARAMS ((bfd *, struct bfd_link_info *, - struct bfd_link_order *, bfd_byte *, - boolean, asymbol **)); - -@end example -@* diff --git a/contrib/binutils/bfd/elf32-mips.c b/contrib/binutils/bfd/elf32-mips.c deleted file mode 100644 index ddfe4a0e7300..000000000000 --- a/contrib/binutils/bfd/elf32-mips.c +++ /dev/null @@ -1,10405 +0,0 @@ -/* MIPS-specific support for 32-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. - - Most of the information added by Ian Lance Taylor, Cygnus Support, - <ian@cygnus.com>. - N32/64 ABI support added by Mark Mitchell, CodeSourcery, LLC. - <mark@codesourcery.com> - Traditional MIPS targets support added by Koundinya.K, Dansk Data - Elektronik & Operations Research Group. <kk@ddeorg.soft.net> - -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 handles MIPS ELF targets. SGI Irix 5 uses a slightly - different MIPS ELF from other targets. This matters when linking. - This file supports both, switching at runtime. */ - -#include "bfd.h" -#include "sysdep.h" -#include "libbfd.h" -#include "bfdlink.h" -#include "genlink.h" -#include "elf-bfd.h" -#include "elf/mips.h" - -/* Get the ECOFF swapping routines. */ -#include "coff/sym.h" -#include "coff/symconst.h" -#include "coff/internal.h" -#include "coff/ecoff.h" -#include "coff/mips.h" -#define ECOFF_SIGNED_32 -#include "ecoffswap.h" - -/* This structure is used to hold .got information when linking. It - is stored in the tdata field of the bfd_elf_section_data structure. */ - -struct mips_got_info -{ - /* The global symbol in the GOT with the lowest index in the dynamic - symbol table. */ - struct elf_link_hash_entry *global_gotsym; - /* The number of global .got entries. */ - unsigned int global_gotno; - /* The number of local .got entries. */ - unsigned int local_gotno; - /* The number of local .got entries we have used. */ - unsigned int assigned_gotno; -}; - -/* The MIPS ELF linker needs additional information for each symbol in - the global hash table. */ - -struct mips_elf_link_hash_entry -{ - struct elf_link_hash_entry root; - - /* External symbol information. */ - EXTR esym; - - /* Number of R_MIPS_32, R_MIPS_REL32, or R_MIPS_64 relocs against - this symbol. */ - unsigned int possibly_dynamic_relocs; - - /* If the R_MIPS_32, R_MIPS_REL32, or R_MIPS_64 reloc is against - a readonly section. */ - boolean readonly_reloc; - - /* The index of the first dynamic relocation (in the .rel.dyn - section) against this symbol. */ - unsigned int min_dyn_reloc_index; - - /* We must not create a stub for a symbol that has relocations - related to taking the function's address, i.e. any but - R_MIPS_CALL*16 ones -- see "MIPS ABI Supplement, 3rd Edition", - p. 4-20. */ - boolean no_fn_stub; - - /* If there is a stub that 32 bit functions should use to call this - 16 bit function, this points to the section containing the stub. */ - asection *fn_stub; - - /* Whether we need the fn_stub; this is set if this symbol appears - in any relocs other than a 16 bit call. */ - boolean need_fn_stub; - - /* If there is a stub that 16 bit functions should use to call this - 32 bit function, this points to the section containing the stub. */ - asection *call_stub; - - /* This is like the call_stub field, but it is used if the function - being called returns a floating point value. */ - asection *call_fp_stub; - - /* Are we forced local? .*/ - boolean forced_local; -}; - -static bfd_reloc_status_type mips32_64bit_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static reloc_howto_type *mips_rtype_to_howto - PARAMS ((unsigned int)); -static void mips_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); -static void mips_info_to_howto_rela - PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); -static void bfd_mips_elf32_swap_gptab_in - PARAMS ((bfd *, const Elf32_External_gptab *, Elf32_gptab *)); -static void bfd_mips_elf32_swap_gptab_out - PARAMS ((bfd *, const Elf32_gptab *, Elf32_External_gptab *)); -#if 0 -static void bfd_mips_elf_swap_msym_in - PARAMS ((bfd *, const Elf32_External_Msym *, Elf32_Internal_Msym *)); -#endif -static void bfd_mips_elf_swap_msym_out - PARAMS ((bfd *, const Elf32_Internal_Msym *, Elf32_External_Msym *)); -static boolean mips_elf_sym_is_global PARAMS ((bfd *, asymbol *)); -static boolean mips_elf_create_procedure_table - PARAMS ((PTR, bfd *, struct bfd_link_info *, asection *, - struct ecoff_debug_info *)); -static INLINE int elf_mips_isa PARAMS ((flagword)); -static INLINE unsigned long elf_mips_mach PARAMS ((flagword)); -static INLINE char* elf_mips_abi_name PARAMS ((bfd *)); -static boolean mips_elf_is_local_label_name - PARAMS ((bfd *, const char *)); -static struct bfd_hash_entry *mips_elf_link_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static int gptab_compare PARAMS ((const void *, const void *)); -static bfd_reloc_status_type mips16_jump_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips16_gprel_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static boolean mips_elf_create_compact_rel_section - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean mips_elf_create_got_section - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_reloc_status_type mips_elf_final_gp - PARAMS ((bfd *, asymbol *, boolean, char **, bfd_vma *)); -static bfd_byte *elf32_mips_get_relocated_section_contents - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, boolean, asymbol **)); -static asection *mips_elf_create_msym_section - PARAMS ((bfd *)); -static void mips_elf_irix6_finish_dynamic_symbol - PARAMS ((bfd *, const char *, Elf_Internal_Sym *)); -static bfd_vma mips_elf_sign_extend PARAMS ((bfd_vma, int)); -static boolean mips_elf_overflow_p PARAMS ((bfd_vma, int)); -static bfd_vma mips_elf_high PARAMS ((bfd_vma)); -static bfd_vma mips_elf_higher PARAMS ((bfd_vma)); -static bfd_vma mips_elf_highest PARAMS ((bfd_vma)); -static bfd_vma mips_elf_global_got_index - PARAMS ((bfd *, struct elf_link_hash_entry *)); -static bfd_vma mips_elf_local_got_index - PARAMS ((bfd *, struct bfd_link_info *, bfd_vma)); -static bfd_vma mips_elf_got_offset_from_index - PARAMS ((bfd *, bfd *, bfd_vma)); -static boolean mips_elf_record_global_got_symbol - PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *, - struct mips_got_info *)); -static bfd_vma mips_elf_got_page - PARAMS ((bfd *, struct bfd_link_info *, bfd_vma, bfd_vma *)); -static const Elf_Internal_Rela *mips_elf_next_relocation - PARAMS ((unsigned int, const Elf_Internal_Rela *, - const Elf_Internal_Rela *)); -static bfd_reloc_status_type mips_elf_calculate_relocation - PARAMS ((bfd *, bfd *, asection *, struct bfd_link_info *, - const Elf_Internal_Rela *, bfd_vma, reloc_howto_type *, - Elf_Internal_Sym *, asection **, bfd_vma *, const char **, - boolean *)); -static bfd_vma mips_elf_obtain_contents - PARAMS ((reloc_howto_type *, const Elf_Internal_Rela *, bfd *, bfd_byte *)); -static boolean mips_elf_perform_relocation - PARAMS ((struct bfd_link_info *, reloc_howto_type *, - const Elf_Internal_Rela *, bfd_vma, - bfd *, asection *, bfd_byte *, boolean)); -static boolean mips_elf_assign_gp PARAMS ((bfd *, bfd_vma *)); -static boolean mips_elf_sort_hash_table_f - PARAMS ((struct mips_elf_link_hash_entry *, PTR)); -static boolean mips_elf_sort_hash_table - PARAMS ((struct bfd_link_info *, unsigned long)); -static asection * mips_elf_got_section PARAMS ((bfd *)); -static struct mips_got_info *mips_elf_got_info - PARAMS ((bfd *, asection **)); -static boolean mips_elf_local_relocation_p - PARAMS ((bfd *, const Elf_Internal_Rela *, asection **, boolean)); -static bfd_vma mips_elf_create_local_got_entry - PARAMS ((bfd *, struct mips_got_info *, asection *, bfd_vma)); -static bfd_vma mips_elf_got16_entry - PARAMS ((bfd *, struct bfd_link_info *, bfd_vma, boolean)); -static boolean mips_elf_create_dynamic_relocation - PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Rela *, - struct mips_elf_link_hash_entry *, asection *, - bfd_vma, bfd_vma *, asection *)); -static void mips_elf_allocate_dynamic_relocations - PARAMS ((bfd *, unsigned int)); -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 *, boolean)); -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 *)); -static boolean _bfd_elf32_mips_discard_info - PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *)); -static boolean _bfd_elf32_mips_ignore_discarded_relocs - PARAMS ((asection *)); -static boolean _bfd_elf32_mips_write_section - PARAMS ((bfd *, asection *, bfd_byte *)); - -extern const bfd_target bfd_elf32_tradbigmips_vec; -extern const bfd_target bfd_elf32_tradlittlemips_vec; -#ifdef BFD64 -extern const bfd_target bfd_elf64_tradbigmips_vec; -extern const bfd_target bfd_elf64_tradlittlemips_vec; -#endif - -/* The level of IRIX compatibility we're striving for. */ - -typedef enum { - ict_none, - ict_irix5, - ict_irix6 -} irix_compat_t; - -/* This will be used when we sort the dynamic relocation records. */ -static bfd *reldyn_sorting_bfd; - -/* Nonzero if ABFD is using the N32 ABI. */ - -#define ABI_N32_P(abfd) \ - ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0) - -/* Nonzero if ABFD is using the 64-bit ABI. */ -#define ABI_64_P(abfd) \ - ((elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64) != 0) - -/* Depending on the target vector we generate some version of Irix - executables or "normal" MIPS ELF ABI executables. */ -#ifdef BFD64 -#define IRIX_COMPAT(abfd) \ - (((abfd->xvec == &bfd_elf64_tradbigmips_vec) || \ - (abfd->xvec == &bfd_elf64_tradlittlemips_vec) || \ - (abfd->xvec == &bfd_elf32_tradbigmips_vec) || \ - (abfd->xvec == &bfd_elf32_tradlittlemips_vec)) ? ict_none : \ - ((ABI_N32_P (abfd) || ABI_64_P (abfd)) ? ict_irix6 : ict_irix5)) -#else -#define IRIX_COMPAT(abfd) \ - (((abfd->xvec == &bfd_elf32_tradbigmips_vec) || \ - (abfd->xvec == &bfd_elf32_tradlittlemips_vec)) ? ict_none : \ - ((ABI_N32_P (abfd) || ABI_64_P (abfd)) ? ict_irix6 : ict_irix5)) -#endif - -#define NEWABI_P(abfd) (ABI_N32_P(abfd) || ABI_64_P(abfd)) - -/* Whether we are trying to be compatible with IRIX at all. */ -#define SGI_COMPAT(abfd) \ - (IRIX_COMPAT (abfd) != ict_none) - -/* The name of the msym section. */ -#define MIPS_ELF_MSYM_SECTION_NAME(abfd) ".msym" - -/* The name of the srdata section. */ -#define MIPS_ELF_SRDATA_SECTION_NAME(abfd) ".srdata" - -/* The name of the options section. */ -#define MIPS_ELF_OPTIONS_SECTION_NAME(abfd) \ - (IRIX_COMPAT (abfd) == ict_irix6 ? ".MIPS.options" : ".options") - -/* The name of the stub section. */ -#define MIPS_ELF_STUB_SECTION_NAME(abfd) \ - (IRIX_COMPAT (abfd) == ict_irix6 ? ".MIPS.stubs" : ".stub") - -/* The name of the dynamic relocation section. */ -#define MIPS_ELF_REL_DYN_SECTION_NAME(abfd) ".rel.dyn" - -/* The size of an external REL relocation. */ -#define MIPS_ELF_REL_SIZE(abfd) \ - (get_elf_backend_data (abfd)->s->sizeof_rel) - -/* The size of an external dynamic table entry. */ -#define MIPS_ELF_DYN_SIZE(abfd) \ - (get_elf_backend_data (abfd)->s->sizeof_dyn) - -/* The size of a GOT entry. */ -#define MIPS_ELF_GOT_SIZE(abfd) \ - (get_elf_backend_data (abfd)->s->arch_size / 8) - -/* The size of a symbol-table entry. */ -#define MIPS_ELF_SYM_SIZE(abfd) \ - (get_elf_backend_data (abfd)->s->sizeof_sym) - -/* The default alignment for sections, as a power of two. */ -#define MIPS_ELF_LOG_FILE_ALIGN(abfd) \ - (get_elf_backend_data (abfd)->s->file_align == 8 ? 3 : 2) - -/* Get word-sized data. */ -#define MIPS_ELF_GET_WORD(abfd, ptr) \ - (ABI_64_P (abfd) ? bfd_get_64 (abfd, ptr) : bfd_get_32 (abfd, ptr)) - -/* Put out word-sized data. */ -#define MIPS_ELF_PUT_WORD(abfd, val, ptr) \ - (ABI_64_P (abfd) \ - ? bfd_put_64 (abfd, val, ptr) \ - : bfd_put_32 (abfd, val, ptr)) - -/* Add a dynamic symbol table-entry. */ -#ifdef BFD64 -#define MIPS_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \ - (ABI_64_P (elf_hash_table (info)->dynobj) \ - ? bfd_elf64_add_dynamic_entry (info, (bfd_vma) tag, (bfd_vma) val) \ - : bfd_elf32_add_dynamic_entry (info, (bfd_vma) tag, (bfd_vma) val)) -#else -#define MIPS_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \ - (ABI_64_P (elf_hash_table (info)->dynobj) \ - ? (boolean) (abort (), false) \ - : bfd_elf32_add_dynamic_entry (info, (bfd_vma) tag, (bfd_vma) val)) -#endif - -/* The number of local .got entries we reserve. */ -#define MIPS_RESERVED_GOTNO (2) - -/* Instructions which appear in a stub. For some reason the stub is - slightly different on an SGI system. */ -#define ELF_MIPS_GP_OFFSET(abfd) (SGI_COMPAT (abfd) ? 0x7ff0 : 0x8000) -#define STUB_LW(abfd) \ - (SGI_COMPAT (abfd) \ - ? (ABI_64_P (abfd) \ - ? 0xdf998010 /* ld t9,0x8010(gp) */ \ - : 0x8f998010) /* lw t9,0x8010(gp) */ \ - : 0x8f998010) /* lw t9,0x8000(gp) */ -#define STUB_MOVE(abfd) \ - (SGI_COMPAT (abfd) ? 0x03e07825 : 0x03e07821) /* move t7,ra */ -#define STUB_JALR 0x0320f809 /* jal t9 */ -#define STUB_LI16(abfd) \ - (SGI_COMPAT (abfd) ? 0x34180000 : 0x24180000) /* ori t8,zero,0 */ -#define MIPS_FUNCTION_STUB_SIZE (16) - -#if 0 -/* We no longer try to identify particular sections for the .dynsym - section. When we do, we wind up crashing if there are other random - sections with relocations. */ - -/* Names of sections which appear in the .dynsym section in an Irix 5 - executable. */ - -static const char * const mips_elf_dynsym_sec_names[] = -{ - ".text", - ".init", - ".fini", - ".data", - ".rodata", - ".sdata", - ".sbss", - ".bss", - NULL -}; - -#define SIZEOF_MIPS_DYNSYM_SECNAMES \ - (sizeof mips_elf_dynsym_sec_names / sizeof mips_elf_dynsym_sec_names[0]) - -/* The number of entries in mips_elf_dynsym_sec_names which go in the - text segment. */ - -#define MIPS_TEXT_DYNSYM_SECNO (3) - -#endif /* 0 */ - -/* The names of the runtime procedure table symbols used on Irix 5. */ - -static const char * const mips_elf_dynsym_rtproc_names[] = -{ - "_procedure_table", - "_procedure_string_table", - "_procedure_table_size", - NULL -}; - -/* These structures are used to generate the .compact_rel section on - Irix 5. */ - -typedef struct -{ - unsigned long id1; /* Always one? */ - unsigned long num; /* Number of compact relocation entries. */ - unsigned long id2; /* Always two? */ - unsigned long offset; /* The file offset of the first relocation. */ - unsigned long reserved0; /* Zero? */ - unsigned long reserved1; /* Zero? */ -} Elf32_compact_rel; - -typedef struct -{ - bfd_byte id1[4]; - bfd_byte num[4]; - bfd_byte id2[4]; - bfd_byte offset[4]; - bfd_byte reserved0[4]; - bfd_byte reserved1[4]; -} Elf32_External_compact_rel; - -typedef struct -{ - unsigned int ctype : 1; /* 1: long 0: short format. See below. */ - unsigned int rtype : 4; /* Relocation types. See below. */ - unsigned int dist2to : 8; - unsigned int relvaddr : 19; /* (VADDR - vaddr of the previous entry)/ 4 */ - unsigned long konst; /* KONST field. See below. */ - unsigned long vaddr; /* VADDR to be relocated. */ -} Elf32_crinfo; - -typedef struct -{ - unsigned int ctype : 1; /* 1: long 0: short format. See below. */ - unsigned int rtype : 4; /* Relocation types. See below. */ - unsigned int dist2to : 8; - unsigned int relvaddr : 19; /* (VADDR - vaddr of the previous entry)/ 4 */ - unsigned long konst; /* KONST field. See below. */ -} Elf32_crinfo2; - -typedef struct -{ - bfd_byte info[4]; - bfd_byte konst[4]; - bfd_byte vaddr[4]; -} Elf32_External_crinfo; - -typedef struct -{ - bfd_byte info[4]; - bfd_byte konst[4]; -} Elf32_External_crinfo2; - -/* These are the constants used to swap the bitfields in a crinfo. */ - -#define CRINFO_CTYPE (0x1) -#define CRINFO_CTYPE_SH (31) -#define CRINFO_RTYPE (0xf) -#define CRINFO_RTYPE_SH (27) -#define CRINFO_DIST2TO (0xff) -#define CRINFO_DIST2TO_SH (19) -#define CRINFO_RELVADDR (0x7ffff) -#define CRINFO_RELVADDR_SH (0) - -/* A compact relocation info has long (3 words) or short (2 words) - formats. A short format doesn't have VADDR field and relvaddr - fields contains ((VADDR - vaddr of the previous entry) >> 2). */ -#define CRF_MIPS_LONG 1 -#define CRF_MIPS_SHORT 0 - -/* There are 4 types of compact relocation at least. The value KONST - has different meaning for each type: - - (type) (konst) - CT_MIPS_REL32 Address in data - CT_MIPS_WORD Address in word (XXX) - CT_MIPS_GPHI_LO GP - vaddr - CT_MIPS_JMPAD Address to jump - */ - -#define CRT_MIPS_REL32 0xa -#define CRT_MIPS_WORD 0xb -#define CRT_MIPS_GPHI_LO 0xc -#define CRT_MIPS_JMPAD 0xd - -#define mips_elf_set_cr_format(x,format) ((x).ctype = (format)) -#define mips_elf_set_cr_type(x,type) ((x).rtype = (type)) -#define mips_elf_set_cr_dist2to(x,v) ((x).dist2to = (v)) -#define mips_elf_set_cr_relvaddr(x,d) ((x).relvaddr = (d)<<2) - -static void bfd_elf32_swap_compact_rel_out - PARAMS ((bfd *, const Elf32_compact_rel *, Elf32_External_compact_rel *)); -static void bfd_elf32_swap_crinfo_out - PARAMS ((bfd *, const Elf32_crinfo *, Elf32_External_crinfo *)); - -/* In case we're on a 32-bit machine, construct a 64-bit "-1" value - from smaller values. Start with zero, widen, *then* decrement. */ -#define MINUS_ONE (((bfd_vma)0) - 1) - -/* The relocation table used for SHT_REL sections. */ - -static reloc_howto_type elf_mips_howto_table_rel[] = -{ - /* No relocation. */ - HOWTO (R_MIPS_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_MIPS_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit relocation. */ - HOWTO (R_MIPS_16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit relocation. */ - HOWTO (R_MIPS_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit symbol relative relocation. */ - HOWTO (R_MIPS_REL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_REL32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 26 bit jump address. */ - HOWTO (R_MIPS_26, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - /* This needs complex overflow - detection, because the upper four - bits must match the PC + 4. */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_26", /* name */ - true, /* partial_inplace */ - 0x03ffffff, /* src_mask */ - 0x03ffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* High 16 bits of symbol value. */ - HOWTO (R_MIPS_HI16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_mips_elf_hi16_reloc, /* special_function */ - "R_MIPS_HI16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of symbol value. */ - HOWTO (R_MIPS_LO16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_mips_elf_lo16_reloc, /* special_function */ - "R_MIPS_LO16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* GP relative reference. */ - HOWTO (R_MIPS_GPREL16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - _bfd_mips_elf_gprel16_reloc, /* special_function */ - "R_MIPS_GPREL16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Reference to literal section. */ - HOWTO (R_MIPS_LITERAL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - _bfd_mips_elf_gprel16_reloc, /* special_function */ - "R_MIPS_LITERAL", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Reference to global offset table. */ - HOWTO (R_MIPS_GOT16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - _bfd_mips_elf_got16_reloc, /* special_function */ - "R_MIPS_GOT16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit PC relative reference. */ - HOWTO (R_MIPS_PC16, /* 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_MIPS_PC16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 16 bit call through global offset table. */ - HOWTO (R_MIPS_CALL16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit GP relative reference. */ - HOWTO (R_MIPS_GPREL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_mips_elf_gprel32_reloc, /* special_function */ - "R_MIPS_GPREL32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* The remaining relocs are defined on Irix 5, although they are - not defined by the ABI. */ - EMPTY_HOWTO (13), - EMPTY_HOWTO (14), - EMPTY_HOWTO (15), - - /* A 5 bit shift field. */ - HOWTO (R_MIPS_SHIFT5, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 5, /* bitsize */ - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT5", /* name */ - true, /* partial_inplace */ - 0x000007c0, /* src_mask */ - 0x000007c0, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 6 bit shift field. */ - /* FIXME: This is not handled correctly; a special function is - needed to put the most significant bit in the right place. */ - HOWTO (R_MIPS_SHIFT6, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 6, /* bitsize */ - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT6", /* name */ - true, /* partial_inplace */ - 0x000007c4, /* src_mask */ - 0x000007c4, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 64 bit relocation. */ - HOWTO (R_MIPS_64, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - mips32_64bit_reloc, /* special_function */ - "R_MIPS_64", /* name */ - true, /* partial_inplace */ - MINUS_ONE, /* src_mask */ - MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ - - /* Displacement in the global offset table. */ - HOWTO (R_MIPS_GOT_DISP, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_DISP", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Displacement to page pointer in the global offset table. */ - HOWTO (R_MIPS_GOT_PAGE, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_PAGE", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Offset from page pointer in the global offset table. */ - HOWTO (R_MIPS_GOT_OFST, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_OFST", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* High 16 bits of displacement in global offset table. */ - HOWTO (R_MIPS_GOT_HI16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_HI16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of displacement in global offset table. */ - HOWTO (R_MIPS_GOT_LO16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_LO16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 64 bit subtraction. Used in the N32 ABI. */ - HOWTO (R_MIPS_SUB, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SUB", /* name */ - true, /* partial_inplace */ - MINUS_ONE, /* src_mask */ - MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ - - /* Used to cause the linker to insert and delete instructions? */ - EMPTY_HOWTO (R_MIPS_INSERT_A), - EMPTY_HOWTO (R_MIPS_INSERT_B), - EMPTY_HOWTO (R_MIPS_DELETE), - - /* Get the higher value of a 64 bit addend. */ - HOWTO (R_MIPS_HIGHER, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_HIGHER", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Get the highest value of a 64 bit addend. */ - HOWTO (R_MIPS_HIGHEST, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_HIGHEST", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* High 16 bits of displacement in global offset table. */ - HOWTO (R_MIPS_CALL_HI16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL_HI16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of displacement in global offset table. */ - HOWTO (R_MIPS_CALL_LO16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL_LO16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Section displacement. */ - HOWTO (R_MIPS_SCN_DISP, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SCN_DISP", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - EMPTY_HOWTO (R_MIPS_REL16), - EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE), - EMPTY_HOWTO (R_MIPS_PJUMP), - EMPTY_HOWTO (R_MIPS_RELGOT), - - /* Protected jump conversion. This is an optimization hint. No - relocation is required for correctness. */ - HOWTO (R_MIPS_JALR, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_JALR", /* name */ - false, /* partial_inplace */ - 0x00000000, /* src_mask */ - 0x00000000, /* dst_mask */ - false), /* pcrel_offset */ -}; - -/* The relocation table used for SHT_RELA sections. */ - -static reloc_howto_type elf_mips_howto_table_rela[] = -{ - /* No relocation. */ - HOWTO (R_MIPS_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_MIPS_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit relocation. */ - HOWTO (R_MIPS_16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit relocation. */ - HOWTO (R_MIPS_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit symbol relative relocation. */ - HOWTO (R_MIPS_REL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_REL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 26 bit jump address. */ - HOWTO (R_MIPS_26, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - /* This needs complex overflow - detection, because the upper 36 - bits must match the PC + 4. */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_26", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x03ffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* R_MIPS_HI16 and R_MIPS_LO16 are unsupported for 64 bit REL. */ - /* High 16 bits of symbol value. */ - HOWTO (R_MIPS_HI16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_HI16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of symbol value. */ - HOWTO (R_MIPS_LO16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_LO16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* GP relative reference. */ - HOWTO (R_MIPS_GPREL16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - _bfd_mips_elf_gprel16_reloc, /* special_function */ - "R_MIPS_GPREL16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Reference to literal section. */ - HOWTO (R_MIPS_LITERAL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - _bfd_mips_elf_gprel16_reloc, /* special_function */ - "R_MIPS_LITERAL", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Reference to global offset table. */ - /* FIXME: This is not handled correctly. */ - HOWTO (R_MIPS_GOT16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit PC relative reference. */ - HOWTO (R_MIPS_PC16, /* 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_MIPS_PC16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 16 bit call through global offset table. */ - /* FIXME: This is not handled correctly. */ - HOWTO (R_MIPS_CALL16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit GP relative reference. */ - HOWTO (R_MIPS_GPREL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_mips_elf_gprel32_reloc, /* special_function */ - "R_MIPS_GPREL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - EMPTY_HOWTO (13), - EMPTY_HOWTO (14), - EMPTY_HOWTO (15), - - /* A 5 bit shift field. */ - HOWTO (R_MIPS_SHIFT5, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 5, /* bitsize */ - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT5", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x000007c0, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 6 bit shift field. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_SHIFT6, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 6, /* bitsize */ - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT6", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x000007c4, /* dst_mask */ - false), /* pcrel_offset */ - - /* 64 bit relocation. */ - HOWTO (R_MIPS_64, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_64", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ - - /* Displacement in the global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_DISP, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_DISP", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Displacement to page pointer in the global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_PAGE, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_PAGE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Offset from page pointer in the global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_OFST, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_OFST", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* High 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_HI16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_HI16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_LO16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_LO16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 64 bit substraction. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_SUB, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SUB", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ - - /* Insert the addend as an instruction. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_INSERT_A, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_INSERT_A", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Insert the addend as an instruction, and change all relocations - to refer to the old instruction at the address. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_INSERT_B, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_INSERT_B", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Delete a 32 bit instruction. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_DELETE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_DELETE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Get the higher value of a 64 bit addend. */ - HOWTO (R_MIPS_HIGHER, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_HIGHER", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Get the highest value of a 64 bit addend. */ - HOWTO (R_MIPS_HIGHEST, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_HIGHEST", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* High 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_CALL_HI16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL_HI16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_CALL_LO16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL_LO16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Section displacement, used by an associated event location section. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_SCN_DISP, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SCN_DISP", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_MIPS_REL16, /* 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_MIPS_REL16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* These two are obsolete. */ - EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE), - EMPTY_HOWTO (R_MIPS_PJUMP), - - /* Similiar to R_MIPS_REL32, but used for relocations in a GOT section. - It must be used for multigot GOT's (and only there). */ - HOWTO (R_MIPS_RELGOT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_RELGOT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Protected jump conversion. This is an optimization hint. No - relocation is required for correctness. */ - HOWTO (R_MIPS_JALR, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_JALR", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ -}; - -/* The reloc used for BFD_RELOC_CTOR when doing a 64 bit link. This - is a hack to make the linker think that we need 64 bit values. */ -static reloc_howto_type elf_mips_ctor64_howto = - HOWTO (R_MIPS_64, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - mips32_64bit_reloc, /* special_function */ - "R_MIPS_64", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false); /* pcrel_offset */ - -/* The reloc used for the mips16 jump instruction. */ -static reloc_howto_type elf_mips16_jump_howto = - HOWTO (R_MIPS16_26, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - /* This needs complex overflow - detection, because the upper four - bits must match the PC. */ - mips16_jump_reloc, /* special_function */ - "R_MIPS16_26", /* name */ - true, /* partial_inplace */ - 0x3ffffff, /* src_mask */ - 0x3ffffff, /* dst_mask */ - false); /* pcrel_offset */ - -/* The reloc used for the mips16 gprel instruction. */ -static reloc_howto_type elf_mips16_gprel_howto = - HOWTO (R_MIPS16_GPREL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - mips16_gprel_reloc, /* special_function */ - "R_MIPS16_GPREL", /* name */ - true, /* partial_inplace */ - 0x07ff001f, /* src_mask */ - 0x07ff001f, /* dst_mask */ - false); /* pcrel_offset */ - -/* GNU extensions for embedded-pic. */ -/* High 16 bits of symbol value, pc-relative. */ -static reloc_howto_type elf_mips_gnu_rel_hi16 = - HOWTO (R_MIPS_GNU_REL_HI16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_mips_elf_hi16_reloc, /* special_function */ - "R_MIPS_GNU_REL_HI16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - true); /* pcrel_offset */ - -/* Low 16 bits of symbol value, pc-relative. */ -static reloc_howto_type elf_mips_gnu_rel_lo16 = - HOWTO (R_MIPS_GNU_REL_LO16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_mips_elf_lo16_reloc, /* special_function */ - "R_MIPS_GNU_REL_LO16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - true); /* pcrel_offset */ - -/* 16 bit offset for pc-relative branches. */ -static reloc_howto_type elf_mips_gnu_rel16_s2 = - HOWTO (R_MIPS_GNU_REL16_S2, /* type */ - 2, /* 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_MIPS_GNU_REL16_S2", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - true); /* pcrel_offset */ - -/* 64 bit pc-relative. */ -static reloc_howto_type elf_mips_gnu_pcrel64 = - HOWTO (R_MIPS_PC64, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_PC64", /* name */ - true, /* partial_inplace */ - MINUS_ONE, /* src_mask */ - MINUS_ONE, /* dst_mask */ - true); /* pcrel_offset */ - -/* 32 bit pc-relative. */ -static reloc_howto_type elf_mips_gnu_pcrel32 = - HOWTO (R_MIPS_PC32, /* 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_MIPS_PC32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - true); /* pcrel_offset */ - -/* GNU extension to record C++ vtable hierarchy */ -static reloc_howto_type elf_mips_gnu_vtinherit_howto = - HOWTO (R_MIPS_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_MIPS_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false); /* pcrel_offset */ - -/* GNU extension to record C++ vtable member usage */ -static reloc_howto_type elf_mips_gnu_vtentry_howto = - HOWTO (R_MIPS_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_MIPS_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false); /* pcrel_offset */ - -/* 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 - actual relocation when we see the LO16. - - MIPS ELF requires that the LO16 immediately follow the HI16. As a - GNU extension, for non-pc-relative relocations, we permit an - arbitrary number of HI16 relocs to be associated with a single LO16 - reloc. This extension permits gcc to output the HI and LO relocs - itself. - - This cannot be done for PC-relative relocations because both the HI16 - and LO16 parts of the relocations must be done relative to the LO16 - part, and there can be carry to or borrow from the HI16 part. */ - -struct mips_hi16 -{ - struct mips_hi16 *next; - bfd_byte *addr; - bfd_vma addend; -}; - -/* FIXME: This should not be a static variable. */ - -static struct mips_hi16 *mips_hi16_list; - -bfd_reloc_status_type -_bfd_mips_elf_hi16_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - bfd_reloc_status_type ret; - bfd_vma relocation; - struct mips_hi16 *n; - - /* If we're relocating, and this an external symbol, we don't want - to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - ret = bfd_reloc_ok; - - if (strcmp (bfd_asymbol_name (symbol), "_gp_disp") == 0) - { - boolean relocateable; - bfd_vma gp; - - if (ret == bfd_reloc_undefined) - abort (); - - if (output_bfd != NULL) - relocateable = true; - else - { - relocateable = false; - output_bfd = symbol->section->output_section->owner; - } - - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, - error_message, &gp); - if (ret != bfd_reloc_ok) - return ret; - - relocation = gp - reloc_entry->address; - } - else - { - if (bfd_is_und_section (symbol->section) - && output_bfd == (bfd *) NULL) - ret = bfd_reloc_undefined; - - 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; - - if (reloc_entry->address > input_section->_cooked_size) - return bfd_reloc_outofrange; - - /* Save the information, and let LO16 do the actual relocation. */ - n = (struct mips_hi16 *) bfd_malloc ((bfd_size_type) sizeof *n); - if (n == NULL) - return bfd_reloc_outofrange; - n->addr = (bfd_byte *) data + reloc_entry->address; - n->addend = relocation; - n->next = mips_hi16_list; - mips_hi16_list = n; - - if (output_bfd != (bfd *) NULL) - reloc_entry->address += input_section->output_offset; - - return ret; -} - -/* Do a R_MIPS_LO16 relocation. This is a straightforward 16 bit - inplace relocation; this function exists in order to do the - R_MIPS_HI16 relocation described above. */ - -bfd_reloc_status_type -_bfd_mips_elf_lo16_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - arelent gp_disp_relent; - - if (mips_hi16_list != NULL) - { - struct mips_hi16 *l; - - l = mips_hi16_list; - while (l != NULL) - { - unsigned long insn; - unsigned long val; - unsigned long vallo; - struct mips_hi16 *next; - - /* Do the HI16 relocation. Note that we actually don't need - to know anything about the LO16 itself, except where to - find the low 16 bits of the addend needed by the LO16. */ - insn = bfd_get_32 (abfd, l->addr); - vallo = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - - /* The low order 16 bits are always treated as a signed - value. */ - vallo = ((vallo & 0xffff) ^ 0x8000) - 0x8000; - val = ((insn & 0xffff) << 16) + vallo; - val += l->addend; - - /* If PC-relative, we need to subtract out the address of the LO - half of the HI/LO. (The actual relocation is relative - to that instruction.) */ - if (reloc_entry->howto->pc_relative) - val -= reloc_entry->address; - - /* At this point, "val" has the value of the combined HI/LO - pair. If the low order 16 bits (which will be used for - the LO16 insn) are negative, then we will need an - adjustment for the high order 16 bits. */ - val += 0x8000; - val = (val >> 16) & 0xffff; - - insn &= ~ (bfd_vma) 0xffff; - insn |= val; - bfd_put_32 (abfd, (bfd_vma) insn, l->addr); - - if (strcmp (bfd_asymbol_name (symbol), "_gp_disp") == 0) - { - gp_disp_relent = *reloc_entry; - reloc_entry = &gp_disp_relent; - reloc_entry->addend = l->addend; - } - - next = l->next; - free (l); - l = next; - } - - mips_hi16_list = NULL; - } - else if (strcmp (bfd_asymbol_name (symbol), "_gp_disp") == 0) - { - bfd_reloc_status_type ret; - bfd_vma gp, relocation; - - /* FIXME: Does this case ever occur? */ - - ret = mips_elf_final_gp (output_bfd, symbol, true, error_message, &gp); - if (ret != bfd_reloc_ok) - return ret; - - relocation = gp - reloc_entry->address; - relocation += symbol->section->output_section->vma; - relocation += symbol->section->output_offset; - relocation += reloc_entry->addend; - - if (reloc_entry->address > input_section->_cooked_size) - return bfd_reloc_outofrange; - - gp_disp_relent = *reloc_entry; - reloc_entry = &gp_disp_relent; - reloc_entry->addend = relocation - 4; - } - - /* 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); -} - -/* Do a R_MIPS_GOT16 reloc. This is a reloc against the global offset - table used for PIC code. If the symbol is an external symbol, the - instruction is modified to contain the offset of the appropriate - entry in the global offset table. If the symbol is a section - symbol, the next reloc is a R_MIPS_LO16 reloc. The two 16 bit - addends are combined to form the real addend against the section - symbol; the GOT16 is modified to contain the offset of an entry in - the global offset table, and the LO16 is modified to offset it - appropriately. Thus an offset larger than 16 bits requires a - modified value in the global offset table. - - This implementation suffices for the assembler, but the linker does - not yet know how to create global offset tables. */ - -bfd_reloc_status_type -_bfd_mips_elf_got16_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - /* If we're relocating, and this an external symbol, we don't want - to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* If we're relocating, and this is a local symbol, we can handle it - just like HI16. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) != 0) - return _bfd_mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message); - - abort (); -} - -/* Set the GP value for OUTPUT_BFD. Returns false if this is a - dangerous relocation. */ - -static boolean -mips_elf_assign_gp (output_bfd, pgp) - bfd *output_bfd; - bfd_vma *pgp; -{ - unsigned int count; - asymbol **sym; - unsigned int i; - - /* If we've already figured out what GP will be, just return it. */ - *pgp = _bfd_get_gp_value (output_bfd); - if (*pgp) - return true; - - count = bfd_get_symcount (output_bfd); - sym = bfd_get_outsymbols (output_bfd); - - /* The linker script will have created a symbol named `_gp' with the - appropriate value. */ - if (sym == (asymbol **) NULL) - i = count; - else - { - for (i = 0; i < count; i++, sym++) - { - register const char *name; - - name = bfd_asymbol_name (*sym); - if (*name == '_' && strcmp (name, "_gp") == 0) - { - *pgp = bfd_asymbol_value (*sym); - _bfd_set_gp_value (output_bfd, *pgp); - break; - } - } - } - - if (i >= count) - { - /* Only get the error once. */ - *pgp = 4; - _bfd_set_gp_value (output_bfd, *pgp); - return false; - } - - return true; -} - -/* We have to figure out the gp value, so that we can adjust the - symbol value correctly. We look up the symbol _gp in the output - BFD. If we can't find it, we're stuck. We cache it in the ELF - target data. We don't need to adjust the symbol value for an - external symbol if we are producing relocateable output. */ - -static bfd_reloc_status_type -mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, pgp) - bfd *output_bfd; - asymbol *symbol; - boolean relocateable; - char **error_message; - bfd_vma *pgp; -{ - if (bfd_is_und_section (symbol->section) - && ! relocateable) - { - *pgp = 0; - return bfd_reloc_undefined; - } - - *pgp = _bfd_get_gp_value (output_bfd); - if (*pgp == 0 - && (! relocateable - || (symbol->flags & BSF_SECTION_SYM) != 0)) - { - if (relocateable) - { - /* Make up a value. */ - *pgp = symbol->section->output_section->vma + 0x4000; - _bfd_set_gp_value (output_bfd, *pgp); - } - else if (!mips_elf_assign_gp (output_bfd, pgp)) - { - *error_message = - (char *) _("GP relative relocation when _gp not defined"); - return bfd_reloc_dangerous; - } - } - - return bfd_reloc_ok; -} - -/* Do a R_MIPS_GPREL16 relocation. This is a 16 bit value which must - become the offset from the gp register. This function also handles - R_MIPS_LITERAL relocations, although those can be handled more - cleverly because the entries in the .lit8 and .lit4 sections can be - merged. */ - -static bfd_reloc_status_type gprel16_with_gp PARAMS ((bfd *, asymbol *, - arelent *, asection *, - boolean, PTR, bfd_vma)); - -bfd_reloc_status_type -_bfd_mips_elf_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - boolean relocateable; - bfd_reloc_status_type ret; - bfd_vma gp; - - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - if (output_bfd != (bfd *) NULL) - relocateable = true; - else - { - relocateable = false; - output_bfd = symbol->section->output_section->owner; - } - - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, - &gp); - if (ret != bfd_reloc_ok) - return ret; - - return gprel16_with_gp (abfd, symbol, reloc_entry, input_section, - relocateable, data, gp); -} - -static bfd_reloc_status_type -gprel16_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data, - gp) - bfd *abfd; - asymbol *symbol; - arelent *reloc_entry; - asection *input_section; - boolean relocateable; - PTR data; - bfd_vma gp; -{ - bfd_vma relocation; - unsigned long insn; - unsigned long val; - - if (bfd_is_com_section (symbol->section)) - relocation = 0; - else - relocation = symbol->value; - - relocation += symbol->section->output_section->vma; - relocation += symbol->section->output_offset; - - if (reloc_entry->address > input_section->_cooked_size) - return bfd_reloc_outofrange; - - insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - - /* Set val to the offset into the section or symbol. */ - if (reloc_entry->howto->src_mask == 0) - { - /* This case occurs with the 64-bit MIPS ELF ABI. */ - val = reloc_entry->addend; - } - else - { - val = ((insn & 0xffff) + reloc_entry->addend) & 0xffff; - if (val & 0x8000) - val -= 0x10000; - } - - /* Adjust val for the final section location and GP value. If we - are producing relocateable output, we don't want to do this for - an external symbol. */ - if (! relocateable - || (symbol->flags & BSF_SECTION_SYM) != 0) - val += relocation - gp; - - insn = (insn & ~0xffff) | (val & 0xffff); - bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); - - if (relocateable) - reloc_entry->address += input_section->output_offset; - - /* Make sure it fit in 16 bits. */ - if ((long) val >= 0x8000 || (long) val < -0x8000) - return bfd_reloc_overflow; - - return bfd_reloc_ok; -} - -/* Do a R_MIPS_GPREL32 relocation. Is this 32 bit value the offset - from the gp register? XXX */ - -static bfd_reloc_status_type gprel32_with_gp PARAMS ((bfd *, asymbol *, - arelent *, asection *, - boolean, PTR, bfd_vma)); - -bfd_reloc_status_type -_bfd_mips_elf_gprel32_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - boolean relocateable; - bfd_reloc_status_type ret; - bfd_vma gp; - - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - *error_message = (char *) - _("32bits gp relative relocation occurs for an external symbol"); - return bfd_reloc_outofrange; - } - - if (output_bfd != (bfd *) NULL) - { - relocateable = true; - gp = _bfd_get_gp_value (output_bfd); - } - else - { - relocateable = false; - output_bfd = symbol->section->output_section->owner; - - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, - error_message, &gp); - if (ret != bfd_reloc_ok) - return ret; - } - - return gprel32_with_gp (abfd, symbol, reloc_entry, input_section, - relocateable, data, gp); -} - -static bfd_reloc_status_type -gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data, - gp) - bfd *abfd; - asymbol *symbol; - arelent *reloc_entry; - asection *input_section; - boolean relocateable; - PTR data; - bfd_vma gp; -{ - bfd_vma relocation; - unsigned long val; - - if (bfd_is_com_section (symbol->section)) - relocation = 0; - else - relocation = symbol->value; - - relocation += symbol->section->output_section->vma; - relocation += symbol->section->output_offset; - - if (reloc_entry->address > input_section->_cooked_size) - return bfd_reloc_outofrange; - - if (reloc_entry->howto->src_mask == 0) - { - /* This case arises with the 64-bit MIPS ELF ABI. */ - val = 0; - } - else - val = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - - /* Set val to the offset into the section or symbol. */ - val += reloc_entry->addend; - - /* Adjust val for the final section location and GP value. If we - are producing relocateable output, we don't want to do this for - an external symbol. */ - if (! relocateable - || (symbol->flags & BSF_SECTION_SYM) != 0) - val += relocation - gp; - - bfd_put_32 (abfd, (bfd_vma) val, (bfd_byte *) data + reloc_entry->address); - - if (relocateable) - reloc_entry->address += input_section->output_offset; - - return bfd_reloc_ok; -} - -/* Handle a 64 bit reloc in a 32 bit MIPS ELF file. These are - generated when addresses are 64 bits. The upper 32 bits are a simple - sign extension. */ - -static bfd_reloc_status_type -mips32_64bit_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - bfd_reloc_status_type r; - arelent reloc32; - unsigned long val; - bfd_size_type addr; - - r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message); - if (r != bfd_reloc_continue) - return r; - - /* Do a normal 32 bit relocation on the lower 32 bits. */ - reloc32 = *reloc_entry; - if (bfd_big_endian (abfd)) - reloc32.address += 4; - reloc32.howto = &elf_mips_howto_table_rel[R_MIPS_32]; - r = bfd_perform_relocation (abfd, &reloc32, data, input_section, - output_bfd, error_message); - - /* Sign extend into the upper 32 bits. */ - val = bfd_get_32 (abfd, (bfd_byte *) data + reloc32.address); - if ((val & 0x80000000) != 0) - val = 0xffffffff; - else - val = 0; - addr = reloc_entry->address; - if (bfd_little_endian (abfd)) - addr += 4; - bfd_put_32 (abfd, (bfd_vma) val, (bfd_byte *) data + addr); - - return r; -} - -/* Handle a mips16 jump. */ - -static bfd_reloc_status_type -mips16_jump_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->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* FIXME. */ - { - static boolean warned; - - if (! warned) - (*_bfd_error_handler) - (_("Linking mips16 objects into %s format is not supported"), - bfd_get_target (input_section->output_section->owner)); - warned = true; - } - - return bfd_reloc_undefined; -} - -/* Handle a mips16 GP relative reloc. */ - -static bfd_reloc_status_type -mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - boolean relocateable; - bfd_reloc_status_type ret; - bfd_vma gp; - unsigned short extend, insn; - unsigned long final; - - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ - if (output_bfd != NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - if (output_bfd != NULL) - relocateable = true; - else - { - relocateable = false; - output_bfd = symbol->section->output_section->owner; - } - - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, - &gp); - if (ret != bfd_reloc_ok) - return ret; - - if (reloc_entry->address > input_section->_cooked_size) - return bfd_reloc_outofrange; - - /* Pick up the mips16 extend instruction and the real instruction. */ - extend = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); - insn = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address + 2); - - /* Stuff the current addend back as a 32 bit value, do the usual - relocation, and then clean up. */ - bfd_put_32 (abfd, - (bfd_vma) (((extend & 0x1f) << 11) - | (extend & 0x7e0) - | (insn & 0x1f)), - (bfd_byte *) data + reloc_entry->address); - - ret = gprel16_with_gp (abfd, symbol, reloc_entry, input_section, - relocateable, data, gp); - - final = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - bfd_put_16 (abfd, - (bfd_vma) ((extend & 0xf800) - | ((final >> 11) & 0x1f) - | (final & 0x7e0)), - (bfd_byte *) data + reloc_entry->address); - bfd_put_16 (abfd, - (bfd_vma) ((insn & 0xffe0) - | (final & 0x1f)), - (bfd_byte *) data + reloc_entry->address + 2); - - return ret; -} - -/* Return the ISA for a MIPS e_flags value. */ - -static INLINE int -elf_mips_isa (flags) - flagword flags; -{ - switch (flags & EF_MIPS_ARCH) - { - case E_MIPS_ARCH_1: - return 1; - case E_MIPS_ARCH_2: - return 2; - case E_MIPS_ARCH_3: - return 3; - case E_MIPS_ARCH_4: - return 4; - case E_MIPS_ARCH_5: - return 5; - case E_MIPS_ARCH_32: - return 32; - case E_MIPS_ARCH_64: - return 64; - } - return 4; -} - -/* Return the MACH for a MIPS e_flags value. */ - -static INLINE unsigned long -elf_mips_mach (flags) - flagword flags; -{ - switch (flags & EF_MIPS_MACH) - { - case E_MIPS_MACH_3900: - return bfd_mach_mips3900; - - case E_MIPS_MACH_4010: - return bfd_mach_mips4010; - - case E_MIPS_MACH_4100: - return bfd_mach_mips4100; - - case E_MIPS_MACH_4111: - return bfd_mach_mips4111; - - case E_MIPS_MACH_4650: - return bfd_mach_mips4650; - - case E_MIPS_MACH_SB1: - return bfd_mach_mips_sb1; - - default: - switch (flags & EF_MIPS_ARCH) - { - default: - case E_MIPS_ARCH_1: - return bfd_mach_mips3000; - break; - - case E_MIPS_ARCH_2: - return bfd_mach_mips6000; - break; - - case E_MIPS_ARCH_3: - return bfd_mach_mips4000; - break; - - case E_MIPS_ARCH_4: - return bfd_mach_mips8000; - break; - - case E_MIPS_ARCH_5: - return bfd_mach_mips5; - break; - - case E_MIPS_ARCH_32: - return bfd_mach_mipsisa32; - break; - - case E_MIPS_ARCH_64: - return bfd_mach_mipsisa64; - break; - } - } - - return 0; -} - -/* Return printable name for ABI. */ - -static INLINE char * -elf_mips_abi_name (abfd) - bfd *abfd; -{ - flagword flags; - - flags = elf_elfheader (abfd)->e_flags; - switch (flags & EF_MIPS_ABI) - { - case 0: - 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: - return "O64"; - case E_MIPS_ABI_EABI32: - return "EABI32"; - case E_MIPS_ABI_EABI64: - return "EABI64"; - default: - return "unknown abi"; - } -} - -/* A mapping from BFD reloc types to MIPS ELF reloc types. */ - -struct elf_reloc_map { - bfd_reloc_code_real_type bfd_reloc_val; - enum elf_mips_reloc_type elf_reloc_val; -}; - -static const struct elf_reloc_map mips_reloc_map[] = -{ - { BFD_RELOC_NONE, R_MIPS_NONE, }, - { BFD_RELOC_16, R_MIPS_16 }, - { BFD_RELOC_32, R_MIPS_32 }, - { BFD_RELOC_64, R_MIPS_64 }, - { BFD_RELOC_MIPS_JMP, R_MIPS_26 }, - { BFD_RELOC_HI16_S, R_MIPS_HI16 }, - { BFD_RELOC_LO16, R_MIPS_LO16 }, - { BFD_RELOC_GPREL16, R_MIPS_GPREL16 }, - { BFD_RELOC_MIPS_LITERAL, R_MIPS_LITERAL }, - { BFD_RELOC_MIPS_GOT16, R_MIPS_GOT16 }, - { BFD_RELOC_16_PCREL, R_MIPS_PC16 }, - { BFD_RELOC_MIPS_CALL16, R_MIPS_CALL16 }, - { BFD_RELOC_GPREL32, R_MIPS_GPREL32 }, - { BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 }, - { BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 }, - { BFD_RELOC_MIPS_CALL_HI16, R_MIPS_CALL_HI16 }, - { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 }, - { 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 }, - { BFD_RELOC_MIPS_GOT_DISP, R_MIPS_GOT_DISP } -}; - -/* Given a BFD reloc type, return a howto structure. */ - -static reloc_howto_type * -bfd_elf32_bfd_reloc_type_lookup (abfd, code) - bfd *abfd; - bfd_reloc_code_real_type code; -{ - unsigned int i; - - for (i = 0; i < sizeof (mips_reloc_map) / sizeof (struct elf_reloc_map); i++) - { - if (mips_reloc_map[i].bfd_reloc_val == code) - return &elf_mips_howto_table_rel[(int) mips_reloc_map[i].elf_reloc_val]; - } - - switch (code) - { - default: - bfd_set_error (bfd_error_bad_value); - return NULL; - - case BFD_RELOC_CTOR: - /* We need to handle BFD_RELOC_CTOR specially. - Select the right relocation (R_MIPS_32 or R_MIPS_64) based on the - size of addresses on this architecture. */ - if (bfd_arch_bits_per_address (abfd) == 32) - return &elf_mips_howto_table_rel[(int) R_MIPS_32]; - else - return &elf_mips_ctor64_howto; - - case BFD_RELOC_MIPS16_JMP: - return &elf_mips16_jump_howto; - case BFD_RELOC_MIPS16_GPREL: - return &elf_mips16_gprel_howto; - case BFD_RELOC_VTABLE_INHERIT: - return &elf_mips_gnu_vtinherit_howto; - case BFD_RELOC_VTABLE_ENTRY: - return &elf_mips_gnu_vtentry_howto; - case BFD_RELOC_PCREL_HI16_S: - return &elf_mips_gnu_rel_hi16; - case BFD_RELOC_PCREL_LO16: - return &elf_mips_gnu_rel_lo16; - case BFD_RELOC_16_PCREL_S2: - return &elf_mips_gnu_rel16_s2; - case BFD_RELOC_64_PCREL: - return &elf_mips_gnu_pcrel64; - case BFD_RELOC_32_PCREL: - return &elf_mips_gnu_pcrel32; - } -} - -/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */ - -static reloc_howto_type * -mips_rtype_to_howto (r_type) - unsigned int r_type; -{ - switch (r_type) - { - case R_MIPS16_26: - return &elf_mips16_jump_howto; - break; - case R_MIPS16_GPREL: - return &elf_mips16_gprel_howto; - break; - case R_MIPS_GNU_VTINHERIT: - return &elf_mips_gnu_vtinherit_howto; - break; - case R_MIPS_GNU_VTENTRY: - return &elf_mips_gnu_vtentry_howto; - break; - case R_MIPS_GNU_REL_HI16: - return &elf_mips_gnu_rel_hi16; - break; - case R_MIPS_GNU_REL_LO16: - return &elf_mips_gnu_rel_lo16; - break; - case R_MIPS_GNU_REL16_S2: - return &elf_mips_gnu_rel16_s2; - break; - case R_MIPS_PC64: - return &elf_mips_gnu_pcrel64; - break; - case R_MIPS_PC32: - return &elf_mips_gnu_pcrel32; - break; - - default: - BFD_ASSERT (r_type < (unsigned int) R_MIPS_max); - return &elf_mips_howto_table_rel[r_type]; - break; - } -} - -/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */ - -static void -mips_info_to_howto_rel (abfd, cache_ptr, dst) - bfd *abfd; - arelent *cache_ptr; - Elf32_Internal_Rel *dst; -{ - unsigned int r_type; - - r_type = ELF32_R_TYPE (dst->r_info); - cache_ptr->howto = mips_rtype_to_howto (r_type); - - /* The addend for a GPREL16 or LITERAL relocation comes from the GP - value for the object file. We get the addend now, rather than - when we do the relocation, because the symbol manipulations done - by the linker may cause us to lose track of the input BFD. */ - if (((*cache_ptr->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0 - && (r_type == (unsigned int) R_MIPS_GPREL16 - || r_type == (unsigned int) R_MIPS_LITERAL)) - cache_ptr->addend = elf_gp (abfd); -} - -/* Given a MIPS Elf32_Internal_Rela, fill in an arelent structure. */ - -static void -mips_info_to_howto_rela (abfd, cache_ptr, dst) - bfd *abfd; - arelent *cache_ptr; - Elf32_Internal_Rela *dst; -{ - /* Since an Elf32_Internal_Rel is an initial prefix of an - Elf32_Internal_Rela, we can just use mips_info_to_howto_rel - above. */ - mips_info_to_howto_rel (abfd, cache_ptr, (Elf32_Internal_Rel *) dst); - - /* If we ever need to do any extra processing with dst->r_addend - (the field omitted in an Elf32_Internal_Rel) we can do it here. */ -} - -/* A .reginfo section holds a single Elf32_RegInfo structure. These - routines swap this structure in and out. They are used outside of - BFD, so they are globally visible. */ - -void -bfd_mips_elf32_swap_reginfo_in (abfd, ex, in) - bfd *abfd; - const Elf32_External_RegInfo *ex; - Elf32_RegInfo *in; -{ - in->ri_gprmask = H_GET_32 (abfd, ex->ri_gprmask); - in->ri_cprmask[0] = H_GET_32 (abfd, ex->ri_cprmask[0]); - in->ri_cprmask[1] = H_GET_32 (abfd, ex->ri_cprmask[1]); - in->ri_cprmask[2] = H_GET_32 (abfd, ex->ri_cprmask[2]); - in->ri_cprmask[3] = H_GET_32 (abfd, ex->ri_cprmask[3]); - in->ri_gp_value = H_GET_32 (abfd, ex->ri_gp_value); -} - -void -bfd_mips_elf32_swap_reginfo_out (abfd, in, ex) - bfd *abfd; - const Elf32_RegInfo *in; - Elf32_External_RegInfo *ex; -{ - H_PUT_32 (abfd, in->ri_gprmask, ex->ri_gprmask); - H_PUT_32 (abfd, in->ri_cprmask[0], ex->ri_cprmask[0]); - H_PUT_32 (abfd, in->ri_cprmask[1], ex->ri_cprmask[1]); - H_PUT_32 (abfd, in->ri_cprmask[2], ex->ri_cprmask[2]); - H_PUT_32 (abfd, in->ri_cprmask[3], ex->ri_cprmask[3]); - H_PUT_32 (abfd, in->ri_gp_value, ex->ri_gp_value); -} - -/* In the 64 bit ABI, the .MIPS.options section holds register - information in an Elf64_Reginfo structure. These routines swap - them in and out. They are globally visible because they are used - outside of BFD. These routines are here so that gas can call them - without worrying about whether the 64 bit ABI has been included. */ - -void -bfd_mips_elf64_swap_reginfo_in (abfd, ex, in) - bfd *abfd; - const Elf64_External_RegInfo *ex; - Elf64_Internal_RegInfo *in; -{ - in->ri_gprmask = H_GET_32 (abfd, ex->ri_gprmask); - in->ri_pad = H_GET_32 (abfd, ex->ri_pad); - in->ri_cprmask[0] = H_GET_32 (abfd, ex->ri_cprmask[0]); - in->ri_cprmask[1] = H_GET_32 (abfd, ex->ri_cprmask[1]); - in->ri_cprmask[2] = H_GET_32 (abfd, ex->ri_cprmask[2]); - in->ri_cprmask[3] = H_GET_32 (abfd, ex->ri_cprmask[3]); - in->ri_gp_value = H_GET_64 (abfd, ex->ri_gp_value); -} - -void -bfd_mips_elf64_swap_reginfo_out (abfd, in, ex) - bfd *abfd; - const Elf64_Internal_RegInfo *in; - Elf64_External_RegInfo *ex; -{ - H_PUT_32 (abfd, in->ri_gprmask, ex->ri_gprmask); - H_PUT_32 (abfd, in->ri_pad, ex->ri_pad); - H_PUT_32 (abfd, in->ri_cprmask[0], ex->ri_cprmask[0]); - H_PUT_32 (abfd, in->ri_cprmask[1], ex->ri_cprmask[1]); - H_PUT_32 (abfd, in->ri_cprmask[2], ex->ri_cprmask[2]); - H_PUT_32 (abfd, in->ri_cprmask[3], ex->ri_cprmask[3]); - H_PUT_64 (abfd, in->ri_gp_value, ex->ri_gp_value); -} - -/* Swap an entry in a .gptab section. Note that these routines rely - on the equivalence of the two elements of the union. */ - -static void -bfd_mips_elf32_swap_gptab_in (abfd, ex, in) - bfd *abfd; - const Elf32_External_gptab *ex; - Elf32_gptab *in; -{ - in->gt_entry.gt_g_value = H_GET_32 (abfd, ex->gt_entry.gt_g_value); - in->gt_entry.gt_bytes = H_GET_32 (abfd, ex->gt_entry.gt_bytes); -} - -static void -bfd_mips_elf32_swap_gptab_out (abfd, in, ex) - bfd *abfd; - const Elf32_gptab *in; - Elf32_External_gptab *ex; -{ - H_PUT_32 (abfd, in->gt_entry.gt_g_value, ex->gt_entry.gt_g_value); - H_PUT_32 (abfd, in->gt_entry.gt_bytes, ex->gt_entry.gt_bytes); -} - -static void -bfd_elf32_swap_compact_rel_out (abfd, in, ex) - bfd *abfd; - const Elf32_compact_rel *in; - Elf32_External_compact_rel *ex; -{ - H_PUT_32 (abfd, in->id1, ex->id1); - H_PUT_32 (abfd, in->num, ex->num); - H_PUT_32 (abfd, in->id2, ex->id2); - H_PUT_32 (abfd, in->offset, ex->offset); - H_PUT_32 (abfd, in->reserved0, ex->reserved0); - H_PUT_32 (abfd, in->reserved1, ex->reserved1); -} - -static void -bfd_elf32_swap_crinfo_out (abfd, in, ex) - bfd *abfd; - const Elf32_crinfo *in; - Elf32_External_crinfo *ex; -{ - unsigned long l; - - l = (((in->ctype & CRINFO_CTYPE) << CRINFO_CTYPE_SH) - | ((in->rtype & CRINFO_RTYPE) << CRINFO_RTYPE_SH) - | ((in->dist2to & CRINFO_DIST2TO) << CRINFO_DIST2TO_SH) - | ((in->relvaddr & CRINFO_RELVADDR) << CRINFO_RELVADDR_SH)); - H_PUT_32 (abfd, l, ex->info); - H_PUT_32 (abfd, in->konst, ex->konst); - H_PUT_32 (abfd, in->vaddr, ex->vaddr); -} - -/* Swap in an options header. */ - -void -bfd_mips_elf_swap_options_in (abfd, ex, in) - bfd *abfd; - const Elf_External_Options *ex; - Elf_Internal_Options *in; -{ - in->kind = H_GET_8 (abfd, ex->kind); - in->size = H_GET_8 (abfd, ex->size); - in->section = H_GET_16 (abfd, ex->section); - in->info = H_GET_32 (abfd, ex->info); -} - -/* Swap out an options header. */ - -void -bfd_mips_elf_swap_options_out (abfd, in, ex) - bfd *abfd; - const Elf_Internal_Options *in; - Elf_External_Options *ex; -{ - H_PUT_8 (abfd, in->kind, ex->kind); - H_PUT_8 (abfd, in->size, ex->size); - H_PUT_16 (abfd, in->section, ex->section); - H_PUT_32 (abfd, in->info, ex->info); -} -#if 0 -/* Swap in an MSYM entry. */ - -static void -bfd_mips_elf_swap_msym_in (abfd, ex, in) - bfd *abfd; - const Elf32_External_Msym *ex; - Elf32_Internal_Msym *in; -{ - in->ms_hash_value = H_GET_32 (abfd, ex->ms_hash_value); - in->ms_info = H_GET_32 (abfd, ex->ms_info); -} -#endif -/* Swap out an MSYM entry. */ - -static void -bfd_mips_elf_swap_msym_out (abfd, in, ex) - bfd *abfd; - const Elf32_Internal_Msym *in; - Elf32_External_Msym *ex; -{ - H_PUT_32 (abfd, in->ms_hash_value, ex->ms_hash_value); - H_PUT_32 (abfd, in->ms_info, ex->ms_info); -} - -/* Determine whether a symbol is global for the purposes of splitting - the symbol table into global symbols and local symbols. At least - on Irix 5, this split must be between section symbols and all other - symbols. On most ELF targets the split is between static symbols - and externally visible symbols. */ - -static boolean -mips_elf_sym_is_global (abfd, sym) - bfd *abfd ATTRIBUTE_UNUSED; - asymbol *sym; -{ - if (SGI_COMPAT (abfd)) - return (sym->flags & BSF_SECTION_SYM) == 0; - else - return ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0 - || bfd_is_und_section (bfd_get_section (sym)) - || bfd_is_com_section (bfd_get_section (sym))); -} - -/* Set the right machine number for a MIPS ELF file. This is used for - both the 32-bit and the 64-bit ABI. */ - -boolean -_bfd_mips_elf_object_p (abfd) - bfd *abfd; -{ - /* Irix 5 and 6 are broken. Object file symbol tables are not always - sorted correctly such that local symbols precede global symbols, - and the sh_info field in the symbol table is not always right. */ - if (SGI_COMPAT(abfd)) - elf_bad_symtab (abfd) = true; - - bfd_default_set_arch_mach (abfd, bfd_arch_mips, - elf_mips_mach (elf_elfheader (abfd)->e_flags)); - return true; -} - -/* The final processing done just before writing out a MIPS ELF object - file. This gets the MIPS architecture right based on the machine - number. This is used by both the 32-bit and the 64-bit ABI. */ - -void -_bfd_mips_elf_final_write_processing (abfd, linker) - bfd *abfd; - boolean linker ATTRIBUTE_UNUSED; -{ - unsigned long val; - unsigned int i; - Elf_Internal_Shdr **hdrpp; - const char *name; - asection *sec; - - switch (bfd_get_mach (abfd)) - { - default: - case bfd_mach_mips3000: - val = E_MIPS_ARCH_1; - break; - - case bfd_mach_mips3900: - val = E_MIPS_ARCH_1 | E_MIPS_MACH_3900; - break; - - case bfd_mach_mips6000: - val = E_MIPS_ARCH_2; - break; - - case bfd_mach_mips4000: - case bfd_mach_mips4300: - case bfd_mach_mips4400: - case bfd_mach_mips4600: - val = E_MIPS_ARCH_3; - break; - - case bfd_mach_mips4010: - val = E_MIPS_ARCH_3 | E_MIPS_MACH_4010; - break; - - case bfd_mach_mips4100: - val = E_MIPS_ARCH_3 | E_MIPS_MACH_4100; - break; - - case bfd_mach_mips4111: - val = E_MIPS_ARCH_3 | E_MIPS_MACH_4111; - break; - - case bfd_mach_mips4650: - val = E_MIPS_ARCH_3 | E_MIPS_MACH_4650; - break; - - case bfd_mach_mips5000: - case bfd_mach_mips8000: - case bfd_mach_mips10000: - case bfd_mach_mips12000: - val = E_MIPS_ARCH_4; - break; - - case bfd_mach_mips5: - val = E_MIPS_ARCH_5; - break; - - case bfd_mach_mips_sb1: - val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1; - break; - - case bfd_mach_mipsisa32: - val = E_MIPS_ARCH_32; - break; - - case bfd_mach_mipsisa64: - val = E_MIPS_ARCH_64; - } - - elf_elfheader (abfd)->e_flags &= ~(EF_MIPS_ARCH | EF_MIPS_MACH); - elf_elfheader (abfd)->e_flags |= val; - - /* Set the sh_info field for .gptab sections and other appropriate - info for each special section. */ - for (i = 1, hdrpp = elf_elfsections (abfd) + 1; - i < elf_numsections (abfd); - i++, hdrpp++) - { - switch ((*hdrpp)->sh_type) - { - case SHT_MIPS_MSYM: - case SHT_MIPS_LIBLIST: - sec = bfd_get_section_by_name (abfd, ".dynstr"); - if (sec != NULL) - (*hdrpp)->sh_link = elf_section_data (sec)->this_idx; - break; - - case SHT_MIPS_GPTAB: - BFD_ASSERT ((*hdrpp)->bfd_section != NULL); - name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section); - BFD_ASSERT (name != NULL - && strncmp (name, ".gptab.", sizeof ".gptab." - 1) == 0); - sec = bfd_get_section_by_name (abfd, name + sizeof ".gptab" - 1); - BFD_ASSERT (sec != NULL); - (*hdrpp)->sh_info = elf_section_data (sec)->this_idx; - break; - - case SHT_MIPS_CONTENT: - BFD_ASSERT ((*hdrpp)->bfd_section != NULL); - name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section); - BFD_ASSERT (name != NULL - && strncmp (name, ".MIPS.content", - sizeof ".MIPS.content" - 1) == 0); - sec = bfd_get_section_by_name (abfd, - name + sizeof ".MIPS.content" - 1); - BFD_ASSERT (sec != NULL); - (*hdrpp)->sh_link = elf_section_data (sec)->this_idx; - break; - - case SHT_MIPS_SYMBOL_LIB: - sec = bfd_get_section_by_name (abfd, ".dynsym"); - if (sec != NULL) - (*hdrpp)->sh_link = elf_section_data (sec)->this_idx; - sec = bfd_get_section_by_name (abfd, ".liblist"); - if (sec != NULL) - (*hdrpp)->sh_info = elf_section_data (sec)->this_idx; - break; - - case SHT_MIPS_EVENTS: - BFD_ASSERT ((*hdrpp)->bfd_section != NULL); - name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section); - BFD_ASSERT (name != NULL); - if (strncmp (name, ".MIPS.events", sizeof ".MIPS.events" - 1) == 0) - sec = bfd_get_section_by_name (abfd, - name + sizeof ".MIPS.events" - 1); - else - { - BFD_ASSERT (strncmp (name, ".MIPS.post_rel", - sizeof ".MIPS.post_rel" - 1) == 0); - sec = bfd_get_section_by_name (abfd, - (name - + sizeof ".MIPS.post_rel" - 1)); - } - BFD_ASSERT (sec != NULL); - (*hdrpp)->sh_link = elf_section_data (sec)->this_idx; - break; - - } - } -} - -/* Function to keep MIPS specific file flags like as EF_MIPS_PIC. */ - -boolean -_bfd_mips_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; -} - -/* Merge backend specific data from an object file to the output - object file when linking. */ - -boolean -_bfd_mips_elf_merge_private_bfd_data (ibfd, obfd) - bfd *ibfd; - bfd *obfd; -{ - flagword old_flags; - flagword new_flags; - boolean ok; - boolean null_input_bfd = true; - asection *sec; - - /* Check if we have the same endianess */ - if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) - 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; - elf_elfheader (obfd)->e_flags |= new_flags & EF_MIPS_NOREORDER; - old_flags = elf_elfheader (obfd)->e_flags; - - if (! elf_flags_init (obfd)) - { - elf_flags_init (obfd) = true; - elf_elfheader (obfd)->e_flags = new_flags; - elf_elfheader (obfd)->e_ident[EI_CLASS] - = elf_elfheader (ibfd)->e_ident[EI_CLASS]; - - if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) - && bfd_get_arch_info (obfd)->the_default) - { - if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), - bfd_get_mach (ibfd))) - return false; - } - - return true; - } - - /* Check flag compatibility. */ - - new_flags &= ~EF_MIPS_NOREORDER; - old_flags &= ~EF_MIPS_NOREORDER; - - if (new_flags == old_flags) - return true; - - /* Check to see if the input BFD actually contains any sections. - If not, its flags may not have been initialised either, but it cannot - actually cause any incompatibility. */ - for (sec = ibfd->sections; sec != NULL; sec = sec->next) - { - /* Ignore synthetic sections and empty .text, .data and .bss sections - which are automatically generated by gas. */ - if (strcmp (sec->name, ".reginfo") - && strcmp (sec->name, ".mdebug") - && ((!strcmp (sec->name, ".text") - || !strcmp (sec->name, ".data") - || !strcmp (sec->name, ".bss")) - && sec->_raw_size != 0)) - { - null_input_bfd = false; - break; - } - } - if (null_input_bfd) - return true; - - ok = true; - - if ((new_flags & EF_MIPS_PIC) != (old_flags & EF_MIPS_PIC)) - { - new_flags &= ~EF_MIPS_PIC; - old_flags &= ~EF_MIPS_PIC; - (*_bfd_error_handler) - (_("%s: linking PIC files with non-PIC files"), - bfd_archive_filename (ibfd)); - ok = false; - } - - if ((new_flags & EF_MIPS_CPIC) != (old_flags & EF_MIPS_CPIC)) - { - new_flags &= ~EF_MIPS_CPIC; - old_flags &= ~EF_MIPS_CPIC; - (*_bfd_error_handler) - (_("%s: linking abicalls files with non-abicalls files"), - bfd_archive_filename (ibfd)); - ok = false; - } - - /* Compare the ISA's. */ - if ((new_flags & (EF_MIPS_ARCH | EF_MIPS_MACH)) - != (old_flags & (EF_MIPS_ARCH | EF_MIPS_MACH))) - { - int new_mach = new_flags & EF_MIPS_MACH; - int old_mach = old_flags & EF_MIPS_MACH; - int new_isa = elf_mips_isa (new_flags); - int old_isa = elf_mips_isa (old_flags); - - /* If either has no machine specified, just compare the general isa's. - Some combinations of machines are ok, if the isa's match. */ - if (! new_mach - || ! old_mach - || new_mach == old_mach - ) - { - /* Don't warn about mixing code using 32-bit ISAs, or mixing code - using 64-bit ISAs. They will normally use the same data sizes - and calling conventions. */ - - if (( (new_isa == 1 || new_isa == 2 || new_isa == 32) - ^ (old_isa == 1 || old_isa == 2 || old_isa == 32)) != 0) - { - (*_bfd_error_handler) - (_("%s: ISA mismatch (-mips%d) with previous modules (-mips%d)"), - bfd_archive_filename (ibfd), new_isa, old_isa); - ok = false; - } - else - { - /* Do we need to update the mach field? */ - if (old_mach == 0 && new_mach != 0) - elf_elfheader (obfd)->e_flags |= new_mach; - - /* Do we need to update the ISA field? */ - if (new_isa > old_isa) - { - elf_elfheader (obfd)->e_flags &= ~EF_MIPS_ARCH; - elf_elfheader (obfd)->e_flags - |= new_flags & EF_MIPS_ARCH; - } - } - } - else - { - (*_bfd_error_handler) - (_("%s: ISA mismatch (%d) with previous modules (%d)"), - bfd_archive_filename (ibfd), - elf_mips_mach (new_flags), - elf_mips_mach (old_flags)); - ok = false; - } - - new_flags &= ~(EF_MIPS_ARCH | EF_MIPS_MACH); - old_flags &= ~(EF_MIPS_ARCH | EF_MIPS_MACH); - } - - /* Compare ABI's. The 64-bit ABI does not use EF_MIPS_ABI. But, it - does set EI_CLASS differently from any 32-bit ABI. */ - if ((new_flags & EF_MIPS_ABI) != (old_flags & EF_MIPS_ABI) - || (elf_elfheader (ibfd)->e_ident[EI_CLASS] - != elf_elfheader (obfd)->e_ident[EI_CLASS])) - { - /* Only error if both are set (to different values). */ - if (((new_flags & EF_MIPS_ABI) && (old_flags & EF_MIPS_ABI)) - || (elf_elfheader (ibfd)->e_ident[EI_CLASS] - != elf_elfheader (obfd)->e_ident[EI_CLASS])) - { - (*_bfd_error_handler) - (_("%s: ABI mismatch: linking %s module with previous %s modules"), - bfd_archive_filename (ibfd), - elf_mips_abi_name (ibfd), - elf_mips_abi_name (obfd)); - ok = false; - } - new_flags &= ~EF_MIPS_ABI; - old_flags &= ~EF_MIPS_ABI; - } - - /* Warn about any other mismatches */ - if (new_flags != old_flags) - { - (*_bfd_error_handler) - (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), - bfd_archive_filename (ibfd), (unsigned long) new_flags, - (unsigned long) old_flags); - ok = false; - } - - if (! ok) - { - bfd_set_error (bfd_error_bad_value); - return false; - } - - return true; -} - -boolean -_bfd_mips_elf_print_private_bfd_data (abfd, ptr) - bfd *abfd; - PTR ptr; -{ - FILE *file = (FILE *) ptr; - - BFD_ASSERT (abfd != NULL && ptr != NULL); - - /* Print normal ELF private data. */ - _bfd_elf_print_private_bfd_data (abfd, ptr); - - /* xgettext:c-format */ - fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); - - if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_O32) - fprintf (file, _(" [abi=O32]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_O64) - fprintf (file, _(" [abi=O64]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI32) - fprintf (file, _(" [abi=EABI32]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI64) - fprintf (file, _(" [abi=EABI64]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI)) - fprintf (file, _(" [abi unknown]")); - else if (ABI_N32_P (abfd)) - fprintf (file, _(" [abi=N32]")); - else if (ABI_64_P (abfd)) - fprintf (file, _(" [abi=64]")); - else - fprintf (file, _(" [no abi set]")); - - if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1) - fprintf (file, _(" [mips1]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2) - fprintf (file, _(" [mips2]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_3) - fprintf (file, _(" [mips3]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_4) - fprintf (file, _(" [mips4]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_5) - fprintf (file, _(" [mips5]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32) - fprintf (file, _(" [mips32]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64) - fprintf (file, _(" [mips64]")); - else - fprintf (file, _(" [unknown ISA]")); - - if (elf_elfheader (abfd)->e_flags & EF_MIPS_32BITMODE) - fprintf (file, _(" [32bitmode]")); - else - fprintf (file, _(" [not 32bitmode]")); - - fputc ('\n', file); - - return true; -} - -/* Handle a MIPS specific section when reading an object file. This - is called when elfcode.h finds a section with an unknown type. - This routine supports both the 32-bit and 64-bit ELF ABI. - - FIXME: We need to handle the SHF_MIPS_GPREL flag, but I'm not sure - how to. */ - -boolean -_bfd_mips_elf_section_from_shdr (abfd, hdr, name) - bfd *abfd; - Elf_Internal_Shdr *hdr; - char *name; -{ - flagword flags = 0; - - /* There ought to be a place to keep ELF backend specific flags, but - at the moment there isn't one. We just keep track of the - sections by their name, instead. Fortunately, the ABI gives - suggested names for all the MIPS specific sections, so we will - probably get away with this. */ - switch (hdr->sh_type) - { - case SHT_MIPS_LIBLIST: - if (strcmp (name, ".liblist") != 0) - return false; - break; - case SHT_MIPS_MSYM: - if (strcmp (name, MIPS_ELF_MSYM_SECTION_NAME (abfd)) != 0) - return false; - break; - case SHT_MIPS_CONFLICT: - if (strcmp (name, ".conflict") != 0) - return false; - break; - case SHT_MIPS_GPTAB: - if (strncmp (name, ".gptab.", sizeof ".gptab." - 1) != 0) - return false; - break; - case SHT_MIPS_UCODE: - if (strcmp (name, ".ucode") != 0) - return false; - break; - case SHT_MIPS_DEBUG: - if (strcmp (name, ".mdebug") != 0) - return false; - flags = SEC_DEBUGGING; - break; - case SHT_MIPS_REGINFO: - if (strcmp (name, ".reginfo") != 0 - || hdr->sh_size != sizeof (Elf32_External_RegInfo)) - return false; - flags = (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_SAME_SIZE); - break; - case SHT_MIPS_IFACE: - if (strcmp (name, ".MIPS.interfaces") != 0) - return false; - break; - case SHT_MIPS_CONTENT: - if (strncmp (name, ".MIPS.content", sizeof ".MIPS.content" - 1) != 0) - return false; - break; - case SHT_MIPS_OPTIONS: - if (strcmp (name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) != 0) - return false; - break; - case SHT_MIPS_DWARF: - if (strncmp (name, ".debug_", sizeof ".debug_" - 1) != 0) - return false; - break; - case SHT_MIPS_SYMBOL_LIB: - if (strcmp (name, ".MIPS.symlib") != 0) - return false; - break; - case SHT_MIPS_EVENTS: - if (strncmp (name, ".MIPS.events", sizeof ".MIPS.events" - 1) != 0 - && strncmp (name, ".MIPS.post_rel", - sizeof ".MIPS.post_rel" - 1) != 0) - return false; - break; - default: - return false; - } - - if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) - return false; - - if (flags) - { - if (! bfd_set_section_flags (abfd, hdr->bfd_section, - (bfd_get_section_flags (abfd, - hdr->bfd_section) - | flags))) - return false; - } - - /* FIXME: We should record sh_info for a .gptab section. */ - - /* For a .reginfo section, set the gp value in the tdata information - from the contents of this section. We need the gp value while - processing relocs, so we just get it now. The .reginfo section - is not used in the 64-bit MIPS ELF ABI. */ - if (hdr->sh_type == SHT_MIPS_REGINFO) - { - Elf32_External_RegInfo ext; - Elf32_RegInfo s; - - if (! bfd_get_section_contents (abfd, hdr->bfd_section, (PTR) &ext, - (file_ptr) 0, - (bfd_size_type) sizeof ext)) - return false; - bfd_mips_elf32_swap_reginfo_in (abfd, &ext, &s); - elf_gp (abfd) = s.ri_gp_value; - } - - /* For a SHT_MIPS_OPTIONS section, look for a ODK_REGINFO entry, and - set the gp value based on what we find. We may see both - SHT_MIPS_REGINFO and SHT_MIPS_OPTIONS/ODK_REGINFO; in that case, - they should agree. */ - if (hdr->sh_type == SHT_MIPS_OPTIONS) - { - bfd_byte *contents, *l, *lend; - - contents = (bfd_byte *) bfd_malloc (hdr->sh_size); - if (contents == NULL) - return false; - if (! bfd_get_section_contents (abfd, hdr->bfd_section, contents, - (file_ptr) 0, hdr->sh_size)) - { - free (contents); - return false; - } - l = contents; - lend = contents + hdr->sh_size; - while (l + sizeof (Elf_External_Options) <= lend) - { - Elf_Internal_Options intopt; - - bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l, - &intopt); - if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO) - { - Elf64_Internal_RegInfo intreg; - - bfd_mips_elf64_swap_reginfo_in - (abfd, - ((Elf64_External_RegInfo *) - (l + sizeof (Elf_External_Options))), - &intreg); - elf_gp (abfd) = intreg.ri_gp_value; - } - else if (intopt.kind == ODK_REGINFO) - { - Elf32_RegInfo intreg; - - bfd_mips_elf32_swap_reginfo_in - (abfd, - ((Elf32_External_RegInfo *) - (l + sizeof (Elf_External_Options))), - &intreg); - elf_gp (abfd) = intreg.ri_gp_value; - } - l += intopt.size; - } - free (contents); - } - - return true; -} - -/* Set the correct type for a MIPS ELF section. We do this by the - section name, which is a hack, but ought to work. This routine is - used by both the 32-bit and the 64-bit ABI. */ - -boolean -_bfd_mips_elf_fake_sections (abfd, hdr, sec) - bfd *abfd; - Elf32_Internal_Shdr *hdr; - asection *sec; -{ - register const char *name; - - name = bfd_get_section_name (abfd, sec); - - if (strcmp (name, ".liblist") == 0) - { - hdr->sh_type = SHT_MIPS_LIBLIST; - hdr->sh_info = sec->_raw_size / sizeof (Elf32_Lib); - /* The sh_link field is set in final_write_processing. */ - } - else if (strcmp (name, ".conflict") == 0) - hdr->sh_type = SHT_MIPS_CONFLICT; - else if (strncmp (name, ".gptab.", sizeof ".gptab." - 1) == 0) - { - hdr->sh_type = SHT_MIPS_GPTAB; - hdr->sh_entsize = sizeof (Elf32_External_gptab); - /* The sh_info field is set in final_write_processing. */ - } - else if (strcmp (name, ".ucode") == 0) - hdr->sh_type = SHT_MIPS_UCODE; - else if (strcmp (name, ".mdebug") == 0) - { - hdr->sh_type = SHT_MIPS_DEBUG; - /* In a shared object on Irix 5.3, the .mdebug section has an - entsize of 0. FIXME: Does this matter? */ - if (SGI_COMPAT (abfd) && (abfd->flags & DYNAMIC) != 0) - hdr->sh_entsize = 0; - else - hdr->sh_entsize = 1; - } - else if (strcmp (name, ".reginfo") == 0) - { - hdr->sh_type = SHT_MIPS_REGINFO; - /* In a shared object on Irix 5.3, the .reginfo section has an - entsize of 0x18. FIXME: Does this matter? */ - if (SGI_COMPAT (abfd)) - { - if ((abfd->flags & DYNAMIC) != 0) - hdr->sh_entsize = sizeof (Elf32_External_RegInfo); - else - hdr->sh_entsize = 1; - } - else - hdr->sh_entsize = sizeof (Elf32_External_RegInfo); - } - else if (SGI_COMPAT (abfd) - && (strcmp (name, ".hash") == 0 - || strcmp (name, ".dynamic") == 0 - || strcmp (name, ".dynstr") == 0)) - { - if (SGI_COMPAT (abfd)) - hdr->sh_entsize = 0; -#if 0 - /* This isn't how the Irix 6 linker behaves. */ - hdr->sh_info = SIZEOF_MIPS_DYNSYM_SECNAMES; -#endif - } - else if (strcmp (name, ".got") == 0 - || strcmp (name, MIPS_ELF_SRDATA_SECTION_NAME (abfd)) == 0 - || strcmp (name, ".sdata") == 0 - || strcmp (name, ".sbss") == 0 - || strcmp (name, ".lit4") == 0 - || strcmp (name, ".lit8") == 0) - hdr->sh_flags |= SHF_MIPS_GPREL; - else if (strcmp (name, ".MIPS.interfaces") == 0) - { - hdr->sh_type = SHT_MIPS_IFACE; - hdr->sh_flags |= SHF_MIPS_NOSTRIP; - } - else if (strncmp (name, ".MIPS.content", strlen (".MIPS.content")) == 0) - { - hdr->sh_type = SHT_MIPS_CONTENT; - hdr->sh_flags |= SHF_MIPS_NOSTRIP; - /* The sh_info field is set in final_write_processing. */ - } - else if (strcmp (name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0) - { - hdr->sh_type = SHT_MIPS_OPTIONS; - hdr->sh_entsize = 1; - hdr->sh_flags |= SHF_MIPS_NOSTRIP; - } - else if (strncmp (name, ".debug_", sizeof ".debug_" - 1) == 0) - hdr->sh_type = SHT_MIPS_DWARF; - else if (strcmp (name, ".MIPS.symlib") == 0) - { - hdr->sh_type = SHT_MIPS_SYMBOL_LIB; - /* The sh_link and sh_info fields are set in - final_write_processing. */ - } - else if (strncmp (name, ".MIPS.events", sizeof ".MIPS.events" - 1) == 0 - || strncmp (name, ".MIPS.post_rel", - sizeof ".MIPS.post_rel" - 1) == 0) - { - hdr->sh_type = SHT_MIPS_EVENTS; - hdr->sh_flags |= SHF_MIPS_NOSTRIP; - /* The sh_link field is set in final_write_processing. */ - } - else if (strcmp (name, MIPS_ELF_MSYM_SECTION_NAME (abfd)) == 0) - { - hdr->sh_type = SHT_MIPS_MSYM; - hdr->sh_flags |= SHF_ALLOC; - hdr->sh_entsize = 8; - } - - /* The generic elf_fake_sections will set up REL_HDR using the - default kind of relocations. But, we may actually need both - kinds of relocations, so we set up the second header here. - - This is not necessary for the O32 ABI since that only uses Elf32_Rel - relocations (cf. System V ABI, MIPS RISC Processor Supplement, - 3rd Edition, p. 4-17). It breaks the IRIX 5/6 32-bit ld, since one - of the resulting empty .rela.<section> sections starts with - sh_offset == object size, and ld doesn't allow that. While the check - is arguably bogus for empty or SHT_NOBITS sections, it can easily be - avoided by not emitting those useless sections in the first place. */ - if (IRIX_COMPAT (abfd) != ict_irix5 && (sec->flags & SEC_RELOC) != 0) - { - struct bfd_elf_section_data *esd; - bfd_size_type amt = sizeof (Elf_Internal_Shdr); - - esd = elf_section_data (sec); - BFD_ASSERT (esd->rel_hdr2 == NULL); - esd->rel_hdr2 = (Elf_Internal_Shdr *) bfd_zalloc (abfd, amt); - if (!esd->rel_hdr2) - return false; - _bfd_elf_init_reloc_shdr (abfd, esd->rel_hdr2, sec, - !elf_section_data (sec)->use_rela_p); - } - - return true; -} - -/* Given a BFD section, try to locate the corresponding ELF section - index. This is used by both the 32-bit and the 64-bit ABI. - Actually, it's not clear to me that the 64-bit ABI supports these, - but for non-PIC objects we will certainly want support for at least - the .scommon section. */ - -boolean -_bfd_mips_elf_section_from_bfd_section (abfd, sec, retval) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec; - int *retval; -{ - if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0) - { - *retval = SHN_MIPS_SCOMMON; - return true; - } - if (strcmp (bfd_get_section_name (abfd, sec), ".acommon") == 0) - { - *retval = SHN_MIPS_ACOMMON; - return true; - } - return false; -} - -/* When are writing out the .options or .MIPS.options section, - remember the bytes we are writing out, so that we can install the - GP value in the section_processing routine. */ - -boolean -_bfd_mips_elf_set_section_contents (abfd, section, location, offset, count) - bfd *abfd; - sec_ptr section; - PTR location; - file_ptr offset; - bfd_size_type count; -{ - if (strcmp (section->name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0) - { - bfd_byte *c; - - if (elf_section_data (section) == NULL) - { - bfd_size_type amt = sizeof (struct bfd_elf_section_data); - section->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); - if (elf_section_data (section) == NULL) - return false; - } - c = (bfd_byte *) elf_section_data (section)->tdata; - if (c == NULL) - { - bfd_size_type size; - - if (section->_cooked_size != 0) - size = section->_cooked_size; - else - size = section->_raw_size; - c = (bfd_byte *) bfd_zalloc (abfd, size); - if (c == NULL) - return false; - elf_section_data (section)->tdata = (PTR) c; - } - - memcpy (c + offset, location, (size_t) count); - } - - return _bfd_elf_set_section_contents (abfd, section, location, offset, - count); -} - -/* Work over a section just before writing it out. This routine is - used by both the 32-bit and the 64-bit ABI. FIXME: We recognize - sections that need the SHF_MIPS_GPREL flag by name; there has to be - a better way. */ - -boolean -_bfd_mips_elf_section_processing (abfd, hdr) - bfd *abfd; - Elf_Internal_Shdr *hdr; -{ - if (hdr->sh_type == SHT_MIPS_REGINFO - && hdr->sh_size > 0) - { - bfd_byte buf[4]; - - BFD_ASSERT (hdr->sh_size == sizeof (Elf32_External_RegInfo)); - BFD_ASSERT (hdr->contents == NULL); - - if (bfd_seek (abfd, - hdr->sh_offset + sizeof (Elf32_External_RegInfo) - 4, - SEEK_SET) != 0) - return false; - H_PUT_32 (abfd, elf_gp (abfd), buf); - if (bfd_bwrite (buf, (bfd_size_type) 4, abfd) != 4) - return false; - } - - if (hdr->sh_type == SHT_MIPS_OPTIONS - && hdr->bfd_section != NULL - && elf_section_data (hdr->bfd_section) != NULL - && elf_section_data (hdr->bfd_section)->tdata != NULL) - { - bfd_byte *contents, *l, *lend; - - /* We stored the section contents in the elf_section_data tdata - field in the set_section_contents routine. We save the - section contents so that we don't have to read them again. - At this point we know that elf_gp is set, so we can look - through the section contents to see if there is an - ODK_REGINFO structure. */ - - contents = (bfd_byte *) elf_section_data (hdr->bfd_section)->tdata; - l = contents; - lend = contents + hdr->sh_size; - while (l + sizeof (Elf_External_Options) <= lend) - { - Elf_Internal_Options intopt; - - bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l, - &intopt); - if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO) - { - bfd_byte buf[8]; - - if (bfd_seek (abfd, - (hdr->sh_offset - + (l - contents) - + sizeof (Elf_External_Options) - + (sizeof (Elf64_External_RegInfo) - 8)), - SEEK_SET) != 0) - return false; - H_PUT_64 (abfd, elf_gp (abfd), buf); - if (bfd_bwrite (buf, (bfd_size_type) 8, abfd) != 8) - return false; - } - else if (intopt.kind == ODK_REGINFO) - { - bfd_byte buf[4]; - - if (bfd_seek (abfd, - (hdr->sh_offset - + (l - contents) - + sizeof (Elf_External_Options) - + (sizeof (Elf32_External_RegInfo) - 4)), - SEEK_SET) != 0) - return false; - H_PUT_32 (abfd, elf_gp (abfd), buf); - if (bfd_bwrite (buf, (bfd_size_type) 4, abfd) != 4) - return false; - } - l += intopt.size; - } - } - - if (hdr->bfd_section != NULL) - { - const char *name = bfd_get_section_name (abfd, hdr->bfd_section); - - if (strcmp (name, ".sdata") == 0 - || strcmp (name, ".lit8") == 0 - || strcmp (name, ".lit4") == 0) - { - hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL; - hdr->sh_type = SHT_PROGBITS; - } - else if (strcmp (name, ".sbss") == 0) - { - hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL; - hdr->sh_type = SHT_NOBITS; - } - else if (strcmp (name, MIPS_ELF_SRDATA_SECTION_NAME (abfd)) == 0) - { - hdr->sh_flags |= SHF_ALLOC | SHF_MIPS_GPREL; - hdr->sh_type = SHT_PROGBITS; - } - else if (strcmp (name, ".compact_rel") == 0) - { - hdr->sh_flags = 0; - hdr->sh_type = SHT_PROGBITS; - } - else if (strcmp (name, ".rtproc") == 0) - { - if (hdr->sh_addralign != 0 && hdr->sh_entsize == 0) - { - unsigned int adjust; - - adjust = hdr->sh_size % hdr->sh_addralign; - if (adjust != 0) - hdr->sh_size += hdr->sh_addralign - adjust; - } - } - } - - return true; -} - -/* MIPS ELF uses two common sections. One is the usual one, and the - other is for small objects. All the small objects are kept - together, and then referenced via the gp pointer, which yields - faster assembler code. This is what we use for the small common - section. This approach is copied from ecoff.c. */ -static asection mips_elf_scom_section; -static asymbol mips_elf_scom_symbol; -static asymbol *mips_elf_scom_symbol_ptr; - -/* MIPS ELF also uses an acommon section, which represents an - allocated common symbol which may be overridden by a - definition in a shared library. */ -static asection mips_elf_acom_section; -static asymbol mips_elf_acom_symbol; -static asymbol *mips_elf_acom_symbol_ptr; - -/* Handle the special MIPS section numbers that a symbol may use. - This is used for both the 32-bit and the 64-bit ABI. */ - -void -_bfd_mips_elf_symbol_processing (abfd, asym) - bfd *abfd; - asymbol *asym; -{ - elf_symbol_type *elfsym; - - elfsym = (elf_symbol_type *) asym; - switch (elfsym->internal_elf_sym.st_shndx) - { - case SHN_MIPS_ACOMMON: - /* This section is used in a dynamically linked executable file. - It is an allocated common section. The dynamic linker can - either resolve these symbols to something in a shared - library, or it can just leave them here. For our purposes, - we can consider these symbols to be in a new section. */ - if (mips_elf_acom_section.name == NULL) - { - /* Initialize the acommon section. */ - mips_elf_acom_section.name = ".acommon"; - mips_elf_acom_section.flags = SEC_ALLOC; - mips_elf_acom_section.output_section = &mips_elf_acom_section; - mips_elf_acom_section.symbol = &mips_elf_acom_symbol; - mips_elf_acom_section.symbol_ptr_ptr = &mips_elf_acom_symbol_ptr; - mips_elf_acom_symbol.name = ".acommon"; - mips_elf_acom_symbol.flags = BSF_SECTION_SYM; - mips_elf_acom_symbol.section = &mips_elf_acom_section; - mips_elf_acom_symbol_ptr = &mips_elf_acom_symbol; - } - asym->section = &mips_elf_acom_section; - break; - - case SHN_COMMON: - /* Common symbols less than the GP size are automatically - treated as SHN_MIPS_SCOMMON symbols on IRIX5. */ - if (asym->value > elf_gp_size (abfd) - || IRIX_COMPAT (abfd) == ict_irix6) - break; - /* Fall through. */ - case SHN_MIPS_SCOMMON: - if (mips_elf_scom_section.name == NULL) - { - /* Initialize the small common section. */ - mips_elf_scom_section.name = ".scommon"; - mips_elf_scom_section.flags = SEC_IS_COMMON; - mips_elf_scom_section.output_section = &mips_elf_scom_section; - mips_elf_scom_section.symbol = &mips_elf_scom_symbol; - mips_elf_scom_section.symbol_ptr_ptr = &mips_elf_scom_symbol_ptr; - mips_elf_scom_symbol.name = ".scommon"; - mips_elf_scom_symbol.flags = BSF_SECTION_SYM; - mips_elf_scom_symbol.section = &mips_elf_scom_section; - mips_elf_scom_symbol_ptr = &mips_elf_scom_symbol; - } - asym->section = &mips_elf_scom_section; - asym->value = elfsym->internal_elf_sym.st_size; - break; - - case SHN_MIPS_SUNDEFINED: - asym->section = bfd_und_section_ptr; - break; - -#if 0 /* for SGI_COMPAT */ - case SHN_MIPS_TEXT: - asym->section = mips_elf_text_section_ptr; - break; - - case SHN_MIPS_DATA: - asym->section = mips_elf_data_section_ptr; - break; -#endif - } -} - -/* When creating an Irix 5 executable, we need REGINFO and RTPROC - segments. */ - -int -_bfd_mips_elf_additional_program_headers (abfd) - bfd *abfd; -{ - asection *s; - int ret = 0; - - /* See if we need a PT_MIPS_REGINFO segment. */ - s = bfd_get_section_by_name (abfd, ".reginfo"); - if (s && (s->flags & SEC_LOAD)) - ++ret; - - /* See if we need a PT_MIPS_OPTIONS segment. */ - if (IRIX_COMPAT (abfd) == ict_irix6 - && bfd_get_section_by_name (abfd, - MIPS_ELF_OPTIONS_SECTION_NAME (abfd))) - ++ret; - - /* See if we need a PT_MIPS_RTPROC segment. */ - if (IRIX_COMPAT (abfd) == ict_irix5 - && bfd_get_section_by_name (abfd, ".dynamic") - && bfd_get_section_by_name (abfd, ".mdebug")) - ++ret; - - return ret; -} - -/* Modify the segment map for an Irix 5 executable. */ - -boolean -_bfd_mips_elf_modify_segment_map (abfd) - bfd *abfd; -{ - asection *s; - struct elf_segment_map *m, **pm; - bfd_size_type amt; - - /* If there is a .reginfo section, we need a PT_MIPS_REGINFO - segment. */ - s = bfd_get_section_by_name (abfd, ".reginfo"); - if (s != NULL && (s->flags & SEC_LOAD) != 0) - { - for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) - if (m->p_type == PT_MIPS_REGINFO) - break; - if (m == NULL) - { - amt = sizeof *m; - m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); - if (m == NULL) - return false; - - m->p_type = PT_MIPS_REGINFO; - m->count = 1; - m->sections[0] = s; - - /* We want to put it after the PHDR and INTERP segments. */ - pm = &elf_tdata (abfd)->segment_map; - while (*pm != NULL - && ((*pm)->p_type == PT_PHDR - || (*pm)->p_type == PT_INTERP)) - pm = &(*pm)->next; - - m->next = *pm; - *pm = m; - } - } - - /* For IRIX 6, we don't have .mdebug sections, nor does anything but - .dynamic end up in PT_DYNAMIC. However, we do have to insert a - PT_OPTIONS segement immediately following the program header - table. */ - if (IRIX_COMPAT (abfd) == ict_irix6) - { - for (s = abfd->sections; s; s = s->next) - if (elf_section_data (s)->this_hdr.sh_type == SHT_MIPS_OPTIONS) - break; - - if (s) - { - struct elf_segment_map *options_segment; - - /* Usually, there's a program header table. But, sometimes - there's not (like when running the `ld' testsuite). So, - if there's no program header table, we just put the - options segement at the end. */ - for (pm = &elf_tdata (abfd)->segment_map; - *pm != NULL; - pm = &(*pm)->next) - if ((*pm)->p_type == PT_PHDR) - break; - - amt = sizeof (struct elf_segment_map); - options_segment = bfd_zalloc (abfd, amt); - options_segment->next = *pm; - options_segment->p_type = PT_MIPS_OPTIONS; - options_segment->p_flags = PF_R; - options_segment->p_flags_valid = true; - options_segment->count = 1; - options_segment->sections[0] = s; - *pm = options_segment; - } - } - else - { - if (IRIX_COMPAT (abfd) == ict_irix5) - { - /* If there are .dynamic and .mdebug sections, we make a room - for the RTPROC header. FIXME: Rewrite without section names. */ - if (bfd_get_section_by_name (abfd, ".interp") == NULL - && bfd_get_section_by_name (abfd, ".dynamic") != NULL - && bfd_get_section_by_name (abfd, ".mdebug") != NULL) - { - for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) - if (m->p_type == PT_MIPS_RTPROC) - break; - if (m == NULL) - { - amt = sizeof *m; - m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); - if (m == NULL) - return false; - - m->p_type = PT_MIPS_RTPROC; - - s = bfd_get_section_by_name (abfd, ".rtproc"); - if (s == NULL) - { - m->count = 0; - m->p_flags = 0; - m->p_flags_valid = 1; - } - else - { - m->count = 1; - m->sections[0] = s; - } - - /* We want to put it after the DYNAMIC segment. */ - pm = &elf_tdata (abfd)->segment_map; - while (*pm != NULL && (*pm)->p_type != PT_DYNAMIC) - pm = &(*pm)->next; - if (*pm != NULL) - pm = &(*pm)->next; - - m->next = *pm; - *pm = m; - } - } - } - /* On Irix 5, the PT_DYNAMIC segment includes the .dynamic, - .dynstr, .dynsym, and .hash sections, and everything in - between. */ - for (pm = &elf_tdata (abfd)->segment_map; *pm != NULL; - pm = &(*pm)->next) - if ((*pm)->p_type == PT_DYNAMIC) - break; - m = *pm; - if (m != NULL && IRIX_COMPAT (abfd) == ict_none) - { - /* For a normal mips executable the permissions for the PT_DYNAMIC - segment are read, write and execute. We do that here since - the code in elf.c sets only the read permission. This matters - sometimes for the dynamic linker. */ - if (bfd_get_section_by_name (abfd, ".dynamic") != NULL) - { - m->p_flags = PF_R | PF_W | PF_X; - m->p_flags_valid = 1; - } - } - if (m != NULL - && m->count == 1 && strcmp (m->sections[0]->name, ".dynamic") == 0) - { - static const char *sec_names[] = - { - ".dynamic", ".dynstr", ".dynsym", ".hash" - }; - bfd_vma low, high; - unsigned int i, c; - struct elf_segment_map *n; - - low = 0xffffffff; - high = 0; - for (i = 0; i < sizeof sec_names / sizeof sec_names[0]; i++) - { - s = bfd_get_section_by_name (abfd, sec_names[i]); - if (s != NULL && (s->flags & SEC_LOAD) != 0) - { - bfd_size_type sz; - - if (low > s->vma) - low = s->vma; - sz = s->_cooked_size; - if (sz == 0) - sz = s->_raw_size; - if (high < s->vma + sz) - high = s->vma + sz; - } - } - - c = 0; - for (s = abfd->sections; s != NULL; s = s->next) - if ((s->flags & SEC_LOAD) != 0 - && s->vma >= low - && ((s->vma - + (s->_cooked_size != - 0 ? s->_cooked_size : s->_raw_size)) <= high)) - ++c; - - amt = sizeof *n + (bfd_size_type) (c - 1) * sizeof (asection *); - n = (struct elf_segment_map *) bfd_zalloc (abfd, amt); - if (n == NULL) - return false; - *n = *m; - n->count = c; - - i = 0; - for (s = abfd->sections; s != NULL; s = s->next) - { - if ((s->flags & SEC_LOAD) != 0 - && s->vma >= low - && ((s->vma - + (s->_cooked_size != 0 ? - s->_cooked_size : s->_raw_size)) <= high)) - { - n->sections[i] = s; - ++i; - } - } - - *pm = n; - } - } - - return true; -} - -/* The structure of the runtime procedure descriptor created by the - loader for use by the static exception system. */ - -typedef struct runtime_pdr { - bfd_vma adr; /* memory address of start of procedure */ - long regmask; /* save register mask */ - long regoffset; /* save register offset */ - long fregmask; /* save floating point register mask */ - long fregoffset; /* save floating point register offset */ - long frameoffset; /* frame size */ - short framereg; /* frame pointer register */ - short pcreg; /* offset or reg of return pc */ - long irpss; /* index into the runtime string table */ - long reserved; - struct exception_info *exception_info;/* pointer to exception array */ -} RPDR, *pRPDR; -#define cbRPDR sizeof (RPDR) -#define rpdNil ((pRPDR) 0) - -/* Swap RPDR (runtime procedure table entry) for output. */ - -static void ecoff_swap_rpdr_out - PARAMS ((bfd *, const RPDR *, struct rpdr_ext *)); - -static void -ecoff_swap_rpdr_out (abfd, in, ex) - bfd *abfd; - const RPDR *in; - struct rpdr_ext *ex; -{ - /* ECOFF_PUT_OFF was defined in ecoffswap.h. */ - ECOFF_PUT_OFF (abfd, in->adr, ex->p_adr); - H_PUT_32 (abfd, in->regmask, ex->p_regmask); - H_PUT_32 (abfd, in->regoffset, ex->p_regoffset); - H_PUT_32 (abfd, in->fregmask, ex->p_fregmask); - H_PUT_32 (abfd, in->fregoffset, ex->p_fregoffset); - H_PUT_32 (abfd, in->frameoffset, ex->p_frameoffset); - - H_PUT_16 (abfd, in->framereg, ex->p_framereg); - H_PUT_16 (abfd, in->pcreg, ex->p_pcreg); - - H_PUT_32 (abfd, in->irpss, ex->p_irpss); -#if 0 /* FIXME */ - ECOFF_PUT_OFF (abfd, in->exception_info, ex->p_exception_info); -#endif -} - -/* Read ECOFF debugging information from a .mdebug section into a - ecoff_debug_info structure. */ - -boolean -_bfd_mips_elf_read_ecoff_info (abfd, section, debug) - bfd *abfd; - asection *section; - struct ecoff_debug_info *debug; -{ - HDRR *symhdr; - const struct ecoff_debug_swap *swap; - char *ext_hdr = NULL; - - swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; - memset (debug, 0, sizeof (*debug)); - - ext_hdr = (char *) bfd_malloc (swap->external_hdr_size); - if (ext_hdr == NULL && swap->external_hdr_size != 0) - goto error_return; - - if (bfd_get_section_contents (abfd, section, ext_hdr, (file_ptr) 0, - swap->external_hdr_size) - == false) - goto error_return; - - symhdr = &debug->symbolic_header; - (*swap->swap_hdr_in) (abfd, ext_hdr, symhdr); - - /* The symbolic header contains absolute file offsets and sizes to - read. */ -#define READ(ptr, offset, count, size, type) \ - if (symhdr->count == 0) \ - debug->ptr = NULL; \ - else \ - { \ - bfd_size_type amt = (bfd_size_type) size * symhdr->count; \ - debug->ptr = (type) bfd_malloc (amt); \ - if (debug->ptr == NULL) \ - goto error_return; \ - if (bfd_seek (abfd, (file_ptr) symhdr->offset, SEEK_SET) != 0 \ - || bfd_bread (debug->ptr, amt, abfd) != amt) \ - goto error_return; \ - } - - READ (line, cbLineOffset, cbLine, sizeof (unsigned char), unsigned char *); - READ (external_dnr, cbDnOffset, idnMax, swap->external_dnr_size, PTR); - READ (external_pdr, cbPdOffset, ipdMax, swap->external_pdr_size, PTR); - READ (external_sym, cbSymOffset, isymMax, swap->external_sym_size, PTR); - READ (external_opt, cbOptOffset, ioptMax, swap->external_opt_size, PTR); - READ (external_aux, cbAuxOffset, iauxMax, sizeof (union aux_ext), - union aux_ext *); - READ (ss, cbSsOffset, issMax, sizeof (char), char *); - READ (ssext, cbSsExtOffset, issExtMax, sizeof (char), char *); - READ (external_fdr, cbFdOffset, ifdMax, swap->external_fdr_size, PTR); - READ (external_rfd, cbRfdOffset, crfd, swap->external_rfd_size, PTR); - READ (external_ext, cbExtOffset, iextMax, swap->external_ext_size, PTR); -#undef READ - - debug->fdr = NULL; - debug->adjust = NULL; - - return true; - - error_return: - if (ext_hdr != NULL) - free (ext_hdr); - if (debug->line != NULL) - free (debug->line); - if (debug->external_dnr != NULL) - free (debug->external_dnr); - if (debug->external_pdr != NULL) - free (debug->external_pdr); - if (debug->external_sym != NULL) - free (debug->external_sym); - if (debug->external_opt != NULL) - free (debug->external_opt); - if (debug->external_aux != NULL) - free (debug->external_aux); - if (debug->ss != NULL) - free (debug->ss); - if (debug->ssext != NULL) - free (debug->ssext); - if (debug->external_fdr != NULL) - free (debug->external_fdr); - if (debug->external_rfd != NULL) - free (debug->external_rfd); - if (debug->external_ext != NULL) - free (debug->external_ext); - return false; -} - -/* MIPS ELF local labels start with '$', not 'L'. */ - -static boolean -mips_elf_is_local_label_name (abfd, name) - bfd *abfd; - const char *name; -{ - if (name[0] == '$') - return true; - - /* On Irix 6, the labels go back to starting with '.', so we accept - the generic ELF local label syntax as well. */ - return _bfd_elf_is_local_label_name (abfd, name); -} - -/* MIPS ELF uses a special find_nearest_line routine in order the - handle the ECOFF debugging information. */ - -struct mips_elf_find_line -{ - struct ecoff_debug_info d; - struct ecoff_find_line i; -}; - -boolean -_bfd_mips_elf_find_nearest_line (abfd, section, symbols, offset, filename_ptr, - functionname_ptr, line_ptr) - bfd *abfd; - asection *section; - asymbol **symbols; - bfd_vma offset; - const char **filename_ptr; - const char **functionname_ptr; - unsigned int *line_ptr; -{ - asection *msec; - - if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr)) - return true; - - if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr, - (unsigned) (ABI_64_P (abfd) ? 8 : 0), - &elf_tdata (abfd)->dwarf2_find_line_info)) - return true; - - msec = bfd_get_section_by_name (abfd, ".mdebug"); - if (msec != NULL) - { - flagword origflags; - struct mips_elf_find_line *fi; - const struct ecoff_debug_swap * const swap = - get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; - - /* If we are called during a link, mips_elf_final_link may have - cleared the SEC_HAS_CONTENTS field. We force it back on here - if appropriate (which it normally will be). */ - origflags = msec->flags; - if (elf_section_data (msec)->this_hdr.sh_type != SHT_NOBITS) - msec->flags |= SEC_HAS_CONTENTS; - - fi = elf_tdata (abfd)->find_line_info; - if (fi == NULL) - { - bfd_size_type external_fdr_size; - char *fraw_src; - char *fraw_end; - struct fdr *fdr_ptr; - bfd_size_type amt = sizeof (struct mips_elf_find_line); - - fi = (struct mips_elf_find_line *) bfd_zalloc (abfd, amt); - if (fi == NULL) - { - msec->flags = origflags; - return false; - } - - if (! _bfd_mips_elf_read_ecoff_info (abfd, msec, &fi->d)) - { - msec->flags = origflags; - return false; - } - - /* Swap in the FDR information. */ - amt = fi->d.symbolic_header.ifdMax * sizeof (struct fdr); - fi->d.fdr = (struct fdr *) bfd_alloc (abfd, amt); - if (fi->d.fdr == NULL) - { - msec->flags = origflags; - return false; - } - external_fdr_size = swap->external_fdr_size; - fdr_ptr = fi->d.fdr; - fraw_src = (char *) fi->d.external_fdr; - fraw_end = (fraw_src - + fi->d.symbolic_header.ifdMax * external_fdr_size); - for (; fraw_src < fraw_end; fraw_src += external_fdr_size, fdr_ptr++) - (*swap->swap_fdr_in) (abfd, (PTR) fraw_src, fdr_ptr); - - elf_tdata (abfd)->find_line_info = fi; - - /* Note that we don't bother to ever free this information. - find_nearest_line is either called all the time, as in - objdump -l, so the information should be saved, or it is - rarely called, as in ld error messages, so the memory - wasted is unimportant. Still, it would probably be a - good idea for free_cached_info to throw it away. */ - } - - if (_bfd_ecoff_locate_line (abfd, section, offset, &fi->d, swap, - &fi->i, filename_ptr, functionname_ptr, - line_ptr)) - { - msec->flags = origflags; - return true; - } - - msec->flags = origflags; - } - - /* Fall back on the generic ELF find_nearest_line routine. */ - - return _bfd_elf_find_nearest_line (abfd, section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr); -} - - /* The mips16 compiler uses a couple of special sections to handle - floating point arguments. - - Section names that look like .mips16.fn.FNNAME contain stubs that - copy floating point arguments from the fp regs to the gp regs and - then jump to FNNAME. If any 32 bit function calls FNNAME, the - call should be redirected to the stub instead. If no 32 bit - function calls FNNAME, the stub should be discarded. We need to - consider any reference to the function, not just a call, because - if the address of the function is taken we will need the stub, - since the address might be passed to a 32 bit function. - - Section names that look like .mips16.call.FNNAME contain stubs - that copy floating point arguments from the gp regs to the fp - regs and then jump to FNNAME. If FNNAME is a 32 bit function, - then any 16 bit function that calls FNNAME should be redirected - to the stub instead. If FNNAME is not a 32 bit function, the - stub should be discarded. - - .mips16.call.fp.FNNAME sections are similar, but contain stubs - which call FNNAME and then copy the return value from the fp regs - to the gp regs. These stubs store the return value in $18 while - calling FNNAME; any function which might call one of these stubs - must arrange to save $18 around the call. (This case is not - needed for 32 bit functions that call 16 bit functions, because - 16 bit functions always return floating point values in both - $f0/$f1 and $2/$3.) - - Note that in all cases FNNAME might be defined statically. - Therefore, FNNAME is not used literally. Instead, the relocation - information will indicate which symbol the section is for. - - We record any stubs that we find in the symbol table. */ - -#define FN_STUB ".mips16.fn." -#define CALL_STUB ".mips16.call." -#define CALL_FP_STUB ".mips16.call.fp." - -/* MIPS ELF linker hash table. */ - -struct mips_elf_link_hash_table -{ - struct elf_link_hash_table root; -#if 0 - /* We no longer use this. */ - /* String section indices for the dynamic section symbols. */ - bfd_size_type dynsym_sec_strindex[SIZEOF_MIPS_DYNSYM_SECNAMES]; -#endif - /* The number of .rtproc entries. */ - bfd_size_type procedure_count; - /* The size of the .compact_rel section (if SGI_COMPAT). */ - bfd_size_type compact_rel_size; - /* This flag indicates that the value of DT_MIPS_RLD_MAP dynamic - entry is set to the address of __rld_obj_head as in Irix 5. */ - boolean use_rld_obj_head; - /* This is the value of the __rld_map or __rld_obj_head symbol. */ - bfd_vma rld_value; - /* This is set if we see any mips16 stub sections. */ - boolean mips16_stubs_seen; -}; - -/* Look up an entry in a MIPS ELF linker hash table. */ - -#define mips_elf_link_hash_lookup(table, string, create, copy, follow) \ - ((struct mips_elf_link_hash_entry *) \ - elf_link_hash_lookup (&(table)->root, (string), (create), \ - (copy), (follow))) - -/* Traverse a MIPS ELF linker hash table. */ - -#define mips_elf_link_hash_traverse(table, func, info) \ - (elf_link_hash_traverse \ - (&(table)->root, \ - (boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ - (info))) - -/* Get the MIPS ELF linker hash table from a link_info structure. */ - -#define mips_elf_hash_table(p) \ - ((struct mips_elf_link_hash_table *) ((p)->hash)) - -static boolean mips_elf_output_extsym - PARAMS ((struct mips_elf_link_hash_entry *, PTR)); - -/* Create an entry in a MIPS ELF linker hash table. */ - -static struct bfd_hash_entry * -mips_elf_link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; -{ - struct mips_elf_link_hash_entry *ret = - (struct mips_elf_link_hash_entry *) entry; - - /* Allocate the structure if it has not already been allocated by a - subclass. */ - if (ret == (struct mips_elf_link_hash_entry *) NULL) - ret = ((struct mips_elf_link_hash_entry *) - bfd_hash_allocate (table, - sizeof (struct mips_elf_link_hash_entry))); - if (ret == (struct mips_elf_link_hash_entry *) NULL) - return (struct bfd_hash_entry *) ret; - - /* Call the allocation method of the superclass. */ - ret = ((struct mips_elf_link_hash_entry *) - _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, - table, string)); - if (ret != (struct mips_elf_link_hash_entry *) NULL) - { - /* Set local fields. */ - memset (&ret->esym, 0, sizeof (EXTR)); - /* We use -2 as a marker to indicate that the information has - not been set. -1 means there is no associated ifd. */ - ret->esym.ifd = -2; - ret->possibly_dynamic_relocs = 0; - ret->readonly_reloc = false; - ret->min_dyn_reloc_index = 0; - ret->no_fn_stub = false; - ret->fn_stub = NULL; - ret->need_fn_stub = false; - ret->call_stub = NULL; - ret->call_fp_stub = NULL; - ret->forced_local = false; - } - - return (struct bfd_hash_entry *) ret; -} - -static void -_bfd_mips_elf_hide_symbol (info, entry, force_local) - struct bfd_link_info *info; - struct elf_link_hash_entry *entry; - boolean force_local; -{ - bfd *dynobj; - asection *got; - struct mips_got_info *g; - struct mips_elf_link_hash_entry *h; - - h = (struct mips_elf_link_hash_entry *) entry; - if (h->forced_local) - return; - h->forced_local = true; - - dynobj = elf_hash_table (info)->dynobj; - got = bfd_get_section_by_name (dynobj, ".got"); - g = (struct mips_got_info *) elf_section_data (got)->tdata; - - _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local); - - /* FIXME: Do we allocate too much GOT space here? */ - g->local_gotno++; - got->_raw_size += MIPS_ELF_GOT_SIZE (dynobj); -} - -/* Create a MIPS ELF linker hash table. */ - -struct bfd_link_hash_table * -_bfd_mips_elf_link_hash_table_create (abfd) - bfd *abfd; -{ - struct mips_elf_link_hash_table *ret; - bfd_size_type amt = sizeof (struct mips_elf_link_hash_table); - - ret = (struct mips_elf_link_hash_table *) bfd_alloc (abfd, amt); - if (ret == (struct mips_elf_link_hash_table *) NULL) - return NULL; - - if (! _bfd_elf_link_hash_table_init (&ret->root, abfd, - mips_elf_link_hash_newfunc)) - { - bfd_release (abfd, ret); - return NULL; - } - -#if 0 - /* We no longer use this. */ - for (i = 0; i < SIZEOF_MIPS_DYNSYM_SECNAMES; i++) - ret->dynsym_sec_strindex[i] = (bfd_size_type) -1; -#endif - ret->procedure_count = 0; - ret->compact_rel_size = 0; - ret->use_rld_obj_head = false; - ret->rld_value = 0; - ret->mips16_stubs_seen = false; - - return &ret->root.root; -} - -/* Hook called by the linker routine which adds symbols from an object - file. We must handle the special MIPS section numbers here. */ - -boolean -_bfd_mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) - bfd *abfd; - struct bfd_link_info *info; - const Elf_Internal_Sym *sym; - const char **namep; - flagword *flagsp ATTRIBUTE_UNUSED; - asection **secp; - bfd_vma *valp; -{ - if (SGI_COMPAT (abfd) - && (abfd->flags & DYNAMIC) != 0 - && strcmp (*namep, "_rld_new_interface") == 0) - { - /* Skip Irix 5 rld entry name. */ - *namep = NULL; - return true; - } - - switch (sym->st_shndx) - { - case SHN_COMMON: - /* Common symbols less than the GP size are automatically - treated as SHN_MIPS_SCOMMON symbols. */ - if (sym->st_size > elf_gp_size (abfd) - || IRIX_COMPAT (abfd) == ict_irix6) - break; - /* Fall through. */ - case SHN_MIPS_SCOMMON: - *secp = bfd_make_section_old_way (abfd, ".scommon"); - (*secp)->flags |= SEC_IS_COMMON; - *valp = sym->st_size; - break; - - case SHN_MIPS_TEXT: - /* This section is used in a shared object. */ - if (elf_tdata (abfd)->elf_text_section == NULL) - { - asymbol *elf_text_symbol; - asection *elf_text_section; - bfd_size_type amt = sizeof (asection); - - elf_text_section = bfd_zalloc (abfd, amt); - if (elf_text_section == NULL) - return false; - - amt = sizeof (asymbol); - elf_text_symbol = bfd_zalloc (abfd, amt); - if (elf_text_symbol == NULL) - return false; - - /* Initialize the section. */ - - elf_tdata (abfd)->elf_text_section = elf_text_section; - elf_tdata (abfd)->elf_text_symbol = elf_text_symbol; - - elf_text_section->symbol = elf_text_symbol; - elf_text_section->symbol_ptr_ptr = &elf_tdata (abfd)->elf_text_symbol; - - elf_text_section->name = ".text"; - elf_text_section->flags = SEC_NO_FLAGS; - elf_text_section->output_section = NULL; - elf_text_section->owner = abfd; - elf_text_symbol->name = ".text"; - elf_text_symbol->flags = BSF_SECTION_SYM | BSF_DYNAMIC; - elf_text_symbol->section = elf_text_section; - } - /* This code used to do *secp = bfd_und_section_ptr if - info->shared. I don't know why, and that doesn't make sense, - so I took it out. */ - *secp = elf_tdata (abfd)->elf_text_section; - break; - - case SHN_MIPS_ACOMMON: - /* Fall through. XXX Can we treat this as allocated data? */ - case SHN_MIPS_DATA: - /* This section is used in a shared object. */ - if (elf_tdata (abfd)->elf_data_section == NULL) - { - asymbol *elf_data_symbol; - asection *elf_data_section; - bfd_size_type amt = sizeof (asection); - - elf_data_section = bfd_zalloc (abfd, amt); - if (elf_data_section == NULL) - return false; - - amt = sizeof (asymbol); - elf_data_symbol = bfd_zalloc (abfd, amt); - if (elf_data_symbol == NULL) - return false; - - /* Initialize the section. */ - - elf_tdata (abfd)->elf_data_section = elf_data_section; - elf_tdata (abfd)->elf_data_symbol = elf_data_symbol; - - elf_data_section->symbol = elf_data_symbol; - elf_data_section->symbol_ptr_ptr = &elf_tdata (abfd)->elf_data_symbol; - - elf_data_section->name = ".data"; - elf_data_section->flags = SEC_NO_FLAGS; - elf_data_section->output_section = NULL; - elf_data_section->owner = abfd; - elf_data_symbol->name = ".data"; - elf_data_symbol->flags = BSF_SECTION_SYM | BSF_DYNAMIC; - elf_data_symbol->section = elf_data_section; - } - /* This code used to do *secp = bfd_und_section_ptr if - info->shared. I don't know why, and that doesn't make sense, - so I took it out. */ - *secp = elf_tdata (abfd)->elf_data_section; - break; - - case SHN_MIPS_SUNDEFINED: - *secp = bfd_und_section_ptr; - break; - } - - if (SGI_COMPAT (abfd) - && ! info->shared - && info->hash->creator == abfd->xvec - && strcmp (*namep, "__rld_obj_head") == 0) - { - struct elf_link_hash_entry *h; - - /* Mark __rld_obj_head as dynamic. */ - h = NULL; - if (! (_bfd_generic_link_add_one_symbol - (info, abfd, *namep, BSF_GLOBAL, *secp, - (bfd_vma) *valp, (const char *) NULL, false, - get_elf_backend_data (abfd)->collect, - (struct bfd_link_hash_entry **) &h))) - return false; - h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - h->type = STT_OBJECT; - - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - - mips_elf_hash_table (info)->use_rld_obj_head = true; - } - - /* If this is a mips16 text symbol, add 1 to the value to make it - odd. This will cause something like .word SYM to come up with - the right value when it is loaded into the PC. */ - if (sym->st_other == STO_MIPS16) - ++*valp; - - return true; -} - -/* Structure used to pass information to mips_elf_output_extsym. */ - -struct extsym_info -{ - bfd *abfd; - struct bfd_link_info *info; - struct ecoff_debug_info *debug; - const struct ecoff_debug_swap *swap; - boolean failed; -}; - -/* This routine is used to write out ECOFF debugging external symbol - information. It is called via mips_elf_link_hash_traverse. The - ECOFF external symbol information must match the ELF external - symbol information. Unfortunately, at this point we don't know - whether a symbol is required by reloc information, so the two - tables may wind up being different. We must sort out the external - symbol information before we can set the final size of the .mdebug - section, and we must set the size of the .mdebug section before we - can relocate any sections, and we can't know which symbols are - required by relocation until we relocate the sections. - Fortunately, it is relatively unlikely that any symbol will be - stripped but required by a reloc. In particular, it can not happen - when generating a final executable. */ - -static boolean -mips_elf_output_extsym (h, data) - struct mips_elf_link_hash_entry *h; - PTR data; -{ - struct extsym_info *einfo = (struct extsym_info *) data; - boolean strip; - asection *sec, *output_section; - - if (h->root.root.type == bfd_link_hash_warning) - h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link; - - if (h->root.indx == -2) - strip = false; - else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - || (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0) - && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 - && (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0) - strip = true; - else if (einfo->info->strip == strip_all - || (einfo->info->strip == strip_some - && bfd_hash_lookup (einfo->info->keep_hash, - h->root.root.root.string, - false, false) == NULL)) - strip = true; - else - strip = false; - - if (strip) - return true; - - if (h->esym.ifd == -2) - { - h->esym.jmptbl = 0; - h->esym.cobol_main = 0; - h->esym.weakext = 0; - h->esym.reserved = 0; - h->esym.ifd = ifdNil; - h->esym.asym.value = 0; - h->esym.asym.st = stGlobal; - - if (h->root.root.type == bfd_link_hash_undefined - || h->root.root.type == bfd_link_hash_undefweak) - { - const char *name; - - /* Use undefined class. Also, set class and type for some - special symbols. */ - name = h->root.root.root.string; - if (strcmp (name, mips_elf_dynsym_rtproc_names[0]) == 0 - || strcmp (name, mips_elf_dynsym_rtproc_names[1]) == 0) - { - h->esym.asym.sc = scData; - h->esym.asym.st = stLabel; - h->esym.asym.value = 0; - } - else if (strcmp (name, mips_elf_dynsym_rtproc_names[2]) == 0) - { - h->esym.asym.sc = scAbs; - h->esym.asym.st = stLabel; - h->esym.asym.value = - mips_elf_hash_table (einfo->info)->procedure_count; - } - else if (strcmp (name, "_gp_disp") == 0) - { - h->esym.asym.sc = scAbs; - h->esym.asym.st = stLabel; - h->esym.asym.value = elf_gp (einfo->abfd); - } - else - h->esym.asym.sc = scUndefined; - } - else if (h->root.root.type != bfd_link_hash_defined - && h->root.root.type != bfd_link_hash_defweak) - h->esym.asym.sc = scAbs; - else - { - const char *name; - - sec = h->root.root.u.def.section; - output_section = sec->output_section; - - /* When making a shared library and symbol h is the one from - the another shared library, OUTPUT_SECTION may be null. */ - if (output_section == NULL) - h->esym.asym.sc = scUndefined; - else - { - name = bfd_section_name (output_section->owner, output_section); - - if (strcmp (name, ".text") == 0) - h->esym.asym.sc = scText; - else if (strcmp (name, ".data") == 0) - h->esym.asym.sc = scData; - else if (strcmp (name, ".sdata") == 0) - h->esym.asym.sc = scSData; - else if (strcmp (name, ".rodata") == 0 - || strcmp (name, ".rdata") == 0) - h->esym.asym.sc = scRData; - else if (strcmp (name, ".bss") == 0) - h->esym.asym.sc = scBss; - else if (strcmp (name, ".sbss") == 0) - h->esym.asym.sc = scSBss; - else if (strcmp (name, ".init") == 0) - h->esym.asym.sc = scInit; - else if (strcmp (name, ".fini") == 0) - h->esym.asym.sc = scFini; - else - h->esym.asym.sc = scAbs; - } - } - - h->esym.asym.reserved = 0; - h->esym.asym.index = indexNil; - } - - if (h->root.root.type == bfd_link_hash_common) - h->esym.asym.value = h->root.root.u.c.size; - else if (h->root.root.type == bfd_link_hash_defined - || h->root.root.type == bfd_link_hash_defweak) - { - if (h->esym.asym.sc == scCommon) - h->esym.asym.sc = scBss; - else if (h->esym.asym.sc == scSCommon) - h->esym.asym.sc = scSBss; - - sec = h->root.root.u.def.section; - output_section = sec->output_section; - if (output_section != NULL) - h->esym.asym.value = (h->root.root.u.def.value - + sec->output_offset - + output_section->vma); - else - h->esym.asym.value = 0; - } - else if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) - { - struct mips_elf_link_hash_entry *hd = h; - boolean no_fn_stub = h->no_fn_stub; - - while (hd->root.root.type == bfd_link_hash_indirect) - { - hd = (struct mips_elf_link_hash_entry *)h->root.root.u.i.link; - no_fn_stub = no_fn_stub || hd->no_fn_stub; - } - - if (!no_fn_stub) - { - /* Set type and value for a symbol with a function stub. */ - h->esym.asym.st = stProc; - sec = hd->root.root.u.def.section; - if (sec == NULL) - h->esym.asym.value = 0; - else - { - output_section = sec->output_section; - if (output_section != NULL) - h->esym.asym.value = (hd->root.plt.offset - + sec->output_offset - + output_section->vma); - else - h->esym.asym.value = 0; - } -#if 0 /* FIXME? */ - h->esym.ifd = 0; -#endif - } - } - - if (! bfd_ecoff_debug_one_external (einfo->abfd, einfo->debug, einfo->swap, - h->root.root.root.string, - &h->esym)) - { - einfo->failed = true; - return false; - } - - return true; -} - -/* Create a runtime procedure table from the .mdebug section. */ - -static boolean -mips_elf_create_procedure_table (handle, abfd, info, s, debug) - PTR handle; - bfd *abfd; - struct bfd_link_info *info; - asection *s; - struct ecoff_debug_info *debug; -{ - const struct ecoff_debug_swap *swap; - HDRR *hdr = &debug->symbolic_header; - RPDR *rpdr, *rp; - struct rpdr_ext *erp; - PTR rtproc; - struct pdr_ext *epdr; - struct sym_ext *esym; - char *ss, **sv; - char *str; - bfd_size_type size; - bfd_size_type count; - unsigned long sindex; - unsigned long i; - PDR pdr; - SYMR sym; - const char *no_name_func = _("static procedure (no name)"); - - epdr = NULL; - rpdr = NULL; - esym = NULL; - ss = NULL; - sv = NULL; - - swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; - - sindex = strlen (no_name_func) + 1; - count = hdr->ipdMax; - if (count > 0) - { - size = swap->external_pdr_size; - - epdr = (struct pdr_ext *) bfd_malloc (size * count); - if (epdr == NULL) - goto error_return; - - if (! _bfd_ecoff_get_accumulated_pdr (handle, (PTR) epdr)) - goto error_return; - - size = sizeof (RPDR); - rp = rpdr = (RPDR *) bfd_malloc (size * count); - if (rpdr == NULL) - goto error_return; - - size = sizeof (char *); - sv = (char **) bfd_malloc (size * count); - if (sv == NULL) - goto error_return; - - count = hdr->isymMax; - size = swap->external_sym_size; - esym = (struct sym_ext *) bfd_malloc (size * count); - if (esym == NULL) - goto error_return; - - if (! _bfd_ecoff_get_accumulated_sym (handle, (PTR) esym)) - goto error_return; - - count = hdr->issMax; - ss = (char *) bfd_malloc (count); - if (ss == NULL) - goto error_return; - if (! _bfd_ecoff_get_accumulated_ss (handle, (PTR) ss)) - goto error_return; - - count = hdr->ipdMax; - for (i = 0; i < (unsigned long) count; i++, rp++) - { - (*swap->swap_pdr_in) (abfd, (PTR) (epdr + i), &pdr); - (*swap->swap_sym_in) (abfd, (PTR) &esym[pdr.isym], &sym); - rp->adr = sym.value; - rp->regmask = pdr.regmask; - rp->regoffset = pdr.regoffset; - rp->fregmask = pdr.fregmask; - rp->fregoffset = pdr.fregoffset; - rp->frameoffset = pdr.frameoffset; - rp->framereg = pdr.framereg; - rp->pcreg = pdr.pcreg; - rp->irpss = sindex; - sv[i] = ss + sym.iss; - sindex += strlen (sv[i]) + 1; - } - } - - size = sizeof (struct rpdr_ext) * (count + 2) + sindex; - size = BFD_ALIGN (size, 16); - rtproc = (PTR) bfd_alloc (abfd, size); - if (rtproc == NULL) - { - mips_elf_hash_table (info)->procedure_count = 0; - goto error_return; - } - - mips_elf_hash_table (info)->procedure_count = count + 2; - - erp = (struct rpdr_ext *) rtproc; - memset (erp, 0, sizeof (struct rpdr_ext)); - erp++; - str = (char *) rtproc + sizeof (struct rpdr_ext) * (count + 2); - strcpy (str, no_name_func); - str += strlen (no_name_func) + 1; - for (i = 0; i < count; i++) - { - ecoff_swap_rpdr_out (abfd, rpdr + i, erp + i); - strcpy (str, sv[i]); - str += strlen (sv[i]) + 1; - } - ECOFF_PUT_OFF (abfd, -1, (erp + count)->p_adr); - - /* Set the size and contents of .rtproc section. */ - s->_raw_size = size; - s->contents = (bfd_byte *) rtproc; - - /* Skip this section later on (I don't think this currently - matters, but someday it might). */ - s->link_order_head = (struct bfd_link_order *) NULL; - - if (epdr != NULL) - free (epdr); - if (rpdr != NULL) - free (rpdr); - if (esym != NULL) - free (esym); - if (ss != NULL) - free (ss); - if (sv != NULL) - free (sv); - - return true; - - error_return: - if (epdr != NULL) - free (epdr); - if (rpdr != NULL) - free (rpdr); - if (esym != NULL) - free (esym); - if (ss != NULL) - free (ss); - if (sv != NULL) - free (sv); - return false; -} - -/* A comparison routine used to sort .gptab entries. */ - -static int -gptab_compare (p1, p2) - const PTR p1; - const PTR p2; -{ - const Elf32_gptab *a1 = (const Elf32_gptab *) p1; - const Elf32_gptab *a2 = (const Elf32_gptab *) p2; - - return a1->gt_entry.gt_g_value - a2->gt_entry.gt_g_value; -} - -/* We need to use a special link routine to handle the .reginfo and - the .mdebug sections. We need to merge all instances of these - sections together, not write them all out sequentially. */ - -boolean -_bfd_mips_elf_final_link (abfd, info) - bfd *abfd; - struct bfd_link_info *info; -{ - asection **secpp; - asection *o; - struct bfd_link_order *p; - asection *reginfo_sec, *mdebug_sec, *gptab_data_sec, *gptab_bss_sec; - asection *rtproc_sec; - Elf32_RegInfo reginfo; - struct ecoff_debug_info debug; - const struct ecoff_debug_swap *swap - = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; - HDRR *symhdr = &debug.symbolic_header; - PTR mdebug_handle = NULL; - asection *s; - EXTR esym; - unsigned int i; - bfd_size_type amt; - - static const char * const secname[] = - { - ".text", ".init", ".fini", ".data", - ".rodata", ".sdata", ".sbss", ".bss" - }; - static const int sc[] = - { - scText, scInit, scFini, scData, - scRData, scSData, scSBss, scBss - }; - - /* If all the things we linked together were PIC, but we're - producing an executable (rather than a shared object), then the - resulting file is CPIC (i.e., it calls PIC code.) */ - if (!info->shared - && !info->relocateable - && elf_elfheader (abfd)->e_flags & EF_MIPS_PIC) - { - elf_elfheader (abfd)->e_flags &= ~EF_MIPS_PIC; - elf_elfheader (abfd)->e_flags |= EF_MIPS_CPIC; - } - - /* We'd carefully arranged the dynamic symbol indices, and then the - generic size_dynamic_sections renumbered them out from under us. - Rather than trying somehow to prevent the renumbering, just do - the sort again. */ - if (elf_hash_table (info)->dynamic_sections_created) - { - bfd *dynobj; - asection *got; - struct mips_got_info *g; - - /* When we resort, we must tell mips_elf_sort_hash_table what - the lowest index it may use is. That's the number of section - symbols we're going to add. The generic ELF linker only - adds these symbols when building a shared object. Note that - we count the sections after (possibly) removing the .options - section above. */ - if (!mips_elf_sort_hash_table (info, (info->shared - ? bfd_count_sections (abfd) + 1 - : 1))) - return false; - - /* Make sure we didn't grow the global .got region. */ - dynobj = elf_hash_table (info)->dynobj; - got = bfd_get_section_by_name (dynobj, ".got"); - g = (struct mips_got_info *) elf_section_data (got)->tdata; - - if (g->global_gotsym != NULL) - BFD_ASSERT ((elf_hash_table (info)->dynsymcount - - g->global_gotsym->dynindx) - <= g->global_gotno); - } - - /* On IRIX5, we omit the .options section. On IRIX6, however, we - include it, even though we don't process it quite right. (Some - entries are supposed to be merged.) Empirically, we seem to be - better off including it then not. */ - if (IRIX_COMPAT (abfd) == ict_irix5 || IRIX_COMPAT (abfd) == ict_none) - for (secpp = &abfd->sections; *secpp != NULL; secpp = &(*secpp)->next) - { - if (strcmp ((*secpp)->name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0) - { - for (p = (*secpp)->link_order_head; p != NULL; p = p->next) - if (p->type == bfd_indirect_link_order) - p->u.indirect.section->flags &= ~SEC_HAS_CONTENTS; - (*secpp)->link_order_head = NULL; - bfd_section_list_remove (abfd, secpp); - --abfd->section_count; - - break; - } - } - - /* Get a value for the GP register. */ - if (elf_gp (abfd) == 0) - { - struct bfd_link_hash_entry *h; - - h = bfd_link_hash_lookup (info->hash, "_gp", false, false, true); - if (h != (struct bfd_link_hash_entry *) NULL - && h->type == bfd_link_hash_defined) - elf_gp (abfd) = (h->u.def.value - + h->u.def.section->output_section->vma - + h->u.def.section->output_offset); - else if (info->relocateable) - { - bfd_vma lo; - - /* Find the GP-relative section with the lowest offset. */ - lo = (bfd_vma) -1; - for (o = abfd->sections; o != (asection *) NULL; o = o->next) - if (o->vma < lo - && (elf_section_data (o)->this_hdr.sh_flags & SHF_MIPS_GPREL)) - lo = o->vma; - - /* And calculate GP relative to that. */ - elf_gp (abfd) = lo + ELF_MIPS_GP_OFFSET (abfd); - } - else - { - /* If the relocate_section function needs to do a reloc - involving the GP value, it should make a reloc_dangerous - callback to warn that GP is not defined. */ - } - } - - /* Go through the sections and collect the .reginfo and .mdebug - information. */ - reginfo_sec = NULL; - mdebug_sec = NULL; - gptab_data_sec = NULL; - gptab_bss_sec = NULL; - for (o = abfd->sections; o != (asection *) NULL; o = o->next) - { - if (strcmp (o->name, ".reginfo") == 0) - { - memset (®info, 0, sizeof reginfo); - - /* We have found the .reginfo section in the output file. - Look through all the link_orders comprising it and merge - the information together. */ - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) - { - asection *input_section; - bfd *input_bfd; - Elf32_External_RegInfo ext; - Elf32_RegInfo sub; - - if (p->type != bfd_indirect_link_order) - { - if (p->type == bfd_fill_link_order) - continue; - abort (); - } - - input_section = p->u.indirect.section; - input_bfd = input_section->owner; - - /* The linker emulation code has probably clobbered the - size to be zero bytes. */ - if (input_section->_raw_size == 0) - input_section->_raw_size = sizeof (Elf32_External_RegInfo); - - if (! bfd_get_section_contents (input_bfd, input_section, - (PTR) &ext, - (file_ptr) 0, - (bfd_size_type) sizeof ext)) - return false; - - bfd_mips_elf32_swap_reginfo_in (input_bfd, &ext, &sub); - - reginfo.ri_gprmask |= sub.ri_gprmask; - reginfo.ri_cprmask[0] |= sub.ri_cprmask[0]; - reginfo.ri_cprmask[1] |= sub.ri_cprmask[1]; - reginfo.ri_cprmask[2] |= sub.ri_cprmask[2]; - reginfo.ri_cprmask[3] |= sub.ri_cprmask[3]; - - /* ri_gp_value is set by the function - mips_elf32_section_processing when the section is - finally written out. */ - - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &= ~SEC_HAS_CONTENTS; - } - - /* Size has been set in mips_elf_always_size_sections */ - BFD_ASSERT(o->_raw_size == sizeof (Elf32_External_RegInfo)); - - /* Skip this section later on (I don't think this currently - matters, but someday it might). */ - o->link_order_head = (struct bfd_link_order *) NULL; - - reginfo_sec = o; - } - - if (strcmp (o->name, ".mdebug") == 0) - { - struct extsym_info einfo; - bfd_vma last; - - /* We have found the .mdebug section in the output file. - Look through all the link_orders comprising it and merge - the information together. */ - symhdr->magic = swap->sym_magic; - /* FIXME: What should the version stamp be? */ - symhdr->vstamp = 0; - symhdr->ilineMax = 0; - symhdr->cbLine = 0; - symhdr->idnMax = 0; - symhdr->ipdMax = 0; - symhdr->isymMax = 0; - symhdr->ioptMax = 0; - symhdr->iauxMax = 0; - symhdr->issMax = 0; - symhdr->issExtMax = 0; - symhdr->ifdMax = 0; - symhdr->crfd = 0; - symhdr->iextMax = 0; - - /* We accumulate the debugging information itself in the - debug_info structure. */ - debug.line = NULL; - debug.external_dnr = NULL; - debug.external_pdr = NULL; - debug.external_sym = NULL; - debug.external_opt = NULL; - debug.external_aux = NULL; - debug.ss = NULL; - debug.ssext = debug.ssext_end = NULL; - debug.external_fdr = NULL; - debug.external_rfd = NULL; - debug.external_ext = debug.external_ext_end = NULL; - - mdebug_handle = bfd_ecoff_debug_init (abfd, &debug, swap, info); - if (mdebug_handle == (PTR) NULL) - return false; - - esym.jmptbl = 0; - esym.cobol_main = 0; - esym.weakext = 0; - esym.reserved = 0; - esym.ifd = ifdNil; - esym.asym.iss = issNil; - esym.asym.st = stLocal; - esym.asym.reserved = 0; - esym.asym.index = indexNil; - last = 0; - for (i = 0; i < sizeof (secname) / sizeof (secname[0]); i++) - { - esym.asym.sc = sc[i]; - s = bfd_get_section_by_name (abfd, secname[i]); - if (s != NULL) - { - esym.asym.value = s->vma; - last = s->vma + s->_raw_size; - } - else - esym.asym.value = last; - if (!bfd_ecoff_debug_one_external (abfd, &debug, swap, - secname[i], &esym)) - return false; - } - - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) - { - asection *input_section; - bfd *input_bfd; - const struct ecoff_debug_swap *input_swap; - struct ecoff_debug_info input_debug; - char *eraw_src; - char *eraw_end; - - if (p->type != bfd_indirect_link_order) - { - if (p->type == bfd_fill_link_order) - continue; - abort (); - } - - input_section = p->u.indirect.section; - input_bfd = input_section->owner; - - if (bfd_get_flavour (input_bfd) != bfd_target_elf_flavour - || (get_elf_backend_data (input_bfd) - ->elf_backend_ecoff_debug_swap) == NULL) - { - /* I don't know what a non MIPS ELF bfd would be - doing with a .mdebug section, but I don't really - want to deal with it. */ - continue; - } - - input_swap = (get_elf_backend_data (input_bfd) - ->elf_backend_ecoff_debug_swap); - - BFD_ASSERT (p->size == input_section->_raw_size); - - /* The ECOFF linking code expects that we have already - read in the debugging information and set up an - ecoff_debug_info structure, so we do that now. */ - if (! _bfd_mips_elf_read_ecoff_info (input_bfd, input_section, - &input_debug)) - return false; - - if (! (bfd_ecoff_debug_accumulate - (mdebug_handle, abfd, &debug, swap, input_bfd, - &input_debug, input_swap, info))) - return false; - - /* Loop through the external symbols. For each one with - interesting information, try to find the symbol in - the linker global hash table and save the information - for the output external symbols. */ - eraw_src = input_debug.external_ext; - eraw_end = (eraw_src - + (input_debug.symbolic_header.iextMax - * input_swap->external_ext_size)); - for (; - eraw_src < eraw_end; - eraw_src += input_swap->external_ext_size) - { - EXTR ext; - const char *name; - struct mips_elf_link_hash_entry *h; - - (*input_swap->swap_ext_in) (input_bfd, (PTR) eraw_src, &ext); - if (ext.asym.sc == scNil - || ext.asym.sc == scUndefined - || ext.asym.sc == scSUndefined) - continue; - - name = input_debug.ssext + ext.asym.iss; - h = mips_elf_link_hash_lookup (mips_elf_hash_table (info), - name, false, false, true); - if (h == NULL || h->esym.ifd != -2) - continue; - - if (ext.ifd != -1) - { - BFD_ASSERT (ext.ifd - < input_debug.symbolic_header.ifdMax); - ext.ifd = input_debug.ifdmap[ext.ifd]; - } - - h->esym = ext; - } - - /* Free up the information we just read. */ - free (input_debug.line); - free (input_debug.external_dnr); - free (input_debug.external_pdr); - free (input_debug.external_sym); - free (input_debug.external_opt); - free (input_debug.external_aux); - free (input_debug.ss); - free (input_debug.ssext); - free (input_debug.external_fdr); - free (input_debug.external_rfd); - free (input_debug.external_ext); - - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &= ~SEC_HAS_CONTENTS; - } - - if (SGI_COMPAT (abfd) && info->shared) - { - /* Create .rtproc section. */ - rtproc_sec = bfd_get_section_by_name (abfd, ".rtproc"); - if (rtproc_sec == NULL) - { - flagword flags = (SEC_HAS_CONTENTS | SEC_IN_MEMORY - | SEC_LINKER_CREATED | SEC_READONLY); - - rtproc_sec = bfd_make_section (abfd, ".rtproc"); - if (rtproc_sec == NULL - || ! bfd_set_section_flags (abfd, rtproc_sec, flags) - || ! bfd_set_section_alignment (abfd, rtproc_sec, 4)) - return false; - } - - if (! mips_elf_create_procedure_table (mdebug_handle, abfd, - info, rtproc_sec, &debug)) - return false; - } - - /* Build the external symbol information. */ - einfo.abfd = abfd; - einfo.info = info; - einfo.debug = &debug; - einfo.swap = swap; - einfo.failed = false; - mips_elf_link_hash_traverse (mips_elf_hash_table (info), - mips_elf_output_extsym, - (PTR) &einfo); - if (einfo.failed) - return false; - - /* Set the size of the .mdebug section. */ - o->_raw_size = bfd_ecoff_debug_size (abfd, &debug, swap); - - /* Skip this section later on (I don't think this currently - matters, but someday it might). */ - o->link_order_head = (struct bfd_link_order *) NULL; - - mdebug_sec = o; - } - - if (strncmp (o->name, ".gptab.", sizeof ".gptab." - 1) == 0) - { - const char *subname; - unsigned int c; - Elf32_gptab *tab; - Elf32_External_gptab *ext_tab; - unsigned int j; - - /* The .gptab.sdata and .gptab.sbss sections hold - information describing how the small data area would - change depending upon the -G switch. These sections - not used in executables files. */ - if (! info->relocateable) - { - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) - { - asection *input_section; - - if (p->type != bfd_indirect_link_order) - { - if (p->type == bfd_fill_link_order) - continue; - abort (); - } - - input_section = p->u.indirect.section; - - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &= ~SEC_HAS_CONTENTS; - } - - /* Skip this section later on (I don't think this - currently matters, but someday it might). */ - o->link_order_head = (struct bfd_link_order *) NULL; - - /* Really remove the section. */ - for (secpp = &abfd->sections; - *secpp != o; - secpp = &(*secpp)->next) - ; - bfd_section_list_remove (abfd, secpp); - --abfd->section_count; - - continue; - } - - /* There is one gptab for initialized data, and one for - uninitialized data. */ - if (strcmp (o->name, ".gptab.sdata") == 0) - gptab_data_sec = o; - else if (strcmp (o->name, ".gptab.sbss") == 0) - gptab_bss_sec = o; - else - { - (*_bfd_error_handler) - (_("%s: illegal section name `%s'"), - bfd_get_filename (abfd), o->name); - bfd_set_error (bfd_error_nonrepresentable_section); - return false; - } - - /* The linker script always combines .gptab.data and - .gptab.sdata into .gptab.sdata, and likewise for - .gptab.bss and .gptab.sbss. It is possible that there is - no .sdata or .sbss section in the output file, in which - case we must change the name of the output section. */ - subname = o->name + sizeof ".gptab" - 1; - if (bfd_get_section_by_name (abfd, subname) == NULL) - { - if (o == gptab_data_sec) - o->name = ".gptab.data"; - else - o->name = ".gptab.bss"; - subname = o->name + sizeof ".gptab" - 1; - BFD_ASSERT (bfd_get_section_by_name (abfd, subname) != NULL); - } - - /* Set up the first entry. */ - c = 1; - amt = c * sizeof (Elf32_gptab); - tab = (Elf32_gptab *) bfd_malloc (amt); - if (tab == NULL) - return false; - tab[0].gt_header.gt_current_g_value = elf_gp_size (abfd); - tab[0].gt_header.gt_unused = 0; - - /* Combine the input sections. */ - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) - { - asection *input_section; - bfd *input_bfd; - bfd_size_type size; - unsigned long last; - bfd_size_type gpentry; - - if (p->type != bfd_indirect_link_order) - { - if (p->type == bfd_fill_link_order) - continue; - abort (); - } - - input_section = p->u.indirect.section; - input_bfd = input_section->owner; - - /* Combine the gptab entries for this input section one - by one. We know that the input gptab entries are - sorted by ascending -G value. */ - size = bfd_section_size (input_bfd, input_section); - last = 0; - for (gpentry = sizeof (Elf32_External_gptab); - gpentry < size; - gpentry += sizeof (Elf32_External_gptab)) - { - Elf32_External_gptab ext_gptab; - Elf32_gptab int_gptab; - unsigned long val; - unsigned long add; - boolean exact; - unsigned int look; - - if (! (bfd_get_section_contents - (input_bfd, input_section, (PTR) &ext_gptab, - (file_ptr) gpentry, - (bfd_size_type) sizeof (Elf32_External_gptab)))) - { - free (tab); - return false; - } - - bfd_mips_elf32_swap_gptab_in (input_bfd, &ext_gptab, - &int_gptab); - val = int_gptab.gt_entry.gt_g_value; - add = int_gptab.gt_entry.gt_bytes - last; - - exact = false; - for (look = 1; look < c; look++) - { - if (tab[look].gt_entry.gt_g_value >= val) - tab[look].gt_entry.gt_bytes += add; - - if (tab[look].gt_entry.gt_g_value == val) - exact = true; - } - - if (! exact) - { - Elf32_gptab *new_tab; - unsigned int max; - - /* We need a new table entry. */ - amt = (bfd_size_type) (c + 1) * sizeof (Elf32_gptab); - new_tab = (Elf32_gptab *) bfd_realloc ((PTR) tab, amt); - if (new_tab == NULL) - { - free (tab); - return false; - } - tab = new_tab; - tab[c].gt_entry.gt_g_value = val; - tab[c].gt_entry.gt_bytes = add; - - /* Merge in the size for the next smallest -G - value, since that will be implied by this new - value. */ - max = 0; - for (look = 1; look < c; look++) - { - if (tab[look].gt_entry.gt_g_value < val - && (max == 0 - || (tab[look].gt_entry.gt_g_value - > tab[max].gt_entry.gt_g_value))) - max = look; - } - if (max != 0) - tab[c].gt_entry.gt_bytes += - tab[max].gt_entry.gt_bytes; - - ++c; - } - - last = int_gptab.gt_entry.gt_bytes; - } - - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &= ~SEC_HAS_CONTENTS; - } - - /* The table must be sorted by -G value. */ - if (c > 2) - qsort (tab + 1, c - 1, sizeof (tab[0]), gptab_compare); - - /* Swap out the table. */ - amt = (bfd_size_type) c * sizeof (Elf32_External_gptab); - ext_tab = (Elf32_External_gptab *) bfd_alloc (abfd, amt); - if (ext_tab == NULL) - { - free (tab); - return false; - } - - for (j = 0; j < c; j++) - bfd_mips_elf32_swap_gptab_out (abfd, tab + j, ext_tab + j); - free (tab); - - o->_raw_size = c * sizeof (Elf32_External_gptab); - o->contents = (bfd_byte *) ext_tab; - - /* Skip this section later on (I don't think this currently - matters, but someday it might). */ - o->link_order_head = (struct bfd_link_order *) NULL; - } - } - - /* Invoke the regular ELF backend linker to do all the work. */ - if (ABI_64_P (abfd)) - { -#ifdef BFD64 - if (!bfd_elf64_bfd_final_link (abfd, info)) - return false; -#else - abort (); - return false; -#endif /* BFD64 */ - } - else if (!bfd_elf32_bfd_final_link (abfd, info)) - return false; - - /* Now write out the computed sections. */ - - if (reginfo_sec != (asection *) NULL) - { - Elf32_External_RegInfo ext; - - bfd_mips_elf32_swap_reginfo_out (abfd, ®info, &ext); - if (! bfd_set_section_contents (abfd, reginfo_sec, (PTR) &ext, - (file_ptr) 0, (bfd_size_type) sizeof ext)) - return false; - } - - if (mdebug_sec != (asection *) NULL) - { - BFD_ASSERT (abfd->output_has_begun); - if (! bfd_ecoff_write_accumulated_debug (mdebug_handle, abfd, &debug, - swap, info, - mdebug_sec->filepos)) - return false; - - bfd_ecoff_debug_free (mdebug_handle, abfd, &debug, swap, info); - } - - if (gptab_data_sec != (asection *) NULL) - { - if (! bfd_set_section_contents (abfd, gptab_data_sec, - gptab_data_sec->contents, - (file_ptr) 0, - gptab_data_sec->_raw_size)) - return false; - } - - if (gptab_bss_sec != (asection *) NULL) - { - if (! bfd_set_section_contents (abfd, gptab_bss_sec, - gptab_bss_sec->contents, - (file_ptr) 0, - gptab_bss_sec->_raw_size)) - return false; - } - - if (SGI_COMPAT (abfd)) - { - rtproc_sec = bfd_get_section_by_name (abfd, ".rtproc"); - if (rtproc_sec != NULL) - { - if (! bfd_set_section_contents (abfd, rtproc_sec, - rtproc_sec->contents, - (file_ptr) 0, - rtproc_sec->_raw_size)) - return false; - } - } - - return true; -} - -/* This function is called via qsort() to sort the dynamic relocation - entries by increasing r_symndx value. */ - -static int -sort_dynamic_relocs (arg1, arg2) - const PTR arg1; - const PTR arg2; -{ - const Elf32_External_Rel *ext_reloc1 = (const Elf32_External_Rel *) arg1; - const Elf32_External_Rel *ext_reloc2 = (const Elf32_External_Rel *) arg2; - - Elf_Internal_Rel int_reloc1; - Elf_Internal_Rel int_reloc2; - - bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, ext_reloc1, &int_reloc1); - bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, ext_reloc2, &int_reloc2); - - return (ELF32_R_SYM (int_reloc1.r_info) - ELF32_R_SYM (int_reloc2.r_info)); -} - -/* Returns the GOT section for ABFD. */ - -static asection * -mips_elf_got_section (abfd) - bfd *abfd; -{ - return bfd_get_section_by_name (abfd, ".got"); -} - -/* Returns the GOT information associated with the link indicated by - INFO. If SGOTP is non-NULL, it is filled in with the GOT - section. */ - -static struct mips_got_info * -mips_elf_got_info (abfd, sgotp) - bfd *abfd; - asection **sgotp; -{ - asection *sgot; - struct mips_got_info *g; - - sgot = mips_elf_got_section (abfd); - BFD_ASSERT (sgot != NULL); - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_got_info *) elf_section_data (sgot)->tdata; - BFD_ASSERT (g != NULL); - - if (sgotp) - *sgotp = sgot; - return g; -} - -/* Return whether a relocation is against a local symbol. */ - -static boolean -mips_elf_local_relocation_p (input_bfd, relocation, local_sections, - check_forced) - bfd *input_bfd; - const Elf_Internal_Rela *relocation; - asection **local_sections; - boolean check_forced; -{ - unsigned long r_symndx; - Elf_Internal_Shdr *symtab_hdr; - struct mips_elf_link_hash_entry *h; - size_t extsymoff; - - r_symndx = ELF32_R_SYM (relocation->r_info); - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info; - - if (r_symndx < extsymoff) - return true; - if (elf_bad_symtab (input_bfd) && local_sections[r_symndx] != NULL) - return true; - - if (check_forced) - { - /* Look up the hash table to check whether the symbol - was forced local. */ - h = (struct mips_elf_link_hash_entry *) - elf_sym_hashes (input_bfd) [r_symndx - extsymoff]; - /* Find the real hash-table entry for this symbol. */ - while (h->root.root.type == bfd_link_hash_indirect - || h->root.root.type == bfd_link_hash_warning) - h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link; - if ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) - return true; - } - - return false; -} - -/* Sign-extend VALUE, which has the indicated number of BITS. */ - -static bfd_vma -mips_elf_sign_extend (value, bits) - bfd_vma value; - int bits; -{ - if (value & ((bfd_vma) 1 << (bits - 1))) - /* VALUE is negative. */ - value |= ((bfd_vma) - 1) << bits; - - return value; -} - -/* Return non-zero if the indicated VALUE has overflowed the maximum - range expressable by a signed number with the indicated number of - BITS. */ - -static boolean -mips_elf_overflow_p (value, bits) - bfd_vma value; - int bits; -{ - bfd_signed_vma svalue = (bfd_signed_vma) value; - - if (svalue > (1 << (bits - 1)) - 1) - /* The value is too big. */ - return true; - else if (svalue < -(1 << (bits - 1))) - /* The value is too small. */ - return true; - - /* All is well. */ - return false; -} - -/* Calculate the %high function. */ - -static bfd_vma -mips_elf_high (value) - bfd_vma value; -{ - return ((value + (bfd_vma) 0x8000) >> 16) & 0xffff; -} - -/* Calculate the %higher function. */ - -static bfd_vma -mips_elf_higher (value) - bfd_vma value ATTRIBUTE_UNUSED; -{ -#ifdef BFD64 - return ((value + (bfd_vma) 0x80008000) >> 32) & 0xffff; -#else - abort (); - return (bfd_vma) -1; -#endif -} - -/* Calculate the %highest function. */ - -static bfd_vma -mips_elf_highest (value) - bfd_vma value ATTRIBUTE_UNUSED; -{ -#ifdef BFD64 - return ((value + (bfd_vma) 0x800080008000) >> 48) & 0xffff; -#else - abort (); - return (bfd_vma) -1; -#endif -} - -/* Returns the GOT index for the global symbol indicated by H. */ - -static bfd_vma -mips_elf_global_got_index (abfd, h) - bfd *abfd; - struct elf_link_hash_entry *h; -{ - bfd_vma index; - asection *sgot; - struct mips_got_info *g; - - g = mips_elf_got_info (abfd, &sgot); - - /* Once we determine the global GOT entry with the lowest dynamic - symbol table index, we must put all dynamic symbols with greater - indices into the GOT. That makes it easy to calculate the GOT - offset. */ - BFD_ASSERT (h->dynindx >= g->global_gotsym->dynindx); - index = ((h->dynindx - g->global_gotsym->dynindx + g->local_gotno) - * MIPS_ELF_GOT_SIZE (abfd)); - BFD_ASSERT (index < sgot->_raw_size); - - return index; -} - -/* Returns the offset for the entry at the INDEXth position - in the GOT. */ - -static bfd_vma -mips_elf_got_offset_from_index (dynobj, output_bfd, index) - bfd *dynobj; - bfd *output_bfd; - bfd_vma index; -{ - asection *sgot; - bfd_vma gp; - - sgot = mips_elf_got_section (dynobj); - gp = _bfd_get_gp_value (output_bfd); - return (sgot->output_section->vma + sgot->output_offset + index - - gp); -} - -/* If H is a symbol that needs a global GOT entry, but has a dynamic - symbol table index lower than any we've seen to date, record it for - posterity. */ - -static boolean -mips_elf_record_global_got_symbol (h, info, g) - struct elf_link_hash_entry *h; - struct bfd_link_info *info; - struct mips_got_info *g ATTRIBUTE_UNUSED; -{ - /* A global symbol in the GOT must also be in the dynamic symbol - table. */ - if (h->dynindx == -1) - { - switch (ELF_ST_VISIBILITY (h->other)) - { - case STV_INTERNAL: - case STV_HIDDEN: - _bfd_mips_elf_hide_symbol (info, h, true); - break; - } - if (!bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - - /* If we've already marked this entry as needing GOT space, we don't - need to do it again. */ - if (h->got.offset != (bfd_vma) -1) - return true; - - /* By setting this to a value other than -1, we are indicating that - there needs to be a GOT entry for H. Avoid using zero, as the - generic ELF copy_indirect_symbol tests for <= 0. */ - h->got.offset = 1; - - return true; -} - -/* This structure is passed to mips_elf_sort_hash_table_f when sorting - the dynamic symbols. */ - -struct mips_elf_hash_sort_data -{ - /* The symbol in the global GOT with the lowest dynamic symbol table - index. */ - struct elf_link_hash_entry *low; - /* The least dynamic symbol table index corresponding to a symbol - with a GOT entry. */ - long min_got_dynindx; - /* The greatest dynamic symbol table index not corresponding to a - symbol without a GOT entry. */ - long max_non_got_dynindx; -}; - -/* If H needs a GOT entry, assign it the highest available dynamic - index. Otherwise, assign it the lowest available dynamic - index. */ - -static boolean -mips_elf_sort_hash_table_f (h, data) - struct mips_elf_link_hash_entry *h; - PTR data; -{ - struct mips_elf_hash_sort_data *hsd - = (struct mips_elf_hash_sort_data *) data; - - if (h->root.root.type == bfd_link_hash_warning) - h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link; - - /* Symbols without dynamic symbol table entries aren't interesting - at all. */ - if (h->root.dynindx == -1) - return true; - - if (h->root.got.offset != 1) - h->root.dynindx = hsd->max_non_got_dynindx++; - else - { - h->root.dynindx = --hsd->min_got_dynindx; - hsd->low = (struct elf_link_hash_entry *) h; - } - - return true; -} - -/* Sort the dynamic symbol table so that symbols that need GOT entries - appear towards the end. This reduces the amount of GOT space - required. MAX_LOCAL is used to set the number of local symbols - known to be in the dynamic symbol table. During - mips_elf_size_dynamic_sections, this value is 1. Afterward, the - section symbols are added and the count is higher. */ - -static boolean -mips_elf_sort_hash_table (info, max_local) - struct bfd_link_info *info; - unsigned long max_local; -{ - struct mips_elf_hash_sort_data hsd; - struct mips_got_info *g; - bfd *dynobj; - - dynobj = elf_hash_table (info)->dynobj; - - hsd.low = NULL; - hsd.min_got_dynindx = elf_hash_table (info)->dynsymcount; - hsd.max_non_got_dynindx = max_local; - mips_elf_link_hash_traverse (((struct mips_elf_link_hash_table *) - elf_hash_table (info)), - mips_elf_sort_hash_table_f, - &hsd); - - /* There should have been enough room in the symbol table to - accomodate both the GOT and non-GOT symbols. */ - BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx); - - /* Now we know which dynamic symbol has the lowest dynamic symbol - table index in the GOT. */ - g = mips_elf_got_info (dynobj, NULL); - g->global_gotsym = hsd.low; - - return true; -} - -/* Create a local GOT entry for VALUE. Return the index of the entry, - or -1 if it could not be created. */ - -static bfd_vma -mips_elf_create_local_got_entry (abfd, g, sgot, value) - bfd *abfd; - struct mips_got_info *g; - asection *sgot; - bfd_vma value; -{ - if (g->assigned_gotno >= g->local_gotno) - { - /* We didn't allocate enough space in the GOT. */ - (*_bfd_error_handler) - (_("not enough GOT space for local GOT entries")); - bfd_set_error (bfd_error_bad_value); - return (bfd_vma) -1; - } - - MIPS_ELF_PUT_WORD (abfd, value, - (sgot->contents - + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno)); - return MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno++; -} - -/* Returns the GOT offset at which the indicated address can be found. - If there is not yet a GOT entry for this value, create one. Returns - -1 if no satisfactory GOT offset can be found. */ - -static bfd_vma -mips_elf_local_got_index (abfd, info, value) - bfd *abfd; - struct bfd_link_info *info; - bfd_vma value; -{ - asection *sgot; - struct mips_got_info *g; - bfd_byte *entry; - - g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); - - /* Look to see if we already have an appropriate entry. */ - for (entry = (sgot->contents - + MIPS_ELF_GOT_SIZE (abfd) * MIPS_RESERVED_GOTNO); - entry != sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno; - entry += MIPS_ELF_GOT_SIZE (abfd)) - { - bfd_vma address = MIPS_ELF_GET_WORD (abfd, entry); - if (address == value) - return entry - sgot->contents; - } - - return mips_elf_create_local_got_entry (abfd, g, sgot, value); -} - -/* Find a GOT entry that is within 32KB of the VALUE. These entries - are supposed to be placed at small offsets in the GOT, i.e., - within 32KB of GP. Return the index into the GOT for this page, - and store the offset from this entry to the desired address in - OFFSETP, if it is non-NULL. */ - -static bfd_vma -mips_elf_got_page (abfd, info, value, offsetp) - bfd *abfd; - struct bfd_link_info *info; - bfd_vma value; - bfd_vma *offsetp; -{ - asection *sgot; - struct mips_got_info *g; - bfd_byte *entry; - bfd_byte *last_entry; - bfd_vma index = 0; - bfd_vma address; - - g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); - - /* Look to see if we aleady have an appropriate entry. */ - last_entry = sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno; - for (entry = (sgot->contents - + MIPS_ELF_GOT_SIZE (abfd) * MIPS_RESERVED_GOTNO); - entry != last_entry; - entry += MIPS_ELF_GOT_SIZE (abfd)) - { - address = MIPS_ELF_GET_WORD (abfd, entry); - - if (!mips_elf_overflow_p (value - address, 16)) - { - /* This entry will serve as the page pointer. We can add a - 16-bit number to it to get the actual address. */ - index = entry - sgot->contents; - break; - } - } - - /* If we didn't have an appropriate entry, we create one now. */ - if (entry == last_entry) - index = mips_elf_create_local_got_entry (abfd, g, sgot, value); - - if (offsetp) - { - address = MIPS_ELF_GET_WORD (abfd, entry); - *offsetp = value - address; - } - - return index; -} - -/* Find a GOT entry whose higher-order 16 bits are the same as those - for value. Return the index into the GOT for this entry. */ - -static bfd_vma -mips_elf_got16_entry (abfd, info, value, external) - bfd *abfd; - struct bfd_link_info *info; - bfd_vma value; - boolean external; -{ - asection *sgot; - struct mips_got_info *g; - bfd_byte *entry; - bfd_byte *last_entry; - bfd_vma index = 0; - bfd_vma address; - - if (! external) - { - /* Although the ABI says that it is "the high-order 16 bits" that we - want, it is really the %high value. The complete value is - calculated with a `addiu' of a LO16 relocation, just as with a - HI16/LO16 pair. */ - value = mips_elf_high (value) << 16; - } - - g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); - - /* Look to see if we already have an appropriate entry. */ - last_entry = sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno; - for (entry = (sgot->contents - + MIPS_ELF_GOT_SIZE (abfd) * MIPS_RESERVED_GOTNO); - entry != last_entry; - entry += MIPS_ELF_GOT_SIZE (abfd)) - { - address = MIPS_ELF_GET_WORD (abfd, entry); - if (address == value) - { - /* This entry has the right high-order 16 bits, and the low-order - 16 bits are set to zero. */ - index = entry - sgot->contents; - break; - } - } - - /* If we didn't have an appropriate entry, we create one now. */ - if (entry == last_entry) - index = mips_elf_create_local_got_entry (abfd, g, sgot, value); - - return index; -} - -/* Returns the first relocation of type r_type found, beginning with - RELOCATION. RELEND is one-past-the-end of the relocation table. */ - -static const Elf_Internal_Rela * -mips_elf_next_relocation (r_type, relocation, relend) - unsigned int r_type; - const Elf_Internal_Rela *relocation; - const Elf_Internal_Rela *relend; -{ - /* According to the MIPS ELF ABI, the R_MIPS_LO16 relocation must be - immediately following. However, for the IRIX6 ABI, the next - relocation may be a composed relocation consisting of several - relocations for the same address. In that case, the R_MIPS_LO16 - relocation may occur as one of these. We permit a similar - extension in general, as that is useful for GCC. */ - while (relocation < relend) - { - if (ELF32_R_TYPE (relocation->r_info) == r_type) - return relocation; - - ++relocation; - } - - /* We didn't find it. */ - bfd_set_error (bfd_error_bad_value); - return NULL; -} - -/* Create a rel.dyn relocation for the dynamic linker to resolve. REL - is the original relocation, which is now being transformed into a - dynamic relocation. The ADDENDP is adjusted if necessary; the - caller should store the result in place of the original addend. */ - -static boolean -mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec, - symbol, addendp, input_section) - bfd *output_bfd; - struct bfd_link_info *info; - const Elf_Internal_Rela *rel; - struct mips_elf_link_hash_entry *h; - asection *sec; - bfd_vma symbol; - bfd_vma *addendp; - asection *input_section; -{ - Elf_Internal_Rel outrel; - boolean skip; - asection *sreloc; - bfd *dynobj; - int r_type; - - r_type = ELF32_R_TYPE (rel->r_info); - dynobj = elf_hash_table (info)->dynobj; - sreloc - = bfd_get_section_by_name (dynobj, - 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; - outrel.r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset); - if (outrel.r_offset == (bfd_vma) -1) - skip = true; - /* FIXME: For -2 runtime relocation needs to be skipped, but - properly resolved statically and installed. */ - BFD_ASSERT (outrel.r_offset != (bfd_vma) -2); - - /* If we've decided to skip this relocation, just output an empty - record. Note that R_MIPS_NONE == 0, so that this call to memset - is a way of setting R_TYPE to R_MIPS_NONE. */ - if (skip) - memset (&outrel, 0, sizeof (outrel)); - else - { - long indx; - bfd_vma section_offset; - - /* We must now calculate the dynamic symbol table index to use - in the relocation. */ - if (h != NULL - && (! info->symbolic || (h->root.elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) - { - indx = h->root.dynindx; - /* h->root.dynindx may be -1 if this symbol was marked to - become local. */ - if (indx == -1) - indx = 0; - } - else - { - if (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 - { - indx = elf_section_data (sec->output_section)->dynindx; - if (indx == 0) - abort (); - } - - /* Figure out how far the target of the relocation is from - the beginning of its section. */ - section_offset = symbol - sec->output_section->vma; - /* The relocation we're building is section-relative. - Therefore, the original addend must be adjusted by the - section offset. */ - *addendp += section_offset; - /* Now, the relocation is just against the section. */ - symbol = sec->output_section->vma; - } - - /* If the relocation was previously an absolute relocation and - this symbol will not be referred to by the relocation, we must - adjust it by the value we give it in the dynamic symbol table. - Otherwise leave the job up to the dynamic linker. */ - if (!indx && r_type != R_MIPS_REL32) - *addendp += symbol; - - /* The relocation is always an REL32 relocation because we don't - know where the shared library will wind up at load-time. */ - outrel.r_info = ELF32_R_INFO (indx, R_MIPS_REL32); - - /* Adjust the output offset of the relocation to reference the - correct location in the output file. */ - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); - } - - /* Put the relocation back out. We have to use the special - relocation outputter in the 64-bit case since the 64-bit - relocation format is non-standard. */ - if (ABI_64_P (output_bfd)) - { - (*get_elf_backend_data (output_bfd)->s->swap_reloc_out) - (output_bfd, &outrel, - (sreloc->contents - + sreloc->reloc_count * sizeof (Elf64_Mips_External_Rel))); - } - else - bfd_elf32_swap_reloc_out (output_bfd, &outrel, - (((Elf32_External_Rel *) - sreloc->contents) - + sreloc->reloc_count)); - - /* Record the index of the first relocation referencing H. This - information is later emitted in the .msym section. */ - if (h != NULL - && (h->min_dyn_reloc_index == 0 - || sreloc->reloc_count < h->min_dyn_reloc_index)) - h->min_dyn_reloc_index = sreloc->reloc_count; - - /* We've now added another relocation. */ - ++sreloc->reloc_count; - - /* Make sure the output section is writable. The dynamic linker - will be writing to it. */ - elf_section_data (input_section->output_section)->this_hdr.sh_flags - |= SHF_WRITE; - - /* On IRIX5, make an entry of compact relocation info. */ - if (! skip && IRIX_COMPAT (output_bfd) == ict_irix5) - { - asection *scpt = bfd_get_section_by_name (dynobj, ".compact_rel"); - bfd_byte *cr; - - if (scpt) - { - Elf32_crinfo cptrel; - - mips_elf_set_cr_format (cptrel, CRF_MIPS_LONG); - cptrel.vaddr = (rel->r_offset - + input_section->output_section->vma - + input_section->output_offset); - if (r_type == R_MIPS_REL32) - mips_elf_set_cr_type (cptrel, CRT_MIPS_REL32); - else - mips_elf_set_cr_type (cptrel, CRT_MIPS_WORD); - mips_elf_set_cr_dist2to (cptrel, 0); - cptrel.konst = *addendp; - - cr = (scpt->contents - + sizeof (Elf32_External_compact_rel)); - bfd_elf32_swap_crinfo_out (output_bfd, &cptrel, - ((Elf32_External_crinfo *) cr - + scpt->reloc_count)); - ++scpt->reloc_count; - } - } - - return true; -} - -/* Calculate the value produced by the RELOCATION (which comes from - the INPUT_BFD). The ADDEND is the addend to use for this - RELOCATION; RELOCATION->R_ADDEND is ignored. - - The result of the relocation calculation is stored in VALUEP. - REQUIRE_JALXP indicates whether or not the opcode used with this - relocation must be JALX. - - This function returns bfd_reloc_continue if the caller need take no - further action regarding this relocation, bfd_reloc_notsupported if - something goes dramatically wrong, bfd_reloc_overflow if an - overflow occurs, and bfd_reloc_ok to indicate success. */ - -static bfd_reloc_status_type -mips_elf_calculate_relocation (abfd, - input_bfd, - input_section, - info, - relocation, - addend, - howto, - local_syms, - local_sections, - valuep, - namep, - require_jalxp) - bfd *abfd; - bfd *input_bfd; - asection *input_section; - struct bfd_link_info *info; - const Elf_Internal_Rela *relocation; - bfd_vma addend; - reloc_howto_type *howto; - Elf_Internal_Sym *local_syms; - asection **local_sections; - bfd_vma *valuep; - const char **namep; - boolean *require_jalxp; -{ - /* The eventual value we will return. */ - bfd_vma value; - /* The address of the symbol against which the relocation is - occurring. */ - bfd_vma symbol = 0; - /* The final GP value to be used for the relocatable, executable, or - shared object file being produced. */ - bfd_vma gp = (bfd_vma) - 1; - /* The place (section offset or address) of the storage unit being - relocated. */ - bfd_vma p; - /* The value of GP used to create the relocatable object. */ - bfd_vma gp0 = (bfd_vma) - 1; - /* The offset into the global offset table at which the address of - the relocation entry symbol, adjusted by the addend, resides - during execution. */ - bfd_vma g = (bfd_vma) - 1; - /* The section in which the symbol referenced by the relocation is - located. */ - asection *sec = NULL; - struct mips_elf_link_hash_entry *h = NULL; - /* True if the symbol referred to by this relocation is a local - symbol. */ - boolean local_p; - /* True if the symbol referred to by this relocation is "_gp_disp". */ - boolean gp_disp_p = false; - Elf_Internal_Shdr *symtab_hdr; - size_t extsymoff; - unsigned long r_symndx; - int r_type; - /* True if overflow occurred during the calculation of the - relocation value. */ - boolean overflowed_p; - /* True if this relocation refers to a MIPS16 function. */ - boolean target_is_16_bit_code_p = false; - - /* Parse the relocation. */ - r_symndx = ELF32_R_SYM (relocation->r_info); - r_type = ELF32_R_TYPE (relocation->r_info); - p = (input_section->output_section->vma - + input_section->output_offset - + relocation->r_offset); - - /* Assume that there will be no overflow. */ - overflowed_p = false; - - /* Figure out whether or not the symbol is local, and get the offset - used in the array of hash table entries. */ - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - local_p = mips_elf_local_relocation_p (input_bfd, relocation, - local_sections, false); - if (! elf_bad_symtab (input_bfd)) - extsymoff = symtab_hdr->sh_info; - else - { - /* The symbol table does not follow the rule that local symbols - must come before globals. */ - extsymoff = 0; - } - - /* Figure out the value of the symbol. */ - if (local_p) - { - Elf_Internal_Sym *sym; - - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - - symbol = sec->output_section->vma + sec->output_offset; - if (ELF_ST_TYPE (sym->st_info) != STT_SECTION) - symbol += sym->st_value; - - /* MIPS16 text labels should be treated as odd. */ - if (sym->st_other == STO_MIPS16) - ++symbol; - - /* Record the name of this symbol, for our caller. */ - *namep = bfd_elf_string_from_elf_section (input_bfd, - symtab_hdr->sh_link, - sym->st_name); - if (*namep == '\0') - *namep = bfd_section_name (input_bfd, sec); - - target_is_16_bit_code_p = (sym->st_other == STO_MIPS16); - } - else - { - /* For global symbols we look up the symbol in the hash-table. */ - h = ((struct mips_elf_link_hash_entry *) - elf_sym_hashes (input_bfd) [r_symndx - extsymoff]); - /* Find the real hash-table entry for this symbol. */ - while (h->root.root.type == bfd_link_hash_indirect - || h->root.root.type == bfd_link_hash_warning) - h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link; - - /* Record the name of this symbol, for our caller. */ - *namep = h->root.root.root.string; - - /* See if this is the special _gp_disp symbol. Note that such a - symbol must always be a global symbol. */ - if (strcmp (h->root.root.root.string, "_gp_disp") == 0) - { - /* Relocations against _gp_disp are permitted only with - R_MIPS_HI16 and R_MIPS_LO16 relocations. */ - if (r_type != R_MIPS_HI16 && r_type != R_MIPS_LO16) - return bfd_reloc_notsupported; - - gp_disp_p = true; - } - /* If this symbol is defined, calculate its address. Note that - _gp_disp is a magic symbol, always implicitly defined by the - linker, so it's inappropriate to check to see whether or not - its defined. */ - else if ((h->root.root.type == bfd_link_hash_defined - || h->root.root.type == bfd_link_hash_defweak) - && h->root.root.u.def.section) - { - sec = h->root.root.u.def.section; - if (sec->output_section) - symbol = (h->root.root.u.def.value - + sec->output_section->vma - + sec->output_offset); - else - symbol = h->root.root.u.def.value; - } - else if (h->root.root.type == bfd_link_hash_undefweak) - /* We allow relocations against undefined weak symbols, giving - it the value zero, so that you can undefined weak functions - and check to see if they exist by looking at their - addresses. */ - symbol = 0; - else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) - && !info->no_undefined - && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) - symbol = 0; - else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0 || - strcmp (h->root.root.root.string, "_DYNAMIC_LINKING") == 0) - { - /* If this is a dynamic link, we should have created a - _DYNAMIC_LINK symbol or _DYNAMIC_LINKING(for normal mips) symbol - in in mips_elf_create_dynamic_sections. - Otherwise, we should define the symbol with a value of 0. - FIXME: It should probably get into the symbol table - somehow as well. */ - BFD_ASSERT (! info->shared); - BFD_ASSERT (bfd_get_section_by_name (abfd, ".dynamic") == NULL); - symbol = 0; - } - else - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.root.string, input_bfd, - input_section, relocation->r_offset, - (!info->shared || info->no_undefined - || ELF_ST_VISIBILITY (h->root.other))))) - return bfd_reloc_undefined; - symbol = 0; - } - - target_is_16_bit_code_p = (h->root.other == STO_MIPS16); - } - - /* If this is a 32-bit call to a 16-bit function with a stub, we - need to redirect the call to the stub, unless we're already *in* - a stub. */ - if (r_type != R_MIPS16_26 && !info->relocateable - && ((h != NULL && h->fn_stub != NULL) - || (local_p && elf_tdata (input_bfd)->local_stubs != NULL - && elf_tdata (input_bfd)->local_stubs[r_symndx] != NULL)) - && !mips_elf_stub_section_p (input_bfd, input_section)) - { - /* This is a 32-bit call to a 16-bit function. We should - have already noticed that we were going to need the - stub. */ - if (local_p) - sec = elf_tdata (input_bfd)->local_stubs[r_symndx]; - else - { - BFD_ASSERT (h->need_fn_stub); - sec = h->fn_stub; - } - - symbol = sec->output_section->vma + sec->output_offset; - } - /* If this is a 16-bit call to a 32-bit function with a stub, we - need to redirect the call to the stub. */ - else if (r_type == R_MIPS16_26 && !info->relocateable - && h != NULL - && (h->call_stub != NULL || h->call_fp_stub != NULL) - && !target_is_16_bit_code_p) - { - /* If both call_stub and call_fp_stub are defined, we can figure - out which one to use by seeing which one appears in the input - file. */ - if (h->call_stub != NULL && h->call_fp_stub != NULL) - { - asection *o; - - sec = NULL; - for (o = input_bfd->sections; o != NULL; o = o->next) - { - if (strncmp (bfd_get_section_name (input_bfd, o), - CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) - { - sec = h->call_fp_stub; - break; - } - } - if (sec == NULL) - sec = h->call_stub; - } - else if (h->call_stub != NULL) - sec = h->call_stub; - else - sec = h->call_fp_stub; - - BFD_ASSERT (sec->_raw_size > 0); - symbol = sec->output_section->vma + sec->output_offset; - } - - /* Calls from 16-bit code to 32-bit code and vice versa require the - special jalx instruction. */ - *require_jalxp = (!info->relocateable - && (((r_type == R_MIPS16_26) && !target_is_16_bit_code_p) - || ((r_type == R_MIPS_26) && target_is_16_bit_code_p))); - - local_p = mips_elf_local_relocation_p (input_bfd, relocation, - local_sections, true); - - /* If we haven't already determined the GOT offset, or the GP value, - and we're going to need it, get it now. */ - switch (r_type) - { - case R_MIPS_CALL16: - case R_MIPS_GOT16: - case R_MIPS_GOT_DISP: - case R_MIPS_GOT_HI16: - case R_MIPS_CALL_HI16: - case R_MIPS_GOT_LO16: - case R_MIPS_CALL_LO16: - /* Find the index into the GOT where this value is located. */ - if (!local_p) - { - BFD_ASSERT (addend == 0); - g = mips_elf_global_got_index - (elf_hash_table (info)->dynobj, - (struct elf_link_hash_entry *) h); - if (! elf_hash_table(info)->dynamic_sections_created - || (info->shared - && (info->symbolic || h->root.dynindx == -1) - && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) - { - /* This is a static link or a -Bsymbolic link. The - symbol is defined locally, or was forced to be local. - We must initialize this entry in the GOT. */ - asection *sgot = mips_elf_got_section(elf_hash_table - (info)->dynobj); - MIPS_ELF_PUT_WORD (elf_hash_table (info)->dynobj, - symbol + addend, sgot->contents + g); - } - } - else if (r_type == R_MIPS_GOT16 || r_type == R_MIPS_CALL16) - /* There's no need to create a local GOT entry here; the - calculation for a local GOT16 entry does not involve G. */ - break; - else - { - g = mips_elf_local_got_index (abfd, info, symbol + addend); - if (g == (bfd_vma) -1) - return bfd_reloc_outofrange; - } - - /* Convert GOT indices to actual offsets. */ - g = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj, - abfd, g); - break; - - case R_MIPS_HI16: - case R_MIPS_LO16: - case R_MIPS16_GPREL: - case R_MIPS_GPREL16: - case R_MIPS_GPREL32: - case R_MIPS_LITERAL: - gp0 = _bfd_get_gp_value (input_bfd); - gp = _bfd_get_gp_value (abfd); - break; - - default: - break; - } - - /* Figure out what kind of relocation is being performed. */ - switch (r_type) - { - case R_MIPS_NONE: - return bfd_reloc_continue; - - case R_MIPS_16: - value = symbol + mips_elf_sign_extend (addend, 16); - overflowed_p = mips_elf_overflow_p (value, 16); - break; - - case R_MIPS_32: - case R_MIPS_REL32: - case R_MIPS_64: - 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.elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0))) - && r_symndx != 0 - && (input_section->flags & SEC_ALLOC) != 0) - { - /* If we're creating a shared library, or this relocation is - against a symbol in a shared library, then we can't know - where the symbol will end up. So, we create a relocation - record in the output, and leave the job up to the dynamic - linker. */ - value = addend; - if (!mips_elf_create_dynamic_relocation (abfd, - info, - relocation, - h, - sec, - symbol, - &value, - input_section)) - return bfd_reloc_undefined; - } - else - { - if (r_type != R_MIPS_REL32) - value = symbol + addend; - else - value = addend; - } - value &= howto->dst_mask; - break; - - case R_MIPS_PC32: - case R_MIPS_PC64: - case R_MIPS_GNU_REL_LO16: - value = symbol + addend - p; - value &= howto->dst_mask; - break; - - case R_MIPS_GNU_REL16_S2: - value = symbol + mips_elf_sign_extend (addend << 2, 18) - p; - overflowed_p = mips_elf_overflow_p (value, 18); - value = (value >> 2) & howto->dst_mask; - break; - - case R_MIPS_GNU_REL_HI16: - /* Instead of subtracting 'p' here, we should be subtracting the - equivalent value for the LO part of the reloc, since the value - here is relative to that address. Because that's not easy to do, - we adjust 'addend' in _bfd_mips_elf_relocate_section(). See also - the comment there for more information. */ - value = mips_elf_high (addend + symbol - p); - value &= howto->dst_mask; - break; - - case R_MIPS16_26: - /* The calculation for R_MIPS16_26 is just the same as for an - R_MIPS_26. It's only the storage of the relocated field into - the output file that's different. That's handled in - mips_elf_perform_relocation. So, we just fall through to the - R_MIPS_26 case here. */ - case R_MIPS_26: - if (local_p) - value = (((addend << 2) | ((p + 4) & 0xf0000000)) + symbol) >> 2; - else - value = (mips_elf_sign_extend (addend << 2, 28) + symbol) >> 2; - value &= howto->dst_mask; - break; - - case R_MIPS_HI16: - if (!gp_disp_p) - { - value = mips_elf_high (addend + symbol); - value &= howto->dst_mask; - } - else - { - value = mips_elf_high (addend + gp - p); - overflowed_p = mips_elf_overflow_p (value, 16); - } - break; - - case R_MIPS_LO16: - if (!gp_disp_p) - value = (symbol + addend) & howto->dst_mask; - else - { - value = addend + gp - p + 4; - /* The MIPS ABI requires checking the R_MIPS_LO16 relocation - for overflow. But, on, say, Irix 5, relocations against - _gp_disp are normally generated from the .cpload - pseudo-op. It generates code that normally looks like - this: - - lui $gp,%hi(_gp_disp) - addiu $gp,$gp,%lo(_gp_disp) - addu $gp,$gp,$t9 - - Here $t9 holds the address of the function being called, - as required by the MIPS ELF ABI. The R_MIPS_LO16 - relocation can easily overflow in this situation, but the - R_MIPS_HI16 relocation will handle the overflow. - Therefore, we consider this a bug in the MIPS ABI, and do - not check for overflow here. */ - } - break; - - case R_MIPS_LITERAL: - /* Because we don't merge literal sections, we can handle this - just like R_MIPS_GPREL16. In the long run, we should merge - shared literals, and then we will need to additional work - here. */ - - /* Fall through. */ - - case R_MIPS16_GPREL: - /* The R_MIPS16_GPREL performs the same calculation as - R_MIPS_GPREL16, but stores the relocated bits in a different - order. We don't need to do anything special here; the - differences are handled in mips_elf_perform_relocation. */ - case R_MIPS_GPREL16: - if (local_p) - value = mips_elf_sign_extend (addend, 16) + symbol + gp0 - gp; - else - value = mips_elf_sign_extend (addend, 16) + symbol - gp; - overflowed_p = mips_elf_overflow_p (value, 16); - break; - - case R_MIPS_GOT16: - case R_MIPS_CALL16: - if (local_p) - { - boolean forced; - - /* The special case is when the symbol is forced to be local. We - need the full address in the GOT since no R_MIPS_LO16 relocation - follows. */ - forced = ! mips_elf_local_relocation_p (input_bfd, relocation, - local_sections, false); - value = mips_elf_got16_entry (abfd, info, symbol + addend, forced); - if (value == (bfd_vma) -1) - return bfd_reloc_outofrange; - value - = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj, - abfd, - value); - overflowed_p = mips_elf_overflow_p (value, 16); - break; - } - - /* Fall through. */ - - case R_MIPS_GOT_DISP: - value = g; - overflowed_p = mips_elf_overflow_p (value, 16); - break; - - case R_MIPS_GPREL32: - value = (addend + symbol + gp0 - gp) & howto->dst_mask; - break; - - case R_MIPS_PC16: - value = mips_elf_sign_extend (addend, 16) + symbol - p; - overflowed_p = mips_elf_overflow_p (value, 16); - value = (bfd_vma) ((bfd_signed_vma) value / 4); - break; - - case R_MIPS_GOT_HI16: - case R_MIPS_CALL_HI16: - /* We're allowed to handle these two relocations identically. - The dynamic linker is allowed to handle the CALL relocations - differently by creating a lazy evaluation stub. */ - value = g; - value = mips_elf_high (value); - value &= howto->dst_mask; - break; - - case R_MIPS_GOT_LO16: - case R_MIPS_CALL_LO16: - value = g & howto->dst_mask; - break; - - case R_MIPS_GOT_PAGE: - value = mips_elf_got_page (abfd, info, symbol + addend, NULL); - if (value == (bfd_vma) -1) - return bfd_reloc_outofrange; - value = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj, - abfd, - value); - overflowed_p = mips_elf_overflow_p (value, 16); - break; - - case R_MIPS_GOT_OFST: - mips_elf_got_page (abfd, info, symbol + addend, &value); - overflowed_p = mips_elf_overflow_p (value, 16); - break; - - case R_MIPS_SUB: - value = symbol - addend; - value &= howto->dst_mask; - break; - - case R_MIPS_HIGHER: - value = mips_elf_higher (addend + symbol); - value &= howto->dst_mask; - break; - - case R_MIPS_HIGHEST: - value = mips_elf_highest (addend + symbol); - value &= howto->dst_mask; - break; - - case R_MIPS_SCN_DISP: - value = symbol + addend - sec->output_offset; - value &= howto->dst_mask; - break; - - case R_MIPS_PJUMP: - case R_MIPS_JALR: - /* Both of these may be ignored. R_MIPS_JALR is an optimization - hint; we could improve performance by honoring that hint. */ - return bfd_reloc_continue; - - case R_MIPS_GNU_VTINHERIT: - case R_MIPS_GNU_VTENTRY: - /* We don't do anything with these at present. */ - return bfd_reloc_continue; - - default: - /* An unrecognized relocation type. */ - return bfd_reloc_notsupported; - } - - /* Store the VALUE for our caller. */ - *valuep = value; - return overflowed_p ? bfd_reloc_overflow : bfd_reloc_ok; -} - -/* Obtain the field relocated by RELOCATION. */ - -static bfd_vma -mips_elf_obtain_contents (howto, relocation, input_bfd, contents) - reloc_howto_type *howto; - const Elf_Internal_Rela *relocation; - bfd *input_bfd; - bfd_byte *contents; -{ - bfd_vma x; - bfd_byte *location = contents + relocation->r_offset; - - /* Obtain the bytes. */ - x = bfd_get (((bfd_vma)(8 * bfd_get_reloc_size (howto))), input_bfd, location); - - if ((ELF32_R_TYPE (relocation->r_info) == R_MIPS16_26 - || ELF32_R_TYPE (relocation->r_info) == R_MIPS16_GPREL) - && bfd_little_endian (input_bfd)) - /* The two 16-bit words will be reversed on a little-endian - system. See mips_elf_perform_relocation for more details. */ - x = (((x & 0xffff) << 16) | ((x & 0xffff0000) >> 16)); - - return x; -} - -/* It has been determined that the result of the RELOCATION is the - VALUE. Use HOWTO to place VALUE into the output file at the - appropriate position. The SECTION is the section to which the - relocation applies. If REQUIRE_JALX is true, then the opcode used - for the relocation must be either JAL or JALX, and it is - unconditionally converted to JALX. - - Returns false if anything goes wrong. */ - -static boolean -mips_elf_perform_relocation (info, howto, relocation, value, - input_bfd, input_section, - contents, require_jalx) - struct bfd_link_info *info; - reloc_howto_type *howto; - const Elf_Internal_Rela *relocation; - bfd_vma value; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - boolean require_jalx; -{ - bfd_vma x; - bfd_byte *location; - int r_type = ELF32_R_TYPE (relocation->r_info); - - /* Figure out where the relocation is occurring. */ - location = contents + relocation->r_offset; - - /* Obtain the current value. */ - x = mips_elf_obtain_contents (howto, relocation, input_bfd, contents); - - /* Clear the field we are setting. */ - x &= ~howto->dst_mask; - - /* If this is the R_MIPS16_26 relocation, we must store the - value in a funny way. */ - if (r_type == R_MIPS16_26) - { - /* R_MIPS16_26 is used for the mips16 jal and jalx instructions. - Most mips16 instructions are 16 bits, but these instructions - are 32 bits. - - The format of these instructions is: - - +--------------+--------------------------------+ - ! JALX ! X! Imm 20:16 ! Imm 25:21 ! - +--------------+--------------------------------+ - ! Immediate 15:0 ! - +-----------------------------------------------+ - - JALX is the 5-bit value 00011. X is 0 for jal, 1 for jalx. - Note that the immediate value in the first word is swapped. - - When producing a relocateable object file, R_MIPS16_26 is - handled mostly like R_MIPS_26. In particular, the addend is - stored as a straight 26-bit value in a 32-bit instruction. - (gas makes life simpler for itself by never adjusting a - R_MIPS16_26 reloc to be against a section, so the addend is - always zero). However, the 32 bit instruction is stored as 2 - 16-bit values, rather than a single 32-bit value. In a - big-endian file, the result is the same; in a little-endian - file, the two 16-bit halves of the 32 bit value are swapped. - This is so that a disassembler can recognize the jal - instruction. - - When doing a final link, R_MIPS16_26 is treated as a 32 bit - instruction stored as two 16-bit values. The addend A is the - contents of the targ26 field. The calculation is the same as - R_MIPS_26. When storing the calculated value, reorder the - immediate value as shown above, and don't forget to store the - value as two 16-bit values. - - To put it in MIPS ABI terms, the relocation field is T-targ26-16, - defined as - - big-endian: - +--------+----------------------+ - | | | - | | targ26-16 | - |31 26|25 0| - +--------+----------------------+ - - little-endian: - +----------+------+-------------+ - | | | | - | sub1 | | sub2 | - |0 9|10 15|16 31| - +----------+--------------------+ - where targ26-16 is sub1 followed by sub2 (i.e., the addend field A is - ((sub1 << 16) | sub2)). - - When producing a relocateable object file, the calculation is - (((A < 2) | ((P + 4) & 0xf0000000) + S) >> 2) - When producing a fully linked file, the calculation is - let R = (((A < 2) | ((P + 4) & 0xf0000000) + S) >> 2) - ((R & 0x1f0000) << 5) | ((R & 0x3e00000) >> 5) | (R & 0xffff) */ - - if (!info->relocateable) - /* Shuffle the bits according to the formula above. */ - value = (((value & 0x1f0000) << 5) - | ((value & 0x3e00000) >> 5) - | (value & 0xffff)); - } - else if (r_type == R_MIPS16_GPREL) - { - /* R_MIPS16_GPREL is used for GP-relative addressing in mips16 - mode. A typical instruction will have a format like this: - - +--------------+--------------------------------+ - ! EXTEND ! Imm 10:5 ! Imm 15:11 ! - +--------------+--------------------------------+ - ! Major ! rx ! ry ! Imm 4:0 ! - +--------------+--------------------------------+ - - EXTEND is the five bit value 11110. Major is the instruction - opcode. - - This is handled exactly like R_MIPS_GPREL16, except that the - addend is retrieved and stored as shown in this diagram; that - is, the Imm fields above replace the V-rel16 field. - - All we need to do here is shuffle the bits appropriately. As - above, the two 16-bit halves must be swapped on a - little-endian system. */ - value = (((value & 0x7e0) << 16) - | ((value & 0xf800) << 5) - | (value & 0x1f)); - } - - /* Set the field. */ - x |= (value & howto->dst_mask); - - /* If required, turn JAL into JALX. */ - if (require_jalx) - { - boolean ok; - bfd_vma opcode = x >> 26; - bfd_vma jalx_opcode; - - /* Check to see if the opcode is already JAL or JALX. */ - if (r_type == R_MIPS16_26) - { - ok = ((opcode == 0x6) || (opcode == 0x7)); - jalx_opcode = 0x7; - } - else - { - ok = ((opcode == 0x3) || (opcode == 0x1d)); - jalx_opcode = 0x1d; - } - - /* If the opcode is not JAL or JALX, there's a problem. */ - if (!ok) - { - (*_bfd_error_handler) - (_("%s: %s+0x%lx: jump to stub routine which is not jal"), - bfd_archive_filename (input_bfd), - input_section->name, - (unsigned long) relocation->r_offset); - bfd_set_error (bfd_error_bad_value); - return false; - } - - /* Make this the JALX opcode. */ - x = (x & ~(0x3f << 26)) | (jalx_opcode << 26); - } - - /* Swap the high- and low-order 16 bits on little-endian systems - when doing a MIPS16 relocation. */ - if ((r_type == R_MIPS16_GPREL || r_type == R_MIPS16_26) - && bfd_little_endian (input_bfd)) - x = (((x & 0xffff) << 16) | ((x & 0xffff0000) >> 16)); - - /* Put the value into the output. */ - bfd_put (8 * bfd_get_reloc_size (howto), input_bfd, x, location); - return true; -} - -/* Returns true if SECTION is a MIPS16 stub section. */ - -static boolean -mips_elf_stub_section_p (abfd, section) - bfd *abfd ATTRIBUTE_UNUSED; - asection *section; -{ - const char *name = bfd_get_section_name (abfd, section); - - return (strncmp (name, FN_STUB, sizeof FN_STUB - 1) == 0 - || strncmp (name, CALL_STUB, sizeof CALL_STUB - 1) == 0 - || strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0); -} - -/* Relocate a MIPS ELF section. */ - -boolean -_bfd_mips_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_Rela *rel; - const Elf_Internal_Rela *relend; - bfd_vma addend = 0; - boolean use_saved_addend_p = false; - struct elf_backend_data *bed; - - bed = get_elf_backend_data (output_bfd); - relend = relocs + input_section->reloc_count * bed->s->int_rels_per_ext_rel; - for (rel = relocs; rel < relend; ++rel) - { - const char *name; - bfd_vma value; - reloc_howto_type *howto; - boolean require_jalx; - /* True if the relocation is a RELA relocation, rather than a - REL relocation. */ - boolean rela_relocation_p = true; - unsigned int r_type = ELF32_R_TYPE (rel->r_info); - const char * msg = (const char *) NULL; - - /* Find the relocation howto for this relocation. */ - if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd)) - { - /* Some 32-bit code uses R_MIPS_64. In particular, people use - 64-bit code, but make sure all their addresses are in the - lowermost or uppermost 32-bit section of the 64-bit address - space. Thus, when they use an R_MIPS_64 they mean what is - usually meant by R_MIPS_32, with the exception that the - stored value is sign-extended to 64 bits. */ - howto = elf_mips_howto_table_rel + R_MIPS_32; - - /* On big-endian systems, we need to lie about the position - of the reloc. */ - if (bfd_big_endian (input_bfd)) - rel->r_offset += 4; - } - else - howto = mips_rtype_to_howto (r_type); - - if (!use_saved_addend_p) - { - Elf_Internal_Shdr *rel_hdr; - - /* If these relocations were originally of the REL variety, - we must pull the addend out of the field that will be - relocated. Otherwise, we simply use the contents of the - RELA relocation. To determine which flavor or relocation - this is, we depend on the fact that the INPUT_SECTION's - REL_HDR is read before its REL_HDR2. */ - rel_hdr = &elf_section_data (input_section)->rel_hdr; - if ((size_t) (rel - relocs) - >= (NUM_SHDR_ENTRIES (rel_hdr) * bed->s->int_rels_per_ext_rel)) - rel_hdr = elf_section_data (input_section)->rel_hdr2; - if (rel_hdr->sh_entsize == MIPS_ELF_REL_SIZE (input_bfd)) - { - /* Note that this is a REL relocation. */ - rela_relocation_p = false; - - /* Get the addend, which is stored in the input file. */ - addend = mips_elf_obtain_contents (howto, - rel, - input_bfd, - contents); - addend &= howto->src_mask; - - /* For some kinds of relocations, the ADDEND is a - combination of the addend stored in two different - relocations. */ - if (r_type == R_MIPS_HI16 - || r_type == R_MIPS_GNU_REL_HI16 - || (r_type == R_MIPS_GOT16 - && mips_elf_local_relocation_p (input_bfd, rel, - local_sections, false))) - { - bfd_vma l; - const Elf_Internal_Rela *lo16_relocation; - reloc_howto_type *lo16_howto; - unsigned int lo; - - /* The combined value is the sum of the HI16 addend, - left-shifted by sixteen bits, and the LO16 - addend, sign extended. (Usually, the code does - a `lui' of the HI16 value, and then an `addiu' of - the LO16 value.) - - Scan ahead to find a matching LO16 relocation. */ - if (r_type == R_MIPS_GNU_REL_HI16) - lo = R_MIPS_GNU_REL_LO16; - else - lo = R_MIPS_LO16; - lo16_relocation - = mips_elf_next_relocation (lo, rel, relend); - if (lo16_relocation == NULL) - return false; - - /* Obtain the addend kept there. */ - lo16_howto = mips_rtype_to_howto (lo); - l = mips_elf_obtain_contents (lo16_howto, - lo16_relocation, - input_bfd, contents); - l &= lo16_howto->src_mask; - l = mips_elf_sign_extend (l, 16); - - addend <<= 16; - - /* Compute the combined addend. */ - addend += l; - - /* If PC-relative, subtract the difference between the - address of the LO part of the reloc and the address of - the HI part. The relocation is relative to the LO - part, but mips_elf_calculate_relocation() doesn't know - it address or the difference from the HI part, so - we subtract that difference here. See also the - comment in mips_elf_calculate_relocation(). */ - if (r_type == R_MIPS_GNU_REL_HI16) - addend -= (lo16_relocation->r_offset - rel->r_offset); - } - else if (r_type == R_MIPS16_GPREL) - { - /* The addend is scrambled in the object file. See - mips_elf_perform_relocation for details on the - format. */ - addend = (((addend & 0x1f0000) >> 5) - | ((addend & 0x7e00000) >> 16) - | (addend & 0x1f)); - } - } - else - addend = rel->r_addend; - } - - if (info->relocateable) - { - Elf_Internal_Sym *sym; - unsigned long r_symndx; - - if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd) - && bfd_big_endian (input_bfd)) - rel->r_offset -= 4; - - /* Since we're just relocating, all we need to do is copy - the relocations back out to the object file, unless - they're against a section symbol, in which case we need - to adjust by the section offset, or unless they're GP - relative in which case we need to adjust by the amount - that we're adjusting GP in this relocateable object. */ - - if (!mips_elf_local_relocation_p (input_bfd, rel, local_sections, - false)) - /* There's nothing to do for non-local relocations. */ - continue; - - if (r_type == R_MIPS16_GPREL - || r_type == R_MIPS_GPREL16 - || r_type == R_MIPS_GPREL32 - || r_type == R_MIPS_LITERAL) - addend -= (_bfd_get_gp_value (output_bfd) - - _bfd_get_gp_value (input_bfd)); - else if (r_type == R_MIPS_26 || r_type == R_MIPS16_26 - || r_type == R_MIPS_GNU_REL16_S2) - /* The addend is stored without its two least - significant bits (which are always zero.) In a - non-relocateable link, calculate_relocation will do - this shift; here, we must do it ourselves. */ - addend <<= 2; - - r_symndx = ELF32_R_SYM (rel->r_info); - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - /* Adjust the addend appropriately. */ - addend += local_sections[r_symndx]->output_offset; - - /* If the relocation is for a R_MIPS_HI16 or R_MIPS_GOT16, - then we only want to write out the high-order 16 bits. - The subsequent R_MIPS_LO16 will handle the low-order bits. */ - if (r_type == R_MIPS_HI16 || r_type == R_MIPS_GOT16 - || r_type == R_MIPS_GNU_REL_HI16) - addend = mips_elf_high (addend); - /* If the relocation is for an R_MIPS_26 relocation, then - the two low-order bits are not stored in the object file; - they are implicitly zero. */ - else if (r_type == R_MIPS_26 || r_type == R_MIPS16_26 - || r_type == R_MIPS_GNU_REL16_S2) - addend >>= 2; - - if (rela_relocation_p) - /* If this is a RELA relocation, just update the addend. - We have to cast away constness for REL. */ - rel->r_addend = addend; - else - { - /* Otherwise, we have to write the value back out. Note - that we use the source mask, rather than the - destination mask because the place to which we are - writing will be source of the addend in the final - link. */ - addend &= howto->src_mask; - - if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd)) - /* See the comment above about using R_MIPS_64 in the 32-bit - ABI. Here, we need to update the addend. It would be - possible to get away with just using the R_MIPS_32 reloc - but for endianness. */ - { - bfd_vma sign_bits; - bfd_vma low_bits; - bfd_vma high_bits; - - if (addend & ((bfd_vma) 1 << 31)) -#ifdef BFD64 - sign_bits = ((bfd_vma) 1 << 32) - 1; -#else - sign_bits = -1; -#endif - else - sign_bits = 0; - - /* If we don't know that we have a 64-bit type, - do two separate stores. */ - if (bfd_big_endian (input_bfd)) - { - /* Store the sign-bits (which are most significant) - first. */ - low_bits = sign_bits; - high_bits = addend; - } - else - { - low_bits = addend; - high_bits = sign_bits; - } - bfd_put_32 (input_bfd, low_bits, - contents + rel->r_offset); - bfd_put_32 (input_bfd, high_bits, - contents + rel->r_offset + 4); - continue; - } - - if (!mips_elf_perform_relocation (info, howto, rel, addend, - input_bfd, input_section, - contents, false)) - return false; - } - - /* Go on to the next relocation. */ - continue; - } - - /* In the N32 and 64-bit ABIs there may be multiple consecutive - relocations for the same offset. In that case we are - supposed to treat the output of each relocation as the addend - for the next. */ - if (rel + 1 < relend - && rel->r_offset == rel[1].r_offset - && ELF32_R_TYPE (rel[1].r_info) != R_MIPS_NONE) - use_saved_addend_p = true; - else - use_saved_addend_p = false; - - /* Figure out what value we are supposed to relocate. */ - switch (mips_elf_calculate_relocation (output_bfd, - input_bfd, - input_section, - info, - rel, - addend, - howto, - local_syms, - local_sections, - &value, - &name, - &require_jalx)) - { - case bfd_reloc_continue: - /* There's nothing to do. */ - continue; - - case bfd_reloc_undefined: - /* mips_elf_calculate_relocation already called the - undefined_symbol callback. There's no real point in - trying to perform the relocation at this point, so we - just skip ahead to the next relocation. */ - continue; - - case bfd_reloc_notsupported: - msg = _("internal error: unsupported relocation error"); - info->callbacks->warning - (info, msg, name, input_bfd, input_section, rel->r_offset); - return false; - - case bfd_reloc_overflow: - if (use_saved_addend_p) - /* Ignore overflow until we reach the last relocation for - a given location. */ - ; - else - { - BFD_ASSERT (name != NULL); - if (! ((*info->callbacks->reloc_overflow) - (info, name, howto->name, (bfd_vma) 0, - input_bfd, input_section, rel->r_offset))) - return false; - } - break; - - case bfd_reloc_ok: - break; - - default: - abort (); - break; - } - - /* If we've got another relocation for the address, keep going - until we reach the last one. */ - if (use_saved_addend_p) - { - addend = value; - continue; - } - - if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd)) - /* See the comment above about using R_MIPS_64 in the 32-bit - ABI. Until now, we've been using the HOWTO for R_MIPS_32; - that calculated the right value. Now, however, we - sign-extend the 32-bit result to 64-bits, and store it as a - 64-bit value. We are especially generous here in that we - go to extreme lengths to support this usage on systems with - only a 32-bit VMA. */ - { - bfd_vma sign_bits; - bfd_vma low_bits; - bfd_vma high_bits; - - if (value & ((bfd_vma) 1 << 31)) -#ifdef BFD64 - sign_bits = ((bfd_vma) 1 << 32) - 1; -#else - sign_bits = -1; -#endif - else - sign_bits = 0; - - /* If we don't know that we have a 64-bit type, - do two separate stores. */ - if (bfd_big_endian (input_bfd)) - { - /* Undo what we did above. */ - rel->r_offset -= 4; - /* Store the sign-bits (which are most significant) - first. */ - low_bits = sign_bits; - high_bits = value; - } - else - { - low_bits = value; - high_bits = sign_bits; - } - bfd_put_32 (input_bfd, low_bits, - contents + rel->r_offset); - bfd_put_32 (input_bfd, high_bits, - contents + rel->r_offset + 4); - continue; - } - - /* Actually perform the relocation. */ - if (!mips_elf_perform_relocation (info, howto, rel, value, input_bfd, - input_section, contents, - require_jalx)) - return false; - } - - return true; -} - -/* This hook function is called before the linker writes out a global - symbol. We mark symbols as small common if appropriate. This is - also where we undo the increment of the value for a mips16 symbol. */ - -boolean -_bfd_mips_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - const char *name ATTRIBUTE_UNUSED; - Elf_Internal_Sym *sym; - asection *input_sec; -{ - /* If we see a common symbol, which implies a relocatable link, then - if a symbol was small common in an input file, mark it as small - common in the output file. */ - if (sym->st_shndx == SHN_COMMON - && strcmp (input_sec->name, ".scommon") == 0) - sym->st_shndx = SHN_MIPS_SCOMMON; - - if (sym->st_other == STO_MIPS16 - && (sym->st_value & 1) != 0) - --sym->st_value; - - return true; -} - -/* Functions for the dynamic linker. */ - -/* The name of the dynamic interpreter. This is put in the .interp - section. */ - -#define ELF_DYNAMIC_INTERPRETER(abfd) \ - (ABI_N32_P (abfd) ? "/usr/lib32/libc.so.1" \ - : ABI_64_P (abfd) ? "/usr/lib64/libc.so.1" \ - : "/usr/lib/libc.so.1") - -/* Create dynamic sections when linking against a dynamic object. */ - -boolean -_bfd_mips_elf_create_dynamic_sections (abfd, info) - bfd *abfd; - struct bfd_link_info *info; -{ - struct elf_link_hash_entry *h; - flagword flags; - register asection *s; - const char * const *namep; - - flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY - | SEC_LINKER_CREATED | SEC_READONLY); - - /* Mips ABI requests the .dynamic section to be read only. */ - s = bfd_get_section_by_name (abfd, ".dynamic"); - if (s != NULL) - { - if (! bfd_set_section_flags (abfd, s, flags)) - return false; - } - - /* We need to create .got section. */ - if (! mips_elf_create_got_section (abfd, info)) - return false; - - /* Create the .msym section on IRIX6. It is used by the dynamic - linker to speed up dynamic relocations, and to avoid computing - the ELF hash for symbols. */ - if (IRIX_COMPAT (abfd) == ict_irix6 - && !mips_elf_create_msym_section (abfd)) - return false; - - /* Create .stub section. */ - if (bfd_get_section_by_name (abfd, - MIPS_ELF_STUB_SECTION_NAME (abfd)) == NULL) - { - s = bfd_make_section (abfd, MIPS_ELF_STUB_SECTION_NAME (abfd)); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_CODE) - || ! bfd_set_section_alignment (abfd, s, - MIPS_ELF_LOG_FILE_ALIGN (abfd))) - return false; - } - - if ((IRIX_COMPAT (abfd) == ict_irix5 || IRIX_COMPAT (abfd) == ict_none) - && !info->shared - && bfd_get_section_by_name (abfd, ".rld_map") == NULL) - { - s = bfd_make_section (abfd, ".rld_map"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags &~ (flagword) SEC_READONLY) - || ! bfd_set_section_alignment (abfd, s, - MIPS_ELF_LOG_FILE_ALIGN (abfd))) - return false; - } - - /* On IRIX5, we adjust add some additional symbols and change the - alignments of several sections. There is no ABI documentation - indicating that this is necessary on IRIX6, nor any evidence that - the linker takes such action. */ - if (IRIX_COMPAT (abfd) == ict_irix5) - { - for (namep = mips_elf_dynsym_rtproc_names; *namep != NULL; namep++) - { - h = NULL; - if (! (_bfd_generic_link_add_one_symbol - (info, abfd, *namep, BSF_GLOBAL, bfd_und_section_ptr, - (bfd_vma) 0, (const char *) NULL, false, - get_elf_backend_data (abfd)->collect, - (struct bfd_link_hash_entry **) &h))) - return false; - h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - h->type = STT_SECTION; - - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - - /* We need to create a .compact_rel section. */ - if (SGI_COMPAT (abfd)) - { - if (!mips_elf_create_compact_rel_section (abfd, info)) - return false; - } - - /* Change aligments of some sections. */ - s = bfd_get_section_by_name (abfd, ".hash"); - if (s != NULL) - bfd_set_section_alignment (abfd, s, 4); - s = bfd_get_section_by_name (abfd, ".dynsym"); - if (s != NULL) - bfd_set_section_alignment (abfd, s, 4); - s = bfd_get_section_by_name (abfd, ".dynstr"); - if (s != NULL) - bfd_set_section_alignment (abfd, s, 4); - s = bfd_get_section_by_name (abfd, ".reginfo"); - if (s != NULL) - bfd_set_section_alignment (abfd, s, 4); - s = bfd_get_section_by_name (abfd, ".dynamic"); - if (s != NULL) - bfd_set_section_alignment (abfd, s, 4); - } - - if (!info->shared) - { - h = NULL; - if (SGI_COMPAT (abfd)) - { - if (!(_bfd_generic_link_add_one_symbol - (info, abfd, "_DYNAMIC_LINK", BSF_GLOBAL, bfd_abs_section_ptr, - (bfd_vma) 0, (const char *) NULL, false, - get_elf_backend_data (abfd)->collect, - (struct bfd_link_hash_entry **) &h))) - return false; - } - else - { - /* For normal mips it is _DYNAMIC_LINKING. */ - if (!(_bfd_generic_link_add_one_symbol - (info, abfd, "_DYNAMIC_LINKING", BSF_GLOBAL, - bfd_abs_section_ptr, (bfd_vma) 0, (const char *) NULL, false, - get_elf_backend_data (abfd)->collect, - (struct bfd_link_hash_entry **) &h))) - return false; - } - h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - h->type = STT_SECTION; - - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - - if (! mips_elf_hash_table (info)->use_rld_obj_head) - { - /* __rld_map is a four byte word located in the .data section - and is filled in by the rtld to contain a pointer to - the _r_debug structure. Its symbol value will be set in - mips_elf_finish_dynamic_symbol. */ - s = bfd_get_section_by_name (abfd, ".rld_map"); - BFD_ASSERT (s != NULL); - - h = NULL; - if (SGI_COMPAT (abfd)) - { - if (!(_bfd_generic_link_add_one_symbol - (info, abfd, "__rld_map", BSF_GLOBAL, s, - (bfd_vma) 0, (const char *) NULL, false, - get_elf_backend_data (abfd)->collect, - (struct bfd_link_hash_entry **) &h))) - return false; - } - else - { - /* For normal mips the symbol is __RLD_MAP. */ - if (!(_bfd_generic_link_add_one_symbol - (info, abfd, "__RLD_MAP", BSF_GLOBAL, s, - (bfd_vma) 0, (const char *) NULL, false, - get_elf_backend_data (abfd)->collect, - (struct bfd_link_hash_entry **) &h))) - return false; - } - h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - h->type = STT_OBJECT; - - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - } - - return true; -} - -/* Create the .compact_rel section. */ - -static boolean -mips_elf_create_compact_rel_section (abfd, info) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; -{ - flagword flags; - register asection *s; - - if (bfd_get_section_by_name (abfd, ".compact_rel") == NULL) - { - flags = (SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED - | SEC_READONLY); - - s = bfd_make_section (abfd, ".compact_rel"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) - || ! bfd_set_section_alignment (abfd, s, - MIPS_ELF_LOG_FILE_ALIGN (abfd))) - return false; - - s->_raw_size = sizeof (Elf32_External_compact_rel); - } - - return true; -} - -/* Create the .got section to hold the global offset table. */ - -static boolean -mips_elf_create_got_section (abfd, info) - bfd *abfd; - struct bfd_link_info *info; -{ - flagword flags; - register asection *s; - struct elf_link_hash_entry *h; - struct mips_got_info *g; - bfd_size_type amt; - - /* This function may be called more than once. */ - if (mips_elf_got_section (abfd)) - return true; - - flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY - | SEC_LINKER_CREATED); - - s = bfd_make_section (abfd, ".got"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) - || ! bfd_set_section_alignment (abfd, s, 4)) - return false; - - /* Define the symbol _GLOBAL_OFFSET_TABLE_. We don't do this in the - linker script because we don't want to define the symbol if we - are not creating a global offset table. */ - h = NULL; - if (! (_bfd_generic_link_add_one_symbol - (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s, - (bfd_vma) 0, (const char *) NULL, false, - get_elf_backend_data (abfd)->collect, - (struct bfd_link_hash_entry **) &h))) - return false; - h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - h->type = STT_OBJECT; - - if (info->shared - && ! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - - /* The first several global offset table entries are reserved. */ - s->_raw_size = MIPS_RESERVED_GOTNO * MIPS_ELF_GOT_SIZE (abfd); - - amt = sizeof (struct mips_got_info); - g = (struct mips_got_info *) bfd_alloc (abfd, amt); - if (g == NULL) - return false; - g->global_gotsym = NULL; - g->local_gotno = MIPS_RESERVED_GOTNO; - g->assigned_gotno = MIPS_RESERVED_GOTNO; - if (elf_section_data (s) == NULL) - { - amt = sizeof (struct bfd_elf_section_data); - s->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); - if (elf_section_data (s) == NULL) - return false; - } - elf_section_data (s)->tdata = (PTR) g; - elf_section_data (s)->this_hdr.sh_flags - |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL; - - return true; -} - -/* Returns the .msym section for ABFD, creating it if it does not - already exist. Returns NULL to indicate error. */ - -static asection * -mips_elf_create_msym_section (abfd) - bfd *abfd; -{ - asection *s; - - s = bfd_get_section_by_name (abfd, MIPS_ELF_MSYM_SECTION_NAME (abfd)); - if (!s) - { - s = bfd_make_section (abfd, MIPS_ELF_MSYM_SECTION_NAME (abfd)); - if (!s - || !bfd_set_section_flags (abfd, s, - SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_LINKER_CREATED - | SEC_READONLY) - || !bfd_set_section_alignment (abfd, s, - MIPS_ELF_LOG_FILE_ALIGN (abfd))) - return NULL; - } - - return s; -} - -/* Add room for N relocations to the .rel.dyn section in ABFD. */ - -static void -mips_elf_allocate_dynamic_relocations (abfd, n) - bfd *abfd; - unsigned int n; -{ - asection *s; - - s = bfd_get_section_by_name (abfd, MIPS_ELF_REL_DYN_SECTION_NAME (abfd)); - BFD_ASSERT (s != NULL); - - if (s->_raw_size == 0) - { - /* Make room for a null element. */ - s->_raw_size += MIPS_ELF_REL_SIZE (abfd); - ++s->reloc_count; - } - s->_raw_size += n * MIPS_ELF_REL_SIZE (abfd); -} - -/* Look through the relocs for a section during the first phase, and - allocate space in the global offset table. */ - -boolean -_bfd_mips_elf_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; -{ - const char *name; - bfd *dynobj; - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - struct mips_got_info *g; - size_t extsymoff; - const Elf_Internal_Rela *rel; - const Elf_Internal_Rela *rel_end; - asection *sgot; - asection *sreloc; - struct elf_backend_data *bed; - - if (info->relocateable) - return true; - - dynobj = elf_hash_table (info)->dynobj; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (abfd); - extsymoff = (elf_bad_symtab (abfd)) ? 0 : symtab_hdr->sh_info; - - /* Check for the mips16 stub sections. */ - - name = bfd_get_section_name (abfd, sec); - if (strncmp (name, FN_STUB, sizeof FN_STUB - 1) == 0) - { - unsigned long r_symndx; - - /* Look at the relocation information to figure out which symbol - this is for. */ - - r_symndx = ELF32_R_SYM (relocs->r_info); - - if (r_symndx < extsymoff - || sym_hashes[r_symndx - extsymoff] == NULL) - { - asection *o; - - /* This stub is for a local symbol. This stub will only be - needed if there is some relocation in this BFD, other - than a 16 bit function call, which refers to this symbol. */ - for (o = abfd->sections; o != NULL; o = o->next) - { - Elf_Internal_Rela *sec_relocs; - const Elf_Internal_Rela *r, *rend; - - /* We can ignore stub sections when looking for relocs. */ - if ((o->flags & SEC_RELOC) == 0 - || o->reloc_count == 0 - || strncmp (bfd_get_section_name (abfd, o), FN_STUB, - sizeof FN_STUB - 1) == 0 - || strncmp (bfd_get_section_name (abfd, o), CALL_STUB, - sizeof CALL_STUB - 1) == 0 - || strncmp (bfd_get_section_name (abfd, o), CALL_FP_STUB, - sizeof CALL_FP_STUB - 1) == 0) - continue; - - sec_relocs = (_bfd_elf32_link_read_relocs - (abfd, o, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory)); - if (sec_relocs == NULL) - return false; - - rend = sec_relocs + o->reloc_count; - for (r = sec_relocs; r < rend; r++) - if (ELF32_R_SYM (r->r_info) == r_symndx - && ELF32_R_TYPE (r->r_info) != R_MIPS16_26) - break; - - if (! info->keep_memory) - free (sec_relocs); - - if (r < rend) - break; - } - - if (o == NULL) - { - /* There is no non-call reloc for this stub, so we do - not need it. Since this function is called before - the linker maps input sections to output sections, we - can easily discard it by setting the SEC_EXCLUDE - flag. */ - sec->flags |= SEC_EXCLUDE; - return true; - } - - /* Record this stub in an array of local symbol stubs for - this BFD. */ - if (elf_tdata (abfd)->local_stubs == NULL) - { - unsigned long symcount; - asection **n; - bfd_size_type amt; - - if (elf_bad_symtab (abfd)) - symcount = NUM_SHDR_ENTRIES (symtab_hdr); - else - symcount = symtab_hdr->sh_info; - amt = symcount * sizeof (asection *); - n = (asection **) bfd_zalloc (abfd, amt); - if (n == NULL) - return false; - elf_tdata (abfd)->local_stubs = n; - } - - elf_tdata (abfd)->local_stubs[r_symndx] = sec; - - /* We don't need to set mips16_stubs_seen in this case. - That flag is used to see whether we need to look through - the global symbol table for stubs. We don't need to set - it here, because we just have a local stub. */ - } - else - { - struct mips_elf_link_hash_entry *h; - - h = ((struct mips_elf_link_hash_entry *) - sym_hashes[r_symndx - extsymoff]); - - /* H is the symbol this stub is for. */ - - h->fn_stub = sec; - mips_elf_hash_table (info)->mips16_stubs_seen = true; - } - } - else if (strncmp (name, CALL_STUB, sizeof CALL_STUB - 1) == 0 - || strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) - { - unsigned long r_symndx; - struct mips_elf_link_hash_entry *h; - asection **loc; - - /* Look at the relocation information to figure out which symbol - this is for. */ - - r_symndx = ELF32_R_SYM (relocs->r_info); - - if (r_symndx < extsymoff - || sym_hashes[r_symndx - extsymoff] == NULL) - { - /* This stub was actually built for a static symbol defined - in the same file. We assume that all static symbols in - mips16 code are themselves mips16, so we can simply - discard this stub. Since this function is called before - the linker maps input sections to output sections, we can - easily discard it by setting the SEC_EXCLUDE flag. */ - sec->flags |= SEC_EXCLUDE; - return true; - } - - h = ((struct mips_elf_link_hash_entry *) - sym_hashes[r_symndx - extsymoff]); - - /* H is the symbol this stub is for. */ - - if (strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) - loc = &h->call_fp_stub; - else - loc = &h->call_stub; - - /* If we already have an appropriate stub for this function, we - don't need another one, so we can discard this one. Since - this function is called before the linker maps input sections - to output sections, we can easily discard it by setting the - SEC_EXCLUDE flag. We can also discard this section if we - happen to already know that this is a mips16 function; it is - not necessary to check this here, as it is checked later, but - it is slightly faster to check now. */ - if (*loc != NULL || h->root.other == STO_MIPS16) - { - sec->flags |= SEC_EXCLUDE; - return true; - } - - *loc = sec; - mips_elf_hash_table (info)->mips16_stubs_seen = true; - } - - if (dynobj == NULL) - { - sgot = NULL; - g = NULL; - } - else - { - sgot = mips_elf_got_section (dynobj); - if (sgot == NULL) - g = NULL; - else - { - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_got_info *) elf_section_data (sgot)->tdata; - BFD_ASSERT (g != NULL); - } - } - - sreloc = NULL; - bed = get_elf_backend_data (abfd); - rel_end = relocs + sec->reloc_count * bed->s->int_rels_per_ext_rel; - for (rel = relocs; rel < rel_end; ++rel) - { - unsigned long r_symndx; - unsigned int r_type; - struct elf_link_hash_entry *h; - - r_symndx = ELF32_R_SYM (rel->r_info); - r_type = ELF32_R_TYPE (rel->r_info); - - if (r_symndx < extsymoff) - h = NULL; - else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr)) - { - (*_bfd_error_handler) - (_("%s: Malformed reloc detected for section %s"), - bfd_archive_filename (abfd), name); - bfd_set_error (bfd_error_bad_value); - return false; - } - else - { - h = sym_hashes[r_symndx - extsymoff]; - - /* This may be an indirect symbol created because of a version. */ - if (h != NULL) - { - while (h->root.type == bfd_link_hash_indirect) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - } - } - - /* Some relocs require a global offset table. */ - if (dynobj == NULL || sgot == NULL) - { - switch (r_type) - { - case R_MIPS_GOT16: - case R_MIPS_CALL16: - case R_MIPS_CALL_HI16: - case R_MIPS_CALL_LO16: - case R_MIPS_GOT_HI16: - case R_MIPS_GOT_LO16: - case R_MIPS_GOT_PAGE: - case R_MIPS_GOT_OFST: - case R_MIPS_GOT_DISP: - if (dynobj == NULL) - elf_hash_table (info)->dynobj = dynobj = abfd; - if (! mips_elf_create_got_section (dynobj, info)) - return false; - g = mips_elf_got_info (dynobj, &sgot); - break; - - case R_MIPS_32: - case R_MIPS_REL32: - case R_MIPS_64: - if (dynobj == NULL - && (info->shared || h != NULL) - && (sec->flags & SEC_ALLOC) != 0) - elf_hash_table (info)->dynobj = dynobj = abfd; - break; - - default: - break; - } - } - - if (!h && (r_type == R_MIPS_CALL_LO16 - || r_type == R_MIPS_GOT_LO16 - || r_type == R_MIPS_GOT_DISP)) - { - /* We may need a local GOT entry for this relocation. We - don't count R_MIPS_GOT_PAGE because we can estimate the - maximum number of pages needed by looking at the size of - the segment. Similar comments apply to R_MIPS_GOT16 and - R_MIPS_CALL16. We don't count R_MIPS_GOT_HI16, or - R_MIPS_CALL_HI16 because these are always followed by an - R_MIPS_GOT_LO16 or R_MIPS_CALL_LO16. - - This estimation is very conservative since we can merge - duplicate entries in the GOT. In order to be less - conservative, we could actually build the GOT here, - rather than in relocate_section. */ - g->local_gotno++; - sgot->_raw_size += MIPS_ELF_GOT_SIZE (dynobj); - } - - switch (r_type) - { - case R_MIPS_CALL16: - if (h == NULL) - { - (*_bfd_error_handler) - (_("%s: CALL16 reloc at 0x%lx not against global symbol"), - bfd_archive_filename (abfd), (unsigned long) rel->r_offset); - bfd_set_error (bfd_error_bad_value); - return false; - } - /* Fall through. */ - - case R_MIPS_CALL_HI16: - case R_MIPS_CALL_LO16: - if (h != NULL) - { - /* This symbol requires a global offset table entry. */ - if (!mips_elf_record_global_got_symbol (h, info, g)) - return false; - - /* We need a stub, not a plt entry for the undefined - function. But we record it as if it needs plt. See - elf_adjust_dynamic_symbol in elflink.h. */ - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - h->type = STT_FUNC; - } - break; - - case R_MIPS_GOT16: - case R_MIPS_GOT_HI16: - case R_MIPS_GOT_LO16: - case R_MIPS_GOT_DISP: - /* This symbol requires a global offset table entry. */ - if (h && !mips_elf_record_global_got_symbol (h, info, g)) - return false; - break; - - case R_MIPS_32: - case R_MIPS_REL32: - case R_MIPS_64: - if ((info->shared || h != NULL) - && (sec->flags & SEC_ALLOC) != 0) - { - if (sreloc == NULL) - { - const char *dname = MIPS_ELF_REL_DYN_SECTION_NAME (dynobj); - - sreloc = bfd_get_section_by_name (dynobj, dname); - if (sreloc == NULL) - { - sreloc = bfd_make_section (dynobj, dname); - if (sreloc == NULL - || ! bfd_set_section_flags (dynobj, sreloc, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, sreloc, - 4)) - return false; - } - } -#define MIPS_READONLY_SECTION (SEC_ALLOC | SEC_LOAD | SEC_READONLY) - if (info->shared) - { - /* When creating a shared object, we must copy these - reloc types into the output file as R_MIPS_REL32 - relocs. We make room for this reloc in the - .rel.dyn reloc section. */ - mips_elf_allocate_dynamic_relocations (dynobj, 1); - if ((sec->flags & MIPS_READONLY_SECTION) - == MIPS_READONLY_SECTION) - /* We tell the dynamic linker that there are - relocations against the text segment. */ - info->flags |= DF_TEXTREL; - } - else - { - struct mips_elf_link_hash_entry *hmips; - - /* We only need to copy this reloc if the symbol is - defined in a dynamic object. */ - hmips = (struct mips_elf_link_hash_entry *) h; - ++hmips->possibly_dynamic_relocs; - if ((sec->flags & MIPS_READONLY_SECTION) - == MIPS_READONLY_SECTION) - /* We need it to tell the dynamic linker if there - are relocations against the text segment. */ - hmips->readonly_reloc = true; - } - - /* Even though we don't directly need a GOT entry for - this symbol, a symbol must have a dynamic symbol - table index greater that DT_MIPS_GOTSYM if there are - dynamic relocations against it. */ - if (h != NULL - && !mips_elf_record_global_got_symbol (h, info, g)) - return false; - } - - if (SGI_COMPAT (abfd)) - mips_elf_hash_table (info)->compact_rel_size += - sizeof (Elf32_External_crinfo); - break; - - case R_MIPS_26: - case R_MIPS_GPREL16: - case R_MIPS_LITERAL: - case R_MIPS_GPREL32: - if (SGI_COMPAT (abfd)) - mips_elf_hash_table (info)->compact_rel_size += - sizeof (Elf32_External_crinfo); - break; - - /* This relocation describes the C++ object vtable hierarchy. - Reconstruct it for later use during GC. */ - case R_MIPS_GNU_VTINHERIT: - if (!_bfd_elf32_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_MIPS_GNU_VTENTRY: - if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_offset)) - return false; - break; - - default: - break; - } - - /* We must not create a stub for a symbol that has relocations - related to taking the function's address. */ - switch (r_type) - { - default: - if (h != NULL) - { - struct mips_elf_link_hash_entry *mh; - - mh = (struct mips_elf_link_hash_entry *) h; - mh->no_fn_stub = true; - } - break; - case R_MIPS_CALL16: - case R_MIPS_CALL_HI16: - case R_MIPS_CALL_LO16: - break; - } - - /* If this reloc is not a 16 bit call, and it has a global - symbol, then we will need the fn_stub if there is one. - References from a stub section do not count. */ - if (h != NULL - && r_type != R_MIPS16_26 - && strncmp (bfd_get_section_name (abfd, sec), FN_STUB, - sizeof FN_STUB - 1) != 0 - && strncmp (bfd_get_section_name (abfd, sec), CALL_STUB, - sizeof CALL_STUB - 1) != 0 - && strncmp (bfd_get_section_name (abfd, sec), CALL_FP_STUB, - sizeof CALL_FP_STUB - 1) != 0) - { - struct mips_elf_link_hash_entry *mh; - - mh = (struct mips_elf_link_hash_entry *) h; - mh->need_fn_stub = true; - } - } - - return true; -} - -/* Return the section that should be marked against GC for a given - relocation. */ - -asection * -_bfd_mips_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; -{ - /* ??? Do mips16 stub sections need to be handled special? */ - - if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_MIPS_GNU_VTINHERIT: - case R_MIPS_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 - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } - - return NULL; -} - -/* Update the got entry reference counts for the section being removed. */ - -boolean -_bfd_mips_elf_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; -{ -#if 0 - 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 (ELF32_R_TYPE (rel->r_info)) - { - case R_MIPS_GOT16: - case R_MIPS_CALL16: - case R_MIPS_CALL_HI16: - case R_MIPS_CALL_LO16: - case R_MIPS_GOT_HI16: - case R_MIPS_GOT_LO16: - /* ??? It would seem that the existing MIPS code does no sort - of reference counting or whatnot on its GOT and PLT entries, - so it is not possible to garbage collect them at this time. */ - break; - - default: - break; - } -#endif - - return true; -} - -/* Copy data from a MIPS ELF indirect symbol to its direct symbol, - hiding the old indirect symbol. Process additional relocation - information. Also called for weakdefs, in which case we just let - _bfd_elf_link_hash_copy_indirect copy the flags for us. */ - -static void -_bfd_mips_elf_copy_indirect_symbol (dir, ind) - struct elf_link_hash_entry *dir, *ind; -{ - struct mips_elf_link_hash_entry *dirmips, *indmips; - - _bfd_elf_link_hash_copy_indirect (dir, ind); - - if (ind->root.type != bfd_link_hash_indirect) - return; - - dirmips = (struct mips_elf_link_hash_entry *) dir; - indmips = (struct mips_elf_link_hash_entry *) ind; - dirmips->possibly_dynamic_relocs += indmips->possibly_dynamic_relocs; - if (indmips->readonly_reloc) - dirmips->readonly_reloc = true; - if (dirmips->min_dyn_reloc_index == 0 - || (indmips->min_dyn_reloc_index != 0 - && indmips->min_dyn_reloc_index < dirmips->min_dyn_reloc_index)) - dirmips->min_dyn_reloc_index = indmips->min_dyn_reloc_index; - if (indmips->no_fn_stub) - dirmips->no_fn_stub = 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. */ - -boolean -_bfd_mips_elf_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; -{ - bfd *dynobj; - struct mips_elf_link_hash_entry *hmips; - asection *s; - - dynobj = elf_hash_table (info)->dynobj; - - /* 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 symbol is defined in a dynamic object, we need to copy - any R_MIPS_32 or R_MIPS_REL32 relocs against it into the output - file. */ - hmips = (struct mips_elf_link_hash_entry *) h; - if (! info->relocateable - && hmips->possibly_dynamic_relocs != 0 - && (h->root.type == bfd_link_hash_defweak - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) - { - mips_elf_allocate_dynamic_relocations (dynobj, - hmips->possibly_dynamic_relocs); - if (hmips->readonly_reloc) - /* We tell the dynamic linker that there are relocations - against the text segment. */ - info->flags |= DF_TEXTREL; - } - - /* For a function, create a stub, if allowed. */ - if (! hmips->no_fn_stub - && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) - { - if (! elf_hash_table (info)->dynamic_sections_created) - return true; - - /* If this symbol is not defined in a regular file, then set - the symbol to the stub location. This is required to make - function pointers compare as equal between the normal - executable and the shared library. */ - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - { - /* We need .stub section. */ - s = bfd_get_section_by_name (dynobj, - MIPS_ELF_STUB_SECTION_NAME (dynobj)); - BFD_ASSERT (s != NULL); - - h->root.u.def.section = s; - h->root.u.def.value = s->_raw_size; - - /* XXX Write this stub address somewhere. */ - h->plt.offset = s->_raw_size; - - /* Make room for this stub code. */ - s->_raw_size += MIPS_FUNCTION_STUB_SIZE; - - /* The last half word of the stub will be filled with the index - of this symbol in .dynsym section. */ - return true; - } - } - else if ((h->type == STT_FUNC) - && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0) - { - /* This will set the entry for this symbol in the GOT to 0, and - the dynamic linker will take care of this. */ - h->root.u.def.value = 0; - 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. */ - - return true; -} - -/* This function is called after all the input files have been read, - and the input sections have been assigned to output sections. We - check for any mips16 stub sections that we can discard. */ - -static boolean mips_elf_check_mips16_stubs - PARAMS ((struct mips_elf_link_hash_entry *, PTR)); - -boolean -_bfd_mips_elf_always_size_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; -{ - asection *ri; - - /* The .reginfo section has a fixed size. */ - ri = bfd_get_section_by_name (output_bfd, ".reginfo"); - if (ri != NULL) - bfd_set_section_size (output_bfd, ri, - (bfd_size_type) sizeof (Elf32_External_RegInfo)); - - if (info->relocateable - || ! mips_elf_hash_table (info)->mips16_stubs_seen) - return true; - - mips_elf_link_hash_traverse (mips_elf_hash_table (info), - mips_elf_check_mips16_stubs, - (PTR) NULL); - - return true; -} - -/* Check the mips16 stubs for a particular symbol, and see if we can - discard them. */ - -static boolean -mips_elf_check_mips16_stubs (h, data) - struct mips_elf_link_hash_entry *h; - PTR data ATTRIBUTE_UNUSED; -{ - if (h->root.root.type == bfd_link_hash_warning) - h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link; - - if (h->fn_stub != NULL - && ! h->need_fn_stub) - { - /* We don't need the fn_stub; the only references to this symbol - are 16 bit calls. Clobber the size to 0 to prevent it from - being included in the link. */ - h->fn_stub->_raw_size = 0; - h->fn_stub->_cooked_size = 0; - h->fn_stub->flags &= ~SEC_RELOC; - h->fn_stub->reloc_count = 0; - h->fn_stub->flags |= SEC_EXCLUDE; - } - - if (h->call_stub != NULL - && h->root.other == STO_MIPS16) - { - /* We don't need the call_stub; this is a 16 bit function, so - calls from other 16 bit functions are OK. Clobber the size - to 0 to prevent it from being included in the link. */ - h->call_stub->_raw_size = 0; - h->call_stub->_cooked_size = 0; - h->call_stub->flags &= ~SEC_RELOC; - h->call_stub->reloc_count = 0; - h->call_stub->flags |= SEC_EXCLUDE; - } - - if (h->call_fp_stub != NULL - && h->root.other == STO_MIPS16) - { - /* We don't need the call_stub; this is a 16 bit function, so - calls from other 16 bit functions are OK. Clobber the size - to 0 to prevent it from being included in the link. */ - h->call_fp_stub->_raw_size = 0; - h->call_fp_stub->_cooked_size = 0; - h->call_fp_stub->flags &= ~SEC_RELOC; - h->call_fp_stub->reloc_count = 0; - h->call_fp_stub->flags |= SEC_EXCLUDE; - } - - return true; -} - -/* Set the sizes of the dynamic sections. */ - -boolean -_bfd_mips_elf_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; -{ - bfd *dynobj; - asection *s; - boolean reltext; - struct mips_got_info *g = NULL; - - 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 - = strlen (ELF_DYNAMIC_INTERPRETER (output_bfd)) + 1; - s->contents - = (bfd_byte *) ELF_DYNAMIC_INTERPRETER (output_bfd); - } - } - - /* The check_relocs and adjust_dynamic_symbol entry points have - determined the sizes of the various dynamic sections. Allocate - memory for them. */ - reltext = false; - for (s = dynobj->sections; s != NULL; s = s->next) - { - const char *name; - boolean strip; - - /* 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); - - if ((s->flags & SEC_LINKER_CREATED) == 0) - continue; - - strip = false; - - if (strncmp (name, ".rel", 4) == 0) - { - if (s->_raw_size == 0) - { - /* We only strip the section if the output section name - has the same name. Otherwise, there might be several - input sections for this output section. FIXME: This - code is probably not needed these days anyhow, since - the linker now does not create empty output sections. */ - if (s->output_section != NULL - && strcmp (name, - bfd_get_section_name (s->output_section->owner, - s->output_section)) == 0) - strip = true; - } - else - { - const char *outname; - asection *target; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. - If the relocation section is .rel.dyn, we always - assert a DT_TEXTREL entry rather than testing whether - there exists a relocation to a read only section or - not. */ - 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) - || strcmp (outname, - MIPS_ELF_REL_DYN_SECTION_NAME (output_bfd)) == 0) - reltext = true; - - /* We use the reloc_count field as a counter if we need - to copy relocs into the output file. */ - if (strcmp (name, - MIPS_ELF_REL_DYN_SECTION_NAME (output_bfd)) != 0) - s->reloc_count = 0; - } - } - else if (strncmp (name, ".got", 4) == 0) - { - int i; - bfd_size_type loadable_size = 0; - bfd_size_type local_gotno; - bfd *sub; - - BFD_ASSERT (elf_section_data (s) != NULL); - g = (struct mips_got_info *) elf_section_data (s)->tdata; - BFD_ASSERT (g != NULL); - - /* Calculate the total loadable size of the output. That - will give us the maximum number of GOT_PAGE entries - required. */ - for (sub = info->input_bfds; sub; sub = sub->link_next) - { - asection *subsection; - - for (subsection = sub->sections; - subsection; - subsection = subsection->next) - { - if ((subsection->flags & SEC_ALLOC) == 0) - continue; - loadable_size += ((subsection->_raw_size + 0xf) - &~ (bfd_size_type) 0xf); - } - } - loadable_size += MIPS_FUNCTION_STUB_SIZE; - - /* Assume there are two loadable segments consisting of - contiguous sections. Is 5 enough? */ - local_gotno = (loadable_size >> 16) + 5; - if (IRIX_COMPAT (output_bfd) == ict_irix6) - /* It's possible we will need GOT_PAGE entries as well as - GOT16 entries. Often, these will be able to share GOT - entries, but not always. */ - local_gotno *= 2; - - g->local_gotno += local_gotno; - s->_raw_size += local_gotno * MIPS_ELF_GOT_SIZE (dynobj); - - /* There has to be a global GOT entry for every symbol with - a dynamic symbol table index of DT_MIPS_GOTSYM or - higher. Therefore, it make sense to put those symbols - that need GOT entries at the end of the symbol table. We - do that here. */ - if (!mips_elf_sort_hash_table (info, 1)) - return false; - - if (g->global_gotsym != NULL) - i = elf_hash_table (info)->dynsymcount - g->global_gotsym->dynindx; - else - /* If there are no global symbols, or none requiring - relocations, then GLOBAL_GOTSYM will be NULL. */ - i = 0; - g->global_gotno = i; - s->_raw_size += i * MIPS_ELF_GOT_SIZE (dynobj); - } - else if (strcmp (name, MIPS_ELF_STUB_SECTION_NAME (output_bfd)) == 0) - { - /* Irix rld assumes that the function stub isn't at the end - of .text section. So put a dummy. XXX */ - s->_raw_size += MIPS_FUNCTION_STUB_SIZE; - } - else if (! info->shared - && ! mips_elf_hash_table (info)->use_rld_obj_head - && strncmp (name, ".rld_map", 8) == 0) - { - /* We add a room for __rld_map. It will be filled in by the - rtld to contain a pointer to the _r_debug structure. */ - s->_raw_size += 4; - } - else if (SGI_COMPAT (output_bfd) - && strncmp (name, ".compact_rel", 12) == 0) - s->_raw_size += mips_elf_hash_table (info)->compact_rel_size; - else if (strcmp (name, MIPS_ELF_MSYM_SECTION_NAME (output_bfd)) - == 0) - s->_raw_size = (sizeof (Elf32_External_Msym) - * (elf_hash_table (info)->dynsymcount - + bfd_count_sections (output_bfd))); - else if (strncmp (name, ".init", 5) != 0) - { - /* It's not one of our sections, so don't allocate space. */ - continue; - } - - if (strip) - { - _bfd_strip_section_from_output (info, s); - continue; - } - - /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); - if (s->contents == NULL && s->_raw_size != 0) - { - bfd_set_error (bfd_error_no_memory); - return false; - } - } - - if (elf_hash_table (info)->dynamic_sections_created) - { - /* Add some entries to the .dynamic section. We fill in the - values later, in elf_mips_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) - { - /* SGI object has the equivalence of DT_DEBUG in the - DT_MIPS_RLD_MAP entry. */ - if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP, 0)) - return false; - if (!SGI_COMPAT (output_bfd)) - { - if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0)) - return false; - } - } - else - { - /* Shared libraries on traditional mips have DT_DEBUG. */ - if (!SGI_COMPAT (output_bfd)) - { - if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0)) - return false; - } - } - - if (reltext && SGI_COMPAT (output_bfd)) - info->flags |= DF_TEXTREL; - - if ((info->flags & DF_TEXTREL) != 0) - { - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_TEXTREL, 0)) - return false; - } - - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTGOT, 0)) - return false; - - if (bfd_get_section_by_name (dynobj, - MIPS_ELF_REL_DYN_SECTION_NAME (dynobj))) - { - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0)) - return false; - - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0)) - return false; - - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0)) - return false; - } - - if (SGI_COMPAT (output_bfd)) - { - if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_CONFLICTNO, 0)) - return false; - } - - if (SGI_COMPAT (output_bfd)) - { - if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LIBLISTNO, 0)) - return false; - } - - if (bfd_get_section_by_name (dynobj, ".conflict") != NULL) - { - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_CONFLICT, 0)) - return false; - - s = bfd_get_section_by_name (dynobj, ".liblist"); - BFD_ASSERT (s != NULL); - - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LIBLIST, 0)) - return false; - } - - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_VERSION, 0)) - return false; - - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_FLAGS, 0)) - return false; - -#if 0 - /* Time stamps in executable files are a bad idea. */ - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_TIME_STAMP, 0)) - return false; -#endif - -#if 0 /* FIXME */ - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_ICHECKSUM, 0)) - return false; -#endif - -#if 0 /* FIXME */ - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_IVERSION, 0)) - return false; -#endif - - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_BASE_ADDRESS, 0)) - return false; - - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LOCAL_GOTNO, 0)) - return false; - - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_SYMTABNO, 0)) - return false; - - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_UNREFEXTNO, 0)) - return false; - - if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_GOTSYM, 0)) - return false; - - if (IRIX_COMPAT (dynobj) == ict_irix5 - && ! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_HIPAGENO, 0)) - return false; - - if (IRIX_COMPAT (dynobj) == ict_irix6 - && (bfd_get_section_by_name - (dynobj, MIPS_ELF_OPTIONS_SECTION_NAME (dynobj))) - && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_OPTIONS, 0)) - return false; - - if (bfd_get_section_by_name (dynobj, - MIPS_ELF_MSYM_SECTION_NAME (dynobj)) - && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_MSYM, 0)) - return false; - } - - return true; -} - -/* If NAME is one of the special IRIX6 symbols defined by the linker, - adjust it appropriately now. */ - -static void -mips_elf_irix6_finish_dynamic_symbol (abfd, name, sym) - bfd *abfd ATTRIBUTE_UNUSED; - const char *name; - Elf_Internal_Sym *sym; -{ - /* The linker script takes care of providing names and values for - these, but we must place them into the right sections. */ - static const char* const text_section_symbols[] = { - "_ftext", - "_etext", - "__dso_displacement", - "__elf_header", - "__program_header_table", - NULL - }; - - static const char* const data_section_symbols[] = { - "_fdata", - "_edata", - "_end", - "_fbss", - NULL - }; - - const char* const *p; - int i; - - for (i = 0; i < 2; ++i) - for (p = (i == 0) ? text_section_symbols : data_section_symbols; - *p; - ++p) - if (strcmp (*p, name) == 0) - { - /* All of these symbols are given type STT_SECTION by the - IRIX6 linker. */ - sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); - - /* The IRIX linker puts these symbols in special sections. */ - if (i == 0) - sym->st_shndx = SHN_MIPS_TEXT; - else - sym->st_shndx = SHN_MIPS_DATA; - - break; - } -} - -/* Finish up dynamic symbol handling. We set the contents of various - dynamic sections here. */ - -boolean -_bfd_mips_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; - bfd_vma gval; - asection *sgot; - asection *smsym; - struct mips_got_info *g; - const char *name; - struct mips_elf_link_hash_entry *mh; - - dynobj = elf_hash_table (info)->dynobj; - gval = sym->st_value; - mh = (struct mips_elf_link_hash_entry *) h; - - if (h->plt.offset != (bfd_vma) -1) - { - asection *s; - bfd_byte *p; - bfd_byte stub[MIPS_FUNCTION_STUB_SIZE]; - - /* This symbol has a stub. Set it up. */ - - BFD_ASSERT (h->dynindx != -1); - - s = bfd_get_section_by_name (dynobj, - MIPS_ELF_STUB_SECTION_NAME (dynobj)); - BFD_ASSERT (s != NULL); - - /* Fill the stub. */ - p = stub; - bfd_put_32 (output_bfd, (bfd_vma) STUB_LW (output_bfd), p); - p += 4; - bfd_put_32 (output_bfd, (bfd_vma) STUB_MOVE (output_bfd), p); - p += 4; - - /* FIXME: Can h->dynindex be more than 64K? */ - if (h->dynindx & 0xffff0000) - return false; - - bfd_put_32 (output_bfd, (bfd_vma) STUB_JALR, p); - p += 4; - bfd_put_32 (output_bfd, (bfd_vma) STUB_LI16 (output_bfd) + h->dynindx, p); - - BFD_ASSERT (h->plt.offset <= s->_raw_size); - memcpy (s->contents + h->plt.offset, stub, MIPS_FUNCTION_STUB_SIZE); - - /* Mark the symbol as undefined. plt.offset != -1 occurs - only for the referenced symbol. */ - sym->st_shndx = SHN_UNDEF; - - /* The run-time linker uses the st_value field of the symbol - to reset the global offset table entry for this external - to its stub address when unlinking a shared object. */ - gval = s->output_section->vma + s->output_offset + h->plt.offset; - sym->st_value = gval; - } - - BFD_ASSERT (h->dynindx != -1 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0); - - sgot = mips_elf_got_section (dynobj); - BFD_ASSERT (sgot != NULL); - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_got_info *) elf_section_data (sgot)->tdata; - BFD_ASSERT (g != NULL); - - /* Run through the global symbol table, creating GOT entries for all - the symbols that need them. */ - if (g->global_gotsym != NULL - && h->dynindx >= g->global_gotsym->dynindx) - { - bfd_vma offset; - bfd_vma value; - - if (sym->st_value) - value = sym->st_value; - else - { - /* For an entity defined in a shared object, this will be - NULL. (For functions in shared objects for - which we have created stubs, ST_VALUE will be non-NULL. - That's because such the functions are now no longer defined - in a shared object.) */ - - if (info->shared && h->root.type == bfd_link_hash_undefined) - value = 0; - else - value = h->root.u.def.value; - } - offset = mips_elf_global_got_index (dynobj, h); - MIPS_ELF_PUT_WORD (output_bfd, value, sgot->contents + offset); - } - - /* Create a .msym entry, if appropriate. */ - smsym = bfd_get_section_by_name (dynobj, - MIPS_ELF_MSYM_SECTION_NAME (dynobj)); - if (smsym) - { - Elf32_Internal_Msym msym; - - msym.ms_hash_value = bfd_elf_hash (h->root.root.string); - /* It is undocumented what the `1' indicates, but IRIX6 uses - this value. */ - msym.ms_info = ELF32_MS_INFO (mh->min_dyn_reloc_index, 1); - bfd_mips_elf_swap_msym_out - (dynobj, &msym, - ((Elf32_External_Msym *) smsym->contents) + h->dynindx); - } - - /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ - name = h->root.root.string; - if (strcmp (name, "_DYNAMIC") == 0 - || strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) - sym->st_shndx = SHN_ABS; - else if (strcmp (name, "_DYNAMIC_LINK") == 0 - || strcmp (name, "_DYNAMIC_LINKING") == 0) - { - sym->st_shndx = SHN_ABS; - sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); - sym->st_value = 1; - } - else if (strcmp (name, "_gp_disp") == 0) - { - sym->st_shndx = SHN_ABS; - sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); - sym->st_value = elf_gp (output_bfd); - } - else if (SGI_COMPAT (output_bfd)) - { - if (strcmp (name, mips_elf_dynsym_rtproc_names[0]) == 0 - || strcmp (name, mips_elf_dynsym_rtproc_names[1]) == 0) - { - sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); - sym->st_other = STO_PROTECTED; - sym->st_value = 0; - sym->st_shndx = SHN_MIPS_DATA; - } - else if (strcmp (name, mips_elf_dynsym_rtproc_names[2]) == 0) - { - sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); - sym->st_other = STO_PROTECTED; - sym->st_value = mips_elf_hash_table (info)->procedure_count; - sym->st_shndx = SHN_ABS; - } - else if (sym->st_shndx != SHN_UNDEF && sym->st_shndx != SHN_ABS) - { - if (h->type == STT_FUNC) - sym->st_shndx = SHN_MIPS_TEXT; - else if (h->type == STT_OBJECT) - sym->st_shndx = SHN_MIPS_DATA; - } - } - - /* Handle the IRIX6-specific symbols. */ - if (IRIX_COMPAT (output_bfd) == ict_irix6) - mips_elf_irix6_finish_dynamic_symbol (output_bfd, name, sym); - - if (! info->shared) - { - if (! mips_elf_hash_table (info)->use_rld_obj_head - && (strcmp (name, "__rld_map") == 0 - || strcmp (name, "__RLD_MAP") == 0)) - { - asection *s = bfd_get_section_by_name (dynobj, ".rld_map"); - BFD_ASSERT (s != NULL); - sym->st_value = s->output_section->vma + s->output_offset; - bfd_put_32 (output_bfd, (bfd_vma) 0, s->contents); - if (mips_elf_hash_table (info)->rld_value == 0) - mips_elf_hash_table (info)->rld_value = sym->st_value; - } - else if (mips_elf_hash_table (info)->use_rld_obj_head - && strcmp (name, "__rld_obj_head") == 0) - { - /* IRIX6 does not use a .rld_map section. */ - if (IRIX_COMPAT (output_bfd) == ict_irix5 - || IRIX_COMPAT (output_bfd) == ict_none) - BFD_ASSERT (bfd_get_section_by_name (dynobj, ".rld_map") - != NULL); - mips_elf_hash_table (info)->rld_value = sym->st_value; - } - } - - /* If this is a mips16 symbol, force the value to be even. */ - if (sym->st_other == STO_MIPS16 - && (sym->st_value & 1) != 0) - --sym->st_value; - - return true; -} - -/* Finish up the dynamic sections. */ - -boolean -_bfd_mips_elf_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; -{ - bfd *dynobj; - asection *sdyn; - asection *sgot; - struct mips_got_info *g; - - dynobj = elf_hash_table (info)->dynobj; - - sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); - - sgot = mips_elf_got_section (dynobj); - if (sgot == NULL) - g = NULL; - else - { - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_got_info *) elf_section_data (sgot)->tdata; - BFD_ASSERT (g != NULL); - } - - if (elf_hash_table (info)->dynamic_sections_created) - { - bfd_byte *b; - - BFD_ASSERT (sdyn != NULL); - BFD_ASSERT (g != NULL); - - for (b = sdyn->contents; - b < sdyn->contents + sdyn->_raw_size; - b += MIPS_ELF_DYN_SIZE (dynobj)) - { - Elf_Internal_Dyn dyn; - const char *name; - size_t elemsize; - asection *s; - boolean swap_out_p; - - /* Read in the current dynamic entry. */ - (*get_elf_backend_data (dynobj)->s->swap_dyn_in) (dynobj, b, &dyn); - - /* Assume that we're going to modify it and write it out. */ - swap_out_p = true; - - switch (dyn.d_tag) - { - case DT_RELENT: - s = (bfd_get_section_by_name - (dynobj, - MIPS_ELF_REL_DYN_SECTION_NAME (dynobj))); - BFD_ASSERT (s != NULL); - dyn.d_un.d_val = MIPS_ELF_REL_SIZE (dynobj); - break; - - case DT_STRSZ: - /* Rewrite DT_STRSZ. */ - dyn.d_un.d_val = - _bfd_elf_strtab_size (elf_hash_table (info)->dynstr); - break; - - case DT_PLTGOT: - name = ".got"; - goto get_vma; - case DT_MIPS_CONFLICT: - name = ".conflict"; - goto get_vma; - case DT_MIPS_LIBLIST: - name = ".liblist"; - get_vma: - s = bfd_get_section_by_name (output_bfd, name); - BFD_ASSERT (s != NULL); - dyn.d_un.d_ptr = s->vma; - break; - - case DT_MIPS_RLD_VERSION: - dyn.d_un.d_val = 1; /* XXX */ - break; - - case DT_MIPS_FLAGS: - dyn.d_un.d_val = RHF_NOTPOT; /* XXX */ - break; - - case DT_MIPS_CONFLICTNO: - name = ".conflict"; - elemsize = sizeof (Elf32_Conflict); - goto set_elemno; - - case DT_MIPS_LIBLISTNO: - name = ".liblist"; - elemsize = sizeof (Elf32_Lib); - set_elemno: - s = bfd_get_section_by_name (output_bfd, name); - if (s != NULL) - { - if (s->_cooked_size != 0) - dyn.d_un.d_val = s->_cooked_size / elemsize; - else - dyn.d_un.d_val = s->_raw_size / elemsize; - } - else - dyn.d_un.d_val = 0; - break; - - case DT_MIPS_TIME_STAMP: - time ((time_t *) &dyn.d_un.d_val); - break; - - case DT_MIPS_ICHECKSUM: - /* XXX FIXME: */ - swap_out_p = false; - break; - - case DT_MIPS_IVERSION: - /* XXX FIXME: */ - swap_out_p = false; - break; - - case DT_MIPS_BASE_ADDRESS: - s = output_bfd->sections; - BFD_ASSERT (s != NULL); - dyn.d_un.d_ptr = s->vma & ~(bfd_vma) 0xffff; - break; - - case DT_MIPS_LOCAL_GOTNO: - dyn.d_un.d_val = g->local_gotno; - break; - - case DT_MIPS_UNREFEXTNO: - /* The index into the dynamic symbol table which is the - entry of the first external symbol that is not - referenced within the same object. */ - dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1; - break; - - case DT_MIPS_GOTSYM: - if (g->global_gotsym) - { - dyn.d_un.d_val = g->global_gotsym->dynindx; - break; - } - /* In case if we don't have global got symbols we default - to setting DT_MIPS_GOTSYM to the same value as - DT_MIPS_SYMTABNO, so we just fall through. */ - - case DT_MIPS_SYMTABNO: - name = ".dynsym"; - elemsize = MIPS_ELF_SYM_SIZE (output_bfd); - s = bfd_get_section_by_name (output_bfd, name); - BFD_ASSERT (s != NULL); - - if (s->_cooked_size != 0) - dyn.d_un.d_val = s->_cooked_size / elemsize; - else - dyn.d_un.d_val = s->_raw_size / elemsize; - break; - - case DT_MIPS_HIPAGENO: - dyn.d_un.d_val = g->local_gotno - MIPS_RESERVED_GOTNO; - break; - - case DT_MIPS_RLD_MAP: - dyn.d_un.d_ptr = mips_elf_hash_table (info)->rld_value; - break; - - case DT_MIPS_OPTIONS: - s = (bfd_get_section_by_name - (output_bfd, MIPS_ELF_OPTIONS_SECTION_NAME (output_bfd))); - dyn.d_un.d_ptr = s->vma; - break; - - case DT_MIPS_MSYM: - s = (bfd_get_section_by_name - (output_bfd, MIPS_ELF_MSYM_SECTION_NAME (output_bfd))); - dyn.d_un.d_ptr = s->vma; - break; - - default: - swap_out_p = false; - break; - } - - if (swap_out_p) - (*get_elf_backend_data (dynobj)->s->swap_dyn_out) - (dynobj, &dyn, b); - } - } - - /* The first entry of the global offset table will be filled at - runtime. The second entry will be used by some runtime loaders. - This isn't the case of Irix rld. */ - if (sgot != NULL && sgot->_raw_size > 0) - { - MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0, sgot->contents); - MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0x80000000, - sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd)); - } - - if (sgot != NULL) - elf_section_data (sgot->output_section)->this_hdr.sh_entsize - = MIPS_ELF_GOT_SIZE (output_bfd); - - { - asection *smsym; - asection *s; - Elf32_compact_rel cpt; - - /* ??? The section symbols for the output sections were set up in - _bfd_elf_final_link. SGI sets the STT_NOTYPE attribute for these - symbols. Should we do so? */ - - smsym = bfd_get_section_by_name (dynobj, - MIPS_ELF_MSYM_SECTION_NAME (dynobj)); - if (smsym != NULL) - { - Elf32_Internal_Msym msym; - - msym.ms_hash_value = 0; - msym.ms_info = ELF32_MS_INFO (0, 1); - - for (s = output_bfd->sections; s != NULL; s = s->next) - { - long dynindx = elf_section_data (s)->dynindx; - - bfd_mips_elf_swap_msym_out - (output_bfd, &msym, - (((Elf32_External_Msym *) smsym->contents) - + dynindx)); - } - } - - if (SGI_COMPAT (output_bfd)) - { - /* Write .compact_rel section out. */ - s = bfd_get_section_by_name (dynobj, ".compact_rel"); - if (s != NULL) - { - cpt.id1 = 1; - cpt.num = s->reloc_count; - cpt.id2 = 2; - cpt.offset = (s->output_section->filepos - + sizeof (Elf32_External_compact_rel)); - cpt.reserved0 = 0; - cpt.reserved1 = 0; - bfd_elf32_swap_compact_rel_out (output_bfd, &cpt, - ((Elf32_External_compact_rel *) - s->contents)); - - /* Clean up a dummy stub function entry in .text. */ - s = bfd_get_section_by_name (dynobj, - MIPS_ELF_STUB_SECTION_NAME (dynobj)); - if (s != NULL) - { - file_ptr dummy_offset; - - BFD_ASSERT (s->_raw_size >= MIPS_FUNCTION_STUB_SIZE); - dummy_offset = s->_raw_size - MIPS_FUNCTION_STUB_SIZE; - memset (s->contents + dummy_offset, 0, - MIPS_FUNCTION_STUB_SIZE); - } - } - } - - /* We need to sort the entries of the dynamic relocation section. */ - - if (!ABI_64_P (output_bfd)) - { - asection *reldyn; - - reldyn = bfd_get_section_by_name (dynobj, - MIPS_ELF_REL_DYN_SECTION_NAME (dynobj)); - if (reldyn != NULL && reldyn->reloc_count > 2) - { - reldyn_sorting_bfd = output_bfd; - qsort ((Elf32_External_Rel *) reldyn->contents + 1, - (size_t) reldyn->reloc_count - 1, - sizeof (Elf32_External_Rel), sort_dynamic_relocs); - } - } - - /* Clean up a first relocation in .rel.dyn. */ - s = bfd_get_section_by_name (dynobj, - MIPS_ELF_REL_DYN_SECTION_NAME (dynobj)); - if (s != NULL && s->_raw_size > 0) - memset (s->contents, 0, MIPS_ELF_REL_SIZE (dynobj)); - } - - return true; -} - -/* Support for core dump NOTE sections */ -static boolean -_bfd_elf32_mips_grok_prstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; -{ - int offset; - unsigned int raw_size; - - switch (note->descsz) - { - default: - return false; - - case 256: /* Linux/MIPS */ - /* pr_cursig */ - elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); - - /* pr_pid */ - elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); - - /* pr_reg */ - offset = 72; - raw_size = 180; - - break; - } - - /* Make a ".reg/999" section. */ - return _bfd_elfcore_make_pseudosection (abfd, ".reg", - raw_size, note->descpos + offset); -} - -static boolean -_bfd_elf32_mips_grok_psinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; -{ - switch (note->descsz) - { - default: - return false; - - case 128: /* Linux/MIPS elf_prpsinfo */ - elf_tdata (abfd)->core_program - = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16); - elf_tdata (abfd)->core_command - = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80); - } - - /* Note that for some reason, a spurious space is tacked - onto the end of the args in some (at least one anyway) - implementations, so strip it off if it exists. */ - - { - char *command = elf_tdata (abfd)->core_command; - int n = strlen (command); - - if (0 < n && command[n - 1] == ' ') - command[n - 1] = '\0'; - } - - return true; -} - -#define PDR_SIZE 32 - -static boolean -_bfd_elf32_mips_discard_info (abfd, cookie, info) - bfd *abfd; - struct elf_reloc_cookie *cookie; - struct bfd_link_info *info; -{ - asection *o; - struct elf_backend_data *bed = get_elf_backend_data (abfd); - boolean ret = false; - unsigned char *tdata; - size_t i, skip; - - o = bfd_get_section_by_name (abfd, ".pdr"); - if (! o) - return false; - if (o->_raw_size == 0) - return false; - if (o->_raw_size % PDR_SIZE != 0) - return false; - if (o->output_section != NULL - && bfd_is_abs_section (o->output_section)) - return false; - - tdata = bfd_zmalloc (o->_raw_size / PDR_SIZE); - if (! tdata) - return false; - - cookie->rels = _bfd_elf32_link_read_relocs (abfd, o, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory); - if (!cookie->rels) - { - free (tdata); - return false; - } - - cookie->rel = cookie->rels; - cookie->relend = - cookie->rels + o->reloc_count * bed->s->int_rels_per_ext_rel; - - for (i = 0, skip = 0; i < o->_raw_size; i ++) - { - if (_bfd_elf32_reloc_symbol_deleted_p (i * PDR_SIZE, cookie)) - { - tdata[i] = 1; - skip ++; - } - } - - if (skip != 0) - { - elf_section_data (o)->tdata = tdata; - o->_cooked_size = o->_raw_size - skip * PDR_SIZE; - ret = true; - } - else - free (tdata); - - if (! info->keep_memory) - free (cookie->rels); - - return ret; -} - -static boolean -_bfd_elf32_mips_ignore_discarded_relocs (sec) - asection *sec; -{ - if (strcmp (sec->name, ".pdr") == 0) - return true; - return false; -} - -static boolean -_bfd_elf32_mips_write_section (output_bfd, sec, contents) - bfd *output_bfd; - asection *sec; - bfd_byte *contents; -{ - bfd_byte *to, *from, *end; - int i; - - if (strcmp (sec->name, ".pdr") != 0) - return false; - - if (elf_section_data (sec)->tdata == NULL) - return false; - - to = contents; - end = contents + sec->_raw_size; - for (from = contents, i = 0; - from < end; - from += PDR_SIZE, i++) - { - if (((unsigned char *)elf_section_data (sec)->tdata)[i] == 1) - continue; - if (to != from) - memcpy (to, from, PDR_SIZE); - to += PDR_SIZE; - } - bfd_set_section_contents (output_bfd, sec->output_section, contents, - (file_ptr) sec->output_offset, - sec->_cooked_size); - return true; -} - -/* Given a data section and an in-memory embedded reloc section, store - relocation information into the embedded reloc section which can be - used at runtime to relocate the data section. This is called by the - linker when the --embedded-relocs switch is used. This is called - after the add_symbols entry point has been called for all the - objects, and before the final_link entry point is called. */ - -boolean -bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) - bfd *abfd; - struct bfd_link_info *info; - asection *datasec; - asection *relsec; - char **errmsg; -{ - Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; - Elf32_External_Sym *extsyms; - Elf32_External_Sym *free_extsyms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; - Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *free_relocs = NULL; - Elf_Internal_Rela *irel, *irelend; - bfd_byte *p; - bfd_size_type amt; - - BFD_ASSERT (! info->relocateable); - - *errmsg = NULL; - - if (datasec->reloc_count == 0) - return true; - - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - /* Read this BFD's symbols if we haven't done so already, or get the cached - copy if it exists. */ - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else - { - /* Go get them off disk. */ - if (info->keep_memory) - extsyms = ((Elf32_External_Sym *) - bfd_alloc (abfd, symtab_hdr->sh_size)); - else - extsyms = ((Elf32_External_Sym *) - bfd_malloc (symtab_hdr->sh_size)); - if (extsyms == NULL) - goto error_return; - if (! info->keep_memory) - free_extsyms = extsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_bread (extsyms, symtab_hdr->sh_size, abfd) - != symtab_hdr->sh_size)) - goto error_return; - if (info->keep_memory) - symtab_hdr->contents = (unsigned char *) extsyms; - } - - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - if (shndx_hdr->sh_size != 0) - { - amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) - goto error_return; - } - - /* Get a copy of the native relocations. */ - internal_relocs = (_bfd_elf32_link_read_relocs - (abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL, - info->keep_memory)); - if (internal_relocs == NULL) - goto error_return; - if (! info->keep_memory) - free_relocs = internal_relocs; - - relsec->contents = (bfd_byte *) bfd_alloc (abfd, datasec->reloc_count * 12); - if (relsec->contents == NULL) - goto error_return; - - p = relsec->contents; - - irelend = internal_relocs + datasec->reloc_count; - - for (irel = internal_relocs; irel < irelend; irel++, p += 12) - { - asection *targetsec; - - /* We are going to write a four byte longword into the runtime - reloc section. The longword will be the address in the data - section which must be relocated. It is followed by the name - of the target section NUL-padded or truncated to 8 - characters. */ - - /* We can only relocate absolute longword relocs at run time. */ - if ((ELF32_R_TYPE (irel->r_info) != (int) R_MIPS_32) && - (ELF32_R_TYPE (irel->r_info) != (int) R_MIPS_64)) - { - *errmsg = _("unsupported reloc type"); - bfd_set_error (bfd_error_bad_value); - goto error_return; - } - /* Get the target section referred to by the reloc. */ - if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) - { - Elf32_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym isym; - - /* A local symbol. */ - esym = extsyms + ELF32_R_SYM (irel->r_info); - shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0); - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); - - targetsec = bfd_section_from_elf_index (abfd, isym.st_shndx); - } - else - { - unsigned long indx; - struct elf_link_hash_entry *h; - - /* An external symbol. */ - indx = ELF32_R_SYM (irel->r_info); - h = elf_sym_hashes (abfd)[indx]; - targetsec = NULL; - /* - * For some reason, in certain programs, the symbol will - * not be in the hash table. It seems to happen when you - * declare a static table of pointers to const external structures. - * In this case, the relocs are relative to data, not - * text, so just treating it like an undefined link - * should be sufficient. - */ - BFD_ASSERT(h != NULL); - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - targetsec = h->root.u.def.section; - } - - - /* - * Set the low bit of the relocation offset if it's a MIPS64 reloc. - * Relocations will always be on (at least) 32-bit boundaries. - */ - - bfd_put_32 (abfd, ((irel->r_offset + datasec->output_offset) + - ((ELF32_R_TYPE (irel->r_info) == (int) R_MIPS_64) ? 1 : 0)), - p); - memset (p + 4, 0, 8); - if (targetsec != NULL) - strncpy (p + 4, targetsec->output_section->name, 8); - } - - if (shndx_buf != NULL) - free (shndx_buf); - if (free_extsyms != NULL) - free (free_extsyms); - if (free_relocs != NULL) - free (free_relocs); - return true; - - error_return: - if (shndx_buf != NULL) - free (shndx_buf); - if (free_extsyms != NULL) - free (free_extsyms); - if (free_relocs != NULL) - free (free_relocs); - return false; -} - -/* This is almost identical to bfd_generic_get_... except that some - MIPS relocations need to be handled specially. Sigh. */ - -static bfd_byte * -elf32_mips_get_relocated_section_contents (abfd, link_info, link_order, data, - relocateable, symbols) - bfd *abfd; - struct bfd_link_info *link_info; - struct bfd_link_order *link_order; - bfd_byte *data; - boolean relocateable; - asymbol **symbols; -{ - /* 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, input_section); - arelent **reloc_vector = NULL; - long reloc_count; - - if (reloc_size < 0) - goto error_return; - - reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); - if (reloc_vector == NULL && reloc_size != 0) - goto error_return; - - /* read in the section */ - if (!bfd_get_section_contents (input_bfd, - input_section, - (PTR) data, - (file_ptr) 0, - input_section->_raw_size)) - goto error_return; - - /* We're not relaxing the section, so just copy the size info */ - input_section->_cooked_size = input_section->_raw_size; - input_section->reloc_done = true; - - reloc_count = bfd_canonicalize_reloc (input_bfd, - input_section, - reloc_vector, - symbols); - if (reloc_count < 0) - goto error_return; - - if (reloc_count > 0) - { - arelent **parent; - /* for mips */ - int gp_found; - bfd_vma gp = 0x12345678; /* initialize just to shut gcc up */ - - { - struct bfd_hash_entry *h; - struct bfd_link_hash_entry *lh; - /* Skip all this stuff if we aren't mixing formats. */ - if (abfd && input_bfd - && abfd->xvec == input_bfd->xvec) - lh = 0; - else - { - h = bfd_hash_lookup (&link_info->hash->table, "_gp", false, false); - lh = (struct bfd_link_hash_entry *) h; - } - lookup: - if (lh) - { - switch (lh->type) - { - case bfd_link_hash_undefined: - case bfd_link_hash_undefweak: - case bfd_link_hash_common: - gp_found = 0; - break; - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - gp_found = 1; - gp = lh->u.def.value; - break; - case bfd_link_hash_indirect: - case bfd_link_hash_warning: - lh = lh->u.i.link; - /* @@FIXME ignoring warning for now */ - goto lookup; - case bfd_link_hash_new: - default: - abort (); - } - } - else - gp_found = 0; - } - /* end mips */ - for (parent = reloc_vector; *parent != (arelent *) NULL; - parent++) - { - char *error_message = (char *) NULL; - bfd_reloc_status_type r; - - /* Specific to MIPS: Deal with relocation types that require - knowing the gp of the output bfd. */ - asymbol *sym = *(*parent)->sym_ptr_ptr; - if (bfd_is_abs_section (sym->section) && abfd) - { - /* The special_function wouldn't get called anyways. */ - } - else if (!gp_found) - { - /* The gp isn't there; let the special function code - fall over on its own. */ - } - else if ((*parent)->howto->special_function - == _bfd_mips_elf_gprel16_reloc) - { - /* bypass special_function call */ - r = gprel16_with_gp (input_bfd, sym, *parent, input_section, - relocateable, (PTR) data, gp); - goto skip_bfd_perform_relocation; - } - /* end mips specific stuff */ - - r = bfd_perform_relocation (input_bfd, - *parent, - (PTR) data, - input_section, - relocateable ? abfd : (bfd *) NULL, - &error_message); - skip_bfd_perform_relocation: - - if (relocateable) - { - asection *os = input_section->output_section; - - /* A partial link, so keep the relocs */ - os->orelocation[os->reloc_count] = *parent; - os->reloc_count++; - } - - if (r != bfd_reloc_ok) - { - switch (r) - { - case bfd_reloc_undefined: - if (!((*link_info->callbacks->undefined_symbol) - (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr), - input_bfd, input_section, (*parent)->address, - true))) - goto error_return; - break; - case bfd_reloc_dangerous: - BFD_ASSERT (error_message != (char *) NULL); - if (!((*link_info->callbacks->reloc_dangerous) - (link_info, error_message, input_bfd, input_section, - (*parent)->address))) - goto error_return; - break; - case bfd_reloc_overflow: - if (!((*link_info->callbacks->reloc_overflow) - (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr), - (*parent)->howto->name, (*parent)->addend, - input_bfd, input_section, (*parent)->address))) - goto error_return; - break; - case bfd_reloc_outofrange: - default: - abort (); - break; - } - - } - } - } - if (reloc_vector != NULL) - free (reloc_vector); - return data; - -error_return: - if (reloc_vector != NULL) - free (reloc_vector); - return NULL; -} - -#define bfd_elf32_bfd_get_relocated_section_contents \ - elf32_mips_get_relocated_section_contents - -/* ECOFF swapping routines. These are used when dealing with the - .mdebug section, which is in the ECOFF debugging format. */ -static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { - /* Symbol table magic number. */ - magicSym, - /* Alignment of debugging information. E.g., 4. */ - 4, - /* Sizes of external symbolic information. */ - sizeof (struct hdr_ext), - sizeof (struct dnr_ext), - sizeof (struct pdr_ext), - sizeof (struct sym_ext), - sizeof (struct opt_ext), - sizeof (struct fdr_ext), - sizeof (struct rfd_ext), - sizeof (struct ext_ext), - /* Functions to swap in external symbolic data. */ - ecoff_swap_hdr_in, - ecoff_swap_dnr_in, - ecoff_swap_pdr_in, - ecoff_swap_sym_in, - ecoff_swap_opt_in, - ecoff_swap_fdr_in, - ecoff_swap_rfd_in, - ecoff_swap_ext_in, - _bfd_ecoff_swap_tir_in, - _bfd_ecoff_swap_rndx_in, - /* Functions to swap out external symbolic data. */ - ecoff_swap_hdr_out, - ecoff_swap_dnr_out, - ecoff_swap_pdr_out, - ecoff_swap_sym_out, - ecoff_swap_opt_out, - ecoff_swap_fdr_out, - ecoff_swap_rfd_out, - ecoff_swap_ext_out, - _bfd_ecoff_swap_tir_out, - _bfd_ecoff_swap_rndx_out, - /* Function to read in symbolic data. */ - _bfd_mips_elf_read_ecoff_info -}; - -#define ELF_ARCH bfd_arch_mips -#define ELF_MACHINE_CODE EM_MIPS - -/* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses - a value of 0x1000, and we are compatible. */ -#define ELF_MAXPAGESIZE 0x1000 - -#define elf_backend_collect true -#define elf_backend_type_change_ok true -#define elf_backend_can_gc_sections true -#define elf_info_to_howto mips_info_to_howto_rela -#define elf_info_to_howto_rel mips_info_to_howto_rel -#define elf_backend_sym_is_global mips_elf_sym_is_global -#define elf_backend_object_p _bfd_mips_elf_object_p -#define elf_backend_symbol_processing _bfd_mips_elf_symbol_processing -#define elf_backend_section_processing _bfd_mips_elf_section_processing -#define elf_backend_section_from_shdr _bfd_mips_elf_section_from_shdr -#define elf_backend_fake_sections _bfd_mips_elf_fake_sections -#define elf_backend_section_from_bfd_section \ - _bfd_mips_elf_section_from_bfd_section -#define elf_backend_add_symbol_hook _bfd_mips_elf_add_symbol_hook -#define elf_backend_link_output_symbol_hook \ - _bfd_mips_elf_link_output_symbol_hook -#define elf_backend_create_dynamic_sections \ - _bfd_mips_elf_create_dynamic_sections -#define elf_backend_check_relocs _bfd_mips_elf_check_relocs -#define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol -#define elf_backend_always_size_sections \ - _bfd_mips_elf_always_size_sections -#define elf_backend_size_dynamic_sections \ - _bfd_mips_elf_size_dynamic_sections -#define elf_backend_relocate_section _bfd_mips_elf_relocate_section -#define elf_backend_finish_dynamic_symbol \ - _bfd_mips_elf_finish_dynamic_symbol -#define elf_backend_finish_dynamic_sections \ - _bfd_mips_elf_finish_dynamic_sections -#define elf_backend_final_write_processing \ - _bfd_mips_elf_final_write_processing -#define elf_backend_additional_program_headers \ - _bfd_mips_elf_additional_program_headers -#define elf_backend_modify_segment_map _bfd_mips_elf_modify_segment_map -#define elf_backend_gc_mark_hook _bfd_mips_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook _bfd_mips_elf_gc_sweep_hook -#define elf_backend_copy_indirect_symbol \ - _bfd_mips_elf_copy_indirect_symbol -#define elf_backend_hide_symbol _bfd_mips_elf_hide_symbol -#define elf_backend_grok_prstatus _bfd_elf32_mips_grok_prstatus -#define elf_backend_grok_psinfo _bfd_elf32_mips_grok_psinfo -#define elf_backend_ecoff_debug_swap &mips_elf32_ecoff_debug_swap - -#define elf_backend_got_header_size (4 * MIPS_RESERVED_GOTNO) -#define elf_backend_plt_header_size 0 -#define elf_backend_may_use_rel_p 1 -#define elf_backend_may_use_rela_p 0 -#define elf_backend_default_use_rela_p 0 -#define elf_backend_sign_extend_vma true - -#define elf_backend_discard_info _bfd_elf32_mips_discard_info -#define elf_backend_ignore_discarded_relocs \ - _bfd_elf32_mips_ignore_discarded_relocs -#define elf_backend_write_section _bfd_elf32_mips_write_section - -#define bfd_elf32_bfd_is_local_label_name \ - mips_elf_is_local_label_name -#define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line -#define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents -#define bfd_elf32_bfd_link_hash_table_create \ - _bfd_mips_elf_link_hash_table_create -#define bfd_elf32_bfd_final_link _bfd_mips_elf_final_link -#define bfd_elf32_bfd_merge_private_bfd_data \ - _bfd_mips_elf_merge_private_bfd_data -#define bfd_elf32_bfd_set_private_flags _bfd_mips_elf_set_private_flags -#define bfd_elf32_bfd_print_private_bfd_data \ - _bfd_mips_elf_print_private_bfd_data - -/* Support for SGI-ish mips targets. */ -#define TARGET_LITTLE_SYM bfd_elf32_littlemips_vec -#define TARGET_LITTLE_NAME "elf32-littlemips" -#define TARGET_BIG_SYM bfd_elf32_bigmips_vec -#define TARGET_BIG_NAME "elf32-bigmips" - -#include "elf32-target.h" - -/* Support for traditional mips targets. */ -#define INCLUDED_TARGET_FILE /* More a type of flag. */ - -#undef TARGET_LITTLE_SYM -#undef TARGET_LITTLE_NAME -#undef TARGET_BIG_SYM -#undef TARGET_BIG_NAME - -#define TARGET_LITTLE_SYM bfd_elf32_tradlittlemips_vec -#define TARGET_LITTLE_NAME "elf32-tradlittlemips" -#define TARGET_BIG_SYM bfd_elf32_tradbigmips_vec -#define TARGET_BIG_NAME "elf32-tradbigmips" - -/* Include the target file again for this target */ -#include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-s390.c b/contrib/binutils/bfd/elf32-s390.c deleted file mode 100644 index ed5f3f0d127e..000000000000 --- a/contrib/binutils/bfd/elf32-s390.c +++ /dev/null @@ -1,2476 +0,0 @@ -/* IBM S/390-specific support for 32-bit ELF - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. - Contributed by Carl B. Pedersen and Martin Schwidefsky. - - 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. */ - -#include "bfd.h" -#include "sysdep.h" -#include "bfdlink.h" -#include "libbfd.h" -#include "elf-bfd.h" - -static reloc_howto_type *elf_s390_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static void elf_s390_info_to_howto - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); -static boolean elf_s390_is_local_label_name - PARAMS ((bfd *, const char *)); -static struct bfd_hash_entry *link_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static struct bfd_link_hash_table *elf_s390_link_hash_table_create - PARAMS ((bfd *)); -static boolean create_got_section - PARAMS((bfd *, struct bfd_link_info *)); -static boolean elf_s390_create_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); -static void elf_s390_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); -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 allocate_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean readonly_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean elf_s390_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean elf_s390_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static boolean elf_s390_finish_dynamic_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); -static enum elf_reloc_type_class elf_s390_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); -static boolean elf_s390_finish_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean elf_s390_object_p PARAMS ((bfd *)); -static boolean elf_s390_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *)); - -#define USE_RELA 1 /* We want RELA relocations, not REL. */ - -#include "elf/s390.h" - -/* The relocation "howto" table. */ - -static reloc_howto_type elf_howto_table[] = -{ - HOWTO (R_390_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_390_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO(R_390_8, 0, 0, 8, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_8", false, 0,0x000000ff, false), - HOWTO(R_390_12, 0, 1, 12, false, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_12", false, 0,0x00000fff, false), - HOWTO(R_390_16, 0, 1, 16, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_16", false, 0,0x0000ffff, false), - HOWTO(R_390_32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_32", false, 0,0xffffffff, false), - HOWTO(R_390_PC32, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32", false, 0,0xffffffff, true), - HOWTO(R_390_GOT12, 0, 1, 12, false, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_GOT12", false, 0,0x00000fff, false), - HOWTO(R_390_GOT32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT32", false, 0,0xffffffff, false), - HOWTO(R_390_PLT32, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32", false, 0,0xffffffff, true), - HOWTO(R_390_COPY, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_COPY", false, 0,0xffffffff, false), - HOWTO(R_390_GLOB_DAT, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GLOB_DAT",false, 0,0xffffffff, false), - HOWTO(R_390_JMP_SLOT, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_JMP_SLOT",false, 0,0xffffffff, false), - HOWTO(R_390_RELATIVE, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_RELATIVE",false, 0,0xffffffff, false), - HOWTO(R_390_GOTOFF, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTOFF", false, 0,0xffffffff, false), - HOWTO(R_390_GOTPC, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPC", false, 0,0xffffffff, true), - HOWTO(R_390_GOT16, 0, 1, 16, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT16", false, 0,0x0000ffff, false), - HOWTO(R_390_PC16, 0, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16", false, 0,0x0000ffff, true), - HOWTO(R_390_PC16DBL, 1, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16DBL", false, 0,0x0000ffff, true), - HOWTO(R_390_PLT16DBL, 1, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT16DBL", false, 0,0x0000ffff, true), - HOWTO(R_390_PC32DBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32DBL", false, 0,0xffffffff, true), - HOWTO(R_390_PLT32DBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32DBL", false, 0,0xffffffff, true), - HOWTO(R_390_GOTPCDBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPCDBL", false, 0,0xffffffff, true), - HOWTO(R_390_GOTENT, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTENT", false, 0,0xffffffff, true), -}; - -/* GNU extension to record C++ vtable hierarchy. */ -static reloc_howto_type elf32_s390_vtinherit_howto = - HOWTO (R_390_GNU_VTINHERIT, 0,2,0,false,0,complain_overflow_dont, NULL, "R_390_GNU_VTINHERIT", false,0, 0, false); -static reloc_howto_type elf32_s390_vtentry_howto = - HOWTO (R_390_GNU_VTENTRY, 0,2,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) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; -{ - switch (code) - { - case BFD_RELOC_NONE: - return &elf_howto_table[(int) R_390_NONE]; - case BFD_RELOC_8: - return &elf_howto_table[(int) R_390_8]; - case BFD_RELOC_390_12: - return &elf_howto_table[(int) R_390_12]; - case BFD_RELOC_16: - return &elf_howto_table[(int) R_390_16]; - case BFD_RELOC_32: - return &elf_howto_table[(int) R_390_32]; - case BFD_RELOC_CTOR: - return &elf_howto_table[(int) R_390_32]; - case BFD_RELOC_32_PCREL: - return &elf_howto_table[(int) R_390_PC32]; - case BFD_RELOC_390_GOT12: - return &elf_howto_table[(int) R_390_GOT12]; - case BFD_RELOC_32_GOT_PCREL: - return &elf_howto_table[(int) R_390_GOT32]; - case BFD_RELOC_390_PLT32: - return &elf_howto_table[(int) R_390_PLT32]; - case BFD_RELOC_390_COPY: - return &elf_howto_table[(int) R_390_COPY]; - case BFD_RELOC_390_GLOB_DAT: - return &elf_howto_table[(int) R_390_GLOB_DAT]; - case BFD_RELOC_390_JMP_SLOT: - return &elf_howto_table[(int) R_390_JMP_SLOT]; - case BFD_RELOC_390_RELATIVE: - return &elf_howto_table[(int) R_390_RELATIVE]; - case BFD_RELOC_32_GOTOFF: - return &elf_howto_table[(int) R_390_GOTOFF]; - case BFD_RELOC_390_GOTPC: - return &elf_howto_table[(int) R_390_GOTPC]; - case BFD_RELOC_390_GOT16: - return &elf_howto_table[(int) R_390_GOT16]; - case BFD_RELOC_16_PCREL: - return &elf_howto_table[(int) R_390_PC16]; - case BFD_RELOC_390_PC16DBL: - return &elf_howto_table[(int) R_390_PC16DBL]; - case BFD_RELOC_390_PLT16DBL: - return &elf_howto_table[(int) R_390_PLT16DBL]; - case BFD_RELOC_390_PC32DBL: - return &elf_howto_table[(int) R_390_PC32DBL]; - case BFD_RELOC_390_PLT32DBL: - return &elf_howto_table[(int) R_390_PLT32DBL]; - case BFD_RELOC_390_GOTPCDBL: - return &elf_howto_table[(int) R_390_GOTPCDBL]; - case BFD_RELOC_390_GOTENT: - return &elf_howto_table[(int) R_390_GOTENT]; - case BFD_RELOC_VTABLE_INHERIT: - return &elf32_s390_vtinherit_howto; - case BFD_RELOC_VTABLE_ENTRY: - return &elf32_s390_vtentry_howto; - default: - break; - } - return 0; -} - -/* We need to use ELF32_R_TYPE so we have our own copy of this function, - and elf32-s390.c has its own copy. */ - -static void -elf_s390_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr; - Elf_Internal_Rela *dst; -{ - switch (ELF32_R_TYPE(dst->r_info)) - { - case R_390_GNU_VTINHERIT: - cache_ptr->howto = &elf32_s390_vtinherit_howto; - break; - - case R_390_GNU_VTENTRY: - cache_ptr->howto = &elf32_s390_vtentry_howto; - break; - - default: - BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_390_max); - cache_ptr->howto = &elf_howto_table[ELF32_R_TYPE(dst->r_info)]; - } -} - -static boolean -elf_s390_is_local_label_name (abfd, name) - bfd *abfd; - const char *name; -{ - if (name[0] == '.' && (name[1] == 'X' || name[1] == 'L')) - return true; - - return _bfd_elf_is_local_label_name (abfd, name); -} - -/* Functions for the 390 ELF linker. */ - -/* 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 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 GOT_ENTRY_SIZE 4 - -/* The first three entries in a procedure linkage table are reserved, - and the initial contents are unimportant (we zero them out). - Subsequent entries look like this. See the SVR4 ABI 386 - supplement to see how this works. */ - -/* For the s390, simple addr offset can only be 0 - 4096. - To use the full 2 GB address space, several instructions - 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!!! */ - -/* The first 3 words in the GOT are then reserved. - Word 0 is the address of the dynamic table. - Word 1 is a pointer to a structure describing the object - Word 2 is used to point to the loader entry address. - - The code for position independand PLT entries looks like this: - - r12 holds addr of the current GOT at entry to the PLT - - 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 - - The loader must then find the module where the function is - and insert the address in the GOT. - - Note: 390 can only address +- 64 K relative. - We check if offset > 65536, then make a relative branch -64xxx - back to a previous defined branch - -PLT1: BASR 1,0 # 2 bytes - L 1,22(1) # 4 bytes Load offset in GOT in r 1 - L 1,(1,12) # 4 bytes Load address from GOT in r1 - BCR 15,1 # 2 bytes Jump to address -RET1: BASR 1,0 # 2 bytes Return from GOT 1st time - L 1,14(1) # 4 bytes Load offset in symol table in r1 - BRC 15,-x # 4 bytes Jump to start of PLT - .word 0 # 2 bytes filler - .long ? # 4 bytes offset in GOT - .long ? # 4 bytes offset into symbol table - - This was the general case. There are two additional, optimizes PLT - definitions. One for GOT offsets < 4096 and one for GOT offsets < 32768. - First the one for GOT offsets < 4096: - -PLT1: L 1,<offset>(12) # 4 bytes Load address from GOT in R1 - BCR 15,1 # 2 bytes Jump to address - .word 0,0,0 # 6 bytes filler -RET1: BASR 1,0 # 2 bytes Return from GOT 1st time - L 1,14(1) # 4 bytes Load offset in symbol table in r1 - BRC 15,-x # 4 bytes Jump to start of PLT - .word 0,0,0 # 6 bytes filler - .long ? # 4 bytes offset into symbol table - - Second the one for GOT offsets < 32768: - -PLT1: LHI 1,<offset> # 4 bytes Load offset in GOT to r1 - L 1,(1,12) # 4 bytes Load address from GOT to r1 - BCR 15,1 # 2 bytes Jump to address - .word 0 # 2 bytes filler -RET1: BASR 1,0 # 2 bytes Return from GOT 1st time - L 1,14(1) # 4 bytes Load offset in symbol table in r1 - BRC 15,-x # 4 bytes Jump to start of PLT - .word 0,0,0 # 6 bytes filler - .long ? # 4 bytes offset into symbol table - -Total = 32 bytes per PLT entry - - The code for static build PLT entries looks like this: - -PLT1: BASR 1,0 # 2 bytes - L 1,22(1) # 4 bytes Load address of GOT entry - L 1,0(0,1) # 4 bytes Load address from GOT in r1 - BCR 15,1 # 2 bytes Jump to address -RET1: BASR 1,0 # 2 bytes Return from GOT 1st time - L 1,14(1) # 4 bytes Load offset in symbol table in r1 - BRC 15,-x # 4 bytes Jump to start of PLT - .word 0 # 2 bytes filler - .long ? # 4 bytes address of GOT entry - .long ? # 4 bytes offset into symbol table */ - -#define PLT_PIC_ENTRY_WORD0 0x0d105810 -#define PLT_PIC_ENTRY_WORD1 0x10165811 -#define PLT_PIC_ENTRY_WORD2 0xc00007f1 -#define PLT_PIC_ENTRY_WORD3 0x0d105810 -#define PLT_PIC_ENTRY_WORD4 0x100ea7f4 - -#define PLT_PIC12_ENTRY_WORD0 0x5810c000 -#define PLT_PIC12_ENTRY_WORD1 0x07f10000 -#define PLT_PIC12_ENTRY_WORD2 0x00000000 -#define PLT_PIC12_ENTRY_WORD3 0x0d105810 -#define PLT_PIC12_ENTRY_WORD4 0x100ea7f4 - -#define PLT_PIC16_ENTRY_WORD0 0xa7180000 -#define PLT_PIC16_ENTRY_WORD1 0x5811c000 -#define PLT_PIC16_ENTRY_WORD2 0x07f10000 -#define PLT_PIC16_ENTRY_WORD3 0x0d105810 -#define PLT_PIC16_ENTRY_WORD4 0x100ea7f4 - -#define PLT_ENTRY_WORD0 0x0d105810 -#define PLT_ENTRY_WORD1 0x10165810 -#define PLT_ENTRY_WORD2 0x100007f1 -#define PLT_ENTRY_WORD3 0x0d105810 -#define PLT_ENTRY_WORD4 0x100ea7f4 - -/* The first PLT entry pushes the offset into the symbol table - from R1 onto the stack at 8(15) and the loader object info - at 12(15), loads the loader address in R1 and jumps to it. */ - -/* The first entry in the PLT for PIC code: - -PLT0: - ST 1,28(15) # R1 has offset into symbol table - L 1,4(12) # Get loader ino(object struct address) - ST 1,24(15) # Store address - L 1,8(12) # Entry address of loader in R1 - BR 1 # Jump to loader - - The first entry in the PLT for static code: - -PLT0: - ST 1,28(15) # R1 has offset into symbol table - BASR 1,0 - L 1,18(0,1) # Get address of GOT - MVC 24(4,15),4(1) # Move loader ino to stack - L 1,8(1) # Get address of loader - BR 1 # Jump to loader - .word 0 # filler - .long got # address of GOT */ - -#define PLT_PIC_FIRST_ENTRY_WORD0 0x5010f01c -#define PLT_PIC_FIRST_ENTRY_WORD1 0x5810c004 -#define PLT_PIC_FIRST_ENTRY_WORD2 0x5010f018 -#define PLT_PIC_FIRST_ENTRY_WORD3 0x5810c008 -#define PLT_PIC_FIRST_ENTRY_WORD4 0x07f10000 - -#define PLT_FIRST_ENTRY_WORD0 0x5010f01c -#define PLT_FIRST_ENTRY_WORD1 0x0d105810 -#define PLT_FIRST_ENTRY_WORD2 0x1012D203 -#define PLT_FIRST_ENTRY_WORD3 0xf0181004 -#define PLT_FIRST_ENTRY_WORD4 0x58101008 -#define PLT_FIRST_ENTRY_WORD5 0x07f10000 - -/* The s390 linker needs to keep track of the number of relocs that it - decides to copy as dynamic relocs in check_relocs for each symbol. - This is so that it can later discard them if they are found to be - unnecessary. We store the information in a field extending the - regular ELF linker hash table. */ - -struct elf_s390_dyn_relocs -{ - struct elf_s390_dyn_relocs *next; - - /* The input section of the reloc. */ - asection *sec; - - /* Total number of relocs copied for the input section. */ - bfd_size_type count; - - /* Number of pc-relative relocs copied for the input section. */ - bfd_size_type pc_count; -}; - -/* s390 ELF linker hash entry. */ - -struct elf_s390_link_hash_entry -{ - struct elf_link_hash_entry elf; - - /* Track dynamic relocs copied for this symbol. */ - struct elf_s390_dyn_relocs *dyn_relocs; -}; - -/* s390 ELF linker hash table. */ - -struct elf_s390_link_hash_table -{ - struct elf_link_hash_table elf; - - /* Short-cuts to get to dynamic linker sections. */ - asection *sgot; - asection *sgotplt; - asection *srelgot; - asection *splt; - asection *srelplt; - asection *sdynbss; - asection *srelbss; - - /* Small local sym to section mapping cache. */ - struct sym_sec_cache sym_sec; -}; - -/* Get the s390 ELF linker hash table from a link_info structure. */ - -#define elf_s390_hash_table(p) \ - ((struct elf_s390_link_hash_table *) ((p)->hash)) - -/* Create an entry in an s390 ELF linker hash table. */ - -static struct bfd_hash_entry * -link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; -{ - /* Allocate the structure if it has not already been allocated by a - subclass. */ - if (entry == NULL) - { - entry = bfd_hash_allocate (table, - sizeof (struct elf_s390_link_hash_entry)); - if (entry == NULL) - return entry; - } - - /* Call the allocation method of the superclass. */ - entry = _bfd_elf_link_hash_newfunc (entry, table, string); - if (entry != NULL) - { - struct elf_s390_link_hash_entry *eh; - - eh = (struct elf_s390_link_hash_entry *) entry; - eh->dyn_relocs = NULL; - } - - return entry; -} - -/* Create an s390 ELF linker hash table. */ - -static struct bfd_link_hash_table * -elf_s390_link_hash_table_create (abfd) - bfd *abfd; -{ - struct elf_s390_link_hash_table *ret; - bfd_size_type amt = sizeof (struct elf_s390_link_hash_table); - - ret = (struct elf_s390_link_hash_table *) bfd_alloc (abfd, amt); - if (ret == NULL) - return NULL; - - if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc)) - { - bfd_release (abfd, ret); - return NULL; - } - - ret->sgot = NULL; - ret->sgotplt = NULL; - ret->srelgot = NULL; - ret->splt = NULL; - ret->srelplt = NULL; - ret->sdynbss = NULL; - ret->srelbss = NULL; - ret->sym_sec.abfd = NULL; - - return &ret->elf.root; -} - -/* Create .got, .gotplt, and .rela.got sections in DYNOBJ, and set up - shortcuts to them in our hash table. */ - -static boolean -create_got_section (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; -{ - struct elf_s390_link_hash_table *htab; - - if (! _bfd_elf_create_got_section (dynobj, info)) - return false; - - htab = elf_s390_hash_table (info); - htab->sgot = bfd_get_section_by_name (dynobj, ".got"); - htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); - if (!htab->sgot || !htab->sgotplt) - abort (); - - htab->srelgot = bfd_make_section (dynobj, ".rela.got"); - if (htab->srelgot == NULL - || ! bfd_set_section_flags (dynobj, htab->srelgot, - (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) - return false; - return true; -} - -/* Create .plt, .rela.plt, .got, .got.plt, .rela.got, .dynbss, and - .rela.bss sections in DYNOBJ, and set up shortcuts to them in our - hash table. */ - -static boolean -elf_s390_create_dynamic_sections (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; -{ - struct elf_s390_link_hash_table *htab; - - htab = elf_s390_hash_table (info); - if (!htab->sgot && !create_got_section (dynobj, info)) - return false; - - if (!_bfd_elf_create_dynamic_sections (dynobj, info)) - return false; - - htab->splt = bfd_get_section_by_name (dynobj, ".plt"); - htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); - htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); - if (!info->shared) - htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss"); - - if (!htab->splt || !htab->srelplt || !htab->sdynbss - || (!info->shared && !htab->srelbss)) - abort (); - - return true; -} - -/* Copy the extra info we tack onto an elf_link_hash_entry. */ - -static void -elf_s390_copy_indirect_symbol (dir, ind) - struct elf_link_hash_entry *dir, *ind; -{ - struct elf_s390_link_hash_entry *edir, *eind; - - edir = (struct elf_s390_link_hash_entry *) dir; - eind = (struct elf_s390_link_hash_entry *) ind; - - if (eind->dyn_relocs != NULL) - { - if (edir->dyn_relocs != NULL) - { - struct elf_s390_dyn_relocs **pp; - struct elf_s390_dyn_relocs *p; - - if (ind->root.type == bfd_link_hash_indirect) - abort (); - - /* Add reloc counts against the weak sym to the strong sym - list. Merge any entries against the same section. */ - for (pp = &eind->dyn_relocs; (p = *pp) != NULL; ) - { - struct elf_s390_dyn_relocs *q; - - for (q = edir->dyn_relocs; q != NULL; q = q->next) - if (q->sec == p->sec) - { - q->pc_count += p->pc_count; - q->count += p->count; - *pp = p->next; - break; - } - if (q == NULL) - pp = &p->next; - } - *pp = edir->dyn_relocs; - } - - edir->dyn_relocs = eind->dyn_relocs; - eind->dyn_relocs = NULL; - } - - _bfd_elf_link_hash_copy_indirect (dir, ind); -} - -/* 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 -elf_s390_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; -{ - struct elf_s390_link_hash_table *htab; - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - const Elf_Internal_Rela *rel; - const Elf_Internal_Rela *rel_end; - asection *sreloc; - - if (info->relocateable) - return true; - - htab = elf_s390_hash_table (info); - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (abfd); - - 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 = ELF32_R_SYM (rel->r_info); - - if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) - { - (*_bfd_error_handler) (_("%s: bad symbol index: %d"), - bfd_archive_filename (abfd), - r_symndx); - return false; - } - - if (r_symndx < symtab_hdr->sh_info) - h = NULL; - else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOTENT: - /* This symbol requires a global offset table entry. */ - if (h != NULL) - { - h->got.refcount += 1; - } - else - { - bfd_signed_vma *local_got_refcounts; - - /* This is a global offset table entry for a local symbol. */ - local_got_refcounts = elf_local_got_refcounts (abfd); - if (local_got_refcounts == NULL) - { - bfd_size_type size; - - size = symtab_hdr->sh_info; - size *= sizeof (bfd_signed_vma); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); - if (local_got_refcounts == NULL) - return false; - elf_local_got_refcounts (abfd) = local_got_refcounts; - } - local_got_refcounts[r_symndx] += 1; - } - /* Fall through */ - - case R_390_GOTOFF: - case R_390_GOTPC: - case R_390_GOTPCDBL: - if (htab->sgot == NULL) - { - if (htab->elf.dynobj == NULL) - htab->elf.dynobj = abfd; - if (!create_got_section (htab->elf.dynobj, info)) - return false; - } - break; - - case R_390_PLT16DBL: - case R_390_PLT32DBL: - case R_390_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 - never referenced by a dynamic object, in which case we - don't need to generate a procedure linkage table entry - after all. */ - - /* If this is a local symbol, we resolve it directly without - creating a procedure linkage table entry. */ - if (h == NULL) - continue; - - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - h->plt.refcount += 1; - break; - - case R_390_8: - case R_390_16: - case R_390_32: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32DBL: - case R_390_PC32: - if (h != NULL && !info->shared) - { - /* If this reloc is in a read-only section, we might - need a copy reloc. We can't check reliably at this - stage whether the section is read-only, as input - sections have not yet been mapped to output sections. - Tentatively set the flag for now, and correct in - adjust_dynamic_symbol. */ - h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; - - /* We may need a .plt entry if the function this reloc - refers to is in a shared lib. */ - h->plt.refcount += 1; - } - - /* If we are creating a shared library, and this is a reloc - against a global symbol, or a non PC relative reloc - against a local symbol, then we need to copy the reloc - into the shared library. However, if we are linking with - -Bsymbolic, we do not need to copy a reloc against a - global symbol which is defined in an object we are - including in the link (i.e., DEF_REGULAR is set). At - this point we have not seen all the input files, so it is - possible that DEF_REGULAR is not set now but will be set - later (it is never cleared). In case of a weak definition, - DEF_REGULAR may be cleared later by a strong definition in - a shared library. We account for that possibility below by - storing information in the relocs_copied field of the hash - table entry. A similar situation occurs when creating - shared libraries and symbol visibility changes render the - symbol local. - - If on the other hand, we are creating an executable, we - may need to keep relocations for symbols satisfied by a - dynamic library if we manage to avoid copy relocs for the - symbol. */ - if ((info->shared - && (sec->flags & SEC_ALLOC) != 0 - && ((ELF32_R_TYPE (rel->r_info) != R_390_PC16 - && ELF32_R_TYPE (rel->r_info) != R_390_PC16DBL - && ELF32_R_TYPE (rel->r_info) != R_390_PC32DBL - && ELF32_R_TYPE (rel->r_info) != R_390_PC32) - || (h != NULL - && (! info->symbolic - || h->root.type == bfd_link_hash_defweak - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared - && (sec->flags & SEC_ALLOC) != 0 - && h != NULL - && (h->root.type == bfd_link_hash_defweak - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0))) - { - struct elf_s390_dyn_relocs *p; - struct elf_s390_dyn_relocs **head; - - /* We must copy these reloc types into the output file. - Create a reloc section in dynobj and make room for - this reloc. */ - if (sreloc == NULL) - { - const char *name; - bfd *dynobj; - - 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; - - if (strncmp (name, ".rela", 5) != 0 - || strcmp (bfd_get_section_name (abfd, sec), - name + 5) != 0) - { - (*_bfd_error_handler) - (_("%s: bad relocation section name `%s\'"), - bfd_archive_filename (abfd), name); - } - - if (htab->elf.dynobj == NULL) - htab->elf.dynobj = abfd; - - dynobj = htab->elf.dynobj; - 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; - } - elf_section_data (sec)->sreloc = sreloc; - } - - /* If this is a global symbol, we count the number of - relocations we need for this symbol. */ - if (h != NULL) - { - head = &((struct elf_s390_link_hash_entry *) h)->dyn_relocs; - } - else - { - /* Track dynamic relocs needed for local syms too. - We really need local syms available to do this - easily. Oh well. */ - - asection *s; - s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, - sec, r_symndx); - if (s == NULL) - return false; - - head = ((struct elf_s390_dyn_relocs **) - &elf_section_data (s)->local_dynrel); - } - - p = *head; - if (p == NULL || p->sec != sec) - { - bfd_size_type amt = sizeof *p; - p = ((struct elf_s390_dyn_relocs *) - bfd_alloc (htab->elf.dynobj, amt)); - if (p == NULL) - return false; - p->next = *head; - *head = p; - p->sec = sec; - p->count = 0; - p->pc_count = 0; - } - - p->count += 1; - if (ELF32_R_TYPE (rel->r_info) == R_390_PC16 - || ELF32_R_TYPE (rel->r_info) == R_390_PC16DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32) - p->pc_count += 1; - } - break; - - /* This relocation describes the C++ object vtable hierarchy. - Reconstruct it for later use during GC. */ - case R_390_GNU_VTINHERIT: - if (!_bfd_elf32_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_390_GNU_VTENTRY: - if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return false; - break; - - default: - break; - } - } - - return true; -} - -/* Return the section that should be marked against GC for a given - relocation. */ - -static asection * -elf_s390_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 (ELF32_R_TYPE (rel->r_info)) - { - case R_390_GNU_VTINHERIT: - case R_390_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 - { - 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 -elf_s390_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - 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; - - elf_section_data (sec)->local_dynrel = NULL; - - 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 (ELF32_R_TYPE (rel->r_info)) - { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOTOFF: - case R_390_GOTPC: - case R_390_GOTPCDBL: - case R_390_GOTENT: - r_symndx = ELF32_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 -= 1; - } - else if (local_got_refcounts != NULL) - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx] -= 1; - } - break; - - case R_390_8: - case R_390_12: - case R_390_16: - case R_390_32: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32DBL: - case R_390_PC32: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs **pp; - struct elf_s390_dyn_relocs *p; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - - if (!info->shared && h->plt.refcount > 0) - h->plt.refcount -= 1; - - eh = (struct elf_s390_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - if (ELF32_R_TYPE (rel->r_info) == R_390_PC16 - || ELF32_R_TYPE (rel->r_info) == R_390_PC16DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; - - case R_390_PLT16DBL: - case R_390_PLT32DBL: - case R_390_PLT32: - r_symndx = ELF32_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 -= 1; - } - 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 -elf_s390_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; -{ - struct elf_s390_link_hash_table *htab; - struct elf_s390_link_hash_entry * eh; - struct elf_s390_dyn_relocs *p; - asection *s; - unsigned int power_of_two; - - /* If this is a function, put it in the procedure linkage table. We - will fill in the contents of the procedure linkage table later - (although we could actually do it here). */ - if (h->type == STT_FUNC - || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) - { - if (h->plt.refcount <= 0 - || (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0 - && h->root.type != bfd_link_hash_undefweak - && h->root.type != bfd_link_hash_undefined)) - { - /* This case can occur if we saw a PLT32 reloc in an input - file, but the symbol was never referred to by a dynamic - object, or if all references were garbage collected. In - such a case, we don't actually need to build a procedure - linkage table, and we can just do a PC32 reloc instead. */ - h->plt.offset = (bfd_vma) -1; - h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - } - - return true; - } - else - /* It's possible that we incorrectly decided a .plt reloc was - needed for an R_390_PC32 reloc to a non-function sym in - check_relocs. We can't decide accurately between function and - non-function syms in check-relocs; Objects loaded later in - the link may change h->type. So fix it now. */ - h->plt.offset = (bfd_vma) -1; - - /* 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; - - /* If there are no references to this symbol that do not use the - GOT, we don't need to generate a copy reloc. */ - if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0) - return true; - - /* If -z nocopyreloc was given, we won't generate them either. */ - if (info->nocopyreloc) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return true; - } - - eh = (struct elf_s390_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) - { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) - break; - } - - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - 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. */ - - htab = elf_s390_hash_table (info); - - /* We must generate a R_390_COPY reloc to tell the dynamic linker to - copy the initial value out of the dynamic object and into the - runtime process image. */ - if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) - { - htab->srelbss->_raw_size += sizeof (Elf32_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 > 3) - power_of_two = 3; - - /* Apply the required alignment. */ - s = htab->sdynbss; - s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.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; -} - -/* This is the condition under which elf_s390_finish_dynamic_symbol - will be called from elflink.h. If elflink.h doesn't call our - finish_dynamic_symbol routine, we'll need to do something about - initializing any .plt and .got entries in elf_s390_relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ - ((DYN) \ - && ((INFO)->shared \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ - && ((H)->dynindx != -1 \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) - -/* Allocate space in .plt, .got and associated reloc sections for - dynamic relocs. */ - -static boolean -allocate_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; -{ - struct bfd_link_info *info; - struct elf_s390_link_hash_table *htab; - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs *p; - - if (h->root.type == bfd_link_hash_indirect) - return true; - - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - info = (struct bfd_link_info *) inf; - htab = elf_s390_hash_table (info); - - if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0) - { - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) - { - asection *s = htab->splt; - - /* If this is the first .plt entry, make room for the special - first entry. */ - if (s->_raw_size == 0) - s->_raw_size += PLT_FIRST_ENTRY_SIZE; - - h->plt.offset = s->_raw_size; - - /* 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 = s; - h->root.u.def.value = h->plt.offset; - } - - /* Make room for this entry. */ - s->_raw_size += PLT_ENTRY_SIZE; - - /* We also need to make an entry in the .got.plt section, which - will be placed in the .got section by the linker script. */ - htab->sgotplt->_raw_size += GOT_ENTRY_SIZE; - - /* We also need to make an entry in the .rela.plt section. */ - htab->srelplt->_raw_size += sizeof (Elf32_External_Rela); - } - else - { - h->plt.offset = (bfd_vma) -1; - h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - } - } - else - { - h->plt.offset = (bfd_vma) -1; - h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - } - - if (h->got.refcount > 0) - { - asection *s; - boolean dyn; - - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - - s = htab->sgot; - h->got.offset = s->_raw_size; - s->_raw_size += GOT_ENTRY_SIZE; - dyn = htab->elf.dynamic_sections_created; - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) - htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); - } - else - h->got.offset = (bfd_vma) -1; - - eh = (struct elf_s390_link_hash_entry *) h; - if (eh->dyn_relocs == NULL) - return true; - - /* In the shared -Bsymbolic case, discard space allocated for - dynamic pc-relative relocs against symbols which turn out to be - defined in regular objects. For the normal shared case, discard - space for pc-relative relocs that have become local due to symbol - visibility changes. */ - - if (info->shared) - { - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || info->symbolic)) - { - struct elf_s390_dyn_relocs **pp; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) - { - p->count -= p->pc_count; - p->pc_count = 0; - if (p->count == 0) - *pp = p->next; - else - pp = &p->next; - } - } - } - else - { - /* For the non-shared case, discard space for relocs against - symbols which turn out to need copy relocs or are not - dynamic. */ - - if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 - && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - || (htab->elf.dynamic_sections_created - && (h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined)))) - { - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - - /* If that succeeded, we know we'll be keeping all the - relocs. */ - if (h->dynindx != -1) - goto keep; - } - - eh->dyn_relocs = NULL; - - keep: ; - } - - /* Finally, allocate space. */ - for (p = eh->dyn_relocs; p != NULL; p = p->next) - { - asection *sreloc = elf_section_data (p->sec)->sreloc; - sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela); - } - - return true; -} - -/* Find any dynamic relocs that apply to read-only sections. */ - -static boolean -readonly_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; -{ - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs *p; - - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - eh = (struct elf_s390_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) - { - asection *s = p->sec->output_section; - - if (s != NULL && (s->flags & SEC_READONLY) != 0) - { - struct bfd_link_info *info = (struct bfd_link_info *) inf; - - info->flags |= DF_TEXTREL; - - /* Not an error, just cut short the traversal. */ - return false; - } - } - return true; -} - -/* Set the sizes of the dynamic sections. */ - -static boolean -elf_s390_size_dynamic_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; -{ - struct elf_s390_link_hash_table *htab; - bfd *dynobj; - asection *s; - boolean relocs; - bfd *ibfd; - - htab = elf_s390_hash_table (info); - dynobj = htab->elf.dynobj; - if (dynobj == NULL) - abort (); - - if (htab->elf.dynamic_sections_created) - { - /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) - { - s = bfd_get_section_by_name (dynobj, ".interp"); - if (s == NULL) - abort (); - s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER; - s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; - } - } - - /* Set up .got offsets for local syms, and space for local dynamic - relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) - { - bfd_signed_vma *local_got; - bfd_signed_vma *end_local_got; - bfd_size_type locsymcount; - Elf_Internal_Shdr *symtab_hdr; - asection *srela; - - if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) - continue; - - for (s = ibfd->sections; s != NULL; s = s->next) - { - struct elf_s390_dyn_relocs *p; - - for (p = *((struct elf_s390_dyn_relocs **) - &elf_section_data (s)->local_dynrel); - p != NULL; - p = p->next) - { - if (!bfd_is_abs_section (p->sec) - && bfd_is_abs_section (p->sec->output_section)) - { - /* Input section has been discarded, either because - it is a copy of a linkonce section or due to - linker script /DISCARD/, so we'll be discarding - the relocs too. */ - } - else if (p->count != 0) - { - srela = elf_section_data (p->sec)->sreloc; - srela->_raw_size += p->count * sizeof (Elf32_External_Rela); - if ((p->sec->output_section->flags & SEC_READONLY) != 0) - info->flags |= DF_TEXTREL; - } - } - } - - local_got = elf_local_got_refcounts (ibfd); - if (!local_got) - continue; - - symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; - locsymcount = symtab_hdr->sh_info; - end_local_got = local_got + locsymcount; - s = htab->sgot; - srela = htab->srelgot; - for (; local_got < end_local_got; ++local_got) - { - if (*local_got > 0) - { - *local_got = s->_raw_size; - s->_raw_size += GOT_ENTRY_SIZE; - if (info->shared) - srela->_raw_size += sizeof (Elf32_External_Rela); - } - else - *local_got = (bfd_vma) -1; - } - } - - /* Allocate global sym .plt and .got entries, and space for global - sym dynamic relocs. */ - elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); - - /* We now have determined the sizes of the various dynamic sections. - Allocate memory for them. */ - relocs = false; - for (s = dynobj->sections; s != NULL; s = s->next) - { - if ((s->flags & SEC_LINKER_CREATED) == 0) - continue; - - if (s == htab->splt - || s == htab->sgot - || s == htab->sgotplt) - { - /* Strip this section if we don't need it; see the - comment below. */ - } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) - { - if (s->_raw_size != 0 && s != htab->srelplt) - relocs = 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 - { - /* It's not one of our sections, so don't allocate space. */ - continue; - } - - if (s->_raw_size == 0) - { - /* If we don't need this section, strip it from the - output file. This is to handle .rela.bss and - .rela.plt. We must create it in - create_dynamic_sections, because it 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. */ - - _bfd_strip_section_from_output (info, s); - continue; - } - - /* Allocate memory for the section contents. We use bfd_zalloc - here in case unused entries are not reclaimed before the - section's contents are written out. This should not happen, - but this way if it does, we get a R_390_NONE reloc instead - of garbage. */ - s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); - if (s->contents == NULL) - return false; - } - - if (htab->elf.dynamic_sections_created) - { - /* Add some entries to the .dynamic section. We fill in the - values later, in elf_s390_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. */ -#define add_dynamic_entry(TAG, VAL) \ - bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) - - if (! info->shared) - { - if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; - } - - if (htab->splt->_raw_size != 0) - { - if (!add_dynamic_entry (DT_PLTGOT, 0) - || !add_dynamic_entry (DT_PLTRELSZ, 0) - || !add_dynamic_entry (DT_PLTREL, DT_RELA) - || !add_dynamic_entry (DT_JMPREL, 0)) - return false; - } - - if (relocs) - { - if (!add_dynamic_entry (DT_RELA, 0) - || !add_dynamic_entry (DT_RELASZ, 0) - || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) - return false; - - /* If any dynamic relocs apply to a read-only section, - then we need a DT_TEXTREL entry. */ - if ((info->flags & DF_TEXTREL) == 0) - elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, - (PTR) info); - - if ((info->flags & DF_TEXTREL) != 0) - { - if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; - } - } - } -#undef add_dynamic_entry - - return true; -} - -/* Relocate a 390 ELF section. */ - -static boolean -elf_s390_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; -{ - struct elf_s390_link_hash_table *htab; - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - bfd_vma *local_got_offsets; - Elf_Internal_Rela *rel; - Elf_Internal_Rela *relend; - - if (info->relocateable) - return true; - - htab = elf_s390_hash_table (info); - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (input_bfd); - local_got_offsets = elf_local_got_offsets (input_bfd); - - rel = relocs; - relend = relocs + input_section->reloc_count; - for (; rel < relend; rel++) - { - int r_type; - reloc_howto_type *howto; - unsigned long r_symndx; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; - asection *sec; - bfd_vma off; - bfd_vma relocation; - boolean unresolved_reloc; - bfd_reloc_status_type r; - - r_type = ELF32_R_TYPE (rel->r_info); - if (r_type == (int) R_390_GNU_VTINHERIT - || r_type == (int) R_390_GNU_VTENTRY) - continue; - if (r_type < 0 || r_type >= (int) R_390_max) - { - bfd_set_error (bfd_error_bad_value); - return false; - } - - howto = elf_howto_table + r_type; - r_symndx = ELF32_R_SYM (rel->r_info); - h = NULL; - sym = NULL; - sec = NULL; - unresolved_reloc = false; - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); - } - 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) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - if (sec->output_section == NULL) - { - /* Set a flag that will be cleared later if we find a - relocation value for this symbol. output_section - is typically NULL for symbols satisfied by a shared - library. */ - unresolved_reloc = true; - 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->allow_shlib_undefined) - && !info->no_undefined - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - 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 (r_type) - { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOTENT: - /* Relocation is to the entry for this symbol in the global - offset table. */ - if (htab->sgot == NULL) - abort (); - - if (h != NULL) - { - boolean dyn; - - off = h->got.offset; - dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) - || (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (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, or the symbol was forced to be local - because of a version file. We must initialize - this entry in the global offset table. Since the - offset must always be a multiple of 2, we use the - least significant bit to record whether we have - initialized it already. - - When doing a dynamic link, we create a .rel.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_32 (output_bfd, relocation, - htab->sgot->contents + off); - h->got.offset |= 1; - } - } - else - unresolved_reloc = false; - } - else - { - if (local_got_offsets == NULL) - abort (); - - 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 generated the necessary reloc. */ - if ((off & 1) != 0) - off &= ~1; - else - { - bfd_put_32 (output_bfd, relocation, - htab->sgot->contents + off); - - if (info->shared) - { - asection *srelgot; - Elf_Internal_Rela outrel; - Elf32_External_Rela *loc; - - srelgot = htab->srelgot; - if (srelgot == NULL) - abort (); - - outrel.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset - + off); - outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); - outrel.r_addend = relocation; - loc = (Elf32_External_Rela *) srelgot->contents; - loc += srelgot->reloc_count++; - bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); - } - - local_got_offsets[r_symndx] |= 1; - } - } - - if (off >= (bfd_vma) -2) - abort (); - - relocation = htab->sgot->output_offset + off; - - /* - * For @GOTENT the relocation is against the offset between - * the instruction and the symbols entry in the GOT and not - * between the start of the GOT and the symbols entry. We - * add the vma of the GOT to get the correct value. - */ - if (r_type == R_390_GOTENT) - relocation += htab->sgot->output_section->vma; - - break; - - case R_390_GOTOFF: - /* Relocation is relative to the start of the global offset - table. */ - - /* Note that sgot->output_offset is not involved in this - calculation. We always want the start of .got. If we - defined _GLOBAL_OFFSET_TABLE in a different way, as is - permitted by the ABI, we might have to change this - calculation. */ - relocation -= htab->sgot->output_section->vma; - break; - - case R_390_GOTPC: - case R_390_GOTPCDBL: - /* Use global offset table as symbol value. */ - relocation = htab->sgot->output_section->vma; - unresolved_reloc = false; - break; - - case R_390_PLT16DBL: - case R_390_PLT32DBL: - case R_390_PLT32: - /* Relocation is to the entry for this symbol in the - procedure linkage table. */ - - /* Resolve a PLT32 reloc against a local symbol directly, - without using the procedure linkage table. */ - if (h == NULL) - break; - - if (h->plt.offset == (bfd_vma) -1 - || htab->splt == NULL) - { - /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ - break; - } - - relocation = (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset); - unresolved_reloc = false; - break; - - case R_390_8: - case R_390_16: - case R_390_32: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32DBL: - case R_390_PC32: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) - break; - - if ((info->shared - && ((r_type != R_390_PC16 - && r_type != R_390_PC16DBL - && r_type != R_390_PC32DBL - && r_type != R_390_PC32) - || (h != NULL - && h->dynindx != -1 - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared - && h != NULL - && h->dynindx != -1 - && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 - && (((h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0) - || h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined))) - { - Elf_Internal_Rela outrel; - boolean skip, relocate; - asection *sreloc; - Elf32_External_Rela *loc; - - /* When generating a shared object, these relocations - are copied into the output file to be resolved at run - time. */ - - skip = false; - relocate = false; - - outrel.r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, - rel->r_offset); - if (outrel.r_offset == (bfd_vma) -1) - skip = true; - else if (outrel.r_offset == (bfd_vma) -2) - skip = true, relocate = true; - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); - - if (skip) - memset (&outrel, 0, sizeof outrel); - else if (h != NULL - && h->dynindx != -1 - && (r_type == R_390_PC16 - || r_type == R_390_PC16DBL - || r_type == R_390_PC32DBL - || r_type == R_390_PC32 - || !info->shared - || !info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) - { - outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); - outrel.r_addend = rel->r_addend; - } - else - { - /* This symbol is local, or marked to become local. */ - relocate = true; - outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); - outrel.r_addend = relocation + rel->r_addend; - } - - sreloc = elf_section_data (input_section)->sreloc; - if (sreloc == NULL) - abort (); - - loc = (Elf32_External_Rela *) sreloc->contents; - loc += sreloc->reloc_count++; - bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); - - /* If this reloc is against an external symbol, we do - not want to fiddle with the addend. Otherwise, we - need to include the symbol value so that it becomes - an addend for the dynamic reloc. */ - if (! relocate) - continue; - } - break; - - default: - break; - } - - if (unresolved_reloc - && !(info->shared - && (input_section->flags & SEC_DEBUGGING) != 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) - (*_bfd_error_handler) - (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), - bfd_archive_filename (input_bfd), - bfd_get_section_name (input_bfd, input_section), - (long) rel->r_offset, - h->root.root.string); - - r = _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, - relocation, rel->r_addend); - - if (r != bfd_reloc_ok) - { - const char *name; - - if (h != NULL) - 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) - return false; - if (*name == '\0') - name = bfd_section_name (input_bfd, sec); - } - - if (r == bfd_reloc_overflow) - { - - if (! ((*info->callbacks->reloc_overflow) - (info, name, howto->name, (bfd_vma) 0, - input_bfd, input_section, rel->r_offset))) - return false; - } - else - { - (*_bfd_error_handler) - (_("%s(%s+0x%lx): reloc against `%s': error %d"), - bfd_archive_filename (input_bfd), - bfd_get_section_name (input_bfd, input_section), - (long) rel->r_offset, name, (int) r); - return false; - } - } - } - - return true; -} - -/* Finish up dynamic symbol handling. We set the contents of various - dynamic sections here. */ - -static boolean -elf_s390_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; -{ - struct elf_s390_link_hash_table *htab; - - htab = elf_s390_hash_table (info); - - if (h->plt.offset != (bfd_vma) -1) - { - bfd_vma plt_index; - bfd_vma got_offset; - Elf_Internal_Rela rela; - Elf32_External_Rela *loc; - bfd_vma relative_offset; - - /* This symbol has an entry in the procedure linkage table. Set - it up. */ - - if (h->dynindx == -1 - || htab->splt == NULL - || htab->sgotplt == NULL - || htab->srelplt == NULL) - abort (); - - /* Calc. index no. - Current offset - size first entry / entry size. */ - plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; - - /* Offset in GOT is PLT index plus GOT headers(3) times 4, - addr & GOT addr. */ - got_offset = (plt_index + 3) * GOT_ENTRY_SIZE; - - /* S390 uses halfwords for relative branch calc! */ - relative_offset = - ((PLT_FIRST_ENTRY_SIZE + - (PLT_ENTRY_SIZE * plt_index) + 18) / 2); - /* If offset is > 32768, branch to a previous branch - 390 can only handle +-64 K jumps. */ - if ( -32768 > (int) relative_offset ) - relative_offset = - -(unsigned) (((65536 / PLT_ENTRY_SIZE - 1) * PLT_ENTRY_SIZE) / 2); - - /* Fill in the entry in the procedure linkage table. */ - if (!info->shared) - { - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD0, - htab->splt->contents + h->plt.offset); - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD1, - htab->splt->contents + h->plt.offset + 4); - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD2, - htab->splt->contents + h->plt.offset + 8); - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD3, - htab->splt->contents + h->plt.offset + 12); - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD4, - htab->splt->contents + h->plt.offset + 16); - bfd_put_32 (output_bfd, (bfd_vma) 0+(relative_offset << 16), - htab->splt->contents + h->plt.offset + 20); - bfd_put_32 (output_bfd, - (htab->sgotplt->output_section->vma - + htab->sgotplt->output_offset - + got_offset), - htab->splt->contents + h->plt.offset + 24); - } - else if (got_offset < 4096) - { - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC12_ENTRY_WORD0 + got_offset, - htab->splt->contents + h->plt.offset); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC12_ENTRY_WORD1, - htab->splt->contents + h->plt.offset + 4); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC12_ENTRY_WORD2, - htab->splt->contents + h->plt.offset + 8); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC12_ENTRY_WORD3, - htab->splt->contents + h->plt.offset + 12); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC12_ENTRY_WORD4, - htab->splt->contents + h->plt.offset + 16); - bfd_put_32 (output_bfd, (bfd_vma) 0+(relative_offset << 16), - htab->splt->contents + h->plt.offset + 20); - bfd_put_32 (output_bfd, (bfd_vma) 0, - htab->splt->contents + h->plt.offset + 24); - } - else if (got_offset < 32768) - { - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC16_ENTRY_WORD0 + got_offset, - htab->splt->contents + h->plt.offset); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC16_ENTRY_WORD1, - htab->splt->contents + h->plt.offset + 4); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC16_ENTRY_WORD2, - htab->splt->contents + h->plt.offset + 8); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC16_ENTRY_WORD3, - htab->splt->contents + h->plt.offset + 12); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC16_ENTRY_WORD4, - htab->splt->contents + h->plt.offset + 16); - bfd_put_32 (output_bfd, (bfd_vma) 0+(relative_offset << 16), - htab->splt->contents + h->plt.offset + 20); - bfd_put_32 (output_bfd, (bfd_vma) 0, - htab->splt->contents + h->plt.offset + 24); - } - else - { - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD0, - htab->splt->contents + h->plt.offset); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD1, - htab->splt->contents + h->plt.offset + 4); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD2, - htab->splt->contents + h->plt.offset + 8); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD3, - htab->splt->contents + h->plt.offset + 12); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD4, - htab->splt->contents + h->plt.offset + 16); - bfd_put_32 (output_bfd, (bfd_vma) 0+(relative_offset << 16), - htab->splt->contents + h->plt.offset + 20); - bfd_put_32 (output_bfd, got_offset, - htab->splt->contents + h->plt.offset + 24); - } - /* Insert offset into reloc. table here. */ - bfd_put_32 (output_bfd, plt_index * sizeof (Elf32_External_Rela), - htab->splt->contents + h->plt.offset + 28); - - /* Fill in the entry in the global offset table. - Points to instruction after GOT offset. */ - bfd_put_32 (output_bfd, - (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset - + 12), - htab->sgotplt->contents + got_offset); - - /* Fill in the entry in the .rela.plt section. */ - rela.r_offset = (htab->sgotplt->output_section->vma - + htab->sgotplt->output_offset - + got_offset); - rela.r_info = ELF32_R_INFO (h->dynindx, R_390_JMP_SLOT); - rela.r_addend = 0; - loc = (Elf32_External_Rela *) htab->srelplt->contents + plt_index; - bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); - - 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. This is a clue - for the dynamic linker, to make function pointer - comparisons work between an application and shared - library. */ - sym->st_shndx = SHN_UNDEF; - } - } - - if (h->got.offset != (bfd_vma) -1) - { - Elf_Internal_Rela rela; - Elf32_External_Rela *loc; - - /* This symbol has an entry in the global offset table. Set it - up. */ - - if (htab->sgot == NULL || htab->srelgot == NULL) - abort (); - - rela.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset - + (h->got.offset &~ (bfd_vma) 1)); - - /* If this is a static link, or it is a -Bsymbolic link and the - symbol is defined locally or was forced to be local because - of a version file, 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_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) - { - BFD_ASSERT((h->got.offset & 1) != 0); - rela.r_info = ELF32_R_INFO (0, R_390_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_32 (output_bfd, (bfd_vma) 0, htab->sgot->contents + h->got.offset); - rela.r_info = ELF32_R_INFO (h->dynindx, R_390_GLOB_DAT); - rela.r_addend = 0; - } - - loc = (Elf32_External_Rela *) htab->srelgot->contents; - loc += htab->srelgot->reloc_count++; - bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); - } - - if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) - { - Elf_Internal_Rela rela; - Elf32_External_Rela *loc; - - /* This symbols needs a copy reloc. Set it up. */ - - if (h->dynindx == -1 - || (h->root.type != bfd_link_hash_defined - && h->root.type != bfd_link_hash_defweak) - || htab->srelbss == NULL) - abort (); - - 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 = ELF32_R_INFO (h->dynindx, R_390_COPY); - rela.r_addend = 0; - loc = (Elf32_External_Rela *) htab->srelbss->contents; - loc += htab->srelbss->reloc_count++; - bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); - } - - /* Mark some specially defined symbols as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 - || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 - || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) - sym->st_shndx = SHN_ABS; - - return true; -} - -/* Used to decide how to sort relocs in an optimal manner for the - dynamic linker, before writing them out. */ - -static enum elf_reloc_type_class -elf_s390_reloc_type_class (rela) - const Elf_Internal_Rela *rela; -{ - switch ((int) ELF32_R_TYPE (rela->r_info)) - { - 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; - } -} - -/* Finish up the dynamic sections. */ - -static boolean -elf_s390_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; -{ - struct elf_s390_link_hash_table *htab; - bfd *dynobj; - asection *sdyn; - - htab = elf_s390_hash_table (info); - dynobj = htab->elf.dynobj; - sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); - - if (htab->elf.dynamic_sections_created) - { - Elf32_External_Dyn *dyncon, *dynconend; - - if (sdyn == NULL || htab->sgot == NULL) - abort (); - - dyncon = (Elf32_External_Dyn *) sdyn->contents; - dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size); - for (; dyncon < dynconend; dyncon++) - { - Elf_Internal_Dyn dyn; - asection *s; - - bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); - - switch (dyn.d_tag) - { - default: - continue; - - case DT_PLTGOT: - dyn.d_un.d_ptr = htab->sgot->output_section->vma; - break; - - case DT_JMPREL: - dyn.d_un.d_ptr = htab->srelplt->output_section->vma; - break; - - case DT_PLTRELSZ: - s = htab->srelplt->output_section; - if (s->_cooked_size != 0) - dyn.d_un.d_val = s->_cooked_size; - else - dyn.d_un.d_val = s->_raw_size; - break; - } - - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); - } - - /* Fill in the special first entry in the procedure linkage table. */ - if (htab->splt && htab->splt->_raw_size > 0) - { - memset (htab->splt->contents, 0, PLT_FIRST_ENTRY_SIZE); - if (info->shared) - { - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD0, - htab->splt->contents ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD1, - htab->splt->contents +4 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD2, - htab->splt->contents +8 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD3, - htab->splt->contents +12 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD4, - htab->splt->contents +16 ); - } - else - { - bfd_put_32 (output_bfd, (bfd_vma)PLT_FIRST_ENTRY_WORD0, - htab->splt->contents ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD1, - htab->splt->contents +4 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD2, - htab->splt->contents +8 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD3, - htab->splt->contents +12 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD4, - htab->splt->contents +16 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD5, - htab->splt->contents +20 ); - bfd_put_32 (output_bfd, - htab->sgotplt->output_section->vma - + htab->sgotplt->output_offset, - htab->splt->contents + 24); - } - elf_section_data (htab->splt->output_section) - ->this_hdr.sh_entsize = 4; - } - - } - - if (htab->sgotplt) - { - /* Fill in the first three entries in the global offset table. */ - if (htab->sgotplt->_raw_size > 0) - { - bfd_put_32 (output_bfd, - (sdyn == NULL ? (bfd_vma) 0 - : sdyn->output_section->vma + sdyn->output_offset), - htab->sgotplt->contents); - /* One entry for shared object struct ptr. */ - bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgotplt->contents + 4); - /* One entry for _dl_runtime_resolve. */ - bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgotplt->contents + 8); - } - - elf_section_data (htab->sgotplt->output_section) - ->this_hdr.sh_entsize = 4; - } - return true; -} - -static boolean -elf_s390_object_p (abfd) - bfd *abfd; -{ - return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_31); -} - -static boolean -elf_s390_grok_prstatus (abfd, note) - bfd * abfd; - Elf_Internal_Note * note; -{ - int offset; - unsigned int raw_size; - - switch (note->descsz) - { - default: - return false; - - case 224: /* S/390 Linux. */ - /* pr_cursig */ - elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); - - /* pr_pid */ - elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); - - /* pr_reg */ - offset = 72; - raw_size = 144; - break; - } - - /* Make a ".reg/999" section. */ - return _bfd_elfcore_make_pseudosection (abfd, ".reg", - raw_size, note->descpos + offset); -} - -#define TARGET_BIG_SYM bfd_elf32_s390_vec -#define TARGET_BIG_NAME "elf32-s390" -#define ELF_ARCH bfd_arch_s390 -#define ELF_MACHINE_CODE EM_S390 -#define ELF_MACHINE_ALT1 EM_S390_OLD -#define ELF_MAXPAGESIZE 0x1000 - -#define elf_backend_can_gc_sections 1 -#define elf_backend_can_refcount 1 -#define elf_backend_want_got_plt 1 -#define elf_backend_plt_readonly 1 -#define elf_backend_want_plt_sym 0 -#define elf_backend_got_header_size 12 -#define elf_backend_plt_header_size PLT_ENTRY_SIZE -#define elf_backend_rela_normal 1 - -#define elf_info_to_howto elf_s390_info_to_howto - -#define bfd_elf32_bfd_is_local_label_name elf_s390_is_local_label_name -#define bfd_elf32_bfd_link_hash_table_create elf_s390_link_hash_table_create -#define bfd_elf32_bfd_reloc_type_lookup elf_s390_reloc_type_lookup - -#define elf_backend_adjust_dynamic_symbol elf_s390_adjust_dynamic_symbol -#define elf_backend_check_relocs elf_s390_check_relocs -#define elf_backend_copy_indirect_symbol elf_s390_copy_indirect_symbol -#define elf_backend_create_dynamic_sections elf_s390_create_dynamic_sections -#define elf_backend_finish_dynamic_sections elf_s390_finish_dynamic_sections -#define elf_backend_finish_dynamic_symbol elf_s390_finish_dynamic_symbol -#define elf_backend_gc_mark_hook elf_s390_gc_mark_hook -#define elf_backend_gc_sweep_hook elf_s390_gc_sweep_hook -#define elf_backend_reloc_type_class elf_s390_reloc_type_class -#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_grok_prstatus elf_s390_grok_prstatus - -#define elf_backend_object_p elf_s390_object_p - -#include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-v850.c b/contrib/binutils/bfd/elf32-v850.c deleted file mode 100644 index ae0a0c4e88b1..000000000000 --- a/contrib/binutils/bfd/elf32-v850.c +++ /dev/null @@ -1,2222 +0,0 @@ -/* V850-specific support for 32-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. - -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. */ - -/* XXX FIXME: This code is littered with 32bit int, 16bit short, 8bit char - dependencies. As is the gas & simulator code or the v850. */ - -#include "bfd.h" -#include "sysdep.h" -#include "bfdlink.h" -#include "libbfd.h" -#include "elf-bfd.h" -#include "elf/v850.h" -#include "libiberty.h" - -/* Sign-extend a 24-bit number. */ -#define SEXT24(x) ((((x) & 0xffffff) ^ 0x800000) - 0x800000) - -static reloc_howto_type *v850_elf_reloc_type_lookup - PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); -static void v850_elf_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); -static void v850_elf_info_to_howto_rela - PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); -static bfd_reloc_status_type v850_elf_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static boolean v850_elf_is_local_label_name - PARAMS ((bfd *, const char *)); -static boolean v850_elf_relocate_section - PARAMS((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static bfd_reloc_status_type v850_elf_perform_relocation - PARAMS ((bfd *, unsigned int, bfd_vma, bfd_byte *)); -static boolean v850_elf_check_relocs - PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static void remember_hi16s_reloc - PARAMS ((bfd *, bfd_vma, bfd_byte *)); -static bfd_byte * find_remembered_hi16s_reloc - PARAMS ((bfd_vma, boolean *)); -static bfd_reloc_status_type v850_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 v850_elf_object_p - PARAMS ((bfd *)); -static boolean v850_elf_fake_sections - PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); -static void v850_elf_final_write_processing - PARAMS ((bfd *, boolean)); -static boolean v850_elf_set_private_flags - PARAMS ((bfd *, flagword)); -static boolean v850_elf_merge_private_bfd_data - PARAMS ((bfd *, bfd *)); -static boolean v850_elf_print_private_bfd_data - PARAMS ((bfd *, PTR)); -static boolean v850_elf_section_from_bfd_section - PARAMS ((bfd *, asection *, int *)); -static void v850_elf_symbol_processing - PARAMS ((bfd *, asymbol *)); -static boolean v850_elf_add_symbol_hook - PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, - const char **, flagword *, asection **, bfd_vma *)); -static boolean v850_elf_link_output_symbol_hook - PARAMS ((bfd *, struct bfd_link_info *, const char *, - 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. */ -static reloc_howto_type v850_elf_howto_table[] = -{ - /* This reloc does nothing. */ - HOWTO (R_V850_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_V850_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* A PC relative 9 bit branch. */ - HOWTO (R_V850_9_PCREL, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_9_PCREL", /* name */ - false, /* partial_inplace */ - 0x00ffffff, /* src_mask */ - 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* A PC relative 22 bit branch. */ - HOWTO (R_V850_22_PCREL, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 22, /* bitsize */ - true, /* pc_relative */ - 7, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_22_PCREL", /* name */ - false, /* partial_inplace */ - 0x07ffff80, /* src_mask */ - 0x07ffff80, /* dst_mask */ - true), /* pcrel_offset */ - - /* High 16 bits of symbol value. */ - HOWTO (R_V850_HI16_S, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_HI16_S", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* High 16 bits of symbol value. */ - HOWTO (R_V850_HI16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_HI16", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of symbol value. */ - HOWTO (R_V850_LO16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_LO16", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Simple 32bit reloc. */ - HOWTO (R_V850_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Simple 16bit reloc. */ - HOWTO (R_V850_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_V850_16", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Simple 8bit reloc. */ - HOWTO (R_V850_8, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_V850_8", /* name */ - false, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit offset from the short data area pointer. */ - HOWTO (R_V850_SDA_16_16_OFFSET, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_SDA_16_16_OFFSET", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 15 bit offset from the short data area pointer. */ - HOWTO (R_V850_SDA_15_16_OFFSET, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 1, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_SDA_15_16_OFFSET", /* name */ - false, /* partial_inplace */ - 0xfffe, /* src_mask */ - 0xfffe, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit offset from the zero data area pointer. */ - HOWTO (R_V850_ZDA_16_16_OFFSET, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_ZDA_16_16_OFFSET", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 15 bit offset from the zero data area pointer. */ - HOWTO (R_V850_ZDA_15_16_OFFSET, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 1, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_ZDA_15_16_OFFSET", /* name */ - false, /* partial_inplace */ - 0xfffe, /* src_mask */ - 0xfffe, /* dst_mask */ - false), /* pcrel_offset */ - - /* 6 bit offset from the tiny data area pointer. */ - HOWTO (R_V850_TDA_6_8_OFFSET, /* type */ - 2, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ - 1, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_TDA_6_8_OFFSET", /* name */ - false, /* partial_inplace */ - 0x7e, /* src_mask */ - 0x7e, /* dst_mask */ - false), /* pcrel_offset */ - - /* 8 bit offset from the tiny data area pointer. */ - HOWTO (R_V850_TDA_7_8_OFFSET, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_TDA_7_8_OFFSET", /* name */ - false, /* partial_inplace */ - 0x7f, /* src_mask */ - 0x7f, /* dst_mask */ - false), /* pcrel_offset */ - - /* 7 bit offset from the tiny data area pointer. */ - HOWTO (R_V850_TDA_7_7_OFFSET, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 7, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_TDA_7_7_OFFSET", /* name */ - false, /* partial_inplace */ - 0x7f, /* src_mask */ - 0x7f, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit offset from the tiny data area pointer! */ - HOWTO (R_V850_TDA_16_16_OFFSET, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_TDA_16_16_OFFSET", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xfff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 5 bit offset from the tiny data area pointer. */ - HOWTO (R_V850_TDA_4_5_OFFSET, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 5, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_TDA_4_5_OFFSET", /* name */ - false, /* partial_inplace */ - 0x0f, /* src_mask */ - 0x0f, /* dst_mask */ - false), /* pcrel_offset */ - - /* 4 bit offset from the tiny data area pointer. */ - HOWTO (R_V850_TDA_4_4_OFFSET, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 4, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_TDA_4_4_OFFSET", /* name */ - false, /* partial_inplace */ - 0x0f, /* src_mask */ - 0x0f, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit offset from the short data area pointer. */ - HOWTO (R_V850_SDA_16_16_SPLIT_OFFSET, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_SDA_16_16_SPLIT_OFFSET",/* name */ - false, /* partial_inplace */ - 0xfffe0020, /* src_mask */ - 0xfffe0020, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit offset from the zero data area pointer. */ - HOWTO (R_V850_ZDA_16_16_SPLIT_OFFSET, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_ZDA_16_16_SPLIT_OFFSET",/* name */ - false, /* partial_inplace */ - 0xfffe0020, /* src_mask */ - 0xfffe0020, /* dst_mask */ - false), /* pcrel_offset */ - - /* 6 bit offset from the call table base pointer. */ - HOWTO (R_V850_CALLT_6_7_OFFSET, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 7, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_CALLT_6_7_OFFSET", /* name */ - false, /* partial_inplace */ - 0x3f, /* src_mask */ - 0x3f, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit offset from the call table base pointer. */ - HOWTO (R_V850_CALLT_16_16_OFFSET, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - v850_elf_reloc, /* special_function */ - "R_V850_CALLT_16_16_OFFSET", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* GNU extension to record C++ vtable hierarchy */ - HOWTO (R_V850_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_V850_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_V850_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_V850_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - -}; - -/* Map BFD reloc types to V850 ELF reloc types. */ - -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 int elf_reloc_val; -}; - -static const struct v850_elf_reloc_map v850_elf_reloc_map[] = -{ - { BFD_RELOC_NONE, R_V850_NONE }, - { BFD_RELOC_V850_9_PCREL, R_V850_9_PCREL }, - { BFD_RELOC_V850_22_PCREL, R_V850_22_PCREL }, - { BFD_RELOC_HI16_S, R_V850_HI16_S }, - { BFD_RELOC_HI16, R_V850_HI16 }, - { BFD_RELOC_LO16, R_V850_LO16 }, - { BFD_RELOC_32, R_V850_32 }, - { BFD_RELOC_16, R_V850_16 }, - { BFD_RELOC_8, R_V850_8 }, - { BFD_RELOC_V850_SDA_16_16_OFFSET, R_V850_SDA_16_16_OFFSET }, - { BFD_RELOC_V850_SDA_15_16_OFFSET, R_V850_SDA_15_16_OFFSET }, - { BFD_RELOC_V850_ZDA_16_16_OFFSET, R_V850_ZDA_16_16_OFFSET }, - { BFD_RELOC_V850_ZDA_15_16_OFFSET, R_V850_ZDA_15_16_OFFSET }, - { BFD_RELOC_V850_TDA_6_8_OFFSET, R_V850_TDA_6_8_OFFSET }, - { BFD_RELOC_V850_TDA_7_8_OFFSET, R_V850_TDA_7_8_OFFSET }, - { BFD_RELOC_V850_TDA_7_7_OFFSET, R_V850_TDA_7_7_OFFSET }, - { BFD_RELOC_V850_TDA_16_16_OFFSET, R_V850_TDA_16_16_OFFSET }, - { BFD_RELOC_V850_TDA_4_5_OFFSET, R_V850_TDA_4_5_OFFSET }, - { BFD_RELOC_V850_TDA_4_4_OFFSET, R_V850_TDA_4_4_OFFSET }, - { BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET, R_V850_SDA_16_16_SPLIT_OFFSET }, - { BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET, R_V850_ZDA_16_16_SPLIT_OFFSET }, - { BFD_RELOC_V850_CALLT_6_7_OFFSET, R_V850_CALLT_6_7_OFFSET }, - { BFD_RELOC_V850_CALLT_16_16_OFFSET, R_V850_CALLT_16_16_OFFSET }, - { BFD_RELOC_VTABLE_INHERIT, R_V850_GNU_VTINHERIT }, - { BFD_RELOC_VTABLE_ENTRY, R_V850_GNU_VTENTRY }, - -}; - -/* Map a bfd relocation into the appropriate howto structure. */ - -static reloc_howto_type * -v850_elf_reloc_type_lookup (abfd, code) - bfd * abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; -{ - unsigned int i; - - 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 + 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; - arelent * cache_ptr; - Elf32_Internal_Rel * dst; -{ - unsigned int r_type; - - r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_V850_max); - cache_ptr->howto = &v850_elf_howto_table[r_type]; -} - -/* Set the howto pointer for a V850 ELF reloc (type RELA). */ -static void -v850_elf_info_to_howto_rela (abfd, cache_ptr, dst) - bfd * abfd ATTRIBUTE_UNUSED; - arelent * cache_ptr; - Elf32_Internal_Rela *dst; -{ - unsigned int r_type; - - r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_V850_max); - cache_ptr->howto = &v850_elf_howto_table[r_type]; -} - -/* 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 -v850_elf_check_relocs (abfd, info, sec, relocs) - bfd * abfd; - struct bfd_link_info * info; - asection * sec; - const Elf_Internal_Rela * relocs; -{ - boolean ret = true; - bfd *dynobj; - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - const Elf_Internal_Rela *rel; - const Elf_Internal_Rela *rel_end; - asection *sreloc; - enum v850_reloc_type r_type; - int other = 0; - const char *common = (const char *)0; - - if (info->relocateable) - return true; - -#ifdef DEBUG - fprintf (stderr, "v850_elf_check_relocs called for section %s in %s\n", - bfd_get_section_name (abfd, sec), - bfd_archive_filename (abfd)); -#endif - - dynobj = elf_hash_table (info)->dynobj; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (abfd); - 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 = ELF32_R_SYM (rel->r_info); - if (r_symndx < symtab_hdr->sh_info) - h = NULL; - else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - - r_type = (enum v850_reloc_type) ELF32_R_TYPE (rel->r_info); - switch (r_type) - { - default: - case R_V850_NONE: - case R_V850_9_PCREL: - case R_V850_22_PCREL: - case R_V850_HI16_S: - case R_V850_HI16: - case R_V850_LO16: - case R_V850_32: - case R_V850_16: - case R_V850_8: - case R_V850_CALLT_6_7_OFFSET: - case R_V850_CALLT_16_16_OFFSET: - break; - - /* This relocation describes the C++ object vtable hierarchy. - Reconstruct it for later use during GC. */ - case R_V850_GNU_VTINHERIT: - if (!_bfd_elf32_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_V850_GNU_VTENTRY: - if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return false; - break; - - case R_V850_SDA_16_16_SPLIT_OFFSET: - case R_V850_SDA_16_16_OFFSET: - case R_V850_SDA_15_16_OFFSET: - other = V850_OTHER_SDA; - common = ".scommon"; - goto small_data_common; - - case R_V850_ZDA_16_16_SPLIT_OFFSET: - case R_V850_ZDA_16_16_OFFSET: - case R_V850_ZDA_15_16_OFFSET: - other = V850_OTHER_ZDA; - common = ".zcommon"; - goto small_data_common; - - case R_V850_TDA_4_5_OFFSET: - case R_V850_TDA_4_4_OFFSET: - case R_V850_TDA_6_8_OFFSET: - case R_V850_TDA_7_8_OFFSET: - case R_V850_TDA_7_7_OFFSET: - case R_V850_TDA_16_16_OFFSET: - other = V850_OTHER_TDA; - common = ".tcommon"; - /* fall through */ - -#define V850_OTHER_MASK (V850_OTHER_TDA | V850_OTHER_SDA | V850_OTHER_ZDA) - - small_data_common: - if (h) - { - /* 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) - { - const char * msg; - static char buff[200]; /* XXX */ - - switch (h->other & V850_OTHER_MASK) - { - default: - msg = _("Variable `%s' cannot occupy in multiple small data regions"); - break; - case V850_OTHER_SDA | V850_OTHER_ZDA | V850_OTHER_TDA: - msg = _("Variable `%s' can only be in one of the small, zero, and tiny data regions"); - break; - case V850_OTHER_SDA | V850_OTHER_ZDA: - msg = _("Variable `%s' cannot be in both small and zero data regions simultaneously"); - break; - case V850_OTHER_SDA | V850_OTHER_TDA: - msg = _("Variable `%s' cannot be in both small and tiny data regions simultaneously"); - break; - case V850_OTHER_ZDA | V850_OTHER_TDA: - msg = _("Variable `%s' cannot be in both zero and tiny data regions simultaneously"); - break; - } - - sprintf (buff, msg, h->root.root.string); - info->callbacks->warning (info, buff, h->root.root.string, - abfd, h->root.u.def.section, - (bfd_vma) 0); - - bfd_set_error (bfd_error_bad_value); - h->other |= V850_OTHER_ERROR; - ret = false; - } - } - - if (h && h->root.type == bfd_link_hash_common - && h->root.u.c.p - && !strcmp (bfd_get_section_name (abfd, h->root.u.c.p->section), "COMMON")) - { - asection * section; - - section = h->root.u.c.p->section = bfd_make_section_old_way (abfd, common); - section->flags |= SEC_IS_COMMON; - } - -#ifdef DEBUG - fprintf (stderr, "v850_elf_check_relocs, found %s relocation for %s%s\n", - v850_elf_howto_table[ (int)r_type ].name, - (h && h->root.root.string) ? h->root.root.string : "<unknown>", - (h->root.type == bfd_link_hash_common) ? ", symbol is common" : ""); -#endif - break; - } - } - - 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. */ - -typedef struct hi16s_location -{ - bfd_vma addend; - bfd_byte * address; - unsigned long counter; - boolean found; - struct hi16s_location * next; -} -hi16s_location; - -static hi16s_location * previous_hi16s; -static hi16s_location * free_hi16s; -static unsigned long hi16s_counter; - -static void -remember_hi16s_reloc (abfd, addend, address) - bfd * abfd; - bfd_vma addend; - bfd_byte * address; -{ - hi16s_location * entry = NULL; - bfd_size_type amt = sizeof (* free_hi16s); - - /* Find a free structure. */ - if (free_hi16s == NULL) - free_hi16s = (hi16s_location *) bfd_zalloc (abfd, amt); - - entry = free_hi16s; - free_hi16s = free_hi16s->next; - - entry->addend = addend; - entry->address = address; - entry->counter = hi16s_counter ++; - entry->found = false; - entry->next = previous_hi16s; - previous_hi16s = entry; - - /* Cope with wrap around of our counter. */ - if (hi16s_counter == 0) - { - /* XXX - Assume that all counter entries differ only in their low 16 bits. */ - for (entry = previous_hi16s; entry != NULL; entry = entry->next) - entry->counter &= 0xffff; - - hi16s_counter = 0x10000; - } - - return; -} - -static bfd_byte * -find_remembered_hi16s_reloc (addend, already_found) - bfd_vma addend; - boolean * already_found; -{ - hi16s_location * match = NULL; - hi16s_location * entry; - hi16s_location * previous = NULL; - hi16s_location * prev; - bfd_byte * addr; - - /* Search the table. Record the most recent entry that matches. */ - for (entry = previous_hi16s; entry; entry = entry->next) - { - if (entry->addend == addend - && (match == NULL || match->counter < entry->counter)) - { - previous = prev; - match = entry; - } - - prev = entry; - } - - if (match == NULL) - return NULL; - - /* Extract the address. */ - addr = match->address; - - /* Remeber if this entry has already been used before. */ - if (already_found) - * already_found = match->found; - - /* Note that this entry has now been used. */ - match->found = true; - - return addr; -} - -/* 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; - unsigned int r_type; - bfd_vma addend; - bfd_byte *address; -{ - unsigned long insn; - bfd_signed_vma saddend = (bfd_signed_vma) addend; - - switch (r_type) - { - default: - /* fprintf (stderr, "reloc type %d not SUPPORTED\n", r_type ); */ - return bfd_reloc_notsupported; - - case R_V850_32: - bfd_put_32 (abfd, addend, address); - return bfd_reloc_ok; - - case R_V850_22_PCREL: - if (saddend > 0x1fffff || saddend < -0x200000) - return bfd_reloc_overflow; - - if ((addend % 2) != 0) - return bfd_reloc_dangerous; - - insn = bfd_get_32 (abfd, address); - insn &= ~0xfffe003f; - insn |= (((addend & 0xfffe) << 16) | ((addend & 0x3f0000) >> 16)); - bfd_put_32 (abfd, (bfd_vma) insn, address); - return bfd_reloc_ok; - - case R_V850_9_PCREL: - if (saddend > 0xff || saddend < -0x100) - return bfd_reloc_overflow; - - if ((addend % 2) != 0) - return bfd_reloc_dangerous; - - insn = bfd_get_16 (abfd, address); - insn &= ~ 0xf870; - insn |= ((addend & 0x1f0) << 7) | ((addend & 0x0e) << 3); - break; - - case R_V850_HI16: - addend += (bfd_get_16 (abfd, address) << 16); - addend = (addend >> 16); - insn = addend; - break; - - case R_V850_HI16_S: - /* Remember where this relocation took place. */ - remember_hi16s_reloc (abfd, addend, address); - - addend += (bfd_get_16 (abfd, address) << 16); - addend = (addend >> 16) + ((addend & 0x8000) != 0); - - /* This relocation cannot overflow. */ - if (addend > 0x7fff) - addend = 0; - - insn = addend; - break; - - case R_V850_LO16: - /* Calculate the sum of the value stored in the instruction and the - addend and check for overflow from the low 16 bits into the high - 16 bits. The assembler has already done some of this: If the - value stored in the instruction has its 15th bit set, (counting - from zero) then the assembler will have added 1 to the value - stored in the associated HI16S reloc. So for example, these - relocations: - - movhi hi( fred ), r0, r1 - movea lo( fred ), r1, r1 - - will store 0 in the value fields for the MOVHI and MOVEA instructions - and addend will be the address of fred, but for these instructions: - - movhi hi( fred + 0x123456), r0, r1 - movea lo( fred + 0x123456), r1, r1 - - the value stored in the MOVHI instruction will be 0x12 and the value - stored in the MOVEA instruction will be 0x3456. If however the - instructions were: - - movhi hi( fred + 0x10ffff), r0, r1 - movea lo( fred + 0x10ffff), r1, r1 - - then the value stored in the MOVHI instruction would be 0x11 (not - 0x10) and the value stored in the MOVEA instruction would be 0xffff. - Thus (assuming for the moment that the addend is 0), at run time the - MOVHI instruction loads 0x110000 into r1, then the MOVEA instruction - adds 0xffffffff (sign extension!) producing 0x10ffff. Similarly if - the instructions were: - - movhi hi( fred - 1), r0, r1 - movea lo( fred - 1), r1, r1 - - then 0 is stored in the MOVHI instruction and -1 is stored in the - MOVEA instruction. - - Overflow can occur if the addition of the value stored in the - instruction plus the addend sets the 15th bit when before it was clear. - This is because the 15th bit will be sign extended into the high part, - thus reducing its value by one, but since the 15th bit was originally - clear, the assembler will not have added 1 to the previous HI16S reloc - to compensate for this effect. For example: - - movhi hi( fred + 0x123456), r0, r1 - movea lo( fred + 0x123456), r1, r1 - - The value stored in HI16S reloc is 0x12, the value stored in the LO16 - reloc is 0x3456. If we assume that the address of fred is 0x00007000 - then the relocations become: - - HI16S: 0x0012 + (0x00007000 >> 16) = 0x12 - LO16: 0x3456 + (0x00007000 & 0xffff) = 0xa456 - - but when the instructions are executed, the MOVEA instruction's value - is signed extended, so the sum becomes: - - 0x00120000 - + 0xffffa456 - ------------ - 0x0011a456 but 'fred + 0x123456' = 0x0012a456 - - Note that if the 15th bit was set in the value stored in the LO16 - reloc, then we do not have to do anything: - - movhi hi( fred + 0x10ffff), r0, r1 - movea lo( fred + 0x10ffff), r1, r1 - - HI16S: 0x0011 + (0x00007000 >> 16) = 0x11 - LO16: 0xffff + (0x00007000 & 0xffff) = 0x6fff - - 0x00110000 - + 0x00006fff - ------------ - 0x00116fff = fred + 0x10ffff = 0x7000 + 0x10ffff - - Overflow can also occur if the computation carries into the 16th bit - and it also results in the 15th bit having the same value as the 15th - bit of the original value. What happens is that the HI16S reloc - will have already examined the 15th bit of the original value and - added 1 to the high part if the bit is set. This compensates for the - sign extension of 15th bit of the result of the computation. But now - there is a carry into the 16th bit, and this has not been allowed for. - - So, for example if fred is at address 0xf000: - - movhi hi( fred + 0xffff), r0, r1 [bit 15 of the offset is set] - movea lo( fred + 0xffff), r1, r1 - - HI16S: 0x0001 + (0x0000f000 >> 16) = 0x0001 - LO16: 0xffff + (0x0000f000 & 0xffff) = 0xefff (carry into bit 16 is lost) - - 0x00010000 - + 0xffffefff - ------------ - 0x0000efff but 'fred + 0xffff' = 0x0001efff - - Similarly, if the 15th bit remains clear, but overflow occurs into - the 16th bit then (assuming the address of fred is 0xf000): - - movhi hi( fred + 0x7000), r0, r1 [bit 15 of the offset is clear] - movea lo( fred + 0x7000), r1, r1 - - HI16S: 0x0000 + (0x0000f000 >> 16) = 0x0000 - LO16: 0x7000 + (0x0000f000 & 0xffff) = 0x6fff (carry into bit 16 is lost) - - 0x00000000 - + 0x00006fff - ------------ - 0x00006fff but 'fred + 0x7000' = 0x00016fff - - Note - there is no need to change anything if a carry occurs, and the - 15th bit changes its value from being set to being clear, as the HI16S - reloc will have already added in 1 to the high part for us: - - movhi hi( fred + 0xffff), r0, r1 [bit 15 of the offset is set] - movea lo( fred + 0xffff), r1, r1 - - HI16S: 0x0001 + (0x00007000 >> 16) - LO16: 0xffff + (0x00007000 & 0xffff) = 0x6fff (carry into bit 16 is lost) - - 0x00010000 - + 0x00006fff (bit 15 not set, so the top half is zero) - ------------ - 0x00016fff which is right (assuming that fred is at 0x7000) - - but if the 15th bit goes from being clear to being set, then we must - once again handle overflow: - - movhi hi( fred + 0x7000), r0, r1 [bit 15 of the offset is clear] - movea lo( fred + 0x7000), r1, r1 - - HI16S: 0x0000 + (0x0000ffff >> 16) - LO16: 0x7000 + (0x0000ffff & 0xffff) = 0x6fff (carry into bit 16) - - 0x00000000 - + 0x00006fff (bit 15 not set, so the top half is zero) - ------------ - 0x00006fff which is wrong (assuming that fred is at 0xffff). */ - { - long result; - - insn = bfd_get_16 (abfd, address); - result = insn + addend; - -#define BIT15_SET(x) ((x) & 0x8000) -#define OVERFLOWS(a,i) ((((a) & 0xffff) + (i)) > 0xffff) - - if ((BIT15_SET (result) && ! BIT15_SET (addend)) - || (OVERFLOWS (addend, insn) - && ((! BIT15_SET (insn)) || (BIT15_SET (addend))))) - { - boolean already_updated; - bfd_byte * hi16s_address = find_remembered_hi16s_reloc - (addend, & already_updated); - - /* Amend the matching HI16_S relocation. */ - if (hi16s_address != NULL) - { - if (! already_updated) - { - insn = bfd_get_16 (abfd, hi16s_address); - insn += 1; - bfd_put_16 (abfd, (bfd_vma) insn, hi16s_address); - } - } - else - { - fprintf (stderr, _("FAILED to find previous HI16 reloc\n")); - return bfd_reloc_overflow; - } - } - - /* Do not complain if value has top bit set, as this has been anticipated. */ - insn = result & 0xffff; - break; - } - - case R_V850_8: - addend += (char) bfd_get_8 (abfd, address); - - saddend = (bfd_signed_vma) addend; - - if (saddend > 0x7f || saddend < -0x80) - return bfd_reloc_overflow; - - bfd_put_8 (abfd, addend, address); - return bfd_reloc_ok; - - case R_V850_CALLT_16_16_OFFSET: - addend += bfd_get_16 (abfd, address); - - saddend = (bfd_signed_vma) addend; - - if (saddend > 0xffff || saddend < 0) - return bfd_reloc_overflow; - - insn = addend; - break; - - case R_V850_16: - - /* drop through */ - case R_V850_SDA_16_16_OFFSET: - case R_V850_ZDA_16_16_OFFSET: - case R_V850_TDA_16_16_OFFSET: - addend += bfd_get_16 (abfd, address); - - saddend = (bfd_signed_vma) addend; - - if (saddend > 0x7fff || saddend < -0x8000) - return bfd_reloc_overflow; - - insn = addend; - break; - - case R_V850_SDA_15_16_OFFSET: - case R_V850_ZDA_15_16_OFFSET: - insn = bfd_get_16 (abfd, address); - addend += (insn & 0xfffe); - - saddend = (bfd_signed_vma) addend; - - if (saddend > 0x7ffe || saddend < -0x8000) - return bfd_reloc_overflow; - - if (addend & 1) - return bfd_reloc_dangerous; - - insn = (addend &~ (bfd_vma) 1) | (insn & 1); - break; - - case R_V850_TDA_6_8_OFFSET: - insn = bfd_get_16 (abfd, address); - addend += ((insn & 0x7e) << 1); - - saddend = (bfd_signed_vma) addend; - - if (saddend > 0xfc || saddend < 0) - return bfd_reloc_overflow; - - if (addend & 3) - return bfd_reloc_dangerous; - - insn &= 0xff81; - insn |= (addend >> 1); - break; - - case R_V850_TDA_7_8_OFFSET: - insn = bfd_get_16 (abfd, address); - addend += ((insn & 0x7f) << 1); - - saddend = (bfd_signed_vma) addend; - - if (saddend > 0xfe || saddend < 0) - return bfd_reloc_overflow; - - if (addend & 1) - return bfd_reloc_dangerous; - - insn &= 0xff80; - insn |= (addend >> 1); - break; - - case R_V850_TDA_7_7_OFFSET: - insn = bfd_get_16 (abfd, address); - addend += insn & 0x7f; - - saddend = (bfd_signed_vma) addend; - - if (saddend > 0x7f || saddend < 0) - return bfd_reloc_overflow; - - insn &= 0xff80; - insn |= addend; - break; - - case R_V850_TDA_4_5_OFFSET: - insn = bfd_get_16 (abfd, address); - addend += ((insn & 0xf) << 1); - - saddend = (bfd_signed_vma) addend; - - if (saddend > 0x1e || saddend < 0) - return bfd_reloc_overflow; - - if (addend & 1) - return bfd_reloc_dangerous; - - insn &= 0xfff0; - insn |= (addend >> 1); - break; - - case R_V850_TDA_4_4_OFFSET: - insn = bfd_get_16 (abfd, address); - addend += insn & 0xf; - - saddend = (bfd_signed_vma) addend; - - if (saddend > 0xf || saddend < 0) - return bfd_reloc_overflow; - - insn &= 0xfff0; - insn |= addend; - break; - - case R_V850_ZDA_16_16_SPLIT_OFFSET: - case R_V850_SDA_16_16_SPLIT_OFFSET: - insn = bfd_get_32 (abfd, address); - addend += ((insn & 0xfffe0000) >> 16) + ((insn & 0x20) >> 5); - - saddend = (bfd_signed_vma) addend; - - if (saddend > 0x7fff || saddend < -0x8000) - return bfd_reloc_overflow; - - insn &= 0x0001ffdf; - insn |= (addend & 1) << 5; - insn |= (addend &~ (bfd_vma) 1) << 16; - - bfd_put_32 (abfd, (bfd_vma) insn, address); - return bfd_reloc_ok; - - case R_V850_CALLT_6_7_OFFSET: - insn = bfd_get_16 (abfd, address); - addend += ((insn & 0x3f) << 1); - - saddend = (bfd_signed_vma) addend; - - if (saddend > 0x7e || saddend < 0) - return bfd_reloc_overflow; - - if (addend & 1) - return bfd_reloc_dangerous; - - insn &= 0xff80; - insn |= (addend >> 1); - break; - - case R_V850_GNU_VTINHERIT: - case R_V850_GNU_VTENTRY: - return bfd_reloc_ok; - - } - - bfd_put_16 (abfd, (bfd_vma) insn, address); - return bfd_reloc_ok; -} - -/* 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; - arelent * reloc; - asymbol * symbol; - PTR data ATTRIBUTE_UNUSED; - asection * isection; - bfd * obfd; - char ** err ATTRIBUTE_UNUSED; -{ - long relocation; - - /* 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 - then just fixup the address and return. */ - if (obfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc->howto->partial_inplace - || reloc->addend == 0)) - { - reloc->address += isection->output_offset; - return bfd_reloc_ok; - } -#if 0 - else if (obfd != NULL) - return bfd_reloc_continue; -#endif - - /* Catch relocs involving undefined symbols. */ - if (bfd_is_und_section (symbol->section) - && (symbol->flags & BSF_WEAK) == 0 - && obfd == NULL) - return bfd_reloc_undefined; - - /* We handle final linking of some relocs ourselves. */ - - /* Is the address of the relocation really within the section? */ - if (reloc->address > isection->_cooked_size) - return bfd_reloc_outofrange; - - /* Work out which section the relocation is targetted at and the - initial relocation command value. */ - - /* Get symbol value. (Common symbols are special.) */ - if (bfd_is_com_section (symbol->section)) - relocation = 0; - else - relocation = symbol->value; - - /* Convert input-section-relative symbol value to absolute + addend. */ - relocation += symbol->section->output_section->vma; - relocation += symbol->section->output_offset; - relocation += reloc->addend; - -#if 0 /* Since this reloc is going to be processed later on, we should - not make it pc-relative here. To test this, try assembling and - linking this program: - - .text - .globl _start - nop - _start: - jr foo - - .section ".foo","ax" - nop - foo: - 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. */ - relocation -= reloc->address; - } -#endif - reloc->addend = relocation; - return bfd_reloc_ok; -} - -static boolean -v850_elf_is_local_label_name (abfd, name) - bfd * abfd ATTRIBUTE_UNUSED; - const char * name; -{ - return ( (name[0] == '.' && (name[1] == 'L' || name[1] == '.')) - || (name[0] == '_' && name[1] == '.' && name[2] == 'L' && name[3] == '_')); -} - -/* 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, - addend, info, sym_sec, is_local) - reloc_howto_type * howto; - bfd * input_bfd; - bfd * output_bfd ATTRIBUTE_UNUSED; - asection * input_section; - bfd_byte * contents; - bfd_vma offset; - bfd_vma value; - bfd_vma addend; - struct bfd_link_info * info; - asection * sym_sec; - int is_local ATTRIBUTE_UNUSED; -{ - unsigned int r_type = howto->type; - bfd_byte * hit_data = contents + offset; - - /* Adjust the value according to the relocation. */ - switch (r_type) - { - case R_V850_9_PCREL: - value -= (input_section->output_section->vma - + input_section->output_offset); - value -= offset; - break; - - case R_V850_22_PCREL: - value -= (input_section->output_section->vma - + input_section->output_offset - + offset); - - /* If the sign extension will corrupt the value then we have overflowed. */ - if (((value & 0xff000000) != 0x0) && ((value & 0xff000000) != 0xff000000)) - return bfd_reloc_overflow; - - /* Only the bottom 24 bits of the PC are valid */ - value = SEXT24 (value); - break; - - case R_V850_HI16_S: - case R_V850_HI16: - case R_V850_LO16: - case R_V850_16: - case R_V850_32: - case R_V850_8: - break; - - case R_V850_ZDA_15_16_OFFSET: - case R_V850_ZDA_16_16_OFFSET: - case R_V850_ZDA_16_16_SPLIT_OFFSET: - if (sym_sec == NULL) - return bfd_reloc_undefined; - - value -= sym_sec->output_section->vma; - break; - - case R_V850_SDA_15_16_OFFSET: - case R_V850_SDA_16_16_OFFSET: - case R_V850_SDA_16_16_SPLIT_OFFSET: - { - unsigned long gp; - struct bfd_link_hash_entry * h; - - if (sym_sec == NULL) - return bfd_reloc_undefined; - - /* Get the value of __gp. */ - h = bfd_link_hash_lookup (info->hash, "__gp", false, false, true); - if (h == (struct bfd_link_hash_entry *) NULL - || h->type != bfd_link_hash_defined) - return bfd_reloc_other; - - gp = (h->u.def.value - + h->u.def.section->output_section->vma - + h->u.def.section->output_offset); - - value -= sym_sec->output_section->vma; - value -= (gp - sym_sec->output_section->vma); - } - break; - - case R_V850_TDA_4_4_OFFSET: - case R_V850_TDA_4_5_OFFSET: - case R_V850_TDA_16_16_OFFSET: - case R_V850_TDA_7_7_OFFSET: - case R_V850_TDA_7_8_OFFSET: - case R_V850_TDA_6_8_OFFSET: - { - unsigned long ep; - struct bfd_link_hash_entry * h; - - /* Get the value of __ep. */ - 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) - /* 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 - + h->u.def.section->output_offset); - - value -= ep; - } - break; - - case R_V850_CALLT_6_7_OFFSET: - { - unsigned long ctbp; - struct bfd_link_hash_entry * h; - - /* Get the value of __ctbp. */ - 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) - /* 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 - + h->u.def.section->output_offset); - value -= ctbp; - } - break; - - case R_V850_CALLT_16_16_OFFSET: - { - unsigned long ctbp; - struct bfd_link_hash_entry * h; - - if (sym_sec == NULL) - return bfd_reloc_undefined; - - /* Get the value of __ctbp. */ - 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); - - ctbp = (h->u.def.value - + h->u.def.section->output_section->vma - + h->u.def.section->output_offset); - - value -= sym_sec->output_section->vma; - value -= (ctbp - sym_sec->output_section->vma); - } - break; - - case R_V850_NONE: - case R_V850_GNU_VTINHERIT: - case R_V850_GNU_VTENTRY: - return bfd_reloc_ok; - - default: - return bfd_reloc_notsupported; - } - - /* Perform the relocation. */ - return v850_elf_perform_relocation (input_bfd, r_type, value + addend, hit_data); -} - -/* Relocate an V850 ELF section. */ - -static boolean -v850_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; - Elf_Internal_Rela * rel; - Elf_Internal_Rela * relend; - - symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (input_bfd); - - if (sym_hashes == NULL) - { - info->callbacks->warning - (info, "no hash table available", - NULL, input_bfd, input_section, (bfd_vma) 0); - - return false; - } - - /* Reset the list of remembered HI16S relocs to empty. */ - free_hi16s = previous_hi16s; - previous_hi16s = NULL; - hi16s_counter = 0; - - rel = relocs; - relend = relocs + input_section->reloc_count; - for (; rel < relend; rel++) - { - int r_type; - reloc_howto_type * howto; - unsigned long r_symndx; - Elf_Internal_Sym * sym; - asection * sec; - struct elf_link_hash_entry * h; - bfd_vma relocation; - bfd_reloc_status_type r; - - r_symndx = ELF32_R_SYM (rel->r_info); - r_type = ELF32_R_TYPE (rel->r_info); - - if (r_type == R_V850_GNU_VTENTRY - || r_type == R_V850_GNU_VTINHERIT) - continue; - - howto = v850_elf_howto_table + r_type; - - if (info->relocateable) - { - /* This is a relocateable 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 (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - - /* This is a final link. */ - h = NULL; - sym = NULL; - sec = NULL; - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -#if 0 - { - char * name; - - name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); - name = (name == NULL) ? "<none>" : 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); - } -#endif - } - 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) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - relocation = (h->root.u.def.value - + 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); -#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); -#endif - relocation = 0; - } - else - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, true))) - return false; -#if 0 - 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. */ - r = v850_elf_final_link_relocate (howto, input_bfd, output_bfd, - input_section, - contents, rel->r_offset, - relocation, rel->r_addend, - info, sec, h == NULL); - - if (r != bfd_reloc_ok) - { - const char * name; - const char * msg = (const char *)0; - - if (h != NULL) - 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 || *name == '\0') - name = bfd_section_name (input_bfd, sec); - } - - switch (r) - { - case bfd_reloc_overflow: - if (! ((*info->callbacks->reloc_overflow) - (info, name, howto->name, (bfd_vma) 0, - input_bfd, input_section, rel->r_offset))) - return false; - break; - - case bfd_reloc_undefined: - if (! ((*info->callbacks->undefined_symbol) - (info, name, input_bfd, input_section, - rel->r_offset, true))) - return false; - break; - - case bfd_reloc_outofrange: - msg = _("internal error: out of range error"); - goto common_error; - - case bfd_reloc_notsupported: - msg = _("internal error: unsupported relocation error"); - goto common_error; - - case bfd_reloc_dangerous: - msg = _("internal error: dangerous relocation"); - goto common_error; - - case bfd_reloc_other: - msg = _("could not locate special linker symbol __gp"); - goto common_error; - - case bfd_reloc_continue: - msg = _("could not locate special linker symbol __ep"); - goto common_error; - - case (bfd_reloc_dangerous + 1): - msg = _("could not locate special linker symbol __ctbp"); - goto common_error; - - default: - msg = _("internal error: unknown error"); - /* fall through */ - - common_error: - if (!((*info->callbacks->warning) - (info, msg, name, input_bfd, input_section, - rel->r_offset))) - return false; - break; - } - } - } - - return true; -} - -static boolean -v850_elf_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; -{ - /* No got and plt entries for v850-elf. */ - return true; -} - -static asection * -v850_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 (ELF32_R_TYPE (rel->r_info)) - { - case R_V850_GNU_VTINHERIT: - case R_V850_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 - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } - - return NULL; -} - -/* Set the right machine number. */ - -static boolean -v850_elf_object_p (abfd) - bfd *abfd; -{ - switch (elf_elfheader (abfd)->e_flags & EF_V850_ARCH) - { - default: - case E_V850_ARCH: (void) bfd_default_set_arch_mach (abfd, bfd_arch_v850, 0); break; - case E_V850E_ARCH: (void) bfd_default_set_arch_mach (abfd, bfd_arch_v850, bfd_mach_v850e); break; - case E_V850EA_ARCH: (void) bfd_default_set_arch_mach (abfd, bfd_arch_v850, bfd_mach_v850ea); break; - } - return true; -} - -/* Store the machine number in the flags field. */ - -static void -v850_elf_final_write_processing (abfd, linker) - bfd * abfd; - boolean linker ATTRIBUTE_UNUSED; -{ - unsigned long val; - - switch (bfd_get_mach (abfd)) - { - default: - case 0: val = E_V850_ARCH; break; - case bfd_mach_v850e: val = E_V850E_ARCH; break; - case bfd_mach_v850ea: val = E_V850EA_ARCH; break; - } - - elf_elfheader (abfd)->e_flags &=~ EF_V850_ARCH; - elf_elfheader (abfd)->e_flags |= val; -} - -/* Function to keep V850 specific file flags. */ - -static boolean -v850_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; -} - -/* 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; - bfd * obfd; -{ - flagword out_flags; - flagword in_flags; - - if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour - || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return true; - - in_flags = elf_elfheader (ibfd)->e_flags; - out_flags = elf_elfheader (obfd)->e_flags; - - if (! elf_flags_init (obfd)) - { - /* If the input is the default architecture then do not - bother setting the flags for the output architecture, - instead allow future merges to do this. If no future - merges ever set these flags then they will retain their - unitialised values, which surprise surprise, correspond - to the default values. */ - if (bfd_get_arch_info (ibfd)->the_default) - return true; - - elf_flags_init (obfd) = true; - elf_elfheader (obfd)->e_flags = in_flags; - - 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 true; - } - - /* Check flag compatibility. */ - if (in_flags == out_flags) - return true; - - if ((in_flags & EF_V850_ARCH) != (out_flags & EF_V850_ARCH) - && (in_flags & EF_V850_ARCH) != E_V850_ARCH) - _bfd_error_handler (_("%s: Architecture mismatch with previous modules"), - bfd_archive_filename (ibfd)); - - return true; -} - -/* Display the flags field. */ - -static boolean -v850_elf_print_private_bfd_data (abfd, ptr) - bfd * abfd; - PTR ptr; -{ - FILE * file = (FILE *) ptr; - - BFD_ASSERT (abfd != NULL && ptr != NULL); - - _bfd_elf_print_private_bfd_data (abfd, ptr); - - /* xgettext:c-format */ - fprintf (file, _("private flags = %lx: "), elf_elfheader (abfd)->e_flags); - - switch (elf_elfheader (abfd)->e_flags & EF_V850_ARCH) - { - default: - case E_V850_ARCH: fprintf (file, _("v850 architecture")); break; - case E_V850E_ARCH: fprintf (file, _("v850e architecture")); break; - case E_V850EA_ARCH: fprintf (file, _("v850ea architecture")); break; - } - - fputc ('\n', file); - - return true; -} - -/* V850 ELF uses four common sections. One is the usual one, and the - others are for (small) objects in one of the special data areas: - small, tiny and zero. All the objects are kept together, and then - referenced via the gp register, the ep register or the r0 register - respectively, which yields smaller, faster assembler code. This - approach is copied from elf32-mips.c. */ - -static asection v850_elf_scom_section; -static asymbol v850_elf_scom_symbol; -static asymbol * v850_elf_scom_symbol_ptr; -static asection v850_elf_tcom_section; -static asymbol v850_elf_tcom_symbol; -static asymbol * v850_elf_tcom_symbol_ptr; -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. */ - -static boolean -v850_elf_section_from_bfd_section (abfd, sec, retval) - bfd * abfd ATTRIBUTE_UNUSED; - asection * sec; - int * retval; -{ - if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0) - *retval = SHN_V850_SCOMMON; - else if (strcmp (bfd_get_section_name (abfd, sec), ".tcommon") == 0) - *retval = SHN_V850_TCOMMON; - else if (strcmp (bfd_get_section_name (abfd, sec), ".zcommon") == 0) - *retval = SHN_V850_ZCOMMON; - else - return false; - - return true; -} - -/* Handle the special V850 section numbers that a symbol may use. */ - -static void -v850_elf_symbol_processing (abfd, asym) - bfd * abfd; - asymbol * asym; -{ - elf_symbol_type * elfsym = (elf_symbol_type *) asym; - unsigned int indx; - - indx = elfsym->internal_elf_sym.st_shndx; - - /* If the section index is an "ordinary" index, then it may - refer to a v850 specific section created by the assembler. - Check the section's type and change the index it matches. - - FIXME: Should we alter the st_shndx field as well ? */ - - if (indx < elf_numsections (abfd)) - switch (elf_elfsections(abfd)[indx]->sh_type) - { - case SHT_V850_SCOMMON: - indx = SHN_V850_SCOMMON; - break; - - case SHT_V850_TCOMMON: - indx = SHN_V850_TCOMMON; - break; - - case SHT_V850_ZCOMMON: - indx = SHN_V850_ZCOMMON; - break; - - default: - break; - } - - switch (indx) - { - case SHN_V850_SCOMMON: - if (v850_elf_scom_section.name == NULL) - { - /* Initialize the small common section. */ - v850_elf_scom_section.name = ".scommon"; - v850_elf_scom_section.flags = SEC_IS_COMMON | SEC_ALLOC | SEC_DATA; - v850_elf_scom_section.output_section = & v850_elf_scom_section; - v850_elf_scom_section.symbol = & v850_elf_scom_symbol; - v850_elf_scom_section.symbol_ptr_ptr = & v850_elf_scom_symbol_ptr; - v850_elf_scom_symbol.name = ".scommon"; - v850_elf_scom_symbol.flags = BSF_SECTION_SYM; - v850_elf_scom_symbol.section = & v850_elf_scom_section; - v850_elf_scom_symbol_ptr = & v850_elf_scom_symbol; - } - asym->section = & v850_elf_scom_section; - asym->value = elfsym->internal_elf_sym.st_size; - break; - - case SHN_V850_TCOMMON: - if (v850_elf_tcom_section.name == NULL) - { - /* Initialize the tcommon section. */ - v850_elf_tcom_section.name = ".tcommon"; - v850_elf_tcom_section.flags = SEC_IS_COMMON; - v850_elf_tcom_section.output_section = & v850_elf_tcom_section; - v850_elf_tcom_section.symbol = & v850_elf_tcom_symbol; - v850_elf_tcom_section.symbol_ptr_ptr = & v850_elf_tcom_symbol_ptr; - v850_elf_tcom_symbol.name = ".tcommon"; - v850_elf_tcom_symbol.flags = BSF_SECTION_SYM; - v850_elf_tcom_symbol.section = & v850_elf_tcom_section; - v850_elf_tcom_symbol_ptr = & v850_elf_tcom_symbol; - } - asym->section = & v850_elf_tcom_section; - asym->value = elfsym->internal_elf_sym.st_size; - break; - - case SHN_V850_ZCOMMON: - if (v850_elf_zcom_section.name == NULL) - { - /* Initialize the zcommon section. */ - v850_elf_zcom_section.name = ".zcommon"; - v850_elf_zcom_section.flags = SEC_IS_COMMON; - v850_elf_zcom_section.output_section = & v850_elf_zcom_section; - v850_elf_zcom_section.symbol = & v850_elf_zcom_symbol; - v850_elf_zcom_section.symbol_ptr_ptr = & v850_elf_zcom_symbol_ptr; - v850_elf_zcom_symbol.name = ".zcommon"; - v850_elf_zcom_symbol.flags = BSF_SECTION_SYM; - v850_elf_zcom_symbol.section = & v850_elf_zcom_section; - v850_elf_zcom_symbol_ptr = & v850_elf_zcom_symbol; - } - asym->section = & v850_elf_zcom_section; - asym->value = elfsym->internal_elf_sym.st_size; - break; - } -} - -/* Hook called by the linker routine which adds symbols from an object - file. We must handle the special v850 section numbers here. */ - -static boolean -v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) - bfd * abfd; - struct bfd_link_info * info ATTRIBUTE_UNUSED; - const Elf_Internal_Sym * sym; - const char ** namep ATTRIBUTE_UNUSED; - flagword * flagsp ATTRIBUTE_UNUSED; - asection ** secp; - bfd_vma * valp; -{ - unsigned int indx = sym->st_shndx; - - /* If the section index is an "ordinary" index, then it may - refer to a v850 specific section created by the assembler. - Check the section's type and change the index it matches. - - FIXME: Should we alter the st_shndx field as well ? */ - - if (indx < elf_numsections (abfd)) - switch (elf_elfsections(abfd)[indx]->sh_type) - { - case SHT_V850_SCOMMON: - indx = SHN_V850_SCOMMON; - break; - - case SHT_V850_TCOMMON: - indx = SHN_V850_TCOMMON; - break; - - case SHT_V850_ZCOMMON: - indx = SHN_V850_ZCOMMON; - break; - - default: - break; - } - - switch (indx) - { - case SHN_V850_SCOMMON: - *secp = bfd_make_section_old_way (abfd, ".scommon"); - (*secp)->flags |= SEC_IS_COMMON; - *valp = sym->st_size; - break; - - case SHN_V850_TCOMMON: - *secp = bfd_make_section_old_way (abfd, ".tcommon"); - (*secp)->flags |= SEC_IS_COMMON; - *valp = sym->st_size; - break; - - case SHN_V850_ZCOMMON: - *secp = bfd_make_section_old_way (abfd, ".zcommon"); - (*secp)->flags |= SEC_IS_COMMON; - *valp = sym->st_size; - break; - } - - return true; -} - -static boolean -v850_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec) - bfd * abfd ATTRIBUTE_UNUSED; - struct bfd_link_info * info ATTRIBUTE_UNUSED; - const char * name ATTRIBUTE_UNUSED; - Elf_Internal_Sym * sym; - asection * input_sec; -{ - /* If we see a common symbol, which implies a relocatable link, then - if a symbol was in a special common section in an input file, mark - it as a special common in the output file. */ - - if (sym->st_shndx == SHN_COMMON) - { - if (strcmp (input_sec->name, ".scommon") == 0) - sym->st_shndx = SHN_V850_SCOMMON; - else if (strcmp (input_sec->name, ".tcommon") == 0) - sym->st_shndx = SHN_V850_TCOMMON; - else if (strcmp (input_sec->name, ".zcommon") == 0) - sym->st_shndx = SHN_V850_ZCOMMON; - } - - return true; -} - -static boolean -v850_elf_section_from_shdr (abfd, hdr, name) - bfd * abfd; - Elf_Internal_Shdr * hdr; - char * name; -{ - /* There ought to be a place to keep ELF backend specific flags, but - at the moment there isn't one. We just keep track of the - sections by their name, instead. */ - - if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) - return false; - - switch (hdr->sh_type) - { - case SHT_V850_SCOMMON: - case SHT_V850_TCOMMON: - case SHT_V850_ZCOMMON: - if (! bfd_set_section_flags (abfd, hdr->bfd_section, - (bfd_get_section_flags (abfd, - hdr->bfd_section) - | SEC_IS_COMMON))) - return false; - } - - 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. */ - -static boolean -v850_elf_fake_sections (abfd, hdr, sec) - bfd * abfd ATTRIBUTE_UNUSED; - Elf32_Internal_Shdr * hdr; - asection * sec; -{ - register const char * name; - - name = bfd_get_section_name (abfd, sec); - - if (strcmp (name, ".scommon") == 0) - { - hdr->sh_type = SHT_V850_SCOMMON; - } - else if (strcmp (name, ".tcommon") == 0) - { - hdr->sh_type = SHT_V850_TCOMMON; - } - else if (strcmp (name, ".zcommon") == 0) - hdr->sh_type = SHT_V850_ZCOMMON; - - return true; -} - -#define TARGET_LITTLE_SYM bfd_elf32_v850_vec -#define TARGET_LITTLE_NAME "elf32-v850" -#define ELF_ARCH bfd_arch_v850 -#define ELF_MACHINE_CODE EM_V850 -#define ELF_MACHINE_ALT1 EM_CYGNUS_V850 -#define ELF_MAXPAGESIZE 0x1000 - -#define elf_info_to_howto v850_elf_info_to_howto_rela -#define elf_info_to_howto_rel v850_elf_info_to_howto_rel - -#define elf_backend_check_relocs v850_elf_check_relocs -#define elf_backend_relocate_section v850_elf_relocate_section -#define elf_backend_object_p v850_elf_object_p -#define elf_backend_final_write_processing v850_elf_final_write_processing -#define elf_backend_section_from_bfd_section v850_elf_section_from_bfd_section -#define elf_backend_symbol_processing v850_elf_symbol_processing -#define elf_backend_add_symbol_hook v850_elf_add_symbol_hook -#define elf_backend_link_output_symbol_hook v850_elf_link_output_symbol_hook -#define elf_backend_section_from_shdr v850_elf_section_from_shdr -#define elf_backend_fake_sections v850_elf_fake_sections -#define elf_backend_gc_mark_hook v850_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook v850_elf_gc_sweep_hook - -#define elf_backend_can_gc_sections 1 - -#define bfd_elf32_bfd_is_local_label_name v850_elf_is_local_label_name -#define bfd_elf32_bfd_reloc_type_lookup v850_elf_reloc_type_lookup -#define bfd_elf32_bfd_merge_private_bfd_data v850_elf_merge_private_bfd_data -#define bfd_elf32_bfd_set_private_flags v850_elf_set_private_flags -#define bfd_elf32_bfd_print_private_bfd_data v850_elf_print_private_bfd_data - -#define elf_symbol_leading_char '_' - -#include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf64-mips.c b/contrib/binutils/bfd/elf64-mips.c deleted file mode 100644 index f2f5dcbc098a..000000000000 --- a/contrib/binutils/bfd/elf64-mips.c +++ /dev/null @@ -1,7092 +0,0 @@ -/* MIPS-specific support for 64-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. - Ian Lance Taylor, Cygnus Support - Linker support added by Mark Mitchell, CodeSourcery, LLC. - <mark@codesourcery.com> - -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 supports the 64-bit MIPS ELF ABI. - - The MIPS 64-bit ELF ABI uses an unusual reloc format. This file - overrides the usual ELF reloc handling, and handles reading and - writing the relocations here. */ - -/* TODO: Many things are unsupported, even if there is some code for it - . (which was mostly stolen from elf32-mips.c and slightly adapted). - . - . - Relocation handling for REL relocs is wrong in many cases and - . generally untested. - . - Relocation handling for RELA relocs related to GOT support are - . also likely to be wrong. - . - Support for MIPS16 is only partially implemented. - . - Embedded PIC is only partially implemented (is it needed?). - . - Combined relocs with RSS_* entries are unsupported. - . - The whole GOT handling for NewABI is missing, some parts of - . the OldABI version is still lying around and shold be removed. - */ - -#include "bfd.h" -#include "sysdep.h" -#include "libbfd.h" -#include "aout/ar.h" -#include "bfdlink.h" -#include "genlink.h" -#include "elf-bfd.h" -#include "elf/mips.h" - -/* Get the ECOFF swapping routines. The 64-bit ABI is not supposed to - use ECOFF. However, we support it anyhow for an easier changeover. */ -#include "coff/sym.h" -#include "coff/symconst.h" -#include "coff/internal.h" -#include "coff/ecoff.h" -/* The 64 bit versions of the mdebug data structures are in alpha.h. */ -#include "coff/alpha.h" -#define ECOFF_SIGNED_64 -#include "ecoffswap.h" - -struct mips_elf64_link_hash_entry; - -static void mips_elf64_swap_reloc_in - PARAMS ((bfd *, const Elf64_Mips_External_Rel *, - Elf64_Mips_Internal_Rel *)); -static void mips_elf64_swap_reloca_in - PARAMS ((bfd *, const Elf64_Mips_External_Rela *, - Elf64_Mips_Internal_Rela *)); -static void mips_elf64_swap_reloc_out - PARAMS ((bfd *, const Elf64_Mips_Internal_Rel *, - Elf64_Mips_External_Rel *)); -static void mips_elf64_swap_reloca_out - PARAMS ((bfd *, const Elf64_Mips_Internal_Rela *, - Elf64_Mips_External_Rela *)); -static void mips_elf64_be_swap_reloc_in - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rel *)); -static void mips_elf64_be_swap_reloc_out - PARAMS ((bfd *, const Elf_Internal_Rel *, bfd_byte *)); -static void mips_elf64_be_swap_reloca_in - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); -static void mips_elf64_be_swap_reloca_out - PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); -static bfd_vma mips_elf64_high PARAMS ((bfd_vma)); -static bfd_vma mips_elf64_higher PARAMS ((bfd_vma)); -static bfd_vma mips_elf64_highest PARAMS ((bfd_vma)); -static reloc_howto_type *mips_elf64_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static void mips_elf64_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf64_Internal_Rel *)); -static void mips_elf64_info_to_howto_rela - PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); -static long mips_elf64_get_reloc_upper_bound PARAMS ((bfd *, asection *)); -static boolean mips_elf64_slurp_one_reloc_table - PARAMS ((bfd *, asection *, asymbol **, const Elf_Internal_Shdr *)); -static boolean mips_elf64_slurp_reloc_table - PARAMS ((bfd *, asection *, asymbol **, boolean)); -static void mips_elf64_write_relocs PARAMS ((bfd *, asection *, PTR)); -static void mips_elf64_write_rel - PARAMS((bfd *, asection *, Elf_Internal_Shdr *, int *, PTR)); -static void mips_elf64_write_rela - PARAMS((bfd *, asection *, Elf_Internal_Shdr *, int *, PTR)); -static struct bfd_hash_entry *mips_elf64_link_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static bfd_reloc_status_type mips_elf64_hi16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips_elf64_higher_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips_elf64_highest_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips_elf64_gprel16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips_elf64_gprel16_reloca - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips_elf64_literal_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips_elf64_gprel32_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips_elf64_shift6_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips_elf64_got16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static boolean mips_elf64_assign_gp PARAMS ((bfd *, bfd_vma *)); -static bfd_reloc_status_type mips_elf64_final_gp - PARAMS ((bfd *, asymbol *, boolean, char **, bfd_vma *)); -static bfd_reloc_status_type gprel16_with_gp - PARAMS ((bfd *, asymbol *, arelent *, asection *, boolean, PTR, bfd_vma)); -static int mips_elf64_additional_program_headers PARAMS ((bfd *)); -static struct bfd_link_hash_table *mips_elf64_link_hash_table_create - PARAMS((bfd *)); -static bfd_vma mips_elf64_got_offset_from_index - PARAMS ((bfd *, bfd *, bfd_vma)); -static struct mips_elf64_got_info *_mips_elf64_got_info - PARAMS ((bfd *, asection **)); -static bfd_vma mips_elf64_sign_extend PARAMS ((bfd_vma, int)); -static boolean mips_elf64_overflow_p PARAMS ((bfd_vma, int)); -static bfd_vma mips_elf64_global_got_index - PARAMS ((bfd *, struct elf_link_hash_entry *)); -static boolean mips_elf64_sort_hash_table_f - PARAMS ((struct mips_elf64_link_hash_entry *, PTR)); -static boolean mips_elf64_sort_hash_table - PARAMS ((struct bfd_link_info *, unsigned long)); -static void mips_elf64_swap_msym_out - PARAMS ((bfd *, const Elf32_Internal_Msym *, Elf32_External_Msym *)); -static bfd_vma mips_elf64_create_local_got_entry - PARAMS ((bfd *abfd, struct mips_elf64_got_info *, asection *, - bfd_vma value)); -static bfd_vma mips_elf64_local_got_index - PARAMS ((bfd *, struct bfd_link_info *, bfd_vma)); -static bfd_vma mips_elf64_got_page - PARAMS ((bfd *, struct bfd_link_info *, bfd_vma, bfd_vma *)); -static bfd_vma mips_elf64_got16_entry - PARAMS ((bfd *, struct bfd_link_info *, bfd_vma, boolean)); -static boolean mips_elf64_local_relocation_p - PARAMS ((bfd *, const Elf_Internal_Rela *, asection **, boolean)); -static const Elf_Internal_Rela *mips_elf64_next_relocation - PARAMS ((unsigned int, const Elf_Internal_Rela *, - const Elf_Internal_Rela *)); -static boolean mips_elf64_create_dynamic_relocation - PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Rela *, - struct mips_elf64_link_hash_entry *, asection *, bfd_vma, - bfd_vma *, asection *)); -static bfd_reloc_status_type mips_elf64_calculate_relocation - PARAMS ((bfd *, bfd *, asection *, struct bfd_link_info *, - const Elf_Internal_Rela *, bfd_vma, reloc_howto_type *, - Elf_Internal_Sym *, asection **, bfd_vma *, const char **, - boolean *)); -static bfd_vma mips_elf64_obtain_contents - PARAMS ((reloc_howto_type *, const Elf_Internal_Rela *, bfd *, bfd_byte *)); -static boolean mips_elf64_perform_relocation - PARAMS ((struct bfd_link_info *, reloc_howto_type *, - const Elf_Internal_Rela *, bfd_vma, - bfd *, asection *, bfd_byte *, boolean)); -static boolean mips_elf64_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -boolean mips_elf64_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -boolean mips_elf64_adjust_dynamic_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *h)); -boolean mips_elf64_always_size_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean mips_elf64_check_mips16_stubs - PARAMS ((struct mips_elf64_link_hash_entry *, PTR)); -boolean mips_elf64_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -boolean mips_elf64_finish_dynamic_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); -boolean mips_elf64_finish_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *info)); -asection *mips_elf64_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); -boolean mips_elf64_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static boolean mips_elf64_create_got_section - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean mips_elf64_record_global_got_symbol - PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *, - struct mips_elf64_got_info *)); -static asection *mips_elf64_create_msym_section PARAMS((bfd *)); -static void mips_elf64_allocate_dynamic_relocations - PARAMS ((bfd *, unsigned int)); -static boolean mips_elf64_stub_section_p PARAMS ((bfd *, asection *)); -boolean mips_elf64_check_relocs - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static boolean mips_elf64_output_extsym - PARAMS ((struct mips_elf64_link_hash_entry *, PTR)); -static void mips_elf64_swap_gptab_in - PARAMS ((bfd *, const Elf32_External_gptab *, Elf32_gptab *)); -static void mips_elf64_swap_gptab_out - PARAMS ((bfd *, const Elf32_gptab *, Elf32_External_gptab *)); -static int gptab_compare PARAMS ((const PTR, const PTR)); -boolean mips_elf64_final_link PARAMS ((bfd *, struct bfd_link_info *)); - -extern const bfd_target bfd_elf64_bigmips_vec; -extern const bfd_target bfd_elf64_littlemips_vec; - -static bfd_vma prev_reloc_addend = 0; -static bfd_size_type prev_reloc_address = 0; - -/* Whether we are trying to be compatible with IRIX6 (or little endianers - which are otherwise IRIX-ABI compliant). */ -#define SGI_COMPAT(abfd) \ - ((abfd->xvec == &bfd_elf64_bigmips_vec) \ - || (abfd->xvec == &bfd_elf64_littlemips_vec) ? true : false) - -/* In case we're on a 32-bit machine, construct a 64-bit "-1" value - from smaller values. Start with zero, widen, *then* decrement. */ -#define MINUS_ONE (((bfd_vma)0) - 1) - -/* The number of local .got entries we reserve. */ -#define MIPS_RESERVED_GOTNO (2) - -/* Instructions which appear in a stub. */ -#define ELF_MIPS_GP_OFFSET(abfd) 0x7ff0 -#define STUB_LW 0xdf998010 /* ld t9,0x8010(gp) */ -#define STUB_MOVE 0x03e07825 /* move t7,ra */ -#define STUB_JALR 0x0320f809 /* jal t9 */ -#define STUB_LI16 0x34180000 /* ori t8,zero,0 */ -#define MIPS_FUNCTION_STUB_SIZE (16) - -/* 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. */ - HOWTO (R_MIPS_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_MIPS_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit relocation. */ - HOWTO (R_MIPS_16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit relocation. */ - HOWTO (R_MIPS_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit symbol relative relocation. */ - HOWTO (R_MIPS_REL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_REL32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 26 bit jump address. */ - HOWTO (R_MIPS_26, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - /* This needs complex overflow - detection, because the upper 36 - bits must match the PC + 4. */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_26", /* name */ - true, /* partial_inplace */ - 0x03ffffff, /* src_mask */ - 0x03ffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* High 16 bits of symbol value. */ - HOWTO (R_MIPS_HI16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_HI16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of symbol value. */ - HOWTO (R_MIPS_LO16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_LO16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* GP relative reference. */ - HOWTO (R_MIPS_GPREL16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - mips_elf64_gprel16_reloc, /* special_function */ - "R_MIPS_GPREL16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Reference to literal section. */ - HOWTO (R_MIPS_LITERAL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - mips_elf64_literal_reloc, /* special_function */ - "R_MIPS_LITERAL", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Reference to global offset table. */ - HOWTO (R_MIPS_GOT16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - mips_elf64_got16_reloc, /* special_function */ - "R_MIPS_GOT16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit PC relative reference. */ - HOWTO (R_MIPS_PC16, /* 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_MIPS_PC16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 16 bit call through global offset table. */ - /* FIXME: This is not handled correctly. */ - HOWTO (R_MIPS_CALL16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit GP relative reference. */ - HOWTO (R_MIPS_GPREL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - mips_elf64_gprel32_reloc, /* special_function */ - "R_MIPS_GPREL32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - UNUSED_RELOC (13), - UNUSED_RELOC (14), - UNUSED_RELOC (15), - - /* A 5 bit shift field. */ - HOWTO (R_MIPS_SHIFT5, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 5, /* bitsize */ - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT5", /* name */ - true, /* partial_inplace */ - 0x000007c0, /* src_mask */ - 0x000007c0, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 6 bit shift field. */ - HOWTO (R_MIPS_SHIFT6, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 6, /* bitsize */ - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - mips_elf64_shift6_reloc, /* special_function */ - "R_MIPS_SHIFT6", /* name */ - true, /* partial_inplace */ - 0x000007c4, /* src_mask */ - 0x000007c4, /* dst_mask */ - false), /* pcrel_offset */ - - /* 64 bit relocation. */ - HOWTO (R_MIPS_64, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_64", /* name */ - true, /* partial_inplace */ - MINUS_ONE, /* src_mask */ - MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ - - /* Displacement in the global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_DISP, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_DISP", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Displacement to page pointer in the global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_PAGE, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_PAGE", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Offset from page pointer in the global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_OFST, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_OFST", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* High 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_HI16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_HI16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_LO16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_LO16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 64 bit substraction. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_SUB, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SUB", /* name */ - true, /* partial_inplace */ - MINUS_ONE, /* src_mask */ - MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ - - /* Insert the addend as an instruction. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_INSERT_A, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_INSERT_A", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Insert the addend as an instruction, and change all relocations - to refer to the old instruction at the address. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_INSERT_B, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_INSERT_B", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Delete a 32 bit instruction. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_DELETE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_DELETE", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Get the higher value of a 64 bit addend. */ - HOWTO (R_MIPS_HIGHER, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - mips_elf64_higher_reloc, /* special_function */ - "R_MIPS_HIGHER", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Get the highest value of a 64 bit addend. */ - HOWTO (R_MIPS_HIGHEST, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - mips_elf64_highest_reloc, /* special_function */ - "R_MIPS_HIGHEST", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* High 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_CALL_HI16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL_HI16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_CALL_LO16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL_LO16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Section displacement, used by an associated event location section. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_SCN_DISP, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SCN_DISP", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_MIPS_REL16, /* 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_MIPS_REL16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* These two are obsolete. */ - EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE), - EMPTY_HOWTO (R_MIPS_PJUMP), - - /* Similiar to R_MIPS_REL32, but used for relocations in a GOT section. - It must be used for multigot GOT's (and only there). */ - HOWTO (R_MIPS_RELGOT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_RELGOT", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Protected jump conversion. This is an optimization hint. No - relocation is required for correctness. */ - HOWTO (R_MIPS_JALR, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_JALR", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x00000000, /* dst_mask */ - false), /* pcrel_offset */ -}; - -/* The relocation table used for SHT_RELA sections. */ - -static reloc_howto_type mips_elf64_howto_table_rela[] = -{ - /* No relocation. */ - HOWTO (R_MIPS_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_MIPS_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit relocation. */ - HOWTO (R_MIPS_16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit relocation. */ - HOWTO (R_MIPS_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit symbol relative relocation. */ - HOWTO (R_MIPS_REL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_REL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 26 bit jump address. */ - HOWTO (R_MIPS_26, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - /* This needs complex overflow - detection, because the upper 36 - bits must match the PC + 4. */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_26", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x03ffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* R_MIPS_HI16 and R_MIPS_LO16 are unsupported for 64 bit REL. */ - /* High 16 bits of symbol value. */ - HOWTO (R_MIPS_HI16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_HI16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of symbol value. */ - HOWTO (R_MIPS_LO16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_LO16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* GP relative reference. */ - HOWTO (R_MIPS_GPREL16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - mips_elf64_gprel16_reloca, /* special_function */ - "R_MIPS_GPREL16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Reference to literal section. */ - HOWTO (R_MIPS_LITERAL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - mips_elf64_literal_reloc, /* special_function */ - "R_MIPS_LITERAL", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Reference to global offset table. */ - /* FIXME: This is not handled correctly. */ - HOWTO (R_MIPS_GOT16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit PC relative reference. */ - HOWTO (R_MIPS_PC16, /* 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_MIPS_PC16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 16 bit call through global offset table. */ - /* FIXME: This is not handled correctly. */ - HOWTO (R_MIPS_CALL16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 32 bit GP relative reference. */ - HOWTO (R_MIPS_GPREL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - mips_elf64_gprel32_reloc, /* special_function */ - "R_MIPS_GPREL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - UNUSED_RELOC (13), - UNUSED_RELOC (14), - UNUSED_RELOC (15), - - /* A 5 bit shift field. */ - HOWTO (R_MIPS_SHIFT5, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 5, /* bitsize */ - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SHIFT5", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x000007c0, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 6 bit shift field. */ - HOWTO (R_MIPS_SHIFT6, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 6, /* bitsize */ - false, /* pc_relative */ - 6, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - mips_elf64_shift6_reloc, /* special_function */ - "R_MIPS_SHIFT6", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x000007c4, /* dst_mask */ - false), /* pcrel_offset */ - - /* 64 bit relocation. */ - HOWTO (R_MIPS_64, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_64", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ - - /* Displacement in the global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_DISP, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_DISP", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Displacement to page pointer in the global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_PAGE, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_PAGE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Offset from page pointer in the global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_OFST, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_OFST", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* High 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_HI16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_HI16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_GOT_LO16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_GOT_LO16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 64 bit substraction. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_SUB, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SUB", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ - - /* Insert the addend as an instruction. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_INSERT_A, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_INSERT_A", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Insert the addend as an instruction, and change all relocations - to refer to the old instruction at the address. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_INSERT_B, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_INSERT_B", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Delete a 32 bit instruction. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_DELETE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_DELETE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Get the higher value of a 64 bit addend. */ - HOWTO (R_MIPS_HIGHER, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_HIGHER", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Get the highest value of a 64 bit addend. */ - HOWTO (R_MIPS_HIGHEST, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_HIGHEST", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* High 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_CALL_HI16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL_HI16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Low 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_CALL_LO16, /* type */ - 0, /* rightshift */ - 2, /* 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_MIPS_CALL_LO16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Section displacement, used by an associated event location section. */ - /* FIXME: Not handled correctly. */ - HOWTO (R_MIPS_SCN_DISP, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_SCN_DISP", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_MIPS_REL16, /* 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_MIPS_REL16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* These two are obsolete. */ - EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE), - EMPTY_HOWTO (R_MIPS_PJUMP), - - /* Similiar to R_MIPS_REL32, but used for relocations in a GOT section. - It must be used for multigot GOT's (and only there). */ - HOWTO (R_MIPS_RELGOT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_RELGOT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Protected jump conversion. This is an optimization hint. No - relocation is required for correctness. */ - HOWTO (R_MIPS_JALR, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_MIPS_JALR", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0x00000000, /* dst_mask */ - false), /* pcrel_offset */ -}; - -/* Swap in a MIPS 64-bit Rel reloc. */ - -static void -mips_elf64_swap_reloc_in (abfd, src, dst) - bfd *abfd; - const Elf64_Mips_External_Rel *src; - Elf64_Mips_Internal_Rel *dst; -{ - dst->r_offset = H_GET_64 (abfd, src->r_offset); - dst->r_sym = H_GET_32 (abfd, src->r_sym); - dst->r_ssym = H_GET_8 (abfd, src->r_ssym); - dst->r_type3 = H_GET_8 (abfd, src->r_type3); - dst->r_type2 = H_GET_8 (abfd, src->r_type2); - dst->r_type = H_GET_8 (abfd, src->r_type); -} - -/* Swap in a MIPS 64-bit Rela reloc. */ - -static void -mips_elf64_swap_reloca_in (abfd, src, dst) - bfd *abfd; - const Elf64_Mips_External_Rela *src; - Elf64_Mips_Internal_Rela *dst; -{ - dst->r_offset = H_GET_64 (abfd, src->r_offset); - dst->r_sym = H_GET_32 (abfd, src->r_sym); - dst->r_ssym = H_GET_8 (abfd, src->r_ssym); - dst->r_type3 = H_GET_8 (abfd, src->r_type3); - dst->r_type2 = H_GET_8 (abfd, src->r_type2); - dst->r_type = H_GET_8 (abfd, src->r_type); - dst->r_addend = H_GET_S64 (abfd, src->r_addend); -} - -/* Swap out a MIPS 64-bit Rel reloc. */ - -static void -mips_elf64_swap_reloc_out (abfd, src, dst) - bfd *abfd; - const Elf64_Mips_Internal_Rel *src; - Elf64_Mips_External_Rel *dst; -{ - H_PUT_64 (abfd, src->r_offset, dst->r_offset); - H_PUT_32 (abfd, src->r_sym, dst->r_sym); - H_PUT_8 (abfd, src->r_ssym, dst->r_ssym); - H_PUT_8 (abfd, src->r_type3, dst->r_type3); - H_PUT_8 (abfd, src->r_type2, dst->r_type2); - H_PUT_8 (abfd, src->r_type, dst->r_type); -} - -/* Swap out a MIPS 64-bit Rela reloc. */ - -static void -mips_elf64_swap_reloca_out (abfd, src, dst) - bfd *abfd; - const Elf64_Mips_Internal_Rela *src; - Elf64_Mips_External_Rela *dst; -{ - H_PUT_64 (abfd, src->r_offset, dst->r_offset); - H_PUT_32 (abfd, src->r_sym, dst->r_sym); - H_PUT_8 (abfd, src->r_ssym, dst->r_ssym); - H_PUT_8 (abfd, src->r_type3, dst->r_type3); - H_PUT_8 (abfd, src->r_type2, dst->r_type2); - H_PUT_8 (abfd, src->r_type, dst->r_type); - H_PUT_S64 (abfd, src->r_addend, dst->r_addend); -} - -/* Swap in a MIPS 64-bit Rel reloc. */ - -static void -mips_elf64_be_swap_reloc_in (abfd, src, dst) - bfd *abfd; - const bfd_byte *src; - Elf_Internal_Rel *dst; -{ - Elf64_Mips_Internal_Rel mirel; - - mips_elf64_swap_reloc_in (abfd, - (const Elf64_Mips_External_Rel *) src, - &mirel); - - dst[0].r_offset = mirel.r_offset; - dst[0].r_info = ELF64_R_INFO (mirel.r_sym, mirel.r_type); - dst[1].r_offset = mirel.r_offset; - dst[1].r_info = ELF64_R_INFO (mirel.r_ssym, mirel.r_type2); - dst[2].r_offset = mirel.r_offset; - dst[2].r_info = ELF64_R_INFO (STN_UNDEF, mirel.r_type3); -} - -/* Swap in a MIPS 64-bit Rela reloc. */ - -static void -mips_elf64_be_swap_reloca_in (abfd, src, dst) - bfd *abfd; - const bfd_byte *src; - Elf_Internal_Rela *dst; -{ - Elf64_Mips_Internal_Rela mirela; - - mips_elf64_swap_reloca_in (abfd, - (const Elf64_Mips_External_Rela *) src, - &mirela); - - dst[0].r_offset = mirela.r_offset; - dst[0].r_info = ELF64_R_INFO (mirela.r_sym, mirela.r_type); - dst[0].r_addend = mirela.r_addend; - dst[1].r_offset = mirela.r_offset; - dst[1].r_info = ELF64_R_INFO (mirela.r_ssym, mirela.r_type2); - dst[1].r_addend = 0; - dst[2].r_offset = mirela.r_offset; - dst[2].r_info = ELF64_R_INFO (STN_UNDEF, mirela.r_type3); - dst[2].r_addend = 0; -} - -/* Swap out a MIPS 64-bit Rel reloc. */ - -static void -mips_elf64_be_swap_reloc_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Rel *src; - bfd_byte *dst; -{ - Elf64_Mips_Internal_Rel mirel; - - mirel.r_offset = src[0].r_offset; - BFD_ASSERT(src[0].r_offset == src[1].r_offset); - BFD_ASSERT(src[0].r_offset == src[2].r_offset); - - mirel.r_type = ELF64_MIPS_R_TYPE (src[0].r_info); - mirel.r_sym = ELF64_R_SYM (src[0].r_info); - mirel.r_type2 = ELF64_MIPS_R_TYPE2 (src[1].r_info); - mirel.r_ssym = ELF64_MIPS_R_SSYM (src[1].r_info); - mirel.r_type3 = ELF64_MIPS_R_TYPE3 (src[2].r_info); - - mips_elf64_swap_reloc_out (abfd, &mirel, - (Elf64_Mips_External_Rel *) dst); -} - -/* Swap out a MIPS 64-bit Rela reloc. */ - -static void -mips_elf64_be_swap_reloca_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Rela *src; - bfd_byte *dst; -{ - Elf64_Mips_Internal_Rela mirela; - - mirela.r_offset = src[0].r_offset; - BFD_ASSERT(src[0].r_offset == src[1].r_offset); - BFD_ASSERT(src[0].r_offset == src[2].r_offset); - - mirela.r_type = ELF64_MIPS_R_TYPE (src[0].r_info); - mirela.r_sym = ELF64_R_SYM (src[0].r_info); - mirela.r_addend = src[0].r_addend; - BFD_ASSERT(src[1].r_addend == 0); - BFD_ASSERT(src[2].r_addend == 0); - - mirela.r_type2 = ELF64_MIPS_R_TYPE2 (src[1].r_info); - mirela.r_ssym = ELF64_MIPS_R_SSYM (src[1].r_info); - mirela.r_type3 = ELF64_MIPS_R_TYPE3 (src[2].r_info); - - mips_elf64_swap_reloca_out (abfd, &mirela, - (Elf64_Mips_External_Rela *) dst); -} - -/* Calculate the %high function. */ - -static bfd_vma -mips_elf64_high (value) - bfd_vma value; -{ - return ((value + (bfd_vma) 0x8000) >> 16) & 0xffff; -} - -/* Calculate the %higher function. */ - -static bfd_vma -mips_elf64_higher (value) - bfd_vma value; -{ - return ((value + (bfd_vma) 0x80008000) >> 32) & 0xffff; -} - -/* Calculate the %highest function. */ - -static bfd_vma -mips_elf64_highest (value) - bfd_vma value; -{ - return ((value + (bfd_vma) 0x800080008000) >> 48) & 0xffff; -} - -/* Do a R_MIPS_HI16 relocation. */ - -bfd_reloc_status_type -mips_elf64_hi16_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 we're relocating, and this is an external symbol, we don't - want to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - if (((reloc_entry->addend & 0xffff) + 0x8000) & ~0xffff) - reloc_entry->addend += 0x8000; - - return bfd_reloc_continue; -} - -/* Do a R_MIPS_HIGHER relocation. */ - -bfd_reloc_status_type -mips_elf64_higher_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 we're relocating, and this is an external symbol, we don't - want to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - if (((reloc_entry->addend & 0xffffffff) + 0x80008000) - & ~0xffffffff) - reloc_entry->addend += 0x80008000; - - return bfd_reloc_continue; -} - -/* Do a R_MIPS_HIGHEST relocation. */ - -bfd_reloc_status_type -mips_elf64_highest_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 we're relocating, and this is an external symbol, we don't - want to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - if (((reloc_entry->addend & 0xffffffffffff) + 0x800080008000) - & ~0xffffffffffff) - reloc_entry->addend += 0x800080008000; - - return bfd_reloc_continue; -} - -/* Do a R_MIPS_GOT16 reloc. This is a reloc against the global offset - table used for PIC code. If the symbol is an external symbol, the - instruction is modified to contain the offset of the appropriate - entry in the global offset table. If the symbol is a section - symbol, the next reloc is a R_MIPS_LO16 reloc. The two 16 bit - addends are combined to form the real addend against the section - symbol; the GOT16 is modified to contain the offset of an entry in - the global offset table, and the LO16 is modified to offset it - appropriately. Thus an offset larger than 16 bits requires a - modified value in the global offset table. - - This implementation suffices for the assembler, but the linker does - not yet know how to create global offset tables. */ - -bfd_reloc_status_type -mips_elf64_got16_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - /* If we're relocating, and this an external symbol, we don't want - to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* If we're relocating, and this is a local symbol, we can handle it - just like HI16. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) != 0) - return mips_elf64_hi16_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message); - - abort (); -} - -/* Set the GP value for OUTPUT_BFD. Returns false if this is a - dangerous relocation. */ - -static boolean -mips_elf64_assign_gp (output_bfd, pgp) - bfd *output_bfd; - bfd_vma *pgp; -{ - unsigned int count; - asymbol **sym; - unsigned int i; - - /* If we've already figured out what GP will be, just return it. */ - *pgp = _bfd_get_gp_value (output_bfd); - if (*pgp) - return true; - - count = bfd_get_symcount (output_bfd); - sym = bfd_get_outsymbols (output_bfd); - - /* The linker script will have created a symbol named `_gp' with the - appropriate value. */ - if (sym == (asymbol **) NULL) - i = count; - else - { - for (i = 0; i < count; i++, sym++) - { - register CONST char *name; - - name = bfd_asymbol_name (*sym); - if (*name == '_' && strcmp (name, "_gp") == 0) - { - *pgp = bfd_asymbol_value (*sym); - _bfd_set_gp_value (output_bfd, *pgp); - break; - } - } - } - - if (i >= count) - { - /* Only get the error once. */ - *pgp = 4; - _bfd_set_gp_value (output_bfd, *pgp); - return false; - } - - return true; -} - -/* We have to figure out the gp value, so that we can adjust the - symbol value correctly. We look up the symbol _gp in the output - BFD. If we can't find it, we're stuck. We cache it in the ELF - target data. We don't need to adjust the symbol value for an - external symbol if we are producing relocateable output. */ - -static bfd_reloc_status_type -mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, pgp) - bfd *output_bfd; - asymbol *symbol; - boolean relocateable; - char **error_message; - bfd_vma *pgp; -{ - if (bfd_is_und_section (symbol->section) - && ! relocateable) - { - *pgp = 0; - return bfd_reloc_undefined; - } - - *pgp = _bfd_get_gp_value (output_bfd); - if (*pgp == 0 - && (! relocateable - || (symbol->flags & BSF_SECTION_SYM) != 0)) - { - if (relocateable) - { - /* Make up a value. */ - *pgp = symbol->section->output_section->vma + 0x4000; - _bfd_set_gp_value (output_bfd, *pgp); - } - else if (!mips_elf64_assign_gp (output_bfd, pgp)) - { - *error_message = - (char *) _("GP relative relocation when _gp not defined"); - return bfd_reloc_dangerous; - } - } - - return bfd_reloc_ok; -} - -/* Do a R_MIPS_GPREL16 relocation. This is a 16 bit value which must - become the offset from the gp register. */ - -bfd_reloc_status_type -mips_elf64_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - boolean relocateable; - bfd_reloc_status_type ret; - bfd_vma gp; - - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - if (output_bfd != (bfd *) NULL) - relocateable = true; - else - { - relocateable = false; - output_bfd = symbol->section->output_section->owner; - } - - ret = mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, - &gp); - if (ret != bfd_reloc_ok) - return ret; - - return gprel16_with_gp (abfd, symbol, reloc_entry, input_section, - relocateable, data, gp); -} - -static bfd_reloc_status_type -gprel16_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data, - gp) - bfd *abfd; - asymbol *symbol; - arelent *reloc_entry; - asection *input_section; - boolean relocateable; - PTR data; - bfd_vma gp; -{ - bfd_vma relocation; - unsigned long insn; - unsigned long val; - - if (bfd_is_com_section (symbol->section)) - relocation = 0; - else - relocation = symbol->value; - - relocation += symbol->section->output_section->vma; - relocation += symbol->section->output_offset; - - if (reloc_entry->address > input_section->_cooked_size) - return bfd_reloc_outofrange; - - insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - - /* Set val to the offset into the section or symbol. */ - if (reloc_entry->howto->src_mask == 0) - { - /* This case occurs with the 64-bit MIPS ELF ABI. */ - val = reloc_entry->addend; - } - else - { - val = ((insn & 0xffff) + reloc_entry->addend) & 0xffff; - if (val & 0x8000) - val -= 0x10000; - } - - /* Adjust val for the final section location and GP value. If we - are producing relocateable output, we don't want to do this for - an external symbol. */ - if (! relocateable - || (symbol->flags & BSF_SECTION_SYM) != 0) - val += relocation - gp; - - insn = (insn & ~0xffff) | (val & 0xffff); - bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); - - if (relocateable) - reloc_entry->address += input_section->output_offset; - - else if ((long) val >= 0x8000 || (long) val < -0x8000) - return bfd_reloc_overflow; - - return bfd_reloc_ok; -} - -/* Do a R_MIPS_GPREL16 RELA relocation. */ - -bfd_reloc_status_type -mips_elf64_gprel16_reloca (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - boolean relocateable; - bfd_vma gp; - - /* This works only for NewABI. */ - BFD_ASSERT (reloc_entry->howto->src_mask == 0); - - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - if (output_bfd != (bfd *) NULL) - relocateable = true; - else - { - relocateable = false; - output_bfd = symbol->section->output_section->owner; - } - - if (prev_reloc_address != reloc_entry->address) - prev_reloc_address = reloc_entry->address; - else - { - mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, - &gp); - prev_reloc_addend = reloc_entry->addend + reloc_entry->address - gp; - if (symbol->flags & BSF_LOCAL) - prev_reloc_addend += _bfd_get_gp_value (abfd); -/*fprintf(stderr, "Addend: %lx, Next Addend: %lx\n", reloc_entry->addend, prev_reloc_addend);*/ - } - - return bfd_reloc_ok; -} - -/* Do a R_MIPS_LITERAL relocation. */ - -bfd_reloc_status_type -mips_elf64_literal_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - /* If we're relocating, and this is an external symbol, we don't - want to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* FIXME: The entries in the .lit8 and .lit4 sections should be merged. - Currently we simply call mips_elf64_gprel16_reloc. */ - return mips_elf64_gprel16_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message); -} - -/* Do a R_MIPS_GPREL32 relocation. Is this 32 bit value the offset - from the gp register? XXX */ - -bfd_reloc_status_type -mips_elf64_gprel32_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ - boolean relocateable; - bfd_reloc_status_type ret; - bfd_vma gp; - bfd_vma relocation; - unsigned long val; - - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - *error_message = (char *) - _("32bits gp relative relocation occurs for an external symbol"); - return bfd_reloc_outofrange; - } - - if (output_bfd != (bfd *) NULL) - { - relocateable = true; - gp = _bfd_get_gp_value (output_bfd); - } - else - { - relocateable = false; - output_bfd = symbol->section->output_section->owner; - - ret = mips_elf64_final_gp (output_bfd, symbol, relocateable, - error_message, &gp); - if (ret != bfd_reloc_ok) - return ret; - } - - if (bfd_is_com_section (symbol->section)) - relocation = 0; - else - relocation = symbol->value; - - relocation += symbol->section->output_section->vma; - relocation += symbol->section->output_offset; - - if (reloc_entry->address > input_section->_cooked_size) - return bfd_reloc_outofrange; - - if (reloc_entry->howto->src_mask == 0) - { - /* This case arises with the 64-bit MIPS ELF ABI. */ - val = 0; - } - else - val = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - - /* Set val to the offset into the section or symbol. */ - val += reloc_entry->addend; - - /* Adjust val for the final section location and GP value. If we - are producing relocateable output, we don't want to do this for - an external symbol. */ - if (! relocateable - || (symbol->flags & BSF_SECTION_SYM) != 0) - val += relocation - gp; - - bfd_put_32 (abfd, val, (bfd_byte *) data + reloc_entry->address); - - if (relocateable) - reloc_entry->address += input_section->output_offset; - - return bfd_reloc_ok; -} - -/* Do a R_MIPS_SHIFT6 relocation. The MSB of the shift is stored at bit 2, - the rest is at bits 6-10. The bitpos alredy got right by the howto. */ - -bfd_reloc_status_type -mips_elf64_shift6_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 we're relocating, and this is an external symbol, we don't - want to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - reloc_entry->addend = (reloc_entry->addend & 0x00007c0) - | (reloc_entry->addend & 0x00000800) >> 9; - - return bfd_reloc_continue; -} - -static int -mips_elf64_additional_program_headers (abfd) - bfd *abfd; -{ - int ret = 0; - - /* See if we need a PT_MIPS_OPTIONS segment. */ - if (bfd_get_section_by_name (abfd, ".MIPS.options")) - ++ret; - - return ret; -} - -/* Given a BFD reloc type, return a howto structure. */ - -static reloc_howto_type * -mips_elf64_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; -{ - /* FIXME: We default to RELA here instead of choosing the right - relocation variant. */ - reloc_howto_type *howto_table = mips_elf64_howto_table_rela; - - switch (code) - { - case BFD_RELOC_NONE: - return &howto_table[R_MIPS_NONE]; - case BFD_RELOC_16: - return &howto_table[R_MIPS_16]; - case BFD_RELOC_32: - return &howto_table[R_MIPS_32]; - case BFD_RELOC_64: - case BFD_RELOC_CTOR: - /* We need to handle these specially. Select the right - relocation (R_MIPS_32 or R_MIPS_64) based on the - size of addresses on this architecture. */ - if (bfd_arch_bits_per_address (abfd) == 32) - return &howto_table[R_MIPS_32]; - else - return &howto_table[R_MIPS_64]; - - case BFD_RELOC_16_PCREL: - return &howto_table[R_MIPS_PC16]; - case BFD_RELOC_HI16_S: - return &howto_table[R_MIPS_HI16]; - case BFD_RELOC_LO16: - return &howto_table[R_MIPS_LO16]; - case BFD_RELOC_GPREL16: - return &howto_table[R_MIPS_GPREL16]; - case BFD_RELOC_GPREL32: - return &howto_table[R_MIPS_GPREL32]; - case BFD_RELOC_MIPS_JMP: - return &howto_table[R_MIPS_26]; - case BFD_RELOC_MIPS_LITERAL: - return &howto_table[R_MIPS_LITERAL]; - case BFD_RELOC_MIPS_GOT16: - return &howto_table[R_MIPS_GOT16]; - case BFD_RELOC_MIPS_CALL16: - return &howto_table[R_MIPS_CALL16]; - case BFD_RELOC_MIPS_SHIFT5: - return &howto_table[R_MIPS_SHIFT5]; - case BFD_RELOC_MIPS_SHIFT6: - return &howto_table[R_MIPS_SHIFT6]; - case BFD_RELOC_MIPS_GOT_DISP: - return &howto_table[R_MIPS_GOT_DISP]; - case BFD_RELOC_MIPS_GOT_PAGE: - return &howto_table[R_MIPS_GOT_PAGE]; - case BFD_RELOC_MIPS_GOT_OFST: - return &howto_table[R_MIPS_GOT_OFST]; - case BFD_RELOC_MIPS_GOT_HI16: - return &howto_table[R_MIPS_GOT_HI16]; - case BFD_RELOC_MIPS_GOT_LO16: - return &howto_table[R_MIPS_GOT_LO16]; - case BFD_RELOC_MIPS_SUB: - return &howto_table[R_MIPS_SUB]; - case BFD_RELOC_MIPS_INSERT_A: - return &howto_table[R_MIPS_INSERT_A]; - case BFD_RELOC_MIPS_INSERT_B: - return &howto_table[R_MIPS_INSERT_B]; - case BFD_RELOC_MIPS_DELETE: - return &howto_table[R_MIPS_DELETE]; - case BFD_RELOC_MIPS_HIGHEST: - return &howto_table[R_MIPS_HIGHEST]; - case BFD_RELOC_MIPS_HIGHER: - return &howto_table[R_MIPS_HIGHER]; - case BFD_RELOC_MIPS_CALL_HI16: - return &howto_table[R_MIPS_CALL_HI16]; - case BFD_RELOC_MIPS_CALL_LO16: - return &howto_table[R_MIPS_CALL_LO16]; - case BFD_RELOC_MIPS_SCN_DISP: - return &howto_table[R_MIPS_SCN_DISP]; - case BFD_RELOC_MIPS_REL16: - return &howto_table[R_MIPS_REL16]; - /* Use of R_MIPS_ADD_IMMEDIATE and R_MIPS_PJUMP is deprecated. */ - case BFD_RELOC_MIPS_RELGOT: - return &howto_table[R_MIPS_RELGOT]; - case BFD_RELOC_MIPS_JALR: - return &howto_table[R_MIPS_JALR]; -/* - case BFD_RELOC_MIPS16_JMP: - return &elf_mips16_jump_howto; - case BFD_RELOC_MIPS16_GPREL: - return &elf_mips16_gprel_howto; - case BFD_RELOC_VTABLE_INHERIT: - return &elf_mips_gnu_vtinherit_howto; - case BFD_RELOC_VTABLE_ENTRY: - return &elf_mips_gnu_vtentry_howto; - case BFD_RELOC_PCREL_HI16_S: - return &elf_mips_gnu_rel_hi16; - case BFD_RELOC_PCREL_LO16: - return &elf_mips_gnu_rel_lo16; - case BFD_RELOC_16_PCREL_S2: - return &elf_mips_gnu_rel16_s2; - case BFD_RELOC_64_PCREL: - return &elf_mips_gnu_pcrel64; - case BFD_RELOC_32_PCREL: - return &elf_mips_gnu_pcrel32; -*/ - default: - bfd_set_error (bfd_error_bad_value); - return NULL; - } -} - -/* Prevent relocation handling by bfd for MIPS ELF64. */ - -static void -mips_elf64_info_to_howto_rel (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr ATTRIBUTE_UNUSED; - Elf64_Internal_Rel *dst ATTRIBUTE_UNUSED; -{ - BFD_ASSERT (0); -} - -static void -mips_elf64_info_to_howto_rela (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr ATTRIBUTE_UNUSED; - Elf64_Internal_Rela *dst ATTRIBUTE_UNUSED; -{ - BFD_ASSERT (0); -} - -/* Since each entry in an SHT_REL or SHT_RELA section can represent up - to three relocs, we must tell the user to allocate more space. */ - -static long -mips_elf64_get_reloc_upper_bound (abfd, sec) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec; -{ - return (sec->reloc_count * 3 + 1) * sizeof (arelent *); -} - -/* Read the relocations from one reloc section. */ - -static boolean -mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr) - bfd *abfd; - asection *asect; - asymbol **symbols; - const Elf_Internal_Shdr *rel_hdr; -{ - PTR allocated = NULL; - bfd_byte *native_relocs; - arelent *relents; - arelent *relent; - bfd_vma count; - bfd_vma i; - int entsize; - reloc_howto_type *howto_table; - - allocated = (PTR) bfd_malloc (rel_hdr->sh_size); - if (allocated == NULL) - return false; - - if (bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_bread (allocated, rel_hdr->sh_size, abfd) != rel_hdr->sh_size)) - goto error_return; - - native_relocs = (bfd_byte *) allocated; - - relents = asect->relocation + asect->reloc_count; - - entsize = rel_hdr->sh_entsize; - BFD_ASSERT (entsize == sizeof (Elf64_Mips_External_Rel) - || entsize == sizeof (Elf64_Mips_External_Rela)); - - count = rel_hdr->sh_size / entsize; - - if (entsize == sizeof (Elf64_Mips_External_Rel)) - howto_table = mips_elf64_howto_table_rel; - else - howto_table = mips_elf64_howto_table_rela; - - relent = relents; - for (i = 0; i < count; i++, native_relocs += entsize) - { - Elf64_Mips_Internal_Rela rela; - boolean used_sym, used_ssym; - int ir; - - if (entsize == sizeof (Elf64_Mips_External_Rela)) - mips_elf64_swap_reloca_in (abfd, - (Elf64_Mips_External_Rela *) native_relocs, - &rela); - else - { - Elf64_Mips_Internal_Rel rel; - - mips_elf64_swap_reloc_in (abfd, - (Elf64_Mips_External_Rel *) native_relocs, - &rel); - rela.r_offset = rel.r_offset; - rela.r_sym = rel.r_sym; - rela.r_ssym = rel.r_ssym; - rela.r_type3 = rel.r_type3; - rela.r_type2 = rel.r_type2; - rela.r_type = rel.r_type; - rela.r_addend = 0; - } - - /* Each entry represents up to three actual relocations. */ - - used_sym = false; - used_ssym = false; - for (ir = 0; ir < 3; ir++) - { - enum elf_mips_reloc_type type; - - switch (ir) - { - default: - abort (); - case 0: - type = (enum elf_mips_reloc_type) rela.r_type; - break; - case 1: - type = (enum elf_mips_reloc_type) rela.r_type2; - break; - case 2: - type = (enum elf_mips_reloc_type) rela.r_type3; - break; - } - - if (type == R_MIPS_NONE) - { - /* There are no more relocations in this entry. If this - is the first entry, we need to generate a dummy - relocation so that the generic linker knows that - there has been a break in the sequence of relocations - applying to a particular address. */ - if (ir == 0) - { - relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - relent->address = rela.r_offset; - else - relent->address = rela.r_offset - asect->vma; - relent->addend = 0; - relent->howto = &howto_table[(int) R_MIPS_NONE]; - ++relent; - } - break; - } - - /* Some types require symbols, whereas some do not. */ - switch (type) - { - case R_MIPS_NONE: - case R_MIPS_LITERAL: - case R_MIPS_INSERT_A: - case R_MIPS_INSERT_B: - case R_MIPS_DELETE: - relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - break; - - default: - if (! used_sym) - { - if (rela.r_sym == 0) - relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - else - { - asymbol **ps, *s; - - ps = symbols + rela.r_sym - 1; - s = *ps; - if ((s->flags & BSF_SECTION_SYM) == 0) - relent->sym_ptr_ptr = ps; - else - relent->sym_ptr_ptr = s->section->symbol_ptr_ptr; - } - - used_sym = true; - } - else if (! used_ssym) - { - switch (rela.r_ssym) - { - case RSS_UNDEF: - relent->sym_ptr_ptr = - bfd_abs_section_ptr->symbol_ptr_ptr; - break; - - case RSS_GP: - case RSS_GP0: - case RSS_LOC: - /* FIXME: I think these need to be handled using - special howto structures. */ - BFD_ASSERT (0); - break; - - default: - BFD_ASSERT (0); - break; - } - - used_ssym = true; - } - else - relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - - break; - } - - /* 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 BFD reloc is always - section relative. */ - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - relent->address = rela.r_offset; - else - relent->address = rela.r_offset - asect->vma; - - relent->addend = rela.r_addend; - - relent->howto = &howto_table[(int) type]; - - ++relent; - } - } - - asect->reloc_count += relent - relents; - - if (allocated != NULL) - free (allocated); - - return true; - - error_return: - if (allocated != NULL) - free (allocated); - return false; -} - -/* Read the relocations. On Irix 6, there can be two reloc sections - associated with a single data section. */ - -static boolean -mips_elf64_slurp_reloc_table (abfd, asect, symbols, dynamic) - bfd *abfd; - asection *asect; - asymbol **symbols; - boolean dynamic; -{ - bfd_size_type amt; - struct bfd_elf_section_data * const d = elf_section_data (asect); - - if (dynamic) - { - bfd_set_error (bfd_error_invalid_operation); - return false; - } - - if (asect->relocation != NULL - || (asect->flags & SEC_RELOC) == 0 - || asect->reloc_count == 0) - return true; - - /* Allocate space for 3 arelent structures for each Rel structure. */ - amt = asect->reloc_count; - amt *= 3 * sizeof (arelent); - asect->relocation = (arelent *) bfd_alloc (abfd, amt); - if (asect->relocation == NULL) - return false; - - /* The slurp_one_reloc_table routine increments reloc_count. */ - asect->reloc_count = 0; - - if (! mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, &d->rel_hdr)) - return false; - if (d->rel_hdr2 != NULL) - { - if (! mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, - d->rel_hdr2)) - return false; - } - - return true; -} - -/* Write out the relocations. */ - -static void -mips_elf64_write_relocs (abfd, sec, data) - bfd *abfd; - asection *sec; - PTR data; -{ - boolean *failedp = (boolean *) data; - int count; - Elf_Internal_Shdr *rel_hdr; - unsigned int idx; - - /* If we have already failed, don't do anything. */ - if (*failedp) - return; - - if ((sec->flags & SEC_RELOC) == 0) - return; - - /* The linker backend writes the relocs out itself, and sets the - reloc_count field to zero to inhibit writing them here. Also, - sometimes the SEC_RELOC flag gets set even when there aren't any - relocs. */ - if (sec->reloc_count == 0) - return; - - /* We can combine up to three relocs that refer to the same address - if the latter relocs have no associated symbol. */ - count = 0; - for (idx = 0; idx < sec->reloc_count; idx++) - { - bfd_vma addr; - unsigned int i; - - ++count; - - addr = sec->orelocation[idx]->address; - for (i = 0; i < 2; i++) - { - arelent *r; - - if (idx + 1 >= sec->reloc_count) - break; - r = sec->orelocation[idx + 1]; - if (r->address != addr - || ! bfd_is_abs_section ((*r->sym_ptr_ptr)->section) - || (*r->sym_ptr_ptr)->value != 0) - break; - - /* We can merge the reloc at IDX + 1 with the reloc at IDX. */ - - ++idx; - } - } - - rel_hdr = &elf_section_data (sec)->rel_hdr; - - /* Do the actual relocation. */ - - if (rel_hdr->sh_entsize == sizeof(Elf64_Mips_External_Rel)) - mips_elf64_write_rel (abfd, sec, rel_hdr, &count, data); - else if (rel_hdr->sh_entsize == sizeof(Elf64_Mips_External_Rela)) - mips_elf64_write_rela (abfd, sec, rel_hdr, &count, data); - else - BFD_ASSERT (0); -} - -static void -mips_elf64_write_rel (abfd, sec, rel_hdr, count, data) - bfd *abfd; - asection *sec; - Elf_Internal_Shdr *rel_hdr; - int *count; - PTR data; -{ - boolean *failedp = (boolean *) data; - Elf64_Mips_External_Rel *ext_rel; - unsigned int idx; - asymbol *last_sym = 0; - int last_sym_idx = 0; - - rel_hdr->sh_size = (bfd_vma)(rel_hdr->sh_entsize * *count); - rel_hdr->contents = (PTR) bfd_alloc (abfd, rel_hdr->sh_size); - if (rel_hdr->contents == NULL) - { - *failedp = true; - return; - } - - ext_rel = (Elf64_Mips_External_Rel *) rel_hdr->contents; - for (idx = 0; idx < sec->reloc_count; idx++, ext_rel++) - { - arelent *ptr; - Elf64_Mips_Internal_Rel int_rel; - asymbol *sym; - int n; - unsigned int i; - - ptr = sec->orelocation[idx]; - - /* 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 BFD reloc is always section relative. */ - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - int_rel.r_offset = ptr->address; - else - int_rel.r_offset = ptr->address + sec->vma; - - sym = *ptr->sym_ptr_ptr; - if (sym == last_sym) - n = last_sym_idx; - else - { - last_sym = sym; - n = _bfd_elf_symbol_from_bfd_symbol (abfd, &sym); - if (n < 0) - { - *failedp = true; - return; - } - last_sym_idx = n; - } - - int_rel.r_sym = n; - int_rel.r_ssym = RSS_UNDEF; - - if ((*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec - && ! _bfd_elf_validate_reloc (abfd, ptr)) - { - *failedp = true; - return; - } - - int_rel.r_type = ptr->howto->type; - int_rel.r_type2 = (int) R_MIPS_NONE; - int_rel.r_type3 = (int) R_MIPS_NONE; - - for (i = 0; i < 2; i++) - { - arelent *r; - - if (idx + 1 >= sec->reloc_count) - break; - r = sec->orelocation[idx + 1]; - if (r->address != ptr->address - || ! bfd_is_abs_section ((*r->sym_ptr_ptr)->section) - || (*r->sym_ptr_ptr)->value != 0) - break; - - /* We can merge the reloc at IDX + 1 with the reloc at IDX. */ - - if (i == 0) - int_rel.r_type2 = r->howto->type; - else - int_rel.r_type3 = r->howto->type; - - ++idx; - } - - mips_elf64_swap_reloc_out (abfd, &int_rel, ext_rel); - } - - BFD_ASSERT (ext_rel - (Elf64_Mips_External_Rel *) rel_hdr->contents - == *count); -} - -static void -mips_elf64_write_rela (abfd, sec, rela_hdr, count, data) - bfd *abfd; - asection *sec; - Elf_Internal_Shdr *rela_hdr; - int *count; - PTR data; -{ - boolean *failedp = (boolean *) data; - Elf64_Mips_External_Rela *ext_rela; - unsigned int idx; - asymbol *last_sym = 0; - int last_sym_idx = 0; - - rela_hdr->sh_size = (bfd_vma)(rela_hdr->sh_entsize * *count); - rela_hdr->contents = (PTR) bfd_alloc (abfd, rela_hdr->sh_size); - if (rela_hdr->contents == NULL) - { - *failedp = true; - return; - } - - ext_rela = (Elf64_Mips_External_Rela *) rela_hdr->contents; - for (idx = 0; idx < sec->reloc_count; idx++, ext_rela++) - { - arelent *ptr; - Elf64_Mips_Internal_Rela int_rela; - asymbol *sym; - int n; - unsigned int i; - - ptr = sec->orelocation[idx]; - - /* 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 BFD reloc is always section relative. */ - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - int_rela.r_offset = ptr->address; - else - int_rela.r_offset = ptr->address + sec->vma; - - sym = *ptr->sym_ptr_ptr; - if (sym == last_sym) - n = last_sym_idx; - else - { - last_sym = sym; - n = _bfd_elf_symbol_from_bfd_symbol (abfd, &sym); - if (n < 0) - { - *failedp = true; - return; - } - last_sym_idx = n; - } - - int_rela.r_sym = n; - int_rela.r_addend = ptr->addend; - int_rela.r_ssym = RSS_UNDEF; - - if ((*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec - && ! _bfd_elf_validate_reloc (abfd, ptr)) - { - *failedp = true; - return; - } - - int_rela.r_type = ptr->howto->type; - int_rela.r_type2 = (int) R_MIPS_NONE; - int_rela.r_type3 = (int) R_MIPS_NONE; - - for (i = 0; i < 2; i++) - { - arelent *r; - - if (idx + 1 >= sec->reloc_count) - break; - r = sec->orelocation[idx + 1]; - if (r->address != ptr->address - || ! bfd_is_abs_section ((*r->sym_ptr_ptr)->section) - || (*r->sym_ptr_ptr)->value != 0) - break; - - /* We can merge the reloc at IDX + 1 with the reloc at IDX. */ - - if (i == 0) - int_rela.r_type2 = r->howto->type; - else - int_rela.r_type3 = r->howto->type; - - ++idx; - } - - mips_elf64_swap_reloca_out (abfd, &int_rela, ext_rela); - } - - BFD_ASSERT (ext_rela - (Elf64_Mips_External_Rela *) rela_hdr->contents - == *count); -} - -/* This structure is used to hold .got information when linking. It - is stored in the tdata field of the bfd_elf_section_data structure. */ - -struct mips_elf64_got_info -{ - /* The global symbol in the GOT with the lowest index in the dynamic - symbol table. */ - struct elf_link_hash_entry *global_gotsym; - /* The number of global .got entries. */ - unsigned int global_gotno; - /* The number of local .got entries. */ - unsigned int local_gotno; - /* The number of local .got entries we have used. */ - unsigned int assigned_gotno; -}; - -/* The MIPS ELF64 linker needs additional information for each symbol in - the global hash table. */ - -struct mips_elf64_link_hash_entry -{ - struct elf_link_hash_entry root; - - /* External symbol information. */ - EXTR esym; - - /* Number of R_MIPS_32, R_MIPS_REL32, or R_MIPS_64 relocs against - this symbol. */ - unsigned int possibly_dynamic_relocs; - - /* If the R_MIPS_32, R_MIPS_REL32, or R_MIPS_64 reloc is against - a readonly section. */ - boolean readonly_reloc; - - /* The index of the first dynamic relocation (in the .rel.dyn - section) against this symbol. */ - unsigned int min_dyn_reloc_index; - - /* We must not create a stub for a symbol that has relocations - related to taking the function's address, i.e. any but - R_MIPS_CALL*16 ones -- see "MIPS ABI Supplement, 3rd Edition", - p. 4-20. */ - boolean no_fn_stub; - - /* If there is a stub that 32 bit functions should use to call this - 16 bit function, this points to the section containing the stub. */ - asection *fn_stub; - - /* Whether we need the fn_stub; this is set if this symbol appears - in any relocs other than a 16 bit call. */ - boolean need_fn_stub; - - /* If there is a stub that 16 bit functions should use to call this - 32 bit function, this points to the section containing the stub. */ - asection *call_stub; - - /* This is like the call_stub field, but it is used if the function - being called returns a floating point value. */ - asection *call_fp_stub; -}; - - /* The mips16 compiler uses a couple of special sections to handle - floating point arguments. - - Section names that look like .mips16.fn.FNNAME contain stubs that - copy floating point arguments from the fp regs to the gp regs and - then jump to FNNAME. If any 32 bit function calls FNNAME, the - call should be redirected to the stub instead. If no 32 bit - function calls FNNAME, the stub should be discarded. We need to - consider any reference to the function, not just a call, because - if the address of the function is taken we will need the stub, - since the address might be passed to a 32 bit function. - - Section names that look like .mips16.call.FNNAME contain stubs - that copy floating point arguments from the gp regs to the fp - regs and then jump to FNNAME. If FNNAME is a 32 bit function, - then any 16 bit function that calls FNNAME should be redirected - to the stub instead. If FNNAME is not a 32 bit function, the - stub should be discarded. - - .mips16.call.fp.FNNAME sections are similar, but contain stubs - which call FNNAME and then copy the return value from the fp regs - to the gp regs. These stubs store the return value in $18 while - calling FNNAME; any function which might call one of these stubs - must arrange to save $18 around the call. (This case is not - needed for 32 bit functions that call 16 bit functions, because - 16 bit functions always return floating point values in both - $f0/$f1 and $2/$3.) - - Note that in all cases FNNAME might be defined statically. - Therefore, FNNAME is not used literally. Instead, the relocation - information will indicate which symbol the section is for. - - We record any stubs that we find in the symbol table. */ - -#define FN_STUB ".mips16.fn." -#define CALL_STUB ".mips16.call." -#define CALL_FP_STUB ".mips16.call.fp." - -/* MIPS ELF64 linker hash table. */ - -struct mips_elf64_link_hash_table -{ - struct elf_link_hash_table root; - /* This is set if we see any mips16 stub sections. */ - boolean mips16_stubs_seen; -}; - -/* Look up an entry in a MIPS ELF64 linker hash table. */ - -#define mips_elf64_link_hash_lookup(table, string, create, copy, follow) \ - ((struct mips_elf64_link_hash_entry *) \ - elf_link_hash_lookup (&(table)->root, (string), (create), \ - (copy), (follow))) - -/* Traverse a MIPS ELF linker hash table. */ - -#define mips_elf64_link_hash_traverse(table, func, info) \ - (elf_link_hash_traverse \ - (&(table)->root, \ - (boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ - (info))) - -/* Get the MIPS ELF64 linker hash table from a link_info structure. */ - -#define mips_elf64_hash_table(p) \ - ((struct mips_elf64_link_hash_table *) ((p)->hash)) - -/* Create an entry in a MIPS ELF64 linker hash table. */ - -static struct bfd_hash_entry * -mips_elf64_link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; -{ - struct mips_elf64_link_hash_entry *ret = - (struct mips_elf64_link_hash_entry *) entry; - - /* Allocate the structure if it has not already been allocated by a - subclass. */ - if (ret == (struct mips_elf64_link_hash_entry *) NULL) - ret = ((struct mips_elf64_link_hash_entry *) - bfd_hash_allocate (table, - sizeof (struct mips_elf64_link_hash_entry))); - if (ret == (struct mips_elf64_link_hash_entry *) NULL) - return (struct bfd_hash_entry *) ret; - - /* Call the allocation method of the superclass. */ - ret = ((struct mips_elf64_link_hash_entry *) - _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, - table, string)); - if (ret != (struct mips_elf64_link_hash_entry *) NULL) - { - /* Set local fields. */ - memset (&ret->esym, 0, sizeof (EXTR)); - /* We use -2 as a marker to indicate that the information has - not been set. -1 means there is no associated ifd. */ - ret->esym.ifd = -2; - ret->possibly_dynamic_relocs = 0; - ret->readonly_reloc = false; - ret->min_dyn_reloc_index = 0; - ret->no_fn_stub = false; - ret->fn_stub = NULL; - ret->need_fn_stub = false; - ret->call_stub = NULL; - ret->call_fp_stub = NULL; - } - - return (struct bfd_hash_entry *) ret; -} - -/* Create a MIPS ELF64 linker hash table. */ - -struct bfd_link_hash_table * -mips_elf64_link_hash_table_create (abfd) - bfd *abfd; -{ - struct mips_elf64_link_hash_table *ret; - - ret = ((struct mips_elf64_link_hash_table *) - bfd_alloc (abfd, sizeof (struct mips_elf64_link_hash_table))); - if (ret == (struct mips_elf64_link_hash_table *) NULL) - return NULL; - - if (! _bfd_elf_link_hash_table_init (&ret->root, abfd, - mips_elf64_link_hash_newfunc)) - { - bfd_release (abfd, ret); - return NULL; - } - - ret->mips16_stubs_seen = false; - - return &ret->root.root; -} - -/* Returns the offset for the entry at the INDEXth position - in the GOT. */ - -static bfd_vma -mips_elf64_got_offset_from_index (dynobj, output_bfd, index) - bfd *dynobj; - bfd *output_bfd; - bfd_vma index; -{ - asection *sgot; - bfd_vma gp; - - sgot = bfd_get_section_by_name (dynobj, ".got"); - gp = _bfd_get_gp_value (output_bfd); - return (sgot->output_section->vma + sgot->output_offset + index - - gp); -} - -/* Returns the GOT information associated with the link indicated by - INFO. If SGOTP is non-NULL, it is filled in with the GOT - section. */ - -static struct mips_elf64_got_info * -_mips_elf64_got_info (abfd, sgotp) - bfd *abfd; - asection **sgotp; -{ - asection *sgot; - struct mips_elf64_got_info *g; - - sgot = bfd_get_section_by_name (abfd, ".got"); - BFD_ASSERT (sgot != NULL); - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_elf64_got_info *) elf_section_data (sgot)->tdata; - BFD_ASSERT (g != NULL); - - if (sgotp) - *sgotp = sgot; - return g; -} - -/* Sign-extend VALUE, which has the indicated number of BITS. */ - -static bfd_vma -mips_elf64_sign_extend (value, bits) - bfd_vma value; - int bits; -{ - if (value & ((bfd_vma)1 << (bits - 1))) - /* VALUE is negative. */ - value |= ((bfd_vma) - 1) << bits; - - return value; -} - -/* Return non-zero if the indicated VALUE has overflowed the maximum - range expressable by a signed number with the indicated number of - BITS. */ - -static boolean -mips_elf64_overflow_p (value, bits) - bfd_vma value; - int bits; -{ - bfd_signed_vma svalue = (bfd_signed_vma) value; - - if (svalue > (1 << (bits - 1)) - 1) - /* The value is too big. */ - return true; - else if (svalue < -(1 << (bits - 1))) - /* The value is too small. */ - return true; - - /* All is well. */ - return false; -} - -/* Returns the GOT index for the global symbol indicated by H. */ - -static bfd_vma -mips_elf64_global_got_index (abfd, h) - bfd *abfd; - struct elf_link_hash_entry *h; -{ - bfd_vma index; - asection *sgot; - struct mips_elf64_got_info *g; - - g = _mips_elf64_got_info (abfd, &sgot); - - /* Once we determine the global GOT entry with the lowest dynamic - symbol table index, we must put all dynamic symbols with greater - indices into the GOT. That makes it easy to calculate the GOT - offset. */ - BFD_ASSERT (h->dynindx >= g->global_gotsym->dynindx); - index = ((h->dynindx - g->global_gotsym->dynindx + g->local_gotno) - * (get_elf_backend_data (abfd)->s->arch_size / 8)); - BFD_ASSERT (index < sgot->_raw_size); - - return index; -} - -struct mips_elf64_hash_sort_data -{ - /* The symbol in the global GOT with the lowest dynamic symbol table - index. */ - struct elf_link_hash_entry *low; - /* The least dynamic symbol table index corresponding to a symbol - with a GOT entry. */ - long min_got_dynindx; - /* The greatest dynamic symbol table index not corresponding to a - symbol without a GOT entry. */ - long max_non_got_dynindx; -}; - -/* If H needs a GOT entry, assign it the highest available dynamic - index. Otherwise, assign it the lowest available dynamic - index. */ - -static boolean -mips_elf64_sort_hash_table_f (h, data) - struct mips_elf64_link_hash_entry *h; - PTR data; -{ - struct mips_elf64_hash_sort_data *hsd - = (struct mips_elf64_hash_sort_data *) data; - - if (h->root.root.type == bfd_link_hash_warning) - h = (struct mips_elf64_link_hash_entry *) h->root.root.u.i.link; - - /* Symbols without dynamic symbol table entries aren't interesting - at all. */ - if (h->root.dynindx == -1) - return true; - - if (h->root.got.offset != 1) - h->root.dynindx = hsd->max_non_got_dynindx++; - else - { - h->root.dynindx = --hsd->min_got_dynindx; - hsd->low = (struct elf_link_hash_entry *) h; - } - - return true; -} - -/* Sort the dynamic symbol table so that symbols that need GOT entries - appear towards the end. This reduces the amount of GOT space - required. MAX_LOCAL is used to set the number of local symbols - known to be in the dynamic symbol table. During - mips_elf64_size_dynamic_sections, this value is 1. Afterward, the - section symbols are added and the count is higher. */ - -static boolean -mips_elf64_sort_hash_table (info, max_local) - struct bfd_link_info *info; - unsigned long max_local; -{ - struct mips_elf64_hash_sort_data hsd; - struct mips_elf64_got_info *g; - bfd *dynobj; - - dynobj = elf_hash_table (info)->dynobj; - - hsd.low = NULL; - hsd.min_got_dynindx = elf_hash_table (info)->dynsymcount; - hsd.max_non_got_dynindx = max_local; - mips_elf64_link_hash_traverse (((struct mips_elf64_link_hash_table *) - elf_hash_table (info)), - mips_elf64_sort_hash_table_f, - &hsd); - - /* There shoud have been enough room in the symbol table to - accomodate both the GOT and non-GOT symbols. */ - BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx); - - /* Now we know which dynamic symbol has the lowest dynamic symbol - table index in the GOT. */ - g = _mips_elf64_got_info (dynobj, NULL); - g->global_gotsym = hsd.low; - - return true; -} - -#if 0 -/* Swap in an MSYM entry. */ - -static void -mips_elf64_swap_msym_in (abfd, ex, in) - bfd *abfd; - const Elf32_External_Msym *ex; - Elf32_Internal_Msym *in; -{ - in->ms_hash_value = H_GET_32 (abfd, ex->ms_hash_value); - in->ms_info = H_GET_32 (abfd, ex->ms_info); -} -#endif -/* Swap out an MSYM entry. */ - -static void -mips_elf64_swap_msym_out (abfd, in, ex) - bfd *abfd; - const Elf32_Internal_Msym *in; - Elf32_External_Msym *ex; -{ - H_PUT_32 (abfd, in->ms_hash_value, ex->ms_hash_value); - H_PUT_32 (abfd, in->ms_info, ex->ms_info); -} - -/* Create a local GOT entry for VALUE. Return the index of the entry, - or -1 if it could not be created. */ - -static bfd_vma -mips_elf64_create_local_got_entry (abfd, g, sgot, value) - bfd *abfd; - struct mips_elf64_got_info *g; - asection *sgot; - bfd_vma value; -{ - CONST bfd_vma got_size = get_elf_backend_data (abfd)->s->arch_size / 8; - - if (g->assigned_gotno >= g->local_gotno) - { - /* We didn't allocate enough space in the GOT. */ - (*_bfd_error_handler) - (_("not enough GOT space for local GOT entries")); - bfd_set_error (bfd_error_bad_value); - return (bfd_vma) -1; - } - - bfd_put_64 (abfd, value, (sgot->contents + got_size * g->assigned_gotno)); - return got_size * g->assigned_gotno++; -} - -/* Returns the GOT offset at which the indicated address can be found. - If there is not yet a GOT entry for this value, create one. Returns - -1 if no satisfactory GOT offset can be found. */ - -static bfd_vma -mips_elf64_local_got_index (abfd, info, value) - bfd *abfd; - struct bfd_link_info *info; - bfd_vma value; -{ - CONST bfd_vma got_size = get_elf_backend_data (abfd)->s->arch_size / 8; - asection *sgot; - struct mips_elf64_got_info *g; - bfd_byte *entry; - - g = _mips_elf64_got_info (elf_hash_table (info)->dynobj, &sgot); - - /* Look to see if we already have an appropriate entry. */ - for (entry = (sgot->contents + got_size * MIPS_RESERVED_GOTNO); - entry != sgot->contents + got_size * g->assigned_gotno; - entry += got_size) - { - bfd_vma address = bfd_get_64 (abfd, entry); - if (address == value) - return entry - sgot->contents; - } - - return mips_elf64_create_local_got_entry (abfd, g, sgot, value); -} - -/* Find a GOT entry that is within 32KB of the VALUE. These entries - are supposed to be placed at small offsets in the GOT, i.e., - within 32KB of GP. Return the index into the GOT for this page, - and store the offset from this entry to the desired address in - OFFSETP, if it is non-NULL. */ - -static bfd_vma -mips_elf64_got_page (abfd, info, value, offsetp) - bfd *abfd; - struct bfd_link_info *info; - bfd_vma value; - bfd_vma *offsetp; -{ - CONST bfd_vma got_size = get_elf_backend_data (abfd)->s->arch_size / 8; - asection *sgot; - struct mips_elf64_got_info *g; - bfd_byte *entry; - bfd_byte *last_entry; - bfd_vma index = 0; - bfd_vma address; - - g = _mips_elf64_got_info (elf_hash_table (info)->dynobj, &sgot); - - /* Look to see if we aleady have an appropriate entry. */ - last_entry = sgot->contents + got_size * g->assigned_gotno; - for (entry = (sgot->contents + got_size * MIPS_RESERVED_GOTNO); - entry != last_entry; - entry += got_size) - { - address = bfd_get_64 (abfd, entry); - - if (!mips_elf64_overflow_p (value - address, 16)) - { - /* This entry will serve as the page pointer. We can add a - 16-bit number to it to get the actual address. */ - index = entry - sgot->contents; - break; - } - } - - /* If we didn't have an appropriate entry, we create one now. */ - if (entry == last_entry) - index = mips_elf64_create_local_got_entry (abfd, g, sgot, value); - - if (offsetp) - { - address = bfd_get_64 (abfd, entry); - *offsetp = value - address; - } - - return index; -} - -/* Find a GOT entry whose higher-order 16 bits are the same as those - for value. Return the index into the GOT for this entry. */ - -static bfd_vma -mips_elf64_got16_entry (abfd, info, value, external) - bfd *abfd; - struct bfd_link_info *info; - bfd_vma value; - boolean external; -{ - CONST bfd_vma got_size = get_elf_backend_data (abfd)->s->arch_size / 8; - asection *sgot; - struct mips_elf64_got_info *g; - bfd_byte *entry; - bfd_byte *last_entry; - bfd_vma index = 0; - bfd_vma address; - - if (! external) - { - /* Although the ABI says that it is "the high-order 16 bits" that we - want, it is really the %high value. The complete value is - calculated with a `addiu' of a LO16 relocation, just as with a - HI16/LO16 pair. */ - value = mips_elf64_high (value) << 16; - } - - g = _mips_elf64_got_info (elf_hash_table (info)->dynobj, &sgot); - - /* Look to see if we already have an appropriate entry. */ - last_entry = sgot->contents + got_size * g->assigned_gotno; - for (entry = (sgot->contents + got_size * MIPS_RESERVED_GOTNO); - entry != last_entry; - entry += got_size) - { - address = bfd_get_64 (abfd, entry); - if (address == value) - { - /* This entry has the right high-order 16 bits, and the low-order - 16 bits are set to zero. */ - index = entry - sgot->contents; - break; - } - } - - /* If we didn't have an appropriate entry, we create one now. */ - if (entry == last_entry) - index = mips_elf64_create_local_got_entry (abfd, g, sgot, value); - - return index; -} - -/* Return whether a relocation is against a local symbol. */ - -static boolean -mips_elf64_local_relocation_p (input_bfd, relocation, local_sections, - check_forced) - bfd *input_bfd; - const Elf_Internal_Rela *relocation; - asection **local_sections; - boolean check_forced; -{ - unsigned long r_symndx; - Elf_Internal_Shdr *symtab_hdr; - struct mips_elf64_link_hash_entry* h; - size_t extsymoff; - - r_symndx = ELF64_R_SYM (relocation->r_info); - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info; - - if (r_symndx < extsymoff) - return true; - if (elf_bad_symtab (input_bfd) && local_sections[r_symndx] != NULL) - return true; - - if (check_forced) - { - /* Look up the hash table to check whether the symbol - was forced local. */ - h = (struct mips_elf64_link_hash_entry *) - elf_sym_hashes (input_bfd) [r_symndx - extsymoff]; - /* Find the real hash-table entry for this symbol. */ - while (h->root.root.type == bfd_link_hash_indirect - || h->root.root.type == bfd_link_hash_warning) - h = (struct mips_elf64_link_hash_entry *) h->root.root.u.i.link; - if ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) - return true; - } - - return false; -} - -/* Returns the first relocation of type r_type found, beginning with - RELOCATION. RELEND is one-past-the-end of the relocation table. */ - -static const Elf_Internal_Rela * -mips_elf64_next_relocation (r_type, relocation, relend) - unsigned int r_type; - const Elf_Internal_Rela *relocation; - const Elf_Internal_Rela *relend; -{ - /* According to the MIPS ELF ABI, the R_MIPS_LO16 relocation must be - immediately following. However, for the IRIX6 ABI, the next - relocation may be a composed relocation consisting of several - relocations for the same address. In that case, the R_MIPS_LO16 - relocation may occur as one of these. We permit a similar - extension in general, as that is useful for GCC. */ - while (relocation < relend) - { - if (ELF64_MIPS_R_TYPE (relocation->r_info) == r_type) - return relocation; - - ++relocation; - } - - /* We didn't find it. */ - bfd_set_error (bfd_error_bad_value); - return NULL; -} - -/* Create a rel.dyn relocation for the dynamic linker to resolve. REL - is the original relocation, which is now being transformed into a - dynamic relocation. The ADDENDP is adjusted if necessary; the - caller should store the result in place of the original addend. */ - -static boolean -mips_elf64_create_dynamic_relocation (output_bfd, info, rel, h, sec, - symbol, addendp, input_section) - bfd *output_bfd; - struct bfd_link_info *info; - const Elf_Internal_Rela *rel; - struct mips_elf64_link_hash_entry *h; - asection *sec; - bfd_vma symbol; - bfd_vma *addendp; - asection *input_section; -{ - Elf_Internal_Rel outrel[3]; - boolean skip; - asection *sreloc; - bfd *dynobj; - int r_type; - - r_type = ELF64_MIPS_R_TYPE (rel->r_info); - dynobj = elf_hash_table (info)->dynobj; - sreloc = bfd_get_section_by_name (dynobj, ".rel.dyn"); - BFD_ASSERT (sreloc != NULL); - BFD_ASSERT (sreloc->contents != NULL); - BFD_ASSERT ((sreloc->reloc_count - * get_elf_backend_data (output_bfd)->s->sizeof_rel) - < sreloc->_raw_size); - - skip = false; - outrel[0].r_offset = _bfd_elf_section_offset (output_bfd, info, - input_section, - rel[0].r_offset); - /* FIXME: For -2 runtime relocation needs to be skipped, but - properly resolved statically and installed. */ - BFD_ASSERT (outrel[0].r_offset != (bfd_vma) -2); - - /* We begin by assuming that the offset for the dynamic relocation - is the same as for the original relocation. We'll adjust this - later to reflect the correct output offsets. */ - if (elf_section_data (input_section)->sec_info_type != ELF_INFO_TYPE_STABS) - { - outrel[1].r_offset = rel[1].r_offset; - outrel[2].r_offset = rel[2].r_offset; - } - else - { - /* Except that in a stab section things are more complex. - Because we compress stab information, the offset given in the - relocation may not be the one we want; we must let the stabs - machinery tell us the offset. */ - outrel[1].r_offset = outrel[0].r_offset; - outrel[2].r_offset = outrel[0].r_offset; - /* If we didn't need the relocation at all, this value will be - -1. */ - if (outrel[0].r_offset == (bfd_vma) -1) - skip = true; - } - - /* If we've decided to skip this relocation, just output an empty - record. Note that R_MIPS_NONE == 0, so that this call to memset - is a way of setting R_TYPE to R_MIPS_NONE. */ - if (skip) - memset (outrel, 0, sizeof (Elf_Internal_Rel) * 3); - else - { - long indx; - bfd_vma section_offset; - - /* We must now calculate the dynamic symbol table index to use - in the relocation. */ - if (h != NULL - && (! info->symbolic || (h->root.elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) - { - indx = h->root.dynindx; - /* h->root.dynindx may be -1 if this symbol was marked to - become local. */ - if (indx == -1) - indx = 0; - } - else - { - if (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 - { - indx = elf_section_data (sec->output_section)->dynindx; - if (indx == 0) - abort (); - } - - /* Figure out how far the target of the relocation is from - the beginning of its section. */ - section_offset = symbol - sec->output_section->vma; - /* The relocation we're building is section-relative. - Therefore, the original addend must be adjusted by the - section offset. */ - *addendp += section_offset; - /* Now, the relocation is just against the section. */ - symbol = sec->output_section->vma; - } - - /* If the relocation was previously an absolute relocation and - this symbol will not be referred to by the relocation, we must - adjust it by the value we give it in the dynamic symbol table. - Otherwise leave the job up to the dynamic linker. */ - if (!indx && r_type != R_MIPS_REL32) - *addendp += symbol; - - /* The relocation is always an REL32 relocation because we don't - know where the shared library will wind up at load-time. */ - outrel[0].r_info = ELF64_R_INFO (indx, R_MIPS_REL32); - - /* Adjust the output offset of the relocation to reference the - correct location in the output file. */ - outrel[0].r_offset += (input_section->output_section->vma - + input_section->output_offset); - outrel[1].r_offset += (input_section->output_section->vma - + input_section->output_offset); - outrel[2].r_offset += (input_section->output_section->vma - + input_section->output_offset); - } - - /* Put the relocation back out. */ - mips_elf64_be_swap_reloc_out (output_bfd, outrel, - (sreloc->contents - + sreloc->reloc_count - * sizeof (Elf64_Mips_External_Rel))); - - /* Record the index of the first relocation referencing H. This - information is later emitted in the .msym section. */ - if (h != NULL - && (h->min_dyn_reloc_index == 0 - || sreloc->reloc_count < h->min_dyn_reloc_index)) - h->min_dyn_reloc_index = sreloc->reloc_count; - - /* We've now added another relocation. */ - ++sreloc->reloc_count; - - /* Make sure the output section is writable. The dynamic linker - will be writing to it. */ - elf_section_data (input_section->output_section)->this_hdr.sh_flags - |= SHF_WRITE; - - return true; -} - -/* Calculate the value produced by the RELOCATION (which comes from - the INPUT_BFD). The ADDEND is the addend to use for this - RELOCATION; RELOCATION->R_ADDEND is ignored. - - The result of the relocation calculation is stored in VALUEP. - REQUIRE_JALXP indicates whether or not the opcode used with this - relocation must be JALX. - - This function returns bfd_reloc_continue if the caller need take no - further action regarding this relocation, bfd_reloc_notsupported if - something goes dramatically wrong, bfd_reloc_overflow if an - overflow occurs, and bfd_reloc_ok to indicate success. */ - -static bfd_reloc_status_type -mips_elf64_calculate_relocation (abfd, input_bfd, input_section, info, - relocation, addend, howto, local_syms, - local_sections, valuep, namep, require_jalxp) - bfd *abfd; - bfd *input_bfd; - asection *input_section; - struct bfd_link_info *info; - const Elf_Internal_Rela *relocation; - bfd_vma addend; - reloc_howto_type *howto; - Elf_Internal_Sym *local_syms; - asection **local_sections; - bfd_vma *valuep; - const char **namep; - boolean *require_jalxp; -{ - /* The eventual value we will return. */ - bfd_vma value; - /* The address of the symbol against which the relocation is - occurring. */ - bfd_vma symbol = 0; - /* The final GP value to be used for the relocatable, executable, or - shared object file being produced. */ - bfd_vma gp = (bfd_vma) - 1; - /* The place (section offset or address) of the storage unit being - relocated. */ - bfd_vma p; - /* The value of GP used to create the relocatable object. */ - bfd_vma gp0 = (bfd_vma) - 1; - /* The offset into the global offset table at which the address of - the relocation entry symbol, adjusted by the addend, resides - during execution. */ - bfd_vma g = (bfd_vma) - 1; - /* The section in which the symbol referenced by the relocation is - located. */ - asection *sec = NULL; - struct mips_elf64_link_hash_entry* h = NULL; - /* True if the symbol referred to by this relocation is a local - symbol. */ - boolean local_p; - Elf_Internal_Shdr *symtab_hdr; - size_t extsymoff; - unsigned long r_symndx; - int r_type; - /* True if overflow occurred during the calculation of the - relocation value. */ - boolean overflowed_p; - /* True if this relocation refers to a MIPS16 function. */ - boolean target_is_16_bit_code_p = false; - - /* Parse the relocation. */ - r_symndx = ELF64_R_SYM (relocation->r_info); - r_type = ELF64_MIPS_R_TYPE (relocation->r_info); - p = (input_section->output_section->vma - + input_section->output_offset - + relocation->r_offset); - - /* Assume that there will be no overflow. */ - overflowed_p = false; - - /* Figure out whether or not the symbol is local, and get the offset - used in the array of hash table entries. */ - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - local_p = mips_elf64_local_relocation_p (input_bfd, relocation, - local_sections, false); - if (! elf_bad_symtab (input_bfd)) - extsymoff = symtab_hdr->sh_info; - else - { - /* The symbol table does not follow the rule that local symbols - must come before globals. */ - extsymoff = 0; - } - - /* Figure out the value of the symbol. */ - if (local_p) - { - Elf_Internal_Sym *sym; - - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - - symbol = sec->output_section->vma + sec->output_offset; - if (ELF_ST_TYPE (sym->st_info) != STT_SECTION) - symbol += sym->st_value; - - /* MIPS16 text labels should be treated as odd. */ - if (sym->st_other == STO_MIPS16) - ++symbol; - - /* Record the name of this symbol, for our caller. */ - *namep = bfd_elf_string_from_elf_section (input_bfd, - symtab_hdr->sh_link, - sym->st_name); - if (*namep == '\0') - *namep = bfd_section_name (input_bfd, sec); - - target_is_16_bit_code_p = (sym->st_other == STO_MIPS16); - } - else - { - /* For global symbols we look up the symbol in the hash-table. */ - h = ((struct mips_elf64_link_hash_entry *) - elf_sym_hashes (input_bfd) [r_symndx - extsymoff]); - /* Find the real hash-table entry for this symbol. */ - while (h->root.root.type == bfd_link_hash_indirect - || h->root.root.type == bfd_link_hash_warning) - h = (struct mips_elf64_link_hash_entry *) h->root.root.u.i.link; - - /* Record the name of this symbol, for our caller. */ - *namep = h->root.root.root.string; - - /* If this symbol is defined, calculate its address. */ - if ((h->root.root.type == bfd_link_hash_defined - || h->root.root.type == bfd_link_hash_defweak) - && h->root.root.u.def.section) - { - sec = h->root.root.u.def.section; - if (sec->output_section) - symbol = (h->root.root.u.def.value - + sec->output_section->vma - + sec->output_offset); - else - symbol = h->root.root.u.def.value; - } - else if (h->root.root.type == bfd_link_hash_undefweak) - /* We allow relocations against undefined weak symbols, giving - it the value zero, so that you can undefined weak functions - and check to see if they exist by looking at their - addresses. */ - symbol = 0; - else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) - && !info->no_undefined - && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) - symbol = 0; - else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0 || - strcmp (h->root.root.root.string, "_DYNAMIC_LINKING") == 0) - { - /* If this is a dynamic link, we should have created a - _DYNAMIC_LINK symbol or _DYNAMIC_LINKING(for normal mips) symbol - in in mips_elf64_create_dynamic_sections. - Otherwise, we should define the symbol with a value of 0. - FIXME: It should probably get into the symbol table - somehow as well. */ - BFD_ASSERT (! info->shared); - BFD_ASSERT (bfd_get_section_by_name (abfd, ".dynamic") == NULL); - symbol = 0; - } - else - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.root.string, input_bfd, - input_section, relocation->r_offset, - (!info->shared || info->no_undefined - || ELF_ST_VISIBILITY (h->root.other))))) - return bfd_reloc_undefined; - symbol = 0; - } - - target_is_16_bit_code_p = (h->root.other == STO_MIPS16); - } - - /* If this is a 64-bit call to a 16-bit function with a stub, we - need to redirect the call to the stub, unless we're already *in* - a stub. */ - if (r_type != R_MIPS16_26 && !info->relocateable - && ((h != NULL && h->fn_stub != NULL) - || (local_p && elf_tdata (input_bfd)->local_stubs != NULL - && elf_tdata (input_bfd)->local_stubs[r_symndx] != NULL)) - && !mips_elf64_stub_section_p (input_bfd, input_section)) - { - /* This is a 64-bit call to a 16-bit function. We should - have already noticed that we were going to need the - stub. */ - if (local_p) - sec = elf_tdata (input_bfd)->local_stubs[r_symndx]; - else - { - BFD_ASSERT (h->need_fn_stub); - sec = h->fn_stub; - } - - symbol = sec->output_section->vma + sec->output_offset; - } - /* If this is a 16-bit call to a 64-bit function with a stub, we - need to redirect the call to the stub. */ - else if (r_type == R_MIPS16_26 && !info->relocateable - && h != NULL - && (h->call_stub != NULL || h->call_fp_stub != NULL) - && !target_is_16_bit_code_p) - { - /* If both call_stub and call_fp_stub are defined, we can figure - out which one to use by seeing which one appears in the input - file. */ - if (h->call_stub != NULL && h->call_fp_stub != NULL) - { - asection *o; - - sec = NULL; - for (o = input_bfd->sections; o != NULL; o = o->next) - { - if (strncmp (bfd_get_section_name (input_bfd, o), - CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) - { - sec = h->call_fp_stub; - break; - } - } - if (sec == NULL) - sec = h->call_stub; - } - else if (h->call_stub != NULL) - sec = h->call_stub; - else - sec = h->call_fp_stub; - - BFD_ASSERT (sec->_raw_size > 0); - symbol = sec->output_section->vma + sec->output_offset; - } - - /* Calls from 16-bit code to 32-bit code and vice versa require the - special jalx instruction. */ - *require_jalxp = (!info->relocateable - && ((r_type == R_MIPS16_26) != target_is_16_bit_code_p)); - - local_p = mips_elf64_local_relocation_p (input_bfd, relocation, - local_sections, true); - - /* If we haven't already determined the GOT offset, or the GP value, - and we're going to need it, get it now. */ - switch (r_type) - { - case R_MIPS_CALL16: - case R_MIPS_GOT16: - case R_MIPS_GOT_DISP: - case R_MIPS_GOT_HI16: - case R_MIPS_CALL_HI16: - case R_MIPS_GOT_LO16: - case R_MIPS_CALL_LO16: - /* Find the index into the GOT where this value is located. */ - if (!local_p) - { - BFD_ASSERT (addend == 0); - g = mips_elf64_global_got_index (elf_hash_table (info)->dynobj, - (struct elf_link_hash_entry*) h); - if (! elf_hash_table(info)->dynamic_sections_created - || (info->shared - && (info->symbolic || h->root.dynindx == -1) - && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) - { - /* This is a static link or a -Bsymbolic link. The - symbol is defined locally, or was forced to be local. - We must initialize this entry in the GOT. */ - bfd *tmpbfd = elf_hash_table (info)->dynobj; - - asection *sgot = bfd_get_section_by_name (tmpbfd, ".got"); - bfd_put_64 (tmpbfd, symbol + addend, sgot->contents + g); - } - } - else if (r_type == R_MIPS_GOT16 || r_type == R_MIPS_CALL16) - /* There's no need to create a local GOT entry here; the - calculation for a local GOT16 entry does not involve G. */ - break; - else - { - g = mips_elf64_local_got_index (abfd, info, symbol + addend); - if (g == (bfd_vma) -1) - return false; - } - - /* Convert GOT indices to actual offsets. */ - g = mips_elf64_got_offset_from_index (elf_hash_table (info)->dynobj, - abfd, g); - break; - - case R_MIPS_HI16: - case R_MIPS_LO16: - case R_MIPS_GPREL16: - case R_MIPS_GPREL32: - case R_MIPS_LITERAL: - gp0 = _bfd_get_gp_value (input_bfd); - gp = _bfd_get_gp_value (abfd); - break; - - default: - break; - } - - /* Figure out what kind of relocation is being performed. */ - switch (r_type) - { - case R_MIPS_NONE: - return bfd_reloc_continue; - - case R_MIPS_16: - value = symbol + mips_elf64_sign_extend (addend, 16); - overflowed_p = mips_elf64_overflow_p (value, 16); - break; - - case R_MIPS_32: - case R_MIPS_REL32: - case R_MIPS_64: - 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.elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0))) - && r_symndx != 0 - && (input_section->flags & SEC_ALLOC) != 0) - { - /* If we're creating a shared library, or this relocation is - against a symbol in a shared library, then we can't know - where the symbol will end up. So, we create a relocation - record in the output, and leave the job up to the dynamic - linker. */ - value = addend; - if (!mips_elf64_create_dynamic_relocation (abfd, info, relocation, - h, sec, symbol, &value, - input_section)) - return false; - } - else - { - if (r_type != R_MIPS_REL32) - value = symbol + addend; - else - value = addend; - } - value &= howto->dst_mask; - break; - - case R_MIPS_PC32: - case R_MIPS_PC64: - case R_MIPS_GNU_REL_LO16: - value = symbol + addend - p; - value &= howto->dst_mask; - break; - - case R_MIPS_GNU_REL16_S2: - value = symbol + mips_elf64_sign_extend (addend << 2, 18) - p; - overflowed_p = mips_elf64_overflow_p (value, 18); - value = (value >> 2) & howto->dst_mask; - break; - - case R_MIPS_GNU_REL_HI16: - value = mips_elf64_high (addend + symbol - p); - value &= howto->dst_mask; - break; - - case R_MIPS16_26: - /* The calculation for R_MIPS16_26 is just the same as for an - R_MIPS_26. It's only the storage of the relocated field into - the output file that's different. That's handled in - mips_elf_perform_relocation. So, we just fall through to the - R_MIPS_26 case here. */ - case R_MIPS_26: - if (local_p) - value = (((addend << 2) | ((p + 4) & 0xf0000000)) + symbol) >> 2; - else - value = (mips_elf64_sign_extend (addend << 2, 28) + symbol) >> 2; - value &= howto->dst_mask; - break; - - case R_MIPS_HI16: - value = mips_elf64_high (addend + symbol); - value &= howto->dst_mask; - break; - - case R_MIPS_LO16: - value = (addend + symbol) & 0xffff; - value &= howto->dst_mask; - break; - - case R_MIPS_LITERAL: - /* Because we don't merge literal sections, we can handle this - just like R_MIPS_GPREL16. In the long run, we should merge - shared literals, and then we will need to additional work - here. */ - - /* Fall through. */ - - case R_MIPS_GPREL16: - if (local_p) - value = mips_elf64_sign_extend (addend, 16) + symbol + gp0 - gp; - else - value = mips_elf64_sign_extend (addend, 16) + symbol - gp; - overflowed_p = mips_elf64_overflow_p (value, 16); - break; - - case R_MIPS_PC16: - value = mips_elf64_sign_extend (addend, 16) + symbol - p; - overflowed_p = mips_elf64_overflow_p (value, 16); - value = (bfd_vma) ((bfd_signed_vma) value / 4); - break; - - case R_MIPS_GOT16: - case R_MIPS_CALL16: - if (local_p) - { - boolean forced; - - /* The special case is when the symbol is forced to be local. We - need the full address in the GOT since no R_MIPS_LO16 relocation - follows. */ - forced = ! mips_elf64_local_relocation_p (input_bfd, relocation, - local_sections, false); - value = mips_elf64_got16_entry (abfd, info, symbol + addend, forced); - if (value == (bfd_vma) -1) - return false; - value - = mips_elf64_got_offset_from_index (elf_hash_table (info)->dynobj, - abfd, - value); - overflowed_p = mips_elf64_overflow_p (value, 16); - break; - } - - /* Fall through. */ - - case R_MIPS_GOT_DISP: - value = g; - overflowed_p = mips_elf64_overflow_p (value, 16); - break; - - case R_MIPS_GPREL32: - value = (addend + symbol + gp0 - gp) & howto->dst_mask; - break; - - case R_MIPS_GOT_HI16: - case R_MIPS_CALL_HI16: - /* We're allowed to handle these two relocations identically. - The dynamic linker is allowed to handle the CALL relocations - differently by creating a lazy evaluation stub. */ - value = g; - value = mips_elf64_high (value); - value &= howto->dst_mask; - break; - - case R_MIPS_GOT_LO16: - case R_MIPS_CALL_LO16: - value = g & howto->dst_mask; - break; - - case R_MIPS_GOT_PAGE: - value = mips_elf64_got_page (abfd, info, symbol + addend, NULL); - if (value == (bfd_vma) -1) - return false; - value = mips_elf64_got_offset_from_index (elf_hash_table (info)->dynobj, - abfd, - value); - overflowed_p = mips_elf64_overflow_p (value, 16); - break; - - case R_MIPS_GOT_OFST: - mips_elf64_got_page (abfd, info, symbol + addend, &value); - overflowed_p = mips_elf64_overflow_p (value, 16); - break; - - case R_MIPS_SUB: - value = symbol - addend; - value &= howto->dst_mask; - break; - - case R_MIPS_HIGHER: - value = mips_elf64_higher (addend + symbol); - value &= howto->dst_mask; - break; - - case R_MIPS_HIGHEST: - value = mips_elf64_highest (addend + symbol); - value &= howto->dst_mask; - break; - - case R_MIPS_SCN_DISP: - value = symbol + addend - sec->output_offset; - value &= howto->dst_mask; - break; - - case R_MIPS_PJUMP: - case R_MIPS_JALR: - /* Both of these may be ignored. R_MIPS_JALR is an optimization - hint; we could improve performance by honoring that hint. */ - return bfd_reloc_continue; - - case R_MIPS_GNU_VTINHERIT: - case R_MIPS_GNU_VTENTRY: - /* We don't do anything with these at present. */ - return bfd_reloc_continue; - - default: - /* An unrecognized relocation type. */ - return bfd_reloc_notsupported; - } - - /* Store the VALUE for our caller. */ - *valuep = value; - return overflowed_p ? bfd_reloc_overflow : bfd_reloc_ok; -} - -/* Obtain the field relocated by RELOCATION. */ - -static bfd_vma -mips_elf64_obtain_contents (howto, relocation, input_bfd, contents) - reloc_howto_type *howto; - const Elf_Internal_Rela *relocation; - bfd *input_bfd; - bfd_byte *contents; -{ - bfd_byte *location = contents + relocation->r_offset; - - /* Obtain the bytes. */ - return bfd_get (8 * bfd_get_reloc_size (howto), input_bfd, location); -} - -/* It has been determined that the result of the RELOCATION is the - VALUE. Use HOWTO to place VALUE into the output file at the - appropriate position. The SECTION is the section to which the - relocation applies. If REQUIRE_JALX is true, then the opcode used - for the relocation must be either JAL or JALX, and it is - unconditionally converted to JALX. - - Returns false if anything goes wrong. */ - -static boolean -mips_elf64_perform_relocation (info, howto, relocation, value, - input_bfd, input_section, - contents, require_jalx) - struct bfd_link_info *info; - reloc_howto_type *howto; - const Elf_Internal_Rela *relocation; - bfd_vma value; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - boolean require_jalx; -{ - bfd_vma x; - bfd_byte *location; - int r_type = ELF32_R_TYPE (relocation->r_info); - - /* Figure out where the relocation is occurring. */ - location = contents + relocation->r_offset; - - /* Obtain the current value. */ - x = mips_elf64_obtain_contents (howto, relocation, input_bfd, contents); - - /* Clear the field we are setting. */ - x &= ~howto->dst_mask; - - /* If this is the R_MIPS16_26 relocation, we must store the - value in a funny way. */ - if (r_type == R_MIPS16_26) - { - /* R_MIPS16_26 is used for the mips16 jal and jalx instructions. - Most mips16 instructions are 16 bits, but these instructions - are 32 bits. - - The format of these instructions is: - - +--------------+--------------------------------+ - ! JALX ! X! Imm 20:16 ! Imm 25:21 ! - +--------------+--------------------------------+ - ! Immediate 15:0 ! - +-----------------------------------------------+ - - JALX is the 5-bit value 00011. X is 0 for jal, 1 for jalx. - Note that the immediate value in the first word is swapped. - - When producing a relocateable object file, R_MIPS16_26 is - handled mostly like R_MIPS_26. In particular, the addend is - stored as a straight 26-bit value in a 32-bit instruction. - (gas makes life simpler for itself by never adjusting a - R_MIPS16_26 reloc to be against a section, so the addend is - always zero). However, the 32 bit instruction is stored as 2 - 16-bit values, rather than a single 32-bit value. In a - big-endian file, the result is the same; in a little-endian - file, the two 16-bit halves of the 32 bit value are swapped. - This is so that a disassembler can recognize the jal - instruction. - - When doing a final link, R_MIPS16_26 is treated as a 32 bit - instruction stored as two 16-bit values. The addend A is the - contents of the targ26 field. The calculation is the same as - R_MIPS_26. When storing the calculated value, reorder the - immediate value as shown above, and don't forget to store the - value as two 16-bit values. - - To put it in MIPS ABI terms, the relocation field is T-targ26-16, - defined as - - big-endian: - +--------+----------------------+ - | | | - | | targ26-16 | - |31 26|25 0| - +--------+----------------------+ - - little-endian: - +----------+------+-------------+ - | | | | - | sub1 | | sub2 | - |0 9|10 15|16 31| - +----------+--------------------+ - where targ26-16 is sub1 followed by sub2 (i.e., the addend field A is - ((sub1 << 16) | sub2)). - - When producing a relocateable object file, the calculation is - (((A < 2) | ((P + 4) & 0xf0000000) + S) >> 2) - When producing a fully linked file, the calculation is - let R = (((A < 2) | ((P + 4) & 0xf0000000) + S) >> 2) - ((R & 0x1f0000) << 5) | ((R & 0x3e00000) >> 5) | (R & 0xffff) */ - - if (!info->relocateable) - /* Shuffle the bits according to the formula above. */ - value = (((value & 0x1f0000) << 5) - | ((value & 0x3e00000) >> 5) - | (value & 0xffff)); - } - else if (r_type == R_MIPS16_GPREL) - { - /* R_MIPS16_GPREL is used for GP-relative addressing in mips16 - mode. A typical instruction will have a format like this: - - +--------------+--------------------------------+ - ! EXTEND ! Imm 10:5 ! Imm 15:11 ! - +--------------+--------------------------------+ - ! Major ! rx ! ry ! Imm 4:0 ! - +--------------+--------------------------------+ - - EXTEND is the five bit value 11110. Major is the instruction - opcode. - - This is handled exactly like R_MIPS_GPREL16, except that the - addend is retrieved and stored as shown in this diagram; that - is, the Imm fields above replace the V-rel16 field. - - All we need to do here is shuffle the bits appropriately. As - above, the two 16-bit halves must be swapped on a - little-endian system. */ - value = (((value & 0x7e0) << 16) - | ((value & 0xf800) << 5) - | (value & 0x1f)); - } - - /* Set the field. */ - x |= (value & howto->dst_mask); - - /* If required, turn JAL into JALX. */ - if (require_jalx) - { - boolean ok; - bfd_vma opcode = x >> 26; - bfd_vma jalx_opcode; - - /* Check to see if the opcode is already JAL or JALX. */ - if (r_type == R_MIPS16_26) - { - ok = ((opcode == 0x6) || (opcode == 0x7)); - jalx_opcode = 0x7; - } - else - { - ok = ((opcode == 0x3) || (opcode == 0x1d)); - jalx_opcode = 0x1d; - } - - /* If the opcode is not JAL or JALX, there's a problem. */ - if (!ok) - { - (*_bfd_error_handler) - (_("%s: %s+0x%lx: jump to stub routine which is not jal"), - bfd_archive_filename (input_bfd), - input_section->name, - (unsigned long) relocation->r_offset); - bfd_set_error (bfd_error_bad_value); - return false; - } - - /* Make this the JALX opcode. */ - x = (x & ~(0x3f << 26)) | (jalx_opcode << 26); - } - - /* Swap the high- and low-order 16 bits on little-endian systems - when doing a MIPS16 relocation. */ - if ((r_type == R_MIPS16_GPREL || r_type == R_MIPS16_26) - && bfd_little_endian (input_bfd)) - x = (((x & 0xffff) << 16) | ((x & 0xffff0000) >> 16)); - - /* Put the value into the output. */ - bfd_put (8 * bfd_get_reloc_size (howto), input_bfd, x, location); - return true; -} - -/* Returns true if SECTION is a MIPS16 stub section. */ - -static boolean -mips_elf64_stub_section_p (abfd, section) - bfd *abfd ATTRIBUTE_UNUSED; - asection *section; -{ - const char *name = bfd_get_section_name (abfd, section); - - return (strncmp (name, FN_STUB, sizeof FN_STUB - 1) == 0 - || strncmp (name, CALL_STUB, sizeof CALL_STUB - 1) == 0 - || strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0); -} - -/* Relocate a MIPS ELF64 section. */ - -static boolean -mips_elf64_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_Rela *rel; - const Elf_Internal_Rela *relend; - bfd_vma addend = 0; - boolean use_saved_addend_p = false; - struct elf_backend_data *bed; - - bed = get_elf_backend_data (output_bfd); - relend = relocs + input_section->reloc_count * bed->s->int_rels_per_ext_rel; - for (rel = relocs; rel < relend; ++rel) - { - const char *name; - bfd_vma value; - reloc_howto_type *howto; - boolean require_jalx; - /* True if the relocation is a RELA relocation, rather than a - REL relocation. */ - boolean rela_relocation_p = true; - int r_type = ELF64_MIPS_R_TYPE (rel->r_info); - const char *msg = (const char *) NULL; - - /* Find the relocation howto for this relocation. */ - howto = &mips_elf64_howto_table_rela[r_type]; - - if (!use_saved_addend_p) - { - Elf_Internal_Shdr *rel_hdr; - - /* If these relocations were originally of the REL variety, - we must pull the addend out of the field that will be - relocated. Otherwise, we simply use the contents of the - RELA relocation. To determine which flavor or relocation - this is, we depend on the fact that the INPUT_SECTION's - REL_HDR is read before its REL_HDR2. */ - rel_hdr = &elf_section_data (input_section)->rel_hdr; - if ((size_t) (rel - relocs) - >= (NUM_SHDR_ENTRIES (rel_hdr) * bed->s->int_rels_per_ext_rel)) - rel_hdr = elf_section_data (input_section)->rel_hdr2; - if (rel_hdr->sh_entsize - == (get_elf_backend_data (input_bfd)->s->sizeof_rel)) - { - /* Note that this is a REL relocation. */ - rela_relocation_p = false; - - /* Find the relocation howto for this relocation. */ - howto = &mips_elf64_howto_table_rel[r_type]; - - /* Get the addend, which is stored in the input file. */ - addend = mips_elf64_obtain_contents (howto, - rel, - input_bfd, - contents); - addend &= howto->src_mask; - - /* For some kinds of relocations, the ADDEND is a - combination of the addend stored in two different - relocations. */ - if (r_type == R_MIPS_HI16 - || r_type == R_MIPS_GNU_REL_HI16 - || (r_type == R_MIPS_GOT16 - && mips_elf64_local_relocation_p (input_bfd, rel, - local_sections, false))) - { - bfd_vma l; - const Elf_Internal_Rela *lo16_relocation; - reloc_howto_type *lo16_howto; - int lo; - - /* The combined value is the sum of the HI16 addend, - left-shifted by sixteen bits, and the LO16 - addend, sign extended. (Usually, the code does - a `lui' of the HI16 value, and then an `addiu' of - the LO16 value.) - - Scan ahead to find a matching LO16 relocation. */ - if (r_type == R_MIPS_GNU_REL_HI16) - lo = R_MIPS_GNU_REL_LO16; - else - lo = R_MIPS_LO16; - lo16_relocation - = mips_elf64_next_relocation (lo, rel, relend); - if (lo16_relocation == NULL) - return false; - - /* Obtain the addend kept there. */ - if (rela_relocation_p == false) - lo16_howto = &mips_elf64_howto_table_rel[lo]; - else - lo16_howto = &mips_elf64_howto_table_rela[lo]; - l = mips_elf64_obtain_contents (lo16_howto, - lo16_relocation, - input_bfd, contents); - l &= lo16_howto->src_mask; - l = mips_elf64_sign_extend (l, 16); - - addend <<= 16; - - /* Compute the combined addend. */ - addend += l; - } - } - else - addend = rel->r_addend; - } - - if (info->relocateable) - { - Elf_Internal_Sym *sym; - unsigned long r_symndx; - - /* Since we're just relocating, all we need to do is copy - the relocations back out to the object file, unless - they're against a section symbol, in which case we need - to adjust by the section offset, or unless they're GP - relative in which case we need to adjust by the amount - that we're adjusting GP in this relocateable object. */ - - if (!mips_elf64_local_relocation_p (input_bfd, rel, local_sections, - false)) - /* There's nothing to do for non-local relocations. */ - continue; - - if (r_type == R_MIPS_GPREL16 - || r_type == R_MIPS_GPREL32 - || r_type == R_MIPS_LITERAL) - addend -= (_bfd_get_gp_value (output_bfd) - - _bfd_get_gp_value (input_bfd)); - else if (r_type == R_MIPS_26 || r_type == R_MIPS_GNU_REL16_S2) - /* The addend is stored without its two least - significant bits (which are always zero.) In a - non-relocateable link, calculate_relocation will do - this shift; here, we must do it ourselves. */ - addend <<= 2; - - r_symndx = ELF64_R_SYM (rel->r_info); - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - /* Adjust the addend appropriately. */ - addend += local_sections[r_symndx]->output_offset; - -#if 0 - /* If the relocation is for a R_MIPS_HI16 or R_MIPS_GOT16, - then we only want to write out the high-order 16 bits. - The subsequent R_MIPS_LO16 will handle the low-order bits. */ - if (r_type == R_MIPS_HI16 || r_type == R_MIPS_GOT16 - || r_type == R_MIPS_GNU_REL_HI16) - addend = mips_elf64_high (addend); - else if (r_type == R_MIPS_HIGHER) - addend = mips_elf64_higher (addend); - else if (r_type == R_MIPS_HIGHEST) - addend = mips_elf64_highest (addend); -#endif - /* If the relocation is for an R_MIPS_26 relocation, then - the two low-order bits are not stored in the object file; - they are implicitly zero. */ - if (r_type == R_MIPS_26 || r_type == R_MIPS_GNU_REL16_S2) - addend >>= 2; - - if (rela_relocation_p) - /* If this is a RELA relocation, just update the addend. - We have to cast away constness for REL. */ - rel->r_addend = addend; - else - { - /* Otherwise, we have to write the value back out. Note - that we use the source mask, rather than the - destination mask because the place to which we are - writing will be source of the addend in the final - link. */ - addend &= howto->src_mask; - - if (!mips_elf64_perform_relocation (info, howto, rel, addend, - input_bfd, input_section, - contents, false)) - return false; - } - - /* Go on to the next relocation. */ - continue; - } - - /* In the N32 and 64-bit ABIs there may be multiple consecutive - relocations for the same offset. In that case we are - supposed to treat the output of each relocation as the addend - for the next. */ - if (rel + 1 < relend - && rel->r_offset == rel[1].r_offset - && ELF64_MIPS_R_TYPE (rel[1].r_info) != R_MIPS_NONE) - use_saved_addend_p = true; - else - use_saved_addend_p = false; - - /* Figure out what value we are supposed to relocate. */ - switch (mips_elf64_calculate_relocation (output_bfd, input_bfd, - input_section, info, rel, - addend, howto, local_syms, - local_sections, &value, &name, - &require_jalx)) - { - case bfd_reloc_continue: - /* There's nothing to do. */ - continue; - - case bfd_reloc_undefined: - /* mips_elf64_calculate_relocation already called the - undefined_symbol callback. There's no real point in - trying to perform the relocation at this point, so we - just skip ahead to the next relocation. */ - continue; - - case bfd_reloc_notsupported: - msg = _("internal error: unsupported relocation error"); - info->callbacks->warning - (info, msg, name, input_bfd, input_section, rel->r_offset); - return false; - - case bfd_reloc_overflow: - if (use_saved_addend_p) - /* Ignore overflow until we reach the last relocation for - a given location. */ - ; - else - { - BFD_ASSERT (name != NULL); - if (! ((*info->callbacks->reloc_overflow) - (info, name, howto->name, (bfd_vma) 0, - input_bfd, input_section, rel->r_offset))) - return false; - } - break; - - case bfd_reloc_ok: - break; - - default: - abort (); - break; - } - - /* If we've got another relocation for the address, keep going - until we reach the last one. */ - if (use_saved_addend_p) - { - addend = value; - continue; - } - - /* Actually perform the relocation. */ - if (!mips_elf64_perform_relocation (info, howto, rel, value, input_bfd, - input_section, contents, - require_jalx)) - return false; - } - - return true; -} - -/* Create dynamic sections when linking against a dynamic object. */ - -boolean -mips_elf64_create_dynamic_sections (abfd, info) - bfd *abfd; - struct bfd_link_info *info; -{ - flagword flags; - register asection *s; - - flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY - | SEC_LINKER_CREATED | SEC_READONLY); - - /* Mips ABI requests the .dynamic section to be read only. */ - s = bfd_get_section_by_name (abfd, ".dynamic"); - if (s != NULL) - { - if (! bfd_set_section_flags (abfd, s, flags)) - return false; - } - - /* We need to create .got section. */ - if (! mips_elf64_create_got_section (abfd, info)) - return false; - - /* Create the .msym section on IRIX6. It is used by the dynamic - linker to speed up dynamic relocations, and to avoid computing - the ELF hash for symbols. */ - if (!mips_elf64_create_msym_section (abfd)) - return false; - - /* Create .stub section. */ - if (bfd_get_section_by_name (abfd, ".MIPS.stubs") == NULL) - { - s = bfd_make_section (abfd, ".MIPS.stubs"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_CODE) - || ! bfd_set_section_alignment (abfd, s, 3)) - return false; - } - - 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. */ - -boolean -mips_elf64_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; -{ - bfd *dynobj; - struct mips_elf64_link_hash_entry *hmips; - asection *s; - - dynobj = elf_hash_table (info)->dynobj; - - /* 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 symbol is defined in a dynamic object, we need to copy - any R_MIPS_32 or R_MIPS_REL32 relocs against it into the output - file. */ - hmips = (struct mips_elf64_link_hash_entry *) h; - if (! info->relocateable - && hmips->possibly_dynamic_relocs != 0 - && (h->root.type == bfd_link_hash_defweak - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) - { - mips_elf64_allocate_dynamic_relocations (dynobj, - hmips->possibly_dynamic_relocs); - if (hmips->readonly_reloc) - /* We tell the dynamic linker that there are relocations - against the text segment. */ - info->flags |= DF_TEXTREL; - } - - /* For a function, create a stub, if allowed. */ - if (! hmips->no_fn_stub - && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) - { - if (! elf_hash_table (info)->dynamic_sections_created) - return true; - - /* If this symbol is not defined in a regular file, then set - the symbol to the stub location. This is required to make - function pointers compare as equal between the normal - executable and the shared library. */ - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - { - /* We need .stub section. */ - s = bfd_get_section_by_name (dynobj, ".MIPS.stubs"); - BFD_ASSERT (s != NULL); - - h->root.u.def.section = s; - h->root.u.def.value = s->_raw_size; - - /* XXX Write this stub address somewhere. */ - h->plt.offset = s->_raw_size; - - /* Make room for this stub code. */ - s->_raw_size += MIPS_FUNCTION_STUB_SIZE; - - /* The last half word of the stub will be filled with the index - of this symbol in .dynsym section. */ - return true; - } - } - else if ((h->type == STT_FUNC) - && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0) - { - /* This will set the entry for this symbol in the GOT to 0, and - the dynamic linker will take care of this. */ - h->root.u.def.value = 0; - 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. */ - - return true; -} - -/* This function is called after all the input files have been read, - and the input sections have been assigned to output sections. */ - -boolean -mips_elf64_always_size_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; -{ - if (info->relocateable - || ! mips_elf64_hash_table (info)->mips16_stubs_seen) - return true; - - mips_elf64_link_hash_traverse (mips_elf64_hash_table (info), - mips_elf64_check_mips16_stubs, - (PTR) NULL); - - return true; -} - -/* Check the mips16 stubs for a particular symbol, and see if we can - discard them. */ - -static boolean -mips_elf64_check_mips16_stubs (h, data) - struct mips_elf64_link_hash_entry *h; - PTR data ATTRIBUTE_UNUSED; -{ - if (h->root.root.type == bfd_link_hash_warning) - h = (struct mips_elf64_link_hash_entry *) h->root.root.u.i.link; - - if (h->fn_stub != NULL - && ! h->need_fn_stub) - { - /* We don't need the fn_stub; the only references to this symbol - are 16 bit calls. Clobber the size to 0 to prevent it from - being included in the link. */ - h->fn_stub->_raw_size = 0; - h->fn_stub->_cooked_size = 0; - h->fn_stub->flags &= ~SEC_RELOC; - h->fn_stub->reloc_count = 0; - h->fn_stub->flags |= SEC_EXCLUDE; - } - - if (h->call_stub != NULL - && h->root.other == STO_MIPS16) - { - /* We don't need the call_stub; this is a 16 bit function, so - calls from other 16 bit functions are OK. Clobber the size - to 0 to prevent it from being included in the link. */ - h->call_stub->_raw_size = 0; - h->call_stub->_cooked_size = 0; - h->call_stub->flags &= ~SEC_RELOC; - h->call_stub->reloc_count = 0; - h->call_stub->flags |= SEC_EXCLUDE; - } - - if (h->call_fp_stub != NULL - && h->root.other == STO_MIPS16) - { - /* We don't need the call_stub; this is a 16 bit function, so - calls from other 16 bit functions are OK. Clobber the size - to 0 to prevent it from being included in the link. */ - h->call_fp_stub->_raw_size = 0; - h->call_fp_stub->_cooked_size = 0; - h->call_fp_stub->flags &= ~SEC_RELOC; - h->call_fp_stub->reloc_count = 0; - h->call_fp_stub->flags |= SEC_EXCLUDE; - } - - return true; -} - -/* Set the sizes of the dynamic sections. */ - -boolean -mips_elf64_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; -{ - bfd *dynobj; - asection *s; - boolean reltext; - struct mips_elf64_got_info *g = NULL; - - 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 = strlen ("/usr/lib64/libc.so.1") + 1; - s->contents = (bfd_byte *) "/usr/lib64/libc.so.1"; - } - } - - /* The check_relocs and adjust_dynamic_symbol entry points have - determined the sizes of the various dynamic sections. Allocate - memory for them. */ - reltext = false; - for (s = dynobj->sections; s != NULL; s = s->next) - { - const char *name; - boolean strip; - - /* 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); - - if ((s->flags & SEC_LINKER_CREATED) == 0) - continue; - - strip = false; - - if (strncmp (name, ".rel", 4) == 0) - { - if (s->_raw_size == 0) - { - /* We only strip the section if the output section name - has the same name. Otherwise, there might be several - input sections for this output section. FIXME: This - code is probably not needed these days anyhow, since - the linker now does not create empty output sections. */ - if (s->output_section != NULL - && strcmp (name, - bfd_get_section_name (s->output_section->owner, - s->output_section)) == 0) - strip = true; - } - else - { - const char *outname; - asection *target; - - /* If this relocation section applies to a read only - section, then we probably need a DT_TEXTREL entry. - If the relocation section is .rel.dyn, we always - assert a DT_TEXTREL entry rather than testing whether - there exists a relocation to a read only section or - not. */ - 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) - || strcmp (outname, "rel.dyn") == 0) - reltext = true; - - /* We use the reloc_count field as a counter if we need - to copy relocs into the output file. */ - if (strcmp (name, "rel.dyn") != 0) - s->reloc_count = 0; - } - } - else if (strncmp (name, ".got", 4) == 0) - { - int i; - bfd_size_type loadable_size = 0; - bfd_size_type local_gotno; - bfd *sub; - - BFD_ASSERT (elf_section_data (s) != NULL); - g = (struct mips_elf64_got_info *) elf_section_data (s)->tdata; - BFD_ASSERT (g != NULL); - - /* Calculate the total loadable size of the output. That - will give us the maximum number of GOT_PAGE entries - required. */ - for (sub = info->input_bfds; sub; sub = sub->link_next) - { - asection *subsection; - - for (subsection = sub->sections; - subsection; - subsection = subsection->next) - { - if ((subsection->flags & SEC_ALLOC) == 0) - continue; - loadable_size += (subsection->_raw_size + 0xf) & ~0xf; - } - } - loadable_size += MIPS_FUNCTION_STUB_SIZE; - - /* Assume there are two loadable segments consisting of - contiguous sections. Is 5 enough? */ - local_gotno = (loadable_size >> 16) + 5; - /* It's possible we will need GOT_PAGE entries as well as - GOT16 entries. Often, these will be able to share GOT - entries, but not always. */ - local_gotno *= 2; - - g->local_gotno += local_gotno; - s->_raw_size += local_gotno * 8; - - /* There has to be a global GOT entry for every symbol with - a dynamic symbol table index of DT_MIPS_GOTSYM or - higher. Therefore, it make sense to put those symbols - that need GOT entries at the end of the symbol table. We - do that here. */ - if (!mips_elf64_sort_hash_table (info, 1)) - return false; - - if (g->global_gotsym != NULL) - i = elf_hash_table (info)->dynsymcount - g->global_gotsym->dynindx; - else - /* If there are no global symbols, or none requiring - relocations, then GLOBAL_GOTSYM will be NULL. */ - i = 0; - g->global_gotno = i; - s->_raw_size += i * 8; - } - else if (strcmp (name, ".MIPS.stubs") == 0) - { - /* Irix rld assumes that the function stub isn't at the end - of .text section. So put a dummy. XXX */ - s->_raw_size += MIPS_FUNCTION_STUB_SIZE; - } - else if (strcmp (name, ".msym") - == 0) - s->_raw_size = (sizeof (Elf32_External_Msym) - * (elf_hash_table (info)->dynsymcount - + bfd_count_sections (output_bfd))); - else if (strncmp (name, ".init", 5) != 0) - { - /* It's not one of our sections, so don't allocate space. */ - continue; - } - - if (strip) - { - _bfd_strip_section_from_output (info, s); - continue; - } - - /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); - if (s->contents == NULL && s->_raw_size != 0) - { - bfd_set_error (bfd_error_no_memory); - return false; - } - } - - if (elf_hash_table (info)->dynamic_sections_created) - { - /* Add some entries to the .dynamic section. We fill in the - values later, in elf_mips_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) - { - /* SGI object has the equivalence of DT_DEBUG in the - DT_MIPS_RLD_MAP entry. */ - if (!bfd_elf64_add_dynamic_entry (info, DT_MIPS_RLD_MAP, 0)) - return false; - if (!SGI_COMPAT (output_bfd)) - { - if (!bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0)) - return false; - } - } - else - { - /* Shared libraries on traditional mips have DT_DEBUG. */ - if (!SGI_COMPAT (output_bfd)) - { - if (!bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0)) - return false; - } - } - - if (reltext && SGI_COMPAT (output_bfd)) - info->flags |= DF_TEXTREL; - - if ((info->flags & DF_TEXTREL) != 0) - { - if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) - return false; - } - - if (! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0)) - return false; - - if (bfd_get_section_by_name (dynobj, "rel.dyn")) - { - if (! bfd_elf64_add_dynamic_entry (info, DT_REL, 0)) - return false; - - if (! bfd_elf64_add_dynamic_entry (info, DT_RELSZ, 0)) - return false; - - if (! bfd_elf64_add_dynamic_entry (info, DT_RELENT, 0)) - return false; - } - - if (SGI_COMPAT (output_bfd)) - { - if (!bfd_elf64_add_dynamic_entry (info, DT_MIPS_CONFLICTNO, 0)) - return false; - } - - if (SGI_COMPAT (output_bfd)) - { - if (!bfd_elf64_add_dynamic_entry (info, DT_MIPS_LIBLISTNO, 0)) - return false; - } - - if (bfd_get_section_by_name (dynobj, ".conflict") != NULL) - { - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_CONFLICT, 0)) - return false; - - s = bfd_get_section_by_name (dynobj, ".liblist"); - BFD_ASSERT (s != NULL); - - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_LIBLIST, 0)) - return false; - } - - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_RLD_VERSION, 0)) - return false; - - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_FLAGS, 0)) - return false; - -#if 0 - /* Time stamps in executable files are a bad idea. */ - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_TIME_STAMP, 0)) - return false; -#endif - -#if 0 /* FIXME */ - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_ICHECKSUM, 0)) - return false; -#endif - -#if 0 /* FIXME */ - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_IVERSION, 0)) - return false; -#endif - - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_BASE_ADDRESS, 0)) - return false; - - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_LOCAL_GOTNO, 0)) - return false; - - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_SYMTABNO, 0)) - return false; - - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_UNREFEXTNO, 0)) - return false; - - if (! bfd_elf64_add_dynamic_entry (info, DT_MIPS_GOTSYM, 0)) - return false; - - if ((bfd_get_section_by_name(dynobj, ".MIPS.options")) - && !bfd_elf64_add_dynamic_entry (info, DT_MIPS_OPTIONS, 0)) - return false; - - if (bfd_get_section_by_name (dynobj, ".msym") - && !bfd_elf64_add_dynamic_entry (info, DT_MIPS_MSYM, 0)) - return false; - } - - return true; -} - -/* Finish up dynamic symbol handling. We set the contents of various - dynamic sections here. */ - -boolean -mips_elf64_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; - bfd_vma gval; - asection *sgot; - asection *smsym; - struct mips_elf64_got_info *g; - const char *name; - struct mips_elf64_link_hash_entry *mh; - - dynobj = elf_hash_table (info)->dynobj; - gval = sym->st_value; - mh = (struct mips_elf64_link_hash_entry *) h; - - if (h->plt.offset != (bfd_vma) -1) - { - asection *s; - bfd_byte stub[MIPS_FUNCTION_STUB_SIZE]; - - /* This symbol has a stub. Set it up. */ - - BFD_ASSERT (h->dynindx != -1); - - s = bfd_get_section_by_name (dynobj, ".MIPS.stubs"); - BFD_ASSERT (s != NULL); - - /* FIXME: Can h->dynindex be more than 64K? */ - if (h->dynindx & 0xffff0000) - return false; - - /* Fill the stub. */ - bfd_put_32 (output_bfd, STUB_LW, stub); - bfd_put_32 (output_bfd, STUB_MOVE, stub + 4); - bfd_put_32 (output_bfd, STUB_JALR, stub + 8); - bfd_put_32 (output_bfd, STUB_LI16 + h->dynindx, stub + 12); - - BFD_ASSERT (h->plt.offset <= s->_raw_size); - memcpy (s->contents + h->plt.offset, stub, MIPS_FUNCTION_STUB_SIZE); - - /* Mark the symbol as undefined. plt.offset != -1 occurs - only for the referenced symbol. */ - sym->st_shndx = SHN_UNDEF; - - /* The run-time linker uses the st_value field of the symbol - to reset the global offset table entry for this external - to its stub address when unlinking a shared object. */ - gval = s->output_section->vma + s->output_offset + h->plt.offset; - sym->st_value = gval; - } - - BFD_ASSERT (h->dynindx != -1 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0); - - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_elf64_got_info *) elf_section_data (sgot)->tdata; - BFD_ASSERT (g != NULL); - - /* Run through the global symbol table, creating GOT entries for all - the symbols that need them. */ - if (g->global_gotsym != NULL - && h->dynindx >= g->global_gotsym->dynindx) - { - bfd_vma offset; - bfd_vma value; - - if (sym->st_value) - value = sym->st_value; - else - { - /* For an entity defined in a shared object, this will be - NULL. (For functions in shared objects for - which we have created stubs, ST_VALUE will be non-NULL. - That's because such the functions are now no longer defined - in a shared object.) */ - - if (info->shared && h->root.type == bfd_link_hash_undefined) - value = 0; - else - value = h->root.u.def.value; - } - offset = mips_elf64_global_got_index (dynobj, h); - bfd_put_64 (output_bfd, value, sgot->contents + offset); - } - - /* Create a .msym entry, if appropriate. */ - smsym = bfd_get_section_by_name (dynobj, ".msym"); - if (smsym) - { - Elf32_Internal_Msym msym; - - msym.ms_hash_value = bfd_elf_hash (h->root.root.string); - /* It is undocumented what the `1' indicates, but IRIX6 uses - this value. */ - msym.ms_info = ELF32_MS_INFO (mh->min_dyn_reloc_index, 1); - mips_elf64_swap_msym_out - (dynobj, &msym, - ((Elf32_External_Msym *) smsym->contents) + h->dynindx); - } - - /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ - name = h->root.root.string; - if (strcmp (name, "_DYNAMIC") == 0 - || strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) - sym->st_shndx = SHN_ABS; - else if (strcmp (name, "_DYNAMIC_LINK") == 0 - || strcmp (name, "_DYNAMIC_LINKING") == 0) - { - sym->st_shndx = SHN_ABS; - sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); - sym->st_value = 1; - } - else if (sym->st_shndx != SHN_UNDEF && sym->st_shndx != SHN_ABS) - { - if (h->type == STT_FUNC) - sym->st_shndx = SHN_MIPS_TEXT; - else if (h->type == STT_OBJECT) - sym->st_shndx = SHN_MIPS_DATA; - } - - /* Handle the IRIX6-specific symbols. */ - - { - /* The linker script takes care of providing names and values for - these, but we must place them into the right sections. */ - static const char* const text_section_symbols[] = { - "_ftext", - "_etext", - "__dso_displacement", - "__elf_header", - "__program_header_table", - NULL - }; - - static const char* const data_section_symbols[] = { - "_fdata", - "_edata", - "_end", - "_fbss", - NULL - }; - - const char* const *p; - int i; - - for (i = 0; i < 2; ++i) - for (p = (i == 0) ? text_section_symbols : data_section_symbols; - *p; - ++p) - if (strcmp (*p, name) == 0) - { - /* All of these symbols are given type STT_SECTION by the - IRIX6 linker. */ - sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); - - /* The IRIX linker puts these symbols in special sections. */ - if (i == 0) - sym->st_shndx = SHN_MIPS_TEXT; - else - sym->st_shndx = SHN_MIPS_DATA; - - break; - } - } - - return true; -} - -/* Finish up the dynamic sections. */ - -boolean -mips_elf64_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; -{ - bfd *dynobj; - asection *sdyn; - asection *sgot; - struct mips_elf64_got_info *g; - - dynobj = elf_hash_table (info)->dynobj; - - sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); - - sgot = bfd_get_section_by_name (dynobj, ".got"); - if (sgot == NULL) - g = NULL; - else - { - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_elf64_got_info *) elf_section_data (sgot)->tdata; - BFD_ASSERT (g != NULL); - } - - if (elf_hash_table (info)->dynamic_sections_created) - { - bfd_byte *b; - - BFD_ASSERT (sdyn != NULL); - BFD_ASSERT (g != NULL); - - for (b = sdyn->contents; - b < sdyn->contents + sdyn->_raw_size; - b += get_elf_backend_data (dynobj)->s->sizeof_dyn) - { - Elf_Internal_Dyn dyn; - const char *name; - size_t elemsize; - asection *s; - boolean swap_out_p; - - /* Read in the current dynamic entry. */ - (*get_elf_backend_data (dynobj)->s->swap_dyn_in) (dynobj, b, &dyn); - - /* Assume that we're going to modify it and write it out. */ - swap_out_p = true; - - switch (dyn.d_tag) - { - case DT_RELENT: - s = bfd_get_section_by_name(dynobj, "rel.dyn"); - BFD_ASSERT (s != NULL); - dyn.d_un.d_val = get_elf_backend_data (dynobj)->s->sizeof_rel; - break; - - case DT_STRSZ: - /* Rewrite DT_STRSZ. */ - dyn.d_un.d_val = - _bfd_elf_strtab_size (elf_hash_table (info)->dynstr); - break; - - case DT_PLTGOT: - name = ".got"; - goto get_vma; - case DT_MIPS_CONFLICT: - name = ".conflict"; - goto get_vma; - case DT_MIPS_LIBLIST: - name = ".liblist"; - get_vma: - s = bfd_get_section_by_name (output_bfd, name); - BFD_ASSERT (s != NULL); - dyn.d_un.d_ptr = s->vma; - break; - - case DT_MIPS_RLD_VERSION: - dyn.d_un.d_val = 1; /* XXX */ - break; - - case DT_MIPS_FLAGS: - dyn.d_un.d_val = RHF_NOTPOT; /* XXX */ - break; - - case DT_MIPS_CONFLICTNO: - name = ".conflict"; - elemsize = sizeof (Elf32_Conflict); - goto set_elemno; - - case DT_MIPS_LIBLISTNO: - name = ".liblist"; - elemsize = sizeof (Elf32_Lib); - set_elemno: - s = bfd_get_section_by_name (output_bfd, name); - if (s != NULL) - { - if (s->_cooked_size != 0) - dyn.d_un.d_val = s->_cooked_size / elemsize; - else - dyn.d_un.d_val = s->_raw_size / elemsize; - } - else - dyn.d_un.d_val = 0; - break; - - case DT_MIPS_TIME_STAMP: - time ((time_t *) &dyn.d_un.d_val); - break; - - case DT_MIPS_ICHECKSUM: - /* XXX FIXME: */ - swap_out_p = false; - break; - - case DT_MIPS_IVERSION: - /* XXX FIXME: */ - swap_out_p = false; - break; - - case DT_MIPS_BASE_ADDRESS: - s = output_bfd->sections; - BFD_ASSERT (s != NULL); - dyn.d_un.d_ptr = s->vma & ~(0xffff); - break; - - case DT_MIPS_LOCAL_GOTNO: - dyn.d_un.d_val = g->local_gotno; - break; - - case DT_MIPS_UNREFEXTNO: - /* The index into the dynamic symbol table which is the - entry of the first external symbol that is not - referenced within the same object. */ - dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1; - break; - - case DT_MIPS_GOTSYM: - if (g->global_gotsym) - { - dyn.d_un.d_val = g->global_gotsym->dynindx; - break; - } - /* In case if we don't have global got symbols we default - to setting DT_MIPS_GOTSYM to the same value as - DT_MIPS_SYMTABNO, so we just fall through. */ - - case DT_MIPS_SYMTABNO: - name = ".dynsym"; - elemsize = get_elf_backend_data (output_bfd)->s->sizeof_sym; - s = bfd_get_section_by_name (output_bfd, name); - BFD_ASSERT (s != NULL); - - if (s->_cooked_size != 0) - dyn.d_un.d_val = s->_cooked_size / elemsize; - else - dyn.d_un.d_val = s->_raw_size / elemsize; - break; - - case DT_MIPS_HIPAGENO: - dyn.d_un.d_val = g->local_gotno - MIPS_RESERVED_GOTNO; - break; - - case DT_MIPS_OPTIONS: - s = bfd_get_section_by_name(output_bfd, ".MIPS.options"); - dyn.d_un.d_ptr = s->vma; - break; - - case DT_MIPS_MSYM: - s = bfd_get_section_by_name(output_bfd, ".msym"); - dyn.d_un.d_ptr = s->vma; - break; - - default: - swap_out_p = false; - break; - } - - if (swap_out_p) - (*get_elf_backend_data (dynobj)->s->swap_dyn_out) - (dynobj, &dyn, b); - } - } - - /* The first entry of the global offset table will be filled at - runtime. The second entry will be used by some runtime loaders. - This isn't the case of Irix rld. */ - if (sgot != NULL && sgot->_raw_size > 0) - { - bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents); - bfd_put_64 (output_bfd, (bfd_vma) 0x80000000, sgot->contents + 8); - } - - if (sgot != NULL) - elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 8; - - { - asection *smsym; - asection *s; - - /* ??? The section symbols for the output sections were set up in - _bfd_elf_final_link. SGI sets the STT_NOTYPE attribute for these - symbols. Should we do so? */ - - smsym = bfd_get_section_by_name (dynobj, ".msym"); - if (smsym != NULL) - { - Elf32_Internal_Msym msym; - - msym.ms_hash_value = 0; - msym.ms_info = ELF32_MS_INFO (0, 1); - - for (s = output_bfd->sections; s != NULL; s = s->next) - { - long dynindx = elf_section_data (s)->dynindx; - - mips_elf64_swap_msym_out - (output_bfd, &msym, - (((Elf32_External_Msym *) smsym->contents) - + dynindx)); - } - } - - /* Clean up a first relocation in .rel.dyn. */ - s = bfd_get_section_by_name (dynobj, "rel.dyn"); - if (s != NULL && s->_raw_size > 0) - memset (s->contents, 0, get_elf_backend_data (dynobj)->s->sizeof_rel); - } - - return true; -} - -/* Return the section that should be marked against GC for a given - relocation. */ - -asection * -mips_elf64_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_MIPS_GNU_VTINHERIT: - case R_MIPS_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 - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } - - return NULL; -} - -/* Update the got entry reference counts for the section being removed. */ - -boolean -mips_elf64_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; -{ -#if 0 - 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_MIPS_GOT16: - case R_MIPS_CALL16: - case R_MIPS_CALL_HI16: - case R_MIPS_CALL_LO16: - case R_MIPS_GOT_HI16: - case R_MIPS_GOT_LO16: - /* ??? It would seem that the existing MIPS code does no sort - of reference counting or whatnot on its GOT and PLT entries, - so it is not possible to garbage collect them at this time. */ - break; - - default: - break; - } -#endif - - return true; -} - -/* Create the .got section to hold the global offset table. */ - -static boolean -mips_elf64_create_got_section (abfd, info) - bfd *abfd; - struct bfd_link_info *info; -{ - flagword flags; - register asection *s; - struct elf_link_hash_entry *h; - struct mips_elf64_got_info *g; - - /* This function may be called more than once. */ - if (bfd_get_section_by_name (abfd, ".got")) - return true; - - flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY - | SEC_LINKER_CREATED); - - s = bfd_make_section (abfd, ".got"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) - || ! bfd_set_section_alignment (abfd, s, 4)) - return false; - - /* Define the symbol _GLOBAL_OFFSET_TABLE_. We don't do this in the - linker script because we don't want to define the symbol if we - are not creating a global offset table. */ - h = NULL; - if (! (_bfd_generic_link_add_one_symbol - (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s, - (bfd_vma) 0, (const char *) NULL, false, - get_elf_backend_data (abfd)->collect, - (struct bfd_link_hash_entry **) &h))) - return false; - h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF; - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - h->type = STT_OBJECT; - - if (info->shared - && ! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; - - /* The first several global offset table entries are reserved. */ - s->_raw_size = MIPS_RESERVED_GOTNO * (get_elf_backend_data (abfd)->s->arch_size / 8); - - g = (struct mips_elf64_got_info *) bfd_alloc (abfd, - sizeof (struct mips_elf64_got_info)); - if (g == NULL) - return false; - g->global_gotsym = NULL; - g->local_gotno = MIPS_RESERVED_GOTNO; - g->assigned_gotno = MIPS_RESERVED_GOTNO; - if (elf_section_data (s) == NULL) - { - s->used_by_bfd = - (PTR) bfd_zalloc (abfd, sizeof (struct bfd_elf_section_data)); - if (elf_section_data (s) == NULL) - return false; - } - elf_section_data (s)->tdata = (PTR) g; - elf_section_data (s)->this_hdr.sh_flags - |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL; - - return true; -} - -/* If H is a symbol that needs a global GOT entry, but has a dynamic - symbol table index lower than any we've seen to date, record it for - posterity. */ - -static boolean -mips_elf64_record_global_got_symbol (h, info, g) - struct elf_link_hash_entry *h; - struct bfd_link_info *info; - struct mips_elf64_got_info *g ATTRIBUTE_UNUSED; -{ - /* A global symbol in the GOT must also be in the dynamic symbol - table. */ - if (h->dynindx == -1 - && !bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; - - /* If we've already marked this entry as needing GOT space, we don't - need to do it again. */ - if (h->got.offset != (bfd_vma) - 1) - return true; - - /* By setting this to a value other than -1, we are indicating that - there needs to be a GOT entry for H. Avoid using zero, as the - generic ELF copy_indirect_symbol tests for <= 0. */ - h->got.offset = 1; - - return true; -} - -/* Returns the .msym section for ABFD, creating it if it does not - already exist. Returns NULL to indicate error. */ - -static asection * -mips_elf64_create_msym_section (abfd) - bfd *abfd; -{ - asection *s; - - s = bfd_get_section_by_name (abfd, ".msym"); - if (!s) - { - s = bfd_make_section (abfd, ".msym"); - if (!s - || !bfd_set_section_flags (abfd, s, - SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_LINKER_CREATED - | SEC_READONLY) - || !bfd_set_section_alignment (abfd, s, 3)) - return NULL; - } - - return s; -} - -/* Add room for N relocations to the .rel.dyn section in ABFD. */ - -static void -mips_elf64_allocate_dynamic_relocations (abfd, n) - bfd *abfd; - unsigned int n; -{ - asection *s; - - s = bfd_get_section_by_name (abfd, ".rel.dyn"); - BFD_ASSERT (s != NULL); - - if (s->_raw_size == 0) - { - /* Make room for a null element. */ - s->_raw_size += get_elf_backend_data (abfd)->s->sizeof_rel; - ++s->reloc_count; - } - s->_raw_size += n * get_elf_backend_data (abfd)->s->sizeof_rel; -} - -/* Look through the relocs for a section during the first phase, and - allocate space in the global offset table. */ - -boolean -mips_elf64_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; -{ - const char *name; - bfd *dynobj; - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - struct mips_elf64_got_info *g; - size_t extsymoff; - const Elf_Internal_Rela *rel; - const Elf_Internal_Rela *rel_end; - asection *sgot; - asection *sreloc; - struct elf_backend_data *bed; - - if (info->relocateable) - return true; - - dynobj = elf_hash_table (info)->dynobj; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (abfd); - extsymoff = (elf_bad_symtab (abfd)) ? 0 : symtab_hdr->sh_info; - - /* Check for the mips16 stub sections. */ - - name = bfd_get_section_name (abfd, sec); - if (strncmp (name, FN_STUB, sizeof FN_STUB - 1) == 0) - { - unsigned long r_symndx; - - /* Look at the relocation information to figure out which symbol - this is for. */ - - r_symndx = ELF64_R_SYM (relocs->r_info); - - if (r_symndx < extsymoff - || sym_hashes[r_symndx - extsymoff] == NULL) - { - asection *o; - - /* This stub is for a local symbol. This stub will only be - needed if there is some relocation in this BFD, other - than a 16 bit function call, which refers to this symbol. */ - for (o = abfd->sections; o != NULL; o = o->next) - { - Elf_Internal_Rela *sec_relocs; - const Elf_Internal_Rela *r, *rend; - - /* We can ignore stub sections when looking for relocs. */ - if ((o->flags & SEC_RELOC) == 0 - || o->reloc_count == 0 - || strncmp (bfd_get_section_name (abfd, o), FN_STUB, - sizeof FN_STUB - 1) == 0 - || strncmp (bfd_get_section_name (abfd, o), CALL_STUB, - sizeof CALL_STUB - 1) == 0 - || strncmp (bfd_get_section_name (abfd, o), CALL_FP_STUB, - sizeof CALL_FP_STUB - 1) == 0) - continue; - - sec_relocs = (_bfd_elf64_link_read_relocs - (abfd, o, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory)); - if (sec_relocs == NULL) - return false; - - rend = sec_relocs + o->reloc_count; - for (r = sec_relocs; r < rend; r++) - if (ELF64_R_SYM (r->r_info) == r_symndx - && ELF64_R_TYPE (r->r_info) != R_MIPS16_26) - break; - - if (! info->keep_memory) - free (sec_relocs); - - if (r < rend) - break; - } - - if (o == NULL) - { - /* There is no non-call reloc for this stub, so we do - not need it. Since this function is called before - the linker maps input sections to output sections, we - can easily discard it by setting the SEC_EXCLUDE - flag. */ - sec->flags |= SEC_EXCLUDE; - return true; - } - - /* Record this stub in an array of local symbol stubs for - this BFD. */ - if (elf_tdata (abfd)->local_stubs == NULL) - { - unsigned long symcount; - asection **n; - bfd_size_type amt; - - if (elf_bad_symtab (abfd)) - symcount = NUM_SHDR_ENTRIES (symtab_hdr); - else - symcount = symtab_hdr->sh_info; - amt = symcount * sizeof (asection *); - n = (asection **) bfd_zalloc (abfd, amt); - if (n == NULL) - return false; - elf_tdata (abfd)->local_stubs = n; - } - - elf_tdata (abfd)->local_stubs[r_symndx] = sec; - - /* We don't need to set mips16_stubs_seen in this case. - That flag is used to see whether we need to look through - the global symbol table for stubs. We don't need to set - it here, because we just have a local stub. */ - } - else - { - struct mips_elf64_link_hash_entry *h; - - h = ((struct mips_elf64_link_hash_entry *) - sym_hashes[r_symndx - extsymoff]); - - /* H is the symbol this stub is for. */ - - h->fn_stub = sec; - mips_elf64_hash_table (info)->mips16_stubs_seen = true; - } - } - else if (strncmp (name, CALL_STUB, sizeof CALL_STUB - 1) == 0 - || strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) - { - unsigned long r_symndx; - struct mips_elf64_link_hash_entry *h; - asection **loc; - - /* Look at the relocation information to figure out which symbol - this is for. */ - - r_symndx = ELF64_R_SYM (relocs->r_info); - - if (r_symndx < extsymoff - || sym_hashes[r_symndx - extsymoff] == NULL) - { - /* This stub was actually built for a static symbol defined - in the same file. We assume that all static symbols in - mips16 code are themselves mips16, so we can simply - discard this stub. Since this function is called before - the linker maps input sections to output sections, we can - easily discard it by setting the SEC_EXCLUDE flag. */ - sec->flags |= SEC_EXCLUDE; - return true; - } - - h = ((struct mips_elf64_link_hash_entry *) - sym_hashes[r_symndx - extsymoff]); - - /* H is the symbol this stub is for. */ - - if (strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) - loc = &h->call_fp_stub; - else - loc = &h->call_stub; - - /* If we already have an appropriate stub for this function, we - don't need another one, so we can discard this one. Since - this function is called before the linker maps input sections - to output sections, we can easily discard it by setting the - SEC_EXCLUDE flag. We can also discard this section if we - happen to already know that this is a mips16 function; it is - not necessary to check this here, as it is checked later, but - it is slightly faster to check now. */ - if (*loc != NULL || h->root.other == STO_MIPS16) - { - sec->flags |= SEC_EXCLUDE; - return true; - } - - *loc = sec; - mips_elf64_hash_table (info)->mips16_stubs_seen = true; - } - - if (dynobj == NULL) - { - sgot = NULL; - g = NULL; - } - else - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - if (sgot == NULL) - g = NULL; - else - { - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_elf64_got_info *) elf_section_data (sgot)->tdata; - BFD_ASSERT (g != NULL); - } - } - - sreloc = NULL; - bed = get_elf_backend_data (abfd); - rel_end = relocs + sec->reloc_count * bed->s->int_rels_per_ext_rel; - for (rel = relocs; rel < rel_end; ++rel) - { - unsigned long r_symndx; - int r_type; - struct elf_link_hash_entry *h; - - r_symndx = ELF64_R_SYM (rel->r_info); - r_type = ELF64_MIPS_R_TYPE (rel->r_info); - - if (r_symndx < extsymoff) - h = NULL; - else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr)) - { - (*_bfd_error_handler) - (_("%s: Malformed reloc detected for section %s"), - bfd_archive_filename (abfd), name); - bfd_set_error (bfd_error_bad_value); - return false; - } - else - { - h = sym_hashes[r_symndx - extsymoff]; - - /* This may be an indirect symbol created because of a version. */ - if (h != NULL) - { - while (h->root.type == bfd_link_hash_indirect) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - } - } - - /* Some relocs require a global offset table. */ - if (dynobj == NULL || sgot == NULL) - { - switch (r_type) - { - case R_MIPS_GOT16: - case R_MIPS_CALL16: - case R_MIPS_CALL_HI16: - case R_MIPS_CALL_LO16: - case R_MIPS_GOT_HI16: - case R_MIPS_GOT_LO16: - case R_MIPS_GOT_PAGE: - case R_MIPS_GOT_OFST: - case R_MIPS_GOT_DISP: - if (dynobj == NULL) - elf_hash_table (info)->dynobj = dynobj = abfd; - if (! mips_elf64_create_got_section (dynobj, info)) - return false; - g = _mips_elf64_got_info (dynobj, &sgot); - break; - - case R_MIPS_32: - case R_MIPS_REL32: - case R_MIPS_64: - if (dynobj == NULL - && (info->shared || h != NULL) - && (sec->flags & SEC_ALLOC) != 0) - elf_hash_table (info)->dynobj = dynobj = abfd; - break; - - default: - break; - } - } - - if (!h && (r_type == R_MIPS_CALL_LO16 - || r_type == R_MIPS_GOT_LO16 - || r_type == R_MIPS_GOT_DISP)) - { - /* We may need a local GOT entry for this relocation. We - don't count R_MIPS_GOT_PAGE because we can estimate the - maximum number of pages needed by looking at the size of - the segment. Similar comments apply to R_MIPS_GOT16 and - R_MIPS_CALL16. We don't count R_MIPS_GOT_HI16, or - R_MIPS_CALL_HI16 because these are always followed by an - R_MIPS_GOT_LO16 or R_MIPS_CALL_LO16. - - This estimation is very conservative since we can merge - duplicate entries in the GOT. In order to be less - conservative, we could actually build the GOT here, - rather than in relocate_section. */ - g->local_gotno++; - sgot->_raw_size += get_elf_backend_data (dynobj)->s->arch_size / 8; - } - - switch (r_type) - { - case R_MIPS_CALL16: - if (h == NULL) - { - (*_bfd_error_handler) - (_("%s: CALL16 reloc at 0x%lx not against global symbol"), - bfd_archive_filename (abfd), (unsigned long) rel->r_offset); - bfd_set_error (bfd_error_bad_value); - return false; - } - /* Fall through. */ - - case R_MIPS_CALL_HI16: - case R_MIPS_CALL_LO16: - if (h != NULL) - { - /* This symbol requires a global offset table entry. */ - if (!mips_elf64_record_global_got_symbol (h, info, g)) - return false; - - /* We need a stub, not a plt entry for the undefined - function. But we record it as if it needs plt. See - elf_adjust_dynamic_symbol in elflink.h. */ - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - h->type = STT_FUNC; - } - break; - - case R_MIPS_GOT16: - case R_MIPS_GOT_HI16: - case R_MIPS_GOT_LO16: - case R_MIPS_GOT_DISP: - /* This symbol requires a global offset table entry. */ - if (h && !mips_elf64_record_global_got_symbol (h, info, g)) - return false; - break; - - case R_MIPS_32: - case R_MIPS_REL32: - case R_MIPS_64: - if ((info->shared || h != NULL) - && (sec->flags & SEC_ALLOC) != 0) - { - if (sreloc == NULL) - { - const char *name = ".rel.dyn"; - - sreloc = bfd_get_section_by_name (dynobj, name); - if (sreloc == NULL) - { - sreloc = bfd_make_section (dynobj, name); - if (sreloc == NULL - || ! bfd_set_section_flags (dynobj, sreloc, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, sreloc, - 4)) - return false; - } - } -#define MIPS_READONLY_SECTION (SEC_ALLOC | SEC_LOAD | SEC_READONLY) - if (info->shared) - { - /* When creating a shared object, we must copy these - reloc types into the output file as R_MIPS_REL32 - relocs. We make room for this reloc in the - .rel.dyn reloc section. */ - mips_elf64_allocate_dynamic_relocations (dynobj, 1); - if ((sec->flags & MIPS_READONLY_SECTION) - == MIPS_READONLY_SECTION) - /* We tell the dynamic linker that there are - relocations against the text segment. */ - info->flags |= DF_TEXTREL; - } - else - { - struct mips_elf64_link_hash_entry *hmips; - - /* We only need to copy this reloc if the symbol is - defined in a dynamic object. */ - hmips = (struct mips_elf64_link_hash_entry *) h; - ++hmips->possibly_dynamic_relocs; - if ((sec->flags & MIPS_READONLY_SECTION) - == MIPS_READONLY_SECTION) - /* We need it to tell the dynamic linker if there - are relocations against the text segment. */ - hmips->readonly_reloc = true; - } - - /* Even though we don't directly need a GOT entry for - this symbol, a symbol must have a dynamic symbol - table index greater that DT_MIPS_GOTSYM if there are - dynamic relocations against it. */ - if (h != NULL - && !mips_elf64_record_global_got_symbol (h, info, g)) - return false; - } - break; - - case R_MIPS_26: - case R_MIPS_GPREL16: - case R_MIPS_LITERAL: - case R_MIPS_GPREL32: - break; - - /* This relocation describes the C++ object vtable hierarchy. - Reconstruct it for later use during GC. */ - case R_MIPS_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_MIPS_GNU_VTENTRY: - if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_offset)) - return false; - break; - - default: - break; - } - } - - return true; -} - -/* Structure used to pass information to mips_elf64_output_extsym. */ - -struct extsym_info -{ - bfd *abfd; - struct bfd_link_info *info; - struct ecoff_debug_info *debug; - const struct ecoff_debug_swap *swap; - boolean failed; -}; - -/* This routine is used to write out ECOFF debugging external symbol - information. It is called via mips_elf64_link_hash_traverse. The - ECOFF external symbol information must match the ELF external - symbol information. Unfortunately, at this point we don't know - whether a symbol is required by reloc information, so the two - tables may wind up being different. We must sort out the external - symbol information before we can set the final size of the .mdebug - section, and we must set the size of the .mdebug section before we - can relocate any sections, and we can't know which symbols are - required by relocation until we relocate the sections. - Fortunately, it is relatively unlikely that any symbol will be - stripped but required by a reloc. In particular, it can not happen - when generating a final executable. */ - -static boolean -mips_elf64_output_extsym (h, data) - struct mips_elf64_link_hash_entry *h; - PTR data; -{ - struct extsym_info *einfo = (struct extsym_info *) data; - boolean strip; - asection *sec, *output_section; - - if (h->root.root.type == bfd_link_hash_warning) - h = (struct mips_elf64_link_hash_entry *) h->root.root.u.i.link; - - if (h->root.indx == -2) - strip = false; - else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - || (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0) - && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 - && (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0) - strip = true; - else if (einfo->info->strip == strip_all - || (einfo->info->strip == strip_some - && bfd_hash_lookup (einfo->info->keep_hash, - h->root.root.root.string, - false, false) == NULL)) - strip = true; - else - strip = false; - - if (strip) - return true; - - if (h->esym.ifd == -2) - { - h->esym.jmptbl = 0; - h->esym.cobol_main = 0; - h->esym.weakext = 0; - h->esym.reserved = 0; - h->esym.ifd = ifdNil; - h->esym.asym.value = 0; - h->esym.asym.st = stGlobal; - - if (h->root.root.type == bfd_link_hash_undefined - || h->root.root.type == bfd_link_hash_undefweak) - { - const char *name; - - /* Use undefined class. Also, set class and type for some - special symbols. */ - name = h->root.root.root.string; - h->esym.asym.sc = scUndefined; - } - else if (h->root.root.type != bfd_link_hash_defined - && h->root.root.type != bfd_link_hash_defweak) - h->esym.asym.sc = scAbs; - else - { - const char *name; - - sec = h->root.root.u.def.section; - output_section = sec->output_section; - - /* When making a shared library and symbol h is the one from - the another shared library, OUTPUT_SECTION may be null. */ - if (output_section == NULL) - h->esym.asym.sc = scUndefined; - else - { - name = bfd_section_name (output_section->owner, output_section); - - if (strcmp (name, ".text") == 0) - h->esym.asym.sc = scText; - else if (strcmp (name, ".data") == 0) - h->esym.asym.sc = scData; - else if (strcmp (name, ".sdata") == 0) - h->esym.asym.sc = scSData; - else if (strcmp (name, ".rodata") == 0 - || strcmp (name, ".rdata") == 0) - h->esym.asym.sc = scRData; - else if (strcmp (name, ".bss") == 0) - h->esym.asym.sc = scBss; - else if (strcmp (name, ".sbss") == 0) - h->esym.asym.sc = scSBss; - else if (strcmp (name, ".init") == 0) - h->esym.asym.sc = scInit; - else if (strcmp (name, ".fini") == 0) - h->esym.asym.sc = scFini; - else - h->esym.asym.sc = scAbs; - } - } - - h->esym.asym.reserved = 0; - h->esym.asym.index = indexNil; - } - - if (h->root.root.type == bfd_link_hash_common) - h->esym.asym.value = h->root.root.u.c.size; - else if (h->root.root.type == bfd_link_hash_defined - || h->root.root.type == bfd_link_hash_defweak) - { - if (h->esym.asym.sc == scCommon) - h->esym.asym.sc = scBss; - else if (h->esym.asym.sc == scSCommon) - h->esym.asym.sc = scSBss; - - sec = h->root.root.u.def.section; - output_section = sec->output_section; - if (output_section != NULL) - h->esym.asym.value = (h->root.root.u.def.value - + sec->output_offset - + output_section->vma); - else - h->esym.asym.value = 0; - } - else if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) - { - struct mips_elf64_link_hash_entry *hd = h; - boolean no_fn_stub = h->no_fn_stub; - - while (hd->root.root.type == bfd_link_hash_indirect) - { - hd = (struct mips_elf64_link_hash_entry *)h->root.root.u.i.link; - no_fn_stub = no_fn_stub || hd->no_fn_stub; - } - - if (!no_fn_stub) - { - /* Set type and value for a symbol with a function stub. */ - h->esym.asym.st = stProc; - sec = hd->root.root.u.def.section; - if (sec == NULL) - h->esym.asym.value = 0; - else - { - output_section = sec->output_section; - if (output_section != NULL) - h->esym.asym.value = (hd->root.plt.offset - + sec->output_offset - + output_section->vma); - else - h->esym.asym.value = 0; - } -#if 0 /* FIXME? */ - h->esym.ifd = 0; -#endif - } - } - - if (! bfd_ecoff_debug_one_external (einfo->abfd, einfo->debug, einfo->swap, - h->root.root.root.string, - &h->esym)) - { - einfo->failed = true; - return false; - } - - return true; -} - -/* Swap an entry in a .gptab section. Note that these routines rely - on the equivalence of the two elements of the union. */ - -static void -mips_elf64_swap_gptab_in (abfd, ex, in) - bfd *abfd; - const Elf32_External_gptab *ex; - Elf32_gptab *in; -{ - in->gt_entry.gt_g_value = H_GET_32 (abfd, ex->gt_entry.gt_g_value); - in->gt_entry.gt_bytes = H_GET_32 (abfd, ex->gt_entry.gt_bytes); -} - -static void -mips_elf64_swap_gptab_out (abfd, in, ex) - bfd *abfd; - const Elf32_gptab *in; - Elf32_External_gptab *ex; -{ - H_PUT_32 (abfd, (bfd_vma) in->gt_entry.gt_g_value, - ex->gt_entry.gt_g_value); - H_PUT_32 (abfd, (bfd_vma) in->gt_entry.gt_bytes, - ex->gt_entry.gt_bytes); -} - -/* A comparison routine used to sort .gptab entries. */ - -static int -gptab_compare (p1, p2) - const PTR p1; - const PTR p2; -{ - const Elf32_gptab *a1 = (const Elf32_gptab *) p1; - const Elf32_gptab *a2 = (const Elf32_gptab *) p2; - - return a1->gt_entry.gt_g_value - a2->gt_entry.gt_g_value; -} - -/* We need to use a special link routine to handle the .mdebug section. - We need to merge all instances of this section together, not write - them all out sequentially. */ - -boolean -mips_elf64_final_link (abfd, info) - bfd *abfd; - struct bfd_link_info *info; -{ - asection **secpp; - asection *o; - struct bfd_link_order *p; - asection *mdebug_sec, *gptab_data_sec, *gptab_bss_sec; - struct ecoff_debug_info debug; - const struct ecoff_debug_swap *swap - = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; - HDRR *symhdr = &debug.symbolic_header; - PTR mdebug_handle = NULL; - asection *s; - EXTR esym; - unsigned int i; - static const char * const secname[] = - { ".text", ".init", ".fini", ".data", - ".rodata", ".sdata", ".sbss", ".bss" }; - static const int sc[] = { scText, scInit, scFini, scData, - scRData, scSData, scSBss, scBss }; - - /* If all the things we linked together were PIC, but we're - producing an executable (rather than a shared object), then the - resulting file is CPIC (i.e., it calls PIC code.) */ - if (!info->shared - && !info->relocateable - && elf_elfheader (abfd)->e_flags & EF_MIPS_PIC) - { - elf_elfheader (abfd)->e_flags &= ~EF_MIPS_PIC; - elf_elfheader (abfd)->e_flags |= EF_MIPS_CPIC; - } - - /* We'd carefully arranged the dynamic symbol indices, and then the - generic size_dynamic_sections renumbered them out from under us. - Rather than trying somehow to prevent the renumbering, just do - the sort again. */ - if (elf_hash_table (info)->dynamic_sections_created) - { - bfd *dynobj; - asection *got; - struct mips_elf64_got_info *g; - - /* When we resort, we must tell mips_elf64_sort_hash_table what - the lowest index it may use is. That's the number of section - symbols we're going to add. The generic ELF linker only - adds these symbols when building a shared object. Note that - we count the sections after (possibly) removing the .options - section above. */ - if (!mips_elf64_sort_hash_table (info, (info->shared - ? bfd_count_sections (abfd) + 1 - : 1))) - return false; - - /* Make sure we didn't grow the global .got region. */ - dynobj = elf_hash_table (info)->dynobj; - got = bfd_get_section_by_name (dynobj, ".got"); - g = (struct mips_elf64_got_info *) elf_section_data (got)->tdata; - - if (g->global_gotsym != NULL) - BFD_ASSERT ((elf_hash_table (info)->dynsymcount - - g->global_gotsym->dynindx) - <= g->global_gotno); - } - - /* We include .MIPS.options, even though we don't process it quite right. - (Some entries are supposed to be merged.) At IRIX6 empirically we seem - to be better off including it than not. */ - for (secpp = &abfd->sections; *secpp != NULL; secpp = &(*secpp)->next) - { - if (strcmp ((*secpp)->name, ".MIPS.options") == 0) - { - for (p = (*secpp)->link_order_head; p != NULL; p = p->next) - if (p->type == bfd_indirect_link_order) - p->u.indirect.section->flags &=~ SEC_HAS_CONTENTS; - (*secpp)->link_order_head = NULL; - bfd_section_list_remove (abfd, secpp); - --abfd->section_count; - - break; - } - } - - /* Get a value for the GP register. */ - if (elf_gp (abfd) == 0) - { - struct bfd_link_hash_entry *h; - - h = bfd_link_hash_lookup (info->hash, "_gp", false, false, true); - if (h != (struct bfd_link_hash_entry *) NULL - && h->type == bfd_link_hash_defined) - elf_gp (abfd) = (h->u.def.value - + h->u.def.section->output_section->vma - + h->u.def.section->output_offset); - else if (info->relocateable) - { - bfd_vma lo = MINUS_ONE; - - /* Find the GP-relative section with the lowest offset. */ - for (o = abfd->sections; o != NULL; o = o->next) - if (o->vma < lo - && (elf_section_data (o)->this_hdr.sh_flags & SHF_MIPS_GPREL)) - lo = o->vma; - - /* And calculate GP relative to that. */ - elf_gp (abfd) = (lo + 0x7ff0); - } - else - { - /* If the relocate_section function needs to do a reloc - involving the GP value, it should make a reloc_dangerous - callback to warn that GP is not defined. */ - } - } - - /* Go through the sections and collect the .mdebug information. */ - mdebug_sec = NULL; - gptab_data_sec = NULL; - gptab_bss_sec = NULL; - for (o = abfd->sections; o != (asection *) NULL; o = o->next) - { - if (strcmp (o->name, ".mdebug") == 0) - { - struct extsym_info einfo; - bfd_vma last; - - /* We have found the .mdebug section in the output file. - Look through all the link_orders comprising it and merge - the information together. */ - symhdr->magic = swap->sym_magic; - /* FIXME: What should the version stamp be? */ - symhdr->vstamp = 0; - symhdr->ilineMax = 0; - symhdr->cbLine = 0; - symhdr->idnMax = 0; - symhdr->ipdMax = 0; - symhdr->isymMax = 0; - symhdr->ioptMax = 0; - symhdr->iauxMax = 0; - symhdr->issMax = 0; - symhdr->issExtMax = 0; - symhdr->ifdMax = 0; - symhdr->crfd = 0; - symhdr->iextMax = 0; - - /* We accumulate the debugging information itself in the - debug_info structure. */ - debug.line = NULL; - debug.external_dnr = NULL; - debug.external_pdr = NULL; - debug.external_sym = NULL; - debug.external_opt = NULL; - debug.external_aux = NULL; - debug.ss = NULL; - debug.ssext = debug.ssext_end = NULL; - debug.external_fdr = NULL; - debug.external_rfd = NULL; - debug.external_ext = debug.external_ext_end = NULL; - - mdebug_handle = bfd_ecoff_debug_init (abfd, &debug, swap, info); - if (mdebug_handle == (PTR) NULL) - return false; - - esym.jmptbl = 0; - esym.cobol_main = 0; - esym.weakext = 0; - esym.reserved = 0; - esym.ifd = ifdNil; - esym.asym.iss = issNil; - esym.asym.st = stLocal; - esym.asym.reserved = 0; - esym.asym.index = indexNil; - last = 0; - for (i = 0; i < sizeof (secname) / sizeof (secname[0]); i++) - { - esym.asym.sc = sc[i]; - s = bfd_get_section_by_name (abfd, secname[i]); - if (s != NULL) - { - esym.asym.value = s->vma; - last = s->vma + s->_raw_size; - } - else - esym.asym.value = last; - if (!bfd_ecoff_debug_one_external (abfd, &debug, swap, - secname[i], &esym)) - return false; - } - - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) - { - asection *input_section; - bfd *input_bfd; - const struct ecoff_debug_swap *input_swap; - struct ecoff_debug_info input_debug; - char *eraw_src; - char *eraw_end; - - if (p->type != bfd_indirect_link_order) - { - if (p->type == bfd_fill_link_order) - continue; - abort (); - } - - input_section = p->u.indirect.section; - input_bfd = input_section->owner; - - if (bfd_get_flavour (input_bfd) != bfd_target_elf_flavour - || (get_elf_backend_data (input_bfd) - ->elf_backend_ecoff_debug_swap) == NULL) - { - /* I don't know what a non MIPS ELF bfd would be - doing with a .mdebug section, but I don't really - want to deal with it. */ - continue; - } - - input_swap = (get_elf_backend_data (input_bfd) - ->elf_backend_ecoff_debug_swap); - - BFD_ASSERT (p->size == input_section->_raw_size); - - /* The ECOFF linking code expects that we have already - read in the debugging information and set up an - ecoff_debug_info structure, so we do that now. */ - if (! _bfd_mips_elf_read_ecoff_info (input_bfd, input_section, - &input_debug)) - return false; - - if (! (bfd_ecoff_debug_accumulate - (mdebug_handle, abfd, &debug, swap, input_bfd, - &input_debug, input_swap, info))) - return false; - - /* Loop through the external symbols. For each one with - interesting information, try to find the symbol in - the linker global hash table and save the information - for the output external symbols. */ - eraw_src = input_debug.external_ext; - eraw_end = (eraw_src - + (input_debug.symbolic_header.iextMax - * input_swap->external_ext_size)); - for (; - eraw_src < eraw_end; - eraw_src += input_swap->external_ext_size) - { - EXTR ext; - const char *name; - struct mips_elf64_link_hash_entry *h; - - (*input_swap->swap_ext_in) (input_bfd, (PTR) eraw_src, &ext); - if (ext.asym.sc == scNil - || ext.asym.sc == scUndefined - || ext.asym.sc == scSUndefined) - continue; - - name = input_debug.ssext + ext.asym.iss; - h = mips_elf64_link_hash_lookup (mips_elf64_hash_table (info), - name, false, false, true); - if (h == NULL || h->esym.ifd != -2) - continue; - - if (ext.ifd != -1) - { - BFD_ASSERT (ext.ifd - < input_debug.symbolic_header.ifdMax); - ext.ifd = input_debug.ifdmap[ext.ifd]; - } - - h->esym = ext; - } - - /* Free up the information we just read. */ - free (input_debug.line); - free (input_debug.external_dnr); - free (input_debug.external_pdr); - free (input_debug.external_sym); - free (input_debug.external_opt); - free (input_debug.external_aux); - free (input_debug.ss); - free (input_debug.ssext); - free (input_debug.external_fdr); - free (input_debug.external_rfd); - free (input_debug.external_ext); - - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &=~ SEC_HAS_CONTENTS; - } - - /* Build the external symbol information. */ - einfo.abfd = abfd; - einfo.info = info; - einfo.debug = &debug; - einfo.swap = swap; - einfo.failed = false; - mips_elf64_link_hash_traverse (mips_elf64_hash_table (info), - mips_elf64_output_extsym, - (PTR) &einfo); - if (einfo.failed) - return false; - - /* Set the size of the .mdebug section. */ - o->_raw_size = bfd_ecoff_debug_size (abfd, &debug, swap); - - /* Skip this section later on (I don't think this currently - matters, but someday it might). */ - o->link_order_head = (struct bfd_link_order *) NULL; - - mdebug_sec = o; - } - - if (strncmp (o->name, ".gptab.", sizeof ".gptab." - 1) == 0) - { - const char *subname; - unsigned int c; - Elf32_gptab *tab; - Elf32_External_gptab *ext_tab; - unsigned int i; - - /* The .gptab.sdata and .gptab.sbss sections hold - information describing how the small data area would - change depending upon the -G switch. These sections - not used in executables files. */ - if (! info->relocateable) - { - asection **secpp; - - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) - { - asection *input_section; - - if (p->type != bfd_indirect_link_order) - { - if (p->type == bfd_fill_link_order) - continue; - abort (); - } - - input_section = p->u.indirect.section; - - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &=~ SEC_HAS_CONTENTS; - } - - /* Skip this section later on (I don't think this - currently matters, but someday it might). */ - o->link_order_head = (struct bfd_link_order *) NULL; - - /* Really remove the section. */ - for (secpp = &abfd->sections; - *secpp != o; - secpp = &(*secpp)->next) - ; - bfd_section_list_remove (abfd, secpp); - --abfd->section_count; - - continue; - } - - /* There is one gptab for initialized data, and one for - uninitialized data. */ - if (strcmp (o->name, ".gptab.sdata") == 0) - gptab_data_sec = o; - else if (strcmp (o->name, ".gptab.sbss") == 0) - gptab_bss_sec = o; - else - { - (*_bfd_error_handler) - (_("%s: illegal section name `%s'"), - bfd_archive_filename (abfd), o->name); - bfd_set_error (bfd_error_nonrepresentable_section); - return false; - } - - /* The linker script always combines .gptab.data and - .gptab.sdata into .gptab.sdata, and likewise for - .gptab.bss and .gptab.sbss. It is possible that there is - no .sdata or .sbss section in the output file, in which - case we must change the name of the output section. */ - subname = o->name + sizeof ".gptab" - 1; - if (bfd_get_section_by_name (abfd, subname) == NULL) - { - if (o == gptab_data_sec) - o->name = ".gptab.data"; - else - o->name = ".gptab.bss"; - subname = o->name + sizeof ".gptab" - 1; - BFD_ASSERT (bfd_get_section_by_name (abfd, subname) != NULL); - } - - /* Set up the first entry. */ - c = 1; - tab = (Elf32_gptab *) bfd_malloc (c * sizeof (Elf32_gptab)); - if (tab == NULL) - return false; - tab[0].gt_header.gt_current_g_value = elf_gp_size (abfd); - tab[0].gt_header.gt_unused = 0; - - /* Combine the input sections. */ - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) - { - asection *input_section; - bfd *input_bfd; - bfd_size_type size; - unsigned long last; - bfd_size_type gpentry; - - if (p->type != bfd_indirect_link_order) - { - if (p->type == bfd_fill_link_order) - continue; - abort (); - } - - input_section = p->u.indirect.section; - input_bfd = input_section->owner; - - /* Combine the gptab entries for this input section one - by one. We know that the input gptab entries are - sorted by ascending -G value. */ - size = bfd_section_size (input_bfd, input_section); - last = 0; - for (gpentry = sizeof (Elf32_External_gptab); - gpentry < size; - gpentry += sizeof (Elf32_External_gptab)) - { - Elf32_External_gptab ext_gptab; - Elf32_gptab int_gptab; - unsigned long val; - unsigned long add; - boolean exact; - unsigned int look; - - if (! (bfd_get_section_contents - (input_bfd, input_section, (PTR) &ext_gptab, - gpentry, sizeof (Elf32_External_gptab)))) - { - free (tab); - return false; - } - - mips_elf64_swap_gptab_in (input_bfd, &ext_gptab, - &int_gptab); - val = int_gptab.gt_entry.gt_g_value; - add = int_gptab.gt_entry.gt_bytes - last; - - exact = false; - for (look = 1; look < c; look++) - { - if (tab[look].gt_entry.gt_g_value >= val) - tab[look].gt_entry.gt_bytes += add; - - if (tab[look].gt_entry.gt_g_value == val) - exact = true; - } - - if (! exact) - { - Elf32_gptab *new_tab; - unsigned int max; - - /* We need a new table entry. */ - new_tab = ((Elf32_gptab *) - bfd_realloc ((PTR) tab, - (c + 1) * sizeof (Elf32_gptab))); - if (new_tab == NULL) - { - free (tab); - return false; - } - tab = new_tab; - tab[c].gt_entry.gt_g_value = val; - tab[c].gt_entry.gt_bytes = add; - - /* Merge in the size for the next smallest -G - value, since that will be implied by this new - value. */ - max = 0; - for (look = 1; look < c; look++) - { - if (tab[look].gt_entry.gt_g_value < val - && (max == 0 - || (tab[look].gt_entry.gt_g_value - > tab[max].gt_entry.gt_g_value))) - max = look; - } - if (max != 0) - tab[c].gt_entry.gt_bytes += - tab[max].gt_entry.gt_bytes; - - ++c; - } - - last = int_gptab.gt_entry.gt_bytes; - } - - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &=~ SEC_HAS_CONTENTS; - } - - /* The table must be sorted by -G value. */ - if (c > 2) - qsort (tab + 1, c - 1, sizeof (tab[0]), gptab_compare); - - /* Swap out the table. */ - ext_tab = ((Elf32_External_gptab *) - bfd_alloc (abfd, c * sizeof (Elf32_External_gptab))); - if (ext_tab == NULL) - { - free (tab); - return false; - } - - for (i = 0; i < c; i++) - mips_elf64_swap_gptab_out (abfd, tab + i, ext_tab + i); - free (tab); - - o->_raw_size = c * sizeof (Elf32_External_gptab); - o->contents = (bfd_byte *) ext_tab; - - /* Skip this section later on (I don't think this currently - matters, but someday it might). */ - o->link_order_head = (struct bfd_link_order *) NULL; - } - } - - /* Invoke the regular ELF backend linker to do all the work. */ - if (!bfd_elf64_bfd_final_link (abfd, info)) - return false; - - /* Now write out the computed sections. */ - if (mdebug_sec != (asection *) NULL) - { - BFD_ASSERT (abfd->output_has_begun); - if (! bfd_ecoff_write_accumulated_debug (mdebug_handle, abfd, &debug, - swap, info, - mdebug_sec->filepos)) - return false; - - bfd_ecoff_debug_free (mdebug_handle, abfd, &debug, swap, info); - } - if (gptab_data_sec != (asection *) NULL) - { - if (! bfd_set_section_contents (abfd, gptab_data_sec, - gptab_data_sec->contents, - (file_ptr) 0, - gptab_data_sec->_raw_size)) - return false; - } - - if (gptab_bss_sec != (asection *) NULL) - { - if (! bfd_set_section_contents (abfd, gptab_bss_sec, - gptab_bss_sec->contents, - (file_ptr) 0, - gptab_bss_sec->_raw_size)) - return false; - } - - return true; -} - -/* ECOFF swapping routines. These are used when dealing with the - .mdebug section, which is in the ECOFF debugging format. */ -static const struct ecoff_debug_swap mips_elf64_ecoff_debug_swap = -{ - /* Symbol table magic number. */ - magicSym2, - /* Alignment of debugging information. E.g., 4. */ - 8, - /* Sizes of external symbolic information. */ - sizeof (struct hdr_ext), - sizeof (struct dnr_ext), - sizeof (struct pdr_ext), - sizeof (struct sym_ext), - sizeof (struct opt_ext), - sizeof (struct fdr_ext), - sizeof (struct rfd_ext), - sizeof (struct ext_ext), - /* Functions to swap in external symbolic data. */ - ecoff_swap_hdr_in, - ecoff_swap_dnr_in, - ecoff_swap_pdr_in, - ecoff_swap_sym_in, - ecoff_swap_opt_in, - ecoff_swap_fdr_in, - ecoff_swap_rfd_in, - ecoff_swap_ext_in, - _bfd_ecoff_swap_tir_in, - _bfd_ecoff_swap_rndx_in, - /* Functions to swap out external symbolic data. */ - ecoff_swap_hdr_out, - ecoff_swap_dnr_out, - ecoff_swap_pdr_out, - ecoff_swap_sym_out, - ecoff_swap_opt_out, - ecoff_swap_fdr_out, - ecoff_swap_rfd_out, - ecoff_swap_ext_out, - _bfd_ecoff_swap_tir_out, - _bfd_ecoff_swap_rndx_out, - /* Function to read in symbolic data. */ - _bfd_mips_elf_read_ecoff_info -}; - -/* Relocations in the 64 bit MIPS ELF ABI are more complex than in - standard ELF. This structure is used to redirect the relocation - handling routines. */ - -const struct elf_size_info mips_elf64_size_info = -{ - sizeof (Elf64_External_Ehdr), - sizeof (Elf64_External_Phdr), - sizeof (Elf64_External_Shdr), - sizeof (Elf64_Mips_External_Rel), - sizeof (Elf64_Mips_External_Rela), - sizeof (Elf64_External_Sym), - sizeof (Elf64_External_Dyn), - sizeof (Elf_External_Note), - 4, /* hash-table entry size */ - 3, /* internal relocations per external relocations */ - 64, /* arch_size */ - 8, /* file_align */ - ELFCLASS64, - EV_CURRENT, - bfd_elf64_write_out_phdrs, - bfd_elf64_write_shdrs_and_ehdr, - mips_elf64_write_relocs, - bfd_elf64_swap_symbol_out, - mips_elf64_slurp_reloc_table, - bfd_elf64_slurp_symbol_table, - bfd_elf64_swap_dyn_in, - bfd_elf64_swap_dyn_out, - mips_elf64_be_swap_reloc_in, - mips_elf64_be_swap_reloc_out, - mips_elf64_be_swap_reloca_in, - mips_elf64_be_swap_reloca_out -}; - -#define ELF_ARCH bfd_arch_mips -#define ELF_MACHINE_CODE EM_MIPS - -#define ELF_MAXPAGESIZE 0x1000 - -#define elf_backend_collect true -#define elf_backend_type_change_ok true -#define elf_backend_can_gc_sections true -#define elf_info_to_howto mips_elf64_info_to_howto_rela -#define elf_info_to_howto_rel mips_elf64_info_to_howto_rel -#define elf_backend_object_p _bfd_mips_elf_object_p -#define elf_backend_symbol_processing _bfd_mips_elf_symbol_processing -#define elf_backend_section_processing _bfd_mips_elf_section_processing -#define elf_backend_section_from_shdr _bfd_mips_elf_section_from_shdr -#define elf_backend_fake_sections _bfd_mips_elf_fake_sections -#define elf_backend_section_from_bfd_section \ - _bfd_mips_elf_section_from_bfd_section -#define elf_backend_add_symbol_hook _bfd_mips_elf_add_symbol_hook -#define elf_backend_link_output_symbol_hook \ - _bfd_mips_elf_link_output_symbol_hook -#define elf_backend_create_dynamic_sections \ - mips_elf64_create_dynamic_sections -#define elf_backend_check_relocs mips_elf64_check_relocs -#define elf_backend_adjust_dynamic_symbol \ - mips_elf64_adjust_dynamic_symbol -#define elf_backend_always_size_sections \ - mips_elf64_always_size_sections -#define elf_backend_size_dynamic_sections \ - mips_elf64_size_dynamic_sections -#define elf_backend_relocate_section mips_elf64_relocate_section -#define elf_backend_finish_dynamic_symbol \ - mips_elf64_finish_dynamic_symbol -#define elf_backend_finish_dynamic_sections \ - mips_elf64_finish_dynamic_sections -#define elf_backend_final_write_processing \ - _bfd_mips_elf_final_write_processing -#define elf_backend_additional_program_headers \ - mips_elf64_additional_program_headers -#define elf_backend_modify_segment_map _bfd_mips_elf_modify_segment_map -#define elf_backend_gc_mark_hook mips_elf64_gc_mark_hook -#define elf_backend_gc_sweep_hook mips_elf64_gc_sweep_hook -#define elf_backend_ecoff_debug_swap &mips_elf64_ecoff_debug_swap -#define elf_backend_size_info mips_elf64_size_info - -#define elf_backend_got_header_size (4 * MIPS_RESERVED_GOTNO) -#define elf_backend_plt_header_size 0 - -/* MIPS ELF64 can use a mixture of REL and RELA, but some Relocations - * work better/work only in RELA, so we default to this. */ -#define elf_backend_may_use_rel_p 1 -#define elf_backend_may_use_rela_p 1 -#define elf_backend_default_use_rela_p 1 - -/* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit - MIPS-specific function only applies to IRIX5, which had no 64-bit - ABI. */ -#define bfd_elf64_find_nearest_line _bfd_mips_elf_find_nearest_line -#define bfd_elf64_set_section_contents _bfd_mips_elf_set_section_contents -#define bfd_elf64_bfd_link_hash_table_create \ - mips_elf64_link_hash_table_create -#define bfd_elf64_bfd_final_link mips_elf64_final_link -#define bfd_elf64_bfd_merge_private_bfd_data \ - _bfd_mips_elf_merge_private_bfd_data -#define bfd_elf64_bfd_set_private_flags _bfd_mips_elf_set_private_flags -#define bfd_elf64_bfd_print_private_bfd_data \ - _bfd_mips_elf_print_private_bfd_data - -#define bfd_elf64_get_reloc_upper_bound mips_elf64_get_reloc_upper_bound -#define bfd_elf64_bfd_reloc_type_lookup mips_elf64_reloc_type_lookup -#define bfd_elf64_archive_functions -extern boolean bfd_elf64_archive_slurp_armap - PARAMS((bfd *)); -extern boolean bfd_elf64_archive_write_armap - PARAMS((bfd *, unsigned int, struct orl *, unsigned int, int)); -#define bfd_elf64_archive_slurp_extended_name_table \ - _bfd_archive_coff_slurp_extended_name_table -#define bfd_elf64_archive_construct_extended_name_table \ - _bfd_archive_coff_construct_extended_name_table -#define bfd_elf64_archive_truncate_arname \ - _bfd_archive_coff_truncate_arname -#define bfd_elf64_archive_read_ar_hdr _bfd_archive_coff_read_ar_hdr -#define bfd_elf64_archive_openr_next_archived_file \ - _bfd_archive_coff_openr_next_archived_file -#define bfd_elf64_archive_get_elt_at_index \ - _bfd_archive_coff_get_elt_at_index -#define bfd_elf64_archive_generic_stat_arch_elt \ - _bfd_archive_coff_generic_stat_arch_elt -#define bfd_elf64_archive_update_armap_timestamp \ - _bfd_archive_coff_update_armap_timestamp - -/* The SGI style (n)64 NewABI. */ -#define TARGET_LITTLE_SYM bfd_elf64_littlemips_vec -#define TARGET_LITTLE_NAME "elf64-littlemips" -#define TARGET_BIG_SYM bfd_elf64_bigmips_vec -#define TARGET_BIG_NAME "elf64-bigmips" - -#include "elf64-target.h" - -#define INCLUDED_TARGET_FILE /* More a type of flag. */ - -/* The SYSV-style 'traditional' (n)64 NewABI. */ -#undef TARGET_LITTLE_SYM -#undef TARGET_LITTLE_NAME -#undef TARGET_BIG_SYM -#undef TARGET_BIG_NAME - -#define TARGET_LITTLE_SYM bfd_elf64_tradlittlemips_vec -#define TARGET_LITTLE_NAME "elf64-tradlittlemips" -#define TARGET_BIG_SYM bfd_elf64_tradbigmips_vec -#define TARGET_BIG_NAME "elf64-tradbigmips" - -/* Include the target file again for this target. */ -#include "elf64-target.h" diff --git a/contrib/binutils/bfd/elf64-s390.c b/contrib/binutils/bfd/elf64-s390.c deleted file mode 100644 index 40f4908dcf39..000000000000 --- a/contrib/binutils/bfd/elf64-s390.c +++ /dev/null @@ -1,2392 +0,0 @@ -/* IBM S/390-specific support for 64-bit ELF - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. - Contributed Martin Schwidefsky (schwidefsky@de.ibm.com). - - 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. */ - -#include "bfd.h" -#include "sysdep.h" -#include "bfdlink.h" -#include "libbfd.h" -#include "elf-bfd.h" - -static reloc_howto_type *elf_s390_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static void elf_s390_info_to_howto - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); -static boolean elf_s390_is_local_label_name - PARAMS ((bfd *, const char *)); -static struct bfd_hash_entry *link_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static struct bfd_link_hash_table *elf_s390_link_hash_table_create - PARAMS ((bfd *)); -static boolean create_got_section - PARAMS((bfd *, struct bfd_link_info *)); -static boolean elf_s390_create_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); -static void elf_s390_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); -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 allocate_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean readonly_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean elf_s390_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean elf_s390_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static boolean elf_s390_finish_dynamic_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); -static enum elf_reloc_type_class elf_s390_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); -static boolean elf_s390_finish_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean elf_s390_object_p PARAMS ((bfd *)); - -#define USE_RELA 1 /* We want RELA relocations, not REL. */ - -#include "elf/s390.h" - -/* In case we're on a 32-bit machine, construct a 64-bit "-1" value - from smaller values. Start with zero, widen, *then* decrement. */ -#define MINUS_ONE (((bfd_vma)0) - 1) - -/* The relocation "howto" table. */ -static reloc_howto_type elf_howto_table[] = -{ - HOWTO (R_390_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_390_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO(R_390_8, 0, 0, 8, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_8", false, 0,0x000000ff, false), - HOWTO(R_390_12, 0, 1, 12, false, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_12", false, 0,0x00000fff, false), - HOWTO(R_390_16, 0, 1, 16, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_16", false, 0,0x0000ffff, false), - HOWTO(R_390_32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_32", false, 0,0xffffffff, false), - HOWTO(R_390_PC32, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32", false, 0,0xffffffff, true), - HOWTO(R_390_GOT12, 0, 1, 12, false, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_GOT12", false, 0,0x00000fff, false), - HOWTO(R_390_GOT32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT32", false, 0,0xffffffff, false), - HOWTO(R_390_PLT32, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32", false, 0,0xffffffff, true), - HOWTO(R_390_COPY, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_COPY", false, 0,MINUS_ONE, false), - HOWTO(R_390_GLOB_DAT, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GLOB_DAT",false, 0,MINUS_ONE, false), - HOWTO(R_390_JMP_SLOT, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_JMP_SLOT",false, 0,MINUS_ONE, false), - HOWTO(R_390_RELATIVE, 0, 4, 64, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_RELATIVE",false, 0,MINUS_ONE, false), - HOWTO(R_390_GOTOFF, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTOFF", false, 0,MINUS_ONE, false), - HOWTO(R_390_GOTPC, 0, 4, 64, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPC", false, 0,MINUS_ONE, true), - HOWTO(R_390_GOT16, 0, 1, 16, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT16", false, 0,0x0000ffff, false), - HOWTO(R_390_PC16, 0, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16", false, 0,0x0000ffff, true), - HOWTO(R_390_PC16DBL, 1, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16DBL", false, 0,0x0000ffff, true), - HOWTO(R_390_PLT16DBL, 1, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT16DBL", false, 0,0x0000ffff, true), - HOWTO(R_390_PC32DBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32DBL", false, 0,0xffffffff, true), - HOWTO(R_390_PLT32DBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32DBL", false, 0,0xffffffff, true), - HOWTO(R_390_GOTPCDBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPCDBL", false, 0,MINUS_ONE, true), - HOWTO(R_390_64, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_64", false, 0,MINUS_ONE, false), - HOWTO(R_390_PC64, 0, 4, 64, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC64", false, 0,MINUS_ONE, true), - HOWTO(R_390_GOT64, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT64", false, 0,MINUS_ONE, false), - HOWTO(R_390_PLT64, 0, 4, 64, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT64", false, 0,MINUS_ONE, true), - HOWTO(R_390_GOTENT, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTENT", false, 0,MINUS_ONE, true), -}; - -/* GNU extension to record C++ vtable hierarchy. */ -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); - -static reloc_howto_type * -elf_s390_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; -{ - switch (code) - { - case BFD_RELOC_NONE: - return &elf_howto_table[(int) R_390_NONE]; - case BFD_RELOC_8: - return &elf_howto_table[(int) R_390_8]; - case BFD_RELOC_390_12: - return &elf_howto_table[(int) R_390_12]; - case BFD_RELOC_16: - return &elf_howto_table[(int) R_390_16]; - case BFD_RELOC_32: - return &elf_howto_table[(int) R_390_32]; - case BFD_RELOC_CTOR: - return &elf_howto_table[(int) R_390_32]; - case BFD_RELOC_32_PCREL: - return &elf_howto_table[(int) R_390_PC32]; - case BFD_RELOC_390_GOT12: - return &elf_howto_table[(int) R_390_GOT12]; - case BFD_RELOC_32_GOT_PCREL: - return &elf_howto_table[(int) R_390_GOT32]; - case BFD_RELOC_390_PLT32: - return &elf_howto_table[(int) R_390_PLT32]; - case BFD_RELOC_390_COPY: - return &elf_howto_table[(int) R_390_COPY]; - case BFD_RELOC_390_GLOB_DAT: - return &elf_howto_table[(int) R_390_GLOB_DAT]; - case BFD_RELOC_390_JMP_SLOT: - return &elf_howto_table[(int) R_390_JMP_SLOT]; - case BFD_RELOC_390_RELATIVE: - return &elf_howto_table[(int) R_390_RELATIVE]; - case BFD_RELOC_32_GOTOFF: - return &elf_howto_table[(int) R_390_GOTOFF]; - case BFD_RELOC_390_GOTPC: - return &elf_howto_table[(int) R_390_GOTPC]; - case BFD_RELOC_390_GOT16: - return &elf_howto_table[(int) R_390_GOT16]; - case BFD_RELOC_16_PCREL: - return &elf_howto_table[(int) R_390_PC16]; - case BFD_RELOC_390_PC16DBL: - return &elf_howto_table[(int) R_390_PC16DBL]; - case BFD_RELOC_390_PLT16DBL: - return &elf_howto_table[(int) R_390_PLT16DBL]; - case BFD_RELOC_VTABLE_INHERIT: - return &elf64_s390_vtinherit_howto; - case BFD_RELOC_VTABLE_ENTRY: - return &elf64_s390_vtentry_howto; - case BFD_RELOC_390_PC32DBL: - return &elf_howto_table[(int) R_390_PC32DBL]; - case BFD_RELOC_390_PLT32DBL: - return &elf_howto_table[(int) R_390_PLT32DBL]; - case BFD_RELOC_390_GOTPCDBL: - return &elf_howto_table[(int) R_390_GOTPCDBL]; - case BFD_RELOC_64: - return &elf_howto_table[(int) R_390_64]; - case BFD_RELOC_64_PCREL: - return &elf_howto_table[(int) R_390_PC64]; - case BFD_RELOC_390_GOT64: - return &elf_howto_table[(int) R_390_GOT64]; - case BFD_RELOC_390_PLT64: - return &elf_howto_table[(int) R_390_PLT64]; - case BFD_RELOC_390_GOTENT: - return &elf_howto_table[(int) R_390_GOTENT]; - default: - break; - } - return 0; -} - -/* We need to use ELF64_R_TYPE so we have our own copy of this function, - and elf64-s390.c has its own copy. */ - -static void -elf_s390_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr; - Elf_Internal_Rela *dst; -{ - switch (ELF64_R_TYPE(dst->r_info)) - { - case R_390_GNU_VTINHERIT: - cache_ptr->howto = &elf64_s390_vtinherit_howto; - break; - - case R_390_GNU_VTENTRY: - cache_ptr->howto = &elf64_s390_vtentry_howto; - break; - - 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 -elf_s390_is_local_label_name (abfd, name) - bfd *abfd; - const char *name; -{ - if (name[0] == '.' && (name[1] == 'X' || name[1] == 'L')) - return true; - - return _bfd_elf_is_local_label_name (abfd, name); -} - -/* Functions for the 390 ELF linker. */ - -/* 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 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 GOT_ENTRY_SIZE 8 - -/* The first three entries in a procedure linkage table are reserved, - and the initial contents are unimportant (we zero them out). - Subsequent entries look like this. See the SVR4 ABI 386 - supplement to see how this works. */ - -/* For the s390, simple addr offset can only be 0 - 4096. - To use the full 16777216 TB address space, several instructions - 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!!! */ - -/* The first 3 words in the GOT are then reserved. - Word 0 is the address of the dynamic table. - Word 1 is a pointer to a structure describing the object - Word 2 is used to point to the loader entry address. - - The code for PLT entries looks like this: - - 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 - The loader must then find the module where the function is - and insert the address in the GOT. - - PLT1: LARL 1,<fn>@GOTENT # 6 bytes Load address of GOT entry in r1 - LG 1,0(1) # 6 bytes Load address from GOT in r1 - BCR 15,1 # 2 bytes Jump to address - RET1: BASR 1,0 # 2 bytes Return from GOT 1st time - LGF 1,12(1) # 6 bytes Load offset in symbl table in r1 - BRCL 15,-x # 6 bytes Jump to start of PLT - .long ? # 4 bytes offset into symbol table - - Total = 32 bytes per PLT entry - Fixup at offset 2: relative address to GOT entry - Fixup at offset 22: relative branch to PLT0 - Fixup at offset 28: 32 bit offset into symbol table - - A 32 bit offset into the symbol table is enough. It allows for symbol - tables up to a size of 2 gigabyte. A single dynamic object (the main - program, any shared library) is limited to 4GB in size and I want to see - the program that manages to have a symbol table of more than 2 GB with a - total size of at max 4 GB. */ - -#define PLT_ENTRY_WORD0 (bfd_vma) 0xc0100000 -#define PLT_ENTRY_WORD1 (bfd_vma) 0x0000e310 -#define PLT_ENTRY_WORD2 (bfd_vma) 0x10000004 -#define PLT_ENTRY_WORD3 (bfd_vma) 0x07f10d10 -#define PLT_ENTRY_WORD4 (bfd_vma) 0xe310100c -#define PLT_ENTRY_WORD5 (bfd_vma) 0x0014c0f4 -#define PLT_ENTRY_WORD6 (bfd_vma) 0x00000000 -#define PLT_ENTRY_WORD7 (bfd_vma) 0x00000000 - -/* The first PLT entry pushes the offset into the symbol table - from R1 onto the stack at 8(15) and the loader object info - at 12(15), loads the loader address in R1 and jumps to it. */ - -/* The first entry in the PLT: - - PLT0: - STG 1,56(15) # r1 contains the offset into the symbol table - LARL 1,_GLOBAL_OFFSET_TABLE # load address of global offset table - MVC 48(8,15),8(1) # move loader ino (object struct address) to stack - LG 1,16(1) # get entry address of loader - BCR 15,1 # jump to loader - - Fixup at offset 8: relative address to start of GOT. */ - -#define PLT_FIRST_ENTRY_WORD0 (bfd_vma) 0xe310f038 -#define PLT_FIRST_ENTRY_WORD1 (bfd_vma) 0x0024c010 -#define PLT_FIRST_ENTRY_WORD2 (bfd_vma) 0x00000000 -#define PLT_FIRST_ENTRY_WORD3 (bfd_vma) 0xd207f030 -#define PLT_FIRST_ENTRY_WORD4 (bfd_vma) 0x1008e310 -#define PLT_FIRST_ENTRY_WORD5 (bfd_vma) 0x10100004 -#define PLT_FIRST_ENTRY_WORD6 (bfd_vma) 0x07f10700 -#define PLT_FIRST_ENTRY_WORD7 (bfd_vma) 0x07000700 - -/* The s390 linker needs to keep track of the number of relocs that it - decides to copy as dynamic relocs in check_relocs for each symbol. - This is so that it can later discard them if they are found to be - unnecessary. We store the information in a field extending the - regular ELF linker hash table. */ - -struct elf_s390_dyn_relocs -{ - struct elf_s390_dyn_relocs *next; - - /* The input section of the reloc. */ - asection *sec; - - /* Total number of relocs copied for the input section. */ - bfd_size_type count; - - /* Number of pc-relative relocs copied for the input section. */ - bfd_size_type pc_count; -}; - -/* s390 ELF linker hash entry. */ - -struct elf_s390_link_hash_entry -{ - struct elf_link_hash_entry elf; - - /* Track dynamic relocs copied for this symbol. */ - struct elf_s390_dyn_relocs *dyn_relocs; -}; - -/* s390 ELF linker hash table. */ - -struct elf_s390_link_hash_table -{ - struct elf_link_hash_table elf; - - /* Short-cuts to get to dynamic linker sections. */ - asection *sgot; - asection *sgotplt; - asection *srelgot; - asection *splt; - asection *srelplt; - asection *sdynbss; - asection *srelbss; - - /* Small local sym to section mapping cache. */ - struct sym_sec_cache sym_sec; -}; - -/* Get the s390 ELF linker hash table from a link_info structure. */ - -#define elf_s390_hash_table(p) \ - ((struct elf_s390_link_hash_table *) ((p)->hash)) - -/* Create an entry in an s390 ELF linker hash table. */ - -static struct bfd_hash_entry * -link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; -{ - /* Allocate the structure if it has not already been allocated by a - subclass. */ - if (entry == NULL) - { - entry = bfd_hash_allocate (table, - sizeof (struct elf_s390_link_hash_entry)); - if (entry == NULL) - return entry; - } - - /* Call the allocation method of the superclass. */ - entry = _bfd_elf_link_hash_newfunc (entry, table, string); - if (entry != NULL) - { - struct elf_s390_link_hash_entry *eh; - - eh = (struct elf_s390_link_hash_entry *) entry; - eh->dyn_relocs = NULL; - } - - return entry; -} - -/* Create an s390 ELF linker hash table. */ - -static struct bfd_link_hash_table * -elf_s390_link_hash_table_create (abfd) - bfd *abfd; -{ - struct elf_s390_link_hash_table *ret; - bfd_size_type amt = sizeof (struct elf_s390_link_hash_table); - - ret = (struct elf_s390_link_hash_table *) bfd_alloc (abfd, amt); - if (ret == NULL) - return NULL; - - if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc)) - { - bfd_release (abfd, ret); - return NULL; - } - - ret->sgot = NULL; - ret->sgotplt = NULL; - ret->srelgot = NULL; - ret->splt = NULL; - ret->srelplt = NULL; - ret->sdynbss = NULL; - ret->srelbss = NULL; - ret->sym_sec.abfd = NULL; - - return &ret->elf.root; -} - -/* Create .got, .gotplt, and .rela.got sections in DYNOBJ, and set up - shortcuts to them in our hash table. */ - -static boolean -create_got_section (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; -{ - struct elf_s390_link_hash_table *htab; - - if (! _bfd_elf_create_got_section (dynobj, info)) - return false; - - htab = elf_s390_hash_table (info); - htab->sgot = bfd_get_section_by_name (dynobj, ".got"); - htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); - if (!htab->sgot || !htab->sgotplt) - abort (); - - htab->srelgot = bfd_make_section (dynobj, ".rela.got"); - if (htab->srelgot == NULL - || ! bfd_set_section_flags (dynobj, htab->srelgot, - (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) - return false; - return true; -} - -/* Create .plt, .rela.plt, .got, .got.plt, .rela.got, .dynbss, and - .rela.bss sections in DYNOBJ, and set up shortcuts to them in our - hash table. */ - -static boolean -elf_s390_create_dynamic_sections (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; -{ - struct elf_s390_link_hash_table *htab; - - htab = elf_s390_hash_table (info); - if (!htab->sgot && !create_got_section (dynobj, info)) - return false; - - if (!_bfd_elf_create_dynamic_sections (dynobj, info)) - return false; - - htab->splt = bfd_get_section_by_name (dynobj, ".plt"); - htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); - htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); - if (!info->shared) - htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss"); - - if (!htab->splt || !htab->srelplt || !htab->sdynbss - || (!info->shared && !htab->srelbss)) - abort (); - - return true; -} - -/* Copy the extra info we tack onto an elf_link_hash_entry. */ - -static void -elf_s390_copy_indirect_symbol (dir, ind) - struct elf_link_hash_entry *dir, *ind; -{ - struct elf_s390_link_hash_entry *edir, *eind; - - edir = (struct elf_s390_link_hash_entry *) dir; - eind = (struct elf_s390_link_hash_entry *) ind; - - if (eind->dyn_relocs != NULL) - { - if (edir->dyn_relocs != NULL) - { - struct elf_s390_dyn_relocs **pp; - struct elf_s390_dyn_relocs *p; - - if (ind->root.type == bfd_link_hash_indirect) - abort (); - - /* Add reloc counts against the weak sym to the strong sym - list. Merge any entries against the same section. */ - for (pp = &eind->dyn_relocs; (p = *pp) != NULL; ) - { - struct elf_s390_dyn_relocs *q; - - for (q = edir->dyn_relocs; q != NULL; q = q->next) - if (q->sec == p->sec) - { - q->pc_count += p->pc_count; - q->count += p->count; - *pp = p->next; - break; - } - if (q == NULL) - pp = &p->next; - } - *pp = edir->dyn_relocs; - } - - edir->dyn_relocs = eind->dyn_relocs; - eind->dyn_relocs = NULL; - } - - _bfd_elf_link_hash_copy_indirect (dir, ind); -} - -/* 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 -elf_s390_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; -{ - struct elf_s390_link_hash_table *htab; - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - const Elf_Internal_Rela *rel; - const Elf_Internal_Rela *rel_end; - asection *sreloc; - - if (info->relocateable) - return true; - - htab = elf_s390_hash_table (info); - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (abfd); - - 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 >= NUM_SHDR_ENTRIES (symtab_hdr)) - { - (*_bfd_error_handler) (_("%s: bad symbol index: %d"), - bfd_archive_filename (abfd), - r_symndx); - return false; - } - - 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)) - { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOT64: - case R_390_GOTENT: - /* This symbol requires a global offset table entry. */ - if (h != NULL) - { - h->got.refcount += 1; - } - else - { - bfd_signed_vma *local_got_refcounts; - - /* This is a global offset table entry for a local symbol. */ - local_got_refcounts = elf_local_got_refcounts (abfd); - if (local_got_refcounts == NULL) - { - bfd_size_type size; - - size = symtab_hdr->sh_info; - size *= sizeof (bfd_signed_vma); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); - if (local_got_refcounts == NULL) - return false; - elf_local_got_refcounts (abfd) = local_got_refcounts; - } - local_got_refcounts[r_symndx] += 1; - } - /* Fall through */ - - case R_390_GOTOFF: - case R_390_GOTPC: - case R_390_GOTPCDBL: - if (htab->sgot == NULL) - { - if (htab->elf.dynobj == NULL) - htab->elf.dynobj = abfd; - if (!create_got_section (htab->elf.dynobj, info)) - return false; - } - break; - - case R_390_PLT16DBL: - case R_390_PLT32: - case R_390_PLT32DBL: - case R_390_PLT64: - /* 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 - never referenced by a dynamic object, in which case we - don't need to generate a procedure linkage table entry - after all. */ - - /* If this is a local symbol, we resolve it directly without - creating a procedure linkage table entry. */ - if (h == NULL) - continue; - - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - h->plt.refcount += 1; - break; - - case R_390_8: - case R_390_16: - case R_390_32: - case R_390_64: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32: - case R_390_PC32DBL: - case R_390_PC64: - if (h != NULL && !info->shared) - { - /* If this reloc is in a read-only section, we might - need a copy reloc. We can't check reliably at this - stage whether the section is read-only, as input - sections have not yet been mapped to output sections. - Tentatively set the flag for now, and correct in - adjust_dynamic_symbol. */ - h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; - - /* We may need a .plt entry if the function this reloc - refers to is in a shared lib. */ - h->plt.refcount += 1; - } - - /* If we are creating a shared library, and this is a reloc - against a global symbol, or a non PC relative reloc - against a local symbol, then we need to copy the reloc - into the shared library. However, if we are linking with - -Bsymbolic, we do not need to copy a reloc against a - global symbol which is defined in an object we are - including in the link (i.e., DEF_REGULAR is set). At - this point we have not seen all the input files, so it is - possible that DEF_REGULAR is not set now but will be set - later (it is never cleared). In case of a weak definition, - DEF_REGULAR may be cleared later by a strong definition in - a shared library. We account for that possibility below by - storing information in the relocs_copied field of the hash - table entry. A similar situation occurs when creating - shared libraries and symbol visibility changes render the - symbol local. - - If on the other hand, we are creating an executable, we - may need to keep relocations for symbols satisfied by a - dynamic library if we manage to avoid copy relocs for the - symbol. */ - if ((info->shared - && (sec->flags & SEC_ALLOC) != 0 - && ((ELF64_R_TYPE (rel->r_info) != R_390_PC16 - && ELF64_R_TYPE (rel->r_info) != R_390_PC16DBL - && ELF64_R_TYPE (rel->r_info) != R_390_PC32 - && ELF64_R_TYPE (rel->r_info) != R_390_PC32DBL - && ELF64_R_TYPE (rel->r_info) != R_390_PC64) - || (h != NULL - && (! info->symbolic - || h->root.type == bfd_link_hash_defweak - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared - && (sec->flags & SEC_ALLOC) != 0 - && h != NULL - && (h->root.type == bfd_link_hash_defweak - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0))) - { - struct elf_s390_dyn_relocs *p; - struct elf_s390_dyn_relocs **head; - - /* We must copy these reloc types into the output file. - Create a reloc section in dynobj and make room for - this reloc. */ - if (sreloc == NULL) - { - const char *name; - bfd *dynobj; - - 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; - - if (strncmp (name, ".rela", 5) != 0 - || strcmp (bfd_get_section_name (abfd, sec), - name + 5) != 0) - { - (*_bfd_error_handler) - (_("%s: bad relocation section name `%s\'"), - bfd_archive_filename (abfd), name); - } - - if (htab->elf.dynobj == NULL) - htab->elf.dynobj = abfd; - - dynobj = htab->elf.dynobj; - 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; - } - elf_section_data (sec)->sreloc = sreloc; - } - - /* If this is a global symbol, we count the number of - relocations we need for this symbol. */ - if (h != NULL) - { - head = &((struct elf_s390_link_hash_entry *) h)->dyn_relocs; - } - else - { - /* Track dynamic relocs needed for local syms too. - We really need local syms available to do this - easily. Oh well. */ - - asection *s; - s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, - sec, r_symndx); - if (s == NULL) - return false; - - head = ((struct elf_s390_dyn_relocs **) - &elf_section_data (s)->local_dynrel); - } - - p = *head; - if (p == NULL || p->sec != sec) - { - bfd_size_type amt = sizeof *p; - p = ((struct elf_s390_dyn_relocs *) - bfd_alloc (htab->elf.dynobj, amt)); - if (p == NULL) - return false; - p->next = *head; - *head = p; - p->sec = sec; - p->count = 0; - p->pc_count = 0; - } - - p->count += 1; - if (ELF64_R_TYPE (rel->r_info) == R_390_PC16 - || ELF64_R_TYPE (rel->r_info) == R_390_PC16DBL - || ELF64_R_TYPE (rel->r_info) == R_390_PC32 - || ELF64_R_TYPE (rel->r_info) == R_390_PC32DBL - || ELF64_R_TYPE (rel->r_info) == R_390_PC64) - p->pc_count += 1; - } - break; - - /* This relocation describes the C++ object vtable hierarchy. - Reconstruct it for later use during GC. */ - case R_390_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_390_GNU_VTENTRY: - if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return false; - break; - - default: - break; - } - } - - return true; -} - -/* Return the section that should be marked against GC for a given - relocation. */ - -static asection * -elf_s390_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_390_GNU_VTINHERIT: - case R_390_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 - { - 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 -elf_s390_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - 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; - - elf_section_data (sec)->local_dynrel = NULL; - - 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_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOT64: - case R_390_GOTOFF: - case R_390_GOTPC: - case R_390_GOTPCDBL: - case R_390_GOTENT: - 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 -= 1; - } - else if (local_got_refcounts != NULL) - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx] -= 1; - } - break; - - case R_390_8: - case R_390_12: - case R_390_16: - case R_390_32: - case R_390_64: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32: - case R_390_PC32DBL: - case R_390_PC64: - r_symndx = ELF64_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs **pp; - struct elf_s390_dyn_relocs *p; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - - if (!info->shared && h->plt.refcount > 0) - h->plt.refcount -= 1; - - eh = (struct elf_s390_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - if (ELF64_R_TYPE (rel->r_info) == R_390_PC16 - || ELF64_R_TYPE (rel->r_info) == R_390_PC16DBL - || ELF64_R_TYPE (rel->r_info) == R_390_PC32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; - - case R_390_PLT16DBL: - case R_390_PLT32: - case R_390_PLT32DBL: - case R_390_PLT64: - 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 -= 1; - } - 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 -elf_s390_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; -{ - struct elf_s390_link_hash_table *htab; - struct elf_s390_link_hash_entry * eh; - struct elf_s390_dyn_relocs *p; - asection *s; - unsigned int power_of_two; - - /* If this is a function, put it in the procedure linkage table. We - will fill in the contents of the procedure linkage table later - (although we could actually do it here). */ - if (h->type == STT_FUNC - || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) - { - if (h->plt.refcount <= 0 - || (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0 - && h->root.type != bfd_link_hash_undefweak - && h->root.type != bfd_link_hash_undefined)) - { - /* This case can occur if we saw a PLT32 reloc in an input - file, but the symbol was never referred to by a dynamic - object, or if all references were garbage collected. In - such a case, we don't actually need to build a procedure - linkage table, and we can just do a PC32 reloc instead. */ - h->plt.offset = (bfd_vma) -1; - h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - } - - return true; - } - else - /* It's possible that we incorrectly decided a .plt reloc was - needed for an R_390_PC32 reloc to a non-function sym in - check_relocs. We can't decide accurately between function and - non-function syms in check-relocs; Objects loaded later in - the link may change h->type. So fix it now. */ - h->plt.offset = (bfd_vma) -1; - - /* 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; - - /* If there are no references to this symbol that do not use the - GOT, we don't need to generate a copy reloc. */ - if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0) - return true; - - /* If -z nocopyreloc was given, we won't generate them either. */ - if (info->nocopyreloc) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return true; - } - - eh = (struct elf_s390_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) - { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) - break; - } - - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - 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. */ - - htab = elf_s390_hash_table (info); - - /* We must generate a R_390_COPY reloc to tell the dynamic linker to - copy the initial value out of the dynamic object and into the - runtime process image. */ - if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) - { - htab->srelbss->_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 > 3) - power_of_two = 3; - - /* Apply the required alignment. */ - s = htab->sdynbss; - s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.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; -} - -/* This is the condition under which elf_s390_finish_dynamic_symbol - will be called from elflink.h. If elflink.h doesn't call our - finish_dynamic_symbol routine, we'll need to do something about - initializing any .plt and .got entries in elf_s390_relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ - ((DYN) \ - && ((INFO)->shared \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ - && ((H)->dynindx != -1 \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) - -/* Allocate space in .plt, .got and associated reloc sections for - dynamic relocs. */ - -static boolean -allocate_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; -{ - struct bfd_link_info *info; - struct elf_s390_link_hash_table *htab; - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs *p; - - if (h->root.type == bfd_link_hash_indirect) - return true; - - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - info = (struct bfd_link_info *) inf; - htab = elf_s390_hash_table (info); - - if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0) - { - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) - { - if (! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; - } - - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) - { - asection *s = htab->splt; - - /* If this is the first .plt entry, make room for the special - first entry. */ - if (s->_raw_size == 0) - s->_raw_size += PLT_FIRST_ENTRY_SIZE; - - h->plt.offset = s->_raw_size; - - /* 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 = s; - h->root.u.def.value = h->plt.offset; - } - - /* Make room for this entry. */ - s->_raw_size += PLT_ENTRY_SIZE; - - /* We also need to make an entry in the .got.plt section, which - will be placed in the .got section by the linker script. */ - htab->sgotplt->_raw_size += GOT_ENTRY_SIZE; - - /* We also need to make an entry in the .rela.plt section. */ - htab->srelplt->_raw_size += sizeof (Elf64_External_Rela); - } - else - { - h->plt.offset = (bfd_vma) -1; - h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - } - } - else - { - h->plt.offset = (bfd_vma) -1; - h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - } - - if (h->got.refcount > 0) - { - asection *s; - boolean dyn; - - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) - { - if (! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; - } - - s = htab->sgot; - h->got.offset = s->_raw_size; - s->_raw_size += GOT_ENTRY_SIZE; - dyn = htab->elf.dynamic_sections_created; - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) - htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); - } - else - h->got.offset = (bfd_vma) -1; - - eh = (struct elf_s390_link_hash_entry *) h; - if (eh->dyn_relocs == NULL) - return true; - - /* In the shared -Bsymbolic case, discard space allocated for - dynamic pc-relative relocs against symbols which turn out to be - defined in regular objects. For the normal shared case, discard - space for pc-relative relocs that have become local due to symbol - visibility changes. */ - - if (info->shared) - { - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || info->symbolic)) - { - struct elf_s390_dyn_relocs **pp; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) - { - p->count -= p->pc_count; - p->pc_count = 0; - if (p->count == 0) - *pp = p->next; - else - pp = &p->next; - } - } - } - else - { - /* For the non-shared case, discard space for relocs against - symbols which turn out to need copy relocs or are not - dynamic. */ - - if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 - && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - || (htab->elf.dynamic_sections_created - && (h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined)))) - { - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) - { - if (! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; - } - - /* If that succeeded, we know we'll be keeping all the - relocs. */ - if (h->dynindx != -1) - goto keep; - } - - eh->dyn_relocs = NULL; - - keep: ; - } - - /* Finally, allocate space. */ - for (p = eh->dyn_relocs; p != NULL; p = p->next) - { - asection *sreloc = elf_section_data (p->sec)->sreloc; - sreloc->_raw_size += p->count * sizeof (Elf64_External_Rela); - } - - return true; -} - -/* Find any dynamic relocs that apply to read-only sections. */ - -static boolean -readonly_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; -{ - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs *p; - - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - eh = (struct elf_s390_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) - { - asection *s = p->sec->output_section; - - if (s != NULL && (s->flags & SEC_READONLY) != 0) - { - struct bfd_link_info *info = (struct bfd_link_info *) inf; - - info->flags |= DF_TEXTREL; - - /* Not an error, just cut short the traversal. */ - return false; - } - } - return true; -} - -/* Set the sizes of the dynamic sections. */ - -static boolean -elf_s390_size_dynamic_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; -{ - struct elf_s390_link_hash_table *htab; - bfd *dynobj; - asection *s; - boolean relocs; - bfd *ibfd; - - htab = elf_s390_hash_table (info); - dynobj = htab->elf.dynobj; - if (dynobj == NULL) - abort (); - - if (htab->elf.dynamic_sections_created) - { - /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) - { - s = bfd_get_section_by_name (dynobj, ".interp"); - if (s == NULL) - abort (); - s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER; - s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; - } - } - - /* Set up .got offsets for local syms, and space for local dynamic - relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) - { - bfd_signed_vma *local_got; - bfd_signed_vma *end_local_got; - bfd_size_type locsymcount; - Elf_Internal_Shdr *symtab_hdr; - asection *srela; - - if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) - continue; - - for (s = ibfd->sections; s != NULL; s = s->next) - { - struct elf_s390_dyn_relocs *p; - - for (p = *((struct elf_s390_dyn_relocs **) - &elf_section_data (s)->local_dynrel); - p != NULL; - p = p->next) - { - if (!bfd_is_abs_section (p->sec) - && bfd_is_abs_section (p->sec->output_section)) - { - /* Input section has been discarded, either because - it is a copy of a linkonce section or due to - linker script /DISCARD/, so we'll be discarding - the relocs too. */ - } - else if (p->count != 0) - { - srela = elf_section_data (p->sec)->sreloc; - srela->_raw_size += p->count * sizeof (Elf64_External_Rela); - if ((p->sec->output_section->flags & SEC_READONLY) != 0) - info->flags |= DF_TEXTREL; - } - } - } - - local_got = elf_local_got_refcounts (ibfd); - if (!local_got) - continue; - - symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; - locsymcount = symtab_hdr->sh_info; - end_local_got = local_got + locsymcount; - s = htab->sgot; - srela = htab->srelgot; - for (; local_got < end_local_got; ++local_got) - { - if (*local_got > 0) - { - *local_got = s->_raw_size; - s->_raw_size += GOT_ENTRY_SIZE; - if (info->shared) - srela->_raw_size += sizeof (Elf64_External_Rela); - } - else - *local_got = (bfd_vma) -1; - } - } - - /* Allocate global sym .plt and .got entries, and space for global - sym dynamic relocs. */ - elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); - - /* We now have determined the sizes of the various dynamic sections. - Allocate memory for them. */ - relocs = false; - for (s = dynobj->sections; s != NULL; s = s->next) - { - if ((s->flags & SEC_LINKER_CREATED) == 0) - continue; - - if (s == htab->splt - || s == htab->sgot - || s == htab->sgotplt) - { - /* Strip this section if we don't need it; see the - comment below. */ - } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) - { - if (s->_raw_size != 0 && s != htab->srelplt) - relocs = 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 - { - /* It's not one of our sections, so don't allocate space. */ - continue; - } - - if (s->_raw_size == 0) - { - /* If we don't need this section, strip it from the - output file. This is to handle .rela.bss and - .rela.plt. We must create it in - create_dynamic_sections, because it 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. */ - - _bfd_strip_section_from_output (info, s); - continue; - } - - /* Allocate memory for the section contents. We use bfd_zalloc - here in case unused entries are not reclaimed before the - section's contents are written out. This should not happen, - but this way if it does, we get a R_390_NONE reloc instead - of garbage. */ - s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); - if (s->contents == NULL) - return false; - } - - if (htab->elf.dynamic_sections_created) - { - /* Add some entries to the .dynamic section. We fill in the - values later, in elf_s390_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. */ -#define add_dynamic_entry(TAG, VAL) \ - bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) - - if (! info->shared) - { - if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; - } - - if (htab->splt->_raw_size != 0) - { - if (!add_dynamic_entry (DT_PLTGOT, 0) - || !add_dynamic_entry (DT_PLTRELSZ, 0) - || !add_dynamic_entry (DT_PLTREL, DT_RELA) - || !add_dynamic_entry (DT_JMPREL, 0)) - return false; - } - - if (relocs) - { - if (!add_dynamic_entry (DT_RELA, 0) - || !add_dynamic_entry (DT_RELASZ, 0) - || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) - return false; - - /* If any dynamic relocs apply to a read-only section, - then we need a DT_TEXTREL entry. */ - if ((info->flags & DF_TEXTREL) == 0) - elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, - (PTR) info); - - if ((info->flags & DF_TEXTREL) != 0) - { - if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; - } - } - } -#undef add_dynamic_entry - - return true; -} - -/* Relocate a 390 ELF section. */ - -static boolean -elf_s390_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; -{ - struct elf_s390_link_hash_table *htab; - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - bfd_vma *local_got_offsets; - Elf_Internal_Rela *rel; - Elf_Internal_Rela *relend; - - if (info->relocateable) - return true; - - htab = elf_s390_hash_table (info); - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (input_bfd); - local_got_offsets = elf_local_got_offsets (input_bfd); - - rel = relocs; - relend = relocs + input_section->reloc_count; - for (; rel < relend; rel++) - { - int r_type; - reloc_howto_type *howto; - unsigned long r_symndx; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; - asection *sec; - bfd_vma off; - bfd_vma relocation; - boolean unresolved_reloc; - bfd_reloc_status_type r; - - r_type = ELF64_R_TYPE (rel->r_info); - if (r_type == (int) R_390_GNU_VTINHERIT - || r_type == (int) R_390_GNU_VTENTRY) - continue; - if (r_type < 0 || r_type >= (int) R_390_max) - { - bfd_set_error (bfd_error_bad_value); - return false; - } - - howto = elf_howto_table + r_type; - r_symndx = ELF64_R_SYM (rel->r_info); - h = NULL; - sym = NULL; - sec = NULL; - unresolved_reloc = false; - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); - } - 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) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - if (sec->output_section == NULL) - { - /* Set a flag that will be cleared later if we find a - relocation value for this symbol. output_section - is typically NULL for symbols satisfied by a shared - library. */ - unresolved_reloc = true; - 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->allow_shlib_undefined) - && !info->no_undefined - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - 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 (r_type) - { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOT64: - case R_390_GOTENT: - /* Relocation is to the entry for this symbol in the global - offset table. */ - if (htab->sgot == NULL) - abort (); - - if (h != NULL) - { - boolean dyn; - - off = h->got.offset; - dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) - || (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (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, or the symbol was forced to be local - because of a version file. We must initialize - this entry in the global offset table. Since the - offset must always be a multiple of 2, we use the - least significant bit to record whether we have - initialized it already. - - When doing a dynamic link, we create a .rel.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, - htab->sgot->contents + off); - h->got.offset |= 1; - } - } - else - unresolved_reloc = false; - } - else - { - if (local_got_offsets == NULL) - abort (); - - off = local_got_offsets[r_symndx]; - - /* The offset must always be a multiple of 8. We use - the least significant bit to record whether we have - already generated the necessary reloc. */ - if ((off & 1) != 0) - off &= ~1; - else - { - bfd_put_64 (output_bfd, relocation, - htab->sgot->contents + off); - - if (info->shared) - { - asection *srelgot; - Elf_Internal_Rela outrel; - Elf64_External_Rela *loc; - - srelgot = htab->srelgot; - if (srelgot == NULL) - abort (); - - outrel.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset - + off); - outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); - outrel.r_addend = relocation; - loc = (Elf64_External_Rela *) srelgot->contents; - loc += srelgot->reloc_count++; - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - } - - local_got_offsets[r_symndx] |= 1; - } - } - - if (off >= (bfd_vma) -2) - abort (); - - relocation = htab->sgot->output_offset + off; - - /* - * For @GOTENT the relocation is against the offset between - * the instruction and the symbols entry in the GOT and not - * between the start of the GOT and the symbols entry. We - * add the vma of the GOT to get the correct value. - */ - if (r_type == R_390_GOTENT) - relocation += htab->sgot->output_section->vma; - - break; - - case R_390_GOTOFF: - /* Relocation is relative to the start of the global offset - table. */ - - /* Note that sgot->output_offset is not involved in this - calculation. We always want the start of .got. If we - defined _GLOBAL_OFFSET_TABLE in a different way, as is - permitted by the ABI, we might have to change this - calculation. */ - relocation -= htab->sgot->output_section->vma; - - break; - - case R_390_GOTPC: - case R_390_GOTPCDBL: - /* Use global offset table as symbol value. */ - relocation = htab->sgot->output_section->vma; - unresolved_reloc = false; - break; - - case R_390_PLT16DBL: - case R_390_PLT32: - case R_390_PLT32DBL: - case R_390_PLT64: - /* Relocation is to the entry for this symbol in the - procedure linkage table. */ - - /* Resolve a PLT32 reloc against a local symbol directly, - without using the procedure linkage table. */ - if (h == NULL) - break; - - if (h->plt.offset == (bfd_vma) -1 - || htab->splt == NULL) - { - /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ - break; - } - - relocation = (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset); - unresolved_reloc = false; - break; - - case R_390_8: - case R_390_16: - case R_390_32: - case R_390_64: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32: - case R_390_PC32DBL: - case R_390_PC64: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) - break; - - if ((info->shared - && ((r_type != R_390_PC16 - && r_type != R_390_PC16DBL - && r_type != R_390_PC32 - && r_type != R_390_PC32DBL - && r_type != R_390_PC64) - || (h != NULL - && h->dynindx != -1 - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared - && h != NULL - && h->dynindx != -1 - && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 - && (((h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0) - || h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined))) - { - Elf_Internal_Rela outrel; - boolean skip, relocate; - asection *sreloc; - Elf64_External_Rela *loc; - - /* When generating a shared object, these relocations - are copied into the output file to be resolved at run - time. */ - - skip = false; - relocate = false; - - outrel.r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, - rel->r_offset); - if (outrel.r_offset == (bfd_vma) -1) - skip = true; - else if (outrel.r_offset == (bfd_vma) -2) - skip = true, relocate = true; - - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); - - if (skip) - memset (&outrel, 0, sizeof outrel); - else if (h != NULL - && h->dynindx != -1 - && (r_type == R_390_PC16 - || r_type == R_390_PC16DBL - || r_type == R_390_PC32 - || r_type == R_390_PC32DBL - || r_type == R_390_PC64 - || !info->shared - || !info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) - { - outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); - outrel.r_addend = rel->r_addend; - } - else - { - /* This symbol is local, or marked to become local. */ - relocate = true; - outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); - outrel.r_addend = relocation + rel->r_addend; - } - - sreloc = elf_section_data (input_section)->sreloc; - if (sreloc == NULL) - abort (); - - loc = (Elf64_External_Rela *) sreloc->contents; - loc += sreloc->reloc_count++; - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - - /* If this reloc is against an external symbol, we do - not want to fiddle with the addend. Otherwise, we - need to include the symbol value so that it becomes - an addend for the dynamic reloc. */ - if (! relocate) - continue; - } - - break; - - default: - break; - } - - if (unresolved_reloc - && !(info->shared - && (input_section->flags & SEC_DEBUGGING) != 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) - (*_bfd_error_handler) - (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), - bfd_archive_filename (input_bfd), - bfd_get_section_name (input_bfd, input_section), - (long) rel->r_offset, - h->root.root.string); - - r = _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, - relocation, rel->r_addend); - - if (r != bfd_reloc_ok) - { - const char *name; - - if (h != NULL) - 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) - return false; - if (*name == '\0') - name = bfd_section_name (input_bfd, sec); - } - - if (r == bfd_reloc_overflow) - { - - if (! ((*info->callbacks->reloc_overflow) - (info, name, howto->name, (bfd_vma) 0, - input_bfd, input_section, rel->r_offset))) - return false; - } - else - { - (*_bfd_error_handler) - (_("%s(%s+0x%lx): reloc against `%s': error %d"), - bfd_archive_filename (input_bfd), - bfd_get_section_name (input_bfd, input_section), - (long) rel->r_offset, name, (int) r); - return false; - } - } - } - - return true; -} - -/* Finish up dynamic symbol handling. We set the contents of various - dynamic sections here. */ - -static boolean -elf_s390_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; -{ - struct elf_s390_link_hash_table *htab; - - htab = elf_s390_hash_table (info); - - if (h->plt.offset != (bfd_vma) -1) - { - bfd_vma plt_index; - bfd_vma got_offset; - Elf_Internal_Rela rela; - Elf64_External_Rela *loc; - - /* This symbol has an entry in the procedure linkage table. Set - it up. */ - - if (h->dynindx == -1 - || htab->splt == NULL - || htab->sgotplt == NULL - || htab->srelplt == NULL) - abort (); - - /* Calc. index no. - Current offset - size first entry / entry size. */ - plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; - - /* Offset in GOT is PLT index plus GOT headers(3) times 8, - addr & GOT addr. */ - got_offset = (plt_index + 3) * GOT_ENTRY_SIZE; - - /* Fill in the blueprint of a PLT. */ - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD0, - htab->splt->contents + h->plt.offset); - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD1, - htab->splt->contents + h->plt.offset + 4); - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD2, - htab->splt->contents + h->plt.offset + 8); - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD3, - htab->splt->contents + h->plt.offset + 12); - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD4, - htab->splt->contents + h->plt.offset + 16); - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD5, - htab->splt->contents + h->plt.offset + 20); - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD6, - htab->splt->contents + h->plt.offset + 24); - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD7, - htab->splt->contents + h->plt.offset + 28); - /* Fixup the relative address to the GOT entry */ - bfd_put_32 (output_bfd, - (htab->sgotplt->output_section->vma + - htab->sgotplt->output_offset + got_offset - - (htab->splt->output_section->vma + h->plt.offset))/2, - htab->splt->contents + h->plt.offset + 2); - /* Fixup the relative branch to PLT 0 */ - bfd_put_32 (output_bfd, - (PLT_FIRST_ENTRY_SIZE + - (PLT_ENTRY_SIZE * plt_index) + 22)/2, - htab->splt->contents + h->plt.offset + 24); - /* Fixup offset into symbol table */ - bfd_put_32 (output_bfd, plt_index * sizeof (Elf64_External_Rela), - htab->splt->contents + h->plt.offset + 28); - - /* Fill in the entry in the global offset table. - Points to instruction after GOT offset. */ - bfd_put_64 (output_bfd, - (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset - + 14), - htab->sgotplt->contents + got_offset); - - /* Fill in the entry in the .rela.plt section. */ - rela.r_offset = (htab->sgotplt->output_section->vma - + htab->sgotplt->output_offset - + got_offset); - rela.r_info = ELF64_R_INFO (h->dynindx, R_390_JMP_SLOT); - rela.r_addend = 0; - loc = (Elf64_External_Rela *) htab->srelplt->contents + plt_index; - bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); - - 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. This is a clue - for the dynamic linker, to make function pointer - comparisons work between an application and shared - library. */ - sym->st_shndx = SHN_UNDEF; - } - } - - if (h->got.offset != (bfd_vma) -1) - { - Elf_Internal_Rela rela; - Elf64_External_Rela *loc; - - /* This symbol has an entry in the global offset table. Set it - up. */ - - if (htab->sgot == NULL || htab->srelgot == NULL) - abort (); - - rela.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset - + (h->got.offset &~ (bfd_vma) 1)); - - /* If this is a static link, or it is a -Bsymbolic link and the - symbol is defined locally or was forced to be local because - of a version file, 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_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) - { - BFD_ASSERT((h->got.offset & 1) != 0); - rela.r_info = ELF64_R_INFO (0, R_390_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, htab->sgot->contents + h->got.offset); - rela.r_info = ELF64_R_INFO (h->dynindx, R_390_GLOB_DAT); - rela.r_addend = 0; - } - - loc = (Elf64_External_Rela *) htab->srelgot->contents; - loc += htab->srelgot->reloc_count++; - bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); - } - - if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) - { - Elf_Internal_Rela rela; - Elf64_External_Rela *loc; - - /* This symbols needs a copy reloc. Set it up. */ - - if (h->dynindx == -1 - || (h->root.type != bfd_link_hash_defined - && h->root.type != bfd_link_hash_defweak) - || htab->srelbss == NULL) - abort (); - - 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_390_COPY); - rela.r_addend = 0; - loc = (Elf64_External_Rela *) htab->srelbss->contents; - loc += htab->srelbss->reloc_count++; - bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); - } - - /* Mark some specially defined symbols as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 - || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 - || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) - sym->st_shndx = SHN_ABS; - - return true; -} - -/* Used to decide how to sort relocs in an optimal manner for the - dynamic linker, before writing them out. */ - -static enum elf_reloc_type_class -elf_s390_reloc_type_class (rela) - const Elf_Internal_Rela *rela; -{ - switch ((int) ELF64_R_TYPE (rela->r_info)) - { - 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; - } -} - -/* Finish up the dynamic sections. */ - -static boolean -elf_s390_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; -{ - struct elf_s390_link_hash_table *htab; - bfd *dynobj; - asection *sdyn; - - htab = elf_s390_hash_table (info); - dynobj = htab->elf.dynobj; - sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); - - if (htab->elf.dynamic_sections_created) - { - Elf64_External_Dyn *dyncon, *dynconend; - - if (sdyn == NULL || htab->sgot == NULL) - abort (); - - dyncon = (Elf64_External_Dyn *) sdyn->contents; - dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size); - for (; dyncon < dynconend; dyncon++) - { - Elf_Internal_Dyn dyn; - asection *s; - - bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); - - switch (dyn.d_tag) - { - default: - continue; - - case DT_PLTGOT: - dyn.d_un.d_ptr = htab->sgot->output_section->vma; - break; - - case DT_JMPREL: - dyn.d_un.d_ptr = htab->srelplt->output_section->vma; - break; - - case DT_PLTRELSZ: - s = htab->srelplt->output_section; - if (s->_cooked_size != 0) - dyn.d_un.d_val = s->_cooked_size; - else - dyn.d_un.d_val = s->_raw_size; - break; - - case DT_RELASZ: - /* The procedure linkage table relocs (DT_JMPREL) should - not be included in the overall relocs (DT_RELA). - Therefore, we override the DT_RELASZ entry here to - make it not include the JMPREL relocs. Since the - linker script arranges for .rela.plt to follow all - other relocation sections, we don't have to worry - about changing the DT_RELA entry. */ - s = htab->srelplt->output_section; - if (s->_cooked_size != 0) - dyn.d_un.d_val -= s->_cooked_size; - else - dyn.d_un.d_val -= s->_raw_size; - break; - } - - bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); - } - - /* Fill in the special first entry in the procedure linkage table. */ - if (htab->splt && htab->splt->_raw_size > 0) - { - /* fill in blueprint for plt 0 entry */ - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD0, - htab->splt->contents ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD1, - htab->splt->contents +4 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD3, - htab->splt->contents +12 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD4, - htab->splt->contents +16 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD5, - htab->splt->contents +20 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD6, - htab->splt->contents + 24); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD7, - htab->splt->contents + 28 ); - /* Fixup relative address to start of GOT */ - bfd_put_32 (output_bfd, - (htab->sgotplt->output_section->vma + - htab->sgotplt->output_offset - - htab->splt->output_section->vma - 6)/2, - htab->splt->contents + 8); - } - elf_section_data (htab->splt->output_section) - ->this_hdr.sh_entsize = PLT_ENTRY_SIZE; - } - - if (htab->sgotplt) - { - /* Fill in the first three entries in the global offset table. */ - if (htab->sgotplt->_raw_size > 0) - { - bfd_put_64 (output_bfd, - (sdyn == NULL ? (bfd_vma) 0 - : sdyn->output_section->vma + sdyn->output_offset), - htab->sgotplt->contents); - /* One entry for shared object struct ptr. */ - bfd_put_64 (output_bfd, (bfd_vma) 0, htab->sgotplt->contents + 8); - /* One entry for _dl_runtime_resolve. */ - bfd_put_64 (output_bfd, (bfd_vma) 0, htab->sgotplt->contents + 12); - } - - elf_section_data (htab->sgot->output_section) - ->this_hdr.sh_entsize = 8; - } - return true; -} - -static boolean -elf_s390_object_p (abfd) - bfd *abfd; -{ - return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_64); -} - -/* - * Why was the hash table entry size definition changed from - * ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and - * this is the only reason for the s390_elf64_size_info structure. - */ - -const struct elf_size_info s390_elf64_size_info = -{ - sizeof (Elf64_External_Ehdr), - sizeof (Elf64_External_Phdr), - sizeof (Elf64_External_Shdr), - sizeof (Elf64_External_Rel), - sizeof (Elf64_External_Rela), - sizeof (Elf64_External_Sym), - sizeof (Elf64_External_Dyn), - sizeof (Elf_External_Note), - 8, /* hash-table entry size */ - 1, /* internal relocations per external relocations */ - 64, /* arch_size */ - 8, /* file_align */ - ELFCLASS64, EV_CURRENT, - bfd_elf64_write_out_phdrs, - bfd_elf64_write_shdrs_and_ehdr, - bfd_elf64_write_relocs, - bfd_elf64_swap_symbol_out, - bfd_elf64_slurp_reloc_table, - bfd_elf64_slurp_symbol_table, - bfd_elf64_swap_dyn_in, - bfd_elf64_swap_dyn_out, - NULL, - NULL, - NULL, - NULL -}; - -#define TARGET_BIG_SYM bfd_elf64_s390_vec -#define TARGET_BIG_NAME "elf64-s390" -#define ELF_ARCH bfd_arch_s390 -#define ELF_MACHINE_CODE EM_S390 -#define ELF_MACHINE_ALT1 EM_S390_OLD -#define ELF_MAXPAGESIZE 0x1000 - -#define elf_backend_size_info s390_elf64_size_info - -#define elf_backend_can_gc_sections 1 -#define elf_backend_can_refcount 1 -#define elf_backend_want_got_plt 1 -#define elf_backend_plt_readonly 1 -#define elf_backend_want_plt_sym 0 -#define elf_backend_got_header_size 24 -#define elf_backend_plt_header_size PLT_ENTRY_SIZE -#define elf_backend_rela_normal 1 - -#define elf_info_to_howto elf_s390_info_to_howto - -#define bfd_elf64_bfd_is_local_label_name elf_s390_is_local_label_name -#define bfd_elf64_bfd_link_hash_table_create elf_s390_link_hash_table_create -#define bfd_elf64_bfd_reloc_type_lookup elf_s390_reloc_type_lookup - -#define elf_backend_adjust_dynamic_symbol elf_s390_adjust_dynamic_symbol -#define elf_backend_check_relocs elf_s390_check_relocs -#define elf_backend_copy_indirect_symbol elf_s390_copy_indirect_symbol -#define elf_backend_create_dynamic_sections elf_s390_create_dynamic_sections -#define elf_backend_finish_dynamic_sections elf_s390_finish_dynamic_sections -#define elf_backend_finish_dynamic_symbol elf_s390_finish_dynamic_symbol -#define elf_backend_gc_mark_hook elf_s390_gc_mark_hook -#define elf_backend_gc_sweep_hook elf_s390_gc_sweep_hook -#define elf_backend_reloc_type_class elf_s390_reloc_type_class -#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 - -#include "elf64-target.h" diff --git a/contrib/binutils/bfd/filemode.c b/contrib/binutils/bfd/filemode.c deleted file mode 100644 index 6f4596872ca8..000000000000 --- a/contrib/binutils/bfd/filemode.c +++ /dev/null @@ -1,194 +0,0 @@ -/* filemode.c -- make a string describing file modes - Copyright (C) 1985, 1990 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 -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. */ - -#include "sysdep.h" -#include <sys/types.h> -#include <sys/stat.h> - -void mode_string (); -static char ftypelet (); -static void rwx (); -static void setst (); - -/* filemodestring - fill in string STR with an ls-style ASCII - representation of the st_mode field of file stats block STATP. - 10 characters are stored in STR; no terminating null is added. - The characters stored in STR are: - - 0 File type. 'd' for directory, 'c' for character - special, 'b' for block special, 'm' for multiplex, - 'l' for symbolic link, 's' for socket, 'p' for fifo, - '-' for any other file type - - 1 'r' if the owner may read, '-' otherwise. - - 2 'w' if the owner may write, '-' otherwise. - - 3 'x' if the owner may execute, 's' if the file is - set-user-id, '-' otherwise. - 'S' if the file is set-user-id, but the execute - bit isn't set. - - 4 'r' if group members may read, '-' otherwise. - - 5 'w' if group members may write, '-' otherwise. - - 6 'x' if group members may execute, 's' if the file is - set-group-id, '-' otherwise. - 'S' if it is set-group-id but not executable. - - 7 'r' if any user may read, '-' otherwise. - - 8 'w' if any user may write, '-' otherwise. - - 9 'x' if any user may execute, 't' if the file is "sticky" - (will be retained in swap space after execution), '-' - otherwise. - 'T' if the file is sticky but not executable. */ - -void -filemodestring (statp, str) - struct stat *statp; - char *str; -{ - mode_string (statp->st_mode, str); -} - -/* Like filemodestring, but only the relevant part of the `struct stat' - is given as an argument. */ - -void -mode_string (mode, str) - unsigned short mode; - char *str; -{ - str[0] = ftypelet (mode); - rwx ((mode & 0700) << 0, &str[1]); - rwx ((mode & 0070) << 3, &str[4]); - rwx ((mode & 0007) << 6, &str[7]); - setst (mode, str); -} - -/* Return a character indicating the type of file described by - file mode BITS: - 'd' for directories - 'b' for block special files - 'c' for character special files - 'm' for multiplexor files - 'l' for symbolic links - 's' for sockets - 'p' for fifos - '-' for any other file type. */ - -static char -ftypelet (bits) - unsigned short bits; -{ - switch (bits & S_IFMT) - { - default: - return '-'; - case S_IFDIR: - return 'd'; -#ifdef S_IFLNK - case S_IFLNK: - return 'l'; -#endif -#ifdef S_IFCHR - case S_IFCHR: - return 'c'; -#endif -#ifdef S_IFBLK - case S_IFBLK: - return 'b'; -#endif -#ifdef S_IFMPC - case S_IFMPC: - case S_IFMPB: - return 'm'; -#endif -#ifdef S_IFSOCK - case S_IFSOCK: - return 's'; -#endif -#ifdef S_IFIFO -#if S_IFIFO != S_IFSOCK - case S_IFIFO: - return 'p'; -#endif -#endif -#ifdef S_IFNWK /* HP-UX */ - case S_IFNWK: - return 'n'; -#endif - } -} - -/* Look at read, write, and execute bits in BITS and set - flags in CHARS accordingly. */ - -static void -rwx (bits, chars) - unsigned short bits; - char *chars; -{ - chars[0] = (bits & S_IREAD) ? 'r' : '-'; - chars[1] = (bits & S_IWRITE) ? 'w' : '-'; - chars[2] = (bits & S_IEXEC) ? 'x' : '-'; -} - -/* Set the 's' and 't' flags in file attributes string CHARS, - according to the file mode BITS. */ - -static void -setst (bits, chars) - unsigned short bits; - char *chars; -{ -#ifdef S_ISUID - if (bits & S_ISUID) - { - if (chars[3] != 'x') - /* Set-uid, but not executable by owner. */ - chars[3] = 'S'; - else - chars[3] = 's'; - } -#endif -#ifdef S_ISGID - if (bits & S_ISGID) - { - if (chars[6] != 'x') - /* Set-gid, but not executable by group. */ - chars[6] = 'S'; - else - chars[6] = 's'; - } -#endif -#ifdef S_ISVTX - if (bits & S_ISVTX) - { - if (chars[9] != 'x') - /* Sticky, but not executable by others. */ - chars[9] = 'T'; - else - chars[9] = 't'; - } -#endif -} - - diff --git a/contrib/binutils/bfd/libpei.h b/contrib/binutils/bfd/libpei.h deleted file mode 100644 index 6b232b48a719..000000000000 --- a/contrib/binutils/bfd/libpei.h +++ /dev/null @@ -1,335 +0,0 @@ -/* Support for the generic parts of PE/PEI; common header information. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. - Written by Cygnus Solutions. - -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. */ - -/* -Most of this hacked by Steve Chamberlain, - sac@cygnus.com - -PE/PEI rearrangement (and code added): Donn Terry - Softway Systems, Inc. -*/ - -/* Hey look, some documentation [and in a place you expect to find it]! - - The main reference for the pei format is "Microsoft Portable Executable - and Common Object File Format Specification 4.1". Get it if you need to - do some serious hacking on this code. - - Another reference: - "Peering Inside the PE: A Tour of the Win32 Portable Executable - File Format", MSJ 1994, Volume 9. - - The *sole* difference between the pe format and the pei format is that the - latter has an MSDOS 2.0 .exe header on the front that prints the message - "This app must be run under Windows." (or some such). - (FIXME: Whether that statement is *really* true or not is unknown. - Are there more subtle differences between pe and pei formats? - For now assume there aren't. If you find one, then for God sakes - document it here!) - - The Microsoft docs use the word "image" instead of "executable" because - the former can also refer to a DLL (shared library). Confusion can arise - because the `i' in `pei' also refers to "image". The `pe' format can - also create images (i.e. executables), it's just that to run on a win32 - system you need to use the pei format. - - FIXME: Please add more docs here so the next poor fool that has to hack - on this code has a chance of getting something accomplished without - wasting too much time. -*/ - -#ifndef GET_FCN_LNNOPTR -#define GET_FCN_LNNOPTR(abfd, ext) \ - H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) -#endif - -#ifndef GET_FCN_ENDNDX -#define GET_FCN_ENDNDX(abfd, ext) \ - H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx) -#endif - -#ifndef PUT_FCN_LNNOPTR -#define PUT_FCN_LNNOPTR(abfd, in, ext) \ - H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) -#endif -#ifndef PUT_FCN_ENDNDX -#define PUT_FCN_ENDNDX(abfd, in, ext) \ - H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_endndx) -#endif -#ifndef GET_LNSZ_LNNO -#define GET_LNSZ_LNNO(abfd, ext) \ - H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_lnno) -#endif -#ifndef GET_LNSZ_SIZE -#define GET_LNSZ_SIZE(abfd, ext) \ - H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_size) -#endif -#ifndef PUT_LNSZ_LNNO -#define PUT_LNSZ_LNNO(abfd, in, ext) \ - H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_lnno) -#endif -#ifndef PUT_LNSZ_SIZE -#define PUT_LNSZ_SIZE(abfd, in, ext) \ - H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_size) -#endif -#ifndef GET_SCN_SCNLEN -#define GET_SCN_SCNLEN(abfd, ext) \ - H_GET_32 (abfd, ext->x_scn.x_scnlen) -#endif -#ifndef GET_SCN_NRELOC -#define GET_SCN_NRELOC(abfd, ext) \ - H_GET_16 (abfd, ext->x_scn.x_nreloc) -#endif -#ifndef GET_SCN_NLINNO -#define GET_SCN_NLINNO(abfd, ext) \ - H_GET_16 (abfd, ext->x_scn.x_nlinno) -#endif -#ifndef PUT_SCN_SCNLEN -#define PUT_SCN_SCNLEN(abfd, in, ext) \ - H_PUT_32(abfd, in, ext->x_scn.x_scnlen) -#endif -#ifndef PUT_SCN_NRELOC -#define PUT_SCN_NRELOC(abfd, in, ext) \ - H_PUT_16(abfd, in, ext->x_scn.x_nreloc) -#endif -#ifndef PUT_SCN_NLINNO -#define PUT_SCN_NLINNO(abfd, in, ext) \ - H_PUT_16(abfd,in, ext->x_scn.x_nlinno) -#endif -#ifndef GET_LINENO_LNNO -#define GET_LINENO_LNNO(abfd, ext) \ - H_GET_16 (abfd, ext->l_lnno); -#endif -#ifndef PUT_LINENO_LNNO -#define PUT_LINENO_LNNO(abfd, val, ext) \ - H_PUT_16(abfd,val, ext->l_lnno); -#endif - -/* The f_symptr field in the filehdr is sometimes 64 bits. */ -#ifndef GET_FILEHDR_SYMPTR -#define GET_FILEHDR_SYMPTR H_GET_32 -#endif -#ifndef PUT_FILEHDR_SYMPTR -#define PUT_FILEHDR_SYMPTR H_PUT_32 -#endif - -/* Some fields in the aouthdr are sometimes 64 bits. */ -#ifndef GET_AOUTHDR_TSIZE -#define GET_AOUTHDR_TSIZE H_GET_32 -#endif -#ifndef PUT_AOUTHDR_TSIZE -#define PUT_AOUTHDR_TSIZE H_PUT_32 -#endif -#ifndef GET_AOUTHDR_DSIZE -#define GET_AOUTHDR_DSIZE H_GET_32 -#endif -#ifndef PUT_AOUTHDR_DSIZE -#define PUT_AOUTHDR_DSIZE H_PUT_32 -#endif -#ifndef GET_AOUTHDR_BSIZE -#define GET_AOUTHDR_BSIZE H_GET_32 -#endif -#ifndef PUT_AOUTHDR_BSIZE -#define PUT_AOUTHDR_BSIZE H_PUT_32 -#endif -#ifndef GET_AOUTHDR_ENTRY -#define GET_AOUTHDR_ENTRY H_GET_32 -#endif -#ifndef PUT_AOUTHDR_ENTRY -#define PUT_AOUTHDR_ENTRY H_PUT_32 -#endif -#ifndef GET_AOUTHDR_TEXT_START -#define GET_AOUTHDR_TEXT_START H_GET_32 -#endif -#ifndef PUT_AOUTHDR_TEXT_START -#define PUT_AOUTHDR_TEXT_START H_PUT_32 -#endif -#ifndef GET_AOUTHDR_DATA_START -#define GET_AOUTHDR_DATA_START H_GET_32 -#endif -#ifndef PUT_AOUTHDR_DATA_START -#define PUT_AOUTHDR_DATA_START H_PUT_32 -#endif - -/* Some fields in the scnhdr are sometimes 64 bits. */ -#ifndef GET_SCNHDR_PADDR -#define GET_SCNHDR_PADDR H_GET_32 -#endif -#ifndef PUT_SCNHDR_PADDR -#define PUT_SCNHDR_PADDR H_PUT_32 -#endif -#ifndef GET_SCNHDR_VADDR -#define GET_SCNHDR_VADDR H_GET_32 -#endif -#ifndef PUT_SCNHDR_VADDR -#define PUT_SCNHDR_VADDR H_PUT_32 -#endif -#ifndef GET_SCNHDR_SIZE -#define GET_SCNHDR_SIZE H_GET_32 -#endif -#ifndef PUT_SCNHDR_SIZE -#define PUT_SCNHDR_SIZE H_PUT_32 -#endif -#ifndef GET_SCNHDR_SCNPTR -#define GET_SCNHDR_SCNPTR H_GET_32 -#endif -#ifndef PUT_SCNHDR_SCNPTR -#define PUT_SCNHDR_SCNPTR H_PUT_32 -#endif -#ifndef GET_SCNHDR_RELPTR -#define GET_SCNHDR_RELPTR H_GET_32 -#endif -#ifndef PUT_SCNHDR_RELPTR -#define PUT_SCNHDR_RELPTR H_PUT_32 -#endif -#ifndef GET_SCNHDR_LNNOPTR -#define GET_SCNHDR_LNNOPTR H_GET_32 -#endif -#ifndef PUT_SCNHDR_LNNOPTR -#define PUT_SCNHDR_LNNOPTR H_PUT_32 -#endif - -#ifdef COFF_WITH_pep - -#define GET_OPTHDR_IMAGE_BASE H_GET_64 -#define PUT_OPTHDR_IMAGE_BASE H_PUT_64 -#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64 -#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64 -#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64 -#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64 -#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64 -#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64 -#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64 -#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64 -#define GET_PDATA_ENTRY bfd_get_64 - -#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pep_bfd_copy_private_bfd_data_common -#define _bfd_XX_bfd_copy_private_section_data _bfd_pep_bfd_copy_private_section_data -#define _bfd_XX_get_symbol_info _bfd_pep_get_symbol_info -#define _bfd_XX_only_swap_filehdr_out _bfd_pep_only_swap_filehdr_out -#define _bfd_XX_print_private_bfd_data_common _bfd_pep_print_private_bfd_data_common -#define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript -#define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript -#define _bfd_XXi_only_swap_filehdr_out _bfd_pepi_only_swap_filehdr_out -#define _bfd_XXi_swap_aouthdr_in _bfd_pepi_swap_aouthdr_in -#define _bfd_XXi_swap_aouthdr_out _bfd_pepi_swap_aouthdr_out -#define _bfd_XXi_swap_aux_in _bfd_pepi_swap_aux_in -#define _bfd_XXi_swap_aux_out _bfd_pepi_swap_aux_out -#define _bfd_XXi_swap_lineno_in _bfd_pepi_swap_lineno_in -#define _bfd_XXi_swap_lineno_out _bfd_pepi_swap_lineno_out -#define _bfd_XXi_swap_scnhdr_out _bfd_pepi_swap_scnhdr_out -#define _bfd_XXi_swap_sym_in _bfd_pepi_swap_sym_in -#define _bfd_XXi_swap_sym_out _bfd_pepi_swap_sym_out - -#else /* !COFF_WITH_pep */ - -#define GET_OPTHDR_IMAGE_BASE H_GET_32 -#define PUT_OPTHDR_IMAGE_BASE H_PUT_32 -#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_32 -#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_32 -#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_32 -#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_32 -#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_32 -#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_32 -#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_32 -#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_32 -#define GET_PDATA_ENTRY bfd_get_32 - -#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pe_bfd_copy_private_bfd_data_common -#define _bfd_XX_bfd_copy_private_section_data _bfd_pe_bfd_copy_private_section_data -#define _bfd_XX_get_symbol_info _bfd_pe_get_symbol_info -#define _bfd_XX_only_swap_filehdr_out _bfd_pe_only_swap_filehdr_out -#define _bfd_XX_print_private_bfd_data_common _bfd_pe_print_private_bfd_data_common -#define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript -#define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript -#define _bfd_XXi_only_swap_filehdr_out _bfd_pei_only_swap_filehdr_out -#define _bfd_XXi_swap_aouthdr_in _bfd_pei_swap_aouthdr_in -#define _bfd_XXi_swap_aouthdr_out _bfd_pei_swap_aouthdr_out -#define _bfd_XXi_swap_aux_in _bfd_pei_swap_aux_in -#define _bfd_XXi_swap_aux_out _bfd_pei_swap_aux_out -#define _bfd_XXi_swap_lineno_in _bfd_pei_swap_lineno_in -#define _bfd_XXi_swap_lineno_out _bfd_pei_swap_lineno_out -#define _bfd_XXi_swap_scnhdr_out _bfd_pei_swap_scnhdr_out -#define _bfd_XXi_swap_sym_in _bfd_pei_swap_sym_in -#define _bfd_XXi_swap_sym_out _bfd_pei_swap_sym_out - -#endif /* !COFF_WITH_pep */ - -/* These functions are architecture dependent, and are in peicode.h: - coff_swap_reloc_in - int coff_swap_reloc_out - coff_swap_filehdr_in - coff_swap_scnhdr_in - pe_mkobject - pe_mkobject_hook */ - -/* The functions described below are common across all PE/PEI - implementations architecture types, and actually appear in - peigen.c. */ - -void _bfd_XXi_swap_sym_in PARAMS ((bfd*, PTR, PTR)); -#define coff_swap_sym_in _bfd_XXi_swap_sym_in - -unsigned int _bfd_XXi_swap_sym_out PARAMS ((bfd*, PTR, PTR)); -#define coff_swap_sym_out _bfd_XXi_swap_sym_out - -void _bfd_XXi_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR)); -#define coff_swap_aux_in _bfd_XXi_swap_aux_in - -unsigned int _bfd_XXi_swap_aux_out \ - PARAMS ((bfd *, PTR, int, int, int, int, PTR)); -#define coff_swap_aux_out _bfd_XXi_swap_aux_out - -void _bfd_XXi_swap_lineno_in PARAMS ((bfd*, PTR, PTR)); -#define coff_swap_lineno_in _bfd_XXi_swap_lineno_in - -unsigned int _bfd_XXi_swap_lineno_out PARAMS ((bfd*, PTR, PTR)); -#define coff_swap_lineno_out _bfd_XXi_swap_lineno_out - -void _bfd_XXi_swap_aouthdr_in PARAMS ((bfd*, PTR, PTR)); -#define coff_swap_aouthdr_in _bfd_XXi_swap_aouthdr_in - -unsigned int _bfd_XXi_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR)); -#define coff_swap_aouthdr_out _bfd_XXi_swap_aouthdr_out - -unsigned int _bfd_XXi_swap_scnhdr_out PARAMS ((bfd *, PTR, PTR)); -#define coff_swap_scnhdr_out _bfd_XXi_swap_scnhdr_out - -boolean _bfd_XX_print_private_bfd_data_common PARAMS ((bfd *, PTR)); - -boolean _bfd_XX_bfd_copy_private_bfd_data_common PARAMS ((bfd *, bfd *)); - -void _bfd_XX_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); - -boolean _bfd_XXi_final_link_postscript - PARAMS ((bfd *, struct coff_final_link_info *)); - -#ifndef coff_final_link_postscript -#define coff_final_link_postscript _bfd_XXi_final_link_postscript -#endif -/* The following are needed only for ONE of pe or pei, but don't - otherwise vary; peicode.h fixes up ifdefs but we provide the - prototype. */ - -unsigned int _bfd_XX_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR)); -unsigned int _bfd_XXi_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR)); -boolean _bfd_XX_bfd_copy_private_section_data - PARAMS ((bfd *, asection *, bfd *, asection *)); diff --git a/contrib/binutils/bfd/mipsbsd.c b/contrib/binutils/bfd/mipsbsd.c deleted file mode 100644 index 85cf0ef21e9a..000000000000 --- a/contrib/binutils/bfd/mipsbsd.c +++ /dev/null @@ -1,487 +0,0 @@ -/* BFD backend for MIPS BSD (a.out) binaries. - Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. - Written by Ralph Campbell. - -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. */ - -#define BYTES_IN_WORD 4 -/* #define ENTRY_CAN_BE_ZERO */ -#define N_HEADER_IN_TEXT(x) 1 -#define N_SHARED_LIB(x) 0 -#define N_TXTADDR(x) \ - (N_MAGIC(x) != ZMAGIC ? (x).a_entry : /* object file or NMAGIC */\ - TEXT_START_ADDR + EXEC_BYTES_SIZE /* no padding */\ - ) -#define N_DATADDR(x) (N_TXTADDR(x)+N_TXTSIZE(x)) -#define TEXT_START_ADDR 4096 -#define TARGET_PAGE_SIZE 4096 -#define SEGMENT_SIZE TARGET_PAGE_SIZE -#define DEFAULT_ARCH bfd_arch_mips -#define MACHTYPE_OK(mtype) ((mtype) == M_UNKNOWN \ - || (mtype) == M_MIPS1 || (mtype) == M_MIPS2) -#define MY_symbol_leading_char '\0' - -/* Do not "beautify" the CONCAT* macro args. Traditional C will not - remove whitespace added here, and thus will fail to concatenate - the tokens. */ -#define MY(OP) CONCAT2 (mipsbsd_,OP) - -#include "bfd.h" -#include "sysdep.h" -#include "libbfd.h" -#include "libaout.h" - -#define SET_ARCH_MACH(ABFD, EXEC) \ - MY(set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \ - MY(choose_reloc_size) (ABFD); -static void MY(set_arch_mach) PARAMS ((bfd *abfd, unsigned long machtype)); -static void MY(choose_reloc_size) PARAMS ((bfd *abfd)); - -#define MY_write_object_contents MY(write_object_contents) -static boolean MY(write_object_contents) PARAMS ((bfd *abfd)); - -/* We can't use MY(x) here because it leads to a recursive call to CONCAT2 - when expanded inside JUMP_TABLE. */ -#define MY_bfd_reloc_type_lookup mipsbsd_reloc_howto_type_lookup -#define MY_canonicalize_reloc mipsbsd_canonicalize_reloc - -#define MY_bfd_link_hash_table_create _bfd_generic_link_hash_table_create -#define MY_bfd_link_add_symbols _bfd_generic_link_add_symbols -#define MY_final_link_callback unused -#define MY_bfd_final_link _bfd_generic_final_link - -#define MY_backend_data &MY(backend_data) -#define MY_BFD_TARGET - -#include "aout-target.h" - -static bfd_reloc_status_type mips_fix_jmp_addr - PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, - bfd *, char **)); -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; - unsigned long machtype; -{ - enum bfd_architecture arch; - unsigned int machine; - - /* Determine the architecture and machine type of the object file. */ - switch (machtype) - { - 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); -} - -/* Determine the size of a relocation entry, based on the architecture */ -static void -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; - } -} - -/* Write an object file in BSD a.out format. - Section contents have already been written. We write the - file header, symbols, and relocation. */ - -static boolean -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); - break; - default: - case bfd_mach_m68020: - N_SET_MACHTYPE (*execp, M_68020); - 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); - break; - default: - N_SET_MACHTYPE (*execp, M_MIPS1); - break; - } - break; - default: - N_SET_MACHTYPE (*execp, M_UNKNOWN); - } - - MY (choose_reloc_size) (abfd); - - WRITE_HEADERS (abfd, execp); - - return true; -} - -/* MIPS relocation types. */ -#define MIPS_RELOC_32 0 -#define MIPS_RELOC_JMP 1 -#define MIPS_RELOC_WDISP16 2 -#define MIPS_RELOC_HI16 3 -#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. */ - -static bfd_reloc_status_type -mips_fix_jmp_addr (abfd, reloc_entry, symbol, data, input_section, output_bfd, - error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - struct symbol_cache_entry *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - bfd_vma relocation, pc; - - /* If this is a partial relocation, just continue. */ - if (output_bfd != (bfd *)NULL) - return bfd_reloc_continue; - - /* 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. */ - 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; - - pc = input_section->output_section->vma + input_section->output_offset + - reloc_entry->address + 4; - - if ((relocation & 0xF0000000) != (pc & 0xF0000000)) - return bfd_reloc_overflow; - - 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. */ - -static bfd_reloc_status_type -mips_fix_hi16_s PARAMS ((bfd *, arelent *, asymbol *, PTR, - asection *, bfd *, char **)); - -static bfd_reloc_status_type -mips_fix_hi16_s (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 ATTRIBUTE_UNUSED; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - bfd_vma relocation; - - /* If this is a partial relocation, just continue. */ - if (output_bfd != (bfd *)NULL) - return bfd_reloc_continue; - - /* 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. */ - 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; - - if (relocation & 0x8000) - reloc_entry->addend += 0x10000; - - return bfd_reloc_continue; -} - -static reloc_howto_type mips_howto_table_ext[] = { - {MIPS_RELOC_32, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, - "32", false, 0, 0xffffffff, false}, - {MIPS_RELOC_JMP, 2, 2, 26, false, 0, complain_overflow_dont, - mips_fix_jmp_addr, - "MIPS_JMP", false, 0, 0x03ffffff, false}, - {MIPS_RELOC_WDISP16, 2, 2, 16, true, 0, complain_overflow_signed, 0, - "WDISP16", false, 0, 0x0000ffff, false}, - {MIPS_RELOC_HI16, 16, 2, 16, false, 0, complain_overflow_bitfield, 0, - "HI16", false, 0, 0x0000ffff, false}, - {MIPS_RELOC_HI16_S, 16, 2, 16, false, 0, complain_overflow_bitfield, - mips_fix_hi16_s, - "HI16_S", false, 0, 0x0000ffff, false}, - {MIPS_RELOC_LO16, 0, 2, 16, false, 0, complain_overflow_dont, 0, - "LO16", false, 0, 0x0000ffff, false}, -}; - -static reloc_howto_type * -MY(reloc_howto_type_lookup) (abfd, code) - bfd *abfd; - bfd_reloc_code_real_type code; -{ - - if (bfd_get_arch (abfd) != bfd_arch_mips) - return 0; - - switch (code) - { - case BFD_RELOC_CTOR: - case BFD_RELOC_32: - return (&mips_howto_table_ext[MIPS_RELOC_32]); - case BFD_RELOC_MIPS_JMP: - return (&mips_howto_table_ext[MIPS_RELOC_JMP]); - case BFD_RELOC_16_PCREL_S2: - return (&mips_howto_table_ext[MIPS_RELOC_WDISP16]); - case BFD_RELOC_HI16: - return (&mips_howto_table_ext[MIPS_RELOC_HI16]); - case BFD_RELOC_HI16_S: - return (&mips_howto_table_ext[MIPS_RELOC_HI16_S]); - case BFD_RELOC_LO16: - return (&mips_howto_table_ext[MIPS_RELOC_LO16]); - default: - return 0; - } -} - -/* 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; - sec_ptr section; - arelent **relptr; - asymbol **symbols; -{ - arelent *tblptr = section->relocation; - unsigned int count, c; - 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; - - 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; - } - - if (!NAME(aout,slurp_reloc_table) (abfd, section, symbols)) - return -1; - tblptr = section->relocation; - - /* fix up howto entries. */ - for (count = 0; count++ < section->reloc_count;) - { - c = tblptr->howto - NAME(aout,ext_howto_table); - tblptr->howto = &mips_howto_table_ext[c]; - - *relptr++ = tblptr++; - } - *relptr = 0; - return section->reloc_count; -} - -static const struct aout_backend_data MY(backend_data) = { - 0, /* zmagic contiguous */ - 1, /* text incl header */ - 0, /* entry is text address */ - 0, /* exec_hdr_flags */ - TARGET_PAGE_SIZE, /* text vma */ - MY_set_sizes, - 0, /* text size includes exec header */ - 0, /* add_dynamic_symbols */ - 0, /* add_one_symbol */ - 0, /* link_dynamic_object */ - 0, /* write_dynamic_symbol */ - 0, /* check_dynamic_reloc */ - 0 /* finish_dynamic_link */ -}; - -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 */ - {_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 (_bfd_nodynamic), - - & aout_mips_big_vec, - - (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 */ - {_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 (_bfd_nodynamic), - - & aout_mips_little_vec, - - (PTR) MY_backend_data - }; diff --git a/contrib/binutils/bfd/pe-mips.c b/contrib/binutils/bfd/pe-mips.c deleted file mode 100644 index c78726d1c3b3..000000000000 --- a/contrib/binutils/bfd/pe-mips.c +++ /dev/null @@ -1,998 +0,0 @@ -/* BFD back-end for MIPS PE COFF files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001 Free Software Foundation, Inc. - Modified from coff-i386.c by DJ Delorie, dj@cygnus.com - -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. */ - -#define COFF_WITH_PE -#define COFF_LONG_SECTION_NAMES -#define PCRELOFFSET true - -#include "bfd.h" -#include "sysdep.h" -#include "libbfd.h" - -#include "coff/mipspe.h" - -#include "coff/internal.h" - -#include "coff/pe.h" - -#include "libcoff.h" - -static bfd_reloc_status_type coff_mips_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static reloc_howto_type *coff_mips_rtype_to_howto - PARAMS ((bfd *, asection *, struct internal_reloc *, - struct coff_link_hash_entry *, struct internal_syment *, - - bfd_vma *)); -#if 0 -static void mips_ecoff_swap_reloc_in PARAMS ((bfd *, PTR, - struct internal_reloc *)); -static void mips_ecoff_swap_reloc_out PARAMS ((bfd *, - const struct internal_reloc *, - PTR)); -static void mips_adjust_reloc_in PARAMS ((bfd *, - const struct internal_reloc *, - arelent *)); -static void mips_adjust_reloc_out PARAMS ((bfd *, const arelent *, - struct internal_reloc *)); -#endif - -static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); -static reloc_howto_type * coff_mips_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); -static void mips_swap_reloc_in PARAMS ((bfd *, PTR, PTR)); -static unsigned int mips_swap_reloc_out PARAMS ((bfd *, PTR, PTR)); -static boolean coff_pe_mips_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - struct internal_reloc *, struct internal_syment *, asection **)); - -#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) -/* The page size is a guess based on ELF. */ - -#define COFF_PAGE_SIZE 0x1000 - -/* For some reason when using mips COFF the value stored in the .text - section for a reference to a common symbol is the value itself plus - any desired offset. Ian Taylor, Cygnus Support. */ - -/* If we are producing relocateable output, we need to do some - adjustments to the object file that are not done by the - bfd_perform_relocation function. This function is called by every - reloc type to make any required adjustments. */ - -static bfd_reloc_status_type -coff_mips_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, - error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section ATTRIBUTE_UNUSED; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - symvalue diff; - - if (output_bfd == (bfd *) NULL) - return bfd_reloc_continue; - - if (bfd_is_com_section (symbol->section)) - { -#ifndef COFF_WITH_PE - /* We are relocating a common symbol. The current value in the - object file is ORIG + OFFSET, where ORIG is the value of the - common symbol as seen by the object file when it was compiled - (this may be zero if the symbol was undefined) and OFFSET is - the offset into the common symbol (normally zero, but may be - non-zero when referring to a field in a common structure). - ORIG is the negative of reloc_entry->addend, which is set by - the CALC_ADDEND macro below. We want to replace the value in - the object file with NEW + OFFSET, where NEW is the value of - the common symbol which we are going to put in the final - object file. NEW is symbol->value. */ - diff = symbol->value + reloc_entry->addend; -#else - /* In PE mode, we do not offset the common symbol. */ - diff = reloc_entry->addend; -#endif - } - else - { - /* For some reason bfd_perform_relocation always effectively - ignores the addend for a COFF target when producing - relocateable output. This seems to be always wrong for 386 - COFF, so we handle the addend here instead. */ - diff = reloc_entry->addend; - } - -#ifdef COFF_WITH_PE -#if 0 - /* dj - handle it like any other reloc? */ - /* FIXME: How should this case be handled? */ - if (reloc_entry->howto->type == MIPS_R_RVA && diff != 0) - abort (); -#endif -#endif - -#define DOIT(x) \ - x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + (diff >> howto->rightshift)) & howto->dst_mask)) - - if (diff != 0) - { - reloc_howto_type *howto = reloc_entry->howto; - unsigned char *addr = (unsigned char *) data + reloc_entry->address; - - switch (howto->size) - { - case 0: - { - char x = bfd_get_8 (abfd, addr); - DOIT (x); - bfd_put_8 (abfd, x, addr); - } - break; - - case 1: - { - short x = bfd_get_16 (abfd, addr); - DOIT (x); - bfd_put_16 (abfd, (bfd_vma) x, addr); - } - break; - - case 2: - { - long x = bfd_get_32 (abfd, addr); - DOIT (x); - bfd_put_32 (abfd, (bfd_vma) x, addr); - } - break; - - default: - abort (); - } - } - - /* Now let bfd_perform_relocation finish everything up. */ - return bfd_reloc_continue; -} - -#ifdef COFF_WITH_PE -/* Return true if this relocation should - appear in the output .reloc section. */ - -static boolean -in_reloc_p (abfd, howto) - bfd * abfd ATTRIBUTE_UNUSED; - reloc_howto_type *howto; -{ - return ! howto->pc_relative && howto->type != MIPS_R_RVA; -} -#endif - -#ifndef PCRELOFFSET -#define PCRELOFFSET false -#endif - -static reloc_howto_type howto_table[] = -{ - /* Reloc type 0 is ignored. The reloc reading code ensures that - this is a reference to the .abs section, which will cause - bfd_perform_relocation to do nothing. */ - HOWTO (MIPS_R_ABSOLUTE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - 0, /* special_function */ - "IGNORE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 16 bit reference to a symbol, normally from a data section. */ - HOWTO (MIPS_R_REFHALF, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - coff_mips_reloc, /* special_function */ - "REFHALF", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 32 bit reference to a symbol, normally from a data section. */ - HOWTO (MIPS_R_REFWORD, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - coff_mips_reloc, /* special_function */ - "REFWORD", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 26 bit absolute jump address. */ - HOWTO (MIPS_R_JMPADDR, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - /* This needs complex overflow - detection, because the upper four - bits must match the PC. */ - coff_mips_reloc, /* special_function */ - "JMPADDR", /* name */ - true, /* partial_inplace */ - 0x3ffffff, /* src_mask */ - 0x3ffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* The high 16 bits of a symbol value. Handled by the function - mips_refhi_reloc. */ - HOWTO (MIPS_R_REFHI, /* type */ - 16, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - coff_mips_reloc, /* special_function */ - "REFHI", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* The low 16 bits of a symbol value. */ - HOWTO (MIPS_R_REFLO, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - coff_mips_reloc, /* special_function */ - "REFLO", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* A reference to an offset from the gp register. Handled by the - function mips_gprel_reloc. */ - HOWTO (MIPS_R_GPREL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - coff_mips_reloc, /* special_function */ - "GPREL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* A reference to a literal using an offset from the gp register. - Handled by the function mips_gprel_reloc. */ - HOWTO (MIPS_R_LITERAL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - coff_mips_reloc, /* special_function */ - "LITERAL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - 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), - EMPTY_HOWTO (24), - EMPTY_HOWTO (25), - EMPTY_HOWTO (26), - EMPTY_HOWTO (27), - EMPTY_HOWTO (28), - EMPTY_HOWTO (29), - EMPTY_HOWTO (30), - EMPTY_HOWTO (31), - EMPTY_HOWTO (32), - EMPTY_HOWTO (33), - HOWTO (MIPS_R_RVA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - coff_mips_reloc, /* special_function */ - "rva32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - EMPTY_HOWTO (35), - EMPTY_HOWTO (36), - HOWTO (MIPS_R_PAIR, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - coff_mips_reloc, /* special_function */ - "PAIR", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ -}; - -/* Turn a howto into a reloc nunmber */ - -#define SELECT_RELOC(x,howto) { x.r_type = howto->type; } -#define BADMAG(x) MIPSBADMAG(x) -#define MIPS 1 /* Customize coffcode.h */ - -#define RTYPE2HOWTO(cache_ptr, dst) \ - (cache_ptr)->howto = howto_table + (dst)->r_type; - -/* Compute the addend of a reloc. If the reloc is to a common symbol, - the object file contains the value of the common symbol. By the - time this is called, the linker may be using a different symbol - from a different object file with a different value. Therefore, we - hack wildly to locate the original symbol from this file so that we - can make the correct adjustment. This macro sets coffsym to the - symbol from the original file, and uses it to set the addend value - correctly. If this is not a common symbol, the usual addend - calculation is done, except that an additional tweak is needed for - PC relative relocs. - FIXME: This macro refers to symbols and asect; these are from the - calling function, not the macro arguments. */ - -#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \ - { \ - coff_symbol_type *coffsym = (coff_symbol_type *) NULL; \ - if (ptr && bfd_asymbol_bfd (ptr) != abfd) \ - coffsym = (obj_symbols (abfd) \ - + (cache_ptr->sym_ptr_ptr - symbols)); \ - else if (ptr) \ - coffsym = coff_symbol_from (abfd, ptr); \ - if (coffsym != (coff_symbol_type *) NULL \ - && coffsym->native->u.syment.n_scnum == 0) \ - cache_ptr->addend = - coffsym->native->u.syment.n_value; \ - else if (ptr && bfd_asymbol_bfd (ptr) == abfd \ - && ptr->section != (asection *) NULL) \ - cache_ptr->addend = - (ptr->section->vma + ptr->value); \ - else \ - cache_ptr->addend = 0; \ - if (ptr && howto_table[reloc.r_type].pc_relative) \ - cache_ptr->addend += asect->vma; \ - } - -/* Convert an rtype to howto for the COFF backend linker. */ - -static reloc_howto_type * -coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec; - struct internal_reloc *rel; - struct coff_link_hash_entry *h; - struct internal_syment *sym; - bfd_vma *addendp; -{ - - reloc_howto_type *howto; - - howto = howto_table + rel->r_type; - -#ifdef COFF_WITH_PE - *addendp = 0; -#endif - - if (howto->pc_relative) - *addendp += sec->vma; - - if (sym != NULL && sym->n_scnum == 0 && sym->n_value != 0) - { - /* This is a common symbol. The section contents include the - size (sym->n_value) as an addend. The relocate_section - function will be adding in the final value of the symbol. We - need to subtract out the current size in order to get the - correct result. */ - - BFD_ASSERT (h != NULL); - -#ifndef COFF_WITH_PE - /* I think we *do* want to bypass this. If we don't, I have - seen some data parameters get the wrong relocation address. - If I link two versions 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. */ - *addendp -= sym->n_value; -#endif - } - -#ifndef COFF_WITH_PE - /* If the output symbol is common (in which case this must be a - relocateable link), we need to add in the final size of the - common symbol. */ - if (h != NULL && h->root.type == bfd_link_hash_common) - *addendp += h->root.u.c.size; -#endif - -#ifdef COFF_WITH_PE - if (howto->pc_relative) - { - *addendp -= 4; - - /* If the symbol is defined, then the generic code is going to - add back the symbol value in order to cancel out an - adjustment it made to the addend. However, we set the addend - to 0 at the start of this function. We need to adjust here, - to avoid the adjustment the generic code will make. FIXME: - This is getting a bit hackish. */ - if (sym != NULL && sym->n_scnum != 0) - *addendp -= sym->n_value; - } - - if (rel->r_type == MIPS_R_RVA) - { - *addendp -= pe_data(sec->output_section->owner)->pe_opthdr.ImageBase; - } -#endif - - return howto; -} - -#define coff_rtype_to_howto coff_mips_rtype_to_howto - -#define coff_bfd_reloc_type_lookup coff_mips_reloc_type_lookup - -/* Get the howto structure for a generic reloc type. */ - -static reloc_howto_type * -coff_mips_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; -{ - int mips_type; - - switch (code) - { - case BFD_RELOC_16: - mips_type = MIPS_R_REFHALF; - break; - case BFD_RELOC_32: - case BFD_RELOC_CTOR: - mips_type = MIPS_R_REFWORD; - break; - case BFD_RELOC_MIPS_JMP: - mips_type = MIPS_R_JMPADDR; - break; - case BFD_RELOC_HI16_S: - mips_type = MIPS_R_REFHI; - break; - case BFD_RELOC_LO16: - mips_type = MIPS_R_REFLO; - break; - case BFD_RELOC_GPREL16: - mips_type = MIPS_R_GPREL; - break; - case BFD_RELOC_MIPS_LITERAL: - mips_type = MIPS_R_LITERAL; - break; -/* FIXME? - case BFD_RELOC_16_PCREL_S2: - mips_type = MIPS_R_PCREL16; - break; - case BFD_RELOC_PCREL_HI16_S: - mips_type = MIPS_R_RELHI; - break; - case BFD_RELOC_PCREL_LO16: - mips_type = MIPS_R_RELLO; - break; - case BFD_RELOC_GPREL32: - mips_type = MIPS_R_SWITCH; - break; -*/ - case BFD_RELOC_RVA: - mips_type = MIPS_R_RVA; - break; - default: - return (reloc_howto_type *) NULL; - } - - return &howto_table[mips_type]; -} - -static void -mips_swap_reloc_in (abfd, src, dst) - bfd *abfd; - PTR src; - PTR dst; -{ - static struct internal_reloc pair_prev; - RELOC *reloc_src = (RELOC *) src; - struct internal_reloc *reloc_dst = (struct internal_reloc *) dst; - - reloc_dst->r_vaddr = H_GET_32 (abfd, reloc_src->r_vaddr); - reloc_dst->r_symndx = H_GET_S32 (abfd, reloc_src->r_symndx); - reloc_dst->r_type = H_GET_16 (abfd, reloc_src->r_type); - reloc_dst->r_size = 0; - reloc_dst->r_extern = 0; - reloc_dst->r_offset = 0; - - switch (reloc_dst->r_type) - { - case MIPS_R_REFHI: - pair_prev = *reloc_dst; - break; - case MIPS_R_PAIR: - reloc_dst->r_offset = reloc_dst->r_symndx; - if (reloc_dst->r_offset & 0x8000) - reloc_dst->r_offset -= 0x10000; - /*printf ("dj: pair offset is %08x\n", reloc_dst->r_offset);*/ - reloc_dst->r_symndx = pair_prev.r_symndx; - break; - } -} - -static unsigned int -mips_swap_reloc_out (abfd, src, dst) - bfd *abfd; - PTR src; - PTR dst; -{ - static int prev_offset = 1; - static bfd_vma prev_addr = 0; - struct internal_reloc *reloc_src = (struct internal_reloc *)src; - struct external_reloc *reloc_dst = (struct external_reloc *)dst; - - switch (reloc_src->r_type) - { - case MIPS_R_REFHI: - prev_addr = reloc_src->r_vaddr; - prev_offset = reloc_src->r_offset; - break; - case MIPS_R_REFLO: - if (reloc_src->r_vaddr == prev_addr) - { - /* FIXME: only slightly hackish. If we see a REFLO pointing to - the same address as a REFHI, we assume this is the matching - PAIR reloc and output it accordingly. The symndx is really - the low 16 bits of the addend */ - H_PUT_32 (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr); - H_PUT_32 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx); - H_PUT_16 (abfd, MIPS_R_PAIR, reloc_dst->r_type); - return RELSZ; - } - break; - } - - H_PUT_32 (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr); - H_PUT_32 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx); - - H_PUT_16 (abfd, reloc_src->r_type, reloc_dst->r_type); - return RELSZ; -} - -#define coff_swap_reloc_in mips_swap_reloc_in -#define coff_swap_reloc_out mips_swap_reloc_out -#define NO_COFF_RELOCS - -static boolean -coff_pe_mips_relocate_section (output_bfd, info, input_bfd, - input_section, contents, relocs, syms, - sections) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - struct internal_reloc *relocs; - struct internal_syment *syms; - asection **sections; -{ - bfd_vma gp; - boolean gp_undefined; - size_t adjust; - struct internal_reloc *rel; - struct internal_reloc *rel_end; - unsigned int i; - boolean got_lo; - - if (info->relocateable) - { - (*_bfd_error_handler) (_("\ -%s: `ld -r' not supported with PE MIPS objects\n"), - bfd_archive_filename (input_bfd)); - bfd_set_error (bfd_error_bad_value); - return false; - } - - BFD_ASSERT (input_bfd->xvec->byteorder - == output_bfd->xvec->byteorder); - -#if 0 - printf ("dj: relocate %s(%s) %08x\n", - input_bfd->filename, input_section->name, - input_section->output_section->vma + input_section->output_offset); -#endif - - gp = _bfd_get_gp_value (output_bfd); - if (gp == 0) - gp_undefined = true; - else - gp_undefined = false; - - got_lo = false; - - adjust = 0; - - rel = relocs; - rel_end = rel + input_section->reloc_count; - for (i = 0; rel < rel_end; rel++, i++) - { - long symndx; - struct coff_link_hash_entry *h; - struct internal_syment *sym; - bfd_vma addend = 0; - bfd_vma val, tmp, targ, src, low; - reloc_howto_type *howto; - unsigned char *mem = contents + rel->r_vaddr; - - symndx = rel->r_symndx; - - if (symndx == -1) - { - h = NULL; - sym = NULL; - } - else - { - h = obj_coff_sym_hashes (input_bfd)[symndx]; - sym = syms + symndx; - } - - /* COFF treats common symbols in one of two ways. Either the - size of the symbol is included in the section contents, or it - is not. We assume that the size is not included, and force - the rtype_to_howto function to adjust the addend as needed. */ - - if (sym != NULL && sym->n_scnum != 0) - addend = - sym->n_value; - else - addend = 0; - - howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h, - sym, &addend); - if (howto == NULL) - return false; - - /* If we are doing a relocateable link, then we can just ignore - a PC relative reloc that is pcrel_offset. It will already - have the correct value. If this is not a relocateable link, - then we should ignore the symbol value. */ - if (howto->pc_relative && howto->pcrel_offset) - { - if (info->relocateable) - continue; - if (sym != NULL && sym->n_scnum != 0) - addend += sym->n_value; - } - - val = 0; - - if (h == NULL) - { - asection *sec; - - if (symndx == -1) - { - sec = bfd_abs_section_ptr; - val = 0; - } - else - { - sec = sections[symndx]; - val = (sec->output_section->vma - + sec->output_offset - + sym->n_value); - if (! obj_pe (input_bfd)) - val -= sec->vma; - } - } - else - { - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - asection *sec; - - sec = h->root.u.def.section; - val = (h->root.u.def.value - + sec->output_section->vma - + sec->output_offset); - } - - else if (! info->relocateable) - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, input_section, - rel->r_vaddr - input_section->vma, true))) - return false; - } - } - - src = rel->r_vaddr + input_section->output_section->vma - + input_section->output_offset; -#if 0 - printf ("dj: reloc %02x %-8s a=%08x/%08x(%08x) v=%08x+%08x %s\n", - rel->r_type, howto_table[rel->r_type].name, - src, rel->r_vaddr, *(unsigned long *)mem, val, rel->r_offset, - h?h->root.root.string:"(none)"); -#endif - - /* OK, at this point the following variables are set up: - src = VMA of the memory we're fixing up - mem = pointer to memory we're fixing up - val = VMA of what we need to refer to - */ - -#define UI(x) (*_bfd_error_handler) (_("%s: unimplemented %s\n"), \ - bfd_archive_filename (input_bfd), x); \ - bfd_set_error (bfd_error_bad_value); - - switch (rel->r_type) - { - case MIPS_R_ABSOLUTE: - /* ignore these */ - break; - - case MIPS_R_REFHALF: - UI("refhalf"); - break; - - case MIPS_R_REFWORD: - tmp = bfd_get_32(input_bfd, mem); - /* printf ("refword: src=%08x targ=%08x+%08x\n", src, tmp, val); */ - tmp += val; - bfd_put_32(input_bfd, tmp, mem); - break; - - case MIPS_R_JMPADDR: - tmp = bfd_get_32(input_bfd, mem); - targ = val + (tmp&0x03ffffff)*4; - if ((src & 0xf0000000) != (targ & 0xf0000000)) - { - (*_bfd_error_handler) (_("%s: jump too far away\n"), - bfd_archive_filename (input_bfd)); - bfd_set_error (bfd_error_bad_value); - return false; - } - tmp &= 0xfc000000; - tmp |= (targ/4) & 0x3ffffff; - bfd_put_32(input_bfd, tmp, mem); - break; - - case MIPS_R_REFHI: - tmp = bfd_get_32(input_bfd, mem); - switch (rel[1].r_type) - { - case MIPS_R_PAIR: - /* MS PE object */ - targ = val + rel[1].r_offset + ((tmp & 0xffff) << 16); - break; - case MIPS_R_REFLO: - /* GNU COFF object */ - low = bfd_get_32(input_bfd, contents + rel[1].r_vaddr); - low &= 0xffff; - if (low & 0x8000) - low -= 0x10000; - targ = val + low + ((tmp & 0xffff) << 16); - break; - default: - (*_bfd_error_handler) (_("%s: bad pair/reflo after refhi\n"), - bfd_archive_filename (input_bfd)); - bfd_set_error (bfd_error_bad_value); - return false; - } - tmp &= 0xffff0000; - tmp |= (targ >> 16) & 0xffff; - bfd_put_32(input_bfd, tmp, mem); - break; - - case MIPS_R_REFLO: - tmp = bfd_get_32(input_bfd, mem); - targ = val + (tmp & 0xffff); - /* printf ("refword: src=%08x targ=%08x\n", src, targ); */ - tmp &= 0xffff0000; - tmp |= targ & 0xffff; - bfd_put_32(input_bfd, tmp, mem); - break; - - case MIPS_R_GPREL: - case MIPS_R_LITERAL: - UI("gprel"); - break; - - case MIPS_R_SECTION: - UI("section"); - break; - - case MIPS_R_SECREL: - UI("secrel"); - break; - - case MIPS_R_SECRELLO: - UI("secrello"); - break; - - case MIPS_R_SECRELHI: - UI("secrelhi"); - break; - - case MIPS_R_RVA: - tmp = bfd_get_32 (input_bfd, mem); - /* printf ("rva: src=%08x targ=%08x+%08x\n", src, tmp, val); */ - tmp += val - - pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase; - bfd_put_32 (input_bfd, tmp, mem); - break; - - case MIPS_R_PAIR: - /* ignore these */ - break; - } - } - - return true; -} - -#define coff_relocate_section coff_pe_mips_relocate_section - -#ifdef TARGET_UNDERSCORE - -/* If mips gcc uses underscores for symbol names, then it does not use - a leading dot for local labels, so if TARGET_UNDERSCORE is defined - we treat all symbols starting with L as local. */ - -static boolean coff_mips_is_local_label_name PARAMS ((bfd *, const char *)); - -static boolean -coff_mips_is_local_label_name (abfd, name) - bfd *abfd; - const char *name; -{ - if (name[0] == 'L') - return true; - - return _bfd_coff_is_local_label_name (abfd, name); -} - -#define coff_bfd_is_local_label_name coff_mips_is_local_label_name - -#endif /* TARGET_UNDERSCORE */ - -#define COFF_NO_HACK_SCNHDR_SIZE - -#include "coffcode.h" - -const bfd_target -#ifdef TARGET_SYM - TARGET_SYM = -#else - mipslpe_vec = -#endif -{ -#ifdef TARGET_NAME - TARGET_NAME, -#else - "pe-mips", /* name */ -#endif - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* data byte order is little */ - BFD_ENDIAN_LITTLE, /* header byte order is little */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), - -#ifndef COFF_WITH_PE - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ - | SEC_CODE | SEC_DATA), -#else - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ - | SEC_CODE | SEC_DATA - | SEC_LINK_ONCE | SEC_LINK_DUPLICATES), -#endif - -#ifdef TARGET_UNDERSCORE - TARGET_UNDERSCORE, /* leading underscore */ -#else - 0, /* leading underscore */ -#endif - '/', /* 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 */ - -/* Note that we allow an object file to be treated as a core file as well. */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, coff_object_p}, - {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 (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - NULL, - - COFF_SWAP_TABLE -}; diff --git a/contrib/binutils/bfd/peicode.h b/contrib/binutils/bfd/peicode.h deleted file mode 100644 index 323b30d89d02..000000000000 --- a/contrib/binutils/bfd/peicode.h +++ /dev/null @@ -1,1309 +0,0 @@ -/* Support for the generic parts of PE/PEI, for BFD. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. - Written by Cygnus Solutions. - -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. */ - -/* -Most of this hacked by Steve Chamberlain, - sac@cygnus.com - -PE/PEI rearrangement (and code added): Donn Terry - Softway Systems, Inc. -*/ - -/* Hey look, some documentation [and in a place you expect to find it]! - - The main reference for the pei format is "Microsoft Portable Executable - and Common Object File Format Specification 4.1". Get it if you need to - do some serious hacking on this code. - - Another reference: - "Peering Inside the PE: A Tour of the Win32 Portable Executable - File Format", MSJ 1994, Volume 9. - - The *sole* difference between the pe format and the pei format is that the - latter has an MSDOS 2.0 .exe header on the front that prints the message - "This app must be run under Windows." (or some such). - (FIXME: Whether that statement is *really* true or not is unknown. - Are there more subtle differences between pe and pei formats? - For now assume there aren't. If you find one, then for God sakes - document it here!) - - The Microsoft docs use the word "image" instead of "executable" because - the former can also refer to a DLL (shared library). Confusion can arise - because the `i' in `pei' also refers to "image". The `pe' format can - also create images (i.e. executables), it's just that to run on a win32 - system you need to use the pei format. - - FIXME: Please add more docs here so the next poor fool that has to hack - on this code has a chance of getting something accomplished without - wasting too much time. -*/ - -#include "libpei.h" - -static boolean (*pe_saved_coff_bfd_print_private_bfd_data) - PARAMS ((bfd *, PTR)) = -#ifndef coff_bfd_print_private_bfd_data - NULL; -#else - coff_bfd_print_private_bfd_data; -#undef coff_bfd_print_private_bfd_data -#endif - -static boolean pe_print_private_bfd_data PARAMS ((bfd *, PTR)); -#define coff_bfd_print_private_bfd_data pe_print_private_bfd_data - -static boolean (*pe_saved_coff_bfd_copy_private_bfd_data) - PARAMS ((bfd *, bfd *)) = -#ifndef coff_bfd_copy_private_bfd_data - NULL; -#else - coff_bfd_copy_private_bfd_data; -#undef coff_bfd_copy_private_bfd_data -#endif - -static boolean pe_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *)); -#define coff_bfd_copy_private_bfd_data pe_bfd_copy_private_bfd_data - -#define coff_mkobject pe_mkobject -#define coff_mkobject_hook pe_mkobject_hook - -#ifndef NO_COFF_RELOCS -static void coff_swap_reloc_in PARAMS ((bfd *, PTR, PTR)); -static unsigned int coff_swap_reloc_out PARAMS ((bfd *, PTR, PTR)); -#endif -static void coff_swap_filehdr_in PARAMS ((bfd *, PTR, PTR)); -static void coff_swap_scnhdr_in PARAMS ((bfd *, PTR, PTR)); -static boolean pe_mkobject PARAMS ((bfd *)); -static PTR pe_mkobject_hook PARAMS ((bfd *, PTR, PTR)); - -#ifdef COFF_IMAGE_WITH_PE -/* This structure contains static variables used by the ILF code. */ -typedef asection * asection_ptr; - -typedef struct -{ - bfd * abfd; - bfd_byte * data; - struct bfd_in_memory * bim; - unsigned short magic; - - arelent * reltab; - unsigned int relcount; - - coff_symbol_type * sym_cache; - coff_symbol_type * sym_ptr; - unsigned int sym_index; - - unsigned int * sym_table; - unsigned int * table_ptr; - - combined_entry_type * native_syms; - combined_entry_type * native_ptr; - - coff_symbol_type ** sym_ptr_table; - coff_symbol_type ** sym_ptr_ptr; - - unsigned int sec_index; - - char * string_table; - char * string_ptr; - char * end_string_ptr; - - SYMENT * esym_table; - SYMENT * esym_ptr; - - struct internal_reloc * int_reltab; -} -pe_ILF_vars; - -static asection_ptr pe_ILF_make_a_section PARAMS ((pe_ILF_vars *, const char *, unsigned int, flagword)); -static void pe_ILF_make_a_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, asection_ptr)); -static void pe_ILF_make_a_symbol PARAMS ((pe_ILF_vars *, const char *, const char *, asection_ptr, flagword)); -static void pe_ILF_save_relocs PARAMS ((pe_ILF_vars *, asection_ptr)); -static void pe_ILF_make_a_symbol_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, struct symbol_cache_entry **, unsigned int)); -static boolean pe_ILF_build_a_bfd PARAMS ((bfd *, unsigned int, bfd_byte *, bfd_byte *, unsigned int, unsigned int)); -static const bfd_target * pe_ILF_object_p PARAMS ((bfd *)); -static const bfd_target * pe_bfd_object_p PARAMS ((bfd *)); -#endif /* COFF_IMAGE_WITH_PE */ - -/**********************************************************************/ - -#ifndef NO_COFF_RELOCS -static void -coff_swap_reloc_in (abfd, src, dst) - bfd *abfd; - PTR src; - PTR dst; -{ - RELOC *reloc_src = (RELOC *) src; - struct internal_reloc *reloc_dst = (struct internal_reloc *) dst; - - reloc_dst->r_vaddr = H_GET_32 (abfd, reloc_src->r_vaddr); - reloc_dst->r_symndx = H_GET_S32 (abfd, reloc_src->r_symndx); - - reloc_dst->r_type = H_GET_16 (abfd, reloc_src->r_type); - -#ifdef SWAP_IN_RELOC_OFFSET - reloc_dst->r_offset = SWAP_IN_RELOC_OFFSET (abfd, reloc_src->r_offset); -#endif -} - -static unsigned int -coff_swap_reloc_out (abfd, src, dst) - bfd *abfd; - PTR src; - PTR dst; -{ - struct internal_reloc *reloc_src = (struct internal_reloc *)src; - struct external_reloc *reloc_dst = (struct external_reloc *)dst; - H_PUT_32 (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr); - H_PUT_32 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx); - - H_PUT_16 (abfd, reloc_src->r_type, reloc_dst->r_type); - -#ifdef SWAP_OUT_RELOC_OFFSET - SWAP_OUT_RELOC_OFFSET (abfd, reloc_src->r_offset, reloc_dst->r_offset); -#endif -#ifdef SWAP_OUT_RELOC_EXTRA - SWAP_OUT_RELOC_EXTRA(abfd, reloc_src, reloc_dst); -#endif - return RELSZ; -} -#endif /* not NO_COFF_RELOCS */ - -static void -coff_swap_filehdr_in (abfd, src, dst) - bfd *abfd; - PTR src; - PTR dst; -{ - FILHDR *filehdr_src = (FILHDR *) src; - struct internal_filehdr *filehdr_dst = (struct internal_filehdr *) dst; - filehdr_dst->f_magic = H_GET_16 (abfd, filehdr_src->f_magic); - filehdr_dst->f_nscns = H_GET_16 (abfd, filehdr_src-> f_nscns); - filehdr_dst->f_timdat = H_GET_32 (abfd, filehdr_src-> f_timdat); - - filehdr_dst->f_nsyms = H_GET_32 (abfd, filehdr_src-> f_nsyms); - filehdr_dst->f_flags = H_GET_16 (abfd, filehdr_src-> f_flags); - filehdr_dst->f_symptr = H_GET_32 (abfd, filehdr_src->f_symptr); - - /* Other people's tools sometimes generate headers with an nsyms but - a zero symptr. */ - if (filehdr_dst->f_nsyms != 0 && filehdr_dst->f_symptr == 0) - { - filehdr_dst->f_nsyms = 0; - filehdr_dst->f_flags |= F_LSYMS; - } - - filehdr_dst->f_opthdr = H_GET_16 (abfd, filehdr_src-> f_opthdr); -} - -#ifdef COFF_IMAGE_WITH_PE -# define coff_swap_filehdr_out _bfd_XXi_only_swap_filehdr_out -#else -# define coff_swap_filehdr_out _bfd_pe_only_swap_filehdr_out -#endif - -static void -coff_swap_scnhdr_in (abfd, ext, in) - bfd *abfd; - PTR ext; - PTR in; -{ - SCNHDR *scnhdr_ext = (SCNHDR *) ext; - struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in; - - memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof (scnhdr_int->s_name)); - scnhdr_int->s_vaddr = GET_SCNHDR_VADDR (abfd, scnhdr_ext->s_vaddr); - scnhdr_int->s_paddr = GET_SCNHDR_PADDR (abfd, scnhdr_ext->s_paddr); - scnhdr_int->s_size = GET_SCNHDR_SIZE (abfd, scnhdr_ext->s_size); - scnhdr_int->s_scnptr = GET_SCNHDR_SCNPTR (abfd, scnhdr_ext->s_scnptr); - scnhdr_int->s_relptr = GET_SCNHDR_RELPTR (abfd, scnhdr_ext->s_relptr); - scnhdr_int->s_lnnoptr = GET_SCNHDR_LNNOPTR (abfd, scnhdr_ext->s_lnnoptr); - scnhdr_int->s_flags = H_GET_32 (abfd, scnhdr_ext->s_flags); - - /* MS handles overflow of line numbers by carrying into the reloc - field (it appears). Since it's supposed to be zero for PE - *IMAGE* format, that's safe. This is still a bit iffy. */ -#ifdef COFF_IMAGE_WITH_PE - scnhdr_int->s_nlnno = (H_GET_16 (abfd, scnhdr_ext->s_nlnno) - + (H_GET_16 (abfd, scnhdr_ext->s_nreloc) << 16)); - scnhdr_int->s_nreloc = 0; -#else - scnhdr_int->s_nreloc = H_GET_16 (abfd, scnhdr_ext->s_nreloc); - scnhdr_int->s_nlnno = H_GET_16 (abfd, scnhdr_ext->s_nlnno); -#endif - - if (scnhdr_int->s_vaddr != 0) - { - scnhdr_int->s_vaddr += pe_data (abfd)->pe_opthdr.ImageBase; - scnhdr_int->s_vaddr &= 0xffffffff; - } - -#ifndef COFF_NO_HACK_SCNHDR_SIZE - /* If this section holds uninitialized data, use the virtual size - (stored in s_paddr) instead of the physical size. */ - if ((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0 - && (scnhdr_int->s_paddr > 0)) - { - scnhdr_int->s_size = scnhdr_int->s_paddr; - /* This code used to set scnhdr_int->s_paddr to 0. However, - coff_set_alignment_hook stores s_paddr in virt_size, which - only works if it correctly holds the virtual size of the - section. */ - } -#endif -} - -static boolean -pe_mkobject (abfd) - bfd * abfd; -{ - pe_data_type *pe; - bfd_size_type amt = sizeof (pe_data_type); - - abfd->tdata.pe_obj_data = (struct pe_tdata *) bfd_zalloc (abfd, amt); - - if (abfd->tdata.pe_obj_data == 0) - return false; - - pe = pe_data (abfd); - - pe->coff.pe = 1; - - /* in_reloc_p is architecture dependent. */ - pe->in_reloc_p = in_reloc_p; - -#ifdef PEI_FORCE_MINIMUM_ALIGNMENT - pe->force_minimum_alignment = 1; -#endif -#ifdef PEI_TARGET_SUBSYSTEM - pe->target_subsystem = PEI_TARGET_SUBSYSTEM; -#endif - - return true; -} - -/* Create the COFF backend specific information. */ -static PTR -pe_mkobject_hook (abfd, filehdr, aouthdr) - bfd * abfd; - PTR filehdr; - PTR aouthdr ATTRIBUTE_UNUSED; -{ - struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; - pe_data_type *pe; - - if (pe_mkobject (abfd) == false) - return NULL; - - pe = pe_data (abfd); - pe->coff.sym_filepos = internal_f->f_symptr; - /* These members communicate important constants about the symbol - table to GDB's symbol-reading code. These `constants' - unfortunately vary among coff implementations... */ - pe->coff.local_n_btmask = N_BTMASK; - pe->coff.local_n_btshft = N_BTSHFT; - pe->coff.local_n_tmask = N_TMASK; - pe->coff.local_n_tshift = N_TSHIFT; - pe->coff.local_symesz = SYMESZ; - pe->coff.local_auxesz = AUXESZ; - pe->coff.local_linesz = LINESZ; - - pe->coff.timestamp = internal_f->f_timdat; - - obj_raw_syment_count (abfd) = - obj_conv_table_size (abfd) = - internal_f->f_nsyms; - - pe->real_flags = internal_f->f_flags; - - if ((internal_f->f_flags & F_DLL) != 0) - pe->dll = 1; - - if ((internal_f->f_flags & IMAGE_FILE_DEBUG_STRIPPED) == 0) - abfd->flags |= HAS_DEBUG; - -#ifdef COFF_IMAGE_WITH_PE - if (aouthdr) - pe->pe_opthdr = ((struct internal_aouthdr *)aouthdr)->pe; -#endif - -#ifdef ARM - if (! _bfd_coff_arm_set_private_flags (abfd, internal_f->f_flags)) - coff_data (abfd) ->flags = 0; -#endif - - return (PTR) pe; -} - -static boolean -pe_print_private_bfd_data (abfd, vfile) - bfd *abfd; - PTR vfile; -{ - FILE *file = (FILE *) vfile; - - if (!_bfd_XX_print_private_bfd_data_common (abfd, vfile)) - return false; - - if (pe_saved_coff_bfd_print_private_bfd_data != NULL) - { - fputc ('\n', file); - - return pe_saved_coff_bfd_print_private_bfd_data (abfd, vfile); - } - - return true; -} - -/* Copy any private info we understand from the input bfd - to the output bfd. */ - -static boolean -pe_bfd_copy_private_bfd_data (ibfd, obfd) - bfd *ibfd, *obfd; -{ - if (!_bfd_XX_bfd_copy_private_bfd_data_common (ibfd, obfd)) - return false; - - if (pe_saved_coff_bfd_copy_private_bfd_data) - return pe_saved_coff_bfd_copy_private_bfd_data (ibfd, obfd); - - return true; -} - -#define coff_bfd_copy_private_section_data \ - _bfd_XX_bfd_copy_private_section_data - -#define coff_get_symbol_info _bfd_XX_get_symbol_info - -#ifdef COFF_IMAGE_WITH_PE - -/* Code to handle Microsoft's Image Library Format. - Also known as LINK6 format. - Documentation about this format can be found at: - - http://msdn.microsoft.com/library/specs/pecoff_section8.htm */ - -/* The following constants specify the sizes of the various data - structures that we have to create in order to build a bfd describing - an ILF object file. The final "+ 1" in the definitions of SIZEOF_IDATA6 - and SIZEOF_IDATA7 below is to allow for the possibility that we might - need a padding byte in order to ensure 16 bit alignment for the section's - contents. - - The value for SIZEOF_ILF_STRINGS is computed as follows: - - There will be NUM_ILF_SECTIONS section symbols. Allow 9 characters - per symbol for their names (longest section name is .idata$x). - - There will be two symbols for the imported value, one the symbol name - and one with _imp__ prefixed. Allowing for the terminating nul's this - is strlen (symbol_name) * 2 + 8 + 21 + strlen (source_dll). - - The strings in the string table must start STRING__SIZE_SIZE bytes into - the table in order to for the string lookup code in coffgen/coffcode to - work. */ -#define NUM_ILF_RELOCS 8 -#define NUM_ILF_SECTIONS 6 -#define NUM_ILF_SYMS (2 + NUM_ILF_SECTIONS) - -#define SIZEOF_ILF_SYMS (NUM_ILF_SYMS * sizeof (* vars.sym_cache)) -#define SIZEOF_ILF_SYM_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_table)) -#define SIZEOF_ILF_NATIVE_SYMS (NUM_ILF_SYMS * sizeof (* vars.native_syms)) -#define SIZEOF_ILF_SYM_PTR_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_ptr_table)) -#define SIZEOF_ILF_EXT_SYMS (NUM_ILF_SYMS * sizeof (* vars.esym_table)) -#define SIZEOF_ILF_RELOCS (NUM_ILF_RELOCS * sizeof (* vars.reltab)) -#define SIZEOF_ILF_INT_RELOCS (NUM_ILF_RELOCS * sizeof (* vars.int_reltab)) -#define SIZEOF_ILF_STRINGS (strlen (symbol_name) * 2 + 8 \ - + 21 + strlen (source_dll) \ - + NUM_ILF_SECTIONS * 9 \ - + STRING_SIZE_SIZE) -#define SIZEOF_IDATA2 (5 * 4) -#define SIZEOF_IDATA4 (1 * 4) -#define SIZEOF_IDATA5 (1 * 4) -#define SIZEOF_IDATA6 (2 + strlen (symbol_name) + 1 + 1) -#define SIZEOF_IDATA7 (strlen (source_dll) + 1 + 1) -#define SIZEOF_ILF_SECTIONS (NUM_ILF_SECTIONS * sizeof (struct coff_section_tdata)) - -#define ILF_DATA_SIZE \ - sizeof (* vars.bim) \ - + SIZEOF_ILF_SYMS \ - + SIZEOF_ILF_SYM_TABLE \ - + SIZEOF_ILF_NATIVE_SYMS \ - + SIZEOF_ILF_SYM_PTR_TABLE \ - + SIZEOF_ILF_EXT_SYMS \ - + SIZEOF_ILF_RELOCS \ - + SIZEOF_ILF_INT_RELOCS \ - + SIZEOF_ILF_STRINGS \ - + SIZEOF_IDATA2 \ - + SIZEOF_IDATA4 \ - + SIZEOF_IDATA5 \ - + SIZEOF_IDATA6 \ - + SIZEOF_IDATA7 \ - + SIZEOF_ILF_SECTIONS \ - + MAX_TEXT_SECTION_SIZE - -/* Create an empty relocation against the given symbol. */ -static void -pe_ILF_make_a_symbol_reloc (pe_ILF_vars * vars, - bfd_vma address, - bfd_reloc_code_real_type reloc, - struct symbol_cache_entry ** sym, - unsigned int sym_index) -{ - arelent * entry; - struct internal_reloc * internal; - - entry = vars->reltab + vars->relcount; - internal = vars->int_reltab + vars->relcount; - - entry->address = address; - entry->addend = 0; - entry->howto = bfd_reloc_type_lookup (vars->abfd, reloc); - entry->sym_ptr_ptr = sym; - - internal->r_vaddr = address; - internal->r_symndx = sym_index; - internal->r_type = entry->howto->type; -#if 0 /* These fields do not need to be initialised. */ - internal->r_size = 0; - internal->r_extern = 0; - internal->r_offset = 0; -#endif - - vars->relcount ++; - - BFD_ASSERT (vars->relcount <= NUM_ILF_RELOCS); -} - -/* Create an empty relocation against the given section. */ -static void -pe_ILF_make_a_reloc (pe_ILF_vars * vars, - bfd_vma address, - bfd_reloc_code_real_type reloc, - asection_ptr sec) -{ - pe_ILF_make_a_symbol_reloc (vars, address, reloc, sec->symbol_ptr_ptr, - coff_section_data (vars->abfd, sec)->i); -} - -/* Move the queued relocs into the given section. */ -static void -pe_ILF_save_relocs (pe_ILF_vars * vars, - asection_ptr sec) -{ - /* Make sure that there is somewhere to store the internal relocs. */ - if (coff_section_data (vars->abfd, sec) == NULL) - /* We should probably return an error indication here. */ - abort (); - - coff_section_data (vars->abfd, sec)->relocs = vars->int_reltab; - coff_section_data (vars->abfd, sec)->keep_relocs = true; - - sec->relocation = vars->reltab; - sec->reloc_count = vars->relcount; - sec->flags |= SEC_RELOC; - - vars->reltab += vars->relcount; - vars->int_reltab += vars->relcount; - vars->relcount = 0; - - BFD_ASSERT ((bfd_byte *) vars->int_reltab < (bfd_byte *) vars->string_table); -} - -/* Create a global symbol and add it to the relevant tables. */ -static void -pe_ILF_make_a_symbol (pe_ILF_vars * vars, - const char * prefix, - const char * symbol_name, - asection_ptr section, - flagword extra_flags) -{ - coff_symbol_type * sym; - combined_entry_type * ent; - SYMENT * esym; - unsigned short sclass; - - if (extra_flags & BSF_LOCAL) - sclass = C_STAT; - else - sclass = C_EXT; - -#ifdef THUMBPEMAGIC - if (vars->magic == THUMBPEMAGIC) - { - if (extra_flags & BSF_FUNCTION) - sclass = C_THUMBEXTFUNC; - else if (extra_flags & BSF_LOCAL) - sclass = C_THUMBSTAT; - else - sclass = C_THUMBEXT; - } -#endif - - BFD_ASSERT (vars->sym_index < NUM_ILF_SYMS); - - sym = vars->sym_ptr; - ent = vars->native_ptr; - esym = vars->esym_ptr; - - /* Copy the symbol's name into the string table. */ - sprintf (vars->string_ptr, "%s%s", prefix, symbol_name); - - if (section == NULL) - section = (asection_ptr) & bfd_und_section; - - /* Initialise the external symbol. */ - H_PUT_32 (vars->abfd, vars->string_ptr - vars->string_table, - esym->e.e.e_offset); - H_PUT_16 (vars->abfd, section->target_index, esym->e_scnum); - esym->e_sclass[0] = sclass; - - /* The following initialisations are unnecessary - the memory is - zero initialised. They are just kept here as reminders. */ -#if 0 - esym->e.e.e_zeroes = 0; - esym->e_value = 0; - esym->e_type = T_NULL; - esym->e_numaux = 0; -#endif - - /* Initialise the internal symbol structure. */ - ent->u.syment.n_sclass = sclass; - ent->u.syment.n_scnum = section->target_index; - ent->u.syment._n._n_n._n_offset = (long) sym; - -#if 0 /* See comment above. */ - ent->u.syment.n_value = 0; - ent->u.syment.n_flags = 0; - ent->u.syment.n_type = T_NULL; - ent->u.syment.n_numaux = 0; - ent->fix_value = 0; -#endif - - sym->symbol.the_bfd = vars->abfd; - sym->symbol.name = vars->string_ptr; - sym->symbol.flags = BSF_EXPORT | BSF_GLOBAL | extra_flags; - sym->symbol.section = section; - sym->native = ent; - -#if 0 /* See comment above. */ - sym->symbol.value = 0; - sym->symbol.udata.i = 0; - sym->done_lineno = false; - sym->lineno = NULL; -#endif - - * vars->table_ptr = vars->sym_index; - * vars->sym_ptr_ptr = sym; - - /* Adjust pointers for the next symbol. */ - vars->sym_index ++; - vars->sym_ptr ++; - vars->sym_ptr_ptr ++; - vars->table_ptr ++; - vars->native_ptr ++; - vars->esym_ptr ++; - vars->string_ptr += strlen (symbol_name) + strlen (prefix) + 1; - - BFD_ASSERT (vars->string_ptr < vars->end_string_ptr); -} - -/* Create a section. */ -static asection_ptr -pe_ILF_make_a_section (pe_ILF_vars * vars, - const char * name, - unsigned int size, - flagword extra_flags) -{ - asection_ptr sec; - flagword flags; - - sec = bfd_make_section_old_way (vars->abfd, name); - if (sec == NULL) - return NULL; - - flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_KEEP | SEC_IN_MEMORY; - - bfd_set_section_flags (vars->abfd, sec, flags | extra_flags); - - bfd_set_section_alignment (vars->abfd, sec, 2); - - /* Check that we will not run out of space. */ - BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size); - - /* Set the section size and contents. The actual - contents are filled in by our parent. */ - bfd_set_section_size (vars->abfd, sec, (bfd_size_type) size); - sec->contents = vars->data; - sec->target_index = vars->sec_index ++; - - /* Advance data pointer in the vars structure. */ - vars->data += size; - - /* Skip the padding byte if it was not needed. - The logic here is that if the string length is odd, - then the entire string length, including the null byte, - is even and so the extra, padding byte, is not needed. */ - if (size & 1) - vars->data --; - - /* Create a coff_section_tdata structure for our use. */ - sec->used_by_bfd = (struct coff_section_tdata *) vars->data; - vars->data += sizeof (struct coff_section_tdata); - - BFD_ASSERT (vars->data <= vars->bim->buffer + vars->bim->size); - - /* Create a symbol to refer to this section. */ - pe_ILF_make_a_symbol (vars, "", name, sec, BSF_LOCAL); - - /* Cache the index to the symbol in the coff_section_data structure. */ - coff_section_data (vars->abfd, sec)->i = vars->sym_index - 1; - - return sec; -} - -/* This structure contains the code that goes into the .text section - in order to perform a jump into the DLL lookup table. The entries - in the table are index by the magic number used to represent the - machine type in the PE file. The contents of the data[] arrays in - these entries are stolen from the jtab[] arrays in ld/pe-dll.c. - The SIZE field says how many bytes in the DATA array are actually - used. The OFFSET field says where in the data array the address - of the .idata$5 section should be placed. */ -#define MAX_TEXT_SECTION_SIZE 32 - -typedef struct -{ - unsigned short magic; - unsigned char data[MAX_TEXT_SECTION_SIZE]; - unsigned int size; - unsigned int offset; -} -jump_table; - -static jump_table jtab[] = -{ -#ifdef I386MAGIC - { I386MAGIC, - { 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90 }, - 8, 2 - }, -#endif - -#ifdef MC68MAGIC - { MC68MAGIC, { /* XXX fill me in */ }, 0, 0 }, -#endif -#ifdef MIPS_ARCH_MAGIC_WINCE - { MIPS_ARCH_MAGIC_WINCE, - { 0x00, 0x00, 0x08, 0x3c, 0x00, 0x00, 0x08, 0x8d, - 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 }, - 16, 0 - }, -#endif - -#ifdef SH_ARCH_MAGIC_WINCE - { SH_ARCH_MAGIC_WINCE, - { 0x01, 0xd0, 0x02, 0x60, 0x2b, 0x40, - 0x09, 0x00, 0x00, 0x00, 0x00, 0x00 }, - 12, 8 - }, -#endif - -#ifdef ARMPEMAGIC - { ARMPEMAGIC, - { 0x00, 0xc0, 0x9f, 0xe5, 0x00, 0xf0, - 0x9c, 0xe5, 0x00, 0x00, 0x00, 0x00}, - 12, 8 - }, -#endif - -#ifdef THUMBPEMAGIC - { THUMBPEMAGIC, - { 0x40, 0xb4, 0x02, 0x4e, 0x36, 0x68, 0xb4, 0x46, - 0x40, 0xbc, 0x60, 0x47, 0x00, 0x00, 0x00, 0x00 }, - 16, 12 - }, -#endif - { 0, { 0 }, 0, 0 } -}; - -#ifndef NUM_ENTRIES -#define NUM_ENTRIES(a) (sizeof (a) / sizeof (a)[0]) -#endif - -/* Build a full BFD from the information supplied in a ILF object. */ -static boolean -pe_ILF_build_a_bfd (bfd * abfd, - unsigned int magic, - bfd_byte * symbol_name, - bfd_byte * source_dll, - unsigned int ordinal, - unsigned int types) -{ - bfd_byte * ptr; - pe_ILF_vars vars; - struct internal_filehdr internal_f; - unsigned int import_type; - unsigned int import_name_type; - asection_ptr id4, id5, id6 = NULL, text = NULL; - coff_symbol_type ** imp_sym; - unsigned int imp_index; - - /* Decode and verify the types field of the ILF structure. */ - import_type = types & 0x3; - import_name_type = (types & 0x1c) >> 2; - - switch (import_type) - { - case IMPORT_CODE: - case IMPORT_DATA: - break; - - case IMPORT_CONST: - /* XXX code yet to be written. */ - _bfd_error_handler (_("%s: Unhandled import type; %x"), - bfd_archive_filename (abfd), import_type); - return false; - - default: - _bfd_error_handler (_("%s: Unrecognised import type; %x"), - bfd_archive_filename (abfd), import_type); - return false; - } - - switch (import_name_type) - { - case IMPORT_ORDINAL: - case IMPORT_NAME: - case IMPORT_NAME_NOPREFIX: - case IMPORT_NAME_UNDECORATE: - break; - - default: - _bfd_error_handler (_("%s: Unrecognised import name type; %x"), - bfd_archive_filename (abfd), import_name_type); - return false; - } - - /* Initialise local variables. - - Note these are kept in a structure rather than being - declared as statics since bfd frowns on global variables. - - We are going to construct the contents of the BFD in memory, - so allocate all the space that we will need right now. */ - ptr = bfd_zalloc (abfd, (bfd_size_type) ILF_DATA_SIZE); - if (ptr == NULL) - return false; - - /* Create a bfd_in_memory structure. */ - vars.bim = (struct bfd_in_memory *) ptr; - vars.bim->buffer = ptr; - vars.bim->size = ILF_DATA_SIZE; - ptr += sizeof (* vars.bim); - - /* Initialise the pointers to regions of the memory and the - other contents of the pe_ILF_vars structure as well. */ - vars.sym_cache = (coff_symbol_type *) ptr; - vars.sym_ptr = (coff_symbol_type *) ptr; - vars.sym_index = 0; - ptr += SIZEOF_ILF_SYMS; - - vars.sym_table = (unsigned int *) ptr; - vars.table_ptr = (unsigned int *) ptr; - ptr += SIZEOF_ILF_SYM_TABLE; - - vars.native_syms = (combined_entry_type *) ptr; - vars.native_ptr = (combined_entry_type *) ptr; - ptr += SIZEOF_ILF_NATIVE_SYMS; - - vars.sym_ptr_table = (coff_symbol_type **) ptr; - vars.sym_ptr_ptr = (coff_symbol_type **) ptr; - ptr += SIZEOF_ILF_SYM_PTR_TABLE; - - vars.esym_table = (SYMENT *) ptr; - vars.esym_ptr = (SYMENT *) ptr; - ptr += SIZEOF_ILF_EXT_SYMS; - - vars.reltab = (arelent *) ptr; - vars.relcount = 0; - ptr += SIZEOF_ILF_RELOCS; - - vars.int_reltab = (struct internal_reloc *) ptr; - ptr += SIZEOF_ILF_INT_RELOCS; - - vars.string_table = ptr; - vars.string_ptr = ptr + STRING_SIZE_SIZE; - ptr += SIZEOF_ILF_STRINGS; - vars.end_string_ptr = ptr; - - /* The remaining space in bim->buffer is used - by the pe_ILF_make_a_section() function. */ - vars.data = ptr; - vars.abfd = abfd; - vars.sec_index = 0; - vars.magic = magic; - - /* Create the initial .idata$<n> sections: - [.idata$2: Import Directory Table -- not needed] - .idata$4: Import Lookup Table - .idata$5: Import Address Table - - Note we do not create a .idata$3 section as this is - created for us by the linker script. */ - id4 = pe_ILF_make_a_section (& vars, ".idata$4", SIZEOF_IDATA4, 0); - id5 = pe_ILF_make_a_section (& vars, ".idata$5", SIZEOF_IDATA5, 0); - if (id4 == NULL || id5 == NULL) - return false; - - /* Fill in the contents of these sections. */ - if (import_name_type == IMPORT_ORDINAL) - { - if (ordinal == 0) - /* XXX - treat as IMPORT_NAME ??? */ - abort (); - - * (unsigned int *) id4->contents = ordinal | 0x80000000; - * (unsigned int *) id5->contents = ordinal | 0x80000000; - } - else - { - char * symbol; - - /* Create .idata$6 - the Hint Name Table. */ - id6 = pe_ILF_make_a_section (& vars, ".idata$6", SIZEOF_IDATA6, 0); - if (id6 == NULL) - return false; - - /* If necessary, trim the import symbol name. */ - symbol = symbol_name; - - if (import_name_type != IMPORT_NAME) - /* Skip any prefix in symbol_name. */ - while (*symbol == '@' || * symbol == '?' || * symbol == '_') - ++ symbol; - - if (import_name_type == IMPORT_NAME_UNDECORATE) - { - /* Truncate at the first '@' */ - while (* symbol != 0 && * symbol != '@') - symbol ++; - - * symbol = 0; - } - - id6->contents[0] = ordinal & 0xff; - id6->contents[1] = ordinal >> 8; - - strcpy (id6->contents + 2, symbol); - } - - if (import_name_type != IMPORT_ORDINAL) - { - pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_RVA, id6); - pe_ILF_save_relocs (&vars, id4); - - pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_RVA, id6); - pe_ILF_save_relocs (&vars, id5); - } - - /* Create extra sections depending upon the type of import we are dealing with. */ - switch (import_type) - { - int i; - - case IMPORT_CODE: - /* Create a .text section. - First we need to look up its contents in the jump table. */ - for (i = NUM_ENTRIES (jtab); i--;) - { - if (jtab[i].size == 0) - continue; - if (jtab[i].magic == magic) - break; - } - /* If we did not find a matching entry something is wrong. */ - if (i < 0) - abort (); - - /* Create the .text section. */ - text = pe_ILF_make_a_section (& vars, ".text", jtab[i].size, SEC_CODE); - if (text == NULL) - return false; - - /* Copy in the jump code. */ - memcpy (text->contents, jtab[i].data, jtab[i].size); - - /* Create an import symbol. */ - pe_ILF_make_a_symbol (& vars, "__imp_", symbol_name, id5, 0); - imp_sym = vars.sym_ptr_ptr - 1; - imp_index = vars.sym_index - 1; - - /* Create a reloc for the data in the text section. */ -#ifdef MIPS_ARCH_MAGIC_WINCE - if (magic == MIPS_ARCH_MAGIC_WINCE) - { - pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 0, BFD_RELOC_HI16_S, - (struct symbol_cache_entry **) imp_sym, - imp_index); - pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_LO16, text); - pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 4, BFD_RELOC_LO16, - (struct symbol_cache_entry **) imp_sym, - imp_index); - } - else -#endif - pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) jtab[i].offset, - BFD_RELOC_32, (asymbol **) imp_sym, - imp_index); - - pe_ILF_save_relocs (& vars, text); - break; - - case IMPORT_DATA: - break; - - default: - /* XXX code not yet written. */ - abort (); - } - - /* Initialise the bfd. */ - memset (& internal_f, 0, sizeof (internal_f)); - - internal_f.f_magic = magic; - internal_f.f_symptr = 0; - internal_f.f_nsyms = 0; - internal_f.f_flags = F_AR32WR | F_LNNO; /* XXX is this correct ? */ - - if ( ! bfd_set_start_address (abfd, (bfd_vma) 0) - || ! bfd_coff_set_arch_mach_hook (abfd, & internal_f)) - return false; - - if (bfd_coff_mkobject_hook (abfd, (PTR) & internal_f, NULL) == NULL) - return false; - - coff_data (abfd)->pe = 1; -#ifdef THUMBPEMAGIC - if (vars.magic == THUMBPEMAGIC) - /* Stop some linker warnings about thumb code not supporting interworking. */ - coff_data (abfd)->flags |= F_INTERWORK | F_INTERWORK_SET; -#endif - - /* Switch from file contents to memory contents. */ - bfd_cache_close (abfd); - - abfd->iostream = (PTR) vars.bim; - abfd->flags |= BFD_IN_MEMORY /* | HAS_LOCALS */; - abfd->where = 0; - obj_sym_filepos (abfd) = 0; - - /* Now create a symbol describing the imported value. */ - switch (import_type) - { - case IMPORT_CODE: - pe_ILF_make_a_symbol (& vars, "", symbol_name, text, - BSF_NOT_AT_END | BSF_FUNCTION); - - /* Create an import symbol for the DLL, without the - .dll suffix. */ - ptr = strrchr (source_dll, '.'); - if (ptr) - * ptr = 0; - pe_ILF_make_a_symbol (& vars, "__IMPORT_DESCRIPTOR_", source_dll, NULL, 0); - if (ptr) - * ptr = '.'; - break; - - case IMPORT_DATA: - /* Nothing to do here. */ - break; - - default: - /* XXX code not yet written. */ - abort (); - } - - /* Point the bfd at the symbol table. */ - obj_symbols (abfd) = vars.sym_cache; - bfd_get_symcount (abfd) = vars.sym_index; - - obj_raw_syments (abfd) = vars.native_syms; - obj_raw_syment_count (abfd) = vars.sym_index; - - obj_coff_external_syms (abfd) = (PTR) vars.esym_table; - obj_coff_keep_syms (abfd) = true; - - obj_convert (abfd) = vars.sym_table; - obj_conv_table_size (abfd) = vars.sym_index; - - obj_coff_strings (abfd) = vars.string_table; - obj_coff_keep_strings (abfd) = true; - - abfd->flags |= HAS_SYMS; - - return true; -} - -/* We have detected a Image Library Format archive element. - Decode the element and return the appropriate target. */ -static const bfd_target * -pe_ILF_object_p (bfd * abfd) -{ - bfd_byte buffer[16]; - bfd_byte * ptr; - bfd_byte * symbol_name; - bfd_byte * source_dll; - unsigned int machine; - bfd_size_type size; - unsigned int ordinal; - unsigned int types; - unsigned int magic; - - /* Upon entry the first four buyes of the ILF header have - already been read. Now read the rest of the header. */ - if (bfd_bread (buffer, (bfd_size_type) 16, abfd) != 16) - return NULL; - - ptr = buffer; - - /* We do not bother to check the version number. - version = H_GET_16 (abfd, ptr); */ - ptr += 2; - - machine = H_GET_16 (abfd, ptr); - ptr += 2; - - /* Check that the machine type is recognised. */ - magic = 0; - - switch (machine) - { - case IMAGE_FILE_MACHINE_UNKNOWN: - case IMAGE_FILE_MACHINE_ALPHA: - case IMAGE_FILE_MACHINE_ALPHA64: - case IMAGE_FILE_MACHINE_IA64: - break; - - case IMAGE_FILE_MACHINE_I386: -#ifdef I386MAGIC - magic = I386MAGIC; -#endif - break; - - case IMAGE_FILE_MACHINE_M68K: -#ifdef MC68AGIC - magic = MC68MAGIC; -#endif - break; - - case IMAGE_FILE_MACHINE_R3000: - case IMAGE_FILE_MACHINE_R4000: - case IMAGE_FILE_MACHINE_R10000: - - case IMAGE_FILE_MACHINE_MIPS16: - case IMAGE_FILE_MACHINE_MIPSFPU: - case IMAGE_FILE_MACHINE_MIPSFPU16: -#ifdef MIPS_ARCH_MAGIC_WINCE - magic = MIPS_ARCH_MAGIC_WINCE; -#endif - break; - - case IMAGE_FILE_MACHINE_SH3: - case IMAGE_FILE_MACHINE_SH4: -#ifdef SH_ARCH_MAGIC_WINCE - magic = SH_ARCH_MAGIC_WINCE; -#endif - break; - - case IMAGE_FILE_MACHINE_ARM: -#ifdef ARMPEMAGIC - magic = ARMPEMAGIC; -#endif - break; - - case IMAGE_FILE_MACHINE_THUMB: -#ifdef THUMBPEMAGIC - { - extern const bfd_target TARGET_LITTLE_SYM; - - if (abfd->xvec == & TARGET_LITTLE_SYM) - magic = THUMBPEMAGIC; - } -#endif - break; - - case IMAGE_FILE_MACHINE_POWERPC: - /* We no longer support PowerPC. */ - default: - _bfd_error_handler - ( -_("%s: Unrecognised machine type (0x%x) in Import Library Format archive"), - bfd_archive_filename (abfd), machine); - bfd_set_error (bfd_error_malformed_archive); - - return NULL; - break; - } - - if (magic == 0) - { - _bfd_error_handler - ( -_("%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive"), - bfd_archive_filename (abfd), machine); - bfd_set_error (bfd_error_wrong_format); - - return NULL; - } - - /* We do not bother to check the date. - date = H_GET_32 (abfd, ptr); */ - ptr += 4; - - size = H_GET_32 (abfd, ptr); - ptr += 4; - - if (size == 0) - { - _bfd_error_handler - (_("%s: size field is zero in Import Library Format header"), - bfd_archive_filename (abfd)); - bfd_set_error (bfd_error_malformed_archive); - - return NULL; - } - - ordinal = H_GET_16 (abfd, ptr); - ptr += 2; - - types = H_GET_16 (abfd, ptr); - /* ptr += 2; */ - - /* Now read in the two strings that follow. */ - ptr = bfd_alloc (abfd, size); - if (ptr == NULL) - return NULL; - - if (bfd_bread (ptr, size, abfd) != size) - return NULL; - - symbol_name = ptr; - source_dll = ptr + strlen (ptr) + 1; - - /* Verify that the strings are null terminated. */ - if (ptr[size - 1] != 0 || ((unsigned long) (source_dll - ptr) >= size)) - { - _bfd_error_handler - (_("%s: string not null terminated in ILF object file."), - bfd_archive_filename (abfd)); - bfd_set_error (bfd_error_malformed_archive); - - return NULL; - } - - /* Now construct the bfd. */ - if (! pe_ILF_build_a_bfd (abfd, magic, symbol_name, - source_dll, ordinal, types)) - return NULL; - - return abfd->xvec; -} - -static const bfd_target * -pe_bfd_object_p (bfd * abfd) -{ - bfd_byte buffer[4]; - struct external_PEI_DOS_hdr dos_hdr; - struct external_PEI_IMAGE_hdr image_hdr; - file_ptr offset; - - /* Detect if this a Microsoft Import Library Format element. */ - if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || bfd_bread (buffer, (bfd_size_type) 4, abfd) != 4) - { - if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return NULL; - } - - if (H_GET_32 (abfd, buffer) == 0xffff0000) - return pe_ILF_object_p (abfd); - - if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || bfd_bread (&dos_hdr, (bfd_size_type) sizeof (dos_hdr), abfd) - != sizeof (dos_hdr)) - { - if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return NULL; - } - - /* There are really two magic numbers involved; the magic number - that says this is a NT executable (PEI) and the magic number that - determines the architecture. The former is DOSMAGIC, stored in - the e_magic field. The latter is stored in the f_magic field. - If the NT magic number isn't valid, the architecture magic number - could be mimicked by some other field (specifically, the number - of relocs in section 3). Since this routine can only be called - correctly for a PEI file, check the e_magic number here, and, if - it doesn't match, clobber the f_magic number so that we don't get - a false match. */ - if (H_GET_16 (abfd, dos_hdr.e_magic) != DOSMAGIC) - { - bfd_set_error (bfd_error_wrong_format); - return NULL; - } - - offset = H_GET_32 (abfd, dos_hdr.e_lfanew); - if (bfd_seek (abfd, offset, SEEK_SET) != 0 - || (bfd_bread (&image_hdr, (bfd_size_type) sizeof (image_hdr), abfd) - != sizeof (image_hdr))) - { - if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return NULL; - } - - if (H_GET_32 (abfd, image_hdr.nt_signature) != 0x4550) - { - bfd_set_error (bfd_error_wrong_format); - return NULL; - } - - /* Here is the hack. coff_object_p wants to read filhsz bytes to - pick up the COFF header for PE, see "struct external_PEI_filehdr" - in include/coff/pe.h. We adjust so that that will work. */ - if (bfd_seek (abfd, (file_ptr) (offset - sizeof (dos_hdr)), SEEK_SET) != 0) - { - if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return NULL; - } - - return coff_object_p (abfd); -} - -#define coff_object_p pe_bfd_object_p -#endif /* COFF_IMAGE_WITH_PE */ diff --git a/contrib/binutils/bfd/po/POTFILES.in b/contrib/binutils/bfd/po/POTFILES.in deleted file mode 100644 index f75b4caec898..000000000000 --- a/contrib/binutils/bfd/po/POTFILES.in +++ /dev/null @@ -1,255 +0,0 @@ -aix386-core.c -aout0.c -aout32.c -aout64.c -aout-adobe.c -aout-arm.c -aout-cris.c -aoutf1.h -aout-ns32k.c -aout-sparcle.c -aout-target.h -aout-tic30.c -aoutx.h -archive.c -archures.c -armnetbsd.c -bfd.c -binary.c -bout.c -cache.c -cf-i386lynx.c -cf-m68klynx.c -cf-sparclynx.c -cisco-core.c -coff64-rs6000.c -coff-a29k.c -coff-alpha.c -coff-apollo.c -coff-arm.c -coff-aux.c -coffcode.h -coffgen.c -coff-go32.c -coff-h8300.c -coff-h8500.c -coff-i386.c -coff-i860.c -coff-i960.c -cofflink.c -coff-m68k.c -coff-m88k.c -coff-mips.c -coff-pmac.c -coff-rs6000.c -coff-sh.c -coff-sparc.c -coff-stgo32.c -coff-svm68k.c -coffswap.h -coff-tic30.c -coff-tic54x.c -coff-tic80.c -coff-u68k.c -coff-w65.c -coff-we32k.c -coff-z8k.c -corefile.c -cpu-a29k.c -cpu-alpha.c -cpu-arc.c -cpu-arm.c -cpu-avr.c -cpu-cris.c -cpu-d10v.c -cpu-d30v.c -cpu-fr30.c -cpu-h8300.c -cpu-h8500.c -cpu-hppa.c -cpu-i370.c -cpu-i386.c -cpu-i860.c -cpu-i960.c -cpu-ia64.c -cpu-m10200.c -cpu-m10300.c -cpu-m32r.c -cpu-m68hc11.c -cpu-m68hc12.c -cpu-m68k.c -cpu-m88k.c -cpu-mcore.c -cpu-mips.c -cpu-ns32k.c -cpu-pj.c -cpu-powerpc.c -cpu-rs6000.c -cpu-sh.c -cpu-sparc.c -cpu-tic30.c -cpu-tic54x.c -cpu-tic80.c -cpu-v850.c -cpu-vax.c -cpu-w65.c -cpu-we32k.c -cpu-z8k.c -demo64.c -dwarf1.c -dwarf2.c -ecoff.c -ecofflink.c -ecoffswap.h -efi-app-ia32.c -efi-app-ia64.c -elf32-arc.c -elf32-arm.h -elf32-avr.c -elf32.c -elf32-cris.c -elf32-d10v.c -elf32-d30v.c -elf32-fr30.c -elf32-gen.c -elf32-hppa.c -elf32-hppa.h -elf32-i370.c -elf32-i386.c -elf32-i860.c -elf32-i960.c -elf32-m32r.c -elf32-m68hc11.c -elf32-m68hc12.c -elf32-m68k.c -elf32-m88k.c -elf32-mcore.c -elf32-mips.c -elf32-pj.c -elf32-ppc.c -elf32-sh.c -elf32-sh-lin.c -elf32-sparc.c -elf32-v850.c -elf64-alpha.c -elf64.c -elf64-gen.c -elf64-hppa.c -elf64-hppa.h -elf64-mips.c -elf64-sparc.c -elf64-x86-64.c -elfarm-nabi.c -elfarm-oabi.c -elf-bfd.h -elf.c -elfcode.h -elfcore.h -elf-hppa.h -elflink.c -elflink.h -elf-m10200.c -elf-m10300.c -epoc-pe-arm.c -epoc-pei-arm.c -format.c -freebsd.h -genlink.h -go32stub.h -hash.c -hp300bsd.c -hp300hpux.c -hpux-core.c -i386aout.c -i386bsd.c -i386dynix.c -i386freebsd.c -i386linux.c -i386lynx.c -i386mach3.c -i386msdos.c -i386netbsd.c -i386os9k.c -ieee.c -ihex.c -init.c -irix-core.c -libaout.h -libbfd.c -libbfd.h -libcoff.h -libecoff.h -libhppa.h -libieee.h -libnlm.h -liboasys.h -libpei.h -linker.c -lynx-core.c -m68k4knetbsd.c -m68klinux.c -m68klynx.c -m68knetbsd.c -m88kmach3.c -mipsbsd.c -netbsd.h -newsos3.c -nlm32-alpha.c -nlm32.c -nlm32-i386.c -nlm32-ppc.c -nlm32-sparc.c -nlm64.c -nlm.c -nlmcode.h -nlmswap.h -nlm-target.h -ns32k.h -ns32knetbsd.c -oasys.c -opncls.c -osf-core.c -pc532-mach.c -pe-arm.c -pe-i386.c -pei-arm.c -peicode.h -peigen.c -pei-i386.c -pei-mcore.c -pei-mips.c -pei-ppc.c -pei-sh.c -pe-mcore.c -pe-mips.c -pe-ppc.c -pe-sh.c -ppcboot.c -reloc16.c -reloc.c -riscix.c -sco5-core.c -section.c -som.c -som.h -sparclinux.c -sparclynx.c -sparcnetbsd.c -srec.c -stabs.c -stab-syms.c -sunos.c -syms.c -targets.c -tekhex.c -trad-core.c -vaxnetbsd.c -versados.c -vms.c -vms-gsd.c -vms.h -vms-hdr.c -vms-misc.c -vms-tir.c -xcofflink.c -xcoff-target.h diff --git a/contrib/binutils/binutils/acconfig.h b/contrib/binutils/binutils/acconfig.h deleted file mode 100644 index c38c529c901c..000000000000 --- a/contrib/binutils/binutils/acconfig.h +++ /dev/null @@ -1,34 +0,0 @@ - -/* Name of package. */ -#undef PACKAGE - -/* Version of package. */ -#undef VERSION - -/* Configured target name. */ -#undef TARGET - -/* Whether strstr must be declared even if <string.h> is included. */ -#undef NEED_DECLARATION_STRSTR - -/* Whether fprintf must be declared even if <stdio.h> is included. */ -#undef NEED_DECLARATION_FPRINTF - -/* Whether sbrk must be declared even if <unistd.h> is included. */ -#undef NEED_DECLARATION_SBRK - -/* Whether getenv must be declared even if <stdlib.h> is included. */ -#undef NEED_DECLARATION_GETENV -@TOP@ - -/* Is the type time_t defined in <time.h>? */ -#undef HAVE_TIME_T_IN_TIME_H - -/* Is the type time_t defined in <sys/types.h>? */ -#undef HAVE_TIME_T_IN_TYPES_H - -/* Does <utime.h> define struct utimbuf? */ -#undef HAVE_GOOD_UTIME_H - -/* Do we need to use the b modifier when opening binary files? */ -#undef USE_BINARY_FOPEN diff --git a/contrib/binutils/binutils/addr2line.1 b/contrib/binutils/binutils/addr2line.1 deleted file mode 100644 index 4294a502ecae..000000000000 --- a/contrib/binutils/binutils/addr2line.1 +++ /dev/null @@ -1,502 +0,0 @@ -.\" Copyright (c) 1997, 2000 Free Software Foundation -.\" See COPYING for conditions for redistribution -.TH addr2line 1 "27 March 1997" "Free Software Foundation" "GNU Development Tools" -.de BP -.sp -.ti \-.2i -\(** -.. - -.SH NAME -addr2line \- convert addresses into file names and line numbers - -.SH SYNOPSIS -.hy 0 -.na -.B addr2line -.RB "[\|" "\-b\ "\c -.I bfdname\c -.RB " | " "\-\-target="\c -.I bfdname\c -\&\|] -.RB "[\|" \-C | \-\-demangle "\|]" -.RB "[\|" "\-e\ "\c -.I filename\c -.RB " | " "\-\-exe="\c -.I filename\c -\&\|] -.RB "[\|" \-f | \-\-functions "\|]" -.RB "[\|" \-s | \-\-basenames "\|]" -.RB "[\|" \-H | \-\-help "\|]" -.RB "[\|" \-V | \-\-version "\|]" -.RB "[\|" addr addr ... "\|]" -.ad b -.hy 1 -.SH DESCRIPTION -\c -.B addr2line -translates program addresses into file names and line numbers. Given -an address and an executable, it uses the debugging information in the -executable to figure out which file name and line number are -associated with a given address. - -The executable to use is specified with the -.B \-e -option. The default is -.B a.out\c -\&. - -.B addr2line -has two modes of operation. - -In the first, hexadecimal addresses are specified on the command line, -and -.B addr2line -displays the file name and line number for each address. - -In the second, -.B addr2line -reads hexadecimal addresses from standard input, and prints the file -name and line number for each address on standard output. In this -mode, -.B addr2line -may be used in a pipe to convert dynamically chosen addresses. - -The format of the output is FILENAME:LINENO. The file name and line -number for each address is printed on a separate line. If the -.B \-f -option is used, then each FILENAME:LINENO line is preceded by a -FUNCTIONNAME line which is the name of the function containing the -address. - -If the file name or function name can not be determined, -.B addr2line -will print two question marks in their place. If the line number can -not be determined, -.B addr2line -will print 0. - -.SH OPTIONS -.TP -.BI "\-b " "bfdname"\c -.TP -.BI "\-\-target=" "bfdname" -Specify the object-code format for the object files to be -\c -.I bfdname\c -\&. - -.TP -.B \-C -.TP -.B \-\-demangle -Decode (\fIdemangle\fP) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes C++ function names readable. - -.TP -.BI "\-e " "filename"\c -.TP -.BI "\-\-exe=" "filename" -Specify the name of the executable for which addresses should be -translated. The default file is -.B a.out\c -\&. - -.TP -.B \-f -.TP -.B \-\-functions -Display function names as well as file and line number information. - -.TP -.B \-s -.TP -.B \-\-basenames -Display only the base of each file name. - -.SH "SEE ALSO" -.RB "`\|" binutils "\|'" -entry in -.B -info\c -\&; -.I -The GNU Binary Utilities\c -\&, Roland H. Pesch (October 1991). - -.SH COPYING -Copyright (c) 1993, 94, 95, 96, 97, 98, 1999, 2000 Free Software Foundation, Inc. -.PP -This document is distributed under the terms of the GNU Free -Documentation License, version 1.1. That license is described in the -sources for this manual page, but it is not displayed here in order to -make this manual more consise. Copies of this license can also be -obtained from: http://www.gnu.org/copyleft/. - -\" .SH GNU Free Documentation License -\" Version 1.1, March 2000 - -\" Copyright (C) 2000 Free Software Foundation, Inc. -\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -\" Everyone is permitted to copy and distribute verbatim -\" copies of this license document, but changing it is -\" not allowed. -\" .PP -\" 0. PREAMBLE -\" .PP -\" The purpose of this License is to make a manual, textbook, or other -\" written document "free" in the sense of freedom: to assure everyone -\" the effective freedom to copy and redistribute it, with or without -\" modifying it, either commercially or noncommercially. Secondarily, -\" this License preserves for the author and publisher a way to get -\" credit for their work, while not being considered responsible for -\" modifications made by others. -\" .PP -\" This License is a kind of "copyleft", which means that derivative -\" works of the document must themselves be free in the same sense. It -\" complements the GNU General Public License, which is a copyleft -\" license designed for free software. -\" .PP -\" We have designed this License in order to use it for manuals for free -\" software, because free software needs free documentation: a free -\" program should come with manuals providing the same freedoms that the -\" software does. But this License is not limited to software manuals; -\" it can be used for any textual work, regardless of subject matter or -\" whether it is published as a printed book. We recommend this License -\" principally for works whose purpose is instruction or reference. -\" .PP -\" 1. APPLICABILITY AND DEFINITIONS -\" .PP -\" This License applies to any manual or other work that contains a -\" notice placed by the copyright holder saying it can be distributed -\" under the terms of this License. The "Document", below, refers to any -\" such manual or work. Any member of the public is a licensee, and is -\" addressed as "you". -\" .PP -\" A "Modified Version" of the Document means any work containing the -\" Document or a portion of it, either copied verbatim, or with -\" modifications and/or translated into another language. -\" .PP -\" A "Secondary Section" is a named appendix or a front-matter section of -\" the Document that deals exclusively with the relationship of the -\" publishers or authors of the Document to the Document's overall subject -\" (or to related matters) and contains nothing that could fall directly -\" within that overall subject. (For example, if the Document is in part a -\" textbook of mathematics, a Secondary Section may not explain any -\" mathematics.) The relationship could be a matter of historical -\" connection with the subject or with related matters, or of legal, -\" commercial, philosophical, ethical or political position regarding -\" them. -\" .PP -\" The "Invariant Sections" are certain Secondary Sections whose titles -\" are designated, as being those of Invariant Sections, in the notice -\" that says that the Document is released under this License. -\" .PP -\" The "Cover Texts" are certain short passages of text that are listed, -\" as Front-Cover Texts or Back-Cover Texts, in the notice that says that -\" the Document is released under this License. -\" .PP -\" A "Transparent" copy of the Document means a machine-readable copy, -\" represented in a format whose specification is available to the -\" general public, whose contents can be viewed and edited directly and -\" straightforwardly with generic text editors or (for images composed of -\" pixels) generic paint programs or (for drawings) some widely available -\" drawing editor, and that is suitable for input to text formatters or -\" for automatic translation to a variety of formats suitable for input -\" to text formatters. A copy made in an otherwise Transparent file -\" format whose markup has been designed to thwart or discourage -\" subsequent modification by readers is not Transparent. A copy that is -\" not "Transparent" is called "Opaque". -\" .PP -\" Examples of suitable formats for Transparent copies include plain -\" ASCII without markup, Texinfo input format, LaTeX input format, SGML -\" or XML using a publicly available DTD, and standard-conforming simple -\" HTML designed for human modification. Opaque formats include -\" PostScript, PDF, proprietary formats that can be read and edited only -\" by proprietary word processors, SGML or XML for which the DTD and/or -\" processing tools are not generally available, and the -\" machine-generated HTML produced by some word processors for output -\" purposes only. -\" .PP -\" The "Title Page" means, for a printed book, the title page itself, -\" plus such following pages as are needed to hold, legibly, the material -\" this License requires to appear in the title page. For works in -\" formats which do not have any title page as such, "Title Page" means -\" the text near the most prominent appearance of the work's title, -\" preceding the beginning of the body of the text. -\" .PP -\" 2. VERBATIM COPYING -\" .PP -\" You may copy and distribute the Document in any medium, either -\" commercially or noncommercially, provided that this License, the -\" copyright notices, and the license notice saying this License applies -\" to the Document are reproduced in all copies, and that you add no other -\" conditions whatsoever to those of this License. You may not use -\" technical measures to obstruct or control the reading or further -\" copying of the copies you make or distribute. However, you may accept -\" compensation in exchange for copies. If you distribute a large enough -\" number of copies you must also follow the conditions in section 3. -\" .PP -\" You may also lend copies, under the same conditions stated above, and -\" you may publicly display copies. -\" .PP -\" 3. COPYING IN QUANTITY -\" .PP -\" If you publish printed copies of the Document numbering more than 100, -\" and the Document's license notice requires Cover Texts, you must enclose -\" the copies in covers that carry, clearly and legibly, all these Cover -\" Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -\" the back cover. Both covers must also clearly and legibly identify -\" you as the publisher of these copies. The front cover must present -\" the full title with all words of the title equally prominent and -\" visible. You may add other material on the covers in addition. -\" Copying with changes limited to the covers, as long as they preserve -\" the title of the Document and satisfy these conditions, can be treated -\" as verbatim copying in other respects. -\" .PP -\" If the required texts for either cover are too voluminous to fit -\" legibly, you should put the first ones listed (as many as fit -\" reasonably) on the actual cover, and continue the rest onto adjacent -\" pages. -\" .PP -\" If you publish or distribute Opaque copies of the Document numbering -\" more than 100, you must either include a machine-readable Transparent -\" copy along with each Opaque copy, or state in or with each Opaque copy -\" a publicly-accessible computer-network location containing a complete -\" Transparent copy of the Document, free of added material, which the -\" general network-using public has access to download anonymously at no -\" charge using public-standard network protocols. If you use the latter -\" option, you must take reasonably prudent steps, when you begin -\" distribution of Opaque copies in quantity, to ensure that this -\" Transparent copy will remain thus accessible at the stated location -\" until at least one year after the last time you distribute an Opaque -\" copy (directly or through your agents or retailers) of that edition to -\" the public. -\" .PP -\" It is requested, but not required, that you contact the authors of the -\" Document well before redistributing any large number of copies, to give -\" them a chance to provide you with an updated version of the Document. -\" .PP -\" 4. MODIFICATIONS -\" .PP -\" You may copy and distribute a Modified Version of the Document under -\" the conditions of sections 2 and 3 above, provided that you release -\" the Modified Version under precisely this License, with the Modified -\" Version filling the role of the Document, thus licensing distribution -\" and modification of the Modified Version to whoever possesses a copy -\" of it. In addition, you must do these things in the Modified Version: -\" .PP -\" A. Use in the Title Page (and on the covers, if any) a title distinct -\" from that of the Document, and from those of previous versions -\" (which should, if there were any, be listed in the History section -\" of the Document). You may use the same title as a previous version -\" if the original publisher of that version gives permission. -\" .PP -\" B. List on the Title Page, as authors, one or more persons or entities -\" responsible for authorship of the modifications in the Modified -\" Version, together with at least five of the principal authors of the -\" Document (all of its principal authors, if it has less than five). -\" .PP -\" C. State on the Title page the name of the publisher of the -\" Modified Version, as the publisher. -\" .PP -\" D. Preserve all the copyright notices of the Document. -\" .PP -\" E. Add an appropriate copyright notice for your modifications -\" adjacent to the other copyright notices. -\" .PP -\" F. Include, immediately after the copyright notices, a license notice -\" giving the public permission to use the Modified Version under the -\" terms of this License, in the form shown in the Addendum below. -\" Preserve in that license notice the full lists of Invariant Sections -\" and required Cover Texts given in the Document's license notice. -\" .PP -\" H. Include an unaltered copy of this License. -\" .PP -\" I. Preserve the section entitled "History", and its title, and add to -\" it an item stating at least the title, year, new authors, and -\" publisher of the Modified Version as given on the Title Page. If -\" there is no section entitled "History" in the Document, create one -\" stating the title, year, authors, and publisher of the Document as -\" given on its Title Page, then add an item describing the Modified -\" Version as stated in the previous sentence. -\" .PP -\" J. Preserve the network location, if any, given in the Document for -\" public access to a Transparent copy of the Document, and likewise -\" the network locations given in the Document for previous versions -\" it was based on. These may be placed in the "History" section. -\" You may omit a network location for a work that was published at -\" least four years before the Document itself, or if the original -\" publisher of the version it refers to gives permission. -\" .PP -\" K. In any section entitled "Acknowledgements" or "Dedications", -\" preserve the section's title, and preserve in the section all the -\" substance and tone of each of the contributor acknowledgements -\" and/or dedications given therein. -\" .PP -\" L. Preserve all the Invariant Sections of the Document, -\" unaltered in their text and in their titles. Section numbers -\" or the equivalent are not considered part of the section titles. -\" .PP -\" M. Delete any section entitled "Endorsements". Such a section -\" may not be included in the Modified Version. -\" .PP -\" N. Do not retitle any existing section as "Endorsements" -\" or to conflict in title with any Invariant Section. -\" .PP -\" If the Modified Version includes new front-matter sections or -\" appendices that qualify as Secondary Sections and contain no material -\" copied from the Document, you may at your option designate some or all -\" of these sections as invariant. To do this, add their titles to the -\" list of Invariant Sections in the Modified Version's license notice. -\" These titles must be distinct from any other section titles. -\" .PP -\" You may add a section entitled "Endorsements", provided it contains -\" nothing but endorsements of your Modified Version by various -\" parties--for example, statements of peer review or that the text has -\" been approved by an organization as the authoritative definition of a -\" standard. -\" .PP -\" You may add a passage of up to five words as a Front-Cover Text, and a -\" passage of up to 25 words as a Back-Cover Text, to the end of the list -\" of Cover Texts in the Modified Version. Only one passage of -\" Front-Cover Text and one of Back-Cover Text may be added by (or -\" through arrangements made by) any one entity. If the Document already -\" includes a cover text for the same cover, previously added by you or -\" by arrangement made by the same entity you are acting on behalf of, -\" you may not add another; but you may replace the old one, on explicit -\" permission from the previous publisher that added the old one. -\" .PP -\" The author(s) and publisher(s) of the Document do not by this License -\" give permission to use their names for publicity for or to assert or -\" imply endorsement of any Modified Version. -\" .PP - -\" 5. COMBINING DOCUMENTS -\" .PP -\" You may combine the Document with other documents released under this -\" License, under the terms defined in section 4 above for modified -\" versions, provided that you include in the combination all of the -\" Invariant Sections of all of the original documents, unmodified, and -\" list them all as Invariant Sections of your combined work in its -\" license notice. -\" .PP -\" The combined work need only contain one copy of this License, and -\" multiple identical Invariant Sections may be replaced with a single -\" copy. If there are multiple Invariant Sections with the same name but -\" different contents, make the title of each such section unique by -\" adding at the end of it, in parentheses, the name of the original -\" author or publisher of that section if known, or else a unique number. -\" Make the same adjustment to the section titles in the list of -\" Invariant Sections in the license notice of the combined work. -\" .PP -\" In the combination, you must combine any sections entitled "History" -\" in the various original documents, forming one section entitled -\" "History"; likewise combine any sections entitled "Acknowledgements", -\" and any sections entitled "Dedications". You must delete all sections -\" entitled "Endorsements." -\" .PP - -\" 6. COLLECTIONS OF DOCUMENTS -\" .PP -\" You may make a collection consisting of the Document and other documents -\" released under this License, and replace the individual copies of this -\" License in the various documents with a single copy that is included in -\" the collection, provided that you follow the rules of this License for -\" verbatim copying of each of the documents in all other respects. -\" .PP -\" You may extract a single document from such a collection, and distribute -\" it individually under this License, provided you insert a copy of this -\" License into the extracted document, and follow this License in all -\" other respects regarding verbatim copying of that document. -\" .PP - -\" 7. AGGREGATION WITH INDEPENDENT WORKS -\" .PP -\" A compilation of the Document or its derivatives with other separate -\" and independent documents or works, in or on a volume of a storage or -\" distribution medium, does not as a whole count as a Modified Version -\" of the Document, provided no compilation copyright is claimed for the -\" compilation. Such a compilation is called an "aggregate", and this -\" License does not apply to the other self-contained works thus compiled -\" with the Document, on account of their being thus compiled, if they -\" are not themselves derivative works of the Document. -\" .PP -\" If the Cover Text requirement of section 3 is applicable to these -\" copies of the Document, then if the Document is less than one quarter -\" of the entire aggregate, the Document's Cover Texts may be placed on -\" covers that surround only the Document within the aggregate. -\" Otherwise they must appear on covers around the whole aggregate. -\" .PP - -\" 8. TRANSLATION -\" .PP -\" Translation is considered a kind of modification, so you may -\" distribute translations of the Document under the terms of section 4. -\" Replacing Invariant Sections with translations requires special -\" permission from their copyright holders, but you may include -\" translations of some or all Invariant Sections in addition to the -\" original versions of these Invariant Sections. You may include a -\" translation of this License provided that you also include the -\" original English version of this License. In case of a disagreement -\" between the translation and the original English version of this -\" License, the original English version will prevail. -\" .PP - -\" 9. TERMINATION -\" .PP -\" You may not copy, modify, sublicense, or distribute the Document except -\" as expressly provided for under this License. Any other attempt to -\" copy, modify, sublicense or distribute the Document is void, and will -\" automatically terminate your rights under this License. However, -\" parties who have received copies, or rights, from you under this -\" License will not have their licenses terminated so long as such -\" parties remain in full compliance. -\" .PP - -\" 10. FUTURE REVISIONS OF THIS LICENSE -\" .PP -\" The Free Software Foundation may publish new, revised versions -\" of the GNU Free Documentation License from time to time. Such new -\" versions will be similar in spirit to the present version, but may -\" differ in detail to address new problems or concerns. See -\" http://www.gnu.org/copyleft/. -\" .PP -\" Each version of the License is given a distinguishing version number. -\" If the Document specifies that a particular numbered version of this -\" License "or any later version" applies to it, you have the option of -\" following the terms and conditions either of that specified version or -\" of any later version that has been published (not as a draft) by the -\" Free Software Foundation. If the Document does not specify a version -\" number of this License, you may choose any version ever published (not -\" as a draft) by the Free Software Foundation. -\" .PP - -\" ADDENDUM: How to use this License for your documents -\" .PP -\" To use this License in a document you have written, include a copy of -\" the License in the document and put the following copyright and -\" license notices just after the title page: -\" .PP -\" Copyright (c) YEAR YOUR NAME. -\" Permission is granted to copy, distribute and/or -\" modify this document under the terms of the GNU -\" Free Documentation License, Version 1.1 or any later -\" version published by the Free Software Foundation; -\" with the Invariant Sections being LIST THEIR TITLES, -\" with the Front-Cover Texts being LIST, and with the -\" Back-Cover Texts being LIST. A copy of the license -\" is included in the section entitled "GNU Free -\" Documentation License". -\" .PP -\" If you have no Invariant Sections, write "with no Invariant Sections" -\" instead of saying which ones are invariant. If you have no -\" Front-Cover Texts, write "no Front-Cover Texts" instead of -\" "Front-Cover Texts being LIST"; likewise for Back-Cover Texts. -\" .PP -\" If your document contains nontrivial examples of program code, we -\" recommend releasing these examples in parallel under your choice of -\" free software license, such as the GNU General Public License, -\" to permit their use in free software. diff --git a/contrib/binutils/binutils/ar.1 b/contrib/binutils/binutils/ar.1 deleted file mode 100644 index d7b2caff8e64..000000000000 --- a/contrib/binutils/binutils/ar.1 +++ /dev/null @@ -1,891 +0,0 @@ -.\" Copyright (c) 1991, 1992, 1993, 1995, 1998, 1999, 2000 Free Software Foundation -.\" See section COPYING for conditions for redistribution -.TH ar 1 "1999" "Free Software Foundation" "GNU Development Tools" -.de BP -.sp -.ti \-.2i -\(** -.. - -.SH NAME -ar \- create, modify, and extract from archives. - -.SH SYNOPSIS -.hy 0 -.na -.BR ar " [\|" "-" "\|]"\c -.I {dmpqrtx}[abcfilNoPsSuvV] \c -[\|\c -.I membername\c -\&\|] \c -[\|\c -.I count\c -\&\|] \c -.I archive\c -\& \c -.I files\c -\&.\|.\|. - -.ad b -.hy 1 -.SH DESCRIPTION -The GNU \c -.B ar\c -\& program creates, modifies, and extracts from -archives. An \c -.I archive\c -\& is a single file holding a collection of -other files in a structure that makes it possible to retrieve -the original individual files (called \c -.I members\c -\& of the archive). - -The original files' contents, mode (permissions), timestamp, owner, and -group are preserved in the archive, and may be reconstituted on -extraction. - -GNU \c -.B ar\c -\& can maintain archives whose members have names of any -length; however, depending on how \c -.B ar\c -\& is configured on your -system, a limit on member-name length may be imposed (for compatibility -with archive formats maintained with other tools). If it exists, the -limit is often 15 characters (typical of formats related to a.out) or 16 -characters (typical of formats related to coff). - -\c -.B ar\c -\& is considered a binary utility because archives of this sort -are most often used as \c -.I libraries\c -\& holding commonly needed -subroutines. - -\c -.B ar\c -\& will create an index to the symbols defined in relocatable -object modules in the archive when you specify the modifier `\|\c -.B s\c -\|'. -Once created, this index is updated in the archive whenever \c -.B ar\c -\& -makes a change to its contents (save for the `\|\c -.B q\c -\|' update operation). -An archive with such an index speeds up linking to the library, and -allows routines in the library to call each other without regard to -their placement in the archive. - -You may use `\|\c -.B nm \-s\c -\|' or `\|\c -.B nm \-\-print\-armap\c -\|' to list this index -table. If an archive lacks the table, another form of \c -.B ar\c -\& called -\c -.B ranlib\c -\& can be used to add just the table. - -\c -.B ar\c -\& insists on at least two arguments to execute: one -keyletter specifying the \c -.I operation\c -\& (optionally accompanied by other -keyletters specifying \c -.I modifiers\c -\&), and the archive name to act on. - -Most operations can also accept further \c -.I files\c -\& arguments, -specifying particular files to operate on. - -.SH OPTIONS -GNU \c -.B ar\c -\& allows you to mix the operation code \c -.I p\c -\& and modifier -flags \c -.I mod\c -\& in any order, within the first command-line argument. - -If you wish, you may begin the first command-line argument with a -dash. - -The \c -.I p\c -\& keyletter specifies what operation to execute; it may be -any of the following, but you must specify only one of them: - -.TP -.B d -\c -.I Delete\c -\& modules from the archive. Specify the names of modules to -be deleted as \c -.I files\c -\&; the archive is untouched if you -specify no files to delete. - -If you specify the `\|\c -.B v\c -\|' modifier, \c -.B ar\c -\& will list each module -as it is deleted. - -.TP -.B m -Use this operation to \c -.I move\c -\& members in an archive. - -The ordering of members in an archive can make a difference in how -programs are linked using the library, if a symbol is defined in more -than one member. - -If no modifiers are used with \c -.B m\c -\&, any members you name in the -\c -.I files\c -\& arguments are moved to the \c -.I end\c -\& of the archive; -you can use the `\|\c -.B a\c -\|', `\|\c -.B b\c -\|', or `\|\c -.B i\c -\|' modifiers to move them to a -specified place instead. - -.TP -.B p -\c -.I Print\c -\& the specified members of the archive, to the standard -output file. If the `\|\c -.B v\c -\|' modifier is specified, show the member -name before copying its contents to standard output. - -If you specify no \c -.I files\c -\&, all the files in the archive are printed. - -.TP -.B q -\c -.I Quick append\c -\&; add \c -.I files\c -\& to the end of \c -.I archive\c -\&, -without checking for replacement. - -The modifiers `\|\c -.B a\c -\|', `\|\c -.B b\c -\|', and `\|\c -.B i\c -\|' do \c -.I not\c -\& affect this -operation; new members are always placed at the end of the archive. - -The modifier `\|\c -.B v\c -\|' makes \c -.B ar\c -\& list each file as it is appended. - -Since the point of this operation is speed, the archive's symbol table -index is not updated, even if it already existed; you can use `\|\c -.B ar s\c -\|' or -\c -.B ranlib\c -\& explicitly to update the symbol table index. - -However, too many different systems assume quick append rebuilds the -index, so GNU -.B ar -implements `\|\c -.B q\c -\|' as a synonym for `\|\c -.B r\c -\|'. - -.TP -.B r -Insert \c -.I files\c -\& into \c -.I archive\c -\& (with \c -.I replacement\c -\&). This -operation differs from `\|\c -.B q\c -\|' in that any previously existing members -are deleted if their names match those being added. - -If one of the files named in \c -.I files\c -\& doesn't exist, \c -.B ar\c -\& -displays an error message, and leaves undisturbed any existing members -of the archive matching that name. - -By default, new members are added at the end of the file; but you may -use one of the modifiers `\|\c -.B a\c -\|', `\|\c -.B b\c -\|', or `\|\c -.B i\c -\|' to request -placement relative to some existing member. - -The modifier `\|\c -.B v\c -\|' used with this operation elicits a line of -output for each file inserted, along with one of the letters `\|\c -.B a\c -\|' or -`\|\c -.B r\c -\|' to indicate whether the file was appended (no old member -deleted) or replaced. - -.TP -.B t -Display a \c -.I table\c -\& listing the contents of \c -.I archive\c -\&, or those -of the files listed in \c -.I files\c -\& that are present in the -archive. Normally only the member name is shown; if you also want to -see the modes (permissions), timestamp, owner, group, and size, you can -request that by also specifying the `\|\c -.B v\c -\|' modifier. - -If you do not specify any \c -.I files\c -\&, all files in the archive -are listed. - -If there is more than one file with the same name (say, `\|\c -.B fie\c -\|') in -an archive (say `\|\c -.B b.a\c -\|'), `\|\c -.B ar t b.a fie\c -\|' will list only the -first instance; to see them all, you must ask for a complete -listing\(em\&in our example, `\|\c -.B ar t b.a\c -\|'. - -.TP -.B x -\c -.I Extract\c -\& members (named \c -.I files\c -\&) from the archive. You can -use the `\|\c -.B v\c -\|' modifier with this operation, to request that -\c -.B ar\c -\& list each name as it extracts it. - -If you do not specify any \c -.I files\c -\&, all files in the archive -are extracted. - -.PP - -A number of modifiers (\c -.I mod\c -\&) may immediately follow the \c -.I p\c -\& -keyletter, to specify variations on an operation's behavior: - -.TP -.B a -Add new files \c -.I after\c -\& an existing member of the -archive. If you use the modifier \c -.B a\c -\&, the name of an existing archive -member must be present as the \c -.I membername\c -\& argument, before the -\c -.I archive\c -\& specification. - -.TP -.B b -Add new files \c -.I before\c -\& an existing member of the -archive. If you use the modifier \c -.B b\c -\&, the name of an existing archive -member must be present as the \c -.I membername\c -\& argument, before the -\c -.I archive\c -\& specification. (same as `\|\c -.B i\c -\|'). - -.TP -.B c -\c -.I Create\c -\& the archive. The specified \c -.I archive\c -\& is always -created if it didn't exist, when you request an update. But a warning is -issued unless you specify in advance that you expect to create it, by -using this modifier. - -.TP -.B f -Truncate names in the archive. -.B ar -will normally permit file names of any length. This will cause it to -create archives which are not compatible with the native -.B ar -program on some systems. If this is a concern, the -.B f -modifier may be used to truncate file names when putting them in the -archive. - -.TP -.B i -Insert new files \c -.I before\c -\& an existing member of the -archive. If you use the modifier \c -.B i\c -\&, the name of an existing archive -member must be present as the \c -.I membername\c -\& argument, before the -\c -.I archive\c -\& specification. (same as `\|\c -.B b\c -\|'). - -.TP -.B l -This modifier is accepted but not used. - -.TP -.B N -Uses the -.I count -parameter. This is used if there are multiple entries in the archive -with the same name. Extract or delete instance -.I count -of the given name from the archive. - -.TP -.B o -Preserve the \c -.I original\c -\& dates of members when extracting them. If -you do not specify this modifier, files extracted from the archive -will be stamped with the time of extraction. - -.TP -.B P -Use the full path name when matching names in the archive. -.B ar -can not create an archive with a full path name (such archives are not -POSIX complaint), but other archive creators can. This option will -cause -.B ar -to match file names using a complete path name, which can be -convenient when extracting a single file from an archive created by -another tool. - -.TP -.B s -Write an object-file index into the archive, or update an existing one, -even if no other change is made to the archive. You may use this modifier -flag either with any operation, or alone. Running `\|\c -.B ar s\c -\|' on an -archive is equivalent to running `\|\c -.B ranlib\c -\|' on it. - -.TP -.B S -Do not generate an archive symbol table. This can speed up building a -large library in several steps. The resulting archive can not be used -with the linker. In order to build a symbol table, you must omit the -`\|\c -.B S\c -\|' modifier on the last execution of `\|\c -.B ar\c -\|', or you must run `\|\c -.B ranlib\c -\|' on the archive. - -.TP -.B u -Normally, \c -.B ar r\c -\&.\|.\|. inserts all files -listed into the archive. If you would like to insert \c -.I only\c -\& those -of the files you list that are newer than existing members of the same -names, use this modifier. The `\|\c -.B u\c -\|' modifier is allowed only for the -operation `\|\c -.B r\c -\|' (replace). In particular, the combination `\|\c -.B qu\c -\|' is -not allowed, since checking the timestamps would lose any speed -advantage from the operation `\|\c -.B q\c -\|'. - -.TP -.B v -This modifier requests the \c -.I verbose\c -\& version of an operation. Many -operations display additional information, such as filenames processed, -when the modifier `\|\c -.B v\c -\|' is appended. - -.TP -.B V -This modifier shows the version number of -.BR ar . - -.PP - -.SH "SEE ALSO" -.RB "`\|" binutils "\|'" -entry in -.B -info\c -\&; -.I -The GNU Binary Utilities\c -, Roland H. Pesch (October 1991). -.BR nm ( 1 )\c -\&, -.BR ranlib ( 1 )\c -\&. - -.SH COPYING -Copyright (c) 1991, 1992, 1993, 1995, 1998, 1999, 2000 Free Software Foundation, Inc. -.PP -This document is distributed under the terms of the GNU Free -Documentation License, version 1.1. That license is described in the -sources for this manual page, but it is not displayed here in order to -make this manual more consise. Copies of this license can also be -obtained from: http://www.gnu.org/copyleft/. - -\" .SH GNU Free Documentation License -\" Version 1.1, March 2000 - -\" Copyright (C) 2000 Free Software Foundation, Inc. -\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -\" Everyone is permitted to copy and distribute verbatim -\" copies of this license document, but changing it is -\" not allowed. -\" .PP -\" 0. PREAMBLE -\" .PP -\" The purpose of this License is to make a manual, textbook, or other -\" written document "free" in the sense of freedom: to assure everyone -\" the effective freedom to copy and redistribute it, with or without -\" modifying it, either commercially or noncommercially. Secondarily, -\" this License preserves for the author and publisher a way to get -\" credit for their work, while not being considered responsible for -\" modifications made by others. -\" .PP -\" This License is a kind of "copyleft", which means that derivative -\" works of the document must themselves be free in the same sense. It -\" complements the GNU General Public License, which is a copyleft -\" license designed for free software. -\" .PP -\" We have designed this License in order to use it for manuals for free -\" software, because free software needs free documentation: a free -\" program should come with manuals providing the same freedoms that the -\" software does. But this License is not limited to software manuals; -\" it can be used for any textual work, regardless of subject matter or -\" whether it is published as a printed book. We recommend this License -\" principally for works whose purpose is instruction or reference. -\" .PP -\" 1. APPLICABILITY AND DEFINITIONS -\" .PP -\" This License applies to any manual or other work that contains a -\" notice placed by the copyright holder saying it can be distributed -\" under the terms of this License. The "Document", below, refers to any -\" such manual or work. Any member of the public is a licensee, and is -\" addressed as "you". -\" .PP -\" A "Modified Version" of the Document means any work containing the -\" Document or a portion of it, either copied verbatim, or with -\" modifications and/or translated into another language. -\" .PP -\" A "Secondary Section" is a named appendix or a front-matter section of -\" the Document that deals exclusively with the relationship of the -\" publishers or authors of the Document to the Document's overall subject -\" (or to related matters) and contains nothing that could fall directly -\" within that overall subject. (For example, if the Document is in part a -\" textbook of mathematics, a Secondary Section may not explain any -\" mathematics.) The relationship could be a matter of historical -\" connection with the subject or with related matters, or of legal, -\" commercial, philosophical, ethical or political position regarding -\" them. -\" .PP -\" The "Invariant Sections" are certain Secondary Sections whose titles -\" are designated, as being those of Invariant Sections, in the notice -\" that says that the Document is released under this License. -\" .PP -\" The "Cover Texts" are certain short passages of text that are listed, -\" as Front-Cover Texts or Back-Cover Texts, in the notice that says that -\" the Document is released under this License. -\" .PP -\" A "Transparent" copy of the Document means a machine-readable copy, -\" represented in a format whose specification is available to the -\" general public, whose contents can be viewed and edited directly and -\" straightforwardly with generic text editors or (for images composed of -\" pixels) generic paint programs or (for drawings) some widely available -\" drawing editor, and that is suitable for input to text formatters or -\" for automatic translation to a variety of formats suitable for input -\" to text formatters. A copy made in an otherwise Transparent file -\" format whose markup has been designed to thwart or discourage -\" subsequent modification by readers is not Transparent. A copy that is -\" not "Transparent" is called "Opaque". -\" .PP -\" Examples of suitable formats for Transparent copies include plain -\" ASCII without markup, Texinfo input format, LaTeX input format, SGML -\" or XML using a publicly available DTD, and standard-conforming simple -\" HTML designed for human modification. Opaque formats include -\" PostScript, PDF, proprietary formats that can be read and edited only -\" by proprietary word processors, SGML or XML for which the DTD and/or -\" processing tools are not generally available, and the -\" machine-generated HTML produced by some word processors for output -\" purposes only. -\" .PP -\" The "Title Page" means, for a printed book, the title page itself, -\" plus such following pages as are needed to hold, legibly, the material -\" this License requires to appear in the title page. For works in -\" formats which do not have any title page as such, "Title Page" means -\" the text near the most prominent appearance of the work's title, -\" preceding the beginning of the body of the text. -\" .PP -\" 2. VERBATIM COPYING -\" .PP -\" You may copy and distribute the Document in any medium, either -\" commercially or noncommercially, provided that this License, the -\" copyright notices, and the license notice saying this License applies -\" to the Document are reproduced in all copies, and that you add no other -\" conditions whatsoever to those of this License. You may not use -\" technical measures to obstruct or control the reading or further -\" copying of the copies you make or distribute. However, you may accept -\" compensation in exchange for copies. If you distribute a large enough -\" number of copies you must also follow the conditions in section 3. -\" .PP -\" You may also lend copies, under the same conditions stated above, and -\" you may publicly display copies. -\" .PP -\" 3. COPYING IN QUANTITY -\" .PP -\" If you publish printed copies of the Document numbering more than 100, -\" and the Document's license notice requires Cover Texts, you must enclose -\" the copies in covers that carry, clearly and legibly, all these Cover -\" Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -\" the back cover. Both covers must also clearly and legibly identify -\" you as the publisher of these copies. The front cover must present -\" the full title with all words of the title equally prominent and -\" visible. You may add other material on the covers in addition. -\" Copying with changes limited to the covers, as long as they preserve -\" the title of the Document and satisfy these conditions, can be treated -\" as verbatim copying in other respects. -\" .PP -\" If the required texts for either cover are too voluminous to fit -\" legibly, you should put the first ones listed (as many as fit -\" reasonably) on the actual cover, and continue the rest onto adjacent -\" pages. -\" .PP -\" If you publish or distribute Opaque copies of the Document numbering -\" more than 100, you must either include a machine-readable Transparent -\" copy along with each Opaque copy, or state in or with each Opaque copy -\" a publicly-accessible computer-network location containing a complete -\" Transparent copy of the Document, free of added material, which the -\" general network-using public has access to download anonymously at no -\" charge using public-standard network protocols. If you use the latter -\" option, you must take reasonably prudent steps, when you begin -\" distribution of Opaque copies in quantity, to ensure that this -\" Transparent copy will remain thus accessible at the stated location -\" until at least one year after the last time you distribute an Opaque -\" copy (directly or through your agents or retailers) of that edition to -\" the public. -\" .PP -\" It is requested, but not required, that you contact the authors of the -\" Document well before redistributing any large number of copies, to give -\" them a chance to provide you with an updated version of the Document. -\" .PP -\" 4. MODIFICATIONS -\" .PP -\" You may copy and distribute a Modified Version of the Document under -\" the conditions of sections 2 and 3 above, provided that you release -\" the Modified Version under precisely this License, with the Modified -\" Version filling the role of the Document, thus licensing distribution -\" and modification of the Modified Version to whoever possesses a copy -\" of it. In addition, you must do these things in the Modified Version: -\" .PP -\" A. Use in the Title Page (and on the covers, if any) a title distinct -\" from that of the Document, and from those of previous versions -\" (which should, if there were any, be listed in the History section -\" of the Document). You may use the same title as a previous version -\" if the original publisher of that version gives permission. -\" .PP -\" B. List on the Title Page, as authors, one or more persons or entities -\" responsible for authorship of the modifications in the Modified -\" Version, together with at least five of the principal authors of the -\" Document (all of its principal authors, if it has less than five). -\" .PP -\" C. State on the Title page the name of the publisher of the -\" Modified Version, as the publisher. -\" .PP -\" D. Preserve all the copyright notices of the Document. -\" .PP -\" E. Add an appropriate copyright notice for your modifications -\" adjacent to the other copyright notices. -\" .PP -\" F. Include, immediately after the copyright notices, a license notice -\" giving the public permission to use the Modified Version under the -\" terms of this License, in the form shown in the Addendum below. -\" Preserve in that license notice the full lists of Invariant Sections -\" and required Cover Texts given in the Document's license notice. -\" .PP -\" H. Include an unaltered copy of this License. -\" .PP -\" I. Preserve the section entitled "History", and its title, and add to -\" it an item stating at least the title, year, new authors, and -\" publisher of the Modified Version as given on the Title Page. If -\" there is no section entitled "History" in the Document, create one -\" stating the title, year, authors, and publisher of the Document as -\" given on its Title Page, then add an item describing the Modified -\" Version as stated in the previous sentence. -\" .PP -\" J. Preserve the network location, if any, given in the Document for -\" public access to a Transparent copy of the Document, and likewise -\" the network locations given in the Document for previous versions -\" it was based on. These may be placed in the "History" section. -\" You may omit a network location for a work that was published at -\" least four years before the Document itself, or if the original -\" publisher of the version it refers to gives permission. -\" .PP -\" K. In any section entitled "Acknowledgements" or "Dedications", -\" preserve the section's title, and preserve in the section all the -\" substance and tone of each of the contributor acknowledgements -\" and/or dedications given therein. -\" .PP -\" L. Preserve all the Invariant Sections of the Document, -\" unaltered in their text and in their titles. Section numbers -\" or the equivalent are not considered part of the section titles. -\" .PP -\" M. Delete any section entitled "Endorsements". Such a section -\" may not be included in the Modified Version. -\" .PP -\" N. Do not retitle any existing section as "Endorsements" -\" or to conflict in title with any Invariant Section. -\" .PP -\" If the Modified Version includes new front-matter sections or -\" appendices that qualify as Secondary Sections and contain no material -\" copied from the Document, you may at your option designate some or all -\" of these sections as invariant. To do this, add their titles to the -\" list of Invariant Sections in the Modified Version's license notice. -\" These titles must be distinct from any other section titles. -\" .PP -\" You may add a section entitled "Endorsements", provided it contains -\" nothing but endorsements of your Modified Version by various -\" parties--for example, statements of peer review or that the text has -\" been approved by an organization as the authoritative definition of a -\" standard. -\" .PP -\" You may add a passage of up to five words as a Front-Cover Text, and a -\" passage of up to 25 words as a Back-Cover Text, to the end of the list -\" of Cover Texts in the Modified Version. Only one passage of -\" Front-Cover Text and one of Back-Cover Text may be added by (or -\" through arrangements made by) any one entity. If the Document already -\" includes a cover text for the same cover, previously added by you or -\" by arrangement made by the same entity you are acting on behalf of, -\" you may not add another; but you may replace the old one, on explicit -\" permission from the previous publisher that added the old one. -\" .PP -\" The author(s) and publisher(s) of the Document do not by this License -\" give permission to use their names for publicity for or to assert or -\" imply endorsement of any Modified Version. -\" .PP - -\" 5. COMBINING DOCUMENTS -\" .PP -\" You may combine the Document with other documents released under this -\" License, under the terms defined in section 4 above for modified -\" versions, provided that you include in the combination all of the -\" Invariant Sections of all of the original documents, unmodified, and -\" list them all as Invariant Sections of your combined work in its -\" license notice. -\" .PP -\" The combined work need only contain one copy of this License, and -\" multiple identical Invariant Sections may be replaced with a single -\" copy. If there are multiple Invariant Sections with the same name but -\" different contents, make the title of each such section unique by -\" adding at the end of it, in parentheses, the name of the original -\" author or publisher of that section if known, or else a unique number. -\" Make the same adjustment to the section titles in the list of -\" Invariant Sections in the license notice of the combined work. -\" .PP -\" In the combination, you must combine any sections entitled "History" -\" in the various original documents, forming one section entitled -\" "History"; likewise combine any sections entitled "Acknowledgements", -\" and any sections entitled "Dedications". You must delete all sections -\" entitled "Endorsements." -\" .PP - -\" 6. COLLECTIONS OF DOCUMENTS -\" .PP -\" You may make a collection consisting of the Document and other documents -\" released under this License, and replace the individual copies of this -\" License in the various documents with a single copy that is included in -\" the collection, provided that you follow the rules of this License for -\" verbatim copying of each of the documents in all other respects. -\" .PP -\" You may extract a single document from such a collection, and distribute -\" it individually under this License, provided you insert a copy of this -\" License into the extracted document, and follow this License in all -\" other respects regarding verbatim copying of that document. -\" .PP - -\" 7. AGGREGATION WITH INDEPENDENT WORKS -\" .PP -\" A compilation of the Document or its derivatives with other separate -\" and independent documents or works, in or on a volume of a storage or -\" distribution medium, does not as a whole count as a Modified Version -\" of the Document, provided no compilation copyright is claimed for the -\" compilation. Such a compilation is called an "aggregate", and this -\" License does not apply to the other self-contained works thus compiled -\" with the Document, on account of their being thus compiled, if they -\" are not themselves derivative works of the Document. -\" .PP -\" If the Cover Text requirement of section 3 is applicable to these -\" copies of the Document, then if the Document is less than one quarter -\" of the entire aggregate, the Document's Cover Texts may be placed on -\" covers that surround only the Document within the aggregate. -\" Otherwise they must appear on covers around the whole aggregate. -\" .PP - -\" 8. TRANSLATION -\" .PP -\" Translation is considered a kind of modification, so you may -\" distribute translations of the Document under the terms of section 4. -\" Replacing Invariant Sections with translations requires special -\" permission from their copyright holders, but you may include -\" translations of some or all Invariant Sections in addition to the -\" original versions of these Invariant Sections. You may include a -\" translation of this License provided that you also include the -\" original English version of this License. In case of a disagreement -\" between the translation and the original English version of this -\" License, the original English version will prevail. -\" .PP - -\" 9. TERMINATION -\" .PP -\" You may not copy, modify, sublicense, or distribute the Document except -\" as expressly provided for under this License. Any other attempt to -\" copy, modify, sublicense or distribute the Document is void, and will -\" automatically terminate your rights under this License. However, -\" parties who have received copies, or rights, from you under this -\" License will not have their licenses terminated so long as such -\" parties remain in full compliance. -\" .PP - -\" 10. FUTURE REVISIONS OF THIS LICENSE -\" .PP -\" The Free Software Foundation may publish new, revised versions -\" of the GNU Free Documentation License from time to time. Such new -\" versions will be similar in spirit to the present version, but may -\" differ in detail to address new problems or concerns. See -\" http://www.gnu.org/copyleft/. -\" .PP -\" Each version of the License is given a distinguishing version number. -\" If the Document specifies that a particular numbered version of this -\" License "or any later version" applies to it, you have the option of -\" following the terms and conditions either of that specified version or -\" of any later version that has been published (not as a draft) by the -\" Free Software Foundation. If the Document does not specify a version -\" number of this License, you may choose any version ever published (not -\" as a draft) by the Free Software Foundation. -\" .PP - -\" ADDENDUM: How to use this License for your documents -\" .PP -\" To use this License in a document you have written, include a copy of -\" the License in the document and put the following copyright and -\" license notices just after the title page: -\" .PP -\" Copyright (c) YEAR YOUR NAME. -\" Permission is granted to copy, distribute and/or -\" modify this document under the terms of the GNU -\" Free Documentation License, Version 1.1 or any later -\" version published by the Free Software Foundation; -\" with the Invariant Sections being LIST THEIR TITLES, -\" with the Front-Cover Texts being LIST, and with the -\" Back-Cover Texts being LIST. A copy of the license -\" is included in the section entitled "GNU Free -\" Documentation License". -\" .PP -\" If you have no Invariant Sections, write "with no Invariant Sections" -\" instead of saying which ones are invariant. If you have no -\" Front-Cover Texts, write "no Front-Cover Texts" instead of -\" "Front-Cover Texts being LIST"; likewise for Back-Cover Texts. -\" .PP -\" If your document contains nontrivial examples of program code, we -\" recommend releasing these examples in parallel under your choice of -\" free software license, such as the GNU General Public License, -\" to permit their use in free software. diff --git a/contrib/binutils/binutils/binutils.texi b/contrib/binutils/binutils/binutils.texi deleted file mode 100644 index 74e7cda41ee1..000000000000 --- a/contrib/binutils/binutils/binutils.texi +++ /dev/null @@ -1,3469 +0,0 @@ -\input texinfo @c -*- Texinfo -*- -@setfilename binutils.info -@include config.texi - -@ifinfo -@format -START-INFO-DIR-ENTRY -* Binutils: (binutils). The GNU binary utilities. -* ar: (binutils)ar. Create, modify, and extract from archives -* nm: (binutils)nm. List symbols from object files -* objcopy: (binutils)objcopy. Copy and translate object files -* objdump: (binutils)objdump. Display information from object files -* ranlib: (binutils)ranlib. Generate index to archive contents -* readelf: (binutils)readelf. Display the contents of ELF format files. -* size: (binutils)size. List section sizes and total size -* strings: (binutils)strings. List printable strings from files -* strip: (binutils)strip. Discard symbols -* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols -* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt -* addr2line: (binutils)addr2line. Convert addresses to file and line -* nlmconv: (binutils)nlmconv. Converts object code into an NLM -* windres: (binutils)windres. Manipulate Windows resources -* dlltool: (binutils)dlltool. Create files needed to build and use DLLs -END-INFO-DIR-ENTRY -@end format -@end ifinfo - -@ifinfo -Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with no Invariant Sections, with no Front-Cover Texts, and with no - Back-Cover Texts. A copy of the license is included in the - section entitled "GNU Free Documentation License". - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries a copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -@end ifinfo - -@synindex ky cp -@c -@c This file documents the GNU binary utilities "ar", "ld", "objcopy", -@c "objdump", "nm", "size", "strings", "strip", "readelf" and "ranlib". -@c -@c Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. -@c -@c This text may be freely distributed under the terms of the GNU -@c Free Documentation License. -@c - -@setchapternewpage odd -@settitle @sc{gnu} Binary Utilities -@titlepage -@finalout -@title The @sc{gnu} Binary Utilities -@subtitle Version @value{VERSION} -@sp 1 -@subtitle May 1993 -@author Roland H. Pesch -@author Jeffrey M. Osier -@author Cygnus Support -@page - -@tex -{\parskip=0pt \hfill Cygnus Support\par \hfill -\TeX{}info \texinfoversion\par } -@end tex - -@vskip 0pt plus 1filll -Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998, 2000, 2001 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with no Invariant Sections, with no Front-Cover Texts, and with no - Back-Cover Texts. A copy of the license is included in the - section entitled "GNU Free Documentation License". - -@end titlepage - -@node Top -@top Introduction - -@cindex version -This brief manual contains preliminary documentation for the @sc{gnu} binary -utilities (collectively version @value{VERSION}): - -@iftex -@table @code -@item ar -Create, modify, and extract from archives - -@item nm -List symbols from object files - -@item objcopy -Copy and translate object files - -@item objdump -Display information from object files - -@item ranlib -Generate index to archive contents - -@item readelf -Display the contents of ELF format files. - -@item size -List file section sizes and total size - -@item strings -List printable strings from files - -@item strip -Discard symbols - -@item c++filt -Demangle encoded C++ symbols (on MS-DOS, this program is named -@code{cxxfilt}) - -@item addr2line -Convert addresses into file names and line numbers - -@item nlmconv -Convert object code into a Netware Loadable Module - -@item windres -Manipulate Windows resources - -@item dlltool -Create the files needed to build and use Dynamic Link Libraries -@end table -@end iftex - -This document is distributed under the terms of the GNU Free -Documentation License. A copy of the license is included in the -section entitled "GNU Free Documentation License". - -@menu -* ar:: Create, modify, and extract from archives -* nm:: List symbols from object files -* objcopy:: Copy and translate object files -* objdump:: Display information from object files -* ranlib:: Generate index to archive contents -* readelf:: Display the contents of ELF format files. -* size:: List section sizes and total size -* strings:: List printable strings from files -* strip:: Discard symbols -* c++filt:: Filter to demangle encoded C++ symbols -* cxxfilt: c++filt. MS-DOS name for c++filt -* addr2line:: Convert addresses to file and line -* nlmconv:: Converts object code into an NLM -* windres:: Manipulate Windows resources -* dlltool:: Create files needed to build and use DLLs -* Selecting The Target System:: How these utilities determine the target. -* Reporting Bugs:: Reporting Bugs -* GNU Free Documentation License:: GNU Free Documentation License -* Index:: Index -@end menu - -@node ar -@chapter ar - -@kindex ar -@cindex archives -@cindex collections of files -@smallexample -ar [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}] -ar -M [ <mri-script ] -@end smallexample - -The @sc{gnu} @code{ar} program creates, modifies, and extracts from -archives. An @dfn{archive} is a single file holding a collection of -other files in a structure that makes it possible to retrieve -the original individual files (called @dfn{members} of the archive). - -The original files' contents, mode (permissions), timestamp, owner, and -group are preserved in the archive, and can be restored on -extraction. - -@cindex name length -@sc{gnu} @code{ar} can maintain archives whose members have names of any -length; however, depending on how @code{ar} is configured on your -system, a limit on member-name length may be imposed for compatibility -with archive formats maintained with other tools. If it exists, the -limit is often 15 characters (typical of formats related to a.out) or 16 -characters (typical of formats related to coff). - -@cindex libraries -@code{ar} is considered a binary utility because archives of this sort -are most often used as @dfn{libraries} holding commonly needed -subroutines. - -@cindex symbol index -@code{ar} creates an index to the symbols defined in relocatable -object modules in the archive when you specify the modifier @samp{s}. -Once created, this index is updated in the archive whenever @code{ar} -makes a change to its contents (save for the @samp{q} update operation). -An archive with such an index speeds up linking to the library, and -allows routines in the library to call each other without regard to -their placement in the archive. - -You may use @samp{nm -s} or @samp{nm --print-armap} to list this index -table. If an archive lacks the table, another form of @code{ar} called -@code{ranlib} can be used to add just the table. - -@cindex compatibility, @code{ar} -@cindex @code{ar} compatibility -@sc{gnu} @code{ar} is designed to be compatible with two different -facilities. You can control its activity using command-line options, -like the different varieties of @code{ar} on Unix systems; or, if you -specify the single command-line option @samp{-M}, you can control it -with a script supplied via standard input, like the MRI ``librarian'' -program. - -@menu -* ar cmdline:: Controlling @code{ar} on the command line -* ar scripts:: Controlling @code{ar} with a script -@end menu - -@page -@node ar cmdline -@section Controlling @code{ar} on the command line - -@smallexample -ar [-X32_64] [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}] -@end smallexample - -@cindex Unix compatibility, @code{ar} -When you use @code{ar} in the Unix style, @code{ar} insists on at least two -arguments to execute: one keyletter specifying the @emph{operation} -(optionally accompanied by other keyletters specifying -@emph{modifiers}), and the archive name to act on. - -Most operations can also accept further @var{member} arguments, -specifying particular files to operate on. - -@sc{gnu} @code{ar} allows you to mix the operation code @var{p} and modifier -flags @var{mod} in any order, within the first command-line argument. - -If you wish, you may begin the first command-line argument with a -dash. - -@cindex operations on archive -The @var{p} keyletter specifies what operation to execute; it may be -any of the following, but you must specify only one of them: - -@table @code -@item d -@cindex deleting from archive -@emph{Delete} modules from the archive. Specify the names of modules to -be deleted as @var{member}@dots{}; the archive is untouched if you -specify no files to delete. - -If you specify the @samp{v} modifier, @code{ar} lists each module -as it is deleted. - -@item m -@cindex moving in archive -Use this operation to @emph{move} members in an archive. - -The ordering of members in an archive can make a difference in how -programs are linked using the library, if a symbol is defined in more -than one member. - -If no modifiers are used with @code{m}, any members you name in the -@var{member} arguments are moved to the @emph{end} of the archive; -you can use the @samp{a}, @samp{b}, or @samp{i} modifiers to move them to a -specified place instead. - -@item p -@cindex printing from archive -@emph{Print} the specified members of the archive, to the standard -output file. If the @samp{v} modifier is specified, show the member -name before copying its contents to standard output. - -If you specify no @var{member} arguments, all the files in the archive are -printed. - -@item q -@cindex quick append to archive -@emph{Quick append}; Historically, add the files @var{member}@dots{} to the end of -@var{archive}, without checking for replacement. - -The modifiers @samp{a}, @samp{b}, and @samp{i} do @emph{not} affect this -operation; new members are always placed at the end of the archive. - -The modifier @samp{v} makes @code{ar} list each file as it is appended. - -Since the point of this operation is speed, the archive's symbol table -index is not updated, even if it already existed; you can use @samp{ar s} or -@code{ranlib} explicitly to update the symbol table index. - -However, too many different systems assume quick append rebuilds the -index, so GNU ar implements @code{q} as a synonym for @code{r}. - -@item r -@cindex replacement in archive -Insert the files @var{member}@dots{} into @var{archive} (with -@emph{replacement}). This operation differs from @samp{q} in that any -previously existing members are deleted if their names match those being -added. - -If one of the files named in @var{member}@dots{} does not exist, @code{ar} -displays an error message, and leaves undisturbed any existing members -of the archive matching that name. - -By default, new members are added at the end of the file; but you may -use one of the modifiers @samp{a}, @samp{b}, or @samp{i} to request -placement relative to some existing member. - -The modifier @samp{v} used with this operation elicits a line of -output for each file inserted, along with one of the letters @samp{a} or -@samp{r} to indicate whether the file was appended (no old member -deleted) or replaced. - -@item t -@cindex contents of archive -Display a @emph{table} listing the contents of @var{archive}, or those -of the files listed in @var{member}@dots{} that are present in the -archive. Normally only the member name is shown; if you also want to -see the modes (permissions), timestamp, owner, group, and size, you can -request that by also specifying the @samp{v} modifier. - -If you do not specify a @var{member}, all files in the archive -are listed. - -@cindex repeated names in archive -@cindex name duplication in archive -If there is more than one file with the same name (say, @samp{fie}) in -an archive (say @samp{b.a}), @samp{ar t b.a fie} lists only the -first instance; to see them all, you must ask for a complete -listing---in our example, @samp{ar t b.a}. -@c WRS only; per Gumby, this is implementation-dependent, and in a more -@c recent case in fact works the other way. - -@item x -@cindex extract from archive -@emph{Extract} members (named @var{member}) from the archive. You can -use the @samp{v} modifier with this operation, to request that -@code{ar} list each name as it extracts it. - -If you do not specify a @var{member}, all files in the archive -are extracted. - -@end table - -A number of modifiers (@var{mod}) may immediately follow the @var{p} -keyletter, to specify variations on an operation's behavior: - -@table @code -@item a -@cindex relative placement in archive -Add new files @emph{after} an existing member of the -archive. If you use the modifier @samp{a}, the name of an existing archive -member must be present as the @var{relpos} argument, before the -@var{archive} specification. - -@item b -Add new files @emph{before} an existing member of the -archive. If you use the modifier @samp{b}, the name of an existing archive -member must be present as the @var{relpos} argument, before the -@var{archive} specification. (same as @samp{i}). - -@item c -@cindex creating archives -@emph{Create} the archive. The specified @var{archive} is always -created if it did not exist, when you request an update. But a warning is -issued unless you specify in advance that you expect to create it, by -using this modifier. - -@item f -Truncate names in the archive. @sc{gnu} @code{ar} will normally permit file -names of any length. This will cause it to create archives which are -not compatible with the native @code{ar} program on some systems. If -this is a concern, the @samp{f} modifier may be used to truncate file -names when putting them in the archive. - -@item i -Insert new files @emph{before} an existing member of the -archive. If you use the modifier @samp{i}, the name of an existing archive -member must be present as the @var{relpos} argument, before the -@var{archive} specification. (same as @samp{b}). - -@item l -This modifier is accepted but not used. -@c whaffor ar l modifier??? presumably compat; with -@c what???---doc@@cygnus.com, 25jan91 - -@item N -Uses the @var{count} parameter. This is used if there are multiple -entries in the archive with the same name. Extract or delete instance -@var{count} of the given name from the archive. - -@item o -@cindex dates in archive -Preserve the @emph{original} dates of members when extracting them. If -you do not specify this modifier, files extracted from the archive -are stamped with the time of extraction. - -@item P -Use the full path name when matching names in the archive. @sc{gnu} -@code{ar} can not create an archive with a full path name (such archives -are not POSIX complaint), but other archive creators can. This option -will cause @sc{gnu} @code{ar} to match file names using a complete path -name, which can be convenient when extracting a single file from an -archive created by another tool. - -@item s -@cindex writing archive index -Write an object-file index into the archive, or update an existing one, -even if no other change is made to the archive. You may use this modifier -flag either with any operation, or alone. Running @samp{ar s} on an -archive is equivalent to running @samp{ranlib} on it. - -@item S -@cindex not writing archive index -Do not generate an archive symbol table. This can speed up building a -large library in several steps. The resulting archive can not be used -with the linker. In order to build a symbol table, you must omit the -@samp{S} modifier on the last execution of @samp{ar}, or you must run -@samp{ranlib} on the archive. - -@item u -@cindex updating an archive -Normally, @samp{ar r}@dots{} inserts all files -listed into the archive. If you would like to insert @emph{only} those -of the files you list that are newer than existing members of the same -names, use this modifier. The @samp{u} modifier is allowed only for the -operation @samp{r} (replace). In particular, the combination @samp{qu} is -not allowed, since checking the timestamps would lose any speed -advantage from the operation @samp{q}. - -@item v -This modifier requests the @emph{verbose} version of an operation. Many -operations display additional information, such as filenames processed, -when the modifier @samp{v} is appended. - -@item V -This modifier shows the version number of @code{ar}. -@end table - -@code{ar} ignores an initial option spelt @code{-X32_64}, for -compatibility with AIX. The behaviour produced by this option is the -default for GNU @code{ar}. @code{ar} does not support any of the other -@code{-X} options; in particular, it does not support @code{-X32} -which is the default for AIX @code{ar}. - -@node ar scripts -@section Controlling @code{ar} with a script - -@smallexample -ar -M [ <@var{script} ] -@end smallexample - -@cindex MRI compatibility, @code{ar} -@cindex scripts, @code{ar} -If you use the single command-line option @samp{-M} with @code{ar}, you -can control its operation with a rudimentary command language. This -form of @code{ar} operates interactively if standard input is coming -directly from a terminal. During interactive use, @code{ar} prompts for -input (the prompt is @samp{AR >}), and continues executing even after -errors. If you redirect standard input to a script file, no prompts are -issued, and @code{ar} abandons execution (with a nonzero exit code) -on any error. - -The @code{ar} command language is @emph{not} designed to be equivalent -to the command-line options; in fact, it provides somewhat less control -over archives. The only purpose of the command language is to ease the -transition to @sc{gnu} @code{ar} for developers who already have scripts -written for the MRI ``librarian'' program. - -The syntax for the @code{ar} command language is straightforward: -@itemize @bullet -@item -commands are recognized in upper or lower case; for example, @code{LIST} -is the same as @code{list}. In the following descriptions, commands are -shown in upper case for clarity. - -@item -a single command may appear on each line; it is the first word on the -line. - -@item -empty lines are allowed, and have no effect. - -@item -comments are allowed; text after either of the characters @samp{*} -or @samp{;} is ignored. - -@item -Whenever you use a list of names as part of the argument to an @code{ar} -command, you can separate the individual names with either commas or -blanks. Commas are shown in the explanations below, for clarity. - -@item -@samp{+} is used as a line continuation character; if @samp{+} appears -at the end of a line, the text on the following line is considered part -of the current command. -@end itemize - -Here are the commands you can use in @code{ar} scripts, or when using -@code{ar} interactively. Three of them have special significance: - -@code{OPEN} or @code{CREATE} specify a @dfn{current archive}, which is -a temporary file required for most of the other commands. - -@code{SAVE} commits the changes so far specified by the script. Prior -to @code{SAVE}, commands affect only the temporary copy of the current -archive. - -@table @code -@item ADDLIB @var{archive} -@itemx ADDLIB @var{archive} (@var{module}, @var{module}, @dots{} @var{module}) -Add all the contents of @var{archive} (or, if specified, each named -@var{module} from @var{archive}) to the current archive. - -Requires prior use of @code{OPEN} or @code{CREATE}. - -@item ADDMOD @var{member}, @var{member}, @dots{} @var{member} -@c FIXME! w/Replacement?? If so, like "ar r @var{archive} @var{names}" -@c else like "ar q..." -Add each named @var{member} as a module in the current archive. - -Requires prior use of @code{OPEN} or @code{CREATE}. - -@item CLEAR -Discard the contents of the current archive, canceling the effect of -any operations since the last @code{SAVE}. May be executed (with no -effect) even if no current archive is specified. - -@item CREATE @var{archive} -Creates an archive, and makes it the current archive (required for many -other commands). The new archive is created with a temporary name; it -is not actually saved as @var{archive} until you use @code{SAVE}. -You can overwrite existing archives; similarly, the contents of any -existing file named @var{archive} will not be destroyed until @code{SAVE}. - -@item DELETE @var{module}, @var{module}, @dots{} @var{module} -Delete each listed @var{module} from the current archive; equivalent to -@samp{ar -d @var{archive} @var{module} @dots{} @var{module}}. - -Requires prior use of @code{OPEN} or @code{CREATE}. - -@item DIRECTORY @var{archive} (@var{module}, @dots{} @var{module}) -@itemx DIRECTORY @var{archive} (@var{module}, @dots{} @var{module}) @var{outputfile} -List each named @var{module} present in @var{archive}. The separate -command @code{VERBOSE} specifies the form of the output: when verbose -output is off, output is like that of @samp{ar -t @var{archive} -@var{module}@dots{}}. When verbose output is on, the listing is like -@samp{ar -tv @var{archive} @var{module}@dots{}}. - -Output normally goes to the standard output stream; however, if you -specify @var{outputfile} as a final argument, @code{ar} directs the -output to that file. - -@item END -Exit from @code{ar}, with a @code{0} exit code to indicate successful -completion. This command does not save the output file; if you have -changed the current archive since the last @code{SAVE} command, those -changes are lost. - -@item EXTRACT @var{module}, @var{module}, @dots{} @var{module} -Extract each named @var{module} from the current archive, writing them -into the current directory as separate files. Equivalent to @samp{ar -x -@var{archive} @var{module}@dots{}}. - -Requires prior use of @code{OPEN} or @code{CREATE}. - -@ignore -@c FIXME Tokens but no commands??? -@item FULLDIR - -@item HELP -@end ignore - -@item LIST -Display full contents of the current archive, in ``verbose'' style -regardless of the state of @code{VERBOSE}. The effect is like @samp{ar -tv @var{archive}}. (This single command is a @sc{gnu} @code{ar} -enhancement, rather than present for MRI compatibility.) - -Requires prior use of @code{OPEN} or @code{CREATE}. - -@item OPEN @var{archive} -Opens an existing archive for use as the current archive (required for -many other commands). Any changes as the result of subsequent commands -will not actually affect @var{archive} until you next use @code{SAVE}. - -@item REPLACE @var{module}, @var{module}, @dots{} @var{module} -In the current archive, replace each existing @var{module} (named in -the @code{REPLACE} arguments) from files in the current working directory. -To execute this command without errors, both the file, and the module in -the current archive, must exist. - -Requires prior use of @code{OPEN} or @code{CREATE}. - -@item VERBOSE -Toggle an internal flag governing the output from @code{DIRECTORY}. -When the flag is on, @code{DIRECTORY} output matches output from -@samp{ar -tv }@dots{}. - -@item SAVE -Commit your changes to the current archive, and actually save it as a -file with the name specified in the last @code{CREATE} or @code{OPEN} -command. - -Requires prior use of @code{OPEN} or @code{CREATE}. - -@end table - -@iftex -@node ld -@chapter ld -@cindex linker -@kindex ld -The @sc{gnu} linker @code{ld} is now described in a separate manual. -@xref{Top,, Overview,, Using LD: the @sc{gnu} linker}. -@end iftex - -@node nm -@chapter nm -@cindex symbols -@kindex nm - -@smallexample -nm [ -a | --debug-syms ] [ -g | --extern-only ] - [ -B ] [ -C | --demangle[=@var{style}] ] [ -D | --dynamic ] - [ -s | --print-armap ] [ -A | -o | --print-file-name ] - [ -n | -v | --numeric-sort ] [ -p | --no-sort ] - [ -r | --reverse-sort ] [ --size-sort ] [ -u | --undefined-only ] - [ -t @var{radix} | --radix=@var{radix} ] [ -P | --portability ] - [ --target=@var{bfdname} ] [ -f @var{format} | --format=@var{format} ] - [ --defined-only ] [-l | --line-numbers ] [ --no-demangle ] - [ -V | --version ] [ -X 32_64 ] [ --help ] [ @var{objfile}@dots{} ] -@end smallexample - -@sc{gnu} @code{nm} lists the symbols from object files @var{objfile}@dots{}. -If no object files are listed as arguments, @code{nm} assumes the file -@file{a.out}. - -For each symbol, @code{nm} shows: - -@itemize @bullet -@item -The symbol value, in the radix selected by options (see below), or -hexadecimal by default. - -@item -The symbol type. At least the following types are used; others are, as -well, depending on the object file format. If lowercase, the symbol is -local; if uppercase, the symbol is global (external). - -@c Some more detail on exactly what these symbol types are used for -@c would be nice. -@table @code -@item A -The symbol's value is absolute, and will not be changed by further -linking. - -@item B -The symbol is in the uninitialized data section (known as BSS). - -@item C -The symbol is common. Common symbols are uninitialized data. When -linking, multiple common symbols may appear with the same name. If the -symbol is defined anywhere, the common symbols are treated as undefined -references. For more details on common symbols, see the discussion of ---warn-common in @ref{Options,,Linker options,ld.info,The GNU linker}. - -@item D -The symbol is in the initialized data section. - -@item G -The symbol is in an initialized data section for small objects. Some -object file formats permit more efficient access to small data objects, -such as a global int variable as opposed to a large global array. - -@item I -The symbol is an indirect reference to another symbol. This is a GNU -extension to the a.out object file format which is rarely used. - -@item N -The symbol is a debugging symbol. - -@item R -The symbol is in a read only data section. - -@item S -The symbol is in an uninitialized data section for small objects. - -@item T -The symbol is in the text (code) section. - -@item U -The symbol is undefined. - -@item V -The symbol is a weak object. When a weak defined symbol is linked with -a normal defined symbol, the normal defined symbol is used with no error. -When a weak undefined symbol is linked and the symbol is not defined, -the value of the weak symbol becomes zero with no error. - -@item W -The symbol is a weak symbol that has not been specifically tagged as a -weak object symbol. When a weak defined symbol is linked with a normal -defined symbol, the normal defined symbol is used with no error. -When a weak undefined symbol is linked and the symbol is not defined, -the value of the weak symbol becomes zero with no error. - -@item - -The symbol is a stabs symbol in an a.out object file. In this case, the -next values printed are the stabs other field, the stabs desc field, and -the stab type. Stabs symbols are used to hold debugging information; -for more information, see @ref{Top,Stabs,Stabs Overview,stabs.info, The -``stabs'' debug format}. - -@item ? -The symbol type is unknown, or object file format specific. -@end table - -@item -The symbol name. -@end itemize - -The long and short forms of options, shown here as alternatives, are -equivalent. - -@table @code -@item -A -@itemx -o -@itemx --print-file-name -@cindex input file name -@cindex file name -@cindex source file name -Precede each symbol by the name of the input file (or archive member) -in which it was found, rather than identifying the input file once only, -before all of its symbols. - -@item -a -@itemx --debug-syms -@cindex debugging symbols -Display all symbols, even debugger-only symbols; normally these are not -listed. - -@item -B -@cindex @code{nm} format -@cindex @code{nm} compatibility -The same as @samp{--format=bsd} (for compatibility with the MIPS @code{nm}). - -@item -C -@itemx --demangle[=@var{style}] -@cindex demangling in nm -Decode (@dfn{demangle}) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes C++ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. @xref{c++filt}, -for more information on demangling. - -@item --no-demangle -Do not demangle low-level symbol names. This is the default. - -@item -D -@itemx --dynamic -@cindex dynamic symbols -Display the dynamic symbols rather than the normal symbols. This is -only meaningful for dynamic objects, such as certain types of shared -libraries. - -@item -f @var{format} -@itemx --format=@var{format} -@cindex @code{nm} format -@cindex @code{nm} compatibility -Use the output format @var{format}, which can be @code{bsd}, -@code{sysv}, or @code{posix}. The default is @code{bsd}. -Only the first character of @var{format} is significant; it can be -either upper or lower case. - -@item -g -@itemx --extern-only -@cindex external symbols -Display only external symbols. - -@item -l -@itemx --line-numbers -@cindex symbol line numbers -For each symbol, use debugging information to try to find a filename and -line number. For a defined symbol, look for the line number of the -address of the symbol. For an undefined symbol, look for the line -number of a relocation entry which refers to the symbol. If line number -information can be found, print it after the other symbol information. - -@item -n -@itemx -v -@itemx --numeric-sort -Sort symbols numerically by their addresses, rather than alphabetically -by their names. - -@item -p -@itemx --no-sort -@cindex sorting symbols -Do not bother to sort the symbols in any order; print them in the order -encountered. - -@item -P -@itemx --portability -Use the POSIX.2 standard output format instead of the default format. -Equivalent to @samp{-f posix}. - -@item -s -@itemx --print-armap -@cindex symbol index, listing -When listing symbols from archive members, include the index: a mapping -(stored in the archive by @code{ar} or @code{ranlib}) of which modules -contain definitions for which names. - -@item -r -@itemx --reverse-sort -Reverse the order of the sort (whether numeric or alphabetic); let the -last come first. - -@item --size-sort -Sort symbols by size. The size is computed as the difference between -the value of the symbol and the value of the symbol with the next higher -value. The size of the symbol is printed, rather than the value. - -@item -t @var{radix} -@itemx --radix=@var{radix} -Use @var{radix} as the radix for printing the symbol values. It must be -@samp{d} for decimal, @samp{o} for octal, or @samp{x} for hexadecimal. - -@item --target=@var{bfdname} -@cindex object code format -Specify an object code format other than your system's default format. -@xref{Target Selection}, for more information. - -@item -u -@itemx --undefined-only -@cindex external symbols -@cindex undefined symbols -Display only undefined symbols (those external to each object file). - -@item --defined-only -@cindex external symbols -@cindex undefined symbols -Display only defined symbols for each object file. - -@item -V -@itemx --version -Show the version number of @code{nm} and exit. - -@item -X -This option is ignored for compatibility with the AIX version of -@code{nm}. It takes one parameter which must be the string -@code{32_64}. The default mode of AIX @code{nm} corresponds -to @code{-X 32}, which is not supported by @sc{gnu} @code{nm}. - -@item --help -Show a summary of the options to @code{nm} and exit. -@end table - -@node objcopy -@chapter objcopy - -@smallexample -objcopy [ -F @var{bfdname} | --target=@var{bfdname} ] - [ -I @var{bfdname} | --input-target=@var{bfdname} ] - [ -O @var{bfdname} | --output-target=@var{bfdname} ] - [ -S | --strip-all ] [ -g | --strip-debug ] - [ -K @var{symbolname} | --keep-symbol=@var{symbolname} ] - [ -N @var{symbolname} | --strip-symbol=@var{symbolname} ] - [ -G @var{symbolname} | --keep-global-symbol=@var{symbolname}] - [ -L @var{symbolname} | --localize-symbol=@var{symbolname} ] - [ -W @var{symbolname} | --weaken-symbol=@var{symbolname} ] - [ -x | --discard-all ] [ -X | --discard-locals ] - [ -b @var{byte} | --byte=@var{byte} ] - [ -i @var{interleave} | --interleave=@var{interleave} ] - [ -j @var{sectionname} | --only-section=@var{sectionname} ] - [ -R @var{sectionname} | --remove-section=@var{sectionname} ] - [ -p | --preserve-dates ] [ --debugging ] - [ --gap-fill=@var{val} ] [ --pad-to=@var{address} ] - [ --set-start=@var{val} ] [ --adjust-start=@var{incr} ] - [ --change-addresses=@var{incr} ] - [ --change-section-address @var{section}@{=,+,-@}@var{val} ] - [ --change-section-lma @var{section}@{=,+,-@}@var{val} ] - [ --change-section-vma @var{section}@{=,+,-@}@var{val} ] - [ --change-warnings ] [ --no-change-warnings ] - [ --set-section-flags @var{section}=@var{flags} ] - [ --add-section @var{sectionname}=@var{filename} ] - [ --change-leading-char ] [ --remove-leading-char ] - [ --srec-len=@var{ival} ] [ --srec-forceS3 ] - [ --redefine-sym @var{old}=@var{new} ] [ --weaken ] - [ --keep-symbols=@var{filename} ] - [ --strip-symbols=@var{filename} ] - [ --keep-global-symbols=@var{filename} ] - [ --localize-symbols=@var{filename} ] - [ --weaken-symbols=@var{filename} ] - [ -v | --verbose ] [ -V | --version ] [ --help ] - @var{infile} [@var{outfile}] -@end smallexample - -The @sc{gnu} @code{objcopy} utility copies the contents of an object -file to another. @code{objcopy} uses the @sc{gnu} @sc{bfd} Library to -read and write the object files. It can write the destination object -file in a format different from that of the source object file. The -exact behavior of @code{objcopy} is controlled by command-line options. -Note that @code{objcopy} should be able to copy a fully linked file -between any two formats. However, copying a relocatable object file -between any two formats may not work as expected. - -@code{objcopy} creates temporary files to do its translations and -deletes them afterward. @code{objcopy} uses @sc{bfd} to do all its -translation work; it has access to all the formats described in @sc{bfd} -and thus is able to recognize most formats without being told -explicitly. @xref{BFD,,BFD,ld.info,Using LD}. - -@code{objcopy} can be used to generate S-records by using an output -target of @samp{srec} (e.g., use @samp{-O srec}). - -@code{objcopy} can be used to generate a raw binary file by using an -output target of @samp{binary} (e.g., use @samp{-O binary}). When -@code{objcopy} generates a raw binary file, it will essentially produce -a memory dump of the contents of the input object file. All symbols and -relocation information will be discarded. The memory dump will start at -the load address of the lowest section copied into the output file. - -When generating an S-record or a raw binary file, it may be helpful to -use @samp{-S} to remove sections containing debugging information. In -some cases @samp{-R} will be useful to remove sections which contain -information that is not needed by the binary file. - -Note - @code{objcopy} is not able to change the endianness of its input -files. If the input format has an endianness, (some formats do not), -@code{objcopy} can only copy the inputs into file formats that have the -same endianness or which have no endianness (eg @samp{srec}). - -@table @code -@item @var{infile} -@itemx @var{outfile} -The input and output files, respectively. -If you do not specify @var{outfile}, @code{objcopy} creates a -temporary file and destructively renames the result with -the name of @var{infile}. - -@item -I @var{bfdname} -@itemx --input-target=@var{bfdname} -Consider the source file's object format to be @var{bfdname}, rather than -attempting to deduce it. @xref{Target Selection}, for more information. - -@item -O @var{bfdname} -@itemx --output-target=@var{bfdname} -Write the output file using the object format @var{bfdname}. -@xref{Target Selection}, for more information. - -@item -F @var{bfdname} -@itemx --target=@var{bfdname} -Use @var{bfdname} as the object format for both the input and the output -file; i.e., simply transfer data from source to destination with no -translation. @xref{Target Selection}, for more information. - -@item -j @var{sectionname} -@itemx --only-section=@var{sectionname} -Copy only the named section from the input file to the output file. -This option may be given more than once. Note that using this option -inappropriately may make the output file unusable. - -@item -R @var{sectionname} -@itemx --remove-section=@var{sectionname} -Remove any section named @var{sectionname} from the output file. This -option may be given more than once. Note that using this option -inappropriately may make the output file unusable. - -@item -S -@itemx --strip-all -Do not copy relocation and symbol information from the source file. - -@item -g -@itemx --strip-debug -Do not copy debugging symbols from the source file. - -@item --strip-unneeded -Strip all symbols that are not needed for relocation processing. - -@item -K @var{symbolname} -@itemx --keep-symbol=@var{symbolname} -Copy only symbol @var{symbolname} from the source file. This option may -be given more than once. - -@item -N @var{symbolname} -@itemx --strip-symbol=@var{symbolname} -Do not copy symbol @var{symbolname} from the source file. This option -may be given more than once. - -@item -G @var{symbolname} -@itemx --keep-global-symbol=@var{symbolname} -Keep only symbol @var{symbolname} global. Make all other symbols local -to the file, so that they are not visible externally. This option may -be given more than once. - -@item -L @var{symbolname} -@itemx --localize-symbol=@var{symbolname} -Make symbol @var{symbolname} local to the file, so that it is not -visible externally. This option may be given more than once. - -@item -W @var{symbolname} -@itemx --weaken-symbol=@var{symbolname} -Make symbol @var{symbolname} weak. This option may be given more than once. - -@item -x -@itemx --discard-all -Do not copy non-global symbols from the source file. -@c FIXME any reason to prefer "non-global" to "local" here? - -@item -X -@itemx --discard-locals -Do not copy compiler-generated local symbols. -(These usually start with @samp{L} or @samp{.}.) - -@item -b @var{byte} -@itemx --byte=@var{byte} -Keep only every @var{byte}th byte of the input file (header data is not -affected). @var{byte} can be in the range from 0 to @var{interleave}-1, -where @var{interleave} is given by the @samp{-i} or @samp{--interleave} -option, or the default of 4. This option is useful for creating files -to program @sc{rom}. It is typically used with an @code{srec} output -target. - -@item -i @var{interleave} -@itemx --interleave=@var{interleave} -Only copy one out of every @var{interleave} bytes. Select which byte to -copy with the @var{-b} or @samp{--byte} option. The default is 4. -@code{objcopy} ignores this option if you do not specify either @samp{-b} or -@samp{--byte}. - -@item -p -@itemx --preserve-dates -Set the access and modification dates of the output file to be the same -as those of the input file. - -@item --debugging -Convert debugging information, if possible. This is not the default -because only certain debugging formats are supported, and the -conversion process can be time consuming. - -@item --gap-fill @var{val} -Fill gaps between sections with @var{val}. This operation applies to -the @emph{load address} (LMA) of the sections. It is done by increasing -the size of the section with the lower address, and filling in the extra -space created with @var{val}. - -@item --pad-to @var{address} -Pad the output file up to the load address @var{address}. This is -done by increasing the size of the last section. The extra space is -filled in with the value specified by @samp{--gap-fill} (default zero). - -@item --set-start @var{val} -Set the start address of the new file to @var{val}. Not all object file -formats support setting the start address. - -@item --change-start @var{incr} -@itemx --adjust-start @var{incr} -@cindex changing start address -Change the start address by adding @var{incr}. Not all object file -formats support setting the start address. - -@item --change-addresses @var{incr} -@itemx --adjust-vma @var{incr} -@cindex changing object addresses -Change the VMA and LMA addresses of all sections, as well as the start -address, by adding @var{incr}. Some object file formats do not permit -section addresses to be changed arbitrarily. Note that this does not -relocate the sections; if the program expects sections to be loaded at a -certain address, and this option is used to change the sections such -that they are loaded at a different address, the program may fail. - -@item --change-section-address @var{section}@{=,+,-@}@var{val} -@itemx --adjust-section-vma @var{section}@{=,+,-@}@var{val} -@cindex changing section address -Set or change both the VMA address and the LMA address of the named -@var{section}. If @samp{=} is used, the section address is set to -@var{val}. Otherwise, @var{val} is added to or subtracted from the -section address. See the comments under @samp{--change-addresses}, -above. If @var{section} does not exist in the input file, a warning will -be issued, unless @samp{--no-change-warnings} is used. - -@item --change-section-lma @var{section}@{=,+,-@}@var{val} -@cindex changing section LMA -Set or change the LMA address of the named @var{section}. The LMA -address is the address where the section will be loaded into memory at -program load time. Normally this is the same as the VMA address, which -is the address of the section at program run time, but on some systems, -especially those where a program is held in ROM, the two can be -different. If @samp{=} is used, the section address is set to -@var{val}. Otherwise, @var{val} is added to or subtracted from the -section address. See the comments under @samp{--change-addresses}, -above. If @var{section} does not exist in the input file, a warning -will be issued, unless @samp{--no-change-warnings} is used. - -@item --change-section-vma @var{section}@{=,+,-@}@var{val} -@cindex changing section VMA -Set or change the VMA address of the named @var{section}. The VMA -address is the address where the section will be located once the -program has started executing. Normally this is the same as the LMA -address, which is the address where the section will be loaded into -memory, but on some systems, especially those where a program is held in -ROM, the two can be different. If @samp{=} is used, the section address -is set to @var{val}. Otherwise, @var{val} is added to or subtracted -from the section address. See the comments under -@samp{--change-addresses}, above. If @var{section} does not exist in -the input file, a warning will be issued, unless -@samp{--no-change-warnings} is used. - -@item --change-warnings -@itemx --adjust-warnings -If @samp{--change-section-address} or @samp{--change-section-lma} or -@samp{--change-section-vma} is used, and the named section does not -exist, issue a warning. This is the default. - -@item --no-change-warnings -@itemx --no-adjust-warnings -Do not issue a warning if @samp{--change-section-address} or -@samp{--adjust-section-lma} or @samp{--adjust-section-vma} is used, even -if the named section does not exist. - -@item --set-section-flags @var{section}=@var{flags} -Set the flags for the named section. The @var{flags} argument is a -comma separated string of flag names. The recognized names are -@samp{alloc}, @samp{contents}, @samp{load}, @samp{noload}, -@samp{readonly}, @samp{code}, @samp{data}, @samp{rom}, @samp{share}, and -@samp{debug}. You can set the @samp{contents} flag for a section which -does not have contents, but it is not meaningful to clear the -@samp{contents} flag of a section which does have contents--just remove -the section instead. Not all flags are meaningful for all object file -formats. - -@item --add-section @var{sectionname}=@var{filename} -Add a new section named @var{sectionname} while copying the file. The -contents of the new section are taken from the file @var{filename}. The -size of the section will be the size of the file. This option only -works on file formats which can support sections with arbitrary names. - -@item --change-leading-char -Some object file formats use special characters at the start of -symbols. The most common such character is underscore, which compilers -often add before every symbol. This option tells @code{objcopy} to -change the leading character of every symbol when it converts between -object file formats. If the object file formats use the same leading -character, this option has no effect. Otherwise, it will add a -character, or remove a character, or change a character, as -appropriate. - -@item --remove-leading-char -If the first character of a global symbol is a special symbol leading -character used by the object file format, remove the character. The -most common symbol leading character is underscore. This option will -remove a leading underscore from all global symbols. This can be useful -if you want to link together objects of different file formats with -different conventions for symbol names. This is different from -@code{--change-leading-char} because it always changes the symbol name -when appropriate, regardless of the object file format of the output -file. - -@item --srec-len=@var{ival} -Meaningful only for srec output. Set the maximum length of the Srecords -being produced to @var{ival}. This length covers both address, data and -crc fields. - -@item --srec-forceS3 -Meaningful only for srec output. Avoid generation of S1/S2 records, -creating S3-only record format. - -@item --redefine-sym @var{old}=@var{new} -Change the name of a symbol @var{old}, to @var{new}. This can be useful -when one is trying link two things together for which you have no -source, and there are name collisions. - -@item --weaken -Change all global symbols in the file to be weak. This can be useful -when building an object which will be linked against other objects using -the @code{-R} option to the linker. This option is only effective when -using an object file format which supports weak symbols. - -@item --keep-symbols=@var{filename} -Apply @samp{--keep-symbol} option to each symbol listed in the file -@var{filename}. @var{filename} is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. - -@item --strip-symbols=@var{filename} -Apply @samp{--strip-symbol} option to each symbol listed in the file -@var{filename}. @var{filename} is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. - -@item --keep-global-symbols=@var{filename} -Apply @samp{--keep-global-symbol} option to each symbol listed in the -file @var{filename}. @var{filename} is simply a flat file, with one -symbol name per line. Line comments may be introduced by the hash -character. This option may be given more than once. - -@item --localize-symbols=@var{filename} -Apply @samp{--localize-symbol} option to each symbol listed in the file -@var{filename}. @var{filename} is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. - -@item --weaken-symbols=@var{filename} -Apply @samp{--weaken-symbol} option to each symbol listed in the file -@var{filename}. @var{filename} is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. - -@item -V -@itemx --version -Show the version number of @code{objcopy}. - -@item -v -@itemx --verbose -Verbose output: list all object files modified. In the case of -archives, @samp{objcopy -V} lists all members of the archive. - -@item --help -Show a summary of the options to @code{objcopy}. -@end table - -@node objdump -@chapter objdump - -@cindex object file information -@kindex objdump - -@smallexample -objdump [ -a | --archive-headers ] - [ -b @var{bfdname} | --target=@var{bfdname} ] - [ -C | --demangle[=@var{style}] ] - [ -d | --disassemble ] - [ -D | --disassemble-all ] - [ -z | --disassemble-zeroes ] - [ -EB | -EL | --endian=@{big | little @} ] - [ -f | --file-headers ] - [ --file-start-context ] - [ -g | --debugging ] - [ -h | --section-headers | --headers ] - [ -i | --info ] - [ -j @var{section} | --section=@var{section} ] - [ -l | --line-numbers ] - [ -S | --source ] - [ -m @var{machine} | --architecture=@var{machine} ] - [ -M @var{options} | --disassembler-options=@var{options}] - [ -p | --private-headers ] - [ -r | --reloc ] - [ -R | --dynamic-reloc ] - [ -s | --full-contents ] - [ -G | --stabs ] - [ -t | --syms ] - [ -T | --dynamic-syms ] - [ -x | --all-headers ] - [ -w | --wide ] - [ --start-address=@var{address} ] - [ --stop-address=@var{address} ] - [ --prefix-addresses] - [ --[no-]show-raw-insn ] - [ --adjust-vma=@var{offset} ] - [ -V | --version ] - [ -H | --help ] - @var{objfile}@dots{} -@end smallexample - -@code{objdump} displays information about one or more object files. -The options control what particular information to display. This -information is mostly useful to programmers who are working on the -compilation tools, as opposed to programmers who just want their -program to compile and work. - -@var{objfile}@dots{} are the object files to be examined. When you -specify archives, @code{objdump} shows information on each of the member -object files. - -The long and short forms of options, shown here as alternatives, are -equivalent. At least one option from the list -@samp{-a,-d,-D,-f,-g,-G,-h,-H,-p,-r,-R,-S,-t,-T,-V,-x} must be given. - -@table @code -@item -a -@itemx --archive-header -@cindex archive headers -If any of the @var{objfile} files are archives, display the archive -header information (in a format similar to @samp{ls -l}). Besides the -information you could list with @samp{ar tv}, @samp{objdump -a} shows -the object file format of each archive member. - -@item --adjust-vma=@var{offset} -@cindex section addresses in objdump -@cindex VMA in objdump -When dumping information, first add @var{offset} to all the section -addresses. This is useful if the section addresses do not correspond to -the symbol table, which can happen when putting sections at particular -addresses when using a format which can not represent section addresses, -such as a.out. - -@item -b @var{bfdname} -@itemx --target=@var{bfdname} -@cindex object code format -Specify that the object-code format for the object files is -@var{bfdname}. This option may not be necessary; @var{objdump} can -automatically recognize many formats. - -For example, -@example -objdump -b oasys -m vax -h fu.o -@end example -@noindent -displays summary information from the section headers (@samp{-h}) of -@file{fu.o}, which is explicitly identified (@samp{-m}) as a VAX object -file in the format produced by Oasys compilers. You can list the -formats available with the @samp{-i} option. -@xref{Target Selection}, for more information. - -@item -C -@itemx --demangle[=@var{style}] -@cindex demangling in objdump -Decode (@dfn{demangle}) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes C++ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. @xref{c++filt}, -for more information on demangling. - -@item -G -@item --debugging -Display debugging information. This attempts to parse debugging -information stored in the file and print it out using a C like syntax. -Only certain types of debugging information have been implemented. - -@item -d -@itemx --disassemble -@cindex disassembling object code -@cindex machine instructions -Display the assembler mnemonics for the machine instructions from -@var{objfile}. This option only disassembles those sections which are -expected to contain instructions. - -@item -D -@itemx --disassemble-all -Like @samp{-d}, but disassemble the contents of all sections, not just -those expected to contain instructions. - -@item --prefix-addresses -When disassembling, print the complete address on each line. This is -the older disassembly format. - -@item --disassemble-zeroes -Normally the disassembly output will skip blocks of zeroes. This -option directs the disassembler to disassemble those blocks, just like -any other data. - -@item -EB -@itemx -EL -@itemx --endian=@{big|little@} -@cindex endianness -@cindex disassembly endianness -Specify the endianness of the object files. This only affects -disassembly. This can be useful when disassembling a file format which -does not describe endianness information, such as S-records. - -@item -f -@itemx --file-header -@cindex object file header -Display summary information from the overall header of -each of the @var{objfile} files. - -@item --file-start-context -@cindex source code context -Specify that when displaying interlisted source code/disassembly -(assumes '-S') from a file that has not yet been displayed, extend the -context to the start of the file. - -@item -h -@itemx --section-header -@itemx --header -@cindex section headers -Display summary information from the section headers of the -object file. - -File segments may be relocated to nonstandard addresses, for example by -using the @samp{-Ttext}, @samp{-Tdata}, or @samp{-Tbss} options to -@code{ld}. However, some object file formats, such as a.out, do not -store the starting address of the file segments. In those situations, -although @code{ld} relocates the sections correctly, using @samp{objdump --h} to list the file section headers cannot show the correct addresses. -Instead, it shows the usual addresses, which are implicit for the -target. - -@item --help -Print a summary of the options to @code{objdump} and exit. - -@item -i -@itemx --info -@cindex architectures available -@cindex object formats available -Display a list showing all architectures and object formats available -for specification with @samp{-b} or @samp{-m}. - -@item -j @var{name} -@itemx --section=@var{name} -@cindex section information -Display information only for section @var{name}. - -@item -l -@itemx --line-numbers -@cindex source filenames for object files -Label the display (using debugging information) with the filename and -source line numbers corresponding to the object code or relocs shown. -Only useful with @samp{-d}, @samp{-D}, or @samp{-r}. - -@item -m @var{machine} -@itemx --architecture=@var{machine} -@cindex architecture -@cindex disassembly architecture -Specify the architecture to use when disassembling object files. This -can be useful when disassembling object files which do not describe -architecture information, such as S-records. You can list the available -architectures with the @samp{-i} option. - -@item -M @var{options} -@itemx --disassembler-options=@var{options} -Pass target specific information to the disassembler. Only supported on -some targets. - -If the target is an ARM architecture then this switch can be used to -select which register name set is used during disassembler. Specifying -@samp{-M reg-name-std} (the default) will select the register names as -used in ARM's instruction set documentation, but with register 13 called -'sp', register 14 called 'lr' and register 15 called 'pc'. Specifying -@samp{-M reg-names-apcs} will select the name set used by the ARM -Procedure Call Standard, whilst specifying @samp{-M reg-names-raw} will -just use @samp{r} followed by the register number. - -There are also two variants on the APCS register naming scheme enabled -by @samp{-M reg-names-atpcs} and @samp{-M reg-names-special-atpcs} which -use the ARM/Thumb Procedure Call Standard naming conventions. (Either -with the normal register names or the special register names). - -This option can also be used for ARM architectures to force the -disassembler to interpret all instructions as Thumb instructions by -using the switch @samp{--disassembler-options=force-thumb}. This can be -useful when attempting to disassemble thumb code produced by other -compilers. - -@item -p -@itemx --private-headers -Print information that is specific to the object file format. The exact -information printed depends upon the object file format. For some -object file formats, no additional information is printed. - -@item -r -@itemx --reloc -@cindex relocation entries, in object file -Print the relocation entries of the file. If used with @samp{-d} or -@samp{-D}, the relocations are printed interspersed with the -disassembly. - -@item -R -@itemx --dynamic-reloc -@cindex dynamic relocation entries, in object file -Print the dynamic relocation entries of the file. This is only -meaningful for dynamic objects, such as certain types of shared -libraries. - -@item -s -@itemx --full-contents -@cindex sections, full contents -@cindex object file sections -Display the full contents of any sections requested. - -@item -S -@itemx --source -@cindex source disassembly -@cindex disassembly, with source -Display source code intermixed with disassembly, if possible. Implies -@samp{-d}. - -@item --show-raw-insn -When disassembling instructions, print the instruction in hex as well as -in symbolic form. This is the default except when -@code{--prefix-addresses} is used. - -@item --no-show-raw-insn -When disassembling instructions, do not print the instruction bytes. -This is the default when @code{--prefix-addresses} is used. - -@item -G -@item --stabs -@cindex stab -@cindex .stab -@cindex debug symbols -@cindex ELF object file format -Display the full contents of any sections requested. Display the -contents of the .stab and .stab.index and .stab.excl sections from an -ELF file. This is only useful on systems (such as Solaris 2.0) in which -@code{.stab} debugging symbol-table entries are carried in an ELF -section. In most other file formats, debugging symbol-table entries are -interleaved with linkage symbols, and are visible in the @samp{--syms} -output. For more information on stabs symbols, see @ref{Top,Stabs,Stabs -Overview,stabs.info, The ``stabs'' debug format}. - -@item --start-address=@var{address} -@cindex start-address -Start displaying data at the specified address. This affects the output -of the @code{-d}, @code{-r} and @code{-s} options. - -@item --stop-address=@var{address} -@cindex stop-address -Stop displaying data at the specified address. This affects the output -of the @code{-d}, @code{-r} and @code{-s} options. - -@item -t -@itemx --syms -@cindex symbol table entries, printing -Print the symbol table entries of the file. -This is similar to the information provided by the @samp{nm} program. - -@item -T -@itemx --dynamic-syms -@cindex dynamic symbol table entries, printing -Print the dynamic symbol table entries of the file. This is only -meaningful for dynamic objects, such as certain types of shared -libraries. This is similar to the information provided by the @samp{nm} -program when given the @samp{-D} (@samp{--dynamic}) option. - -@item --version -Print the version number of @code{objdump} and exit. - -@item -x -@itemx --all-header -@cindex all header information, object file -@cindex header information, all -Display all available header information, including the symbol table and -relocation entries. Using @samp{-x} is equivalent to specifying all of -@samp{-a -f -h -r -t}. - -@item -w -@itemx --wide -@cindex wide output, printing -Format some lines for output devices that have more than 80 columns. -@end table - -@node ranlib -@chapter ranlib - -@kindex ranlib -@cindex archive contents -@cindex symbol index - -@smallexample -ranlib [-vV] @var{archive} -@end smallexample - -@code{ranlib} generates an index to the contents of an archive and -stores it in the archive. The index lists each symbol defined by a -member of an archive that is a relocatable object file. - -You may use @samp{nm -s} or @samp{nm --print-armap} to list this index. - -An archive with such an index speeds up linking to the library and -allows routines in the library to call each other without regard to -their placement in the archive. - -The @sc{gnu} @code{ranlib} program is another form of @sc{gnu} @code{ar}; running -@code{ranlib} is completely equivalent to executing @samp{ar -s}. -@xref{ar}. - -@table @code -@item -v -@itemx -V -@itemx --version -Show the version number of @code{ranlib}. -@end table - -@node size -@chapter size - -@kindex size -@cindex section sizes - -@smallexample -size [ -A | -B | --format=@var{compatibility} ] - [ --help ] [ -d | -o | -x | --radix=@var{number} ] - [ --target=@var{bfdname} ] [ -V | --version ] - [ @var{objfile}@dots{} ] -@end smallexample - -The @sc{gnu} @code{size} utility lists the section sizes---and the total -size---for each of the object or archive files @var{objfile} in its -argument list. By default, one line of output is generated for each -object file or each module in an archive. - -@var{objfile}@dots{} are the object files to be examined. -If none are specified, the file @code{a.out} will be used. - -The command line options have the following meanings: - -@table @code -@item -A -@itemx -B -@itemx --format=@var{compatibility} -@cindex @code{size} display format -Using one of these options, you can choose whether the output from @sc{gnu} -@code{size} resembles output from System V @code{size} (using @samp{-A}, -or @samp{--format=sysv}), or Berkeley @code{size} (using @samp{-B}, or -@samp{--format=berkeley}). The default is the one-line format similar to -Berkeley's. -@c Bonus for doc-source readers: you can also say --format=strange (or -@c anything else that starts with 's') for sysv, and --format=boring (or -@c anything else that starts with 'b') for Berkeley. - -Here is an example of the Berkeley (default) format of output from -@code{size}: -@smallexample -$ size --format=Berkeley ranlib size -text data bss dec hex filename -294880 81920 11592 388392 5ed28 ranlib -294880 81920 11888 388688 5ee50 size -@end smallexample - -@noindent -This is the same data, but displayed closer to System V conventions: - -@smallexample -$ size --format=SysV ranlib size -ranlib : -section size addr -.text 294880 8192 -.data 81920 303104 -.bss 11592 385024 -Total 388392 - - -size : -section size addr -.text 294880 8192 -.data 81920 303104 -.bss 11888 385024 -Total 388688 -@end smallexample - -@item --help -Show a summary of acceptable arguments and options. - -@item -d -@itemx -o -@itemx -x -@itemx --radix=@var{number} -@cindex @code{size} number format -@cindex radix for section sizes -Using one of these options, you can control whether the size of each -section is given in decimal (@samp{-d}, or @samp{--radix=10}); octal -(@samp{-o}, or @samp{--radix=8}); or hexadecimal (@samp{-x}, or -@samp{--radix=16}). In @samp{--radix=@var{number}}, only the three -values (8, 10, 16) are supported. The total size is always given in two -radices; decimal and hexadecimal for @samp{-d} or @samp{-x} output, or -octal and hexadecimal if you're using @samp{-o}. - -@item --target=@var{bfdname} -@cindex object code format -Specify that the object-code format for @var{objfile} is -@var{bfdname}. This option may not be necessary; @code{size} can -automatically recognize many formats. -@xref{Target Selection}, for more information. - -@item -V -@itemx --version -Display the version number of @code{size}. -@end table - -@node strings -@chapter strings -@kindex strings -@cindex listings strings -@cindex printing strings -@cindex strings, printing - -@smallexample -strings [-afov] [-@var{min-len}] [-n @var{min-len}] [-t @var{radix}] [-] - [--all] [--print-file-name] [--bytes=@var{min-len}] - [--radix=@var{radix}] [--target=@var{bfdname}] - [--help] [--version] @var{file}@dots{} -@end smallexample - -For each @var{file} given, @sc{gnu} @code{strings} prints the printable -character sequences that are at least 4 characters long (or the number -given with the options below) and are followed by an unprintable -character. By default, it only prints the strings from the initialized -and loaded sections of object files; for other types of files, it prints -the strings from the whole file. - -@code{strings} is mainly useful for determining the contents of non-text -files. - -@table @code -@item -a -@itemx --all -@itemx - -Do not scan only the initialized and loaded sections of object files; -scan the whole files. - -@item -f -@itemx --print-file-name -Print the name of the file before each string. - -@item --help -Print a summary of the program usage on the standard output and exit. - -@item -@var{min-len} -@itemx -n @var{min-len} -@itemx --bytes=@var{min-len} -Print sequences of characters that are at least @var{min-len} characters -long, instead of the default 4. - -@item -o -Like @samp{-t o}. Some other versions of @code{strings} have @samp{-o} -act like @samp{-t d} instead. Since we can not be compatible with both -ways, we simply chose one. - -@item -t @var{radix} -@itemx --radix=@var{radix} -Print the offset within the file before each string. The single -character argument specifies the radix of the offset---@samp{o} for -octal, @samp{x} for hexadecimal, or @samp{d} for decimal. - -@item --target=@var{bfdname} -@cindex object code format -Specify an object code format other than your system's default format. -@xref{Target Selection}, for more information. - -@item -v -@itemx --version -Print the program version number on the standard output and exit. -@end table - -@node strip -@chapter strip - -@kindex strip -@cindex removing symbols -@cindex discarding symbols -@cindex symbols, discarding - -@smallexample -strip [ -F @var{bfdname} | --target=@var{bfdname} ] - [ -I @var{bfdname} | --input-target=@var{bfdname} ] - [ -O @var{bfdname} | --output-target=@var{bfdname} ] - [ -s | --strip-all ] [ -S | -g | --strip-debug ] - [ -K @var{symbolname} | --keep-symbol=@var{symbolname} ] - [ -N @var{symbolname} | --strip-symbol=@var{symbolname} ] - [ -x | --discard-all ] [ -X | --discard-locals ] - [ -R @var{sectionname} | --remove-section=@var{sectionname} ] - [ -o @var{file} ] [ -p | --preserve-dates ] - [ -v | --verbose ] [ -V | --version ] [ --help ] - @var{objfile}@dots{} -@end smallexample - -@sc{gnu} @code{strip} discards all symbols from object files -@var{objfile}. The list of object files may include archives. -At least one object file must be given. - -@code{strip} modifies the files named in its argument, -rather than writing modified copies under different names. - -@table @code -@item -F @var{bfdname} -@itemx --target=@var{bfdname} -Treat the original @var{objfile} as a file with the object -code format @var{bfdname}, and rewrite it in the same format. -@xref{Target Selection}, for more information. - -@item --help -Show a summary of the options to @code{strip} and exit. - -@item -I @var{bfdname} -@itemx --input-target=@var{bfdname} -Treat the original @var{objfile} as a file with the object -code format @var{bfdname}. -@xref{Target Selection}, for more information. - -@item -O @var{bfdname} -@itemx --output-target=@var{bfdname} -Replace @var{objfile} with a file in the output format @var{bfdname}. -@xref{Target Selection}, for more information. - -@item -R @var{sectionname} -@itemx --remove-section=@var{sectionname} -Remove any section named @var{sectionname} from the output file. This -option may be given more than once. Note that using this option -inappropriately may make the output file unusable. - -@item -s -@itemx --strip-all -Remove all symbols. - -@item -g -@itemx -S -@itemx --strip-debug -Remove debugging symbols only. - -@item --strip-unneeded -Remove all symbols that are not needed for relocation processing. - -@item -K @var{symbolname} -@itemx --keep-symbol=@var{symbolname} -Keep only symbol @var{symbolname} from the source file. This option may -be given more than once. - -@item -N @var{symbolname} -@itemx --strip-symbol=@var{symbolname} -Remove symbol @var{symbolname} from the source file. This option may be -given more than once, and may be combined with strip options other than -@code{-K}. - -@item -o @var{file} -Put the stripped output in @var{file}, rather than replacing the -existing file. When this argument is used, only one @var{objfile} -argument may be specified. - -@item -p -@itemx --preserve-dates -Preserve the access and modification dates of the file. - -@item -x -@itemx --discard-all -Remove non-global symbols. - -@item -X -@itemx --discard-locals -Remove compiler-generated local symbols. -(These usually start with @samp{L} or @samp{.}.) - -@item -V -@itemx --version -Show the version number for @code{strip}. - -@item -v -@itemx --verbose -Verbose output: list all object files modified. In the case of -archives, @samp{strip -v} lists all members of the archive. -@end table - -@node c++filt, addr2line, strip, Top -@chapter c++filt - -@kindex c++filt -@cindex demangling C++ symbols - -@smallexample -c++filt [ -_ | --strip-underscores ] - [ -j | --java ] - [ -n | --no-strip-underscores ] - [ -s @var{format} | --format=@var{format} ] - [ --help ] [ --version ] [ @var{symbol}@dots{} ] -@end smallexample - -@kindex cxxfilt -The C++ and Java languages provides function overloading, which means -that you can write many functions with the same name (providing each -takes parameters of different types). All C++ and Java function names -are encoded into a low-level assembly label (this process is known as -@dfn{mangling}). The @code{c++filt} -@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on -MS-DOS this program is named @code{cxxfilt}.} -program does the inverse mapping: it decodes (@dfn{demangles}) low-level -names into user-level names so that the linker can keep these overloaded -functions from clashing. - -Every alphanumeric word (consisting of letters, digits, underscores, -dollars, or periods) seen in the input is a potential label. If the -label decodes into a C++ name, the C++ name replaces the low-level -name in the output. - -You can use @code{c++filt} to decipher individual symbols: - -@example -c++filt @var{symbol} -@end example - -If no @var{symbol} arguments are given, @code{c++filt} reads symbol -names from the standard input and writes the demangled names to the -standard output. All results are printed on the standard output. - -@table @code -@item -_ -@itemx --strip-underscores -On some systems, both the C and C++ compilers put an underscore in front -of every name. For example, the C name @code{foo} gets the low-level -name @code{_foo}. This option removes the initial underscore. Whether -@code{c++filt} removes the underscore by default is target dependent. - -@item -j -@itemx --java -Prints demangled names using Java syntax. The default is to use C++ -syntax. - -@item -n -@itemx --no-strip-underscores -Do not remove the initial underscore. - -@item -s @var{format} -@itemx --format=@var{format} -@sc{gnu} @code{nm} can decode three different methods of mangling, used by -different C++ compilers. The argument to this option selects which -method it uses: - -@table @code -@item gnu -the one used by the @sc{gnu} compiler (the default method) -@item lucid -the one used by the Lucid compiler -@item arm -the one specified by the C++ Annotated Reference Manual -@item hp -the one used by the HP compiler -@item edg -the one used by the EDG compiler -@item gnu-new-abi -the one used by the @sc{gnu} compiler with the new ABI. -@end table - -@item --help -Print a summary of the options to @code{c++filt} and exit. - -@item --version -Print the version number of @code{c++filt} and exit. -@end table - -@quotation -@emph{Warning:} @code{c++filt} is a new utility, and the details of its -user interface are subject to change in future releases. In particular, -a command-line option may be required in the the future to decode a name -passed as an argument on the command line; in other words, - -@example -c++filt @var{symbol} -@end example - -@noindent -may in a future release become - -@example -c++filt @var{option} @var{symbol} -@end example -@end quotation - -@node addr2line -@chapter addr2line - -@kindex addr2line -@cindex address to file name and line number - -@smallexample -addr2line [ -b @var{bfdname} | --target=@var{bfdname} ] - [ -C | --demangle[=@var{style} ] - [ -e @var{filename} | --exe=@var{filename} ] - [ -f | --functions ] [ -s | --basename ] - [ -H | --help ] [ -V | --version ] - [ addr addr ... ] -@end smallexample - -@code{addr2line} translates program addresses into file names and line -numbers. Given an address and an executable, it uses the debugging -information in the executable to figure out which file name and line -number are associated with a given address. - -The executable to use is specified with the @code{-e} option. The -default is the file @file{a.out}. - -@code{addr2line} has two modes of operation. - -In the first, hexadecimal addresses are specified on the command line, -and @code{addr2line} displays the file name and line number for each -address. - -In the second, @code{addr2line} reads hexadecimal addresses from -standard input, and prints the file name and line number for each -address on standard output. In this mode, @code{addr2line} may be used -in a pipe to convert dynamically chosen addresses. - -The format of the output is @samp{FILENAME:LINENO}. The file name and -line number for each address is printed on a separate line. If the -@code{-f} option is used, then each @samp{FILENAME:LINENO} line is -preceded by a @samp{FUNCTIONNAME} line which is the name of the function -containing the address. - -If the file name or function name can not be determined, -@code{addr2line} will print two question marks in their place. If the -line number can not be determined, @code{addr2line} will print 0. - -The long and short forms of options, shown here as alternatives, are -equivalent. - -@table @code -@item -b @var{bfdname} -@itemx --target=@var{bfdname} -@cindex object code format -Specify that the object-code format for the object files is -@var{bfdname}. - -@item -C -@itemx --demangle[=@var{style}] -@cindex demangling in objdump -Decode (@dfn{demangle}) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes C++ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. @xref{c++filt}, -for more information on demangling. - -@item -e @var{filename} -@itemx --exe=@var{filename} -Specify the name of the executable for which addresses should be -translated. The default file is @file{a.out}. - -@item -f -@itemx --functions -Display function names as well as file and line number information. - -@item -s -@itemx --basenames -Display only the base of each file name. -@end table - -@node nlmconv -@chapter nlmconv - -@code{nlmconv} converts a relocatable object file into a NetWare -Loadable Module. - -@ignore -@code{nlmconv} currently works with @samp{i386} object -files in @code{coff}, @sc{elf}, or @code{a.out} format, and @sc{SPARC} -object files in @sc{elf}, or @code{a.out} format@footnote{ -@code{nlmconv} should work with any @samp{i386} or @sc{sparc} object -format in the Binary File Descriptor library. It has only been tested -with the above formats.}. -@end ignore - -@quotation -@emph{Warning:} @code{nlmconv} is not always built as part of the binary -utilities, since it is only useful for NLM targets. -@end quotation - -@smallexample -nlmconv [ -I @var{bfdname} | --input-target=@var{bfdname} ] - [ -O @var{bfdname} | --output-target=@var{bfdname} ] - [ -T @var{headerfile} | --header-file=@var{headerfile} ] - [ -d | --debug] [ -l @var{linker} | --linker=@var{linker} ] - [ -h | --help ] [ -V | --version ] - @var{infile} @var{outfile} -@end smallexample - -@code{nlmconv} converts the relocatable @samp{i386} object file -@var{infile} into the NetWare Loadable Module @var{outfile}, optionally -reading @var{headerfile} for NLM header information. For instructions -on writing the NLM command file language used in header files, see the -@samp{linkers} section, @samp{NLMLINK} in particular, of the @cite{NLM -Development and Tools Overview}, which is part of the NLM Software -Developer's Kit (``NLM SDK''), available from Novell, Inc. -@code{nlmconv} uses the @sc{gnu} Binary File Descriptor library to read -@var{infile}; see @ref{BFD,,BFD,ld.info,Using LD}, for -more information. - -@code{nlmconv} can perform a link step. In other words, you can list -more than one object file for input if you list them in the definitions -file (rather than simply specifying one input file on the command line). -In this case, @code{nlmconv} calls the linker for you. - -@table @code -@item -I @var{bfdname} -@itemx --input-target=@var{bfdname} -Object format of the input file. @code{nlmconv} can usually determine -the format of a given file (so no default is necessary). -@xref{Target Selection}, for more information. - -@item -O @var{bfdname} -@itemx --output-target=@var{bfdname} -Object format of the output file. @code{nlmconv} infers the output -format based on the input format, e.g. for a @samp{i386} input file the -output format is @samp{nlm32-i386}. -@xref{Target Selection}, for more information. - -@item -T @var{headerfile} -@itemx --header-file=@var{headerfile} -Reads @var{headerfile} for NLM header information. For instructions on -writing the NLM command file language used in header files, see@ see the -@samp{linkers} section, of the @cite{NLM Development and Tools -Overview}, which is part of the NLM Software Developer's Kit, available -from Novell, Inc. - -@item -d -@itemx --debug -Displays (on standard error) the linker command line used by @code{nlmconv}. - -@item -l @var{linker} -@itemx --linker=@var{linker} -Use @var{linker} for any linking. @var{linker} can be an absolute or a -relative pathname. - -@item -h -@itemx --help -Prints a usage summary. - -@item -V -@itemx --version -Prints the version number for @code{nlmconv}. -@end table - -@node windres -@chapter windres - -@code{windres} may be used to manipulate Windows resources. - -@quotation -@emph{Warning:} @code{windres} is not always built as part of the binary -utilities, since it is only useful for Windows targets. -@end quotation - -@smallexample -windres [options] [input-file] [output-file] -@end smallexample - -@code{windres} reads resources from an input file and copies them into -an output file. Either file may be in one of three formats: - -@table @code -@item rc -A text format read by the Resource Compiler. - -@item res -A binary format generated by the Resource Compiler. - -@item coff -A COFF object or executable. -@end table - -The exact description of these different formats is available in -documentation from Microsoft. - -When @code{windres} converts from the @code{rc} format to the @code{res} -format, it is acting like the Windows Resource Compiler. When -@code{windres} converts from the @code{res} format to the @code{coff} -format, it is acting like the Windows @code{CVTRES} program. - -When @code{windres} generates an @code{rc} file, the output is similar -but not identical to the format expected for the input. When an input -@code{rc} file refers to an external filename, an output @code{rc} file -will instead include the file contents. - -If the input or output format is not specified, @code{windres} will -guess based on the file name, or, for the input file, the file contents. -A file with an extension of @file{.rc} will be treated as an @code{rc} -file, a file with an extension of @file{.res} will be treated as a -@code{res} file, and a file with an extension of @file{.o} or -@file{.exe} will be treated as a @code{coff} file. - -If no output file is specified, @code{windres} will print the resources -in @code{rc} format to standard output. - -The normal use is for you to write an @code{rc} file, use @code{windres} -to convert it to a COFF object file, and then link the COFF file into -your application. This will make the resources described in the -@code{rc} file available to Windows. - -@table @code -@item -i @var{filename} -@itemx --input @var{filename} -The name of the input file. If this option is not used, then -@code{windres} will use the first non-option argument as the input file -name. If there are no non-option arguments, then @code{windres} will -read from standard input. @code{windres} can not read a COFF file from -standard input. - -@item -o @var{filename} -@itemx --output @var{filename} -The name of the output file. If this option is not used, then -@code{windres} will use the first non-option argument, after any used -for the input file name, as the output file name. If there is no -non-option argument, then @code{windres} will write to standard output. -@code{windres} can not write a COFF file to standard output. - -@item -I @var{format} -@itemx --input-format @var{format} -The input format to read. @var{format} may be @samp{res}, @samp{rc}, or -@samp{coff}. If no input format is specified, @code{windres} will -guess, as described above. - -@item -O @var{format} -@itemx --output-format @var{format} -The output format to generate. @var{format} may be @samp{res}, -@samp{rc}, or @samp{coff}. If no output format is specified, -@code{windres} will guess, as described above. - -@item -F @var{target} -@itemx --target @var{target} -Specify the BFD format to use for a COFF file as input or output. This -is a BFD target name; you can use the @code{--help} option to see a list -of supported targets. Normally @code{windres} will use the default -format, which is the first one listed by the @code{--help} option. -@ref{Target Selection}. - -@item --preprocessor @var{program} -When @code{windres} reads an @code{rc} file, it runs it through the C -preprocessor first. This option may be used to specify the preprocessor -to use, including any leading arguments. The default preprocessor -argument is @code{gcc -E -xc-header -DRC_INVOKED}. - -@item --include-dir @var{directory} -Specify an include directory to use when reading an @code{rc} file. -@code{windres} will pass this to the preprocessor as an @code{-I} -option. @code{windres} will also search this directory when looking for -files named in the @code{rc} file. - -@item -D @var{target} -@itemx --define @var{sym}[=@var{val}] -Specify a @code{-D} option to pass to the preprocessor when reading an -@code{rc} file. - -@item -v -Enable verbose mode. This tells you what the preprocessor is if you -didn't specify one. - -@item --language @var{val} -Specify the default language to use when reading an @code{rc} file. -@var{val} should be a hexadecimal language code. The low eight bits are -the language, and the high eight bits are the sublanguage. - -@item --use-temp-file -Use a temporary file to instead of using popen to read the output of -the preprocessor. Use this option if the popen implementation is buggy -on the host (eg., certain non-English language versions of Windows 95 and -Windows 98 are known to have buggy popen where the output will instead -go the console). - -@item --no-use-temp-file -Use popen, not a temporary file, to read the output of the preprocessor. -This is the default behaviour. - -@item --help -Prints a usage summary. - -@item --version -Prints the version number for @code{windres}. - -@item --yydebug -If @code{windres} is compiled with @code{YYDEBUG} defined as @code{1}, -this will turn on parser debugging. -@end table - - -@node dlltool -@chapter Create files needed to build and use DLLs -@cindex DLL -@kindex dlltool - -@code{dlltool} may be used to create the files needed to build and use -dynamic link libraries (DLLs). - -@quotation -@emph{Warning:} @code{dlltool} is not always built as part of the binary -utilities, since it is only useful for those targets which support DLLs. -@end quotation - -@smallexample -dlltool [-d|--input-def @var{def-file-name}] - [-b|--base-file @var{base-file-name}] - [-e|--output-exp @var{exports-file-name}] - [-z|--output-def @var{def-file-name}] - [-l|--output-lib @var{library-file-name}] - [--export-all-symbols] [--no-export-all-symbols] - [--exclude-symbols @var{list}] - [--no-default-excludes] - [-S|--as @var{path-to-assembler}] [-f|--as-flags @var{options}] - [-D|--dllname @var{name}] [-m|--machine @var{machine}] - [-a|--add-indirect] [-U|--add-underscore] [-k|--kill-at] - [-A|--add-stdcall-alias] - [-x|--no-idata4] [-c|--no-idata5] [-i|--interwork] - [-n|--nodelete] [-v|--verbose] [-h|--help] [-V|--version] - [object-file @dots{}] -@end smallexample - -@code{dlltool} reads its inputs, which can come from the @samp{-d} and -@samp{-b} options as well as object files specified on the command -line. It then processes these inputs and if the @samp{-e} option has -been specified it creates a exports file. If the @samp{-l} option -has been specified it creates a library file and if the @samp{-z} option -has been specified it creates a def file. Any or all of the -e, -l -and -z options can be present in one invocation of dlltool. - -When creating a DLL, along with the source for the DLL, it is necessary -to have three other files. @code{dlltool} can help with the creation of -these files. - -The first file is a @samp{.def} file which specifies which functions are -exported from the DLL, which functions the DLL imports, and so on. This -is a text file and can be created by hand, or @code{dlltool} can be used -to create it using the @samp{-z} option. In this case @code{dlltool} -will scan the object files specified on its command line looking for -those functions which have been specially marked as being exported and -put entries for them in the .def file it creates. - -In order to mark a function as being exported from a DLL, it needs to -have an @samp{-export:<name_of_function>} entry in the @samp{.drectve} -section of the object file. This can be done in C by using the -asm() operator: - -@smallexample - asm (".section .drectve"); - asm (".ascii \"-export:my_func\""); - - int my_func (void) @{ @dots{} @} -@end smallexample - -The second file needed for DLL creation is an exports file. This file -is linked with the object files that make up the body of the DLL and it -handles the interface between the DLL and the outside world. This is a -binary file and it can be created by giving the @samp{-e} option to -@code{dlltool} when it is creating or reading in a .def file. - -The third file needed for DLL creation is the library file that programs -will link with in order to access the functions in the DLL. This file -can be created by giving the @samp{-l} option to dlltool when it -is creating or reading in a .def file. - -@code{dlltool} builds the library file by hand, but it builds the -exports file by creating temporary files containing assembler statements -and then assembling these. The @samp{-S} command line option can be -used to specify the path to the assembler that dlltool will use, -and the @samp{-f} option can be used to pass specific flags to that -assembler. The @samp{-n} can be used to prevent dlltool from deleting -these temporary assembler files when it is done, and if @samp{-n} is -specified twice then this will prevent dlltool from deleting the -temporary object files it used to build the library. - -Here is an example of creating a DLL from a source file @samp{dll.c} and -also creating a program (from an object file called @samp{program.o}) -that uses that DLL: - -@smallexample - gcc -c dll.c - dlltool -e exports.o -l dll.lib dll.o - gcc dll.o exports.o -o dll.dll - gcc program.o dll.lib -o program -@end smallexample - -The command line options have the following meanings: - -@table @code - -@item -d @var{filename} -@itemx --input-def @var{filename} -@cindex input .def file -Specifies the name of a .def file to be read in and processed. - -@item -b @var{filename} -@itemx --base-file @var{filename} -@cindex base files -Specifies the name of a base file to be read in and processed. The -contents of this file will be added to the relocation section in the -exports file generated by dlltool. - -@item -e @var{filename} -@itemx --output-exp @var{filename} -Specifies the name of the export file to be created by dlltool. - -@item -z @var{filename} -@itemx --output-def @var{filename} -Specifies the name of the .def file to be created by dlltool. - -@item -l @var{filename} -@itemx --output-lib @var{filename} -Specifies the name of the library file to be created by dlltool. - -@item --export-all-symbols -Treat all global and weak defined symbols found in the input object -files as symbols to be exported. There is a small list of symbols which -are not exported by default; see the @code{--no-default-excludes} -option. You may add to the list of symbols to not export by using the -@code{--exclude-symbols} option. - -@item --no-export-all-symbols -Only export symbols explicitly listed in an input .def file or in -@samp{.drectve} sections in the input object files. This is the default -behaviour. The @samp{.drectve} sections are created by @samp{dllexport} -attributes in the source code. - -@item --exclude-symbols @var{list} -Do not export the symbols in @var{list}. This is a list of symbol names -separated by comma or colon characters. The symbol names should not -contain a leading underscore. This is only meaningful when -@code{--export-all-symbols} is used. - -@item --no-default-excludes -When @code{--export-all-symbols} is used, it will by default avoid -exporting certain special symbols. The current list of symbols to avoid -exporting is @samp{DllMain@@12}, @samp{DllEntryPoint@@0}, -@samp{impure_ptr}. You may use the @code{--no-default-excludes} option -to go ahead and export these special symbols. This is only meaningful -when @code{--export-all-symbols} is used. - -@item -S @var{path} -@itemx --as @var{path} -Specifies the path, including the filename, of the assembler to be used -to create the exports file. - -@item -f @var{switches} -@itemx --as-flags @var{switches} -Specifies any specific command line switches to be passed to the -assembler when building the exports file. This option will work even if -the @samp{-S} option is not used. This option only takes one argument, -and if it occurs more than once on the command line, then later -occurrences will override earlier occurrences. So if it is necessary to -pass multiple switches to the assembler they should be enclosed in -double quotes. - -@item -D @var{name} -@itemx --dll-name @var{name} -Specifies the name to be stored in the .def file as the name of the DLL -when the @samp{-e} option is used. If this option is not present, then -the filename given to the @samp{-e} option will be used as the name of -the DLL. - -@item -m @var{machine} -@itemx -machine @var{machine} -Specifies the type of machine for which the library file should be -built. @code{dlltool} has a built in default type, depending upon how -it was created, but this option can be used to override that. This is -normally only useful when creating DLLs for an ARM processor, when the -contents of the DLL are actually encode using Thumb instructions. - -@item -a -@itemx --add-indirect -Specifies that when @code{dlltool} is creating the exports file it -should add a section which allows the exported functions to be -referenced without using the import library. Whatever the hell that -means! - -@item -U -@itemx --add-underscore -Specifies that when @code{dlltool} is creating the exports file it -should prepend an underscore to the names of the exported functions. - -@item -k -@itemx --kill-at -Specifies that when @code{dlltool} is creating the exports file it -should not append the string @samp{@@ <number>}. These numbers are -called ordinal numbers and they represent another way of accessing the -function in a DLL, other than by name. - -@item -A -@itemx --add-stdcall-alias -Specifies that when @code{dlltool} is creating the exports file it -should add aliases for stdcall symbols without @samp{@@ <number>} -in addition to the symbols with @samp{@@ <number>}. - -@item -x -@itemx --no-idata4 -Specifies that when @code{dlltool} is creating the exports and library -files it should omit the .idata4 section. This is for compatibility -with certain operating systems. - -@item -c -@itemx --no-idata5 -Specifies that when @code{dlltool} is creating the exports and library -files it should omit the .idata5 section. This is for compatibility -with certain operating systems. - -@item -i -@itemx --interwork -Specifies that @code{dlltool} should mark the objects in the library -file and exports file that it produces as supporting interworking -between ARM and Thumb code. - -@item -n -@itemx --nodelete -Makes @code{dlltool} preserve the temporary assembler files it used to -create the exports file. If this option is repeated then dlltool will -also preserve the temporary object files it uses to create the library -file. - -@item -v -@itemx --verbose -Make dlltool describe what it is doing. - -@item -h -@itemx --help -Displays a list of command line options and then exits. - -@item -V -@itemx --version -Displays dlltool's version number and then exits. - -@end table - -@node readelf -@chapter readelf - -@cindex ELF file information -@kindex readelf - -@smallexample -readelf [ -a | --all ] - [ -h | --file-header] - [ -l | --program-headers | --segments] - [ -S | --section-headers | --sections] - [ -e | --headers] - [ -s | --syms | --symbols] - [ -n | --notes] - [ -r | --relocs] - [ -d | --dynamic] - [ -V | --version-info] - [ -D | --use-dynamic] - [ -x <number> | --hex-dump=<number>] - [ -w[liaprf] | --debug-dump[=info,=line,=abbrev,=pubnames,=ranges,=frames]] - [ --histogram] - [ -v | --version] - [ -H | --help] - @var{elffile}@dots{} -@end smallexample - -@code{readelf} displays information about one or more ELF format object -files. The options control what particular information to display. - -@var{elffile}@dots{} are the object files to be examined. At the -moment, @code{readelf} does not support examining archives, nor does it -support examing 64 bit ELF files. - -The long and short forms of options, shown here as alternatives, are -equivalent. At least one option besides @samp{-v} or @samp{-H} must be -given. - -@table @code -@item -a -@itemx --all -Equivalent to specifiying @samp{--file-header}, -@samp{--program-headers}, @samp{--sections}, @samp{--symbols}, -@samp{--relocs}, @samp{--dynamic}, @samp{--notes} and -@samp{--version-info}. - -@item -h -@itemx --file-header -@cindex ELF file header information -Displays the information contained in the ELF header at the start of the -file. - -@item -l -@itemx --program-headers -@itemx --segments -@cindex ELF program header information -@cindex ELF segment information -Displays the information contained in the file's segment headers, if it -has any. - -@item -S -@itemx --sections -@itemx --section-headers -@cindex ELF section information -Displays the information contained in the file's section headers, if it -has any. - -@item -s -@itemx --symbols -@itemx --syms -@cindex ELF symbol table information -Displays the entries in symbol table section of the file, if it has one. - -@item -e -@itemx --headers -Display all the headers in the file. Equivalent to @samp{-h -l -S}. - -@item -n -@itemx --notes -@cindex ELF core notes -Displays the contents of the NOTE segment, if it exists. - -@item -r -@itemx --relocs -@cindex ELF reloc information -Displays the contents of the file's relocation section, if it ha one. - -@item -d -@itemx --dynamic -@cindex ELF dynamic section information -Displays the contents of the file's dynamic section, if it has one. - -@item -V -@itemx --version-info -@cindex ELF version sections informations -Displays the contents of the version sections in the file, it they -exist. - -@item -D -@itemx --use-dynamic -When displaying symbols, this option makes @code{readelf} use the -symbol table in the file's dynamic section, rather than the one in the -symbols section. - -@item -x <number> -@itemx --hex-dump=<number> -Displays the contents of the indicated section as a hexadecimal dump. - -@item -w[liaprf] -@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=frames] -Displays the contents of the debug sections in the file, if any are -present. If one of the optional letters or words follows the switch -then only data found in those specific sections will be dumped. - -@item --histogram -Display a histogram of bucket list lengths when displaying the contents -of the symbol tables. - -@item -v -@itemx --version -Display the version number of readelf. - -@item -H -@itemx --help -Display the command line options understood by @code{readelf}. - -@end table - - -@node Selecting The Target System -@chapter Selecting the target system - -You can specify three aspects of the target system to the @sc{gnu} -binary file utilities, each in several ways: - -@itemize @bullet -@item -the target - -@item -the architecture - -@item -the linker emulation (which applies to the linker only) -@end itemize - -In the following summaries, the lists of ways to specify values are in -order of decreasing precedence. The ways listed first override those -listed later. - -The commands to list valid values only list the values for which the -programs you are running were configured. If they were configured with -@samp{--enable-targets=all}, the commands list most of the available -values, but a few are left out; not all targets can be configured in at -once because some of them can only be configured @dfn{native} (on hosts -with the same type as the target system). - -@menu -* Target Selection:: -* Architecture Selection:: -* Linker Emulation Selection:: -@end menu - -@node Target Selection -@section Target Selection - -A @dfn{target} is an object file format. A given target may be -supported for multiple architectures (@pxref{Architecture Selection}). -A target selection may also have variations for different operating -systems or architectures. - -The command to list valid target values is @samp{objdump -i} -(the first column of output contains the relevant information). - -Some sample values are: @samp{a.out-hp300bsd}, @samp{ecoff-littlemips}, -@samp{a.out-sunos-big}. - -You can also specify a target using a configuration triplet. This is -the same sort of name that is passed to @file{configure} to specify a -target. When you use a configuration triplet as an argument, it must be -fully canonicalized. You can see the canonical version of a triplet by -running the shell script @file{config.sub} which is included with the -sources. - -Some sample configuration triplets are: @samp{m68k-hp-bsd}, -@samp{mips-dec-ultrix}, @samp{sparc-sun-sunos}. - -@subheading @code{objdump} Target - -Ways to specify: - -@enumerate -@item -command line option: @samp{-b} or @samp{--target} - -@item -environment variable @code{GNUTARGET} - -@item -deduced from the input file -@end enumerate - -@subheading @code{objcopy} and @code{strip} Input Target - -Ways to specify: - -@enumerate -@item -command line options: @samp{-I} or @samp{--input-target}, or @samp{-F} or @samp{--target} - -@item -environment variable @code{GNUTARGET} - -@item -deduced from the input file -@end enumerate - -@subheading @code{objcopy} and @code{strip} Output Target - -Ways to specify: - -@enumerate -@item -command line options: @samp{-O} or @samp{--output-target}, or @samp{-F} or @samp{--target} - -@item -the input target (see ``@code{objcopy} and @code{strip} Input Target'' above) - -@item -environment variable @code{GNUTARGET} - -@item -deduced from the input file -@end enumerate - -@subheading @code{nm}, @code{size}, and @code{strings} Target - -Ways to specify: - -@enumerate -@item -command line option: @samp{--target} - -@item -environment variable @code{GNUTARGET} - -@item -deduced from the input file -@end enumerate - -@subheading Linker Input Target - -Ways to specify: - -@enumerate -@item -command line option: @samp{-b} or @samp{--format} -(@pxref{Options,,Options,ld.info,Using LD}) - -@item -script command @code{TARGET} -(@pxref{Option Commands,,Option Commands,ld.info,Using LD}) - -@item -environment variable @code{GNUTARGET} -(@pxref{Environment,,Environment,ld.info,Using LD}) - -@item -the default target of the selected linker emulation -(@pxref{Linker Emulation Selection}) -@end enumerate - -@subheading Linker Output Target - -Ways to specify: - -@enumerate -@item -command line option: @samp{-oformat} -(@pxref{Options,,Options,ld.info,Using LD}) - -@item -script command @code{OUTPUT_FORMAT} -(@pxref{Option Commands,,Option Commands,ld.info,Using LD}) - -@item -the linker input target (see ``Linker Input Target'' above) -@end enumerate - -@node Architecture Selection -@section Architecture selection - -An @dfn{architecture} is a type of @sc{cpu} on which an object file is -to run. Its name may contain a colon, separating the name of the -processor family from the name of the particular @sc{cpu}. - -The command to list valid architecture values is @samp{objdump -i} (the -second column contains the relevant information). - -Sample values: @samp{m68k:68020}, @samp{mips:3000}, @samp{sparc}. - -@subheading @code{objdump} Architecture - -Ways to specify: - -@enumerate -@item -command line option: @samp{-m} or @samp{--architecture} - -@item -deduced from the input file -@end enumerate - -@subheading @code{objcopy}, @code{nm}, @code{size}, @code{strings} Architecture - -Ways to specify: - -@enumerate -@item -deduced from the input file -@end enumerate - -@subheading Linker Input Architecture - -Ways to specify: - -@enumerate -@item -deduced from the input file -@end enumerate - -@subheading Linker Output Architecture - -Ways to specify: - -@enumerate -@item -script command @code{OUTPUT_ARCH} -(@pxref{Option Commands,,Option Commands,ld.info,Using LD}) - -@item -the default architecture from the linker output target -(@pxref{Target Selection}) -@end enumerate - -@node Linker Emulation Selection -@section Linker emulation selection - -A linker @dfn{emulation} is a ``personality'' of the linker, which gives -the linker default values for the other aspects of the target system. -In particular, it consists of - -@itemize @bullet -@item -the linker script - -@item -the target - -@item -several ``hook'' functions that are run at certain stages of the linking -process to do special things that some targets require -@end itemize - -The command to list valid linker emulation values is @samp{ld -V}. - -Sample values: @samp{hp300bsd}, @samp{mipslit}, @samp{sun4}. - -Ways to specify: - -@enumerate -@item -command line option: @samp{-m} -(@pxref{Options,,Options,ld.info,Using LD}) - -@item -environment variable @code{LDEMULATION} - -@item -compiled-in @code{DEFAULT_EMULATION} from @file{Makefile}, -which comes from @code{EMUL} in @file{config/@var{target}.mt} -@end enumerate - -@node Reporting Bugs -@chapter Reporting Bugs -@cindex bugs -@cindex reporting bugs - -Your bug reports play an essential role in making the binary utilities -reliable. - -Reporting a bug may help you by bringing a solution to your problem, or -it may not. But in any case the principal function of a bug report is -to help the entire community by making the next version of the binary -utilities work better. Bug reports are your contribution to their -maintenance. - -In order for a bug report to serve its purpose, you must include the -information that enables us to fix the bug. - -@menu -* Bug Criteria:: Have you found a bug? -* Bug Reporting:: How to report bugs -@end menu - -@node Bug Criteria -@section Have you found a bug? -@cindex bug criteria - -If you are not sure whether you have found a bug, here are some guidelines: - -@itemize @bullet -@cindex fatal signal -@cindex crash -@item -If a binary utility gets a fatal signal, for any input whatever, that is -a bug. Reliable utilities never crash. - -@cindex error on valid input -@item -If a binary utility produces an error message for valid input, that is a -bug. - -@item -If you are an experienced user of binary utilities, your suggestions for -improvement are welcome in any case. -@end itemize - -@node Bug Reporting -@section How to report bugs -@cindex bug reports -@cindex bugs, reporting - -A number of companies and individuals offer support for @sc{gnu} -products. If you obtained the binary utilities from a support -organization, we recommend you contact that organization first. - -You can find contact information for many support companies and -individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs -distribution. - -In any event, we also recommend that you send bug reports for the binary -utilities to @samp{bug-binutils@@gnu.org}. - -The fundamental principle of reporting bugs usefully is this: -@strong{report all the facts}. If you are not sure whether to state a -fact or leave it out, state it! - -Often people omit facts because they think they know what causes the -problem and assume that some details do not matter. Thus, you might -assume that the name of a file you use in an example does not matter. -Well, probably it does not, but one cannot be sure. Perhaps the bug is -a stray memory reference which happens to fetch from the location where -that pathname is stored in memory; perhaps, if the pathname were -different, the contents of that location would fool the utility into -doing the right thing despite the bug. Play it safe and give a -specific, complete example. That is the easiest thing for you to do, -and the most helpful. - -Keep in mind that the purpose of a bug report is to enable us to fix the bug if -it is new to us. Therefore, always write your bug reports on the assumption -that the bug has not been reported previously. - -Sometimes people give a few sketchy facts and ask, ``Does this ring a -bell?'' Those bug reports are useless, and we urge everyone to -@emph{refuse to respond to them} except to chide the sender to report -bugs properly. - -To enable us to fix the bug, you should include all these things: - -@itemize @bullet -@item -The version of the utility. Each utility announces it if you start it -with the @samp{--version} argument. - -Without this, we will not know whether there is any point in looking for -the bug in the current version of the binary utilities. - -@item -Any patches you may have applied to the source, including any patches -made to the @code{BFD} library. - -@item -The type of machine you are using, and the operating system name and -version number. - -@item -What compiler (and its version) was used to compile the utilities---e.g. -``@code{gcc-2.7}''. - -@item -The command arguments you gave the utility to observe the bug. To -guarantee you will not omit something important, list them all. A copy -of the Makefile (or the output from make) is sufficient. - -If we were to try to guess the arguments, we would probably guess wrong -and then we might not encounter the bug. - -@item -A complete input file, or set of input files, that will reproduce the -bug. If the utility is reading an object file or files, then it is -generally most helpful to send the actual object files, uuencoded if -necessary to get them through the mail system. Note that -@samp{bug-binutils@@gnu.org} is a mailing list, so you should avoid -sending very large files to it. Making the files available for -anonymous FTP is OK. - -If the source files were produced exclusively using @sc{gnu} programs -(e.g., @code{gcc}, @code{gas}, and/or the @sc{gnu} @code{ld}), then it -may be OK to send the source files rather than the object files. In -this case, be sure to say exactly what version of @code{gcc}, or -whatever, was used to produce the object files. Also say how -@code{gcc}, or whatever, was configured. - -@item -A description of what behavior you observe that you believe is -incorrect. For example, ``It gets a fatal signal.'' - -Of course, if the bug is that the utility gets a fatal signal, then we -will certainly notice it. But if the bug is incorrect output, we might -not notice unless it is glaringly wrong. You might as well not give us -a chance to make a mistake. - -Even if the problem you experience is a fatal signal, you should still -say so explicitly. Suppose something strange is going on, such as your -copy of the utility is out of synch, or you have encountered a bug in -the C library on your system. (This has happened!) Your copy might -crash and ours would not. If you told us to expect a crash, then when -ours fails to crash, we would know that the bug was not happening for -us. If you had not told us to expect a crash, then we would not be able -to draw any conclusion from our observations. - -@item -If you wish to suggest changes to the source, send us context diffs, as -generated by @code{diff} with the @samp{-u}, @samp{-c}, or @samp{-p} -option. Always send diffs from the old file to the new file. If you -wish to discuss something in the @code{ld} source, refer to it by -context, not by line number. - -The line numbers in our development sources will not match those in your -sources. Your line numbers would convey no useful information to us. -@end itemize - -Here are some things that are not necessary: - -@itemize @bullet -@item -A description of the envelope of the bug. - -Often people who encounter a bug spend a lot of time investigating -which changes to the input file will make the bug go away and which -changes will not affect it. - -This is often time consuming and not very useful, because the way we -will find the bug is by running a single example under the debugger -with breakpoints, not by pure deduction from a series of examples. -We recommend that you save your time for something else. - -Of course, if you can find a simpler example to report @emph{instead} -of the original one, that is a convenience for us. Errors in the -output will be easier to spot, running under the debugger will take -less time, and so on. - -However, simplification is not vital; if you do not want to do this, -report the bug anyway and send us the entire test case you used. - -@item -A patch for the bug. - -A patch for the bug does help us if it is a good one. But do not omit -the necessary information, such as the test case, on the assumption that -a patch is all we need. We might see problems with your patch and decide -to fix the problem another way, or we might not understand it at all. - -Sometimes with programs as complicated as the binary utilities it is -very hard to construct an example that will make the program follow a -certain path through the code. If you do not send us the example, we -will not be able to construct one, so we will not be able to verify that -the bug is fixed. - -And if we cannot understand what bug you are trying to fix, or why your -patch should be an improvement, we will not install it. A test case will -help us to understand. - -@item -A guess about what the bug is or what it depends on. - -Such guesses are usually wrong. Even we cannot guess right about such -things without first using the debugger to find the facts. -@end itemize - -@node GNU Free Documentation License -@chapter GNU Free Documentation License -@cindex GNU Free Documentation License - - GNU Free Documentation License - - Version 1.1, March 2000 - - Copyright (C) 2000 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - -0. PREAMBLE - -The purpose of this License is to make a manual, textbook, or other -written document "free" in the sense of freedom: to assure everyone -the effective freedom to copy and redistribute it, with or without -modifying it, either commercially or noncommercially. Secondarily, -this License preserves for the author and publisher a way to get -credit for their work, while not being considered responsible for -modifications made by others. - -This License is a kind of "copyleft", which means that derivative -works of the document must themselves be free in the same sense. It -complements the GNU General Public License, which is a copyleft -license designed for free software. - -We have designed this License in order to use it for manuals for free -software, because free software needs free documentation: a free -program should come with manuals providing the same freedoms that the -software does. But this License is not limited to software manuals; -it can be used for any textual work, regardless of subject matter or -whether it is published as a printed book. We recommend this License -principally for works whose purpose is instruction or reference. - - -1. APPLICABILITY AND DEFINITIONS - -This License applies to any manual or other work that contains a -notice placed by the copyright holder saying it can be distributed -under the terms of this License. The "Document", below, refers to any -such manual or work. Any member of the public is a licensee, and is -addressed as "you". - -A "Modified Version" of the Document means any work containing the -Document or a portion of it, either copied verbatim, or with -modifications and/or translated into another language. - -A "Secondary Section" is a named appendix or a front-matter section of -the Document that deals exclusively with the relationship of the -publishers or authors of the Document to the Document's overall subject -(or to related matters) and contains nothing that could fall directly -within that overall subject. (For example, if the Document is in part a -textbook of mathematics, a Secondary Section may not explain any -mathematics.) The relationship could be a matter of historical -connection with the subject or with related matters, or of legal, -commercial, philosophical, ethical or political position regarding -them. - -The "Invariant Sections" are certain Secondary Sections whose titles -are designated, as being those of Invariant Sections, in the notice -that says that the Document is released under this License. - -The "Cover Texts" are certain short passages of text that are listed, -as Front-Cover Texts or Back-Cover Texts, in the notice that says that -the Document is released under this License. - -A "Transparent" copy of the Document means a machine-readable copy, -represented in a format whose specification is available to the -general public, whose contents can be viewed and edited directly and -straightforwardly with generic text editors or (for images composed of -pixels) generic paint programs or (for drawings) some widely available -drawing editor, and that is suitable for input to text formatters or -for automatic translation to a variety of formats suitable for input -to text formatters. A copy made in an otherwise Transparent file -format whose markup has been designed to thwart or discourage -subsequent modification by readers is not Transparent. A copy that is -not "Transparent" is called "Opaque". - -Examples of suitable formats for Transparent copies include plain -ASCII without markup, Texinfo input format, LaTeX input format, SGML -or XML using a publicly available DTD, and standard-conforming simple -HTML designed for human modification. Opaque formats include -PostScript, PDF, proprietary formats that can be read and edited only -by proprietary word processors, SGML or XML for which the DTD and/or -processing tools are not generally available, and the -machine-generated HTML produced by some word processors for output -purposes only. - -The "Title Page" means, for a printed book, the title page itself, -plus such following pages as are needed to hold, legibly, the material -this License requires to appear in the title page. For works in -formats which do not have any title page as such, "Title Page" means -the text near the most prominent appearance of the work's title, -preceding the beginning of the body of the text. - - -2. VERBATIM COPYING - -You may copy and distribute the Document in any medium, either -commercially or noncommercially, provided that this License, the -copyright notices, and the license notice saying this License applies -to the Document are reproduced in all copies, and that you add no other -conditions whatsoever to those of this License. You may not use -technical measures to obstruct or control the reading or further -copying of the copies you make or distribute. However, you may accept -compensation in exchange for copies. If you distribute a large enough -number of copies you must also follow the conditions in section 3. - -You may also lend copies, under the same conditions stated above, and -you may publicly display copies. - - -3. COPYING IN QUANTITY - -If you publish printed copies of the Document numbering more than 100, -and the Document's license notice requires Cover Texts, you must enclose -the copies in covers that carry, clearly and legibly, all these Cover -Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -the back cover. Both covers must also clearly and legibly identify -you as the publisher of these copies. The front cover must present -the full title with all words of the title equally prominent and -visible. You may add other material on the covers in addition. -Copying with changes limited to the covers, as long as they preserve -the title of the Document and satisfy these conditions, can be treated -as verbatim copying in other respects. - -If the required texts for either cover are too voluminous to fit -legibly, you should put the first ones listed (as many as fit -reasonably) on the actual cover, and continue the rest onto adjacent -pages. - -If you publish or distribute Opaque copies of the Document numbering -more than 100, you must either include a machine-readable Transparent -copy along with each Opaque copy, or state in or with each Opaque copy -a publicly-accessible computer-network location containing a complete -Transparent copy of the Document, free of added material, which the -general network-using public has access to download anonymously at no -charge using public-standard network protocols. If you use the latter -option, you must take reasonably prudent steps, when you begin -distribution of Opaque copies in quantity, to ensure that this -Transparent copy will remain thus accessible at the stated location -until at least one year after the last time you distribute an Opaque -copy (directly or through your agents or retailers) of that edition to -the public. - -It is requested, but not required, that you contact the authors of the -Document well before redistributing any large number of copies, to give -them a chance to provide you with an updated version of the Document. - - -4. MODIFICATIONS - -You may copy and distribute a Modified Version of the Document under -the conditions of sections 2 and 3 above, provided that you release -the Modified Version under precisely this License, with the Modified -Version filling the role of the Document, thus licensing distribution -and modification of the Modified Version to whoever possesses a copy -of it. In addition, you must do these things in the Modified Version: - -A. Use in the Title Page (and on the covers, if any) a title distinct - from that of the Document, and from those of previous versions - (which should, if there were any, be listed in the History section - of the Document). You may use the same title as a previous version - if the original publisher of that version gives permission. -B. List on the Title Page, as authors, one or more persons or entities - responsible for authorship of the modifications in the Modified - Version, together with at least five of the principal authors of the - Document (all of its principal authors, if it has less than five). -C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. -D. Preserve all the copyright notices of the Document. -E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. -F. Include, immediately after the copyright notices, a license notice - giving the public permission to use the Modified Version under the - terms of this License, in the form shown in the Addendum below. -G. Preserve in that license notice the full lists of Invariant Sections - and required Cover Texts given in the Document's license notice. -H. Include an unaltered copy of this License. -I. Preserve the section entitled "History", and its title, and add to - it an item stating at least the title, year, new authors, and - publisher of the Modified Version as given on the Title Page. If - there is no section entitled "History" in the Document, create one - stating the title, year, authors, and publisher of the Document as - given on its Title Page, then add an item describing the Modified - Version as stated in the previous sentence. -J. Preserve the network location, if any, given in the Document for - public access to a Transparent copy of the Document, and likewise - the network locations given in the Document for previous versions - it was based on. These may be placed in the "History" section. - You may omit a network location for a work that was published at - least four years before the Document itself, or if the original - publisher of the version it refers to gives permission. -K. In any section entitled "Acknowledgements" or "Dedications", - preserve the section's title, and preserve in the section all the - substance and tone of each of the contributor acknowledgements - and/or dedications given therein. -L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section titles. -M. Delete any section entitled "Endorsements". Such a section - may not be included in the Modified Version. -N. Do not retitle any existing section as "Endorsements" - or to conflict in title with any Invariant Section. - -If the Modified Version includes new front-matter sections or -appendices that qualify as Secondary Sections and contain no material -copied from the Document, you may at your option designate some or all -of these sections as invariant. To do this, add their titles to the -list of Invariant Sections in the Modified Version's license notice. -These titles must be distinct from any other section titles. - -You may add a section entitled "Endorsements", provided it contains -nothing but endorsements of your Modified Version by various -parties--for example, statements of peer review or that the text has -been approved by an organization as the authoritative definition of a -standard. - -You may add a passage of up to five words as a Front-Cover Text, and a -passage of up to 25 words as a Back-Cover Text, to the end of the list -of Cover Texts in the Modified Version. Only one passage of -Front-Cover Text and one of Back-Cover Text may be added by (or -through arrangements made by) any one entity. If the Document already -includes a cover text for the same cover, previously added by you or -by arrangement made by the same entity you are acting on behalf of, -you may not add another; but you may replace the old one, on explicit -permission from the previous publisher that added the old one. - -The author(s) and publisher(s) of the Document do not by this License -give permission to use their names for publicity for or to assert or -imply endorsement of any Modified Version. - - -5. COMBINING DOCUMENTS - -You may combine the Document with other documents released under this -License, under the terms defined in section 4 above for modified -versions, provided that you include in the combination all of the -Invariant Sections of all of the original documents, unmodified, and -list them all as Invariant Sections of your combined work in its -license notice. - -The combined work need only contain one copy of this License, and -multiple identical Invariant Sections may be replaced with a single -copy. If there are multiple Invariant Sections with the same name but -different contents, make the title of each such section unique by -adding at the end of it, in parentheses, the name of the original -author or publisher of that section if known, or else a unique number. -Make the same adjustment to the section titles in the list of -Invariant Sections in the license notice of the combined work. - -In the combination, you must combine any sections entitled "History" -in the various original documents, forming one section entitled -"History"; likewise combine any sections entitled "Acknowledgements", -and any sections entitled "Dedications". You must delete all sections -entitled "Endorsements." - - -6. COLLECTIONS OF DOCUMENTS - -You may make a collection consisting of the Document and other documents -released under this License, and replace the individual copies of this -License in the various documents with a single copy that is included in -the collection, provided that you follow the rules of this License for -verbatim copying of each of the documents in all other respects. - -You may extract a single document from such a collection, and distribute -it individually under this License, provided you insert a copy of this -License into the extracted document, and follow this License in all -other respects regarding verbatim copying of that document. - - -7. AGGREGATION WITH INDEPENDENT WORKS - -A compilation of the Document or its derivatives with other separate -and independent documents or works, in or on a volume of a storage or -distribution medium, does not as a whole count as a Modified Version -of the Document, provided no compilation copyright is claimed for the -compilation. Such a compilation is called an "aggregate", and this -License does not apply to the other self-contained works thus compiled -with the Document, on account of their being thus compiled, if they -are not themselves derivative works of the Document. - -If the Cover Text requirement of section 3 is applicable to these -copies of the Document, then if the Document is less than one quarter -of the entire aggregate, the Document's Cover Texts may be placed on -covers that surround only the Document within the aggregate. -Otherwise they must appear on covers around the whole aggregate. - - -8. TRANSLATION - -Translation is considered a kind of modification, so you may -distribute translations of the Document under the terms of section 4. -Replacing Invariant Sections with translations requires special -permission from their copyright holders, but you may include -translations of some or all Invariant Sections in addition to the -original versions of these Invariant Sections. You may include a -translation of this License provided that you also include the -original English version of this License. In case of a disagreement -between the translation and the original English version of this -License, the original English version will prevail. - - -9. TERMINATION - -You may not copy, modify, sublicense, or distribute the Document except -as expressly provided for under this License. Any other attempt to -copy, modify, sublicense or distribute the Document is void, and will -automatically terminate your rights under this License. However, -parties who have received copies, or rights, from you under this -License will not have their licenses terminated so long as such -parties remain in full compliance. - - -10. FUTURE REVISIONS OF THIS LICENSE - -The Free Software Foundation may publish new, revised versions -of the GNU Free Documentation License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. See -http://www.gnu.org/copyleft/. - -Each version of the License is given a distinguishing version number. -If the Document specifies that a particular numbered version of this -License "or any later version" applies to it, you have the option of -following the terms and conditions either of that specified version or -of any later version that has been published (not as a draft) by the -Free Software Foundation. If the Document does not specify a version -number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. - - -ADDENDUM: How to use this License for your documents - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and -license notices just after the title page: - -@smallexample - Copyright (c) YEAR YOUR NAME. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with the Invariant Sections being LIST THEIR TITLES, with the - Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. - A copy of the license is included in the section entitled "GNU - Free Documentation License". -@end smallexample - -If you have no Invariant Sections, write "with no Invariant Sections" -instead of saying which ones are invariant. If you have no -Front-Cover Texts, write "no Front-Cover Texts" instead of -"Front-Cover Texts being LIST"; likewise for Back-Cover Texts. - -If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, -to permit their use in free software. - -@node Index -@unnumbered Index - -@printindex cp - -@contents -@bye diff --git a/contrib/binutils/binutils/config.texi b/contrib/binutils/binutils/config.texi deleted file mode 100644 index 56bdd12e9e39..000000000000 --- a/contrib/binutils/binutils/config.texi +++ /dev/null @@ -1 +0,0 @@ -@set VERSION 2.11.2 diff --git a/contrib/binutils/binutils/cxxfilt.man b/contrib/binutils/binutils/cxxfilt.man deleted file mode 100644 index a4d5d45106b6..000000000000 --- a/contrib/binutils/binutils/cxxfilt.man +++ /dev/null @@ -1,114 +0,0 @@ -.\" Copyright (c) 1991 Free Software Foundation -.\" See section COPYING for conditions for redistribution -.TH @PROGRAM@ 1 "June 1993" "cygnus support" "GNU Development Tools" -.de BP -.sp -.ti \-.2i -\(** -.. - -.SH NAME -@PROGRAM@ \- demangle C++ symbols - -.SH SYNOPSIS -.hy 0 -.na -.TP -.B @PROGRAM@ -.RB "[\|" \-_ | \-\-strip-underscores "\|]" -.RB "[\|" "\-s {gnu,lucid,arm} " | " \-\-format={gnu,lucid,arm}" "\|]" -.RB "[\|" \-\-help "\|]" -.RB "[\|" \-\-version "\|]" -.RB "[\|" symbol "...\|]" -.SH DESCRIPTION -The C++ language provides function overloading, which means that you can -write many functions with the same name (providing each takes parameters -of different types). All C++ function names are encoded into a -low-level assembly label (this process is known as -.I mangling\c -). The -.B @PROGRAM@ -program does the inverse mapping: it decodes (\fIdemangles\fR) -low-level names into user-level names so that the linker can keep -these overloaded functions from clashing. -.PP -Every alphanumeric word (consisting of letters, digits, underscores, -dollars, or periods) seen in the input is a potential label. If the -label decodes into a C++ name, the C++ name replaces the low-level -name in the output. -.PP -You can use -.B @PROGRAM@ -to decipher individual symbols by specifying these symbols on the -command line. -.PP -If no -.B symbol -arguments are given, -.B @PROGRAM@ -reads symbol names from the standard input and writes the demangled -names to the standard output. All results are printed on the standard -output. -.SH OPTIONS -.TP -.B \-_ -.TP -.B \-\-strip\-underscores -On some systems, both the C and C++ compilers put an -underscore in front of every name. For example, the C name -.B foo -gets the low-level name -.BR _foo . -This option removes the leading underscore. - -.TP -.B "\-s {gnu,lucid,arm}" -.TP -.B \-\-format={gnu,lucid,arm} -GNU -.B nm -can decode three different methods of mangling, used by different C++ -compilers. This option selects which method it uses: the one used by -the GNU compiler, the one used by the Lucid compiler, or the one -specified by the C++ Annotated Reference Manual. The default is the -GNU style. - -.TP -.B \-\-help -Print a summary of the options to -.B @PROGRAM@ -and exit. - -.TP -.B \-\-version -Print the version number of -.B @PROGRAM@ -and exit. - -.SH "SEE ALSO" -.RB "`\|" binutils "\|'" -entry in -.B -info\c -\&; -.I -The GNU Binary Utilities\c -\&, Roland H. Pesch (June 1993). - -.SH COPYING -Copyright (c) 1993 Free Software Foundation, Inc. -.PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the Free Software Foundation instead of in -the original English. diff --git a/contrib/binutils/binutils/dyn-string.c b/contrib/binutils/binutils/dyn-string.c deleted file mode 100644 index a16401827657..000000000000 --- a/contrib/binutils/binutils/dyn-string.c +++ /dev/null @@ -1,107 +0,0 @@ -/* An abstract string datatype. - Copyright (C) 1998 Free Software Foundation, Inc. - Contributed by Mark Mitchell (mark@markmitchell.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 this program; if not, write to the Free Software - Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* This file lives in at least two places: binutils and gcc. - Don't change one without the other. */ - -#include "config.h" -#ifdef IN_GCC -#include "system.h" -#include "gansidecl.h" -#else -#include "ansidecl.h" -#endif -#include "dyn-string.h" - -extern char *xmalloc (); -extern char *xrealloc (); - -/* Create a new dynamic string capable of holding at least SPACE - characters, including the terminating NUL. If SPACE is 0, it - will be silently increased to 1. */ - -dyn_string_t -dyn_string_new (space) - int space; -{ - dyn_string_t result = (dyn_string_t) xmalloc (sizeof (struct dyn_string)); - - if (space == 0) - /* We need at least one byte in which to store the terminating - NUL. */ - space = 1; - - result->allocated = space; - result->s = (char*) xmalloc (space); - result->length = 0; - result->s[0] = '\0'; - - return result; -} - -/* Free the memory used by DS. */ - -void -dyn_string_delete (ds) - dyn_string_t ds; -{ - free (ds->s); - free (ds); -} - -/* Append the NUL-terminated string S to DS, resizing DS if - necessary. */ - -dyn_string_t -dyn_string_append (ds, s) - dyn_string_t ds; - char *s; -{ - int len = strlen (s); - dyn_string_resize (ds, ds->length + len + 1 /* '\0' */); - strcpy (ds->s + ds->length, s); - ds->length += len; - - return ds; -} - -/* Increase the capacity of DS so that it can hold at least SPACE - characters, including the terminating NUL. This function will not - (at present) reduce the capacity of DS. */ - -dyn_string_t -dyn_string_resize (ds, space) - dyn_string_t ds; - int space; -{ - int new_allocated = ds->allocated; - - while (space > new_allocated) - new_allocated *= 2; - - if (new_allocated != ds->allocated) - { - /* We actually need more space. */ - ds->allocated = new_allocated; - ds->s = (char*) xrealloc (ds->s, ds->allocated); - } - - return ds; -} diff --git a/contrib/binutils/binutils/dyn-string.h b/contrib/binutils/binutils/dyn-string.h deleted file mode 100644 index cbd25c347344..000000000000 --- a/contrib/binutils/binutils/dyn-string.h +++ /dev/null @@ -1,34 +0,0 @@ -/* An abstract string datatype. - Copyright (C) 1998 Free Software Foundation, Inc. - Contributed by Mark Mitchell (mark@markmitchell.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 this program; if not, write to the Free Software - Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* This file lives in at least two places: binutils and gcc. - Don't change one without the other. */ - -typedef struct dyn_string -{ - int allocated; /* The amount of space allocated for the string. */ - int length; /* The actual length of the string. */ - char *s; /* The string itself, NUL-terminated. */ -}* dyn_string_t; - -extern dyn_string_t dyn_string_new PARAMS((int)); -extern void dyn_string_delete PARAMS((dyn_string_t)); -extern dyn_string_t dyn_string_append PARAMS((dyn_string_t, char*)); -extern dyn_string_t dyn_string_resize PARAMS((dyn_string_t, int)); diff --git a/contrib/binutils/binutils/nm.1 b/contrib/binutils/binutils/nm.1 deleted file mode 100644 index d6f4eba7e52b..000000000000 --- a/contrib/binutils/binutils/nm.1 +++ /dev/null @@ -1,587 +0,0 @@ -.\" Copyright (c) 1991, 2000 Free Software Foundation -.\" See section COPYING for conditions for redistribution -.TH nm 1 "5 November 1991" "Free Software Foundation" "GNU Development Tools" -.de BP -.sp -.ti \-.2i -\(** -.. - -.SH NAME -nm \- list symbols from object files. - -.SH SYNOPSIS -.hy 0 -.na -.B nm -.RB "[\|" \-a | \-\-debug\-syms "\|]" -.RB "[\|" \-g | \-\-extern\-only "\|]" -.RB "[\|" \-B "\|]" -.RB "[\|" \-C | \-\-demangle "\|]" -.RB "[\|" \-D | \-\-dynamic "\|]" -.RB "[\|" \-s | \-\-print\-armap "\|]" -.RB "[\|" \-o | \-\-print\-file\-name "\|]" -.RB "[\|" \-n | \-\-numeric\-sort "\|]" -.RB "[\|" \-p | \-\-no\-sort "\|]" -.RB "[\|" \-r | \-\-reverse\-sort "\|]" -.RB "[\|" \-\-size\-sort "\|]" -.RB "[\|" \-u | \-\-undefined\-only "\|]" -.RB "[\|" \-l | \-\-line\-numbers "\|]" -.RB "[\|" \-\-help "\|]" -.RB "[\|" \-\-version "\|]" -.RB "[\|" "\-t \fIradix" | \-\-radix=\fIradix "\|]" -.RB "[\|" \-P | --portability "\|]" -.RB "[\|" "\-f \fIformat" | \-\-format=\fIformat "\|]" -.RB "[\|" "\-\-target=\fIbfdname" "\|]" -.RB "[\|" \c -.I objfile\c -\&.\|.\|.\|] -.ad b -.hy 1 -.SH DESCRIPTION -GNU \c -.B nm\c -\& lists the symbols from object files \c -.I objfile\c -\&. If no object files are given as arguments, \c -.B nm\c -\& assumes `\|\c -.B a.out\c -\|'. - -.SH OPTIONS -The long and short forms of options, shown here as alternatives, are -equivalent. - -.TP -.B \-A -.TP -.B \-o -.TP -.B \-\-print\-file\-name -Precede each symbol by the name of the input file where it was found, -rather than identifying the input file once only before all of its -symbols. - -.TP -.B \-a -.TP -.B \-\-debug\-syms -Display debugger-only symbols; normally these are not listed. - -.TP -.B \-B -The same as -.B \-\-format=bsd -(for compatibility with the MIPS \fBnm\fP). - -.TP -.B \-C -.TP -.B \-\-demangle -Decode (\fIdemangle\fP) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes C++ function names readable. - -.TP -.B \-D -.TP -.B \-\-dynamic -Display the dynamic symbols rather than the normal symbols. This is -only meaningful for dynamic objects, such as certain types of shared -libraries. - -.TP -.B "\-f \fIformat" -Use the output format \fIformat\fP, which can be ``bsd'', -``sysv'', or ``posix''. The default is ``bsd''. -Only the first character of \fIformat\fP is significant; it can be -either upper or lower case. - -.TP -.B \-g -.TP -.B \-\-extern\-only -Display only external symbols. - -.TP -.B \-n -.TP -.B \-v -.TP -.B \-\-numeric\-sort -Sort symbols numerically by their addresses, not alphabetically by their -names. - -.TP -.B \-p -.TP -.B \-\-no\-sort -Don't bother to sort the symbols in any order; just print them in the -order encountered. - -.TP -.B \-P -.TP -.B \-\-portability -Use the POSIX.2 standard output format instead of the default format. -Equivalent to ``\-f posix''. - -.TP -.B \-s -.TP -.B \-\-print\-armap -When listing symbols from archive members, include the index: a mapping -(stored in the archive by \c -.B ar\c -\& or \c -.B ranlib\c -\&) of what modules -contain definitions for what names. - -.TP -.B \-r -.TP -.B \-\-reverse\-sort -Reverse the sense of the sort (whether numeric or alphabetic); let the -last come first. - -.TP -.B \-\-size\-sort -Sort symbols by size. The size is computed as the difference between -the value of the symbol and the value of the symbol with the next higher -value. The size of the symbol is printed, rather than the value. - -.TP -.B "\-t \fIradix" -.TP -.B "\-\-radix=\fIradix" -Use \fIradix\fP as the radix for printing the symbol values. It must be -``d'' for decimal, ``o'' for octal, or ``x'' for hexadecimal. - -.TP -.BI "\-\-target=" "bfdname" -Specify an object code format other than your system's default format. -See -.BR objdump ( 1 ), -for information on listing available formats. - -.TP -.B \-u -.TP -.B \-\-undefined\-only -Display only undefined symbols (those external to each object file). - -.TP -.B \-l -.TP -.B \-\-line\-numbers -For each symbol, use debugging information to try to find a filename and -line number. For a defined symbol, look for the line number of the -address of the symbol. For an undefined symbol, look for the line -number of a relocation entry which refers to the symbol. If line number -information can be found, print it after the other symbol information. - -.TP -.B \-V -.TP -.B \-\-version -Show the version number of -.B nm -and exit. - -.TP -.B \-\-help -Show a summary of the options to -.B nm -and exit. - -.SH "SEE ALSO" -.RB "`\|" binutils "\|'" -entry in -.B -info\c -\&; -.I -The GNU Binary Utilities\c -\&, Roland H. Pesch (October 1991); -.BR ar "(" 1 ")," -.BR objdump ( 1 ), -.BR ranlib "(" 1 ")." - - -.SH COPYING -Copyright (c) 1991, 2000 Free Software Foundation, Inc. -.PP -This document is distributed under the terms of the GNU Free -Documentation License, version 1.1. That license is described in the -sources for this manual page, but it is not displayed here in order to -make this manual more consise. Copies of this license can also be -obtained from: http://www.gnu.org/copyleft/. - -\" .SH GNU Free Documentation License -\" Version 1.1, March 2000 - -\" Copyright (C) 2000 Free Software Foundation, Inc. -\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -\" Everyone is permitted to copy and distribute verbatim -\" copies of this license document, but changing it is -\" not allowed. -\" .PP -\" 0. PREAMBLE -\" .PP -\" The purpose of this License is to make a manual, textbook, or other -\" written document "free" in the sense of freedom: to assure everyone -\" the effective freedom to copy and redistribute it, with or without -\" modifying it, either commercially or noncommercially. Secondarily, -\" this License preserves for the author and publisher a way to get -\" credit for their work, while not being considered responsible for -\" modifications made by others. -\" .PP -\" This License is a kind of "copyleft", which means that derivative -\" works of the document must themselves be free in the same sense. It -\" complements the GNU General Public License, which is a copyleft -\" license designed for free software. -\" .PP -\" We have designed this License in order to use it for manuals for free -\" software, because free software needs free documentation: a free -\" program should come with manuals providing the same freedoms that the -\" software does. But this License is not limited to software manuals; -\" it can be used for any textual work, regardless of subject matter or -\" whether it is published as a printed book. We recommend this License -\" principally for works whose purpose is instruction or reference. -\" .PP -\" 1. APPLICABILITY AND DEFINITIONS -\" .PP -\" This License applies to any manual or other work that contains a -\" notice placed by the copyright holder saying it can be distributed -\" under the terms of this License. The "Document", below, refers to any -\" such manual or work. Any member of the public is a licensee, and is -\" addressed as "you". -\" .PP -\" A "Modified Version" of the Document means any work containing the -\" Document or a portion of it, either copied verbatim, or with -\" modifications and/or translated into another language. -\" .PP -\" A "Secondary Section" is a named appendix or a front-matter section of -\" the Document that deals exclusively with the relationship of the -\" publishers or authors of the Document to the Document's overall subject -\" (or to related matters) and contains nothing that could fall directly -\" within that overall subject. (For example, if the Document is in part a -\" textbook of mathematics, a Secondary Section may not explain any -\" mathematics.) The relationship could be a matter of historical -\" connection with the subject or with related matters, or of legal, -\" commercial, philosophical, ethical or political position regarding -\" them. -\" .PP -\" The "Invariant Sections" are certain Secondary Sections whose titles -\" are designated, as being those of Invariant Sections, in the notice -\" that says that the Document is released under this License. -\" .PP -\" The "Cover Texts" are certain short passages of text that are listed, -\" as Front-Cover Texts or Back-Cover Texts, in the notice that says that -\" the Document is released under this License. -\" .PP -\" A "Transparent" copy of the Document means a machine-readable copy, -\" represented in a format whose specification is available to the -\" general public, whose contents can be viewed and edited directly and -\" straightforwardly with generic text editors or (for images composed of -\" pixels) generic paint programs or (for drawings) some widely available -\" drawing editor, and that is suitable for input to text formatters or -\" for automatic translation to a variety of formats suitable for input -\" to text formatters. A copy made in an otherwise Transparent file -\" format whose markup has been designed to thwart or discourage -\" subsequent modification by readers is not Transparent. A copy that is -\" not "Transparent" is called "Opaque". -\" .PP -\" Examples of suitable formats for Transparent copies include plain -\" ASCII without markup, Texinfo input format, LaTeX input format, SGML -\" or XML using a publicly available DTD, and standard-conforming simple -\" HTML designed for human modification. Opaque formats include -\" PostScript, PDF, proprietary formats that can be read and edited only -\" by proprietary word processors, SGML or XML for which the DTD and/or -\" processing tools are not generally available, and the -\" machine-generated HTML produced by some word processors for output -\" purposes only. -\" .PP -\" The "Title Page" means, for a printed book, the title page itself, -\" plus such following pages as are needed to hold, legibly, the material -\" this License requires to appear in the title page. For works in -\" formats which do not have any title page as such, "Title Page" means -\" the text near the most prominent appearance of the work's title, -\" preceding the beginning of the body of the text. -\" .PP -\" 2. VERBATIM COPYING -\" .PP -\" You may copy and distribute the Document in any medium, either -\" commercially or noncommercially, provided that this License, the -\" copyright notices, and the license notice saying this License applies -\" to the Document are reproduced in all copies, and that you add no other -\" conditions whatsoever to those of this License. You may not use -\" technical measures to obstruct or control the reading or further -\" copying of the copies you make or distribute. However, you may accept -\" compensation in exchange for copies. If you distribute a large enough -\" number of copies you must also follow the conditions in section 3. -\" .PP -\" You may also lend copies, under the same conditions stated above, and -\" you may publicly display copies. -\" .PP -\" 3. COPYING IN QUANTITY -\" .PP -\" If you publish printed copies of the Document numbering more than 100, -\" and the Document's license notice requires Cover Texts, you must enclose -\" the copies in covers that carry, clearly and legibly, all these Cover -\" Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -\" the back cover. Both covers must also clearly and legibly identify -\" you as the publisher of these copies. The front cover must present -\" the full title with all words of the title equally prominent and -\" visible. You may add other material on the covers in addition. -\" Copying with changes limited to the covers, as long as they preserve -\" the title of the Document and satisfy these conditions, can be treated -\" as verbatim copying in other respects. -\" .PP -\" If the required texts for either cover are too voluminous to fit -\" legibly, you should put the first ones listed (as many as fit -\" reasonably) on the actual cover, and continue the rest onto adjacent -\" pages. -\" .PP -\" If you publish or distribute Opaque copies of the Document numbering -\" more than 100, you must either include a machine-readable Transparent -\" copy along with each Opaque copy, or state in or with each Opaque copy -\" a publicly-accessible computer-network location containing a complete -\" Transparent copy of the Document, free of added material, which the -\" general network-using public has access to download anonymously at no -\" charge using public-standard network protocols. If you use the latter -\" option, you must take reasonably prudent steps, when you begin -\" distribution of Opaque copies in quantity, to ensure that this -\" Transparent copy will remain thus accessible at the stated location -\" until at least one year after the last time you distribute an Opaque -\" copy (directly or through your agents or retailers) of that edition to -\" the public. -\" .PP -\" It is requested, but not required, that you contact the authors of the -\" Document well before redistributing any large number of copies, to give -\" them a chance to provide you with an updated version of the Document. -\" .PP -\" 4. MODIFICATIONS -\" .PP -\" You may copy and distribute a Modified Version of the Document under -\" the conditions of sections 2 and 3 above, provided that you release -\" the Modified Version under precisely this License, with the Modified -\" Version filling the role of the Document, thus licensing distribution -\" and modification of the Modified Version to whoever possesses a copy -\" of it. In addition, you must do these things in the Modified Version: -\" .PP -\" A. Use in the Title Page (and on the covers, if any) a title distinct -\" from that of the Document, and from those of previous versions -\" (which should, if there were any, be listed in the History section -\" of the Document). You may use the same title as a previous version -\" if the original publisher of that version gives permission. -\" .PP -\" B. List on the Title Page, as authors, one or more persons or entities -\" responsible for authorship of the modifications in the Modified -\" Version, together with at least five of the principal authors of the -\" Document (all of its principal authors, if it has less than five). -\" .PP -\" C. State on the Title page the name of the publisher of the -\" Modified Version, as the publisher. -\" .PP -\" D. Preserve all the copyright notices of the Document. -\" .PP -\" E. Add an appropriate copyright notice for your modifications -\" adjacent to the other copyright notices. -\" .PP -\" F. Include, immediately after the copyright notices, a license notice -\" giving the public permission to use the Modified Version under the -\" terms of this License, in the form shown in the Addendum below. -\" Preserve in that license notice the full lists of Invariant Sections -\" and required Cover Texts given in the Document's license notice. -\" .PP -\" H. Include an unaltered copy of this License. -\" .PP -\" I. Preserve the section entitled "History", and its title, and add to -\" it an item stating at least the title, year, new authors, and -\" publisher of the Modified Version as given on the Title Page. If -\" there is no section entitled "History" in the Document, create one -\" stating the title, year, authors, and publisher of the Document as -\" given on its Title Page, then add an item describing the Modified -\" Version as stated in the previous sentence. -\" .PP -\" J. Preserve the network location, if any, given in the Document for -\" public access to a Transparent copy of the Document, and likewise -\" the network locations given in the Document for previous versions -\" it was based on. These may be placed in the "History" section. -\" You may omit a network location for a work that was published at -\" least four years before the Document itself, or if the original -\" publisher of the version it refers to gives permission. -\" .PP -\" K. In any section entitled "Acknowledgements" or "Dedications", -\" preserve the section's title, and preserve in the section all the -\" substance and tone of each of the contributor acknowledgements -\" and/or dedications given therein. -\" .PP -\" L. Preserve all the Invariant Sections of the Document, -\" unaltered in their text and in their titles. Section numbers -\" or the equivalent are not considered part of the section titles. -\" .PP -\" M. Delete any section entitled "Endorsements". Such a section -\" may not be included in the Modified Version. -\" .PP -\" N. Do not retitle any existing section as "Endorsements" -\" or to conflict in title with any Invariant Section. -\" .PP -\" If the Modified Version includes new front-matter sections or -\" appendices that qualify as Secondary Sections and contain no material -\" copied from the Document, you may at your option designate some or all -\" of these sections as invariant. To do this, add their titles to the -\" list of Invariant Sections in the Modified Version's license notice. -\" These titles must be distinct from any other section titles. -\" .PP -\" You may add a section entitled "Endorsements", provided it contains -\" nothing but endorsements of your Modified Version by various -\" parties--for example, statements of peer review or that the text has -\" been approved by an organization as the authoritative definition of a -\" standard. -\" .PP -\" You may add a passage of up to five words as a Front-Cover Text, and a -\" passage of up to 25 words as a Back-Cover Text, to the end of the list -\" of Cover Texts in the Modified Version. Only one passage of -\" Front-Cover Text and one of Back-Cover Text may be added by (or -\" through arrangements made by) any one entity. If the Document already -\" includes a cover text for the same cover, previously added by you or -\" by arrangement made by the same entity you are acting on behalf of, -\" you may not add another; but you may replace the old one, on explicit -\" permission from the previous publisher that added the old one. -\" .PP -\" The author(s) and publisher(s) of the Document do not by this License -\" give permission to use their names for publicity for or to assert or -\" imply endorsement of any Modified Version. -\" .PP - -\" 5. COMBINING DOCUMENTS -\" .PP -\" You may combine the Document with other documents released under this -\" License, under the terms defined in section 4 above for modified -\" versions, provided that you include in the combination all of the -\" Invariant Sections of all of the original documents, unmodified, and -\" list them all as Invariant Sections of your combined work in its -\" license notice. -\" .PP -\" The combined work need only contain one copy of this License, and -\" multiple identical Invariant Sections may be replaced with a single -\" copy. If there are multiple Invariant Sections with the same name but -\" different contents, make the title of each such section unique by -\" adding at the end of it, in parentheses, the name of the original -\" author or publisher of that section if known, or else a unique number. -\" Make the same adjustment to the section titles in the list of -\" Invariant Sections in the license notice of the combined work. -\" .PP -\" In the combination, you must combine any sections entitled "History" -\" in the various original documents, forming one section entitled -\" "History"; likewise combine any sections entitled "Acknowledgements", -\" and any sections entitled "Dedications". You must delete all sections -\" entitled "Endorsements." -\" .PP - -\" 6. COLLECTIONS OF DOCUMENTS -\" .PP -\" You may make a collection consisting of the Document and other documents -\" released under this License, and replace the individual copies of this -\" License in the various documents with a single copy that is included in -\" the collection, provided that you follow the rules of this License for -\" verbatim copying of each of the documents in all other respects. -\" .PP -\" You may extract a single document from such a collection, and distribute -\" it individually under this License, provided you insert a copy of this -\" License into the extracted document, and follow this License in all -\" other respects regarding verbatim copying of that document. -\" .PP - -\" 7. AGGREGATION WITH INDEPENDENT WORKS -\" .PP -\" A compilation of the Document or its derivatives with other separate -\" and independent documents or works, in or on a volume of a storage or -\" distribution medium, does not as a whole count as a Modified Version -\" of the Document, provided no compilation copyright is claimed for the -\" compilation. Such a compilation is called an "aggregate", and this -\" License does not apply to the other self-contained works thus compiled -\" with the Document, on account of their being thus compiled, if they -\" are not themselves derivative works of the Document. -\" .PP -\" If the Cover Text requirement of section 3 is applicable to these -\" copies of the Document, then if the Document is less than one quarter -\" of the entire aggregate, the Document's Cover Texts may be placed on -\" covers that surround only the Document within the aggregate. -\" Otherwise they must appear on covers around the whole aggregate. -\" .PP - -\" 8. TRANSLATION -\" .PP -\" Translation is considered a kind of modification, so you may -\" distribute translations of the Document under the terms of section 4. -\" Replacing Invariant Sections with translations requires special -\" permission from their copyright holders, but you may include -\" translations of some or all Invariant Sections in addition to the -\" original versions of these Invariant Sections. You may include a -\" translation of this License provided that you also include the -\" original English version of this License. In case of a disagreement -\" between the translation and the original English version of this -\" License, the original English version will prevail. -\" .PP - -\" 9. TERMINATION -\" .PP -\" You may not copy, modify, sublicense, or distribute the Document except -\" as expressly provided for under this License. Any other attempt to -\" copy, modify, sublicense or distribute the Document is void, and will -\" automatically terminate your rights under this License. However, -\" parties who have received copies, or rights, from you under this -\" License will not have their licenses terminated so long as such -\" parties remain in full compliance. -\" .PP - -\" 10. FUTURE REVISIONS OF THIS LICENSE -\" .PP -\" The Free Software Foundation may publish new, revised versions -\" of the GNU Free Documentation License from time to time. Such new -\" versions will be similar in spirit to the present version, but may -\" differ in detail to address new problems or concerns. See -\" http://www.gnu.org/copyleft/. -\" .PP -\" Each version of the License is given a distinguishing version number. -\" If the Document specifies that a particular numbered version of this -\" License "or any later version" applies to it, you have the option of -\" following the terms and conditions either of that specified version or -\" of any later version that has been published (not as a draft) by the -\" Free Software Foundation. If the Document does not specify a version -\" number of this License, you may choose any version ever published (not -\" as a draft) by the Free Software Foundation. -\" .PP - -\" ADDENDUM: How to use this License for your documents -\" .PP -\" To use this License in a document you have written, include a copy of -\" the License in the document and put the following copyright and -\" license notices just after the title page: -\" .PP -\" Copyright (c) YEAR YOUR NAME. -\" Permission is granted to copy, distribute and/or -\" modify this document under the terms of the GNU -\" Free Documentation License, Version 1.1 or any later -\" version published by the Free Software Foundation; -\" with the Invariant Sections being LIST THEIR TITLES, -\" with the Front-Cover Texts being LIST, and with the -\" Back-Cover Texts being LIST. A copy of the license -\" is included in the section entitled "GNU Free -\" Documentation License". -\" .PP -\" If you have no Invariant Sections, write "with no Invariant Sections" -\" instead of saying which ones are invariant. If you have no -\" Front-Cover Texts, write "no Front-Cover Texts" instead of -\" "Front-Cover Texts being LIST"; likewise for Back-Cover Texts. -\" .PP -\" If your document contains nontrivial examples of program code, we -\" recommend releasing these examples in parallel under your choice of -\" free software license, such as the GNU General Public License, -\" to permit their use in free software. diff --git a/contrib/binutils/binutils/objcopy.1 b/contrib/binutils/binutils/objcopy.1 deleted file mode 100644 index a6aa1815fa80..000000000000 --- a/contrib/binutils/binutils/objcopy.1 +++ /dev/null @@ -1,548 +0,0 @@ -.\" Automatically generated by Pod::Man version 1.02 -.\" Wed May 30 12:24:28 2001 -.\" -.\" Standard preamble: -.\" ====================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Ip \" List item -.br -.ie \\n(.$>=3 .ne \\$3 -.el .ne 3 -.IP "\\$1" \\$2 -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R - -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used -.\" to do unbreakable dashes and therefore won't be available. \*(C` and -.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> -.tr \(*W-|\(bv\*(Tr -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` ` -. ds C' ' -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr -.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and -.\" index entries marked with X<> in POD. Of course, you'll have to process -.\" the output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -. . -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it -.\" makes way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -.bd B 3 -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ====================================================================== -.\" -.IX Title "OBJCOPY.1 1" -.TH OBJCOPY.1 1 "binutils-2.11.90" "2001-05-30" "GNU" -.UC -.SH "NAME" -objcopy \- copy and translate object files -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -objcopy [ \-F \fIbfdname\fR | \-\-target=\fIbfdname\fR ] - [ \-I \fIbfdname\fR | \-\-input-target=\fIbfdname\fR ] - [ \-O \fIbfdname\fR | \-\-output-target=\fIbfdname\fR ] - [ \-B \fIbfdarch\fR | \-\-binary-architecture=\fIbfdarch\fR ] - [ \-S | \-\-strip-all ] [ \-g | \-\-strip-debug ] - [ \-K \fIsymbolname\fR | \-\-keep-symbol=\fIsymbolname\fR ] - [ \-N \fIsymbolname\fR | \-\-strip-symbol=\fIsymbolname\fR ] - [ \-G \fIsymbolname\fR | \-\-keep-global-symbol=\fIsymbolname\fR] - [ \-L \fIsymbolname\fR | \-\-localize-symbol=\fIsymbolname\fR ] - [ \-W \fIsymbolname\fR | \-\-weaken-symbol=\fIsymbolname\fR ] - [ \-x | \-\-discard-all ] [ \-X | \-\-discard-locals ] - [ \-b \fIbyte\fR | \-\-byte=\fIbyte\fR ] - [ \-i \fIinterleave\fR | \-\-interleave=\fIinterleave\fR ] - [ \-j \fIsectionname\fR | \-\-only-section=\fIsectionname\fR ] - [ \-R \fIsectionname\fR | \-\-remove-section=\fIsectionname\fR ] - [ \-p | \-\-preserve-dates ] [ \-\-debugging ] - [ \-\-gap-fill=\fIval\fR ] [ \-\-pad-to=\fIaddress\fR ] - [ \-\-set-start=\fIval\fR ] [ \-\-adjust-start=\fIincr\fR ] - [ \-\-change-addresses=\fIincr\fR ] - [ \-\-change-section-address \fIsection\fR{=,+,\-}\fIval\fR ] - [ \-\-change-section-lma \fIsection\fR{=,+,\-}\fIval\fR ] - [ \-\-change-section-vma \fIsection\fR{=,+,\-}\fIval\fR ] - [ \-\-change-warnings ] [ \-\-no-change-warnings ] - [ \-\-set-section-flags \fIsection\fR=\fIflags\fR ] - [ \-\-add-section \fIsectionname\fR=\fIfilename\fR ] - [ \-\-change-leading-char ] [ \-\-remove-leading-char ] - [ \-\-srec-len=\fIival\fR ] [ \-\-srec-forceS3 ] - [ \-\-redefine-sym \fIold\fR=\fInew\fR ] [ \-\-weaken ] - [ \-\-keep-symbols=\fIfilename\fR ] - [ \-\-strip-symbols=\fIfilename\fR ] - [ \-\-keep-global-symbols=\fIfilename\fR ] - [ \-\-localize-symbols=\fIfilename\fR ] - [ \-\-weaken-symbols=\fIfilename\fR ] - [ \-v | \-\-verbose ] [ \-V | \-\-version ] [ \-\-help ] - \fIinfile\fR [\fIoutfile\fR] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \s-1GNU\s0 \f(CW\*(C`objcopy\*(C'\fR utility copies the contents of an object -file to another. \f(CW\*(C`objcopy\*(C'\fR uses the \s-1GNU\s0 \s-1BFD\s0 Library to -read and write the object files. It can write the destination object -file in a format different from that of the source object file. The -exact behavior of \f(CW\*(C`objcopy\*(C'\fR is controlled by command-line options. -Note that \f(CW\*(C`objcopy\*(C'\fR should be able to copy a fully linked file -between any two formats. However, copying a relocatable object file -between any two formats may not work as expected. -.PP -\&\f(CW\*(C`objcopy\*(C'\fR creates temporary files to do its translations and -deletes them afterward. \f(CW\*(C`objcopy\*(C'\fR uses \s-1BFD\s0 to do all its -translation work; it has access to all the formats described in \s-1BFD\s0 -and thus is able to recognize most formats without being told -explicitly. -.PP -\&\f(CW\*(C`objcopy\*(C'\fR can be used to generate S-records by using an output -target of \fBsrec\fR (e.g., use \fB\-O srec\fR). -.PP -\&\f(CW\*(C`objcopy\*(C'\fR can be used to generate a raw binary file by using an -output target of \fBbinary\fR (e.g., use \fB\-O binary\fR). When -\&\f(CW\*(C`objcopy\*(C'\fR generates a raw binary file, it will essentially produce -a memory dump of the contents of the input object file. All symbols and -relocation information will be discarded. The memory dump will start at -the load address of the lowest section copied into the output file. -.PP -When generating an S-record or a raw binary file, it may be helpful to -use \fB\-S\fR to remove sections containing debugging information. In -some cases \fB\-R\fR will be useful to remove sections which contain -information that is not needed by the binary file. -.PP -Note \- \f(CW\*(C`objcopy\*(C'\fR is not able to change the endianness of its input -files. If the input format has an endianness, (some formats do not), -\&\f(CW\*(C`objcopy\*(C'\fR can only copy the inputs into file formats that have the -same endianness or which have no endianness (eg \fBsrec\fR). -.SH "OPTIONS" -.IX Header "OPTIONS" -.Ip "\f(CW\*(C`\f(CIinfile\f(CW\*(C'\fR" 4 -.IX Item "infile" -.Ip "\f(CW\*(C`\f(CIoutfile\f(CW\*(C'\fR" 4 -.IX Item "outfile" -The input and output files, respectively. -If you do not specify \fIoutfile\fR, \f(CW\*(C`objcopy\*(C'\fR creates a -temporary file and destructively renames the result with -the name of \fIinfile\fR. -.Ip "\f(CW\*(C`\-I \f(CIbfdname\f(CW \*(C'\fR" 4 -.IX Item "-I bfdname " -.Ip "\f(CW\*(C`\-\-input\-target=\f(CIbfdname\f(CW\*(C'\fR" 4 -.IX Item "--input-target=bfdname" -Consider the source file's object format to be \fIbfdname\fR, rather than -attempting to deduce it. -.Ip "\f(CW\*(C`\-O \f(CIbfdname\f(CW\*(C'\fR" 4 -.IX Item "-O bfdname" -.Ip "\f(CW\*(C`\-\-output\-target=\f(CIbfdname\f(CW\*(C'\fR" 4 -.IX Item "--output-target=bfdname" -Write the output file using the object format \fIbfdname\fR. -.Ip "\f(CW\*(C`\-F \f(CIbfdname\f(CW\*(C'\fR" 4 -.IX Item "-F bfdname" -.Ip "\f(CW\*(C`\-\-target=\f(CIbfdname\f(CW\*(C'\fR" 4 -.IX Item "--target=bfdname" -Use \fIbfdname\fR as the object format for both the input and the output -file; i.e., simply transfer data from source to destination with no -translation. -.Ip "\f(CW\*(C`\-B \f(CIbfdarch\f(CW\*(C'\fR" 4 -.IX Item "-B bfdarch" -.Ip "\f(CW\*(C`\-\-binary\-architecture=\f(CIbfdarch\f(CW\*(C'\fR" 4 -.IX Item "--binary-architecture=bfdarch" -Useful when transforming a raw binary input file into an object file. -In this case the output architecture can be set to \fIbfdarch\fR. This -option will be ignored if the input file has a known \fIbfdarch\fR. You -can access this binary data inside a program by referencing the special -symbols that are created by the conversion process. These symbols are -called _binary_\fIobjfile\fR_start, _binary_\fIobjfile\fR_end and -_binary_\fIobjfile\fR_size. e.g. you can transform a picture file into -an object file and then access it in your code using these symbols. -.Ip "\f(CW\*(C`\-j \f(CIsectionname\f(CW\*(C'\fR" 4 -.IX Item "-j sectionname" -.Ip "\f(CW\*(C`\-\-only\-section=\f(CIsectionname\f(CW\*(C'\fR" 4 -.IX Item "--only-section=sectionname" -Copy only the named section from the input file to the output file. -This option may be given more than once. Note that using this option -inappropriately may make the output file unusable. -.Ip "\f(CW\*(C`\-R \f(CIsectionname\f(CW\*(C'\fR" 4 -.IX Item "-R sectionname" -.Ip "\f(CW\*(C`\-\-remove\-section=\f(CIsectionname\f(CW\*(C'\fR" 4 -.IX Item "--remove-section=sectionname" -Remove any section named \fIsectionname\fR from the output file. This -option may be given more than once. Note that using this option -inappropriately may make the output file unusable. -.Ip "\f(CW\*(C`\-S\*(C'\fR" 4 -.IX Item "-S" -.Ip "\f(CW\*(C`\-\-strip\-all\*(C'\fR" 4 -.IX Item "--strip-all" -Do not copy relocation and symbol information from the source file. -.Ip "\f(CW\*(C`\-g\*(C'\fR" 4 -.IX Item "-g" -.Ip "\f(CW\*(C`\-\-strip\-debug\*(C'\fR" 4 -.IX Item "--strip-debug" -Do not copy debugging symbols from the source file. -.Ip "\f(CW\*(C`\-\-strip\-unneeded\*(C'\fR" 4 -.IX Item "--strip-unneeded" -Strip all symbols that are not needed for relocation processing. -.Ip "\f(CW\*(C`\-K \f(CIsymbolname\f(CW\*(C'\fR" 4 -.IX Item "-K symbolname" -.Ip "\f(CW\*(C`\-\-keep\-symbol=\f(CIsymbolname\f(CW\*(C'\fR" 4 -.IX Item "--keep-symbol=symbolname" -Copy only symbol \fIsymbolname\fR from the source file. This option may -be given more than once. -.Ip "\f(CW\*(C`\-N \f(CIsymbolname\f(CW\*(C'\fR" 4 -.IX Item "-N symbolname" -.Ip "\f(CW\*(C`\-\-strip\-symbol=\f(CIsymbolname\f(CW\*(C'\fR" 4 -.IX Item "--strip-symbol=symbolname" -Do not copy symbol \fIsymbolname\fR from the source file. This option -may be given more than once. -.Ip "\f(CW\*(C`\-G \f(CIsymbolname\f(CW\*(C'\fR" 4 -.IX Item "-G symbolname" -.Ip "\f(CW\*(C`\-\-keep\-global\-symbol=\f(CIsymbolname\f(CW\*(C'\fR" 4 -.IX Item "--keep-global-symbol=symbolname" -Keep only symbol \fIsymbolname\fR global. Make all other symbols local -to the file, so that they are not visible externally. This option may -be given more than once. -.Ip "\f(CW\*(C`\-L \f(CIsymbolname\f(CW\*(C'\fR" 4 -.IX Item "-L symbolname" -.Ip "\f(CW\*(C`\-\-localize\-symbol=\f(CIsymbolname\f(CW\*(C'\fR" 4 -.IX Item "--localize-symbol=symbolname" -Make symbol \fIsymbolname\fR local to the file, so that it is not -visible externally. This option may be given more than once. -.Ip "\f(CW\*(C`\-W \f(CIsymbolname\f(CW\*(C'\fR" 4 -.IX Item "-W symbolname" -.Ip "\f(CW\*(C`\-\-weaken\-symbol=\f(CIsymbolname\f(CW\*(C'\fR" 4 -.IX Item "--weaken-symbol=symbolname" -Make symbol \fIsymbolname\fR weak. This option may be given more than once. -.Ip "\f(CW\*(C`\-x\*(C'\fR" 4 -.IX Item "-x" -.Ip "\f(CW\*(C`\-\-discard\-all\*(C'\fR" 4 -.IX Item "--discard-all" -Do not copy non-global symbols from the source file. -.Ip "\f(CW\*(C`\-X\*(C'\fR" 4 -.IX Item "-X" -.Ip "\f(CW\*(C`\-\-discard\-locals\*(C'\fR" 4 -.IX Item "--discard-locals" -Do not copy compiler-generated local symbols. -(These usually start with \fBL\fR or \fB.\fR.) -.Ip "\f(CW\*(C`\-b \f(CIbyte\f(CW\*(C'\fR" 4 -.IX Item "-b byte" -.Ip "\f(CW\*(C`\-\-byte=\f(CIbyte\f(CW\*(C'\fR" 4 -.IX Item "--byte=byte" -Keep only every \fIbyte\fRth byte of the input file (header data is not -affected). \fIbyte\fR can be in the range from 0 to \fIinterleave\fR\-1, -where \fIinterleave\fR is given by the \fB\-i\fR or \fB\*(--interleave\fR -option, or the default of 4. This option is useful for creating files -to program \s-1ROM\s0. It is typically used with an \f(CW\*(C`srec\*(C'\fR output -target. -.Ip "\f(CW\*(C`\-i \f(CIinterleave\f(CW\*(C'\fR" 4 -.IX Item "-i interleave" -.Ip "\f(CW\*(C`\-\-interleave=\f(CIinterleave\f(CW\*(C'\fR" 4 -.IX Item "--interleave=interleave" -Only copy one out of every \fIinterleave\fR bytes. Select which byte to -copy with the \fI\-b\fR or \fB\*(--byte\fR option. The default is 4. -\&\f(CW\*(C`objcopy\*(C'\fR ignores this option if you do not specify either \fB\-b\fR or -\&\fB\*(--byte\fR. -.Ip "\f(CW\*(C`\-p\*(C'\fR" 4 -.IX Item "-p" -.Ip "\f(CW\*(C`\-\-preserve\-dates\*(C'\fR" 4 -.IX Item "--preserve-dates" -Set the access and modification dates of the output file to be the same -as those of the input file. -.Ip "\f(CW\*(C`\-\-debugging\*(C'\fR" 4 -.IX Item "--debugging" -Convert debugging information, if possible. This is not the default -because only certain debugging formats are supported, and the -conversion process can be time consuming. -.Ip "\f(CW\*(C`\-\-gap\-fill \f(CIval\f(CW\*(C'\fR" 4 -.IX Item "--gap-fill val" -Fill gaps between sections with \fIval\fR. This operation applies to -the \fIload address\fR (\s-1LMA\s0) of the sections. It is done by increasing -the size of the section with the lower address, and filling in the extra -space created with \fIval\fR. -.Ip "\f(CW\*(C`\-\-pad\-to \f(CIaddress\f(CW\*(C'\fR" 4 -.IX Item "--pad-to address" -Pad the output file up to the load address \fIaddress\fR. This is -done by increasing the size of the last section. The extra space is -filled in with the value specified by \fB\*(--gap-fill\fR (default zero). -.Ip "\f(CW\*(C`\-\-set\-start \f(CIval\f(CW\*(C'\fR" 4 -.IX Item "--set-start val" -Set the start address of the new file to \fIval\fR. Not all object file -formats support setting the start address. -.Ip "\f(CW\*(C`\-\-change\-start \f(CIincr\f(CW\*(C'\fR" 4 -.IX Item "--change-start incr" -.Ip "\f(CW\*(C`\-\-adjust\-start \f(CIincr\f(CW\*(C'\fR" 4 -.IX Item "--adjust-start incr" -Change the start address by adding \fIincr\fR. Not all object file -formats support setting the start address. -.Ip "\f(CW\*(C`\-\-change\-addresses \f(CIincr\f(CW\*(C'\fR" 4 -.IX Item "--change-addresses incr" -.Ip "\f(CW\*(C`\-\-adjust\-vma \f(CIincr\f(CW\*(C'\fR" 4 -.IX Item "--adjust-vma incr" -Change the \s-1VMA\s0 and \s-1LMA\s0 addresses of all sections, as well as the start -address, by adding \fIincr\fR. Some object file formats do not permit -section addresses to be changed arbitrarily. Note that this does not -relocate the sections; if the program expects sections to be loaded at a -certain address, and this option is used to change the sections such -that they are loaded at a different address, the program may fail. -.Ip "\f(CW\*(C`\-\-change\-section\-address \f(CIsection\f(CW{=,+,\-}\f(CIval\f(CW\*(C'\fR" 4 -.IX Item "--change-section-address section{=,+,-}val" -.Ip "\f(CW\*(C`\-\-adjust\-section\-vma \f(CIsection\f(CW{=,+,\-}\f(CIval\f(CW\*(C'\fR" 4 -.IX Item "--adjust-section-vma section{=,+,-}val" -Set or change both the \s-1VMA\s0 address and the \s-1LMA\s0 address of the named -\&\fIsection\fR. If \fB=\fR is used, the section address is set to -\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the -section address. See the comments under \fB\*(--change-addresses\fR, -above. If \fIsection\fR does not exist in the input file, a warning will -be issued, unless \fB\*(--no-change-warnings\fR is used. -.Ip "\f(CW\*(C`\-\-change\-section\-lma \f(CIsection\f(CW{=,+,\-}\f(CIval\f(CW\*(C'\fR" 4 -.IX Item "--change-section-lma section{=,+,-}val" -Set or change the \s-1LMA\s0 address of the named \fIsection\fR. The \s-1LMA\s0 -address is the address where the section will be loaded into memory at -program load time. Normally this is the same as the \s-1VMA\s0 address, which -is the address of the section at program run time, but on some systems, -especially those where a program is held in \s-1ROM\s0, the two can be -different. If \fB=\fR is used, the section address is set to -\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the -section address. See the comments under \fB\*(--change-addresses\fR, -above. If \fIsection\fR does not exist in the input file, a warning -will be issued, unless \fB\*(--no-change-warnings\fR is used. -.Ip "\f(CW\*(C`\-\-change\-section\-vma \f(CIsection\f(CW{=,+,\-}\f(CIval\f(CW\*(C'\fR" 4 -.IX Item "--change-section-vma section{=,+,-}val" -Set or change the \s-1VMA\s0 address of the named \fIsection\fR. The \s-1VMA\s0 -address is the address where the section will be located once the -program has started executing. Normally this is the same as the \s-1LMA\s0 -address, which is the address where the section will be loaded into -memory, but on some systems, especially those where a program is held in -\&\s-1ROM\s0, the two can be different. If \fB=\fR is used, the section address -is set to \fIval\fR. Otherwise, \fIval\fR is added to or subtracted -from the section address. See the comments under -\&\fB\*(--change-addresses\fR, above. If \fIsection\fR does not exist in -the input file, a warning will be issued, unless -\&\fB\*(--no-change-warnings\fR is used. -.Ip "\f(CW\*(C`\-\-change\-warnings\*(C'\fR" 4 -.IX Item "--change-warnings" -.Ip "\f(CW\*(C`\-\-adjust\-warnings\*(C'\fR" 4 -.IX Item "--adjust-warnings" -If \fB\*(--change-section-address\fR or \fB\*(--change-section-lma\fR or -\&\fB\*(--change-section-vma\fR is used, and the named section does not -exist, issue a warning. This is the default. -.Ip "\f(CW\*(C`\-\-no\-change\-warnings\*(C'\fR" 4 -.IX Item "--no-change-warnings" -.Ip "\f(CW\*(C`\-\-no\-adjust\-warnings\*(C'\fR" 4 -.IX Item "--no-adjust-warnings" -Do not issue a warning if \fB\*(--change-section-address\fR or -\&\fB\*(--adjust-section-lma\fR or \fB\*(--adjust-section-vma\fR is used, even -if the named section does not exist. -.Ip "\f(CW\*(C`\-\-set\-section\-flags \f(CIsection\f(CW=\f(CIflags\f(CW\*(C'\fR" 4 -.IX Item "--set-section-flags section=flags" -Set the flags for the named section. The \fIflags\fR argument is a -comma separated string of flag names. The recognized names are -\&\fBalloc\fR, \fBcontents\fR, \fBload\fR, \fBnoload\fR, -\&\fBreadonly\fR, \fBcode\fR, \fBdata\fR, \fBrom\fR, \fBshare\fR, and -\&\fBdebug\fR. You can set the \fBcontents\fR flag for a section which -does not have contents, but it is not meaningful to clear the -\&\fBcontents\fR flag of a section which does have contents\*(--just remove -the section instead. Not all flags are meaningful for all object file -formats. -.Ip "\f(CW\*(C`\-\-add\-section \f(CIsectionname\f(CW=\f(CIfilename\f(CW\*(C'\fR" 4 -.IX Item "--add-section sectionname=filename" -Add a new section named \fIsectionname\fR while copying the file. The -contents of the new section are taken from the file \fIfilename\fR. The -size of the section will be the size of the file. This option only -works on file formats which can support sections with arbitrary names. -.Ip "\f(CW\*(C`\-\-change\-leading\-char\*(C'\fR" 4 -.IX Item "--change-leading-char" -Some object file formats use special characters at the start of -symbols. The most common such character is underscore, which compilers -often add before every symbol. This option tells \f(CW\*(C`objcopy\*(C'\fR to -change the leading character of every symbol when it converts between -object file formats. If the object file formats use the same leading -character, this option has no effect. Otherwise, it will add a -character, or remove a character, or change a character, as -appropriate. -.Ip "\f(CW\*(C`\-\-remove\-leading\-char\*(C'\fR" 4 -.IX Item "--remove-leading-char" -If the first character of a global symbol is a special symbol leading -character used by the object file format, remove the character. The -most common symbol leading character is underscore. This option will -remove a leading underscore from all global symbols. This can be useful -if you want to link together objects of different file formats with -different conventions for symbol names. This is different from -\&\f(CW\*(C`\-\-change\-leading\-char\*(C'\fR because it always changes the symbol name -when appropriate, regardless of the object file format of the output -file. -.Ip "\f(CW\*(C`\-\-srec\-len=\f(CIival\f(CW\*(C'\fR" 4 -.IX Item "--srec-len=ival" -Meaningful only for srec output. Set the maximum length of the Srecords -being produced to \fIival\fR. This length covers both address, data and -crc fields. -.Ip "\f(CW\*(C`\-\-srec\-forceS3\*(C'\fR" 4 -.IX Item "--srec-forceS3" -Meaningful only for srec output. Avoid generation of S1/S2 records, -creating S3\-only record format. -.Ip "\f(CW\*(C`\-\-redefine\-sym \f(CIold\f(CW=\f(CInew\f(CW\*(C'\fR" 4 -.IX Item "--redefine-sym old=new" -Change the name of a symbol \fIold\fR, to \fInew\fR. This can be useful -when one is trying link two things together for which you have no -source, and there are name collisions. -.Ip "\f(CW\*(C`\-\-weaken\*(C'\fR" 4 -.IX Item "--weaken" -Change all global symbols in the file to be weak. This can be useful -when building an object which will be linked against other objects using -the \f(CW\*(C`\-R\*(C'\fR option to the linker. This option is only effective when -using an object file format which supports weak symbols. -.Ip "\f(CW\*(C`\-\-keep\-symbols=\f(CIfilename\f(CW\*(C'\fR" 4 -.IX Item "--keep-symbols=filename" -Apply \fB\*(--keep-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.Ip "\f(CW\*(C`\-\-strip\-symbols=\f(CIfilename\f(CW\*(C'\fR" 4 -.IX Item "--strip-symbols=filename" -Apply \fB\*(--strip-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.Ip "\f(CW\*(C`\-\-keep\-global\-symbols=\f(CIfilename\f(CW\*(C'\fR" 4 -.IX Item "--keep-global-symbols=filename" -Apply \fB\*(--keep-global-symbol\fR option to each symbol listed in the -file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one -symbol name per line. Line comments may be introduced by the hash -character. This option may be given more than once. -.Ip "\f(CW\*(C`\-\-localize\-symbols=\f(CIfilename\f(CW\*(C'\fR" 4 -.IX Item "--localize-symbols=filename" -Apply \fB\*(--localize-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.Ip "\f(CW\*(C`\-\-weaken\-symbols=\f(CIfilename\f(CW\*(C'\fR" 4 -.IX Item "--weaken-symbols=filename" -Apply \fB\*(--weaken-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.Ip "\f(CW\*(C`\-V\*(C'\fR" 4 -.IX Item "-V" -.Ip "\f(CW\*(C`\-\-version\*(C'\fR" 4 -.IX Item "--version" -Show the version number of \f(CW\*(C`objcopy\*(C'\fR. -.Ip "\f(CW\*(C`\-v\*(C'\fR" 4 -.IX Item "-v" -.Ip "\f(CW\*(C`\-\-verbose\*(C'\fR" 4 -.IX Item "--verbose" -Verbose output: list all object files modified. In the case of -archives, \fBobjcopy \-V\fR lists all members of the archive. -.Ip "\f(CW\*(C`\-\-help\*(C'\fR" 4 -.IX Item "--help" -Show a summary of the options to \f(CW\*(C`objcopy\*(C'\fR. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIld\fR\|(1), \fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/contrib/binutils/binutils/objdump.1 b/contrib/binutils/binutils/objdump.1 deleted file mode 100644 index 591a0f44bbde..000000000000 --- a/contrib/binutils/binutils/objdump.1 +++ /dev/null @@ -1,770 +0,0 @@ -.\" Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 1998, 2000 Free Software Foundation -.\" See section COPYING for conditions for redistribution -.TH objdump 1 "5 November 1991" "Free Software Foundation" "GNU Development Tools" -.de BP -.sp -.ti \-.2i -\(** -.. - -.SH NAME -objdump \- display information from object files. - -.SH SYNOPSIS -.hy 0 -.na -.B objdump -.RB "[\|" \-a | \-\-archive\-headers "\|]" -.RB "[\|" "\-b\ "\c -.I bfdname\c -.RB " | " "\-\-target="\c -.I bfdname\c -\&\|] -.RB "[\|" \-C | \-\-demangle "\|]" -.RB "[\|" \-\-debugging "\|]" -.RB "[\|" \-d | \-\-disassemble "\|]" -.RB "[\|" \-D | \-\-disassemble-all "\|]" -.RB "[\|" \-\-disassemble\-zeroes "\|]" -.RB "[\|" \-EB | \-EL | \-\-endian=\c -.I {big|little}\c -\&\|] -.RB "[\|" \-f | \-\-file\-headers "\|]" -.RB "[\|" \-h | \-\-section\-headers -.RB "| " \-\-headers "\|]" -.RB "[\|" \-i | \-\-info "\|]" -.RB "[\|" "\-j\ "\c -.I section\c -.RB " | " "\-\-section="\c -.I section\c -\&\|] -.RB "[\|" \-l | \-\-line\-numbers "\|]" -.RB "[\|" "\-m\ "\c -.I machine\c -.RB " | " "\-\-architecture="\c -.I machine\c -\&\|] -.RB "[\|" \-p | \-\-private\-headers "\|]" -.RB "[\|" \-\-prefix\-addresses "\|]" -.RB "[\|" \-r | \-\-reloc "\|]" -.RB "[\|" \-R | \-\-dynamic\-reloc "\|]" -.RB "[\|" \-s | \-\-full\-contents "\|]" -.RB "[\|" \-S | \-\-source "\|]" -.RB "[\|" \-\-[no\-]show\-raw\-insn "\|]" -.RB "[\|" \-\-stabs "\|]" -.RB "[\|" \-t | \-\-syms "\|]" -.RB "[\|" \-T | \-\-dynamic\-syms "\|]" -.RB "[\|" \-x | \-\-all\-headers "\|]" -.RB "[\|" "\-\-start\-address="\c -.I address\c -\&\|] -.RB "[\|" "\-\-stop\-address="\c -.I address\c -\&\|] -.RB "[\|" "\-\-adjust\-vma="\c -.I offset\c -\&\|] -.RB "[\|" \-\-version "\|]" -.RB "[\|" \-\-help "\|]" -.I objfile\c -\&.\|.\|. -.ad b -.hy 1 -.SH DESCRIPTION -\c -.B objdump\c -\& displays information about one or more object files. -The options control what particular information to display. This -information is mostly useful to programmers who are working on the -compilation tools, as opposed to programmers who just want their -program to compile and work. -.PP -.IR "objfile" .\|.\|. -are the object files to be examined. When you specify archives, -\c -.B objdump\c -\& shows information on each of the member object files. - -.SH OPTIONS -Where long and short forms of an option are shown together, they are -equivalent. At least one option besides -.B \-l -(\fB\-\-line\-numbers\fP) must be given. - -.TP -.B \-a -.TP -.B \-\-archive\-headers -If any files from \c -.I objfile\c -\& are archives, display the archive -header information (in a format similar to `\|\c -.B ls \-l\c -\|'). Besides the -information you could list with `\|\c -.B ar tv\c -\|', `\|\c -.B objdump \-a\c -\|' shows -the object file format of each archive member. - -.TP -.BI "\-\-adjust\-vma=" "offset" -When dumping information, first add -.I offset -to all the section addresses. This is useful if the section addresses -do not correspond to the symbol table, which can happen when putting -sections at particular addresses when using a format which can not -represent section addresses, such as a.out. - -.TP -.BI "\-b " "bfdname"\c -.TP -.BI "\-\-target=" "bfdname" -Specify the object-code format for the object files to be -\c -.I bfdname\c -\&. This may not be necessary; \c -.I objdump\c -\& can -automatically recognize many formats. For example, -.sp -.br -objdump\ \-b\ oasys\ \-m\ vax\ \-h\ fu.o -.br -.sp -display summary information from the section headers (`\|\c -.B \-h\c -\|') of -`\|\c -.B fu.o\c -\|', which is explicitly identified (`\|\c -.B \-m\c -\|') as a Vax object -file in the format produced by Oasys compilers. You can list the -formats available with the `\|\c -.B \-i\c -\|' option. - -.TP -.B \-C -.TP -.B \-\-demangle -Decode (\fIdemangle\fP) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes C++ function names readable. - -.TP -.B \-\-debugging -Display debugging information. This attempts to parse debugging -information stored in the file and print it out using a C like syntax. -Only certain types of debugging information have been implemented. - -.TP -.B \-d -.TP -.B \-\-disassemble -Display the assembler mnemonics for the machine -instructions from \c -.I objfile\c -\&. -This option only disassembles those sections which are -expected to contain instructions. - -.TP -.B \-D -.TP -.B \-\-disassemble-all -Like \fB\-d\fP, but disassemble the contents of all sections, not just -those expected to contain instructions. - -.TP -.B \-\-prefix\-addresses -When disassembling, print the complete address on each line. This is -the older disassembly format. - -.TP -.B \-\-disassemble\-zeroes -Normally the disassembly output will skip blocks of zeroes. This -option directs the disassembler to disassemble those blocks, just like -any other data. - -.TP -.B \-EB -.TP -.B \-EL -.TP -.BI "\-\-endian=" "{big|little}" -Specify the endianness of the object files. This only affects -disassembly. This can be useful when disassembling a file format which -does not describe endianness information, such as S-records. - -.TP -.B \-f -.TP -.B \-\-file\-headers -Display summary information from the overall header of -each file in \c -.I objfile\c -\&. - -.TP -.B \-h -.TP -.B \-\-section\-headers -.TP -.B \-\-headers -Display summary information from the section headers of the -object file. - -.TP -.B \-\-help -Print a summary of the options to -.B objdump -and exit. - -.TP -.B \-i -.TP -.B \-\-info -Display a list showing all architectures and object formats available -for specification with \c -.B \-b\c -\& or \c -.B \-m\c -\&. - -.TP -.BI "\-j " "name"\c -.TP -.BI "\-\-section=" "name" -Display information only for section \c -.I name\c -\&. - -.TP -.B \-l -.TP -.B \-\-line\-numbers -Label the display (using debugging information) with the filename -and source line numbers corresponding to the object code shown. -Only useful with \fB\-d\fP, \fB\-D\fP, or \fB\-r\fP. - -.TP -.BI "\-m " "machine"\c -.TP -.BI "\-\-architecture=" "machine" -Specify the architecture to use when disassembling object files. This -can be useful when disassembling object files which do not describe -architecture information, such as S-records. You can list the available -architectures with the \fB\-i\fP option. - -.TP -.B \-p -.TP -.B \-\-private\-headers -Print information that is specific to the object file format. The -exact information printed depends upon the object file format. For -some object file formats, no additional information is printed. - -.TP -.B \-r -.TP -.B \-\-reloc -Print the relocation entries of the file. If used with \fB\-d\fP or -\fB\-D\fP, the relocations are printed interspersed with the -disassembly. - -.TP -.B \-R -.TP -.B \-\-dynamic\-reloc -Print the dynamic relocation entries of the file. This is only -meaningful for dynamic objects, such as certain types of shared -libraries. - -.TP -.B \-s -.TP -.B \-\-full\-contents -Display the full contents of any sections requested. - -.TP -.B \-S -.TP -.B \-\-source -Display source code intermixed with disassembly, if possible. Implies -\fB-d\fP. - -.TP -.B \-\-show\-raw\-insn -When disassembling instructions, print the instruction in hex as well as -in symbolic form. This is the default except when -.B \-\-prefix\-addresses -is used. - -.TP -.B \-\-no\-show\-raw\-insn -When disassembling instructions, do not print the instruction bytes. -This is the default when -.B \-\-prefix\-addresses -is used. - -.TP -.B \-\-stabs -Display the contents of the .stab, .stab.index, and .stab.excl -sections from an ELF file. This is only useful on systems (such as -Solaris 2.0) in which .stab debugging symbol-table entries are carried -in an ELF section. In most other file formats, debugging symbol-table -entries are interleaved with linkage symbols, and are visible in the -.B \-\-syms -output. - -.TP -.BI "\-\-start\-address=" "address" -Start displaying data at the specified address. This affects the output -of the -.B \-d\c -, -.B \-r -and -.B \-s -options. - -.TP -.BI "\-\-stop\-address=" "address" -Stop displaying data at the specified address. This affects the output -of the -.B \-d\c -, -.B \-r -and -.B \-s -options. - -.TP -.B \-t -.TP -.B \-\-syms -Symbol Table. Print the symbol table entries of the file. -This is similar to the information provided by the `\|\c -.B nm\c -\|' program. - -.TP -.B \-T -.TP -.B \-\-dynamic\-syms -Dynamic Symbol Table. Print the dynamic symbol table entries of the -file. This is only meaningful for dynamic objects, such as certain -types of shared libraries. This is similar to the information -provided by the `\|\c -.B nm\c -\|' program when given the -.B \-D (\-\-dynamic) -option. - -.TP -.B \-\-version -Print the version number of -.B objdump -and exit. - -.TP -.B \-x -.TP -.B \-\-all\-headers -Display all available header information, including the symbol table and -relocation entries. Using `\|\c -.B \-x\c -\|' is equivalent to specifying all of -`\|\c -.B \-a \-f \-h \-r \-t\c -\|'. - -.SH "SEE ALSO" -.RB "`\|" binutils "\|'" -entry in -.B -info\c -\&; -.I -The GNU Binary Utilities\c -\&, Roland H. Pesch (October 1991); -.BR nm "(" 1 ")." - -.SH COPYING -Copyright (c) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. -.PP -.PP -This document is distributed under the terms of the GNU Free -Documentation License, version 1.1. That license is described in the -sources for this manual page, but it is not displayed here in order to -make this manual more consise. Copies of this license can also be -obtained from: http://www.gnu.org/copyleft/. - -\" .SH GNU Free Documentation License -\" Version 1.1, March 2000 - -\" Copyright (C) 2000 Free Software Foundation, Inc. -\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -\" Everyone is permitted to copy and distribute verbatim -\" copies of this license document, but changing it is -\" not allowed. -\" .PP -\" 0. PREAMBLE -\" .PP -\" The purpose of this License is to make a manual, textbook, or other -\" written document "free" in the sense of freedom: to assure everyone -\" the effective freedom to copy and redistribute it, with or without -\" modifying it, either commercially or noncommercially. Secondarily, -\" this License preserves for the author and publisher a way to get -\" credit for their work, while not being considered responsible for -\" modifications made by others. -\" .PP -\" This License is a kind of "copyleft", which means that derivative -\" works of the document must themselves be free in the same sense. It -\" complements the GNU General Public License, which is a copyleft -\" license designed for free software. -\" .PP -\" We have designed this License in order to use it for manuals for free -\" software, because free software needs free documentation: a free -\" program should come with manuals providing the same freedoms that the -\" software does. But this License is not limited to software manuals; -\" it can be used for any textual work, regardless of subject matter or -\" whether it is published as a printed book. We recommend this License -\" principally for works whose purpose is instruction or reference. -\" .PP -\" 1. APPLICABILITY AND DEFINITIONS -\" .PP -\" This License applies to any manual or other work that contains a -\" notice placed by the copyright holder saying it can be distributed -\" under the terms of this License. The "Document", below, refers to any -\" such manual or work. Any member of the public is a licensee, and is -\" addressed as "you". -\" .PP -\" A "Modified Version" of the Document means any work containing the -\" Document or a portion of it, either copied verbatim, or with -\" modifications and/or translated into another language. -\" .PP -\" A "Secondary Section" is a named appendix or a front-matter section of -\" the Document that deals exclusively with the relationship of the -\" publishers or authors of the Document to the Document's overall subject -\" (or to related matters) and contains nothing that could fall directly -\" within that overall subject. (For example, if the Document is in part a -\" textbook of mathematics, a Secondary Section may not explain any -\" mathematics.) The relationship could be a matter of historical -\" connection with the subject or with related matters, or of legal, -\" commercial, philosophical, ethical or political position regarding -\" them. -\" .PP -\" The "Invariant Sections" are certain Secondary Sections whose titles -\" are designated, as being those of Invariant Sections, in the notice -\" that says that the Document is released under this License. -\" .PP -\" The "Cover Texts" are certain short passages of text that are listed, -\" as Front-Cover Texts or Back-Cover Texts, in the notice that says that -\" the Document is released under this License. -\" .PP -\" A "Transparent" copy of the Document means a machine-readable copy, -\" represented in a format whose specification is available to the -\" general public, whose contents can be viewed and edited directly and -\" straightforwardly with generic text editors or (for images composed of -\" pixels) generic paint programs or (for drawings) some widely available -\" drawing editor, and that is suitable for input to text formatters or -\" for automatic translation to a variety of formats suitable for input -\" to text formatters. A copy made in an otherwise Transparent file -\" format whose markup has been designed to thwart or discourage -\" subsequent modification by readers is not Transparent. A copy that is -\" not "Transparent" is called "Opaque". -\" .PP -\" Examples of suitable formats for Transparent copies include plain -\" ASCII without markup, Texinfo input format, LaTeX input format, SGML -\" or XML using a publicly available DTD, and standard-conforming simple -\" HTML designed for human modification. Opaque formats include -\" PostScript, PDF, proprietary formats that can be read and edited only -\" by proprietary word processors, SGML or XML for which the DTD and/or -\" processing tools are not generally available, and the -\" machine-generated HTML produced by some word processors for output -\" purposes only. -\" .PP -\" The "Title Page" means, for a printed book, the title page itself, -\" plus such following pages as are needed to hold, legibly, the material -\" this License requires to appear in the title page. For works in -\" formats which do not have any title page as such, "Title Page" means -\" the text near the most prominent appearance of the work's title, -\" preceding the beginning of the body of the text. -\" .PP -\" 2. VERBATIM COPYING -\" .PP -\" You may copy and distribute the Document in any medium, either -\" commercially or noncommercially, provided that this License, the -\" copyright notices, and the license notice saying this License applies -\" to the Document are reproduced in all copies, and that you add no other -\" conditions whatsoever to those of this License. You may not use -\" technical measures to obstruct or control the reading or further -\" copying of the copies you make or distribute. However, you may accept -\" compensation in exchange for copies. If you distribute a large enough -\" number of copies you must also follow the conditions in section 3. -\" .PP -\" You may also lend copies, under the same conditions stated above, and -\" you may publicly display copies. -\" .PP -\" 3. COPYING IN QUANTITY -\" .PP -\" If you publish printed copies of the Document numbering more than 100, -\" and the Document's license notice requires Cover Texts, you must enclose -\" the copies in covers that carry, clearly and legibly, all these Cover -\" Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -\" the back cover. Both covers must also clearly and legibly identify -\" you as the publisher of these copies. The front cover must present -\" the full title with all words of the title equally prominent and -\" visible. You may add other material on the covers in addition. -\" Copying with changes limited to the covers, as long as they preserve -\" the title of the Document and satisfy these conditions, can be treated -\" as verbatim copying in other respects. -\" .PP -\" If the required texts for either cover are too voluminous to fit -\" legibly, you should put the first ones listed (as many as fit -\" reasonably) on the actual cover, and continue the rest onto adjacent -\" pages. -\" .PP -\" If you publish or distribute Opaque copies of the Document numbering -\" more than 100, you must either include a machine-readable Transparent -\" copy along with each Opaque copy, or state in or with each Opaque copy -\" a publicly-accessible computer-network location containing a complete -\" Transparent copy of the Document, free of added material, which the -\" general network-using public has access to download anonymously at no -\" charge using public-standard network protocols. If you use the latter -\" option, you must take reasonably prudent steps, when you begin -\" distribution of Opaque copies in quantity, to ensure that this -\" Transparent copy will remain thus accessible at the stated location -\" until at least one year after the last time you distribute an Opaque -\" copy (directly or through your agents or retailers) of that edition to -\" the public. -\" .PP -\" It is requested, but not required, that you contact the authors of the -\" Document well before redistributing any large number of copies, to give -\" them a chance to provide you with an updated version of the Document. -\" .PP -\" 4. MODIFICATIONS -\" .PP -\" You may copy and distribute a Modified Version of the Document under -\" the conditions of sections 2 and 3 above, provided that you release -\" the Modified Version under precisely this License, with the Modified -\" Version filling the role of the Document, thus licensing distribution -\" and modification of the Modified Version to whoever possesses a copy -\" of it. In addition, you must do these things in the Modified Version: -\" .PP -\" A. Use in the Title Page (and on the covers, if any) a title distinct -\" from that of the Document, and from those of previous versions -\" (which should, if there were any, be listed in the History section -\" of the Document). You may use the same title as a previous version -\" if the original publisher of that version gives permission. -\" .PP -\" B. List on the Title Page, as authors, one or more persons or entities -\" responsible for authorship of the modifications in the Modified -\" Version, together with at least five of the principal authors of the -\" Document (all of its principal authors, if it has less than five). -\" .PP -\" C. State on the Title page the name of the publisher of the -\" Modified Version, as the publisher. -\" .PP -\" D. Preserve all the copyright notices of the Document. -\" .PP -\" E. Add an appropriate copyright notice for your modifications -\" adjacent to the other copyright notices. -\" .PP -\" F. Include, immediately after the copyright notices, a license notice -\" giving the public permission to use the Modified Version under the -\" terms of this License, in the form shown in the Addendum below. -\" Preserve in that license notice the full lists of Invariant Sections -\" and required Cover Texts given in the Document's license notice. -\" .PP -\" H. Include an unaltered copy of this License. -\" .PP -\" I. Preserve the section entitled "History", and its title, and add to -\" it an item stating at least the title, year, new authors, and -\" publisher of the Modified Version as given on the Title Page. If -\" there is no section entitled "History" in the Document, create one -\" stating the title, year, authors, and publisher of the Document as -\" given on its Title Page, then add an item describing the Modified -\" Version as stated in the previous sentence. -\" .PP -\" J. Preserve the network location, if any, given in the Document for -\" public access to a Transparent copy of the Document, and likewise -\" the network locations given in the Document for previous versions -\" it was based on. These may be placed in the "History" section. -\" You may omit a network location for a work that was published at -\" least four years before the Document itself, or if the original -\" publisher of the version it refers to gives permission. -\" .PP -\" K. In any section entitled "Acknowledgements" or "Dedications", -\" preserve the section's title, and preserve in the section all the -\" substance and tone of each of the contributor acknowledgements -\" and/or dedications given therein. -\" .PP -\" L. Preserve all the Invariant Sections of the Document, -\" unaltered in their text and in their titles. Section numbers -\" or the equivalent are not considered part of the section titles. -\" .PP -\" M. Delete any section entitled "Endorsements". Such a section -\" may not be included in the Modified Version. -\" .PP -\" N. Do not retitle any existing section as "Endorsements" -\" or to conflict in title with any Invariant Section. -\" .PP -\" If the Modified Version includes new front-matter sections or -\" appendices that qualify as Secondary Sections and contain no material -\" copied from the Document, you may at your option designate some or all -\" of these sections as invariant. To do this, add their titles to the -\" list of Invariant Sections in the Modified Version's license notice. -\" These titles must be distinct from any other section titles. -\" .PP -\" You may add a section entitled "Endorsements", provided it contains -\" nothing but endorsements of your Modified Version by various -\" parties--for example, statements of peer review or that the text has -\" been approved by an organization as the authoritative definition of a -\" standard. -\" .PP -\" You may add a passage of up to five words as a Front-Cover Text, and a -\" passage of up to 25 words as a Back-Cover Text, to the end of the list -\" of Cover Texts in the Modified Version. Only one passage of -\" Front-Cover Text and one of Back-Cover Text may be added by (or -\" through arrangements made by) any one entity. If the Document already -\" includes a cover text for the same cover, previously added by you or -\" by arrangement made by the same entity you are acting on behalf of, -\" you may not add another; but you may replace the old one, on explicit -\" permission from the previous publisher that added the old one. -\" .PP -\" The author(s) and publisher(s) of the Document do not by this License -\" give permission to use their names for publicity for or to assert or -\" imply endorsement of any Modified Version. -\" .PP - -\" 5. COMBINING DOCUMENTS -\" .PP -\" You may combine the Document with other documents released under this -\" License, under the terms defined in section 4 above for modified -\" versions, provided that you include in the combination all of the -\" Invariant Sections of all of the original documents, unmodified, and -\" list them all as Invariant Sections of your combined work in its -\" license notice. -\" .PP -\" The combined work need only contain one copy of this License, and -\" multiple identical Invariant Sections may be replaced with a single -\" copy. If there are multiple Invariant Sections with the same name but -\" different contents, make the title of each such section unique by -\" adding at the end of it, in parentheses, the name of the original -\" author or publisher of that section if known, or else a unique number. -\" Make the same adjustment to the section titles in the list of -\" Invariant Sections in the license notice of the combined work. -\" .PP -\" In the combination, you must combine any sections entitled "History" -\" in the various original documents, forming one section entitled -\" "History"; likewise combine any sections entitled "Acknowledgements", -\" and any sections entitled "Dedications". You must delete all sections -\" entitled "Endorsements." -\" .PP - -\" 6. COLLECTIONS OF DOCUMENTS -\" .PP -\" You may make a collection consisting of the Document and other documents -\" released under this License, and replace the individual copies of this -\" License in the various documents with a single copy that is included in -\" the collection, provided that you follow the rules of this License for -\" verbatim copying of each of the documents in all other respects. -\" .PP -\" You may extract a single document from such a collection, and distribute -\" it individually under this License, provided you insert a copy of this -\" License into the extracted document, and follow this License in all -\" other respects regarding verbatim copying of that document. -\" .PP - -\" 7. AGGREGATION WITH INDEPENDENT WORKS -\" .PP -\" A compilation of the Document or its derivatives with other separate -\" and independent documents or works, in or on a volume of a storage or -\" distribution medium, does not as a whole count as a Modified Version -\" of the Document, provided no compilation copyright is claimed for the -\" compilation. Such a compilation is called an "aggregate", and this -\" License does not apply to the other self-contained works thus compiled -\" with the Document, on account of their being thus compiled, if they -\" are not themselves derivative works of the Document. -\" .PP -\" If the Cover Text requirement of section 3 is applicable to these -\" copies of the Document, then if the Document is less than one quarter -\" of the entire aggregate, the Document's Cover Texts may be placed on -\" covers that surround only the Document within the aggregate. -\" Otherwise they must appear on covers around the whole aggregate. -\" .PP - -\" 8. TRANSLATION -\" .PP -\" Translation is considered a kind of modification, so you may -\" distribute translations of the Document under the terms of section 4. -\" Replacing Invariant Sections with translations requires special -\" permission from their copyright holders, but you may include -\" translations of some or all Invariant Sections in addition to the -\" original versions of these Invariant Sections. You may include a -\" translation of this License provided that you also include the -\" original English version of this License. In case of a disagreement -\" between the translation and the original English version of this -\" License, the original English version will prevail. -\" .PP - -\" 9. TERMINATION -\" .PP -\" You may not copy, modify, sublicense, or distribute the Document except -\" as expressly provided for under this License. Any other attempt to -\" copy, modify, sublicense or distribute the Document is void, and will -\" automatically terminate your rights under this License. However, -\" parties who have received copies, or rights, from you under this -\" License will not have their licenses terminated so long as such -\" parties remain in full compliance. -\" .PP - -\" 10. FUTURE REVISIONS OF THIS LICENSE -\" .PP -\" The Free Software Foundation may publish new, revised versions -\" of the GNU Free Documentation License from time to time. Such new -\" versions will be similar in spirit to the present version, but may -\" differ in detail to address new problems or concerns. See -\" http://www.gnu.org/copyleft/. -\" .PP -\" Each version of the License is given a distinguishing version number. -\" If the Document specifies that a particular numbered version of this -\" License "or any later version" applies to it, you have the option of -\" following the terms and conditions either of that specified version or -\" of any later version that has been published (not as a draft) by the -\" Free Software Foundation. If the Document does not specify a version -\" number of this License, you may choose any version ever published (not -\" as a draft) by the Free Software Foundation. -\" .PP - -\" ADDENDUM: How to use this License for your documents -\" .PP -\" To use this License in a document you have written, include a copy of -\" the License in the document and put the following copyright and -\" license notices just after the title page: -\" .PP -\" Copyright (c) YEAR YOUR NAME. -\" Permission is granted to copy, distribute and/or -\" modify this document under the terms of the GNU -\" Free Documentation License, Version 1.1 or any later -\" version published by the Free Software Foundation; -\" with the Invariant Sections being LIST THEIR TITLES, -\" with the Front-Cover Texts being LIST, and with the -\" Back-Cover Texts being LIST. A copy of the license -\" is included in the section entitled "GNU Free -\" Documentation License". -\" .PP -\" If you have no Invariant Sections, write "with no Invariant Sections" -\" instead of saying which ones are invariant. If you have no -\" Front-Cover Texts, write "no Front-Cover Texts" instead of -\" "Front-Cover Texts being LIST"; likewise for Back-Cover Texts. -\" .PP -\" If your document contains nontrivial examples of program code, we -\" recommend releasing these examples in parallel under your choice of -\" free software license, such as the GNU General Public License, -\" to permit their use in free software. diff --git a/contrib/binutils/binutils/ranlib.1 b/contrib/binutils/binutils/ranlib.1 deleted file mode 100644 index 9e973c699d9b..000000000000 --- a/contrib/binutils/binutils/ranlib.1 +++ /dev/null @@ -1,441 +0,0 @@ -.\" Copyright (c) 1991, 2000 Free Software Foundation -.\" See section COPYING for conditions for redistribution -.TH ranlib 1 "5 November 1991" "Free Software Foundation" "GNU Development Tools" -.de BP -.sp -.ti \-.2i -\(** -.. - -.SH NAME -ranlib \- generate index to archive. - -.SH SYNOPSIS -.hy 0 -.na -.B ranlib \c -.RB "[\|" \-v | \-V "\|]" -.I archive\c -\& -.ad b -.hy 1 -.SH DESCRIPTION -.B ranlib -generates an index to the contents of an archive, and -stores it in the archive. The index lists each symbol defined by a -member of an archive that is a relocatable object file. -.PP -You may use -.RB ` "nm \-s" ' -or -.RB ` "nm \-\-print-armap" ' -to list this index. -.PP -An archive with such an index speeds up linking to the library, and -allows routines in the library to call each other without regard to -their placement in the archive. -.PP -The GNU -.B ranlib -program is another form of GNU -.BR ar ; -running -.B ranlib -is completely equivalent to executing -.RB ` "ar \-s" '. - -.SH OPTIONS -.TP -.B \-v -Print the version number of -.B ranlib -and exit. - -.SH "SEE ALSO" -.RB "`\|" binutils "\|'" -entry in -.B -info\c -\&; -.I -The GNU Binary Utilities\c -\&, Roland H. Pesch (October 1991); -.BR ar "(" 1 ")," -.BR nm "(" 1 ")." - - -.SH COPYING -Copyright (c) 1991, 2000 Free Software Foundation, Inc. -.PP -This document is distributed under the terms of the GNU Free -Documentation License, version 1.1. That license is described in the -sources for this manual page, but it is not displayed here in order to -make this manual more consise. Copies of this license can also be -obtained from: http://www.gnu.org/copyleft/. - -\" .SH GNU Free Documentation License -\" Version 1.1, March 2000 - -\" Copyright (C) 2000 Free Software Foundation, Inc. -\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -\" Everyone is permitted to copy and distribute verbatim -\" copies of this license document, but changing it is -\" not allowed. -\" .PP -\" 0. PREAMBLE -\" .PP -\" The purpose of this License is to make a manual, textbook, or other -\" written document "free" in the sense of freedom: to assure everyone -\" the effective freedom to copy and redistribute it, with or without -\" modifying it, either commercially or noncommercially. Secondarily, -\" this License preserves for the author and publisher a way to get -\" credit for their work, while not being considered responsible for -\" modifications made by others. -\" .PP -\" This License is a kind of "copyleft", which means that derivative -\" works of the document must themselves be free in the same sense. It -\" complements the GNU General Public License, which is a copyleft -\" license designed for free software. -\" .PP -\" We have designed this License in order to use it for manuals for free -\" software, because free software needs free documentation: a free -\" program should come with manuals providing the same freedoms that the -\" software does. But this License is not limited to software manuals; -\" it can be used for any textual work, regardless of subject matter or -\" whether it is published as a printed book. We recommend this License -\" principally for works whose purpose is instruction or reference. -\" .PP -\" 1. APPLICABILITY AND DEFINITIONS -\" .PP -\" This License applies to any manual or other work that contains a -\" notice placed by the copyright holder saying it can be distributed -\" under the terms of this License. The "Document", below, refers to any -\" such manual or work. Any member of the public is a licensee, and is -\" addressed as "you". -\" .PP -\" A "Modified Version" of the Document means any work containing the -\" Document or a portion of it, either copied verbatim, or with -\" modifications and/or translated into another language. -\" .PP -\" A "Secondary Section" is a named appendix or a front-matter section of -\" the Document that deals exclusively with the relationship of the -\" publishers or authors of the Document to the Document's overall subject -\" (or to related matters) and contains nothing that could fall directly -\" within that overall subject. (For example, if the Document is in part a -\" textbook of mathematics, a Secondary Section may not explain any -\" mathematics.) The relationship could be a matter of historical -\" connection with the subject or with related matters, or of legal, -\" commercial, philosophical, ethical or political position regarding -\" them. -\" .PP -\" The "Invariant Sections" are certain Secondary Sections whose titles -\" are designated, as being those of Invariant Sections, in the notice -\" that says that the Document is released under this License. -\" .PP -\" The "Cover Texts" are certain short passages of text that are listed, -\" as Front-Cover Texts or Back-Cover Texts, in the notice that says that -\" the Document is released under this License. -\" .PP -\" A "Transparent" copy of the Document means a machine-readable copy, -\" represented in a format whose specification is available to the -\" general public, whose contents can be viewed and edited directly and -\" straightforwardly with generic text editors or (for images composed of -\" pixels) generic paint programs or (for drawings) some widely available -\" drawing editor, and that is suitable for input to text formatters or -\" for automatic translation to a variety of formats suitable for input -\" to text formatters. A copy made in an otherwise Transparent file -\" format whose markup has been designed to thwart or discourage -\" subsequent modification by readers is not Transparent. A copy that is -\" not "Transparent" is called "Opaque". -\" .PP -\" Examples of suitable formats for Transparent copies include plain -\" ASCII without markup, Texinfo input format, LaTeX input format, SGML -\" or XML using a publicly available DTD, and standard-conforming simple -\" HTML designed for human modification. Opaque formats include -\" PostScript, PDF, proprietary formats that can be read and edited only -\" by proprietary word processors, SGML or XML for which the DTD and/or -\" processing tools are not generally available, and the -\" machine-generated HTML produced by some word processors for output -\" purposes only. -\" .PP -\" The "Title Page" means, for a printed book, the title page itself, -\" plus such following pages as are needed to hold, legibly, the material -\" this License requires to appear in the title page. For works in -\" formats which do not have any title page as such, "Title Page" means -\" the text near the most prominent appearance of the work's title, -\" preceding the beginning of the body of the text. -\" .PP -\" 2. VERBATIM COPYING -\" .PP -\" You may copy and distribute the Document in any medium, either -\" commercially or noncommercially, provided that this License, the -\" copyright notices, and the license notice saying this License applies -\" to the Document are reproduced in all copies, and that you add no other -\" conditions whatsoever to those of this License. You may not use -\" technical measures to obstruct or control the reading or further -\" copying of the copies you make or distribute. However, you may accept -\" compensation in exchange for copies. If you distribute a large enough -\" number of copies you must also follow the conditions in section 3. -\" .PP -\" You may also lend copies, under the same conditions stated above, and -\" you may publicly display copies. -\" .PP -\" 3. COPYING IN QUANTITY -\" .PP -\" If you publish printed copies of the Document numbering more than 100, -\" and the Document's license notice requires Cover Texts, you must enclose -\" the copies in covers that carry, clearly and legibly, all these Cover -\" Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -\" the back cover. Both covers must also clearly and legibly identify -\" you as the publisher of these copies. The front cover must present -\" the full title with all words of the title equally prominent and -\" visible. You may add other material on the covers in addition. -\" Copying with changes limited to the covers, as long as they preserve -\" the title of the Document and satisfy these conditions, can be treated -\" as verbatim copying in other respects. -\" .PP -\" If the required texts for either cover are too voluminous to fit -\" legibly, you should put the first ones listed (as many as fit -\" reasonably) on the actual cover, and continue the rest onto adjacent -\" pages. -\" .PP -\" If you publish or distribute Opaque copies of the Document numbering -\" more than 100, you must either include a machine-readable Transparent -\" copy along with each Opaque copy, or state in or with each Opaque copy -\" a publicly-accessible computer-network location containing a complete -\" Transparent copy of the Document, free of added material, which the -\" general network-using public has access to download anonymously at no -\" charge using public-standard network protocols. If you use the latter -\" option, you must take reasonably prudent steps, when you begin -\" distribution of Opaque copies in quantity, to ensure that this -\" Transparent copy will remain thus accessible at the stated location -\" until at least one year after the last time you distribute an Opaque -\" copy (directly or through your agents or retailers) of that edition to -\" the public. -\" .PP -\" It is requested, but not required, that you contact the authors of the -\" Document well before redistributing any large number of copies, to give -\" them a chance to provide you with an updated version of the Document. -\" .PP -\" 4. MODIFICATIONS -\" .PP -\" You may copy and distribute a Modified Version of the Document under -\" the conditions of sections 2 and 3 above, provided that you release -\" the Modified Version under precisely this License, with the Modified -\" Version filling the role of the Document, thus licensing distribution -\" and modification of the Modified Version to whoever possesses a copy -\" of it. In addition, you must do these things in the Modified Version: -\" .PP -\" A. Use in the Title Page (and on the covers, if any) a title distinct -\" from that of the Document, and from those of previous versions -\" (which should, if there were any, be listed in the History section -\" of the Document). You may use the same title as a previous version -\" if the original publisher of that version gives permission. -\" .PP -\" B. List on the Title Page, as authors, one or more persons or entities -\" responsible for authorship of the modifications in the Modified -\" Version, together with at least five of the principal authors of the -\" Document (all of its principal authors, if it has less than five). -\" .PP -\" C. State on the Title page the name of the publisher of the -\" Modified Version, as the publisher. -\" .PP -\" D. Preserve all the copyright notices of the Document. -\" .PP -\" E. Add an appropriate copyright notice for your modifications -\" adjacent to the other copyright notices. -\" .PP -\" F. Include, immediately after the copyright notices, a license notice -\" giving the public permission to use the Modified Version under the -\" terms of this License, in the form shown in the Addendum below. -\" Preserve in that license notice the full lists of Invariant Sections -\" and required Cover Texts given in the Document's license notice. -\" .PP -\" H. Include an unaltered copy of this License. -\" .PP -\" I. Preserve the section entitled "History", and its title, and add to -\" it an item stating at least the title, year, new authors, and -\" publisher of the Modified Version as given on the Title Page. If -\" there is no section entitled "History" in the Document, create one -\" stating the title, year, authors, and publisher of the Document as -\" given on its Title Page, then add an item describing the Modified -\" Version as stated in the previous sentence. -\" .PP -\" J. Preserve the network location, if any, given in the Document for -\" public access to a Transparent copy of the Document, and likewise -\" the network locations given in the Document for previous versions -\" it was based on. These may be placed in the "History" section. -\" You may omit a network location for a work that was published at -\" least four years before the Document itself, or if the original -\" publisher of the version it refers to gives permission. -\" .PP -\" K. In any section entitled "Acknowledgements" or "Dedications", -\" preserve the section's title, and preserve in the section all the -\" substance and tone of each of the contributor acknowledgements -\" and/or dedications given therein. -\" .PP -\" L. Preserve all the Invariant Sections of the Document, -\" unaltered in their text and in their titles. Section numbers -\" or the equivalent are not considered part of the section titles. -\" .PP -\" M. Delete any section entitled "Endorsements". Such a section -\" may not be included in the Modified Version. -\" .PP -\" N. Do not retitle any existing section as "Endorsements" -\" or to conflict in title with any Invariant Section. -\" .PP -\" If the Modified Version includes new front-matter sections or -\" appendices that qualify as Secondary Sections and contain no material -\" copied from the Document, you may at your option designate some or all -\" of these sections as invariant. To do this, add their titles to the -\" list of Invariant Sections in the Modified Version's license notice. -\" These titles must be distinct from any other section titles. -\" .PP -\" You may add a section entitled "Endorsements", provided it contains -\" nothing but endorsements of your Modified Version by various -\" parties--for example, statements of peer review or that the text has -\" been approved by an organization as the authoritative definition of a -\" standard. -\" .PP -\" You may add a passage of up to five words as a Front-Cover Text, and a -\" passage of up to 25 words as a Back-Cover Text, to the end of the list -\" of Cover Texts in the Modified Version. Only one passage of -\" Front-Cover Text and one of Back-Cover Text may be added by (or -\" through arrangements made by) any one entity. If the Document already -\" includes a cover text for the same cover, previously added by you or -\" by arrangement made by the same entity you are acting on behalf of, -\" you may not add another; but you may replace the old one, on explicit -\" permission from the previous publisher that added the old one. -\" .PP -\" The author(s) and publisher(s) of the Document do not by this License -\" give permission to use their names for publicity for or to assert or -\" imply endorsement of any Modified Version. -\" .PP - -\" 5. COMBINING DOCUMENTS -\" .PP -\" You may combine the Document with other documents released under this -\" License, under the terms defined in section 4 above for modified -\" versions, provided that you include in the combination all of the -\" Invariant Sections of all of the original documents, unmodified, and -\" list them all as Invariant Sections of your combined work in its -\" license notice. -\" .PP -\" The combined work need only contain one copy of this License, and -\" multiple identical Invariant Sections may be replaced with a single -\" copy. If there are multiple Invariant Sections with the same name but -\" different contents, make the title of each such section unique by -\" adding at the end of it, in parentheses, the name of the original -\" author or publisher of that section if known, or else a unique number. -\" Make the same adjustment to the section titles in the list of -\" Invariant Sections in the license notice of the combined work. -\" .PP -\" In the combination, you must combine any sections entitled "History" -\" in the various original documents, forming one section entitled -\" "History"; likewise combine any sections entitled "Acknowledgements", -\" and any sections entitled "Dedications". You must delete all sections -\" entitled "Endorsements." -\" .PP - -\" 6. COLLECTIONS OF DOCUMENTS -\" .PP -\" You may make a collection consisting of the Document and other documents -\" released under this License, and replace the individual copies of this -\" License in the various documents with a single copy that is included in -\" the collection, provided that you follow the rules of this License for -\" verbatim copying of each of the documents in all other respects. -\" .PP -\" You may extract a single document from such a collection, and distribute -\" it individually under this License, provided you insert a copy of this -\" License into the extracted document, and follow this License in all -\" other respects regarding verbatim copying of that document. -\" .PP - -\" 7. AGGREGATION WITH INDEPENDENT WORKS -\" .PP -\" A compilation of the Document or its derivatives with other separate -\" and independent documents or works, in or on a volume of a storage or -\" distribution medium, does not as a whole count as a Modified Version -\" of the Document, provided no compilation copyright is claimed for the -\" compilation. Such a compilation is called an "aggregate", and this -\" License does not apply to the other self-contained works thus compiled -\" with the Document, on account of their being thus compiled, if they -\" are not themselves derivative works of the Document. -\" .PP -\" If the Cover Text requirement of section 3 is applicable to these -\" copies of the Document, then if the Document is less than one quarter -\" of the entire aggregate, the Document's Cover Texts may be placed on -\" covers that surround only the Document within the aggregate. -\" Otherwise they must appear on covers around the whole aggregate. -\" .PP - -\" 8. TRANSLATION -\" .PP -\" Translation is considered a kind of modification, so you may -\" distribute translations of the Document under the terms of section 4. -\" Replacing Invariant Sections with translations requires special -\" permission from their copyright holders, but you may include -\" translations of some or all Invariant Sections in addition to the -\" original versions of these Invariant Sections. You may include a -\" translation of this License provided that you also include the -\" original English version of this License. In case of a disagreement -\" between the translation and the original English version of this -\" License, the original English version will prevail. -\" .PP - -\" 9. TERMINATION -\" .PP -\" You may not copy, modify, sublicense, or distribute the Document except -\" as expressly provided for under this License. Any other attempt to -\" copy, modify, sublicense or distribute the Document is void, and will -\" automatically terminate your rights under this License. However, -\" parties who have received copies, or rights, from you under this -\" License will not have their licenses terminated so long as such -\" parties remain in full compliance. -\" .PP - -\" 10. FUTURE REVISIONS OF THIS LICENSE -\" .PP -\" The Free Software Foundation may publish new, revised versions -\" of the GNU Free Documentation License from time to time. Such new -\" versions will be similar in spirit to the present version, but may -\" differ in detail to address new problems or concerns. See -\" http://www.gnu.org/copyleft/. -\" .PP -\" Each version of the License is given a distinguishing version number. -\" If the Document specifies that a particular numbered version of this -\" License "or any later version" applies to it, you have the option of -\" following the terms and conditions either of that specified version or -\" of any later version that has been published (not as a draft) by the -\" Free Software Foundation. If the Document does not specify a version -\" number of this License, you may choose any version ever published (not -\" as a draft) by the Free Software Foundation. -\" .PP - -\" ADDENDUM: How to use this License for your documents -\" .PP -\" To use this License in a document you have written, include a copy of -\" the License in the document and put the following copyright and -\" license notices just after the title page: -\" .PP -\" Copyright (c) YEAR YOUR NAME. -\" Permission is granted to copy, distribute and/or -\" modify this document under the terms of the GNU -\" Free Documentation License, Version 1.1 or any later -\" version published by the Free Software Foundation; -\" with the Invariant Sections being LIST THEIR TITLES, -\" with the Front-Cover Texts being LIST, and with the -\" Back-Cover Texts being LIST. A copy of the license -\" is included in the section entitled "GNU Free -\" Documentation License". -\" .PP -\" If you have no Invariant Sections, write "with no Invariant Sections" -\" instead of saying which ones are invariant. If you have no -\" Front-Cover Texts, write "no Front-Cover Texts" instead of -\" "Front-Cover Texts being LIST"; likewise for Back-Cover Texts. -\" .PP -\" If your document contains nontrivial examples of program code, we -\" recommend releasing these examples in parallel under your choice of -\" free software license, such as the GNU General Public License, -\" to permit their use in free software. diff --git a/contrib/binutils/binutils/readelf.1 b/contrib/binutils/binutils/readelf.1 deleted file mode 100644 index bcef9862babb..000000000000 --- a/contrib/binutils/binutils/readelf.1 +++ /dev/null @@ -1,291 +0,0 @@ -.\" Automatically generated by Pod::Man version 1.02 -.\" Wed May 30 12:24:29 2001 -.\" -.\" Standard preamble: -.\" ====================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Ip \" List item -.br -.ie \\n(.$>=3 .ne \\$3 -.el .ne 3 -.IP "\\$1" \\$2 -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R - -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used -.\" to do unbreakable dashes and therefore won't be available. \*(C` and -.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> -.tr \(*W-|\(bv\*(Tr -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` ` -. ds C' ' -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr -.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and -.\" index entries marked with X<> in POD. Of course, you'll have to process -.\" the output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -. . -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it -.\" makes way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -.bd B 3 -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ====================================================================== -.\" -.IX Title "READELF.1 1" -.TH READELF.1 1 "binutils-2.11.90" "2001-05-30" "GNU" -.UC -.SH "NAME" -readelf \- Displays information about \s-1ELF\s0 files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -readelf [ \-a | \-\-all ] - [ \-h | \-\-file-header] - [ \-l | \-\-program-headers | \-\-segments] - [ \-S | \-\-section-headers | \-\-sections] - [ \-e | \-\-headers] - [ \-s | \-\-syms | \-\-symbols] - [ \-n | \-\-notes] - [ \-r | \-\-relocs] - [ \-u | \-\-unwind] - [ \-d | \-\-dynamic] - [ \-V | \-\-version-info] - [ \-D | \-\-use-dynamic] - [ \-x <number> | \-\-hex-dump=<number>] - [ \-w[liaprf] | \-\-debug-dump[=info,=line,=abbrev,=pubnames,=ranges,=frames]] - [ \-\-histogram] - [ \-v | \-\-version] - [ \-H | \-\-help] - \fIelffile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\f(CW\*(C`readelf\*(C'\fR displays information about one or more \s-1ELF\s0 format object -files. The options control what particular information to display. -.PP -\&\fIelffile\fR... are the object files to be examined. At the -moment, \f(CW\*(C`readelf\*(C'\fR does not support examining archives, nor does it -support examing 64 bit \s-1ELF\s0 files. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. At least one option besides \fB\-v\fR or \fB\-H\fR must be -given. -.Ip "\f(CW\*(C`\-a\*(C'\fR" 4 -.IX Item "-a" -.Ip "\f(CW\*(C`\-\-all\*(C'\fR" 4 -.IX Item "--all" -Equivalent to specifiying \fB\*(--file-header\fR, -\&\fB\*(--program-headers\fR, \fB\*(--sections\fR, \fB\*(--symbols\fR, -\&\fB\*(--relocs\fR, \fB\*(--dynamic\fR, \fB\*(--notes\fR and -\&\fB\*(--version-info\fR. -.Ip "\f(CW\*(C`\-h\*(C'\fR" 4 -.IX Item "-h" -.Ip "\f(CW\*(C`\-\-file\-header\*(C'\fR" 4 -.IX Item "--file-header" -Displays the information contained in the \s-1ELF\s0 header at the start of the -file. -.Ip "\f(CW\*(C`\-l\*(C'\fR" 4 -.IX Item "-l" -.Ip "\f(CW\*(C`\-\-program\-headers\*(C'\fR" 4 -.IX Item "--program-headers" -.Ip "\f(CW\*(C`\-\-segments\*(C'\fR" 4 -.IX Item "--segments" -Displays the information contained in the file's segment headers, if it -has any. -.Ip "\f(CW\*(C`\-S\*(C'\fR" 4 -.IX Item "-S" -.Ip "\f(CW\*(C`\-\-sections\*(C'\fR" 4 -.IX Item "--sections" -.Ip "\f(CW\*(C`\-\-section\-headers\*(C'\fR" 4 -.IX Item "--section-headers" -Displays the information contained in the file's section headers, if it -has any. -.Ip "\f(CW\*(C`\-s\*(C'\fR" 4 -.IX Item "-s" -.Ip "\f(CW\*(C`\-\-symbols\*(C'\fR" 4 -.IX Item "--symbols" -.Ip "\f(CW\*(C`\-\-syms\*(C'\fR" 4 -.IX Item "--syms" -Displays the entries in symbol table section of the file, if it has one. -.Ip "\f(CW\*(C`\-e\*(C'\fR" 4 -.IX Item "-e" -.Ip "\f(CW\*(C`\-\-headers\*(C'\fR" 4 -.IX Item "--headers" -Display all the headers in the file. Equivalent to \fB\-h \-l \-S\fR. -.Ip "\f(CW\*(C`\-n\*(C'\fR" 4 -.IX Item "-n" -.Ip "\f(CW\*(C`\-\-notes\*(C'\fR" 4 -.IX Item "--notes" -Displays the contents of the \s-1NOTE\s0 segment, if it exists. -.Ip "\f(CW\*(C`\-r\*(C'\fR" 4 -.IX Item "-r" -.Ip "\f(CW\*(C`\-\-relocs\*(C'\fR" 4 -.IX Item "--relocs" -Displays the contents of the file's relocation section, if it has one. -.Ip "\f(CW\*(C`\-u\*(C'\fR" 4 -.IX Item "-u" -.Ip "\f(CW\*(C`\-\-unwind\*(C'\fR" 4 -.IX Item "--unwind" -Displays the contents of the file's unwind section, if it has one. Only -the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. -.Ip "\f(CW\*(C`\-d\*(C'\fR" 4 -.IX Item "-d" -.Ip "\f(CW\*(C`\-\-dynamic\*(C'\fR" 4 -.IX Item "--dynamic" -Displays the contents of the file's dynamic section, if it has one. -.Ip "\f(CW\*(C`\-V\*(C'\fR" 4 -.IX Item "-V" -.Ip "\f(CW\*(C`\-\-version\-info\*(C'\fR" 4 -.IX Item "--version-info" -Displays the contents of the version sections in the file, it they -exist. -.Ip "\f(CW\*(C`\-D\*(C'\fR" 4 -.IX Item "-D" -.Ip "\f(CW\*(C`\-\-use\-dynamic\*(C'\fR" 4 -.IX Item "--use-dynamic" -When displaying symbols, this option makes \f(CW\*(C`readelf\*(C'\fR use the -symbol table in the file's dynamic section, rather than the one in the -symbols section. -.Ip "\f(CW\*(C`\-x <number>\*(C'\fR" 4 -.IX Item "-x <number>" -.Ip "\f(CW\*(C`\-\-hex\-dump=<number>\*(C'\fR" 4 -.IX Item "--hex-dump=<number>" -Displays the contents of the indicated section as a hexadecimal dump. -.Ip "\f(CW\*(C`\-w[liaprf]\*(C'\fR" 4 -.IX Item "-w[liaprf]" -.Ip "\f(CW\*(C`\-\-debug\-dump[=line,=info,=abbrev,=pubnames,=ranges,=frames]\*(C'\fR" 4 -.IX Item "--debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=frames]" -Displays the contents of the debug sections in the file, if any are -present. If one of the optional letters or words follows the switch -then only data found in those specific sections will be dumped. -.Ip "\f(CW\*(C`\-\-histogram\*(C'\fR" 4 -.IX Item "--histogram" -Display a histogram of bucket list lengths when displaying the contents -of the symbol tables. -.Ip "\f(CW\*(C`\-v\*(C'\fR" 4 -.IX Item "-v" -.Ip "\f(CW\*(C`\-\-version\*(C'\fR" 4 -.IX Item "--version" -Display the version number of readelf. -.Ip "\f(CW\*(C`\-H\*(C'\fR" 4 -.IX Item "-H" -.Ip "\f(CW\*(C`\-\-help\*(C'\fR" 4 -.IX Item "--help" -Display the command line options understood by \f(CW\*(C`readelf\*(C'\fR. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/contrib/binutils/binutils/size.1 b/contrib/binutils/binutils/size.1 deleted file mode 100644 index 7f8f9ef4e63b..000000000000 --- a/contrib/binutils/binutils/size.1 +++ /dev/null @@ -1,518 +0,0 @@ -.\" Copyright (c) 1991, 2000 Free Software Foundation -.\" See section COPYING for conditions for redistribution -.TH size 1 "5 November 1991" "Free Software Foundation" "GNU Development Tools" -.de BP -.sp -.ti \-.2i -\(** -.. - -.SH NAME -size \- list section sizes and total size. - -.SH SYNOPSIS -.hy 0 -.na -.B size -.RB "[\|" \-A \||\| \-B \||\| \c -.BI "\-\-format=" compatibility\c -\&\|] -.RB "[\|" \-\-help "\|]" -.RB "[\|" \-d \||\| \-o \||\| \-x\c -\||\|\c -.BI "\-\-radix=" number\c -\&\|] -.RB "[\|" \c -.BI "\-\-target=" bfdname\c -\&\|] -.RB "[\|" \-V \||\| \-\-version "\|]" -.I objfile\c -\&.\|.\|. -.ad b -.hy 1 -.SH DESCRIPTION -The GNU \c -.B size\c -\& utility lists the section sizes\(em\&and the total -size\(em\&for each of the object files -.I objfile -in its argument list. -By default, one line of output is generated for each object file or each -module in an archive. - -.SH OPTIONS -.TP -.B \-A -.TP -.B \-B -.TP -.BI "\-\-format " "compatibility" -Using one of these options, you can choose whether the output from GNU -\c -.B size\c -\& resembles output from System V \c -.B size\c -\& (using `\|\c -.B \-A\c -\|', -or `\|\c -.B \-\-format=sysv\c -\|'), or Berkeley \c -.B size\c -\& (using `\|\c -.B \-B\c -\|', or -`\|\c -.B \-\-format=berkeley\c -\|'). The default is the one-line format similar to -Berkeley's. - -.TP -.B \-\-help -Show a summary of acceptable arguments and options. - -.TP -.B \-d -.TP -.B \-o -.TP -.B \-x -.TP -.BI "\-\-radix " "number" -Using one of these options, you can control whether the size of each -section is given in decimal (`\|\c -.B \-d\c -\|', or `\|\c -.B \-\-radix 10\c -\|'); octal -(`\|\c -.B \-o\c -\|', or `\|\c -.B \-\-radix 8\c -\|'); or hexadecimal (`\|\c -.B \-x\c -\|', or -`\|\c -.B \-\-radix 16\c -\|'). In `\|\c -.B \-\-radix \c -.I number\c -\&\c -\|', only the three -values (8, 10, 16) are supported. The total size is always given in two -radices; decimal and hexadecimal for `\|\c -.B \-d\c -\|' or `\|\c -.B \-x\c -\|' output, or -octal and hexadecimal if you're using `\|\c -.B \-o\c -\|'. - -.TP -.BI "\-\-target " "bfdname" -You can specify a particular object-code format for \c -.I objfile\c -\& as -\c -.I bfdname\c -\&. This may not be necessary; \c -.I size\c -\& can -automatically recognize many formats. See -.BR objdump ( 1 ) -for information -on listing available formats. - -.TP -.B \-V -.TP -.B \-\-version -Display version number information on \c -.B size\c -\& itself. - -.SH "SEE ALSO" -.RB "`\|" binutils "\|'" -entry in -.BR info ; -.IR "The GNU Binary Utilities" , - Roland H. Pesch (October 1991); -.BR ar "(" 1 ")," -.BR objdump ( 1 ). - -.SH COPYING -Copyright (c) 1991, 2000 Free Software Foundation, Inc. -.PP -This document is distributed under the terms of the GNU Free -Documentation License, version 1.1. That license is described in the -sources for this manual page, but it is not displayed here in order to -make this manual more consise. Copies of this license can also be -obtained from: http://www.gnu.org/copyleft/. - -\" .SH GNU Free Documentation License -\" Version 1.1, March 2000 - -\" Copyright (C) 2000 Free Software Foundation, Inc. -\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -\" Everyone is permitted to copy and distribute verbatim -\" copies of this license document, but changing it is -\" not allowed. -\" .PP -\" 0. PREAMBLE -\" .PP -\" The purpose of this License is to make a manual, textbook, or other -\" written document "free" in the sense of freedom: to assure everyone -\" the effective freedom to copy and redistribute it, with or without -\" modifying it, either commercially or noncommercially. Secondarily, -\" this License preserves for the author and publisher a way to get -\" credit for their work, while not being considered responsible for -\" modifications made by others. -\" .PP -\" This License is a kind of "copyleft", which means that derivative -\" works of the document must themselves be free in the same sense. It -\" complements the GNU General Public License, which is a copyleft -\" license designed for free software. -\" .PP -\" We have designed this License in order to use it for manuals for free -\" software, because free software needs free documentation: a free -\" program should come with manuals providing the same freedoms that the -\" software does. But this License is not limited to software manuals; -\" it can be used for any textual work, regardless of subject matter or -\" whether it is published as a printed book. We recommend this License -\" principally for works whose purpose is instruction or reference. -\" .PP -\" 1. APPLICABILITY AND DEFINITIONS -\" .PP -\" This License applies to any manual or other work that contains a -\" notice placed by the copyright holder saying it can be distributed -\" under the terms of this License. The "Document", below, refers to any -\" such manual or work. Any member of the public is a licensee, and is -\" addressed as "you". -\" .PP -\" A "Modified Version" of the Document means any work containing the -\" Document or a portion of it, either copied verbatim, or with -\" modifications and/or translated into another language. -\" .PP -\" A "Secondary Section" is a named appendix or a front-matter section of -\" the Document that deals exclusively with the relationship of the -\" publishers or authors of the Document to the Document's overall subject -\" (or to related matters) and contains nothing that could fall directly -\" within that overall subject. (For example, if the Document is in part a -\" textbook of mathematics, a Secondary Section may not explain any -\" mathematics.) The relationship could be a matter of historical -\" connection with the subject or with related matters, or of legal, -\" commercial, philosophical, ethical or political position regarding -\" them. -\" .PP -\" The "Invariant Sections" are certain Secondary Sections whose titles -\" are designated, as being those of Invariant Sections, in the notice -\" that says that the Document is released under this License. -\" .PP -\" The "Cover Texts" are certain short passages of text that are listed, -\" as Front-Cover Texts or Back-Cover Texts, in the notice that says that -\" the Document is released under this License. -\" .PP -\" A "Transparent" copy of the Document means a machine-readable copy, -\" represented in a format whose specification is available to the -\" general public, whose contents can be viewed and edited directly and -\" straightforwardly with generic text editors or (for images composed of -\" pixels) generic paint programs or (for drawings) some widely available -\" drawing editor, and that is suitable for input to text formatters or -\" for automatic translation to a variety of formats suitable for input -\" to text formatters. A copy made in an otherwise Transparent file -\" format whose markup has been designed to thwart or discourage -\" subsequent modification by readers is not Transparent. A copy that is -\" not "Transparent" is called "Opaque". -\" .PP -\" Examples of suitable formats for Transparent copies include plain -\" ASCII without markup, Texinfo input format, LaTeX input format, SGML -\" or XML using a publicly available DTD, and standard-conforming simple -\" HTML designed for human modification. Opaque formats include -\" PostScript, PDF, proprietary formats that can be read and edited only -\" by proprietary word processors, SGML or XML for which the DTD and/or -\" processing tools are not generally available, and the -\" machine-generated HTML produced by some word processors for output -\" purposes only. -\" .PP -\" The "Title Page" means, for a printed book, the title page itself, -\" plus such following pages as are needed to hold, legibly, the material -\" this License requires to appear in the title page. For works in -\" formats which do not have any title page as such, "Title Page" means -\" the text near the most prominent appearance of the work's title, -\" preceding the beginning of the body of the text. -\" .PP -\" 2. VERBATIM COPYING -\" .PP -\" You may copy and distribute the Document in any medium, either -\" commercially or noncommercially, provided that this License, the -\" copyright notices, and the license notice saying this License applies -\" to the Document are reproduced in all copies, and that you add no other -\" conditions whatsoever to those of this License. You may not use -\" technical measures to obstruct or control the reading or further -\" copying of the copies you make or distribute. However, you may accept -\" compensation in exchange for copies. If you distribute a large enough -\" number of copies you must also follow the conditions in section 3. -\" .PP -\" You may also lend copies, under the same conditions stated above, and -\" you may publicly display copies. -\" .PP -\" 3. COPYING IN QUANTITY -\" .PP -\" If you publish printed copies of the Document numbering more than 100, -\" and the Document's license notice requires Cover Texts, you must enclose -\" the copies in covers that carry, clearly and legibly, all these Cover -\" Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -\" the back cover. Both covers must also clearly and legibly identify -\" you as the publisher of these copies. The front cover must present -\" the full title with all words of the title equally prominent and -\" visible. You may add other material on the covers in addition. -\" Copying with changes limited to the covers, as long as they preserve -\" the title of the Document and satisfy these conditions, can be treated -\" as verbatim copying in other respects. -\" .PP -\" If the required texts for either cover are too voluminous to fit -\" legibly, you should put the first ones listed (as many as fit -\" reasonably) on the actual cover, and continue the rest onto adjacent -\" pages. -\" .PP -\" If you publish or distribute Opaque copies of the Document numbering -\" more than 100, you must either include a machine-readable Transparent -\" copy along with each Opaque copy, or state in or with each Opaque copy -\" a publicly-accessible computer-network location containing a complete -\" Transparent copy of the Document, free of added material, which the -\" general network-using public has access to download anonymously at no -\" charge using public-standard network protocols. If you use the latter -\" option, you must take reasonably prudent steps, when you begin -\" distribution of Opaque copies in quantity, to ensure that this -\" Transparent copy will remain thus accessible at the stated location -\" until at least one year after the last time you distribute an Opaque -\" copy (directly or through your agents or retailers) of that edition to -\" the public. -\" .PP -\" It is requested, but not required, that you contact the authors of the -\" Document well before redistributing any large number of copies, to give -\" them a chance to provide you with an updated version of the Document. -\" .PP -\" 4. MODIFICATIONS -\" .PP -\" You may copy and distribute a Modified Version of the Document under -\" the conditions of sections 2 and 3 above, provided that you release -\" the Modified Version under precisely this License, with the Modified -\" Version filling the role of the Document, thus licensing distribution -\" and modification of the Modified Version to whoever possesses a copy -\" of it. In addition, you must do these things in the Modified Version: -\" .PP -\" A. Use in the Title Page (and on the covers, if any) a title distinct -\" from that of the Document, and from those of previous versions -\" (which should, if there were any, be listed in the History section -\" of the Document). You may use the same title as a previous version -\" if the original publisher of that version gives permission. -\" .PP -\" B. List on the Title Page, as authors, one or more persons or entities -\" responsible for authorship of the modifications in the Modified -\" Version, together with at least five of the principal authors of the -\" Document (all of its principal authors, if it has less than five). -\" .PP -\" C. State on the Title page the name of the publisher of the -\" Modified Version, as the publisher. -\" .PP -\" D. Preserve all the copyright notices of the Document. -\" .PP -\" E. Add an appropriate copyright notice for your modifications -\" adjacent to the other copyright notices. -\" .PP -\" F. Include, immediately after the copyright notices, a license notice -\" giving the public permission to use the Modified Version under the -\" terms of this License, in the form shown in the Addendum below. -\" Preserve in that license notice the full lists of Invariant Sections -\" and required Cover Texts given in the Document's license notice. -\" .PP -\" H. Include an unaltered copy of this License. -\" .PP -\" I. Preserve the section entitled "History", and its title, and add to -\" it an item stating at least the title, year, new authors, and -\" publisher of the Modified Version as given on the Title Page. If -\" there is no section entitled "History" in the Document, create one -\" stating the title, year, authors, and publisher of the Document as -\" given on its Title Page, then add an item describing the Modified -\" Version as stated in the previous sentence. -\" .PP -\" J. Preserve the network location, if any, given in the Document for -\" public access to a Transparent copy of the Document, and likewise -\" the network locations given in the Document for previous versions -\" it was based on. These may be placed in the "History" section. -\" You may omit a network location for a work that was published at -\" least four years before the Document itself, or if the original -\" publisher of the version it refers to gives permission. -\" .PP -\" K. In any section entitled "Acknowledgements" or "Dedications", -\" preserve the section's title, and preserve in the section all the -\" substance and tone of each of the contributor acknowledgements -\" and/or dedications given therein. -\" .PP -\" L. Preserve all the Invariant Sections of the Document, -\" unaltered in their text and in their titles. Section numbers -\" or the equivalent are not considered part of the section titles. -\" .PP -\" M. Delete any section entitled "Endorsements". Such a section -\" may not be included in the Modified Version. -\" .PP -\" N. Do not retitle any existing section as "Endorsements" -\" or to conflict in title with any Invariant Section. -\" .PP -\" If the Modified Version includes new front-matter sections or -\" appendices that qualify as Secondary Sections and contain no material -\" copied from the Document, you may at your option designate some or all -\" of these sections as invariant. To do this, add their titles to the -\" list of Invariant Sections in the Modified Version's license notice. -\" These titles must be distinct from any other section titles. -\" .PP -\" You may add a section entitled "Endorsements", provided it contains -\" nothing but endorsements of your Modified Version by various -\" parties--for example, statements of peer review or that the text has -\" been approved by an organization as the authoritative definition of a -\" standard. -\" .PP -\" You may add a passage of up to five words as a Front-Cover Text, and a -\" passage of up to 25 words as a Back-Cover Text, to the end of the list -\" of Cover Texts in the Modified Version. Only one passage of -\" Front-Cover Text and one of Back-Cover Text may be added by (or -\" through arrangements made by) any one entity. If the Document already -\" includes a cover text for the same cover, previously added by you or -\" by arrangement made by the same entity you are acting on behalf of, -\" you may not add another; but you may replace the old one, on explicit -\" permission from the previous publisher that added the old one. -\" .PP -\" The author(s) and publisher(s) of the Document do not by this License -\" give permission to use their names for publicity for or to assert or -\" imply endorsement of any Modified Version. -\" .PP - -\" 5. COMBINING DOCUMENTS -\" .PP -\" You may combine the Document with other documents released under this -\" License, under the terms defined in section 4 above for modified -\" versions, provided that you include in the combination all of the -\" Invariant Sections of all of the original documents, unmodified, and -\" list them all as Invariant Sections of your combined work in its -\" license notice. -\" .PP -\" The combined work need only contain one copy of this License, and -\" multiple identical Invariant Sections may be replaced with a single -\" copy. If there are multiple Invariant Sections with the same name but -\" different contents, make the title of each such section unique by -\" adding at the end of it, in parentheses, the name of the original -\" author or publisher of that section if known, or else a unique number. -\" Make the same adjustment to the section titles in the list of -\" Invariant Sections in the license notice of the combined work. -\" .PP -\" In the combination, you must combine any sections entitled "History" -\" in the various original documents, forming one section entitled -\" "History"; likewise combine any sections entitled "Acknowledgements", -\" and any sections entitled "Dedications". You must delete all sections -\" entitled "Endorsements." -\" .PP - -\" 6. COLLECTIONS OF DOCUMENTS -\" .PP -\" You may make a collection consisting of the Document and other documents -\" released under this License, and replace the individual copies of this -\" License in the various documents with a single copy that is included in -\" the collection, provided that you follow the rules of this License for -\" verbatim copying of each of the documents in all other respects. -\" .PP -\" You may extract a single document from such a collection, and distribute -\" it individually under this License, provided you insert a copy of this -\" License into the extracted document, and follow this License in all -\" other respects regarding verbatim copying of that document. -\" .PP - -\" 7. AGGREGATION WITH INDEPENDENT WORKS -\" .PP -\" A compilation of the Document or its derivatives with other separate -\" and independent documents or works, in or on a volume of a storage or -\" distribution medium, does not as a whole count as a Modified Version -\" of the Document, provided no compilation copyright is claimed for the -\" compilation. Such a compilation is called an "aggregate", and this -\" License does not apply to the other self-contained works thus compiled -\" with the Document, on account of their being thus compiled, if they -\" are not themselves derivative works of the Document. -\" .PP -\" If the Cover Text requirement of section 3 is applicable to these -\" copies of the Document, then if the Document is less than one quarter -\" of the entire aggregate, the Document's Cover Texts may be placed on -\" covers that surround only the Document within the aggregate. -\" Otherwise they must appear on covers around the whole aggregate. -\" .PP - -\" 8. TRANSLATION -\" .PP -\" Translation is considered a kind of modification, so you may -\" distribute translations of the Document under the terms of section 4. -\" Replacing Invariant Sections with translations requires special -\" permission from their copyright holders, but you may include -\" translations of some or all Invariant Sections in addition to the -\" original versions of these Invariant Sections. You may include a -\" translation of this License provided that you also include the -\" original English version of this License. In case of a disagreement -\" between the translation and the original English version of this -\" License, the original English version will prevail. -\" .PP - -\" 9. TERMINATION -\" .PP -\" You may not copy, modify, sublicense, or distribute the Document except -\" as expressly provided for under this License. Any other attempt to -\" copy, modify, sublicense or distribute the Document is void, and will -\" automatically terminate your rights under this License. However, -\" parties who have received copies, or rights, from you under this -\" License will not have their licenses terminated so long as such -\" parties remain in full compliance. -\" .PP - -\" 10. FUTURE REVISIONS OF THIS LICENSE -\" .PP -\" The Free Software Foundation may publish new, revised versions -\" of the GNU Free Documentation License from time to time. Such new -\" versions will be similar in spirit to the present version, but may -\" differ in detail to address new problems or concerns. See -\" http://www.gnu.org/copyleft/. -\" .PP -\" Each version of the License is given a distinguishing version number. -\" If the Document specifies that a particular numbered version of this -\" License "or any later version" applies to it, you have the option of -\" following the terms and conditions either of that specified version or -\" of any later version that has been published (not as a draft) by the -\" Free Software Foundation. If the Document does not specify a version -\" number of this License, you may choose any version ever published (not -\" as a draft) by the Free Software Foundation. -\" .PP - -\" ADDENDUM: How to use this License for your documents -\" .PP -\" To use this License in a document you have written, include a copy of -\" the License in the document and put the following copyright and -\" license notices just after the title page: -\" .PP -\" Copyright (c) YEAR YOUR NAME. -\" Permission is granted to copy, distribute and/or -\" modify this document under the terms of the GNU -\" Free Documentation License, Version 1.1 or any later -\" version published by the Free Software Foundation; -\" with the Invariant Sections being LIST THEIR TITLES, -\" with the Front-Cover Texts being LIST, and with the -\" Back-Cover Texts being LIST. A copy of the license -\" is included in the section entitled "GNU Free -\" Documentation License". -\" .PP -\" If you have no Invariant Sections, write "with no Invariant Sections" -\" instead of saying which ones are invariant. If you have no -\" Front-Cover Texts, write "no Front-Cover Texts" instead of -\" "Front-Cover Texts being LIST"; likewise for Back-Cover Texts. -\" .PP -\" If your document contains nontrivial examples of program code, we -\" recommend releasing these examples in parallel under your choice of -\" free software license, such as the GNU General Public License, -\" to permit their use in free software. diff --git a/contrib/binutils/binutils/strings.1 b/contrib/binutils/binutils/strings.1 deleted file mode 100644 index 6cbf041a4cd1..000000000000 --- a/contrib/binutils/binutils/strings.1 +++ /dev/null @@ -1,508 +0,0 @@ -.\" Copyright (c) 1993, 94, 95, 2000 Free Software Foundation -.\" See section COPYING for conditions for redistribution -.TH strings 1 "09 March 2000" "Free Software Foundation" "GNU Development Tools" -.de BP -.sp -.ti \-.2i -\(** -.. - -.SH NAME -strings \- print the strings of printable characters in files - -.SH SYNOPSIS -.hy 0 -.na -.B strings -.RB "[\|" \-a | \-\c -.RB | \-\-all "\|]" -.RB "[\|" \-f | \-\-print\-file\-name "\|]" -.RB "[\|" \-o "\|]" -.RB "[\|" \-\-help "\|]" -.RB "[\|" \-v | \-\-version "\|]" -.RB "[\|" \-n -.I min\-len\c -.RI | \-min\-len\c -.RB | "\-\-bytes="\c -.I min\-len\c -\&\|] -.RB "[\|" \-t -.I {o,x,d}\c -.RB "[\|" "\-\-target=\fIbfdname" "\|]" -.RB | "\-\-radix="\c -.I {o,x,d}\c -\&\|] -.I file\c -.ad b -.hy 1 -.SH DESCRIPTION -For each -.I file -given, GNU \c -.B strings -prints the printable character sequences that are at least 4 -characters long (or the number given with the options below) and are -followed by an unprintable character. By default, it only prints the -strings from the initialized and loaded sections of object files; for -other types of files, it prints the strings from the whole file. - -.PP -.B strings -is mainly useful for determining the contents of non-text files. - -.SH OPTIONS -The long and short forms of options, shown here as alternatives, are -equivalent. - -.TP -.B \-a -.TP -.B \-\-all -.TP -.B \- -Do not scan only the initialized and loaded sections of object files; -scan the whole files. - -.TP -.B \-f -.TP -.B \-\-print\-file\-name -Print the name of the file before each string. - -.TP -.B \-\-help -Print a summary of the options to -.B strings -on the standard output and exit. - -.TP -.B \-v -.TP -.B \-\-version -Print the version number -of -.B strings -on the standard output and exit. - -.TP -.B "\-n \fImin\-len\fP" -.TP -.B "\-\fImin\-len\fP" -.TP -.B "\-\-bytes=\fImin\-len\fP" -Print sequences of characters that are at least -.I min\-len -characters long, instead of the default 4. - -.TP -.BR "\-t " {o,x,d} -.TP -.BR "\-\-radix=" {o,x,d} -Print the offset within the file before each string. The single -character argument specifies the radix of the offset\(emoctal, -hexadecimal, or decimal. - -.TP -.BI "\-\-target=" "bfdname" -Specify an object code format other than your system's default format. -See -.BR objdump ( 1 ), -for information on listing available formats. - -.TP -.B \-o -Like -.BR "\-t o" . - -.PP - -.SH "SEE ALSO" -.RB "`\|" binutils "\|'" -entry in -.B -info\c -\&; -.I -The GNU Binary Utilities\c -\&, Roland H. Pesch (October 1991); -.BR ar ( 1 ), -.BR nm ( 1 ), -.BR objdump ( 1 ), -.BR ranlib ( 1 ). - - -.SH COPYING -Copyright (c) 1993, 2000 Free Software Foundation, Inc. -.PP -This document is distributed under the terms of the GNU Free -Documentation License, version 1.1. That license is described in the -sources for this manual page, but it is not displayed here in order to -make this manual more consise. Copies of this license can also be -obtained from: http://www.gnu.org/copyleft/. - -\" .SH GNU Free Documentation License -\" Version 1.1, March 2000 - -\" Copyright (C) 2000 Free Software Foundation, Inc. -\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -\" Everyone is permitted to copy and distribute verbatim -\" copies of this license document, but changing it is -\" not allowed. -\" .PP -\" 0. PREAMBLE -\" .PP -\" The purpose of this License is to make a manual, textbook, or other -\" written document "free" in the sense of freedom: to assure everyone -\" the effective freedom to copy and redistribute it, with or without -\" modifying it, either commercially or noncommercially. Secondarily, -\" this License preserves for the author and publisher a way to get -\" credit for their work, while not being considered responsible for -\" modifications made by others. -\" .PP -\" This License is a kind of "copyleft", which means that derivative -\" works of the document must themselves be free in the same sense. It -\" complements the GNU General Public License, which is a copyleft -\" license designed for free software. -\" .PP -\" We have designed this License in order to use it for manuals for free -\" software, because free software needs free documentation: a free -\" program should come with manuals providing the same freedoms that the -\" software does. But this License is not limited to software manuals; -\" it can be used for any textual work, regardless of subject matter or -\" whether it is published as a printed book. We recommend this License -\" principally for works whose purpose is instruction or reference. -\" .PP -\" 1. APPLICABILITY AND DEFINITIONS -\" .PP -\" This License applies to any manual or other work that contains a -\" notice placed by the copyright holder saying it can be distributed -\" under the terms of this License. The "Document", below, refers to any -\" such manual or work. Any member of the public is a licensee, and is -\" addressed as "you". -\" .PP -\" A "Modified Version" of the Document means any work containing the -\" Document or a portion of it, either copied verbatim, or with -\" modifications and/or translated into another language. -\" .PP -\" A "Secondary Section" is a named appendix or a front-matter section of -\" the Document that deals exclusively with the relationship of the -\" publishers or authors of the Document to the Document's overall subject -\" (or to related matters) and contains nothing that could fall directly -\" within that overall subject. (For example, if the Document is in part a -\" textbook of mathematics, a Secondary Section may not explain any -\" mathematics.) The relationship could be a matter of historical -\" connection with the subject or with related matters, or of legal, -\" commercial, philosophical, ethical or political position regarding -\" them. -\" .PP -\" The "Invariant Sections" are certain Secondary Sections whose titles -\" are designated, as being those of Invariant Sections, in the notice -\" that says that the Document is released under this License. -\" .PP -\" The "Cover Texts" are certain short passages of text that are listed, -\" as Front-Cover Texts or Back-Cover Texts, in the notice that says that -\" the Document is released under this License. -\" .PP -\" A "Transparent" copy of the Document means a machine-readable copy, -\" represented in a format whose specification is available to the -\" general public, whose contents can be viewed and edited directly and -\" straightforwardly with generic text editors or (for images composed of -\" pixels) generic paint programs or (for drawings) some widely available -\" drawing editor, and that is suitable for input to text formatters or -\" for automatic translation to a variety of formats suitable for input -\" to text formatters. A copy made in an otherwise Transparent file -\" format whose markup has been designed to thwart or discourage -\" subsequent modification by readers is not Transparent. A copy that is -\" not "Transparent" is called "Opaque". -\" .PP -\" Examples of suitable formats for Transparent copies include plain -\" ASCII without markup, Texinfo input format, LaTeX input format, SGML -\" or XML using a publicly available DTD, and standard-conforming simple -\" HTML designed for human modification. Opaque formats include -\" PostScript, PDF, proprietary formats that can be read and edited only -\" by proprietary word processors, SGML or XML for which the DTD and/or -\" processing tools are not generally available, and the -\" machine-generated HTML produced by some word processors for output -\" purposes only. -\" .PP -\" The "Title Page" means, for a printed book, the title page itself, -\" plus such following pages as are needed to hold, legibly, the material -\" this License requires to appear in the title page. For works in -\" formats which do not have any title page as such, "Title Page" means -\" the text near the most prominent appearance of the work's title, -\" preceding the beginning of the body of the text. -\" .PP -\" 2. VERBATIM COPYING -\" .PP -\" You may copy and distribute the Document in any medium, either -\" commercially or noncommercially, provided that this License, the -\" copyright notices, and the license notice saying this License applies -\" to the Document are reproduced in all copies, and that you add no other -\" conditions whatsoever to those of this License. You may not use -\" technical measures to obstruct or control the reading or further -\" copying of the copies you make or distribute. However, you may accept -\" compensation in exchange for copies. If you distribute a large enough -\" number of copies you must also follow the conditions in section 3. -\" .PP -\" You may also lend copies, under the same conditions stated above, and -\" you may publicly display copies. -\" .PP -\" 3. COPYING IN QUANTITY -\" .PP -\" If you publish printed copies of the Document numbering more than 100, -\" and the Document's license notice requires Cover Texts, you must enclose -\" the copies in covers that carry, clearly and legibly, all these Cover -\" Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -\" the back cover. Both covers must also clearly and legibly identify -\" you as the publisher of these copies. The front cover must present -\" the full title with all words of the title equally prominent and -\" visible. You may add other material on the covers in addition. -\" Copying with changes limited to the covers, as long as they preserve -\" the title of the Document and satisfy these conditions, can be treated -\" as verbatim copying in other respects. -\" .PP -\" If the required texts for either cover are too voluminous to fit -\" legibly, you should put the first ones listed (as many as fit -\" reasonably) on the actual cover, and continue the rest onto adjacent -\" pages. -\" .PP -\" If you publish or distribute Opaque copies of the Document numbering -\" more than 100, you must either include a machine-readable Transparent -\" copy along with each Opaque copy, or state in or with each Opaque copy -\" a publicly-accessible computer-network location containing a complete -\" Transparent copy of the Document, free of added material, which the -\" general network-using public has access to download anonymously at no -\" charge using public-standard network protocols. If you use the latter -\" option, you must take reasonably prudent steps, when you begin -\" distribution of Opaque copies in quantity, to ensure that this -\" Transparent copy will remain thus accessible at the stated location -\" until at least one year after the last time you distribute an Opaque -\" copy (directly or through your agents or retailers) of that edition to -\" the public. -\" .PP -\" It is requested, but not required, that you contact the authors of the -\" Document well before redistributing any large number of copies, to give -\" them a chance to provide you with an updated version of the Document. -\" .PP -\" 4. MODIFICATIONS -\" .PP -\" You may copy and distribute a Modified Version of the Document under -\" the conditions of sections 2 and 3 above, provided that you release -\" the Modified Version under precisely this License, with the Modified -\" Version filling the role of the Document, thus licensing distribution -\" and modification of the Modified Version to whoever possesses a copy -\" of it. In addition, you must do these things in the Modified Version: -\" .PP -\" A. Use in the Title Page (and on the covers, if any) a title distinct -\" from that of the Document, and from those of previous versions -\" (which should, if there were any, be listed in the History section -\" of the Document). You may use the same title as a previous version -\" if the original publisher of that version gives permission. -\" .PP -\" B. List on the Title Page, as authors, one or more persons or entities -\" responsible for authorship of the modifications in the Modified -\" Version, together with at least five of the principal authors of the -\" Document (all of its principal authors, if it has less than five). -\" .PP -\" C. State on the Title page the name of the publisher of the -\" Modified Version, as the publisher. -\" .PP -\" D. Preserve all the copyright notices of the Document. -\" .PP -\" E. Add an appropriate copyright notice for your modifications -\" adjacent to the other copyright notices. -\" .PP -\" F. Include, immediately after the copyright notices, a license notice -\" giving the public permission to use the Modified Version under the -\" terms of this License, in the form shown in the Addendum below. -\" Preserve in that license notice the full lists of Invariant Sections -\" and required Cover Texts given in the Document's license notice. -\" .PP -\" H. Include an unaltered copy of this License. -\" .PP -\" I. Preserve the section entitled "History", and its title, and add to -\" it an item stating at least the title, year, new authors, and -\" publisher of the Modified Version as given on the Title Page. If -\" there is no section entitled "History" in the Document, create one -\" stating the title, year, authors, and publisher of the Document as -\" given on its Title Page, then add an item describing the Modified -\" Version as stated in the previous sentence. -\" .PP -\" J. Preserve the network location, if any, given in the Document for -\" public access to a Transparent copy of the Document, and likewise -\" the network locations given in the Document for previous versions -\" it was based on. These may be placed in the "History" section. -\" You may omit a network location for a work that was published at -\" least four years before the Document itself, or if the original -\" publisher of the version it refers to gives permission. -\" .PP -\" K. In any section entitled "Acknowledgements" or "Dedications", -\" preserve the section's title, and preserve in the section all the -\" substance and tone of each of the contributor acknowledgements -\" and/or dedications given therein. -\" .PP -\" L. Preserve all the Invariant Sections of the Document, -\" unaltered in their text and in their titles. Section numbers -\" or the equivalent are not considered part of the section titles. -\" .PP -\" M. Delete any section entitled "Endorsements". Such a section -\" may not be included in the Modified Version. -\" .PP -\" N. Do not retitle any existing section as "Endorsements" -\" or to conflict in title with any Invariant Section. -\" .PP -\" If the Modified Version includes new front-matter sections or -\" appendices that qualify as Secondary Sections and contain no material -\" copied from the Document, you may at your option designate some or all -\" of these sections as invariant. To do this, add their titles to the -\" list of Invariant Sections in the Modified Version's license notice. -\" These titles must be distinct from any other section titles. -\" .PP -\" You may add a section entitled "Endorsements", provided it contains -\" nothing but endorsements of your Modified Version by various -\" parties--for example, statements of peer review or that the text has -\" been approved by an organization as the authoritative definition of a -\" standard. -\" .PP -\" You may add a passage of up to five words as a Front-Cover Text, and a -\" passage of up to 25 words as a Back-Cover Text, to the end of the list -\" of Cover Texts in the Modified Version. Only one passage of -\" Front-Cover Text and one of Back-Cover Text may be added by (or -\" through arrangements made by) any one entity. If the Document already -\" includes a cover text for the same cover, previously added by you or -\" by arrangement made by the same entity you are acting on behalf of, -\" you may not add another; but you may replace the old one, on explicit -\" permission from the previous publisher that added the old one. -\" .PP -\" The author(s) and publisher(s) of the Document do not by this License -\" give permission to use their names for publicity for or to assert or -\" imply endorsement of any Modified Version. -\" .PP - -\" 5. COMBINING DOCUMENTS -\" .PP -\" You may combine the Document with other documents released under this -\" License, under the terms defined in section 4 above for modified -\" versions, provided that you include in the combination all of the -\" Invariant Sections of all of the original documents, unmodified, and -\" list them all as Invariant Sections of your combined work in its -\" license notice. -\" .PP -\" The combined work need only contain one copy of this License, and -\" multiple identical Invariant Sections may be replaced with a single -\" copy. If there are multiple Invariant Sections with the same name but -\" different contents, make the title of each such section unique by -\" adding at the end of it, in parentheses, the name of the original -\" author or publisher of that section if known, or else a unique number. -\" Make the same adjustment to the section titles in the list of -\" Invariant Sections in the license notice of the combined work. -\" .PP -\" In the combination, you must combine any sections entitled "History" -\" in the various original documents, forming one section entitled -\" "History"; likewise combine any sections entitled "Acknowledgements", -\" and any sections entitled "Dedications". You must delete all sections -\" entitled "Endorsements." -\" .PP - -\" 6. COLLECTIONS OF DOCUMENTS -\" .PP -\" You may make a collection consisting of the Document and other documents -\" released under this License, and replace the individual copies of this -\" License in the various documents with a single copy that is included in -\" the collection, provided that you follow the rules of this License for -\" verbatim copying of each of the documents in all other respects. -\" .PP -\" You may extract a single document from such a collection, and distribute -\" it individually under this License, provided you insert a copy of this -\" License into the extracted document, and follow this License in all -\" other respects regarding verbatim copying of that document. -\" .PP - -\" 7. AGGREGATION WITH INDEPENDENT WORKS -\" .PP -\" A compilation of the Document or its derivatives with other separate -\" and independent documents or works, in or on a volume of a storage or -\" distribution medium, does not as a whole count as a Modified Version -\" of the Document, provided no compilation copyright is claimed for the -\" compilation. Such a compilation is called an "aggregate", and this -\" License does not apply to the other self-contained works thus compiled -\" with the Document, on account of their being thus compiled, if they -\" are not themselves derivative works of the Document. -\" .PP -\" If the Cover Text requirement of section 3 is applicable to these -\" copies of the Document, then if the Document is less than one quarter -\" of the entire aggregate, the Document's Cover Texts may be placed on -\" covers that surround only the Document within the aggregate. -\" Otherwise they must appear on covers around the whole aggregate. -\" .PP - -\" 8. TRANSLATION -\" .PP -\" Translation is considered a kind of modification, so you may -\" distribute translations of the Document under the terms of section 4. -\" Replacing Invariant Sections with translations requires special -\" permission from their copyright holders, but you may include -\" translations of some or all Invariant Sections in addition to the -\" original versions of these Invariant Sections. You may include a -\" translation of this License provided that you also include the -\" original English version of this License. In case of a disagreement -\" between the translation and the original English version of this -\" License, the original English version will prevail. -\" .PP - -\" 9. TERMINATION -\" .PP -\" You may not copy, modify, sublicense, or distribute the Document except -\" as expressly provided for under this License. Any other attempt to -\" copy, modify, sublicense or distribute the Document is void, and will -\" automatically terminate your rights under this License. However, -\" parties who have received copies, or rights, from you under this -\" License will not have their licenses terminated so long as such -\" parties remain in full compliance. -\" .PP - -\" 10. FUTURE REVISIONS OF THIS LICENSE -\" .PP -\" The Free Software Foundation may publish new, revised versions -\" of the GNU Free Documentation License from time to time. Such new -\" versions will be similar in spirit to the present version, but may -\" differ in detail to address new problems or concerns. See -\" http://www.gnu.org/copyleft/. -\" .PP -\" Each version of the License is given a distinguishing version number. -\" If the Document specifies that a particular numbered version of this -\" License "or any later version" applies to it, you have the option of -\" following the terms and conditions either of that specified version or -\" of any later version that has been published (not as a draft) by the -\" Free Software Foundation. If the Document does not specify a version -\" number of this License, you may choose any version ever published (not -\" as a draft) by the Free Software Foundation. -\" .PP - -\" ADDENDUM: How to use this License for your documents -\" .PP -\" To use this License in a document you have written, include a copy of -\" the License in the document and put the following copyright and -\" license notices just after the title page: -\" .PP -\" Copyright (c) YEAR YOUR NAME. -\" Permission is granted to copy, distribute and/or -\" modify this document under the terms of the GNU -\" Free Documentation License, Version 1.1 or any later -\" version published by the Free Software Foundation; -\" with the Invariant Sections being LIST THEIR TITLES, -\" with the Front-Cover Texts being LIST, and with the -\" Back-Cover Texts being LIST. A copy of the license -\" is included in the section entitled "GNU Free -\" Documentation License". -\" .PP -\" If you have no Invariant Sections, write "with no Invariant Sections" -\" instead of saying which ones are invariant. If you have no -\" Front-Cover Texts, write "no Front-Cover Texts" instead of -\" "Front-Cover Texts being LIST"; likewise for Back-Cover Texts. -\" .PP -\" If your document contains nontrivial examples of program code, we -\" recommend releasing these examples in parallel under your choice of -\" free software license, such as the GNU General Public License, -\" to permit their use in free software. diff --git a/contrib/binutils/binutils/strip.1 b/contrib/binutils/binutils/strip.1 deleted file mode 100644 index 83c3fe603056..000000000000 --- a/contrib/binutils/binutils/strip.1 +++ /dev/null @@ -1,542 +0,0 @@ -.\" Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 1998, 2000 Free Software Foundation -.\" See section COPYING for conditions for redistribution -.TH strip 1 "5 November 1991" "Free Software Foundation" "GNU Development Tools" -.de BP -.sp -.ti \-.2i -\(** -.. - -.SH NAME -strip \- Discard symbols from object files. - -.SH SYNOPSIS -.hy 0 -.na -.B strip -.RB "[\|" \-F\ \fIbfdname\fR\ |\ \fB\-\-target=\fIbfdname\fP "\|]" -.RB "[\|" \-I\ \fIbfdname\fR\ |\ \fB\-\-input\-target=\fIbfdname\fP "\|]" -.RB "[\|" \-O\ \fIbfdname\fR\ |\ \fB\-\-output\-target=\fIbfdname\fP "\|]" -.RB "[\|" \-R\ \fIsectionname\fR\ |\ \fB\-\-remove\-section=\fIsectionname\fP "\|]" -.RB "[\|" \-s\fR\ |\ \fB\-\-strip\-all "\|]" -.RB "[\|" \-S\fR\ |\ \fB\-g\fR\ |\ \fB\-\-strip\-debug "\|]" -.RB "[\|" \-\-strip\-unneeded\fR "\|]" -.RB "[\|" \-x\fR\ |\ \fB\-\-discard\-all "\|]" -.RB "[\|" \-X\fR\ |\ \fB\-\-discard\-locals "\|]" -.RB "[\|" \-K\ \fIsymbolname\fR\ |\ \fB\-\-keep\-symbol=\fIsymbolname\fR "\|]" -.RB "[\|" \-N\ \fIsymbolname\fR\ |\ \fB\-\-strip\-symbol=\fIsymbolname\fR "\|]" -.RB "[\|" \-o\ \fIfile\fR "\|]" -.RB "[\|" \-p\fR\ |\ \fB\-\-preserve\-dates "\|]" -.RB "[\|" \-v\fR\ |\ \fB\-\-verbose "\|]" -.RB "[\|" \-V\fR\ |\ \fB\-\-version "\|]" -.RB "[\|" \-V\fR\ |\ \fB\-\-help "\|]" -.I objfile\c -\&.\|.\|. - -.SH DESCRIPTION -GNU -.B strip -discards all symbols from the object files -.IR objfile . -The list of object files may include archives. -At least one object file must be given. - -.P -.B strip -modifies the files named in its argument, -rather than writing modified copies under different names. - -.SH OPTIONS -.TP -.B "\-F \fIbfdname" -.TP -.B "\-\-target=\fIbfdname" -Treat the original \fIobjfile\fP as a file with the object -code format \fIbfdname\fP, and rewrite it in the same format. - -.TP -.B \-\-help -Show a summary of the options to -.B strip -and exit. - -.TP -.B "\-I \fIbfdname -.TP -.B "\-\-input\-target=\fIbfdname" -Treat the original \fIobjfile\fP as a file with the object -code format \fIbfdname\fP. - -.TP -.B "\-O \fIbfdname\fP" -.TP -.B "\-\-output\-target=\fIbfdname" -Replace \fIobjfile\fP with a file in the output format \fIbfdname\fP. - -.TP -.B "\-R \fIsectionname\fP" -.TP -.B "\-\-remove\-section=\fIsectionname" -Remove the named section from the file. This option may be given more -than once. Note that using this option inappropriately may make the -object file unusable. - -.TP -.B \-s -.TP -.B \-\-strip\-all -Remove all symbols. - -.TP -.B \-S -.TP -.B \-g -.TP -.B \-\-strip\-debug -Remove debugging symbols only. - -.TP -.B \-\-strip\-unneeded -Strip all symbols that are not needed for relocation processing. - -.TP -.B \-N \fIsymbolname\fR -.TP -.B \-\-strip\-symbol=\fIsymbolname -Remove symbol \fIsymbolname\fP from the source file. This option -may be given more than once, and may be combined with other strip -options. - -.TP -.B \-o \fIfile\fR -Put the stripped output in \fIfile\fR, rather than replacing the -existing file. When this argument is used, only one \fIobjfile\fR -argument may be specified. - -.TP -.B \-p -.TP -.B \-\-preserve-dates -Preserve the access and modification dates of the file. - -.TP -.B \-x -.TP -.B \-\-discard\-all -Remove non-global symbols. - -.TP -.B \-X -.TP -.B \-\-discard\-locals -Remove compiler-generated local symbols. -(These usually start with ``L'' or ``.''.) - -.TP -.B \-K \fIsymbolname\fR, \fB\-\-keep\-symbol=\fIsymbolname -Copy only symbol \fIsymbolname\fP from the source file. This option -may be given more than once. - -.TP -.B \-N \fIsymbolname\fR, \fB\-\-strip\-symbol=\fIsymbolname -Do not copy symbol \fIsymbolname\fP from the source file. This option -may be given more than once, and may be combined with strip options -other than \fB\-K\fR. - -.TP -.B \-v -.TP -.B \-\-verbose -Verbose output: list all object files modified. In the case of -archives, -.B "strip \-v" -lists all members of the archive. - -.TP -.B \-V -.TP -.B \-\-version -Show the version number for \fBstrip\fP and exit. - -.SH "SEE ALSO" -.RB "`\|" binutils "\|'" -entry in -.BR info ; -.IR "The GNU Binary Utilities" , -Roland H. Pesch (October 1991). - -.SH COPYING -Copyright (c) 1991, 2000 Free Software Foundation, Inc. -.PP -This document is distributed under the terms of the GNU Free -Documentation License, version 1.1. That license is described in the -sources for this manual page, but it is not displayed here in order to -make this manual more consise. Copies of this license can also be -obtained from: http://www.gnu.org/copyleft/. - -\" .SH GNU Free Documentation License -\" Version 1.1, March 2000 - -\" Copyright (C) 2000 Free Software Foundation, Inc. -\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -\" Everyone is permitted to copy and distribute verbatim -\" copies of this license document, but changing it is -\" not allowed. -\" .PP -\" 0. PREAMBLE -\" .PP -\" The purpose of this License is to make a manual, textbook, or other -\" written document "free" in the sense of freedom: to assure everyone -\" the effective freedom to copy and redistribute it, with or without -\" modifying it, either commercially or noncommercially. Secondarily, -\" this License preserves for the author and publisher a way to get -\" credit for their work, while not being considered responsible for -\" modifications made by others. -\" .PP -\" This License is a kind of "copyleft", which means that derivative -\" works of the document must themselves be free in the same sense. It -\" complements the GNU General Public License, which is a copyleft -\" license designed for free software. -\" .PP -\" We have designed this License in order to use it for manuals for free -\" software, because free software needs free documentation: a free -\" program should come with manuals providing the same freedoms that the -\" software does. But this License is not limited to software manuals; -\" it can be used for any textual work, regardless of subject matter or -\" whether it is published as a printed book. We recommend this License -\" principally for works whose purpose is instruction or reference. -\" .PP -\" 1. APPLICABILITY AND DEFINITIONS -\" .PP -\" This License applies to any manual or other work that contains a -\" notice placed by the copyright holder saying it can be distributed -\" under the terms of this License. The "Document", below, refers to any -\" such manual or work. Any member of the public is a licensee, and is -\" addressed as "you". -\" .PP -\" A "Modified Version" of the Document means any work containing the -\" Document or a portion of it, either copied verbatim, or with -\" modifications and/or translated into another language. -\" .PP -\" A "Secondary Section" is a named appendix or a front-matter section of -\" the Document that deals exclusively with the relationship of the -\" publishers or authors of the Document to the Document's overall subject -\" (or to related matters) and contains nothing that could fall directly -\" within that overall subject. (For example, if the Document is in part a -\" textbook of mathematics, a Secondary Section may not explain any -\" mathematics.) The relationship could be a matter of historical -\" connection with the subject or with related matters, or of legal, -\" commercial, philosophical, ethical or political position regarding -\" them. -\" .PP -\" The "Invariant Sections" are certain Secondary Sections whose titles -\" are designated, as being those of Invariant Sections, in the notice -\" that says that the Document is released under this License. -\" .PP -\" The "Cover Texts" are certain short passages of text that are listed, -\" as Front-Cover Texts or Back-Cover Texts, in the notice that says that -\" the Document is released under this License. -\" .PP -\" A "Transparent" copy of the Document means a machine-readable copy, -\" represented in a format whose specification is available to the -\" general public, whose contents can be viewed and edited directly and -\" straightforwardly with generic text editors or (for images composed of -\" pixels) generic paint programs or (for drawings) some widely available -\" drawing editor, and that is suitable for input to text formatters or -\" for automatic translation to a variety of formats suitable for input -\" to text formatters. A copy made in an otherwise Transparent file -\" format whose markup has been designed to thwart or discourage -\" subsequent modification by readers is not Transparent. A copy that is -\" not "Transparent" is called "Opaque". -\" .PP -\" Examples of suitable formats for Transparent copies include plain -\" ASCII without markup, Texinfo input format, LaTeX input format, SGML -\" or XML using a publicly available DTD, and standard-conforming simple -\" HTML designed for human modification. Opaque formats include -\" PostScript, PDF, proprietary formats that can be read and edited only -\" by proprietary word processors, SGML or XML for which the DTD and/or -\" processing tools are not generally available, and the -\" machine-generated HTML produced by some word processors for output -\" purposes only. -\" .PP -\" The "Title Page" means, for a printed book, the title page itself, -\" plus such following pages as are needed to hold, legibly, the material -\" this License requires to appear in the title page. For works in -\" formats which do not have any title page as such, "Title Page" means -\" the text near the most prominent appearance of the work's title, -\" preceding the beginning of the body of the text. -\" .PP -\" 2. VERBATIM COPYING -\" .PP -\" You may copy and distribute the Document in any medium, either -\" commercially or noncommercially, provided that this License, the -\" copyright notices, and the license notice saying this License applies -\" to the Document are reproduced in all copies, and that you add no other -\" conditions whatsoever to those of this License. You may not use -\" technical measures to obstruct or control the reading or further -\" copying of the copies you make or distribute. However, you may accept -\" compensation in exchange for copies. If you distribute a large enough -\" number of copies you must also follow the conditions in section 3. -\" .PP -\" You may also lend copies, under the same conditions stated above, and -\" you may publicly display copies. -\" .PP -\" 3. COPYING IN QUANTITY -\" .PP -\" If you publish printed copies of the Document numbering more than 100, -\" and the Document's license notice requires Cover Texts, you must enclose -\" the copies in covers that carry, clearly and legibly, all these Cover -\" Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -\" the back cover. Both covers must also clearly and legibly identify -\" you as the publisher of these copies. The front cover must present -\" the full title with all words of the title equally prominent and -\" visible. You may add other material on the covers in addition. -\" Copying with changes limited to the covers, as long as they preserve -\" the title of the Document and satisfy these conditions, can be treated -\" as verbatim copying in other respects. -\" .PP -\" If the required texts for either cover are too voluminous to fit -\" legibly, you should put the first ones listed (as many as fit -\" reasonably) on the actual cover, and continue the rest onto adjacent -\" pages. -\" .PP -\" If you publish or distribute Opaque copies of the Document numbering -\" more than 100, you must either include a machine-readable Transparent -\" copy along with each Opaque copy, or state in or with each Opaque copy -\" a publicly-accessible computer-network location containing a complete -\" Transparent copy of the Document, free of added material, which the -\" general network-using public has access to download anonymously at no -\" charge using public-standard network protocols. If you use the latter -\" option, you must take reasonably prudent steps, when you begin -\" distribution of Opaque copies in quantity, to ensure that this -\" Transparent copy will remain thus accessible at the stated location -\" until at least one year after the last time you distribute an Opaque -\" copy (directly or through your agents or retailers) of that edition to -\" the public. -\" .PP -\" It is requested, but not required, that you contact the authors of the -\" Document well before redistributing any large number of copies, to give -\" them a chance to provide you with an updated version of the Document. -\" .PP -\" 4. MODIFICATIONS -\" .PP -\" You may copy and distribute a Modified Version of the Document under -\" the conditions of sections 2 and 3 above, provided that you release -\" the Modified Version under precisely this License, with the Modified -\" Version filling the role of the Document, thus licensing distribution -\" and modification of the Modified Version to whoever possesses a copy -\" of it. In addition, you must do these things in the Modified Version: -\" .PP -\" A. Use in the Title Page (and on the covers, if any) a title distinct -\" from that of the Document, and from those of previous versions -\" (which should, if there were any, be listed in the History section -\" of the Document). You may use the same title as a previous version -\" if the original publisher of that version gives permission. -\" .PP -\" B. List on the Title Page, as authors, one or more persons or entities -\" responsible for authorship of the modifications in the Modified -\" Version, together with at least five of the principal authors of the -\" Document (all of its principal authors, if it has less than five). -\" .PP -\" C. State on the Title page the name of the publisher of the -\" Modified Version, as the publisher. -\" .PP -\" D. Preserve all the copyright notices of the Document. -\" .PP -\" E. Add an appropriate copyright notice for your modifications -\" adjacent to the other copyright notices. -\" .PP -\" F. Include, immediately after the copyright notices, a license notice -\" giving the public permission to use the Modified Version under the -\" terms of this License, in the form shown in the Addendum below. -\" Preserve in that license notice the full lists of Invariant Sections -\" and required Cover Texts given in the Document's license notice. -\" .PP -\" H. Include an unaltered copy of this License. -\" .PP -\" I. Preserve the section entitled "History", and its title, and add to -\" it an item stating at least the title, year, new authors, and -\" publisher of the Modified Version as given on the Title Page. If -\" there is no section entitled "History" in the Document, create one -\" stating the title, year, authors, and publisher of the Document as -\" given on its Title Page, then add an item describing the Modified -\" Version as stated in the previous sentence. -\" .PP -\" J. Preserve the network location, if any, given in the Document for -\" public access to a Transparent copy of the Document, and likewise -\" the network locations given in the Document for previous versions -\" it was based on. These may be placed in the "History" section. -\" You may omit a network location for a work that was published at -\" least four years before the Document itself, or if the original -\" publisher of the version it refers to gives permission. -\" .PP -\" K. In any section entitled "Acknowledgements" or "Dedications", -\" preserve the section's title, and preserve in the section all the -\" substance and tone of each of the contributor acknowledgements -\" and/or dedications given therein. -\" .PP -\" L. Preserve all the Invariant Sections of the Document, -\" unaltered in their text and in their titles. Section numbers -\" or the equivalent are not considered part of the section titles. -\" .PP -\" M. Delete any section entitled "Endorsements". Such a section -\" may not be included in the Modified Version. -\" .PP -\" N. Do not retitle any existing section as "Endorsements" -\" or to conflict in title with any Invariant Section. -\" .PP -\" If the Modified Version includes new front-matter sections or -\" appendices that qualify as Secondary Sections and contain no material -\" copied from the Document, you may at your option designate some or all -\" of these sections as invariant. To do this, add their titles to the -\" list of Invariant Sections in the Modified Version's license notice. -\" These titles must be distinct from any other section titles. -\" .PP -\" You may add a section entitled "Endorsements", provided it contains -\" nothing but endorsements of your Modified Version by various -\" parties--for example, statements of peer review or that the text has -\" been approved by an organization as the authoritative definition of a -\" standard. -\" .PP -\" You may add a passage of up to five words as a Front-Cover Text, and a -\" passage of up to 25 words as a Back-Cover Text, to the end of the list -\" of Cover Texts in the Modified Version. Only one passage of -\" Front-Cover Text and one of Back-Cover Text may be added by (or -\" through arrangements made by) any one entity. If the Document already -\" includes a cover text for the same cover, previously added by you or -\" by arrangement made by the same entity you are acting on behalf of, -\" you may not add another; but you may replace the old one, on explicit -\" permission from the previous publisher that added the old one. -\" .PP -\" The author(s) and publisher(s) of the Document do not by this License -\" give permission to use their names for publicity for or to assert or -\" imply endorsement of any Modified Version. -\" .PP - -\" 5. COMBINING DOCUMENTS -\" .PP -\" You may combine the Document with other documents released under this -\" License, under the terms defined in section 4 above for modified -\" versions, provided that you include in the combination all of the -\" Invariant Sections of all of the original documents, unmodified, and -\" list them all as Invariant Sections of your combined work in its -\" license notice. -\" .PP -\" The combined work need only contain one copy of this License, and -\" multiple identical Invariant Sections may be replaced with a single -\" copy. If there are multiple Invariant Sections with the same name but -\" different contents, make the title of each such section unique by -\" adding at the end of it, in parentheses, the name of the original -\" author or publisher of that section if known, or else a unique number. -\" Make the same adjustment to the section titles in the list of -\" Invariant Sections in the license notice of the combined work. -\" .PP -\" In the combination, you must combine any sections entitled "History" -\" in the various original documents, forming one section entitled -\" "History"; likewise combine any sections entitled "Acknowledgements", -\" and any sections entitled "Dedications". You must delete all sections -\" entitled "Endorsements." -\" .PP - -\" 6. COLLECTIONS OF DOCUMENTS -\" .PP -\" You may make a collection consisting of the Document and other documents -\" released under this License, and replace the individual copies of this -\" License in the various documents with a single copy that is included in -\" the collection, provided that you follow the rules of this License for -\" verbatim copying of each of the documents in all other respects. -\" .PP -\" You may extract a single document from such a collection, and distribute -\" it individually under this License, provided you insert a copy of this -\" License into the extracted document, and follow this License in all -\" other respects regarding verbatim copying of that document. -\" .PP - -\" 7. AGGREGATION WITH INDEPENDENT WORKS -\" .PP -\" A compilation of the Document or its derivatives with other separate -\" and independent documents or works, in or on a volume of a storage or -\" distribution medium, does not as a whole count as a Modified Version -\" of the Document, provided no compilation copyright is claimed for the -\" compilation. Such a compilation is called an "aggregate", and this -\" License does not apply to the other self-contained works thus compiled -\" with the Document, on account of their being thus compiled, if they -\" are not themselves derivative works of the Document. -\" .PP -\" If the Cover Text requirement of section 3 is applicable to these -\" copies of the Document, then if the Document is less than one quarter -\" of the entire aggregate, the Document's Cover Texts may be placed on -\" covers that surround only the Document within the aggregate. -\" Otherwise they must appear on covers around the whole aggregate. -\" .PP - -\" 8. TRANSLATION -\" .PP -\" Translation is considered a kind of modification, so you may -\" distribute translations of the Document under the terms of section 4. -\" Replacing Invariant Sections with translations requires special -\" permission from their copyright holders, but you may include -\" translations of some or all Invariant Sections in addition to the -\" original versions of these Invariant Sections. You may include a -\" translation of this License provided that you also include the -\" original English version of this License. In case of a disagreement -\" between the translation and the original English version of this -\" License, the original English version will prevail. -\" .PP - -\" 9. TERMINATION -\" .PP -\" You may not copy, modify, sublicense, or distribute the Document except -\" as expressly provided for under this License. Any other attempt to -\" copy, modify, sublicense or distribute the Document is void, and will -\" automatically terminate your rights under this License. However, -\" parties who have received copies, or rights, from you under this -\" License will not have their licenses terminated so long as such -\" parties remain in full compliance. -\" .PP - -\" 10. FUTURE REVISIONS OF THIS LICENSE -\" .PP -\" The Free Software Foundation may publish new, revised versions -\" of the GNU Free Documentation License from time to time. Such new -\" versions will be similar in spirit to the present version, but may -\" differ in detail to address new problems or concerns. See -\" http://www.gnu.org/copyleft/. -\" .PP -\" Each version of the License is given a distinguishing version number. -\" If the Document specifies that a particular numbered version of this -\" License "or any later version" applies to it, you have the option of -\" following the terms and conditions either of that specified version or -\" of any later version that has been published (not as a draft) by the -\" Free Software Foundation. If the Document does not specify a version -\" number of this License, you may choose any version ever published (not -\" as a draft) by the Free Software Foundation. -\" .PP - -\" ADDENDUM: How to use this License for your documents -\" .PP -\" To use this License in a document you have written, include a copy of -\" the License in the document and put the following copyright and -\" license notices just after the title page: -\" .PP -\" Copyright (c) YEAR YOUR NAME. -\" Permission is granted to copy, distribute and/or -\" modify this document under the terms of the GNU -\" Free Documentation License, Version 1.1 or any later -\" version published by the Free Software Foundation; -\" with the Invariant Sections being LIST THEIR TITLES, -\" with the Front-Cover Texts being LIST, and with the -\" Back-Cover Texts being LIST. A copy of the license -\" is included in the section entitled "GNU Free -\" Documentation License". -\" .PP -\" If you have no Invariant Sections, write "with no Invariant Sections" -\" instead of saying which ones are invariant. If you have no -\" Front-Cover Texts, write "no Front-Cover Texts" instead of -\" "Front-Cover Texts being LIST"; likewise for Back-Cover Texts. -\" .PP -\" If your document contains nontrivial examples of program code, we -\" recommend releasing these examples in parallel under your choice of -\" free software license, such as the GNU General Public License, -\" to permit their use in free software. diff --git a/contrib/binutils/config.if b/contrib/binutils/config.if deleted file mode 100644 index 3958928ec65e..000000000000 --- a/contrib/binutils/config.if +++ /dev/null @@ -1,93 +0,0 @@ -#! /dev/null -# Don't call it directly. This shell script fragment is called to -# determine: -# -# 1. libstcxx_interface: the interface name for libstdc++. -# 2. cxx_interface: the interface name for c++. -# 3. libc_interface: the interface name for libc. -# - -# Get the top level src dir. -if [ -z "${topsrcdir}" -a -z "${top_srcdir}" ] -then - echo "Undefined top level src dir: topsrcdir and top_srcdir are empty" >&2 - exit 1 -fi - -if [ -n "${topsrcdir}" ] -then - if_topsrcdir=${topsrcdir} -else - if_topsrcdir=${top_srcdir} -fi - -if [ "${enable_libstdcxx_v3}" = "yes" ] ; then - libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3 -else - libstdcxx_srcdir=${if_topsrcdir}/libstdc++ -fi - -if [ -f ${libstdcxx_srcdir}/Makefile.in ]; then -# We check libstdc++ for libstdcxx_interface. -libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'` -else -libstdcxx_interface= -fi - -if [ -f ${if_topsrcdir}/gcc/cp/Makefile.in ]; then -# We check gcc/cp for cxx_interface. -cxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/gcc/cp/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'` -else -cxx_interface= -fi - -# The trickiest part is libc_interface. -if [ -z "${libc_interface}" ] -then - case ${target_os} in - *linux*libc1*|*linux*libc5*) - case ${target_alias} in - *alpha*|*powerpc*) - libc_interface=-libc5.9- - ;; - *) - libc_interface=-libc5- - ;; - esac - ;; - *linux*gnu*) - # We have to work harder to figure it out. - if [ ${target_alias} = ${build_alias} ] - then - dummy=if$$ - cat >$dummy.c <<EOF -#include <features.h> -main(argc, argv) - int argc; - char *argv[]; -{ - printf("%d\n", __GLIBC_MINOR__); - return 0; -} -EOF - ${CC-cc} $dummy.c -o $dummy 2>/dev/null - if [ "$?" = 0 ] - then - libc_interface=-libc6.`./$dummy`- - rm -f $dummy.c $dummy - else - # It should never happen. - echo "Cannot find the GNU C library minor version number." >&2 - rm -f $dummy.c $dummy - exit 1 - fi - else - # Cross compiling. Assume glibc 2.2. - libc_interface=-libc6.2- - fi - ;; - *) - libc_interface=- - ;; - esac -fi diff --git a/contrib/binutils/config/mh-s390pic b/contrib/binutils/config/mh-s390pic deleted file mode 100644 index 92e48d90fbdf..000000000000 --- a/contrib/binutils/config/mh-s390pic +++ /dev/null @@ -1 +0,0 @@ -PICFLAG=-fpic diff --git a/contrib/binutils/config/mt-armpic b/contrib/binutils/config/mt-armpic deleted file mode 100644 index 35b8c9e4dc23..000000000000 --- a/contrib/binutils/config/mt-armpic +++ /dev/null @@ -1 +0,0 @@ -PICFLAG_FOR_TARGET=-fPIC diff --git a/contrib/binutils/config/mt-elfalphapic b/contrib/binutils/config/mt-elfalphapic deleted file mode 100644 index 35b8c9e4dc23..000000000000 --- a/contrib/binutils/config/mt-elfalphapic +++ /dev/null @@ -1 +0,0 @@ -PICFLAG_FOR_TARGET=-fPIC diff --git a/contrib/binutils/config/mt-ia64pic b/contrib/binutils/config/mt-ia64pic deleted file mode 100644 index ff9872755757..000000000000 --- a/contrib/binutils/config/mt-ia64pic +++ /dev/null @@ -1 +0,0 @@ -PICFLAG_FOR_TARGET=-fpic diff --git a/contrib/binutils/config/mt-papic b/contrib/binutils/config/mt-papic deleted file mode 100644 index 35b8c9e4dc23..000000000000 --- a/contrib/binutils/config/mt-papic +++ /dev/null @@ -1 +0,0 @@ -PICFLAG_FOR_TARGET=-fPIC diff --git a/contrib/binutils/config/mt-ppcpic b/contrib/binutils/config/mt-ppcpic deleted file mode 100644 index 35b8c9e4dc23..000000000000 --- a/contrib/binutils/config/mt-ppcpic +++ /dev/null @@ -1 +0,0 @@ -PICFLAG_FOR_TARGET=-fPIC diff --git a/contrib/binutils/config/mt-s390pic b/contrib/binutils/config/mt-s390pic deleted file mode 100644 index ff9872755757..000000000000 --- a/contrib/binutils/config/mt-s390pic +++ /dev/null @@ -1 +0,0 @@ -PICFLAG_FOR_TARGET=-fpic diff --git a/contrib/binutils/config/mt-sparcpic b/contrib/binutils/config/mt-sparcpic deleted file mode 100644 index a62b38bd9c1b..000000000000 --- a/contrib/binutils/config/mt-sparcpic +++ /dev/null @@ -1 +0,0 @@ -PICFLAG_FOR_TARGET=`case '${LIBCFLAGS} ${LIBCXXFLAGS}' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac` diff --git a/contrib/binutils/config/mt-x86pic b/contrib/binutils/config/mt-x86pic deleted file mode 100644 index ff9872755757..000000000000 --- a/contrib/binutils/config/mt-x86pic +++ /dev/null @@ -1 +0,0 @@ -PICFLAG_FOR_TARGET=-fpic diff --git a/contrib/binutils/etc/ChangeLog b/contrib/binutils/etc/ChangeLog deleted file mode 100644 index ffd021f53fa2..000000000000 --- a/contrib/binutils/etc/ChangeLog +++ /dev/null @@ -1,515 +0,0 @@ -2002-01-26 Hans-Peter Nilsson <hp@bitrange.com> - - * Makefile.in (install): Depend on install-info. - -2001-03-25 Stephane Carrez <Stephane.Carrez@worldnet.fr> - - * texi2pod.pl: New file (from gcc/contrib). - -1999-04-01 Jim Blandy <jimb@zwingli.cygnus.com> - - * add-log.el, add-log.vi: New files. - -Wed Jan 20 01:33:50 1999 Angela Marie Thomas (angela@cygnus.com) - - * comp-tools-verify: Remove some checks that are no longer valid. - -1998-12-03 Nick Clifton <nickc@cygnus.com> - - * targetdoc/fr30.texi: New document. - -Thu Oct 1 21:15:59 1998 Angela Marie Thomas (angela@cygnus.com) - - * comp-tools-fix, cross-tools-fix: Replace /usr/include - with ${FIXINCDIR}. - -Tue Aug 11 19:22:11 1998 Doug Evans <devans@canuck.cygnus.com> - - * make-rel-sym-tree (version): Update calculation. - -Fri Jun 12 21:34:01 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.texi: Various additions. - * Makefile.in (TEXI2HTML, DVIPS): New variables. - (standards.ps): New target. - (configure.dvi): Copy .tin files in as well. - (configure.ps, configure.html): New targets. - (clean): Remove configdev.jpg and configbuild.jpg. - * configdev.fig: New file. - * configdev.ein: New file (EPS version of configdev.fig). - * configdev.jin: New file (JPEG version of configdev.fig). - * configbuild.fig: New file. - * configbuild.ein: New file (EPS version of configbuild.fig). - * configbuild.jin: New file (JPEG version of configbuild.fig). - -Wed Jun 10 14:41:25 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.texi: New file. - * configdev.tin: New file. - * configbuild.tin: New file. - * Makefile.in (MAKEINFO): Use makeinfo from texinfo directory if - it exists. - (TEXI2DVI): Likewise for texi2dvi. - (INFOFILES): Add configure.info. - (DVIFILES): Add configure.dvi. - (info): Only build info files if the source files exist. - (install-info): Only install info files if they exist. - (dvi): Only build DVI files if the sources files exist. - (configure.info): New target. - (configure.dvi): New target. - (clean): Remove configdev and configbuild derived files. - - Remove obsolete documentation. - * intro.texi: Remove. - * install.texi: Remove. - * config-names.texi: Remove. - * screen1.eps: Remove. - * screen1.obj: Remove. - * screen2.eps: Remove. - * screen2.obj: Remove. - * Makefile.in: Remove references to the above. - -Thu May 21 14:34:51 1998 Nick Clifton <nickc@cygnus.com> - - * targetdoc/arm-interwork.texi: Add note about ignoring linker - warning message when using --support-old-code. - -Mon May 18 14:27:37 1998 Angela Marie Thomas (angela@cygnus.com) - - * Install.in, comp-tools-fix, comp-tools-verify, cross-tools-fix: - Use $GCCvn rather than substitute everywhere. - -Thu May 14 14:43:10 1998 Nick Clifton <nickc@cygnus.com> - - * targetdoc/arm-interwork.texi: Document dlltool support of - interworking. - -Thu May 7 16:49:38 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * Install.in: Remove references to TCL_LIBRARY, TK_LIBRARY, - and GDBTK_FILENAME. - -Wed Apr 1 17:11:44 1998 Nick Clifton <nickc@cygnus.com> - - * targetdoc/arm-interwork.texi: Document ARM/thumb interworking. - -Tue Mar 31 15:28:20 1998 Ian Lance Taylor <ian@cygnus.com> - - * standards.texi, make-stds.texi: Update to current FSF versions. - * Makefile.in (standards.info): Depend upon make-std.texi. - -Tue Mar 24 16:13:26 1998 Stu Grossman <grossman@bhuna.cygnus.co.uk> - - * configure: Regenerate with autoconf 2.12.1 to fix shell issues - for NT native builds. - -Mon Mar 9 16:41:04 1998 Doug Evans <devans@canuck.cygnus.com> - - * make-rel-sym-tree (binprogs): Add objcopy. - -Tue Feb 24 18:11:58 1998 Doug Evans <devans@canuck.cygnus.com> - - * make-rel-sym-tree: as.new -> as-new, ld.new -> ld-new - nm.new -> nm-new. Make symlinks to crt*.o. - -Fri Nov 21 12:54:58 1997 Manfred Hollstein <manfred@s-direktnet.de> - - * Makefile.in: Add --no-split argument to avoid creating files - with names longer than 14 characters. - -Thu Sep 25 13:13:11 1997 Jason Molenda (crash@pern.cygnus.com) - - * intro.texi: Add closing ifset. - -Mon Sep 1 10:31:32 1997 Angela Marie Thomas (angela@cygnus.com) - - * Install.in: Move setting HOST and TARGET to the beginning - of the file for editing convenience. - -Mon Sep 1 10:28:37 1997 Angela Marie Thomas (angela@cygnus.com) - - * Install.in.: More friendly options/messages when extracting - from a file instead of a tape device. - -Tue Jun 17 15:50:23 1997 Angela Marie Thomas (angela@cygnus.com) - - * Install.in: Add /usr/bsd to PATH for Irix (home of compress) - -Thu Jun 12 13:47:00 1997 Angela Marie Thomas (angela@cygnus.com) - - * Install.in (show_exec_prefix_msg): fix quoting - -Wed Jun 4 15:31:43 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * rebuilding.texi: Removed. - -Sat May 24 18:02:20 1997 Angela Marie Thomas (angela@cygnus.com) - - * cross-tools-fix: Remove host check since it doesn't matter - for this case. - * Install.in (guess_system): clean up more unused hosts. - * Install.in, cross-tools-fix, comp-tools-fix, comp-tools-verify: - Hack for host check to not warn the user for certain cases. - -Fri May 23 23:46:10 1997 Angela Marie Thomas (angela@cygnus.com) - - * subst-strings: Remove a lot of unused code - * Install.in: Remove reference to TAPEdflt, use variables instead of - string substitution when able. - -Fri Apr 11 17:25:52 1997 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Change file named in AC_INIT to Makefile.in. - * configure: Rebuild. - -Fri Apr 11 18:12:42 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Install.in (guess_system): Back out change to INSTALLHOST to - call all IRIX systems "mips-sgi-irix4" - - * Makefile.in: Remove references to configure.texi and cfg-paper.texi. - -Thu Apr 10 23:26:45 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * srctree.texi, emacs-relnotes.texi, cfg-paper.texi: Remove. - * Install.in: Remove Ultrix-specific hacks. - Update Cygnus phone numbers. - (guess_system): Remove some old systems (Ultrix, OSF1 v1 & 2, - m68k-HPUX, m68k SunOS, etc.) - (show_gnu_root_msg): Remove. - Removed all the remove option code. - -Thu Apr 10 23:23:33 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * configure.man, configure.texi: Remote. - -Mon Apr 7 18:15:00 1997 Brendan Kehoe <brendan@cygnus.com> - - * Fix the version string for OSF1 4.0 to recognize either - V4.* or X4.* - -Mon Apr 7 15:34:47 1997 Ian Lance Taylor <ian@cygnus.com> - - * standards.texi, make-stds.texi: Update to current FSF versions. - -Tue Nov 19 15:36:14 1996 Doug Evans <dje@canuck.cygnus.com> - - * make-rel-sym-tree: New file. - -Wed Oct 23 00:34:07 1996 Angela Marie Thomas (angela@cygnus.com) - - * Lots of patches from progressive... - * Install.in: restore DDOPTS for AIX 4.x - * Install.in, subst-strings: add case for DG Aviion - * subst-strings: fix typo in INSTALLdir var setting - * comp-tools-verify: set SHLIB_PATH for shared libs - * Install.in, subst-strings: add case for solaris2.5 - * Install.in: fix regression for hppa1.1 check - * comp-tools-fix: set LD_LIBRARY_PATH - * comp-tools-fix: If fixincludes fixes /usr/include/limits.h, - install it as syslimits.h. - -Wed Oct 16 19:20:42 1996 Michael Meissner <meissner@tiktok.cygnus.com> - - * Install.in (guess_system): Treat powerpc-ibm-aix4.1 the same as - rs6000-ibm-aix4.1, since the compiler now uses common mode by - default. - -Wed Oct 2 15:39:07 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * configure.in (AC_PROG_INSTALL): Added. - * Makefile.in (distclean): Remove config.cache. - -Wed Oct 2 14:33:58 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * configure.in: Switch to autoconf configure.in. - * configure: New. - * Makefile.in: Use autoconf-substituted values. - -Tue Jun 25 18:56:08 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (datadir): Changed to $(prefix)/share. - -Fri Mar 29 11:38:01 1996 J.T. Conklin (jtc@lisa.cygnus.com) - - * configure.man: Changed to be recognized by catman -w on Solaris. - -Wed Dec 6 15:40:28 1995 Doug Evans <dje@canuck.cygnus.com> - - * comp-tools-fix (fixincludes): Define FIXPROTO_DEFINES from - .../install-tools/fixproto-defines. - -Sun Nov 12 19:31:27 1995 Jason Molenda (crash@phydeaux.cygnus.com) - - * comp-tools-verify (verify_cxx_initializers): delete argv, - argc declarations, add -static to compile line. - (verify_cxx_hello_world): delete argv, argc declarations, add - -static to compile line. - -Wed Sep 20 13:21:52 1995 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (maintainer-clean): New target, synonym for - realclean. - -Mon Aug 28 17:25:49 1995 Jason Molenda (crash@phydeaux.cygnus.com) - - * Install.in (PATH): add /usr/ucb to $PATH (for SunOS 4.1.x). - -Tue Aug 15 21:51:58 1995 Jason Molenda (crash@phydeaux.cygnus.com) - - * Install.in (guess_system): Match OSF/1 v3.x as the same as - v2.x--v2.x binaries are upward compatible. - -Tue Aug 15 21:46:54 1995 Jason Molenda (crash@phydeaux.cygnus.com) - - * Install.in (guess_system): recognize HP 9000/800 systems as the - same as HP 9000/700 systems. - -Tue Aug 8 13:11:56 1995 Brendan Kehoe <brendan@lisa.cygnus.com> - - * Install.in: For emacs, run show_emacs_alternate_msg and exit. - (show_emacs_alternate_msg): New message saying how emacs can't be - installed in an alternate prefix. - -Thu Jun 8 00:42:56 1995 Angela Marie Thomas <angela@cirdan.cygnus.com> - - * subst-strings: change du commands to $BINDIR/. & $SRCDIR/. just - in case they are symlinks. - -Tue Apr 18 14:23:10 1995 J.T. Conklin <jtc@rtl.cygnus.com> - - * cdk-fix: Extracted table of targets that don't need their - headers fixed from gcc's configure script. - - * cdk-fix, cdk-verify: Use ${HOST} instead of ||HOSTstr|| - - * cdk-fix, cdk-verify: New files, install script fragments used - for Cygnus Developer's Kit. - - * Install.in (do_mkdir): New function. - - * Install.in: Added support for --with and --without options. - Changed so that tape commands are not run when extracting - from a file. - (do_mt): Changed to take only one argument. - -Wed Mar 29 11:16:38 1995 Jason Molenda (crash@phydeaux.cygnus.com) - - * Install.in: catch UNAME==alpha-dec-osf2.x and correct entry for - alpha-dec-osf1.x - -Fri Jan 27 12:04:29 1995 J.T. Conklin <jtc@rtl.cygnus.com> - - * subst-strings (mips-sgi-irix5): New entry in table. - -Thu Jan 19 12:15:44 1995 J.T. Conklin <jtc@rtl.cygnus.com> - - * Install.in: Major rewrite, bundle dependent code (for example, - fixincludes for comp-tools) will be inserted into the Install - script when it is generated. - -Tue Jan 17 16:51:32 1995 Ian Lance Taylor <ian@sanguine.cygnus.com> - - * Makefile.in (Makefile): Rebuild using $(SHELL). - -Thu Nov 3 19:30:33 1994 Ken Raeburn <raeburn@cujo.cygnus.com> - - * Makefile.in (install-info): Depend on info. - -Fri Aug 19 16:16:38 1994 Jason Molenda (crash@phydeaux.cygnus.com) - - * Install.in: set $FIX_HEADER so fixproto can find fix-header. - -Fri May 6 16:18:58 1994 Jason Molenda (crash@sendai.cygnus.com) - - * Makefile.in (install-info): add a semicolon in the if statement. - -Fri Apr 29 16:56:07 1994 David J. Mackenzie (djm@rtl.cygnus.com) - - * cfg-paper.texi: Update some outdated information. - - * Makefile.in (install-info): Pass file, not directory, as last - arg to INSTALL_DATA. - (uninstall): New target. - -Thu Apr 28 14:42:22 1994 David J. Mackenzie (djm@rtl.cygnus.com) - - * configure.texi: Comment out @smallbook. - - * Makefile.in: Define TEXI2DVI and TEXIDIR, and use the latter. - Remove info files in realclean, not clean, per coding standards. - Remove TeX output in clean. - -Tue Apr 26 17:18:03 1994 Jason Molenda (crash@sendai.cygnus.com) - - * Install.in: fixincludes output is actually put in fixincludes.log, - but echo'ed messages claim it is fixinc.log. This is the same - messages as I logged in March 4 1994, but for some reason we found - the change hadn't been done. I'll have to dig through the logs - and find out what I really did do that day. :) - -Mon Apr 25 20:28:19 1994 Jason Molenda (crash@sendai.cygnus.com) - - * Install.in: use eval to call do_mt() for Ultrix brokenness. - -Mon Apr 25 20:00:00 1994 Jason Molenda (crash@sendai.cygnus.com) - - * Install.in(do_mt): exit with error status 1 if # of parameters - != 3. - -Mon Apr 25 19:42:36 1994 Jason Molenda (crash@sendai.cygnus.com) - - * Install.in: lose TAPE_FORWARD and TAPE_REWIND, add do_mt() - to do all tape movement operations. Currently untested. Addresses - PR # 4886 from bull. - - * Install.in: add 1994 to the copyright thing. - -Fri Apr 22 19:05:13 1994 David J. Mackenzie (djm@rtl.cygnus.com) - - * standards.texi: Update from FSF. - -Fri Apr 22 15:46:10 1994 Jason Molenda (crash@cygnus.com) - - * Install.in: Add $DDOPTS, has ``bs=124b'' for all systems except - AIX (some versions of AIX don't understand bs=124b. Silly OS). - -Mon Apr 4 22:55:05 1994 Jason Molenda (crash@sendai.cygnus.com) - - * Install.in: null out $TOOLS before adding stuff to it - non-destructively. - -Wed Mar 30 21:45:35 1994 David J. Mackenzie (djm@rtl.cygnus.com) - - * standards.texi: Fix typo. - - * configure.texi, configure.man: Document --disable-. - -Mon Mar 28 13:22:15 1994 David J. Mackenzie (djm@rtl.cygnus.com) - - * standards.texi: Update from FSF. - -Sat Mar 26 09:21:44 1994 David J. Mackenzie (djm@rtl.cygnus.com) - - * standards.texi, make-stds.texi: Update from FSF. - -Fri Mar 25 22:59:45 1994 David J. Mackenzie (djm@rtl.cygnus.com) - - * configure.texi, configure.man: Document --enable-* options. - -Wed Mar 23 23:38:24 1994 Jason Molenda (crash@sendai.cygnus.com) - - * Install.in: set CPP to be gcc -E for fixincludes. - -Wed Mar 23 13:42:48 1994 Jason Molenda (crash@sendai.cygnus.com) - - * Install.in: set PATH to $PATH:/bin:/usr/bin so we can pick - up native tools even if the user doesn't have them in his - path. - - * Install.in: ``hppa-1.1-hp-hpux'' -> ``hppa1.1-hp-hpux''. - -Tue Mar 15 22:09:20 1994 Jason Molenda (crash@sendai.cygnus.com) - - * Install.in: TAPE_REWIND and TAPE_FORWARD variables for Unixunaware, - added switch statement to detect if system is Unixunaware. - -Fri Mar 4 12:10:30 1994 Jason Molenda (crash@sendai.cygnus.com) - - * Install.in: fixincludes output is actually put in fixincludes.log, - but echo'ed messages claim it is fixinc.log. - -Wed Nov 3 02:58:02 1993 Jeffrey Osier (jeffrey@thepub.cygnus.com) - - * subst-strings: output TEXBUNDLE for more install notes matching - * install-texi.in: PRMS info now exists - -Tue Oct 26 16:57:12 1993 K. Richard Pixley (rich@sendai.cygnus.com) - - * subst-strings: match solaris*. Also, add default case to catch - and error out for unrecognized systems. - -Thu Aug 19 18:21:31 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) - - * Install.in: handle the new fixproto work - -Mon Jul 19 12:05:41 1993 david d `zoo' zuhn (zoo@cirdan.cygnus.com) - - * Install.in: remove "MT=tctl" for AIX (not needed, and barely - worked anyway) - -Mon Jun 14 19:09:22 1993 Jeffrey Osier (jeffrey@cygnus.com) - - * subst-strings: changed HOST to recognize Solaris for install notes - -Thu Jun 10 16:01:25 1993 Jeffrey Osier (jeffrey@cygnus.com) - - * dos-inst.texi: new file. - -Wed Jun 9 19:23:59 1993 Jeffrey Osier (jeffrey@rtl.cygnus.com) - - * install-texi.in: added conditionals (nearly complete) - cleaned up - added support for other releases (not done) - -Wed Jun 9 15:53:58 1993 Jim Kingdon (kingdon@cygnus.com) - - * Makefile.in (install-info): Use INSTALL_DATA. - ({dist,real}clean): Also delete Makefile and config.status. - -Fri Jun 4 17:09:56 1993 Jeffrey Osier (jeffrey@cygnus.com) - - * subst-strings: added data for OS_STRING - - * subst-strings: added support for OS_STRING - -Thu Jun 3 00:37:01 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Install.in: pull COPYING and COPYING.LIB off of the tape - -Tue Jun 1 16:52:08 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * subst-strings: replace RELEASE_DIR too - -Mon Mar 22 23:55:27 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: add installcheck target - -Wed Mar 17 02:21:15 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Install.in: fix 'source only' extraction bug where it looked for - the src dir under H-<host>/src instead of src; also remove stray - reference to EMACSHIBIN - -Mon Mar 15 01:25:45 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * make-stds.texi: added 'installcheck' to the standard targets - -Tue Mar 9 19:48:28 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * standards.texi: added INFO-DIR-ENTRY, updated version from the FSF - -Tue Feb 9 12:40:23 1993 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in (standards.info): Added -I$(srcdir) to find - make-stds.texi. - -Mon Feb 1 16:32:56 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * standards.texi: updated to latest FSF version, which includes: - - * make-stds.texi: new file - -Mon Nov 30 01:31:40 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * install-texi.in, relnotes.texi, intro.texi: changed Cygnus phone - numbers from the old Palo Alto ones to the new Mtn. View numbers - -Mon Nov 16 16:50:43 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: define $(RM) to "rm -f" - -Sun Oct 11 16:05:48 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * intro.texi: added INFO-DIR-ENTRY - diff --git a/contrib/binutils/etc/Makefile.in b/contrib/binutils/etc/Makefile.in deleted file mode 100644 index 2bc34574540e..000000000000 --- a/contrib/binutils/etc/Makefile.in +++ /dev/null @@ -1,157 +0,0 @@ -# -# Makefile.in for etc -# - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -srcdir = @srcdir@ -VPATH = @srcdir@ - -bindir = @bindir@ -libdir = @libdir@ -tooldir = $(libdir) -datadir = @datadir@ - -mandir = @mandir@ -man1dir = $(mandir)/man1 -man2dir = $(mandir)/man2 -man3dir = $(mandir)/man3 -man4dir = $(mandir)/man4 -man5dir = $(mandir)/man5 -man6dir = $(mandir)/man6 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -man9dir = $(mandir)/man9 -infodir = @infodir@ - -SHELL = /bin/sh - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -MAKEINFO = `if [ -f ../texinfo/makeinfo/makeinfo ]; \ - then echo ../texinfo/makeinfo/makeinfo; \ - else echo makeinfo; fi` -TEXI2DVI = `if [ -f ../texinfo/util/texi2dvi ]; \ - then echo ../texinfo/util/texi2dvi; \ - else echo texi2dvi; fi` -TEXI2HTML = texi2html -DVIPS = dvips - -# Where to find texinfo.tex to format documentation with TeX. -TEXIDIR = $(srcdir)/../texinfo - -#### Host, target, and site specific Makefile fragments come in here. -### - -INFOFILES = standards.info configure.info -DVIFILES = standards.dvi configure.dvi - -all: - -# We want install to imply install-info as per GNU standards. -install: install-info - -uninstall: - -info: - for f in $(INFOFILES); do \ - if test -f $(srcdir)/`echo $$f | sed -e 's/.info$$/.texi/'`; then \ - if $(MAKE) "MAKEINFO=$(MAKEINFO)" $$f; then \ - true; \ - else \ - exit 1; \ - fi; \ - fi; \ - done - -install-info: info - $(SHELL) $(srcdir)/../mkinstalldirs $(infodir) - if test ! -f standards.info; then cd $(srcdir); fi; \ - if test -f standards.info; then \ - for i in standards.info*; do \ - $(INSTALL_DATA) $$i $(infodir)/$$i; \ - done; \ - fi - if test ! -f configure.info; then cd $(srcdir); fi; \ - if test -f configure.info; then \ - for i in configure.info*; do \ - $(INSTALL_DATA) $$i $(infodir)/$$i; \ - done; \ - fi - -dvi: - for f in $(DVIFILES); do \ - if test -f $(srcdir)/`echo $$f | sed -e 's/.dvi$$/.texi/'`; then \ - if $(MAKE) "TEXI2DVI=$(TEXI2DVI)" $$f; then \ - true; \ - else \ - exit 1; \ - fi; \ - fi; \ - done - -standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi - $(MAKEINFO) --no-split -I$(srcdir) -o standards.info $(srcdir)/standards.texi - -standards.dvi: $(srcdir)/standards.texi - TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/standards.texi - -standards.ps: standards.dvi - $(DVIPS) standards.dvi -o standards.ps - -# makeinfo requires images to be in the current directory. -configure.info: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin - rm -f configdev.txt configbuild.txt - cp $(srcdir)/configdev.tin configdev.txt - cp $(srcdir)/configbuild.tin configbuild.txt - $(MAKEINFO) -I$(srcdir) -o configure.info $(srcdir)/configure.texi - rm -f configdev.txt configbuild.txt - -# texi2dvi wants both the .txt and the .eps files. -configure.dvi: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin $(srcdir)/configdev.ein $(srcdir)/configbuild.ein - rm -f configdev.txt configbuild.txt - cp $(srcdir)/configdev.tin configdev.txt - cp $(srcdir)/configbuild.tin configbuild.txt - rm -f configdev.eps configbuild.eps - cp $(srcdir)/configdev.ein configdev.eps - cp $(srcdir)/configbuild.ein configbuild.eps - TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/configure.texi - rm -f configdev.txt configbuild.txt - rm -f configdev.eps configbuild.eps - -# dvips requires images to be in the current directory -configure.ps: configure.dvi $(srcdir)/configdev.ein $(srcdir)/configbuild.ein - rm -f configdev.eps configbuild.eps - cp $(srcdir)/configdev.ein configdev.eps - cp $(srcdir)/configbuild.ein configbuild.eps - $(DVIPS) configure.dvi -o configure.ps - rm -f configdev.eps configbuild.eps - -configure.html: $(srcdir)/configure.texi - $(TEXI2HTML) -split_chapter $(srcdir)/configure.texi - -clean: - rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log - rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs - rm -f configdev.txt configbuild.txt configdev.eps configbuild.eps - rm -f configdev.jpg configbuild.jpg - -mostlyclean: clean - -distclean: clean - rm -f Makefile config.status config.cache - -maintainer-clean realclean: distclean - rm -f *.info* - -Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) - $(SHELL) ./config.status - -## these last targets are for standards.texi conformance -dist: -check: -installcheck: -TAGS: diff --git a/contrib/binutils/etc/add-log.el b/contrib/binutils/etc/add-log.el deleted file mode 100644 index 60c88e8c9490..000000000000 --- a/contrib/binutils/etc/add-log.el +++ /dev/null @@ -1,573 +0,0 @@ -;;; ============ NOTE WELL! ============= -;;; -;;; You only need to use this file if you're using a version of Emacs -;;; prior to 20.1 to work on GDB. The only difference between this -;;; and the standard add-log.el provided with 19.34 is that it -;;; generates dates using the terser format used by Emacs 20. This is -;;; the format recommended for use in GDB ChangeLogs. -;;; -;;; To use this code, you should create a directory `~/elisp', save the code -;;; below in `~/elisp/add-log.el', and then put something like this in -;;; your `~/.emacs' file, to tell Emacs where to find it: -;;; -;;; (setq load-path -;;; (cons (expand-file-name "~/elisp") -;;; load-path)) -;;; -;;; If you want, you can also byte-compile it --- it'll run a little -;;; faster, and use a little less memory. (Not that those matter much for -;;; this file.) To do that, after you've saved the text as -;;; ~/elisp/add-log.el, bring it up in Emacs, and type -;;; -;;; C-u M-x byte-compile-file -;;; -;;; --- Jim Blandy - -;;; add-log.el --- change log maintenance commands for Emacs - -;; Copyright (C) 1985, 1986, 1988, 1993, 1994 Free Software Foundation, Inc. - -;; Keywords: maint - -;; This file is part of GNU Emacs. - -;; GNU Emacs 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 Emacs 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 Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Commentary: - -;; This facility is documented in the Emacs Manual. - -;;; Code: - -(defvar change-log-default-name nil - "*Name of a change log file for \\[add-change-log-entry].") - -(defvar add-log-current-defun-function nil - "\ -*If non-nil, function to guess name of current function from surrounding text. -\\[add-change-log-entry] calls this function (if nil, `add-log-current-defun' -instead) with no arguments. It returns a string or nil if it cannot guess.") - -;;;###autoload -(defvar add-log-full-name nil - "*Full name of user, for inclusion in ChangeLog daily headers. -This defaults to the value returned by the `user-full-name' function.") - -;;;###autoload -(defvar add-log-mailing-address nil - "*Electronic mail address of user, for inclusion in ChangeLog daily headers. -This defaults to the value of `user-mail-address'.") - -(defvar change-log-font-lock-keywords - '(("^[SMTWF].+" . font-lock-function-name-face) ; Date line. - ("^\t\\* \\([^ :\n]+\\)" 1 font-lock-comment-face) ; File name. - ("(\\([^)\n]+\\)):" 1 font-lock-keyword-face)) ; Function name. - "Additional expressions to highlight in Change Log mode.") - -(defvar change-log-mode-map nil - "Keymap for Change Log major mode.") -(if change-log-mode-map - nil - (setq change-log-mode-map (make-sparse-keymap)) - (define-key change-log-mode-map "\M-q" 'change-log-fill-paragraph)) - -(defun change-log-name () - (or change-log-default-name - (if (eq system-type 'vax-vms) - "$CHANGE_LOG$.TXT" - (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)) - "changelo" - "ChangeLog")))) - -;;;###autoload -(defun prompt-for-change-log-name () - "Prompt for a change log name." - (let* ((default (change-log-name)) - (name (expand-file-name - (read-file-name (format "Log file (default %s): " default) - nil default)))) - ;; Handle something that is syntactically a directory name. - ;; Look for ChangeLog or whatever in that directory. - (if (string= (file-name-nondirectory name) "") - (expand-file-name (file-name-nondirectory default) - name) - ;; Handle specifying a file that is a directory. - (if (file-directory-p name) - (expand-file-name (file-name-nondirectory default) - (file-name-as-directory name)) - name)))) - -;;;###autoload -(defun find-change-log (&optional file-name) - "Find a change log file for \\[add-change-log-entry] and return the name. - -Optional arg FILE-NAME specifies the file to use. -If FILE-NAME is nil, use the value of `change-log-default-name'. -If 'change-log-default-name' is nil, behave as though it were 'ChangeLog' -\(or whatever we use on this operating system). - -If 'change-log-default-name' contains a leading directory component, then -simply find it in the current directory. Otherwise, search in the current -directory and its successive parents for a file so named. - -Once a file is found, `change-log-default-name' is set locally in the -current buffer to the complete file name." - ;; If user specified a file name or if this buffer knows which one to use, - ;; just use that. - (or file-name - (setq file-name (and change-log-default-name - (file-name-directory change-log-default-name) - change-log-default-name)) - (progn - ;; Chase links in the source file - ;; and use the change log in the dir where it points. - (setq file-name (or (and buffer-file-name - (file-name-directory - (file-chase-links buffer-file-name))) - default-directory)) - (if (file-directory-p file-name) - (setq file-name (expand-file-name (change-log-name) file-name))) - ;; Chase links before visiting the file. - ;; This makes it easier to use a single change log file - ;; for several related directories. - (setq file-name (file-chase-links file-name)) - (setq file-name (expand-file-name file-name)) - ;; Move up in the dir hierarchy till we find a change log file. - (let ((file1 file-name) - parent-dir) - (while (and (not (or (get-file-buffer file1) (file-exists-p file1))) - (progn (setq parent-dir - (file-name-directory - (directory-file-name - (file-name-directory file1)))) - ;; Give up if we are already at the root dir. - (not (string= (file-name-directory file1) - parent-dir)))) - ;; Move up to the parent dir and try again. - (setq file1 (expand-file-name - (file-name-nondirectory (change-log-name)) - parent-dir))) - ;; If we found a change log in a parent, use that. - (if (or (get-file-buffer file1) (file-exists-p file1)) - (setq file-name file1))))) - ;; Make a local variable in this buffer so we needn't search again. - (set (make-local-variable 'change-log-default-name) file-name) - file-name) - -;;;###autoload -(defun add-change-log-entry (&optional whoami file-name other-window new-entry) - "Find change log file and add an entry for today. -Optional arg (interactive prefix) non-nil means prompt for user name and site. -Second arg is file name of change log. If nil, uses `change-log-default-name'. -Third arg OTHER-WINDOW non-nil means visit in other window. -Fourth arg NEW-ENTRY non-nil means always create a new entry at the front; -never append to an existing entry." - (interactive (list current-prefix-arg - (prompt-for-change-log-name))) - (or add-log-full-name - (setq add-log-full-name (user-full-name))) - (or add-log-mailing-address - (setq add-log-mailing-address user-mail-address)) - (if whoami - (progn - (setq add-log-full-name (read-input "Full name: " add-log-full-name)) - ;; Note that some sites have room and phone number fields in - ;; full name which look silly when inserted. Rather than do - ;; anything about that here, let user give prefix argument so that - ;; s/he can edit the full name field in prompter if s/he wants. - (setq add-log-mailing-address - (read-input "Mailing address: " add-log-mailing-address)))) - (let ((defun (funcall (or add-log-current-defun-function - 'add-log-current-defun))) - paragraph-end entry) - - (setq file-name (expand-file-name (find-change-log file-name))) - - ;; Set ENTRY to the file name to use in the new entry. - (and buffer-file-name - ;; Never want to add a change log entry for the ChangeLog file itself. - (not (string= buffer-file-name file-name)) - (setq entry (if (string-match - (concat "^" (regexp-quote (file-name-directory - file-name))) - buffer-file-name) - (substring buffer-file-name (match-end 0)) - (file-name-nondirectory buffer-file-name)))) - - (if (and other-window (not (equal file-name buffer-file-name))) - (find-file-other-window file-name) - (find-file file-name)) - (or (eq major-mode 'change-log-mode) - (change-log-mode)) - (undo-boundary) - (goto-char (point-min)) - (let ((heading (format "%s %s <%s>" - (format-time-string "%Y-%m-%d") - add-log-full-name - add-log-mailing-address))) - (if (looking-at (regexp-quote heading)) - (forward-line 1) - (insert heading "\n\n"))) - - ;; Search only within the first paragraph. - (if (looking-at "\n*[^\n* \t]") - (skip-chars-forward "\n") - (forward-paragraph 1)) - (setq paragraph-end (point)) - (goto-char (point-min)) - - ;; Now insert the new line for this entry. - (cond ((re-search-forward "^\\s *\\*\\s *$" paragraph-end t) - ;; Put this file name into the existing empty entry. - (if entry - (insert entry))) - ((and (not new-entry) - (let (case-fold-search) - (re-search-forward - (concat (regexp-quote (concat "* " entry)) - ;; Don't accept `foo.bar' when - ;; looking for `foo': - "\\(\\s \\|[(),:]\\)") - paragraph-end t))) - ;; Add to the existing entry for the same file. - (re-search-forward "^\\s *$\\|^\\s \\*") - (goto-char (match-beginning 0)) - ;; Delete excess empty lines; make just 2. - (while (and (not (eobp)) (looking-at "^\\s *$")) - (delete-region (point) (save-excursion (forward-line 1) (point)))) - (insert "\n\n") - (forward-line -2) - (indent-relative-maybe)) - (t - ;; Make a new entry. - (forward-line 1) - (while (looking-at "\\sW") - (forward-line 1)) - (while (and (not (eobp)) (looking-at "^\\s *$")) - (delete-region (point) (save-excursion (forward-line 1) (point)))) - (insert "\n\n\n") - (forward-line -2) - (indent-to left-margin) - (insert "* " (or entry "")))) - ;; Now insert the function name, if we have one. - ;; Point is at the entry for this file, - ;; either at the end of the line or at the first blank line. - (if defun - (progn - ;; Make it easy to get rid of the function name. - (undo-boundary) - (insert (if (save-excursion - (beginning-of-line 1) - (looking-at "\\s *$")) - "" - " ") - "(" defun "): ")) - ;; No function name, so put in a colon unless we have just a star. - (if (not (save-excursion - (beginning-of-line 1) - (looking-at "\\s *\\(\\*\\s *\\)?$"))) - (insert ": "))))) - -;;;###autoload -(defun add-change-log-entry-other-window (&optional whoami file-name) - "Find change log file in other window and add an entry for today. -Optional arg (interactive prefix) non-nil means prompt for user name and site. -Second arg is file name of change log. \ -If nil, uses `change-log-default-name'." - (interactive (if current-prefix-arg - (list current-prefix-arg - (prompt-for-change-log-name)))) - (add-change-log-entry whoami file-name t)) -;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) - -;;;###autoload -(defun change-log-mode () - "Major mode for editing change logs; like Indented Text Mode. -Prevents numeric backups and sets `left-margin' to 8 and `fill-column' to 74. -New log entries are usually made with \\[add-change-log-entry] or \\[add-change-log-entry-other-window]. -Each entry behaves as a paragraph, and the entries for one day as a page. -Runs `change-log-mode-hook'." - (interactive) - (kill-all-local-variables) - (indented-text-mode) - (setq major-mode 'change-log-mode - mode-name "Change Log" - left-margin 8 - fill-column 74 - indent-tabs-mode t - tab-width 8) - (use-local-map change-log-mode-map) - ;; Let each entry behave as one paragraph: - ;; We really do want "^" in paragraph-start below: it is only the lines that - ;; begin at column 0 (despite the left-margin of 8) that we are looking for. - (set (make-local-variable 'paragraph-start) "\\s *$\\|\f\\|^\\sw") - (set (make-local-variable 'paragraph-separate) "\\s *$\\|\f\\|^\\sw") - ;; Let all entries for one day behave as one page. - ;; Match null string on the date-line so that the date-line - ;; is grouped with what follows. - (set (make-local-variable 'page-delimiter) "^\\<\\|^\f") - (set (make-local-variable 'version-control) 'never) - (set (make-local-variable 'adaptive-fill-regexp) "\\s *") - (set (make-local-variable 'font-lock-defaults) - '(change-log-font-lock-keywords t)) - (run-hooks 'change-log-mode-hook)) - -;; It might be nice to have a general feature to replace this. The idea I -;; have is a variable giving a regexp matching text which should not be -;; moved from bol by filling. change-log-mode would set this to "^\\s *\\s(". -;; But I don't feel up to implementing that today. -(defun change-log-fill-paragraph (&optional justify) - "Fill the paragraph, but preserve open parentheses at beginning of lines. -Prefix arg means justify as well." - (interactive "P") - (let ((end (save-excursion (forward-paragraph) (point))) - (beg (save-excursion (backward-paragraph)(point))) - (paragraph-start (concat paragraph-start "\\|\\s *\\s("))) - (fill-region beg end justify))) - -(defvar add-log-current-defun-header-regexp - "^\\([A-Z][A-Z_ ]*[A-Z_]\\|[-_a-zA-Z]+\\)[ \t]*[:=]" - "*Heuristic regexp used by `add-log-current-defun' for unknown major modes.") - -;;;###autoload -(defun add-log-current-defun () - "Return name of function definition point is in, or nil. - -Understands C, Lisp, LaTeX (\"functions\" are chapters, sections, ...), -Texinfo (@node titles), Perl, and Fortran. - -Other modes are handled by a heuristic that looks in the 10K before -point for uppercase headings starting in the first column or -identifiers followed by `:' or `=', see variable -`add-log-current-defun-header-regexp'. - -Has a preference of looking backwards." - (condition-case nil - (save-excursion - (let ((location (point))) - (cond ((memq major-mode '(emacs-lisp-mode lisp-mode scheme-mode - lisp-interaction-mode)) - ;; If we are now precisely at the beginning of a defun, - ;; make sure beginning-of-defun finds that one - ;; rather than the previous one. - (or (eobp) (forward-char 1)) - (beginning-of-defun) - ;; Make sure we are really inside the defun found, not after it. - (if (and (looking-at "\\s(") - (progn (end-of-defun) - (< location (point))) - (progn (forward-sexp -1) - (>= location (point)))) - (progn - (if (looking-at "\\s(") - (forward-char 1)) - (forward-sexp 1) - (skip-chars-forward " '") - (buffer-substring (point) - (progn (forward-sexp 1) (point)))))) - ((and (memq major-mode '(c-mode c++-mode c++-c-mode objc-mode)) - (save-excursion (beginning-of-line) - ;; Use eq instead of = here to avoid - ;; error when at bob and char-after - ;; returns nil. - (while (eq (char-after (- (point) 2)) ?\\) - (forward-line -1)) - (looking-at "[ \t]*#[ \t]*define[ \t]"))) - ;; Handle a C macro definition. - (beginning-of-line) - (while (eq (char-after (- (point) 2)) ?\\) ;not =; note above - (forward-line -1)) - (search-forward "define") - (skip-chars-forward " \t") - (buffer-substring (point) - (progn (forward-sexp 1) (point)))) - ((memq major-mode '(c-mode c++-mode c++-c-mode objc-mode)) - (beginning-of-line) - ;; See if we are in the beginning part of a function, - ;; before the open brace. If so, advance forward. - (while (not (looking-at "{\\|\\(\\s *$\\)")) - (forward-line 1)) - (or (eobp) - (forward-char 1)) - (beginning-of-defun) - (if (progn (end-of-defun) - (< location (point))) - (progn - (backward-sexp 1) - (let (beg tem) - - (forward-line -1) - ;; Skip back over typedefs of arglist. - (while (and (not (bobp)) - (looking-at "[ \t\n]")) - (forward-line -1)) - ;; See if this is using the DEFUN macro used in Emacs, - ;; or the DEFUN macro used by the C library. - (if (condition-case nil - (and (save-excursion - (end-of-line) - (while (= (preceding-char) ?\\) - (end-of-line 2)) - (backward-sexp 1) - (beginning-of-line) - (setq tem (point)) - (looking-at "DEFUN\\b")) - (>= location tem)) - (error nil)) - (progn - (goto-char tem) - (down-list 1) - (if (= (char-after (point)) ?\") - (progn - (forward-sexp 1) - (skip-chars-forward " ,"))) - (buffer-substring (point) - (progn (forward-sexp 1) (point)))) - (if (looking-at "^[+-]") - (get-method-definition) - ;; Ordinary C function syntax. - (setq beg (point)) - (if (and (condition-case nil - ;; Protect against "Unbalanced parens" error. - (progn - (down-list 1) ; into arglist - (backward-up-list 1) - (skip-chars-backward " \t") - t) - (error nil)) - ;; Verify initial pos was after - ;; real start of function. - (save-excursion - (goto-char beg) - ;; For this purpose, include the line - ;; that has the decl keywords. This - ;; may also include some of the - ;; comments before the function. - (while (and (not (bobp)) - (save-excursion - (forward-line -1) - (looking-at "[^\n\f]"))) - (forward-line -1)) - (>= location (point))) - ;; Consistency check: going down and up - ;; shouldn't take us back before BEG. - (> (point) beg)) - (let (end middle) - ;; Don't include any final newline - ;; in the name we use. - (if (= (preceding-char) ?\n) - (forward-char -1)) - (setq end (point)) - (backward-sexp 1) - ;; Now find the right beginning of the name. - ;; Include certain keywords if they - ;; precede the name. - (setq middle (point)) - (forward-word -1) - ;; Ignore these subparts of a class decl - ;; and move back to the class name itself. - (while (looking-at "public \\|private ") - (skip-chars-backward " \t:") - (setq end (point)) - (backward-sexp 1) - (setq middle (point)) - (forward-word -1)) - (and (bolp) - (looking-at "struct \\|union \\|class ") - (setq middle (point))) - (buffer-substring middle end))))))))) - ((memq major-mode - '(TeX-mode plain-TeX-mode LaTeX-mode;; tex-mode.el - plain-tex-mode latex-mode;; cmutex.el - )) - (if (re-search-backward - "\\\\\\(sub\\)*\\(section\\|paragraph\\|chapter\\)" nil t) - (progn - (goto-char (match-beginning 0)) - (buffer-substring (1+ (point));; without initial backslash - (progn - (end-of-line) - (point)))))) - ((eq major-mode 'texinfo-mode) - (if (re-search-backward "^@node[ \t]+\\([^,\n]+\\)" nil t) - (buffer-substring (match-beginning 1) - (match-end 1)))) - ((eq major-mode 'perl-mode) - (if (re-search-backward "^sub[ \t]+\\([^ \t\n]+\\)" nil t) - (buffer-substring (match-beginning 1) - (match-end 1)))) - ((eq major-mode 'fortran-mode) - ;; must be inside function body for this to work - (beginning-of-fortran-subprogram) - (let ((case-fold-search t)) ; case-insensitive - ;; search for fortran subprogram start - (if (re-search-forward - "^[ \t]*\\(program\\|subroutine\\|function\ -\\|[ \ta-z0-9*]*[ \t]+function\\)" - nil t) - (progn - ;; move to EOL or before first left paren - (if (re-search-forward "[(\n]" nil t) - (progn (forward-char -1) - (skip-chars-backward " \t")) - (end-of-line)) - ;; Use the name preceding that. - (buffer-substring (point) - (progn (forward-sexp -1) - (point))))))) - (t - ;; If all else fails, try heuristics - (let (case-fold-search) - (end-of-line) - (if (re-search-backward add-log-current-defun-header-regexp - (- (point) 10000) - t) - (buffer-substring (match-beginning 1) - (match-end 1)))))))) - (error nil))) - -(defvar get-method-definition-md) - -;; Subroutine used within get-method-definition. -;; Add the last match in the buffer to the end of `md', -;; followed by the string END; move to the end of that match. -(defun get-method-definition-1 (end) - (setq get-method-definition-md - (concat get-method-definition-md - (buffer-substring (match-beginning 1) (match-end 1)) - end)) - (goto-char (match-end 0))) - -;; For objective C, return the method name if we are in a method. -(defun get-method-definition () - (let ((get-method-definition-md "[")) - (save-excursion - (if (re-search-backward "^@implementation\\s-*\\([A-Za-z_]*\\)" nil t) - (get-method-definition-1 " "))) - (save-excursion - (cond - ((re-search-forward "^\\([-+]\\)[ \t\n\f\r]*\\(([^)]*)\\)?\\s-*" nil t) - (get-method-definition-1 "") - (while (not (looking-at "[{;]")) - (looking-at - "\\([A-Za-z_]*:?\\)\\s-*\\(([^)]*)\\)?[A-Za-z_]*[ \t\n\f\r]*") - (get-method-definition-1 "")) - (concat get-method-definition-md "]")))))) - - -(provide 'add-log) - -;;; add-log.el ends here diff --git a/contrib/binutils/etc/add-log.vi b/contrib/binutils/etc/add-log.vi deleted file mode 100644 index efb8c77aa2b8..000000000000 --- a/contrib/binutils/etc/add-log.vi +++ /dev/null @@ -1,11 +0,0 @@ -Here is a vi macro to create entries in the recommended format for -GDB's ChangeLogs. - -map 1GO:r !date '+\%Y-\%m-\%d'2GA Jason Molenda (:r !whoamikJxA@:r !hostnameA)kJxkddjO
*
k$ - -It contains control and escape sequences, so don't just cut and paste it. -You'll need to change the "Jason Molenda" bit, of course. :-) Put this -in your $HOME/.exrc and when you type control-X in move-around-mode, -you'll have a changelog template inserted. - ---- Jason Molenda diff --git a/contrib/binutils/etc/cfg-paper.texi b/contrib/binutils/etc/cfg-paper.texi deleted file mode 100644 index bcfbb31e13f8..000000000000 --- a/contrib/binutils/etc/cfg-paper.texi +++ /dev/null @@ -1,717 +0,0 @@ -\input texinfo -@c %**start of header -@setfilename cfg-paper.info -@settitle On Configuring Development Tools -@c %**end of header -@setchapternewpage off - -@ifinfo -This document attempts to describe the general concepts behind -configuration of the @sc{gnu} Development Tools. -It also discusses common usage. - -Copyright (C) 1991, 1992, 1994 Cygnus Support -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by Cygnus Support. -@end ifinfo - -@titlepage -@sp 10 -@title{On Configuring Development Tools} -@author{K. Richard Pixley, @code{rich@@cygnus.com}} -@author{Cygnus Support} -@page - -@vskip 0pt plus 1filll -Copyright @copyright{} 1991, 1992, 1994 Cygnus Support - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by Cygnus Support. -@end titlepage - -@ifinfo -@format -START-INFO-DIR-ENTRY -* configuration: (cfg-paper). Some theory on configuring source. -END-INFO-DIR-ENTRY -@end format -@end ifinfo - -@node top, Some Basic Terms, (dir), (dir) - -@ifinfo -This document attempts to describe the general concepts behind -configuration of the @sc{gnu} Development Tools. -It also discusses common usage. -@end ifinfo - -@menu -* Some Basic Terms:: Some Basic Terms -* Specifics.:: Specifics -* Building Development Environments:: Building Development Environments -* A Walk Through:: A Walk Through -* Final Notes:: Final Notes -* Index:: Index - - --- The Detailed Node Listing --- - -Some Basic Terms - -* Host Environments:: Host Environments -* Configuration Time Options:: Configuration Time Options - -A Walk Through - -* Native Development Environments:: Native Development Environments -* Emulation Environments:: Emulation Environments -* Simple Cross Environments:: Simple Cross Environments -* Crossing Into Targets:: Crossing Into Targets -* Canadian Cross:: Canadian Cross - -Final Notes - -* Hacking Configurations:: Hacking Configurations -@end menu - -@node Some Basic Terms, Specifics., top, top -@chapter Some Basic Terms - -There are a lot of terms that are frequently used when discussing -development tools. Most of the common terms have been used for many -different concepts such that their meanings have become ambiguous to the -point of being confusing. Typically, we only guess at their meanings -from context and we frequently guess wrong. - -This document uses very few terms by comparison. The intent is to make -the concepts as clear as possible in order to convey the usage and -intent of these tools. - -@emph{Programs} run on @emph{machines}. Programs are very nearly always -written in @emph{source}. Programs are @emph{built} from source. -@emph{Compilation} is a process that is frequently, but not always, used -when building programs. -@cindex Programs -@cindex Machines -@cindex Source -@cindex Building -@cindex Compilation - -@menu -* Host Environments:: Host Environments -* Configuration Time Options:: Configuration Time Options -@end menu - -@node Host Environments, Configuration Time Options, Some Basic Terms, Some Basic Terms -@section Host Environments - -@cindex host -In this document, the word @emph{host} refers to the environment in -which the source in question will be compiled. @emph{host} and -@emph{host name} have nothing to do with the proper name of your host, -like @emph{ucbvax}, @emph{prep.ai.mit.edu} or @emph{att.com}. Instead -they refer to things like @emph{sun4} and @emph{dec3100}. - -Forget for a moment that this particular directory of source is the -source for a development environment. Instead, pretend that it is the -source for a simpler, more mundane, application, say, a desk calculator. - -Source that can be compiled in more than one environment, generally -needs to be set up for each environment explicitly. Here we refer to -that process as configuration. That is, we configure the source for a -host. - -For example, if we wanted to configure our mythical desk calculator to -compile on a SparcStation, we might configure for host sun4. With our -configuration system: - -@example -cd desk-calculator ; ./configure sun4 -@end example - -@noindent -does the trick. @code{configure} is a shell script that sets up Makefiles, -subdirectories, and symbolic links appropriate for compiling the source -on a sun4. - -The @emph{host} environment does not necessarily refer to the machine on -which the tools are built. It is possible to provide a sun3 development -environment on a sun4. If we wanted to use a cross compiler on the sun4 -to build a program intended to be run on a sun3, we would configure the -source for sun3. - -@example -cd desk-calculator ; ./configure sun3 -@end example - -@noindent -The fact that we are actually building the program on a sun4 makes no -difference if the sun3 cross compiler presents an environment that looks -like a sun3 from the point of view of the desk calculator source code. -Specifically, the environment is a sun3 environment if the header files, -predefined symbols, and libraries appear as they do on a sun3. - -Nor does the host environment refer to the the machine on which the -program to be built will run. It is possible to provide a sun3 -emulation environment on a sun4 such that programs built in a sun3 -development environment actually run on the sun4. This technique is -often used within individual programs to remedy deficiencies in the host -operating system. For example, some operating systems do not provide -the @code{bcopy} function and so it is emulated using the -@code{memcpy} funtion. - -Host environment simply refers to the environment in which the program -will be built from the source. - - -@node Configuration Time Options, , Host Environments, Some Basic Terms -@section Configuration Time Options - -Many programs have compile time options. That is, features of the -program that are either compiled into the program or not based on a -choice made by the person who builds the program. We refer to these as -@emph{configuration options}. For example, our desk calculator might be -capable of being compiled into a program that either uses infix notation -or postfix as a configuration option. For a sun3, to choose infix you -might use: - -@example -./configure sun3 --enable-notation=infix -@end example - -@noindent -while for a sun4 with postfix you might use: - -@example -./configure sun4 --enable-notation=postfix -@end example - -If we wanted to build both at the same time, the intermediate pieces -used in the build process must be kept separate. - -@example -mkdir ../objdir.sun4 -(cd ../objdir.sun4 ; ../configure sun4 --enable-notation=postfix --srcdir=../src) -mkdir ../objdir.sun3 -(cd ../objdir.sun3 ; ../configure sun3 --enable-notation=infix --srcdir=../src) -@end example - -@noindent -will create subdirectories for the intermediate pieces of the sun4 and -sun3 configurations. This is necessary as previous systems were only -capable of one configuration at a time. Otherwise, a second -configuration would write over the first. We've chosen to retain this -behaviour so the obj directories and the @code{--srcdir} configuration -option are necessary to get the new behaviour. The order of the -arguments doesn't matter. There should be exactly one argument without -a leading @samp{-} and that argument will be assumed to be the host -name. - -From here on the examples will assume that you want to build the tools -@emph{in place} and won't show the @code{--srcdir} option, but remember -that it is available. - -In order to actually install the program, the configuration system needs -to know where you would like the program installed. The default -location is @file{/usr/local}. We refer to this location as -@code{$(prefix)}. All user visible programs will be installed in -@file{@code{$(prefix)}/bin}. All other programs and files will be -installed in a subdirectory of @file{@code{$(prefix)}/lib}. - -You can only change @code{$(prefix)} as a configuration time -option. - -@example -./configure sun4 --enable-notation=postfix --prefix=/local -@end example - -@noindent -Will configure the source such that: - -@example -make install -@end example - -@noindent -will put its programs in @file{/local/bin} and @file{/local/lib/gcc}. -If you change @code{$(prefix)} after building the source, you will need -to: - -@example -make clean -@end example - -@noindent -before the change will be propogated properly. This is because some -tools need to know the locations of other tools. - -With these concepts in mind, we can drop the desk calculator example and -move on to the application that resides in these directories, namely, -the source to a development environment. - -@node Specifics., Building Development Environments, Some Basic Terms, top -@chapter Specifics - -The @sc{gnu} Development Tools can be built on a wide variety of hosts. So, -of course, they must be configured. Like the last example, - -@example -./configure sun4 --prefix=/local -./configure sun3 --prefix=/local -@end example - -@noindent -will configure the source to be built in subdirectories, in order to -keep the intermediate pieces separate, and to be installed in -@file{/local}. - -When built with suitable development environments, these will be native -tools. We'll explain the term @emph{native} later. - -@node Building Development Environments, A Walk Through, Specifics., top -@chapter Building Development Environments - -@cindex Target - -The @sc{gnu} development tools can not only be built in a -number of host development environments, they can also be configured to -create a number of different development environments on each of those -hosts. We refer to a specific development environment created as a -@emph{target}. That is, the word @emph{target} refers to the development -environment produced by compiling this source and installing the -resulting programs. - -For the @sc{gnu} development tools, the default target is the -same as the host. That is, the development environment produced is -intended to be compatible with the environment used to build the tools. - -In the example above, we created two configurations, one for sun4 and -one for sun3. The first configuration is expecting to be built in a -sun4 development environment, to create a sun4 development environment. -It doesn't necessarily need to be built on a sun4 if a sun4 development -environment is available elsewhere. Likewise, if the available sun4 -development environment produces executables intended for something -other than sun4, then the development environment built from this sun4 -configuration will run on something other than a sun4. From the point -of view of the configuration system and the @sc{gnu} development tools -source, this doesn't matter. What matters is that they will be built in -a sun4 environment. - -Similarly, the second configuration given above is expecting to be built -in a sun3 development environment, to create a sun3 development -environment. - -The development environment produced is a configuration time option, -just like @code{$(prefix)}. - -@example -./configure sun4 --prefix=/local --target=sun3 -./configure sun3 --prefix=/local --target=sun4 -@end example - -In this example, like before, we create two configurations. The first -is intended to be built in a sun4 environment, in subdirectories, to be -installed in @file{/local}. The second is intended to be built in a -sun3 environment, in subdirectories, to be installed in @file{/local}. - -Unlike the previous example, the first configuration will produce a sun3 -development environment, perhaps even suitable for building the second -configuration. Likewise, the second configuration will produce a sun4 -development environment, perhaps even suitable for building the first -configuration. - -The development environment used to build these configurations will -determine the machines on which the resulting development environments -can be used. - - -@node A Walk Through, Final Notes, Building Development Environments, top -@chapter A Walk Through - - -@menu -* Native Development Environments:: Native Development Environments -* Emulation Environments:: Emulation Environments -* Simple Cross Environments:: Simple Cross Environments -* Crossing Into Targets:: Crossing Into Targets -* Canadian Cross:: Canadian Cross -@end menu - -@node Native Development Environments, Emulation Environments, A Walk Through, A Walk Through -@section Native Development Environments - -Let us assume for a moment that you have a sun4 and that with your sun4 -you received a development environment. This development environment is -intended to be run on your sun4 to build programs that can be run on -your sun4. You could, for instance, run this development environment on -your sun4 to build our example desk calculator program. You could then -run the desk calculator program on your sun4. - -@cindex Native -@cindex Foreign -The resulting desk calculator program is referred to as a @emph{native} -program. The development environment itself is composed of native -programs that, when run, build other native programs. Any other program -is referred to as @emph{foreign}. Programs intended for other machines are -foreign programs. - -This type of development environment, which is by far the most common, -is refered to as @emph{native}. That is, a native development environment -runs on some machine to build programs for that same machine. The -process of using a native development environment to build native -programs is called a @emph{native} build. - -@example -./configure sun4 -@end example - -@noindent -will configure this source such that when built in a sun4 development -environment, with a development environment that builds programs -intended to be run on sun4 machines, the programs built will be native -programs and the resulting development environment will be a native -development environment. - -The development system that came with your sun4 is one such environment. -Using it to build the @sc{gnu} Development Tools is a very common activity -and the resulting development environment is quite popular. - -@example -make all -@end example - -@noindent -will build the tools as configured and will assume that you want to use -the native development environment that came with your machine. - -@cindex Bootstrapping -@cindex Stage1 -Using a development environment to build a development environment is -called @emph{bootstrapping}. The release of the @sc{gnu} -Development Tools is capable of bootstrapping itself. This is a very -powerful feature that we'll return to later. For now, let's pretend -that you used the native development environment that came with your -sun4 to bootstrap the release and let's call the new -development environment @emph{stage1}. - -Why bother? Well, most people find that the @sc{gnu} development -environment builds programs that run faster and take up less space than -the native development environments that came with their machines. Some -people didn't get development environments with their machines and some -people just like using the @sc{gnu} tools better than using other tools. - -@cindex Stage2 -While you're at it, if the @sc{gnu} tools produce better programs, maybe you -should use them to build the @sc{gnu} tools. So let's -pretend that you do. Let's call the new development environment -@emph{stage2}. - -@cindex Stage3 -So far you've built a development environment, stage1, and you've used -stage1 to build a new, faster and smaller development environment, -stage2, but you haven't run any of the programs that the @sc{gnu} tools have -built. You really don't yet know if these tools work. Do you have any -programs built with the @sc{gnu} tools? Yes, you do. stage2. What does -that program do? It builds programs. Ok, do you have any source handy -to build into a program? Yes, you do. The @sc{gnu} tools themselves. In -fact, if you use stage2 to build the @sc{gnu} tools again the resulting -programs should be identical to stage2. Let's pretend that you do and -call the new development environment @emph{stage3}. - -@cindex Three stage boot -You've just completed what's called a @emph{three stage boot}. You now have -a small, fast, somewhat tested, development environment. - -@example -make bootstrap -@end example - -@noindent -will do a three stage boot across all tools and will compare stage2 to -stage3 and complain if they are not identical. - -Once built, - -@example -make install -@end example - -@noindent -will install the development environment in the default location, or in -@code{$(prefix)} if you specified an alternate when you configured. - -@cindex Cross -Any development environment that is not a native development environment -is refered to as a @emph{cross} development environment. There are many -different types of cross development environments but most fall into one -of three basic categories. - - -@node Emulation Environments, Simple Cross Environments, Native Development Environments, A Walk Through -@section Emulation Environments - -@cindex Emulation -The first category of cross development environment is called -@emph{emulation}. There are two primary types of emulation, but both -types result in programs that run on the native host. - -@cindex Software emulation -@cindex Software emulator -The first type is @emph{software emulation}. This form of cross -development environment involves a native program that when run on the -native host, is capable of interpreting, and in most aspects running, a -program intended for some other machine. This technique is typically -used when the other machine is either too expensive, too slow, too fast, -or not available, perhaps because it hasn't yet been built. The native, -interpreting program is called a @emph{software emulator}. - -The @sc{gnu} Development Tools do not currently include any software -emulators. Some do exist and the @sc{gnu} Development Tools can be -configured to create simple cross development environments for with -these emulators. More on this later. - -The second type of emulation is when source intended for some other -development environment is built into a program intended for the native -host. The concepts of operating system universes and hosted operating -systems are two such development environments. - -@node Simple Cross Environments, Crossing Into Targets, Emulation Environments, A Walk Through -@section Simple Cross Environments - -@example -./configure sun4 --target=a29k -@end example - -@noindent -will configure the tools such that when compiled in a sun4 development -environment the resulting development environment can be used to create -programs intended for an a29k. Again, this does not necessarily mean -that the new development environment can be run on a sun4. That would -depend on the development environment used to build these tools. - -Earlier you saw how to configure the tools to build a native development -environment, that is, a development environment that runs on your sun4 -and builds programs for your sun4. Let's pretend that you use stage3 to -build this simple cross configuration and let's call the new development -environment gcc-a29k. Remember that this is a native build. Gcc-a29k -is a collection of native programs intended to run on your sun4. That's -what stage3 builds, programs for your sun4. Gcc-a29k represents an a29k -development environment that builds programs intended to run on an a29k. -But, remember, gcc-a29k runs on your sun4. Programs built with gcc-a29k -will run on your sun4 only with the help of an appropriate software -emulator. - -@cindex Simple cross -@cindex Crossing to -Building gcc-a29k is also a bootstrap but of a slightly different sort. -We call gcc-a29k a @emph{simple cross} environment and using gcc-a29k to -build a program intended for a29k is called @emph{crossing to} a29k. -Simple cross environments are the second category of cross development -environments. - - -@node Crossing Into Targets, Canadian Cross, Simple Cross Environments, A Walk Through -@section Crossing Into Targets - -@example -./configure a29k --target=a29k -@end example - -@noindent -will configure the tools such that when compiled in an a29k development -environment, the resulting development environment can be used to create -programs intended for an a29k. Again, this does not necessarily mean -that the new development environment can be run on an a29k. That would -depend on the development environment used to build these tools. - -If you've been following along this walk through, then you've already -built an a29k environment, namely gcc-a29k. Let's pretend you use -gcc-a29k to build the current configuration. - -Gcc-a29k builds programs intended for the a29k so the new development -environment will be intended for use on an a29k. That is, this new gcc -consists of programs that are foreign to your sun4. They cannot be run -on your sun4. - -@cindex Crossing into -The process of building this configuration is a another bootstrap. This -bootstrap is also a cross to a29k. Because this type of build is both a -bootstrap and a cross to a29k, it is sometimes referred to as a -@emph{cross into} a29k. This new development environment isn't really a -cross development environment at all. It is intended to run on an a29k -to produce programs for an a29k. You'll remember that this makes it, by -definition, an a29k native compiler. @emph{Crossing into} has been -introduced here not because it is a type of cross development -environment, but because it is frequently mistaken as one. The process -is @emph{a cross} but the resulting development environment is a native -development environment. - -You could not have built this configuration with stage3, because stage3 -doesn't provide an a29k environment. Instead it provides a sun4 -environment. - -If you happen to have an a29k lying around, you could now use this fresh -development environment on the a29k to three-stage these tools all over -again. This process would look just like it did when we built the -native sun4 development environment because we would be building another -native development environment, this one on a29k. - - -@node Canadian Cross, , Crossing Into Targets, A Walk Through -@section Canadian Cross - -So far you've seen that our development environment source must be -configured for a specific host and for a specific target. You've also -seen that the resulting development environment depends on the -development environment used in the build process. - -When all four match identically, that is, the configured host, the -configured target, the environment presented by the development -environment used in the build, and the machine on which the resulting -development environment is intended to run, then the new development -environment will be a native development environment. - -When all four match except the configured host, then we can assume that -the development environment used in the build is some form of library -emulation. - -When all four match except for the configured target, then the resulting -development environment will be a simple cross development environment. - -When all four match except for the host on which the development -environment used in the build runs, the build process is a @emph{cross into} -and the resulting development environment will be native to some other -machine. - -Most of the other permutations do exist in some form, but only one more -is interesting to the current discussion. - -@example -./configure a29k --target=sun3 -@end example - -@noindent -will configure the tools such that when compiled in an a29k development -environment, the resulting development environment can be used to create -programs intended for a sun3. Again, this does not necessarily mean -that the new development environment can be run on an a29k. That would -depend on the development environment used to build these tools. - -If you are still following along, then you have two a29k development -environments, the native development environment that runs on a29k, and -the simple cross that runs on your sun4. If you use the a29k native -development environment on the a29k, you will be doing the same thing we -did a while back, namely building a simple cross from a29k to sun3. -Let's pretend that instead, you use gcc-a29k, the simple cross -development environment that runs on sun4 but produces programs for -a29k. - -The resulting development environment will run on a29k because that's -what gcc-a29k builds, a29k programs. This development environment will -produce programs for a sun3 because that is how it was configured. This -means that the resulting development environment is a simple cross. - -@cindex Canadian Cross -@cindex Three party cross -There really isn't a common name for this process because very few -development environments are capable of being configured this -extensively. For the sake of discussion, let's call this process a -@emph{Canadian cross}. It's a three party cross, Canada has a three -party system, hence Canadian Cross. - -@node Final Notes, Index, A Walk Through, top -@chapter Final Notes - -By @emph{configures}, I mean that links, Makefile, .gdbinit, and -config.status are built. Configuration is always done from the source -directory. - -@table @code - -@item ./configure @var{name} -configures this directory, perhaps recursively, for a single host+target -pair where the host and target are both @var{name}. If a previous -configuration existed, it will be overwritten. - -@item ./configure @var{hostname} --target=@var{targetname} -configures this directory, perhaps recursively, for a single host+target -pair where the host is @var{hostname} and target is @var{targetname}. -If a previous configuration existed, it will be overwritten. - -@end table - -@menu -* Hacking Configurations:: Hacking Configurations -@end menu - -@node Hacking Configurations, , Final Notes, Final Notes -@section Hacking Configurations - -The configure scripts essentially do three things, create subdirectories -if appropriate, build a @file{Makefile}, and create links to files, all -based on and tailored to, a specific host+target pair. The scripts also -create a @file{.gdbinit} if appropriate but this is not tailored. - -The Makefile is created by prepending some variable definitions to a -Makefile template called @file{Makefile.in} and then inserting host and -target specific Makefile fragments. The variables are set based on the -chosen host+target pair and build style, that is, if you use -@code{--srcdir} or not. The host and target specific Makefile may or may -not exist. - -@itemize @bullet - -@item -Makefiles can be edited directly, but those changes will eventually be -lost. Changes intended to be permanent for a specific host should be -made to the host specific Makefile fragment. This should be in -@file{./config/mh-@var{host}} if it exists. Changes intended to be -permanent for a specific target should be made to the target specific -Makefile fragment. This should be in @file{./config/mt-@var{target}} if -it exists. Changes intended to be permanent for the directory should be -made in @file{Makefile.in}. To propogate changes to any of these, -either use @code{make Makefile} or @code{./config.status} or -re-configure. - -@end itemize - -@page -@node Index, , Final Notes, top -@appendix Index - -@printindex cp - -@contents -@bye - -@c Local Variables: -@c fill-column: 72 -@c End: diff --git a/contrib/binutils/etc/configbuild.ein b/contrib/binutils/etc/configbuild.ein deleted file mode 100644 index 7a0e214f2d52..000000000000 --- a/contrib/binutils/etc/configbuild.ein +++ /dev/null @@ -1,149 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: configbuild.fig -%%Creator: fig2dev Version 3.1 Patchlevel 1 -%%CreationDate: Fri Jun 12 20:13:16 1998 -%%For: ian@tito.cygnus.com (Ian Lance Taylor) -%%Orientation: Portrait -%%BoundingBox: 0 0 322 173 -%%Pages: 0 -%%BeginSetup -%%IncludeFeature: *PageSize Letter -%%EndSetup -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {} def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def - -end -save --62.0 226.0 translate -1 -1 scale - -/clp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/l {lineto} bind def -/m {moveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def -%%EndProlog - -$F2psBegin -10 setmiterlimit - 0.06000 0.06000 sc -7.500 slw -% Polyline -n 1050 900 m 2100 900 l 2100 1425 l 1050 1425 l clp gs col-1 s gr -% Polyline -n 1500 1425 m 1500 2100 l gs col-1 s gr -n 1530.00 1980.00 m 1500.00 2100.00 l 1470.00 1980.00 l 1500.50 1980.50 l 1530.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 1500 2625 m 1500 3300 l gs col-1 s gr -n 1530.00 3180.00 m 1500.00 3300.00 l 1470.00 3180.00 l 1500.50 3180.50 l 1530.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 2925 900 m 3825 900 l 3825 1425 l 2925 1425 l clp gs col-1 s gr -% Polyline -n 1155 2100 m 1050 2100 1050 2520 105 arcto 4 {pop} repeat 1050 2625 2220 2625 105 arcto 4 {pop} repeat 2325 2625 2325 2205 105 arcto 4 {pop} repeat 2325 2100 1155 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr -% Polyline -n 2850 2100 m 4125 2100 l 4125 2625 l 2850 2625 l clp gs col-1 s gr -% Polyline -n 3375 1425 m 3375 2100 l gs col-1 s gr -n 3405.00 1980.00 m 3375.00 2100.00 l 3345.00 1980.00 l 3375.50 1980.50 l 3405.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 5100 900 m 6300 900 l 6300 1350 l 5100 1350 l clp gs col-1 s gr -% Polyline -n 5625 1350 m 5625 2100 l gs col-1 s gr -n 5655.00 1980.00 m 5625.00 2100.00 l 5595.00 1980.00 l 5625.50 1980.50 l 5655.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 5205 2100 m 5100 2100 5100 2520 105 arcto 4 {pop} repeat 5100 2625 6270 2625 105 arcto 4 {pop} repeat 6375 2625 6375 2205 105 arcto 4 {pop} repeat 6375 2100 5205 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr -% Polyline -n 5625 2625 m 5625 3300 l gs col-1 s gr -n 5655.00 3180.00 m 5625.00 3300.00 l 5595.00 3180.00 l 5625.50 3180.50 l 5655.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 5100 3300 m 6225 3300 l 6225 3750 l 5100 3750 l clp gs col-1 s gr -% Polyline - [1 50.0] 50.000000 setdash -n 2850 2400 m 2325 2400 l gs col-1 s gr [] 0 setdash -n 2445.00 2430.00 m 2325.00 2400.00 l 2445.00 2370.00 l 2445.50 2400.50 l 2445.00 2430.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline - [1 50.0] 50.000000 setdash -n 4125 2400 m 5100 2400 l gs col-1 s gr [] 0 setdash -n 4980.00 2370.00 m 5100.00 2400.00 l 4980.00 2430.00 l 4980.50 2400.50 l 4980.00 2370.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 1050 3300 m 1950 3300 l 1950 3750 l 1050 3750 l clp gs col-1 s gr -/Times-Roman findfont 180.00 scalefont setfont -1200 1200 m -gs 1 -1 sc (config.in) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -3000 1200 m -gs 1 -1 sc (configure) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -3000 2400 m -gs 1 -1 sc (config.status) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -1200 2400 m -gs 1 -1 sc (config.status) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -1200 3600 m -gs 1 -1 sc (config.h) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -5250 1200 m -gs 1 -1 sc (Makefile.in) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -5250 2400 m -gs 1 -1 sc (config.status) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -5250 3600 m -gs 1 -1 sc (Makefile) col-1 show gr -$F2psEnd -restore diff --git a/contrib/binutils/etc/configbuild.fig b/contrib/binutils/etc/configbuild.fig deleted file mode 100644 index 747592d3d623..000000000000 --- a/contrib/binutils/etc/configbuild.fig +++ /dev/null @@ -1,50 +0,0 @@ -#FIG 3.1 -Portrait -Center -Inches -1200 2 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 1050 900 2100 900 2100 1425 1050 1425 1050 900 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 1500 1425 1500 2100 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 1500 2625 1500 3300 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 2925 900 3825 900 3825 1425 2925 1425 2925 900 -2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 - 2325 2625 2325 2100 1050 2100 1050 2625 2325 2625 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 2850 2100 4125 2100 4125 2625 2850 2625 2850 2100 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 3375 1425 3375 2100 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 5100 900 6300 900 6300 1350 5100 1350 5100 900 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5625 1350 5625 2100 -2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 - 6375 2625 6375 2100 5100 2100 5100 2625 6375 2625 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5625 2625 5625 3300 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 5100 3300 6225 3300 6225 3750 5100 3750 5100 3300 -2 1 2 1 -1 7 0 0 -1 3.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 2850 2400 2325 2400 -2 1 2 1 -1 7 0 0 -1 3.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 4125 2400 5100 2400 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 1050 3300 1950 3300 1950 3750 1050 3750 1050 3300 -4 0 -1 0 0 0 12 0.0000000 4 180 645 1200 1200 config.in\001 -4 0 -1 0 0 0 12 0.0000000 4 180 705 3000 1200 configure\001 -4 0 -1 0 0 0 12 0.0000000 4 180 990 3000 2400 config.status\001 -4 0 -1 0 0 0 12 0.0000000 4 180 990 1200 2400 config.status\001 -4 0 -1 0 0 0 12 0.0000000 4 180 600 1200 3600 config.h\001 -4 0 -1 0 0 0 12 0.0000000 4 135 855 5250 1200 Makefile.in\001 -4 0 -1 0 0 0 12 0.0000000 4 180 990 5250 2400 config.status\001 -4 0 -1 0 0 0 12 0.0000000 4 135 675 5250 3600 Makefile\001 diff --git a/contrib/binutils/etc/configbuild.jin b/contrib/binutils/etc/configbuild.jin Binary files differdeleted file mode 100644 index 44cd9397aa16..000000000000 --- a/contrib/binutils/etc/configbuild.jin +++ /dev/null diff --git a/contrib/binutils/etc/configbuild.tin b/contrib/binutils/etc/configbuild.tin deleted file mode 100644 index cfdd6fe07437..000000000000 --- a/contrib/binutils/etc/configbuild.tin +++ /dev/null @@ -1,9 +0,0 @@ - config.in *configure* Makefile.in - | | | - | v | - | config.status | - | | | - *config.status*<======+==========>*config.status* - | | - v v - config.h Makefile diff --git a/contrib/binutils/etc/configdev.ein b/contrib/binutils/etc/configdev.ein deleted file mode 100644 index 7f837850d695..000000000000 --- a/contrib/binutils/etc/configdev.ein +++ /dev/null @@ -1,185 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: configdev.fig -%%Creator: fig2dev Version 3.1 Patchlevel 1 -%%CreationDate: Mon Jun 15 17:35:19 1998 -%%For: ian@tito.cygnus.com (Ian Lance Taylor) -%%Orientation: Portrait -%%BoundingBox: 0 0 344 317 -%%Pages: 0 -%%BeginSetup -%%IncludeFeature: *PageSize Letter -%%EndSetup -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {} def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def - -end -save --62.0 370.0 translate -1 -1 scale - -/clp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/l {lineto} bind def -/m {moveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def -%%EndProlog - -$F2psBegin -10 setmiterlimit - 0.06000 0.06000 sc -7.500 slw -% Polyline -n 1050 900 m 2100 900 l 2100 1425 l 1050 1425 l clp gs col-1 s gr -% Polyline -n 2925 900 m 3975 900 l 3975 1425 l 2925 1425 l clp gs col-1 s gr -% Polyline -n 5550 900 m 6750 900 l 6750 1350 l 5550 1350 l clp gs col-1 s gr -% Polyline -n 3750 1800 m 5025 1800 l 5025 2250 l 3750 2250 l clp gs col-1 s gr -% Polyline -n 1155 2100 m 1050 2100 1050 2520 105 arcto 4 {pop} repeat 1050 2625 2070 2625 105 arcto 4 {pop} repeat 2175 2625 2175 2205 105 arcto 4 {pop} repeat 2175 2100 1155 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr -% Polyline -n 5550 3300 m 6675 3300 l 6675 3750 l 5550 3750 l clp gs col-1 s gr -% Polyline -n 5655 2100 m 5550 2100 5550 2520 105 arcto 4 {pop} repeat 5550 2625 6495 2625 105 arcto 4 {pop} repeat 6600 2625 6600 2205 105 arcto 4 {pop} repeat 6600 2100 5655 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr -% Polyline -n 3750 3600 m 4875 3600 l 4875 4050 l 3750 4050 l clp gs col-1 s gr -% Polyline -n 3855 2700 m 3750 2700 3750 3045 105 arcto 4 {pop} repeat 3750 3150 4545 3150 105 arcto 4 {pop} repeat 4650 3150 4650 2805 105 arcto 4 {pop} repeat 4650 2700 3855 2700 105 arcto 4 {pop} repeat clp gs col-1 s gr -% Polyline -n 2850 5700 m 3750 5700 l 3750 6150 l 2850 6150 l clp gs col-1 s gr -% Polyline -n 3030 4800 m 2925 4800 2925 5145 105 arcto 4 {pop} repeat 2925 5250 3645 5250 105 arcto 4 {pop} repeat 3750 5250 3750 4905 105 arcto 4 {pop} repeat 3750 4800 3030 4800 105 arcto 4 {pop} repeat clp gs col-1 s gr -% Polyline -n 1500 1425 m 1500 2100 l gs col-1 s gr -n 1530.00 1980.00 m 1500.00 2100.00 l 1470.00 1980.00 l 1500.50 1980.50 l 1530.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 3300 1425 m 3300 4800 l gs col-1 s gr -n 3330.00 4680.00 m 3300.00 4800.00 l 3270.00 4680.00 l 3300.50 4680.50 l 3330.00 4680.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 3300 1575 m 1875 1575 l 1875 2100 l gs col-1 s gr -n 1905.00 1980.00 m 1875.00 2100.00 l 1845.00 1980.00 l 1875.50 1980.50 l 1905.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 3300 1575 m 5700 1575 l 5700 2100 l gs col-1 s gr -n 5730.00 1980.00 m 5700.00 2100.00 l 5670.00 1980.00 l 5700.50 1980.50 l 5730.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 6225 1350 m 6225 2100 l gs col-1 s gr -n 6255.00 1980.00 m 6225.00 2100.00 l 6195.00 1980.00 l 6225.50 1980.50 l 6255.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 6075 2625 m 6075 3300 l gs col-1 s gr -n 6105.00 3180.00 m 6075.00 3300.00 l 6045.00 3180.00 l 6075.50 3180.50 l 6105.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 4200 2250 m 4200 2700 l gs col-1 s gr -n 4230.00 2580.00 m 4200.00 2700.00 l 4170.00 2580.00 l 4200.50 2580.50 l 4230.00 2580.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 4200 3150 m 4200 3600 l gs col-1 s gr -n 4230.00 3480.00 m 4200.00 3600.00 l 4170.00 3480.00 l 4200.50 3480.50 l 4230.00 3480.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 4200 4050 m 4200 4500 l 3675 4500 l 3675 4800 l gs col-1 s gr -n 3705.00 4680.00 m 3675.00 4800.00 l 3645.00 4680.00 l 3675.50 4680.50 l 3705.00 4680.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 3375 5250 m 3375 5700 l gs col-1 s gr -n 3405.00 5580.00 m 3375.00 5700.00 l 3345.00 5580.00 l 3375.50 5580.50 l 3405.00 5580.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 3300 2925 m 3750 2925 l gs col-1 s gr -n 3630.00 2895.00 m 3750.00 2925.00 l 3630.00 2955.00 l 3630.50 2925.50 l 3630.00 2895.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 1500 2625 m 1500 3300 l gs col-1 s gr -n 1530.00 3180.00 m 1500.00 3300.00 l 1470.00 3180.00 l 1500.50 3180.50 l 1530.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -% Polyline -n 1050 3300 m 2100 3300 l 2100 3750 l 1050 3750 l clp gs col-1 s gr -% Polyline -n 4875 3825 m 5250 3825 l 5250 2400 l 5550 2400 l gs col-1 s gr -n 5430.00 2370.00 m 5550.00 2400.00 l 5430.00 2430.00 l 5430.50 2400.50 l 5430.00 2370.00 l clp gs 0.00 setgray ef gr gs col-1 s gr -/Times-Roman findfont 180.00 scalefont setfont -1200 1200 m -gs 1 -1 sc (acconfig.h) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -3000 1200 m -gs 1 -1 sc (configure.in) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -5700 1200 m -gs 1 -1 sc (Makefile.am) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -3900 2100 m -gs 1 -1 sc (acinclude.m4) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -1200 2400 m -gs 1 -1 sc (autoheader) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -1200 3600 m -gs 1 -1 sc (config.in) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -5700 3600 m -gs 1 -1 sc (Makefile.in) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -5700 2400 m -gs 1 -1 sc (automake) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -3900 3900 m -gs 1 -1 sc (aclocal.m4) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -3900 3000 m -gs 1 -1 sc (aclocal) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -3000 6000 m -gs 1 -1 sc (configure) col-1 show gr -/Times-Roman findfont 180.00 scalefont setfont -3000 5100 m -gs 1 -1 sc (autoconf) col-1 show gr -$F2psEnd -restore diff --git a/contrib/binutils/etc/configdev.fig b/contrib/binutils/etc/configdev.fig deleted file mode 100644 index 4d386ec4ff7a..000000000000 --- a/contrib/binutils/etc/configdev.fig +++ /dev/null @@ -1,80 +0,0 @@ -#FIG 3.1 -Portrait -Center -Inches -1200 2 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 1050 900 2100 900 2100 1425 1050 1425 1050 900 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 2925 900 3975 900 3975 1425 2925 1425 2925 900 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 5550 900 6750 900 6750 1350 5550 1350 5550 900 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 3750 1800 5025 1800 5025 2250 3750 2250 3750 1800 -2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 - 2175 2625 2175 2100 1050 2100 1050 2625 2175 2625 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 5550 3300 6675 3300 6675 3750 5550 3750 5550 3300 -2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 - 6600 2625 6600 2100 5550 2100 5550 2625 6600 2625 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 3750 3600 4875 3600 4875 4050 3750 4050 3750 3600 -2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 - 4650 3150 4650 2700 3750 2700 3750 3150 4650 3150 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 2850 5700 3750 5700 3750 6150 2850 6150 2850 5700 -2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 - 3750 5250 3750 4800 2925 4800 2925 5250 3750 5250 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 1500 1425 1500 2100 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 3300 1425 3300 4800 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 - 1 1 1.00 60.00 120.00 - 3300 1575 1875 1575 1875 2100 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 - 1 1 1.00 60.00 120.00 - 3300 1575 5700 1575 5700 2100 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 6225 1350 6225 2100 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 6075 2625 6075 3300 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 4200 2250 4200 2700 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 4200 3150 4200 3600 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 4 - 1 1 1.00 60.00 120.00 - 4200 4050 4200 4500 3675 4500 3675 4800 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 3375 5250 3375 5700 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 3300 2925 3750 2925 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 1500 2625 1500 3300 -2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 1050 3300 2100 3300 2100 3750 1050 3750 1050 3300 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 4 - 1 1 1.00 60.00 120.00 - 4875 3825 5250 3825 5250 2400 5550 2400 -4 0 -1 0 0 0 12 0.0000000 4 180 780 1200 1200 acconfig.h\001 -4 0 -1 0 0 0 12 0.0000000 4 180 885 3000 1200 configure.in\001 -4 0 -1 0 0 0 12 0.0000000 4 135 945 5700 1200 Makefile.am\001 -4 0 -1 0 0 0 12 0.0000000 4 135 990 3900 2100 acinclude.m4\001 -4 0 -1 0 0 0 12 0.0000000 4 135 840 1200 2400 autoheader\001 -4 0 -1 0 0 0 12 0.0000000 4 180 645 1200 3600 config.in\001 -4 0 -1 0 0 0 12 0.0000000 4 135 855 5700 3600 Makefile.in\001 -4 0 -1 0 0 0 12 0.0000000 4 135 735 5700 2400 automake\001 -4 0 -1 0 0 0 12 0.0000000 4 135 810 3900 3900 aclocal.m4\001 -4 0 -1 0 0 0 12 0.0000000 4 135 540 3900 3000 aclocal\001 -4 0 -1 0 0 0 12 0.0000000 4 180 705 3000 6000 configure\001 -4 0 -1 0 0 0 12 0.0000000 4 135 660 3000 5100 autoconf\001 diff --git a/contrib/binutils/etc/configdev.jin b/contrib/binutils/etc/configdev.jin Binary files differdeleted file mode 100644 index 9b11a71acd7d..000000000000 --- a/contrib/binutils/etc/configdev.jin +++ /dev/null diff --git a/contrib/binutils/etc/configdev.tin b/contrib/binutils/etc/configdev.tin deleted file mode 100644 index c9b6f34f4d79..000000000000 --- a/contrib/binutils/etc/configdev.tin +++ /dev/null @@ -1,17 +0,0 @@ - acconfig.h configure.in Makefile.am - | | | - | --------------+---------------------- | - | | | | | - v v | acinclude.m4 | | - *autoheader* | | v v - | | v --->*automake* - v |--->*aclocal* | | - config.in | | | v - | v | Makefile.in - | aclocal.m4--- - | | - v v - *autoconf* - | - v - configure diff --git a/contrib/binutils/etc/configure b/contrib/binutils/etc/configure deleted file mode 100755 index 101fcefecfcc..000000000000 --- a/contrib/binutils/etc/configure +++ /dev/null @@ -1,862 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12.1 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12.1" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=Makefile.in - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -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" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# 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:555: 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 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set) 2>&1 | grep ac_space` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs - - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <<EOF -#! /bin/sh -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12.1" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS <<EOF - -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_DATA@%$INSTALL_DATA%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <<EOF - -CONFIG_FILES=\${CONFIG_FILES-"Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -EOF -cat >> $CONFIG_STATUS <<EOF - -EOF -cat >> $CONFIG_STATUS <<\EOF - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - diff --git a/contrib/binutils/etc/configure.in b/contrib/binutils/etc/configure.in deleted file mode 100644 index b785068009eb..000000000000 --- a/contrib/binutils/etc/configure.in +++ /dev/null @@ -1,7 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.5) -AC_INIT(Makefile.in) - -AC_PROG_INSTALL - -AC_OUTPUT(Makefile) diff --git a/contrib/binutils/etc/configure.man b/contrib/binutils/etc/configure.man deleted file mode 100644 index a7699041a711..000000000000 --- a/contrib/binutils/etc/configure.man +++ /dev/null @@ -1,166 +0,0 @@ -.\" -*- nroff -*- -.\" Copyright (c) 1991, 1992, 1996 Cygnus Support -.\" written by K. Richard Pixley -.TH configure 1 "29 March 1996" "cygnus support" "Cygnus Support" -.de BP -.sp -.ti \-.2i -\(** -.. - -.SH NAME -configure \- prepare source code to be built - -.SH SYNOPSIS -configure HOST [--target=TARGET] [--srcdir=DIR] [--rm] - [--site=SITE] [--prefix=DIR] [--exec_prefix=DIR] - [--program_prefix=DIR] [--tmpdir=DIR] - [--with-PACKAGE[=YES/NO]] [--without-PACKAGE] - [--enable-FEATURE[=YES/NO]] [--disable-FEATURE] - [--norecursion] [--nfp] [-s] [-v] [-V | --version] [--help] - -.SH DESCRIPTION -.I configure -is a program used to prepare souce code to be built. It does this by -generating Makefiles and .gdbinit files, creating symlinks, recursing -in subdirectories, and some other miscellaneous file editing. - -.SH OPTIONS -.I configure -accepts the following options: - -.TP -.I \--target=TARGET -Requests that the sources be configured to target the -.I TARGET -machine. If no target is specified explicitly, the target is assumed -to be the same as the host. - -.TP -.I \--srcdir=DIR -tells configure to find the source in -.I DIR. -Object code is always built in the current directory, -.I `.'. - -.TP -.I \--rm -asks configure to remove a configuration rather than create one. - -.TP -.I \--site=SITE -asks configure to use any site-specific Makefile fragments for -.I SITE -when building Makefiles. - -.TP -.I \--prefix=DIR -sets the location in which to install files to -.I DIR. -The default is "/usr/local". - -.TP -.I \--exec_prefix=DIR -sets the root directory for host-dependent files to -.I DIR. -The default location is the value of -.I prefix. - -.TP -.I \--program_prefix=DIR -configures the source to install programs which have the same names as -common Unix programs, such as "make", in -.I DIR. -Also applies to programs which might be used for cross-compilation. - -.TP -.I \--tmpdir=DIR -sets the directory in which configure creates temporary files to -.I DIR. - -.TP -.I \--with-PACKAGE[=YES/NO] -sets a flag for the build to recognize that -.I PACKAGE -is explicitly present or not present. If -.I \=YES/NO -is nonexistent, the default is -.I YES. -.I \--without-PACKAGE -is equivalent to -.IR \--with-PACKAGE=no . - -.TP -.I \--enable-FEATURE[=YES/NO] -sets a flag for the build to recognize that -.I FEATURE -should be included or not included. If -.I \=YES/NO -is nonexistent, the default is -.I YES. -.I \--disable-FEATURE -is equivalent to -.IR --enable-FEATURE=no . - -.TP -.I \--norecursion -asks that only the current directory be configured. Normally -.I configure -recurs on subdirectories. - -.TP -.I \-nfp -Notifies -.I configure -that all of the specified hosts have -.I no floating point -units. - -.TP -.I \-s -used internally by configure to supress status messages on -subdirectory recursions. Override with -.I \-v - -.TP -.I \-v -verbose output. Asks that configure print status lines for each -directory configured. Normally, only the status lines for the current -directory are printed. - -.TP -.I \--version -.I \-V -prints -.I configure -version number. - -.TP -.I \-help -displays a brief usage summary. - - -.SH FILES -configure.in for each directory's individual needs -.br -Makefile.in Makefile template -.br -config.sub for parsing configuration names -.br -config.guess for guessing HOST when not specified -.br -config.status non-recursively rebuilds current directory - -.SH FILES -.ta \w'gmon.sum 'u -a.out the namelist and text space. -.br -gmon.out dynamic call graph and profile. -.br -gmon.sum summarized dynamic call graph and profile. - -.SH "SEE ALSO" -.RB "`\|" configure "\|'" -entry in -.B -info. diff --git a/contrib/binutils/etc/configure.texi b/contrib/binutils/etc/configure.texi deleted file mode 100644 index 91401671f925..000000000000 --- a/contrib/binutils/etc/configure.texi +++ /dev/null @@ -1,2644 +0,0 @@ -\input texinfo -@c %**start of header -@setfilename configure.info -@settitle The GNU configure and build system -@setchapternewpage off -@c %**end of header - -@dircategory GNU admin -@direntry -* configure: (configure). The GNU configure and build system -@end direntry - -@ifinfo -This file documents the GNU configure and build system. - -Copyright (C) 1998 Cygnus Solutions. - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph - - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Foundation. -@end ifinfo - -@titlepage -@title The GNU configure and build system -@author Ian Lance Taylor - -@page -@vskip 0pt plus 1filll -Copyright @copyright{} 1998 Cygnus Solutions - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation -approved by the Free Software Foundation. -@end titlepage - -@ifinfo -@node Top -@top GNU configure and build system - -The GNU configure and build system. - -@menu -* Introduction:: Introduction. -* Getting Started:: Getting Started. -* Files:: Files. -* Configuration Names:: Configuration Names. -* Cross Compilation Tools:: Cross Compilation Tools. -* Canadian Cross:: Canadian Cross. -* Cygnus Configure:: Cygnus Configure. -* Multilibs:: Multilibs. -* FAQ:: Frequently Asked Questions. -* Index:: Index. -@end menu - -@end ifinfo - -@node Introduction -@chapter Introduction - -This document describes the GNU configure and build systems. It -describes how autoconf, automake, libtool, and make fit together. It -also includes a discussion of the older Cygnus configure system. - -This document does not describe in detail how to use each of the tools; -see the respective manuals for that. Instead, it describes which files -the developer must write, which files are machine generated and how they -are generated, and where certain common problems should be addressed. - -@ifnothtml -This document draws on several sources, including the autoconf manual by -David MacKenzie (@pxref{Top, , autoconf overview, autoconf, Autoconf}), -the automake manual by David MacKenzie and Tom Tromey (@pxref{Top, , -automake overview, automake, GNU Automake}), the libtool manual by -Gordon Matzigkeit (@pxref{Top, , libtool overview, libtool, GNU -libtool}), and the Cygnus configure manual by K. Richard Pixley. -@end ifnothtml -@ifhtml -This document draws on several sources, including -@uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_toc.html, the -autoconf manual} by David MacKenzie, -@uref{http://www.delorie.com/gnu/docs/automake/automake_toc.html, the -automake manual} by David MacKenzie and Tom Tromey, -@uref{http://www.delorie.com/gnu/docs/libtool/libtool_toc.html, the -libtool manual} by Gordon Matzigkeit, and the Cygnus configure manual by -K. Richard Pixley. -@end ifhtml - -@menu -* Goals:: Goals. -* Tools:: The tools. -* History:: History. -* Building:: Building. -@end menu - -@node Goals -@section Goals -@cindex goals - -The GNU configure and build system has two main goals. - -The first is to simplify the development of portable programs. The -system permits the developer to concentrate on writing the program, -simplifying many details of portability across Unix and even Windows -systems, and permitting the developer to describe how to build the -program using simple rules rather than complex Makefiles. - -The second is to simplify the building of programs distributed as source -code. All programs are built using a simple, standardized, two step -process. The program builder need not install any special tools in -order to build the program. - -@node Tools -@section Tools - -The GNU configure and build system is comprised of several different -tools. Program developers must build and install all of these tools. - -People who just want to build programs from distributed sources normally -do not need any special tools beyond a Unix shell, a make program, and a -C compiler. - -@table @asis -@item autoconf -provides a general portability framework, based on testing the features -of the host system at build time. -@item automake -a system for describing how to build a program, permitting the developer -to write a simplified @file{Makefile}. -@item libtool -a standardized approach to building shared libraries. -@item gettext -provides a framework for translation of text messages into other -languages; not really discussed in this document. -@item m4 -autoconf requires the GNU version of m4; the standard Unix m4 does not -suffice. -@item perl -automake requires perl. -@end table - -@node History -@section History -@cindex history - -This is a very brief and probably inaccurate history. - -As the number of Unix variants increased during the 1980s, it became -harder to write programs which could run on all variants. While it was -often possible to use @code{#ifdef} to identify particular systems, -developers frequently did not have access to every system, and the -characteristics of some systems changed from version to version. - -By 1992, at least three different approaches had been developed: -@itemize @bullet -@item -The Metaconfig program, by Larry Wall, Harlan Stenn, and Raphael -Manfredi. -@item -The Cygnus configure script, by K. Richard Pixley, and the gcc configure -script, by Richard Stallman. These use essentially the same approach, -and the developers communicated regularly. -@item -The autoconf program, by David MacKenzie. -@end itemize - -The Metaconfig program is still used for Perl and a few other programs. -It is part of the Dist package. I do not know if it is being developed. - -In 1994, David MacKenzie and others modified autoconf to incorporate all -the features of Cygnus configure. Since then, there has been a slow but -steady conversion of GNU programs from Cygnus configure to autoconf. gcc -has been converted, eliminating the gcc configure script. - -GNU autoconf was regularly maintained until late 1996. As of this -writing in June, 1998, it has no public maintainer. - -Most programs are built using the make program, which requires the -developer to write Makefiles describing how to build the programs. -Since most programs are built in pretty much the same way, this led to a -lot of duplication. - -The X Window system is built using the imake tool, which uses a database -of rules to eliminate the duplication. However, building a tool which -was developed using imake requires that the builder have imake -installed, violating one of the goals of the GNU system. - -The new BSD make provides a standard library of Makefile fragments, -which permits developers to write very simple Makefiles. However, this -requires that the builder install the new BSD make program. - -In 1994, David MacKenzie wrote the first version of automake, which -permitted writing a simple build description which was converted into a -Makefile which could be used by the standard make program. In 1995, Tom -Tromey completely rewrote automake in Perl, and he continues to enhance -it. - -Various free packages built libraries, and by around 1995 several -included support to build shared libraries on various platforms. -However, there was no consistent approach. In early 1996, Gordon -Matzigkeit began working on libtool, which provided a standardized -approach to building shared libraries. This was integrated into -automake from the start. - -The development of automake and libtool was driven by the GNITS project, -a group of GNU maintainers who designed standardized tools to help meet -the GNU coding standards. - -@node Building -@section Building - -Most readers of this document should already know how to build a tool by -running @samp{configure} and @samp{make}. This section may serve as a -quick introduction or reminder. - -Building a tool is normally as simple as running @samp{configure} -followed by @samp{make}. You should normally run @samp{configure} from -an empty directory, using some path to refer to the @samp{configure} -script in the source directory. The directory in which you run -@samp{configure} is called the @dfn{object directory}. - -In order to use a object directory which is different from the source -directory, you must be using the GNU version of @samp{make}, which has -the required @samp{VPATH} support. Despite this restriction, using a -different object directory is highly recommended: -@itemize @bullet -@item -It keeps the files generated during the build from cluttering up your -sources. -@item -It permits you to remove the built files by simply removing the entire -build directory. -@item -It permits you to build from the same sources with several sets of -configure options simultaneously. -@end itemize - -If you don't have GNU @samp{make}, you will have to run @samp{configure} -in the source directory. All GNU packages should support this; in -particular, GNU packages should not assume the presence of GNU -@samp{make}. - -After running @samp{configure}, you can build the tools by running -@samp{make}. - -To install the tools, run @samp{make install}. Installing the tools -will copy the programs and any required support files to the -@dfn{installation directory}. The location of the installation -directory is controlled by @samp{configure} options, as described below. - -In the Cygnus tree at present, the info files are built and installed as -a separate step. To build them, run @samp{make info}. To install them, -run @samp{make install-info}. - -All @samp{configure} scripts support a wide variety of options. The -most interesting ones are @samp{--with} and @samp{--enable} options -which are generally specific to particular tools. You can usually use -the @samp{--help} option to get a list of interesting options for a -particular configure script. - -The only generic options you are likely to use are the @samp{--prefix} -and @samp{--exec-prefix} options. These options are used to specify the -installation directory. - -The directory named by the @samp{--prefix} option will hold machine -independent files such as info files. - -The directory named by the @samp{--exec-prefix} option, which is -normally a subdirectory of the @samp{--prefix} directory, will hold -machine dependent files such as executables. - -The default for @samp{--prefix} is @file{/usr/local}. The default for -@samp{--exec-prefix} is the value used for @samp{--prefix}. - -The convention used in Cygnus releases is to use a @samp{--prefix} -option of @file{/usr/cygnus/@var{release}}, where @var{release} is the -name of the release, and to use a @samp{--exec-prefix} option of -@file{/usr/cygnus/@var{release}/H-@var{host}}, where @var{host} is the -configuration name of the host system (@pxref{Configuration Names}). - -Do not use either the source or the object directory as the installation -directory. That will just lead to confusion. - -@node Getting Started -@chapter Getting Started - -To start using the GNU configure and build system with your software -package, you must write three files, and you must run some tools to -manually generate additional files. - -@menu -* Write configure.in:: Write configure.in. -* Write Makefile.am:: Write Makefile.am. -* Write acconfig.h:: Write acconfig.h. -* Generate files:: Generate files. -* Getting Started Example:: Example. -@end menu - -@node Write configure.in -@section Write configure.in -@cindex @file{configure.in}, writing - -You must first write the file @file{configure.in}. This is an autoconf -input file, and the autoconf manual describes in detail what this file -should look like. - -You will write tests in your @file{configure.in} file to check for -conditions that may change from one system to another, such as the -presence of particular header files or functions. - -For example, not all systems support the @samp{gettimeofday} function. -If you want to use the @samp{gettimeofday} function when it is -available, and to use some other function when it is not, you would -check for this by putting @samp{AC_CHECK_FUNCS(gettimeofday)} in -@file{configure.in}. - -When the configure script is run at build time, this will arrange to -define the preprocessor macro @samp{HAVE_GETTIMEOFDAY} to the value 1 if -the @samp{gettimeofday} function is available, and to not define the -macro at all if the function is not available. Your code can then use -@samp{#ifdef} to test whether it is safe to call @samp{gettimeofday}. - -If you have an existing body of code, the @samp{autoscan} program may -help identify potential portability problems, and hence configure tests -that you will want to use. -@ifnothtml -@xref{Invoking autoscan, , , autoconf, the autoconf manual}. -@end ifnothtml -@ifhtml -See @uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_4.html, the -autoscan documentation}. -@end ifhtml - -Another handy tool for an existing body of code is @samp{ifnames}. This -will show you all the preprocessor conditionals that the code already -uses. -@ifnothtml -@xref{Invoking ifnames, , , autoconf, the autoconf manual}. -@end ifnothtml -@ifhtml -See @uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_5.html, the -ifnames documentation}. -@end ifhtml - -Besides the portability tests which are specific to your particular -package, every @file{configure.in} file should contain the following -macros. - -@table @samp -@item AC_INIT -@cindex @samp{AC_INIT} -This macro takes a single argument, which is the name of a file in your -package. For example, @samp{AC_INIT(foo.c)}. - -@item AC_PREREQ(@var{VERSION}) -@cindex @samp{AC_PREREQ} -This macro is optional. It may be used to indicate the version of -@samp{autoconf} that you are using. This will prevent users from -running an earlier version of @samp{autoconf} and perhaps getting an -invalid @file{configure} script. For example, @samp{AC_PREREQ(2.12)}. - -@item AM_INIT_AUTOMAKE -@cindex @samp{AM_INIT_AUTOMAKE} -This macro takes two arguments: the name of the package, and a version -number. For example, @samp{AM_INIT_AUTOMAKE(foo, 1.0)}. (This macro is -not needed if you are not using automake). - -@item AM_CONFIG_HEADER -@cindex @samp{AM_CONFIG_HEADER} -This macro names the header file which will hold the preprocessor macro -definitions at run time. Normally this should be @file{config.h}. Your -sources would then use @samp{#include "config.h"} to include it. - -This macro may optionally name the input file for that header file; by -default, this is @file{config.h.in}, but that file name works poorly on -DOS filesystems. Therefore, it is often better to name it explicitly as -@file{config.in}. - -This is what you should normally put in @file{configure.in}: -@example -AM_CONFIG_HEADER(config.h:config.in) -@end example - -@cindex @samp{AC_CONFIG_HEADER} -(If you are not using automake, use @samp{AC_CONFIG_HEADER} rather than -@samp{AM_CONFIG_HEADER}). - -@item AM_MAINTAINER_MODE -@cindex @samp{AM_MAINTAINER_MODE} -This macro always appears in Cygnus configure scripts. Other programs -may or may not use it. - -If this macro is used, the @samp{--enable-maintainer-mode} option is -required to enable automatic rebuilding of generated files used by the -configure system. This of course requires that developers be aware of, -and use, that option. - -If this macro is not used, then the generated files will always be -rebuilt automatically. This will cause problems if the wrong versions -of autoconf, automake, or others are in the builder's @samp{PATH}. - -(If you are not using automake, you do not need to use this macro). - -@item AC_EXEEXT -@cindex @samp{AC_EXEEXT} -@cindex @samp{AM_EXEEXT} -Either this macro or @samp{AM_EXEEXT} always appears in Cygnus configure -files. Other programs may or may not use one of them. - -This macro looks for the executable suffix used on the host system. On -Unix systems, this is the empty string. On Windows systems, this is -@samp{.exe}. This macro directs automake to use the executable suffix -as appropriate when creating programs. This macro does not take any -arguments. - -The @samp{AC_EXEEXT} form is new, and is part of a Cygnus patch to -autoconf to support compiling with Visual C++. Older programs use -@samp{AM_EXEEXT} instead. - -(Programs which do not use automake use neither @samp{AC_EXEEXT} nor -@samp{AM_EXEEXT}). - -@item AC_PROG_CC -@cindex @samp{AC_PROG_CC} -If you are writing C code, you will normally want to use this macro. It -locates the C compiler to use. It does not take any arguments. - -However, if this @file{configure.in} file is for a library which is to -be compiled by a cross compiler which may not fully work, then you will -not want to use @samp{AC_PROG_CC}. Instead, you will want to use a -variant which does not call the macro @samp{AC_PROG_CC_WORKS}. Examples -can be found in various @file{configure.in} files for libraries that are -compiled with cross compilers, such as libiberty or libgloss. This is -essentially a bug in autoconf, and there will probably be a better -workaround at some point. - -@item AC_PROG_CXX -@cindex @samp{AC_PROG_CXX} -If you are writing C++ code, you will want to use this macro. It -locates the C++ compiler to use. It does not take any arguments. The -same cross compiler comments apply as for @samp{AC_PROG_CC}. - -@item AM_PROG_LIBTOOL -@cindex @samp{AM_PROG_LIBTOOL} -If you want to build libraries, and you want to permit them to be -shared, or you want to link against libraries which were built using -libtool, then you will need this macro. This macro is required in order -to use libtool. - -@cindex @samp{AM_DISABLE_SHARED} -By default, this will cause all libraries to be built as shared -libraries. To prevent this--to change the default--use -@samp{AM_DISABLE_SHARED} before @samp{AM_PROG_LIBTOOL}. The configure -options @samp{--enable-shared} and @samp{--disable-shared} may be used -to override the default at build time. - -@item AC_DEFINE(_GNU_SOURCE) -@cindex @samp{_GNU_SOURCE} -GNU packages should normally include this line before any other feature -tests. This defines the macro @samp{_GNU_SOURCE} when compiling, which -directs the libc header files to provide the standard GNU system -interfaces including all GNU extensions. If this macro is not defined, -certain GNU extensions may not be available. - -@item AC_OUTPUT -@cindex @samp{AC_OUTPUT} -This macro takes a list of file names which the configure process should -produce. This is normally a list of one or more @file{Makefile} files -in different directories. If your package lives entirely in a single -directory, you would use simply @samp{AC_OUTPUT(Makefile)}. If you also -have, for example, a @file{lib} subdirectory, you would use -@samp{AC_OUTPUT(Makefile lib/Makefile)}. -@end table - -If you want to use locally defined macros in your @file{configure.in} -file, then you will need to write a @file{acinclude.m4} file which -defines them (if not using automake, this file is called -@file{aclocal.m4}). Alternatively, you can put separate macros in an -@file{m4} subdirectory, and put @samp{ACLOCAL_AMFLAGS = -I m4} in your -@file{Makefile.am} file so that the @samp{aclocal} program will be able -to find them. - -The different macro prefixes indicate which tool defines the macro. -Macros which start with @samp{AC_} are part of autoconf. Macros which -start with @samp{AM_} are provided by automake or libtool. - -@node Write Makefile.am -@section Write Makefile.am -@cindex @file{Makefile.am}, writing - -You must write the file @file{Makefile.am}. This is an automake input -file, and the automake manual describes in detail what this file should -look like. - -The automake commands in @file{Makefile.am} mostly look like variable -assignments in a @file{Makefile}. automake recognizes special variable -names, and automatically add make rules to the output as needed. - -There will be one @file{Makefile.am} file for each directory in your -package. For each directory with subdirectories, the @file{Makefile.am} -file should contain the line -@smallexample -SUBDIRS = @var{dir} @var{dir} @dots{} -@end smallexample -@noindent -where each @var{dir} is the name of a subdirectory. - -For each @file{Makefile.am}, there should be a corresponding -@file{Makefile} in the @samp{AC_OUTPUT} macro in @file{configure.in}. - -Every @file{Makefile.am} written at Cygnus should contain the line -@smallexample -AUTOMAKE_OPTIONS = cygnus -@end smallexample -@noindent -This puts automake into Cygnus mode. See the automake manual for -details. - -You may to include the version number of @samp{automake} that you are -using on the @samp{AUTOMAKE_OPTIONS} line. For example, -@smallexample -AUTOMAKE_OPTIONS = cygnus 1.3 -@end smallexample -@noindent -This will prevent users from running an earlier version of -@samp{automake} and perhaps getting an invalid @file{Makefile.in}. - -If your package builds a program, then in the directory where that -program is built you will normally want a line like -@smallexample -bin_PROGRAMS = @var{program} -@end smallexample -@noindent -where @var{program} is the name of the program. You will then want a -line like -@smallexample -@var{program}_SOURCES = @var{file} @var{file} @dots{} -@end smallexample -@noindent -where each @var{file} is the name of a source file to link into the -program (e.g., @samp{foo.c}). - -If your package builds a library, and you do not want the library to -ever be built as a shared library, then in the directory where that -library is built you will normally want a line like -@smallexample -lib_LIBRARIES = lib@var{name}.a -@end smallexample -@noindent -where @samp{lib@var{name}.a} is the name of the library. You will then -want a line like -@smallexample -lib@var{name}_a_SOURCES = @var{file} @var{file} @dots{} -@end smallexample -@noindent -where each @var{file} is the name of a source file to add to the -library. - -If your package builds a library, and you want to permit building the -library as a shared library, then in the directory where that library is -built you will normally want a line like -@smallexample -lib_LTLIBRARIES = lib@var{name}.la -@end smallexample -The use of @samp{LTLIBRARIES}, and the @samp{.la} extension, indicate a -library to be built using libtool. As usual, you will then want a line -like -@smallexample -lib@var{name}_la_SOURCES = @var{file} @var{file} @dots{} -@end smallexample - -The strings @samp{bin} and @samp{lib} that appear above in -@samp{bin_PROGRAMS} and @samp{lib_LIBRARIES} are not arbitrary. They -refer to particular directories, which may be set by the @samp{--bindir} -and @samp{--libdir} options to @file{configure}. If those options are -not used, the default values are based on the @samp{--prefix} or -@samp{--exec-prefix} options to @file{configure}. It is possible to use -other names if the program or library should be installed in some other -directory. - -The @file{Makefile.am} file may also contain almost anything that may -appear in a normal @file{Makefile}. automake also supports many other -special variables, as well as conditionals. - -See the automake manual for more information. - -@node Write acconfig.h -@section Write acconfig.h -@cindex @file{acconfig.h}, writing - -If you are generating a portability header file, (i.e., you are using -@samp{AM_CONFIG_HEADER} in @file{configure.in}), then you will have to -write a @file{acconfig.h} file. It will have to contain the following -lines. - -@smallexample -/* Name of package. */ -#undef PACKAGE - -/* Version of package. */ -#undef VERSION -@end smallexample - -This requirement is really a bug in the system, and the requirement may -be eliminated at some later date. - -The @file{acconfig.h} file will also similar comment and @samp{#undef} -lines for any unusual macros in the @file{configure.in} file, including -any macro which appears in a @samp{AC_DEFINE} macro. - -In particular, if you are writing a GNU package and therefore include -@samp{AC_DEFINE(_GNU_SOURCE)} in @file{configure.in} as suggested above, -you will need lines like this in @file{acconfig.h}: -@smallexample -/* Enable GNU extensions. */ -#undef _GNU_SOURCE -@end smallexample - -Normally the @samp{autoheader} program will inform you of any such -requirements by printing an error message when it is run. However, if -you do anything particular odd in your @file{configure.in} file, you -will have to make sure that the right entries appear in -@file{acconfig.h}, since otherwise the results of the tests may not be -available in the @file{config.h} file which your code will use. - -(Thee @samp{PACKAGE} and @samp{VERSION} lines are not required if you -are not using automake, and in that case you may not need a -@file{acconfig.h} file at all). - -@node Generate files -@section Generate files - -Once you have written @file{configure.in}, @file{Makefile.am}, -@file{acconfig.h}, and possibly @file{acinclude.m4}, you must use -autoconf and automake programs to produce the first versions of the -generated files. This is done by executing the following sequence of -commands. - -@smallexample -aclocal -autoconf -autoheader -automake -@end smallexample - -The @samp{aclocal} and @samp{automake} commands are part of the automake -package, and the @samp{autoconf} and @samp{autoheader} commands are part -of the autoconf package. - -If you are using a @file{m4} subdirectory for your macros, you will need -to use the @samp{-I m4} option when you run @samp{aclocal}. - -If you are not using the Cygnus tree, use the @samp{-a} option when -running @samp{automake} command in order to copy the required support -files into your source directory. - -If you are using libtool, you must build and install the libtool package -with the same @samp{--prefix} and @samp{--exec-prefix} options as you -used with the autoconf and automake packages. You must do this before -running any of the above commands. If you are not using the Cygnus -tree, you will need to run the @samp{libtoolize} program to copy the -libtool support files into your directory. - -Once you have managed to run these commands without getting any errors, -you should create a new empty directory, and run the @samp{configure} -script which will have been created by @samp{autoconf} with the -@samp{--enable-maintainer-mode} option. This will give you a set of -Makefiles which will include rules to automatically rebuild all the -generated files. - -After doing that, whenever you have changed some of the input files and -want to regenerated the other files, go to your object directory and run -@samp{make}. Doing this is more reliable than trying to rebuild the -files manually, because there are complex order dependencies and it is -easy to forget something. - -@node Getting Started Example -@section Example - -Let's consider a trivial example. - -Suppose we want to write a simple version of @samp{touch}. Our program, -which we will call @samp{poke}, will take a single file name argument, -and use the @samp{utime} system call to set the modification and access -times of the file to the current time. We want this program to be -highly portable. - -We'll first see what this looks like without using autoconf and -automake, and then see what it looks like with them. - -@menu -* Getting Started Example 1:: First Try. -* Getting Started Example 2:: Second Try. -* Getting Started Example 3:: Third Try. -* Generate Files in Example:: Generate Files. -@end menu - -@node Getting Started Example 1 -@subsection First Try - -Here is our first try at @samp{poke.c}. Note that we've written it -without ANSI/ISO C prototypes, since we want it to be highly portable. - -@example -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <utime.h> - -int -main (argc, argv) - int argc; - char **argv; -@{ - if (argc != 2) - @{ - fprintf (stderr, "Usage: poke file\n"); - exit (1); - @} - - if (utime (argv[1], NULL) < 0) - @{ - perror ("utime"); - exit (1); - @} - - exit (0); -@} -@end example - -We also write a simple @file{Makefile}. - -@example -CC = gcc -CFLAGS = -g -O2 - -all: poke - -poke: poke.o - $(CC) -o poke $(CFLAGS) $(LDFLAGS) poke.o -@end example - -So far, so good. - -Unfortunately, there are a few problems. - -On older Unix systems derived from BSD 4.3, the @samp{utime} system call -does not accept a second argument of @samp{NULL}. On those systems, we -need to pass a pointer to @samp{struct utimbuf} structure. -Unfortunately, even older systems don't define that structure; on those -systems, we need to pass an array of two @samp{long} values. - -The header file @file{stdlib.h} was invented by ANSI C, and older -systems don't have a copy. We included it above to get a declaration of -@samp{exit}. - -We can find some of these portability problems by running -@samp{autoscan}, which will create a @file{configure.scan} file which we -can use as a prototype for our @file{configure.in} file. I won't show -the output, but it will notice the potential problems with @samp{utime} -and @file{stdlib.h}. - -In our @file{Makefile}, we don't provide any way to install the program. -This doesn't matter much for such a simple example, but a real program -will need an @samp{install} target. For that matter, we will also want -a @samp{clean} target. - -@node Getting Started Example 2 -@subsection Second Try - -Here is our second try at this program. - -We modify @file{poke.c} to use preprocessor macros to control what -features are available. (I've cheated a bit by using the same macro -names which autoconf will use). - -@example -#include <stdio.h> - -#ifdef STDC_HEADERS -#include <stdlib.h> -#endif - -#include <sys/types.h> - -#ifdef HAVE_UTIME_H -#include <utime.h> -#endif - -#ifndef HAVE_UTIME_NULL - -#include <time.h> - -#ifndef HAVE_STRUCT_UTIMBUF - -struct utimbuf -@{ - long actime; - long modtime; -@}; - -#endif - -static int -utime_now (file) - char *file; -@{ - struct utimbuf now; - - now.actime = now.modtime = time (NULL); - return utime (file, &now); -@} - -#define utime(f, p) utime_now (f) - -#endif /* HAVE_UTIME_NULL */ - -int -main (argc, argv) - int argc; - char **argv; -@{ - if (argc != 2) - @{ - fprintf (stderr, "Usage: poke file\n"); - exit (1); - @} - - if (utime (argv[1], NULL) < 0) - @{ - perror ("utime"); - exit (1); - @} - - exit (0); -@} -@end example - -Here is the associated @file{Makefile}. We've added support for the -preprocessor flags we use. We've also added @samp{install} and -@samp{clean} targets. - -@example -# Set this to your installation directory. -bindir = /usr/local/bin - -# Uncomment this if you have the standard ANSI/ISO C header files. -# STDC_HDRS = -DSTDC_HEADERS - -# Uncomment this if you have utime.h. -# UTIME_H = -DHAVE_UTIME_H - -# Uncomment this if utime (FILE, NULL) works on your system. -# UTIME_NULL = -DHAVE_UTIME_NULL - -# Uncomment this if struct utimbuf is defined in utime.h. -# UTIMBUF = -DHAVE_STRUCT_UTIMBUF - -CC = gcc -CFLAGS = -g -O2 - -ALL_CFLAGS = $(STDC_HDRS) $(UTIME_H) $(UTIME_NULL) $(UTIMBUF) $(CFLAGS) - -all: poke - -poke: poke.o - $(CC) -o poke $(ALL_CFLAGS) $(LDFLAGS) poke.o - -.c.o: - $(CC) -c $(ALL_CFLAGS) poke.c - -install: poke - cp poke $(bindir)/poke - -clean: - rm poke poke.o -@end example - -Some problems with this approach should be clear. - -Users who want to compile poke will have to know how @samp{utime} works -on their systems, so that they can uncomment the @file{Makefile} -correctly. - -The installation is done using @samp{cp}, but many systems have an -@samp{install} program which may be used, and which supports optional -features such as stripping debugging information out of the installed -binary. - -The use of @file{Makefile} variables like @samp{CC}, @samp{CFLAGS} and -@samp{LDFLAGS} follows the requirements of the GNU standards. This is -convenient for all packages, since it reduces surprises for users. -However, it is easy to get the details wrong, and wind up with a -slightly nonstandard distribution. - -@node Getting Started Example 3 -@subsection Third Try - -For our third try at this program, we will write a @file{configure.in} -script to discover the configuration features on the host system, rather -than requiring the user to edit the @file{Makefile}. We will also write -a @file{Makefile.am} rather than a @file{Makefile}. - -The only change to @file{poke.c} is to add a line at the start of the -file: -@smallexample -#include "config.h" -@end smallexample - -The new @file{configure.in} file is as follows. - -@example -AC_INIT(poke.c) -AM_INIT_AUTOMAKE(poke, 1.0) -AM_CONFIG_HEADER(config.h:config.in) -AC_PROG_CC -AC_HEADER_STDC -AC_CHECK_HEADERS(utime.h) -AC_EGREP_HEADER(utimbuf, utime.h, AC_DEFINE(HAVE_STRUCT_UTIMBUF)) -AC_FUNC_UTIME_NULL -AC_OUTPUT(Makefile) -@end example - -The first four macros in this file, and the last one, were described -above; see @ref{Write configure.in}. If we omit these macros, then when -we run @samp{automake} we will get a reminder that we need them. - -The other macros are standard autoconf macros. - -@table @samp -@item AC_HEADER_STDC -Check for standard C headers. -@item AC_CHECK_HEADERS -Check whether a particular header file exists. -@item AC_EGREP_HEADER -Check for a particular string in a particular header file, in this case -checking for @samp{utimbuf} in @file{utime.h}. -@item AC_FUNC_UTIME_NULL -Check whether @samp{utime} accepts a NULL second argument to set the -file change time to the current time. -@end table - -See the autoconf manual for a more complete description. - -The new @file{Makefile.am} file is as follows. Note how simple this is -compared to our earlier @file{Makefile}. - -@example -bin_PROGRAMS = poke - -poke_SOURCES = poke.c -@end example - -This means that we should build a single program name @samp{poke}. It -should be installed in the binary directory, which we called -@samp{bindir} earlier. The program @samp{poke} is built from the source -file @file{poke.c}. - -We must also write a @file{acconfig.h} file. Besides @samp{PACKAGE} and -@samp{VERSION}, which must be mentioned for all packages which use -automake, we must include @samp{HAVE_STRUCT_UTIMBUF}, since we mentioned -it in an @samp{AC_DEFINE}. - -@example -/* Name of package. */ -#undef PACKAGE - -/* Version of package. */ -#undef VERSION - -/* Whether utime.h defines struct utimbuf. */ -#undef HAVE_STRUCT_UTIMBUF -@end example - -@node Generate Files in Example -@subsection Generate Files - -We must now generate the other files, using the following commands. - -@smallexample -aclocal -autoconf -autoheader -automake -@end smallexample - -When we run @samp{autoheader}, it will remind us of any macros we forgot -to add to @file{acconfig.h}. - -When we run @samp{automake}, it will want to add some files to our -distribution. It will add them automatically if we use the -@samp{--add-missing} option. - -By default, @samp{automake} will run in GNU mode, which means that it -will want us to create certain additional files; as of this writing, it -will want @file{NEWS}, @file{README}, @file{AUTHORS}, and -@file{ChangeLog}, all of which are files which should appear in a -standard GNU distribution. We can either add those files, or run -@samp{automake} with the @samp{--foreign} option. - -Running these tools will generate the following files, all of which are -described in the next chapter. - -@itemize @bullet -@item -@file{aclocal.m4} -@item -@file{configure} -@item -@file{config.in} -@item -@file{Makefile.in} -@item -@file{stamp-h.in} -@end itemize - -@node Files -@chapter Files - -As was seen in the previous chapter, the GNU configure and build system -uses a number of different files. The developer must write a few files. -The others are generated by various tools. - -The system is rather flexible, and can be used in many different ways. -In describing the files that it uses, I will describe the common case, -and mention some other cases that may arise. - -@menu -* Developer Files:: Developer Files. -* Build Files:: Build Files. -* Support Files:: Support Files. -@end menu - -@node Developer Files -@section Developer Files - -This section describes the files written or generated by the developer -of a package. - -@menu -* Developer Files Picture:: Developer Files Picture. -* Written Developer Files:: Written Developer Files. -* Generated Developer Files:: Generated Developer Files. -@end menu - -@node Developer Files Picture -@subsection Developer Files Picture - -Here is a picture of the files which are written by the developer, the -generated files which would be included with a complete source -distribution, and the tools which create those files. -@ifinfo -The file names are plain text and the tool names are enclosed by -@samp{*} characters -@end ifinfo -@ifnotinfo -The file names are in rectangles with square corners and the tool names -are in rectangles with rounded corners -@end ifnotinfo -(e.g., @samp{autoheader} is the name of a tool, not the name of a file). - -@image{configdev} - -@node Written Developer Files -@subsection Written Developer Files - -The following files would be written by the developer. - -@table @file -@item configure.in -@cindex @file{configure.in} -This is the configuration script. This script contains invocations of -autoconf macros. It may also contain ordinary shell script code. This -file will contain feature tests for portability issues. The last thing -in the file will normally be an @samp{AC_OUTPUT} macro listing which -files to create when the builder runs the configure script. This file -is always required when using the GNU configure system. @xref{Write -configure.in}. - -@item Makefile.am -@cindex @file{Makefile.am} -This is the automake input file. It describes how the code should be -built. It consists of definitions of automake variables. It may also -contain ordinary Makefile targets. This file is only needed when using -automake (newer tools normally use automake, but there are still older -tools which have not been converted, in which the developer writes -@file{Makefile.in} directly). @xref{Write Makefile.am}. - -@item acconfig.h -@cindex @file{acconfig.h} -When the configure script creates a portability header file, by using -@samp{AM_CONFIG_HEADER} (or, if not using automake, -@samp{AC_CONFIG_HEADER}), this file is used to describe macros which are -not recognized by the @samp{autoheader} command. This is normally a -fairly uninteresting file, consisting of a collection of @samp{#undef} -lines with comments. Normally any call to @samp{AC_DEFINE} in -@file{configure.in} will require a line in this file. @xref{Write -acconfig.h}. - -@item acinclude.m4 -@cindex @file{acinclude.m4} -This file is not always required. It defines local autoconf macros. -These macros may then be used in @file{configure.in}. If you don't need -any local autoconf macros, then you don't need this file at all. In -fact, in general, you never need local autoconf macros, since you can -put everything in @file{configure.in}, but sometimes a local macro is -convenient. - -Newer tools may omit @file{acinclude.m4}, and instead use a -subdirectory, typically named @file{m4}, and define -@samp{ACLOCAL_AMFLAGS = -I m4} in @file{Makefile.am} to force -@samp{aclocal} to look there for macro definitions. The macro -definitions are then placed in separate files in that directory. - -The @file{acinclude.m4} file is only used when using automake; in older -tools, the developer writes @file{aclocal.m4} directly, if it is needed. -@end table - -@node Generated Developer Files -@subsection Generated Developer Files - -The following files would be generated by the developer. - -When using automake, these files are normally not generated manually -after the first time. Instead, the generated @file{Makefile} contains -rules to automatically rebuild the files as required. When -@samp{AM_MAINTAINER_MODE} is used in @file{configure.in} (the normal -case in Cygnus code), the automatic rebuilding rules will only be -defined if you configure using the @samp{--enable-maintainer-mode} -option. - -When using automatic rebuilding, it is important to ensure that all the -various tools have been built and installed on your @samp{PATH}. Using -automatic rebuilding is highly recommended, so much so that I'm not -going to explain what you have to do if you don't use it. - -@table @file -@item configure -@cindex @file{configure} -This is the configure script which will be run when building the -package. This is generated by @samp{autoconf} from @file{configure.in} -and @file{aclocal.m4}. This is a shell script. - -@item Makefile.in -@cindex @file{Makefile.in} -This is the file which the configure script will turn into the -@file{Makefile} at build time. This file is generated by -@samp{automake} from @file{Makefile.am}. If you aren't using automake, -you must write this file yourself. This file is pretty much a normal -@file{Makefile}, with some configure substitutions for certain -variables. - -@item aclocal.m4 -@cindex @file{aclocal.m4} -This file is created by the @samp{aclocal} program, based on the -contents of @file{configure.in} and @file{acinclude.m4} (or, as noted in -the description of @file{acinclude.m4} above, on the contents of an -@file{m4} subdirectory). This file contains definitions of autoconf -macros which @samp{autoconf} will use when generating the file -@file{configure}. These autoconf macros may be defined by you in -@file{acinclude.m4} or they may be defined by other packages such as -automake, libtool or gettext. If you aren't using automake, you will -normally write this file yourself; in that case, if @file{configure.in} -uses only standard autoconf macros, this file will not be needed at all. - -@item config.in -@cindex @file{config.in} -@cindex @file{config.h.in} -This file is created by @samp{autoheader} based on @file{acconfig.h} and -@file{configure.in}. At build time, the configure script will define -some of the macros in it to create @file{config.h}, which may then be -included by your program. This permits your C code to use preprocessor -conditionals to change its behaviour based on the characteristics of the -host system. This file may also be called @file{config.h.in}. - -@item stamp.h-in -@cindex @file{stamp-h.in} -This rather uninteresting file, which I omitted from the picture, is -generated by @samp{automake}. It always contains the string -@samp{timestamp}. It is used as a timestamp file indicating whether -@file{config.in} is up to date. Using a timestamp file means that -@file{config.in} can be marked as up to date without actually changing -its modification time. This is useful since @file{config.in} depends -upon @file{configure.in}, but it is easy to change @file{configure.in} -in a way which does not affect @file{config.in}. -@end table - -@node Build Files -@section Build Files - -This section describes the files which are created at configure and -build time. These are the files which somebody who builds the package -will see. - -Of course, the developer will also build the package. The distinction -between developer files and build files is not that the developer does -not see the build files, but that somebody who only builds the package -does not have to worry about the developer files. - -@menu -* Build Files Picture:: Build Files Picture. -* Build Files Description:: Build Files Description. -@end menu - -@node Build Files Picture -@subsection Build Files Picture - -Here is a picture of the files which will be created at build time. -@file{config.status} is both a created file and a shell script which is -run to create other files, and the picture attempts to show that. - -@image{configbuild} - -@node Build Files Description -@subsection Build Files Description - -This is a description of the files which are created at build time. - -@table @file -@item config.status -@cindex @file{config.status} -The first step in building a package is to run the @file{configure} -script. The @file{configure} script will create the file -@file{config.status}, which is itself a shell script. When you first -run @file{configure}, it will automatically run @file{config.status}. -An @file{Makefile} derived from an automake generated @file{Makefile.in} -will contain rules to automatically run @file{config.status} again when -necessary to recreate certain files if their inputs change. - -@item Makefile -@cindex @file{Makefile} -This is the file which make will read to build the program. The -@file{config.status} script will transform @file{Makefile.in} into -@file{Makefile}. - -@item config.h -@cindex @file{config.h} -This file defines C preprocessor macros which C code can use to adjust -its behaviour on different systems. The @file{config.status} script -will transform @file{config.in} into @file{config.h}. - -@item config.cache -@cindex @file{config.cache} -This file did not fit neatly into the picture, and I omitted it. It is -used by the @file{configure} script to cache results between runs. This -can be an important speedup. If you modify @file{configure.in} in such -a way that the results of old tests should change (perhaps you have -added a new library to @samp{LDFLAGS}), then you will have to remove -@file{config.cache} to force the tests to be rerun. - -The autoconf manual explains how to set up a site specific cache file. -This can speed up running @file{configure} scripts on your system. - -@item stamp.h -@cindex @file{stamp-h} -This file, which I omitted from the picture, is similar to -@file{stamp-h.in}. It is used as a timestamp file indicating whether -@file{config.h} is up to date. This is useful since @file{config.h} -depends upon @file{config.status}, but it is easy for -@file{config.status} to change in a way which does not affect -@file{config.h}. -@end table - -@node Support Files -@section Support Files - -The GNU configure and build system requires several support files to be -included with your distribution. You do not normally need to concern -yourself with these. If you are using the Cygnus tree, most are already -present. Otherwise, they will be installed with your source by -@samp{automake} (with the @samp{--add-missing} option) and -@samp{libtoolize}. - -You don't have to put the support files in the top level directory. You -can put them in a subdirectory, and use the @samp{AC_CONFIG_AUX_DIR} -macro in @file{configure.in} to tell @samp{automake} and the -@file{configure} script where they are. - -In this section, I describe the support files, so that you can know what -they are and why they are there. - -@table @file -@item ABOUT-NLS -Added by automake if you are using gettext. This is a documentation -file about the gettext project. -@item ansi2knr.c -Used by an automake generated @file{Makefile} if you put @samp{ansi2knr} -in @samp{AUTOMAKE_OPTIONS} in @file{Makefile.am}. This permits -compiling ANSI C code with a K&R C compiler. -@item ansi2knr.1 -The man page which goes with @file{ansi2knr.c}. -@item config.guess -A shell script which determines the configuration name for the system on -which it is run. -@item config.sub -A shell script which canonicalizes a configuration name entered by a -user. -@item elisp-comp -Used to compile Emacs LISP files. -@item install-sh -A shell script which installs a program. This is used if the configure -script can not find an install binary. -@item ltconfig -Used by libtool. This is a shell script which configures libtool for -the particular system on which it is used. -@item ltmain.sh -Used by libtool. This is the actual libtool script which is used, after -it is configured by @file{ltconfig} to build a library. -@item mdate-sh -A shell script used by an automake generated @file{Makefile} to pretty -print the modification time of a file. This is used to maintain version -numbers for texinfo files. -@item missing -A shell script used if some tool is missing entirely. This is used by -an automake generated @file{Makefile} to avoid certain sorts of -timestamp problems. -@item mkinstalldirs -A shell script which creates a directory, including all parent -directories. This is used by an automake generated @file{Makefile} -during installation. -@item texinfo.tex -Required if you have any texinfo files. This is used when converting -Texinfo files into DVI using @samp{texi2dvi} and @TeX{}. -@item ylwrap -A shell script used by an automake generated @file{Makefile} to run -programs like @samp{bison}, @samp{yacc}, @samp{flex}, and @samp{lex}. -These programs default to producing output files with a fixed name, and -the @file{ylwrap} script runs them in a subdirectory to avoid file name -conflicts when using a parallel make program. -@end table - -@node Configuration Names -@chapter Configuration Names -@cindex configuration names -@cindex configuration triplets -@cindex triplets -@cindex host names -@cindex host triplets -@cindex canonical system names -@cindex system names -@cindex system types - -The GNU configure system names all systems using a @dfn{configuration -name}. All such names used to be triplets (they may now contain four -parts in certain cases), and the term @dfn{configuration triplet} is -still seen. - -@menu -* Configuration Name Definition:: Configuration Name Definition. -* Using Configuration Names:: Using Configuration Names. -@end menu - -@node Configuration Name Definition -@section Configuration Name Definition - -This is a string of the form -@var{cpu}-@var{manufacturer}-@var{operating_system}. In some cases, -this is extended to a four part form: -@var{cpu}-@var{manufacturer}-@var{kernel}-@var{operating_system}. - -When using a configuration name in a configure option, it is normally -not necessary to specify an entire name. In particular, the -@var{manufacturer} field is often omitted, leading to strings such as -@samp{i386-linux} or @samp{sparc-sunos}. The shell script -@file{config.sub} will translate these shortened strings into the -canonical form. autoconf will arrange for @file{config.sub} to be run -automatically when it is needed. - -The fields of a configuration name are as follows: - -@table @var -@item cpu -The type of processor. This is typically something like @samp{i386} or -@samp{sparc}. More specific variants are used as well, such as -@samp{mipsel} to indicate a little endian MIPS processor. -@item manufacturer -A somewhat freeform field which indicates the manufacturer of the -system. This is often simply @samp{unknown}. Other common strings are -@samp{pc} for an IBM PC compatible system, or the name of a workstation -vendor, such as @samp{sun}. -@item operating_system -The name of the operating system which is run on the system. This will -be something like @samp{solaris2.5} or @samp{irix6.3}. There is no -particular restriction on the version number, and strings like -@samp{aix4.1.4.0} are seen. For an embedded system, which has no -operating system, this field normally indicates the type of object file -format, such as @samp{elf} or @samp{coff}. -@item kernel -This is used mainly for GNU/Linux. A typical GNU/Linux configuration -name is @samp{i586-pc-linux-gnulibc1}. In this case the kernel, -@samp{linux}, is separated from the operating system, @samp{gnulibc1}. -@end table - -The shell script @file{config.guess} will normally print the correct -configuration name for the system on which it is run. It does by -running @samp{uname} and by examining other characteristics of the -system. - -Because @file{config.guess} can normally determine the configuration -name for a machine, it is normally only necessary to specify a -configuration name when building a cross-compiler or when building using -a cross-compiler. - -@node Using Configuration Names -@section Using Configuration Names - -A configure script will sometimes have to make a decision based on a -configuration name. You will need to do this if you have to compile -code differently based on something which can not be tested using a -standard autoconf feature test. - -It is normally better to test for particular features, rather than to -test for a particular system. This is because as Unix evolves, -different systems copy features from one another. Even if you need to -determine whether the feature is supported based on a configuration -name, you should define a macro which describes the feature, rather than -defining a macro which describes the particular system you are on. - -Testing for a particular system is normally done using a case statement -in @file{configure.in}. The case statement might look something like -the following, assuming that @samp{host} is a shell variable holding a -canonical configuration name (which will be the case if -@file{configure.in} uses the @samp{AC_CANONICAL_HOST} or -@samp{AC_CANONICAL_SYSTEM} macro). - -@smallexample -case "$@{host@}" in -i[3456]86-*-linux-gnu*) do something ;; -sparc*-sun-solaris2.[56789]*) do something ;; -sparc*-sun-solaris*) do something ;; -mips*-*-elf*) do something ;; -esac -@end smallexample - -It is particularly important to use @samp{*} after the operating system -field, in order to match the version number which will be generated by -@file{config.guess}. - -In most cases you must be careful to match a range of processor types. -For most processor families, a trailing @samp{*} suffices, as in -@samp{mips*} above. For the i386 family, something along the lines of -@samp{i[3456]86} suffices at present. For the m68k family, you will -need something like @samp{m68*}. Of course, if you do not need to match -on the processor, it is simpler to just replace the entire field by a -@samp{*}, as in @samp{*-*-irix*}. - -@node Cross Compilation Tools -@chapter Cross Compilation Tools -@cindex cross tools - -The GNU configure and build system can be used to build @dfn{cross -compilation} tools. A cross compilation tool is a tool which runs on -one system and produces code which runs on another system. - -@menu -* Cross Compilation Concepts:: Cross Compilation Concepts. -* Host and Target:: Host and Target. -* Using the Host Type:: Using the Host Type. -* Specifying the Target:: Specifying the Target. -* Using the Target Type:: Using the Target Type. -* Cross Tools in the Cygnus Tree:: Cross Tools in the Cygnus Tree -@end menu - -@node Cross Compilation Concepts -@section Cross Compilation Concepts - -@cindex cross compiler -A compiler which produces programs which run on a different system is a -cross compilation compiler, or simply a @dfn{cross compiler}. -Similarly, we speak of cross assemblers, cross linkers, etc. - -In the normal case, a compiler produces code which runs on the same -system as the one on which the compiler runs. When it is necessary to -distinguish this case from the cross compilation case, such a compiler -is called a @dfn{native compiler}. Similarly, we speak of native -assemblers, etc. - -Although the debugger is not strictly speaking a compilation tool, it is -nevertheless meaningful to speak of a cross debugger: a debugger which -is used to debug code which runs on another system. Everything that is -said below about configuring cross compilation tools applies to the -debugger as well. - -@node Host and Target -@section Host and Target -@cindex host system -@cindex target system - -When building cross compilation tools, there are two different systems -involved: the system on which the tools will run, and the system for -which the tools generate code. - -The system on which the tools will run is called the @dfn{host} system. - -The system for which the tools generate code is called the @dfn{target} -system. - -For example, suppose you have a compiler which runs on a GNU/Linux -system and generates ELF programs for a MIPS embedded system. In this -case the GNU/Linux system is the host, and the MIPS ELF system is the -target. Such a compiler could be called a GNU/Linux cross MIPS ELF -compiler, or, equivalently, a @samp{i386-linux-gnu} cross -@samp{mips-elf} compiler. - -Naturally, most programs are not cross compilation tools. For those -programs, it does not make sense to speak of a target. It only makes -sense to speak of a target for tools like @samp{gcc} or the -@samp{binutils} which actually produce running code. For example, it -does not make sense to speak of the target of a tool like @samp{bison} -or @samp{make}. - -Most cross compilation tools can also serve as native tools. For a -native compilation tool, it is still meaningful to speak of a target. -For a native tool, the target is the same as the host. For example, for -a GNU/Linux native compiler, the host is GNU/Linux, and the target is -also GNU/Linux. - -@node Using the Host Type -@section Using the Host Type - -In almost all cases the host system is the system on which you run the -@samp{configure} script, and on which you build the tools (for the case -when they differ, @pxref{Canadian Cross}). - -@cindex @samp{AC_CANONICAL_HOST} -If your configure script needs to know the configuration name of the -host system, and the package is not a cross compilation tool and -therefore does not have a target, put @samp{AC_CANONICAL_HOST} in -@file{configure.in}. This macro will arrange to define a few shell -variables when the @samp{configure} script is run. - -@table @samp -@item host -The canonical configuration name of the host. This will normally be -determined by running the @file{config.guess} shell script, although the -user is permitted to override this by using an explicit @samp{--host} -option. -@item host_alias -In the unusual case that the user used an explicit @samp{--host} option, -this will be the argument to @samp{--host}. In the normal case, this -will be the same as the @samp{host} variable. -@item host_cpu -@itemx host_vendor -@itemx host_os -The first three parts of the canonical configuration name. -@end table - -The shell variables may be used by putting shell code in -@file{configure.in}. For an example, see @ref{Using Configuration -Names}. - -@node Specifying the Target -@section Specifying the Target - -By default, the @samp{configure} script will assume that the target is -the same as the host. This is the more common case; for example, it -leads to a native compiler rather than a cross compiler. - -@cindex @samp{--target} option -@cindex target option -@cindex configure target -If you want to build a cross compilation tool, you must specify the -target explicitly by using the @samp{--target} option when you run -@samp{configure}. The argument to @samp{--target} is the configuration -name of the system for which you wish to generate code. -@xref{Configuration Names}. - -For example, to build tools which generate code for a MIPS ELF embedded -system, you would use @samp{--target mips-elf}. - -@node Using the Target Type -@section Using the Target Type - -@cindex @samp{AC_CANONICAL_SYSTEM} -When writing @file{configure.in} for a cross compilation tool, you will -need to use information about the target. To do this, put -@samp{AC_CANONICAL_SYSTEM} in @file{configure.in}. - -@samp{AC_CANONICAL_SYSTEM} will look for a @samp{--target} option and -canonicalize it using the @file{config.sub} shell script. It will also -run @samp{AC_CANONICAL_HOST} (@pxref{Using the Host Type}). - -The target type will be recorded in the following shell variables. Note -that the host versions of these variables will also be defined by -@samp{AC_CANONICAL_HOST}. - -@table @samp -@item target -The canonical configuration name of the target. -@item target_alias -The argument to the @samp{--target} option. If the user did not specify -a @samp{--target} option, this will be the same as @samp{host_alias}. -@item target_cpu -@itemx target_vendor -@itemx target_os -The first three parts of the canonical target configuration name. -@end table - -Note that if @samp{host} and @samp{target} are the same string, you can -assume a native configuration. If they are different, you can assume a -cross configuration. - -It is arguably possible for @samp{host} and @samp{target} to represent -the same system, but for the strings to not be identical. For example, -if @samp{config.guess} returns @samp{sparc-sun-sunos4.1.4}, and somebody -configures with @samp{--target sparc-sun-sunos4.1}, then the slight -differences between the two versions of SunOS may be unimportant for -your tool. However, in the general case it can be quite difficult to -determine whether the differences between two configuration names are -significant or not. Therefore, by convention, if the user specifies a -@samp{--target} option without specifying a @samp{--host} option, it is -assumed that the user wants to configure a cross compilation tool. - -The variables @samp{target} and @samp{target_alias} should be handled -differently. - -In general, whenever the user may actually see a string, -@samp{target_alias} should be used. This includes anything which may -appear in the file system, such as a directory name or part of a tool -name. It also includes any tool output, unless it is clearly labelled -as the canonical target configuration name. This permits the user to -use the @samp{--target} option to specify how the tool will appear to -the outside world. - -On the other hand, when checking for characteristics of the target -system, @samp{target} should be used. This is because a wide variety of -@samp{--target} options may map into the same canonical configuration -name. You should not attempt to duplicate the canonicalization done by -@samp{config.sub} in your own code. - -By convention, cross tools are installed with a prefix of the argument -used with the @samp{--target} option, also known as @samp{target_alias} -(@pxref{Using the Target Type}). If the user does not use the -@samp{--target} option, and thus is building a native tool, no prefix is -used. - -For example, if gcc is configured with @samp{--target mips-elf}, then -the installed binary will be named @samp{mips-elf-gcc}. If gcc is -configured without a @samp{--target} option, then the installed binary -will be named @samp{gcc}. - -The autoconf macro @samp{AC_ARG_PROGRAM} will handle this for you. If -you are using automake, no more need be done; the programs will -automatically be installed with the correct prefixes. Otherwise, see -the autoconf documentation for @samp{AC_ARG_PROGRAM}. - -@node Cross Tools in the Cygnus Tree -@section Cross Tools in the Cygnus Tree - -The Cygnus tree is used for various packages including gdb, the GNU -binutils, and egcs. It is also, of course, used for Cygnus releases. - -In the Cygnus tree, the top level @file{configure} script uses the old -Cygnus configure system, not autoconf. The top level @file{Makefile.in} -is written to build packages based on what is in the source tree, and -supports building a large number of tools in a single -@samp{configure}/@samp{make} step. - -The Cygnus tree may be configured with a @samp{--target} option. The -@samp{--target} option applies recursively to every subdirectory, and -permits building an entire set of cross tools at once. - -@menu -* Host and Target Libraries:: Host and Target Libraries. -* Target Library Configure Scripts:: Target Library Configure Scripts. -* Make Targets in Cygnus Tree:: Make Targets in Cygnus Tree. -* Target libiberty:: Target libiberty -@end menu - -@node Host and Target Libraries -@subsection Host and Target Libraries - -The Cygnus tree distinguishes host libraries from target libraries. - -Host libraries are built with the compiler used to build the programs -which run on the host, which is called the host compiler. This includes -libraries such as @samp{bfd} and @samp{tcl}. These libraries are built -with the host compiler, and are linked into programs like the binutils -or gcc which run on the host. - -Target libraries are built with the target compiler. If gcc is present -in the source tree, then the target compiler is the gcc that is built -using the host compiler. Target libraries are libraries such as -@samp{newlib} and @samp{libstdc++}. These libraries are not linked into -the host programs, but are instead made available for use with programs -built with the target compiler. - -For the rest of this section, assume that gcc is present in the source -tree, so that it will be used to build the target libraries. - -There is a complication here. The configure process needs to know which -compiler you are going to use to build a tool; otherwise, the feature -tests will not work correctly. The Cygnus tree handles this by not -configuring the target libraries until the target compiler is built. In -order to permit everything to build using a single -@samp{configure}/@samp{make}, the configuration of the target libraries -is actually triggered during the make step. - -When the target libraries are configured, the @samp{--target} option is -not used. Instead, the @samp{--host} option is used with the argument -of the @samp{--target} option for the overall configuration. If no -@samp{--target} option was used for the overall configuration, the -@samp{--host} option will be passed with the output of the -@file{config.guess} shell script. Any @samp{--build} option is passed -down unchanged. - -This translation of configuration options is done because since the -target libraries are compiled with the target compiler, they are being -built in order to run on the target of the overall configuration. By -the definition of host, this means that their host system is the same as -the target system of the overall configuration. - -The same process is used for both a native configuration and a cross -configuration. Even when using a native configuration, the target -libraries will be configured and built using the newly built compiler. -This is particularly important for the C++ libraries, since there is no -reason to assume that the C++ compiler used to build the host tools (if -there even is one) uses the same ABI as the g++ compiler which will be -used to build the target libraries. - -There is one difference between a native configuration and a cross -configuration. In a native configuration, the target libraries are -normally configured and built as siblings of the host tools. In a cross -configuration, the target libraries are normally built in a subdirectory -whose name is the argument to @samp{--target}. This is mainly for -historical reasons. - -To summarize, running @samp{configure} in the Cygnus tree configures all -the host libraries and tools, but does not configure any of the target -libraries. Running @samp{make} then does the following steps: - -@itemize @bullet -@item -Build the host libraries. -@item -Build the host programs, including gcc. Note that we call gcc both a -host program (since it runs on the host) and a target compiler (since it -generates code for the target). -@item -Using the newly built target compiler, configure the target libraries. -@item -Build the target libraries. -@end itemize - -The steps need not be done in precisely this order, since they are -actually controlled by @file{Makefile} targets. - -@node Target Library Configure Scripts -@subsection Target Library Configure Scripts - -There are a few things you must know in order to write a configure -script for a target library. This is just a quick sketch, and beginners -shouldn't worry if they don't follow everything here. - -The target libraries are configured and built using a newly built target -compiler. There may not be any startup files or libraries for this -target compiler. In fact, those files will probably be built as part of -some target library, which naturally means that they will not exist when -your target library is configured. - -This means that the configure script for a target library may not use -any test which requires doing a link. This unfortunately includes many -useful autoconf macros, such as @samp{AC_CHECK_FUNCS}. autoconf macros -which do a compile but not a link, such as @samp{AC_CHECK_HEADERS}, may -be used. - -This is a severe restriction, but normally not a fatal one, as target -libraries can often assume the presence of other target libraries, and -thus know which functions will be available. - -As of this writing, the autoconf macro @samp{AC_PROG_CC} does a link to -make sure that the compiler works. This may fail in a target library, -so target libraries must use a different set of macros to locate the -compiler. See the @file{configure.in} file in a directory like -@file{libiberty} or @file{libgloss} for an example. - -As noted in the previous section, target libraries are sometimes built -in directories which are siblings to the host tools, and are sometimes -built in a subdirectory. The @samp{--with-target-subdir} configure -option will be passed when the library is configured. Its value will be -an empty string if the target library is a sibling. Its value will be -the name of the subdirectory if the target library is in a subdirectory. - -If the overall build is not a native build (i.e., the overall configure -used the @samp{--target} option), then the library will be configured -with the @samp{--with-cross-host} option. The value of this option will -be the host system of the overall build. Recall that the host system of -the library will be the target of the overall build. If the overall -build is a native build, the @samp{--with-cross-host} option will not be -used. - -A library which can be built both standalone and as a target library may -want to install itself into different directories depending upon the -case. When built standalone, or when built native, the library should -be installed in @samp{$(libdir)}. When built as a target library which -is not native, the library should be installed in @samp{$(tooldir)/lib}. -The @samp{--with-cross-host} option may be used to distinguish these -cases. - -This same test of @samp{--with-cross-host} may be used to see whether it -is OK to use link tests in the configure script. If the -@samp{--with-cross-host} option is not used, then the library is being -built either standalone or native, and a link should work. - -@node Make Targets in Cygnus Tree -@subsection Make Targets in Cygnus Tree - -The top level @file{Makefile} in the Cygnus tree defines targets for -every known subdirectory. - -For every subdirectory @var{dir} which holds a host library or program, -the @file{Makefile} target @samp{all-@var{dir}} will build that library -or program. - -There are dependencies among host tools. For example, building gcc -requires first building gas, because the gcc build process invokes the -target assembler. These dependencies are reflected in the top level -@file{Makefile}. - -For every subdirectory @var{dir} which holds a target library, the -@file{Makefile} target @samp{configure-target-@var{dir}} will configure -that library. The @file{Makefile} target @samp{all-target-@var{dir}} -will build that library. - -Every @samp{configure-target-@var{dir}} target depends upon -@samp{all-gcc}, since gcc, the target compiler, is required to configure -the tool. Every @samp{all-target-@var{dir}} target depends upon the -corresponding @samp{configure-target-@var{dir}} target. - -There are several other targets which may be of interest for each -directory: @samp{install-@var{dir}}, @samp{clean-@var{dir}}, and -@samp{check-@var{dir}}. There are also corresponding @samp{target} -versions of these for the target libraries , such as -@samp{install-target-@var{dir}}. - -@node Target libiberty -@subsection Target libiberty - -The @file{libiberty} subdirectory is currently a special case, in that -it is the only directory which is built both using the host compiler and -using the target compiler. - -This is because the files in @file{libiberty} are used when building the -host tools, and they are also incorporated into the @file{libstdc++} -target library as support code. - -This duality does not pose any particular difficulties. It means that -there are targets for both @samp{all-libiberty} and -@samp{all-target-libiberty}. - -In a native configuration, when target libraries are not built in a -subdirectory, the same objects are normally used as both the host build -and the target build. This is normally OK, since libiberty contains -only C code, and in a native configuration the results of the host -compiler and the target compiler are normally interoperable. - -Irix 6 is again an exception here, since the SGI native compiler -defaults to using the @samp{O32} ABI, and gcc defaults to using the -@samp{N32} ABI. On Irix 6, the target libraries are built in a -subdirectory even for a native configuration, avoiding this problem. - -There are currently no other libraries built for both the host and the -target, but there is no conceptual problem with adding more. - -@node Canadian Cross -@chapter Canadian Cross -@cindex canadian cross -@cindex building with a cross compiler -@cindex cross compiler, building with - -It is possible to use the GNU configure and build system to build a -program which will run on a system which is different from the system on -which the tools are built. In other words, it is possible to build -programs using a cross compiler. - -This is referred to as a @dfn{Canadian Cross}. - -@menu -* Canadian Cross Example:: Canadian Cross Example. -* Canadian Cross Concepts:: Canadian Cross Concepts. -* Build Cross Host Tools:: Build Cross Host Tools. -* Build and Host Options:: Build and Host Options. -* CCross not in Cygnus Tree:: Canadian Cross not in Cygnus Tree. -* CCross in Cygnus Tree:: Canadian Cross in Cygnus Tree. -* Supporting Canadian Cross:: Supporting Canadian Cross. -@end menu - -@node Canadian Cross Example -@section Canadian Cross Example - -Here is an example of a Canadian Cross. - -While running on a GNU/Linux, you can build a program which will run on -a Solaris system. You would use a GNU/Linux cross Solaris compiler to -build the program. - -Of course, you could not run the resulting program on your GNU/Linux -system. You would have to copy it over to a Solaris system before you -would run it. - -Of course, you could also simply build the programs on the Solaris -system in the first place. However, perhaps the Solaris system is not -available for some reason; perhaps you actually don't have one, but you -want to build the tools for somebody else to use. Or perhaps your -GNU/Linux system is much faster than your Solaris system. - -A Canadian Cross build is most frequently used when building programs to -run on a non-Unix system, such as DOS or Windows. It may be simpler to -configure and build on a Unix system than to support the configuration -machinery on a non-Unix system. - -@node Canadian Cross Concepts -@section Canadian Cross Concepts - -When building a Canadian Cross, there are at least two different systems -involved: the system on which the tools are being built, and the system -on which the tools will run. - -The system on which the tools are being built is called the @dfn{build} -system. - -The system on which the tools will run is called the host system. - -For example, if you are building a Solaris program on a GNU/Linux -system, as in the previous section, the build system would be GNU/Linux, -and the host system would be Solaris. - -It is, of course, possible to build a cross compiler using a Canadian -Cross (i.e., build a cross compiler using a cross compiler). In this -case, the system for which the resulting cross compiler generates code -is called the target system. (For a more complete discussion of host -and target systems, @pxref{Host and Target}). - -An example of building a cross compiler using a Canadian Cross would be -building a Windows cross MIPS ELF compiler on a GNU/Linux system. In -this case the build system would be GNU/Linux, the host system would be -Windows, and the target system would be MIPS ELF. - -The name Canadian Cross comes from the case when the build, host, and -target systems are all different. At the time that these issues were -all being hashed out, Canada had three national political parties. - -@node Build Cross Host Tools -@section Build Cross Host Tools - -In order to configure a program for a Canadian Cross build, you must -first build and install the set of cross tools you will use to build the -program. - -These tools will be build cross host tools. That is, they will run on -the build system, and will produce code that runs on the host system. - -It is easy to confuse the meaning of build and host here. Always -remember that the build system is where you are doing the build, and the -host system is where the resulting program will run. Therefore, you -need a build cross host compiler. - -In general, you must have a complete cross environment in order to do -the build. This normally means a cross compiler, cross assembler, and -so forth, as well as libraries and include files for the host system. - -@node Build and Host Options -@section Build and Host Options -@cindex configuring a canadian cross -@cindex canadian cross, configuring - -When you run @file{configure}, you must use both the @samp{--build} and -@samp{--host} options. - -@cindex @samp{--build} option -@cindex build option -@cindex configure build system -The @samp{--build} option is used to specify the configuration name of -the build system. This can normally be the result of running the -@file{config.guess} shell script, and it is reasonable to use -@samp{--build=`config.guess`}. - -@cindex @samp{--host} option -@cindex host option -@cindex configure host -The @samp{--host} option is used to specify the configuration name of -the host system. - -As we explained earlier, @file{config.guess} is used to set the default -value for the @samp{--host} option (@pxref{Using the Host Type}). We -can now see that since @file{config.guess} returns the type of system on -which it is run, it really identifies the build system. Since the host -system is normally the same as the build system (i.e., people do not -normally build using a cross compiler), it is reasonable to use the -result of @file{config.guess} as the default for the host system when -the @samp{--host} option is not used. - -It might seem that if the @samp{--host} option were used without the -@samp{--build} option that the configure script could run -@file{config.guess} to determine the build system, and presume a -Canadian Cross if the result of @file{config.guess} differed from the -@samp{--host} option. However, for historical reasons, some configure -scripts are routinely run using an explicit @samp{--host} option, rather -than using the default from @file{config.guess}. As noted earlier, it -is difficult or impossible to reliably compare configuration names -(@pxref{Using the Target Type}). Therefore, by convention, if the -@samp{--host} option is used, but the @samp{--build} option is not used, -then the build system defaults to the host system. - -@node CCross not in Cygnus Tree -@section Canadian Cross not in Cygnus Tree. - -If you are not using the Cygnus tree, you must explicitly specify the -cross tools which you want to use to build the program. This is done by -setting environment variables before running the @file{configure} -script. - -You must normally set at least the environment variables @samp{CC}, -@samp{AR}, and @samp{RANLIB} to the cross tools which you want to use to -build. - -For some programs, you must set additional cross tools as well, such as -@samp{AS}, @samp{LD}, or @samp{NM}. - -You would set these environment variables to the build cross tools which -you are going to use. - -For example, if you are building a Solaris program on a GNU/Linux -system, and your GNU/Linux cross Solaris compiler were named -@samp{solaris-gcc}, then you would set the environment variable -@samp{CC} to @samp{solaris-gcc}. - -@node CCross in Cygnus Tree -@section Canadian Cross in Cygnus Tree -@cindex canadian cross in cygnus tree - -This section describes configuring and building a Canadian Cross when -using the Cygnus tree. - -@menu -* Standard Cygnus CCross:: Building a Normal Program. -* Cross Cygnus CCross:: Building a Cross Program. -@end menu - -@node Standard Cygnus CCross -@subsection Building a Normal Program - -When configuring a Canadian Cross in the Cygnus tree, all the -appropriate environment variables are automatically set to -@samp{@var{host}-@var{tool}}, where @var{host} is the value used for the -@samp{--host} option, and @var{tool} is the name of the tool (e.g., -@samp{gcc}, @samp{as}, etc.). These tools must be on your @samp{PATH}. - -Adding a prefix of @var{host} will give the usual name for the build -cross host tools. To see this, consider that when these cross tools -were built, they were configured to run on the build system and to -produce code for the host system. That is, they were configured with a -@samp{--target} option that is the same as the system which we are now -calling the host. Recall that the default name for installed cross -tools uses the target system as a prefix (@pxref{Using the Target -Type}). Since that is the system which we are now calling the host, -@var{host} is the right prefix to use. - -For example, if you configure with @samp{--build=i386-linux-gnu} and -@samp{--host=solaris}, then the Cygnus tree will automatically default -to using the compiler @samp{solaris-gcc}. You must have previously -built and installed this compiler, probably by doing a build with no -@samp{--host} option and with a @samp{--target} option of -@samp{solaris}. - -@node Cross Cygnus CCross -@subsection Building a Cross Program - -There are additional considerations if you want to build a cross -compiler, rather than a native compiler, in the Cygnus tree using a -Canadian Cross. - -When you build a cross compiler using the Cygnus tree, then the target -libraries will normally be built with the newly built target compiler -(@pxref{Host and Target Libraries}). However, this will not work when -building with a Canadian Cross. This is because the newly built target -compiler will be a program which runs on the host system, and therefore -will not be able to run on the build system. - -Therefore, when building a cross compiler with the Cygnus tree, you must -first install a set of build cross target tools. These tools will be -used when building the target libraries. - -Note that this is not a requirement of a Canadian Cross in general. For -example, it would be possible to build just the host cross target tools -on the build system, to copy the tools to the host system, and to build -the target libraries on the host system. The requirement for build -cross target tools is imposed by the Cygnus tree, which expects to be -able to build both host programs and target libraries in a single -@samp{configure}/@samp{make} step. Because it builds these in a single -step, it expects to be able to build the target libraries on the build -system, which means that it must use a build cross target toolchain. - -For example, suppose you want to build a Windows cross MIPS ELF compiler -on a GNU/Linux system. You must have previously installed both a -GNU/Linux cross Windows compiler and a GNU/Linux cross MIPS ELF -compiler. - -In order to build the Windows (configuration name @samp{i386-cygwin32}) -cross MIPS ELF (configure name @samp{mips-elf}) compiler, you might -execute the following commands (long command lines are broken across -lines with a trailing backslash as a continuation character). - -@example -mkdir linux-x-cygwin32 -cd linux-x-cygwin32 -@var{srcdir}/configure --target i386-cygwin32 --prefix=@var{installdir} \ - --exec-prefix=@var{installdir}/H-i386-linux -make -make install -cd .. -mkdir linux-x-mips-elf -cd linux-x-mips-elf -@var{srcdir}/configure --target mips-elf --prefix=@var{installdir} \ - --exec-prefix=@var{installdir}/H-i386-linux -make -make install -cd .. -mkdir cygwin32-x-mips-elf -cd cygwin32-x-mips-elf -@var{srcdir}/configure --build=i386-linux-gnu --host=i386-cygwin32 \ - --target=mips-elf --prefix=@var{wininstalldir} \ - --exec-prefix=@var{wininstalldir}/H-i386-cygwin32 -make -make install -@end example - -You would then copy the contents of @var{wininstalldir} over to the -Windows machine, and run the resulting programs. - -@node Supporting Canadian Cross -@section Supporting Canadian Cross - -If you want to make it possible to build a program you are developing -using a Canadian Cross, you must take some care when writing your -configure and make rules. Simple cases will normally work correctly. -However, it is not hard to write configure and make tests which will -fail in a Canadian Cross. - -@menu -* CCross in Configure:: Supporting Canadian Cross in Configure Scripts. -* CCross in Make:: Supporting Canadian Cross in Makefiles. -@end menu - -@node CCross in Configure -@subsection Supporting Canadian Cross in Configure Scripts -@cindex canadian cross in configure - -In a @file{configure.in} file, after calling @samp{AC_PROG_CC}, you can -find out whether this is a Canadian Cross configure by examining the -shell variable @samp{cross_compiling}. In a Canadian Cross, which means -that the compiler is a cross compiler, @samp{cross_compiling} will be -@samp{yes}. In a normal configuration, @samp{cross_compiling} will be -@samp{no}. - -You ordinarily do not need to know the type of the build system in a -configure script. However, if you do need that information, you can get -it by using the macro @samp{AC_CANONICAL_SYSTEM}, the same macro that is -used to determine the target system. This macro will set the variables -@samp{build}, @samp{build_alias}, @samp{build_cpu}, @samp{build_vendor}, -and @samp{build_os}, which correspond to the similar @samp{target} and -@samp{host} variables, except that they describe the build system. - -When writing tests in @file{configure.in}, you must remember that you -want to test the host environment, not the build environment. - -Macros like @samp{AC_CHECK_FUNCS} which use the compiler will test the -host environment. That is because the tests will be done by running the -compiler, which is actually a build cross host compiler. If the -compiler can find the function, that means that the function is present -in the host environment. - -Tests like @samp{test -f /dev/ptyp0}, on the other hand, will test the -build environment. Remember that the configure script is running on the -build system, not the host system. If your configure scripts examines -files, those files will be on the build system. Whatever you determine -based on those files may or may not be the case on the host system. - -Most autoconf macros will work correctly for a Canadian Cross. The main -exception is @samp{AC_TRY_RUN}. This macro tries to compile and run a -test program. This will fail in a Canadian Cross, because the program -will be compiled for the host system, which means that it will not run -on the build system. - -The @samp{AC_TRY_RUN} macro provides an optional argument to tell the -configure script what to do in a Canadian Cross. If that argument is -not present, you will get a warning when you run @samp{autoconf}: -@smallexample -warning: AC_TRY_RUN called without default to allow cross compiling -@end smallexample -@noindent -This tells you that the resulting @file{configure} script will not work -with a Canadian Cross. - -In some cases while it may better to perform a test at configure time, -it is also possible to perform the test at run time. In such a case you -can use the cross compiling argument to @samp{AC_TRY_RUN} to tell your -program that the test could not be performed at configure time. - -There are a few other autoconf macros which will not work correctly with -a Canadian Cross: a partial list is @samp{AC_FUNC_GETPGRP}, -@samp{AC_FUNC_SETPGRP}, @samp{AC_FUNC_SETVBUF_REVERSED}, and -@samp{AC_SYS_RESTARTABLE_SYSCALLS}. The @samp{AC_CHECK_SIZEOF} macro is -generally not very useful with a Canadian Cross; it permits an optional -argument indicating the default size, but there is no way to know what -the correct default should be. - -@node CCross in Make -@subsection Supporting Canadian Cross in Makefiles. -@cindex canadian cross in makefile - -The main Canadian Cross issue in a @file{Makefile} arises when you want -to use a subsidiary program to generate code or data which you will then -include in your real program. - -If you compile this subsidiary program using @samp{$(CC)} in the usual -way, you will not be able to run it. This is because @samp{$(CC)} will -build a program for the host system, but the program is being built on -the build system. - -You must instead use a compiler for the build system, rather than the -host system. In the Cygnus tree, this make variable -@samp{$(CC_FOR_BUILD)} will hold a compiler for the build system. - -Note that you should not include @file{config.h} in a file you are -compiling with @samp{$(CC_FOR_BUILD)}. The @file{configure} script will -build @file{config.h} with information for the host system. However, -you are compiling the file using a compiler for the build system (a -native compiler). Subsidiary programs are normally simple filters which -do no user interaction, and it is normally possible to write them in a -highly portable fashion so that the absence of @file{config.h} is not -crucial. - -@cindex @samp{HOST_CC} -The gcc @file{Makefile.in} shows a complex situation in which certain -files, such as @file{rtl.c}, must be compiled into both subsidiary -programs run on the build system and into the final program. This -approach may be of interest for advanced build system hackers. Note -that the build system compiler is rather confusingly called -@samp{HOST_CC}. - -@node Cygnus Configure -@chapter Cygnus Configure -@cindex cygnus configure - -The Cygnus configure script predates autoconf. All of its interesting -features have been incorporated into autoconf. No new programs should -be written to use the Cygnus configure script. - -However, the Cygnus configure script is still used in a few places: at -the top of the Cygnus tree and in a few target libraries in the Cygnus -tree. Until those uses have been replaced with autoconf, some brief -notes are appropriate here. This is not complete documentation, but it -should be possible to use this as a guide while examining the scripts -themselves. - -@menu -* Cygnus Configure Basics:: Cygnus Configure Basics. -* Cygnus Configure in C++ Libraries:: Cygnus Configure in C++ Libraries. -@end menu - -@node Cygnus Configure Basics -@section Cygnus Configure Basics - -Cygnus configure does not use any generated files; there is no program -corresponding to @samp{autoconf}. Instead, there is a single shell -script named @samp{configure} which may be found at the top of the -Cygnus tree. This shell script was written by hand; it was not -generated by autoconf, and it is incorrect, and indeed harmful, to run -@samp{autoconf} in the top level of a Cygnus tree. - -Cygnus configure works in a particular directory by examining the file -@file{configure.in} in that directory. That file is broken into four -separate shell scripts. - -The first is the contents of @file{configure.in} up to a line that -starts with @samp{# per-host:}. This is the common part. - -The second is the rest of @file{configure.in} up to a line that starts -with @samp{# per-target:}. This is the per host part. - -The third is the rest of @file{configure.in} up to a line that starts -with @samp{# post-target:}. This is the per target part. - -The fourth is the remainder of @file{configure.in}. This is the post -target part. - -If any of these comment lines are missing, the corresponding shell -script is empty. - -Cygnus configure will first execute the common part. This must set the -shell variable @samp{srctrigger} to the name of a source file, to -confirm that Cygnus configure is looking at the right directory. This -may set the shell variables @samp{package_makefile_frag} and -@samp{package_makefile_rules_frag}. - -Cygnus configure will next set the @samp{build} and @samp{host} shell -variables, and execute the per host part. This may set the shell -variable @samp{host_makefile_frag}. - -Cygnus configure will next set the @samp{target} variable, and execute -the per target part. This may set the shell variable -@samp{target_makefile_frag}. - -Any of these scripts may set the @samp{subdirs} shell variable. This -variable is a list of subdirectories where a @file{Makefile.in} file may -be found. Cygnus configure will automatically look for a -@file{Makefile.in} file in the current directory. The @samp{subdirs} -shell variable is not normally used, and I believe that the only -directory which uses it at present is @file{newlib}. - -For each @file{Makefile.in}, Cygnus configure will automatically create -a @file{Makefile} by adding definitions for @samp{make} variables such -as @samp{host} and @samp{target}, and automatically editing the values -of @samp{make} variables such as @samp{prefix} if they are present. - -Also, if any of the @samp{makefile_frag} shell variables are set, Cygnus -configure will interpret them as file names relative to either the -working directory or the source directory, and will read the contents of -the file into the generated @file{Makefile}. The file contents will be -read in after the first line in @file{Makefile.in} which starts with -@samp{####}. - -These @file{Makefile} fragments are used to customize behaviour for a -particular host or target. They serve to select particular files to -compile, and to define particular preprocessor macros by providing -values for @samp{make} variables which are then used during compilation. -Cygnus configure, unlike autoconf, normally does not do feature tests, -and normally requires support to be added manually for each new host. - -The @file{Makefile} fragment support is similar to the autoconf -@samp{AC_SUBST_FILE} macro. - -After creating each @file{Makefile}, the post target script will be run -(i.e., it may be run several times). This script may further customize -the @file{Makefile}. When it is run, the shell variable @samp{Makefile} -will hold the name of the @file{Makefile}, including the appropriate -directory component. - -Like an autoconf generated @file{configure} script, Cygnus configure -will create a file named @file{config.status} which, when run, will -automatically recreate the configuration. The @file{config.status} file -will simply execute the Cygnus configure script again with the -appropriate arguments. - -Any of the parts of @file{configure.in} may set the shell variables -@samp{files} and @samp{links}. Cygnus configure will set up symlinks -from the names in @samp{links} to the files named in @samp{files}. This -is similar to the autoconf @samp{AC_LINK_FILES} macro. - -Finally, any of the parts of @file{configure.in} may set the shell -variable @samp{configdirs} to a set of subdirectories. If it is set, -Cygnus configure will recursively run the configure process in each -subdirectory. If the subdirectory uses Cygnus configure, it will -contain a @file{configure.in} file but no @file{configure} file, in -which case Cygnus configure will invoke itself recursively. If the -subdirectory has a @file{configure} file, Cygnus configure assumes that -it is an autoconf generated @file{configure} script, and simply invokes -it directly. - -@node Cygnus Configure in C++ Libraries -@section Cygnus Configure in C++ Libraries -@cindex @file{libstdc++} configure -@cindex @file{libio} configure -@cindex @file{libg++} configure - -The C++ library configure system, written by Per Bothner, deserves -special mention. It uses Cygnus configure, but it does feature testing -like that done by autoconf generated @file{configure} scripts. This -approach is used in the libraries @file{libio}, @file{libstdc++}, and -@file{libg++}. - -Most of the @file{Makefile} information is written out by the shell -script @file{libio/config.shared}. Each @file{configure.in} file sets -certain shell variables, and then invokes @file{config.shared} to create -two package @file{Makefile} fragments. These fragments are then -incorporated into the resulting @file{Makefile} by the Cygnus configure -script. - -The file @file{_G_config.h} is created in the @file{libio} object -directory by running the shell script @file{libio/gen-params}. This -shell script uses feature tests to define macros and typedefs in -@file{_G_config.h}. - -@node Multilibs -@chapter Multilibs -@cindex multilibs - -For some targets gcc may have different processor requirements depending -upon command line options. An obvious example is the -@samp{-msoft-float} option supported on several processors. This option -means that the floating point registers are not available, which means -that floating point operations must be done by calling an emulation -subroutine rather than by using machine instructions. - -For such options, gcc is often configured to compile target libraries -twice: once with @samp{-msoft-float} and once without. When gcc -compiles target libraries more than once, the resulting libraries are -called @dfn{multilibs}. - -Multilibs are not really part of the GNU configure and build system, but -we discuss them here since they require support in the @file{configure} -scripts and @file{Makefile}s used for target libraries. - -@menu -* Multilibs in gcc:: Multilibs in gcc. -* Multilibs in Target Libraries:: Multilibs in Target Libraries. -@end menu - -@node Multilibs in gcc -@section Multilibs in gcc - -In gcc, multilibs are defined by setting the variable -@samp{MULTILIB_OPTIONS} in the target @file{Makefile} fragment. Several -other @samp{MULTILIB} variables may also be defined there. @xref{Target -Fragment, , The Target Makefile Fragment, gcc, Using and Porting GNU -CC}. - -If you have built gcc, you can see what multilibs it uses by running it -with the @samp{-print-multi-lib} option. The output @samp{.;} means -that no multilibs are used. In general, the output is a sequence of -lines, one per multilib. The first part of each line, up to the -@samp{;}, is the name of the multilib directory. The second part is a -list of compiler options separated by @samp{@@} characters. - -Multilibs are built in a tree of directories. The top of the tree, -represented by @samp{.} in the list of multilib directories, is the -default library to use when no special compiler options are used. The -subdirectories of the tree hold versions of the library to use when -particular compiler options are used. - -@node Multilibs in Target Libraries -@section Multilibs in Target Libraries - -The target libraries in the Cygnus tree are automatically built with -multilibs. That means that each library is built multiple times. - -This default is set in the top level @file{configure.in} file, by adding -@samp{--enable-multilib} to the list of arguments passed to configure -when it is run for the target libraries (@pxref{Host and Target -Libraries}). - -Each target library uses the shell script @file{config-ml.in}, written -by Doug Evans, to prepare to build target libraries. This shell script -is invoked after the @file{Makefile} has been created by the -@file{configure} script. If multilibs are not enabled, it does nothing, -otherwise it modifies the @file{Makefile} to support multilibs. - -The @file{config-ml.in} script makes one copy of the @file{Makefile} for -each multilib in the appropriate subdirectory. When configuring in the -source directory (which is not recommended), it will build a symlink -tree of the sources in each subdirectory. - -The @file{config-ml.in} script sets several variables in the various -@file{Makefile}s. The @file{Makefile.in} must have definitions for -these variables already; @file{config-ml.in} simply changes the existing -values. The @file{Makefile} should use default values for these -variables which will do the right thing in the subdirectories. - -@table @samp -@item MULTISRCTOP -@file{config-ml.in} will set this to a sequence of @samp{../} strings, -where the number of strings is the number of multilib levels in the -source tree. The default value should be the empty string. -@item MULTIBUILDTOP -@file{config-ml.in} will set this to a sequence of @samp{../} strings, -where the number of strings is number of multilib levels in the object -directory. The default value should be the empty string. This will -differ from @samp{MULTISRCTOP} when configuring in the source tree -(which is not recommended). -@item MULTIDIRS -In the top level @file{Makefile} only, @file{config-ml.in} will set this -to the list of multilib subdirectories. The default value should be the -empty string. -@item MULTISUBDIR -@file{config-ml.in} will set this to the installed subdirectory name to -use for this subdirectory, with a leading @samp{/}. The default value -shold be the empty string. -@item MULTIDO -@itemx MULTICLEAN -In the top level @file{Makefile} only, @file{config-ml.in} will set -these variables to commands to use when doing a recursive make. These -variables should both default to the string @samp{true}, so that by -default nothing happens. -@end table - -All references to the parent of the source directory should use the -variable @samp{MULTISRCTOP}. Instead of writing @samp{$(srcdir)/..}, -you must write @samp{$(srcdir)/$(MULTISRCTOP)..}. - -Similarly, references to the parent of the object directory should use -the variable @samp{MULTIBUILDTOP}. - -In the installation target, the libraries should be installed in the -subdirectory @samp{MULTISUBDIR}. Instead of installing -@samp{$(libdir)/libfoo.a}, install -@samp{$(libdir)$(MULTISUBDIR)/libfoo.a}. - -The @file{config-ml.in} script also modifies the top level -@file{Makefile} to add @samp{multi-do} and @samp{multi-clean} targets -which are used when building multilibs. - -The default target of the @file{Makefile} should include the following -command: -@smallexample -@@$(MULTIDO) $(FLAGS_TO_PASS) DO=all multi-do -@end smallexample -@noindent -This assumes that @samp{$(FLAGS_TO_PASS)} is defined as a set of -variables to pass to a recursive invocation of @samp{make}. This will -build all the multilibs. Note that the default value of @samp{MULTIDO} -is @samp{true}, so by default this command will do nothing. It will -only do something in the top level @file{Makefile} if multilibs were -enabled. - -The @samp{install} target of the @file{Makefile} should include the -following command: -@smallexample -@@$(MULTIDO) $(FLAGS_TO_PASS) DO=install multi-do -@end smallexample - -In general, any operation, other than clean, which should be performed -on all the multilibs should use a @samp{$(MULTIDO)} line, setting the -variable @samp{DO} to the target of each recursive call to @samp{make}. - -The @samp{clean} targets (@samp{clean}, @samp{mostlyclean}, etc.) should -use @samp{$(MULTICLEAN)}. For example, the @samp{clean} target should -do this: -@smallexample -@@$(MULTICLEAN) DO=clean multi-clean -@end smallexample - -@node FAQ -@chapter Frequently Asked Questions - -@table @asis -@item Which do I run first, @samp{autoconf} or @samp{automake}? -Except when you first add autoconf or automake support to a package, you -shouldn't run either by hand. Instead, configure with the -@samp{--enable-maintainer-mode} option, and let @samp{make} take care of -it. - -@cindex undefined macros -@item @samp{autoconf} says something about undefined macros. -This means that you have macros in your @file{configure.in} which are -not defined by @samp{autoconf}. You may be using an old version of -@samp{autoconf}; try building and installing a newer one. Make sure the -newly installled @samp{autoconf} is first on your @samp{PATH}. Also, -see the next question. - -@cindex @samp{CY_GNU_GETTEXT} in @file{configure} -@cindex @samp{AM_PROG_LIBTOOL} in @file{configure} -@item My @file{configure} script has stuff like @samp{CY_GNU_GETTEXT} in it. -This means that you have macros in your @file{configure.in} which should -be defined in your @file{aclocal.m4} file, but aren't. This usually -means that @samp{aclocal} was not able to appropriate definitions of the -macros. Make sure that you have installed all the packages you need. -In particular, make sure that you have installed libtool (this is where -@samp{AM_PROG_LIBTOOL} is defined) and gettext (this is where -@samp{CY_GNU_GETTEXT} is defined, at least in the Cygnus version of -gettext). - -@cindex @file{Makefile}, garbage characters -@item My @file{Makefile} has @samp{@@} characters in it. -This may mean that you tried to use an autoconf substitution in your -@file{Makefile.in} without adding the appropriate @samp{AC_SUBST} call -to your @file{configure} script. Or it may just mean that you need to -rebuild @file{Makefile} in your build directory. To rebuild -@file{Makefile} from @file{Makefile.in}, run the shell script -@file{config.status} with no arguments. If you need to force -@file{configure} to run again, first run @samp{config.status --recheck}. -These runs are normally done automatically by @file{Makefile} targets, -but if your @file{Makefile} has gotten messed up you'll need to help -them along. - -@cindex @samp{config.status --recheck} -@item Why do I have to run both @samp{config.status --recheck} and @samp{config.status}? -Normally, you don't; they will be run automatically by @file{Makefile} -targets. If you do need to run them, use @samp{config.status --recheck} -to run the @file{configure} script again with the same arguments as the -first time you ran it. Use @samp{config.status} (with no arguments) to -regenerate all files (@file{Makefile}, @file{config.h}, etc.) based on -the results of the configure script. The two cases are separate because -it isn't always necessary to regenerate all the files after running -@samp{config.status --recheck}. The @file{Makefile} targets generated -by automake will use the environment variables @samp{CONFIG_FILES} and -@samp{CONFIG_HEADERS} to only regenerate files as they are needed. - -@item What is the Cygnus tree? -The Cygnus tree is used for various packages including gdb, the GNU -binutils, and egcs. It is also, of course, used for Cygnus releases. -It is the build system which was developed at Cygnus, using the Cygnus -configure script. It permits building many different packages with a -single configure and make. The configure scripts in the tree are being -converted to autoconf, but the general build structure remains intact. - -@item Why do I have to keep rebuilding and reinstalling the tools? -I know, it's a pain. Unfortunately, there are bugs in the tools -themselves which need to be fixed, and each time that happens everybody -who uses the tools need to reinstall new versions of them. I don't know -if there is going to be a clever fix until the tools stabilize. - -@item Why not just have a Cygnus tree @samp{make} target to update the tools? -The tools unfortunately need to be installed before they can be used. -That means that they must be built using an appropriate prefix, and it -seems unwise to assume that every configuration uses an appropriate -prefix. It might be possible to make them work in place, or it might be -possible to install them in some subdirectory; so far these approaches -have not been implemented. -@end table - -@node Index -@unnumbered Index - -@printindex cp - -@contents -@bye diff --git a/contrib/binutils/etc/make-stds.texi b/contrib/binutils/etc/make-stds.texi deleted file mode 100644 index 2149764b8e9c..000000000000 --- a/contrib/binutils/etc/make-stds.texi +++ /dev/null @@ -1,914 +0,0 @@ -@comment This file is included by both standards.texi and make.texinfo. -@comment It was broken out of standards.texi on 1/6/93 by roland. - -@node Makefile Conventions -@chapter Makefile Conventions -@comment standards.texi does not print an index, but make.texinfo does. -@cindex makefile, conventions for -@cindex conventions for makefiles -@cindex standards for makefiles - -This -@ifinfo -node -@end ifinfo -@iftex -@ifset CODESTD -section -@end ifset -@ifclear CODESTD -chapter -@end ifclear -@end iftex -describes conventions for writing the Makefiles for GNU programs. - -@menu -* Makefile Basics:: General Conventions for Makefiles -* Utilities in Makefiles:: Utilities in Makefiles -* Command Variables:: Variables for Specifying Commands -* Directory Variables:: Variables for Installation Directories -* Standard Targets:: Standard Targets for Users -* Install Command Categories:: Three categories of commands in the `install' - rule: normal, pre-install and post-install. -@end menu - -@node Makefile Basics -@section General Conventions for Makefiles - -Every Makefile should contain this line: - -@example -SHELL = /bin/sh -@end example - -@noindent -to avoid trouble on systems where the @code{SHELL} variable might be -inherited from the environment. (This is never a problem with GNU -@code{make}.) - -Different @code{make} programs have incompatible suffix lists and -implicit rules, and this sometimes creates confusion or misbehavior. So -it is a good idea to set the suffix list explicitly using only the -suffixes you need in the particular Makefile, like this: - -@example -.SUFFIXES: -.SUFFIXES: .c .o -@end example - -@noindent -The first line clears out the suffix list, the second introduces all -suffixes which may be subject to implicit rules in this Makefile. - -Don't assume that @file{.} is in the path for command execution. When -you need to run programs that are a part of your package during the -make, please make sure that it uses @file{./} if the program is built as -part of the make or @file{$(srcdir)/} if the file is an unchanging part -of the source code. Without one of these prefixes, the current search -path is used. - -The distinction between @file{./} (the @dfn{build directory}) and -@file{$(srcdir)/} (the @dfn{source directory}) is important because -users can build in a separate directory using the @samp{--srcdir} option -to @file{configure}. A rule of the form: - -@smallexample -foo.1 : foo.man sedscript - sed -e sedscript foo.man > foo.1 -@end smallexample - -@noindent -will fail when the build directory is not the source directory, because -@file{foo.man} and @file{sedscript} are in the the source directory. - -When using GNU @code{make}, relying on @samp{VPATH} to find the source -file will work in the case where there is a single dependency file, -since the @code{make} automatic variable @samp{$<} will represent the -source file wherever it is. (Many versions of @code{make} set @samp{$<} -only in implicit rules.) A Makefile target like - -@smallexample -foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o -@end smallexample - -@noindent -should instead be written as - -@smallexample -foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@@ -@end smallexample - -@noindent -in order to allow @samp{VPATH} to work correctly. When the target has -multiple dependencies, using an explicit @samp{$(srcdir)} is the easiest -way to make the rule work well. For example, the target above for -@file{foo.1} is best written as: - -@smallexample -foo.1 : foo.man sedscript - sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@ -@end smallexample - -GNU distributions usually contain some files which are not source -files---for example, Info files, and the output from Autoconf, Automake, -Bison or Flex. Since these files normally appear in the source -directory, they should always appear in the source directory, not in the -build directory. So Makefile rules to update them should put the -updated files in the source directory. - -However, if a file does not appear in the distribution, then the -Makefile should not put it in the source directory, because building a -program in ordinary circumstances should not modify the source directory -in any way. - -Try to make the build and installation targets, at least (and all their -subtargets) work correctly with a parallel @code{make}. - -@node Utilities in Makefiles -@section Utilities in Makefiles - -Write the Makefile commands (and any shell scripts, such as -@code{configure}) to run in @code{sh}, not in @code{csh}. Don't use any -special features of @code{ksh} or @code{bash}. - -The @code{configure} script and the Makefile rules for building and -installation should not use any utilities directly except these: - -@c dd find -@c gunzip gzip md5sum -@c mkfifo mknod tee uname - -@example -cat cmp cp diff echo egrep expr false grep install-info -ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true -@end example - -The compression program @code{gzip} can be used in the @code{dist} rule. - -Stick to the generally supported options for these programs. For -example, don't use @samp{mkdir -p}, convenient as it may be, because -most systems don't support it. - -It is a good idea to avoid creating symbolic links in makefiles, since a -few systems don't support them. - -The Makefile rules for building and installation can also use compilers -and related programs, but should do so via @code{make} variables so that the -user can substitute alternatives. Here are some of the programs we -mean: - -@example -ar bison cc flex install ld ldconfig lex -make makeinfo ranlib texi2dvi yacc -@end example - -Use the following @code{make} variables to run those programs: - -@example -$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX) -$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) -@end example - -When you use @code{ranlib} or @code{ldconfig}, you should make sure -nothing bad happens if the system does not have the program in question. -Arrange to ignore an error from that command, and print a message before -the command to tell the user that failure of this command does not mean -a problem. (The Autoconf @samp{AC_PROG_RANLIB} macro can help with -this.) - -If you use symbolic links, you should implement a fallback for systems -that don't have symbolic links. - -Additional utilities that can be used via Make variables are: - -@example -chgrp chmod chown mknod -@end example - -It is ok to use other utilities in Makefile portions (or scripts) -intended only for particular systems where you know those utilities -exist. - -@node Command Variables -@section Variables for Specifying Commands - -Makefiles should provide variables for overriding certain commands, options, -and so on. - -In particular, you should run most utility programs via variables. -Thus, if you use Bison, have a variable named @code{BISON} whose default -value is set with @samp{BISON = bison}, and refer to it with -@code{$(BISON)} whenever you need to use Bison. - -File management utilities such as @code{ln}, @code{rm}, @code{mv}, and -so on, need not be referred to through variables in this way, since users -don't need to replace them with other programs. - -Each program-name variable should come with an options variable that is -used to supply options to the program. Append @samp{FLAGS} to the -program-name variable name to get the options variable name---for -example, @code{BISONFLAGS}. (The names @code{CFLAGS} for the C -compiler, @code{YFLAGS} for yacc, and @code{LFLAGS} for lex, are -exceptions to this rule, but we keep them because they are standard.) -Use @code{CPPFLAGS} in any compilation command that runs the -preprocessor, and use @code{LDFLAGS} in any compilation command that -does linking as well as in any direct use of @code{ld}. - -If there are C compiler options that @emph{must} be used for proper -compilation of certain files, do not include them in @code{CFLAGS}. -Users expect to be able to specify @code{CFLAGS} freely themselves. -Instead, arrange to pass the necessary options to the C compiler -independently of @code{CFLAGS}, by writing them explicitly in the -compilation commands or by defining an implicit rule, like this: - -@smallexample -CFLAGS = -g -ALL_CFLAGS = -I. $(CFLAGS) -.c.o: - $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< -@end smallexample - -Do include the @samp{-g} option in @code{CFLAGS}, because that is not -@emph{required} for proper compilation. You can consider it a default -that is only recommended. If the package is set up so that it is -compiled with GCC by default, then you might as well include @samp{-O} -in the default value of @code{CFLAGS} as well. - -Put @code{CFLAGS} last in the compilation command, after other variables -containing compiler options, so the user can use @code{CFLAGS} to -override the others. - -@code{CFLAGS} should be used in every invocation of the C compiler, -both those which do compilation and those which do linking. - -Every Makefile should define the variable @code{INSTALL}, which is the -basic command for installing a file into the system. - -Every Makefile should also define the variables @code{INSTALL_PROGRAM} -and @code{INSTALL_DATA}. (The default for each of these should be -@code{$(INSTALL)}.) Then it should use those variables as the commands -for actual installation, for executables and nonexecutables -respectively. Use these variables as follows: - -@example -$(INSTALL_PROGRAM) foo $(bindir)/foo -$(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a -@end example - -Optionally, you may prepend the value of @code{DESTDIR} to the target -filename. Doing this allows the installer to create a snapshot of the -installation to be copied onto the real target filesystem later. Do not -set the value of @code{DESTDIR} in your Makefile, and do not include it -in any installed files. With support for @code{DESTDIR}, the above -examples become: - -@example -$(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo -$(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a -@end example - -@noindent -Always use a file name, not a directory name, as the second argument of -the installation commands. Use a separate command for each file to be -installed. - -@node Directory Variables -@section Variables for Installation Directories - -Installation directories should always be named by variables, so it is -easy to install in a nonstandard place. The standard names for these -variables are described below. They are based on a standard filesystem -layout; variants of it are used in SVR4, 4.4BSD, Linux, Ultrix v4, and -other modern operating systems. - -These two variables set the root for the installation. All the other -installation directories should be subdirectories of one of these two, -and nothing should be directly installed into these two directories. - -@table @samp -@item prefix -A prefix used in constructing the default values of the variables listed -below. The default value of @code{prefix} should be @file{/usr/local}. -When building the complete GNU system, the prefix will be empty and -@file{/usr} will be a symbolic link to @file{/}. -(If you are using Autoconf, write it as @samp{@@prefix@@}.) - -Running @samp{make install} with a different value of @code{prefix} -from the one used to build the program should @var{not} recompile -the program. - -@item exec_prefix -A prefix used in constructing the default values of some of the -variables listed below. The default value of @code{exec_prefix} should -be @code{$(prefix)}. -(If you are using Autoconf, write it as @samp{@@exec_prefix@@}.) - -Generally, @code{$(exec_prefix)} is used for directories that contain -machine-specific files (such as executables and subroutine libraries), -while @code{$(prefix)} is used directly for other directories. - -Running @samp{make install} with a different value of @code{exec_prefix} -from the one used to build the program should @var{not} recompile the -program. -@end table - -Executable programs are installed in one of the following directories. - -@table @samp -@item bindir -The directory for installing executable programs that users can run. -This should normally be @file{/usr/local/bin}, but write it as -@file{$(exec_prefix)/bin}. -(If you are using Autoconf, write it as @samp{@@bindir@@}.) - -@item sbindir -The directory for installing executable programs that can be run from -the shell, but are only generally useful to system administrators. This -should normally be @file{/usr/local/sbin}, but write it as -@file{$(exec_prefix)/sbin}. -(If you are using Autoconf, write it as @samp{@@sbindir@@}.) - -@item libexecdir -@comment This paragraph adjusted to avoid overfull hbox --roland 5jul94 -The directory for installing executable programs to be run by other -programs rather than by users. This directory should normally be -@file{/usr/local/libexec}, but write it as @file{$(exec_prefix)/libexec}. -(If you are using Autoconf, write it as @samp{@@libexecdir@@}.) -@end table - -Data files used by the program during its execution are divided into -categories in two ways. - -@itemize @bullet -@item -Some files are normally modified by programs; others are never normally -modified (though users may edit some of these). - -@item -Some files are architecture-independent and can be shared by all -machines at a site; some are architecture-dependent and can be shared -only by machines of the same kind and operating system; others may never -be shared between two machines. -@end itemize - -This makes for six different possibilities. However, we want to -discourage the use of architecture-dependent files, aside from object -files and libraries. It is much cleaner to make other data files -architecture-independent, and it is generally not hard. - -Therefore, here are the variables Makefiles should use to specify -directories: - -@table @samp -@item datadir -The directory for installing read-only architecture independent data -files. This should normally be @file{/usr/local/share}, but write it as -@file{$(prefix)/share}. -(If you are using Autoconf, write it as @samp{@@datadir@@}.) -As a special exception, see @file{$(infodir)} -and @file{$(includedir)} below. - -@item sysconfdir -The directory for installing read-only data files that pertain to a -single machine--that is to say, files for configuring a host. Mailer -and network configuration files, @file{/etc/passwd}, and so forth belong -here. All the files in this directory should be ordinary ASCII text -files. This directory should normally be @file{/usr/local/etc}, but -write it as @file{$(prefix)/etc}. -(If you are using Autoconf, write it as @samp{@@sysconfdir@@}.) - -Do not install executables here in this directory (they probably belong -in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not install -files that are modified in the normal course of their use (programs -whose purpose is to change the configuration of the system excluded). -Those probably belong in @file{$(localstatedir)}. - -@item sharedstatedir -The directory for installing architecture-independent data files which -the programs modify while they run. This should normally be -@file{/usr/local/com}, but write it as @file{$(prefix)/com}. -(If you are using Autoconf, write it as @samp{@@sharedstatedir@@}.) - -@item localstatedir -The directory for installing data files which the programs modify while -they run, and that pertain to one specific machine. Users should never -need to modify files in this directory to configure the package's -operation; put such configuration information in separate files that go -in @file{$(datadir)} or @file{$(sysconfdir)}. @file{$(localstatedir)} -should normally be @file{/usr/local/var}, but write it as -@file{$(prefix)/var}. -(If you are using Autoconf, write it as @samp{@@localstatedir@@}.) - -@item libdir -The directory for object files and libraries of object code. Do not -install executables here, they probably ought to go in @file{$(libexecdir)} -instead. The value of @code{libdir} should normally be -@file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}. -(If you are using Autoconf, write it as @samp{@@libdir@@}.) - -@item infodir -The directory for installing the Info files for this package. By -default, it should be @file{/usr/local/info}, but it should be written -as @file{$(prefix)/info}. -(If you are using Autoconf, write it as @samp{@@infodir@@}.) - -@item lispdir -The directory for installing any Emacs Lisp files in this package. By -default, it should be @file{/usr/local/share/emacs/site-lisp}, but it -should be written as @file{$(prefix)/share/emacs/site-lisp}. - -If you are using Autoconf, write the default as @samp{@@lispdir@@}. -In order to make @samp{@@lispdir@@} work, you need the following lines -in your @file{configure.in} file: - -@example -lispdir='$@{datadir@}/emacs/site-lisp' -AC_SUBST(lispdir) -@end example - -@item includedir -@c rewritten to avoid overfull hbox --roland -The directory for installing header files to be included by user -programs with the C @samp{#include} preprocessor directive. This -should normally be @file{/usr/local/include}, but write it as -@file{$(prefix)/include}. -(If you are using Autoconf, write it as @samp{@@includedir@@}.) - -Most compilers other than GCC do not look for header files in directory -@file{/usr/local/include}. So installing the header files this way is -only useful with GCC. Sometimes this is not a problem because some -libraries are only really intended to work with GCC. But some libraries -are intended to work with other compilers. They should install their -header files in two places, one specified by @code{includedir} and one -specified by @code{oldincludedir}. - -@item oldincludedir -The directory for installing @samp{#include} header files for use with -compilers other than GCC. This should normally be @file{/usr/include}. -(If you are using Autoconf, you can write it as @samp{@@oldincludedir@@}.) - -The Makefile commands should check whether the value of -@code{oldincludedir} is empty. If it is, they should not try to use -it; they should cancel the second installation of the header files. - -A package should not replace an existing header in this directory unless -the header came from the same package. Thus, if your Foo package -provides a header file @file{foo.h}, then it should install the header -file in the @code{oldincludedir} directory if either (1) there is no -@file{foo.h} there or (2) the @file{foo.h} that exists came from the Foo -package. - -To tell whether @file{foo.h} came from the Foo package, put a magic -string in the file---part of a comment---and @code{grep} for that string. -@end table - -Unix-style man pages are installed in one of the following: - -@table @samp -@item mandir -The top-level directory for installing the man pages (if any) for this -package. It will normally be @file{/usr/local/man}, but you should -write it as @file{$(prefix)/man}. -(If you are using Autoconf, write it as @samp{@@mandir@@}.) - -@item man1dir -The directory for installing section 1 man pages. Write it as -@file{$(mandir)/man1}. -@item man2dir -The directory for installing section 2 man pages. Write it as -@file{$(mandir)/man2} -@item @dots{} - -@strong{Don't make the primary documentation for any GNU software be a -man page. Write a manual in Texinfo instead. Man pages are just for -the sake of people running GNU software on Unix, which is a secondary -application only.} - -@item manext -The file name extension for the installed man page. This should contain -a period followed by the appropriate digit; it should normally be @samp{.1}. - -@item man1ext -The file name extension for installed section 1 man pages. -@item man2ext -The file name extension for installed section 2 man pages. -@item @dots{} -Use these names instead of @samp{manext} if the package needs to install man -pages in more than one section of the manual. -@end table - -And finally, you should set the following variable: - -@table @samp -@item srcdir -The directory for the sources being compiled. The value of this -variable is normally inserted by the @code{configure} shell script. -(If you are using Autconf, use @samp{srcdir = @@srcdir@@}.) -@end table - -For example: - -@smallexample -@c I have changed some of the comments here slightly to fix an overfull -@c hbox, so the make manual can format correctly. --roland -# Common prefix for installation directories. -# NOTE: This directory must exist when you start the install. -prefix = /usr/local -exec_prefix = $(prefix) -# Where to put the executable for the command `gcc'. -bindir = $(exec_prefix)/bin -# Where to put the directories used by the compiler. -libexecdir = $(exec_prefix)/libexec -# Where to put the Info files. -infodir = $(prefix)/info -@end smallexample - -If your program installs a large number of files into one of the -standard user-specified directories, it might be useful to group them -into a subdirectory particular to that program. If you do this, you -should write the @code{install} rule to create these subdirectories. - -Do not expect the user to include the subdirectory name in the value of -any of the variables listed above. The idea of having a uniform set of -variable names for installation directories is to enable the user to -specify the exact same values for several different GNU packages. In -order for this to be useful, all the packages must be designed so that -they will work sensibly when the user does so. - -@node Standard Targets -@section Standard Targets for Users - -All GNU programs should have the following targets in their Makefiles: - -@table @samp -@item all -Compile the entire program. This should be the default target. This -target need not rebuild any documentation files; Info files should -normally be included in the distribution, and DVI files should be made -only when explicitly asked for. - -By default, the Make rules should compile and link with @samp{-g}, so -that executable programs have debugging symbols. Users who don't mind -being helpless can strip the executables later if they wish. - -@item install -Compile the program and copy the executables, libraries, and so on to -the file names where they should reside for actual use. If there is a -simple test to verify that a program is properly installed, this target -should run that test. - -Do not strip executables when installing them. Devil-may-care users can -use the @code{install-strip} target to do that. - -If possible, write the @code{install} target rule so that it does not -modify anything in the directory where the program was built, provided -@samp{make all} has just been done. This is convenient for building the -program under one user name and installing it under another. - -The commands should create all the directories in which files are to be -installed, if they don't already exist. This includes the directories -specified as the values of the variables @code{prefix} and -@code{exec_prefix}, as well as all subdirectories that are needed. -One way to do this is by means of an @code{installdirs} target -as described below. - -Use @samp{-} before any command for installing a man page, so that -@code{make} will ignore any errors. This is in case there are systems -that don't have the Unix man page documentation system installed. - -The way to install Info files is to copy them into @file{$(infodir)} -with @code{$(INSTALL_DATA)} (@pxref{Command Variables}), and then run -the @code{install-info} program if it is present. @code{install-info} -is a program that edits the Info @file{dir} file to add or update the -menu entry for the given Info file; it is part of the Texinfo package. -Here is a sample rule to install an Info file: - -@comment This example has been carefully formatted for the Make manual. -@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu. -@smallexample -$(DESTDIR)$(infodir)/foo.info: foo.info - $(POST_INSTALL) -# There may be a newer info file in . than in srcdir. - -if test -f foo.info; then d=.; \ - else d=$(srcdir); fi; \ - $(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@@; \ -# Run install-info only if it exists. -# Use `if' instead of just prepending `-' to the -# line so we notice real errors from install-info. -# We use `$(SHELL) -c' because some shells do not -# fail gracefully when there is an unknown command. - if $(SHELL) -c 'install-info --version' \ - >/dev/null 2>&1; then \ - install-info --dir-file=$(DESTDIR)$(infodir)/dir \ - $(DESTDIR)$(infodir)/foo.info; \ - else true; fi -@end smallexample - -When writing the @code{install} target, you must classify all the -commands into three categories: normal ones, @dfn{pre-installation} -commands and @dfn{post-installation} commands. @xref{Install Command -Categories}. - -@item uninstall -Delete all the installed files---the copies that the @samp{install} -target creates. - -This rule should not modify the directories where compilation is done, -only the directories where files are installed. - -The uninstallation commands are divided into three categories, just like -the installation commands. @xref{Install Command Categories}. - -@item install-strip -Like @code{install}, but strip the executable files while installing -them. In many cases, the definition of this target can be very simple: - -@smallexample -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \ - install -@end smallexample - -Normally we do not recommend stripping an executable unless you are sure -the program has no bugs. However, it can be reasonable to install a -stripped executable for actual execution while saving the unstripped -executable elsewhere in case there is a bug. - -@comment The gratuitous blank line here is to make the table look better -@comment in the printed Make manual. Please leave it in. -@item clean - -Delete all files from the current directory that are normally created by -building the program. Don't delete the files that record the -configuration. Also preserve files that could be made by building, but -normally aren't because the distribution comes with them. - -Delete @file{.dvi} files here if they are not part of the distribution. - -@item distclean -Delete all files from the current directory that are created by -configuring or building the program. If you have unpacked the source -and built the program without creating any other files, @samp{make -distclean} should leave only the files that were in the distribution. - -@item mostlyclean -Like @samp{clean}, but may refrain from deleting a few files that people -normally don't want to recompile. For example, the @samp{mostlyclean} -target for GCC does not delete @file{libgcc.a}, because recompiling it -is rarely necessary and takes a lot of time. - -@item maintainer-clean -Delete almost everything from the current directory that can be -reconstructed with this Makefile. This typically includes everything -deleted by @code{distclean}, plus more: C source files produced by -Bison, tags tables, Info files, and so on. - -The reason we say ``almost everything'' is that running the command -@samp{make maintainer-clean} should not delete @file{configure} even if -@file{configure} can be remade using a rule in the Makefile. More generally, -@samp{make maintainer-clean} should not delete anything that needs to -exist in order to run @file{configure} and then begin to build the -program. This is the only exception; @code{maintainer-clean} should -delete everything else that can be rebuilt. - -The @samp{maintainer-clean} target is intended to be used by a maintainer of -the package, not by ordinary users. You may need special tools to -reconstruct some of the files that @samp{make maintainer-clean} deletes. -Since these files are normally included in the distribution, we don't -take care to make them easy to reconstruct. If you find you need to -unpack the full distribution again, don't blame us. - -To help make users aware of this, the commands for the special -@code{maintainer-clean} target should start with these two: - -@smallexample -@@echo 'This command is intended for maintainers to use; it' -@@echo 'deletes files that may need special tools to rebuild.' -@end smallexample - -@item TAGS -Update a tags table for this program. -@c ADR: how? - -@item info -Generate any Info files needed. The best way to write the rules is as -follows: - -@smallexample -info: foo.info - -foo.info: foo.texi chap1.texi chap2.texi - $(MAKEINFO) $(srcdir)/foo.texi -@end smallexample - -@noindent -You must define the variable @code{MAKEINFO} in the Makefile. It should -run the @code{makeinfo} program, which is part of the Texinfo -distribution. - -Normally a GNU distribution comes with Info files, and that means the -Info files are present in the source directory. Therefore, the Make -rule for an info file should update it in the source directory. When -users build the package, ordinarily Make will not update the Info files -because they will already be up to date. - -@item dvi -Generate DVI files for all Texinfo documentation. -For example: - -@smallexample -dvi: foo.dvi - -foo.dvi: foo.texi chap1.texi chap2.texi - $(TEXI2DVI) $(srcdir)/foo.texi -@end smallexample - -@noindent -You must define the variable @code{TEXI2DVI} in the Makefile. It should -run the program @code{texi2dvi}, which is part of the Texinfo -distribution.@footnote{@code{texi2dvi} uses @TeX{} to do the real work -of formatting. @TeX{} is not distributed with Texinfo.} Alternatively, -write just the dependencies, and allow GNU @code{make} to provide the command. - -@item dist -Create a distribution tar file for this program. The tar file should be -set up so that the file names in the tar file start with a subdirectory -name which is the name of the package it is a distribution for. This -name can include the version number. - -For example, the distribution tar file of GCC version 1.40 unpacks into -a subdirectory named @file{gcc-1.40}. - -The easiest way to do this is to create a subdirectory appropriately -named, use @code{ln} or @code{cp} to install the proper files in it, and -then @code{tar} that subdirectory. - -Compress the tar file file with @code{gzip}. For example, the actual -distribution file for GCC version 1.40 is called @file{gcc-1.40.tar.gz}. - -The @code{dist} target should explicitly depend on all non-source files -that are in the distribution, to make sure they are up to date in the -distribution. -@ifset CODESTD -@xref{Releases, , Making Releases}. -@end ifset -@ifclear CODESTD -@xref{Releases, , Making Releases, standards, GNU Coding Standards}. -@end ifclear - -@item check -Perform self-tests (if any). The user must build the program before -running the tests, but need not install the program; you should write -the self-tests so that they work when the program is built but not -installed. -@end table - -The following targets are suggested as conventional names, for programs -in which they are useful. - -@table @code -@item installcheck -Perform installation tests (if any). The user must build and install -the program before running the tests. You should not assume that -@file{$(bindir)} is in the search path. - -@item installdirs -It's useful to add a target named @samp{installdirs} to create the -directories where files are installed, and their parent directories. -There is a script called @file{mkinstalldirs} which is convenient for -this; you can find it in the Texinfo package. -@c It's in /gd/gnu/lib/mkinstalldirs. -You can use a rule like this: - -@comment This has been carefully formatted to look decent in the Make manual. -@comment Please be sure not to make it extend any further to the right.--roland -@smallexample -# Make sure all installation directories (e.g. $(bindir)) -# actually exist by making them if necessary. -installdirs: mkinstalldirs - $(srcdir)/mkinstalldirs $(bindir) $(datadir) \ - $(libdir) $(infodir) \ - $(mandir) -@end smallexample - -This rule should not modify the directories where compilation is done. -It should do nothing but create installation directories. -@end table - -@node Install Command Categories -@section Install Command Categories - -@cindex pre-installation commands -@cindex post-installation commands -When writing the @code{install} target, you must classify all the -commands into three categories: normal ones, @dfn{pre-installation} -commands and @dfn{post-installation} commands. - -Normal commands move files into their proper places, and set their -modes. They may not alter any files except the ones that come entirely -from the package they belong to. - -Pre-installation and post-installation commands may alter other files; -in particular, they can edit global configuration files or data bases. - -Pre-installation commands are typically executed before the normal -commands, and post-installation commands are typically run after the -normal commands. - -The most common use for a post-installation command is to run -@code{install-info}. This cannot be done with a normal command, since -it alters a file (the Info directory) which does not come entirely and -solely from the package being installed. It is a post-installation -command because it needs to be done after the normal command which -installs the package's Info files. - -Most programs don't need any pre-installation commands, but we have the -feature just in case it is needed. - -To classify the commands in the @code{install} rule into these three -categories, insert @dfn{category lines} among them. A category line -specifies the category for the commands that follow. - -A category line consists of a tab and a reference to a special Make -variable, plus an optional comment at the end. There are three -variables you can use, one for each category; the variable name -specifies the category. Category lines are no-ops in ordinary execution -because these three Make variables are normally undefined (and you -@emph{should not} define them in the makefile). - -Here are the three possible category lines, each with a comment that -explains what it means: - -@smallexample - $(PRE_INSTALL) # @r{Pre-install commands follow.} - $(POST_INSTALL) # @r{Post-install commands follow.} - $(NORMAL_INSTALL) # @r{Normal commands follow.} -@end smallexample - -If you don't use a category line at the beginning of the @code{install} -rule, all the commands are classified as normal until the first category -line. If you don't use any category lines, all the commands are -classified as normal. - -These are the category lines for @code{uninstall}: - -@smallexample - $(PRE_UNINSTALL) # @r{Pre-uninstall commands follow.} - $(POST_UNINSTALL) # @r{Post-uninstall commands follow.} - $(NORMAL_UNINSTALL) # @r{Normal commands follow.} -@end smallexample - -Typically, a pre-uninstall command would be used for deleting entries -from the Info directory. - -If the @code{install} or @code{uninstall} target has any dependencies -which act as subroutines of installation, then you should start -@emph{each} dependency's commands with a category line, and start the -main target's commands with a category line also. This way, you can -ensure that each command is placed in the right category regardless of -which of the dependencies actually run. - -Pre-installation and post-installation commands should not run any -programs except for these: - -@example -[ basename bash cat chgrp chmod chown cmp cp dd diff echo -egrep expand expr false fgrep find getopt grep gunzip gzip -hostname install install-info kill ldconfig ln ls md5sum -mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee -test touch true uname xargs yes -@end example - -@cindex binary packages -The reason for distinguishing the commands in this way is for the sake -of making binary packages. Typically a binary package contains all the -executables and other files that need to be installed, and has its own -method of installing them---so it does not need to run the normal -installation commands. But installing the binary package does need to -execute the pre-installation and post-installation commands. - -Programs to build binary packages work by extracting the -pre-installation and post-installation commands. Here is one way of -extracting the pre-installation commands: - -@smallexample -make -n install -o all \ - PRE_INSTALL=pre-install \ - POST_INSTALL=post-install \ - NORMAL_INSTALL=normal-install \ - | gawk -f pre-install.awk -@end smallexample - -@noindent -where the file @file{pre-install.awk} could contain this: - -@smallexample -$0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ @{on = 0@} -on @{print $0@} -$0 ~ /^\t[ \t]*pre_install[ \t]*$/ @{on = 1@} -@end smallexample - -The resulting file of pre-installation commands is executed as a shell -script as part of installing the binary package. diff --git a/contrib/binutils/etc/standards.texi b/contrib/binutils/etc/standards.texi deleted file mode 100644 index 910bf8b0479e..000000000000 --- a/contrib/binutils/etc/standards.texi +++ /dev/null @@ -1,3093 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@c %**start of header -@setfilename standards.info -@settitle GNU Coding Standards -@c This date is automagically updated when you save this file: -@set lastupdate March 13, 1998 -@c %**end of header - -@ifinfo -@format -START-INFO-DIR-ENTRY -* Standards: (standards). GNU coding standards. -END-INFO-DIR-ENTRY -@end format -@end ifinfo - -@c @setchapternewpage odd -@setchapternewpage off - -@c This is used by a cross ref in make-stds.texi -@set CODESTD 1 -@iftex -@set CHAPTER chapter -@end iftex -@ifinfo -@set CHAPTER node -@end ifinfo - -@ifinfo -GNU Coding Standards -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). -@end ignore - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@titlepage -@title GNU Coding Standards -@author Richard Stallman -@author last updated @value{lastupdate} -@page - -@vskip 0pt plus 1filll -Copyright @copyright{} 1992, 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end titlepage - -@ifinfo -@node Top, Preface, (dir), (dir) -@top Version - -Last updated @value{lastupdate}. -@end ifinfo - -@menu -* Preface:: About the GNU Coding Standards -* Intellectual Property:: Keeping Free Software Free -* Design Advice:: General Program Design -* Program Behavior:: Program Behavior for All Programs -* Writing C:: Making The Best Use of C -* Documentation:: Documenting Programs -* Managing Releases:: The Release Process -@end menu - -@node Preface -@chapter About the GNU Coding Standards - -The GNU Coding Standards were written by Richard Stallman and other GNU -Project volunteers. Their purpose is to make the GNU system clean, -consistent, and easy to install. This document can also be read as a -guide to writing portable, robust and reliable programs. It focuses on -programs written in C, but many of the rules and principles are useful -even if you write in another programming language. The rules often -state reasons for writing in a certain way. - -Corrections or suggestions for this document should be sent to -@email{gnu@@gnu.org}. If you make a suggestion, please include a -suggested new wording for it; our time is limited. We prefer a context -diff to the @file{standards.texi} or @file{make-stds.texi} files, but if -you don't have those files, please mail your suggestion anyway. - -This release of the GNU Coding Standards was last updated -@value{lastupdate}. - -@node Intellectual Property -@chapter Keeping Free Software Free - -This @value{CHAPTER} discusses how you can make sure that GNU software -remains unencumbered. - -@menu -* Reading Non-Free Code:: Referring to Proprietary Programs -* Contributions:: Accepting Contributions -@end menu - -@node Reading Non-Free Code -@section Referring to Proprietary Programs - -Don't in any circumstances refer to Unix source code for or during -your work on GNU! (Or to any other proprietary programs.) - -If you have a vague recollection of the internals of a Unix program, -this does not absolutely mean you can't write an imitation of it, but -do try to organize the imitation internally along different lines, -because this is likely to make the details of the Unix version -irrelevant and dissimilar to your results. - -For example, Unix utilities were generally optimized to minimize -memory use; if you go for speed instead, your program will be very -different. You could keep the entire input file in core and scan it -there instead of using stdio. Use a smarter algorithm discovered more -recently than the Unix program. Eliminate use of temporary files. Do -it in one pass instead of two (we did this in the assembler). - -Or, on the contrary, emphasize simplicity instead of speed. For some -applications, the speed of today's computers makes simpler algorithms -adequate. - -Or go for generality. For example, Unix programs often have static -tables or fixed-size strings, which make for arbitrary limits; use -dynamic allocation instead. Make sure your program handles NULs and -other funny characters in the input files. Add a programming language -for extensibility and write part of the program in that language. - -Or turn some parts of the program into independently usable libraries. -Or use a simple garbage collector instead of tracking precisely when -to free memory, or use a new GNU facility such as obstacks. - - -@node Contributions -@section Accepting Contributions - -If someone else sends you a piece of code to add to the program you are -working on, we need legal papers to use it---the same sort of legal -papers we will need to get from you. @emph{Each} significant -contributor to a program must sign some sort of legal papers in order -for us to have clear title to the program. The main author alone is not -enough. - -So, before adding in any contributions from other people, please tell -us, so we can arrange to get the papers. Then wait until we tell you -that we have received the signed papers, before you actually use the -contribution. - -This applies both before you release the program and afterward. If -you receive diffs to fix a bug, and they make significant changes, we -need legal papers for that change. - -This also applies to comments and documentation files. For copyright -law, comments and code are just text. Copyright applies to all kinds of -text, so we need legal papers for all kinds. - -You don't need papers for changes of a few lines here or there, since -they are not significant for copyright purposes. Also, you don't need -papers if all you get from the suggestion is some ideas, not actual code -which you use. For example, if you write a different solution to the -problem, you don't need to get papers. - -We know this is frustrating; it's frustrating for us as well. But if -you don't wait, you are going out on a limb---for example, what if the -contributor's employer won't sign a disclaimer? You might have to take -that code out again! - -The very worst thing is if you forget to tell us about the other -contributor. We could be very embarrassed in court some day as a -result. - -We have more detailed advice for maintainers of programs; if you have -reached the stage of actually maintaining a program for GNU (whether -released or not), please ask us for a copy. - -@node Design Advice -@chapter General Program Design - -This @value{CHAPTER} discusses some of the issues you should take into -account when designing your program. - -@menu -* Compatibility:: Compatibility with other implementations -* Using Extensions:: Using non-standard features -* ANSI C:: Using ANSI C features -* Source Language:: Using languages other than C -@end menu - -@node Compatibility -@section Compatibility with Other Implementations - -With occasional exceptions, utility programs and libraries for GNU -should be upward compatible with those in Berkeley Unix, and upward -compatible with @sc{ansi} C if @sc{ansi} C specifies their behavior, and -upward compatible with @sc{POSIX} if @sc{POSIX} specifies their -behavior. - -When these standards conflict, it is useful to offer compatibility -modes for each of them. - -@sc{ansi} C and @sc{POSIX} prohibit many kinds of extensions. Feel free -to make the extensions anyway, and include a @samp{--ansi}, -@samp{--posix}, or @samp{--compatible} option to turn them off. -However, if the extension has a significant chance of breaking any real -programs or scripts, then it is not really upward compatible. Try to -redesign its interface. - -Many GNU programs suppress extensions that conflict with POSIX if the -environment variable @code{POSIXLY_CORRECT} is defined (even if it is -defined with a null value). Please make your program recognize this -variable if appropriate. - -When a feature is used only by users (not by programs or command -files), and it is done poorly in Unix, feel free to replace it -completely with something totally different and better. (For example, -@code{vi} is replaced with Emacs.) But it is nice to offer a compatible -feature as well. (There is a free @code{vi} clone, so we offer it.) - -Additional useful features not in Berkeley Unix are welcome. - -@node Using Extensions -@section Using Non-standard Features - -Many GNU facilities that already exist support a number of convenient -extensions over the comparable Unix facilities. Whether to use these -extensions in implementing your program is a difficult question. - -On the one hand, using the extensions can make a cleaner program. -On the other hand, people will not be able to build the program -unless the other GNU tools are available. This might cause the -program to work on fewer kinds of machines. - -With some extensions, it might be easy to provide both alternatives. -For example, you can define functions with a ``keyword'' @code{INLINE} -and define that as a macro to expand into either @code{inline} or -nothing, depending on the compiler. - -In general, perhaps it is best not to use the extensions if you can -straightforwardly do without them, but to use the extensions if they -are a big improvement. - -An exception to this rule are the large, established programs (such as -Emacs) which run on a great variety of systems. Such programs would -be broken by use of GNU extensions. - -Another exception is for programs that are used as part of -compilation: anything that must be compiled with other compilers in -order to bootstrap the GNU compilation facilities. If these require -the GNU compiler, then no one can compile them without having them -installed already. That would be no good. - -@node ANSI C -@section @sc{ansi} C and pre-@sc{ansi} C - -Do not ever use the ``trigraph'' feature of @sc{ansi} C. - -@sc{ansi} C is widespread enough now that it is ok to write new programs -that use @sc{ansi} C features (and therefore will not work in -non-@sc{ansi} compilers). And if a program is already written in -@sc{ansi} C, there's no need to convert it to support non-@sc{ansi} -compilers. - -However, it is easy to support non-@sc{ansi} compilers in most programs, -so you might still consider doing so when you write a program. Instead -of writing function definitions in @sc{ansi} prototype form, - -@example -int -foo (int x, int y) -@dots{} -@end example - -@noindent -write the definition in pre-@sc{ansi} style like this, - -@example -int -foo (x, y) - int x, y; -@dots{} -@end example - -@noindent -and use a separate declaration to specify the argument prototype: - -@example -int foo (int, int); -@end example - -You need such a declaration anyway, in a header file, to get the benefit -of @sc{ansi} C prototypes in all the files where the function is called. -And once you have it, you lose nothing by writing the function -definition in the pre-@sc{ansi} style. - -If you don't know non-@sc{ansi} C, there's no need to learn it; just -write in @sc{ansi} C. - -@node Source Language -@section Using Languages Other Than C - -Using a language other than C is like using a non-standard feature: it -will cause trouble for users. Even if GCC supports the other language, -users may find it inconvenient to have to install the compiler for that -other language in order to build your program. For example, if you -write your program in C++, people will have to install the C++ compiler -in order to compile your program. Thus, it is better if you write in C. - -But there are three situations when there is no disadvantage in using -some other language: - -@itemize @bullet -@item -It is okay to use another language if your program contains an -interpreter for that language. - -For example, if your program links with GUILE, it is ok to write part of -the program in Scheme or another language supported by GUILE. - -@item -It is okay to use another language in a tool specifically intended for -use with that language. - -This is okay because the only people who want to build the tool will be -those who have installed the other language anyway. - -@item -If an application is of interest to a narrow community, then perhaps -it's not important if the application is inconvenient to install. -@end itemize - -C has one other advantage over C++ and other compiled languages: more -people know C, so more people will find it easy to read and modify the -program if it is written in C. - -@node Program Behavior -@chapter Program Behavior for All Programs - -This @value{CHAPTER} describes how to write robust software. It also -describes general standards for error messages, the command line interface, -and how libraries should behave. - -@menu -* Semantics:: Writing robust programs -* Libraries:: Library behavior -* Errors:: Formatting error messages -* User Interfaces:: Standards for command line interfaces -* Option Table:: Table of long options. -* Memory Usage:: When and how to care about memory needs -@end menu - -@node Semantics -@section Writing Robust Programs - -Avoid arbitrary limits on the length or number of @emph{any} data -structure, including file names, lines, files, and symbols, by allocating -all data structures dynamically. In most Unix utilities, ``long lines -are silently truncated''. This is not acceptable in a GNU utility. - -Utilities reading files should not drop NUL characters, or any other -nonprinting characters @emph{including those with codes above 0177}. The -only sensible exceptions would be utilities specifically intended for -interface to certain types of printers that can't handle those characters. - -Check every system call for an error return, unless you know you wish to -ignore errors. Include the system error text (from @code{perror} or -equivalent) in @emph{every} error message resulting from a failing -system call, as well as the name of the file if any and the name of the -utility. Just ``cannot open foo.c'' or ``stat failed'' is not -sufficient. - -Check every call to @code{malloc} or @code{realloc} to see if it -returned zero. Check @code{realloc} even if you are making the block -smaller; in a system that rounds block sizes to a power of 2, -@code{realloc} may get a different block if you ask for less space. - -In Unix, @code{realloc} can destroy the storage block if it returns -zero. GNU @code{realloc} does not have this bug: if it fails, the -original block is unchanged. Feel free to assume the bug is fixed. If -you wish to run your program on Unix, and wish to avoid lossage in this -case, you can use the GNU @code{malloc}. - -You must expect @code{free} to alter the contents of the block that was -freed. Anything you want to fetch from the block, you must fetch before -calling @code{free}. - -If @code{malloc} fails in a noninteractive program, make that a fatal -error. In an interactive program (one that reads commands from the -user), it is better to abort the command and return to the command -reader loop. This allows the user to kill other processes to free up -virtual memory, and then try the command again. - -Use @code{getopt_long} to decode arguments, unless the argument syntax -makes this unreasonable. - -When static storage is to be written in during program execution, use -explicit C code to initialize it. Reserve C initialized declarations -for data that will not be changed. -@c ADR: why? - -Try to avoid low-level interfaces to obscure Unix data structures (such -as file directories, utmp, or the layout of kernel memory), since these -are less likely to work compatibly. If you need to find all the files -in a directory, use @code{readdir} or some other high-level interface. -These will be supported compatibly by GNU. - -By default, the GNU system will provide the signal handling functions of -@sc{BSD} and of @sc{POSIX}. So GNU software should be written to use -these. - -In error checks that detect ``impossible'' conditions, just abort. -There is usually no point in printing any message. These checks -indicate the existence of bugs. Whoever wants to fix the bugs will have -to read the source code and run a debugger. So explain the problem with -comments in the source. The relevant data will be in variables, which -are easy to examine with the debugger, so there is no point moving them -elsewhere. - -Do not use a count of errors as the exit status for a program. -@emph{That does not work}, because exit status values are limited to 8 -bits (0 through 255). A single run of the program might have 256 -errors; if you try to return 256 as the exit status, the parent process -will see 0 as the status, and it will appear that the program succeeded. - -If you make temporary files, check the @code{TMPDIR} environment -variable; if that variable is defined, use the specified directory -instead of @file{/tmp}. - -@node Libraries -@section Library Behavior - -Try to make library functions reentrant. If they need to do dynamic -storage allocation, at least try to avoid any nonreentrancy aside from -that of @code{malloc} itself. - -Here are certain name conventions for libraries, to avoid name -conflicts. - -Choose a name prefix for the library, more than two characters long. -All external function and variable names should start with this -prefix. In addition, there should only be one of these in any given -library member. This usually means putting each one in a separate -source file. - -An exception can be made when two external symbols are always used -together, so that no reasonable program could use one without the -other; then they can both go in the same file. - -External symbols that are not documented entry points for the user -should have names beginning with @samp{_}. They should also contain -the chosen name prefix for the library, to prevent collisions with -other libraries. These can go in the same files with user entry -points if you like. - -Static functions and variables can be used as you like and need not -fit any naming convention. - -@node Errors -@section Formatting Error Messages - -Error messages from compilers should look like this: - -@example -@var{source-file-name}:@var{lineno}: @var{message} -@end example - -Error messages from other noninteractive programs should look like this: - -@example -@var{program}:@var{source-file-name}:@var{lineno}: @var{message} -@end example - -@noindent -when there is an appropriate source file, or like this: - -@example -@var{program}: @var{message} -@end example - -@noindent -when there is no relevant source file. - -In an interactive program (one that is reading commands from a -terminal), it is better not to include the program name in an error -message. The place to indicate which program is running is in the -prompt or with the screen layout. (When the same program runs with -input from a source other than a terminal, it is not interactive and -would do best to print error messages using the noninteractive style.) - -The string @var{message} should not begin with a capital letter when -it follows a program name and/or file name. Also, it should not end -with a period. - -Error messages from interactive programs, and other messages such as -usage messages, should start with a capital letter. But they should not -end with a period. - -@node User Interfaces -@section Standards for Command Line Interfaces - -Please don't make the behavior of a utility depend on the name used -to invoke it. It is useful sometimes to make a link to a utility -with a different name, and that should not change what it does. - -Instead, use a run time option or a compilation switch or both -to select among the alternate behaviors. - -Likewise, please don't make the behavior of the program depend on the -type of output device it is used with. Device independence is an -important principle of the system's design; do not compromise it -merely to save someone from typing an option now and then. - -If you think one behavior is most useful when the output is to a -terminal, and another is most useful when the output is a file or a -pipe, then it is usually best to make the default behavior the one that -is useful with output to a terminal, and have an option for the other -behavior. - -Compatibility requires certain programs to depend on the type of output -device. It would be disastrous if @code{ls} or @code{sh} did not do so -in the way all users expect. In some of these cases, we supplement the -program with a preferred alternate version that does not depend on the -output device type. For example, we provide a @code{dir} program much -like @code{ls} except that its default output format is always -multi-column format. - -It is a good idea to follow the @sc{POSIX} guidelines for the -command-line options of a program. The easiest way to do this is to use -@code{getopt} to parse them. Note that the GNU version of @code{getopt} -will normally permit options anywhere among the arguments unless the -special argument @samp{--} is used. This is not what @sc{POSIX} -specifies; it is a GNU extension. - -Please define long-named options that are equivalent to the -single-letter Unix-style options. We hope to make GNU more user -friendly this way. This is easy to do with the GNU function -@code{getopt_long}. - -One of the advantages of long-named options is that they can be -consistent from program to program. For example, users should be able -to expect the ``verbose'' option of any GNU program which has one, to be -spelled precisely @samp{--verbose}. To achieve this uniformity, look at -the table of common long-option names when you choose the option names -for your program (@pxref{Option Table}). - -It is usually a good idea for file names given as ordinary arguments to -be input files only; any output files would be specified using options -(preferably @samp{-o} or @samp{--output}). Even if you allow an output -file name as an ordinary argument for compatibility, try to provide an -option as another way to specify it. This will lead to more consistency -among GNU utilities, and fewer idiosyncracies for users to remember. - -All programs should support two standard options: @samp{--version} -and @samp{--help}. - -@table @code -@item --version -This option should direct the program to information about its name, -version, origin and legal status, all on standard output, and then exit -successfully. Other options and arguments should be ignored once this -is seen, and the program should not perform its normal function. - -The first line is meant to be easy for a program to parse; the version -number proper starts after the last space. In addition, it contains -the canonical name for this program, in this format: - -@example -GNU Emacs 19.30 -@end example - -@noindent -The program's name should be a constant string; @emph{don't} compute it -from @code{argv[0]}. The idea is to state the standard or canonical -name for the program, not its file name. There are other ways to find -out the precise file name where a command is found in @code{PATH}. - -If the program is a subsidiary part of a larger package, mention the -package name in parentheses, like this: - -@example -emacsserver (GNU Emacs) 19.30 -@end example - -@noindent -If the package has a version number which is different from this -program's version number, you can mention the package version number -just before the close-parenthesis. - -If you @strong{need} to mention the version numbers of libraries which -are distributed separately from the package which contains this program, -you can do so by printing an additional line of version info for each -library you want to mention. Use the same format for these lines as for -the first line. - -Please do not mention all of the libraries that the program uses ``just -for completeness''---that would produce a lot of unhelpful clutter. -Please mention library version numbers only if you find in practice that -they are very important to you in debugging. - -The following line, after the version number line or lines, should be a -copyright notice. If more than one copyright notice is called for, put -each on a separate line. - -Next should follow a brief statement that the program is free software, -and that users are free to copy and change it on certain conditions. If -the program is covered by the GNU GPL, say so here. Also mention that -there is no warranty, to the extent permitted by law. - -It is ok to finish the output with a list of the major authors of the -program, as a way of giving credit. - -Here's an example of output that follows these rules: - -@smallexample -GNU Emacs 19.34.5 -Copyright (C) 1996 Free Software Foundation, Inc. -GNU Emacs comes with NO WARRANTY, -to the extent permitted by law. -You may redistribute copies of GNU Emacs -under the terms of the GNU General Public License. -For more information about these matters, -see the files named COPYING. -@end smallexample - -You should adapt this to your program, of course, filling in the proper -year, copyright holder, name of program, and the references to -distribution terms, and changing the rest of the wording as necessary. - -This copyright notice only needs to mention the most recent year in -which changes were made---there's no need to list the years for previous -versions' changes. You don't have to mention the name of the program in -these notices, if that is inconvenient, since it appeared in the first -line. - -@item --help -This option should output brief documentation for how to invoke the -program, on standard output, then exit successfully. Other options and -arguments should be ignored once this is seen, and the program should -not perform its normal function. - -Near the end of the @samp{--help} option's output there should be a line -that says where to mail bug reports. It should have this format: - -@example -Report bugs to @var{mailing-address}. -@end example -@end table - -@node Option Table -@section Table of Long Options - -Here is a table of long options used by GNU programs. It is surely -incomplete, but we aim to list all the options that a new program might -want to be compatible with. If you use names not already in the table, -please send @email{gnu@@gnu.org} a list of them, with their -meanings, so we can update the table. - -@c Please leave newlines between items in this table; it's much easier -@c to update when it isn't completely squashed together and unreadable. -@c When there is more than one short option for a long option name, put -@c a semicolon between the lists of the programs that use them, not a -@c period. --friedman - -@table @samp -@item after-date -@samp{-N} in @code{tar}. - -@item all -@samp{-a} in @code{du}, @code{ls}, @code{nm}, @code{stty}, @code{uname}, -and @code{unexpand}. - -@item all-text -@samp{-a} in @code{diff}. - -@item almost-all -@samp{-A} in @code{ls}. - -@item append -@samp{-a} in @code{etags}, @code{tee}, @code{time}; -@samp{-r} in @code{tar}. - -@item archive -@samp{-a} in @code{cp}. - -@item archive-name -@samp{-n} in @code{shar}. - -@item arglength -@samp{-l} in @code{m4}. - -@item ascii -@samp{-a} in @code{diff}. - -@item assign -@samp{-v} in @code{gawk}. - -@item assume-new -@samp{-W} in Make. - -@item assume-old -@samp{-o} in Make. - -@item auto-check -@samp{-a} in @code{recode}. - -@item auto-pager -@samp{-a} in @code{wdiff}. - -@item auto-reference -@samp{-A} in @code{ptx}. - -@item avoid-wraps -@samp{-n} in @code{wdiff}. - -@item backward-search -@samp{-B} in @code{ctags}. - -@item basename -@samp{-f} in @code{shar}. - -@item batch -Used in GDB. - -@item baud -Used in GDB. - -@item before -@samp{-b} in @code{tac}. - -@item binary -@samp{-b} in @code{cpio} and @code{diff}. - -@item bits-per-code -@samp{-b} in @code{shar}. - -@item block-size -Used in @code{cpio} and @code{tar}. - -@item blocks -@samp{-b} in @code{head} and @code{tail}. - -@item break-file -@samp{-b} in @code{ptx}. - -@item brief -Used in various programs to make output shorter. - -@item bytes -@samp{-c} in @code{head}, @code{split}, and @code{tail}. - -@item c@t{++} -@samp{-C} in @code{etags}. - -@item catenate -@samp{-A} in @code{tar}. - -@item cd -Used in various programs to specify the directory to use. - -@item changes -@samp{-c} in @code{chgrp} and @code{chown}. - -@item classify -@samp{-F} in @code{ls}. - -@item colons -@samp{-c} in @code{recode}. - -@item command -@samp{-c} in @code{su}; -@samp{-x} in GDB. - -@item compare -@samp{-d} in @code{tar}. - -@item compat -Used in @code{gawk}. - -@item compress -@samp{-Z} in @code{tar} and @code{shar}. - -@item concatenate -@samp{-A} in @code{tar}. - -@item confirmation -@samp{-w} in @code{tar}. - -@item context -Used in @code{diff}. - -@item copyleft -@samp{-W copyleft} in @code{gawk}. - -@item copyright -@samp{-C} in @code{ptx}, @code{recode}, and @code{wdiff}; -@samp{-W copyright} in @code{gawk}. - -@item core -Used in GDB. - -@item count -@samp{-q} in @code{who}. - -@item count-links -@samp{-l} in @code{du}. - -@item create -Used in @code{tar} and @code{cpio}. - -@item cut-mark -@samp{-c} in @code{shar}. - -@item cxref -@samp{-x} in @code{ctags}. - -@item date -@samp{-d} in @code{touch}. - -@item debug -@samp{-d} in Make and @code{m4}; -@samp{-t} in Bison. - -@item define -@samp{-D} in @code{m4}. - -@item defines -@samp{-d} in Bison and @code{ctags}. - -@item delete -@samp{-D} in @code{tar}. - -@item dereference -@samp{-L} in @code{chgrp}, @code{chown}, @code{cpio}, @code{du}, -@code{ls}, and @code{tar}. - -@item dereference-args -@samp{-D} in @code{du}. - -@item diacritics -@samp{-d} in @code{recode}. - -@item dictionary-order -@samp{-d} in @code{look}. - -@item diff -@samp{-d} in @code{tar}. - -@item digits -@samp{-n} in @code{csplit}. - -@item directory -Specify the directory to use, in various programs. In @code{ls}, it -means to show directories themselves rather than their contents. In -@code{rm} and @code{ln}, it means to not treat links to directories -specially. - -@item discard-all -@samp{-x} in @code{strip}. - -@item discard-locals -@samp{-X} in @code{strip}. - -@item dry-run -@samp{-n} in Make. - -@item ed -@samp{-e} in @code{diff}. - -@item elide-empty-files -@samp{-z} in @code{csplit}. - -@item end-delete -@samp{-x} in @code{wdiff}. - -@item end-insert -@samp{-z} in @code{wdiff}. - -@item entire-new-file -@samp{-N} in @code{diff}. - -@item environment-overrides -@samp{-e} in Make. - -@item eof -@samp{-e} in @code{xargs}. - -@item epoch -Used in GDB. - -@item error-limit -Used in @code{makeinfo}. - -@item error-output -@samp{-o} in @code{m4}. - -@item escape -@samp{-b} in @code{ls}. - -@item exclude-from -@samp{-X} in @code{tar}. - -@item exec -Used in GDB. - -@item exit -@samp{-x} in @code{xargs}. - -@item exit-0 -@samp{-e} in @code{unshar}. - -@item expand-tabs -@samp{-t} in @code{diff}. - -@item expression -@samp{-e} in @code{sed}. - -@item extern-only -@samp{-g} in @code{nm}. - -@item extract -@samp{-i} in @code{cpio}; -@samp{-x} in @code{tar}. - -@item faces -@samp{-f} in @code{finger}. - -@item fast -@samp{-f} in @code{su}. - -@item fatal-warnings -@samp{-E} in @code{m4}. - -@item file -@samp{-f} in @code{info}, @code{gawk}, Make, @code{mt}, and @code{tar}; -@samp{-n} in @code{sed}; -@samp{-r} in @code{touch}. - -@item field-separator -@samp{-F} in @code{gawk}. - -@item file-prefix -@samp{-b} in Bison. - -@item file-type -@samp{-F} in @code{ls}. - -@item files-from -@samp{-T} in @code{tar}. - -@item fill-column -Used in @code{makeinfo}. - -@item flag-truncation -@samp{-F} in @code{ptx}. - -@item fixed-output-files -@samp{-y} in Bison. - -@item follow -@samp{-f} in @code{tail}. - -@item footnote-style -Used in @code{makeinfo}. - -@item force -@samp{-f} in @code{cp}, @code{ln}, @code{mv}, and @code{rm}. - -@item force-prefix -@samp{-F} in @code{shar}. - -@item format -Used in @code{ls}, @code{time}, and @code{ptx}. - -@item freeze-state -@samp{-F} in @code{m4}. - -@item fullname -Used in GDB. - -@item gap-size -@samp{-g} in @code{ptx}. - -@item get -@samp{-x} in @code{tar}. - -@item graphic -@samp{-i} in @code{ul}. - -@item graphics -@samp{-g} in @code{recode}. - -@item group -@samp{-g} in @code{install}. - -@item gzip -@samp{-z} in @code{tar} and @code{shar}. - -@item hashsize -@samp{-H} in @code{m4}. - -@item header -@samp{-h} in @code{objdump} and @code{recode} - -@item heading -@samp{-H} in @code{who}. - -@item help -Used to ask for brief usage information. - -@item here-delimiter -@samp{-d} in @code{shar}. - -@item hide-control-chars -@samp{-q} in @code{ls}. - -@item idle -@samp{-u} in @code{who}. - -@item ifdef -@samp{-D} in @code{diff}. - -@item ignore -@samp{-I} in @code{ls}; -@samp{-x} in @code{recode}. - -@item ignore-all-space -@samp{-w} in @code{diff}. - -@item ignore-backups -@samp{-B} in @code{ls}. - -@item ignore-blank-lines -@samp{-B} in @code{diff}. - -@item ignore-case -@samp{-f} in @code{look} and @code{ptx}; -@samp{-i} in @code{diff} and @code{wdiff}. - -@item ignore-errors -@samp{-i} in Make. - -@item ignore-file -@samp{-i} in @code{ptx}. - -@item ignore-indentation -@samp{-I} in @code{etags}. - -@item ignore-init-file -@samp{-f} in Oleo. - -@item ignore-interrupts -@samp{-i} in @code{tee}. - -@item ignore-matching-lines -@samp{-I} in @code{diff}. - -@item ignore-space-change -@samp{-b} in @code{diff}. - -@item ignore-zeros -@samp{-i} in @code{tar}. - -@item include -@samp{-i} in @code{etags}; -@samp{-I} in @code{m4}. - -@item include-dir -@samp{-I} in Make. - -@item incremental -@samp{-G} in @code{tar}. - -@item info -@samp{-i}, @samp{-l}, and @samp{-m} in Finger. - -@item initial -@samp{-i} in @code{expand}. - -@item initial-tab -@samp{-T} in @code{diff}. - -@item inode -@samp{-i} in @code{ls}. - -@item interactive -@samp{-i} in @code{cp}, @code{ln}, @code{mv}, @code{rm}; -@samp{-e} in @code{m4}; -@samp{-p} in @code{xargs}; -@samp{-w} in @code{tar}. - -@item intermix-type -@samp{-p} in @code{shar}. - -@item jobs -@samp{-j} in Make. - -@item just-print -@samp{-n} in Make. - -@item keep-going -@samp{-k} in Make. - -@item keep-files -@samp{-k} in @code{csplit}. - -@item kilobytes -@samp{-k} in @code{du} and @code{ls}. - -@item language -@samp{-l} in @code{etags}. - -@item less-mode -@samp{-l} in @code{wdiff}. - -@item level-for-gzip -@samp{-g} in @code{shar}. - -@item line-bytes -@samp{-C} in @code{split}. - -@item lines -Used in @code{split}, @code{head}, and @code{tail}. - -@item link -@samp{-l} in @code{cpio}. - -@item lint -@itemx lint-old -Used in @code{gawk}. - -@item list -@samp{-t} in @code{cpio}; -@samp{-l} in @code{recode}. - -@item list -@samp{-t} in @code{tar}. - -@item literal -@samp{-N} in @code{ls}. - -@item load-average -@samp{-l} in Make. - -@item login -Used in @code{su}. - -@item machine -No listing of which programs already use this; -someone should check to -see if any actually do, and tell @email{gnu@@gnu.org}. - -@item macro-name -@samp{-M} in @code{ptx}. - -@item mail -@samp{-m} in @code{hello} and @code{uname}. - -@item make-directories -@samp{-d} in @code{cpio}. - -@item makefile -@samp{-f} in Make. - -@item mapped -Used in GDB. - -@item max-args -@samp{-n} in @code{xargs}. - -@item max-chars -@samp{-n} in @code{xargs}. - -@item max-lines -@samp{-l} in @code{xargs}. - -@item max-load -@samp{-l} in Make. - -@item max-procs -@samp{-P} in @code{xargs}. - -@item mesg -@samp{-T} in @code{who}. - -@item message -@samp{-T} in @code{who}. - -@item minimal -@samp{-d} in @code{diff}. - -@item mixed-uuencode -@samp{-M} in @code{shar}. - -@item mode -@samp{-m} in @code{install}, @code{mkdir}, and @code{mkfifo}. - -@item modification-time -@samp{-m} in @code{tar}. - -@item multi-volume -@samp{-M} in @code{tar}. - -@item name-prefix -@samp{-a} in Bison. - -@item nesting-limit -@samp{-L} in @code{m4}. - -@item net-headers -@samp{-a} in @code{shar}. - -@item new-file -@samp{-W} in Make. - -@item no-builtin-rules -@samp{-r} in Make. - -@item no-character-count -@samp{-w} in @code{shar}. - -@item no-check-existing -@samp{-x} in @code{shar}. - -@item no-common -@samp{-3} in @code{wdiff}. - -@item no-create -@samp{-c} in @code{touch}. - -@item no-defines -@samp{-D} in @code{etags}. - -@item no-deleted -@samp{-1} in @code{wdiff}. - -@item no-dereference -@samp{-d} in @code{cp}. - -@item no-inserted -@samp{-2} in @code{wdiff}. - -@item no-keep-going -@samp{-S} in Make. - -@item no-lines -@samp{-l} in Bison. - -@item no-piping -@samp{-P} in @code{shar}. - -@item no-prof -@samp{-e} in @code{gprof}. - -@item no-regex -@samp{-R} in @code{etags}. - -@item no-sort -@samp{-p} in @code{nm}. - -@item no-split -Used in @code{makeinfo}. - -@item no-static -@samp{-a} in @code{gprof}. - -@item no-time -@samp{-E} in @code{gprof}. - -@item no-timestamp -@samp{-m} in @code{shar}. - -@item no-validate -Used in @code{makeinfo}. - -@item no-wait -Used in @code{emacsclient}. - -@item no-warn -Used in various programs to inhibit warnings. - -@item node -@samp{-n} in @code{info}. - -@item nodename -@samp{-n} in @code{uname}. - -@item nonmatching -@samp{-f} in @code{cpio}. - -@item nstuff -@samp{-n} in @code{objdump}. - -@item null -@samp{-0} in @code{xargs}. - -@item number -@samp{-n} in @code{cat}. - -@item number-nonblank -@samp{-b} in @code{cat}. - -@item numeric-sort -@samp{-n} in @code{nm}. - -@item numeric-uid-gid -@samp{-n} in @code{cpio} and @code{ls}. - -@item nx -Used in GDB. - -@item old-archive -@samp{-o} in @code{tar}. - -@item old-file -@samp{-o} in Make. - -@item one-file-system -@samp{-l} in @code{tar}, @code{cp}, and @code{du}. - -@item only-file -@samp{-o} in @code{ptx}. - -@item only-prof -@samp{-f} in @code{gprof}. - -@item only-time -@samp{-F} in @code{gprof}. - -@item output -In various programs, specify the output file name. - -@item output-prefix -@samp{-o} in @code{shar}. - -@item override -@samp{-o} in @code{rm}. - -@item overwrite -@samp{-c} in @code{unshar}. - -@item owner -@samp{-o} in @code{install}. - -@item paginate -@samp{-l} in @code{diff}. - -@item paragraph-indent -Used in @code{makeinfo}. - -@item parents -@samp{-p} in @code{mkdir} and @code{rmdir}. - -@item pass-all -@samp{-p} in @code{ul}. - -@item pass-through -@samp{-p} in @code{cpio}. - -@item port -@samp{-P} in @code{finger}. - -@item portability -@samp{-c} in @code{cpio} and @code{tar}. - -@item posix -Used in @code{gawk}. - -@item prefix-builtins -@samp{-P} in @code{m4}. - -@item prefix -@samp{-f} in @code{csplit}. - -@item preserve -Used in @code{tar} and @code{cp}. - -@item preserve-environment -@samp{-p} in @code{su}. - -@item preserve-modification-time -@samp{-m} in @code{cpio}. - -@item preserve-order -@samp{-s} in @code{tar}. - -@item preserve-permissions -@samp{-p} in @code{tar}. - -@item print -@samp{-l} in @code{diff}. - -@item print-chars -@samp{-L} in @code{cmp}. - -@item print-data-base -@samp{-p} in Make. - -@item print-directory -@samp{-w} in Make. - -@item print-file-name -@samp{-o} in @code{nm}. - -@item print-symdefs -@samp{-s} in @code{nm}. - -@item printer -@samp{-p} in @code{wdiff}. - -@item prompt -@samp{-p} in @code{ed}. - -@item query-user -@samp{-X} in @code{shar}. - -@item question -@samp{-q} in Make. - -@item quiet -Used in many programs to inhibit the usual output. @strong{Note:} every -program accepting @samp{--quiet} should accept @samp{--silent} as a -synonym. - -@item quiet-unshar -@samp{-Q} in @code{shar} - -@item quote-name -@samp{-Q} in @code{ls}. - -@item rcs -@samp{-n} in @code{diff}. - -@item re-interval -Used in @code{gawk}. - -@item read-full-blocks -@samp{-B} in @code{tar}. - -@item readnow -Used in GDB. - -@item recon -@samp{-n} in Make. - -@item record-number -@samp{-R} in @code{tar}. - -@item recursive -Used in @code{chgrp}, @code{chown}, @code{cp}, @code{ls}, @code{diff}, -and @code{rm}. - -@item reference-limit -Used in @code{makeinfo}. - -@item references -@samp{-r} in @code{ptx}. - -@item regex -@samp{-r} in @code{tac} and @code{etags}. - -@item release -@samp{-r} in @code{uname}. - -@item reload-state -@samp{-R} in @code{m4}. - -@item relocation -@samp{-r} in @code{objdump}. - -@item rename -@samp{-r} in @code{cpio}. - -@item replace -@samp{-i} in @code{xargs}. - -@item report-identical-files -@samp{-s} in @code{diff}. - -@item reset-access-time -@samp{-a} in @code{cpio}. - -@item reverse -@samp{-r} in @code{ls} and @code{nm}. - -@item reversed-ed -@samp{-f} in @code{diff}. - -@item right-side-defs -@samp{-R} in @code{ptx}. - -@item same-order -@samp{-s} in @code{tar}. - -@item same-permissions -@samp{-p} in @code{tar}. - -@item save -@samp{-g} in @code{stty}. - -@item se -Used in GDB. - -@item sentence-regexp -@samp{-S} in @code{ptx}. - -@item separate-dirs -@samp{-S} in @code{du}. - -@item separator -@samp{-s} in @code{tac}. - -@item sequence -Used by @code{recode} to chose files or pipes for sequencing passes. - -@item shell -@samp{-s} in @code{su}. - -@item show-all -@samp{-A} in @code{cat}. - -@item show-c-function -@samp{-p} in @code{diff}. - -@item show-ends -@samp{-E} in @code{cat}. - -@item show-function-line -@samp{-F} in @code{diff}. - -@item show-tabs -@samp{-T} in @code{cat}. - -@item silent -Used in many programs to inhibit the usual output. -@strong{Note:} every program accepting -@samp{--silent} should accept @samp{--quiet} as a synonym. - -@item size -@samp{-s} in @code{ls}. - -@item sort -Used in @code{ls}. - -@item source -@samp{-W source} in @code{gawk}. - -@item sparse -@samp{-S} in @code{tar}. - -@item speed-large-files -@samp{-H} in @code{diff}. - -@item split-at -@samp{-E} in @code{unshar}. - -@item split-size-limit -@samp{-L} in @code{shar}. - -@item squeeze-blank -@samp{-s} in @code{cat}. - -@item start-delete -@samp{-w} in @code{wdiff}. - -@item start-insert -@samp{-y} in @code{wdiff}. - -@item starting-file -Used in @code{tar} and @code{diff} to specify which file within -a directory to start processing with. - -@item statistics -@samp{-s} in @code{wdiff}. - -@item stdin-file-list -@samp{-S} in @code{shar}. - -@item stop -@samp{-S} in Make. - -@item strict -@samp{-s} in @code{recode}. - -@item strip -@samp{-s} in @code{install}. - -@item strip-all -@samp{-s} in @code{strip}. - -@item strip-debug -@samp{-S} in @code{strip}. - -@item submitter -@samp{-s} in @code{shar}. - -@item suffix -@samp{-S} in @code{cp}, @code{ln}, @code{mv}. - -@item suffix-format -@samp{-b} in @code{csplit}. - -@item sum -@samp{-s} in @code{gprof}. - -@item summarize -@samp{-s} in @code{du}. - -@item symbolic -@samp{-s} in @code{ln}. - -@item symbols -Used in GDB and @code{objdump}. - -@item synclines -@samp{-s} in @code{m4}. - -@item sysname -@samp{-s} in @code{uname}. - -@item tabs -@samp{-t} in @code{expand} and @code{unexpand}. - -@item tabsize -@samp{-T} in @code{ls}. - -@item terminal -@samp{-T} in @code{tput} and @code{ul}. -@samp{-t} in @code{wdiff}. - -@item text -@samp{-a} in @code{diff}. - -@item text-files -@samp{-T} in @code{shar}. - -@item time -Used in @code{ls} and @code{touch}. - -@item to-stdout -@samp{-O} in @code{tar}. - -@item total -@samp{-c} in @code{du}. - -@item touch -@samp{-t} in Make, @code{ranlib}, and @code{recode}. - -@item trace -@samp{-t} in @code{m4}. - -@item traditional -@samp{-t} in @code{hello}; -@samp{-W traditional} in @code{gawk}; -@samp{-G} in @code{ed}, @code{m4}, and @code{ptx}. - -@item tty -Used in GDB. - -@item typedefs -@samp{-t} in @code{ctags}. - -@item typedefs-and-c++ -@samp{-T} in @code{ctags}. - -@item typeset-mode -@samp{-t} in @code{ptx}. - -@item uncompress -@samp{-z} in @code{tar}. - -@item unconditional -@samp{-u} in @code{cpio}. - -@item undefine -@samp{-U} in @code{m4}. - -@item undefined-only -@samp{-u} in @code{nm}. - -@item update -@samp{-u} in @code{cp}, @code{ctags}, @code{mv}, @code{tar}. - -@item usage -Used in @code{gawk}; same as @samp{--help}. - -@item uuencode -@samp{-B} in @code{shar}. - -@item vanilla-operation -@samp{-V} in @code{shar}. - -@item verbose -Print more information about progress. Many programs support this. - -@item verify -@samp{-W} in @code{tar}. - -@item version -Print the version number. - -@item version-control -@samp{-V} in @code{cp}, @code{ln}, @code{mv}. - -@item vgrind -@samp{-v} in @code{ctags}. - -@item volume -@samp{-V} in @code{tar}. - -@item what-if -@samp{-W} in Make. - -@item whole-size-limit -@samp{-l} in @code{shar}. - -@item width -@samp{-w} in @code{ls} and @code{ptx}. - -@item word-regexp -@samp{-W} in @code{ptx}. - -@item writable -@samp{-T} in @code{who}. - -@item zeros -@samp{-z} in @code{gprof}. -@end table - -@node Memory Usage -@section Memory Usage - -If it typically uses just a few meg of memory, don't bother making any -effort to reduce memory usage. For example, if it is impractical for -other reasons to operate on files more than a few meg long, it is -reasonable to read entire input files into core to operate on them. - -However, for programs such as @code{cat} or @code{tail}, that can -usefully operate on very large files, it is important to avoid using a -technique that would artificially limit the size of files it can handle. -If a program works by lines and could be applied to arbitrary -user-supplied input files, it should keep only a line in memory, because -this is not very hard and users will want to be able to operate on input -files that are bigger than will fit in core all at once. - -If your program creates complicated data structures, just make them in -core and give a fatal error if @code{malloc} returns zero. - -@node Writing C -@chapter Making The Best Use of C - -This @value{CHAPTER} provides advice on how best to use the C language -when writing GNU software. - -@menu -* Formatting:: Formatting Your Source Code -* Comments:: Commenting Your Work -* Syntactic Conventions:: Clean Use of C Constructs -* Names:: Naming Variables and Functions -* System Portability:: Portability between different operating systems -* CPU Portability:: Supporting the range of CPU types -* System Functions:: Portability and ``standard'' library functions -* Internationalization:: Techniques for internationalization -* Mmap:: How you can safely use @code{mmap}. -@end menu - -@node Formatting -@section Formatting Your Source Code - -It is important to put the open-brace that starts the body of a C -function in column zero, and avoid putting any other open-brace or -open-parenthesis or open-bracket in column zero. Several tools look -for open-braces in column zero to find the beginnings of C functions. -These tools will not work on code not formatted that way. - -It is also important for function definitions to start the name of the -function in column zero. This helps people to search for function -definitions, and may also help certain tools recognize them. Thus, -the proper format is this: - -@example -static char * -concat (s1, s2) /* Name starts in column zero here */ - char *s1, *s2; -@{ /* Open brace in column zero here */ - @dots{} -@} -@end example - -@noindent -or, if you want to use @sc{ansi} C, format the definition like this: - -@example -static char * -concat (char *s1, char *s2) -@{ - @dots{} -@} -@end example - -In @sc{ansi} C, if the arguments don't fit nicely on one line, -split it like this: - -@example -int -lots_of_args (int an_integer, long a_long, short a_short, - double a_double, float a_float) -@dots{} -@end example - -For the body of the function, we prefer code formatted like this: - -@example -if (x < foo (y, z)) - haha = bar[4] + 5; -else - @{ - while (z) - @{ - haha += foo (z, z); - z--; - @} - return ++x + bar (); - @} -@end example - -We find it easier to read a program when it has spaces before the -open-parentheses and after the commas. Especially after the commas. - -When you split an expression into multiple lines, split it -before an operator, not after one. Here is the right way: - -@example -if (foo_this_is_long && bar > win (x, y, z) - && remaining_condition) -@end example - -Try to avoid having two operators of different precedence at the same -level of indentation. For example, don't write this: - -@example -mode = (inmode[j] == VOIDmode - || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]) - ? outmode[j] : inmode[j]); -@end example - -Instead, use extra parentheses so that the indentation shows the nesting: - -@example -mode = ((inmode[j] == VOIDmode - || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]))) - ? outmode[j] : inmode[j]); -@end example - -Insert extra parentheses so that Emacs will indent the code properly. -For example, the following indentation looks nice if you do it by hand, -but Emacs would mess it up: - -@example -v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 - + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000; -@end example - -But adding a set of parentheses solves the problem: - -@example -v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 - + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000); -@end example - -Format do-while statements like this: - -@example -do - @{ - a = foo (a); - @} -while (a > 0); -@end example - -Please use formfeed characters (control-L) to divide the program into -pages at logical places (but not within a function). It does not matter -just how long the pages are, since they do not have to fit on a printed -page. The formfeeds should appear alone on lines by themselves. - - -@node Comments -@section Commenting Your Work - -Every program should start with a comment saying briefly what it is for. -Example: @samp{fmt - filter for simple filling of text}. - -Please write the comments in a GNU program in English, because English -is the one language that nearly all programmers in all countries can -read. If you do not write English well, please write comments in -English as well as you can, then ask other people to help rewrite them. -If you can't write comments in English, please find someone to work with -you and translate your comments into English. - -Please put a comment on each function saying what the function does, -what sorts of arguments it gets, and what the possible values of -arguments mean and are used for. It is not necessary to duplicate in -words the meaning of the C argument declarations, if a C type is being -used in its customary fashion. If there is anything nonstandard about -its use (such as an argument of type @code{char *} which is really the -address of the second character of a string, not the first), or any -possible values that would not work the way one would expect (such as, -that strings containing newlines are not guaranteed to work), be sure -to say so. - -Also explain the significance of the return value, if there is one. - -Please put two spaces after the end of a sentence in your comments, so -that the Emacs sentence commands will work. Also, please write -complete sentences and capitalize the first word. If a lower-case -identifier comes at the beginning of a sentence, don't capitalize it! -Changing the spelling makes it a different identifier. If you don't -like starting a sentence with a lower case letter, write the sentence -differently (e.g., ``The identifier lower-case is @dots{}''). - -The comment on a function is much clearer if you use the argument -names to speak about the argument values. The variable name itself -should be lower case, but write it in upper case when you are speaking -about the value rather than the variable itself. Thus, ``the inode -number NODE_NUM'' rather than ``an inode''. - -There is usually no purpose in restating the name of the function in -the comment before it, because the reader can see that for himself. -There might be an exception when the comment is so long that the function -itself would be off the bottom of the screen. - -There should be a comment on each static variable as well, like this: - -@example -/* Nonzero means truncate lines in the display; - zero means continue them. */ -int truncate_lines; -@end example - -Every @samp{#endif} should have a comment, except in the case of short -conditionals (just a few lines) that are not nested. The comment should -state the condition of the conditional that is ending, @emph{including -its sense}. @samp{#else} should have a comment describing the condition -@emph{and sense} of the code that follows. For example: - -@example -@group -#ifdef foo - @dots{} -#else /* not foo */ - @dots{} -#endif /* not foo */ -@end group -@group -#ifdef foo - @dots{} -#endif /* foo */ -@end group -@end example - -@noindent -but, by contrast, write the comments this way for a @samp{#ifndef}: - -@example -@group -#ifndef foo - @dots{} -#else /* foo */ - @dots{} -#endif /* foo */ -@end group -@group -#ifndef foo - @dots{} -#endif /* not foo */ -@end group -@end example - -@node Syntactic Conventions -@section Clean Use of C Constructs - -Please explicitly declare all arguments to functions. -Don't omit them just because they are @code{int}s. - -Declarations of external functions and functions to appear later in the -source file should all go in one place near the beginning of the file -(somewhere before the first function definition in the file), or else -should go in a header file. Don't put @code{extern} declarations inside -functions. - -It used to be common practice to use the same local variables (with -names like @code{tem}) over and over for different values within one -function. Instead of doing this, it is better declare a separate local -variable for each distinct purpose, and give it a name which is -meaningful. This not only makes programs easier to understand, it also -facilitates optimization by good compilers. You can also move the -declaration of each local variable into the smallest scope that includes -all its uses. This makes the program even cleaner. - -Don't use local variables or parameters that shadow global identifiers. - -Don't declare multiple variables in one declaration that spans lines. -Start a new declaration on each line, instead. For example, instead -of this: - -@example -@group -int foo, - bar; -@end group -@end example - -@noindent -write either this: - -@example -int foo, bar; -@end example - -@noindent -or this: - -@example -int foo; -int bar; -@end example - -@noindent -(If they are global variables, each should have a comment preceding it -anyway.) - -When you have an @code{if}-@code{else} statement nested in another -@code{if} statement, always put braces around the @code{if}-@code{else}. -Thus, never write like this: - -@example -if (foo) - if (bar) - win (); - else - lose (); -@end example - -@noindent -always like this: - -@example -if (foo) - @{ - if (bar) - win (); - else - lose (); - @} -@end example - -If you have an @code{if} statement nested inside of an @code{else} -statement, either write @code{else if} on one line, like this, - -@example -if (foo) - @dots{} -else if (bar) - @dots{} -@end example - -@noindent -with its @code{then}-part indented like the preceding @code{then}-part, -or write the nested @code{if} within braces like this: - -@example -if (foo) - @dots{} -else - @{ - if (bar) - @dots{} - @} -@end example - -Don't declare both a structure tag and variables or typedefs in the -same declaration. Instead, declare the structure tag separately -and then use it to declare the variables or typedefs. - -Try to avoid assignments inside @code{if}-conditions. For example, -don't write this: - -@example -if ((foo = (char *) malloc (sizeof *foo)) == 0) - fatal ("virtual memory exhausted"); -@end example - -@noindent -instead, write this: - -@example -foo = (char *) malloc (sizeof *foo); -if (foo == 0) - fatal ("virtual memory exhausted"); -@end example - -Don't make the program ugly to placate @code{lint}. Please don't insert any -casts to @code{void}. Zero without a cast is perfectly fine as a null -pointer constant, except when calling a varargs function. - -@node Names -@section Naming Variables and Functions - -The names of global variables and functions in a program serve as -comments of a sort. So don't choose terse names---instead, look for -names that give useful information about the meaning of the variable or -function. In a GNU program, names should be English, like other -comments. - -Local variable names can be shorter, because they are used only within -one context, where (presumably) comments explain their purpose. - -Please use underscores to separate words in a name, so that the Emacs -word commands can be useful within them. Stick to lower case; reserve -upper case for macros and @code{enum} constants, and for name-prefixes -that follow a uniform convention. - -For example, you should use names like @code{ignore_space_change_flag}; -don't use names like @code{iCantReadThis}. - -Variables that indicate whether command-line options have been -specified should be named after the meaning of the option, not after -the option-letter. A comment should state both the exact meaning of -the option and its letter. For example, - -@example -@group -/* Ignore changes in horizontal whitespace (-b). */ -int ignore_space_change_flag; -@end group -@end example - -When you want to define names with constant integer values, use -@code{enum} rather than @samp{#define}. GDB knows about enumeration -constants. - -Use file names of 14 characters or less, to avoid creating gratuitous -problems on older System V systems. You can use the program -@code{doschk} to test for this. @code{doschk} also tests for potential -name conflicts if the files were loaded onto an MS-DOS file -system---something you may or may not care about. - -@node System Portability -@section Portability between System Types - -In the Unix world, ``portability'' refers to porting to different Unix -versions. For a GNU program, this kind of portability is desirable, but -not paramount. - -The primary purpose of GNU software is to run on top of the GNU kernel, -compiled with the GNU C compiler, on various types of @sc{cpu}. The -amount and kinds of variation among GNU systems on different @sc{cpu}s -will be comparable to the variation among Linux-based GNU systems or -among BSD systems today. So the kinds of portability that are absolutely -necessary are quite limited. - -But many users do run GNU software on non-GNU Unix or Unix-like systems. -So supporting a variety of Unix-like systems is desirable, although not -paramount. - -The easiest way to achieve portability to most Unix-like systems is to -use Autoconf. It's unlikely that your program needs to know more -information about the host platform than Autoconf can provide, simply -because most of the programs that need such knowledge have already been -written. - -Avoid using the format of semi-internal data bases (e.g., directories) -when there is a higher-level alternative (@code{readdir}). - -As for systems that are not like Unix, such as MSDOS, Windows, the -Macintosh, VMS, and MVS, supporting them is usually so much work that it -is better if you don't. - -The planned GNU kernel is not finished yet, but you can tell which -facilities it will provide by looking at the GNU C Library Manual. The -GNU kernel is based on Mach, so the features of Mach will also be -available. However, if you use Mach features, you'll probably have -trouble debugging your program today. - -@node CPU Portability -@section Portability between @sc{cpu}s - -Even GNU systems will differ because of differences among @sc{cpu} -types---for example, difference in byte ordering and alignment -requirements. It is absolutely essential to handle these differences. -However, don't make any effort to cater to the possibility that an -@code{int} will be less than 32 bits. We don't support 16-bit machines -in GNU. - -Don't assume that the address of an @code{int} object is also the -address of its least-significant byte. This is false on big-endian -machines. Thus, don't make the following mistake: - -@example -int c; -@dots{} -while ((c = getchar()) != EOF) - write(file_descriptor, &c, 1); -@end example - -When calling functions, you need not worry about the difference between -pointers of various types, or between pointers and integers. On most -machines, there's no difference anyway. As for the few machines where -there is a difference, all of them support @sc{ansi} C, so you can use -prototypes (conditionalized to be active only in @sc{ansi} C) to make -the code work on those systems. - -In certain cases, it is ok to pass integer and pointer arguments -indiscriminately to the same function, and use no prototype on any -system. For example, many GNU programs have error-reporting functions -that pass their arguments along to @code{printf} and friends: - -@example -error (s, a1, a2, a3) - char *s; - int a1, a2, a3; -@{ - fprintf (stderr, "error: "); - fprintf (stderr, s, a1, a2, a3); -@} -@end example - -@noindent -In practice, this works on all machines, and it is much simpler than any -``correct'' alternative. Be sure @emph{not} to use a prototype -for such functions. - -However, avoid casting pointers to integers unless you really need to. -These assumptions really reduce portability, and in most programs they -are easy to avoid. In the cases where casting pointers to integers is -essential---such as, a Lisp interpreter which stores type information as -well as an address in one word---it is ok to do so, but you'll have to -make explicit provisions to handle different word sizes. - -@node System Functions -@section Calling System Functions - -C implementations differ substantially. @sc{ansi} C reduces but does not -eliminate the incompatibilities; meanwhile, many users wish to compile -GNU software with pre-@sc{ansi} compilers. This chapter gives -recommendations for how to use the more or less standard C library -functions to avoid unnecessary loss of portability. - -@itemize @bullet -@item -Don't use the value of @code{sprintf}. It returns the number of -characters written on some systems, but not on all systems. - -@item -@code{main} should be declared to return type @code{int}. It should -terminate either by calling @code{exit} or by returning the integer -status code; make sure it cannot ever return an undefined value. - -@item -Don't declare system functions explicitly. - -Almost any declaration for a system function is wrong on some system. -To minimize conflicts, leave it to the system header files to declare -system functions. If the headers don't declare a function, let it -remain undeclared. - -While it may seem unclean to use a function without declaring it, in -practice this works fine for most system library functions on the -systems where this really happens; thus, the disadvantage is only -theoretical. By contrast, actual declarations have frequently caused -actual conflicts. - -@item -If you must declare a system function, don't specify the argument types. -Use an old-style declaration, not an @sc{ansi} prototype. The more you -specify about the function, the more likely a conflict. - -@item -In particular, don't unconditionally declare @code{malloc} or -@code{realloc}. - -Most GNU programs use those functions just once, in functions -conventionally named @code{xmalloc} and @code{xrealloc}. These -functions call @code{malloc} and @code{realloc}, respectively, and -check the results. - -Because @code{xmalloc} and @code{xrealloc} are defined in your program, -you can declare them in other files without any risk of type conflict. - -On most systems, @code{int} is the same length as a pointer; thus, the -calls to @code{malloc} and @code{realloc} work fine. For the few -exceptional systems (mostly 64-bit machines), you can use -@strong{conditionalized} declarations of @code{malloc} and -@code{realloc}---or put these declarations in configuration files -specific to those systems. - -@item -The string functions require special treatment. Some Unix systems have -a header file @file{string.h}; others have @file{strings.h}. Neither -file name is portable. There are two things you can do: use Autoconf to -figure out which file to include, or don't include either file. - -@item -If you don't include either strings file, you can't get declarations for -the string functions from the header file in the usual way. - -That causes less of a problem than you might think. The newer @sc{ansi} -string functions should be avoided anyway because many systems still -don't support them. The string functions you can use are these: - -@example -strcpy strncpy strcat strncat -strlen strcmp strncmp -strchr strrchr -@end example - -The copy and concatenate functions work fine without a declaration as -long as you don't use their values. Using their values without a -declaration fails on systems where the width of a pointer differs from -the width of @code{int}, and perhaps in other cases. It is trivial to -avoid using their values, so do that. - -The compare functions and @code{strlen} work fine without a declaration -on most systems, possibly all the ones that GNU software runs on. -You may find it necessary to declare them @strong{conditionally} on a -few systems. - -The search functions must be declared to return @code{char *}. Luckily, -there is no variation in the data type they return. But there is -variation in their names. Some systems give these functions the names -@code{index} and @code{rindex}; other systems use the names -@code{strchr} and @code{strrchr}. Some systems support both pairs of -names, but neither pair works on all systems. - -You should pick a single pair of names and use it throughout your -program. (Nowadays, it is better to choose @code{strchr} and -@code{strrchr} for new programs, since those are the standard @sc{ansi} -names.) Declare both of those names as functions returning @code{char -*}. On systems which don't support those names, define them as macros -in terms of the other pair. For example, here is what to put at the -beginning of your file (or in a header) if you want to use the names -@code{strchr} and @code{strrchr} throughout: - -@example -#ifndef HAVE_STRCHR -#define strchr index -#endif -#ifndef HAVE_STRRCHR -#define strrchr rindex -#endif - -char *strchr (); -char *strrchr (); -@end example -@end itemize - -Here we assume that @code{HAVE_STRCHR} and @code{HAVE_STRRCHR} are -macros defined in systems where the corresponding functions exist. -One way to get them properly defined is to use Autoconf. - -@node Internationalization -@section Internationalization - -GNU has a library called GNU gettext that makes it easy to translate the -messages in a program into various languages. You should use this -library in every program. Use English for the messages as they appear -in the program, and let gettext provide the way to translate them into -other languages. - -Using GNU gettext involves putting a call to the @code{gettext} macro -around each string that might need translation---like this: - -@example -printf (gettext ("Processing file `%s'...")); -@end example - -@noindent -This permits GNU gettext to replace the string @code{"Processing file -`%s'..."} with a translated version. - -Once a program uses gettext, please make a point of writing calls to -@code{gettext} when you add new strings that call for translation. - -Using GNU gettext in a package involves specifying a @dfn{text domain -name} for the package. The text domain name is used to separate the -translations for this package from the translations for other packages. -Normally, the text domain name should be the same as the name of the -package---for example, @samp{fileutils} for the GNU file utilities. - -To enable gettext to work well, avoid writing code that makes -assumptions about the structure of words or sentences. When you want -the precise text of a sentence to vary depending on the data, use two or -more alternative string constants each containing a complete sentences, -rather than inserting conditionalized words or phrases into a single -sentence framework. - -Here is an example of what not to do: - -@example -printf ("%d file%s processed", nfiles, - nfiles != 1 ? "s" : ""); -@end example - -@noindent -The problem with that example is that it assumes that plurals are made -by adding `s'. If you apply gettext to the format string, like this, - -@example -printf (gettext ("%d file%s processed"), nfiles, - nfiles != 1 ? "s" : ""); -@end example - -@noindent -the message can use different words, but it will still be forced to use -`s' for the plural. Here is a better way: - -@example -printf ((nfiles != 1 ? "%d files processed" - : "%d file processed"), - nfiles); -@end example - -@noindent -This way, you can apply gettext to each of the two strings -independently: - -@example -printf ((nfiles != 1 ? gettext ("%d files processed") - : gettext ("%d file processed")), - nfiles); -@end example - -@noindent -This can be any method of forming the plural of the word for ``file'', and -also handles languages that require agreement in the word for -``processed''. - -A similar problem appears at the level of sentence structure with this -code: - -@example -printf ("# Implicit rule search has%s been done.\n", - f->tried_implicit ? "" : " not"); -@end example - -@noindent -Adding @code{gettext} calls to this code cannot give correct results for -all languages, because negation in some languages requires adding words -at more than one place in the sentence. By contrast, adding -@code{gettext} calls does the job straightfowardly if the code starts -out like this: - -@example -printf (f->tried_implicit - ? "# Implicit rule search has been done.\n", - : "# Implicit rule search has not been done.\n"); -@end example - -@node Mmap -@section Mmap - -Don't assume that @code{mmap} either works on all files or fails -for all files. It may work on some files and fail on others. - -The proper way to use @code{mmap} is to try it on the specific file for -which you want to use it---and if @code{mmap} doesn't work, fall back on -doing the job in another way using @code{read} and @code{write}. - -The reason this precaution is needed is that the GNU kernel (the HURD) -provides a user-extensible file system, in which there can be many -different kinds of ``ordinary files.'' Many of them support -@code{mmap}, but some do not. It is important to make programs handle -all these kinds of files. - -@node Documentation -@chapter Documenting Programs - -@menu -* GNU Manuals:: Writing proper manuals. -* Manual Structure Details:: Specific structure conventions. -* NEWS File:: NEWS files supplement manuals. -* Change Logs:: Recording Changes -* Man Pages:: Man pages are secondary. -* Reading other Manuals:: How far you can go in learning - from other manuals. -@end menu - -@node GNU Manuals -@section GNU Manuals - -The preferred way to document part of the GNU system is to write a -manual in the Texinfo formatting language. See the Texinfo manual, -either the hardcopy, or the on-line version available through -@code{info} or the Emacs Info subsystem (@kbd{C-h i}). - -Programmers often find it most natural to structure the documentation -following the structure of the implementation, which they know. But -this structure is not necessarily good for explaining how to use the -program; it may be irrelevant and confusing for a user. - -At every level, from the sentences in a paragraph to the grouping of -topics into separate manuals, the right way to structure documentation -is according to the concepts and questions that a user will have in mind -when reading it. Sometimes this structure of ideas matches the -structure of the implementation of the software being documented---but -often they are different. Often the most important part of learning to -write good documentation is learning to notice when you are structuring -the documentation like the implementation, and think about better -alternatives. - -For example, each program in the GNU system probably ought to be -documented in one manual; but this does not mean each program should -have its own manual. That would be following the structure of the -implementation, rather than the structure that helps the user -understand. - -Instead, each manual should cover a coherent @emph{topic}. For example, -instead of a manual for @code{diff} and a manual for @code{diff3}, we -have one manual for ``comparison of files'' which covers both of those -programs, as well as @code{cmp}. By documenting these programs -together, we can make the whole subject clearer. - -The manual which discusses a program should document all of the -program's command-line options and all of its commands. It should give -examples of their use. But don't organize the manual as a list of -features. Instead, organize it logically, by subtopics. Address the -questions that a user will ask when thinking about the job that the -program does. - -In general, a GNU manual should serve both as tutorial and reference. -It should be set up for convenient access to each topic through Info, -and for reading straight through (appendixes aside). A GNU manual -should give a good introduction to a beginner reading through from the -start, and should also provide all the details that hackers want. - -That is not as hard as it first sounds. Arrange each chapter as a -logical breakdown of its topic, but order the sections, and write their -text, so that reading the chapter straight through makes sense. Do -likewise when structuring the book into chapters, and when structuring a -section into paragraphs. The watchword is, @emph{at each point, address -the most fundamental and important issue raised by the preceding text.} - -If necessary, add extra chapters at the beginning of the manual which -are purely tutorial and cover the basics of the subject. These provide -the framework for a beginner to understand the rest of the manual. The -Bison manual provides a good example of how to do this. - -Don't use Unix man pages as a model for how to write GNU documentation; -most of them are terse, badly structured, and give inadequate -explanation of the underlying concepts. (There are, of course -exceptions.) Also Unix man pages use a particular format which is -different from what we use in GNU manuals. - -Please do not use the term ``pathname'' that is used in Unix -documentation; use ``file name'' (two words) instead. We use the term -``path'' only for search paths, which are lists of file names. - -Please do not use the term ``illegal'' to refer to erroneous input to a -computer program. Please use ``invalid'' for this, and reserve the term -``illegal'' for violations of law. - -@node Manual Structure Details -@section Manual Structure Details - -The title page of the manual should state the version of the programs or -packages documented in the manual. The Top node of the manual should -also contain this information. If the manual is changing more -frequently than or independent of the program, also state a version -number for the manual in both of these places. - -Each program documented in the manual should should have a node named -@samp{@var{program} Invocation} or @samp{Invoking @var{program}}. This -node (together with its subnodes, if any) should describe the program's -command line arguments and how to run it (the sort of information people -would look in a man page for). Start with an @samp{@@example} -containing a template for all the options and arguments that the program -uses. - -Alternatively, put a menu item in some menu whose item name fits one of -the above patterns. This identifies the node which that item points to -as the node for this purpose, regardless of the node's actual name. - -There will be automatic features for specifying a program name and -quickly reading just this part of its manual. - -If one manual describes several programs, it should have such a node for -each program described. - -@node NEWS File -@section The NEWS File - -In addition to its manual, the package should have a file named -@file{NEWS} which contains a list of user-visible changes worth -mentioning. In each new release, add items to the front of the file and -identify the version they pertain to. Don't discard old items; leave -them in the file after the newer items. This way, a user upgrading from -any previous version can see what is new. - -If the @file{NEWS} file gets very long, move some of the older items -into a file named @file{ONEWS} and put a note at the end referring the -user to that file. - -@node Change Logs -@section Change Logs - -Keep a change log to describe all the changes made to program source -files. The purpose of this is so that people investigating bugs in the -future will know about the changes that might have introduced the bug. -Often a new bug can be found by looking at what was recently changed. -More importantly, change logs can help you eliminate conceptual -inconsistencies between different parts of a program, by giving you a -history of how the conflicting concepts arose and who they came from. - -@menu -* Change Log Concepts:: -* Style of Change Logs:: -* Simple Changes:: -* Conditional Changes:: -@end menu - -@node Change Log Concepts -@subsection Change Log Concepts - -You can think of the change log as a conceptual ``undo list'' which -explains how earlier versions were different from the current version. -People can see the current version; they don't need the change log -to tell them what is in it. What they want from a change log is a -clear explanation of how the earlier version differed. - -The change log file is normally called @file{ChangeLog} and covers an -entire directory. Each directory can have its own change log, or a -directory can use the change log of its parent directory--it's up to -you. - -Another alternative is to record change log information with a version -control system such as RCS or CVS. This can be converted automatically -to a @file{ChangeLog} file. - -There's no need to describe the full purpose of the changes or how they -work together. If you think that a change calls for explanation, you're -probably right. Please do explain it---but please put the explanation -in comments in the code, where people will see it whenever they see the -code. For example, ``New function'' is enough for the change log when -you add a function, because there should be a comment before the -function definition to explain what it does. - -However, sometimes it is useful to write one line to describe the -overall purpose of a batch of changes. - -The easiest way to add an entry to @file{ChangeLog} is with the Emacs -command @kbd{M-x add-change-log-entry}. An entry should have an -asterisk, the name of the changed file, and then in parentheses the name -of the changed functions, variables or whatever, followed by a colon. -Then describe the changes you made to that function or variable. - -@node Style of Change Logs -@subsection Style of Change Logs - -Here are some examples of change log entries: - -@example -* register.el (insert-register): Return nil. -(jump-to-register): Likewise. - -* sort.el (sort-subr): Return nil. - -* tex-mode.el (tex-bibtex-file, tex-file, tex-region): -Restart the tex shell if process is gone or stopped. -(tex-shell-running): New function. - -* expr.c (store_one_arg): Round size up for move_block_to_reg. -(expand_call): Round up when emitting USE insns. -* stmt.c (assign_parms): Round size up for move_block_from_reg. -@end example - -It's important to name the changed function or variable in full. Don't -abbreviate function or variable names, and don't combine them. -Subsequent maintainers will often search for a function name to find all -the change log entries that pertain to it; if you abbreviate the name, -they won't find it when they search. - -For example, some people are tempted to abbreviate groups of function -names by writing @samp{* register.el (@{insert,jump-to@}-register)}; -this is not a good idea, since searching for @code{jump-to-register} or -@code{insert-register} would not find that entry. - -Separate unrelated change log entries with blank lines. When two -entries represent parts of the same change, so that they work together, -then don't put blank lines between them. Then you can omit the file -name and the asterisk when successive entries are in the same file. - -@node Simple Changes -@subsection Simple Changes - -Certain simple kinds of changes don't need much detail in the change -log. - -When you change the calling sequence of a function in a simple fashion, -and you change all the callers of the function, there is no need to make -individual entries for all the callers that you changed. Just write in -the entry for the function being called, ``All callers changed.'' - -@example -* keyboard.c (Fcommand_execute): New arg SPECIAL. -All callers changed. -@end example - -When you change just comments or doc strings, it is enough to write an -entry for the file, without mentioning the functions. Just ``Doc -fixes'' is enough for the change log. - -There's no need to make change log entries for documentation files. -This is because documentation is not susceptible to bugs that are hard -to fix. Documentation does not consist of parts that must interact in a -precisely engineered fashion. To correct an error, you need not know -the history of the erroneous passage; it is enough to compare what the -documentation says with the way the program actually works. - -@node Conditional Changes -@subsection Conditional Changes - -C programs often contain compile-time @code{#if} conditionals. Many -changes are conditional; sometimes you add a new definition which is -entirely contained in a conditional. It is very useful to indicate in -the change log the conditions for which the change applies. - -Our convention for indicating conditional changes is to use square -brackets around the name of the condition. - -Here is a simple example, describing a change which is conditional but -does not have a function or entity name associated with it: - -@example -* xterm.c [SOLARIS2]: Include string.h. -@end example - -Here is an entry describing a new definition which is entirely -conditional. This new definition for the macro @code{FRAME_WINDOW_P} is -used only when @code{HAVE_X_WINDOWS} is defined: - -@example -* frame.h [HAVE_X_WINDOWS] (FRAME_WINDOW_P): Macro defined. -@end example - -Here is an entry for a change within the function @code{init_display}, -whose definition as a whole is unconditional, but the changes themselves -are contained in a @samp{#ifdef HAVE_LIBNCURSES} conditional: - -@example -* dispnew.c (init_display) [HAVE_LIBNCURSES]: If X, call tgetent. -@end example - -Here is an entry for a change that takes affect only when -a certain macro is @emph{not} defined: - -@example -(gethostname) [!HAVE_SOCKETS]: Replace with winsock version. -@end example - -@node Man Pages -@section Man Pages - -In the GNU project, man pages are secondary. It is not necessary or -expected for every GNU program to have a man page, but some of them do. -It's your choice whether to include a man page in your program. - -When you make this decision, consider that supporting a man page -requires continual effort each time the program is changed. The time -you spend on the man page is time taken away from more useful work. - -For a simple program which changes little, updating the man page may be -a small job. Then there is little reason not to include a man page, if -you have one. - -For a large program that changes a great deal, updating a man page may -be a substantial burden. If a user offers to donate a man page, you may -find this gift costly to accept. It may be better to refuse the man -page unless the same person agrees to take full responsibility for -maintaining it---so that you can wash your hands of it entirely. If -this volunteer later ceases to do the job, then don't feel obliged to -pick it up yourself; it may be better to withdraw the man page from the -distribution until someone else agrees to update it. - -When a program changes only a little, you may feel that the -discrepancies are small enough that the man page remains useful without -updating. If so, put a prominent note near the beginning of the man -page explaining that you don't maintain it and that the Texinfo manual -is more authoritative. The note should say how to access the Texinfo -documentation. - -@node Reading other Manuals -@section Reading other Manuals - -There may be non-free books or documentation files that describe the -program you are documenting. - -It is ok to use these documents for reference, just as the author of a -new algebra textbook can read other books on algebra. A large portion -of any non-fiction book consists of facts, in this case facts about how -a certain program works, and these facts are necessarily the same for -everyone who writes about the subject. But be careful not to copy your -outline structure, wording, tables or examples from preexisting non-free -documentation. Copying from free documentation may be ok; please check -with the FSF about the individual case. - -@node Managing Releases -@chapter The Release Process - -Making a release is more than just bundling up your source files in a -tar file and putting it up for FTP. You should set up your software so -that it can be configured to run on a variety of systems. Your Makefile -should conform to the GNU standards described below, and your directory -layout should also conform to the standards discussed below. Doing so -makes it easy to include your package into the larger framework of -all GNU software. - -@menu -* Configuration:: How Configuration Should Work -* Makefile Conventions:: Makefile Conventions -* Releases:: Making Releases -@end menu - -@node Configuration -@section How Configuration Should Work - -Each GNU distribution should come with a shell script named -@code{configure}. This script is given arguments which describe the -kind of machine and system you want to compile the program for. - -The @code{configure} script must record the configuration options so -that they affect compilation. - -One way to do this is to make a link from a standard name such as -@file{config.h} to the proper configuration file for the chosen system. -If you use this technique, the distribution should @emph{not} contain a -file named @file{config.h}. This is so that people won't be able to -build the program without configuring it first. - -Another thing that @code{configure} can do is to edit the Makefile. If -you do this, the distribution should @emph{not} contain a file named -@file{Makefile}. Instead, it should include a file @file{Makefile.in} which -contains the input used for editing. Once again, this is so that people -won't be able to build the program without configuring it first. - -If @code{configure} does write the @file{Makefile}, then @file{Makefile} -should have a target named @file{Makefile} which causes @code{configure} -to be rerun, setting up the same configuration that was set up last -time. The files that @code{configure} reads should be listed as -dependencies of @file{Makefile}. - -All the files which are output from the @code{configure} script should -have comments at the beginning explaining that they were generated -automatically using @code{configure}. This is so that users won't think -of trying to edit them by hand. - -The @code{configure} script should write a file named @file{config.status} -which describes which configuration options were specified when the -program was last configured. This file should be a shell script which, -if run, will recreate the same configuration. - -The @code{configure} script should accept an option of the form -@samp{--srcdir=@var{dirname}} to specify the directory where sources are found -(if it is not the current directory). This makes it possible to build -the program in a separate directory, so that the actual source directory -is not modified. - -If the user does not specify @samp{--srcdir}, then @code{configure} should -check both @file{.} and @file{..} to see if it can find the sources. If -it finds the sources in one of these places, it should use them from -there. Otherwise, it should report that it cannot find the sources, and -should exit with nonzero status. - -Usually the easy way to support @samp{--srcdir} is by editing a -definition of @code{VPATH} into the Makefile. Some rules may need to -refer explicitly to the specified source directory. To make this -possible, @code{configure} can add to the Makefile a variable named -@code{srcdir} whose value is precisely the specified directory. - -The @code{configure} script should also take an argument which specifies the -type of system to build the program for. This argument should look like -this: - -@example -@var{cpu}-@var{company}-@var{system} -@end example - -For example, a Sun 3 might be @samp{m68k-sun-sunos4.1}. - -The @code{configure} script needs to be able to decode all plausible -alternatives for how to describe a machine. Thus, @samp{sun3-sunos4.1} -would be a valid alias. For many programs, @samp{vax-dec-ultrix} would -be an alias for @samp{vax-dec-bsd}, simply because the differences -between Ultrix and @sc{BSD} are rarely noticeable, but a few programs -might need to distinguish them. -@c Real 4.4BSD now runs on some Suns. - -There is a shell script called @file{config.sub} that you can use -as a subroutine to validate system types and canonicalize aliases. - -Other options are permitted to specify in more detail the software -or hardware present on the machine, and include or exclude optional -parts of the package: - -@table @samp -@item --enable-@var{feature}@r{[}=@var{parameter}@r{]} -Configure the package to build and install an optional user-level -facility called @var{feature}. This allows users to choose which -optional features to include. Giving an optional @var{parameter} of -@samp{no} should omit @var{feature}, if it is built by default. - -No @samp{--enable} option should @strong{ever} cause one feature to -replace another. No @samp{--enable} option should ever substitute one -useful behavior for another useful behavior. The only proper use for -@samp{--enable} is for questions of whether to build part of the program -or exclude it. - -@item --with-@var{package} -@c @r{[}=@var{parameter}@r{]} -The package @var{package} will be installed, so configure this package -to work with @var{package}. - -@c Giving an optional @var{parameter} of -@c @samp{no} should omit @var{package}, if it is used by default. - -Possible values of @var{package} include -@samp{gnu-as} (or @samp{gas}), @samp{gnu-ld}, @samp{gnu-libc}, -@samp{gdb}, -@samp{x}, -and -@samp{x-toolkit}. - -Do not use a @samp{--with} option to specify the file name to use to -find certain files. That is outside the scope of what @samp{--with} -options are for. - -@item --nfp -The target machine has no floating point processor. - -@item --gas -The target machine assembler is GAS, the GNU assembler. -This is obsolete; users should use @samp{--with-gnu-as} instead. - -@item --x -The target machine has the X Window System installed. -This is obsolete; users should use @samp{--with-x} instead. -@end table - -All @code{configure} scripts should accept all of these ``detail'' -options, whether or not they make any difference to the particular -package at hand. In particular, they should accept any option that -starts with @samp{--with-} or @samp{--enable-}. This is so users will -be able to configure an entire GNU source tree at once with a single set -of options. - -You will note that the categories @samp{--with-} and @samp{--enable-} -are narrow: they @strong{do not} provide a place for any sort of option -you might think of. That is deliberate. We want to limit the possible -configuration options in GNU software. We do not want GNU programs to -have idiosyncratic configuration options. - -Packages that perform part of the compilation process may support cross-compilation. -In such a case, the host and target machines for the program may be -different. The @code{configure} script should normally treat the -specified type of system as both the host and the target, thus producing -a program which works for the same type of machine that it runs on. - -The way to build a cross-compiler, cross-assembler, or what have you, is -to specify the option @samp{--host=@var{hosttype}} when running -@code{configure}. This specifies the host system without changing the -type of target system. The syntax for @var{hosttype} is the same as -described above. - -Bootstrapping a cross-compiler requires compiling it on a machine other -than the host it will run on. Compilation packages accept a -configuration option @samp{--build=@var{hosttype}} for specifying the -configuration on which you will compile them, in case that is different -from the host. - -Programs for which cross-operation is not meaningful need not accept the -@samp{--host} option, because configuring an entire operating system for -cross-operation is not a meaningful thing. - -Some programs have ways of configuring themselves automatically. If -your program is set up to do this, your @code{configure} script can simply -ignore most of its arguments. - -@comment The makefile standards are in a separate file that is also -@comment included by make.texinfo. Done by roland@gnu.ai.mit.edu on 1/6/93. -@comment For this document, turn chapters into sections, etc. -@lowersections -@include make-stds.texi -@raisesections - -@node Releases -@section Making Releases - -Package the distribution of @code{Foo version 69.96} up in a gzipped tar -file with the name @file{foo-69.96.tar.gz}. It should unpack into a -subdirectory named @file{foo-69.96}. - -Building and installing the program should never modify any of the files -contained in the distribution. This means that all the files that form -part of the program in any way must be classified into @dfn{source -files} and @dfn{non-source files}. Source files are written by humans -and never changed automatically; non-source files are produced from -source files by programs under the control of the Makefile. - -Naturally, all the source files must be in the distribution. It is okay -to include non-source files in the distribution, provided they are -up-to-date and machine-independent, so that building the distribution -normally will never modify them. We commonly include non-source files -produced by Bison, @code{lex}, @TeX{}, and @code{makeinfo}; this helps avoid -unnecessary dependencies between our distributions, so that users can -install whichever packages they want to install. - -Non-source files that might actually be modified by building and -installing the program should @strong{never} be included in the -distribution. So if you do distribute non-source files, always make -sure they are up to date when you make a new distribution. - -Make sure that the directory into which the distribution unpacks (as -well as any subdirectories) are all world-writable (octal mode 777). -This is so that old versions of @code{tar} which preserve the -ownership and permissions of the files from the tar archive will be -able to extract all the files even if the user is unprivileged. - -Make sure that all the files in the distribution are world-readable. - -Make sure that no file name in the distribution is more than 14 -characters long. Likewise, no file created by building the program -should have a name longer than 14 characters. The reason for this is -that some systems adhere to a foolish interpretation of the POSIX -standard, and refuse to open a longer name, rather than truncating as -they did in the past. - -Don't include any symbolic links in the distribution itself. If the tar -file contains symbolic links, then people cannot even unpack it on -systems that don't support symbolic links. Also, don't use multiple -names for one file in different directories, because certain file -systems cannot handle this and that prevents unpacking the -distribution. - -Try to make sure that all the file names will be unique on MS-DOS. A -name on MS-DOS consists of up to 8 characters, optionally followed by a -period and up to three characters. MS-DOS will truncate extra -characters both before and after the period. Thus, -@file{foobarhacker.c} and @file{foobarhacker.o} are not ambiguous; they -are truncated to @file{foobarha.c} and @file{foobarha.o}, which are -distinct. - -Include in your distribution a copy of the @file{texinfo.tex} you used -to test print any @file{*.texinfo} or @file{*.texi} files. - -Likewise, if your program uses small GNU software packages like regex, -getopt, obstack, or termcap, include them in the distribution file. -Leaving them out would make the distribution file a little smaller at -the expense of possible inconvenience to a user who doesn't know what -other files to get. - -@contents - -@bye -Local variables: -update-date-leading-regexp: "@c This date is automagically updated when you save this file:\n@set lastupdate " -update-date-trailing-regexp: "" -eval: (load "/gd/gnuorg/update-date.el") -eval: (add-hook 'write-file-hooks 'update-date) -End: diff --git a/contrib/binutils/gas/acconfig.h b/contrib/binutils/gas/acconfig.h deleted file mode 100644 index c9c60025c757..000000000000 --- a/contrib/binutils/gas/acconfig.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Name of package. */ -#undef PACKAGE - -/* Version of package. */ -#undef VERSION - -/* Should gas use high-level BFD interfaces? */ -#undef BFD_ASSEMBLER - -/* Some assert/preprocessor combinations are incapable of handling - certain kinds of constructs in the argument of assert. For example, - quoted strings (if requoting isn't done right) or newlines. */ -#undef BROKEN_ASSERT - -/* If we aren't doing cross-assembling, some operations can be optimized, - since byte orders and value sizes don't need to be adjusted. */ -#undef CROSS_COMPILE - -/* Some gas code wants to know these parameters. */ -#undef TARGET_ALIAS -#undef TARGET_CPU -#undef TARGET_CANONICAL -#undef TARGET_OS -#undef TARGET_VENDOR - -/* Sometimes the system header files don't declare strstr. */ -#undef NEED_DECLARATION_STRSTR - -/* Sometimes the system header files don't declare malloc and realloc. */ -#undef NEED_DECLARATION_MALLOC - -/* Sometimes the system header files don't declare free. */ -#undef NEED_DECLARATION_FREE - -/* Sometimes the system header files don't declare sbrk. */ -#undef NEED_DECLARATION_SBRK - -/* Sometimes errno.h doesn't declare errno itself. */ -#undef NEED_DECLARATION_ERRNO - -#undef MANY_SEGMENTS - -/* The configure script defines this for some targets based on the - target name used. It is not always defined. */ -#undef TARGET_BYTES_BIG_ENDIAN - -/* Needed only for some configurations that can produce multiple output - formats. */ -#undef DEFAULT_EMULATION -#undef EMULATIONS -#undef USE_EMULATIONS -#undef OBJ_MAYBE_AOUT -#undef OBJ_MAYBE_BOUT -#undef OBJ_MAYBE_COFF -#undef OBJ_MAYBE_ECOFF -#undef OBJ_MAYBE_ELF -#undef OBJ_MAYBE_GENERIC -#undef OBJ_MAYBE_HP300 -#undef OBJ_MAYBE_IEEE -#undef OBJ_MAYBE_SOM -#undef OBJ_MAYBE_VMS - -/* Used for some of the COFF configurations, when the COFF code needs - to select something based on the CPU type before it knows it... */ -#undef I386COFF -#undef M68KCOFF -#undef M88KCOFF - -/* Using cgen code? */ -#undef USING_CGEN - -/* Needed only for sparc configuration. */ -#undef DEFAULT_ARCH - -/* Needed only for PowerPC Solaris. */ -#undef TARGET_SOLARIS_COMMENT - -/* Needed only for SCO 5. */ -#undef SCO_ELF diff --git a/contrib/binutils/gas/conf.in b/contrib/binutils/gas/conf.in deleted file mode 100644 index d56807cd88d5..000000000000 --- a/contrib/binutils/gas/conf.in +++ /dev/null @@ -1,127 +0,0 @@ -/* conf.in. Generated automatically from configure.in by autoheader. */ - -/* Define if using alloca.c. */ -#undef C_ALLOCA - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END - -/* Define if you have alloca, as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ -#undef HAVE_ALLOCA_H - -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#undef STACK_DIRECTION - -/* Should gas use high-level BFD interfaces? */ -#undef BFD_ASSEMBLER - -/* Some assert/preprocessor combinations are incapable of handling - certain kinds of constructs in the argument of assert. For example, - quoted strings (if requoting isn't done right) or newlines. */ -#undef BROKEN_ASSERT - -/* If we aren't doing cross-assembling, some operations can be optimized, - since byte orders and value sizes don't need to be adjusted. */ -#undef CROSS_COMPILE - -/* Some gas code wants to know these parameters. */ -#undef TARGET_ALIAS -#undef TARGET_CPU -#undef TARGET_CANONICAL -#undef TARGET_OS -#undef TARGET_VENDOR - -/* Sometimes the system header files don't declare strstr. */ -#undef NEED_DECLARATION_STRSTR - -/* Sometimes the system header files don't declare malloc and realloc. */ -#undef NEED_DECLARATION_MALLOC - -/* Sometimes the system header files don't declare free. */ -#undef NEED_DECLARATION_FREE - -/* Sometimes the system header files don't declare sbrk. */ -#undef NEED_DECLARATION_SBRK - -/* Sometimes errno.h doesn't declare errno itself. */ -#undef NEED_DECLARATION_ERRNO - -#undef MANY_SEGMENTS - -/* Needed only for sparc configuration. */ -#undef SPARC_V9 -#undef SPARC_ARCH64 - -/* Defined if using CGEN. */ -#undef USING_CGEN - -/* Needed only for some configurations that can produce multiple output - formats. */ -#undef DEFAULT_EMULATION -#undef EMULATIONS -#undef USE_EMULATIONS -#undef OBJ_MAYBE_AOUT -#undef OBJ_MAYBE_BOUT -#undef OBJ_MAYBE_COFF -#undef OBJ_MAYBE_ECOFF -#undef OBJ_MAYBE_ELF -#undef OBJ_MAYBE_GENERIC -#undef OBJ_MAYBE_HP300 -#undef OBJ_MAYBE_IEEE -#undef OBJ_MAYBE_SOM -#undef OBJ_MAYBE_VMS - -/* Used for some of the COFF configurations, when the COFF code needs - to select something based on the CPU type before it knows it... */ -#undef I386COFF -#undef M68KCOFF -#undef M88KCOFF - -/* Define if you have the remove function. */ -#undef HAVE_REMOVE - -/* Define if you have the sbrk function. */ -#undef HAVE_SBRK - -/* Define if you have the unlink function. */ -#undef HAVE_UNLINK - -/* Define if you have the <errno.h> header file. */ -#undef HAVE_ERRNO_H - -/* Define if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the <stdarg.h> header file. */ -#undef HAVE_STDARG_H - -/* Define if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define if you have the <varargs.h> header file. */ -#undef HAVE_VARARGS_H diff --git a/contrib/binutils/gas/config/i386coff.mt b/contrib/binutils/gas/config/i386coff.mt deleted file mode 100644 index efda83365181..000000000000 --- a/contrib/binutils/gas/config/i386coff.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DI386COFF diff --git a/contrib/binutils/gas/config/obj-generic.c b/contrib/binutils/gas/config/obj-generic.c deleted file mode 100644 index 69fc3d1dbf96..000000000000 --- a/contrib/binutils/gas/config/obj-generic.c +++ /dev/null @@ -1,41 +0,0 @@ -/* This file is obj-generic.c and is intended to be a template for - object format specific source files. - - Copyright (C) 1987-1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Chars that can be used to separate mant from exp in floating point nums */ -char EXP_CHARS[] = "eE"; - -/* Chars that mean this number is a floating point constant */ -/* As in 0f12.456 */ -/* or 0d1.2345e12 */ -char FLT_CHARS[] = "rRsSfFdDxXpP"; - -/* These chars start a comment anywhere in a source file (except inside - another comment */ -const char comment_chars[] = "#"; - -/* - * Local Variables: - * comment-column: 0 - * fill-column: 131 - * End: - */ - -/* end of obj-generic.c */ diff --git a/contrib/binutils/gas/config/obj-generic.h b/contrib/binutils/gas/config/obj-generic.h deleted file mode 100644 index 8cb8020d0a42..000000000000 --- a/contrib/binutils/gas/config/obj-generic.h +++ /dev/null @@ -1,79 +0,0 @@ -/* This file is obj-generic.h - Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 2000 - Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - -/* - * This file is obj-generic.h and is intended to be a template for - * object format specific header files. - */ - -/* define an obj specific macro off which target cpu back ends may key. */ -#define OBJ_GENERIC 1 - -/* include whatever target cpu is appropriate. */ -#include "targ-cpu.h" - -/* - * SYMBOLS - */ - -/* - * If your object format needs to reorder symbols, define this. When - * defined, symbols are kept on a doubly linked list and functions are - * made available for push, insert, append, and delete. If not defined, - * symbols are kept on a singly linked list, only the append and clear - * facilities are available, and they are macros. - */ - -/* #define SYMBOLS_NEED_PACKPOINTERS */ - -/* */ -typedef struct - { - void *nothing; - } - -obj_symbol_type; /* should be the format's symbol structure */ - -typedef void *object_headers; - -/* symbols have names */ -#define S_GET_NAME(s) ("foo") /* get the name of a symbolP */ -#define S_SET_NAME(s,v) ; -/* symbols have segments */ -#define S_GET_SEGMENT(s) (SEG_UNKNOWN) -#define S_SET_SEGMENT(s,v) ; -/* symbols may be external */ -#define S_IS_EXTERNAL(s) (0) -#define S_SET_EXTERNAL(s) ; - -/* symbols may or may not be defined */ -#define S_IS_DEFINED(s) (0) - -#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (0) /* your magic number */ - -#define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */ - -/* - * Local Variables: - * comment-column: 0 - * fill-column: 131 - * End: - */ diff --git a/contrib/binutils/gas/config/sco5.mt b/contrib/binutils/gas/config/sco5.mt deleted file mode 100644 index 8879320c4e1e..000000000000 --- a/contrib/binutils/gas/config/sco5.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DSCO_ELF diff --git a/contrib/binutils/gas/config/tc-s390.c b/contrib/binutils/gas/config/tc-s390.c deleted file mode 100644 index 4e09ab571497..000000000000 --- a/contrib/binutils/gas/config/tc-s390.c +++ /dev/null @@ -1,1977 +0,0 @@ -/* tc-s390.c -- Assemble for the S390 - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - -#include <stdio.h> -#include "as.h" -#include "safe-ctype.h" -#include "subsegs.h" -#include "struc-symbol.h" - -#include "opcode/s390.h" -#include "elf/s390.h" - -/* The default architecture. */ -#ifndef DEFAULT_ARCH -#define DEFAULT_ARCH "s390" -#endif -static char *default_arch = DEFAULT_ARCH; -/* Either 32 or 64, selects file format. */ -static int s390_arch_size; -/* Current architecture. Start with the smallest instruction set. */ -static enum s390_opcode_arch_val current_architecture = S390_OPCODE_ESA; -static int current_arch_mask = 1 << S390_OPCODE_ESA; -static int current_arch_requested = 0; - -/* Whether to use user friendly register names. Default is true. */ -#ifndef TARGET_REG_NAMES_P -#define TARGET_REG_NAMES_P true -#endif - -static boolean reg_names_p = TARGET_REG_NAMES_P; - -/* Set to TRUE if we want to warn about zero base/index registers. */ -static boolean warn_areg_zero = FALSE; - -/* Generic assembler global variables which must be defined by all - targets. */ - -const char comment_chars[] = "#"; - -/* Characters which start a comment at the beginning of a line. */ -const char line_comment_chars[] = "#"; - -/* Characters which may be used to separate multiple commands on a - single line. */ -const char line_separator_chars[] = ";"; - -/* Characters which are used to indicate an exponent in a floating - point number. */ -const char EXP_CHARS[] = "eE"; - -/* Characters which mean that a number is a floating point constant, - as in 0d1.0. */ -const char FLT_CHARS[] = "dD"; - -/* The target specific pseudo-ops which we support. */ - -/* Define the prototypes for the pseudo-ops */ -static void s390_byte PARAMS ((int)); -static void s390_elf_cons PARAMS ((int)); -static void s390_bss PARAMS ((int)); -static void s390_insn PARAMS ((int)); -static void s390_literals PARAMS ((int)); - -const pseudo_typeS md_pseudo_table[] = -{ - { "align", s_align_bytes, 0 }, - /* Pseudo-ops which must be defined. */ - { "bss", s390_bss, 0 }, - { "insn", s390_insn, 0 }, - /* Pseudo-ops which must be overridden. */ - { "byte", s390_byte, 0 }, - { "short", s390_elf_cons, 2 }, - { "long", s390_elf_cons, 4 }, - { "quad", s390_elf_cons, 8 }, - { "ltorg", s390_literals, 0 }, - { "string", stringer, 2 }, - { NULL, NULL, 0 } -}; - - -/* Structure to hold information about predefined registers. */ -struct pd_reg - { - char *name; - int value; - }; - -/* List of registers that are pre-defined: - - Each access register has a predefined name of the form: - a<reg_num> which has the value <reg_num>. - - Each control register has a predefined name of the form: - c<reg_num> which has the value <reg_num>. - - Each general register has a predefined name of the form: - r<reg_num> which has the value <reg_num>. - - Each floating point register a has predefined name of the form: - f<reg_num> which has the value <reg_num>. - - There are individual registers as well: - sp has the value 15 - lit has the value 12 - - The table is sorted. Suitable for searching by a binary search. */ - -static const struct pd_reg pre_defined_registers[] = -{ - { "a0", 0 }, /* Access registers */ - { "a1", 1 }, - { "a10", 10 }, - { "a11", 11 }, - { "a12", 12 }, - { "a13", 13 }, - { "a14", 14 }, - { "a15", 15 }, - { "a2", 2 }, - { "a3", 3 }, - { "a4", 4 }, - { "a5", 5 }, - { "a6", 6 }, - { "a7", 7 }, - { "a8", 8 }, - { "a9", 9 }, - - { "c0", 0 }, /* Control registers */ - { "c1", 1 }, - { "c10", 10 }, - { "c11", 11 }, - { "c12", 12 }, - { "c13", 13 }, - { "c14", 14 }, - { "c15", 15 }, - { "c2", 2 }, - { "c3", 3 }, - { "c4", 4 }, - { "c5", 5 }, - { "c6", 6 }, - { "c7", 7 }, - { "c8", 8 }, - { "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 }, - - { "lit", 13 }, /* Pointer to literal pool */ - - { "r0", 0 }, /* General purpose registers */ - { "r1", 1 }, - { "r10", 10 }, - { "r11", 11 }, - { "r12", 12 }, - { "r13", 13 }, - { "r14", 14 }, - { "r15", 15 }, - { "r2", 2 }, - { "r3", 3 }, - { "r4", 4 }, - { "r5", 5 }, - { "r6", 6 }, - { "r7", 7 }, - { "r8", 8 }, - { "r9", 9 }, - - { "sp", 15 }, /* Stack pointer */ - -}; - -#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. */ - -static int -reg_name_search (regs, regcount, name) - const struct pd_reg *regs; - int regcount; - const char *name; -{ - int middle, low, high; - int cmp; - - low = 0; - high = regcount - 1; - - do - { - middle = (low + high) / 2; - cmp = strcasecmp (name, regs[middle].name); - if (cmp < 0) - high = middle - 1; - else if (cmp > 0) - low = middle + 1; - else - return regs[middle].value; - } - while (low <= high); - - return -1; -} - - -/* - * Summary of register_name(). - * - * in: Input_line_pointer points to 1st char of operand. - * - * out: A expressionS. - * The operand may have been a register: in this case, X_op == O_register, - * X_add_number is set to the register number, and truth is returned. - * Input_line_pointer->(next non-blank) char after operand, or is in its - * original state. - */ - -static boolean -register_name (expressionP) - expressionS *expressionP; -{ - int reg_number; - char *name; - char *start; - char c; - - /* Find the spelling of the operand. */ - start = name = input_line_pointer; - if (name[0] == '%' && ISALPHA (name[1])) - name = ++input_line_pointer; - else - return false; - - c = get_symbol_end (); - reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name); - - /* Put back the delimiting char. */ - *input_line_pointer = c; - - /* Look to see if it's in the register table. */ - 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; - return true; - } - - /* Reset the line as if we had not done anything. */ - input_line_pointer = start; - return false; -} - -/* Local variables. */ - -/* Opformat hash table. */ -static struct hash_control *s390_opformat_hash; - -/* Opcode hash table. */ -static struct hash_control *s390_opcode_hash; - -/* Flags to set in the elf header */ -static flagword s390_flags = 0; - -symbolS *GOT_symbol; /* Pre-defined "_GLOBAL_OFFSET_TABLE_" */ - -#ifndef WORKING_DOT_WORD -const int md_short_jump_size = 4; -const int md_long_jump_size = 4; -#endif - -CONST char *md_shortopts = "A:m:kVQ:"; -struct option md_longopts[] = { - {NULL, no_argument, NULL, 0} -}; -size_t md_longopts_size = sizeof (md_longopts); - -/* Initialize the default opcode arch and word size from the default - architecture name. */ -static void -init_default_arch () -{ - if (current_arch_requested) - return; - - if (strcmp (default_arch, "s390") == 0) - { - s390_arch_size = 32; - current_architecture = S390_OPCODE_ESA; - } - else if (strcmp (default_arch, "s390x") == 0) - { - s390_arch_size = 64; - current_architecture = S390_OPCODE_ESAME; - } - else - as_fatal ("Invalid default architecture, broken assembler."); - current_arch_mask = 1 << current_architecture; -} - -/* Called by TARGET_FORMAT. */ -const char * -s390_target_format () -{ - /* We don't get a chance to initialize anything before we're called, - so handle that now. */ - if (! s390_arch_size) - init_default_arch (); - - return s390_arch_size == 64 ? "elf64-s390" : "elf32-s390"; -} - -int -md_parse_option (c, arg) - int c; - char *arg; -{ - switch (c) - { - /* -k: Ignore for FreeBSD compatibility. */ - case 'k': - break; - 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 if (arg != NULL && strcmp (arg, "warn-areg-zero") == 0) - warn_areg_zero = TRUE; - - else if (arg != NULL && strcmp (arg, "31") == 0) - s390_arch_size = 31; - - else if (arg != NULL && strcmp (arg, "64") == 0) - s390_arch_size = 64; - - else - { - as_bad (_("invalid switch -m%s"), arg); - return 0; - } - break; - - case 'A': - if (arg != NULL && strcmp (arg, "esa") == 0) - current_architecture = S390_OPCODE_ESA; - else if (arg != NULL && strcmp (arg, "esame") == 0) - current_architecture = S390_OPCODE_ESAME; - else - as_bad ("invalid architecture -A%s", arg); - current_arch_mask = 1 << current_architecture; - current_arch_requested = 1; - break; - - /* -V: SVR4 argument to print version ID. */ - 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; -} - -void -md_show_usage (stream) - FILE *stream; -{ - fprintf (stream, _("\ - S390 options:\n\ - -mregnames Allow symbolic names for registers\n\ - -mwarn-areg-zero Warn about zero base/index registers\n\ - -mno-regnames Do not allow symbolic names for registers\n\ - -m31 Set file format to 31 bit format\n\ - -m64 Set file format to 64 bit format\n")); - fprintf (stream, _("\ - -V print assembler version number\n\ - -Qy, -Qn ignored\n")); -} - -/* This function is called when the assembler starts up. It is called - after the options have been parsed and the output file has been - opened. */ - -void -md_begin () -{ - register const struct s390_opcode *op; - const struct s390_opcode *op_end; - boolean dup_insn = false; - const char *retval; - - /* Give a warning if the combination -m64-bit and -Aesa is used. */ - if (s390_arch_size == 64 && current_arch_mask == (1 << S390_OPCODE_ESA)) - as_warn ("The 64 bit file format is used without esame instructions."); - - /* Set the ELF flags if desired. */ - if (s390_flags) - bfd_set_private_flags (stdoutput, s390_flags); - - /* Insert the opcode formats into a hash table. */ - s390_opformat_hash = hash_new (); - - op_end = s390_opformats + s390_num_opformats; - for (op = s390_opformats; op < op_end; op++) - { - retval = hash_insert (s390_opformat_hash, op->name, (PTR) op); - if (retval != (const char *) NULL) - { - as_bad (_("Internal assembler error for instruction format %s"), - op->name); - dup_insn = true; - } - } - - /* Insert the opcodes into a hash table. */ - s390_opcode_hash = hash_new (); - - op_end = s390_opcodes + s390_num_opcodes; - for (op = s390_opcodes; op < op_end; op++) - { - retval = hash_insert (s390_opcode_hash, op->name, (PTR) op); - if (retval != (const char *) NULL) - { - as_bad (_("Internal assembler error for instruction %s"), op->name); - dup_insn = true; - } - } - - if (dup_insn) - abort (); - - record_alignment (text_section, 2); - record_alignment (data_section, 2); - record_alignment (bss_section, 2); - -} - -/* Called after all assembly has been done. */ -void -s390_md_end () -{ - if (s390_arch_size == 64) - bfd_set_arch_mach (stdoutput, bfd_arch_s390, bfd_mach_s390_64); - else - bfd_set_arch_mach (stdoutput, bfd_arch_s390, bfd_mach_s390_31); -} - -void -s390_align_code (fragP, count) - fragS *fragP; - int count; -{ - /* We use nop pattern 0x0707. */ - if (count > 0) - { - memset (fragP->fr_literal + fragP->fr_fix, 0x07, count); - fragP->fr_var = count; - } -} - -/* Insert an operand value into an instruction. */ - -static void -s390_insert_operand (insn, operand, val, file, line) - unsigned char *insn; - const struct s390_operand *operand; - offsetT val; - char *file; - unsigned int line; -{ - addressT uval; - int offset; - - if (operand->flags & (S390_OPERAND_SIGNED|S390_OPERAND_PCREL)) - { - offsetT min, max; - - max = ((offsetT) 1 << (operand->bits - 1)) - 1; - min = - ((offsetT) 1 << (operand->bits - 1)); - /* Halve PCREL operands. */ - if (operand->flags & S390_OPERAND_PCREL) - val >>= 1; - /* Check for underflow / overflow. */ - if (val < min || val > max) - { - const char *err = - "operand out of range (%s not between %ld and %ld)"; - char buf[100]; - - if (operand->flags & S390_OPERAND_PCREL) - { - val <<= 1; - min <<= 1; - max <<= 1; - } - sprint_value (buf, val); - if (file == (char *) NULL) - as_bad (err, buf, (int) min, (int) max); - else - as_bad_where (file, line, err, buf, (int) min, (int) max); - return; - } - /* val is ok, now restrict it to operand->bits bits. */ - uval = (addressT) val & ((((addressT) 1 << (operand->bits-1)) << 1) - 1); - } - else - { - addressT min, max; - - max = (((addressT) 1 << (operand->bits - 1))<<1) - 1; - min = (offsetT) 0; - uval = (addressT) val; - /* Length x in an instructions has real length x+1. */ - if (operand->flags & S390_OPERAND_LENGTH) - uval--; - /* Check for underflow / overflow. */ - if (uval < min || uval > max) - { - const char *err = - "operand out of range (%s not between %ld and %ld)"; - char buf[100]; - - if (operand->flags & S390_OPERAND_LENGTH) - { - uval++; - min++; - max++; - } - sprint_value (buf, uval); - if (file == (char *) NULL) - as_bad (err, buf, (int) min, (int) max); - else - as_bad_where (file, line, err, buf, (int) min, (int) max); - return; - } - } - - /* Insert fragments of the operand byte for byte. */ - offset = operand->shift + operand->bits; - uval <<= (-offset) & 7; - insn += (offset - 1)/8; - while (uval != 0) - { - *insn-- |= uval; - uval >>= 8; - } -} - -/* Structure used to hold suffixes. */ -typedef enum - { - ELF_SUFFIX_NONE = 0, - ELF_SUFFIX_GOT, - ELF_SUFFIX_PLT, - ELF_SUFFIX_GOTENT - } -elf_suffix_type; - -struct map_bfd - { - char *string; - int length; - 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) - char **str_p; - expressionS *exp_p; -{ - static struct map_bfd mapping[] = - { - { "got", 3, ELF_SUFFIX_GOT }, - { "got12", 5, ELF_SUFFIX_GOT }, - { "plt", 3, ELF_SUFFIX_PLT }, - { "gotent", 6, ELF_SUFFIX_GOTENT }, - { NULL, 0, ELF_SUFFIX_NONE } - }; - - struct map_bfd *ptr; - char *str = *str_p; - char *ident; - int len; - - if (*str++ != '@') - return ELF_SUFFIX_NONE; - - ident = str; - while (ISALNUM (*str)) - str++; - len = str - ident; - - for (ptr = &mapping[0]; ptr->length > 0; ptr++) - if (len == ptr->length - && strncasecmp (ident, ptr->string, ptr->length) == 0) - { - if (exp_p->X_add_number != 0) - as_warn (_("identifier+constant@%s means identifier@%s+constant"), - ptr->string, ptr->string); - /* Now check for identifier@suffix+constant. */ - if (*str == '-' || *str == '+') - { - char *orig_line = input_line_pointer; - expressionS new_exp; - - input_line_pointer = str; - expression (&new_exp); - - switch (new_exp.X_op) - { - case O_constant: /* X_add_number (a constant expression). */ - exp_p->X_add_number += new_exp.X_add_number; - str = input_line_pointer; - break; - case O_symbol: /* X_add_symbol + X_add_number. */ - /* this case is used for e.g. xyz@PLT+.Label. */ - exp_p->X_add_number += new_exp.X_add_number; - exp_p->X_op_symbol = new_exp.X_add_symbol; - exp_p->X_op = O_add; - str = input_line_pointer; - break; - case O_uminus: /* (- X_add_symbol) + X_add_number. */ - /* this case is used for e.g. xyz@PLT-.Label. */ - exp_p->X_add_number += new_exp.X_add_number; - exp_p->X_op_symbol = new_exp.X_add_symbol; - exp_p->X_op = O_subtract; - str = input_line_pointer; - break; - default: - break; - } - - /* If s390_elf_suffix has not been called with - &input_line_pointer as first parameter, we have - clobbered the input_line_pointer. We have to - undo that. */ - if (&input_line_pointer != str_p) - input_line_pointer = orig_line; - } - *str_p = str; - return ptr->suffix; - } - - return BFD_RELOC_UNUSED; -} - -/* Structure used to hold a literal pool entry. */ -struct s390_lpe - { - struct s390_lpe *next; - expressionS ex; - FLONUM_TYPE floatnum; /* used if X_op == O_big && X_add_number <= 0 */ - LITTLENUM_TYPE bignum[4]; /* used if X_op == O_big && X_add_number > 0 */ - int nbytes; - bfd_reloc_code_real_type reloc; - symbolS *sym; - }; - -static struct s390_lpe *lpe_free_list = NULL; -static struct s390_lpe *lpe_list = NULL; -static struct s390_lpe *lpe_list_tail = NULL; -static symbolS *lp_sym = NULL; -static int lp_count = 0; -static int lpe_count = 0; - -static int -s390_exp_compare(exp1, exp2) - expressionS *exp1; - expressionS *exp2; -{ - if (exp1->X_op != exp2->X_op) - return 0; - - switch (exp1->X_op) - { - case O_constant: /* X_add_number must be equal. */ - case O_register: - return exp1->X_add_number == exp2->X_add_number; - - case O_big: - 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: - case O_uminus: - case O_bit_not: - case O_logical_not: - return (exp1->X_add_symbol == exp2->X_add_symbol) - && (exp1->X_add_number == exp2->X_add_number); - - case O_multiply: /* X_add_symbol,X_op_symbol&X_add_number must be equal. */ - case O_divide: - case O_modulus: - case O_left_shift: - case O_right_shift: - case O_bit_inclusive_or: - case O_bit_or_not: - case O_bit_exclusive_or: - case O_bit_and: - case O_add: - case O_subtract: - case O_eq: - case O_ne: - case O_lt: - case O_le: - case O_ge: - case O_gt: - case O_logical_and: - case O_logical_or: - return (exp1->X_add_symbol == exp2->X_add_symbol) - && (exp1->X_op_symbol == exp2->X_op_symbol) - && (exp1->X_add_number == exp2->X_add_number); - default: - return 0; - } -} - -/* Test for @lit and if its present make an entry in the literal pool and - modify the current expression to be an offset into the literal pool. */ -static elf_suffix_type -s390_lit_suffix (str_p, exp_p, suffix) - char **str_p; - expressionS *exp_p; - elf_suffix_type suffix; -{ - bfd_reloc_code_real_type reloc; - char tmp_name[64]; - char *str = *str_p; - char *ident; - struct s390_lpe *lpe; - int nbytes, len; - - if (*str++ != ':') - return suffix; /* No modification. */ - - /* We look for a suffix of the form "@lit1", "@lit2", "@lit4" or "@lit8". */ - ident = str; - while (ISALNUM (*str)) - str++; - len = str - ident; - if (len != 4 || strncasecmp (ident, "lit", 3) != 0 - || (ident[3]!='1' && ident[3]!='2' && ident[3]!='4' && ident[3]!='8')) - return suffix; /* no modification */ - nbytes = ident[3] - '0'; - - reloc = BFD_RELOC_UNUSED; - if (suffix == ELF_SUFFIX_GOT) - { - if (nbytes == 2) - reloc = BFD_RELOC_390_GOT16; - else if (nbytes == 4) - reloc = BFD_RELOC_32_GOT_PCREL; - else if (nbytes == 8) - reloc = BFD_RELOC_390_GOT64; - } - else if (suffix == ELF_SUFFIX_PLT) - { - if (nbytes == 4) - reloc = BFD_RELOC_390_PLT32; - else if (nbytes == 8) - reloc = BFD_RELOC_390_PLT64; - } - - if (suffix != ELF_SUFFIX_NONE && reloc == BFD_RELOC_UNUSED) - as_bad (_("Invalid suffix for literal pool entry")); - - /* Search the pool if the new entry is a duplicate. */ - if (exp_p->X_op == O_big) - { - /* Special processing for big numbers. */ - for (lpe = lpe_list; lpe != NULL; lpe = lpe->next) - { - if (lpe->ex.X_op == O_big) - { - if (exp_p->X_add_number <= 0 && lpe->ex.X_add_number <= 0) - { - if (memcmp (&generic_floating_point_number, &lpe->floatnum, - sizeof (FLONUM_TYPE)) == 0) - break; - } - else if (exp_p->X_add_number == lpe->ex.X_add_number) - { - if (memcmp (generic_bignum, lpe->bignum, - sizeof (LITTLENUM_TYPE)*exp_p->X_add_number) == 0) - break; - } - } - } - } - else - { - /* Processing for 'normal' data types. */ - for (lpe = lpe_list; lpe != NULL; lpe = lpe->next) - if (lpe->nbytes == nbytes && lpe->reloc == reloc - && s390_exp_compare(exp_p, &lpe->ex) != 0) - break; - } - - if (lpe == NULL) - { - /* A new literal. */ - if (lpe_free_list != NULL) - { - lpe = lpe_free_list; - lpe_free_list = lpe_free_list->next; - } - else - { - lpe = (struct s390_lpe *) xmalloc(sizeof (struct s390_lpe)); - } - - lpe->ex = *exp_p; - - if (exp_p->X_op == O_big) - { - if (exp_p->X_add_number <= 0) - lpe->floatnum = generic_floating_point_number; - else if (exp_p->X_add_number <= 4) - memcpy (lpe->bignum, generic_bignum, - exp_p->X_add_number*sizeof (LITTLENUM_TYPE)); - else - as_bad (_("Big number is too big")); - } - - lpe->nbytes = nbytes; - lpe->reloc = reloc; - /* Literal pool name defined ? */ - if (lp_sym == NULL) - { - sprintf (tmp_name, ".L\001%i", lp_count); - lp_sym = symbol_make(tmp_name); - } - - /* Make name for literal pool entry. */ - sprintf (tmp_name, ".L\001%i\002%i", lp_count, lpe_count); - lpe_count++; - lpe->sym = symbol_make(tmp_name); - - /* Add to literal pool list. */ - lpe->next = NULL; - if (lpe_list_tail != NULL) - { - lpe_list_tail->next = lpe; - lpe_list_tail = lpe; - } - 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; - exp_p->X_op_symbol = lp_sym; - exp_p->X_op = O_subtract; - exp_p->X_add_number = 0; - - *str_p = str; - - /* We change the suffix type to ELF_SUFFIX_NONE, because - the difference of two local labels is just a number. */ - return ELF_SUFFIX_NONE; -} - -/* Like normal .long/.short/.word, except support @got, etc. - clobbers input_line_pointer, checks end-of-line. */ -static void -s390_elf_cons (nbytes) - register int nbytes; /* 1=.byte, 2=.word, 4=.long */ -{ - expressionS exp; - elf_suffix_type suffix; - - if (is_it_end_of_statement ()) - { - demand_empty_rest_of_line (); - return; - } - - do - { - expression (&exp); - - if (exp.X_op == O_symbol - && *input_line_pointer == '@' - && (suffix = s390_elf_suffix (&input_line_pointer, &exp)) != ELF_SUFFIX_NONE) - { - bfd_reloc_code_real_type reloc; - reloc_howto_type *reloc_howto; - int size; - char *where; - - if (nbytes == 2 && suffix == ELF_SUFFIX_GOT) - reloc = BFD_RELOC_390_GOT16; - else if (nbytes == 4 && suffix == ELF_SUFFIX_GOT) - reloc = BFD_RELOC_32_GOT_PCREL; - else if (nbytes == 8 && suffix == ELF_SUFFIX_GOT) - reloc = BFD_RELOC_390_GOT64; - else if (nbytes == 4 && suffix == ELF_SUFFIX_PLT) - reloc = BFD_RELOC_390_PLT32; - else if (nbytes == 8 && suffix == ELF_SUFFIX_PLT) - reloc = BFD_RELOC_390_PLT64; - else - reloc = BFD_RELOC_UNUSED; - - if (reloc != BFD_RELOC_UNUSED) - { - reloc_howto = bfd_reloc_type_lookup (stdoutput, reloc); - size = bfd_get_reloc_size (reloc_howto); - if (size > nbytes) - as_bad (_("%s relocations do not fit in %d bytes"), - reloc_howto->name, nbytes); - where = frag_more (nbytes); - md_number_to_chars (where, 0, size); - /* 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")); - } - else - emit_expr (&exp, (unsigned int) nbytes); - } - while (*input_line_pointer++ == ','); - - input_line_pointer--; /* Put terminator back into stream. */ - demand_empty_rest_of_line (); -} - -/* We need to keep a list of fixups. We can't simply generate them as - we go, because that would require us to first create the frag, and - that would screw up references to ``.''. */ - -struct s390_fixup - { - expressionS exp; - int opindex; - bfd_reloc_code_real_type reloc; - }; - -#define MAX_INSN_FIXUPS (4) - -/* This routine is called for each instruction to be assembled. */ - -static char * -md_gather_operands (str, insn, opcode) - char *str; - unsigned char *insn; - const struct s390_opcode *opcode; -{ - struct s390_fixup fixups[MAX_INSN_FIXUPS]; - const struct s390_operand *operand; - const unsigned char *opindex_ptr; - elf_suffix_type suffix; - bfd_reloc_code_real_type reloc; - int skip_optional; - int parentheses; - char *f; - int fc, i; - - while (ISSPACE (*str)) str++; - - parentheses = 0; - skip_optional = 0; - - /* Gather the operands. */ - fc = 0; - for (opindex_ptr = opcode->operands; *opindex_ptr != 0; opindex_ptr++) - { - expressionS ex; - 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 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")); - else if (ex.X_op == O_absent) - as_bad (_("missing operand")); - else if (ex.X_op == O_register || ex.X_op == O_constant) - { - s390_lit_suffix (&str, &ex, ELF_SUFFIX_NONE); - - if (ex.X_op != O_register && ex.X_op != O_constant) - { - /* We need to generate a fixup for the - expression returned by s390_lit_suffix. */ - if (fc >= MAX_INSN_FIXUPS) - as_fatal (_("too many fixups")); - fixups[fc].exp = ex; - fixups[fc].opindex = *opindex_ptr; - fixups[fc].reloc = BFD_RELOC_UNUSED; - ++fc; - } - else - { - if ((operand->flags & S390_OPERAND_INDEX) - && ex.X_add_number == 0 - && warn_areg_zero == TRUE) - as_warn ("index register specified but zero"); - if ((operand->flags & S390_OPERAND_BASE) - && ex.X_add_number == 0 - && warn_areg_zero == TRUE) - as_warn ("base register specified but zero"); - s390_insert_operand (insn, operand, ex.X_add_number, NULL, 0); - } - } - else - { - suffix = s390_elf_suffix (&str, &ex); - suffix = s390_lit_suffix (&str, &ex, suffix); - reloc = BFD_RELOC_UNUSED; - - if (suffix == ELF_SUFFIX_GOT) - { - if (operand->flags & S390_OPERAND_DISP) - reloc = BFD_RELOC_390_GOT12; - else if ((operand->flags & S390_OPERAND_SIGNED) - && (operand->bits == 16)) - reloc = BFD_RELOC_390_GOT16; - else if ((operand->flags & S390_OPERAND_PCREL) - && (operand->bits == 32)) - reloc = BFD_RELOC_390_GOTENT; - } - else if (suffix == ELF_SUFFIX_PLT) - { - if ((operand->flags & S390_OPERAND_PCREL) - && (operand->bits == 16)) - reloc = BFD_RELOC_390_PLT16DBL; - else if ((operand->flags & S390_OPERAND_PCREL) - && (operand->bits == 32)) - reloc = BFD_RELOC_390_PLT32DBL; - } - else if (suffix == ELF_SUFFIX_GOTENT) - { - if ((operand->flags & S390_OPERAND_PCREL) - && (operand->bits == 32)) - reloc = BFD_RELOC_390_GOTENT; - } - - if (suffix != ELF_SUFFIX_NONE && reloc == BFD_RELOC_UNUSED) - as_bad (_("invalid operand suffix")); - /* We need to generate a fixup of type 'reloc' for this - expression. */ - if (fc >= MAX_INSN_FIXUPS) - as_fatal (_("too many fixups")); - fixups[fc].exp = ex; - fixups[fc].opindex = *opindex_ptr; - 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) - { - /* After a displacement a block in parentheses can start. */ - if (*str != '(') - { - /* Check if parethesed block can be skipped. If the next - operand is neiter an optional operand nor a base register - then we have a syntax error. */ - operand = s390_operands + *(++opindex_ptr); - if (!(operand->flags & (S390_OPERAND_INDEX|S390_OPERAND_BASE))) - as_bad (_("syntax error; missing '(' after displacement")); - - /* 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') - { - if (*str++ != ',') - as_bad (_("syntax error; expected ,")); - } - } - else - { - /* We found an opening parentheses. */ - str++; - for (f = str; *f != '\0'; f++) - if (*f == ',' || *f == ')') - break; - /* If there is no comma until the closing parentheses OR - there is a comma right after the opening parentheses, - we have to skip optional operands. */ - if (*f == ',' && f == str) - { - /* comma directly after '(' ? */ - skip_optional = 1; - str++; - } - else - skip_optional = (*f != ','); - } - } - else if (operand->flags & S390_OPERAND_BASE) - { - /* After the base register the parenthesed block ends. */ - if (*str++ != ')') - as_bad (_("syntax error; missing ')' after base register")); - skip_optional = 0; - /* If there is a next operand it must be seperated by a comma. */ - if (opindex_ptr[1] != '\0') - { - if (*str++ != ',') - as_bad (_("syntax error; expected ,")); - } - } - else - { - /* We can find an 'early' closing parentheses in e.g. D(L) instead - of D(L,B). In this case the base register has to be skipped. */ - if (*str == ')') - { - operand = s390_operands + *(++opindex_ptr); - - if (!(operand->flags & S390_OPERAND_BASE)) - as_bad (_("syntax error; ')' not allowed here")); - str++; - } - /* If there is a next operand it must be seperated by a comma. */ - if (opindex_ptr[1] != '\0') - { - if (*str++ != ',') - as_bad (_("syntax error; expected ,")); - } - } - } - - while (ISSPACE (*str)) - ++str; - - if (*str != '\0') - { - char *linefeed; - - if ((linefeed = strchr (str, '\n')) != NULL) - *linefeed = '\0'; - as_bad (_("junk at end of line: `%s'"), str); - if (linefeed != NULL) - *linefeed = '\n'; - } - - /* Write out the instruction. */ - f = frag_more (opcode->oplen); - memcpy (f, insn, opcode->oplen); - dwarf2_emit_insn (opcode->oplen); - - /* Create any fixups. At this point we do not use a - bfd_reloc_code_real_type, but instead just use the - BFD_RELOC_UNUSED plus the operand index. This lets us easily - handle fixups for any operand type, although that is admittedly - not a very exciting feature. We pick a BFD reloc type in - md_apply_fix3. */ - for (i = 0; i < fc; i++) - { - operand = s390_operands + fixups[i].opindex; - - if (fixups[i].reloc != BFD_RELOC_UNUSED) - { - 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), - size, &fixups[i].exp, reloc_howto->pc_relative, - fixups[i].reloc); - /* Turn off overflow checking in fixup_segment. This is necessary - because fixup_segment will signal an overflow for large 4 byte - quantities for GOT12 relocations. */ - if ( fixups[i].reloc == BFD_RELOC_390_GOT12 - || fixups[i].reloc == BFD_RELOC_390_GOT16) - fixP->fx_no_overflow = 1; - } - else - fix_new_exp (frag_now, f - frag_now->fr_literal, 4, &fixups[i].exp, - (operand->flags & S390_OPERAND_PCREL) != 0, - ((bfd_reloc_code_real_type) - (fixups[i].opindex + (int) BFD_RELOC_UNUSED))); - } - return str; -} - -/* This routine is called for each instruction to be assembled. */ - -void -md_assemble (str) - char *str; -{ - const struct s390_opcode *opcode; - unsigned char insn[6]; - char *s; - - /* Get the opcode. */ - for (s = str; *s != '\0' && ! ISSPACE (*s); s++) - ; - if (*s != '\0') - *s++ = '\0'; - - /* Look up the opcode in the hash table. */ - opcode = (struct s390_opcode *) hash_find (s390_opcode_hash, str); - if (opcode == (const struct s390_opcode *) NULL) - { - as_bad (_("Unrecognized opcode: `%s'"), str); - return; - } - else if (!(opcode->architecture & current_arch_mask)) - { - as_bad ("Opcode %s not available in this architecture", str); - return; - } - - memcpy (insn, opcode->opcode, sizeof (insn)); - md_gather_operands (s, insn, opcode); -} - -#ifndef WORKING_DOT_WORD -/* Handle long and short jumps. We don't support these */ -void -md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol) - char *ptr; - addressT from_addr, to_addr; - fragS *frag; - symbolS *to_symbol; -{ - abort (); -} - -void -md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol) - char *ptr; - addressT from_addr, to_addr; - fragS *frag; - symbolS *to_symbol; -{ - abort (); -} -#endif - -void -s390_bss (ignore) - int ignore ATTRIBUTE_UNUSED; -{ - /* We don't support putting frags in the BSS segment, we fake it - by marking in_bss, then looking at s_skip for clues. */ - - subseg_set (bss_section, 0); - demand_empty_rest_of_line (); -} - -/* Pseudo-op handling. */ - -void -s390_insn (ignore) - int ignore ATTRIBUTE_UNUSED; -{ - expressionS exp; - const struct s390_opcode *opformat; - unsigned char insn[6]; - char *s; - - /* Get the opcode format. */ - s = input_line_pointer; - while (*s != '\0' && *s != ',' && ! ISSPACE (*s)) - s++; - if (*s != ',') - as_bad (_("Invalid .insn format\n")); - *s++ = '\0'; - - /* Look up the opcode in the hash table. */ - opformat = (struct s390_opcode *) - hash_find (s390_opformat_hash, input_line_pointer); - if (opformat == (const struct s390_opcode *) NULL) - { - as_bad (_("Unrecognized opcode format: `%s'"), input_line_pointer); - return; - } - input_line_pointer = s; - expression (&exp); - if (exp.X_op == O_constant) - { - if ( ((opformat->oplen == 6) && (exp.X_op > 0) && (exp.X_op < (1ULL << 48))) - || ((opformat->oplen == 4) && (exp.X_op > 0) && (exp.X_op < (1ULL << 32))) - || ((opformat->oplen == 2) && (exp.X_op > 0) && (exp.X_op < (1ULL << 16)))) - md_number_to_chars (insn, exp.X_add_number, opformat->oplen); - else - as_bad (_("Invalid .insn format\n")); - } - else if (exp.X_op == O_big) - { - if (exp.X_add_number > 0 - && opformat->oplen == 6 - && generic_bignum[3] == 0) - { - md_number_to_chars (insn, generic_bignum[2], 2); - md_number_to_chars (&insn[2], generic_bignum[1], 2); - md_number_to_chars (&insn[4], generic_bignum[0], 2); - } - else - as_bad (_("Invalid .insn format\n")); - } - else - as_bad (_("second operand of .insn not a constant\n")); - - if (strcmp (opformat->name, "e") != 0 && *input_line_pointer++ != ',') - as_bad (_("missing comma after insn constant\n")); - - if ((s = strchr (input_line_pointer, '\n')) != NULL) - *s = '\0'; - input_line_pointer = md_gather_operands (input_line_pointer, insn, - opformat); - if (s != NULL) - *s = '\n'; - demand_empty_rest_of_line (); -} - -/* The .byte pseudo-op. This is similar to the normal .byte - pseudo-op, but it can also take a single ASCII string. */ - -static void -s390_byte (ignore) - int ignore ATTRIBUTE_UNUSED; -{ - if (*input_line_pointer != '\"') - { - cons (1); - return; - } - - /* Gather characters. A real double quote is doubled. Unusual - characters are not permitted. */ - ++input_line_pointer; - while (1) - { - char c; - - c = *input_line_pointer++; - - if (c == '\"') - { - if (*input_line_pointer != '\"') - break; - ++input_line_pointer; - } - - FRAG_APPEND_1_CHAR (c); - } - - demand_empty_rest_of_line (); -} - -/* The .ltorg pseudo-op.This emits all literals defined since the last - .ltorg or the invocation of gas. Literals are defined with the - @lit suffix. */ - -static void -s390_literals (ignore) - int ignore ATTRIBUTE_UNUSED; -{ - struct s390_lpe *lpe; - - if (lp_sym == NULL || lpe_count == 0) - return; /* nothing to be done */ - - /* Emit symbol for start of literal pool. */ - S_SET_SEGMENT (lp_sym, now_seg); - S_SET_VALUE (lp_sym, (valueT) frag_now_fix ()); - lp_sym->sy_frag = frag_now; - - while (lpe_list) - { - lpe = lpe_list; - lpe_list = lpe_list->next; - S_SET_SEGMENT (lpe->sym, now_seg); - S_SET_VALUE (lpe->sym, (valueT) frag_now_fix ()); - lpe->sym->sy_frag = frag_now; - - /* Emit literal pool entry. */ - if (lpe->reloc != BFD_RELOC_UNUSED) - { - reloc_howto_type *reloc_howto = - bfd_reloc_type_lookup (stdoutput, lpe->reloc); - int size = bfd_get_reloc_size (reloc_howto); - char *where; - - if (size > lpe->nbytes) - as_bad (_("%s relocations do not fit in %d bytes"), - reloc_howto->name, lpe->nbytes); - where = frag_more (lpe->nbytes); - md_number_to_chars (where, 0, size); - fix_new_exp (frag_now, where - frag_now->fr_literal, - size, &lpe->ex, reloc_howto->pc_relative, lpe->reloc); - } - else - { - if (lpe->ex.X_op == O_big) - { - if (lpe->ex.X_add_number <= 0) - generic_floating_point_number = lpe->floatnum; - else - memcpy (generic_bignum, lpe->bignum, - lpe->ex.X_add_number*sizeof (LITTLENUM_TYPE)); - } - emit_expr (&lpe->ex, lpe->nbytes); - } - - lpe->next = lpe_free_list; - lpe_free_list = lpe; - } - lpe_list_tail = NULL; - lp_sym = NULL; - lp_count++; - lpe_count = 0; -} - -/* Turn a string in input_line_pointer into a floating point constant - of type type, and store the appropriate bytes in *litp. The number - of LITTLENUMS emitted is stored in *sizep . An error message is - returned, or NULL on OK. */ - -char * -md_atof (type, litp, sizep) - int type; - char *litp; - int *sizep; -{ - int prec; - LITTLENUM_TYPE words[4]; - char *t; - int i; - - switch (type) - { - case 'f': - prec = 2; - break; - - case 'd': - prec = 4; - break; - - default: - *sizep = 0; - return "bad call to md_atof"; - } - - t = atof_ieee (input_line_pointer, type, words); - if (t) - input_line_pointer = t; - - *sizep = prec * 2; - - for (i = 0; i < prec; i++) - { - md_number_to_chars (litp, (valueT) words[i], 2); - litp += 2; - } - - return NULL; -} - -/* Align a section (I don't know why this is machine dependent). */ - -valueT -md_section_align (seg, addr) - asection *seg; - valueT addr; -{ - int align = bfd_get_section_alignment (stdoutput, seg); - - return ((addr + (1 << align) - 1) & (-1 << align)); -} - -/* We don't have any form of relaxing. */ - -int -md_estimate_size_before_relax (fragp, seg) - fragS *fragp ATTRIBUTE_UNUSED; - asection *seg ATTRIBUTE_UNUSED; -{ - abort (); - return 0; -} - -/* Convert a machine dependent frag. We never generate these. */ - -void -md_convert_frag (abfd, sec, fragp) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - fragS *fragp ATTRIBUTE_UNUSED; -{ - abort (); -} - -symbolS * -md_undefined_symbol (name) - char *name; -{ - if (*name == '_' && *(name+1) == 'G' - && strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) - { - if (!GOT_symbol) - { - if (symbol_find (name)) - as_bad (_("GOT already in symbol table")); - GOT_symbol = symbol_new (name, undefined_section, - (valueT) 0, &zero_address_frag); - } - return GOT_symbol; - } - return 0; -} - -/* Functions concerning relocs. */ - -/* The location from which a PC relative jump should be calculated, - given a PC relative reloc. */ - -long -md_pcrel_from_section (fixp, sec) - fixS *fixp; - segT sec ATTRIBUTE_UNUSED; -{ - return fixp->fx_frag->fr_address + fixp->fx_where; -} - -/* Here we decide which fixups can be adjusted to make them relative to - the beginning of the section instead of the symbol. Basically we need - to make sure that the dynamic relocations are done correctly, so in - some cases we force the original symbol to be used. */ -int -tc_s390_fix_adjustable(fixP) - fixS * fixP; -{ - /* Prevent all adjustments to global symbols. */ - if (S_IS_EXTERN (fixP->fx_addsy)) - return 0; - if (S_IS_WEAK (fixP->fx_addsy)) - return 0; - /* Don't adjust pc-relative references to merge sections. */ - if ((S_GET_SEGMENT(fixP->fx_addsy)->flags & SEC_MERGE) != 0 - && fixP->fx_pcrel) - return 0; - /* adjust_reloc_syms doesn't know about the GOT. */ - if ( fixP->fx_r_type == BFD_RELOC_32_GOTOFF - || fixP->fx_r_type == BFD_RELOC_390_PLT16DBL - || fixP->fx_r_type == BFD_RELOC_390_PLT32 - || fixP->fx_r_type == BFD_RELOC_390_PLT32DBL - || fixP->fx_r_type == BFD_RELOC_390_PLT64 - || fixP->fx_r_type == BFD_RELOC_390_GOT12 - || fixP->fx_r_type == BFD_RELOC_390_GOT16 - || fixP->fx_r_type == BFD_RELOC_32_GOT_PCREL - || fixP->fx_r_type == BFD_RELOC_390_GOT64 - || fixP->fx_r_type == BFD_RELOC_390_GOTENT - || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT - || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) - return 0; - return 1; -} - -/* Return true if we must always emit a reloc for a type and false if - there is some hope of resolving it a assembly time. */ -int -tc_s390_force_relocation (fixp) - struct fix *fixp; -{ - /* Ensure we emit a relocation for every reference to the global - offset table or to the procedure link table. */ - switch (fixp->fx_r_type) - { - case BFD_RELOC_390_GOT12: - case BFD_RELOC_32_GOT_PCREL: - case BFD_RELOC_32_GOTOFF: - case BFD_RELOC_390_GOTPC: - case BFD_RELOC_390_GOT16: - case BFD_RELOC_390_GOTPCDBL: - case BFD_RELOC_390_GOT64: - case BFD_RELOC_390_GOTENT: - case BFD_RELOC_390_PLT32: - case BFD_RELOC_390_PLT16DBL: - case BFD_RELOC_390_PLT32DBL: - case BFD_RELOC_390_PLT64: - case BFD_RELOC_VTABLE_INHERIT: - case BFD_RELOC_VTABLE_ENTRY: - return 1; - default: - return 0; - } -} - -/* 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 - above we used a reloc code which was the largest legal reloc code - plus the operand index. Here we undo that to recover the operand - index. At this point all symbol values should be fully resolved, - and we attempt to completely resolve the reloc. If we can not do - that, we determine the correct reloc code and put it back in the - fixup. */ - -void -md_apply_fix3 (fixP, valP, seg) - fixS *fixP; - valueT *valP; - segT seg; -{ - char *where; - valueT value = * valP; - - where = fixP->fx_frag->fr_literal + fixP->fx_where; - - if (fixP->fx_subsy != NULL) - { - if ((fixP->fx_addsy != NULL - && S_GET_SEGMENT (fixP->fx_addsy) == S_GET_SEGMENT (fixP->fx_subsy) - && SEG_NORMAL (S_GET_SEGMENT (fixP->fx_addsy))) - || (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section)) - value += S_GET_VALUE (fixP->fx_subsy); - if (!S_IS_DEFINED (fixP->fx_subsy)) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("unresolved fx_subsy symbol that must be resolved")); - value -= S_GET_VALUE(fixP->fx_subsy); - - if (S_GET_SEGMENT (fixP->fx_subsy) == seg && ! fixP->fx_pcrel) - value += MD_PCREL_FROM_SECTION (fixP, seg); - } - - if (fixP->fx_addsy != NULL) - { - if ((fixP->fx_subsy != NULL - && S_GET_SEGMENT (fixP->fx_addsy) == S_GET_SEGMENT (fixP->fx_subsy) - && SEG_NORMAL (S_GET_SEGMENT(fixP->fx_addsy))) - || (S_GET_SEGMENT (fixP->fx_addsy) == seg - && fixP->fx_pcrel && TC_RELOC_RTSYM_LOC_FIXUP (fixP)) - || (!fixP->fx_pcrel - && S_GET_SEGMENT (fixP->fx_addsy) == absolute_section) - || (S_GET_SEGMENT (fixP->fx_addsy) != undefined_section - && !bfd_is_com_section (S_GET_SEGMENT (fixP->fx_addsy)) - && TC_FIX_ADJUSTABLE(fixP))) - value -= S_GET_VALUE (fixP->fx_addsy); - - if (fixP->fx_pcrel) - value += fixP->fx_frag->fr_address + fixP->fx_where; - } - else - fixP->fx_done = 1; - - if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED) - { - 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. */ - s390_insert_operand (where, operand, (offsetT) value, - fixP->fx_file, fixP->fx_line); - return; - } - - /* Determine a BFD reloc value based on the operand information. - We are only prepared to turn a few of the operands into - relocs. */ - fixP->fx_offset = value; - if (operand->bits == 12 && operand->shift == 20) - { - fixP->fx_size = 2; - fixP->fx_where += 2; - fixP->fx_r_type = BFD_RELOC_390_12; - } - else if (operand->bits == 12 && operand->shift == 36) - { - fixP->fx_size = 2; - fixP->fx_where += 4; - fixP->fx_r_type = BFD_RELOC_390_12; - } - else if (operand->bits == 8 && operand->shift == 8) - { - fixP->fx_size = 1; - fixP->fx_where += 1; - fixP->fx_r_type = BFD_RELOC_8; - } - else if (operand->bits == 16 && operand->shift == 16) - { - fixP->fx_size = 2; - fixP->fx_where += 2; - if (operand->flags & S390_OPERAND_PCREL) - { - fixP->fx_r_type = BFD_RELOC_390_PC16DBL; - fixP->fx_offset += 2; - } - else - fixP->fx_r_type = BFD_RELOC_16; - } - else if (operand->bits == 32 && operand->shift == 16 - && (operand->flags & S390_OPERAND_PCREL)) - { - fixP->fx_size = 4; - fixP->fx_where += 2; - fixP->fx_offset += 2; - fixP->fx_r_type = BFD_RELOC_390_PC32DBL; - } - else - { - 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)) - 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")); - fixP->fx_done = 1; - return; - } - } - else - { - switch (fixP->fx_r_type) - { - case BFD_RELOC_8: - if (fixP->fx_pcrel) - abort (); - if (fixP->fx_done) - md_number_to_chars (where, value, 1); - break; - case BFD_RELOC_390_12: - case BFD_RELOC_390_GOT12: - if (fixP->fx_done) - { - unsigned short mop; - - 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: - case BFD_RELOC_16_GOTOFF: - if (fixP->fx_pcrel) - as_bad_where (fixP->fx_file, fixP->fx_line, - "cannot emit PC relative %s relocation%s%s", - bfd_get_reloc_code_name (fixP->fx_r_type), - fixP->fx_addsy != NULL ? " against " : "", - (fixP->fx_addsy != NULL - ? S_GET_NAME (fixP->fx_addsy) - : "")); - if (fixP->fx_done) - md_number_to_chars (where, value, 2); - break; - case BFD_RELOC_390_GOT16: - if (fixP->fx_done) - md_number_to_chars (where, value, 2); - break; - case BFD_RELOC_390_PC16DBL: - case BFD_RELOC_390_PLT16DBL: - value += 2; - if (fixP->fx_done) - md_number_to_chars (where, (offsetT) value >> 1, 2); - break; - - case BFD_RELOC_32: - if (fixP->fx_pcrel) - fixP->fx_r_type = BFD_RELOC_32_PCREL; - else - fixP->fx_r_type = BFD_RELOC_32; - if (fixP->fx_done) - md_number_to_chars (where, value, 4); - break; - case BFD_RELOC_32_PCREL: - case BFD_RELOC_32_BASEREL: - fixP->fx_r_type = BFD_RELOC_32_PCREL; - if (fixP->fx_done) - md_number_to_chars (where, value, 4); - break; - case BFD_RELOC_32_GOT_PCREL: - case BFD_RELOC_390_PLT32: - if (fixP->fx_done) - md_number_to_chars (where, value, 4); - break; - case BFD_RELOC_390_PC32DBL: - case BFD_RELOC_390_PLT32DBL: - case BFD_RELOC_390_GOTPCDBL: - case BFD_RELOC_390_GOTENT: - value += 2; - if (fixP->fx_done) - md_number_to_chars (where, (offsetT) value >> 1, 4); - break; - - case BFD_RELOC_32_GOTOFF: - if (fixP->fx_done) - md_number_to_chars (where, value, sizeof (int)); - break; - - case BFD_RELOC_390_GOT64: - case BFD_RELOC_390_PLT64: - if (fixP->fx_done) - md_number_to_chars (where, value, 8); - break; - - case BFD_RELOC_64: - if (fixP->fx_pcrel) - fixP->fx_r_type = BFD_RELOC_64_PCREL; - else - fixP->fx_r_type = BFD_RELOC_64; - if (fixP->fx_done) - md_number_to_chars (where, value, 8); - break; - - case BFD_RELOC_64_PCREL: - fixP->fx_r_type = BFD_RELOC_64_PCREL; - if (fixP->fx_done) - md_number_to_chars (where, value, 8); - break; - - case BFD_RELOC_VTABLE_INHERIT: - case BFD_RELOC_VTABLE_ENTRY: - fixP->fx_done = 0; - return; - - 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 - fprintf (stderr, "Gas failure, reloc type #%i\n", fixP->fx_r_type); - fflush (stderr); - abort (); - } - } - - fixP->fx_offset = value; - } -} - -/* Generate a reloc for a fixup. */ - -arelent * -tc_gen_reloc (seg, fixp) - asection *seg ATTRIBUTE_UNUSED; - fixS *fixp; -{ - bfd_reloc_code_real_type code; - arelent *reloc; - - code = fixp->fx_r_type; - if (GOT_symbol && fixp->fx_addsy == GOT_symbol) - { - if ( (s390_arch_size == 32 && code == BFD_RELOC_32_PCREL) - || (s390_arch_size == 64 && code == BFD_RELOC_64_PCREL)) - code = BFD_RELOC_390_GOTPC; - if (code == BFD_RELOC_390_PC32DBL) - code = BFD_RELOC_390_GOTPCDBL; - } - - reloc = (arelent *) xmalloc (sizeof (arelent)); - reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; - reloc->howto = bfd_reloc_type_lookup (stdoutput, code); - if (reloc->howto == NULL) - { - as_bad_where (fixp->fx_file, fixp->fx_line, - _("cannot represent relocation type %s"), - bfd_get_reloc_code_name (code)); - /* Set howto to a garbage value so that we can keep going. */ - reloc->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32); - assert (reloc->howto != NULL); - } - reloc->addend = fixp->fx_offset; - - return reloc; -} diff --git a/contrib/binutils/gas/config/tc-s390.h b/contrib/binutils/gas/config/tc-s390.h deleted file mode 100644 index 1837b1ab4448..000000000000 --- a/contrib/binutils/gas/config/tc-s390.h +++ /dev/null @@ -1,115 +0,0 @@ -/* tc-s390.h -- Header file for tc-s390.c. - Copyright 2000, 2001 Free Software Foundation, Inc. - Written by Martin Schwidefsky (schwidefsky@de.ibm.com). - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - -#define TC_S390 - -#ifdef ANSI_PROTOTYPES -struct fix; -#endif - -#ifndef BFD_ASSEMBLER - #error S390 support requires BFD_ASSEMBLER -#endif - -/* This expression evaluates to false if the relocation is for a local object - for which we still want to do the relocation at runtime. True if we - are willing to perform this relocation while building the .o file. - This is only used for pcrel relocations, so GOTOFF does not need to be - checked here. I am not sure if some of the others are ever used with - pcrel, but it is easier to be safe than sorry. */ - -#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ - ((FIX)->fx_r_type != BFD_RELOC_390_GOTENT \ - && ((FIX)->fx_addsy == NULL \ - || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && S_IS_DEFINED ((FIX)->fx_addsy) \ - && ! S_IS_COMMON ((FIX)->fx_addsy)))) - -#define TC_FORCE_RELOCATION(FIXP) tc_s390_force_relocation(FIXP) -extern int tc_s390_force_relocation PARAMS ((struct fix *)); - -#define tc_fix_adjustable(X) tc_s390_fix_adjustable(X) -extern int tc_s390_fix_adjustable PARAMS ((struct fix *)); - -#define TC_FIX_ADJUSTABLE(fixP) \ - (! symbol_used_in_reloc_p ((fixP)->fx_addsy) && tc_fix_adjustable (fixP)) - -/* The target BFD architecture. */ -#define TARGET_ARCH bfd_arch_s390 -extern enum bfd_architecture s390_arch PARAMS ((void)); - -/* The target BFD format. */ -#define TARGET_FORMAT s390_target_format() -extern const char * s390_target_format PARAMS ((void)); - -/* Set the endianness we are using. */ -#define TARGET_BYTES_BIG_ENDIAN 1 - -/* Whether or not the target is big endian */ -extern int target_big_endian; - -/* Permit temporary numeric labels. */ -#define LOCAL_LABELS_FB 1 - -/* $ is used to refer to the current location. */ -/* #define DOLLAR_DOT */ - -/* We need to be able to make relocations involving the difference of - two symbols. This includes the difference of two symbols when - one of them is undefined (this comes up in PIC code generation). - */ -#define UNDEFINED_DIFFERENCE_OK - -/* foo-. gets turned into PC relative relocs */ -#define DIFF_EXPR_OK - -/* We don't need to handle .word strangely. */ -#define WORKING_DOT_WORD - -#define md_number_to_chars number_to_chars_bigendian - -#define md_do_align(n, fill, len, max, around) \ -if ((n) && !need_pass_2 && (fill == 0) && \ - (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) { \ - char *p; \ - p = frag_var (rs_align_code, 15, 1, (relax_substateT) max, \ - (symbolS *) 0, (offsetT) (n), (char *) 0); \ - *p = 0x07; \ - goto around; \ -} - -extern void s390_align_code PARAMS ((fragS *, int)); - -#define HANDLE_ALIGN(fragP) \ -if (fragP->fr_type == rs_align_code) \ - s390_align_code (fragP, (fragP->fr_next->fr_address \ - - fragP->fr_address \ - - fragP->fr_fix)); - -/* call md_pcrel_from_section, not md_pcrel_from */ -#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC) -extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); - -#define md_operand(x) - -extern void s390_md_end PARAMS ((void)); -#define md_end() s390_md_end () diff --git a/contrib/binutils/gas/config/tc-tic30.c b/contrib/binutils/gas/config/tc-tic30.c deleted file mode 100644 index 1258b1317d54..000000000000 --- a/contrib/binutils/gas/config/tc-tic30.c +++ /dev/null @@ -1,1881 +0,0 @@ -/* tc-c30.c -- Assembly code for the Texas Instruments TMS320C30 - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. - Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - -/* Texas Instruments TMS320C30 machine specific gas. - Written by Steven Haworth (steve@pm.cse.rmit.edu.au). - Bugs & suggestions are completely welcome. This is free software. - Please help us make it better. */ - -#include "as.h" -#include "safe-ctype.h" -#include "opcode/tic30.h" - -/* Put here all non-digit non-letter charcters that may occur in an - operand. */ -static char operand_special_chars[] = "%$-+(,)*._~/<>&^!:[@]"; -static char *ordinal_names[] = { - "first", "second", "third", "fourth", "fifth" -}; - -const int md_reloc_size = 0; - -const char comment_chars[] = ";"; -const char line_comment_chars[] = "*"; -const char line_separator_chars[] = ""; - -const char *md_shortopts = ""; -struct option md_longopts[] = { - {NULL, no_argument, NULL, 0} -}; - -size_t md_longopts_size = sizeof (md_longopts); - -/* Chars that mean this number is a floating point constant. */ -/* As in 0f12.456 */ -/* or 0d1.2345e12 */ -const char FLT_CHARS[] = "fFdDxX"; - -/* Chars that can be used to separate mant from exp in floating point - nums. */ -const char EXP_CHARS[] = "eE"; - -/* tables for lexical analysis */ -static char opcode_chars[256]; -static char register_chars[256]; -static char operand_chars[256]; -static char space_chars[256]; -static char identifier_chars[256]; -static char digit_chars[256]; - -/* lexical macros */ -#define is_opcode_char(x) (opcode_chars[(unsigned char) x]) -#define is_operand_char(x) (operand_chars[(unsigned char) x]) -#define is_register_char(x) (register_chars[(unsigned char) x]) -#define is_space_char(x) (space_chars[(unsigned char) x]) -#define is_identifier_char(x) (identifier_chars[(unsigned char) x]) -#define is_digit_char(x) (digit_chars[(unsigned char) x]) - -const pseudo_typeS md_pseudo_table[] = { - {0, 0, 0} -}; - -#undef USE_STDOUT -#define USE_STDOUT 1 - -#ifdef USE_STDARG - -#include <stdarg.h> - -int -debug (const char *string, ...) -{ - if (flag_debug) - { - va_list argptr; - char str[100]; - - va_start (argptr, string); - vsprintf (str, string, argptr); - if (str[0] == '\0') - return (0); - va_end (argptr); - fputs (str, USE_STDOUT ? stdout : stderr); - return strlen (str); - } - else - return 0; -} -#else -int -debug (string, va_alist) - const char *string; - va_dcl -{ - if (flag_debug) - { - va_list argptr; - char str[100]; - int cnt; - - va_start (argptr, string); - cnt = vsprintf (str, string, argptr); - if (str[0] == NULL) - return (0); - va_end (argptr); - fputs (str, USE_STDOUT ? stdout : stderr); - return (cnt); - } - else - return 0; -} -#endif - -/* hash table for opcode lookup */ -static struct hash_control *op_hash; -/* hash table for parallel opcode lookup */ -static struct hash_control *parop_hash; -/* hash table for register lookup */ -static struct hash_control *reg_hash; -/* hash table for indirect addressing lookup */ -static struct hash_control *ind_hash; - -void -md_begin () -{ - const char *hash_err; - debug ("In md_begin()\n"); - op_hash = hash_new (); - { - const template *current_optab = tic30_optab; - for (; current_optab < tic30_optab_end; current_optab++) - { - hash_err = hash_insert (op_hash, current_optab->name, (char *) current_optab); - if (hash_err) - as_fatal ("Internal Error: Can't Hash %s: %s", current_optab->name, hash_err); - } - } - parop_hash = hash_new (); - { - const partemplate *current_parop = tic30_paroptab; - for (; current_parop < tic30_paroptab_end; current_parop++) - { - hash_err = hash_insert (parop_hash, current_parop->name, (char *) current_parop); - if (hash_err) - as_fatal ("Internal Error: Can't Hash %s: %s", current_parop->name, hash_err); - } - } - reg_hash = hash_new (); - { - const reg *current_reg = tic30_regtab; - for (; current_reg < tic30_regtab_end; current_reg++) - { - hash_err = hash_insert (reg_hash, current_reg->name, (char *) current_reg); - if (hash_err) - as_fatal ("Internal Error: Can't Hash %s: %s", current_reg->name, hash_err); - } - } - ind_hash = hash_new (); - { - const ind_addr_type *current_ind = tic30_indaddr_tab; - for (; current_ind < tic30_indaddrtab_end; current_ind++) - { - hash_err = hash_insert (ind_hash, current_ind->syntax, (char *) current_ind); - if (hash_err) - as_fatal ("Internal Error: Can't Hash %s: %s", current_ind->syntax, hash_err); - } - } - /* fill in lexical tables: opcode_chars, operand_chars, space_chars */ - { - register int c; - register char *p; - - for (c = 0; c < 256; c++) - { - if (ISLOWER (c) || ISDIGIT (c)) - { - opcode_chars[c] = c; - register_chars[c] = c; - } - else if (ISUPPER (c)) - { - opcode_chars[c] = TOLOWER (c); - register_chars[c] = opcode_chars[c]; - } - else if (c == ')' || c == '(') - { - register_chars[c] = c; - } - if (ISUPPER (c) || ISLOWER (c) || ISDIGIT (c)) - operand_chars[c] = c; - if (ISDIGIT (c) || c == '-') - digit_chars[c] = c; - if (ISALPHA (c) || c == '_' || c == '.' || ISDIGIT (c)) - identifier_chars[c] = c; - if (c == ' ' || c == '\t') - space_chars[c] = c; - if (c == '_') - opcode_chars[c] = c; - } - for (p = operand_special_chars; *p != '\0'; p++) - operand_chars[(unsigned char) *p] = *p; - } -} - -/* Address Mode OR values */ -#define AM_Register 0x00000000 -#define AM_Direct 0x00200000 -#define AM_Indirect 0x00400000 -#define AM_Immediate 0x00600000 -#define AM_NotReq 0xFFFFFFFF - -/* PC Relative OR values */ -#define PC_Register 0x00000000 -#define PC_Relative 0x02000000 - -typedef struct { - unsigned op_type; - struct { - int resolved; - unsigned address; - char *label; - expressionS direct_expr; - } direct; - struct { - unsigned mod; - int ARnum; - unsigned char disp; - } indirect; - struct { - unsigned opcode; - } reg; - struct { - int resolved; - int decimal_found; - float f_number; - int s_number; - unsigned int u_number; - char *label; - expressionS imm_expr; - } immediate; -} operand; - -int tic30_parallel_insn PARAMS ((char *)); -operand *tic30_operand PARAMS ((char *)); -char *tic30_find_parallel_insn PARAMS ((char *, char *)); - -template *opcode; - -struct tic30_insn { - template *tm; /* Template of current instruction */ - unsigned opcode; /* Final opcode */ - int operands; /* Number of given operands */ - /* Type of operand given in instruction */ - operand *operand_type[MAX_OPERANDS]; - unsigned addressing_mode; /* Final addressing mode of instruction */ -}; - -struct tic30_insn insn; -static int found_parallel_insn; - -void -md_assemble (line) - char *line; -{ - template *opcode; - char *current_posn; - char *token_start; - char save_char; - int count; - - debug ("In md_assemble() with argument %s\n", line); - memset (&insn, '\0', sizeof (insn)); - if (found_parallel_insn) - { - debug ("Line is second part of parallel instruction\n\n"); - found_parallel_insn = 0; - return; - } - if ((current_posn = tic30_find_parallel_insn (line, input_line_pointer + 1)) == NULL) - current_posn = line; - else - found_parallel_insn = 1; - while (is_space_char (*current_posn)) - current_posn++; - token_start = current_posn; - if (!is_opcode_char (*current_posn)) - { - as_bad ("Invalid character %s in opcode", output_invalid (*current_posn)); - return; - } - /* Check if instruction is a parallel instruction by seeing if the first - character is a q. */ - if (*token_start == 'q') - { - if (tic30_parallel_insn (token_start)) - { - if (found_parallel_insn) - free (token_start); - return; - } - } - while (is_opcode_char (*current_posn)) - current_posn++; - { /* Find instruction */ - save_char = *current_posn; - *current_posn = '\0'; - opcode = (template *) hash_find (op_hash, token_start); - if (opcode) - { - debug ("Found instruction %s\n", opcode->name); - insn.tm = opcode; - } - else - { - debug ("Didn't find insn\n"); - as_bad ("Unknown TMS320C30 instruction: %s", token_start); - return; - } - *current_posn = save_char; - } - if (*current_posn != END_OF_INSN) - { /* Find operands */ - int paren_not_balanced; - int expecting_operand = 0; - int this_operand; - do - { - /* skip optional white space before operand */ - while (!is_operand_char (*current_posn) && *current_posn != END_OF_INSN) - { - if (!is_space_char (*current_posn)) - { - as_bad ("Invalid character %s before %s operand", - output_invalid (*current_posn), - ordinal_names[insn.operands]); - return; - } - current_posn++; - } - token_start = current_posn; /* after white space */ - paren_not_balanced = 0; - while (paren_not_balanced || *current_posn != ',') - { - if (*current_posn == END_OF_INSN) - { - if (paren_not_balanced) - { - as_bad ("Unbalanced parenthesis in %s operand.", - ordinal_names[insn.operands]); - return; - } - else - break; /* we are done */ - } - else if (!is_operand_char (*current_posn) && !is_space_char (*current_posn)) - { - as_bad ("Invalid character %s in %s operand", - output_invalid (*current_posn), - ordinal_names[insn.operands]); - return; - } - if (*current_posn == '(') - ++paren_not_balanced; - if (*current_posn == ')') - --paren_not_balanced; - current_posn++; - } - if (current_posn != token_start) - { /* yes, we've read in another operand */ - this_operand = insn.operands++; - if (insn.operands > MAX_OPERANDS) - { - as_bad ("Spurious operands; (%d operands/instruction max)", - MAX_OPERANDS); - return; - } - /* now parse operand adding info to 'insn' as we go along */ - save_char = *current_posn; - *current_posn = '\0'; - insn.operand_type[this_operand] = tic30_operand (token_start); - *current_posn = save_char; - if (insn.operand_type[this_operand] == NULL) - return; - } - else - { - if (expecting_operand) - { - as_bad ("Expecting operand after ','; got nothing"); - return; - } - if (*current_posn == ',') - { - as_bad ("Expecting operand before ','; got nothing"); - return; - } - } - /* now *current_posn must be either ',' or END_OF_INSN */ - if (*current_posn == ',') - { - if (*++current_posn == END_OF_INSN) - { /* just skip it, if it's \n complain */ - as_bad ("Expecting operand after ','; got nothing"); - return; - } - expecting_operand = 1; - } - } - while (*current_posn != END_OF_INSN); /* until we get end of insn */ - } - debug ("Number of operands found: %d\n", insn.operands); - /* Check that number of operands is correct */ - if (insn.operands != insn.tm->operands) - { - int i; - int numops = insn.tm->operands; - /* If operands are not the same, then see if any of the operands are not - required. Then recheck with number of given operands. If they are still not - the same, then give an error, otherwise carry on. */ - for (i = 0; i < insn.tm->operands; i++) - if (insn.tm->operand_types[i] & NotReq) - numops--; - if (insn.operands != numops) - { - as_bad ("Incorrect number of operands given"); - return; - } - } - insn.addressing_mode = AM_NotReq; - for (count = 0; count < insn.operands; count++) - { - if (insn.operand_type[count]->op_type & insn.tm->operand_types[count]) - { - debug ("Operand %d matches\n", count + 1); - /* If instruction has two operands and has an AddressMode modifier then set - addressing mode type for instruction */ - if (insn.tm->opcode_modifier == AddressMode) - { - int addr_insn = 0; - /* Store instruction uses the second operand for the address mode. */ - if ((insn.tm->operand_types[1] & (Indirect | Direct)) == (Indirect | Direct)) - addr_insn = 1; - if (insn.operand_type[addr_insn]->op_type & (AllReg)) - insn.addressing_mode = AM_Register; - else if (insn.operand_type[addr_insn]->op_type & Direct) - insn.addressing_mode = AM_Direct; - else if (insn.operand_type[addr_insn]->op_type & Indirect) - insn.addressing_mode = AM_Indirect; - else - insn.addressing_mode = AM_Immediate; - } - } - else - { - as_bad ("The %s operand doesn't match", ordinal_names[count]); - return; - } - } - /* Now set the addressing mode for 3 operand instructions. */ - if ((insn.tm->operand_types[0] & op3T1) && (insn.tm->operand_types[1] & op3T2)) - { - /* Set the addressing mode to the values used for 2 operand instructions in the - G addressing field of the opcode. */ - char *p; - switch (insn.operand_type[0]->op_type) - { - case Rn: - case ARn: - case DPReg: - case OtherReg: - if (insn.operand_type[1]->op_type & (AllReg)) - insn.addressing_mode = AM_Register; - else if (insn.operand_type[1]->op_type & Indirect) - insn.addressing_mode = AM_Direct; - else - { - /* Shouldn't make it to this stage */ - as_bad ("Incompatible first and second operands in instruction"); - return; - } - break; - case Indirect: - if (insn.operand_type[1]->op_type & (AllReg)) - insn.addressing_mode = AM_Indirect; - else if (insn.operand_type[1]->op_type & Indirect) - insn.addressing_mode = AM_Immediate; - else - { - /* Shouldn't make it to this stage */ - as_bad ("Incompatible first and second operands in instruction"); - return; - } - break; - } - /* Now make up the opcode for the 3 operand instructions. As in parallel - instructions, there will be no unresolved values, so they can be fully formed - and added to the frag table. */ - insn.opcode = insn.tm->base_opcode; - if (insn.operand_type[0]->op_type & Indirect) - { - insn.opcode |= (insn.operand_type[0]->indirect.ARnum); - insn.opcode |= (insn.operand_type[0]->indirect.mod << 3); - } - else - insn.opcode |= (insn.operand_type[0]->reg.opcode); - if (insn.operand_type[1]->op_type & Indirect) - { - insn.opcode |= (insn.operand_type[1]->indirect.ARnum << 8); - insn.opcode |= (insn.operand_type[1]->indirect.mod << 11); - } - else - insn.opcode |= (insn.operand_type[1]->reg.opcode << 8); - if (insn.operands == 3) - insn.opcode |= (insn.operand_type[2]->reg.opcode << 16); - insn.opcode |= insn.addressing_mode; - p = frag_more (INSN_SIZE); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else - { /* Not a three operand instruction */ - char *p; - int am_insn = -1; - insn.opcode = insn.tm->base_opcode; - /* Create frag for instruction - all instructions are 4 bytes long. */ - p = frag_more (INSN_SIZE); - if ((insn.operands > 0) && (insn.tm->opcode_modifier == AddressMode)) - { - insn.opcode |= insn.addressing_mode; - if (insn.addressing_mode == AM_Indirect) - { - /* Determine which operand gives the addressing mode */ - if (insn.operand_type[0]->op_type & Indirect) - am_insn = 0; - if ((insn.operands > 1) && (insn.operand_type[1]->op_type & Indirect)) - am_insn = 1; - insn.opcode |= (insn.operand_type[am_insn]->indirect.disp); - insn.opcode |= (insn.operand_type[am_insn]->indirect.ARnum << 8); - insn.opcode |= (insn.operand_type[am_insn]->indirect.mod << 11); - if (insn.operands > 1) - insn.opcode |= (insn.operand_type[!am_insn]->reg.opcode << 16); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else if (insn.addressing_mode == AM_Register) - { - insn.opcode |= (insn.operand_type[0]->reg.opcode); - if (insn.operands > 1) - insn.opcode |= (insn.operand_type[1]->reg.opcode << 16); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else if (insn.addressing_mode == AM_Direct) - { - if (insn.operand_type[0]->op_type & Direct) - am_insn = 0; - if ((insn.operands > 1) && (insn.operand_type[1]->op_type & Direct)) - am_insn = 1; - if (insn.operands > 1) - insn.opcode |= (insn.operand_type[!am_insn]->reg.opcode << 16); - if (insn.operand_type[am_insn]->direct.resolved == 1) - { - /* Resolved values can be placed straight into instruction word, and output */ - insn.opcode |= (insn.operand_type[am_insn]->direct.address & 0x0000FFFF); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else - { /* Unresolved direct addressing mode instruction */ - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - fix_new_exp (frag_now, p + 2 - (frag_now->fr_literal), 2, &insn.operand_type[am_insn]->direct.direct_expr, 0, 0); - } - } - else if (insn.addressing_mode == AM_Immediate) - { - if (insn.operand_type[0]->immediate.resolved == 1) - { - char *keeploc; - int size; - if (insn.operands > 1) - insn.opcode |= (insn.operand_type[1]->reg.opcode << 16); - switch (insn.tm->imm_arg_type) - { - case Imm_Float: - debug ("Floating point first operand\n"); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - keeploc = input_line_pointer; - input_line_pointer = insn.operand_type[0]->immediate.label; - if (md_atof ('f', p + 2, &size) != 0) - { - as_bad ("invalid short form floating point immediate operand"); - return; - } - input_line_pointer = keeploc; - break; - case Imm_UInt: - debug ("Unsigned int first operand\n"); - if (insn.operand_type[0]->immediate.decimal_found) - as_warn ("rounding down first operand float to unsigned int"); - if (insn.operand_type[0]->immediate.u_number > 0xFFFF) - as_warn ("only lower 16-bits of first operand are used"); - insn.opcode |= (insn.operand_type[0]->immediate.u_number & 0x0000FFFFL); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - break; - case Imm_SInt: - debug ("Int first operand\n"); - if (insn.operand_type[0]->immediate.decimal_found) - as_warn ("rounding down first operand float to signed int"); - if (insn.operand_type[0]->immediate.s_number < -32768 || - insn.operand_type[0]->immediate.s_number > 32767) - { - as_bad ("first operand is too large for 16-bit signed int"); - return; - } - insn.opcode |= (insn.operand_type[0]->immediate.s_number & 0x0000FFFFL); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - break; - } - } - else - { /* Unresolved immediate label */ - if (insn.operands > 1) - insn.opcode |= (insn.operand_type[1]->reg.opcode << 16); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - fix_new_exp (frag_now, p + 2 - (frag_now->fr_literal), 2, &insn.operand_type[0]->immediate.imm_expr, 0, 0); - } - } - } - else if (insn.tm->opcode_modifier == PCRel) - { - /* Conditional Branch and Call instructions */ - if ((insn.tm->operand_types[0] & (AllReg | Disp)) == (AllReg | Disp)) - { - if (insn.operand_type[0]->op_type & (AllReg)) - { - insn.opcode |= (insn.operand_type[0]->reg.opcode); - insn.opcode |= PC_Register; - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else - { - insn.opcode |= PC_Relative; - if (insn.operand_type[0]->immediate.resolved == 1) - { - insn.opcode |= (insn.operand_type[0]->immediate.s_number & 0x0000FFFF); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else - { - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - fix_new_exp (frag_now, p + 2 - (frag_now->fr_literal), 2, &insn.operand_type[0]->immediate.imm_expr, 1, 0); - } - } - } - else if ((insn.tm->operand_types[0] & ARn) == ARn) - { - /* Decrement and Branch instructions */ - insn.opcode |= ((insn.operand_type[0]->reg.opcode - 0x08) << 22); - if (insn.operand_type[1]->op_type & (AllReg)) - { - insn.opcode |= (insn.operand_type[1]->reg.opcode); - insn.opcode |= PC_Register; - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else if (insn.operand_type[1]->immediate.resolved == 1) - { - if (insn.operand_type[0]->immediate.decimal_found) - { - as_bad ("first operand is floating point"); - return; - } - if (insn.operand_type[0]->immediate.s_number < -32768 || - insn.operand_type[0]->immediate.s_number > 32767) - { - as_bad ("first operand is too large for 16-bit signed int"); - return; - } - insn.opcode |= (insn.operand_type[1]->immediate.s_number); - insn.opcode |= PC_Relative; - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else - { - insn.opcode |= PC_Relative; - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - fix_new_exp (frag_now, p + 2 - frag_now->fr_literal, 2, &insn.operand_type[1]->immediate.imm_expr, 1, 0); - } - } - } - else if (insn.tm->operand_types[0] == IVector) - { - /* Trap instructions */ - if (insn.operand_type[0]->op_type & IVector) - insn.opcode |= (insn.operand_type[0]->immediate.u_number); - else - { /* Shouldn't get here */ - as_bad ("interrupt vector for trap instruction out of range"); - return; - } - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else if (insn.tm->opcode_modifier == StackOp || insn.tm->opcode_modifier == Rotate) - { - /* Push, Pop and Rotate instructions */ - insn.opcode |= (insn.operand_type[0]->reg.opcode << 16); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else if ((insn.tm->operand_types[0] & (Abs24 | Direct)) == (Abs24 | Direct)) - { - /* LDP Instruction needs to be tested for before the next section */ - if (insn.operand_type[0]->op_type & Direct) - { - if (insn.operand_type[0]->direct.resolved == 1) - { - /* Direct addressing uses lower 8 bits of direct address */ - insn.opcode |= (insn.operand_type[0]->direct.address & 0x00FF0000) >> 16; - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else - { - fixS *fix; - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - fix = fix_new_exp (frag_now, p + 3 - (frag_now->fr_literal), 1, &insn.operand_type[0]->direct.direct_expr, 0, 0); - /* Ensure that the assembler doesn't complain about fitting a 24-bit - address into 8 bits. */ - fix->fx_no_overflow = 1; - } - } - else - { - if (insn.operand_type[0]->immediate.resolved == 1) - { - /* Immediate addressing uses upper 8 bits of address */ - if (insn.operand_type[0]->immediate.u_number > 0x00FFFFFF) - { - as_bad ("LDP instruction needs a 24-bit operand"); - return; - } - insn.opcode |= ((insn.operand_type[0]->immediate.u_number & 0x00FF0000) >> 16); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else - { - fixS *fix; - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - fix = fix_new_exp (frag_now, p + 3 - (frag_now->fr_literal), 1, &insn.operand_type[0]->immediate.imm_expr, 0, 0); - fix->fx_no_overflow = 1; - } - } - } - else if (insn.tm->operand_types[0] & (Imm24)) - { - /* Unconditional Branch and Call instructions */ - if (insn.operand_type[0]->immediate.resolved == 1) - { - if (insn.operand_type[0]->immediate.u_number > 0x00FFFFFF) - as_warn ("first operand is too large for a 24-bit displacement"); - insn.opcode |= (insn.operand_type[0]->immediate.u_number & 0x00FFFFFF); - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else - { - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - fix_new_exp (frag_now, p + 1 - (frag_now->fr_literal), 3, &insn.operand_type[0]->immediate.imm_expr, 0, 0); - } - } - else if (insn.tm->operand_types[0] & NotReq) - { - /* Check for NOP instruction without arguments. */ - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - else if (insn.tm->operands == 0) - { - /* Check for instructions without operands. */ - md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE); - } - } - debug ("Addressing mode: %08X\n", insn.addressing_mode); - { - int i; - for (i = 0; i < insn.operands; i++) - { - if (insn.operand_type[i]->immediate.label) - free (insn.operand_type[i]->immediate.label); - free (insn.operand_type[i]); - } - } - debug ("Final opcode: %08X\n", insn.opcode); - debug ("\n"); -} - -struct tic30_par_insn { - partemplate *tm; /* Template of current parallel instruction */ - int operands[2]; /* Number of given operands for each insn */ - /* Type of operand given in instruction */ - operand *operand_type[2][MAX_OPERANDS]; - int swap_operands; /* Whether to swap operands around. */ - unsigned p_field; /* Value of p field in multiply add/sub instructions */ - unsigned opcode; /* Final opcode */ -}; - -struct tic30_par_insn p_insn; - -int -tic30_parallel_insn (char *token) -{ - static partemplate *p_opcode; - char *current_posn = token; - char *token_start; - char save_char; - - debug ("In tic30_parallel_insn with %s\n", token); - memset (&p_insn, '\0', sizeof (p_insn)); - while (is_opcode_char (*current_posn)) - current_posn++; - { /* Find instruction */ - save_char = *current_posn; - *current_posn = '\0'; - p_opcode = (partemplate *) hash_find (parop_hash, token); - if (p_opcode) - { - debug ("Found instruction %s\n", p_opcode->name); - p_insn.tm = p_opcode; - } - else - { - char first_opcode[6] = - {0}; - char second_opcode[6] = - {0}; - int i; - int current_opcode = -1; - int char_ptr = 0; - - for (i = 0; i < strlen (token); i++) - { - char ch = *(token + i); - if (ch == '_' && current_opcode == -1) - { - current_opcode = 0; - continue; - } - if (ch == '_' && current_opcode == 0) - { - current_opcode = 1; - char_ptr = 0; - continue; - } - switch (current_opcode) - { - case 0: - first_opcode[char_ptr++] = ch; - break; - case 1: - second_opcode[char_ptr++] = ch; - break; - } - } - debug ("first_opcode = %s\n", first_opcode); - debug ("second_opcode = %s\n", second_opcode); - sprintf (token, "q_%s_%s", second_opcode, first_opcode); - p_opcode = (partemplate *) hash_find (parop_hash, token); - if (p_opcode) - { - debug ("Found instruction %s\n", p_opcode->name); - p_insn.tm = p_opcode; - p_insn.swap_operands = 1; - } - else - return 0; - } - *current_posn = save_char; - } - { /* Find operands */ - int paren_not_balanced; - int expecting_operand = 0; - int found_separator = 0; - do - { - /* skip optional white space before operand */ - while (!is_operand_char (*current_posn) && *current_posn != END_OF_INSN) - { - if (!is_space_char (*current_posn) && *current_posn != PARALLEL_SEPARATOR) - { - as_bad ("Invalid character %s before %s operand", - output_invalid (*current_posn), - ordinal_names[insn.operands]); - return 1; - } - if (*current_posn == PARALLEL_SEPARATOR) - found_separator = 1; - current_posn++; - } - token_start = current_posn; /* after white space */ - paren_not_balanced = 0; - while (paren_not_balanced || *current_posn != ',') - { - if (*current_posn == END_OF_INSN) - { - if (paren_not_balanced) - { - as_bad ("Unbalanced parenthesis in %s operand.", - ordinal_names[insn.operands]); - return 1; - } - else - break; /* we are done */ - } - else if (*current_posn == PARALLEL_SEPARATOR) - { - while (is_space_char (*(current_posn - 1))) - current_posn--; - break; - } - else if (!is_operand_char (*current_posn) && !is_space_char (*current_posn)) - { - as_bad ("Invalid character %s in %s operand", - output_invalid (*current_posn), - ordinal_names[insn.operands]); - return 1; - } - if (*current_posn == '(') - ++paren_not_balanced; - if (*current_posn == ')') - --paren_not_balanced; - current_posn++; - } - if (current_posn != token_start) - { /* yes, we've read in another operand */ - p_insn.operands[found_separator]++; - if (p_insn.operands[found_separator] > MAX_OPERANDS) - { - as_bad ("Spurious operands; (%d operands/instruction max)", - MAX_OPERANDS); - return 1; - } - /* now parse operand adding info to 'insn' as we go along */ - save_char = *current_posn; - *current_posn = '\0'; - p_insn.operand_type[found_separator][p_insn.operands[found_separator] - 1] = - tic30_operand (token_start); - *current_posn = save_char; - if (!p_insn.operand_type[found_separator][p_insn.operands[found_separator] - 1]) - return 1; - } - else - { - if (expecting_operand) - { - as_bad ("Expecting operand after ','; got nothing"); - return 1; - } - if (*current_posn == ',') - { - as_bad ("Expecting operand before ','; got nothing"); - return 1; - } - } - /* now *current_posn must be either ',' or END_OF_INSN */ - if (*current_posn == ',') - { - if (*++current_posn == END_OF_INSN) - { /* just skip it, if it's \n complain */ - as_bad ("Expecting operand after ','; got nothing"); - return 1; - } - expecting_operand = 1; - } - } - while (*current_posn != END_OF_INSN); /* until we get end of insn */ - } - if (p_insn.swap_operands) - { - int temp_num, i; - operand *temp_op; - - temp_num = p_insn.operands[0]; - p_insn.operands[0] = p_insn.operands[1]; - p_insn.operands[1] = temp_num; - for (i = 0; i < MAX_OPERANDS; i++) - { - temp_op = p_insn.operand_type[0][i]; - p_insn.operand_type[0][i] = p_insn.operand_type[1][i]; - p_insn.operand_type[1][i] = temp_op; - } - } - if (p_insn.operands[0] != p_insn.tm->operands_1) - { - as_bad ("incorrect number of operands given in the first instruction"); - return 1; - } - if (p_insn.operands[1] != p_insn.tm->operands_2) - { - as_bad ("incorrect number of operands given in the second instruction"); - return 1; - } - debug ("Number of operands in first insn: %d\n", p_insn.operands[0]); - debug ("Number of operands in second insn: %d\n", p_insn.operands[1]); - { /* Now check if operands are correct */ - int count; - int num_rn = 0; - int num_ind = 0; - for (count = 0; count < 2; count++) - { - int i; - for (i = 0; i < p_insn.operands[count]; i++) - { - if ((p_insn.operand_type[count][i]->op_type & - p_insn.tm->operand_types[count][i]) == 0) - { - as_bad ("%s instruction, operand %d doesn't match", ordinal_names[count], i + 1); - return 1; - } - /* Get number of R register and indirect reference contained within the first - two operands of each instruction. This is required for the multiply - parallel instructions which require two R registers and two indirect - references, but not in any particular place. */ - if ((p_insn.operand_type[count][i]->op_type & Rn) && i < 2) - num_rn++; - else if ((p_insn.operand_type[count][i]->op_type & Indirect) && i < 2) - num_ind++; - } - } - if ((p_insn.tm->operand_types[0][0] & (Indirect | Rn)) == (Indirect | Rn)) - { - /* Check for the multiply instructions */ - if (num_rn != 2) - { - as_bad ("incorrect format for multiply parallel instruction"); - return 1; - } - if (num_ind != 2) - { /* Shouldn't get here */ - as_bad ("incorrect format for multiply parallel instruction"); - return 1; - } - if ((p_insn.operand_type[0][2]->reg.opcode != 0x00) && - (p_insn.operand_type[0][2]->reg.opcode != 0x01)) - { - as_bad ("destination for multiply can only be R0 or R1"); - return 1; - } - if ((p_insn.operand_type[1][2]->reg.opcode != 0x02) && - (p_insn.operand_type[1][2]->reg.opcode != 0x03)) - { - as_bad ("destination for add/subtract can only be R2 or R3"); - return 1; - } - /* Now determine the P field for the instruction */ - if (p_insn.operand_type[0][0]->op_type & Indirect) - { - if (p_insn.operand_type[0][1]->op_type & Indirect) - p_insn.p_field = 0x00000000; /* Ind * Ind, Rn +/- Rn */ - else if (p_insn.operand_type[1][0]->op_type & Indirect) - p_insn.p_field = 0x01000000; /* Ind * Rn, Ind +/- Rn */ - else - p_insn.p_field = 0x03000000; /* Ind * Rn, Rn +/- Ind */ - } - else - { - if (p_insn.operand_type[0][1]->op_type & Rn) - p_insn.p_field = 0x02000000; /* Rn * Rn, Ind +/- Ind */ - else if (p_insn.operand_type[1][0]->op_type & Indirect) - { - operand *temp; - p_insn.p_field = 0x01000000; /* Rn * Ind, Ind +/- Rn */ - /* Need to swap the two multiply operands around so that everything is in - its place for the opcode makeup ie so Ind * Rn, Ind +/- Rn */ - temp = p_insn.operand_type[0][0]; - p_insn.operand_type[0][0] = p_insn.operand_type[0][1]; - p_insn.operand_type[0][1] = temp; - } - else - { - operand *temp; - p_insn.p_field = 0x03000000; /* Rn * Ind, Rn +/- Ind */ - temp = p_insn.operand_type[0][0]; - p_insn.operand_type[0][0] = p_insn.operand_type[0][1]; - p_insn.operand_type[0][1] = temp; - } - } - } - } - debug ("P field: %08X\n", p_insn.p_field); - /* Finalise opcode. This is easier for parallel instructions as they have to be - fully resolved, there are no memory addresses allowed, except through indirect - addressing, so there are no labels to resolve. */ - { - p_insn.opcode = p_insn.tm->base_opcode; - switch (p_insn.tm->oporder) - { - case OO_4op1: - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum); - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 3); - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum << 8); - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 11); - p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 16); - p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 22); - break; - case OO_4op2: - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum); - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 3); - p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.ARnum << 8); - p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.mod << 11); - p_insn.opcode |= (p_insn.operand_type[1][1]->reg.opcode << 19); - p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 22); - if (p_insn.operand_type[1][1]->reg.opcode == p_insn.operand_type[0][1]->reg.opcode) - as_warn ("loading the same register in parallel operation"); - break; - case OO_4op3: - p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.ARnum); - p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.mod << 3); - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum << 8); - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 11); - p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 16); - p_insn.opcode |= (p_insn.operand_type[0][0]->reg.opcode << 22); - break; - case OO_5op1: - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum); - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 3); - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum << 8); - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 11); - p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 16); - p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 19); - p_insn.opcode |= (p_insn.operand_type[0][2]->reg.opcode << 22); - break; - case OO_5op2: - p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.ARnum); - p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.mod << 3); - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum << 8); - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 11); - p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 16); - p_insn.opcode |= (p_insn.operand_type[0][0]->reg.opcode << 19); - p_insn.opcode |= (p_insn.operand_type[0][2]->reg.opcode << 22); - break; - case OO_PField: - p_insn.opcode |= p_insn.p_field; - if (p_insn.operand_type[0][2]->reg.opcode == 0x01) - p_insn.opcode |= 0x00800000; - if (p_insn.operand_type[1][2]->reg.opcode == 0x03) - p_insn.opcode |= 0x00400000; - switch (p_insn.p_field) - { - case 0x00000000: - p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.ARnum); - p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.mod << 3); - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum << 8); - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 11); - p_insn.opcode |= (p_insn.operand_type[1][1]->reg.opcode << 16); - p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 19); - break; - case 0x01000000: - p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.ARnum); - p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.mod << 3); - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum << 8); - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 11); - p_insn.opcode |= (p_insn.operand_type[1][1]->reg.opcode << 16); - p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 19); - break; - case 0x02000000: - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum); - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 3); - p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.ARnum << 8); - p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.mod << 11); - p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 16); - p_insn.opcode |= (p_insn.operand_type[0][0]->reg.opcode << 19); - break; - case 0x03000000: - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum); - p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 3); - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum << 8); - p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 11); - p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 16); - p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 19); - break; - } - break; - } - } /* Opcode is finalised at this point for all parallel instructions. */ - { /* Output opcode */ - char *p; - p = frag_more (INSN_SIZE); - md_number_to_chars (p, (valueT) p_insn.opcode, INSN_SIZE); - } - { - int i, j; - for (i = 0; i < 2; i++) - for (j = 0; j < p_insn.operands[i]; j++) - free (p_insn.operand_type[i][j]); - } - debug ("Final opcode: %08X\n", p_insn.opcode); - debug ("\n"); - return 1; -} - -operand * -tic30_operand (token) - char *token; -{ - int count; - char ind_buffer[strlen (token)]; - operand *current_op; - - debug ("In tic30_operand with %s\n", token); - current_op = (operand *) malloc (sizeof (operand)); - memset (current_op, '\0', sizeof (operand)); - if (*token == DIRECT_REFERENCE) - { - char *token_posn = token + 1; - int direct_label = 0; - debug ("Found direct reference\n"); - while (*token_posn) - { - if (!is_digit_char (*token_posn)) - direct_label = 1; - token_posn++; - } - if (direct_label) - { - char *save_input_line_pointer; - segT retval; - debug ("Direct reference is a label\n"); - current_op->direct.label = token + 1; - save_input_line_pointer = input_line_pointer; - input_line_pointer = token + 1; - debug ("Current input_line_pointer: %s\n", input_line_pointer); - retval = expression (¤t_op->direct.direct_expr); - debug ("Expression type: %d\n", current_op->direct.direct_expr.X_op); - debug ("Expression addnum: %d\n", current_op->direct.direct_expr.X_add_number); - debug ("Segment: %d\n", retval); - input_line_pointer = save_input_line_pointer; - if (current_op->direct.direct_expr.X_op == O_constant) - { - current_op->direct.address = current_op->direct.direct_expr.X_add_number; - current_op->direct.resolved = 1; - } - } - else - { - debug ("Direct reference is a number\n"); - current_op->direct.address = atoi (token + 1); - current_op->direct.resolved = 1; - } - current_op->op_type = Direct; - } - else if (*token == INDIRECT_REFERENCE) - { /* Indirect reference operand */ - int found_ar = 0; - int found_disp = 0; - int ar_number = -1; - int disp_number = 0; - int buffer_posn = 1; - ind_addr_type *ind_addr_op; - debug ("Found indirect reference\n"); - ind_buffer[0] = *token; - for (count = 1; count < strlen (token); count++) - { /* Strip operand */ - ind_buffer[buffer_posn] = TOLOWER (*(token + count)); - if ((*(token + count - 1) == 'a' || *(token + count - 1) == 'A') && - (*(token + count) == 'r' || *(token + count) == 'R')) - { - /* AR reference is found, so get its number and remove it from the buffer - so it can pass through hash_find() */ - if (found_ar) - { - as_bad ("More than one AR register found in indirect reference"); - return NULL; - } - if (*(token + count + 1) < '0' || *(token + count + 1) > '7') - { - as_bad ("Illegal AR register in indirect reference"); - return NULL; - } - ar_number = *(token + count + 1) - '0'; - found_ar = 1; - count++; - } - if (*(token + count) == '(') - { - /* Parenthesis found, so check if a displacement value is inside. If so, get - the value and remove it from the buffer. */ - if (is_digit_char (*(token + count + 1))) - { - char disp[10]; - int disp_posn = 0; - - if (found_disp) - { - as_bad ("More than one displacement found in indirect reference"); - return NULL; - } - count++; - while (*(token + count) != ')') - { - if (!is_digit_char (*(token + count))) - { - as_bad ("Invalid displacement in indirect reference"); - return NULL; - } - disp[disp_posn++] = *(token + (count++)); - } - disp[disp_posn] = '\0'; - disp_number = atoi (disp); - count--; - found_disp = 1; - } - } - buffer_posn++; - } - ind_buffer[buffer_posn] = '\0'; - if (!found_ar) - { - as_bad ("AR register not found in indirect reference"); - return NULL; - } - ind_addr_op = (ind_addr_type *) hash_find (ind_hash, ind_buffer); - if (ind_addr_op) - { - debug ("Found indirect reference: %s\n", ind_addr_op->syntax); - if (ind_addr_op->displacement == IMPLIED_DISP) - { - found_disp = 1; - disp_number = 1; - } - else if ((ind_addr_op->displacement == DISP_REQUIRED) && !found_disp) - { - /* Maybe an implied displacement of 1 again */ - as_bad ("required displacement wasn't given in indirect reference"); - return 0; - } - } - else - { - as_bad ("illegal indirect reference"); - return NULL; - } - if (found_disp && (disp_number < 0 || disp_number > 255)) - { - as_bad ("displacement must be an unsigned 8-bit number"); - return NULL; - } - current_op->indirect.mod = ind_addr_op->modfield; - current_op->indirect.disp = disp_number; - current_op->indirect.ARnum = ar_number; - current_op->op_type = Indirect; - } - else - { - reg *regop = (reg *) hash_find (reg_hash, token); - if (regop) - { - debug ("Found register operand: %s\n", regop->name); - if (regop->regtype == REG_ARn) - current_op->op_type = ARn; - else if (regop->regtype == REG_Rn) - current_op->op_type = Rn; - else if (regop->regtype == REG_DP) - current_op->op_type = DPReg; - else - current_op->op_type = OtherReg; - current_op->reg.opcode = regop->opcode; - } - else - { - if (!is_digit_char (*token) || *(token + 1) == 'x' || strchr (token, 'h')) - { - char *save_input_line_pointer; - segT retval; - debug ("Probably a label: %s\n", token); - current_op->immediate.label = (char *) malloc (strlen (token) + 1); - strcpy (current_op->immediate.label, token); - current_op->immediate.label[strlen (token)] = '\0'; - save_input_line_pointer = input_line_pointer; - input_line_pointer = token; - debug ("Current input_line_pointer: %s\n", input_line_pointer); - retval = expression (¤t_op->immediate.imm_expr); - debug ("Expression type: %d\n", current_op->immediate.imm_expr.X_op); - debug ("Expression addnum: %d\n", current_op->immediate.imm_expr.X_add_number); - debug ("Segment: %d\n", retval); - input_line_pointer = save_input_line_pointer; - if (current_op->immediate.imm_expr.X_op == O_constant) - { - current_op->immediate.s_number = current_op->immediate.imm_expr.X_add_number; - current_op->immediate.u_number = (unsigned int) current_op->immediate.imm_expr.X_add_number; - current_op->immediate.resolved = 1; - } - } - else - { - unsigned count; - debug ("Found a number or displacement\n"); - for (count = 0; count < strlen (token); count++) - if (*(token + count) == '.') - current_op->immediate.decimal_found = 1; - current_op->immediate.label = (char *) malloc (strlen (token) + 1); - strcpy (current_op->immediate.label, token); - current_op->immediate.label[strlen (token)] = '\0'; - current_op->immediate.f_number = (float) atof (token); - current_op->immediate.s_number = (int) atoi (token); - current_op->immediate.u_number = (unsigned int) atoi (token); - current_op->immediate.resolved = 1; - } - current_op->op_type = Disp | Abs24 | Imm16 | Imm24; - if (current_op->immediate.u_number >= 0 && current_op->immediate.u_number <= 31) - current_op->op_type |= IVector; - } - } - return current_op; -} - -/* next_line points to the next line after the current instruction (current_line). - Search for the parallel bars, and if found, merge two lines into internal syntax - for a parallel instruction: - q_[INSN1]_[INSN2] [OPERANDS1] | [OPERANDS2] - By this stage, all comments are scrubbed, and only the bare lines are given. - */ - -#define NONE 0 -#define START_OPCODE 1 -#define END_OPCODE 2 -#define START_OPERANDS 3 -#define END_OPERANDS 4 - -char * -tic30_find_parallel_insn (current_line, next_line) - char *current_line; - char *next_line; -{ - int found_parallel = 0; - char first_opcode[256]; - char second_opcode[256]; - char first_operands[256]; - char second_operands[256]; - char *parallel_insn; - - debug ("In tic30_find_parallel_insn()\n"); - while (!is_end_of_line[(unsigned char) *next_line]) - { - if (*next_line == PARALLEL_SEPARATOR && *(next_line + 1) == PARALLEL_SEPARATOR) - { - found_parallel = 1; - next_line++; - break; - } - next_line++; - } - if (!found_parallel) - return NULL; - debug ("Found a parallel instruction\n"); - { - int i; - char *opcode, *operands, *line; - - for (i = 0; i < 2; i++) - { - if (i == 0) - { - opcode = &first_opcode[0]; - operands = &first_operands[0]; - line = current_line; - } - else - { - opcode = &second_opcode[0]; - operands = &second_operands[0]; - line = next_line; - } - { - int search_status = NONE; - int char_ptr = 0; - char c; - - while (!is_end_of_line[(unsigned char) (c = *line)]) - { - if (is_opcode_char (c) && search_status == NONE) - { - opcode[char_ptr++] = TOLOWER (c); - search_status = START_OPCODE; - } - else if (is_opcode_char (c) && search_status == START_OPCODE) - { - opcode[char_ptr++] = TOLOWER (c); - } - else if (!is_opcode_char (c) && search_status == START_OPCODE) - { - opcode[char_ptr] = '\0'; - char_ptr = 0; - search_status = END_OPCODE; - } - else if (is_operand_char (c) && search_status == START_OPERANDS) - { - operands[char_ptr++] = c; - } - if (is_operand_char (c) && search_status == END_OPCODE) - { - operands[char_ptr++] = c; - search_status = START_OPERANDS; - } - line++; - } - if (search_status != START_OPERANDS) - return NULL; - operands[char_ptr] = '\0'; - } - } - } - parallel_insn = (char *) malloc (strlen (first_opcode) + strlen (first_operands) + - strlen (second_opcode) + strlen (second_operands) + 8); - sprintf (parallel_insn, "q_%s_%s %s | %s", first_opcode, second_opcode, first_operands, second_operands); - debug ("parallel insn = %s\n", parallel_insn); - return parallel_insn; -} - -#undef NONE -#undef START_OPCODE -#undef END_OPCODE -#undef START_OPERANDS -#undef END_OPERANDS - -/* In order to get gas to ignore any | chars at the start of a line, - this function returns true if a | is found in a line. */ - -int -tic30_unrecognized_line (c) - int c; -{ - debug ("In tc_unrecognized_line\n"); - return (c == PARALLEL_SEPARATOR); -} - -int -md_estimate_size_before_relax (fragP, segment) - fragS *fragP; - segT segment; -{ - debug ("In md_estimate_size_before_relax()\n"); - return 0; -} - -void -md_convert_frag (abfd, sec, fragP) - bfd *abfd; - segT sec; - register fragS *fragP; -{ - debug ("In md_convert_frag()\n"); -} - -void -md_apply_fix3 (fixP, valP, seg) - fixS *fixP; - valueT *valP; - segT seg ATTRIBUTE_UNUSED; -{ - valueT value = *valP; - - debug ("In md_apply_fix() with value = %ld\n", (long) value); - debug ("Values in fixP\n"); - debug ("fx_size = %d\n", fixP->fx_size); - debug ("fx_pcrel = %d\n", fixP->fx_pcrel); - debug ("fx_where = %d\n", fixP->fx_where); - debug ("fx_offset = %d\n", (int) fixP->fx_offset); - { - char *buf = fixP->fx_frag->fr_literal + fixP->fx_where; - - value /= INSN_SIZE; - if (fixP->fx_size == 1) - /* Special fix for LDP instruction. */ - value = (value & 0x00FF0000) >> 16; - - debug ("new value = %ld\n", (long) value); - md_number_to_chars (buf, value, fixP->fx_size); - } - - if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) - fixP->fx_done = 1; -} - -int -md_parse_option (c, arg) - int c; - char *arg; -{ - int i; - - debug ("In md_parse_option()\n"); - for (i = 0; i < c; i++) - { - printf ("%c\n", arg[c]); - } - return 0; -} - -void -md_show_usage (stream) - FILE *stream; -{ - debug ("In md_show_usage()\n"); -} - -symbolS * -md_undefined_symbol (name) - char *name; -{ - debug ("In md_undefined_symbol()\n"); - return (symbolS *) 0; -} - -valueT -md_section_align (segment, size) - segT segment; - valueT size; -{ - debug ("In md_section_align() segment = %d and size = %d\n", segment, size); - size = (size + 3) / 4; - size *= 4; - debug ("New size value = %d\n", size); - return size; -} - -long -md_pcrel_from (fixP) - fixS *fixP; -{ - int offset; - - debug ("In md_pcrel_from()\n"); - debug ("fx_where = %d\n", fixP->fx_where); - debug ("fx_size = %d\n", fixP->fx_size); - /* Find the opcode that represents the current instruction in the fr_literal - storage area, and check bit 21. Bit 21 contains whether the current instruction - is a delayed one or not, and then set the offset value appropriately. */ - if (fixP->fx_frag->fr_literal[fixP->fx_where - fixP->fx_size + 1] & 0x20) - offset = 3; - else - offset = 1; - debug ("offset = %d\n", offset); - /* PC Relative instructions have a format: - displacement = Label - (PC + offset) - This function returns PC + offset where: - fx_where - fx_size = PC - INSN_SIZE * offset = offset number of instructions - */ - return fixP->fx_where - fixP->fx_size + (INSN_SIZE * offset); -} - -char * -md_atof (what_statement_type, literalP, sizeP) - int what_statement_type; - char *literalP; - int *sizeP; -{ - int prec; - char *token; - char keepval; - unsigned long value; - /* char *atof_ieee (); */ - float float_value; - debug ("In md_atof()\n"); - debug ("precision = %c\n", what_statement_type); - debug ("literal = %s\n", literalP); - debug ("line = "); - token = input_line_pointer; - while (!is_end_of_line[(unsigned char) *input_line_pointer] - && (*input_line_pointer != ',')) - { - debug ("%c", *input_line_pointer); - input_line_pointer++; - } - keepval = *input_line_pointer; - *input_line_pointer = '\0'; - debug ("\n"); - float_value = (float) atof (token); - *input_line_pointer = keepval; - debug ("float_value = %f\n", float_value); - switch (what_statement_type) - { - case 'f': - case 'F': - case 's': - case 'S': - prec = 2; - break; - - case 'd': - case 'D': - case 'r': - case 'R': - prec = 4; - break; - - default: - *sizeP = 0; - return "Bad call to MD_ATOF()"; - } - if (float_value == 0.0) - { - value = (prec == 2) ? 0x00008000L : 0x80000000L; - } - else - { - unsigned long exp, sign, mant, tmsfloat; - tmsfloat = *((long *) &float_value); - sign = tmsfloat & 0x80000000; - mant = tmsfloat & 0x007FFFFF; - exp = tmsfloat & 0x7F800000; - exp <<= 1; - if (exp == 0xFF000000) - { - if (mant == 0) - value = 0x7F7FFFFF; - else if (sign == 0) - value = 0x7F7FFFFF; - else - value = 0x7F800000; - } - else - { - exp -= 0x7F000000; - if (sign) - { - mant = mant & 0x007FFFFF; - mant = -mant; - mant = mant & 0x00FFFFFF; - if (mant == 0) - { - mant |= 0x00800000; - exp = (long) exp - 0x01000000; - } - } - tmsfloat = exp | mant; - value = tmsfloat; - } - if (prec == 2) - { - long exp, mant; - - if (tmsfloat == 0x80000000) - { - value = 0x8000; - } - else - { - value = 0; - exp = (tmsfloat & 0xFF000000); - exp >>= 24; - mant = tmsfloat & 0x007FFFFF; - if (tmsfloat & 0x00800000) - { - mant |= 0xFF000000; - mant += 0x00000800; - mant >>= 12; - mant |= 0x00000800; - mant &= 0x0FFF; - if (exp > 7) - value = 0x7800; - } - else - { - mant |= 0x00800000; - mant += 0x00000800; - exp += (mant >> 24); - mant >>= 12; - mant &= 0x07FF; - if (exp > 7) - value = 0x77FF; - } - if (exp < -8) - value = 0x8000; - if (value == 0) - { - mant = (exp << 12) | mant; - value = mant & 0xFFFF; - } - } - } - } - md_number_to_chars (literalP, value, prec); - *sizeP = prec; - return 0; -} - -void -md_number_to_chars (buf, val, n) - char *buf; - valueT val; - int n; -{ - debug ("In md_number_to_chars()\n"); - number_to_chars_bigendian (buf, val, n); - /* number_to_chars_littleendian(buf,val,n); */ -} - -#define F(SZ,PCREL) (((SZ) << 1) + (PCREL)) -#define MAP(SZ,PCREL,TYPE) case F(SZ,PCREL): code = (TYPE); break - -arelent * -tc_gen_reloc (section, fixP) - asection *section; - fixS *fixP; -{ - arelent *rel; - bfd_reloc_code_real_type code = 0; - - debug ("In tc_gen_reloc()\n"); - debug ("fixP.size = %d\n", fixP->fx_size); - debug ("fixP.pcrel = %d\n", fixP->fx_pcrel); - debug ("addsy.name = %s\n", S_GET_NAME (fixP->fx_addsy)); - switch (F (fixP->fx_size, fixP->fx_pcrel)) - { - MAP (1, 0, BFD_RELOC_TIC30_LDP); - MAP (2, 0, BFD_RELOC_16); - MAP (3, 0, BFD_RELOC_24); - MAP (2, 1, BFD_RELOC_16_PCREL); - MAP (4, 0, BFD_RELOC_32); - default: - as_bad ("Can not do %d byte %srelocation", fixP->fx_size, - fixP->fx_pcrel ? "pc-relative " : ""); - } -#undef MAP -#undef F - - rel = (arelent *) xmalloc (sizeof (arelent)); - assert (rel != 0); - rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *rel->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy); - rel->address = fixP->fx_frag->fr_address + fixP->fx_where; - if (fixP->fx_pcrel) - rel->addend = fixP->fx_addnumber; - else - rel->addend = 0; - rel->howto = bfd_reloc_type_lookup (stdoutput, code); - if (!rel->howto) - { - const char *name; - name = S_GET_NAME (fixP->fx_addsy); - if (name == NULL) - name = "<unknown>"; - as_fatal ("Cannot generate relocation type for symbol %s, code %s", name, bfd_get_reloc_code_name (code)); - } - return rel; -} - -void -tc_aout_pre_write_hook () -{ - debug ("In tc_aout_pre_write_hook()\n"); -} - -void -md_operand (expressionP) - expressionS *expressionP; -{ - debug ("In md_operand()\n"); -} - -char output_invalid_buf[8]; - -char * -output_invalid (c) - char c; -{ - if (ISPRINT (c)) - sprintf (output_invalid_buf, "'%c'", c); - else - sprintf (output_invalid_buf, "(0x%x)", (unsigned) c); - return output_invalid_buf; -} diff --git a/contrib/binutils/gas/config/tc-tic30.h b/contrib/binutils/gas/config/tc-tic30.h deleted file mode 100644 index d55c8702cfe8..000000000000 --- a/contrib/binutils/gas/config/tc-tic30.h +++ /dev/null @@ -1,55 +0,0 @@ -/* tc-tic30.h -- Header file for tc-tic30.c - Copyright 1998, 2000 Free Software Foundation, Inc. - Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - -#ifndef _TC_TIC30_H_ -#define _TC_TIC30_H_ - -#define TC_TIC30 1 - -#ifdef OBJ_AOUT -#define TARGET_FORMAT "a.out-tic30" -#endif - -#define TARGET_ARCH bfd_arch_tic30 -#define TARGET_BYTES_BIG_ENDIAN 1 - -#define WORKING_DOT_WORD - -char *output_invalid PARAMS ((int c)); - -#define END_OF_INSN '\0' -#define MAX_OPERANDS 6 -#define DIRECT_REFERENCE '@' -#define INDIRECT_REFERENCE '*' -#define PARALLEL_SEPARATOR '|' -#define INSN_SIZE 4 - -/* Define this to 1 if you want the debug output to be on stdout, - otherwise stderr will be used. If stderr is used, there will be a - better synchronisation with the as_bad outputs, but you can't - capture the output. */ -#define USE_STDOUT 0 - -#define tc_unrecognized_line tic30_unrecognized_line - -extern int tic30_unrecognized_line PARAMS ((int)); - -#endif diff --git a/contrib/binutils/gas/config/tc-v850.c b/contrib/binutils/gas/config/tc-v850.c deleted file mode 100644 index e0c4936c8ccf..000000000000 --- a/contrib/binutils/gas/config/tc-v850.c +++ /dev/null @@ -1,2434 +0,0 @@ -/* tc-v850.c -- Assembler code for the NEC V850 - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <stdio.h> -#include "as.h" -#include "safe-ctype.h" -#include "subsegs.h" -#include "opcode/v850.h" -#include "dwarf2dbg.h" - -/* Sign-extend a 16-bit number. */ -#define SEXT16(x) ((((x) & 0xffff) ^ (~0x7fff)) + 0x8000) - -/* Temporarily holds the reloc in a cons expression. */ -static bfd_reloc_code_real_type hold_cons_reloc = BFD_RELOC_UNUSED; - -/* Set to TRUE if we want to be pedantic about signed overflows. */ -static boolean warn_signed_overflows = FALSE; -static boolean warn_unsigned_overflows = FALSE; - -/* Indicates the target BFD machine number. */ -static int machine = -1; - -/* Indicates the target processor(s) for the assemble. */ -static int processor_mask = -1; - -/* Structure to hold information about predefined registers. */ -struct reg_name { - const char *name; - int value; -}; - -/* Generic assembler global variables which must be defined by all - targets. */ - -/* Characters which always start a comment. */ -const char comment_chars[] = "#"; - -/* Characters which start a comment at the beginning of a line. */ -const char line_comment_chars[] = ";#"; - -/* Characters which may be used to separate multiple commands on a - single line. */ -const char line_separator_chars[] = ";"; - -/* Characters which are used to indicate an exponent in a floating - point number. */ -const char EXP_CHARS[] = "eE"; - -/* Characters which mean that a number is a floating point constant, - as in 0d1.0. */ -const char FLT_CHARS[] = "dD"; - -const relax_typeS md_relax_table[] = { - /* Conditional branches. */ - {0xff, -0x100, 2, 1}, - {0x1fffff, -0x200000, 6, 0}, - /* Unconditional branches. */ - {0xff, -0x100, 2, 3}, - {0x1fffff, -0x200000, 4, 0}, -}; - -/* Fixups. */ -#define MAX_INSN_FIXUPS (5) -struct v850_fixup { - expressionS exp; - int opindex; - bfd_reloc_code_real_type reloc; -}; - -struct v850_fixup fixups[MAX_INSN_FIXUPS]; -static int fc; - -struct v850_seg_entry -{ - segT s; - const char *name; - flagword flags; -}; - -struct v850_seg_entry v850_seg_table[] = -{ - { NULL, ".sdata", - SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS - | SEC_SMALL_DATA }, - { NULL, ".tdata", - SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS }, - { NULL, ".zdata", - SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS }, - { NULL, ".sbss", - SEC_ALLOC | SEC_SMALL_DATA }, - { NULL, ".tbss", - SEC_ALLOC }, - { NULL, ".zbss", - SEC_ALLOC}, - { NULL, ".rosdata", - SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | SEC_DATA - | SEC_HAS_CONTENTS | SEC_SMALL_DATA }, - { NULL, ".rozdata", - SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | SEC_DATA - | SEC_HAS_CONTENTS }, - { NULL, ".scommon", - SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS - | SEC_SMALL_DATA | SEC_IS_COMMON }, - { NULL, ".tcommon", - SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS - | SEC_IS_COMMON }, - { NULL, ".zcommon", - SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS - | SEC_IS_COMMON }, - { NULL, ".call_table_data", - SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS }, - { NULL, ".call_table_text", - SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | SEC_CODE - | SEC_HAS_CONTENTS}, - { NULL, ".bss", - SEC_ALLOC } -}; - -#define SDATA_SECTION 0 -#define TDATA_SECTION 1 -#define ZDATA_SECTION 2 -#define SBSS_SECTION 3 -#define TBSS_SECTION 4 -#define ZBSS_SECTION 5 -#define ROSDATA_SECTION 6 -#define ROZDATA_SECTION 7 -#define SCOMMON_SECTION 8 -#define TCOMMON_SECTION 9 -#define ZCOMMON_SECTION 10 -#define CALL_TABLE_DATA_SECTION 11 -#define CALL_TABLE_TEXT_SECTION 12 -#define BSS_SECTION 13 - -static void do_v850_seg PARAMS ((int, subsegT)); - -static void -do_v850_seg (i, sub) - int i; - subsegT sub; -{ - struct v850_seg_entry *seg = v850_seg_table + i; - - obj_elf_section_change_hook (); - if (seg->s != NULL) - { - subseg_set (seg->s, sub); - } - else - { - seg->s = subseg_new (seg->name, sub); - bfd_set_section_flags (stdoutput, seg->s, seg->flags); - if ((seg->flags & SEC_LOAD) == 0) - seg_info (seg->s)->bss = 1; - } -} - -static void v850_seg PARAMS ((int i)); - -static void -v850_seg (i) - int i; -{ - subsegT sub = get_absolute_expression (); - - do_v850_seg (i, sub); - demand_empty_rest_of_line (); -} - -static void v850_offset PARAMS ((int)); - -static void -v850_offset (ignore) - int ignore ATTRIBUTE_UNUSED; -{ - int temp = get_absolute_expression (); - - temp -= frag_now_fix (); - - if (temp > 0) - (void) frag_more (temp); - - demand_empty_rest_of_line (); -} - -/* Copied from obj_elf_common() in gas/config/obj-elf.c. */ - -static void v850_comm PARAMS ((int)); - -static void -v850_comm (area) - int area; -{ - char *name; - char c; - char *p; - int temp; - unsigned int size; - symbolS *symbolP; - int have_align; - - name = input_line_pointer; - c = get_symbol_end (); - - /* Just after name is now '\0'. */ - p = input_line_pointer; - *p = c; - - SKIP_WHITESPACE (); - - if (*input_line_pointer != ',') - { - as_bad (_("Expected comma after symbol-name")); - ignore_rest_of_line (); - return; - } - - /* Skip ','. */ - input_line_pointer++; - - if ((temp = get_absolute_expression ()) < 0) - { - /* xgettext:c-format */ - as_bad (_(".COMMon length (%d.) < 0! Ignored."), temp); - ignore_rest_of_line (); - return; - } - - size = temp; - *p = 0; - symbolP = symbol_find_or_make (name); - *p = c; - - if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP)) - { - as_bad (_("Ignoring attempt to re-define symbol")); - ignore_rest_of_line (); - return; - } - - if (S_GET_VALUE (symbolP) != 0) - { - if (S_GET_VALUE (symbolP) != size) - { - /* xgettext:c-format */ - as_warn (_("Length of .comm \"%s\" is already %ld. Not changed to %d."), - S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size); - } - } - - know (symbol_get_frag (symbolP) == &zero_address_frag); - - if (*input_line_pointer != ',') - have_align = 0; - else - { - have_align = 1; - input_line_pointer++; - SKIP_WHITESPACE (); - } - - if (! have_align || *input_line_pointer != '"') - { - if (! have_align) - temp = 0; - else - { - temp = get_absolute_expression (); - - if (temp < 0) - { - temp = 0; - as_warn (_("Common alignment negative; 0 assumed")); - } - } - - if (symbol_get_obj (symbolP)->local) - { - segT old_sec; - int old_subsec; - char *pfrag; - int align; - flagword applicable; - - old_sec = now_seg; - old_subsec = now_subseg; - - applicable = bfd_applicable_section_flags (stdoutput); - - applicable &= SEC_ALLOC; - - switch (area) - { - case SCOMMON_SECTION: - do_v850_seg (SBSS_SECTION, 0); - break; - - case ZCOMMON_SECTION: - do_v850_seg (ZBSS_SECTION, 0); - break; - - case TCOMMON_SECTION: - do_v850_seg (TBSS_SECTION, 0); - break; - } - - if (temp) - { - /* Convert to a power of 2 alignment. */ - for (align = 0; (temp & 1) == 0; temp >>= 1, ++align) - ; - - if (temp != 1) - { - as_bad (_("Common alignment not a power of 2")); - ignore_rest_of_line (); - return; - } - } - else - align = 0; - - record_alignment (now_seg, align); - - if (align) - frag_align (align, 0, 0); - - switch (area) - { - case SCOMMON_SECTION: - if (S_GET_SEGMENT (symbolP) == v850_seg_table[SBSS_SECTION].s) - symbol_get_frag (symbolP)->fr_symbol = 0; - break; - - case ZCOMMON_SECTION: - if (S_GET_SEGMENT (symbolP) == v850_seg_table[ZBSS_SECTION].s) - symbol_get_frag (symbolP)->fr_symbol = 0; - break; - - case TCOMMON_SECTION: - if (S_GET_SEGMENT (symbolP) == v850_seg_table[TBSS_SECTION].s) - symbol_get_frag (symbolP)->fr_symbol = 0; - break; - - default: - abort (); - } - - symbol_set_frag (symbolP, frag_now); - pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, - (offsetT) size, (char *) 0); - *pfrag = 0; - S_SET_SIZE (symbolP, size); - - switch (area) - { - case SCOMMON_SECTION: - S_SET_SEGMENT (symbolP, v850_seg_table[SBSS_SECTION].s); - break; - - case ZCOMMON_SECTION: - S_SET_SEGMENT (symbolP, v850_seg_table[ZBSS_SECTION].s); - break; - - case TCOMMON_SECTION: - S_SET_SEGMENT (symbolP, v850_seg_table[TBSS_SECTION].s); - break; - - default: - abort (); - } - - S_CLEAR_EXTERNAL (symbolP); - obj_elf_section_change_hook (); - subseg_set (old_sec, old_subsec); - } - else - { - allocate_common: - S_SET_VALUE (symbolP, (valueT) size); - S_SET_ALIGN (symbolP, temp); - S_SET_EXTERNAL (symbolP); - - switch (area) - { - case SCOMMON_SECTION: - case ZCOMMON_SECTION: - case TCOMMON_SECTION: - do_v850_seg (area, 0); - S_SET_SEGMENT (symbolP, v850_seg_table[area].s); - break; - - default: - abort (); - } - } - } - else - { - input_line_pointer++; - - /* @@ Some use the dot, some don't. Can we get some consistency?? */ - if (*input_line_pointer == '.') - input_line_pointer++; - - /* @@ Some say data, some say bss. */ - if (strncmp (input_line_pointer, "bss\"", 4) - && strncmp (input_line_pointer, "data\"", 5)) - { - while (*--input_line_pointer != '"') - ; - input_line_pointer--; - goto bad_common_segment; - } - while (*input_line_pointer++ != '"') - ; - goto allocate_common; - } - - symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT; - - demand_empty_rest_of_line (); - return; - - { - bad_common_segment: - p = input_line_pointer; - while (*p && *p != '\n') - p++; - c = *p; - *p = '\0'; - as_bad (_("bad .common segment %s"), input_line_pointer + 1); - *p = c; - input_line_pointer = p; - ignore_rest_of_line (); - return; - } -} - -static void set_machine PARAMS ((int)); - -static void -set_machine (number) - int number; -{ - machine = number; - bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine); - - switch (machine) - { - case 0: processor_mask = PROCESSOR_V850; break; - case bfd_mach_v850e: processor_mask = PROCESSOR_V850E; break; - case bfd_mach_v850ea: processor_mask = PROCESSOR_V850EA; break; - } -} - -/* The target specific pseudo-ops which we support. */ -const pseudo_typeS md_pseudo_table[] = { - { "sdata", v850_seg, SDATA_SECTION }, - { "tdata", v850_seg, TDATA_SECTION }, - { "zdata", v850_seg, ZDATA_SECTION }, - { "sbss", v850_seg, SBSS_SECTION }, - { "tbss", v850_seg, TBSS_SECTION }, - { "zbss", v850_seg, ZBSS_SECTION }, - { "rosdata", v850_seg, ROSDATA_SECTION }, - { "rozdata", v850_seg, ROZDATA_SECTION }, - { "bss", v850_seg, BSS_SECTION }, - { "offset", v850_offset, 0 }, - { "word", cons, 4 }, - { "zcomm", v850_comm, ZCOMMON_SECTION }, - { "scomm", v850_comm, SCOMMON_SECTION }, - { "tcomm", v850_comm, TCOMMON_SECTION }, - { "v850", set_machine, 0 }, - { "call_table_data", v850_seg, CALL_TABLE_DATA_SECTION }, - { "call_table_text", v850_seg, CALL_TABLE_TEXT_SECTION }, - { "v850e", set_machine, bfd_mach_v850e }, - { "v850ea", set_machine, bfd_mach_v850ea }, - { "file", dwarf2_directive_file, 0 }, - { "loc", dwarf2_directive_loc, 0 }, - { NULL, NULL, 0 } -}; - -/* Opcode hash table. */ -static struct hash_control *v850_hash; - -/* This table is sorted. Suitable for searching by a binary search. */ -static const struct reg_name pre_defined_registers[] = { - { "ep", 30 }, /* ep - element ptr */ - { "gp", 4 }, /* gp - global ptr */ - { "hp", 2 }, /* hp - handler stack ptr */ - { "lp", 31 }, /* lp - link ptr */ - { "r0", 0 }, - { "r1", 1 }, - { "r10", 10 }, - { "r11", 11 }, - { "r12", 12 }, - { "r13", 13 }, - { "r14", 14 }, - { "r15", 15 }, - { "r16", 16 }, - { "r17", 17 }, - { "r18", 18 }, - { "r19", 19 }, - { "r2", 2 }, - { "r20", 20 }, - { "r21", 21 }, - { "r22", 22 }, - { "r23", 23 }, - { "r24", 24 }, - { "r25", 25 }, - { "r26", 26 }, - { "r27", 27 }, - { "r28", 28 }, - { "r29", 29 }, - { "r3", 3 }, - { "r30", 30 }, - { "r31", 31 }, - { "r4", 4 }, - { "r5", 5 }, - { "r6", 6 }, - { "r7", 7 }, - { "r8", 8 }, - { "r9", 9 }, - { "sp", 3 }, /* sp - stack ptr */ - { "tp", 5 }, /* tp - text ptr */ - { "zero", 0 }, -}; - -#define REG_NAME_CNT \ - (sizeof (pre_defined_registers) / sizeof (struct reg_name)) - -static const struct reg_name system_registers[] = { - { "ctbp", 20 }, - { "ctpc", 16 }, - { "ctpsw", 17 }, - { "dbpc", 18 }, - { "dbpsw", 19 }, - { "ecr", 4 }, - { "eipc", 0 }, - { "eipsw", 1 }, - { "fepc", 2 }, - { "fepsw", 3 }, - { "psw", 5 }, -}; - -#define SYSREG_NAME_CNT \ - (sizeof (system_registers) / sizeof (struct reg_name)) - -static const struct reg_name system_list_registers[] = { - {"PS", 5 }, - {"SR", 0 + 1} -}; - -#define SYSREGLIST_NAME_CNT \ - (sizeof (system_list_registers) / sizeof (struct reg_name)) - -static const struct reg_name cc_names[] = { - { "c", 0x1 }, - { "e", 0x2 }, - { "ge", 0xe }, - { "gt", 0xf }, - { "h", 0xb }, - { "l", 0x1 }, - { "le", 0x7 }, - { "lt", 0x6 }, - { "n", 0x4 }, - { "nc", 0x9 }, - { "ne", 0xa }, - { "nh", 0x3 }, - { "nl", 0x9 }, - { "ns", 0xc }, - { "nv", 0x8 }, - { "nz", 0xa }, - { "p", 0xc }, - { "s", 0x4 }, - { "sa", 0xd }, - { "t", 0x5 }, - { "v", 0x0 }, - { "z", 0x2 }, -}; - -#define CC_NAME_CNT \ - (sizeof (cc_names) / sizeof (struct reg_name)) - -/* Do a binary search of the given register table to see if NAME is a - valid regiter name. Return the register number from the array on - success, or -1 on failure. */ - -static int reg_name_search - PARAMS ((const struct reg_name *, int, const char *, boolean)); - -static int -reg_name_search (regs, regcount, name, accept_numbers) - const struct reg_name *regs; - int regcount; - const char *name; - boolean accept_numbers; -{ - int middle, low, high; - int cmp; - symbolS *symbolP; - - /* If the register name is a symbol, then evaluate it. */ - if ((symbolP = symbol_find (name)) != NULL) - { - /* If the symbol is an alias for another name then use that. - If the symbol is an alias for a number, then return the number. */ - if (symbol_equated_p (symbolP)) - { - name - = S_GET_NAME (symbol_get_value_expression (symbolP)->X_add_symbol); - } - else if (accept_numbers) - { - int reg = S_GET_VALUE (symbolP); - - if (reg >= 0 && reg <= 31) - return reg; - } - - /* Otherwise drop through and try parsing name normally. */ - } - - low = 0; - high = regcount - 1; - - do - { - middle = (low + high) / 2; - cmp = strcasecmp (name, regs[middle].name); - if (cmp < 0) - high = middle - 1; - else if (cmp > 0) - low = middle + 1; - else - return regs[middle].value; - } - while (low <= high); - return -1; -} - -/* Summary of register_name(). - * - * in: Input_line_pointer points to 1st char of operand. - * - * out: An expressionS. - * The operand may have been a register: in this case, X_op == O_register, - * X_add_number is set to the register number, and truth is returned. - * Input_line_pointer->(next non-blank) char after operand, or is in - * its original state. */ - -static boolean register_name PARAMS ((expressionS *)); - -static boolean -register_name (expressionP) - expressionS *expressionP; -{ - int reg_number; - char *name; - char *start; - char c; - - /* Find the spelling of the operand. */ - start = name = input_line_pointer; - - c = get_symbol_end (); - - reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, - name, FALSE); - - /* Put back the delimiting char. */ - *input_line_pointer = c; - - /* Look to see if it's in the register table. */ - 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; - - return true; - } - else - { - /* Reset the line as if we had not done anything. */ - input_line_pointer = start; - - return false; - } -} - -/* Summary of system_register_name(). - * - * in: INPUT_LINE_POINTER points to 1st char of operand. - * EXPRESSIONP points to an expression structure to be filled in. - * ACCEPT_NUMBERS is true iff numerical register names may be used. - * ACCEPT_LIST_NAMES is true iff the special names PS and SR may be - * accepted. - * - * out: An expressionS structure in expressionP. - * The operand may have been a register: in this case, X_op == O_register, - * X_add_number is set to the register number, and truth is returned. - * Input_line_pointer->(next non-blank) char after operand, or is in - * its original state. */ - -static boolean system_register_name PARAMS ((expressionS *, boolean, boolean)); - -static boolean -system_register_name (expressionP, accept_numbers, accept_list_names) - expressionS *expressionP; - boolean accept_numbers; - boolean accept_list_names; -{ - int reg_number; - char *name; - char *start; - char c; - - /* Find the spelling of the operand. */ - start = name = input_line_pointer; - - c = get_symbol_end (); - reg_number = reg_name_search (system_registers, SYSREG_NAME_CNT, name, - accept_numbers); - - /* Put back the delimiting char. */ - *input_line_pointer = c; - - if (reg_number < 0 - && accept_numbers) - { - /* Reset input_line pointer. */ - input_line_pointer = start; - - if (ISDIGIT (*input_line_pointer)) - { - reg_number = strtol (input_line_pointer, &input_line_pointer, 10); - - /* Make sure that the register number is allowable. */ - if (reg_number < 0 - || (reg_number > 5 && reg_number < 16) - || reg_number > 20) - { - reg_number = -1; - } - } - else if (accept_list_names) - { - c = get_symbol_end (); - reg_number = reg_name_search (system_list_registers, - SYSREGLIST_NAME_CNT, name, FALSE); - - /* Put back the delimiting char. */ - *input_line_pointer = c; - } - } - - /* Look to see if it's in the register table. */ - 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; - - return true; - } - else - { - /* Reset the line as if we had not done anything. */ - input_line_pointer = start; - - return false; - } -} - -/* Summary of cc_name(). - * - * in: INPUT_LINE_POINTER points to 1st char of operand. - * - * out: An expressionS. - * The operand may have been a register: in this case, X_op == O_register, - * X_add_number is set to the register number, and truth is returned. - * Input_line_pointer->(next non-blank) char after operand, or is in - * its original state. */ - -static boolean cc_name PARAMS ((expressionS *)); - -static boolean -cc_name (expressionP) - expressionS *expressionP; -{ - int reg_number; - char *name; - char *start; - char c; - - /* Find the spelling of the operand. */ - start = name = input_line_pointer; - - c = get_symbol_end (); - reg_number = reg_name_search (cc_names, CC_NAME_CNT, name, FALSE); - - /* Put back the delimiting char. */ - *input_line_pointer = c; - - /* Look to see if it's in the register table. */ - if (reg_number >= 0) - { - expressionP->X_op = O_constant; - expressionP->X_add_number = reg_number; - - /* Make the rest nice. */ - expressionP->X_add_symbol = NULL; - expressionP->X_op_symbol = NULL; - - return true; - } - else - { - /* Reset the line as if we had not done anything. */ - input_line_pointer = start; - - return false; - } -} - -static void skip_white_space PARAMS ((void)); - -static void -skip_white_space () -{ - while (*input_line_pointer == ' ' - || *input_line_pointer == '\t') - ++input_line_pointer; -} - -/* Summary of parse_register_list (). - * - * in: INPUT_LINE_POINTER points to 1st char of a list of registers. - * INSN is the partially constructed instruction. - * OPERAND is the operand being inserted. - * - * out: NULL if the parse completed successfully, otherwise a - * pointer to an error message is returned. If the parse - * completes the correct bit fields in the instruction - * will be filled in. - * - * Parses register lists with the syntax: - * - * { rX } - * { rX, rY } - * { rX - rY } - * { rX - rY, rZ } - * etc - * - * and also parses constant epxressions whoes bits indicate the - * registers in the lists. The LSB in the expression refers to - * the lowest numbered permissable register in the register list, - * and so on upwards. System registers are considered to be very - * high numbers. */ - -static char *parse_register_list - PARAMS ((unsigned long *, const struct v850_operand *)); - -static char * -parse_register_list (insn, operand) - unsigned long *insn; - const struct v850_operand *operand; -{ - static int type1_regs[32] = { - 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 31, 29, 28, 23, 22, 21, 20, 27, 26, 25, 24 - }; - static int type2_regs[32] = { - 19, 18, 17, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 30, 31, 29, 28, 23, 22, 21, 20, 27, 26, 25, 24 - }; - static int type3_regs[32] = { - 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 14, 15, 13, 12, 7, 6, 5, 4, 11, 10, 9, 8 - }; - int *regs; - expressionS exp; - - /* Select a register array to parse. */ - switch (operand->shift) - { - case 0xffe00001: regs = type1_regs; break; - case 0xfff8000f: regs = type2_regs; break; - case 0xfff8001f: regs = type3_regs; break; - default: - as_bad (_("unknown operand shift: %x\n"), operand->shift); - return _("internal failure in parse_register_list"); - } - - skip_white_space (); - - /* If the expression starts with a curly brace it is a register list. - Otherwise it is a constant expression, whoes bits indicate which - registers are to be included in the list. */ - - if (*input_line_pointer != '{') - { - int reg; - int i; - - expression (&exp); - - if (exp.X_op != O_constant) - return _("constant expression or register list expected"); - - if (regs == type1_regs) - { - if (exp.X_add_number & 0xFFFFF000) - return _("high bits set in register list expression"); - - for (reg = 20; reg < 32; reg++) - if (exp.X_add_number & (1 << (reg - 20))) - { - for (i = 0; i < 32; i++) - if (regs[i] == reg) - *insn |= (1 << i); - } - } - else if (regs == type2_regs) - { - if (exp.X_add_number & 0xFFFE0000) - return _("high bits set in register list expression"); - - for (reg = 1; reg < 16; reg++) - if (exp.X_add_number & (1 << (reg - 1))) - { - for (i = 0; i < 32; i++) - if (regs[i] == reg) - *insn |= (1 << i); - } - - if (exp.X_add_number & (1 << 15)) - *insn |= (1 << 3); - - if (exp.X_add_number & (1 << 16)) - *insn |= (1 << 19); - } - else /* regs == type3_regs */ - { - if (exp.X_add_number & 0xFFFE0000) - return _("high bits set in register list expression"); - - for (reg = 16; reg < 32; reg++) - if (exp.X_add_number & (1 << (reg - 16))) - { - for (i = 0; i < 32; i++) - if (regs[i] == reg) - *insn |= (1 << i); - } - - if (exp.X_add_number & (1 << 16)) - *insn |= (1 << 19); - } - - return NULL; - } - - input_line_pointer++; - - /* Parse the register list until a terminator (closing curly brace or - new-line) is found. */ - for (;;) - { - if (register_name (&exp)) - { - int i; - - /* Locate the given register in the list, and if it is there, - insert the corresponding bit into the instruction. */ - for (i = 0; i < 32; i++) - { - if (regs[i] == exp.X_add_number) - { - *insn |= (1 << i); - break; - } - } - - if (i == 32) - { - return _("illegal register included in list"); - } - } - else if (system_register_name (&exp, true, true)) - { - if (regs == type1_regs) - { - return _("system registers cannot be included in list"); - } - else if (exp.X_add_number == 5) - { - if (regs == type2_regs) - return _("PSW cannot be included in list"); - else - *insn |= 0x8; - } - else if (exp.X_add_number < 4) - *insn |= 0x80000; - else - return _("High value system registers cannot be included in list"); - } - else if (*input_line_pointer == '}') - { - input_line_pointer++; - break; - } - else if (*input_line_pointer == ',') - { - input_line_pointer++; - continue; - } - else if (*input_line_pointer == '-') - { - /* We have encountered a range of registers: rX - rY. */ - int j; - expressionS exp2; - - /* Skip the dash. */ - ++input_line_pointer; - - /* Get the second register in the range. */ - if (! register_name (&exp2)) - { - return _("second register should follow dash in register list"); - exp2.X_add_number = exp.X_add_number; - } - - /* Add the rest of the registers in the range. */ - for (j = exp.X_add_number + 1; j <= exp2.X_add_number; j++) - { - int i; - - /* Locate the given register in the list, and if it is there, - insert the corresponding bit into the instruction. */ - for (i = 0; i < 32; i++) - { - if (regs[i] == j) - { - *insn |= (1 << i); - break; - } - } - - if (i == 32) - return _("illegal register included in list"); - } - } - else - { - break; - } - - skip_white_space (); - } - - return NULL; -} - -CONST char *md_shortopts = "m:"; - -struct option md_longopts[] = { - {NULL, no_argument, NULL, 0} -}; - -size_t md_longopts_size = sizeof (md_longopts); - -void -md_show_usage (stream) - FILE *stream; -{ - fprintf (stream, _(" V850 options:\n")); - fprintf (stream, _(" -mwarn-signed-overflow Warn if signed immediate values overflow\n")); - fprintf (stream, _(" -mwarn-unsigned-overflow Warn if unsigned immediate values overflow\n")); - fprintf (stream, _(" -mv850 The code is targeted at the v850\n")); - fprintf (stream, _(" -mv850e The code is targeted at the v850e\n")); - fprintf (stream, _(" -mv850ea The code is targeted at the v850ea\n")); - fprintf (stream, _(" -mv850any The code is generic, despite any processor specific instructions\n")); -} - -int -md_parse_option (c, arg) - int c; - char *arg; -{ - if (c != 'm') - { - if (c != 'a') - /* xgettext:c-format */ - fprintf (stderr, _("unknown command line option: -%c%s\n"), c, arg); - return 0; - } - - if (strcmp (arg, "warn-signed-overflow") == 0) - { - warn_signed_overflows = TRUE; - } - else if (strcmp (arg, "warn-unsigned-overflow") == 0) - { - warn_unsigned_overflows = TRUE; - } - else if (strcmp (arg, "v850") == 0) - { - machine = 0; - processor_mask = PROCESSOR_V850; - } - else if (strcmp (arg, "v850e") == 0) - { - machine = bfd_mach_v850e; - processor_mask = PROCESSOR_V850E; - } - else if (strcmp (arg, "v850ea") == 0) - { - machine = bfd_mach_v850ea; - processor_mask = PROCESSOR_V850EA; - } - else if (strcmp (arg, "v850any") == 0) - { - /* Tell the world that this is for any v850 chip. */ - machine = 0; - - /* But support instructions for the extended versions. */ - processor_mask = PROCESSOR_V850EA; - } - else - { - /* xgettext:c-format */ - fprintf (stderr, _("unknown command line option: -%c%s\n"), c, arg); - return 0; - } - - return 1; -} - -symbolS * -md_undefined_symbol (name) - char *name ATTRIBUTE_UNUSED; -{ - return 0; -} - -char * -md_atof (type, litp, sizep) - int type; - char *litp; - int *sizep; -{ - int prec; - LITTLENUM_TYPE words[4]; - char *t; - int i; - - switch (type) - { - case 'f': - prec = 2; - break; - - case 'd': - prec = 4; - break; - - default: - *sizep = 0; - return _("bad call to md_atof"); - } - - t = atof_ieee (input_line_pointer, type, words); - if (t) - input_line_pointer = t; - - *sizep = prec * 2; - - for (i = prec - 1; i >= 0; i--) - { - md_number_to_chars (litp, (valueT) words[i], 2); - litp += 2; - } - - return NULL; -} - -/* Very gross. */ - -void -md_convert_frag (abfd, sec, fragP) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec; - fragS *fragP; -{ - subseg_change (sec, 0); - - /* In range conditional or unconditional branch. */ - if (fragP->fr_subtype == 0 || fragP->fr_subtype == 2) - { - fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, - fragP->fr_offset, 1, BFD_RELOC_UNUSED + (int)fragP->fr_opcode); - fragP->fr_fix += 2; - } - /* Out of range conditional branch. Emit a branch around a jump. */ - else if (fragP->fr_subtype == 1) - { - unsigned char *buffer = - (unsigned char *) (fragP->fr_fix + fragP->fr_literal); - - /* Reverse the condition of the first branch. */ - buffer[0] ^= 0x08; - /* Mask off all the displacement bits. */ - buffer[0] &= 0x8f; - buffer[1] &= 0x07; - /* Now set the displacement bits so that we branch - around the unconditional branch. */ - buffer[0] |= 0x30; - - /* Now create the unconditional branch + fixup to the final - target. */ - md_number_to_chars (buffer + 2, 0x00000780, 4); - fix_new (fragP, fragP->fr_fix + 2, 4, fragP->fr_symbol, - fragP->fr_offset, 1, BFD_RELOC_UNUSED + - (int) fragP->fr_opcode + 1); - fragP->fr_fix += 6; - } - /* Out of range unconditional branch. Emit a jump. */ - else if (fragP->fr_subtype == 3) - { - md_number_to_chars (fragP->fr_fix + fragP->fr_literal, 0x00000780, 4); - fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, - fragP->fr_offset, 1, BFD_RELOC_UNUSED + - (int) fragP->fr_opcode + 1); - fragP->fr_fix += 4; - } - else - abort (); -} - -valueT -md_section_align (seg, addr) - asection *seg; - valueT addr; -{ - int align = bfd_get_section_alignment (stdoutput, seg); - return ((addr + (1 << align) - 1) & (-1 << align)); -} - -void -md_begin () -{ - char *prev_name = ""; - register const struct v850_opcode *op; - - if (strncmp (TARGET_CPU, "v850ea", 6) == 0) - { - if (machine == -1) - machine = bfd_mach_v850ea; - - if (processor_mask == -1) - processor_mask = PROCESSOR_V850EA; - } - else if (strncmp (TARGET_CPU, "v850e", 5) == 0) - { - if (machine == -1) - machine = bfd_mach_v850e; - - if (processor_mask == -1) - processor_mask = PROCESSOR_V850E; - } - else if (strncmp (TARGET_CPU, "v850", 4) == 0) - { - if (machine == -1) - machine = 0; - - if (processor_mask == -1) - processor_mask = PROCESSOR_V850; - } - else - /* xgettext:c-format */ - as_bad (_("Unable to determine default target processor from string: %s"), - TARGET_CPU); - - v850_hash = hash_new (); - - /* Insert unique names into hash table. The V850 instruction set - has many identical opcode names that have different opcodes based - on the operands. This hash table then provides a quick index to - the first opcode with a particular name in the opcode table. */ - - op = v850_opcodes; - while (op->name) - { - if (strcmp (prev_name, op->name)) - { - prev_name = (char *) op->name; - hash_insert (v850_hash, op->name, (char *) op); - } - op++; - } - - v850_seg_table[BSS_SECTION].s = bss_section; - bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine); -} - -static bfd_reloc_code_real_type handle_ctoff - PARAMS ((const struct v850_operand *)); - -static bfd_reloc_code_real_type -handle_ctoff (operand) - const struct v850_operand *operand; -{ - if (operand == NULL) - return BFD_RELOC_V850_CALLT_16_16_OFFSET; - - if (operand->bits != 6 - || operand->shift != 0) - { - as_bad (_("ctoff() relocation used on an instruction which does not support it")); - return BFD_RELOC_64; /* Used to indicate an error condition. */ - } - - return BFD_RELOC_V850_CALLT_6_7_OFFSET; -} - -static bfd_reloc_code_real_type handle_sdaoff - PARAMS ((const struct v850_operand *)); - -static bfd_reloc_code_real_type -handle_sdaoff (operand) - const struct v850_operand *operand; -{ - if (operand == NULL) - return BFD_RELOC_V850_SDA_16_16_OFFSET; - - if (operand->bits == 15 && operand->shift == 17) - return BFD_RELOC_V850_SDA_15_16_OFFSET; - - if (operand->bits == -1) - return BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET; - - if (operand->bits != 16 - || operand->shift != 16) - { - as_bad (_("sdaoff() relocation used on an instruction which does not support it")); - return BFD_RELOC_64; /* Used to indicate an error condition. */ - } - - return BFD_RELOC_V850_SDA_16_16_OFFSET; -} - -static bfd_reloc_code_real_type handle_zdaoff - PARAMS ((const struct v850_operand *)); - -static bfd_reloc_code_real_type -handle_zdaoff (operand) - const struct v850_operand *operand; -{ - if (operand == NULL) - return BFD_RELOC_V850_ZDA_16_16_OFFSET; - - if (operand->bits == 15 && operand->shift == 17) - return BFD_RELOC_V850_ZDA_15_16_OFFSET; - - if (operand->bits == -1) - return BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET; - - if (operand->bits != 16 - || operand->shift != 16) - { - as_bad (_("zdaoff() relocation used on an instruction which does not support it")); - /* Used to indicate an error condition. */ - return BFD_RELOC_64; - } - - return BFD_RELOC_V850_ZDA_16_16_OFFSET; -} - -static bfd_reloc_code_real_type handle_tdaoff - PARAMS ((const struct v850_operand *)); - -static bfd_reloc_code_real_type -handle_tdaoff (operand) - const struct v850_operand *operand; -{ - if (operand == NULL) - /* Data item, not an instruction. */ - return BFD_RELOC_V850_TDA_7_7_OFFSET; - - if (operand->bits == 6 && operand->shift == 1) - /* sld.w/sst.w, operand: D8_6 */ - return BFD_RELOC_V850_TDA_6_8_OFFSET; - - if (operand->bits == 4 && operand->insert != NULL) - /* sld.hu, operand: D5-4 */ - return BFD_RELOC_V850_TDA_4_5_OFFSET; - - if (operand->bits == 4 && operand->insert == NULL) - /* sld.bu, operand: D4 */ - return BFD_RELOC_V850_TDA_4_4_OFFSET; - - if (operand->bits == 16 && operand->shift == 16) - /* set1 & chums, operands: D16 */ - return BFD_RELOC_V850_TDA_16_16_OFFSET; - - if (operand->bits != 7) - { - as_bad (_("tdaoff() relocation used on an instruction which does not support it")); - /* Used to indicate an error condition. */ - return BFD_RELOC_64; - } - - return operand->insert != NULL - ? BFD_RELOC_V850_TDA_7_8_OFFSET /* sld.h/sst.h, operand: D8_7 */ - : BFD_RELOC_V850_TDA_7_7_OFFSET; /* sld.b/sst.b, opreand: D7 */ -} - -/* Warning: The code in this function relies upon the definitions - in the v850_operands[] array (defined in opcodes/v850-opc.c) - matching the hard coded values contained herein. */ - -static bfd_reloc_code_real_type v850_reloc_prefix - PARAMS ((const struct v850_operand *)); - -static bfd_reloc_code_real_type -v850_reloc_prefix (operand) - const struct v850_operand *operand; -{ - boolean paren_skipped = false; - - /* Skip leading opening parenthesis. */ - if (*input_line_pointer == '(') - { - ++input_line_pointer; - paren_skipped = true; - } - -#define CHECK_(name, reloc) \ - if (strncmp (input_line_pointer, name##"(", strlen (name) + 1) == 0) \ - { \ - input_line_pointer += strlen (name); \ - return reloc; \ - } - - CHECK_ ("hi0", BFD_RELOC_HI16 ); - CHECK_ ("hi", BFD_RELOC_HI16_S ); - CHECK_ ("lo", BFD_RELOC_LO16 ); - CHECK_ ("sdaoff", handle_sdaoff (operand)); - CHECK_ ("zdaoff", handle_zdaoff (operand)); - CHECK_ ("tdaoff", handle_tdaoff (operand)); - CHECK_ ("hilo", BFD_RELOC_32 ); - CHECK_ ("ctoff", handle_ctoff (operand) ); - - /* Restore skipped parenthesis. */ - if (paren_skipped) - --input_line_pointer; - - return BFD_RELOC_UNUSED; -} - -/* Insert an operand value into an instruction. */ - -static unsigned long v850_insert_operand - PARAMS ((unsigned long, const struct v850_operand *, offsetT, char *, - unsigned int, char *)); - -static unsigned long -v850_insert_operand (insn, operand, val, file, line, str) - unsigned long insn; - const struct v850_operand *operand; - offsetT val; - char *file; - unsigned int line; - char *str; -{ - if (operand->insert) - { - const char *message = NULL; - - insn = operand->insert (insn, val, &message); - if (message != NULL) - { - if ((operand->flags & V850_OPERAND_SIGNED) - && ! warn_signed_overflows - && strstr (message, "out of range") != NULL) - { - /* Skip warning... */ - } - else if ((operand->flags & V850_OPERAND_SIGNED) == 0 - && ! warn_unsigned_overflows - && strstr (message, "out of range") != NULL) - { - /* Skip warning... */ - } - else if (str) - { - if (file == (char *) NULL) - as_warn ("%s: %s", str, message); - else - as_warn_where (file, line, "%s: %s", str, message); - } - else - { - if (file == (char *) NULL) - as_warn (message); - else - as_warn_where (file, line, message); - } - } - } - else - { - if (operand->bits != 32) - { - long min, max; - - if ((operand->flags & V850_OPERAND_SIGNED) != 0) - { - if (! warn_signed_overflows) - max = (1 << operand->bits) - 1; - else - max = (1 << (operand->bits - 1)) - 1; - - min = -(1 << (operand->bits - 1)); - } - else - { - max = (1 << operand->bits) - 1; - - if (! warn_unsigned_overflows) - min = -(1 << (operand->bits - 1)); - else - min = 0; - } - - if (val < (offsetT) min || val > (offsetT) max) - { - /* xgettext:c-format */ - const char *err = - _("operand out of range (%s not between %ld and %ld)"); - char buf[100]; - - /* Restore min and mix to expected values for decimal ranges. */ - if ((operand->flags & V850_OPERAND_SIGNED) - && ! warn_signed_overflows) - max = (1 << (operand->bits - 1)) - 1; - - if (! (operand->flags & V850_OPERAND_SIGNED) - && ! warn_unsigned_overflows) - min = 0; - - if (str) - { - sprintf (buf, "%s: ", str); - - sprint_value (buf + strlen (buf), val); - } - else - sprint_value (buf, val); - - if (file == (char *) NULL) - as_warn (err, buf, min, max); - else - as_warn_where (file, line, err, buf, min, max); - } - } - - insn |= (((long) val & ((1 << operand->bits) - 1)) << operand->shift); - } - - return insn; -} - -static char copy_of_instruction[128]; - -void -md_assemble (str) - char *str; -{ - char *s; - char *start_of_operands; - struct v850_opcode *opcode; - struct v850_opcode *next_opcode; - const unsigned char *opindex_ptr; - int next_opindex; - int relaxable = 0; - unsigned long insn; - unsigned long insn_size; - char *f; - int i; - int match; - boolean extra_data_after_insn = false; - unsigned extra_data_len = 0; - unsigned long extra_data = 0; - char *saved_input_line_pointer; - - strncpy (copy_of_instruction, str, sizeof (copy_of_instruction) - 1); - - /* Get the opcode. */ - for (s = str; *s != '\0' && ! ISSPACE (*s); s++) - continue; - - if (*s != '\0') - *s++ = '\0'; - - /* Find the first opcode with the proper name. */ - opcode = (struct v850_opcode *) hash_find (v850_hash, str); - if (opcode == NULL) - { - /* xgettext:c-format */ - as_bad (_("Unrecognized opcode: `%s'"), str); - ignore_rest_of_line (); - return; - } - - str = s; - while (ISSPACE (*str)) - ++str; - - start_of_operands = str; - - saved_input_line_pointer = input_line_pointer; - - for (;;) - { - const char *errmsg = NULL; - - match = 0; - - if ((opcode->processors & processor_mask) == 0) - { - errmsg = _("Target processor does not support this instruction."); - goto error; - } - - relaxable = 0; - fc = 0; - next_opindex = 0; - insn = opcode->opcode; - extra_data_after_insn = false; - - input_line_pointer = str = start_of_operands; - - for (opindex_ptr = opcode->operands; *opindex_ptr != 0; opindex_ptr++) - { - const struct v850_operand *operand; - char *hold; - expressionS ex; - bfd_reloc_code_real_type reloc; - - if (next_opindex == 0) - { - operand = &v850_operands[*opindex_ptr]; - } - else - { - operand = &v850_operands[next_opindex]; - next_opindex = 0; - } - - errmsg = NULL; - - while (*str == ' ' || *str == ',' || *str == '[' || *str == ']') - ++str; - - if (operand->flags & V850_OPERAND_RELAX) - relaxable = 1; - - /* Gather the operand. */ - hold = input_line_pointer; - input_line_pointer = str; - - /* lo(), hi(), hi0(), etc... */ - if ((reloc = v850_reloc_prefix (operand)) != BFD_RELOC_UNUSED) - { - /* This is a fake reloc, used to indicate an error condition. */ - if (reloc == BFD_RELOC_64) - { - match = 1; - goto error; - } - - expression (&ex); - - if (ex.X_op == O_constant) - { - switch (reloc) - { - case BFD_RELOC_V850_ZDA_16_16_OFFSET: - /* To cope with "not1 7, zdaoff(0xfffff006)[r0]" - and the like. */ - /* Fall through. */ - - case BFD_RELOC_LO16: - { - /* Truncate, then sign extend the value. */ - ex.X_add_number = SEXT16 (ex.X_add_number); - break; - } - - case BFD_RELOC_HI16: - { - /* Truncate, then sign extend the value. */ - ex.X_add_number = SEXT16 (ex.X_add_number >> 16); - break; - } - - case BFD_RELOC_HI16_S: - { - /* Truncate, then sign extend the value. */ - int temp = (ex.X_add_number >> 16) & 0xffff; - - temp += (ex.X_add_number >> 15) & 1; - - ex.X_add_number = SEXT16 (temp); - break; - } - - case BFD_RELOC_32: - if ((operand->flags & V850E_IMMEDIATE32) == 0) - { - errmsg = _("immediate operand is too large"); - goto error; - } - - extra_data_after_insn = true; - extra_data_len = 4; - extra_data = ex.X_add_number; - ex.X_add_number = 0; - break; - - default: - fprintf (stderr, "reloc: %d\n", reloc); - as_bad (_("AAARG -> unhandled constant reloc")); - break; - } - - if (fc > MAX_INSN_FIXUPS) - as_fatal (_("too many fixups")); - - fixups[fc].exp = ex; - fixups[fc].opindex = *opindex_ptr; - fixups[fc].reloc = reloc; - fc++; - } - else - { - if (reloc == BFD_RELOC_32) - { - if ((operand->flags & V850E_IMMEDIATE32) == 0) - { - errmsg = _("immediate operand is too large"); - goto error; - } - - extra_data_after_insn = true; - extra_data_len = 4; - extra_data = ex.X_add_number; - } - - if (fc > MAX_INSN_FIXUPS) - as_fatal (_("too many fixups")); - - fixups[fc].exp = ex; - fixups[fc].opindex = *opindex_ptr; - fixups[fc].reloc = reloc; - fc++; - } - } - else - { - errmsg = NULL; - - if ((operand->flags & V850_OPERAND_REG) != 0) - { - if (!register_name (&ex)) - { - errmsg = _("invalid register name"); - } - else if ((operand->flags & V850_NOT_R0) - && ex.X_add_number == 0) - { - errmsg = _("register r0 cannot be used here"); - - /* Force an error message to be generated by - skipping over any following potential matches - for this opcode. */ - opcode += 3; - } - } - else if ((operand->flags & V850_OPERAND_SRG) != 0) - { - if (!system_register_name (&ex, true, false)) - { - errmsg = _("invalid system register name"); - } - } - else if ((operand->flags & V850_OPERAND_EP) != 0) - { - char *start = input_line_pointer; - char c = get_symbol_end (); - - if (strcmp (start, "ep") != 0 && strcmp (start, "r30") != 0) - { - /* Put things back the way we found them. */ - *input_line_pointer = c; - input_line_pointer = start; - errmsg = _("expected EP register"); - goto error; - } - - *input_line_pointer = c; - str = input_line_pointer; - input_line_pointer = hold; - - while (*str == ' ' || *str == ',' - || *str == '[' || *str == ']') - ++str; - continue; - } - else if ((operand->flags & V850_OPERAND_CC) != 0) - { - if (!cc_name (&ex)) - { - errmsg = _("invalid condition code name"); - } - } - else if (operand->flags & V850E_PUSH_POP) - { - errmsg = parse_register_list (&insn, operand); - - /* The parse_register_list() function has already done - everything, so fake a dummy expression. */ - ex.X_op = O_constant; - ex.X_add_number = 0; - } - else if (operand->flags & V850E_IMMEDIATE16) - { - expression (&ex); - - if (ex.X_op != O_constant) - errmsg = _("constant expression expected"); - else if (ex.X_add_number & 0xffff0000) - { - if (ex.X_add_number & 0xffff) - errmsg = _("constant too big to fit into instruction"); - else if ((insn & 0x001fffc0) == 0x00130780) - ex.X_add_number >>= 16; - else - errmsg = _("constant too big to fit into instruction"); - } - - extra_data_after_insn = true; - extra_data_len = 2; - extra_data = ex.X_add_number; - ex.X_add_number = 0; - } - else if (operand->flags & V850E_IMMEDIATE32) - { - expression (&ex); - - if (ex.X_op != O_constant) - errmsg = _("constant expression expected"); - - extra_data_after_insn = true; - extra_data_len = 4; - extra_data = ex.X_add_number; - ex.X_add_number = 0; - } - else if (register_name (&ex) - && (operand->flags & V850_OPERAND_REG) == 0) - { - char c; - int exists = 0; - - /* It is possible that an alias has been defined that - matches a register name. For example the code may - include a ".set ZERO, 0" directive, which matches - the register name "zero". Attempt to reparse the - field as an expression, and only complain if we - cannot generate a constant. */ - - input_line_pointer = str; - - c = get_symbol_end (); - - if (symbol_find (str) != NULL) - exists = 1; - - *input_line_pointer = c; - input_line_pointer = str; - - expression (&ex); - - if (ex.X_op != O_constant) - { - /* If this register is actually occuring too early on - the parsing of the instruction, (because another - field is missing) then report this. */ - if (opindex_ptr[1] != 0 - && (v850_operands[opindex_ptr[1]].flags - & V850_OPERAND_REG)) - errmsg = _("syntax error: value is missing before the register name"); - else - errmsg = _("syntax error: register not expected"); - - /* If we created a symbol in the process of this - test then delete it now, so that it will not - be output with the real symbols... */ - if (exists == 0 - && ex.X_op == O_symbol) - symbol_remove (ex.X_add_symbol, - &symbol_rootP, &symbol_lastP); - } - } - else if (system_register_name (&ex, false, false) - && (operand->flags & V850_OPERAND_SRG) == 0) - { - errmsg = _("syntax error: system register not expected"); - } - else if (cc_name (&ex) - && (operand->flags & V850_OPERAND_CC) == 0) - { - errmsg = _("syntax error: condition code not expected"); - } - else - { - expression (&ex); - /* Special case: - If we are assembling a MOV instruction (or a CALLT.... :-) - and the immediate value does not fit into the bits - available then create a fake error so that the next MOV - instruction will be selected. This one has a 32 bit - immediate field. */ - - if (((insn & 0x07e0) == 0x0200) - && ex.X_op == O_constant - && (ex.X_add_number < (-(1 << (operand->bits - 1))) - || ex.X_add_number > ((1 << operand->bits) - 1))) - errmsg = _("immediate operand is too large"); - } - - if (errmsg) - goto error; - -#if 0 - fprintf (stderr, - " insn: %x, operand %d, op: %d, add_number: %d\n", - insn, opindex_ptr - opcode->operands, - ex.X_op, ex.X_add_number); -#endif - - switch (ex.X_op) - { - case O_illegal: - errmsg = _("illegal operand"); - goto error; - case O_absent: - errmsg = _("missing operand"); - goto error; - case O_register: - if ((operand->flags - & (V850_OPERAND_REG | V850_OPERAND_SRG)) == 0) - { - errmsg = _("invalid operand"); - goto error; - } - insn = v850_insert_operand (insn, operand, ex.X_add_number, - (char *) NULL, 0, - copy_of_instruction); - break; - - case O_constant: - insn = v850_insert_operand (insn, operand, ex.X_add_number, - (char *) NULL, 0, - copy_of_instruction); - break; - - default: - /* We need to generate a fixup for this expression. */ - if (fc >= MAX_INSN_FIXUPS) - as_fatal (_("too many fixups")); - - fixups[fc].exp = ex; - fixups[fc].opindex = *opindex_ptr; - fixups[fc].reloc = BFD_RELOC_UNUSED; - ++fc; - break; - } - } - - str = input_line_pointer; - input_line_pointer = hold; - - while (*str == ' ' || *str == ',' || *str == '[' || *str == ']' - || *str == ')') - ++str; - } - match = 1; - - error: - if (match == 0) - { - next_opcode = opcode + 1; - if (next_opcode->name != NULL - && strcmp (next_opcode->name, opcode->name) == 0) - { - opcode = next_opcode; - - /* Skip versions that are not supported by the target - processor. */ - if ((opcode->processors & processor_mask) == 0) - goto error; - - continue; - } - - as_bad ("%s: %s", copy_of_instruction, errmsg); - - if (*input_line_pointer == ']') - ++input_line_pointer; - - ignore_rest_of_line (); - input_line_pointer = saved_input_line_pointer; - return; - } - break; - } - - while (ISSPACE (*str)) - ++str; - - if (*str != '\0') - /* xgettext:c-format */ - as_bad (_("junk at end of line: `%s'"), str); - - input_line_pointer = str; - - /* Tie dwarf2 debug info to the address at the start of the insn. - We can't do this after the insn has been output as the current - frag may have been closed off. eg. by frag_var. */ - dwarf2_emit_insn (0); - - /* Write out the instruction. */ - - if (relaxable && fc > 0) - { - insn_size = 2; - fc = 0; - - if (!strcmp (opcode->name, "br")) - { - f = frag_var (rs_machine_dependent, 4, 2, 2, - fixups[0].exp.X_add_symbol, - fixups[0].exp.X_add_number, - (char *) fixups[0].opindex); - md_number_to_chars (f, insn, insn_size); - md_number_to_chars (f + 2, 0, 2); - } - else - { - f = frag_var (rs_machine_dependent, 6, 4, 0, - fixups[0].exp.X_add_symbol, - fixups[0].exp.X_add_number, - (char *) fixups[0].opindex); - md_number_to_chars (f, insn, insn_size); - md_number_to_chars (f + 2, 0, 4); - } - } - else - { - /* Four byte insns have an opcode with the two high bits on. */ - if ((insn & 0x0600) == 0x0600) - insn_size = 4; - else - insn_size = 2; - - /* Special case: 32 bit MOV. */ - if ((insn & 0xffe0) == 0x0620) - insn_size = 2; - - f = frag_more (insn_size); - md_number_to_chars (f, insn, insn_size); - - if (extra_data_after_insn) - { - f = frag_more (extra_data_len); - md_number_to_chars (f, extra_data, extra_data_len); - - extra_data_after_insn = false; - } - } - - /* Create any fixups. At this point we do not use a - bfd_reloc_code_real_type, but instead just use the - BFD_RELOC_UNUSED plus the operand index. This lets us easily - handle fixups for any operand type, although that is admittedly - not a very exciting feature. We pick a BFD reloc type in - md_apply_fix3. */ - for (i = 0; i < fc; i++) - { - const struct v850_operand *operand; - bfd_reloc_code_real_type reloc; - - operand = &v850_operands[fixups[i].opindex]; - - reloc = fixups[i].reloc; - - if (reloc != BFD_RELOC_UNUSED) - { - reloc_howto_type *reloc_howto = - bfd_reloc_type_lookup (stdoutput, reloc); - int size; - int address; - fixS *fixP; - - if (!reloc_howto) - abort (); - - size = bfd_get_reloc_size (reloc_howto); - - /* XXX This will abort on an R_V850_8 reloc - - is this reloc actually used? */ - if (size != 2 && size != 4) - abort (); - - address = (f - frag_now->fr_literal) + insn_size - size; - - if (reloc == BFD_RELOC_32) - address += 2; - - fixP = fix_new_exp (frag_now, address, size, - &fixups[i].exp, - reloc_howto->pc_relative, - reloc); - - switch (reloc) - { - case BFD_RELOC_LO16: - case BFD_RELOC_HI16: - case BFD_RELOC_HI16_S: - fixP->fx_no_overflow = 1; - break; - default: - break; - } - } - else - { - fix_new_exp (frag_now, - f - frag_now->fr_literal, 4, - & fixups[i].exp, - 1 /* FIXME: V850_OPERAND_RELATIVE ??? */, - (bfd_reloc_code_real_type) (fixups[i].opindex - + (int) BFD_RELOC_UNUSED)); - } - } - - input_line_pointer = saved_input_line_pointer; -} - -/* If while processing a fixup, a reloc really needs to be created - then it is done here. */ - -arelent * -tc_gen_reloc (seg, fixp) - asection *seg ATTRIBUTE_UNUSED; - fixS *fixp; -{ - arelent *reloc; - - reloc = (arelent *) xmalloc (sizeof (arelent)); - reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; - reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); - - if (reloc->howto == (reloc_howto_type *) NULL) - { - as_bad_where (fixp->fx_file, fixp->fx_line, - /* xgettext:c-format */ - _("reloc %d not supported by object file format"), - (int) fixp->fx_r_type); - - xfree (reloc); - - return NULL; - } - - if (fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY - || fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT) - reloc->addend = fixp->fx_offset; - else - reloc->addend = fixp->fx_addnumber; - - return reloc; -} - -/* Return current size of variable part of frag. */ - -int -md_estimate_size_before_relax (fragp, seg) - fragS *fragp; - asection *seg ATTRIBUTE_UNUSED; -{ - if (fragp->fr_subtype >= sizeof (md_relax_table) / sizeof (md_relax_table[0])) - abort (); - - return md_relax_table[fragp->fr_subtype].rlx_length; -} - -long -v850_pcrel_from_section (fixp, section) - fixS *fixp; - segT section; -{ - /* If the symbol is undefined, or in a section other than our own, - or it is weak (in which case it may well be in another section, - then let the linker figure it out. */ - if (fixp->fx_addsy != (symbolS *) NULL - && (! S_IS_DEFINED (fixp->fx_addsy) - || S_IS_WEAK (fixp->fx_addsy) - || (S_GET_SEGMENT (fixp->fx_addsy) != section))) - return 0; - - return fixp->fx_frag->fr_address + fixp->fx_where; -} - -void -md_apply_fix3 (fixP, valueP, seg) - fixS *fixP; - valueT *valueP; - segT seg ATTRIBUTE_UNUSED; -{ - valueT value = * valueP; - char *where; - - if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT - || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) - { - fixP->fx_done = 0; - return; - } - - if (fixP->fx_addsy == (symbolS *) NULL) - fixP->fx_done = 1; - - else if (fixP->fx_pcrel) - ; - - else - { - value = fixP->fx_offset; - if (fixP->fx_subsy != (symbolS *) NULL) - { - if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section) - value -= S_GET_VALUE (fixP->fx_subsy); - else - { - /* We don't actually support subtracting a symbol. */ - as_bad_where (fixP->fx_file, fixP->fx_line, - _("expression too complex")); - } - } - } - - if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED) - { - int opindex; - const struct v850_operand *operand; - unsigned long insn; - - opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED; - operand = &v850_operands[opindex]; - - /* Fetch the instruction, insert the fully resolved operand - value, and stuff the instruction back again. - - Note the instruction has been stored in little endian - format! */ - where = fixP->fx_frag->fr_literal + fixP->fx_where; - - insn = bfd_getl32 ((unsigned char *) where); - insn = v850_insert_operand (insn, operand, (offsetT) value, - fixP->fx_file, fixP->fx_line, NULL); - bfd_putl32 ((bfd_vma) insn, (unsigned char *) where); - - if (fixP->fx_done) - /* Nothing else to do here. */ - return; - - /* Determine a BFD reloc value based on the operand information. - We are only prepared to turn a few of the operands into relocs. */ - - if (operand->bits == 22) - fixP->fx_r_type = BFD_RELOC_V850_22_PCREL; - else if (operand->bits == 9) - fixP->fx_r_type = BFD_RELOC_V850_9_PCREL; - else - { -#if 0 - fprintf (stderr, "bits: %d, insn: %x\n", operand->bits, insn); -#endif - - as_bad_where (fixP->fx_file, fixP->fx_line, - _("unresolved expression that must be resolved")); - fixP->fx_done = 1; - return; - } - } - else if (fixP->fx_done) - { - /* We still have to insert the value into memory! */ - where = fixP->fx_frag->fr_literal + fixP->fx_where; - - if (fixP->fx_size == 1) - *where = value & 0xff; - else if (fixP->fx_size == 2) - bfd_putl16 (value & 0xffff, (unsigned char *) where); - else if (fixP->fx_size == 4) - bfd_putl32 (value, (unsigned char *) where); - } - - fixP->fx_addnumber = value; -} - -/* Parse a cons expression. We have to handle hi(), lo(), etc - on the v850. */ - -void -parse_cons_expression_v850 (exp) - expressionS *exp; -{ - /* See if there's a reloc prefix like hi() we have to handle. */ - hold_cons_reloc = v850_reloc_prefix (NULL); - - /* Do normal expression parsing. */ - expression (exp); -} - -/* Create a fixup for a cons expression. If parse_cons_expression_v850 - found a reloc prefix, then we use that reloc, else we choose an - appropriate one based on the size of the expression. */ - -void -cons_fix_new_v850 (frag, where, size, exp) - fragS *frag; - int where; - int size; - expressionS *exp; -{ - if (hold_cons_reloc == BFD_RELOC_UNUSED) - { - if (size == 4) - hold_cons_reloc = BFD_RELOC_32; - if (size == 2) - hold_cons_reloc = BFD_RELOC_16; - if (size == 1) - hold_cons_reloc = BFD_RELOC_8; - } - - if (exp != NULL) - fix_new_exp (frag, where, size, exp, 0, hold_cons_reloc); - else - fix_new (frag, where, size, NULL, 0, 0, hold_cons_reloc); - - hold_cons_reloc = BFD_RELOC_UNUSED; -} - -boolean -v850_fix_adjustable (fixP) - fixS *fixP; -{ - if (fixP->fx_addsy == NULL) - return 1; - - /* Prevent all adjustments to global symbols. */ - if (S_IS_EXTERN (fixP->fx_addsy)) - return 0; - - /* Similarly for weak symbols. */ - if (S_IS_WEAK (fixP->fx_addsy)) - return 0; - - /* Don't adjust function names. */ - if (S_IS_FUNCTION (fixP->fx_addsy)) - return 0; - - /* We need the symbol name for the VTABLE entries. */ - if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT - || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) - return 0; - - return 1; -} - -int -v850_force_relocation (fixP) - struct fix *fixP; -{ - if (fixP->fx_addsy && S_IS_WEAK (fixP->fx_addsy)) - return 1; - - if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT - || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) - return 1; - - return 0; -} diff --git a/contrib/binutils/gas/config/tc-v850.h b/contrib/binutils/gas/config/tc-v850.h deleted file mode 100644 index 3de777c3fc9f..000000000000 --- a/contrib/binutils/gas/config/tc-v850.h +++ /dev/null @@ -1,97 +0,0 @@ -/* tc-v850.h -- Header file for tc-v850.c. - Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - -#define TC_V850 - -#include <elf/v850.h> - -#define TARGET_BYTES_BIG_ENDIAN 0 - -#ifndef BFD_ASSEMBLER - #error V850 support requires BFD_ASSEMBLER -#endif - -/* The target BFD architecture. */ -#define TARGET_ARCH bfd_arch_v850 - -/* The target BFD format. */ -#define TARGET_FORMAT "elf32-v850" - -#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 - obj_fix_adjustable() says it is not adjustable. */ -#define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP) -#endif - -/* Permit temporary numeric labels. */ -#define LOCAL_LABELS_FB 1 - -#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs. */ - -/* We don't need to handle .word strangely. */ -#define WORKING_DOT_WORD - -#define md_number_to_chars number_to_chars_littleendian - -/* 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 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 -/* This section must be in the tiny data area (pointed to by EP). */ -#define SHF_V850_EPREL 0x20000000 -/* This section must be in the zero data area (pointed to by R0). */ -#define SHF_V850_R0REL 0x40000000 - -#define ELF_TC_SPECIAL_SECTIONS \ - { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL }, \ - { ".rosdata", SHT_PROGBITS, SHF_ALLOC + SHF_V850_GPREL }, \ - { ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL }, \ - { ".scommon", SHT_V850_SCOMMON, SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL }, \ - { ".tdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_EPREL }, \ - { ".tbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_EPREL }, \ - { ".tcommon", SHT_V850_TCOMMON, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, \ - { ".zdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, \ - { ".rozdata", SHT_PROGBITS, SHF_ALLOC + SHF_V850_R0REL }, \ - { ".zbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, \ - { ".zcommon", SHT_V850_ZCOMMON, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, \ - { ".call_table_data", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \ - { ".call_table_text", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_EXECINSTR }, - -#define MD_PCREL_FROM_SECTION(fixP,section) v850_pcrel_from_section (fixP, section) -extern long v850_pcrel_from_section PARAMS ((struct fix *, asection *)); - -#define DWARF2_LINE_MIN_INSN_LENGTH 2 diff --git a/contrib/binutils/gas/config/tc-z8k.c b/contrib/binutils/gas/config/tc-z8k.c deleted file mode 100644 index f5b05a632f9c..000000000000 --- a/contrib/binutils/gas/config/tc-z8k.c +++ /dev/null @@ -1,1566 +0,0 @@ -/* tc-z8k.c -- Assemble code for the Zilog Z800n - Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001 - Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - -/* Written By Steve Chamberlain <sac@cygnus.com>. */ - -#define DEFINE_TABLE -#include <stdio.h> - -#include "as.h" -#include "bfd.h" -#include "safe-ctype.h" -#include "opcodes/z8k-opc.h" - -const char comment_chars[] = "!"; -const char line_comment_chars[] = "#"; -const char line_separator_chars[] = ";"; - -extern int machine; -extern int coff_flags; -int segmented_mode; -const int md_reloc_size; - -void cons (); - -void -s_segm () -{ - segmented_mode = 1; - machine = bfd_mach_z8001; - coff_flags = F_Z8001; -} - -void -s_unseg () -{ - segmented_mode = 0; - machine = bfd_mach_z8002; - coff_flags = F_Z8002; -} - -static void -even () -{ - frag_align (1, 0, 0); - record_alignment (now_seg, 1); -} - -void obj_coff_section (); - -int -tohex (c) - int c; -{ - if (ISDIGIT (c)) - return c - '0'; - if (ISLOWER (c)) - return c - 'a' + 10; - return c - 'A' + 10; -} - -void -sval () -{ - SKIP_WHITESPACE (); - if (*input_line_pointer == '\'') - { - int c; - input_line_pointer++; - c = *input_line_pointer++; - while (c != '\'') - { - if (c == '%') - { - c = (tohex (input_line_pointer[0]) << 4) - | tohex (input_line_pointer[1]); - input_line_pointer += 2; - } - FRAG_APPEND_1_CHAR (c); - c = *input_line_pointer++; - } - demand_empty_rest_of_line (); - } -} - -/* This table describes all the machine specific pseudo-ops the assembler - has to support. The fields are: - pseudo-op name without dot - function to call to execute this pseudo-op - Integer arg to pass to the function - */ - -const pseudo_typeS md_pseudo_table[] = { - {"int" , cons , 2}, - {"data.b" , cons , 1}, - {"data.w" , cons , 2}, - {"data.l" , cons , 4}, - {"form" , listing_psize , 0}, - {"heading", listing_title , 0}, - {"import" , s_ignore , 0}, - {"page" , listing_eject , 0}, - {"program", s_ignore , 0}, - {"z8001" , s_segm , 0}, - {"z8002" , s_unseg , 0}, - - {"segm" , s_segm , 0}, - {"unsegm" , s_unseg , 0}, - {"unseg" , s_unseg , 0}, - {"name" , s_app_file , 0}, - {"global" , s_globl , 0}, - {"wval" , cons , 2}, - {"lval" , cons , 4}, - {"bval" , cons , 1}, - {"sval" , sval , 0}, - {"rsect" , obj_coff_section, 0}, - {"sect" , obj_coff_section, 0}, - {"block" , s_space , 0}, - {"even" , even , 0}, - {0 , 0 , 0} -}; - -const char EXP_CHARS[] = "eE"; - -/* Chars that mean this number is a floating point constant. - As in 0f12.456 - or 0d1.2345e12 */ -const char FLT_CHARS[] = "rRsSfFdDxXpP"; - -/* Opcode mnemonics. */ -static struct hash_control *opcode_hash_control; - -void -md_begin () -{ - opcode_entry_type *opcode; - char *prev_name = ""; - int idx = 0; - - opcode_hash_control = hash_new (); - - for (opcode = z8k_table; opcode->name; opcode++) - { - /* Only enter unique codes into the table. */ - if (strcmp (opcode->name, prev_name)) - { - hash_insert (opcode_hash_control, opcode->name, (char *) opcode); - idx++; - } - opcode->idx = idx; - prev_name = opcode->name; - } - - /* Default to z8002. */ - s_unseg (); - - /* Insert the pseudo ops, too. */ - for (idx = 0; md_pseudo_table[idx].poc_name; idx++) - { - opcode_entry_type *fake_opcode; - fake_opcode = (opcode_entry_type *) malloc (sizeof (opcode_entry_type)); - fake_opcode->name = md_pseudo_table[idx].poc_name; - fake_opcode->func = (void *) (md_pseudo_table + idx); - fake_opcode->opcode = 250; - hash_insert (opcode_hash_control, fake_opcode->name, fake_opcode); - } - - linkrelax = 1; -} - -struct z8k_exp { - char *e_beg; - char *e_end; - expressionS e_exp; -}; - -typedef struct z8k_op { - /* 'b','w','r','q'. */ - char regsize; - - /* 0 .. 15. */ - unsigned int reg; - - int mode; - - /* Any other register associated with the mode. */ - unsigned int x_reg; - - /* Any expression. */ - expressionS exp; -} op_type; - -static expressionS *da_operand; -static expressionS *imm_operand; - -int reg[16]; -int the_cc; -int the_ctrl; -int the_flags; -int the_interrupt; - -char * -whatreg (reg, src) - int *reg; - char *src; -{ - if (ISDIGIT (src[1])) - { - *reg = (src[0] - '0') * 10 + src[1] - '0'; - return src + 2; - } - else - { - *reg = (src[0] - '0'); - return src + 1; - } -} - -/* Parse operands - - rh0-rh7, rl0-rl7 - r0-r15 - rr0-rr14 - rq0--rq12 - WREG r0,r1,r2,r3,r4,r5,r6,r7,fp,sp - r0l,r0h,..r7l,r7h - @WREG - @WREG+ - @-WREG - #const -*/ - -/* Try to parse a reg name. Return a pointer to the first character - in SRC after the reg name. */ - -char * -parse_reg (src, mode, reg) - char *src; - int *mode; - unsigned int *reg; -{ - char *res = 0; - char regno; - - if (src[0] == 's' && src[1] == 'p' && (src[2] == 0 || src[2] == ',')) - { - if (segmented_mode) - { - *mode = CLASS_REG_LONG; - *reg = 14; - } - else - { - *mode = CLASS_REG_WORD; - *reg = 15; - } - return src + 2; - } - if (src[0] == 'r') - { - if (src[1] == 'r') - { - if (src[2] < '0' || src[2] > '9') - return res; /* Assume no register name but a label starting with 'rr'. */ - *mode = CLASS_REG_LONG; - res = whatreg (reg, src + 2); - regno = *reg; - if (regno > 14) - as_warn (_("register rr%d, out of range."), regno); - } - else if (src[1] == 'h') - { - if (src[2] < '0' || src[2] > '9') - return res; /* Assume no register name but a label starting with 'rh'. */ - *mode = CLASS_REG_BYTE; - res = whatreg (reg, src + 2); - regno = *reg; - if (regno > 7) - as_warn (_("register rh%d, out of range."), regno); - } - else if (src[1] == 'l') - { - if (src[2] < '0' || src[2] > '9') - return res; /* Assume no register name but a label starting with 'rl'. */ - *mode = CLASS_REG_BYTE; - res = whatreg (reg, src + 2); - regno = *reg; - if (regno > 7) - as_warn (_("register rl%d, out of range."), regno); - *reg += 8; - } - else if (src[1] == 'q') - { - if (src[2] < '0' || src[2] > '9') - return res; /* Assume no register name but a label starting with 'rq'. */ - *mode = CLASS_REG_QUAD; - res = whatreg (reg, src + 2); - regno = *reg; - if (regno > 12) - as_warn (_("register rq%d, out of range."), regno); - } - else - { - if (src[1] < '0' || src[1] > '9') - return res; /* Assume no register name but a label starting with 'r'. */ - *mode = CLASS_REG_WORD; - res = whatreg (reg, src + 1); - regno = *reg; - if (regno > 15) - as_warn (_("register r%d, out of range."), regno); - } - } - return res; -} - -char * -parse_exp (s, op) - char *s; - expressionS *op; -{ - char *save = input_line_pointer; - char *new; - - input_line_pointer = s; - expression (op); - if (op->X_op == O_absent) - as_bad (_("missing operand")); - new = input_line_pointer; - input_line_pointer = save; - return new; -} - -/* The many forms of operand: - - <rb> - <r> - <rr> - <rq> - @r - #exp - exp - exp(r) - r(#exp) - r(r) - */ - -static char * -checkfor (ptr, what) - char *ptr; - char what; -{ - if (*ptr == what) - ptr++; - else - as_bad (_("expected %c"), what); - - return ptr; -} - -/* Make sure the mode supplied is the size of a word. */ - -static void -regword (mode, string) - int mode; - char *string; -{ - int ok; - - ok = CLASS_REG_WORD; - if (ok != mode) - { - as_bad (_("register is wrong size for a word %s"), string); - } -} - -/* Make sure the mode supplied is the size of an address. */ - -static void -regaddr (mode, string) - int mode; - char *string; -{ - int ok; - - ok = segmented_mode ? CLASS_REG_LONG : CLASS_REG_WORD; - if (ok != mode) - { - as_bad (_("register is wrong size for address %s"), string); - } -} - -struct ctrl_names { - int value; - char *name; -}; - -struct ctrl_names ctrl_table[] = { - { 0x2, "fcw" }, - { 0x3, "refresh" }, - { 0x4, "psapseg" }, - { 0x5, "psapoff" }, - { 0x5, "psap" }, - { 0x6, "nspseg" }, - { 0x7, "nspoff" }, - { 0x7, "nsp" }, - { 0 , 0 } -}; - -static void -get_ctrl_operand (ptr, mode, dst) - char **ptr; - struct z8k_op *mode; - unsigned int dst ATTRIBUTE_UNUSED; -{ - char *src = *ptr; - int i; - - while (*src == ' ') - src++; - - mode->mode = CLASS_CTRL; - for (i = 0; ctrl_table[i].name; i++) - { - int j; - - for (j = 0; ctrl_table[i].name[j]; j++) - { - if (ctrl_table[i].name[j] != src[j]) - goto fail; - } - the_ctrl = ctrl_table[i].value; - *ptr = src + j; - return; - fail: - ; - } - the_ctrl = 0; - return; -} - -struct flag_names { - int value; - char *name; - -}; - -struct flag_names flag_table[] = { - { 0x1, "p" }, - { 0x1, "v" }, - { 0x2, "s" }, - { 0x4, "z" }, - { 0x8, "c" }, - { 0x0, "+" }, - { 0, 0 } -}; - -static void -get_flags_operand (ptr, mode, dst) - char **ptr; - struct z8k_op *mode; - unsigned int dst ATTRIBUTE_UNUSED; -{ - char *src = *ptr; - int i; - int j; - - while (*src == ' ') - src++; - - mode->mode = CLASS_FLAGS; - the_flags = 0; - for (j = 0; j <= 9; j++) - { - if (!src[j]) - goto done; - for (i = 0; flag_table[i].name; i++) - { - if (flag_table[i].name[0] == src[j]) - { - the_flags = the_flags | flag_table[i].value; - goto match; - } - } - goto done; - match: - ; - } - done: - *ptr = src + j; - return; -} - -struct interrupt_names { - int value; - char *name; - -}; - -struct interrupt_names intr_table[] = { - { 0x1, "nvi" }, - { 0x2, "vi" }, - { 0x3, "both" }, - { 0x3, "all" }, - { 0, 0 } -}; - -static void -get_interrupt_operand (ptr, mode, dst) - char **ptr; - struct z8k_op *mode; - unsigned int dst ATTRIBUTE_UNUSED; -{ - char *src = *ptr; - int i; - - while (*src == ' ') - src++; - - mode->mode = CLASS_IMM; - for (i = 0; intr_table[i].name; i++) - { - int j; - - for (j = 0; intr_table[i].name[j]; j++) - { - if (intr_table[i].name[j] != src[j]) - goto fail; - } - the_interrupt = intr_table[i].value; - *ptr = src + j; - return; - fail: - ; - } - the_interrupt = 0x0; - return; -} - -struct cc_names { - int value; - char *name; - -}; - -struct cc_names table[] = { - { 0x0, "f" }, - { 0x1, "lt" }, - { 0x2, "le" }, - { 0x3, "ule" }, - { 0x4, "ov" }, - { 0x4, "pe" }, - { 0x5, "mi" }, - { 0x6, "eq" }, - { 0x6, "z" }, - { 0x7, "c" }, - { 0x7, "ult" }, - { 0x8, "t" }, - { 0x9, "ge" }, - { 0xa, "gt" }, - { 0xb, "ugt" }, - { 0xc, "nov" }, - { 0xc, "po" }, - { 0xd, "pl" }, - { 0xe, "ne" }, - { 0xe, "nz" }, - { 0xf, "nc" }, - { 0xf, "uge" }, - { 0 , 0 } -}; - -static void -get_cc_operand (ptr, mode, dst) - char **ptr; - struct z8k_op *mode; - unsigned int dst ATTRIBUTE_UNUSED; -{ - char *src = *ptr; - int i; - - while (*src == ' ') - src++; - - mode->mode = CLASS_CC; - for (i = 0; table[i].name; i++) - { - int j; - - for (j = 0; table[i].name[j]; j++) - { - if (table[i].name[j] != src[j]) - goto fail; - } - the_cc = table[i].value; - *ptr = src + j; - return; - fail: - ; - } - the_cc = 0x8; -} - -static void -get_operand (ptr, mode, dst) - char **ptr; - struct z8k_op *mode; - unsigned int dst ATTRIBUTE_UNUSED; -{ - char *src = *ptr; - char *end; - - mode->mode = 0; - - while (*src == ' ') - src++; - if (*src == '#') - { - mode->mode = CLASS_IMM; - imm_operand = &(mode->exp); - src = parse_exp (src + 1, &(mode->exp)); - } - else if (*src == '@') - { - int d; - - mode->mode = CLASS_IR; - src = parse_reg (src + 1, &d, &mode->reg); - } - else - { - int regn; - - end = parse_reg (src, &mode->mode, ®n); - - if (end) - { - int nw, nr; - - src = end; - if (*src == '(') - { - src++; - end = parse_reg (src, &nw, &nr); - if (end) - { - /* Got Ra(Rb). */ - src = end; - - if (*src != ')') - as_bad (_("Missing ) in ra(rb)")); - else - src++; - - regaddr (mode->mode, "ra(rb) ra"); -#if 0 - regword (mode->mode, "ra(rb) rb"); -#endif - mode->mode = CLASS_BX; - mode->reg = regn; - mode->x_reg = nr; - reg[ARG_RX] = nr; - } - else - { - /* Got Ra(disp). */ - if (*src == '#') - src++; - src = parse_exp (src, &(mode->exp)); - src = checkfor (src, ')'); - mode->mode = CLASS_BA; - mode->reg = regn; - mode->x_reg = 0; - imm_operand = &(mode->exp); - } - } - else - { - mode->reg = regn; - mode->x_reg = 0; - } - } - else - { - /* No initial reg. */ - src = parse_exp (src, &(mode->exp)); - if (*src == '(') - { - src++; - end = parse_reg (src, &(mode->mode), ®n); - regword (mode->mode, "addr(Ra) ra"); - mode->mode = CLASS_X; - mode->reg = regn; - mode->x_reg = 0; - da_operand = &(mode->exp); - src = checkfor (end, ')'); - } - else - { - /* Just an address. */ - mode->mode = CLASS_DA; - mode->reg = 0; - mode->x_reg = 0; - da_operand = &(mode->exp); - } - } - } - *ptr = src; -} - -static char * -get_operands (opcode, op_end, operand) - opcode_entry_type *opcode; - char *op_end; - op_type *operand; -{ - char *ptr = op_end; - char *savptr; - - switch (opcode->noperands) - { - case 0: - operand[0].mode = 0; - operand[1].mode = 0; - break; - - case 1: - ptr++; - if (opcode->arg_info[0] == CLASS_CC) - { - get_cc_operand (&ptr, operand + 0, 0); - } - else if (opcode->arg_info[0] == CLASS_FLAGS) - { - get_flags_operand (&ptr, operand + 0, 0); - } - else if (opcode->arg_info[0] == (CLASS_IMM + (ARG_IMM2))) - { - get_interrupt_operand (&ptr, operand + 0, 0); - } - else - { - get_operand (&ptr, operand + 0, 0); - } - operand[1].mode = 0; - break; - - case 2: - ptr++; - savptr = ptr; - if (opcode->arg_info[0] == CLASS_CC) - { - get_cc_operand (&ptr, operand + 0, 0); - } - else if (opcode->arg_info[0] == CLASS_CTRL) - { - get_ctrl_operand (&ptr, operand + 0, 0); - if (the_ctrl == 0) - { - ptr = savptr; - get_operand (&ptr, operand + 0, 0); - if (ptr == 0) - return NULL; - if (*ptr == ',') - ptr++; - get_ctrl_operand (&ptr, operand + 1, 1); - return ptr; - } - } - else - { - get_operand (&ptr, operand + 0, 0); - } - if (ptr == 0) - return NULL; - if (*ptr == ',') - ptr++; - get_operand (&ptr, operand + 1, 1); - break; - - case 3: - ptr++; - get_operand (&ptr, operand + 0, 0); - if (*ptr == ',') - ptr++; - get_operand (&ptr, operand + 1, 1); - if (*ptr == ',') - ptr++; - get_operand (&ptr, operand + 2, 2); - break; - - case 4: - ptr++; - get_operand (&ptr, operand + 0, 0); - if (*ptr == ',') - ptr++; - get_operand (&ptr, operand + 1, 1); - if (*ptr == ',') - ptr++; - get_operand (&ptr, operand + 2, 2); - if (*ptr == ',') - ptr++; - get_cc_operand (&ptr, operand + 3, 3); - break; - - default: - abort (); - } - - return ptr; -} - -/* Passed a pointer to a list of opcodes which use different - addressing modes. Return the opcode which matches the opcodes - provided. */ - -static opcode_entry_type * -get_specific (opcode, operands) - opcode_entry_type *opcode; - op_type *operands; - -{ - opcode_entry_type *this_try = opcode; - int found = 0; - unsigned int noperands = opcode->noperands; - - int this_index = opcode->idx; - - while (this_index == opcode->idx && !found) - { - unsigned int i; - - this_try = opcode++; - for (i = 0; i < noperands; i++) - { - unsigned int mode = operands[i].mode; - - if ((mode & CLASS_MASK) != (this_try->arg_info[i] & CLASS_MASK)) - { - /* It could be an pc rel operand, if this is a da mode - and we like disps, then insert it. */ - - if (mode == CLASS_DA && this_try->arg_info[i] == CLASS_DISP) - { - /* This is the case. */ - operands[i].mode = CLASS_DISP; - } - else if (mode == CLASS_BA && this_try->arg_info[i]) - { - /* Can't think of a way to turn what we've been - given into something that's OK. */ - goto fail; - } - else if (this_try->arg_info[i] & CLASS_PR) - { - if (mode == CLASS_REG_LONG && segmented_mode) - { - /* OK. */ - } - else if (mode == CLASS_REG_WORD && !segmented_mode) - { - /* OK. */ - } - else - goto fail; - } - else - goto fail; - } - switch (mode & CLASS_MASK) - { - default: - break; - case CLASS_X: - case CLASS_IR: - case CLASS_BA: - case CLASS_BX: - case CLASS_DISP: - case CLASS_REG: - case CLASS_REG_WORD: - case CLASS_REG_BYTE: - case CLASS_REG_QUAD: - case CLASS_REG_LONG: - case CLASS_REGN0: - reg[this_try->arg_info[i] & ARG_MASK] = operands[i].reg; - break; - } - } - - found = 1; - fail: - ; - } - if (found) - return this_try; - else - return 0; -} - -#if 0 /* Not used. */ -static void -check_operand (operand, width, string) - struct z8k_op *operand; - unsigned int width; - char *string; -{ - if (operand->exp.X_add_symbol == 0 - && operand->exp.X_op_symbol == 0) - { - - /* No symbol involved, let's look at offset, it's dangerous if - any of the high bits are not 0 or ff's, find out by oring or - anding with the width and seeing if the answer is 0 or all - fs. */ - if ((operand->exp.X_add_number & ~width) != 0 && - (operand->exp.X_add_number | width) != (~0)) - { - as_warn (_("operand %s0x%x out of range."), - string, operand->exp.X_add_number); - } - } - -} -#endif - -static char buffer[20]; - -static void -newfix (ptr, type, operand) - int ptr; - int type; - expressionS *operand; -{ - if (operand->X_add_symbol - || operand->X_op_symbol - || operand->X_add_number) - { - fix_new_exp (frag_now, - ptr, - 1, - operand, - 0, - type); - } -} - -static char * -apply_fix (ptr, type, operand, size) - char *ptr; - int type; - expressionS *operand; - int size; -{ - int n = operand->X_add_number; - - newfix ((ptr - buffer) / 2, type, operand); - switch (size) - { - case 8: /* 8 nibbles == 32 bits. */ - *ptr++ = n >> 28; - *ptr++ = n >> 24; - *ptr++ = n >> 20; - *ptr++ = n >> 16; - case 4: /* 4 nibbles == 16 bits. */ - *ptr++ = n >> 12; - *ptr++ = n >> 8; - case 2: - *ptr++ = n >> 4; - case 1: - *ptr++ = n >> 0; - break; - } - return ptr; -} - -/* Now we know what sort of opcodes it is. Let's build the bytes. */ - -#define INSERT(x,y) *x++ = y>>24; *x++ = y>> 16; *x++=y>>8; *x++ =y; - -static void -build_bytes (this_try, operand) - opcode_entry_type *this_try; - struct z8k_op *operand ATTRIBUTE_UNUSED; -{ - char *output_ptr = buffer; - int c; - int nib; - int nibble; - unsigned int *class_ptr; - - frag_wane (frag_now); - frag_new (0); - - memset (buffer, 20, 0); - class_ptr = this_try->byte_info; - - for (nibble = 0; (c = *class_ptr++); nibble++) - { - - switch (c & CLASS_MASK) - { - default: - abort (); - - case CLASS_ADDRESS: - /* Direct address, we don't cope with the SS mode right now. */ - if (segmented_mode) - { - /* da_operand->X_add_number |= 0x80000000; -- Now set at relocation time. */ - output_ptr = apply_fix (output_ptr, R_IMM32, da_operand, 8); - } - else - { - output_ptr = apply_fix (output_ptr, R_IMM16, da_operand, 4); - } - da_operand = 0; - break; - case CLASS_DISP8: - /* pc rel 8 bit */ - output_ptr = apply_fix (output_ptr, R_JR, da_operand, 2); - da_operand = 0; - break; - - case CLASS_0DISP7: - /* pc rel 7 bit */ - *output_ptr = 0; - output_ptr = apply_fix (output_ptr, R_DISP7, da_operand, 2); - da_operand = 0; - break; - - case CLASS_1DISP7: - /* pc rel 7 bit */ - *output_ptr = 0x80; - output_ptr = apply_fix (output_ptr, R_DISP7, da_operand, 2); - output_ptr[-2] = 0x8; - da_operand = 0; - break; - - case CLASS_BIT_1OR2: - *output_ptr = c & 0xf; - if (imm_operand) - { - if (imm_operand->X_add_number == 2) - *output_ptr |= 2; - else if (imm_operand->X_add_number != 1) - as_bad (_("immediate must be 1 or 2")); - } - else - as_bad (_("immediate 1 or 2 expected")); - output_ptr++; - break; - case CLASS_CC: - *output_ptr++ = the_cc; - break; - case CLASS_0CCC: - *output_ptr++ = the_ctrl; - break; - case CLASS_1CCC: - *output_ptr++ = the_ctrl | 0x8; - break; - case CLASS_00II: - *output_ptr++ = (~the_interrupt & 0x3); - break; - case CLASS_01II: - *output_ptr++ = (~the_interrupt & 0x3) | 0x4; - break; - case CLASS_FLAGS: - *output_ptr++ = the_flags; - break; - case CLASS_BIT: - *output_ptr++ = c & 0xf; - break; - case CLASS_REGN0: - if (reg[c & 0xf] == 0) - as_bad (_("can't use R0 here")); - /* Fall through. */ - case CLASS_REG: - case CLASS_REG_BYTE: - case CLASS_REG_WORD: - case CLASS_REG_LONG: - case CLASS_REG_QUAD: - /* Insert bit mattern of right reg. */ - *output_ptr++ = reg[c & 0xf]; - break; - case CLASS_DISP: - switch (c & ARG_MASK) - { - case ARG_DISP12: - output_ptr = apply_fix (output_ptr, R_CALLR, da_operand, 4); - break; - case ARG_DISP16: - output_ptr = apply_fix (output_ptr, R_REL16, da_operand, 4); - break; - default: - output_ptr = apply_fix (output_ptr, R_IMM16, da_operand, 4); - } - da_operand = 0; - break; - - case CLASS_IMM: - { - nib = 0; - switch (c & ARG_MASK) - { - case ARG_IMM4: - output_ptr = apply_fix (output_ptr, R_IMM4L, imm_operand, 1); - break; - case ARG_IMM4M1: - imm_operand->X_add_number--; - output_ptr = apply_fix (output_ptr, R_IMM4L, imm_operand, 1); - break; - case ARG_IMMNMINUS1: - imm_operand->X_add_number--; - output_ptr = apply_fix (output_ptr, R_IMM4L, imm_operand, 1); - break; - case ARG_NIM8: - imm_operand->X_add_number = -imm_operand->X_add_number; - case ARG_IMM8: - output_ptr = apply_fix (output_ptr, R_IMM8, imm_operand, 2); - break; - case ARG_IMM16: - output_ptr = apply_fix (output_ptr, R_IMM16, imm_operand, 4); - break; - - case ARG_IMM32: - output_ptr = apply_fix (output_ptr, R_IMM32, imm_operand, 8); - break; - - default: - abort (); - } - } - } - } - - /* Copy from the nibble buffer into the frag. */ - { - int length = (output_ptr - buffer) / 2; - char *src = buffer; - char *fragp = frag_more (length); - - while (src < output_ptr) - { - *fragp = (src[0] << 4) | src[1]; - src += 2; - fragp++; - } - } -} - -/* This is the guts of the machine-dependent assembler. STR points to a - machine dependent instruction. This function is supposed to emit - the frags/bytes it assembles to. */ - -void -md_assemble (str) - char *str; -{ - char c; - char *op_start; - char *op_end; - struct z8k_op operand[3]; - opcode_entry_type *opcode; - opcode_entry_type *prev_opcode; - - /* Drop leading whitespace. */ - while (*str == ' ') - str++; - - /* Find the op code end. */ - for (op_start = op_end = str; - *op_end != 0 && *op_end != ' '; - op_end++) - ; - - if (op_end == op_start) - { - as_bad (_("can't find opcode ")); - } - c = *op_end; - - *op_end = 0; - - opcode = (opcode_entry_type *) hash_find (opcode_hash_control, op_start); - - if (opcode == NULL) - { - as_bad (_("unknown opcode")); - return; - } - - if (opcode->opcode == 250) - { - /* Was really a pseudo op. */ - - pseudo_typeS *p; - char oc; - - char *old = input_line_pointer; - *op_end = c; - - input_line_pointer = op_end; - - oc = *old; - *old = '\n'; - while (*input_line_pointer == ' ') - input_line_pointer++; - p = (pseudo_typeS *) (opcode->func); - - (p->poc_handler) (p->poc_val); - input_line_pointer = old; - *old = oc; - } - else - { - input_line_pointer = get_operands (opcode, op_end, operand); - prev_opcode = opcode; - - opcode = get_specific (opcode, operand); - - if (opcode == 0) - { - /* Couldn't find an opcode which matched the operands. */ - char *where = frag_more (2); - - where[0] = 0x0; - where[1] = 0x0; - - as_bad (_("Can't find opcode to match operands")); - return; - } - - build_bytes (opcode, operand); - } -} - -void -tc_crawl_symbol_chain (headers) - object_headers *headers ATTRIBUTE_UNUSED; -{ - printf (_("call to tc_crawl_symbol_chain \n")); -} - -symbolS * -md_undefined_symbol (name) - char *name ATTRIBUTE_UNUSED; -{ - return 0; -} - -void -tc_headers_hook (headers) - object_headers *headers ATTRIBUTE_UNUSED; -{ - printf (_("call to tc_headers_hook \n")); -} - -/* Various routines to kill one day. */ -/* Equal to MAX_PRECISION in atof-ieee.c. */ -#define MAX_LITTLENUMS 6 - -/* Turn a string in input_line_pointer into a floating point constant - of type TYPE, and store the appropriate bytes in *LITP. The number - of LITTLENUMS emitted is stored in *SIZEP. An error message is - returned, or NULL on OK. */ - -char * -md_atof (type, litP, sizeP) - char type; - char *litP; - int *sizeP; -{ - int prec; - LITTLENUM_TYPE words[MAX_LITTLENUMS]; - LITTLENUM_TYPE *wordP; - char *t; - char *atof_ieee (); - - switch (type) - { - case 'f': - case 'F': - case 's': - case 'S': - prec = 2; - break; - - case 'd': - case 'D': - case 'r': - case 'R': - prec = 4; - break; - - case 'x': - case 'X': - prec = 6; - break; - - case 'p': - case 'P': - prec = 6; - break; - - default: - *sizeP = 0; - return _("Bad call to MD_ATOF()"); - } - t = atof_ieee (input_line_pointer, type, words); - if (t) - input_line_pointer = t; - - *sizeP = prec * sizeof (LITTLENUM_TYPE); - for (wordP = words; prec--;) - { - md_number_to_chars (litP, (long) (*wordP++), sizeof (LITTLENUM_TYPE)); - litP += sizeof (LITTLENUM_TYPE); - } - return 0; -} - -CONST char *md_shortopts = "z:"; - -struct option md_longopts[] = { - {NULL, no_argument, NULL, 0} -}; - -size_t md_longopts_size = sizeof (md_longopts); - -int -md_parse_option (c, arg) - int c; - char *arg; -{ - switch (c) - { - case 'z': - if (!strcmp (arg, "8001")) - s_segm (); - else if (!strcmp (arg, "8002")) - s_unseg (); - else - { - as_bad (_("invalid architecture -z%s"), arg); - return 0; - } - break; - - default: - return 0; - } - - return 1; -} - -void -md_show_usage (stream) - FILE *stream; -{ - fprintf (stream, _("\ -Z8K options:\n\ --z8001 generate segmented code\n\ --z8002 generate unsegmented code\n")); -} - -void -tc_aout_fix_to_chars () -{ - printf (_("call to tc_aout_fix_to_chars \n")); - abort (); -} - -void -md_convert_frag (headers, seg, fragP) - object_headers *headers ATTRIBUTE_UNUSED; - segT seg ATTRIBUTE_UNUSED; - fragS *fragP ATTRIBUTE_UNUSED; -{ - printf (_("call to md_convert_frag \n")); - abort (); -} - -valueT -md_section_align (seg, size) - segT seg; - valueT size; -{ - return ((size + (1 << section_alignment[(int) seg]) - 1) - & (-1 << section_alignment[(int) seg])); - -} - -void -md_apply_fix3 (fixP, valP, segment) - fixS *fixP; - valueT * valP; - segT segment ATTRIBUTE_UNUSED; -{ - long val = * (long *) valP; - char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; - - switch (fixP->fx_r_type) - { - case R_IMM4L: - buf[0] = (buf[0] & 0xf0) | ((buf[0] + val) & 0xf); - break; - - case R_JR: - - *buf++ = val; -#if 0 - if (val != 0) - abort (); -#endif - break; - - case R_DISP7: - - *buf++ += val; -#if 0 - if (val != 0) - abort (); -#endif - break; - - case R_IMM8: - buf[0] += val; - break; - case R_IMM16: - *buf++ = (val >> 8); - *buf++ = val; - break; - case R_IMM32: - *buf++ = (val >> 24); - *buf++ = (val >> 16); - *buf++ = (val >> 8); - *buf++ = val; - break; -#if 0 - case R_DA | R_SEG: - *buf++ = (val >> 16); - *buf++ = 0x00; - *buf++ = (val >> 8); - *buf++ = val; - break; -#endif - - case 0: - md_number_to_chars (buf, val, fixP->fx_size); - break; - - default: - abort (); - } - - if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) - fixP->fx_done = 1; -} - -int -md_estimate_size_before_relax (fragP, segment_type) - register fragS *fragP ATTRIBUTE_UNUSED; - register segT segment_type ATTRIBUTE_UNUSED; -{ - printf (_("call tomd_estimate_size_before_relax \n")); - abort (); -} - -/* Put number into target byte order. */ - -void -md_number_to_chars (ptr, use, nbytes) - char *ptr; - valueT use; - int nbytes; -{ - number_to_chars_bigendian (ptr, use, nbytes); -} - -long -md_pcrel_from (fixP) - fixS *fixP ATTRIBUTE_UNUSED; -{ - abort (); -} - -void -tc_coff_symbol_emit_hook (s) - symbolS *s ATTRIBUTE_UNUSED; -{ -} - -void -tc_reloc_mangle (fix_ptr, intr, base) - fixS *fix_ptr; - struct internal_reloc *intr; - bfd_vma base; - -{ - symbolS *symbol_ptr; - - if (fix_ptr->fx_addsy - && fix_ptr->fx_subsy) - { - symbolS *add = fix_ptr->fx_addsy; - symbolS *sub = fix_ptr->fx_subsy; - - if (S_GET_SEGMENT (add) != S_GET_SEGMENT (sub)) - as_bad (_("Can't subtract symbols in different sections %s %s"), - S_GET_NAME (add), S_GET_NAME (sub)); - else - { - int diff = S_GET_VALUE (add) - S_GET_VALUE (sub); - - fix_ptr->fx_addsy = 0; - fix_ptr->fx_subsy = 0; - fix_ptr->fx_offset += diff; - } - } - symbol_ptr = fix_ptr->fx_addsy; - - /* If this relocation is attached to a symbol then it's ok - to output it. */ - if (fix_ptr->fx_r_type == 0) - { - /* cons likes to create reloc32's whatever the size of the reloc. */ - switch (fix_ptr->fx_size) - { - case 2: - intr->r_type = R_IMM16; - break; - case 1: - intr->r_type = R_IMM8; - break; - case 4: - intr->r_type = R_IMM32; - break; - default: - abort (); - } - } - else - intr->r_type = fix_ptr->fx_r_type; - - intr->r_vaddr = fix_ptr->fx_frag->fr_address + fix_ptr->fx_where + base; - intr->r_offset = fix_ptr->fx_offset; - - if (symbol_ptr) - intr->r_symndx = symbol_ptr->sy_number; - else - intr->r_symndx = -1; -} diff --git a/contrib/binutils/gas/config/tc-z8k.h b/contrib/binutils/gas/config/tc-z8k.h deleted file mode 100644 index d1899e1564fd..000000000000 --- a/contrib/binutils/gas/config/tc-z8k.h +++ /dev/null @@ -1,53 +0,0 @@ -/* This file is tc-z8k.h - Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1997, 1998, - 2000 - Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - -#define TC_Z8K -#define TARGET_BYTES_BIG_ENDIAN 1 - -#if ANSI_PROTOTYPES -struct internal_reloc; -#endif - -#define WORKING_DOT_WORD - -#ifndef BFD_ASSEMBLER -#define LOCAL_LABEL(x) 0 -#endif - -/* This macro translates between an internal fix and an coff reloc type */ -#define TC_COFF_FIX2RTYPE(fixP) abort (); - -#define BFD_ARCH bfd_arch_z8k -#define COFF_MAGIC 0x8000 -#define TC_COUNT_RELOC(x) (1) -#define IGNORE_NONSTANDARD_ESCAPES - -#define TC_RELOC_MANGLE(s,a,b,c) tc_reloc_mangle(a,b,c) -extern void tc_reloc_mangle - PARAMS ((struct fix *, struct internal_reloc *, bfd_vma)); - -#define DO_NOT_STRIP 0 -#define LISTING_HEADER "Zilog Z8000 GAS " -#define NEED_FX_R_TYPE 1 -#define RELOC_32 1234 - -#define md_operand(x) diff --git a/contrib/binutils/gas/config/te-multi.h b/contrib/binutils/gas/config/te-multi.h deleted file mode 100644 index b8eda4505fb7..000000000000 --- a/contrib/binutils/gas/config/te-multi.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This file is te-generic.h and is intended to be a template for - * target environment specific header files. - * - * It is my intent that this file will evolve into a file suitable for config, - * compile, and copying as an aid for testing and porting. xoxorich. - */ - -/* Added these, because if we don't know what we're targetting we may - need an assembler version of libgcc, and that will use local - labels. */ -#define LOCAL_LABELS_DOLLAR 1 -#define LOCAL_LABELS_FB 1 - -/* these define interfaces */ -#ifdef OBJ_HEADER -#include OBJ_HEADER -#else -#include "obj-format.h" -#endif - -/* end of te-generic.h */ diff --git a/contrib/binutils/gas/doc/c-sh.texi b/contrib/binutils/gas/doc/c-sh.texi deleted file mode 100644 index df3184486d6f..000000000000 --- a/contrib/binutils/gas/doc/c-sh.texi +++ /dev/null @@ -1,297 +0,0 @@ -@c Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2001 -@c Free Software Foundation, Inc. -@c This is part of the GAS manual. -@c For copying conditions, see the file as.texinfo. -@page -@node SH-Dependent -@chapter Hitachi SH Dependent Features - -@cindex SH support -@menu -* SH Options:: Options -* SH Syntax:: Syntax -* SH Floating Point:: Floating Point -* SH Directives:: SH Machine Directives -* SH Opcodes:: Opcodes -@end menu - -@node SH Options -@section Options - -@cindex SH options -@cindex options, SH -@code{@value{AS}} has following command-line options for the Hitachi -SH family. - -@table @code -@kindex -little -@kindex -big -@kindex -relax -@kindex -small -@kindex -dsp - -@item -little -Generate little endian code. - -@item -big -Generate big endian code. - -@item -relax -Alter jump instructions for long displacements. - -@item -small -Align sections to 4 byte boundaries, not 16. - -@item -dsp -Enable sh-dsp insns, and disable sh3e / sh4 insns. - -@end table - -@node SH Syntax -@section Syntax - -@menu -* SH-Chars:: Special Characters -* SH-Regs:: Register Names -* SH-Addressing:: Addressing Modes -@end menu - -@node SH-Chars -@subsection Special Characters - -@cindex line comment character, SH -@cindex SH line comment character -@samp{!} is the line comment character. - -@cindex line separator, SH -@cindex statement separator, SH -@cindex SH line separator -You can use @samp{;} instead of a newline to separate statements. - -@cindex symbol names, @samp{$} in -@cindex @code{$} in symbol names -Since @samp{$} has no special meaning, you may use it in symbol names. - -@node SH-Regs -@subsection Register Names - -@cindex SH registers -@cindex registers, SH -You can use the predefined symbols @samp{r0}, @samp{r1}, @samp{r2}, -@samp{r3}, @samp{r4}, @samp{r5}, @samp{r6}, @samp{r7}, @samp{r8}, -@samp{r9}, @samp{r10}, @samp{r11}, @samp{r12}, @samp{r13}, @samp{r14}, -and @samp{r15} to refer to the SH registers. - -The SH also has these control registers: - -@table @code -@item pr -procedure register (holds return address) - -@item pc -program counter - -@item mach -@itemx macl -high and low multiply accumulator registers - -@item sr -status register - -@item gbr -global base register - -@item vbr -vector base register (for interrupt vectors) -@end table - -@node SH-Addressing -@subsection Addressing Modes - -@cindex addressing modes, SH -@cindex SH addressing modes -@code{@value{AS}} understands the following addressing modes for the SH. -@code{R@var{n}} in the following refers to any of the numbered -registers, but @emph{not} the control registers. - -@table @code -@item R@var{n} -Register direct - -@item @@R@var{n} -Register indirect - -@item @@-R@var{n} -Register indirect with pre-decrement - -@item @@R@var{n}+ -Register indirect with post-increment - -@item @@(@var{disp}, R@var{n}) -Register indirect with displacement - -@item @@(R0, R@var{n}) -Register indexed - -@item @@(@var{disp}, GBR) -@code{GBR} offset - -@item @@(R0, GBR) -GBR indexed - -@item @var{addr} -@itemx @@(@var{disp}, PC) -PC relative address (for branch or for addressing memory). The -@code{@value{AS}} implementation allows you to use the simpler form -@var{addr} anywhere a PC relative address is called for; the alternate -form is supported for compatibility with other assemblers. - -@item #@var{imm} -Immediate data -@end table - -@node SH Floating Point -@section Floating Point - -@cindex floating point, SH (@sc{ieee}) -@cindex SH floating point (@sc{ieee}) -The SH family has no hardware floating point, but the @code{.float} -directive generates @sc{ieee} floating-point numbers for compatibility -with other development tools. - -@node SH Directives -@section SH Machine Directives - -@cindex SH machine directives -@cindex machine directives, SH -@cindex @code{uaword} directive, SH -@cindex @code{ualong} directive, SH - -@table @code -@item uaword -@itemx ualong -@code{@value{AS}} will issue a warning when a misaligned @code{.word} or -@code{.long} directive is used. You may use @code{.uaword} or -@code{.ualong} to indicate that the value is intentionally misaligned. -@end table - -@node SH Opcodes -@section Opcodes - -@cindex SH opcode summary -@cindex opcode summary, SH -@cindex mnemonics, SH -@cindex instruction summary, SH -For detailed information on the SH machine instruction set, see -@cite{SH-Microcomputer User's Manual} (Hitachi Micro Systems, Inc.). - -@code{@value{AS}} implements all the standard SH opcodes. No additional -pseudo-instructions are needed on this family. Note, however, that -because @code{@value{AS}} supports a simpler form of PC-relative -addressing, you may simply write (for example) - -@example -mov.l bar,r0 -@end example - -@noindent -where other assemblers might require an explicit displacement to -@code{bar} from the program counter: - -@example -mov.l @@(@var{disp}, PC) -@end example - -@ifset SMALL -@c this table, due to the multi-col faking and hardcoded order, looks silly -@c except in smallbook. See comments below "@set SMALL" near top of this file. - -Here is a summary of SH opcodes: - -@page -@smallexample -@i{Legend:} -Rn @r{a numbered register} -Rm @r{another numbered register} -#imm @r{immediate data} -disp @r{displacement} -disp8 @r{8-bit displacement} -disp12 @r{12-bit displacement} - -add #imm,Rn lds.l @@Rn+,PR -add Rm,Rn mac.w @@Rm+,@@Rn+ -addc Rm,Rn mov #imm,Rn -addv Rm,Rn mov Rm,Rn -and #imm,R0 mov.b Rm,@@(R0,Rn) -and Rm,Rn mov.b Rm,@@-Rn -and.b #imm,@@(R0,GBR) mov.b Rm,@@Rn -bf disp8 mov.b @@(disp,Rm),R0 -bra disp12 mov.b @@(disp,GBR),R0 -bsr disp12 mov.b @@(R0,Rm),Rn -bt disp8 mov.b @@Rm+,Rn -clrmac mov.b @@Rm,Rn -clrt mov.b R0,@@(disp,Rm) -cmp/eq #imm,R0 mov.b R0,@@(disp,GBR) -cmp/eq Rm,Rn mov.l Rm,@@(disp,Rn) -cmp/ge Rm,Rn mov.l Rm,@@(R0,Rn) -cmp/gt Rm,Rn mov.l Rm,@@-Rn -cmp/hi Rm,Rn mov.l Rm,@@Rn -cmp/hs Rm,Rn mov.l @@(disp,Rn),Rm -cmp/pl Rn mov.l @@(disp,GBR),R0 -cmp/pz Rn mov.l @@(disp,PC),Rn -cmp/str Rm,Rn mov.l @@(R0,Rm),Rn -div0s Rm,Rn mov.l @@Rm+,Rn -div0u mov.l @@Rm,Rn -div1 Rm,Rn mov.l R0,@@(disp,GBR) -exts.b Rm,Rn mov.w Rm,@@(R0,Rn) -exts.w Rm,Rn mov.w Rm,@@-Rn -extu.b Rm,Rn mov.w Rm,@@Rn -extu.w Rm,Rn mov.w @@(disp,Rm),R0 -jmp @@Rn mov.w @@(disp,GBR),R0 -jsr @@Rn mov.w @@(disp,PC),Rn -ldc Rn,GBR mov.w @@(R0,Rm),Rn -ldc Rn,SR mov.w @@Rm+,Rn -ldc Rn,VBR mov.w @@Rm,Rn -ldc.l @@Rn+,GBR mov.w R0,@@(disp,Rm) -ldc.l @@Rn+,SR mov.w R0,@@(disp,GBR) -ldc.l @@Rn+,VBR mova @@(disp,PC),R0 -lds Rn,MACH movt Rn -lds Rn,MACL muls Rm,Rn -lds Rn,PR mulu Rm,Rn -lds.l @@Rn+,MACH neg Rm,Rn -lds.l @@Rn+,MACL negc Rm,Rn -@page -nop stc VBR,Rn -not Rm,Rn stc.l GBR,@@-Rn -or #imm,R0 stc.l SR,@@-Rn -or Rm,Rn stc.l VBR,@@-Rn -or.b #imm,@@(R0,GBR) sts MACH,Rn -rotcl Rn sts MACL,Rn -rotcr Rn sts PR,Rn -rotl Rn sts.l MACH,@@-Rn -rotr Rn sts.l MACL,@@-Rn -rte sts.l PR,@@-Rn -rts sub Rm,Rn -sett subc Rm,Rn -shal Rn subv Rm,Rn -shar Rn swap.b Rm,Rn -shll Rn swap.w Rm,Rn -shll16 Rn tas.b @@Rn -shll2 Rn trapa #imm -shll8 Rn tst #imm,R0 -shlr Rn tst Rm,Rn -shlr16 Rn tst.b #imm,@@(R0,GBR) -shlr2 Rn xor #imm,R0 -shlr8 Rn xor Rm,Rn -sleep xor.b #imm,@@(R0,GBR) -stc GBR,Rn xtrct Rm,Rn -stc SR,Rn -@end smallexample -@end ifset - -@ifset Hitachi-all -@ifclear GENERIC -@raisesections -@end ifclear -@end ifset - diff --git a/contrib/binutils/gas/doc/c-v850.texi b/contrib/binutils/gas/doc/c-v850.texi deleted file mode 100644 index 4b36461ee52b..000000000000 --- a/contrib/binutils/gas/doc/c-v850.texi +++ /dev/null @@ -1,363 +0,0 @@ -@c Copyright 1997 Free Software Foundation, Inc. -@c This is part of the GAS manual. -@c For copying conditions, see the file as.texinfo. - -@node V850-Dependent -@chapter v850 Dependent Features - -@cindex V850 support -@menu -* V850 Options:: Options -* V850 Syntax:: Syntax -* V850 Floating Point:: Floating Point -* V850 Directives:: V850 Machine Directives -* V850 Opcodes:: Opcodes -@end menu - -@node V850 Options -@section Options -@cindex V850 options (none) -@cindex options for V850 (none) -@code{@value{AS}} supports the following additional command-line options -for the V850 processor family: - -@cindex command line options, V850 -@cindex V850 command line options -@table @code - -@cindex @code{-wsigned_overflow} command line option, V850 -@item -wsigned_overflow -Causes warnings to be produced when signed immediate values overflow the -space available for then within their opcodes. By default this option -is disabled as it is possible to receive spurious warnings due to using -exact bit patterns as immediate constants. - -@cindex @code{-wunsigned_overflow} command line option, V850 -@item -wunsigned_overflow -Causes warnings to be produced when unsigned immediate values overflow -the space available for then within their opcodes. By default this -option is disabled as it is possible to receive spurious warnings due to -using exact bit patterns as immediate constants. - -@cindex @code{-mv850} command line option, V850 -@item -mv850 -Specifies that the assembled code should be marked as being targeted at -the V850 processor. This allows the linker to detect attempts to link -such code with code assembled for other processors. - -@cindex @code{-mv850e} command line option, V850 -@item -mv850e -Specifies that the assembled code should be marked as being targeted at -the V850E processor. This allows the linker to detect attempts to link -such code with code assembled for other processors. - -@cindex @code{-mv850any} command line option, V850 -@item -mv850any -Specifies that the assembled code should be marked as being targeted at -the V850 processor but support instructions that are specific to the -extended variants of the process. This allows the production of -binaries that contain target specific code, but which are also intended -to be used in a generic fashion. For example libgcc.a contains generic -routines used by the code produced by GCC for all versions of the v850 -architecture, together with support routines only used by the V850E -architecture. - -@end table - - -@node V850 Syntax -@section Syntax -@menu -* V850-Chars:: Special Characters -* V850-Regs:: Register Names -@end menu - -@node V850-Chars -@subsection Special Characters - -@cindex line comment character, V850 -@cindex V850 line comment character -@samp{#} is the line comment character. -@node V850-Regs -@subsection Register Names - -@cindex V850 register names -@cindex register names, V850 -@code{@value{AS}} supports the following names for registers: -@table @code -@cindex @code{zero} register, V850 -@item general register 0 -r0, zero -@item general register 1 -r1 -@item general register 2 -r2, hp -@cindex @code{sp} register, V850 -@item general register 3 -r3, sp -@cindex @code{gp} register, V850 -@item general register 4 -r4, gp -@cindex @code{tp} register, V850 -@item general register 5 -r5, tp -@item general register 6 -r6 -@item general register 7 -r7 -@item general register 8 -r8 -@item general register 9 -r9 -@item general register 10 -r10 -@item general register 11 -r11 -@item general register 12 -r12 -@item general register 13 -r13 -@item general register 14 -r14 -@item general register 15 -r15 -@item general register 16 -r16 -@item general register 17 -r17 -@item general register 18 -r18 -@item general register 19 -r19 -@item general register 20 -r20 -@item general register 21 -r21 -@item general register 22 -r22 -@item general register 23 -r23 -@item general register 24 -r24 -@item general register 25 -r25 -@item general register 26 -r26 -@item general register 27 -r27 -@item general register 28 -r28 -@item general register 29 -r29 -@cindex @code{ep} register, V850 -@item general register 30 -r30, ep -@cindex @code{lp} register, V850 -@item general register 31 -r31, lp -@cindex @code{eipc} register, V850 -@item system register 0 -eipc -@cindex @code{eipsw} register, V850 -@item system register 1 -eipsw -@cindex @code{fepc} register, V850 -@item system register 2 -fepc -@cindex @code{fepsw} register, V850 -@item system register 3 -fepsw -@cindex @code{ecr} register, V850 -@item system register 4 -ecr -@cindex @code{psw} register, V850 -@item system register 5 -psw -@cindex @code{ctpc} register, V850 -@item system register 16 -ctpc -@cindex @code{ctpsw} register, V850 -@item system register 17 -ctpsw -@cindex @code{dbpc} register, V850 -@item system register 18 -dbpc -@cindex @code{dbpsw} register, V850 -@item system register 19 -dbpsw -@cindex @code{ctbp} register, V850 -@item system register 20 -ctbp -@end table - -@node V850 Floating Point -@section Floating Point - -@cindex floating point, V850 (@sc{ieee}) -@cindex V850 floating point (@sc{ieee}) -The V850 family uses @sc{ieee} floating-point numbers. - -@node V850 Directives -@section V850 Machine Directives - -@cindex machine directives, V850 -@cindex V850 machine directives -@table @code -@cindex @code{offset} directive, V850 -@item .offset @var{<expression>} -Moves the offset into the current section to the specified amount. - -@cindex @code{section} directive, V850 -@item .section "name", <type> -This is an extension to the standard .section directive. It sets the -current section to be <type> and creates an alias for this section -called "name". - -@cindex @code{.v850} directive, V850 -@item .v850 -Specifies that the assembled code should be marked as being targeted at -the V850 processor. This allows the linker to detect attempts to link -such code with code assembled for other processors. - -@cindex @code{.v850e} directive, V850 -@item .v850e -Specifies that the assembled code should be marked as being targeted at -the V850E processor. This allows the linker to detect attempts to link -such code with code assembled for other processors. - -@end table - -@node V850 Opcodes -@section Opcodes - -@cindex V850 opcodes -@cindex opcodes for V850 -@code{@value{AS}} implements all the standard V850 opcodes. - -@code{@value{AS}} also implements the following pseudo ops: - -@table @code - -@cindex @code{hi0} pseudo-op, V850 -@item hi0() -Computes the higher 16 bits of the given expression and stores it into -the immediate operand field of the given instruction. For example: - - @samp{mulhi hi0(here - there), r5, r6} - -computes the difference between the address of labels 'here' and -'there', takes the upper 16 bits of this difference, shifts it down 16 -bits and then mutliplies it by the lower 16 bits in register 5, putting -the result into register 6. - -@cindex @code{lo} pseudo-op, V850 -@item lo() -Computes the lower 16 bits of the given expression and stores it into -the immediate operand field of the given instruction. For example: - - @samp{addi lo(here - there), r5, r6} - -computes the difference between the address of labels 'here' and -'there', takes the lower 16 bits of this difference and adds it to -register 5, putting the result into register 6. - -@cindex @code{hi} pseudo-op, V850 -@item hi() -Computes the higher 16 bits of the given expression and then adds the -value of the most significant bit of the lower 16 bits of the expression -and stores the result into the immediate operand field of the given -instruction. For example the following code can be used to compute the -address of the label 'here' and store it into register 6: - - @samp{movhi hi(here), r0, r6} - @samp{movea lo(here), r6, r6} - -The reason for this special behaviour is that movea performs a sign -extention on its immediate operand. So for example if the address of -'here' was 0xFFFFFFFF then without the special behaviour of the hi() -pseudo-op the movhi instruction would put 0xFFFF0000 into r6, then the -movea instruction would takes its immediate operand, 0xFFFF, sign extend -it to 32 bits, 0xFFFFFFFF, and then add it into r6 giving 0xFFFEFFFF -which is wrong (the fifth nibble is E). With the hi() pseudo op adding -in the top bit of the lo() pseudo op, the movhi instruction actually -stores 0 into r6 (0xFFFF + 1 = 0x0000), so that the movea instruction -stores 0xFFFFFFFF into r6 - the right value. - -@cindex @code{hilo} pseudo-op, V850 -@item hilo() -Computes the 32 bit value of the given expression and stores it into -the immediate operand field of the given instruction (which must be a -mov instruction). For example: - - @samp{mov hilo(here), r6} - -computes the absolute address of label 'here' and puts the result into -register 6. - -@cindex @code{sdaoff} pseudo-op, V850 -@item sdaoff() -Computes the offset of the named variable from the start of the Small -Data Area (whoes address is held in register 4, the GP register) and -stores the result as a 16 bit signed value in the immediate operand -field of the given instruction. For example: - - @samp{ld.w sdaoff(_a_variable)[gp],r6} - -loads the contents of the location pointed to by the label '_a_variable' -into register 6, provided that the label is located somewhere within +/- -32K of the address held in the GP register. [Note the linker assumes -that the GP register contains a fixed address set to the address of the -label called '__gp'. This can either be set up automatically by the -linker, or specifically set by using the @samp{--defsym __gp=<value>} -command line option]. - -@cindex @code{tdaoff} pseudo-op, V850 -@item tdaoff() -Computes the offset of the named variable from the start of the Tiny -Data Area (whoes address is held in register 30, the EP register) and -stores the result as a 4,5, 7 or 8 bit unsigned value in the immediate -operand field of the given instruction. For example: - - @samp{sld.w tdaoff(_a_variable)[ep],r6} - -loads the contents of the location pointed to by the label '_a_variable' -into register 6, provided that the label is located somewhere within +256 -bytes of the address held in the EP register. [Note the linker assumes -that the EP register contains a fixed address set to the address of the -label called '__ep'. This can either be set up automatically by the -linker, or specifically set by using the @samp{--defsym __ep=<value>} -command line option]. - -@cindex @code{zdaoff} pseudo-op, V850 -@item zdaoff() -Computes the offset of the named variable from address 0 and stores the -result as a 16 bit signed value in the immediate operand field of the -given instruction. For example: - - @samp{movea zdaoff(_a_variable),zero,r6} - -puts the address of the label '_a_variable' into register 6, assuming -that the label is somewhere within the first 32K of memory. (Strictly -speaking it also possible to access the last 32K of memory as well, as -the offsets are signed). - -@cindex @code{ctoff} pseudo-op, V850 -@item ctoff() -Computes the offset of the named variable from the start of the Call -Table Area (whoes address is helg in system register 20, the CTBP -register) and stores the result a 6 or 16 bit unsigned value in the -immediate field of then given instruction or piece of data. For -example: - - @samp{callt ctoff(table_func1)} - -will put the call the function whoes address is held in the call table -at the location labeled 'table_func1'. - -@end table - - -For information on the V850 instruction set, see @cite{V850 -Family 32-/16-Bit single-Chip Microcontroller Architecture Manual} from NEC. -Ltd. - diff --git a/contrib/binutils/gas/doc/c-z8k.texi b/contrib/binutils/gas/doc/c-z8k.texi deleted file mode 100644 index d98adeaf04aa..000000000000 --- a/contrib/binutils/gas/doc/c-z8k.texi +++ /dev/null @@ -1,380 +0,0 @@ -@c Copyright 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. -@c This is part of the GAS manual. -@c For copying conditions, see the file as.texinfo. -@ifset GENERIC -@page -@node Z8000-Dependent -@chapter Z8000 Dependent Features -@end ifset -@ifclear GENERIC -@node Machine Dependencies -@chapter Z8000 Dependent Features -@end ifclear - -@cindex Z8000 support -The Z8000 @value{AS} supports both members of the Z8000 family: the -unsegmented Z8002, with 16 bit addresses, and the segmented Z8001 with -24 bit addresses. - -When the assembler is in unsegmented mode (specified with the -@code{unsegm} directive), an address takes up one word (16 bit) -sized register. When the assembler is in segmented mode (specified with -the @code{segm} directive), a 24-bit address takes up a long (32 bit) -register. @xref{Z8000 Directives,,Assembler Directives for the Z8000}, -for a list of other Z8000 specific assembler directives. - -@menu -* Z8000 Options:: No special command-line options for Z8000 -* Z8000 Syntax:: Assembler syntax for the Z8000 -* Z8000 Directives:: Special directives for the Z8000 -* Z8000 Opcodes:: Opcodes -@end menu - -@node Z8000 Options -@section Options - -@cindex Z8000 options -@cindex options, Z8000 -@code{@value{AS}} has no additional command-line options for the Zilog -Z8000 family. - -@node Z8000 Syntax -@section Syntax -@menu -* Z8000-Chars:: Special Characters -* Z8000-Regs:: Register Names -* Z8000-Addressing:: Addressing Modes -@end menu - -@node Z8000-Chars -@subsection Special Characters - -@cindex line comment character, Z8000 -@cindex Z8000 line comment character -@samp{!} is the line comment character. - -@cindex line separator, Z8000 -@cindex statement separator, Z8000 -@cindex Z8000 line separator -You can use @samp{;} instead of a newline to separate statements. - -@node Z8000-Regs -@subsection Register Names - -@cindex Z8000 registers -@cindex registers, Z8000 -The Z8000 has sixteen 16 bit registers, numbered 0 to 15. You can refer -to different sized groups of registers by register number, with the -prefix @samp{r} for 16 bit registers, @samp{rr} for 32 bit registers and -@samp{rq} for 64 bit registers. You can also refer to the contents of -the first eight (of the sixteen 16 bit registers) by bytes. They are -named @samp{r@var{n}h} and @samp{r@var{n}l}. - -@smallexample -@exdent @emph{byte registers} -r0l r0h r1h r1l r2h r2l r3h r3l -r4h r4l r5h r5l r6h r6l r7h r7l - -@exdent @emph{word registers} -r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 - -@exdent @emph{long word registers} -rr0 rr2 rr4 rr6 rr8 rr10 rr12 rr14 - -@exdent @emph{quad word registers} -rq0 rq4 rq8 rq12 -@end smallexample - -@node Z8000-Addressing -@subsection Addressing Modes - -@cindex addressing modes, Z8000 -@cindex Z800 addressing modes -@value{AS} understands the following addressing modes for the Z8000: - -@table @code -@item r@var{n} -Register direct - -@item @@r@var{n} -Indirect register - -@item @var{addr} -Direct: the 16 bit or 24 bit address (depending on whether the assembler -is in segmented or unsegmented mode) of the operand is in the instruction. - -@item address(r@var{n}) -Indexed: the 16 or 24 bit address is added to the 16 bit register to produce -the final address in memory of the operand. - -@item r@var{n}(#@var{imm}) -Base Address: the 16 or 24 bit register is added to the 16 bit sign -extended immediate displacement to produce the final address in memory -of the operand. - -@item r@var{n}(r@var{m}) -Base Index: the 16 or 24 bit register r@var{n} is added to the sign -extended 16 bit index register r@var{m} to produce the final address in -memory of the operand. - -@item #@var{xx} -Immediate data @var{xx}. -@end table - -@node Z8000 Directives -@section Assembler Directives for the Z8000 - -@cindex Z8000 directives -@cindex directives, Z8000 -The Z8000 port of @value{AS} includes these additional assembler directives, -for compatibility with other Z8000 assemblers. As shown, these do not -begin with @samp{.} (unlike the ordinary @value{AS} directives). - -@table @code -@kindex segm -@item segm -Generates code for the segmented Z8001. - -@kindex unsegm -@item unsegm -Generates code for the unsegmented Z8002. - -@kindex name -@item name -Synonym for @code{.file} - -@kindex global -@item global -Synonym for @code{.global} - -@kindex wval -@item wval -Synonym for @code{.word} - -@kindex lval -@item lval -Synonym for @code{.long} - -@kindex bval -@item bval -Synonym for @code{.byte} - -@kindex sval -@item sval -Assemble a string. @code{sval} expects one string literal, delimited by -single quotes. It assembles each byte of the string into consecutive -addresses. You can use the escape sequence @samp{%@var{xx}} (where -@var{xx} represents a two-digit hexadecimal number) to represent the -character whose @sc{ascii} value is @var{xx}. Use this feature to -describe single quote and other characters that may not appear in string -literals as themselves. For example, the C statement @w{@samp{char *a = -"he said \"it's 50% off\"";}} is represented in Z8000 assembly language -(shown with the assembler output in hex at the left) as - -@iftex -@begingroup -@let@nonarrowing=@comment -@end iftex -@smallexample -68652073 sval 'he said %22it%27s 50%25 off%22%00' -61696420 -22697427 -73203530 -25206F66 -662200 -@end smallexample -@iftex -@endgroup -@end iftex - -@kindex rsect -@item rsect -synonym for @code{.section} - -@kindex block -@item block -synonym for @code{.space} - -@kindex even -@item even -special case of @code{.align}; aligns output to even byte boundary. -@end table - -@node Z8000 Opcodes -@section Opcodes - -@cindex Z8000 opcode summary -@cindex opcode summary, Z8000 -@cindex mnemonics, Z8000 -@cindex instruction summary, Z8000 -For detailed information on the Z8000 machine instruction set, see -@cite{Z8000 Technical Manual}. - -@ifset SMALL -@c this table, due to the multi-col faking and hardcoded order, looks silly -@c except in smallbook. See comments below "@set SMALL" near top of this file. - -The following table summarizes the opcodes and their arguments: -@iftex -@begingroup -@let@nonarrowing=@comment -@end iftex -@smallexample - - rs @r{16 bit source register} - rd @r{16 bit destination register} - rbs @r{8 bit source register} - rbd @r{8 bit destination register} - rrs @r{32 bit source register} - rrd @r{32 bit destination register} - rqs @r{64 bit source register} - rqd @r{64 bit destination register} - addr @r{16/24 bit address} - imm @r{immediate data} - -adc rd,rs clrb addr cpsir @@rd,@@rs,rr,cc -adcb rbd,rbs clrb addr(rd) cpsirb @@rd,@@rs,rr,cc -add rd,@@rs clrb rbd dab rbd -add rd,addr com @@rd dbjnz rbd,disp7 -add rd,addr(rs) com addr dec @@rd,imm4m1 -add rd,imm16 com addr(rd) dec addr(rd),imm4m1 -add rd,rs com rd dec addr,imm4m1 -addb rbd,@@rs comb @@rd dec rd,imm4m1 -addb rbd,addr comb addr decb @@rd,imm4m1 -addb rbd,addr(rs) comb addr(rd) decb addr(rd),imm4m1 -addb rbd,imm8 comb rbd decb addr,imm4m1 -addb rbd,rbs comflg flags decb rbd,imm4m1 -addl rrd,@@rs cp @@rd,imm16 di i2 -addl rrd,addr cp addr(rd),imm16 div rrd,@@rs -addl rrd,addr(rs) cp addr,imm16 div rrd,addr -addl rrd,imm32 cp rd,@@rs div rrd,addr(rs) -addl rrd,rrs cp rd,addr div rrd,imm16 -and rd,@@rs cp rd,addr(rs) div rrd,rs -and rd,addr cp rd,imm16 divl rqd,@@rs -and rd,addr(rs) cp rd,rs divl rqd,addr -and rd,imm16 cpb @@rd,imm8 divl rqd,addr(rs) -and rd,rs cpb addr(rd),imm8 divl rqd,imm32 -andb rbd,@@rs cpb addr,imm8 divl rqd,rrs -andb rbd,addr cpb rbd,@@rs djnz rd,disp7 -andb rbd,addr(rs) cpb rbd,addr ei i2 -andb rbd,imm8 cpb rbd,addr(rs) ex rd,@@rs -andb rbd,rbs cpb rbd,imm8 ex rd,addr -bit @@rd,imm4 cpb rbd,rbs ex rd,addr(rs) -bit addr(rd),imm4 cpd rd,@@rs,rr,cc ex rd,rs -bit addr,imm4 cpdb rbd,@@rs,rr,cc exb rbd,@@rs -bit rd,imm4 cpdr rd,@@rs,rr,cc exb rbd,addr -bit rd,rs cpdrb rbd,@@rs,rr,cc exb rbd,addr(rs) -bitb @@rd,imm4 cpi rd,@@rs,rr,cc exb rbd,rbs -bitb addr(rd),imm4 cpib rbd,@@rs,rr,cc ext0e imm8 -bitb addr,imm4 cpir rd,@@rs,rr,cc ext0f imm8 -bitb rbd,imm4 cpirb rbd,@@rs,rr,cc ext8e imm8 -bitb rbd,rs cpl rrd,@@rs ext8f imm8 -bpt cpl rrd,addr exts rrd -call @@rd cpl rrd,addr(rs) extsb rd -call addr cpl rrd,imm32 extsl rqd -call addr(rd) cpl rrd,rrs halt -calr disp12 cpsd @@rd,@@rs,rr,cc in rd,@@rs -clr @@rd cpsdb @@rd,@@rs,rr,cc in rd,imm16 -clr addr cpsdr @@rd,@@rs,rr,cc inb rbd,@@rs -clr addr(rd) cpsdrb @@rd,@@rs,rr,cc inb rbd,imm16 -clr rd cpsi @@rd,@@rs,rr,cc inc @@rd,imm4m1 -clrb @@rd cpsib @@rd,@@rs,rr,cc inc addr(rd),imm4m1 -inc addr,imm4m1 ldb rbd,rs(rx) mult rrd,addr(rs) -inc rd,imm4m1 ldb rd(imm16),rbs mult rrd,imm16 -incb @@rd,imm4m1 ldb rd(rx),rbs mult rrd,rs -incb addr(rd),imm4m1 ldctl ctrl,rs multl rqd,@@rs -incb addr,imm4m1 ldctl rd,ctrl multl rqd,addr -incb rbd,imm4m1 ldd @@rs,@@rd,rr multl rqd,addr(rs) -ind @@rd,@@rs,ra lddb @@rs,@@rd,rr multl rqd,imm32 -indb @@rd,@@rs,rba lddr @@rs,@@rd,rr multl rqd,rrs -inib @@rd,@@rs,ra lddrb @@rs,@@rd,rr neg @@rd -inibr @@rd,@@rs,ra ldi @@rd,@@rs,rr neg addr -iret ldib @@rd,@@rs,rr neg addr(rd) -jp cc,@@rd ldir @@rd,@@rs,rr neg rd -jp cc,addr ldirb @@rd,@@rs,rr negb @@rd -jp cc,addr(rd) ldk rd,imm4 negb addr -jr cc,disp8 ldl @@rd,rrs negb addr(rd) -ld @@rd,imm16 ldl addr(rd),rrs negb rbd -ld @@rd,rs ldl addr,rrs nop -ld addr(rd),imm16 ldl rd(imm16),rrs or rd,@@rs -ld addr(rd),rs ldl rd(rx),rrs or rd,addr -ld addr,imm16 ldl rrd,@@rs or rd,addr(rs) -ld addr,rs ldl rrd,addr or rd,imm16 -ld rd(imm16),rs ldl rrd,addr(rs) or rd,rs -ld rd(rx),rs ldl rrd,imm32 orb rbd,@@rs -ld rd,@@rs ldl rrd,rrs orb rbd,addr -ld rd,addr ldl rrd,rs(imm16) orb rbd,addr(rs) -ld rd,addr(rs) ldl rrd,rs(rx) orb rbd,imm8 -ld rd,imm16 ldm @@rd,rs,n orb rbd,rbs -ld rd,rs ldm addr(rd),rs,n out @@rd,rs -ld rd,rs(imm16) ldm addr,rs,n out imm16,rs -ld rd,rs(rx) ldm rd,@@rs,n outb @@rd,rbs -lda rd,addr ldm rd,addr(rs),n outb imm16,rbs -lda rd,addr(rs) ldm rd,addr,n outd @@rd,@@rs,ra -lda rd,rs(imm16) ldps @@rs outdb @@rd,@@rs,rba -lda rd,rs(rx) ldps addr outib @@rd,@@rs,ra -ldar rd,disp16 ldps addr(rs) outibr @@rd,@@rs,ra -ldb @@rd,imm8 ldr disp16,rs pop @@rd,@@rs -ldb @@rd,rbs ldr rd,disp16 pop addr(rd),@@rs -ldb addr(rd),imm8 ldrb disp16,rbs pop addr,@@rs -ldb addr(rd),rbs ldrb rbd,disp16 pop rd,@@rs -ldb addr,imm8 ldrl disp16,rrs popl @@rd,@@rs -ldb addr,rbs ldrl rrd,disp16 popl addr(rd),@@rs -ldb rbd,@@rs mbit popl addr,@@rs -ldb rbd,addr mreq rd popl rrd,@@rs -ldb rbd,addr(rs) mres push @@rd,@@rs -ldb rbd,imm8 mset push @@rd,addr -ldb rbd,rbs mult rrd,@@rs push @@rd,addr(rs) -ldb rbd,rs(imm16) mult rrd,addr push @@rd,imm16 -push @@rd,rs set addr,imm4 subl rrd,imm32 -pushl @@rd,@@rs set rd,imm4 subl rrd,rrs -pushl @@rd,addr set rd,rs tcc cc,rd -pushl @@rd,addr(rs) setb @@rd,imm4 tccb cc,rbd -pushl @@rd,rrs setb addr(rd),imm4 test @@rd -res @@rd,imm4 setb addr,imm4 test addr -res addr(rd),imm4 setb rbd,imm4 test addr(rd) -res addr,imm4 setb rbd,rs test rd -res rd,imm4 setflg imm4 testb @@rd -res rd,rs sinb rbd,imm16 testb addr -resb @@rd,imm4 sinb rd,imm16 testb addr(rd) -resb addr(rd),imm4 sind @@rd,@@rs,ra testb rbd -resb addr,imm4 sindb @@rd,@@rs,rba testl @@rd -resb rbd,imm4 sinib @@rd,@@rs,ra testl addr -resb rbd,rs sinibr @@rd,@@rs,ra testl addr(rd) -resflg imm4 sla rd,imm8 testl rrd -ret cc slab rbd,imm8 trdb @@rd,@@rs,rba -rl rd,imm1or2 slal rrd,imm8 trdrb @@rd,@@rs,rba -rlb rbd,imm1or2 sll rd,imm8 trib @@rd,@@rs,rbr -rlc rd,imm1or2 sllb rbd,imm8 trirb @@rd,@@rs,rbr -rlcb rbd,imm1or2 slll rrd,imm8 trtdrb @@ra,@@rb,rbr -rldb rbb,rba sout imm16,rs trtib @@ra,@@rb,rr -rr rd,imm1or2 soutb imm16,rbs trtirb @@ra,@@rb,rbr -rrb rbd,imm1or2 soutd @@rd,@@rs,ra trtrb @@ra,@@rb,rbr -rrc rd,imm1or2 soutdb @@rd,@@rs,rba tset @@rd -rrcb rbd,imm1or2 soutib @@rd,@@rs,ra tset addr -rrdb rbb,rba soutibr @@rd,@@rs,ra tset addr(rd) -rsvd36 sra rd,imm8 tset rd -rsvd38 srab rbd,imm8 tsetb @@rd -rsvd78 sral rrd,imm8 tsetb addr -rsvd7e srl rd,imm8 tsetb addr(rd) -rsvd9d srlb rbd,imm8 tsetb rbd -rsvd9f srll rrd,imm8 xor rd,@@rs -rsvdb9 sub rd,@@rs xor rd,addr -rsvdbf sub rd,addr xor rd,addr(rs) -sbc rd,rs sub rd,addr(rs) xor rd,imm16 -sbcb rbd,rbs sub rd,imm16 xor rd,rs -sc imm8 sub rd,rs xorb rbd,@@rs -sda rd,rs subb rbd,@@rs xorb rbd,addr -sdab rbd,rs subb rbd,addr xorb rbd,addr(rs) -sdal rrd,rs subb rbd,addr(rs) xorb rbd,imm8 -sdl rd,rs subb rbd,imm8 xorb rbd,rbs -sdlb rbd,rs subb rbd,rbs xorb rbd,rbs -sdll rrd,rs subl rrd,@@rs -set @@rd,imm4 subl rrd,addr -set addr(rd),imm4 subl rrd,addr(rs) -@end smallexample -@iftex -@endgroup -@end iftex -@end ifset - diff --git a/contrib/binutils/gprof/po/Make-in b/contrib/binutils/gprof/po/Make-in deleted file mode 100644 index 0552db1feef3..000000000000 --- a/contrib/binutils/gprof/po/Make-in +++ /dev/null @@ -1,251 +0,0 @@ -# Makefile for program source directory in GNU NLS utilities package. -# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu> -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ - -SHELL = /bin/sh -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -datadir = $(prefix)/@DATADIRNAME@ -localedir = $(datadir)/locale -gnulocaledir = $(prefix)/share/locale -gettextsrcdir = $(prefix)/share/gettext/po -subdir = po - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -MKINSTALLDIRS = @MKINSTALLDIRS@ - -CC = @CC@ -GENCAT = @GENCAT@ -GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ -MSGFMT = @MSGFMT@ -XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ -MSGMERGE = PATH=../src:$$PATH msgmerge - -DEFS = @DEFS@ -CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ - -INCLUDES = -I.. -I$(top_srcdir)/intl - -COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) - -SOURCES = cat-id-tbl.c -POFILES = @POFILES@ -GMOFILES = @GMOFILES@ -DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ -stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) - -POTFILES = \ - -CATALOGS = @CATALOGS@ -CATOBJEXT = @CATOBJEXT@ -INSTOBJEXT = @INSTOBJEXT@ - -.SUFFIXES: -.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat - -.c.o: - $(COMPILE) $< - -.po.pox: - $(MAKE) $(PACKAGE).pot - $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox - -.po.mo: - $(MSGFMT) -o $@ $< - -.po.gmo: - file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ - && rm -f $$file && $(GMSGFMT) -o $$file $< - -.po.cat: - sed -f ../intl/po2msg.sed < $< > $*.msg \ - && rm -f $@ && $(GENCAT) $@ $*.msg - - -all: all-@USE_NLS@ - -all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot -all-no: - -$(srcdir)/$(PACKAGE).pot: $(POTFILES) - $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ - --add-comments --keyword=_ --keyword=N_ \ - --files-from=$(srcdir)/POTFILES.in - rm -f $(srcdir)/$(PACKAGE).pot - mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot - -$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: -$(srcdir)/stamp-cat-id: $(PACKAGE).pot - rm -f cat-id-tbl.tmp - sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ - | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp - if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ - rm cat-id-tbl.tmp; \ - else \ - echo cat-id-tbl.c changed; \ - rm -f $(srcdir)/cat-id-tbl.c; \ - mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ - fi - cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id - - -install: install-exec install-data -install-exec: -install-info: -install-data: install-data-@USE_NLS@ -install-data-no: all -install-data-yes: all - if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(datadir); \ - else \ - $(top_srcdir)/mkinstalldirs $(datadir); \ - fi - @catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - case "$$cat" in \ - *.gmo) destdir=$(gnulocaledir);; \ - *) destdir=$(localedir);; \ - esac; \ - lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - dir=$$destdir/$$lang/LC_MESSAGES; \ - if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $$dir; \ - else \ - $(top_srcdir)/mkinstalldirs $$dir; \ - fi; \ - if test -r $$cat; then \ - $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ - echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ - else \ - $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ - echo "installing $(srcdir)/$$cat as" \ - "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ - fi; \ - if test -r $$cat.m; then \ - $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ - echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ - else \ - if test -r $(srcdir)/$$cat.m ; then \ - $(INSTALL_DATA) $(srcdir)/$$cat.m \ - $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ - echo "installing $(srcdir)/$$cat as" \ - "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ - else \ - true; \ - fi; \ - fi; \ - done - if test "$(PACKAGE)" = "gettext"; then \ - if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(gettextsrcdir); \ - else \ - $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ - fi; \ - $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ - $(gettextsrcdir)/Makefile.in.in; \ - else \ - : ; \ - fi - -# Define this as empty until I found a useful application. -installcheck: - -uninstall: - catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ - done - rm -f $(gettextsrcdir)/po-Makefile.in.in - -check: all - -cat-id-tbl.o: ../intl/libgettext.h - -dvi info tags TAGS ID: - -mostlyclean: - rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp - rm -fr *.o - -clean: mostlyclean - -distclean: clean - rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m - -maintainer-clean: distclean - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - rm -f $(GMOFILES) - -distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) -dist distdir: update-po $(DISTFILES) - dists="$(DISTFILES)"; \ - for file in $$dists; do \ - ln $(srcdir)/$$file $(distdir) 2> /dev/null \ - || cp -p $(srcdir)/$$file $(distdir); \ - done - -update-po: Makefile - $(MAKE) $(PACKAGE).pot - PATH=`pwd`/../src:$$PATH; \ - cd $(srcdir); \ - catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - mv $$lang.po $$lang.old.po; \ - echo "$$lang:"; \ - if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ - rm -f $$lang.old.po; \ - else \ - echo "msgmerge for $$cat failed!"; \ - rm -f $$lang.po; \ - mv $$lang.old.po $$lang.po; \ - fi; \ - done - -POTFILES: POTFILES.in - ( if test 'x$(srcdir)' != 'x.'; then \ - posrcprefix='$(top_srcdir)/'; \ - else \ - posrcprefix="../"; \ - fi; \ - rm -f $@-t $@ \ - && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ - -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ - | sed -e '$$s/\\$$//') > $@-t \ - && chmod a-w $@-t \ - && mv $@-t $@ ) - -POTFILES.in: @MAINT@ ../Makefile - cd .. && $(MAKE) po/POTFILES.in - -Makefile: Make-in ../config.status POTFILES - cd .. \ - && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \ - CONFIG_HEADERS= $(SHELL) ./config.status - -# Tell versions [3.59,3.63) of GNU make not to export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/contrib/binutils/gprof/po/POTFILES.in b/contrib/binutils/gprof/po/POTFILES.in deleted file mode 100644 index 6ea40f18244c..000000000000 --- a/contrib/binutils/gprof/po/POTFILES.in +++ /dev/null @@ -1,38 +0,0 @@ -alpha.c -basic_blocks.c -basic_blocks.h -call_graph.c -call_graph.h -cg_arcs.c -cg_arcs.h -cg_dfn.c -cg_dfn.h -cg_print.c -cg_print.h -corefile.c -corefile.h -gmon.h -gmon_io.c -gmon_io.h -gmon_out.h -gprof.c -gprof.h -hertz.c -hertz.h -hist.c -hist.h -i386.c -mips.c -search_list.c -search_list.h -source.c -source.h -sparc.c -sym_ids.c -sym_ids.h -symtab.c -symtab.h -tahoe.c -utils.c -utils.h -vax.c diff --git a/contrib/binutils/gprof/po/gprof.pot b/contrib/binutils/gprof/po/gprof.pot deleted file mode 100644 index f586066b1fcc..000000000000 --- a/contrib/binutils/gprof/po/gprof.pot +++ /dev/null @@ -1,505 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Free Software Foundation, Inc. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2002-01-31 18:32+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: alpha.c:93 mips.c:47 -msgid "<indirect child>" -msgstr "" - -#: alpha.c:110 mips.c:64 -#, c-format -msgid "[find_call] %s: 0x%lx to 0x%lx\n" -msgstr "" - -#: alpha.c:132 -#, c-format -msgid "[find_call] 0x%lx: jsr%s <indirect_child>\n" -msgstr "" - -#: alpha.c:142 -#, c-format -msgid "[find_call] 0x%lx: bsr" -msgstr "" - -#: basic_blocks.c:122 call_graph.c:90 hist.c:93 -#, c-format -msgid "%s: %s: unexpected end of file\n" -msgstr "" - -#: basic_blocks.c:190 -#, c-format -msgid "%s: warning: ignoring basic-block exec counts (use -l or --line)\n" -msgstr "" - -#. FIXME: This only works if bfd_vma is unsigned long. -#: basic_blocks.c:281 basic_blocks.c:291 -#, c-format -msgid "%s:%d: (%s:0x%lx) %lu executions\n" -msgstr "" - -#: basic_blocks.c:282 basic_blocks.c:292 -msgid "<unknown>" -msgstr "" - -#: basic_blocks.c:536 -#, c-format -msgid "" -"\n" -"\n" -"Top %d Lines:\n" -"\n" -" Line Count\n" -"\n" -msgstr "" - -#: basic_blocks.c:560 -msgid "" -"\n" -"Execution Summary:\n" -"\n" -msgstr "" - -#: basic_blocks.c:561 -#, c-format -msgid "%9ld Executable lines in this file\n" -msgstr "" - -#: basic_blocks.c:563 -#, c-format -msgid "%9ld Lines executed\n" -msgstr "" - -#: basic_blocks.c:564 -#, c-format -msgid "%9.2f Percent of the file executed\n" -msgstr "" - -#: basic_blocks.c:568 -#, c-format -msgid "" -"\n" -"%9lu Total number of line executions\n" -msgstr "" - -#: basic_blocks.c:570 -#, c-format -msgid "%9.2f Average executions per line\n" -msgstr "" - -#: call_graph.c:69 -#, c-format -msgid "[cg_tally] arc from %s to %s traversed %lu times\n" -msgstr "" - -#: cg_print.c:58 -msgid "" -"\t\t Call graph (explanation follows)\n" -"\n" -msgstr "" - -#: cg_print.c:60 -msgid "" -"\t\t\tCall graph\n" -"\n" -msgstr "" - -#: cg_print.c:63 hist.c:355 -#, c-format -msgid "" -"\n" -"granularity: each sample hit covers %ld byte(s)" -msgstr "" - -#: cg_print.c:67 -#, c-format -msgid "" -" for %.2f%% of %.2f seconds\n" -"\n" -msgstr "" - -#: cg_print.c:71 -msgid "" -" no time propagated\n" -"\n" -msgstr "" - -#: cg_print.c:80 cg_print.c:83 cg_print.c:85 -msgid "called" -msgstr "" - -#: cg_print.c:80 cg_print.c:85 -msgid "total" -msgstr "" - -#: cg_print.c:80 -msgid "parents" -msgstr "" - -#: cg_print.c:82 cg_print.c:83 -msgid "index" -msgstr "" - -#: cg_print.c:82 -msgid "%time" -msgstr "" - -#: cg_print.c:82 cg_print.c:83 -msgid "self" -msgstr "" - -#: cg_print.c:82 -msgid "descendants" -msgstr "" - -#: cg_print.c:83 hist.c:381 -msgid "name" -msgstr "" - -#: cg_print.c:85 -msgid "children" -msgstr "" - -#: cg_print.c:90 -#, c-format -msgid "index %% time self children called name\n" -msgstr "" - -#: cg_print.c:113 -#, c-format -msgid " <cycle %d as a whole> [%d]\n" -msgstr "" - -#: cg_print.c:339 -#, c-format -msgid "%6.6s %5.5s %7.7s %11.11s %7.7s %7.7s <spontaneous>\n" -msgstr "" - -#: cg_print.c:340 -#, c-format -msgid "%6.6s %5.5s %7.7s %7.7s %7.7s %7.7s <spontaneous>\n" -msgstr "" - -#: cg_print.c:574 -msgid "" -"Index by function name\n" -"\n" -msgstr "" - -#: cg_print.c:631 cg_print.c:640 -#, c-format -msgid "<cycle %d>" -msgstr "" - -#: corefile.c:64 -#, c-format -msgid "%s: could not open %s.\n" -msgstr "" - -#: corefile.c:78 corefile.c:112 -#, c-format -msgid "%s: unable to parse mapping file %s.\n" -msgstr "" - -#: corefile.c:154 -#, c-format -msgid "%s: %s: not in a.out format\n" -msgstr "" - -#: corefile.c:165 -#, c-format -msgid "%s: can't find .text section in %s\n" -msgstr "" - -#: corefile.c:223 -#, c-format -msgid "%s: ran out room for %lu bytes of text space\n" -msgstr "" - -#: corefile.c:237 -#, c-format -msgid "%s: can't do -c\n" -msgstr "" - -#: corefile.c:272 -#, c-format -msgid "%s: -c not supported on architecture %s\n" -msgstr "" - -#: corefile.c:439 -#, c-format -msgid "%s: file `%s' has no symbols\n" -msgstr "" - -#: corefile.c:739 -#, c-format -msgid "%s: somebody miscounted: ltab.len=%d instead of %ld\n" -msgstr "" - -#: gmon_io.c:83 gmon_io.c:137 gmon_io.c:188 gmon_io.c:216 gmon_io.c:386 -#: gmon_io.c:413 gmon_io.c:609 gmon_io.c:634 -#, c-format -msgid "%s: bits per address has unexpected value of %u\n" -msgstr "" - -#: gmon_io.c:252 gmon_io.c:347 -#, c-format -msgid "%s: file too short to be a gmon file\n" -msgstr "" - -#: gmon_io.c:262 gmon_io.c:396 -#, c-format -msgid "%s: file `%s' has bad magic cookie\n" -msgstr "" - -#: gmon_io.c:273 -#, c-format -msgid "%s: file `%s' has unsupported version %d\n" -msgstr "" - -#: gmon_io.c:303 -#, c-format -msgid "%s: %s: found bad tag %d (file corrupted?)\n" -msgstr "" - -#: gmon_io.c:369 -#, c-format -msgid "%s: profiling rate incompatible with first gmon file\n" -msgstr "" - -#: gmon_io.c:429 -#, c-format -msgid "%s: incompatible with first gmon file\n" -msgstr "" - -#: gmon_io.c:457 -#, c-format -msgid "%s: file '%s' does not appear to be in gmon.out format\n" -msgstr "" - -#: gmon_io.c:478 -#, c-format -msgid "%s: unexpected EOF after reading %d/%d bins\n" -msgstr "" - -#: gmon_io.c:511 -msgid "time is in ticks, not seconds\n" -msgstr "" - -#: gmon_io.c:517 gmon_io.c:704 -#, c-format -msgid "%s: don't know how to deal with file format %d\n" -msgstr "" - -#: gmon_io.c:524 -#, c-format -msgid "File `%s' (version %d) contains:\n" -msgstr "" - -#: gmon_io.c:527 -#, c-format -msgid "\t%d histogram record\n" -msgstr "" - -#: gmon_io.c:528 -#, c-format -msgid "\t%d histogram records\n" -msgstr "" - -#: gmon_io.c:530 -#, c-format -msgid "\t%d call-graph record\n" -msgstr "" - -#: gmon_io.c:531 -#, c-format -msgid "\t%d call-graph records\n" -msgstr "" - -#: gmon_io.c:533 -#, c-format -msgid "\t%d basic-block count record\n" -msgstr "" - -#: gmon_io.c:534 -#, c-format -msgid "\t%d basic-block count records\n" -msgstr "" - -#: gprof.c:147 -#, c-format -msgid "" -"Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n" -"\t[-d[num]] [-k from/to] [-m min-count] [-t table-length]\n" -"\t[--[no-]annotated-source[=name]] [--[no-]exec-counts[=name]]\n" -"\t[--[no-]flat-profile[=name]] [--[no-]graph[=name]]\n" -"\t[--[no-]time=name] [--all-lines] [--brief] [--debug[=level]]\n" -"\t[--function-ordering] [--file-ordering]\n" -"\t[--directory-path=dirs] [--display-unused-functions]\n" -"\t[--file-format=name] [--file-info] [--help] [--line] [--min-count=n]\n" -"\t[--no-static] [--print-path] [--separate-files]\n" -"\t[--static-call-graph] [--sum] [--table-length=len] [--traditional]\n" -"\t[--version] [--width=n] [--ignore-non-functions]\n" -"\t[--demangle[=STYLE]] [--no-demangle]\n" -"\t[image-file] [profile-file...]\n" -msgstr "" - -#: gprof.c:163 -#, c-format -msgid "Report bugs to %s\n" -msgstr "" - -#: gprof.c:235 -#, c-format -msgid "%s: debugging not supported; -d ignored\n" -msgstr "" - -#: gprof.c:315 -#, c-format -msgid "%s: unknown file format %s\n" -msgstr "" - -#. This output is intended to follow the GNU standards document. -#: gprof.c:399 -#, c-format -msgid "GNU gprof %s\n" -msgstr "" - -#: gprof.c:400 -msgid "" -"Based on BSD gprof, copyright 1983 Regents of the University of California.\n" -msgstr "" - -#: gprof.c:401 -msgid "" -"This program is free software. This program has absolutely no warranty.\n" -msgstr "" - -#: gprof.c:442 -#, c-format -msgid "%s: unknown demangling style `%s'\n" -msgstr "" - -#: gprof.c:462 -#, c-format -msgid "" -"%s: Only one of --function-ordering and --file-ordering may be specified.\n" -msgstr "" - -#: gprof.c:562 -#, c-format -msgid "%s: sorry, file format `prof' is not yet supported\n" -msgstr "" - -#: gprof.c:623 -#, c-format -msgid "%s: gmon.out file is missing histogram\n" -msgstr "" - -#: gprof.c:630 -#, c-format -msgid "%s: gmon.out file is missing call-graph data\n" -msgstr "" - -#: hist.c:122 -#, c-format -msgid "%s: `%s' is incompatible with first gmon file\n" -msgstr "" - -#: hist.c:138 -#, c-format -msgid "%s: %s: unexpected EOF after reading %d of %d samples\n" -msgstr "" - -#: hist.c:351 -#, c-format -msgid "%c%c/call" -msgstr "" - -#: hist.c:359 -#, c-format -msgid "" -" for %.2f%% of %.2f %s\n" -"\n" -msgstr "" - -#: hist.c:365 -#, c-format -msgid "" -"\n" -"Each sample counts as %g %s.\n" -msgstr "" - -#: hist.c:370 -msgid "" -" no time accumulated\n" -"\n" -msgstr "" - -#: hist.c:377 -msgid "cumulative" -msgstr "" - -#: hist.c:377 -msgid "self " -msgstr "" - -#: hist.c:377 -msgid "total " -msgstr "" - -#: hist.c:380 -msgid "time" -msgstr "" - -#: hist.c:380 -msgid "calls" -msgstr "" - -#: hist.c:469 -msgid "" -"\n" -"\n" -"\n" -"flat profile:\n" -msgstr "" - -#: hist.c:475 -msgid "Flat profile:\n" -msgstr "" - -#: mips.c:75 -#, c-format -msgid "[find_call] 0x%lx: jal" -msgstr "" - -#: mips.c:100 -#, c-format -msgid "[find_call] 0x%lx: jalr\n" -msgstr "" - -#: source.c:163 -#, c-format -msgid "%s: could not locate `%s'\n" -msgstr "" - -#: source.c:238 -#, c-format -msgid "*** File %s:\n" -msgstr "" - -#: utils.c:96 -#, c-format -msgid " <cycle %d>" -msgstr "" diff --git a/contrib/binutils/include/callback.h b/contrib/binutils/include/callback.h deleted file mode 100644 index 30752842ed90..000000000000 --- a/contrib/binutils/include/callback.h +++ /dev/null @@ -1,270 +0,0 @@ -/* Remote target system call callback support. - Copyright 1997 Free Software Foundation, Inc. - Contributed by Cygnus Solutions. - -This file is part of GDB. - -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 interface isn't intended to be specific to any particular kind - of remote (hardware, simulator, whatever). As such, support for it - (e.g. sim/common/callback.c) should *not* live in the simulator source - tree, nor should it live in the gdb source tree. */ - -/* There are various ways to handle system calls: - - 1) Have a simulator intercept the appropriate trap instruction and - directly perform the system call on behalf of the target program. - This is the typical way of handling system calls for embedded targets. - [Handling system calls for embedded targets isn't that much of an - oxymoron as running compiler testsuites make use of the capability.] - - This method of system call handling is done when STATE_ENVIRONMENT - is ENVIRONMENT_USER. - - 2) Have a simulator emulate the hardware as much as possible. - If the program running on the real hardware communicates with some sort - of target manager, one would want to be able to run this program on the - simulator as well. - - This method of system call handling is done when STATE_ENVIRONMENT - is ENVIRONMENT_OPERATING. -*/ - -#ifndef CALLBACK_H -#define CALLBACK_H - -/* ??? The reason why we check for va_start here should be documented. */ - -#ifndef va_start -#include <ansidecl.h> -#ifdef ANSI_PROTOTYPES -#include <stdarg.h> -#else -#include <varargs.h> -#endif -#endif - -/* Mapping of host/target values. */ -/* ??? For debugging purposes, one might want to add a string of the - name of the symbol. */ - -typedef struct { - int host_val; - int target_val; -} CB_TARGET_DEFS_MAP; - -#define MAX_CALLBACK_FDS 10 - -/* Forward decl for stat/fstat. */ -struct stat; - -typedef struct host_callback_struct host_callback; - -struct host_callback_struct -{ - int (*close) PARAMS ((host_callback *,int)); - int (*get_errno) PARAMS ((host_callback *)); - int (*isatty) PARAMS ((host_callback *, int)); - int (*lseek) PARAMS ((host_callback *, int, long , int)); - int (*open) PARAMS ((host_callback *, const char*, int mode)); - int (*read) PARAMS ((host_callback *,int, char *, int)); - int (*read_stdin) PARAMS (( host_callback *, char *, int)); - int (*rename) PARAMS ((host_callback *, const char *, const char *)); - int (*system) PARAMS ((host_callback *, const char *)); - long (*time) PARAMS ((host_callback *, long *)); - int (*unlink) PARAMS ((host_callback *, const char *)); - int (*write) PARAMS ((host_callback *,int, const char *, int)); - int (*write_stdout) PARAMS ((host_callback *, const char *, int)); - void (*flush_stdout) PARAMS ((host_callback *)); - int (*write_stderr) PARAMS ((host_callback *, const char *, int)); - void (*flush_stderr) PARAMS ((host_callback *)); - int (*stat) PARAMS ((host_callback *, const char *, struct stat *)); - int (*fstat) PARAMS ((host_callback *, int, struct stat *)); - - /* When present, call to the client to give it the oportunity to - poll any io devices for a request to quit (indicated by a nonzero - return value). */ - int (*poll_quit) PARAMS ((host_callback *)); - - /* Used when the target has gone away, so we can close open - handles and free memory etc etc. */ - int (*shutdown) PARAMS ((host_callback *)); - int (*init) PARAMS ((host_callback *)); - - /* depreciated, use vprintf_filtered - Talk to the user on a console. */ - void (*printf_filtered) PARAMS ((host_callback *, const char *, ...)); - - /* Talk to the user on a console. */ - void (*vprintf_filtered) PARAMS ((host_callback *, const char *, va_list)); - - /* Same as vprintf_filtered but to stderr. */ - void (*evprintf_filtered) PARAMS ((host_callback *, const char *, va_list)); - - /* Print an error message and "exit". - In the case of gdb "exiting" means doing a longjmp back to the main - command loop. */ - void (*error) PARAMS ((host_callback *, const char *, ...)); - - int last_errno; /* host format */ - - int fdmap[MAX_CALLBACK_FDS]; - char fdopen[MAX_CALLBACK_FDS]; - char alwaysopen[MAX_CALLBACK_FDS]; - - /* System call numbers. */ - CB_TARGET_DEFS_MAP *syscall_map; - /* Errno values. */ - CB_TARGET_DEFS_MAP *errno_map; - /* Flags to the open system call. */ - CB_TARGET_DEFS_MAP *open_map; - /* Signal numbers. */ - CB_TARGET_DEFS_MAP *signal_map; - /* Layout of `stat' struct. - The format is a series of "name,length" pairs separated by colons. - Empty space is indicated with a `name' of "space". - All padding must be explicitly mentioned. - Lengths are in bytes. If this needs to be extended to bits, - use "name.bits". - Example: "st_dev,4:st_ino,4:st_mode,4:..." */ - const char *stat_map; - - /* Marker for those wanting to do sanity checks. - This should remain the last member of this struct to help catch - miscompilation errors. */ -#define HOST_CALLBACK_MAGIC 4705 /* teds constant */ - int magic; -}; - -extern host_callback default_callback; - -/* Canonical versions of system call numbers. - It's not intended to willy-nilly throw every system call ever heard - of in here. Only include those that have an important use. - ??? One can certainly start a discussion over the ones that are currently - here, but that will always be true. */ - -/* These are used by the ANSI C support of libc. */ -#define CB_SYS_exit 1 -#define CB_SYS_open 2 -#define CB_SYS_close 3 -#define CB_SYS_read 4 -#define CB_SYS_write 5 -#define CB_SYS_lseek 6 -#define CB_SYS_unlink 7 -#define CB_SYS_getpid 8 -#define CB_SYS_kill 9 -#define CB_SYS_fstat 10 -/*#define CB_SYS_sbrk 11 - not currently a system call, but reserved. */ - -/* ARGV support. */ -#define CB_SYS_argvlen 12 -#define CB_SYS_argv 13 - -/* These are extras added for one reason or another. */ -#define CB_SYS_chdir 14 -#define CB_SYS_stat 15 -#define CB_SYS_chmod 16 -#define CB_SYS_utime 17 -#define CB_SYS_time 18 - -/* Struct use to pass and return information necessary to perform a - system call. */ -/* FIXME: Need to consider target word size. */ - -typedef struct cb_syscall { - /* The target's value of what system call to perform. */ - int func; - /* The arguments to the syscall. */ - long arg1, arg2, arg3, arg4; - - /* The result. */ - long result; - /* Some system calls have two results. */ - long result2; - /* The target's errno value, or 0 if success. - This is converted to the target's value with host_to_target_errno. */ - int errcode; - - /* Working space to be used by memory read/write callbacks. */ - PTR p1; - PTR p2; - long x1,x2; - - /* Callbacks for reading/writing memory (e.g. for read/write syscalls). - ??? long or unsigned long might be better to use for the `count' - argument here. We mimic sim_{read,write} for now. Be careful to - test any changes with -Wall -Werror, mixed signed comparisons - will get you. */ - int (*read_mem) PARAMS ((host_callback * /*cb*/, struct cb_syscall * /*sc*/, - unsigned long /*taddr*/, char * /*buf*/, - int /*bytes*/)); - int (*write_mem) PARAMS ((host_callback * /*cb*/, struct cb_syscall * /*sc*/, - unsigned long /*taddr*/, const char * /*buf*/, - int /*bytes*/)); - - /* For sanity checking, should be last entry. */ - int magic; -} CB_SYSCALL; - -/* Magic number sanity checker. */ -#define CB_SYSCALL_MAGIC 0x12344321 - -/* Macro to initialize CB_SYSCALL. Called first, before filling in - any fields. */ -#define CB_SYSCALL_INIT(sc) \ -do { \ - memset ((sc), 0, sizeof (*(sc))); \ - (sc)->magic = CB_SYSCALL_MAGIC; \ -} while (0) - -/* Return codes for various interface routines. */ - -typedef enum { - CB_RC_OK = 0, - /* generic error */ - CB_RC_ERR, - /* either file not found or no read access */ - CB_RC_ACCESS, - CB_RC_NO_MEM -} CB_RC; - -/* Read in target values for system call numbers, errno values, signals. */ -CB_RC cb_read_target_syscall_maps PARAMS ((host_callback *, const char *)); - -/* Translate target to host syscall function numbers. */ -int cb_target_to_host_syscall PARAMS ((host_callback *, int)); - -/* Translate host to target errno value. */ -int cb_host_to_target_errno PARAMS ((host_callback *, int)); - -/* Translate target to host open flags. */ -int cb_target_to_host_open PARAMS ((host_callback *, int)); - -/* Translate target signal number to host. */ -int cb_target_to_host_signal PARAMS ((host_callback *, int)); - -/* Translate host signal number to target. */ -int cb_host_to_target_signal PARAMS ((host_callback *, int)); - -/* Translate host stat struct to target. - If stat struct ptr is NULL, just compute target stat struct size. - Result is size of target stat struct or 0 if error. */ -int cb_host_to_target_stat PARAMS ((host_callback *, const struct stat *, PTR)); - -/* Perform a system call. */ -CB_RC cb_syscall PARAMS ((host_callback *, CB_SYSCALL *)); - -#endif diff --git a/contrib/binutils/include/elf/arm-oabi.h b/contrib/binutils/include/elf/arm-oabi.h deleted file mode 100644 index da5e7316eed6..000000000000 --- a/contrib/binutils/include/elf/arm-oabi.h +++ /dev/null @@ -1,88 +0,0 @@ -/* ARM ELF support for BFD. - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - - 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. */ - -#ifndef _ELF_ARM_H -#define _ELF_ARM_H - -#include "elf/reloc-macros.h" - -/* Processor specific flags for the ELF header e_flags field. */ -#define EF_ARM_RELEXEC 0x01 -#define EF_ARM_HASENTRY 0x02 -#define EF_INTERWORK 0x04 -#define EF_APCS_26 0x08 -#define EF_APCS_FLOAT 0x10 -#define EF_PIC 0x20 -#define EF_ALIGN8 0x40 /* 8-bit structure alignment is in use. */ -#define EF_NEW_ABI 0x80 -#define EF_OLD_ABI 0x100 - -/* Local aliases for some flags to match names used by COFF port. */ -#define F_INTERWORK EF_INTERWORK -#define F_APCS26 EF_APCS_26 -#define F_APCS_FLOAT EF_APCS_FLOAT -#define F_PIC EF_PIC - -/* Additional symbol types for Thumb. */ -#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */ -#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */ - -/* ARM-specific values for sh_flags. */ -#define SHF_ENTRYSECT 0x10000000 /* Section contains an entry point. */ -#define SHF_COMDEF 0x80000000 /* Section may be multiply defined in the input to a link step. */ - -/* ARM-specific program header flags. */ -#define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base. */ - -/* Relocation types. */ -START_RELOC_NUMBERS (elf_arm_reloc_type) - RELOC_NUMBER (R_ARM_NONE, 0) - RELOC_NUMBER (R_ARM_PC24, 1) - RELOC_NUMBER (R_ARM_ABS32, 2) - RELOC_NUMBER (R_ARM_REL32, 3) - RELOC_NUMBER (R_ARM_ABS8, 4) - RELOC_NUMBER (R_ARM_ABS16, 5) - RELOC_NUMBER (R_ARM_ABS12, 6) - RELOC_NUMBER (R_ARM_THM_ABS5, 7) - RELOC_NUMBER (R_ARM_THM_PC22, 8) - RELOC_NUMBER (R_ARM_SBREL32, 9) - RELOC_NUMBER (R_ARM_AMP_VCALL9, 10) - RELOC_NUMBER (R_ARM_THM_PC11, 11) /* Cygnus extension to abi: Thumb unconditional branch. */ - RELOC_NUMBER (R_ARM_THM_PC9, 12) /* Cygnus extension to abi: Thumb conditional branch. */ - RELOC_NUMBER (R_ARM_GNU_VTINHERIT, 13) - RELOC_NUMBER (R_ARM_GNU_VTENTRY, 14) - RELOC_NUMBER (R_ARM_COPY, 20) /* Copy symbol at runtime. */ - RELOC_NUMBER (R_ARM_GLOB_DAT, 21) /* Create GOT entry. */ - RELOC_NUMBER (R_ARM_JUMP_SLOT, 22) /* Create PLT entry. */ - RELOC_NUMBER (R_ARM_RELATIVE, 23) /* Adjust by program base. */ - RELOC_NUMBER (R_ARM_GOTOFF, 24) /* 32 bit offset to GOT. */ - RELOC_NUMBER (R_ARM_GOTPC, 25) /* 32 bit PC relative offset to GOT. */ - RELOC_NUMBER (R_ARM_GOT32, 26) /* 32 bit GOT entry. */ - RELOC_NUMBER (R_ARM_PLT32, 27) /* 32 bit PLT address. */ - FAKE_RELOC (FIRST_INVALID_RELOC, 28) - FAKE_RELOC (LAST_INVALID_RELOC, 249) - RELOC_NUMBER (R_ARM_RSBREL32, 250) - RELOC_NUMBER (R_ARM_THM_RPC22, 251) - RELOC_NUMBER (R_ARM_RREL32, 252) - RELOC_NUMBER (R_ARM_RABS32, 253) - RELOC_NUMBER (R_ARM_RPC24, 254) - RELOC_NUMBER (R_ARM_RBASE, 255) -END_RELOC_NUMBERS - -#endif diff --git a/contrib/binutils/include/elf/po/Make-in b/contrib/binutils/include/elf/po/Make-in deleted file mode 100644 index 0552db1feef3..000000000000 --- a/contrib/binutils/include/elf/po/Make-in +++ /dev/null @@ -1,251 +0,0 @@ -# Makefile for program source directory in GNU NLS utilities package. -# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu> -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ - -SHELL = /bin/sh -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -datadir = $(prefix)/@DATADIRNAME@ -localedir = $(datadir)/locale -gnulocaledir = $(prefix)/share/locale -gettextsrcdir = $(prefix)/share/gettext/po -subdir = po - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -MKINSTALLDIRS = @MKINSTALLDIRS@ - -CC = @CC@ -GENCAT = @GENCAT@ -GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ -MSGFMT = @MSGFMT@ -XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ -MSGMERGE = PATH=../src:$$PATH msgmerge - -DEFS = @DEFS@ -CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ - -INCLUDES = -I.. -I$(top_srcdir)/intl - -COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) - -SOURCES = cat-id-tbl.c -POFILES = @POFILES@ -GMOFILES = @GMOFILES@ -DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ -stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) - -POTFILES = \ - -CATALOGS = @CATALOGS@ -CATOBJEXT = @CATOBJEXT@ -INSTOBJEXT = @INSTOBJEXT@ - -.SUFFIXES: -.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat - -.c.o: - $(COMPILE) $< - -.po.pox: - $(MAKE) $(PACKAGE).pot - $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox - -.po.mo: - $(MSGFMT) -o $@ $< - -.po.gmo: - file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ - && rm -f $$file && $(GMSGFMT) -o $$file $< - -.po.cat: - sed -f ../intl/po2msg.sed < $< > $*.msg \ - && rm -f $@ && $(GENCAT) $@ $*.msg - - -all: all-@USE_NLS@ - -all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot -all-no: - -$(srcdir)/$(PACKAGE).pot: $(POTFILES) - $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ - --add-comments --keyword=_ --keyword=N_ \ - --files-from=$(srcdir)/POTFILES.in - rm -f $(srcdir)/$(PACKAGE).pot - mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot - -$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: -$(srcdir)/stamp-cat-id: $(PACKAGE).pot - rm -f cat-id-tbl.tmp - sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ - | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp - if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ - rm cat-id-tbl.tmp; \ - else \ - echo cat-id-tbl.c changed; \ - rm -f $(srcdir)/cat-id-tbl.c; \ - mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ - fi - cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id - - -install: install-exec install-data -install-exec: -install-info: -install-data: install-data-@USE_NLS@ -install-data-no: all -install-data-yes: all - if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(datadir); \ - else \ - $(top_srcdir)/mkinstalldirs $(datadir); \ - fi - @catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - case "$$cat" in \ - *.gmo) destdir=$(gnulocaledir);; \ - *) destdir=$(localedir);; \ - esac; \ - lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - dir=$$destdir/$$lang/LC_MESSAGES; \ - if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $$dir; \ - else \ - $(top_srcdir)/mkinstalldirs $$dir; \ - fi; \ - if test -r $$cat; then \ - $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ - echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ - else \ - $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ - echo "installing $(srcdir)/$$cat as" \ - "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ - fi; \ - if test -r $$cat.m; then \ - $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ - echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ - else \ - if test -r $(srcdir)/$$cat.m ; then \ - $(INSTALL_DATA) $(srcdir)/$$cat.m \ - $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ - echo "installing $(srcdir)/$$cat as" \ - "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ - else \ - true; \ - fi; \ - fi; \ - done - if test "$(PACKAGE)" = "gettext"; then \ - if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(gettextsrcdir); \ - else \ - $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ - fi; \ - $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ - $(gettextsrcdir)/Makefile.in.in; \ - else \ - : ; \ - fi - -# Define this as empty until I found a useful application. -installcheck: - -uninstall: - catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ - done - rm -f $(gettextsrcdir)/po-Makefile.in.in - -check: all - -cat-id-tbl.o: ../intl/libgettext.h - -dvi info tags TAGS ID: - -mostlyclean: - rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp - rm -fr *.o - -clean: mostlyclean - -distclean: clean - rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m - -maintainer-clean: distclean - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - rm -f $(GMOFILES) - -distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) -dist distdir: update-po $(DISTFILES) - dists="$(DISTFILES)"; \ - for file in $$dists; do \ - ln $(srcdir)/$$file $(distdir) 2> /dev/null \ - || cp -p $(srcdir)/$$file $(distdir); \ - done - -update-po: Makefile - $(MAKE) $(PACKAGE).pot - PATH=`pwd`/../src:$$PATH; \ - cd $(srcdir); \ - catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - mv $$lang.po $$lang.old.po; \ - echo "$$lang:"; \ - if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ - rm -f $$lang.old.po; \ - else \ - echo "msgmerge for $$cat failed!"; \ - rm -f $$lang.po; \ - mv $$lang.old.po $$lang.po; \ - fi; \ - done - -POTFILES: POTFILES.in - ( if test 'x$(srcdir)' != 'x.'; then \ - posrcprefix='$(top_srcdir)/'; \ - else \ - posrcprefix="../"; \ - fi; \ - rm -f $@-t $@ \ - && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ - -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ - | sed -e '$$s/\\$$//') > $@-t \ - && chmod a-w $@-t \ - && mv $@-t $@ ) - -POTFILES.in: @MAINT@ ../Makefile - cd .. && $(MAKE) po/POTFILES.in - -Makefile: Make-in ../config.status POTFILES - cd .. \ - && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \ - CONFIG_HEADERS= $(SHELL) ./config.status - -# Tell versions [3.59,3.63) of GNU make not to export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/contrib/binutils/include/elf/po/POTFILES.in b/contrib/binutils/include/elf/po/POTFILES.in deleted file mode 100644 index a3a05867fb25..000000000000 --- a/contrib/binutils/include/elf/po/POTFILES.in +++ /dev/null @@ -1,55 +0,0 @@ -addr2line.c -ar.c -arsup.c -arsup.h -bucomm.c -bucomm.h -budbg.h -coffdump.c -coffgrok.c -coffgrok.h -debug.c -debug.c -debug.h -dlltool.c -dlltool.h -dllwrap.c -dyn-string.c -dyn-string.h -filemode.c -ieee.c -ieee.c -is-ranlib.c -is-strip.c -maybe-ranlib.c -maybe-strip.c -nlmconv.c -nlmconv.h -nm.c -not-ranlib.c -not-strip.c -objcopy.c -objdump.c -prdbg.c -rdcoff.c -rdcoff.c -rddbg.c -rddbg.c -readelf.c -rename.c -resbin.c -rescoff.c -resrc.c -resres.c -size.c -srconv.c -stabs.c -stabs.c -strings.c -sysdump.c -version.c -windres.c -windres.h -winduni.c -winduni.h -wrstabs.c diff --git a/contrib/binutils/include/elf/po/binutils.pot b/contrib/binutils/include/elf/po/binutils.pot deleted file mode 100644 index ed7ba0c4282b..000000000000 --- a/contrib/binutils/include/elf/po/binutils.pot +++ /dev/null @@ -1,3756 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Free Software Foundation, Inc. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-04-05 14:09+0930\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: ENCODING\n" - -#: addr2line.c:76 -#, c-format -msgid "" -"Usage: %s [-CfsHV] [-b bfdname] [--target=bfdname]\n" -" [-e executable] [--exe=executable] [--demangle]\n" -" [--basenames] [--functions] [addr addr ...]\n" -msgstr "" - -#: addr2line.c:83 ar.c:286 nlmconv.c:1141 nm.c:306 objcopy.c:358 objcopy.c:390 -#: objdump.c:277 readelf.c:1703 size.c:89 strings.c:512 windres.c:737 -#, c-format -msgid "Report bugs to %s\n" -msgstr "" - -#: addr2line.c:243 -#, c-format -msgid "%s: can not get addresses from archive" -msgstr "" - -#: ar.c:235 -#, c-format -msgid "no entry %s in archive\n" -msgstr "" - -#: ar.c:252 -#, c-format -msgid "" -"Usage: %s [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file " -"file...\n" -msgstr "" - -#: ar.c:255 -#, c-format -msgid " %s -M [<mri-script]\n" -msgstr "" - -#: ar.c:256 -msgid " commands:\n" -msgstr "" - -#: ar.c:257 -msgid " d - delete file(s) from the archive\n" -msgstr "" - -#: ar.c:258 -msgid " m[ab] - move file(s) in the archive\n" -msgstr "" - -#: ar.c:259 -msgid " p - print file(s) found in the archive\n" -msgstr "" - -#: ar.c:260 -msgid " q[f] - quick append file(s) to the archive\n" -msgstr "" - -#: ar.c:261 -msgid "" -" r[ab][f][u] - replace existing or insert new file(s) into the archive\n" -msgstr "" - -#: ar.c:262 -msgid " t - display contents of archive\n" -msgstr "" - -#: ar.c:263 -msgid " x[o] - extract file(s) from the archive\n" -msgstr "" - -#: ar.c:264 -msgid " command specific modifiers:\n" -msgstr "" - -#: ar.c:265 -msgid " [a] - put file(s) after [member-name]\n" -msgstr "" - -#: ar.c:266 -msgid " [b] - put file(s) before [member-name] (same as [i])\n" -msgstr "" - -#: ar.c:267 -msgid " [N] - use instance [count] of name\n" -msgstr "" - -#: ar.c:268 -msgid " [f] - truncate inserted file names\n" -msgstr "" - -#: ar.c:269 -msgid " [P] - use full path names when matching\n" -msgstr "" - -#: ar.c:270 -msgid " [o] - preserve original dates\n" -msgstr "" - -#: ar.c:271 -msgid "" -" [u] - only replace files that are newer than current archive " -"contents\n" -msgstr "" - -#: ar.c:272 -msgid " generic modifiers:\n" -msgstr "" - -#: ar.c:273 -msgid " [c] - do not warn if the library had to be created\n" -msgstr "" - -#: ar.c:274 -msgid " [s] - create an archive index (cf. ranlib)\n" -msgstr "" - -#: ar.c:275 -msgid " [S] - do not build a symbol table\n" -msgstr "" - -#: ar.c:276 -msgid " [v] - be verbose\n" -msgstr "" - -#: ar.c:277 -msgid " [V] - display the version number\n" -msgstr "" - -#: ar.c:281 -#, c-format -msgid "Usage: %s [-vV] archive\n" -msgstr "" - -#: ar.c:466 -msgid "two different operation options specified" -msgstr "" - -#: ar.c:541 -#, c-format -msgid "%s: illegal option -- %c\n" -msgstr "" - -#: ar.c:573 -msgid "no operation specified" -msgstr "" - -#: ar.c:576 -msgid "`u' is only meaningful with the `r' option." -msgstr "" - -#: ar.c:586 -msgid "`N' is only meaningful with the `x' and 'd' options." -msgstr "" - -#: ar.c:589 -msgid "Value for `N' must be positive." -msgstr "" - -#: ar.c:672 -#, c-format -msgid "%s: internal error -- this option not implemented\n" -msgstr "" - -#: ar.c:790 ar.c:841 ar.c:1283 objcopy.c:1104 -#, c-format -msgid "internal stat error on %s" -msgstr "" - -#: ar.c:810 ar.c:878 -#, c-format -msgid "%s is not a valid archive" -msgstr "" - -#: ar.c:846 -#, c-format -msgid "stat returns negative size for %s" -msgstr "" - -#: ar.c:967 -#, c-format -msgid "%s is not an archive" -msgstr "" - -#: ar.c:974 -#, c-format -msgid "%s: creating %s\n" -msgstr "" - -#: ar.c:1181 -#, c-format -msgid "No member named `%s'\n" -msgstr "" - -#: ar.c:1233 -#, c-format -msgid "%s: no entry %s in archive %s!\n" -msgstr "" - -#: ar.c:1395 -#, c-format -msgid "%s: no archive map to update" -msgstr "" - -#: arsup.c:87 -#, c-format -msgid "No entry %s in archive.\n" -msgstr "" - -#: arsup.c:119 -#, c-format -msgid "Can't open file %s\n" -msgstr "" - -#: arsup.c:167 -#, c-format -msgid "%s: Can't open output archive %s\n" -msgstr "" - -#: arsup.c:179 -#, c-format -msgid "%s: Can't open input archive %s\n" -msgstr "" - -#: arsup.c:185 -#, c-format -msgid "%s: file %s is not an archive\n" -msgstr "" - -#: arsup.c:226 -#, c-format -msgid "%s: no output archive specified yet\n" -msgstr "" - -#: arsup.c:246 arsup.c:281 arsup.c:317 arsup.c:337 arsup.c:395 -#, c-format -msgid "%s: no open output archive\n" -msgstr "" - -#: arsup.c:254 arsup.c:355 arsup.c:375 -#, c-format -msgid "%s: can't open file %s\n" -msgstr "" - -#: arsup.c:302 arsup.c:371 arsup.c:450 -#, c-format -msgid "%s: can't find module file %s\n" -msgstr "" - -#: arsup.c:402 -#, c-format -msgid "Current open archive is %s\n" -msgstr "" - -#: arsup.c:429 -#, c-format -msgid "%s: no open archive\n" -msgstr "" - -#: bucomm.c:139 -#, c-format -msgid "can't set BFD default target to `%s': %s" -msgstr "" - -#: bucomm.c:151 -#, c-format -msgid "%s: Matching formats:" -msgstr "" - -#: bucomm.c:168 -msgid "Supported targets:" -msgstr "" - -#: bucomm.c:170 -#, c-format -msgid "%s: supported targets:" -msgstr "" - -#: bucomm.c:263 -#, c-format -msgid "%s: bad number: %s" -msgstr "" - -#: coffdump.c:94 -#, c-format -msgid "#lines %d " -msgstr "" - -#: coffdump.c:456 sysdump.c:719 -#, c-format -msgid "%s: Print a human readable interpretation of a SYSROFF object file\n" -msgstr "" - -#: coffdump.c:498 srconv.c:1940 sysdump.c:755 -#, c-format -msgid "GNU %s version %s\n" -msgstr "" - -#: coffdump.c:516 srconv.c:1977 sysdump.c:775 -#, c-format -msgid "%s: no input file specified\n" -msgstr "" - -#: debug.c:653 -msgid "debug_add_to_current_namespace: no current file" -msgstr "" - -#: debug.c:736 -msgid "debug_start_source: no debug_set_filename call" -msgstr "" - -#: debug.c:795 -msgid "debug_record_function: no debug_set_filename call" -msgstr "" - -#: debug.c:851 -msgid "debug_record_parameter: no current function" -msgstr "" - -#: debug.c:885 -msgid "debug_end_function: no current function" -msgstr "" - -#: debug.c:891 -msgid "debug_end_function: some blocks were not closed" -msgstr "" - -#: debug.c:921 -msgid "debug_start_block: no current block" -msgstr "" - -#: debug.c:959 -msgid "debug_end_block: no current block" -msgstr "" - -#: debug.c:966 -msgid "debug_end_block: attempt to close top level block" -msgstr "" - -#: debug.c:992 -msgid "debug_record_line: no current unit" -msgstr "" - -#. FIXME -#: debug.c:1046 -msgid "debug_start_common_block: not implemented" -msgstr "" - -#. FIXME -#: debug.c:1058 -msgid "debug_end_common_block: not implemented" -msgstr "" - -#. FIXME. -#: debug.c:1152 -msgid "debug_record_label not implemented" -msgstr "" - -#: debug.c:1178 -msgid "debug_record_variable: no current file" -msgstr "" - -#: debug.c:1194 -msgid "debug_record_variable: no current block" -msgstr "" - -#: debug.c:1764 -msgid "debug_make_undefined_type: unsupported kind" -msgstr "" - -#: debug.c:1970 -msgid "debug_name_type: no current file" -msgstr "" - -#: debug.c:2018 -msgid "debug_tag_type: no current file" -msgstr "" - -#: debug.c:2026 -msgid "debug_tag_type: extra tag attempted" -msgstr "" - -#: debug.c:2066 -#, c-format -msgid "Warning: changing type size from %d to %d\n" -msgstr "" - -#: debug.c:2090 -msgid "debug_find_named_type: no current compilation unit" -msgstr "" - -#: debug.c:2197 -#, c-format -msgid "debug_get_real_type: circular debug information for %s\n" -msgstr "" - -#: debug.c:2662 -msgid "debug_write_type: illegal type encountered" -msgstr "" - -#: dlltool.c:770 dlltool.c:794 dlltool.c:819 -#, c-format -msgid "Internal error: Unknown machine type: %d\n" -msgstr "" - -#: dlltool.c:856 -#, c-format -msgid "Can't open def file: %s" -msgstr "" - -#: dlltool.c:861 -#, c-format -msgid "Processing def file: %s" -msgstr "" - -#: dlltool.c:865 -msgid "Processed def file" -msgstr "" - -#: dlltool.c:890 -#, c-format -msgid "Syntax error in def file %s:%d\n" -msgstr "" - -#: dlltool.c:923 -#, c-format -msgid "NAME: %s base: %x" -msgstr "" - -#: dlltool.c:926 -msgid "Can't have LIBRARY and NAME\n" -msgstr "" - -#: dlltool.c:942 -#, c-format -msgid "LIBRARY: %s base: %x" -msgstr "" - -#: dlltool.c:945 -#, c-format -msgid "%s: Can't have LIBRARY and NAME\n" -msgstr "" - -#: dlltool.c:1200 resrc.c:271 -#, c-format -msgid "wait: %s" -msgstr "" - -#: dlltool.c:1205 resrc.c:276 -#, c-format -msgid "subprocess got fatal signal %d" -msgstr "" - -#: dlltool.c:1211 -#, c-format -msgid "%s exited with status %d\n" -msgstr "" - -#: dlltool.c:1243 -#, c-format -msgid "Sucking in info from %s section in %s\n" -msgstr "" - -#: dlltool.c:1367 -#, c-format -msgid "Excluding symbol: %s\n" -msgstr "" - -#: dlltool.c:1462 dlltool.c:1473 nm.c:904 nm.c:915 objdump.c:444 objdump.c:461 -#, c-format -msgid "%s: no symbols\n" -msgstr "" - -#. FIXME: we ought to read in and block out the base relocations -#: dlltool.c:1500 -#, c-format -msgid "Done reading %s\n" -msgstr "" - -#: dlltool.c:1511 -#, c-format -msgid "Unable to open object file: %s" -msgstr "" - -#: dlltool.c:1514 -#, c-format -msgid "Scanning object file %s" -msgstr "" - -#: dlltool.c:1529 -#, c-format -msgid "Cannot produce mcore-elf dll from archive file: %s" -msgstr "" - -#: dlltool.c:1621 -msgid "Adding exports to output file" -msgstr "" - -#: dlltool.c:1666 -msgid "Added exports to output file" -msgstr "" - -#: dlltool.c:1790 -#, c-format -msgid "Generating export file: %s\n" -msgstr "" - -#: dlltool.c:1795 -#, c-format -msgid "Unable to open temporary assembler file: %s" -msgstr "" - -#: dlltool.c:1798 -#, c-format -msgid "Opened temporary file: %s" -msgstr "" - -#: dlltool.c:2012 -msgid "Generated exports file" -msgstr "" - -#: dlltool.c:2267 -#, c-format -msgid "bfd_open failed open stub file: %s" -msgstr "" - -#: dlltool.c:2270 -#, c-format -msgid "Creating stub file: %s" -msgstr "" - -#: dlltool.c:2657 -#, c-format -msgid "failed to open temporary head file: %s" -msgstr "" - -#: dlltool.c:2716 -#, c-format -msgid "failed to open temporary tail file: %s" -msgstr "" - -#: dlltool.c:2784 -#, c-format -msgid "Can't open .lib file: %s" -msgstr "" - -#: dlltool.c:2787 -#, c-format -msgid "Creating library file: %s\n" -msgstr "" - -#: dlltool.c:2846 -#, c-format -msgid "cannot delete %s: %s\n" -msgstr "" - -#: dlltool.c:2850 -msgid "Created lib file" -msgstr "" - -#: dlltool.c:2955 -#, c-format -msgid "Warning, ignoring duplicate EXPORT %s %d,%d\n" -msgstr "" - -#: dlltool.c:2961 -#, c-format -msgid "Error, duplicate EXPORT with oridinals: %s" -msgstr "" - -#: dlltool.c:3088 -msgid "Processing definitions" -msgstr "" - -#: dlltool.c:3126 -msgid "Processed definitions" -msgstr "" - -#. xgetext:c-format -#: dlltool.c:3137 -#, c-format -msgid "Usage %s <options> <object-files>\n" -msgstr "" - -#. xgetext:c-format -#: dlltool.c:3139 -#, c-format -msgid "" -" -m --machine <machine> Create as DLL for <machine>. [default: %s]\n" -msgstr "" - -#: dlltool.c:3140 -msgid "" -" possible <machine>: arm[_interwork], i386, mcore[-elf]{-le|-be}, " -"ppc, thumb\n" -msgstr "" - -#: dlltool.c:3141 -msgid " -e --output-exp <outname> Generate an export file.\n" -msgstr "" - -#: dlltool.c:3142 -msgid " -l --output-lib <outname> Generate an interface library.\n" -msgstr "" - -#: dlltool.c:3143 -msgid " -a --add-indirect Add dll indirects to export file.\n" -msgstr "" - -#: dlltool.c:3144 -msgid "" -" -D --dllname <name> Name of input dll to put into interface lib.\n" -msgstr "" - -#: dlltool.c:3145 -msgid " -d --input-def <deffile> Name of .def file to be read in.\n" -msgstr "" - -#: dlltool.c:3146 -msgid " -z --output-def <deffile> Name of .def file to be created.\n" -msgstr "" - -#: dlltool.c:3147 -msgid " --export-all-symbols Export all symbols to .def\n" -msgstr "" - -#: dlltool.c:3148 -msgid " --no-export-all-symbols Only export listed symbols\n" -msgstr "" - -#: dlltool.c:3149 -msgid " --exclude-symbols <list> Don't export <list>\n" -msgstr "" - -#: dlltool.c:3150 -msgid " --no-default-excludes Clear default exclude symbols\n" -msgstr "" - -#: dlltool.c:3151 -msgid " -b --base-file <basefile> Read linker generated base file.\n" -msgstr "" - -#: dlltool.c:3152 -msgid " -x --no-idata4 Don't generate idata$4 section.\n" -msgstr "" - -#: dlltool.c:3153 -msgid " -c --no-idata5 Don't generate idata$5 section.\n" -msgstr "" - -#: dlltool.c:3154 -msgid "" -" -U --add-underscore Add underscores to symbols in interface " -"library.\n" -msgstr "" - -#: dlltool.c:3155 -msgid " -k --kill-at Kill @<n> from exported names.\n" -msgstr "" - -#: dlltool.c:3156 -msgid " -A --add-stdcall-alias Add aliases without @<n>.\n" -msgstr "" - -#: dlltool.c:3157 -msgid " -S --as <name> Use <name> for assembler.\n" -msgstr "" - -#: dlltool.c:3158 -msgid " -f --as-flags <flags> Pass <flags> to the assembler.\n" -msgstr "" - -#: dlltool.c:3159 -msgid "" -" -C --compat-implib Create backward compatible import library.\n" -msgstr "" - -#: dlltool.c:3160 -msgid "" -" -n --no-delete Keep temp files (repeat for extra " -"preservation).\n" -msgstr "" - -#: dlltool.c:3161 -msgid " -v --verbose Be verbose.\n" -msgstr "" - -#: dlltool.c:3162 -msgid " -V --version Display the program version.\n" -msgstr "" - -#: dlltool.c:3163 -msgid " -h --help Display this information.\n" -msgstr "" - -#: dlltool.c:3165 -msgid "" -" -M --mcore-elf <outname> Process mcore-elf object files into <outname>.\n" -msgstr "" - -#: dlltool.c:3166 -msgid " -L --linker <name> Use <name> as the linker.\n" -msgstr "" - -#: dlltool.c:3167 -msgid " -F --linker-flags <flags> Pass <flags> to the linker.\n" -msgstr "" - -#: dlltool.c:3311 -#, c-format -msgid "Unable to open base-file: %s" -msgstr "" - -#: dlltool.c:3340 -#, c-format -msgid "Machine '%s' not supported" -msgstr "" - -#: dlltool.c:3443 dllwrap.c:215 -#, c-format -msgid "Tried file: %s" -msgstr "" - -#: dlltool.c:3450 dllwrap.c:222 -#, c-format -msgid "Using file: %s" -msgstr "" - -#: ieee.c:316 -msgid "unexpected end of debugging information" -msgstr "" - -#: ieee.c:411 -msgid "invalid number" -msgstr "" - -#: ieee.c:470 -msgid "invalid string length" -msgstr "" - -#: ieee.c:527 ieee.c:568 -msgid "expression stack overflow" -msgstr "" - -#: ieee.c:547 -msgid "unsupported IEEE expression operator" -msgstr "" - -#: ieee.c:562 -msgid "unknown section" -msgstr "" - -#: ieee.c:583 -msgid "expression stack underflow" -msgstr "" - -#: ieee.c:597 -msgid "expression stack mismatch" -msgstr "" - -#: ieee.c:636 -msgid "unknown builtin type" -msgstr "" - -#: ieee.c:781 -msgid "BCD float type not supported" -msgstr "" - -#: ieee.c:927 -msgid "unexpected number" -msgstr "" - -#: ieee.c:934 -msgid "unexpected record type" -msgstr "" - -#: ieee.c:967 -msgid "blocks left on stack at end" -msgstr "" - -#: ieee.c:1232 -msgid "unknown BB type" -msgstr "" - -#: ieee.c:1241 -msgid "stack overflow" -msgstr "" - -#: ieee.c:1266 -msgid "stack underflow" -msgstr "" - -#: ieee.c:1380 ieee.c:1452 ieee.c:2151 -msgid "illegal variable index" -msgstr "" - -#: ieee.c:1430 -msgid "illegal type index" -msgstr "" - -#: ieee.c:1440 ieee.c:1477 -msgid "unknown TY code" -msgstr "" - -#: ieee.c:1459 -msgid "undefined variable in TY" -msgstr "" - -#. Pascal file name. FIXME. -#: ieee.c:1870 -msgid "Pascal file name not supported" -msgstr "" - -#: ieee.c:1918 -msgid "unsupported qualifer" -msgstr "" - -#: ieee.c:2189 -msgid "undefined variable in ATN" -msgstr "" - -#: ieee.c:2232 -msgid "unknown ATN type" -msgstr "" - -#. Reserved for FORTRAN common. -#: ieee.c:2354 -msgid "unsupported ATN11" -msgstr "" - -#. We have no way to record this information. FIXME. -#: ieee.c:2381 -msgid "unsupported ATN12" -msgstr "" - -#: ieee.c:2441 -msgid "unexpected string in C++ misc" -msgstr "" - -#: ieee.c:2454 -msgid "bad misc record" -msgstr "" - -#: ieee.c:2497 -msgid "unrecognized C++ misc record" -msgstr "" - -#: ieee.c:2614 -msgid "undefined C++ object" -msgstr "" - -#: ieee.c:2648 -msgid "unrecognized C++ object spec" -msgstr "" - -#: ieee.c:2684 -msgid "unsupported C++ object type" -msgstr "" - -#: ieee.c:2694 -msgid "C++ base class not defined" -msgstr "" - -#: ieee.c:2706 ieee.c:2811 -msgid "C++ object has no fields" -msgstr "" - -#: ieee.c:2725 -msgid "C++ base class not found in container" -msgstr "" - -#: ieee.c:2832 -msgid "C++ data member not found in container" -msgstr "" - -#: ieee.c:2873 ieee.c:3023 -msgid "unknown C++ visibility" -msgstr "" - -#: ieee.c:2907 -msgid "bad C++ field bit pos or size" -msgstr "" - -#: ieee.c:2999 -msgid "bad type for C++ method function" -msgstr "" - -#: ieee.c:3009 -msgid "no type information for C++ method function" -msgstr "" - -#: ieee.c:3048 -msgid "C++ static virtual method" -msgstr "" - -#: ieee.c:3143 -msgid "unrecognized C++ object overhead spec" -msgstr "" - -#: ieee.c:3182 -msgid "undefined C++ vtable" -msgstr "" - -#: ieee.c:3253 -msgid "C++ default values not in a function" -msgstr "" - -#: ieee.c:3293 -msgid "unrecognized C++ default type" -msgstr "" - -#: ieee.c:3324 -msgid "reference parameter is not a pointer" -msgstr "" - -#: ieee.c:3409 -msgid "unrecognized C++ reference type" -msgstr "" - -#: ieee.c:3491 -msgid "C++ reference not found" -msgstr "" - -#: ieee.c:3499 -msgid "C++ reference is not pointer" -msgstr "" - -#: ieee.c:3528 ieee.c:3536 -msgid "missing required ASN" -msgstr "" - -#: ieee.c:3566 ieee.c:3574 -msgid "missing required ATN65" -msgstr "" - -#: ieee.c:3588 -msgid "bad ATN65 record" -msgstr "" - -#: ieee.c:4235 -msgid "IEEE numeric overflow: 0x" -msgstr "" - -#: ieee.c:4281 -#, c-format -msgid "IEEE string length overflow: %u\n" -msgstr "" - -#: ieee.c:5315 -#, c-format -msgid "IEEE unsupported integer type size %u\n" -msgstr "" - -#: ieee.c:5351 -#, c-format -msgid "IEEE unsupported float type size %u\n" -msgstr "" - -#: ieee.c:5387 -#, c-format -msgid "IEEE unsupported complex type size %u\n" -msgstr "" - -#: nlmconv.c:275 srconv.c:1966 -#, c-format -msgid "%s: input and output files must be different\n" -msgstr "" - -#: nlmconv.c:325 -#, c-format -msgid "%s: input file named both on command line and with INPUT\n" -msgstr "" - -#: nlmconv.c:336 -#, c-format -msgid "%s: no input file\n" -msgstr "" - -#: nlmconv.c:366 -#, c-format -msgid "%s: no name for output file\n" -msgstr "" - -#: nlmconv.c:381 -#, c-format -msgid "%s: warning:input and output formats are not compatible\n" -msgstr "" - -#: nlmconv.c:411 -msgid "make .bss section" -msgstr "" - -#: nlmconv.c:420 -msgid "make .nlmsections section" -msgstr "" - -#: nlmconv.c:422 -msgid "set .nlmsections flags" -msgstr "" - -#: nlmconv.c:450 -msgid "set .bss vma" -msgstr "" - -#: nlmconv.c:457 -msgid "set .data size" -msgstr "" - -#: nlmconv.c:638 -#, c-format -msgid "%s: warning: symbol %s imported but not in import list\n" -msgstr "" - -#: nlmconv.c:658 -msgid "set start address" -msgstr "" - -#: nlmconv.c:707 -#, c-format -msgid "%s: warning: START procedure %s not defined\n" -msgstr "" - -#: nlmconv.c:710 -#, c-format -msgid "%s: warning: EXIT procedure %s not defined\n" -msgstr "" - -#: nlmconv.c:714 -#, c-format -msgid "%s: warning: CHECK procedure %s not defined\n" -msgstr "" - -#: nlmconv.c:736 nlmconv.c:928 -msgid "custom section" -msgstr "" - -#: nlmconv.c:757 nlmconv.c:960 -msgid "help section" -msgstr "" - -#: nlmconv.c:779 nlmconv.c:979 -msgid "message section" -msgstr "" - -#: nlmconv.c:795 nlmconv.c:1012 -msgid "module section" -msgstr "" - -#: nlmconv.c:815 nlmconv.c:1029 -msgid "rpc section" -msgstr "" - -#: nlmconv.c:852 -#, c-format -msgid "%s:%s: warning: shared libraries can not have uninitialized data\n" -msgstr "" - -#: nlmconv.c:873 nlmconv.c:1049 -msgid "shared section" -msgstr "" - -#: nlmconv.c:881 -#, c-format -msgid "%s: warning: No version number given\n" -msgstr "" - -#: nlmconv.c:922 nlmconv.c:954 nlmconv.c:973 nlmconv.c:1023 nlmconv.c:1043 -#, c-format -msgid "%s:%s: read: %s\n" -msgstr "" - -#: nlmconv.c:946 -#, c-format -msgid "%s: warning: MAP and FULLMAP are not supported; try ld -M\n" -msgstr "" - -#: nlmconv.c:1121 -#, c-format -msgid "%s: Convert an object file into a NetWare Loadable Module\n" -msgstr "" - -#: nlmconv.c:1133 -#, c-format -msgid "" -"Usage: %s [-dhV] [-I bfdname] [-O bfdname] [-T header-file] [-l linker]\n" -" [--input-target=bfdname] [--output-target=bfdname]\n" -" [--header-file=file] [--linker=linker] [--debug]\n" -" [--help] [--version]\n" -" [in-file [out-file]]\n" -msgstr "" - -#: nlmconv.c:1173 -#, c-format -msgid "%s: support not compiled in for %s\n" -msgstr "" - -#: nlmconv.c:1216 -msgid "make section" -msgstr "" - -#: nlmconv.c:1230 -msgid "set section size" -msgstr "" - -#: nlmconv.c:1236 -msgid "set section alignment" -msgstr "" - -#: nlmconv.c:1240 -msgid "set section flags" -msgstr "" - -#: nlmconv.c:1251 -msgid "set .nlmsections size" -msgstr "" - -#: nlmconv.c:1339 nlmconv.c:1347 nlmconv.c:1356 nlmconv.c:1361 -msgid "set .nlmsection contents" -msgstr "" - -#: nlmconv.c:1864 -msgid "stub section sizes" -msgstr "" - -#: nlmconv.c:1913 -msgid "writing stub" -msgstr "" - -#: nlmconv.c:2003 -#, c-format -msgid "%s: unresolved PC relative reloc against %s\n" -msgstr "" - -#: nlmconv.c:2068 -#, c-format -msgid "%s: overflow when adjusting relocation against %s\n" -msgstr "" - -#: nlmconv.c:2191 -#, c-format -msgid "%s: execution of %s failed: " -msgstr "" - -#: nlmconv.c:2206 -#, c-format -msgid "%s: Execution of %s failed\n" -msgstr "" - -#: nm.c:294 -#, c-format -msgid "" -"Usage: %s [-aABCDglnopPrsuvV] [-t radix] [--radix=radix] [--target=bfdname]\n" -" [--debug-syms] [--extern-only] [--print-armap] [--print-file-name]\n" -" [--numeric-sort] [--no-sort] [--reverse-sort] [--size-sort]\n" -" [--undefined-only] [--portability] [-f {bsd,sysv,posix}]\n" -" [--format={bsd,sysv,posix}] [--demangle] [--no-demangle] [--dynamic]\n" -" [--defined-only] [--line-numbers]\n" -" [--version] [--help]\n" -" [file...]\n" -msgstr "" - -#: nm.c:339 -#, c-format -msgid "%s: %s: invalid radix\n" -msgstr "" - -#: nm.c:365 -#, c-format -msgid "%s: %s: invalid output format\n" -msgstr "" - -#: nm.c:492 -#, c-format -msgid "%s: data size %ld\n" -msgstr "" - -#: nm.c:1283 -#, c-format -msgid "" -"\n" -"\n" -"Undefined symbols from %s:\n" -"\n" -msgstr "" - -#: nm.c:1285 -#, c-format -msgid "" -"\n" -"\n" -"Symbols from %s:\n" -"\n" -msgstr "" - -#: nm.c:1286 nm.c:1340 -msgid "" -"Name Value Class Type Size Line " -"Section\n" -"\n" -msgstr "" - -#: nm.c:1337 -#, c-format -msgid "" -"\n" -"\n" -"Undefined symbols from %s[%s]:\n" -"\n" -msgstr "" - -#: nm.c:1339 -#, c-format -msgid "" -"\n" -"\n" -"Symbols from %s[%s]:\n" -"\n" -msgstr "" - -#: nm.c:1510 -msgid "" -"\n" -"Archive index:\n" -msgstr "" - -#: objcopy.c:309 -#, c-format -msgid "Usage: %s <switches> in-file [out-file]\n" -msgstr "" - -#: objcopy.c:310 objcopy.c:368 -msgid " The switches are:\n" -msgstr "" - -#: objcopy.c:311 -msgid "" -" -I --input-target <bfdname> Assume input file is in format <bfdname>\n" -" -O --output-target <bfdname> Create an output file in format " -"<bfdname>\n" -" -F --target <bfdname> Set both input and output format to " -"<bfdname>\n" -" --debugging Convert debugging information, if " -"possible\n" -" -p --preserve-dates Copy modified/access timestamps to the " -"output\n" -" -j --only-section <name> Only copy section <name> into the output\n" -" -R --remove-section <name> Remove section <name> from the output\n" -" -S --strip-all Remove all symbol and relocation " -"information\n" -" -g --strip-debug Remove all debugging symbols\n" -" --strip-unneeded Remove all symbols not needed by " -"relocations\n" -" -N --strip-symbol <name> Do not copy symbol <name>\n" -" -K --keep-symbol <name> Only copy symbol <name>\n" -" -L --localize-symbol <name> Force symbol <name> to be marked as a " -"local\n" -" -W --weaken-symbol <name> Force symbol <name> to be marked as a " -"weak\n" -" --weaken Force all global symbols to be marked as " -"weak\n" -" -x --discard-all Remove all non-global symbols\n" -" -X --discard-locals Remove any compiler-generated symbols\n" -" -i --interleave <number> Only copy one out of every <number> " -"bytes\n" -" -b --byte <num> Select byte <num> in every interleaved " -"block\n" -" --gap-fill <val> Fill gaps between sections with <val>\n" -" --pad-to <addr> Pad the last section up to address " -"<addr>\n" -" --set-start <addr> Set the start address to <addr>\n" -" {--change-start|--adjust-start} <incr>\n" -" Add <incr> to the start address\n" -" {--change-addresses|--adjust-vma} <incr>\n" -" Add <incr> to LMA, VMA and start " -"addresses\n" -" {--change-section-address|--adjust-section-vma} <name>{=|+|-}<val>\n" -" Change LMA and VMA of section <name> by " -"<val>\n" -" --change-section-lma <name>{=|+|-}<val>\n" -" Change the LMA of section <name> by " -"<val>\n" -" --change-section-vma <name>{=|+|-}<val>\n" -" Change the VMA of section <name> by " -"<val>\n" -" {--[no-]change-warnings|--[no-]adjust-warnings}\n" -" Warn if a named section does not exist\n" -" --set-section-flags <name>=<flags>\n" -" Set section <name>'s properties to " -"<flags>\n" -" --add-section <name>=<file> Add section <name> found in <file> to " -"output\n" -" --change-leading-char Force output format's leading character " -"style\n" -" --remove-leading-char Remove leading character from global " -"symbols\n" -" --redefine-sym <old>=<new> Redefine symbol name <old> to <new>\n" -" -v --verbose List all object files modified\n" -" -V --version Display this program's version number\n" -" -h --help Display this output\n" -msgstr "" - -#: objcopy.c:367 -#, c-format -msgid "Usage: %s <switches> in-file(s)\n" -msgstr "" - -#: objcopy.c:369 -msgid "" -" -I --input-target <bfdname> Assume input file is in format <bfdname>\n" -" -O --output-target <bfdname> Create an output file in format " -"<bfdname>\n" -" -F --target <bfdname> Set both input and output format to " -"<bfdname>\n" -" -p --preserve-dates Copy modified/access timestamps to the " -"output\n" -" -R --remove-section <name> Remove section <name> from the output\n" -" -s --strip-all Remove all symbol and relocation " -"information\n" -" -g -S --strip-debug Remove all debugging symbols\n" -" --strip-unneeded Remove all symbols not needed by " -"relocations\n" -" -N --strip-symbol <name> Do not copy symbol <name>\n" -" -K --keep-symbol <name> Only copy symbol <name>\n" -" -x --discard-all Remove all non-global symbols\n" -" -X --discard-locals Remove any compiler-generated symbols\n" -" -v --verbose List all object files modified\n" -" -V --version Display this program's version number\n" -" -h --help Display this output\n" -" -o <file> Place stripped output into <file>\n" -msgstr "" - -#: objcopy.c:439 -#, c-format -msgid "unrecognized section flag `%s'" -msgstr "" - -#: objcopy.c:440 -#, c-format -msgid "supported flags: %s" -msgstr "" - -#: objcopy.c:692 -#, c-format -msgid "%s: Multiple redefinition of symbol \"%s\"" -msgstr "" - -#: objcopy.c:699 -#, c-format -msgid "%s: Symbol \"%s\" is target of more than one redefinition" -msgstr "" - -#: objcopy.c:753 -#, c-format -msgid "copy from %s(%s) to %s(%s)\n" -msgstr "" - -#: objcopy.c:772 -#, c-format -msgid "Warning: Output file cannot represent architecture %s" -msgstr "" - -#: objcopy.c:799 -#, c-format -msgid "can't create section `%s': %s" -msgstr "" - -#: objcopy.c:885 -#, c-format -msgid "Can't fill gap after %s: %s" -msgstr "" - -#: objcopy.c:910 -#, c-format -msgid "Can't add padding to %s: %s" -msgstr "" - -#: objcopy.c:1048 -#, c-format -msgid "%s: error copying private BFD data: %s" -msgstr "" - -#: objcopy.c:1082 -#, c-format -msgid "cannot mkdir %s for archive copying (error: %s)" -msgstr "" - -#: objcopy.c:1351 -#, c-format -msgid "%s: section `%s': error in %s: %s" -msgstr "" - -#: objcopy.c:1625 -#, c-format -msgid "%s: can't create debugging section: %s" -msgstr "" - -#: objcopy.c:1640 -#, c-format -msgid "%s: can't set debugging section contents: %s" -msgstr "" - -#: objcopy.c:1649 -#, c-format -msgid "%s: don't know how to write debugging information for %s" -msgstr "" - -#: objcopy.c:1754 -#, c-format -msgid "%s: cannot stat: %s" -msgstr "" - -#: objcopy.c:1804 -msgid "byte number must be non-negative" -msgstr "" - -#: objcopy.c:1810 -msgid "interleave must be positive" -msgstr "" - -#: objcopy.c:1830 objcopy.c:1838 -#, c-format -msgid "%s both copied and removed" -msgstr "" - -#: objcopy.c:1907 objcopy.c:1977 objcopy.c:2078 objcopy.c:2106 -#, c-format -msgid "bad format for %s" -msgstr "" - -#: objcopy.c:1910 -#, c-format -msgid "cannot stat: %s: %s" -msgstr "" - -#: objcopy.c:1928 -#, c-format -msgid "cannot open: %s: %s" -msgstr "" - -#: objcopy.c:1932 -#, c-format -msgid "%s: fread failed" -msgstr "" - -#: objcopy.c:2046 -#, c-format -msgid "Warning: truncating gap-fill from 0x%s to 0x%x" -msgstr "" - -#: objcopy.c:2140 -msgid "byte number must be less than interleave" -msgstr "" - -#: objcopy.c:2159 -#, c-format -msgid "Cannot stat: %s: %s" -msgstr "" - -#: objcopy.c:2199 objcopy.c:2213 -#, c-format -msgid "%s %s%c0x%s never used" -msgstr "" - -#: objdump.c:229 -#, c-format -msgid "Usage: %s <switches> file(s)\n" -msgstr "" - -#: objdump.c:230 -msgid " At least one of the following switches must be given:\n" -msgstr "" - -#: objdump.c:231 -msgid "" -" -a --archive-headers Display archive header information\n" -" -f --file-headers Display the contents of the overall file header\n" -" -p --private-headers Display object format specific file header " -"contents\n" -" -h --[section-]headers Display the contents of the section headers\n" -" -x --all-headers Display the contents of all headers\n" -" -d --disassemble Display assembler contents of executable " -"sections\n" -" -D --disassemble-all Display assembler contents of all sections\n" -" -S --source Intermix source code with disassembly\n" -" -s --full-contents Display the full contents of all sections " -"requested\n" -" -g --debugging Display debug information in object file\n" -" -G --stabs Display the STABS contents of an ELF format file\n" -" -t --syms Display the contents of the symbol table(s)\n" -" -T --dynamic-syms Display the contents of the dynamic symbol table\n" -" -r --reloc Display the relocation entries in the file\n" -" -R --dynamic-reloc Display the dynamic relocation entries in the " -"file\n" -" -V --version Display this program's version number\n" -" -i --info List object formats and architectures supported\n" -" -H --help Display this information\n" -msgstr "" - -#: objdump.c:253 -msgid "" -"\n" -" The following switches are optional:\n" -msgstr "" - -#: objdump.c:254 -msgid "" -" -b --target <bfdname> Specify the target object format as " -"<bfdname>\n" -" -m --architecture <machine> Specify the target architecture as " -"<machine>\n" -" -j --section <name> Only display information for section " -"<name>\n" -" -M --disassembler-options <o> Pass text <o> on to the disassembler\n" -" -EB --endian=big Assume big endian format when " -"disassembling\n" -" -EL --endian=little Assume little endian format when " -"disassembling\n" -" --file-start-context Include context from start of file (with " -"-S)\n" -" -l --line-numbers Include line numbers and filenames in " -"output\n" -" -C --demangle Decode mangled/processed symbol names\n" -" -w --wide Format output for more than 80 columns\n" -" -z --disassemble-zeroes Do not skip blocks of zeroes when " -"disassembling\n" -" --start-address <addr> Only process data whoes address is >= " -"<addr>\n" -" --stop-address <addr> Only process data whoes address is <= " -"<addr>\n" -" --prefix-addresses Print complete address alongside " -"disassembly\n" -" --[no-]show-raw-insn Display hex alongside symbolic disassembly\n" -" --adjust-vma <offset> Add <offset> to all displayed section " -"addresses\n" -"\n" -msgstr "" - -#: objdump.c:420 -msgid "Sections:\n" -msgstr "" - -#: objdump.c:423 -msgid "Idx Name Size VMA LMA File off Algn" -msgstr "" - -#: objdump.c:425 -msgid "" -"Idx Name Size VMA LMA File off " -"Algn" -msgstr "" - -#: objdump.c:429 -msgid " Flags" -msgstr "" - -#: objdump.c:479 -#, c-format -msgid "%s: %s: not a dynamic object\n" -msgstr "" - -#: objdump.c:496 -#, c-format -msgid "%s: %s: No dynamic symbols\n" -msgstr "" - -#: objdump.c:1200 -msgid "Out of virtual memory\n" -msgstr "" - -#: objdump.c:1611 -#, c-format -msgid "%s: Can't use supplied machine %s\n" -msgstr "" - -#: objdump.c:1632 -#, c-format -msgid "%s: Can't disassemble for architecture %s\n" -msgstr "" - -#: objdump.c:1709 -#, c-format -msgid "Disassembly of section %s:\n" -msgstr "" - -#: objdump.c:1883 -#, c-format -msgid "" -"No %s section present\n" -"\n" -msgstr "" - -#: objdump.c:1890 -#, c-format -msgid "%s: %s has no %s section\n" -msgstr "" - -#: objdump.c:1904 objdump.c:1916 -#, c-format -msgid "%s: Reading %s section of %s failed: %s\n" -msgstr "" - -#: objdump.c:1959 -#, c-format -msgid "" -"Contents of %s section:\n" -"\n" -msgstr "" - -#: objdump.c:2059 -#, c-format -msgid "architecture: %s, " -msgstr "" - -#: objdump.c:2062 -#, c-format -msgid "flags 0x%08x:\n" -msgstr "" - -#: objdump.c:2075 -msgid "" -"\n" -"start address 0x" -msgstr "" - -#: objdump.c:2107 -#, c-format -msgid "" -"\n" -"%s: file format %s\n" -msgstr "" - -#: objdump.c:2150 -#, c-format -msgid "%s: printing debugging information failed\n" -msgstr "" - -#: objdump.c:2227 -#, c-format -msgid "In archive %s:\n" -msgstr "" - -#: objdump.c:2279 -#, c-format -msgid "Contents of section %s:\n" -msgstr "" - -#: objdump.c:2788 -#, c-format -msgid "BFD header file version %s\n" -msgstr "" - -#: objdump.c:2861 -#, c-format -msgid "%s: unrecognized -E option\n" -msgstr "" - -#: objdump.c:2873 -#, c-format -msgid "%s: unrecognized --endian type `%s'\n" -msgstr "" - -#: rdcoff.c:204 -#, c-format -msgid "%s: parse_coff_type: Bad type code 0x%x\n" -msgstr "" - -#: rdcoff.c:423 rdcoff.c:531 rdcoff.c:712 -#, c-format -msgid "%s: bfd_coff_get_syment failed: %s\n" -msgstr "" - -#: rdcoff.c:439 rdcoff.c:732 -#, c-format -msgid "%s: bfd_coff_get_auxent failed: %s\n" -msgstr "" - -#: rdcoff.c:798 -#, c-format -msgid "%s: %ld: .bf without preceding function\n" -msgstr "" - -#: rdcoff.c:848 -#, c-format -msgid "%s: %ld: unexpected .ef\n" -msgstr "" - -#: rddbg.c:87 -#, c-format -msgid "%s: no recognized debugging information\n" -msgstr "" - -#: rddbg.c:410 -msgid "Last stabs entries before error:\n" -msgstr "" - -#: readelf.c:303 readelf.c:329 -#, c-format -msgid "%s: Error: " -msgstr "" - -#: readelf.c:315 readelf.c:344 -#, c-format -msgid "%s: Warning: " -msgstr "" - -#: readelf.c:394 readelf.c:532 -#, c-format -msgid "Unhandled data length: %d\n" -msgstr "" - -#: readelf.c:591 -msgid "Don't know about relocations on this machine architecture\n" -msgstr "" - -#: readelf.c:631 readelf.c:660 readelf.c:692 readelf.c:720 -msgid "out of memory parsing relocs" -msgstr "" - -#: readelf.c:738 -msgid "" -" Offset Info Type Symbol's Value Symbol's Name " -"Addend\n" -msgstr "" - -#: readelf.c:741 -msgid " Offset Info Type Symbol's Value Symbol's Name\n" -msgstr "" - -#: readelf.c:885 readelf.c:887 -#, c-format -msgid "unrecognised: %-7lx" -msgstr "" - -#: readelf.c:912 -#, c-format -msgid "<string table index %3ld>" -msgstr "" - -#: readelf.c:1119 -#, c-format -msgid "Processor Specific: %lx" -msgstr "" - -#: readelf.c:1138 -#, c-format -msgid "Operating System specific: %lx" -msgstr "" - -#: readelf.c:1141 readelf.c:1506 -#, c-format -msgid "<unknown>: %lx" -msgstr "" - -#: readelf.c:1155 -msgid "NONE (None)" -msgstr "" - -#: readelf.c:1156 -msgid "REL (Relocatable file)" -msgstr "" - -#: readelf.c:1157 -msgid "EXEC (Executable file)" -msgstr "" - -#: readelf.c:1158 -msgid "DYN (Shared object file)" -msgstr "" - -#: readelf.c:1159 -msgid "CORE (Core file)" -msgstr "" - -#: readelf.c:1163 -#, c-format -msgid "Processor Specific: (%x)" -msgstr "" - -#: readelf.c:1165 -#, c-format -msgid "OS Specific: (%x)" -msgstr "" - -#: readelf.c:1167 readelf.c:1244 readelf.c:1638 -#, c-format -msgid "<unknown>: %x" -msgstr "" - -#: readelf.c:1180 -msgid "None" -msgstr "" - -#: readelf.c:1676 -msgid "Usage: readelf {options} elf-file(s)\n" -msgstr "" - -#: readelf.c:1677 -msgid " Options are:\n" -msgstr "" - -#: readelf.c:1678 -msgid " -a or --all Equivalent to: -h -l -S -s -r -d -V -A -I\n" -msgstr "" - -#: readelf.c:1679 -msgid " -h or --file-header Display the ELF file header\n" -msgstr "" - -#: readelf.c:1680 -msgid " -l or --program-headers or --segments\n" -msgstr "" - -#: readelf.c:1681 -msgid " Display the program headers\n" -msgstr "" - -#: readelf.c:1682 -msgid " -S or --section-headers or --sections\n" -msgstr "" - -#: readelf.c:1683 -msgid " Display the sections' header\n" -msgstr "" - -#: readelf.c:1684 -msgid " -e or --headers Equivalent to: -h -l -S\n" -msgstr "" - -#: readelf.c:1685 -msgid " -s or --syms or --symbols Display the symbol table\n" -msgstr "" - -#: readelf.c:1686 -msgid " -n or --notes Display the core notes (if present)\n" -msgstr "" - -#: readelf.c:1687 -msgid " -r or --relocs Display the relocations (if present)\n" -msgstr "" - -#: readelf.c:1688 -msgid " -d or --dynamic Display the dynamic segment (if present)\n" -msgstr "" - -#: readelf.c:1689 -msgid " -V or --version-info Display the version sections (if present)\n" -msgstr "" - -#: readelf.c:1690 -msgid "" -" -A or --arch-specific Display architecture specific information (if " -"any).\n" -msgstr "" - -#: readelf.c:1691 -msgid "" -" -D or --use-dynamic Use the dynamic section info when displaying " -"symbols\n" -msgstr "" - -#: readelf.c:1692 -msgid " -x <number> or --hex-dump=<number>\n" -msgstr "" - -#: readelf.c:1693 -msgid " Dump the contents of section <number>\n" -msgstr "" - -#: readelf.c:1694 -msgid " -w[liapr] or --debug-dump[=line,=info,=abbrev,=pubnames,=ranges]\n" -msgstr "" - -#: readelf.c:1695 -msgid "" -" Display the contents of DWARF2 debug sections\n" -msgstr "" - -#: readelf.c:1697 -msgid " -i <number> or --instruction-dump=<number>\n" -msgstr "" - -#: readelf.c:1698 -msgid "" -" Disassemble the contents of section <number>\n" -msgstr "" - -#: readelf.c:1700 -msgid " -I or --histogram Display histogram of bucket list lengths\n" -msgstr "" - -#: readelf.c:1701 -msgid " -v or --version Display the version number of readelf\n" -msgstr "" - -#: readelf.c:1702 -msgid " -H or --help Display this information\n" -msgstr "" - -#: readelf.c:1720 -msgid "Out of memory allocating dump request table." -msgstr "" - -#: readelf.c:1855 -#, c-format -msgid "Unrecognised debug option '%s'\n" -msgstr "" - -#: readelf.c:1880 -#, c-format -msgid "Invalid option '-%c'\n" -msgstr "" - -#: readelf.c:1893 -msgid "Nothing to do.\n" -msgstr "" - -#: readelf.c:1906 readelf.c:1923 readelf.c:3493 -msgid "none" -msgstr "" - -#: readelf.c:1907 -msgid "ELF32" -msgstr "" - -#: readelf.c:1908 -msgid "ELF64" -msgstr "" - -#: readelf.c:1910 readelf.c:1927 readelf.c:1946 -#, c-format -msgid "<unknown: %x>" -msgstr "" - -#: readelf.c:1924 -msgid "2's complement, little endian" -msgstr "" - -#: readelf.c:1925 -msgid "2's complement, big endian" -msgstr "" - -#: readelf.c:1940 -msgid "UNIX - System V" -msgstr "" - -#: readelf.c:1941 -msgid "UNIX - HP-UX" -msgstr "" - -#: readelf.c:1942 -msgid "UNIX - Linux" -msgstr "" - -#: readelf.c:1943 -msgid "Standalone App" -msgstr "" - -#: readelf.c:1944 -msgid "ARM" -msgstr "" - -#: readelf.c:1961 -msgid "Not an ELF file - it has the wrong magic bytes at the start\n" -msgstr "" - -#: readelf.c:1969 -msgid "ELF Header:\n" -msgstr "" - -#: readelf.c:1970 -msgid " Magic: " -msgstr "" - -#: readelf.c:1974 -#, c-format -msgid " Class: %s\n" -msgstr "" - -#: readelf.c:1976 -#, c-format -msgid " Data: %s\n" -msgstr "" - -#: readelf.c:1978 -#, c-format -msgid " Version: %d %s\n" -msgstr "" - -#: readelf.c:1985 -#, c-format -msgid " OS/ABI: %s\n" -msgstr "" - -#: readelf.c:1987 -#, c-format -msgid " ABI Version: %d\n" -msgstr "" - -#: readelf.c:1989 -#, c-format -msgid " Type: %s\n" -msgstr "" - -#: readelf.c:1991 -#, c-format -msgid " Machine: %s\n" -msgstr "" - -#: readelf.c:1993 -#, c-format -msgid " Version: 0x%lx\n" -msgstr "" - -#: readelf.c:1996 -msgid " Entry point address: " -msgstr "" - -#: readelf.c:1998 -msgid "" -"\n" -" Start of program headers: " -msgstr "" - -#: readelf.c:2000 -msgid "" -" (bytes into file)\n" -" Start of section headers: " -msgstr "" - -#: readelf.c:2002 -msgid " (bytes into file)\n" -msgstr "" - -#: readelf.c:2004 -#, c-format -msgid " Flags: 0x%lx%s\n" -msgstr "" - -#: readelf.c:2007 -#, c-format -msgid " Size of this header: %ld (bytes)\n" -msgstr "" - -#: readelf.c:2009 -#, c-format -msgid " Size of program headers: %ld (bytes)\n" -msgstr "" - -#: readelf.c:2011 -#, c-format -msgid " Number of program headers: %ld\n" -msgstr "" - -#: readelf.c:2013 -#, c-format -msgid " Size of section headers: %ld (bytes)\n" -msgstr "" - -#: readelf.c:2015 -#, c-format -msgid " Number of section headers: %ld\n" -msgstr "" - -#: readelf.c:2017 -#, c-format -msgid " Section header string table index: %ld\n" -msgstr "" - -#: readelf.c:2102 -msgid "" -"\n" -"There are no program headers in this file.\n" -msgstr "" - -#: readelf.c:2108 -#, c-format -msgid "" -"\n" -"Elf file type is %s\n" -msgstr "" - -#: readelf.c:2109 -msgid "Entry point " -msgstr "" - -#: readelf.c:2111 -#, c-format -msgid "" -"\n" -"There are %d program headers, starting at offset " -msgstr "" - -#: readelf.c:2122 readelf.c:2298 readelf.c:2340 readelf.c:2383 readelf.c:2424 -#: readelf.c:2932 readelf.c:2973 readelf.c:3149 readelf.c:4111 readelf.c:4125 -#: readelf.c:7023 readelf.c:7063 -msgid "Out of memory\n" -msgstr "" - -#: readelf.c:2140 -#, c-format -msgid "" -"\n" -"Program Header%s:\n" -msgstr "" - -#: readelf.c:2144 -msgid "" -" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n" -msgstr "" - -#: readelf.c:2148 -msgid " Type Offset VirtAddr PhysAddr\n" -msgstr "" - -#: readelf.c:2150 -msgid " FileSiz MemSiz Flags Align\n" -msgstr "" - -#: readelf.c:2208 -msgid "more than one dynamic segment\n" -msgstr "" - -#: readelf.c:2216 -msgid "Unable to find program interpreter name\n" -msgstr "" - -#: readelf.c:2223 -#, c-format -msgid "" -"\n" -" [Requesting program interpreter: %s]" -msgstr "" - -#: readelf.c:2241 -msgid "" -"\n" -" Section to Segment mapping:\n" -msgstr "" - -#: readelf.c:2242 -msgid " Segment Sections...\n" -msgstr "" - -#: readelf.c:2505 -msgid "" -"\n" -"There are no sections in this file.\n" -msgstr "" - -#: readelf.c:2511 -#, c-format -msgid "There are %d section headers, starting at offset 0x%lx:\n" -msgstr "" - -#: readelf.c:2551 -msgid "File contains multiple dynamic symbol tables\n" -msgstr "" - -#: readelf.c:2564 -msgid "File contains multiple dynamic string tables\n" -msgstr "" - -#: readelf.c:2591 -#, c-format -msgid "" -"\n" -"Section Header%s:\n" -msgstr "" - -#: readelf.c:2595 -msgid "" -" [Nr] Name Type Addr Off Size ES Flg Lk " -"Inf Al\n" -msgstr "" - -#: readelf.c:2598 -msgid " [Nr] Name Type Address Offset\n" -msgstr "" - -#: readelf.c:2599 -msgid " Size EntSize Flags Link Info Align\n" -msgstr "" - -#: readelf.c:2646 -msgid "" -"Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings)\n" -msgstr "" - -#: readelf.c:2647 -msgid "" -" I (info), L (link order), O (extra OS processing required)\n" -msgstr "" - -#: readelf.c:2648 -msgid " o (os specific), p (processor specific) x (unknown)\n" -msgstr "" - -#: readelf.c:2706 -#, c-format -msgid "" -"\n" -"Relocation section at offset 0x%lx contains %ld bytes:\n" -msgstr "" - -#: readelf.c:2713 -msgid "" -"\n" -"There are no dynamic relocations in this file.\n" -msgstr "" - -#: readelf.c:2741 -msgid "" -"\n" -"Relocation section " -msgstr "" - -#: readelf.c:2748 -#, c-format -msgid " at offset 0x%lx contains %lu entries:\n" -msgstr "" - -#: readelf.c:2776 -msgid "" -"\n" -"There are no relocations in this file.\n" -msgstr "" - -#: readelf.c:3026 -msgid "" -"\n" -"There is no dynamic segment in this file.\n" -msgstr "" - -#: readelf.c:3060 -msgid "Unable to seek to end of file!" -msgstr "" - -#: readelf.c:3069 -msgid "Unable to determine the number of symbols to load\n" -msgstr "" - -#: readelf.c:3099 -msgid "Unable to seek to end of file\n" -msgstr "" - -#: readelf.c:3105 -msgid "Unable to determine the length of the dynamic string table\n" -msgstr "" - -#: readelf.c:3166 -#, c-format -msgid "" -"\n" -"Dynamic segment at offset 0x%x contains %ld entries:\n" -msgstr "" - -#: readelf.c:3169 -msgid " Tag Type Name/Value\n" -msgstr "" - -#: readelf.c:3200 -msgid "Auxiliary library" -msgstr "" - -#: readelf.c:3202 -msgid "Filter library" -msgstr "" - -#: readelf.c:3218 readelf.c:3239 readelf.c:3265 -msgid "Flags:" -msgstr "" - -#: readelf.c:3220 readelf.c:3241 readelf.c:3267 -msgid " None\n" -msgstr "" - -#: readelf.c:3370 -#, c-format -msgid "Shared library: [%s]" -msgstr "" - -#: readelf.c:3373 -msgid " program interpreter" -msgstr "" - -#: readelf.c:3377 -#, c-format -msgid "Library soname: [%s]" -msgstr "" - -#: readelf.c:3381 -#, c-format -msgid "Library rpath: [%s]" -msgstr "" - -#: readelf.c:3442 -#, c-format -msgid "Not needed object: [%s]\n" -msgstr "" - -#: readelf.c:3539 -#, c-format -msgid "" -"\n" -"Version definition section '%s' contains %ld entries:\n" -msgstr "" - -#: readelf.c:3542 -msgid " Addr: 0x" -msgstr "" - -#: readelf.c:3544 readelf.c:3732 -#, c-format -msgid " Offset: %#08lx Link: %lx (%s)\n" -msgstr "" - -#: readelf.c:3574 -#, c-format -msgid " %#06x: Rev: %d Flags: %s" -msgstr "" - -#: readelf.c:3577 -#, c-format -msgid " Index: %d Cnt: %d " -msgstr "" - -#: readelf.c:3588 -#, c-format -msgid "Name: %s\n" -msgstr "" - -#: readelf.c:3590 -#, c-format -msgid "Name index: %ld\n" -msgstr "" - -#: readelf.c:3605 -#, c-format -msgid " %#06x: Parent %d: %s\n" -msgstr "" - -#: readelf.c:3608 -#, c-format -msgid " %#06x: Parent %d, name index: %ld\n" -msgstr "" - -#: readelf.c:3627 -#, c-format -msgid "" -"\n" -"Version needs section '%s' contains %ld entries:\n" -msgstr "" - -#: readelf.c:3630 -msgid " Addr: 0x" -msgstr "" - -#: readelf.c:3632 -#, c-format -msgid " Offset: %#08lx Link to section: %ld (%s)\n" -msgstr "" - -#: readelf.c:3658 -#, c-format -msgid " %#06x: Version: %d" -msgstr "" - -#: readelf.c:3661 -#, c-format -msgid " File: %s" -msgstr "" - -#: readelf.c:3663 -#, c-format -msgid " File: %lx" -msgstr "" - -#: readelf.c:3665 -#, c-format -msgid " Cnt: %d\n" -msgstr "" - -#: readelf.c:3683 -#, c-format -msgid " %#06x: Name: %s" -msgstr "" - -#: readelf.c:3686 -#, c-format -msgid " %#06x: Name index: %lx" -msgstr "" - -#: readelf.c:3689 -#, c-format -msgid " Flags: %s Version: %d\n" -msgstr "" - -#: readelf.c:3727 -#, c-format -msgid "" -"\n" -"Version symbols section '%s' contains %d entries:\n" -msgstr "" - -#: readelf.c:3730 -msgid " Addr: " -msgstr "" - -#: readelf.c:3760 -msgid " 0 (*local*) " -msgstr "" - -#: readelf.c:3764 -msgid " 1 (*global*) " -msgstr "" - -#: readelf.c:3986 -msgid "" -"\n" -"No version information found in this file.\n" -msgstr "" - -#: readelf.c:4004 readelf.c:4039 -#, c-format -msgid "<processor specific>: %d" -msgstr "" - -#: readelf.c:4006 readelf.c:4051 -#, c-format -msgid "<OS specific>: %d" -msgstr "" - -#: readelf.c:4008 readelf.c:4054 -#, c-format -msgid "<unknown>: %d" -msgstr "" - -#: readelf.c:4117 -msgid "Unable to read in dynamic data\n" -msgstr "" - -#: readelf.c:4159 -msgid "Unable to seek to start of dynamic information" -msgstr "" - -#: readelf.c:4165 -msgid "Failed to read in number of buckets\n" -msgstr "" - -#: readelf.c:4171 -msgid "Failed to read in number of chains\n" -msgstr "" - -#: readelf.c:4191 -msgid "" -"\n" -"Symbol table for image:\n" -msgstr "" - -#: readelf.c:4193 -msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" -msgstr "" - -#: readelf.c:4195 -msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" -msgstr "" - -#: readelf.c:4239 -#, c-format -msgid "" -"\n" -"Symbol table '%s' contains %lu entries:\n" -msgstr "" - -#: readelf.c:4243 -msgid " Num: Value Size Type Bind Vis Ndx Name\n" -msgstr "" - -#: readelf.c:4245 -msgid " Num: Value Size Type Bind Vis Ndx Name\n" -msgstr "" - -#: readelf.c:4354 -msgid "bad dynamic symbol" -msgstr "" - -#: readelf.c:4413 -msgid "" -"\n" -"Dynamic symbol information is not available for displaying symbols.\n" -msgstr "" - -#: readelf.c:4425 -#, c-format -msgid "" -"\n" -"Histogram for bucket list length (total of %d buckets):\n" -msgstr "" - -#: readelf.c:4427 -msgid " Length Number %% of total Coverage\n" -msgstr "" - -#: readelf.c:4432 readelf.c:4451 readelf.c:6704 readelf.c:6897 -msgid "Out of memory" -msgstr "" - -#: readelf.c:4500 -#, c-format -msgid "" -"\n" -"Dynamic info segment at offset 0x%lx contains %d entries:\n" -msgstr "" - -#: readelf.c:4503 -msgid " Num: Name BoundTo Flags\n" -msgstr "" - -#: readelf.c:4551 -#, c-format -msgid "" -"\n" -"Assembly dump of section %s\n" -msgstr "" - -#: readelf.c:4574 -#, c-format -msgid "" -"\n" -"Section '%s' has no data to dump.\n" -msgstr "" - -#: readelf.c:4579 -#, c-format -msgid "" -"\n" -"Hex dump of section '%s':\n" -msgstr "" - -#: readelf.c:4731 -msgid "badly formed extended line op encountered!" -msgstr "" - -#: readelf.c:4738 -#, c-format -msgid " Extended opcode %d: " -msgstr "" - -#: readelf.c:4743 -msgid "" -"End of Sequence\n" -"\n" -msgstr "" - -#: readelf.c:4749 -#, c-format -msgid "set Address to 0x%lx\n" -msgstr "" - -#: readelf.c:4754 -msgid " define new File Table entry\n" -msgstr "" - -#: readelf.c:4755 readelf.c:4877 -msgid " Entry\tDir\tTime\tSize\tName\n" -msgstr "" - -#: readelf.c:4757 -#, c-format -msgid " %d\t" -msgstr "" - -#: readelf.c:4760 readelf.c:4762 readelf.c:4764 readelf.c:4889 readelf.c:4891 -#: readelf.c:4893 -#, c-format -msgid "%lu\t" -msgstr "" - -#: readelf.c:4765 -#, c-format -msgid "" -"%s\n" -"\n" -msgstr "" - -#: readelf.c:4769 -#, c-format -msgid "UNKNOWN: length %d\n" -msgstr "" - -#: readelf.c:4795 -#, c-format -msgid "" -"\n" -"Dump of debug contents of section %s:\n" -"\n" -msgstr "" - -#: readelf.c:4807 -msgid "The line info appears to be corrupt - the section is too small\n" -msgstr "" - -#: readelf.c:4815 -msgid "Only DWARF version 2 line info is currently supported.\n" -msgstr "" - -#: readelf.c:4830 -#, c-format -msgid " Length: %ld\n" -msgstr "" - -#: readelf.c:4831 -#, c-format -msgid " DWARF Version: %d\n" -msgstr "" - -#: readelf.c:4832 -#, c-format -msgid " Prolgue Length: %d\n" -msgstr "" - -#: readelf.c:4833 -#, c-format -msgid " Minimum Instruction Length: %d\n" -msgstr "" - -#: readelf.c:4834 -#, c-format -msgid " Initial value of 'is_stmt': %d\n" -msgstr "" - -#: readelf.c:4835 -#, c-format -msgid " Line Base: %d\n" -msgstr "" - -#: readelf.c:4836 -#, c-format -msgid " Line Range: %d\n" -msgstr "" - -#: readelf.c:4837 -#, c-format -msgid " Opcode Base: %d\n" -msgstr "" - -#: readelf.c:4846 -msgid "" -"\n" -" Opcodes:\n" -msgstr "" - -#: readelf.c:4849 -#, c-format -msgid " Opcode %d has %d args\n" -msgstr "" - -#: readelf.c:4855 -msgid "" -"\n" -" The Directory Table is empty.\n" -msgstr "" - -#: readelf.c:4858 -msgid "" -"\n" -" The Directory Table:\n" -msgstr "" - -#: readelf.c:4862 -#, c-format -msgid " %s\n" -msgstr "" - -#: readelf.c:4873 -msgid "" -"\n" -" The File Name Table is empty.\n" -msgstr "" - -#: readelf.c:4876 -msgid "" -"\n" -" The File Name Table:\n" -msgstr "" - -#: readelf.c:4884 -#, c-format -msgid " %d\t" -msgstr "" - -#: readelf.c:4895 -#, c-format -msgid "%s\n" -msgstr "" - -#. Now display the statements. -#: readelf.c:4903 -msgid "" -"\n" -" Line Number Statements:\n" -msgstr "" - -#: readelf.c:4922 -msgid " Copy\n" -msgstr "" - -#: readelf.c:4929 -#, c-format -msgid " Advance PC by %d to %lx\n" -msgstr "" - -#: readelf.c:4937 -#, c-format -msgid " Advance Line by %d to %d\n" -msgstr "" - -#: readelf.c:4944 -#, c-format -msgid " Set File Name to entry %d in the File Name Table\n" -msgstr "" - -#: readelf.c:4952 -#, c-format -msgid " Set column to %d\n" -msgstr "" - -#: readelf.c:4959 -#, c-format -msgid " Set is_stmt to %d\n" -msgstr "" - -#: readelf.c:4964 -msgid " Set basic block\n" -msgstr "" - -#: readelf.c:4972 -#, c-format -msgid " Advance PC by constant %d to 0x%lx\n" -msgstr "" - -#: readelf.c:4980 -#, c-format -msgid " Advance PC by fixed size amount %d to 0x%lx\n" -msgstr "" - -#: readelf.c:4988 -#, c-format -msgid " Special opcode %d: advance Address by %d to 0x%lx" -msgstr "" - -#: readelf.c:4992 -#, c-format -msgid " and Line by %d to %d\n" -msgstr "" - -#: readelf.c:5015 readelf.c:5437 -#, c-format -msgid "" -"Contents of the %s section:\n" -"\n" -msgstr "" - -#: readelf.c:5034 -msgid "Only DWARF 2 pubnames are currently supported" -msgstr "" - -#: readelf.c:5038 -#, c-format -msgid " Length: %ld\n" -msgstr "" - -#: readelf.c:5040 -#, c-format -msgid " Version: %d\n" -msgstr "" - -#: readelf.c:5042 -#, c-format -msgid " Offset into .debug_info section: %ld\n" -msgstr "" - -#: readelf.c:5044 -#, c-format -msgid " Size of area in .debug_info section: %ld\n" -msgstr "" - -#: readelf.c:5047 -msgid "" -"\n" -" Offset\tName\n" -msgstr "" - -#: readelf.c:5129 -#, c-format -msgid "Unknown TAG value: %lx" -msgstr "" - -#: readelf.c:5224 -#, c-format -msgid "Unknown AT value: %lx" -msgstr "" - -#: readelf.c:5261 -#, c-format -msgid "Unknown FORM value: %lx" -msgstr "" - -#: readelf.c:5443 -msgid " Number TAG\n" -msgstr "" - -#: readelf.c:5449 -#, c-format -msgid " %ld %s [%s]\n" -msgstr "" - -#: readelf.c:5452 -msgid "has children" -msgstr "" - -#: readelf.c:5452 -msgid "no children" -msgstr "" - -#: readelf.c:5456 -#, c-format -msgid " %-18s %s\n" -msgstr "" - -#: readelf.c:5475 -#, c-format -msgid " %lu byte block: " -msgstr "" - -#: readelf.c:5939 -msgid "(User defined location op)" -msgstr "" - -#: readelf.c:5941 -msgid "(Unknown location op)" -msgstr "" - -#: readelf.c:6058 -#, c-format -msgid "Unable to handle FORM: %d" -msgstr "" - -#: readelf.c:6062 -#, c-format -msgid "Unrecognised form: %d" -msgstr "" - -#: readelf.c:6075 -msgid "(not inlined)" -msgstr "" - -#: readelf.c:6076 -msgid "(inlined)" -msgstr "" - -#: readelf.c:6077 -msgid "(declared as inline but ignored)" -msgstr "" - -#: readelf.c:6078 -msgid "(declared as inline and inlined)" -msgstr "" - -#: readelf.c:6079 -#, c-format -msgid " (Unknown inline attribute value: %lx)" -msgstr "" - -#: readelf.c:6209 readelf.c:6333 -#, c-format -msgid "" -"The section %s contains:\n" -"\n" -msgstr "" - -#: readelf.c:6231 -msgid "Only version 2 DWARF debug information is currently supported.\n" -msgstr "" - -#: readelf.c:6235 -msgid " Compilation Unit:\n" -msgstr "" - -#: readelf.c:6236 -#, c-format -msgid " Length: %ld\n" -msgstr "" - -#: readelf.c:6237 -#, c-format -msgid " Version: %d\n" -msgstr "" - -#: readelf.c:6238 -#, c-format -msgid " Abbrev Offset: %ld\n" -msgstr "" - -#: readelf.c:6239 -#, c-format -msgid " Pointer Size: %d\n" -msgstr "" - -#: readelf.c:6259 -msgid "Unable to locate .debug_abbrev section!\n" -msgstr "" - -#: readelf.c:6299 -#, c-format -msgid "Unable to locate entry %lu in the abbreviation table\n" -msgstr "" - -#: readelf.c:6304 -#, c-format -msgid " <%d><%x>: Abbrev Number: %lu (%s)\n" -msgstr "" - -#: readelf.c:6352 -#, c-format -msgid " Length: %ld\n" -msgstr "" - -#: readelf.c:6353 -#, c-format -msgid " Version: %d\n" -msgstr "" - -#: readelf.c:6354 -#, c-format -msgid " Offset into .debug_info: %lx\n" -msgstr "" - -#: readelf.c:6355 -#, c-format -msgid " Pointer Size: %d\n" -msgstr "" - -#: readelf.c:6356 -#, c-format -msgid " Segment Size: %d\n" -msgstr "" - -#: readelf.c:6358 -msgid "" -"\n" -" Address Length\n" -msgstr "" - -#: readelf.c:6399 -#, c-format -msgid "Displaying the debug contents of section %s is not yet supported.\n" -msgstr "" - -#: readelf.c:6461 -#, c-format -msgid "" -"\n" -"Section '%s' has no debugging data.\n" -msgstr "" - -#: readelf.c:6477 -#, c-format -msgid "Unrecognised debug section: %s\n" -msgstr "" - -#: readelf.c:6549 -msgid "Some sections were not dumped because they do not exist!\n" -msgstr "" - -#: readelf.c:6728 -#, c-format -msgid "" -"\n" -"Section '%s' contains %d entries:\n" -msgstr "" - -#: readelf.c:6890 -msgid "conflict list with without table" -msgstr "" - -#: readelf.c:6918 -#, c-format -msgid "" -"\n" -"Section '.conflict' contains %d entries:\n" -msgstr "" - -#: readelf.c:6919 -msgid " Num: Index Value Name" -msgstr "" - -#: readelf.c:6944 -msgid "NT_PRSTATUS (prstatus structure)" -msgstr "" - -#: readelf.c:6945 -msgid "NT_FPREGSET (floating point registers)" -msgstr "" - -#: readelf.c:6946 -msgid "NT_PRPSINFO (prpsinfo structure)" -msgstr "" - -#: readelf.c:6947 -msgid "NT_TASKSTRUCT (task structure)" -msgstr "" - -#: readelf.c:6948 -msgid "NT_PRXFPREG (user_xfpregs structure)" -msgstr "" - -#: readelf.c:6949 -msgid "NT_PSTATUS (pstatus structure)" -msgstr "" - -#: readelf.c:6950 -msgid "NT_FPREGS (floating point registers)" -msgstr "" - -#: readelf.c:6951 -msgid "NT_PSINFO (psinfo structure)" -msgstr "" - -#: readelf.c:6952 -msgid "NT_LWPSTATUS (lwpstatus_t structure)" -msgstr "" - -#: readelf.c:6953 -msgid "NT_LWPSINFO (lwpsinfo_t structure)" -msgstr "" - -#: readelf.c:6954 -msgid "NT_WIN32PSTATUS (win32_pstatus strcuture)" -msgstr "" - -#: readelf.c:6956 -#, c-format -msgid "Unknown note type: (0x%08x)" -msgstr "" - -#: readelf.c:6994 -#, c-format -msgid "" -"\n" -"Notes at offset 0x%08lx with length 0x%08lx:\n" -msgstr "" - -#: readelf.c:6997 -msgid " Owner\t\tData size\tDescription\n" -msgstr "" - -#: readelf.c:7108 -msgid "No note segments present in the core file.\n" -msgstr "" - -#: readelf.c:7186 -msgid "This instance of readelf has been built without support for a\n" -msgstr "" - -#: readelf.c:7187 -msgid "64 bit data type and so it cannot read 64 bit ELF files.\n" -msgstr "" - -#: readelf.c:7222 -#, c-format -msgid "Cannot stat input file %s.\n" -msgstr "" - -#: readelf.c:7229 -#, c-format -msgid "Input file %s not found.\n" -msgstr "" - -#: readelf.c:7235 -#, c-format -msgid "%s: Failed to read file header\n" -msgstr "" - -#: readelf.c:7249 -#, c-format -msgid "" -"\n" -"File: %s\n" -msgstr "" - -#: rename.c:131 -#, c-format -msgid "%s: cannot set time: %s" -msgstr "" - -#. We have to clean up here. -#: rename.c:170 rename.c:203 -#, c-format -msgid "%s: rename: %s" -msgstr "" - -#: rename.c:211 -#, c-format -msgid "%s: simple_copy: %s" -msgstr "" - -#: resbin.c:130 -#, c-format -msgid "%s: not enough binary data" -msgstr "" - -#: resbin.c:149 -msgid "null terminated unicode string" -msgstr "" - -#: resbin.c:179 resbin.c:185 -msgid "resource ID" -msgstr "" - -#: resbin.c:229 -msgid "cursor" -msgstr "" - -#: resbin.c:263 resbin.c:270 -msgid "menu header" -msgstr "" - -#: resbin.c:280 -msgid "menuex header" -msgstr "" - -#: resbin.c:284 -msgid "menuex offset" -msgstr "" - -#: resbin.c:291 -#, c-format -msgid "unsupported menu version %d" -msgstr "" - -#: resbin.c:319 resbin.c:334 resbin.c:400 -msgid "menuitem header" -msgstr "" - -#: resbin.c:430 -msgid "menuitem" -msgstr "" - -#: resbin.c:471 resbin.c:499 -msgid "dialog header" -msgstr "" - -#: resbin.c:489 -#, c-format -msgid "unexpected dialog signature %d" -msgstr "" - -#: resbin.c:531 -msgid "dialog font point size" -msgstr "" - -#: resbin.c:539 -msgid "dialogex font information" -msgstr "" - -#: resbin.c:564 resbin.c:582 -msgid "dialog control" -msgstr "" - -#: resbin.c:574 -msgid "dialogex control" -msgstr "" - -#: resbin.c:603 -msgid "dialog control end" -msgstr "" - -#: resbin.c:615 -msgid "dialog control data" -msgstr "" - -#: resbin.c:658 -msgid "stringtable string length" -msgstr "" - -#: resbin.c:668 -msgid "stringtable string" -msgstr "" - -#: resbin.c:701 -msgid "fontdir header" -msgstr "" - -#: resbin.c:714 -msgid "fontdir" -msgstr "" - -#: resbin.c:730 -msgid "fontdir device name" -msgstr "" - -#: resbin.c:736 -msgid "fontdir face name" -msgstr "" - -#: resbin.c:779 -msgid "accelerator" -msgstr "" - -#: resbin.c:843 -msgid "group cursor header" -msgstr "" - -#: resbin.c:847 -#, c-format -msgid "unexpected group cursor type %d" -msgstr "" - -#: resbin.c:862 -msgid "group cursor" -msgstr "" - -#: resbin.c:901 -msgid "group icon header" -msgstr "" - -#: resbin.c:905 -#, c-format -msgid "unexpected group icon type %d" -msgstr "" - -#: resbin.c:920 -msgid "group icon" -msgstr "" - -#: resbin.c:991 resbin.c:1210 -msgid "unexpected version string" -msgstr "" - -#: resbin.c:1025 -#, c-format -msgid "version length %d does not match resource length %lu" -msgstr "" - -#: resbin.c:1029 -#, c-format -msgid "unexpected version type %d" -msgstr "" - -#: resbin.c:1041 -#, c-format -msgid "unexpected fixed version information length %d" -msgstr "" - -#: resbin.c:1044 -msgid "fixed version info" -msgstr "" - -#: resbin.c:1048 -#, c-format -msgid "unexpected fixed version signature %lu" -msgstr "" - -#: resbin.c:1052 -#, c-format -msgid "unexpected fixed version info version %lu" -msgstr "" - -#: resbin.c:1081 -msgid "version var info" -msgstr "" - -#: resbin.c:1098 -#, c-format -msgid "unexpected stringfileinfo value length %d" -msgstr "" - -#: resbin.c:1108 -#, c-format -msgid "unexpected version stringtable value length %d" -msgstr "" - -#: resbin.c:1142 -#, c-format -msgid "unexpected version string length %d != %d + %d" -msgstr "" - -#: resbin.c:1153 -#, c-format -msgid "unexpected version string length %d < %d" -msgstr "" - -#: resbin.c:1170 -#, c-format -msgid "unexpected varfileinfo value length %d" -msgstr "" - -#: resbin.c:1189 -msgid "version varfileinfo" -msgstr "" - -#: resbin.c:1204 -#, c-format -msgid "unexpected version value length %d" -msgstr "" - -#: rescoff.c:128 -msgid "filename required for COFF input" -msgstr "" - -#: rescoff.c:145 -#, c-format -msgid "%s: %s: no resource section\n" -msgstr "" - -#: rescoff.c:154 -msgid "can't read resource section" -msgstr "" - -#: rescoff.c:180 -#, c-format -msgid "%s: %s: address out of bounds" -msgstr "" - -#: rescoff.c:199 -msgid "directory" -msgstr "" - -#: rescoff.c:227 -msgid "named directory entry" -msgstr "" - -#: rescoff.c:236 -msgid "directory entry name" -msgstr "" - -#: rescoff.c:256 -msgid "named subdirectory" -msgstr "" - -#: rescoff.c:264 -msgid "named resource" -msgstr "" - -#: rescoff.c:279 -msgid "ID directory entry" -msgstr "" - -#: rescoff.c:296 -msgid "ID subdirectory" -msgstr "" - -#: rescoff.c:304 -msgid "ID resource" -msgstr "" - -#: rescoff.c:330 -msgid "resource type unknown" -msgstr "" - -#: rescoff.c:333 -msgid "data entry" -msgstr "" - -#: rescoff.c:341 -msgid "resource data" -msgstr "" - -#: rescoff.c:346 -msgid "resource data size" -msgstr "" - -#: rescoff.c:441 -msgid "filename required for COFF output" -msgstr "" - -#: rescoff.c:740 -msgid "can't get BFD_RELOC_RVA relocation type" -msgstr "" - -#: resrc.c:240 resrc.c:312 -#, c-format -msgid "can't open temporary file `%s': %s" -msgstr "" - -#: resrc.c:246 -#, c-format -msgid "can't redirect stdout: `%s': %s" -msgstr "" - -#: resrc.c:262 -#, c-format -msgid "%s %s: %s" -msgstr "" - -#: resrc.c:283 -#, c-format -msgid "%s exited with status %d" -msgstr "" - -#: resrc.c:308 -#, c-format -msgid "can't execute `%s': %s" -msgstr "" - -#: resrc.c:317 -#, c-format -msgid "Using temporary file `%s' to read preprocessor output\n" -msgstr "" - -#: resrc.c:324 -#, c-format -msgid "can't popen `%s': %s" -msgstr "" - -#: resrc.c:326 -msgid "Using popen to read preprocessor output\n" -msgstr "" - -#: resrc.c:369 -#, c-format -msgid "Tried `%s'\n" -msgstr "" - -#: resrc.c:380 -#, c-format -msgid "Using `%s'\n" -msgstr "" - -#: resrc.c:544 -#, c-format -msgid "%s:%d: %s\n" -msgstr "" - -#: resrc.c:553 -#, c-format -msgid "%s: unexpected EOF" -msgstr "" - -#: resrc.c:610 -#, c-format -msgid "%s: read of %lu returned %lu" -msgstr "" - -#: resrc.c:652 resrc.c:883 resrc.c:1156 resrc.c:1310 -#, c-format -msgid "stat failed on bitmap file `%s': %s" -msgstr "" - -#: resrc.c:705 -#, c-format -msgid "cursor file `%s' does not contain cursor data" -msgstr "" - -#: resrc.c:737 resrc.c:1027 -#, c-format -msgid "%s: fseek to %lu failed: %s" -msgstr "" - -#: resrc.c:996 -#, c-format -msgid "icon file `%s' does not contain icon data" -msgstr "" - -#: resrc.c:1515 -#, c-format -msgid "can't open `%s' for output: %s" -msgstr "" - -#: size.c:79 -#, c-format -msgid "" -"Usage: %s [-ABdoxV] [--format=berkeley|sysv] [--radix=8|10|16]\n" -" [--target=bfdname] [--version] [--help] [file...]\n" -msgstr "" - -#: size.c:83 -msgid "default is --format=berkeley\n" -msgstr "" - -#: size.c:85 -msgid "default is --format=sysv\n" -msgstr "" - -#: size.c:139 -#, c-format -msgid "invalid argument to --format: %s\n" -msgstr "" - -#: size.c:166 -#, c-format -msgid "Invalid radix: %s\n" -msgstr "" - -#: srconv.c:1879 -#, c-format -msgid "Usage: %s [-dhVq] in-file [out-file]\n" -msgstr "" - -#: srconv.c:1886 -#, c-format -msgid "%s: Convert a COFF object file into a SYSROFF object file\n" -msgstr "" - -#: srconv.c:2024 -#, c-format -msgid "%s: unable to open output file %s\n" -msgstr "" - -#: stabs.c:349 stabs.c:1769 -msgid "numeric overflow" -msgstr "" - -#: stabs.c:360 -#, c-format -msgid "Bad stab: %s\n" -msgstr "" - -#: stabs.c:370 -#, c-format -msgid "Warning: %s: %s\n" -msgstr "" - -#: stabs.c:492 -msgid "N_LBRAC not within function\n" -msgstr "" - -#: stabs.c:531 -msgid "Too many N_RBRACs\n" -msgstr "" - -#: stabs.c:780 -msgid "unknown C++ encoded name" -msgstr "" - -#. Complain and keep going, so compilers can invent new -#. cross-reference types. -#: stabs.c:1306 -msgid "unrecognized cross reference type" -msgstr "" - -#. Does this actually ever happen? Is that why we are worrying -#. about dealing with it rather than just calling error_type? -#: stabs.c:1861 -msgid "missing index type" -msgstr "" - -#: stabs.c:2188 -msgid "unknown virtual character for baseclass" -msgstr "" - -#: stabs.c:2206 -msgid "unknown visibility character for baseclass" -msgstr "" - -#: stabs.c:2398 -msgid "unnamed $vb type" -msgstr "" - -#: stabs.c:2404 -msgid "unrecognized C++ abbreviation" -msgstr "" - -#: stabs.c:2484 -msgid "unknown visibility character for field" -msgstr "" - -#: stabs.c:2740 -msgid "const/volatile indicator missing" -msgstr "" - -#: stabs.c:2980 -#, c-format -msgid "No mangling for \"%s\"\n" -msgstr "" - -#: stabs.c:3293 -msgid "Undefined N_EXCL" -msgstr "" - -#: stabs.c:3381 -#, c-format -msgid "Type file number %d out of range\n" -msgstr "" - -#: stabs.c:3386 -#, c-format -msgid "Type index number %d out of range\n" -msgstr "" - -#: stabs.c:3473 -#, c-format -msgid "Unrecognized XCOFF type %d\n" -msgstr "" - -#: stabs.c:3772 -#, c-format -msgid "bad mangled name `%s'\n" -msgstr "" - -#: stabs.c:3868 -msgid "no argument types in mangled string\n" -msgstr "" - -#: strings.c:159 -#, c-format -msgid "%s: invalid number %s\n" -msgstr "" - -#: strings.c:494 -#, c-format -msgid "%s: invalid integer argument %s\n" -msgstr "" - -#: strings.c:505 -#, c-format -msgid "" -"Usage: %s [-afov] [-n min-len] [-min-len] [-t {o,x,d}] [-]\n" -" [--all] [--print-file-name] [--bytes=min-len] [--radix={o,x,d}]\n" -" [--target=bfdname] [--help] [--version] file...\n" -msgstr "" - -#: sysdump.c:712 -#, c-format -msgid "Usage: %s [-hV] in-file\n" -msgstr "" - -#: sysdump.c:783 -#, c-format -msgid "%s: cannot open input file %s\n" -msgstr "" - -#: version.c:39 -msgid "Copyright 1997, 1998, 1999 Free Software Foundation, Inc.\n" -msgstr "" - -#: version.c:40 -msgid "" -"This program is free software; you may redistribute it under the terms of\n" -"the GNU General Public License. This program has absolutely no warranty.\n" -msgstr "" - -#: windres.c:237 -#, c-format -msgid "can't open %s `%s': %s" -msgstr "" - -#: windres.c:416 -msgid ": expected to be a directory\n" -msgstr "" - -#: windres.c:428 -msgid ": expected to be a leaf\n" -msgstr "" - -#: windres.c:437 -#, c-format -msgid "%s: warning: " -msgstr "" - -#: windres.c:439 -msgid ": duplicate value\n" -msgstr "" - -#: windres.c:602 -#, c-format -msgid "%s: unknown format type `%s'\n" -msgstr "" - -#: windres.c:603 -#, c-format -msgid "%s: supported formats:" -msgstr "" - -#. Otherwise, we give up. -#: windres.c:690 -#, c-format -msgid "can not determine type of file `%s'; use the -I option" -msgstr "" - -#: windres.c:704 -#, c-format -msgid "Usage: %s [options] [input-file] [output-file]\n" -msgstr "" - -#: windres.c:706 -msgid "" -"Options:\n" -" -i FILE, --input FILE Name input file\n" -" -o FILE, --output FILE Name output file\n" -" -I FORMAT, --input-format FORMAT\n" -" Specify input format\n" -" -O FORMAT, --output-format FORMAT\n" -" Specify output format\n" -" -F TARGET, --target TARGET Specify COFF target\n" -" --preprocessor PROGRAM Program to use to preprocess rc file\n" -" --include-dir DIR Include directory when preprocessing rc file\n" -" -DSYM[=VAL], --define SYM[=VAL]\n" -" Define SYM when preprocessing rc file\n" -" -v Verbose - tells you what it's doing\n" -" --language VAL Set language when reading rc file\n" -" --use-temp-file Use a temporary file instead of popen to read\n" -" the preprocessor output\n" -" --no-use-temp-file Use popen (default)\n" -msgstr "" - -#: windres.c:725 -msgid " --yydebug Turn on parser debugging\n" -msgstr "" - -#: windres.c:728 -msgid "" -" --help Print this help message\n" -" --version Print version information\n" -msgstr "" - -#: windres.c:731 -msgid "" -"FORMAT is one of rc, res, or coff, and is deduced from the file name\n" -"extension if not specified. A single file name is an input file.\n" -"No input-file is stdin, default rc. No output-file is stdout, default rc.\n" -msgstr "" - -#: windres.c:980 -msgid "no resources" -msgstr "" - -#: wrstabs.c:366 wrstabs.c:2028 -#, c-format -msgid "string_hash_lookup failed: %s\n" -msgstr "" - -#: wrstabs.c:666 -#, c-format -msgid "stab_int_type: bad size %u\n" -msgstr "" - -#: wrstabs.c:1468 -#, c-format -msgid "%s: warning: unknown size for field `%s' in struct\n" -msgstr "" diff --git a/contrib/binutils/include/opcode/mips.h b/contrib/binutils/include/opcode/mips.h deleted file mode 100644 index 1469e1072502..000000000000 --- a/contrib/binutils/include/opcode/mips.h +++ /dev/null @@ -1,789 +0,0 @@ -/* mips.h. Mips opcode list for GDB, the GNU debugger. - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. - Contributed by Ralph Campbell and OSF - Commented and modified by Ian Lance Taylor, Cygnus Support - -This file is part of GDB, GAS, and the GNU binutils. - -GDB, GAS, and the GNU binutils are free software; you can redistribute -them and/or modify them under the terms of the GNU General Public -License as published by the Free Software Foundation; either version -1, or (at your option) any later version. - -GDB, GAS, and the GNU binutils are distributed in the hope that they -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 file; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef _MIPS_H_ -#define _MIPS_H_ - -/* These are bit masks and shift counts to use to access the various - fields of an instruction. To retrieve the X field of an - instruction, use the expression - (i >> OP_SH_X) & OP_MASK_X - To set the same field (to j), use - i = (i &~ (OP_MASK_X << OP_SH_X)) | (j << OP_SH_X) - - Make sure you use fields that are appropriate for the instruction, - of course. - - The 'i' format uses OP, RS, RT and IMMEDIATE. - - The 'j' format uses OP and TARGET. - - The 'r' format uses OP, RS, RT, RD, SHAMT and FUNCT. - - The 'b' format uses OP, RS, RT and DELTA. - - The floating point 'i' format uses OP, RS, RT and IMMEDIATE. - - The floating point 'r' format uses OP, FMT, FT, FS, FD and FUNCT. - - A breakpoint instruction uses OP, CODE and SPEC (10 bits of the - breakpoint instruction are not defined; Kane says the breakpoint - code field in BREAK is 20 bits; yet MIPS assemblers and debuggers - only use ten bits). An optional two-operand form of break/sdbbp - allows the lower ten bits to be set too, and MIPS32 and later - architectures allow 20 bits to be set with a signal operand - (using CODE20). - - The syscall instruction uses CODE20. - - The general coprocessor instructions use COPZ. */ - -#define OP_MASK_OP 0x3f -#define OP_SH_OP 26 -#define OP_MASK_RS 0x1f -#define OP_SH_RS 21 -#define OP_MASK_FR 0x1f -#define OP_SH_FR 21 -#define OP_MASK_FMT 0x1f -#define OP_SH_FMT 21 -#define OP_MASK_BCC 0x7 -#define OP_SH_BCC 18 -#define OP_MASK_CODE 0x3ff -#define OP_SH_CODE 16 -#define OP_MASK_CODE2 0x3ff -#define OP_SH_CODE2 6 -#define OP_MASK_RT 0x1f -#define OP_SH_RT 16 -#define OP_MASK_FT 0x1f -#define OP_SH_FT 16 -#define OP_MASK_CACHE 0x1f -#define OP_SH_CACHE 16 -#define OP_MASK_RD 0x1f -#define OP_SH_RD 11 -#define OP_MASK_FS 0x1f -#define OP_SH_FS 11 -#define OP_MASK_PREFX 0x1f -#define OP_SH_PREFX 11 -#define OP_MASK_CCC 0x7 -#define OP_SH_CCC 8 -#define OP_MASK_CODE20 0xfffff /* 20 bit syscall/breakpoint code. */ -#define OP_SH_CODE20 6 -#define OP_MASK_SHAMT 0x1f -#define OP_SH_SHAMT 6 -#define OP_MASK_FD 0x1f -#define OP_SH_FD 6 -#define OP_MASK_TARGET 0x3ffffff -#define OP_SH_TARGET 0 -#define OP_MASK_COPZ 0x1ffffff -#define OP_SH_COPZ 0 -#define OP_MASK_IMMEDIATE 0xffff -#define OP_SH_IMMEDIATE 0 -#define OP_MASK_DELTA 0xffff -#define OP_SH_DELTA 0 -#define OP_MASK_FUNCT 0x3f -#define OP_SH_FUNCT 0 -#define OP_MASK_SPEC 0x3f -#define OP_SH_SPEC 0 -#define OP_SH_LOCC 8 /* FP condition code. */ -#define OP_SH_HICC 18 /* FP condition code. */ -#define OP_MASK_CC 0x7 -#define OP_SH_COP1NORM 25 /* Normal COP1 encoding. */ -#define OP_MASK_COP1NORM 0x1 /* a single bit. */ -#define OP_SH_COP1SPEC 21 /* COP1 encodings. */ -#define OP_MASK_COP1SPEC 0xf -#define OP_MASK_COP1SCLR 0x4 -#define OP_MASK_COP1CMP 0x3 -#define OP_SH_COP1CMP 4 -#define OP_SH_FORMAT 21 /* FP short format field. */ -#define OP_MASK_FORMAT 0x7 -#define OP_SH_TRUE 16 -#define OP_MASK_TRUE 0x1 -#define OP_SH_GE 17 -#define OP_MASK_GE 0x01 -#define OP_SH_UNSIGNED 16 -#define OP_MASK_UNSIGNED 0x1 -#define OP_SH_HINT 16 -#define OP_MASK_HINT 0x1f -#define OP_SH_MMI 0 /* Multimedia (parallel) op. */ -#define OP_MASK_MMI 0x3f -#define OP_SH_MMISUB 6 -#define OP_MASK_MMISUB 0x1f -#define OP_MASK_PERFREG 0x1f /* Performance monitoring. */ -#define OP_SH_PERFREG 1 -#define OP_SH_SEL 0 /* Coprocessor select field. */ -#define OP_MASK_SEL 0x7 /* The sel field of mfcZ and mtcZ. */ -#define OP_SH_CODE19 6 /* 19 bit wait code. */ -#define OP_MASK_CODE19 0x7ffff - -/* This structure holds information for a particular instruction. */ - -struct mips_opcode -{ - /* The name of the instruction. */ - const char *name; - /* A string describing the arguments for this instruction. */ - const char *args; - /* The basic opcode for the instruction. When assembling, this - opcode is modified by the arguments to produce the actual opcode - that is used. If pinfo is INSN_MACRO, then this is 0. */ - unsigned long match; - /* If pinfo is not INSN_MACRO, then this is a bit mask for the - relevant portions of the opcode when disassembling. If the - actual opcode anded with the match field equals the opcode field, - then we have found the correct instruction. If pinfo is - INSN_MACRO, then this field is the macro identifier. */ - unsigned long mask; - /* For a macro, this is INSN_MACRO. Otherwise, it is a collection - of bits describing the instruction, notably any relevant hazard - information. */ - unsigned long pinfo; - /* A collection of bits describing the instruction sets of which this - instruction or macro is a member. */ - unsigned long membership; -}; - -/* These are the characters which may appears in the args field of an - instruction. They appear in the order in which the fields appear - when the instruction is used. Commas and parentheses in the args - string are ignored when assembling, and written into the output - when disassembling. - - Each of these characters corresponds to a mask field defined above. - - "<" 5 bit shift amount (OP_*_SHAMT) - ">" shift amount between 32 and 63, stored after subtracting 32 (OP_*_SHAMT) - "a" 26 bit target address (OP_*_TARGET) - "b" 5 bit base register (OP_*_RS) - "c" 10 bit breakpoint code (OP_*_CODE) - "d" 5 bit destination register specifier (OP_*_RD) - "h" 5 bit prefx hint (OP_*_PREFX) - "i" 16 bit unsigned immediate (OP_*_IMMEDIATE) - "j" 16 bit signed immediate (OP_*_DELTA) - "k" 5 bit cache opcode in target register position (OP_*_CACHE) - "o" 16 bit signed offset (OP_*_DELTA) - "p" 16 bit PC relative branch target address (OP_*_DELTA) - "q" 10 bit extra breakpoint code (OP_*_CODE2) - "r" 5 bit same register used as both source and target (OP_*_RS) - "s" 5 bit source register specifier (OP_*_RS) - "t" 5 bit target register (OP_*_RT) - "u" 16 bit upper 16 bits of address (OP_*_IMMEDIATE) - "v" 5 bit same register used as both source and destination (OP_*_RS) - "w" 5 bit same register used as both target and destination (OP_*_RT) - "U" 5 bit same destination register in both OP_*_RD and OP_*_RT - (used by clo and clz) - "C" 25 bit coprocessor function code (OP_*_COPZ) - "B" 20 bit syscall/breakpoint function code (OP_*_CODE20) - "J" 19 bit wait function code (OP_*_CODE19) - "x" accept and ignore register name - "z" must be zero register - - Floating point instructions: - "D" 5 bit destination register (OP_*_FD) - "M" 3 bit compare condition code (OP_*_CCC) (only used for mips4 and up) - "N" 3 bit branch condition code (OP_*_BCC) (only used for mips4 and up) - "S" 5 bit fs source 1 register (OP_*_FS) - "T" 5 bit ft source 2 register (OP_*_FT) - "R" 5 bit fr source 3 register (OP_*_FR) - "V" 5 bit same register used as floating source and destination (OP_*_FS) - "W" 5 bit same register used as floating target and destination (OP_*_FT) - - Coprocessor instructions: - "E" 5 bit target register (OP_*_RT) - "G" 5 bit destination register (OP_*_RD) - "H" 3 bit sel field for (d)mtc* and (d)mfc* (OP_*_SEL) - "P" 5 bit performance-monitor register (OP_*_PERFREG) - - Macro instructions: - "A" General 32 bit expression - "I" 32 bit immediate - "F" 64 bit floating point constant in .rdata - "L" 64 bit floating point constant in .lit8 - "f" 32 bit floating point constant - "l" 32 bit floating point constant in .lit4 - - Other: - "()" parens surrounding optional value - "," separates operands - - Characters used so far, for quick reference when adding more: - "<>()," - "ABCDEFGHIJLMNPRSTUVW" - "abcdfhijklopqrstuvwxz" -*/ - -/* These are the bits which may be set in the pinfo field of an - instructions, if it is not equal to INSN_MACRO. */ - -/* Modifies the general purpose register in OP_*_RD. */ -#define INSN_WRITE_GPR_D 0x00000001 -/* Modifies the general purpose register in OP_*_RT. */ -#define INSN_WRITE_GPR_T 0x00000002 -/* Modifies general purpose register 31. */ -#define INSN_WRITE_GPR_31 0x00000004 -/* Modifies the floating point register in OP_*_FD. */ -#define INSN_WRITE_FPR_D 0x00000008 -/* Modifies the floating point register in OP_*_FS. */ -#define INSN_WRITE_FPR_S 0x00000010 -/* Modifies the floating point register in OP_*_FT. */ -#define INSN_WRITE_FPR_T 0x00000020 -/* Reads the general purpose register in OP_*_RS. */ -#define INSN_READ_GPR_S 0x00000040 -/* Reads the general purpose register in OP_*_RT. */ -#define INSN_READ_GPR_T 0x00000080 -/* Reads the floating point register in OP_*_FS. */ -#define INSN_READ_FPR_S 0x00000100 -/* Reads the floating point register in OP_*_FT. */ -#define INSN_READ_FPR_T 0x00000200 -/* Reads the floating point register in OP_*_FR. */ -#define INSN_READ_FPR_R 0x00000400 -/* Modifies coprocessor condition code. */ -#define INSN_WRITE_COND_CODE 0x00000800 -/* Reads coprocessor condition code. */ -#define INSN_READ_COND_CODE 0x00001000 -/* TLB operation. */ -#define INSN_TLB 0x00002000 -/* Reads coprocessor register other than floating point register. */ -#define INSN_COP 0x00004000 -/* Instruction loads value from memory, requiring delay. */ -#define INSN_LOAD_MEMORY_DELAY 0x00008000 -/* Instruction loads value from coprocessor, requiring delay. */ -#define INSN_LOAD_COPROC_DELAY 0x00010000 -/* Instruction has unconditional branch delay slot. */ -#define INSN_UNCOND_BRANCH_DELAY 0x00020000 -/* Instruction has conditional branch delay slot. */ -#define INSN_COND_BRANCH_DELAY 0x00040000 -/* Conditional branch likely: if branch not taken, insn nullified. */ -#define INSN_COND_BRANCH_LIKELY 0x00080000 -/* Moves to coprocessor register, requiring delay. */ -#define INSN_COPROC_MOVE_DELAY 0x00100000 -/* Loads coprocessor register from memory, requiring delay. */ -#define INSN_COPROC_MEMORY_DELAY 0x00200000 -/* Reads the HI register. */ -#define INSN_READ_HI 0x00400000 -/* Reads the LO register. */ -#define INSN_READ_LO 0x00800000 -/* Modifies the HI register. */ -#define INSN_WRITE_HI 0x01000000 -/* Modifies the LO register. */ -#define INSN_WRITE_LO 0x02000000 -/* Takes a trap (easier to keep out of delay slot). */ -#define INSN_TRAP 0x04000000 -/* Instruction stores value into memory. */ -#define INSN_STORE_MEMORY 0x08000000 -/* Instruction uses single precision floating point. */ -#define FP_S 0x10000000 -/* Instruction uses double precision floating point. */ -#define FP_D 0x20000000 -/* Instruction is part of the tx39's integer multiply family. */ -#define INSN_MULT 0x40000000 -/* Instruction synchronize shared memory. */ -#define INSN_SYNC 0x80000000 - -/* Instruction is actually a macro. It should be ignored by the - disassembler, and requires special treatment by the assembler. */ -#define INSN_MACRO 0xffffffff - -/* Masks used to mark instructions to indicate which MIPS ISA level - they were introduced in. ISAs, as defined below, are logical - ORs of these bits, indicatingthat they support the instructions - defined at the given level. */ - -#define INSN_ISA_MASK 0x00000fff -#define INSN_ISA1 0x00000010 -#define INSN_ISA2 0x00000020 -#define INSN_ISA3 0x00000040 -#define INSN_ISA4 0x00000080 -#define INSN_ISA5 0x00000100 -#define INSN_ISA32 0x00000200 -#define INSN_ISA64 0x00000400 - -/* Chip specific instructions. These are bitmasks. */ - -/* MIPS R4650 instruction. */ -#define INSN_4650 0x00010000 -/* LSI R4010 instruction. */ -#define INSN_4010 0x00020000 -/* NEC VR4100 instruction. */ -#define INSN_4100 0x00040000 -/* Toshiba R3900 instruction. */ -#define INSN_3900 0x00080000 -/* MIPS R10000 instruction. */ -#define INSN_10000 0x00100000 -/* Broadcom SB-1 instruction. */ -#define INSN_SB1 0x00200000 - -/* MIPS ISA defines, use instead of hardcoding ISA level. */ - -#define ISA_UNKNOWN 0 /* Gas internal use. */ -#define ISA_MIPS1 (INSN_ISA1) -#define ISA_MIPS2 (ISA_MIPS1 | INSN_ISA2) -#define ISA_MIPS3 (ISA_MIPS2 | INSN_ISA3) -#define ISA_MIPS4 (ISA_MIPS3 | INSN_ISA4) -#define ISA_MIPS5 (ISA_MIPS4 | INSN_ISA5) -#define ISA_MIPS32 (ISA_MIPS2 | INSN_ISA32) -#define ISA_MIPS64 (ISA_MIPS5 | INSN_ISA32 | INSN_ISA64) - -/* CPU defines, use instead of hardcoding processor number. Keep this - in sync with bfd/archures.c in order for machine selection to work. */ -#define CPU_UNKNOWN 0 /* Gas internal use. */ -#define CPU_R2000 2000 -#define CPU_R3000 3000 -#define CPU_R3900 3900 -#define CPU_R4000 4000 -#define CPU_R4010 4010 -#define CPU_VR4100 4100 -#define CPU_R4111 4111 -#define CPU_R4300 4300 -#define CPU_R4400 4400 -#define CPU_R4600 4600 -#define CPU_R4650 4650 -#define CPU_R5000 5000 -#define CPU_R6000 6000 -#define CPU_R8000 8000 -#define CPU_R10000 10000 -#define CPU_R12000 12000 -#define CPU_MIPS16 16 -#define CPU_MIPS32 32 -#define CPU_MIPS5 5 -#define CPU_MIPS64 64 -#define CPU_SB1 12310201 /* octal 'SB', 01. */ - -/* Test for membership in an ISA including chip specific ISAs. - INSN is pointer to an element of the opcode table; ISA is the - specified ISA to test against; and CPU is the CPU specific ISA - to test, or zero if no CPU specific ISA test is desired. */ - -#define OPCODE_IS_MEMBER(insn, isa, cpu) \ - (((insn)->membership & isa) != 0 \ - || (cpu == CPU_R4650 && ((insn)->membership & INSN_4650) != 0) \ - || (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_R10000 || cpu == CPU_R12000) \ - && ((insn)->membership & INSN_10000) != 0) \ - || (cpu == CPU_SB1 && ((insn)->membership & INSN_SB1) != 0) \ - || 0) /* Please keep this term for easier source merging. */ - -/* This is a list of macro expanded instructions. - - _I appended means immediate - _A appended means address - _AB appended means address with base register - _D appended means 64 bit floating point constant - _S appended means 32 bit floating point constant. */ - -enum -{ - M_ABS, - M_ADD_I, - M_ADDU_I, - M_AND_I, - M_BEQ, - M_BEQ_I, - M_BEQL_I, - M_BGE, - M_BGEL, - M_BGE_I, - M_BGEL_I, - M_BGEU, - M_BGEUL, - M_BGEU_I, - M_BGEUL_I, - M_BGT, - M_BGTL, - M_BGT_I, - M_BGTL_I, - M_BGTU, - M_BGTUL, - M_BGTU_I, - M_BGTUL_I, - M_BLE, - M_BLEL, - M_BLE_I, - M_BLEL_I, - M_BLEU, - M_BLEUL, - M_BLEU_I, - M_BLEUL_I, - M_BLT, - M_BLTL, - M_BLT_I, - M_BLTL_I, - M_BLTU, - M_BLTUL, - M_BLTU_I, - M_BLTUL_I, - M_BNE, - M_BNE_I, - M_BNEL_I, - M_DABS, - M_DADD_I, - M_DADDU_I, - M_DDIV_3, - M_DDIV_3I, - M_DDIVU_3, - M_DDIVU_3I, - M_DIV_3, - M_DIV_3I, - M_DIVU_3, - M_DIVU_3I, - M_DLA_AB, - M_DLI, - M_DMUL, - M_DMUL_I, - M_DMULO, - M_DMULO_I, - M_DMULOU, - M_DMULOU_I, - M_DREM_3, - M_DREM_3I, - M_DREMU_3, - M_DREMU_3I, - M_DSUB_I, - M_DSUBU_I, - M_DSUBU_I_2, - M_J_A, - M_JAL_1, - M_JAL_2, - M_JAL_A, - M_L_DOB, - M_L_DAB, - M_LA_AB, - M_LB_A, - M_LB_AB, - M_LBU_A, - M_LBU_AB, - M_LD_A, - M_LD_OB, - M_LD_AB, - M_LDC1_AB, - M_LDC2_AB, - M_LDC3_AB, - M_LDL_AB, - M_LDR_AB, - M_LH_A, - M_LH_AB, - M_LHU_A, - M_LHU_AB, - M_LI, - M_LI_D, - M_LI_DD, - M_LI_S, - M_LI_SS, - M_LL_AB, - M_LLD_AB, - M_LS_A, - M_LW_A, - M_LW_AB, - M_LWC0_A, - M_LWC0_AB, - M_LWC1_A, - M_LWC1_AB, - M_LWC2_A, - M_LWC2_AB, - M_LWC3_A, - M_LWC3_AB, - M_LWL_A, - M_LWL_AB, - M_LWR_A, - M_LWR_AB, - M_LWU_AB, - M_MOVE, - M_MUL, - M_MUL_I, - M_MULO, - M_MULO_I, - M_MULOU, - M_MULOU_I, - M_NOR_I, - M_OR_I, - M_REM_3, - M_REM_3I, - M_REMU_3, - M_REMU_3I, - M_ROL, - M_ROL_I, - M_ROR, - M_ROR_I, - M_S_DA, - M_S_DOB, - M_S_DAB, - M_S_S, - M_SC_AB, - M_SCD_AB, - M_SD_A, - M_SD_OB, - M_SD_AB, - M_SDC1_AB, - M_SDC2_AB, - M_SDC3_AB, - M_SDL_AB, - M_SDR_AB, - M_SEQ, - M_SEQ_I, - M_SGE, - M_SGE_I, - M_SGEU, - M_SGEU_I, - M_SGT, - M_SGT_I, - M_SGTU, - M_SGTU_I, - M_SLE, - M_SLE_I, - M_SLEU, - M_SLEU_I, - M_SLT_I, - M_SLTU_I, - M_SNE, - M_SNE_I, - M_SB_A, - M_SB_AB, - M_SH_A, - M_SH_AB, - M_SW_A, - M_SW_AB, - M_SWC0_A, - M_SWC0_AB, - M_SWC1_A, - M_SWC1_AB, - M_SWC2_A, - M_SWC2_AB, - M_SWC3_A, - M_SWC3_AB, - M_SWL_A, - M_SWL_AB, - M_SWR_A, - M_SWR_AB, - M_SUB_I, - M_SUBU_I, - M_SUBU_I_2, - M_TEQ_I, - M_TGE_I, - M_TGEU_I, - M_TLT_I, - M_TLTU_I, - M_TNE_I, - M_TRUNCWD, - M_TRUNCWS, - M_ULD, - M_ULD_A, - M_ULH, - M_ULH_A, - M_ULHU, - M_ULHU_A, - M_ULW, - M_ULW_A, - M_USH, - M_USH_A, - M_USW, - M_USW_A, - M_USD, - M_USD_A, - M_XOR_I, - M_COP0, - M_COP1, - M_COP2, - M_COP3, - M_NUM_MACROS -}; - - -/* The order of overloaded instructions matters. Label arguments and - register arguments look the same. Instructions that can have either - for arguments must apear in the correct order in this table for the - assembler to pick the right one. In other words, entries with - immediate operands must apear after the same instruction with - registers. - - Many instructions are short hand for other instructions (i.e., The - jal <register> instruction is short for jalr <register>). */ - -extern const struct mips_opcode mips_builtin_opcodes[]; -extern const int bfd_mips_num_builtin_opcodes; -extern struct mips_opcode *mips_opcodes; -extern int bfd_mips_num_opcodes; -#define NUMOPCODES bfd_mips_num_opcodes - - -/* The rest of this file adds definitions for the mips16 TinyRISC - processor. */ - -/* These are the bitmasks and shift counts used for the different - fields in the instruction formats. Other than OP, no masks are - provided for the fixed portions of an instruction, since they are - not needed. - - The I format uses IMM11. - - The RI format uses RX and IMM8. - - The RR format uses RX, and RY. - - The RRI format uses RX, RY, and IMM5. - - The RRR format uses RX, RY, and RZ. - - The RRI_A format uses RX, RY, and IMM4. - - The SHIFT format uses RX, RY, and SHAMT. - - The I8 format uses IMM8. - - The I8_MOVR32 format uses RY and REGR32. - - The IR_MOV32R format uses REG32R and MOV32Z. - - The I64 format uses IMM8. - - The RI64 format uses RY and IMM5. - */ - -#define MIPS16OP_MASK_OP 0x1f -#define MIPS16OP_SH_OP 11 -#define MIPS16OP_MASK_IMM11 0x7ff -#define MIPS16OP_SH_IMM11 0 -#define MIPS16OP_MASK_RX 0x7 -#define MIPS16OP_SH_RX 8 -#define MIPS16OP_MASK_IMM8 0xff -#define MIPS16OP_SH_IMM8 0 -#define MIPS16OP_MASK_RY 0x7 -#define MIPS16OP_SH_RY 5 -#define MIPS16OP_MASK_IMM5 0x1f -#define MIPS16OP_SH_IMM5 0 -#define MIPS16OP_MASK_RZ 0x7 -#define MIPS16OP_SH_RZ 2 -#define MIPS16OP_MASK_IMM4 0xf -#define MIPS16OP_SH_IMM4 0 -#define MIPS16OP_MASK_REGR32 0x1f -#define MIPS16OP_SH_REGR32 0 -#define MIPS16OP_MASK_REG32R 0x1f -#define MIPS16OP_SH_REG32R 3 -#define MIPS16OP_EXTRACT_REG32R(i) ((((i) >> 5) & 7) | ((i) & 0x18)) -#define MIPS16OP_MASK_MOVE32Z 0x7 -#define MIPS16OP_SH_MOVE32Z 0 -#define MIPS16OP_MASK_IMM6 0x3f -#define MIPS16OP_SH_IMM6 5 - -/* These are the characters which may appears in the args field of an - instruction. They appear in the order in which the fields appear - when the instruction is used. Commas and parentheses in the args - string are ignored when assembling, and written into the output - when disassembling. - - "y" 3 bit register (MIPS16OP_*_RY) - "x" 3 bit register (MIPS16OP_*_RX) - "z" 3 bit register (MIPS16OP_*_RZ) - "Z" 3 bit register (MIPS16OP_*_MOVE32Z) - "v" 3 bit same register as source and destination (MIPS16OP_*_RX) - "w" 3 bit same register as source and destination (MIPS16OP_*_RY) - "0" zero register ($0) - "S" stack pointer ($sp or $29) - "P" program counter - "R" return address register ($ra or $31) - "X" 5 bit MIPS register (MIPS16OP_*_REGR32) - "Y" 5 bit MIPS register (MIPS16OP_*_REG32R) - "6" 6 bit unsigned break code (MIPS16OP_*_IMM6) - "a" 26 bit jump address - "e" 11 bit extension value - "l" register list for entry instruction - "L" register list for exit instruction - - The remaining codes may be extended. Except as otherwise noted, - the full extended operand is a 16 bit signed value. - "<" 3 bit unsigned shift count * 0 (MIPS16OP_*_RZ) (full 5 bit unsigned) - ">" 3 bit unsigned shift count * 0 (MIPS16OP_*_RX) (full 5 bit unsigned) - "[" 3 bit unsigned shift count * 0 (MIPS16OP_*_RZ) (full 6 bit unsigned) - "]" 3 bit unsigned shift count * 0 (MIPS16OP_*_RX) (full 6 bit unsigned) - "4" 4 bit signed immediate * 0 (MIPS16OP_*_IMM4) (full 15 bit signed) - "5" 5 bit unsigned immediate * 0 (MIPS16OP_*_IMM5) - "H" 5 bit unsigned immediate * 2 (MIPS16OP_*_IMM5) - "W" 5 bit unsigned immediate * 4 (MIPS16OP_*_IMM5) - "D" 5 bit unsigned immediate * 8 (MIPS16OP_*_IMM5) - "j" 5 bit signed immediate * 0 (MIPS16OP_*_IMM5) - "8" 8 bit unsigned immediate * 0 (MIPS16OP_*_IMM8) - "V" 8 bit unsigned immediate * 4 (MIPS16OP_*_IMM8) - "C" 8 bit unsigned immediate * 8 (MIPS16OP_*_IMM8) - "U" 8 bit unsigned immediate * 0 (MIPS16OP_*_IMM8) (full 16 bit unsigned) - "k" 8 bit signed immediate * 0 (MIPS16OP_*_IMM8) - "K" 8 bit signed immediate * 8 (MIPS16OP_*_IMM8) - "p" 8 bit conditional branch address (MIPS16OP_*_IMM8) - "q" 11 bit branch address (MIPS16OP_*_IMM11) - "A" 8 bit PC relative address * 4 (MIPS16OP_*_IMM8) - "B" 5 bit PC relative address * 8 (MIPS16OP_*_IMM5) - "E" 5 bit PC relative address * 4 (MIPS16OP_*_IMM5) - */ - -/* For the mips16, we use the same opcode table format and a few of - the same flags. However, most of the flags are different. */ - -/* Modifies the register in MIPS16OP_*_RX. */ -#define MIPS16_INSN_WRITE_X 0x00000001 -/* Modifies the register in MIPS16OP_*_RY. */ -#define MIPS16_INSN_WRITE_Y 0x00000002 -/* Modifies the register in MIPS16OP_*_RZ. */ -#define MIPS16_INSN_WRITE_Z 0x00000004 -/* Modifies the T ($24) register. */ -#define MIPS16_INSN_WRITE_T 0x00000008 -/* Modifies the SP ($29) register. */ -#define MIPS16_INSN_WRITE_SP 0x00000010 -/* Modifies the RA ($31) register. */ -#define MIPS16_INSN_WRITE_31 0x00000020 -/* Modifies the general purpose register in MIPS16OP_*_REG32R. */ -#define MIPS16_INSN_WRITE_GPR_Y 0x00000040 -/* Reads the register in MIPS16OP_*_RX. */ -#define MIPS16_INSN_READ_X 0x00000080 -/* Reads the register in MIPS16OP_*_RY. */ -#define MIPS16_INSN_READ_Y 0x00000100 -/* Reads the register in MIPS16OP_*_MOVE32Z. */ -#define MIPS16_INSN_READ_Z 0x00000200 -/* Reads the T ($24) register. */ -#define MIPS16_INSN_READ_T 0x00000400 -/* Reads the SP ($29) register. */ -#define MIPS16_INSN_READ_SP 0x00000800 -/* Reads the RA ($31) register. */ -#define MIPS16_INSN_READ_31 0x00001000 -/* Reads the program counter. */ -#define MIPS16_INSN_READ_PC 0x00002000 -/* Reads the general purpose register in MIPS16OP_*_REGR32. */ -#define MIPS16_INSN_READ_GPR_X 0x00004000 -/* Is a branch insn. */ -#define MIPS16_INSN_BRANCH 0x00010000 - -/* The following flags have the same value for the mips16 opcode - table: - INSN_UNCOND_BRANCH_DELAY - INSN_COND_BRANCH_DELAY - INSN_COND_BRANCH_LIKELY (never used) - INSN_READ_HI - INSN_READ_LO - INSN_WRITE_HI - INSN_WRITE_LO - INSN_TRAP - INSN_ISA3 - */ - -extern const struct mips_opcode mips16_opcodes[]; -extern const int bfd_mips16_num_opcodes; - -#endif /* _MIPS_H_ */ diff --git a/contrib/binutils/include/opcode/s390.h b/contrib/binutils/include/opcode/s390.h deleted file mode 100644 index 1a42be6603a7..000000000000 --- a/contrib/binutils/include/opcode/s390.h +++ /dev/null @@ -1,130 +0,0 @@ -/* s390.h -- Header file for S390 opcode table - Copyright 2000, 2001 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - - 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. */ - -#ifndef S390_H -#define S390_H - -/* List of instruction sets variations. */ - -enum s390_opcode_arch_val - { - S390_OPCODE_ESA = 0, - S390_OPCODE_ESAME - }; - -/* The opcode table is an array of struct s390_opcode. */ - -struct s390_opcode - { - /* The opcode name. */ - const char * name; - - /* The opcode itself. Those bits which will be filled in with - operands are zeroes. */ - unsigned char opcode[6]; - - /* The opcode mask. This is used by the disassembler. This is a - mask containing ones indicating those bits which must match the - opcode field, and zeroes indicating those bits which need not - match (and are presumably filled in by operands). */ - unsigned char mask[6]; - - /* The opcode length in bytes. */ - int oplen; - - /* An array of operand codes. Each code is an index into the - operand table. They appear in the order which the operands must - appear in assembly code, and are terminated by a zero. */ - unsigned char operands[6]; - - /* Bitmask of architectures this opcode is available for. */ - unsigned int architecture; - }; - -/* The table itself is sorted by major opcode number, and is otherwise - in the order in which the disassembler should consider - instructions. */ -extern const struct s390_opcode s390_opcodes[]; -extern const int s390_num_opcodes; - -/* A opcode format table for the .insn pseudo mnemonic. */ -extern const struct s390_opcode s390_opformats[]; -extern const int s390_num_opformats; - -/* Values defined for the flags field of a struct powerpc_opcode. */ - -/* The operands table is an array of struct s390_operand. */ - -struct s390_operand - { - /* The number of bits in the operand. */ - int bits; - - /* How far the operand is left shifted in the instruction. */ - int shift; - - /* One bit syntax flags. */ - unsigned long flags; - }; - -/* Elements in the table are retrieved by indexing with values from - the operands field of the powerpc_opcodes table. */ - -extern const struct s390_operand s390_operands[]; - -/* Values defined for the flags field of a struct s390_operand. */ - -/* This operand names a register. The disassembler uses this to print - register names with a leading 'r'. */ -#define S390_OPERAND_GPR 0x1 - -/* This operand names a floating point register. The disassembler - prints these with a leading 'f'. */ -#define S390_OPERAND_FPR 0x2 - -/* This operand names an access register. The disassembler - prints these with a leading 'a'. */ -#define S390_OPERAND_AR 0x4 - -/* This operand names a control register. The disassembler - prints these with a leading 'c'. */ -#define S390_OPERAND_CR 0x8 - -/* This operand is a displacement. */ -#define S390_OPERAND_DISP 0x10 - -/* This operand names a base register. */ -#define S390_OPERAND_BASE 0x20 - -/* This operand names an index register, it can be skipped. */ -#define S390_OPERAND_INDEX 0x40 - -/* This operand is a relative branch displacement. The disassembler - prints these symbolically if possible. */ -#define S390_OPERAND_PCREL 0x80 - -/* This operand takes signed values. */ -#define S390_OPERAND_SIGNED 0x100 - -/* This operand is a length. */ -#define S390_OPERAND_LENGTH 0x200 - -#endif /* S390_H */ diff --git a/contrib/binutils/include/opcode/tic30.h b/contrib/binutils/include/opcode/tic30.h deleted file mode 100644 index a70027591188..000000000000 --- a/contrib/binutils/include/opcode/tic30.h +++ /dev/null @@ -1,691 +0,0 @@ -/* tic30.h -- Header file for TI TMS320C30 opcode table - Copyright 1998 Free Software Foundation, Inc. - Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) - -This file is part of GDB, GAS, and the GNU binutils. - -GDB, GAS, and the GNU binutils are free software; you can redistribute -them and/or modify them under the terms of the GNU General Public -License as published by the Free Software Foundation; either version -1, or (at your option) any later version. - -GDB, GAS, and the GNU binutils are distributed in the hope that they -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 file; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* FIXME: The opcode table should be in opcodes/tic30-opc.c, not in a - header file. */ - -#ifndef _TMS320_H_ -#define _TMS320_H_ - -struct _register -{ - char *name; - unsigned char opcode; - unsigned char regtype; -}; - -typedef struct _register reg; - -#define REG_Rn 0x01 -#define REG_ARn 0x02 -#define REG_DP 0x03 -#define REG_OTHER 0x04 - -static const reg tic30_regtab[] = { - { "r0", 0x00, REG_Rn }, - { "r1", 0x01, REG_Rn }, - { "r2", 0x02, REG_Rn }, - { "r3", 0x03, REG_Rn }, - { "r4", 0x04, REG_Rn }, - { "r5", 0x05, REG_Rn }, - { "r6", 0x06, REG_Rn }, - { "r7", 0x07, REG_Rn }, - { "ar0",0x08, REG_ARn }, - { "ar1",0x09, REG_ARn }, - { "ar2",0x0A, REG_ARn }, - { "ar3",0x0B, REG_ARn }, - { "ar4",0x0C, REG_ARn }, - { "ar5",0x0D, REG_ARn }, - { "ar6",0x0E, REG_ARn }, - { "ar7",0x0F, REG_ARn }, - { "dp", 0x10, REG_DP }, - { "ir0",0x11, REG_OTHER }, - { "ir1",0x12, REG_OTHER }, - { "bk", 0x13, REG_OTHER }, - { "sp", 0x14, REG_OTHER }, - { "st", 0x15, REG_OTHER }, - { "ie", 0x16, REG_OTHER }, - { "if", 0x17, REG_OTHER }, - { "iof",0x18, REG_OTHER }, - { "rs", 0x19, REG_OTHER }, - { "re", 0x1A, REG_OTHER }, - { "rc", 0x1B, REG_OTHER }, - { "R0", 0x00, REG_Rn }, - { "R1", 0x01, REG_Rn }, - { "R2", 0x02, REG_Rn }, - { "R3", 0x03, REG_Rn }, - { "R4", 0x04, REG_Rn }, - { "R5", 0x05, REG_Rn }, - { "R6", 0x06, REG_Rn }, - { "R7", 0x07, REG_Rn }, - { "AR0",0x08, REG_ARn }, - { "AR1",0x09, REG_ARn }, - { "AR2",0x0A, REG_ARn }, - { "AR3",0x0B, REG_ARn }, - { "AR4",0x0C, REG_ARn }, - { "AR5",0x0D, REG_ARn }, - { "AR6",0x0E, REG_ARn }, - { "AR7",0x0F, REG_ARn }, - { "DP", 0x10, REG_DP }, - { "IR0",0x11, REG_OTHER }, - { "IR1",0x12, REG_OTHER }, - { "BK", 0x13, REG_OTHER }, - { "SP", 0x14, REG_OTHER }, - { "ST", 0x15, REG_OTHER }, - { "IE", 0x16, REG_OTHER }, - { "IF", 0x17, REG_OTHER }, - { "IOF",0x18, REG_OTHER }, - { "RS", 0x19, REG_OTHER }, - { "RE", 0x1A, REG_OTHER }, - { "RC", 0x1B, REG_OTHER }, - { "", 0, 0 } -}; - -static const reg *const tic30_regtab_end - = tic30_regtab + sizeof(tic30_regtab)/sizeof(tic30_regtab[0]); - -/* Indirect Addressing Modes Modification Fields */ -/* Indirect Addressing with Displacement */ -#define PreDisp_Add 0x00 -#define PreDisp_Sub 0x01 -#define PreDisp_Add_Mod 0x02 -#define PreDisp_Sub_Mod 0x03 -#define PostDisp_Add_Mod 0x04 -#define PostDisp_Sub_Mod 0x05 -#define PostDisp_Add_Circ 0x06 -#define PostDisp_Sub_Circ 0x07 -/* Indirect Addressing with Index Register IR0 */ -#define PreIR0_Add 0x08 -#define PreIR0_Sub 0x09 -#define PreIR0_Add_Mod 0x0A -#define PreIR0_Sub_Mod 0x0B -#define PostIR0_Add_Mod 0x0C -#define PostIR0_Sub_Mod 0x0D -#define PostIR0_Add_Circ 0x0E -#define PostIR0_Sub_Circ 0x0F -/* Indirect Addressing with Index Register IR1 */ -#define PreIR1_Add 0x10 -#define PreIR1_Sub 0x11 -#define PreIR1_Add_Mod 0x12 -#define PreIR1_Sub_Mod 0x13 -#define PostIR1_Add_Mod 0x14 -#define PostIR1_Sub_Mod 0x15 -#define PostIR1_Add_Circ 0x16 -#define PostIR1_Sub_Circ 0x17 -/* Indirect Addressing (Special Cases) */ -#define IndirectOnly 0x18 -#define PostIR0_Add_BitRev 0x19 - -typedef struct { - char *syntax; - unsigned char modfield; - unsigned char displacement; -} ind_addr_type; - -#define IMPLIED_DISP 0x01 -#define DISP_REQUIRED 0x02 -#define NO_DISP 0x03 - -static const ind_addr_type tic30_indaddr_tab[] = { - { "*+ar", PreDisp_Add, IMPLIED_DISP }, - { "*-ar", PreDisp_Sub, IMPLIED_DISP }, - { "*++ar", PreDisp_Add_Mod, IMPLIED_DISP }, - { "*--ar", PreDisp_Sub_Mod, IMPLIED_DISP }, - { "*ar++", PostDisp_Add_Mod, IMPLIED_DISP }, - { "*ar--", PostDisp_Sub_Mod, IMPLIED_DISP }, - { "*ar++%", PostDisp_Add_Circ, IMPLIED_DISP }, - { "*ar--%", PostDisp_Sub_Circ, IMPLIED_DISP }, - { "*+ar()", PreDisp_Add, DISP_REQUIRED }, - { "*-ar()", PreDisp_Sub, DISP_REQUIRED }, - { "*++ar()", PreDisp_Add_Mod, DISP_REQUIRED }, - { "*--ar()", PreDisp_Sub_Mod, DISP_REQUIRED }, - { "*ar++()", PostDisp_Add_Mod, DISP_REQUIRED }, - { "*ar--()", PostDisp_Sub_Mod, DISP_REQUIRED }, - { "*ar++()%", PostDisp_Add_Circ, DISP_REQUIRED }, - { "*ar--()%", PostDisp_Sub_Circ, DISP_REQUIRED }, - { "*+ar(ir0)", PreIR0_Add, NO_DISP }, - { "*-ar(ir0)", PreIR0_Sub, NO_DISP }, - { "*++ar(ir0)", PreIR0_Add_Mod, NO_DISP }, - { "*--ar(ir0)", PreIR0_Sub_Mod, NO_DISP }, - { "*ar++(ir0)", PostIR0_Add_Mod, NO_DISP }, - { "*ar--(ir0)", PostIR0_Sub_Mod, NO_DISP }, - { "*ar++(ir0)%",PostIR0_Add_Circ, NO_DISP }, - { "*ar--(ir0)%",PostIR0_Sub_Circ, NO_DISP }, - { "*+ar(ir1)", PreIR1_Add, NO_DISP }, - { "*-ar(ir1)", PreIR1_Sub, NO_DISP }, - { "*++ar(ir1)", PreIR1_Add_Mod, NO_DISP }, - { "*--ar(ir1)", PreIR1_Sub_Mod, NO_DISP }, - { "*ar++(ir1)", PostIR1_Add_Mod, NO_DISP }, - { "*ar--(ir1)", PostIR1_Sub_Mod, NO_DISP }, - { "*ar++(ir1)%",PostIR1_Add_Circ, NO_DISP }, - { "*ar--(ir1)%",PostIR1_Sub_Circ, NO_DISP }, - { "*ar", IndirectOnly, NO_DISP }, - { "*ar++(ir0)b",PostIR0_Add_BitRev, NO_DISP }, - { "", 0,0 } -}; - -static const ind_addr_type *const tic30_indaddrtab_end - = tic30_indaddr_tab + sizeof(tic30_indaddr_tab)/sizeof(tic30_indaddr_tab[0]); - -/* Possible operand types */ -/* Register types */ -#define Rn 0x0001 -#define ARn 0x0002 -#define DPReg 0x0004 -#define OtherReg 0x0008 -/* Addressing mode types */ -#define Direct 0x0010 -#define Indirect 0x0020 -#define Imm16 0x0040 -#define Disp 0x0080 -#define Imm24 0x0100 -#define Abs24 0x0200 -/* 3 operand addressing mode types */ -#define op3T1 0x0400 -#define op3T2 0x0800 -/* Interrupt vector */ -#define IVector 0x1000 -/* Not required */ -#define NotReq 0x2000 - -#define GAddr1 Rn | Direct | Indirect | Imm16 -#define GAddr2 GAddr1 | AllReg -#define TAddr1 op3T1 | Rn | Indirect -#define TAddr2 op3T2 | Rn | Indirect -#define Reg Rn | ARn -#define AllReg Reg | DPReg | OtherReg - -typedef struct _template -{ - char *name; - unsigned int operands; /* how many operands */ - unsigned int base_opcode; /* base_opcode is the fundamental opcode byte */ - /* the bits in opcode_modifier are used to generate the final opcode from - the base_opcode. These bits also are used to detect alternate forms of - the same instruction */ - unsigned int opcode_modifier; - - /* opcode_modifier bits: */ -#define AddressMode 0x00600000 -#define PCRel 0x02000000 -#define StackOp 0x001F0000 -#define Rotate StackOp - - /* operand_types[i] describes the type of operand i. This is made - by OR'ing together all of the possible type masks. (e.g. - 'operand_types[i] = Reg|Imm' specifies that operand i can be - either a register or an immediate operand */ - unsigned int operand_types[3]; - /* This defines the number type of an immediate argument to an instruction. */ - int imm_arg_type; -#define Imm_None 0 -#define Imm_Float 1 -#define Imm_SInt 2 -#define Imm_UInt 3 -} -template; - -static const template tic30_optab[] = { - { "absf" ,2,0x00000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "absi" ,2,0x00800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "addc" ,2,0x01000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "addc3" ,3,0x20000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None }, - { "addf" ,2,0x01800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "addf3" ,3,0x20800000,AddressMode, { TAddr1, TAddr2, Rn }, Imm_None }, - { "addi" ,2,0x02000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "addi3" ,3,0x21000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None }, - { "and" ,2,0x02800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt }, - { "and3" ,3,0x21800000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None }, - { "andn" ,2,0x03000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt }, - { "andn3" ,3,0x22000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None }, - { "ash" ,2,0x03800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ash3" ,3,0x22800000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None }, - { "b" ,1,0x68000000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bu" ,1,0x68000000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "blo" ,1,0x68010000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bls" ,1,0x68020000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bhi" ,1,0x68030000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bhs" ,1,0x68040000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "beq" ,1,0x68050000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bne" ,1,0x68060000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "blt" ,1,0x68070000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "ble" ,1,0x68080000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bgt" ,1,0x68090000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bge" ,1,0x680A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bz" ,1,0x68050000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnz" ,1,0x68060000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bp" ,1,0x68090000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bn" ,1,0x68070000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnn" ,1,0x680A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnv" ,1,0x680C0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bv" ,1,0x680D0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnuf" ,1,0x680E0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "buf" ,1,0x680F0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnc" ,1,0x68040000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bc" ,1,0x68010000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnlv" ,1,0x68100000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "blv" ,1,0x68110000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnluf" ,1,0x68120000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bluf" ,1,0x68130000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bzuf" ,1,0x68140000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bd" ,1,0x68200000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bud" ,1,0x68200000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "blod" ,1,0x68210000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "blsd" ,1,0x68220000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bhid" ,1,0x68230000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bhsd" ,1,0x68240000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "beqd" ,1,0x68250000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bned" ,1,0x68260000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bltd" ,1,0x68270000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bled" ,1,0x68280000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bgtd" ,1,0x68290000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bged" ,1,0x682A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bzd" ,1,0x68250000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnzd" ,1,0x68260000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bpd" ,1,0x68290000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnd" ,1,0x68270000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnnd" ,1,0x682A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnvd" ,1,0x682C0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bvd" ,1,0x682D0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnufd" ,1,0x682E0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bufd" ,1,0x682F0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bncd" ,1,0x68240000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bcd" ,1,0x68210000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnlvd" ,1,0x68300000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "blvd" ,1,0x68310000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bnlufd" ,1,0x68320000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "blufd" ,1,0x68330000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "bzufd" ,1,0x68340000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None }, - { "br" ,1,0x60000000,0, { Imm24, 0, 0 }, Imm_UInt }, - { "brd" ,1,0x61000000,0, { Imm24, 0, 0 }, Imm_UInt }, - { "call" ,1,0x62000000,0, { Imm24, 0, 0 }, Imm_UInt }, - { "callu" ,1,0x70000000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "calllo" ,1,0x70010000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callls" ,1,0x70020000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callhi" ,1,0x70030000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callhs" ,1,0x70040000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "calleq" ,1,0x70050000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callne" ,1,0x70060000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "calllt" ,1,0x70070000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callle" ,1,0x70080000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callgt" ,1,0x70090000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callge" ,1,0x700A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callz" ,1,0x70050000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callnz" ,1,0x70060000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callp" ,1,0x70090000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "calln" ,1,0x70070000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callnn" ,1,0x700A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callnv" ,1,0x700C0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callv" ,1,0x700D0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callnuf",1,0x700E0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "calluf" ,1,0x700F0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callnc" ,1,0x70040000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callc" ,1,0x70010000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callnlv",1,0x70100000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "calllv" ,1,0x70110000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callnluf",1,0x70120000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callluf",1,0x70130000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "callzuf",1,0x70140000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt }, - { "cmpf" ,2,0x04000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "cmpf3" ,2,0x23000000,AddressMode, { TAddr1, TAddr2, 0 }, Imm_None }, - { "cmpi" ,2,0x04800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "cmpi3" ,2,0x23800000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, 0 }, Imm_None }, - { "db" ,2,0x6C000000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbu" ,2,0x6C000000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dblo" ,2,0x6C010000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbls" ,2,0x6C020000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbhi" ,2,0x6C030000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbhs" ,2,0x6C040000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbeq" ,2,0x6C050000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbne" ,2,0x6C060000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dblt" ,2,0x6C070000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dble" ,2,0x6C080000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbgt" ,2,0x6C090000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbge" ,2,0x6C0A0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbz" ,2,0x6C050000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnz" ,2,0x6C060000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbp" ,2,0x6C090000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbn" ,2,0x6C070000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnn" ,2,0x6C0A0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnv" ,2,0x6C0C0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbv" ,2,0x6C0D0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnuf" ,2,0x6C0E0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbuf" ,2,0x6C0F0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnc" ,2,0x6C040000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbc" ,2,0x6C010000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnlv" ,2,0x6C100000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dblv" ,2,0x6C110000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnluf" ,2,0x6C120000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbluf" ,2,0x6C130000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbzuf" ,2,0x6C140000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbd" ,2,0x6C200000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbud" ,2,0x6C200000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dblod" ,2,0x6C210000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dblsd" ,2,0x6C220000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbhid" ,2,0x6C230000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbhsd" ,2,0x6C240000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbeqd" ,2,0x6C250000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbned" ,2,0x6C260000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbltd" ,2,0x6C270000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbled" ,2,0x6C280000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbgtd" ,2,0x6C290000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbged" ,2,0x6C2A0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbzd" ,2,0x6C250000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnzd" ,2,0x6C260000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbpd" ,2,0x6C290000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnd" ,2,0x6C270000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnnd" ,2,0x6C2A0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnvd" ,2,0x6C2C0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbvd" ,2,0x6C2D0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnufd" ,2,0x6C2E0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbufd" ,2,0x6C2F0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbncd" ,2,0x6C240000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbcd" ,2,0x6C210000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnlvd" ,2,0x6C300000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dblvd" ,2,0x6C310000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbnlufd",2,0x6C320000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dblufd" ,2,0x6C330000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "dbzufd" ,2,0x6C340000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None }, - { "fix" ,2,0x05000000,AddressMode, { GAddr1, AllReg, 0 }, Imm_Float }, - { "float" ,2,0x05800000,AddressMode, { GAddr2, Rn, 0 }, Imm_SInt }, - { "iack" ,1,0x1B000000,AddressMode, { Direct|Indirect, 0, 0 }, Imm_None }, - { "idle" ,0,0x06000000,0, { 0, 0, 0 }, Imm_None }, - { "idle2" ,0,0x06000001,0, { 0, 0, 0 }, Imm_None }, /* LC31 Only */ - { "lde" ,2,0x06800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldf" ,2,0x07000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfu" ,2,0x40000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldflo" ,2,0x40800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfls" ,2,0x41000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfhi" ,2,0x41800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfhs" ,2,0x42000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfeq" ,2,0x42800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfne" ,2,0x43000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldflt" ,2,0x43800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfle" ,2,0x44000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfgt" ,2,0x44800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfge" ,2,0x45000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfz" ,2,0x42800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfnz" ,2,0x43000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfp" ,2,0x44800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfn" ,2,0x43800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfnn" ,2,0x45000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfnv" ,2,0x46000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfv" ,2,0x46800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfnuf" ,2,0x47000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfuf" ,2,0x47800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfnc" ,2,0x42000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfc" ,2,0x40800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfnlv" ,2,0x48000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldflv" ,2,0x48800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfnluf",2,0x49000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfluf" ,2,0x49800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfzuf" ,2,0x4A000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldfi" ,2,0x07800000,AddressMode, { Direct|Indirect, Rn, 0 }, Imm_None }, - { "ldi" ,2,0x08000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldiu" ,2,0x50000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldilo" ,2,0x50800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldils" ,2,0x51000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldihi" ,2,0x51800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldihs" ,2,0x52000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldieq" ,2,0x52800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldine" ,2,0x53000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldilt" ,2,0x53800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldile" ,2,0x54000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldigt" ,2,0x54800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldige" ,2,0x55000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldiz" ,2,0x52800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldinz" ,2,0x53000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldip" ,2,0x54800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldin" ,2,0x53800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldinn" ,2,0x55000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldinv" ,2,0x56000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldiv" ,2,0x56800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldinuf" ,2,0x57000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldiuf" ,2,0x57800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldinc" ,2,0x52000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldic" ,2,0x50800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldinlv" ,2,0x58000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldilv" ,2,0x58800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldinluf",2,0x59000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldiluf" ,2,0x59800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldizuf" ,2,0x5A000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "ldii" ,2,0x08800000,AddressMode, { Direct|Indirect, AllReg, 0 }, Imm_None }, - { "ldm" ,2,0x09000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "ldp" ,2,0x08700000,0, { Abs24|Direct, DPReg|NotReq, 0 }, Imm_UInt }, - { "lopower",0,0x10800001,0, { 0, 0, 0 }, Imm_None }, /* LC31 Only */ - { "lsh" ,2,0x09800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt }, - { "lsh3" ,3,0x24000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None }, - { "maxspeed",0,0x10800000,0, { 0, 0, 0 }, Imm_None }, /* LC31 Only */ - { "mpyf" ,2,0x0A000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "mpyf3" ,3,0x24800000,AddressMode, { TAddr1, TAddr2, Rn }, Imm_None }, - { "mpyi" ,2,0x0A800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "mpyi3" ,3,0x25000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None }, - { "negb" ,2,0x0B000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "negf" ,2,0x0B800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "negi" ,2,0x0C000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "nop" ,1,0x0C800000,AddressMode, { AllReg|Indirect|NotReq, 0, 0 }, Imm_None }, - { "norm" ,2,0x0D000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, /*Check another source*/ - { "not" ,2,0x0D800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt }, - { "or" ,2,0x10000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt }, - { "or3" ,3,0x25800000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None }, - { "pop" ,1,0x0E200000,StackOp, { AllReg, 0, 0 }, Imm_None }, - { "popf" ,1,0x0EA00000,StackOp, { Rn, 0, 0 }, Imm_None }, - { "push" ,1,0x0F200000,StackOp, { AllReg, 0, 0 }, Imm_None }, - { "pushf" ,1,0x0FA00000,StackOp, { Rn, 0, 0 }, Imm_None }, - { "reti" ,0,0x78000000,0, { 0, 0, 0 }, Imm_None }, - { "retiu" ,0,0x78000000,0, { 0, 0, 0 }, Imm_None }, - { "retilo" ,0,0x78010000,0, { 0, 0, 0 }, Imm_None }, - { "retils" ,0,0x78020000,0, { 0, 0, 0 }, Imm_None }, - { "retihi" ,0,0x78030000,0, { 0, 0, 0 }, Imm_None }, - { "retihs" ,0,0x78040000,0, { 0, 0, 0 }, Imm_None }, - { "retieq" ,0,0x78050000,0, { 0, 0, 0 }, Imm_None }, - { "retine" ,0,0x78060000,0, { 0, 0, 0 }, Imm_None }, - { "retilt" ,0,0x78070000,0, { 0, 0, 0 }, Imm_None }, - { "retile" ,0,0x78080000,0, { 0, 0, 0 }, Imm_None }, - { "retigt" ,0,0x78090000,0, { 0, 0, 0 }, Imm_None }, - { "retige" ,0,0x780A0000,0, { 0, 0, 0 }, Imm_None }, - { "retiz" ,0,0x78050000,0, { 0, 0, 0 }, Imm_None }, - { "retinz" ,0,0x78060000,0, { 0, 0, 0 }, Imm_None }, - { "retip" ,0,0x78090000,0, { 0, 0, 0 }, Imm_None }, - { "retin" ,0,0x78070000,0, { 0, 0, 0 }, Imm_None }, - { "retinn" ,0,0x780A0000,0, { 0, 0, 0 }, Imm_None }, - { "retinv" ,0,0x780C0000,0, { 0, 0, 0 }, Imm_None }, - { "retiv" ,0,0x780D0000,0, { 0, 0, 0 }, Imm_None }, - { "retinuf",0,0x780E0000,0, { 0, 0, 0 }, Imm_None }, - { "retiuf" ,0,0x780F0000,0, { 0, 0, 0 }, Imm_None }, - { "retinc" ,0,0x78040000,0, { 0, 0, 0 }, Imm_None }, - { "retic" ,0,0x78010000,0, { 0, 0, 0 }, Imm_None }, - { "retinlv",0,0x78100000,0, { 0, 0, 0 }, Imm_None }, - { "retilv" ,0,0x78110000,0, { 0, 0, 0 }, Imm_None }, - { "retinluf",0,0x78120000,0, { 0, 0, 0 }, Imm_None }, - { "retiluf",0,0x78130000,0, { 0, 0, 0 }, Imm_None }, - { "retizuf",0,0x78140000,0, { 0, 0, 0 }, Imm_None }, - { "rets" ,0,0x78800000,0, { 0, 0, 0 }, Imm_None }, - { "retsu" ,0,0x78800000,0, { 0, 0, 0 }, Imm_None }, - { "retslo" ,0,0x78810000,0, { 0, 0, 0 }, Imm_None }, - { "retsls" ,0,0x78820000,0, { 0, 0, 0 }, Imm_None }, - { "retshi" ,0,0x78830000,0, { 0, 0, 0 }, Imm_None }, - { "retshs" ,0,0x78840000,0, { 0, 0, 0 }, Imm_None }, - { "retseq" ,0,0x78850000,0, { 0, 0, 0 }, Imm_None }, - { "retsne" ,0,0x78860000,0, { 0, 0, 0 }, Imm_None }, - { "retslt" ,0,0x78870000,0, { 0, 0, 0 }, Imm_None }, - { "retsle" ,0,0x78880000,0, { 0, 0, 0 }, Imm_None }, - { "retsgt" ,0,0x78890000,0, { 0, 0, 0 }, Imm_None }, - { "retsge" ,0,0x788A0000,0, { 0, 0, 0 }, Imm_None }, - { "retsz" ,0,0x78850000,0, { 0, 0, 0 }, Imm_None }, - { "retsnz" ,0,0x78860000,0, { 0, 0, 0 }, Imm_None }, - { "retsp" ,0,0x78890000,0, { 0, 0, 0 }, Imm_None }, - { "retsn" ,0,0x78870000,0, { 0, 0, 0 }, Imm_None }, - { "retsnn" ,0,0x788A0000,0, { 0, 0, 0 }, Imm_None }, - { "retsnv" ,0,0x788C0000,0, { 0, 0, 0 }, Imm_None }, - { "retsv" ,0,0x788D0000,0, { 0, 0, 0 }, Imm_None }, - { "retsnuf",0,0x788E0000,0, { 0, 0, 0 }, Imm_None }, - { "retsuf" ,0,0x788F0000,0, { 0, 0, 0 }, Imm_None }, - { "retsnc" ,0,0x78840000,0, { 0, 0, 0 }, Imm_None }, - { "retsc" ,0,0x78810000,0, { 0, 0, 0 }, Imm_None }, - { "retsnlv",0,0x78900000,0, { 0, 0, 0 }, Imm_None }, - { "retslv" ,0,0x78910000,0, { 0, 0, 0 }, Imm_None }, - { "retsnluf",0,0x78920000,0, { 0, 0, 0 }, Imm_None }, - { "retsluf",0,0x78930000,0, { 0, 0, 0 }, Imm_None }, - { "retszuf",0,0x78940000,0, { 0, 0, 0 }, Imm_None }, - { "rnd" ,2,0x11000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "rol" ,1,0x11E00001,Rotate, { AllReg, 0, 0 }, Imm_None }, - { "rolc" ,1,0x12600001,Rotate, { AllReg, 0, 0 }, Imm_None }, - { "ror" ,1,0x12E0FFFF,Rotate, { AllReg, 0, 0 }, Imm_None }, - { "rorc" ,1,0x1360FFFF,Rotate, { AllReg, 0, 0 }, Imm_None }, - { "rptb" ,1,0x64000000,0, { Imm24, 0, 0 }, Imm_UInt }, - { "rpts" ,1,0x139B0000,AddressMode, { GAddr2, 0, 0 }, Imm_UInt }, - { "sigi" ,0,0x16000000,0, { 0, 0, 0 }, Imm_None }, - { "stf" ,2,0x14000000,AddressMode, { Rn, Direct|Indirect, 0 }, Imm_Float }, - { "stfi" ,2,0x14800000,AddressMode, { Rn, Direct|Indirect, 0 }, Imm_Float }, - { "sti" ,2,0x15000000,AddressMode, { AllReg, Direct|Indirect, 0 }, Imm_SInt }, - { "stii" ,2,0x15800000,AddressMode, { AllReg, Direct|Indirect, 0 }, Imm_SInt }, - { "subb" ,2,0x16800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "subb3" ,3,0x26000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None }, - { "subc" ,2,0x17000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt }, - { "subf" ,2,0x17800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "subf3" ,3,0x26800000,AddressMode, { TAddr1, TAddr2, Rn }, Imm_None }, - { "subi" ,2,0x18000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "subi3" ,3,0x27000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None }, - { "subrb" ,2,0x18800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "subrf" ,2,0x19000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, - { "subri" ,2,0x19800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt }, - { "swi" ,0,0x66000000,0, { 0, 0, 0 }, Imm_None }, - { "trap" ,1,0x74800020,0, { IVector, 0, 0 }, Imm_None }, - { "trapu" ,1,0x74800020,0, { IVector, 0, 0 }, Imm_None }, - { "traplo" ,1,0x74810020,0, { IVector, 0, 0 }, Imm_None }, - { "trapls" ,1,0x74820020,0, { IVector, 0, 0 }, Imm_None }, - { "traphi" ,1,0x74830020,0, { IVector, 0, 0 }, Imm_None }, - { "traphs" ,1,0x74840020,0, { IVector, 0, 0 }, Imm_None }, - { "trapeq" ,1,0x74850020,0, { IVector, 0, 0 }, Imm_None }, - { "trapne" ,1,0x74860020,0, { IVector, 0, 0 }, Imm_None }, - { "traplt" ,1,0x74870020,0, { IVector, 0, 0 }, Imm_None }, - { "traple" ,1,0x74880020,0, { IVector, 0, 0 }, Imm_None }, - { "trapgt" ,1,0x74890020,0, { IVector, 0, 0 }, Imm_None }, - { "trapge" ,1,0x748A0020,0, { IVector, 0, 0 }, Imm_None }, - { "trapz" ,1,0x74850020,0, { IVector, 0, 0 }, Imm_None }, - { "trapnz" ,1,0x74860020,0, { IVector, 0, 0 }, Imm_None }, - { "trapp" ,1,0x74890020,0, { IVector, 0, 0 }, Imm_None }, - { "trapn" ,1,0x74870020,0, { IVector, 0, 0 }, Imm_None }, - { "trapnn" ,1,0x748A0020,0, { IVector, 0, 0 }, Imm_None }, - { "trapnv" ,1,0x748C0020,0, { IVector, 0, 0 }, Imm_None }, - { "trapv" ,1,0x748D0020,0, { IVector, 0, 0 }, Imm_None }, - { "trapnuf",1,0x748E0020,0, { IVector, 0, 0 }, Imm_None }, - { "trapuf" ,1,0x748F0020,0, { IVector, 0, 0 }, Imm_None }, - { "trapnc" ,1,0x74840020,0, { IVector, 0, 0 }, Imm_None }, - { "trapc" ,1,0x74810020,0, { IVector, 0, 0 }, Imm_None }, - { "trapnlv",1,0x74900020,0, { IVector, 0, 0 }, Imm_None }, - { "traplv" ,1,0x74910020,0, { IVector, 0, 0 }, Imm_None }, - { "trapnluf",1,0x74920020,0, { IVector, 0, 0 }, Imm_None }, - { "trapluf",1,0x74930020,0, { IVector, 0, 0 }, Imm_None }, - { "trapzuf",1,0x74940020,0, { IVector, 0, 0 }, Imm_None }, - { "tstb" ,2,0x1A000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt }, - { "tstb3" ,2,0x27800000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, 0 }, Imm_None }, - { "xor" ,2,0x1A800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt }, - { "xor3" ,3,0x28000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None }, - { "" ,0,0x00000000,0, { 0, 0, 0 }, 0 } -}; - -static const template *const tic30_optab_end = - tic30_optab + sizeof(tic30_optab)/sizeof(tic30_optab[0]); - -typedef struct { - char *name; - unsigned int operands_1; - unsigned int operands_2; - unsigned int base_opcode; - unsigned int operand_types[2][3]; - /* Which operand fits into which part of the final opcode word. */ - int oporder; -} partemplate; - -/* oporder defines - not very descriptive. */ -#define OO_4op1 0 -#define OO_4op2 1 -#define OO_4op3 2 -#define OO_5op1 3 -#define OO_5op2 4 -#define OO_PField 5 - -static const partemplate tic30_paroptab[] = { - { "q_absf_stf", 2,2,0xC8000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } }, - OO_4op1 }, - { "q_absi_sti", 2,2,0xCA000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } }, - OO_4op1 }, - { "q_addf3_stf", 3,2,0xCC000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } }, - OO_5op1 }, - { "q_addi3_sti", 3,2,0xCE000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } }, - OO_5op1 }, - { "q_and3_sti", 3,2,0xD0000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } }, - OO_5op1 }, - { "q_ash3_sti", 3,2,0xD2000000, { { Rn, Indirect, Rn }, { Rn, Indirect, 0 } }, - OO_5op2 }, - { "q_fix_sti", 2,2,0xD4000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } }, - OO_4op1 }, - { "q_float_stf", 2,2,0xD6000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } }, - OO_4op1 }, - { "q_ldf_ldf", 2,2,0xC4000000, { { Indirect, Rn, 0 }, { Indirect, Rn, 0 } }, - OO_4op2 }, - { "q_ldf_stf", 2,2,0xD8000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } }, - OO_4op1 }, - { "q_ldi_ldi", 2,2,0xC6000000, { { Indirect, Rn, 0 }, { Indirect, Rn, 0 } }, - OO_4op2 }, - { "q_ldi_sti", 2,2,0xDA000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } }, - OO_4op1 }, - { "q_lsh3_sti", 3,2,0xDC000000, { { Rn, Indirect, Rn }, { Rn, Indirect, 0 } }, - OO_5op2 }, - { "q_mpyf3_addf3",3,3,0x80000000, { { Rn | Indirect, Rn | Indirect, Rn }, - { Rn | Indirect, Rn | Indirect, Rn } }, OO_PField }, - { "q_mpyf3_stf", 3,2,0xDE000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } }, - OO_5op1 }, - { "q_mpyf3_subf3",3,3,0x84000000, { { Rn | Indirect, Rn | Indirect, Rn }, - { Rn | Indirect, Rn | Indirect, Rn } }, OO_PField }, - { "q_mpyi3_addi3",3,3,0x88000000, { { Rn | Indirect, Rn | Indirect, Rn }, - { Rn | Indirect, Rn | Indirect, Rn } }, OO_PField }, - { "q_mpyi3_sti", 3,2,0xE0000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } }, - OO_5op1 }, - { "q_mpyi3_subi3",3,3,0x8C000000, { { Rn | Indirect, Rn | Indirect, Rn }, - { Rn | Indirect, Rn | Indirect, Rn } }, OO_PField }, - { "q_negf_stf", 2,2,0xE2000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } }, - OO_4op1 }, - { "q_negi_sti", 2,2,0xE4000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } }, - OO_4op1 }, - { "q_not_sti", 2,2,0xE6000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } }, - OO_4op1 }, - { "q_or3_sti", 3,2,0xE8000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } }, - OO_5op1 }, - { "q_stf_stf", 2,2,0xC0000000, { { Rn, Indirect, 0 }, { Rn, Indirect, 0 } }, - OO_4op3 }, - { "q_sti_sti", 2,2,0xC2000000, { { Rn, Indirect, 0 }, { Rn, Indirect, 0 } }, - OO_4op3 }, - { "q_subf3_stf", 3,2,0xEA000000, { { Rn, Indirect, Rn }, { Rn, Indirect, 0 } }, - OO_5op2 }, - { "q_subi3_sti", 3,2,0xEC000000, { { Rn, Indirect, Rn }, { Rn, Indirect, 0 } }, - OO_5op2 }, - { "q_xor3_sti", 3,2,0xEE000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } }, - OO_5op1 }, - { "", 0,0,0x00000000, { { 0, 0, 0 }, { 0, 0, 0 } }, 0 } -}; - -static const partemplate *const tic30_paroptab_end = - tic30_paroptab + sizeof(tic30_paroptab)/sizeof(tic30_paroptab[0]); - -#endif diff --git a/contrib/binutils/include/opcode/v850.h b/contrib/binutils/include/opcode/v850.h deleted file mode 100644 index 2183bc8586be..000000000000 --- a/contrib/binutils/include/opcode/v850.h +++ /dev/null @@ -1,165 +0,0 @@ -/* v850.h -- Header file for NEC V850 opcode table - Copyright 1996, 1997, 2001 Free Software Foundation, Inc. - Written by J.T. Conklin, Cygnus Support - -This file is part of GDB, GAS, and the GNU binutils. - -GDB, GAS, and the GNU binutils are free software; you can redistribute -them and/or modify them under the terms of the GNU General Public -License as published by the Free Software Foundation; either version -1, or (at your option) any later version. - -GDB, GAS, and the GNU binutils are distributed in the hope that they -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 file; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef V850_H -#define V850_H - -/* The opcode table is an array of struct v850_opcode. */ - -struct v850_opcode -{ - /* The opcode name. */ - const char *name; - - /* The opcode itself. Those bits which will be filled in with - operands are zeroes. */ - unsigned long opcode; - - /* The opcode mask. This is used by the disassembler. This is a - mask containing ones indicating those bits which must match the - opcode field, and zeroes indicating those bits which need not - match (and are presumably filled in by operands). */ - unsigned long mask; - - /* An array of operand codes. Each code is an index into the - operand table. They appear in the order which the operands must - appear in assembly code, and are terminated by a zero. */ - unsigned char operands[8]; - - /* Which (if any) operand is a memory operand. */ - unsigned int memop; - - /* Target processor(s). A bit field of processors which support - this instruction. Note a bit field is used as some instructions - are available on multiple, different processor types, whereas - other instructions are only available on one specific type. */ - unsigned int processors; -}; - -/* Values for the processors field in the v850_opcode structure. */ -#define PROCESSOR_V850 (1 << 0) /* Just the V850. */ -#define PROCESSOR_ALL -1 /* Any processor. */ -#define PROCESSOR_V850E (1 << 1) /* Just the V850E. */ -#define PROCESSOR_NOT_V850 (~ PROCESSOR_V850) /* Any processor except the V850. */ -#define PROCESSOR_V850EA (1 << 2) /* Just the V850EA. */ - -/* The table itself is sorted by major opcode number, and is otherwise - in the order in which the disassembler should consider - instructions. */ -extern const struct v850_opcode v850_opcodes[]; -extern const int v850_num_opcodes; - - -/* The operands table is an array of struct v850_operand. */ - -struct v850_operand -{ - /* The number of bits in the operand. */ - /* If this value is -1 then the operand's bits are in a discontinous distribution in the instruction. */ - int bits; - - /* (bits >= 0): How far the operand is left shifted in the instruction. */ - /* (bits == -1): Bit mask of the bits in the operand. */ - int shift; - - /* Insertion function. This is used by the assembler. To insert an - operand value into an instruction, check this field. - - If it is NULL, execute - i |= (op & ((1 << o->bits) - 1)) << o->shift; - (i is the instruction which we are filling in, o is a pointer to - this structure, and op is the opcode value; this assumes twos - complement arithmetic). - - If this field is not NULL, then simply call it with the - instruction and the operand value. It will return the new value - of the instruction. If the ERRMSG argument is not NULL, then if - the operand value is illegal, *ERRMSG will be set to a warning - string (the operand will be inserted in any case). If the - operand value is legal, *ERRMSG will be unchanged (most operands - can accept any value). */ - unsigned long (* insert) PARAMS ((unsigned long instruction, long op, - const char ** errmsg)); - - /* Extraction function. This is used by the disassembler. To - extract this operand type from an instruction, check this field. - - If it is NULL, compute - op = o->bits == -1 ? ((i) & o->shift) : ((i) >> o->shift) & ((1 << o->bits) - 1); - if (o->flags & V850_OPERAND_SIGNED) - op = (op << (32 - o->bits)) >> (32 - o->bits); - (i is the instruction, o is a pointer to this structure, and op - is the result; this assumes twos complement arithmetic). - - If this field is not NULL, then simply call it with the - instruction value. It will return the value of the operand. If - the INVALID argument is not NULL, *INVALID will be set to - non-zero if this operand type can not actually be extracted from - this operand (i.e., the instruction does not match). If the - operand is valid, *INVALID will not be changed. */ - unsigned long (* extract) PARAMS ((unsigned long instruction, int * invalid)); - - /* One bit syntax flags. */ - int flags; -}; - -/* Elements in the table are retrieved by indexing with values from - the operands field of the v850_opcodes table. */ - -extern const struct v850_operand v850_operands[]; - -/* Values defined for the flags field of a struct v850_operand. */ - -/* This operand names a general purpose register */ -#define V850_OPERAND_REG 0x01 - -/* This operand names a system register */ -#define V850_OPERAND_SRG 0x02 - -/* This operand names a condition code used in the setf instruction */ -#define V850_OPERAND_CC 0x04 - -/* This operand takes signed values */ -#define V850_OPERAND_SIGNED 0x08 - -/* This operand is the ep register. */ -#define V850_OPERAND_EP 0x10 - -/* This operand is a PC displacement */ -#define V850_OPERAND_DISP 0x20 - -/* This is a relaxable operand. Only used for D9->D22 branch relaxing - right now. We may need others in the future (or maybe handle them like - promoted operands on the mn10300?) */ -#define V850_OPERAND_RELAX 0x40 - -/* The register specified must not be r0 */ -#define V850_NOT_R0 0x80 - -/* push/pop type instruction, V850E specific. */ -#define V850E_PUSH_POP 0x100 - -/* 16 bit immediate follows instruction, V850E specific. */ -#define V850E_IMMEDIATE16 0x200 - -/* 32 bit immediate follows instruction, V850E specific. */ -#define V850E_IMMEDIATE32 0x400 - -#endif /* V850_H */ diff --git a/contrib/binutils/include/remote-sim.h b/contrib/binutils/include/remote-sim.h deleted file mode 100644 index 726ec623fbdf..000000000000 --- a/contrib/binutils/include/remote-sim.h +++ /dev/null @@ -1,354 +0,0 @@ -/* This file defines the interface between the simulator and gdb. - Copyright 1993, 1994, 1996, 1997, 1998, 2000 - Free Software Foundation, Inc. - -This file is part of GDB. - -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. */ - -#if !defined (REMOTE_SIM_H) -#define REMOTE_SIM_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* This file is used when building stand-alone simulators, so isolate this - file from gdb. */ - -/* Pick up CORE_ADDR_TYPE if defined (from gdb), otherwise use same value as - gdb does (unsigned int - from defs.h). */ - -#ifndef CORE_ADDR_TYPE -typedef unsigned int SIM_ADDR; -#else -typedef CORE_ADDR_TYPE SIM_ADDR; -#endif - - -/* Semi-opaque type used as result of sim_open and passed back to all - other routines. "desc" is short for "descriptor". - It is up to each simulator to define `sim_state'. */ - -typedef struct sim_state *SIM_DESC; - - -/* Values for `kind' arg to sim_open. */ - -typedef enum { - SIM_OPEN_STANDALONE, /* simulator used standalone (run.c) */ - SIM_OPEN_DEBUG /* simulator used by debugger (gdb) */ -} SIM_OPEN_KIND; - - -/* Return codes from various functions. */ - -typedef enum { - SIM_RC_FAIL = 0, - SIM_RC_OK = 1, - SIM_RC_UNKNOWN_BREAKPOINT = 2, - SIM_RC_INSUFFICIENT_RESOURCES = 3, - SIM_RC_DUPLICATE_BREAKPOINT = 4 -} SIM_RC; - - -/* The bfd struct, as an opaque type. */ - -struct _bfd; - - -/* Main simulator entry points. */ - - -/* Create a fully initialized simulator instance. - - (This function is called when the simulator is selected from the - gdb command line.) - - KIND specifies how the simulator shall be used. Currently there - are only two kinds: stand-alone and debug. - - CALLBACK specifies a standard host callback (defined in callback.h). - - ABFD, when non NULL, designates a target program. The program is - not loaded. - - ARGV is a standard ARGV pointer such as that passed from the - command line. The syntax of the argument list is is assumed to be - ``SIM-PROG { SIM-OPTION } [ TARGET-PROGRAM { TARGET-OPTION } ]''. - The trailing TARGET-PROGRAM and args are only valid for a - stand-alone simulator. - - On success, the result is a non NULL descriptor that shall be - passed to the other sim_foo functions. While the simulator - configuration can be parameterized by (in decreasing precedence) - ARGV's SIM-OPTION, ARGV's TARGET-PROGRAM and the ABFD argument, the - successful creation of the simulator shall not dependent on the - presence of any of these arguments/options. - - Hardware simulator: The created simulator shall be sufficiently - initialized to handle, with out restrictions any client requests - (including memory reads/writes, register fetch/stores and a - resume). - - Process simulator: that process is not created until a call to - sim_create_inferior. FIXME: What should the state of the simulator - be? */ - -SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct _bfd *abfd, char **argv)); - - -/* Destory a simulator instance. - - QUITTING is non-zero if we cannot hang on errors. - - This may involve freeing target memory and closing any open files - and mmap'd areas. You cannot assume sim_kill has already been - called. */ - -void sim_close PARAMS ((SIM_DESC sd, int quitting)); - - -/* Load program PROG into the simulators memory. - - If ABFD is non-NULL, the bfd for the file has already been opened. - The result is a return code indicating success. - - Hardware simulator: Normally, each program section is written into - memory according to that sections LMA using physical (direct) - addressing. The exception being systems, such as PPC/CHRP, which - support more complicated program loaders. A call to this function - should not effect the state of the processor registers. Multiple - calls to this function are permitted and have an accumulative - effect. - - Process simulator: Calls to this function may be ignored. - - FIXME: Most hardware simulators load the image at the VMA using - virtual addressing. - - FIXME: For some hardware targets, before a loaded program can be - executed, it requires the manipulation of VM registers and tables. - Such manipulation should probably (?) occure in - sim_create_inferior. */ - -SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct _bfd *abfd, int from_tty)); - - -/* Prepare to run the simulated program. - - ABFD, if not NULL, provides initial processor state information. - ARGV and ENV, if non NULL, are NULL terminated lists of pointers. - - Hardware simulator: This function shall initialize the processor - registers to a known value. The program counter and possibly stack - pointer shall be set using information obtained from ABFD (or - hardware reset defaults). ARGV and ENV, dependant on the target - ABI, may be written to memory. - - Process simulator: After a call to this function, a new process - instance shall exist. The TEXT, DATA, BSS and stack regions shall - all be initialized, ARGV and ENV shall be written to process - address space (according to the applicable ABI) and the program - counter and stack pointer set accordingly. */ - -SIM_RC sim_create_inferior PARAMS ((SIM_DESC sd, struct _bfd *abfd, char **argv, char **env)); - - -/* Fetch LENGTH bytes of the simulated program's memory. Start fetch - at virtual address MEM and store in BUF. Result is number of bytes - read, or zero if error. */ - -int sim_read PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)); - - -/* Store LENGTH bytes from BUF into the simulated program's - memory. Store bytes starting at virtual address MEM. Result is - number of bytes write, or zero if error. */ - -int sim_write PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)); - - -/* Fetch register REGNO storing its raw (target endian) value in the - LENGTH byte buffer BUF. Return the actual size of the register or - zero if REGNO is not applicable. - - Legacy implementations ignore LENGTH and always return -1. - - If LENGTH does not match the size of REGNO no data is transfered - (the actual register size is still returned). */ - -int sim_fetch_register PARAMS ((SIM_DESC sd, int regno, unsigned char *buf, int length)); - - -/* Store register REGNO from the raw (target endian) value in BUF. - Return the actual size of the register or zero if REGNO is not - applicable. - - Legacy implementations ignore LENGTH and always return -1. - - If LENGTH does not match the size of REGNO no data is transfered - (the actual register size is still returned). */ - -int sim_store_register PARAMS ((SIM_DESC sd, int regno, unsigned char *buf, int length)); - - -/* Print whatever statistics the simulator has collected. - - VERBOSE is currently unused and must always be zero. */ - -void sim_info PARAMS ((SIM_DESC sd, int verbose)); - - -/* Run (or resume) the simulated program. - - STEP, when non-zero indicates that only a single simulator cycle - should be emulated. - - SIGGNAL, if non-zero is a (HOST) SIGRC value indicating the type of - event (hardware interrupt, signal) to be delivered to the simulated - program. - - Hardware simulator: If the SIGRC value returned by - sim_stop_reason() is passed back to the simulator via SIGGNAL then - the hardware simulator shall correctly deliver the hardware event - indicated by that signal. If a value of zero is passed in then the - simulation will continue as if there were no outstanding signal. - The effect of any other SIGGNAL value is is implementation - dependant. - - Process simulator: If SIGRC is non-zero then the corresponding - signal is delivered to the simulated program and execution is then - continued. A zero SIGRC value indicates that the program should - continue as normal. */ - -void sim_resume PARAMS ((SIM_DESC sd, int step, int siggnal)); - - -/* Asynchronous request to stop the simulation. - A nonzero return indicates that the simulator is able to handle - the request */ - -int sim_stop PARAMS ((SIM_DESC sd)); - - -/* Fetch the REASON why the program stopped. - - SIM_EXITED: The program has terminated. SIGRC indicates the target - dependant exit status. - - SIM_STOPPED: The program has stopped. SIGRC uses the host's signal - numbering as a way of identifying the reaon: program interrupted by - user via a sim_stop request (SIGINT); a breakpoint instruction - (SIGTRAP); a completed single step (SIGTRAP); an internal error - condition (SIGABRT); an illegal instruction (SIGILL); Access to an - undefined memory region (SIGSEGV); Mis-aligned memory access - (SIGBUS). For some signals information in addition to the signal - number may be retained by the simulator (e.g. offending address), - that information is not directly accessable via this interface. - - SIM_SIGNALLED: The program has been terminated by a signal. The - simulator has encountered target code that causes the the program - to exit with signal SIGRC. - - SIM_RUNNING, SIM_POLLING: The return of one of these values - indicates a problem internal to the simulator. */ - -enum sim_stop { sim_running, sim_polling, sim_exited, sim_stopped, sim_signalled }; - -void sim_stop_reason PARAMS ((SIM_DESC sd, enum sim_stop *reason, int *sigrc)); - - -/* Passthru for other commands that the simulator might support. - Simulators should be prepared to deal with any combination of NULL - or empty CMD. */ - -void sim_do_command PARAMS ((SIM_DESC sd, char *cmd)); - -/* Call these functions to set and clear breakpoints at ADDR. */ - -SIM_RC sim_set_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); -SIM_RC sim_clear_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); -SIM_RC sim_clear_all_breakpoints PARAMS ((SIM_DESC sd)); - -/* These functions are used to enable and disable breakpoints. */ - -SIM_RC sim_enable_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); -SIM_RC sim_disable_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); -SIM_RC sim_enable_all_breakpoints PARAMS ((SIM_DESC sd)); -SIM_RC sim_disable_all_breakpoints PARAMS ((SIM_DESC sd)); - - -/* Provide simulator with a default (global) host_callback_struct. - THIS PROCEDURE IS DEPRECIATED. - GDB and NRUN do not use this interface. - This procedure does not take a SIM_DESC argument as it is - used before sim_open. */ - -void sim_set_callbacks PARAMS ((struct host_callback_struct *)); - - -/* Set the size of the simulator memory array. - THIS PROCEDURE IS DEPRECIATED. - GDB and NRUN do not use this interface. - This procedure does not take a SIM_DESC argument as it is - used before sim_open. */ - -void sim_size PARAMS ((int i)); - - -/* Single-step simulator with tracing enabled. - THIS PROCEDURE IS DEPRECIATED. - THIS PROCEDURE IS EVEN MORE DEPRECATED THAN SIM_SET_TRACE - GDB and NRUN do not use this interface. - This procedure returns: ``0'' indicating that the simulator should - be continued using sim_trace() calls; ``1'' indicating that the - simulation has finished. */ - -int sim_trace PARAMS ((SIM_DESC sd)); - - -/* Enable tracing. - THIS PROCEDURE IS DEPRECIATED. - GDB and NRUN do not use this interface. - This procedure returns: ``0'' indicating that the simulator should - be continued using sim_trace() calls; ``1'' indicating that the - simulation has finished. */ - -void sim_set_trace PARAMS ((void)); - - -/* Configure the size of the profile buffer. - THIS PROCEDURE IS DEPRECIATED. - GDB and NRUN do not use this interface. - This procedure does not take a SIM_DESC argument as it is - used before sim_open. */ - -void sim_set_profile_size PARAMS ((int n)); - - -/* Kill the running program. - THIS PROCEDURE IS DEPRECIATED. - GDB and NRUN do not use this interface. - This procedure will be replaced as part of the introduction of - multi-cpu simulators. */ - -void sim_kill PARAMS ((SIM_DESC sd)); - -#ifdef __cplusplus -} -#endif - -#endif /* !defined (REMOTE_SIM_H) */ diff --git a/contrib/binutils/include/wait.h b/contrib/binutils/include/wait.h deleted file mode 100644 index fa3c9ccb1d7e..000000000000 --- a/contrib/binutils/include/wait.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Define how to access the int that the wait system call stores. - This has been compatible in all Unix systems since time immemorial, - but various well-meaning people have defined various different - words for the same old bits in the same old int (sometimes claimed - to be a struct). We just know it's an int and we use these macros - to access the bits. */ - -/* The following macros are defined equivalently to their definitions - in POSIX.1. We fail to define WNOHANG and WUNTRACED, which POSIX.1 - <sys/wait.h> defines, since our code does not use waitpid(). We - also fail to declare wait() and waitpid(). */ - -#ifndef WIFEXITED -#define WIFEXITED(w) (((w)&0377) == 0) -#endif - -#ifndef WIFSIGNALED -#define WIFSIGNALED(w) (((w)&0377) != 0177 && ((w)&~0377) == 0) -#endif - -#ifndef WIFSTOPPED -#ifdef IBM6000 - -/* Unfortunately, the above comment (about being compatible in all Unix - systems) is not quite correct for AIX, sigh. And AIX 3.2 can generate - status words like 0x57c (sigtrap received after load), and gdb would - choke on it. */ - -#define WIFSTOPPED(w) ((w)&0x40) - -#else -#define WIFSTOPPED(w) (((w)&0377) == 0177) -#endif -#endif - -#ifndef WEXITSTATUS -#define WEXITSTATUS(w) (((w) >> 8) & 0377) /* same as WRETCODE */ -#endif - -#ifndef WTERMSIG -#define WTERMSIG(w) ((w) & 0177) -#endif - -#ifndef WSTOPSIG -#define WSTOPSIG WEXITSTATUS -#endif - -/* These are not defined in POSIX, but are used by our programs. */ - -#define WAITTYPE int - -#ifndef WCOREDUMP -#define WCOREDUMP(w) (((w)&0200) != 0) -#endif - -#ifndef WSETEXIT -#define WSETEXIT(w,status) ((w) = (0 | ((status) << 8))) -#endif - -#ifndef WSETSTOP -#define WSETSTOP(w,sig) ((w) = (0177 | ((sig) << 8))) -#endif - diff --git a/contrib/binutils/install.sh b/contrib/binutils/install.sh deleted file mode 100755 index 4b883b386de2..000000000000 --- a/contrib/binutils/install.sh +++ /dev/null @@ -1,247 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/contrib/binutils/ld/acconfig.h b/contrib/binutils/ld/acconfig.h deleted file mode 100644 index c627d7faa97a..000000000000 --- a/contrib/binutils/ld/acconfig.h +++ /dev/null @@ -1,22 +0,0 @@ - -/* Name of package. */ -#undef PACKAGE - -/* Version of package. */ -#undef VERSION - -/* Whether strstr must be declared even if <string.h> is included. */ -#undef NEED_DECLARATION_STRSTR - -/* Whether free must be declared even if <stdlib.h> is included. */ -#undef NEED_DECLARATION_FREE - -/* Whether sbrk must be declared even if <unistd.h> is included. */ -#undef NEED_DECLARATION_SBRK - -/* Whether getenv must be declared even if <stdlib.h> is included. */ -#undef NEED_DECLARATION_GETENV -@TOP@ - -/* Do we need to use the b modifier when opening binary files? */ -#undef USE_BINARY_FOPEN diff --git a/contrib/binutils/ld/configdoc.texi b/contrib/binutils/ld/configdoc.texi deleted file mode 100644 index 8d1acad1ef16..000000000000 --- a/contrib/binutils/ld/configdoc.texi +++ /dev/null @@ -1,14 +0,0 @@ -@c ------------------------------ CONFIGURATION VARS: -@c 1. Inclusiveness of this manual -@set GENERIC - -@c 2. Specific target machines -@set H8300 -@set I960 -@set TICOFF - -@c 3. Properties of this configuration -@clear SingleFormat -@set UsesEnvVars -@c ------------------------------ end CONFIGURATION VARS - diff --git a/contrib/binutils/ld/emulparams/armelf_linux26.sh b/contrib/binutils/ld/emulparams/armelf_linux26.sh deleted file mode 100644 index 36d1b0ec5c7a..000000000000 --- a/contrib/binutils/ld/emulparams/armelf_linux26.sh +++ /dev/null @@ -1,20 +0,0 @@ -ARCH=arm -SCRIPT_NAME=elf -OUTPUT_FORMAT="elf32-littlearm" -BIG_OUTPUT_FORMAT="elf32-bigarm" -LITTLE_OUTPUT_FORMAT="elf32-littlearm" -MAXPAGESIZE=0x8000 -TEMPLATE_NAME=armelf -GENERATE_SHLIB_SCRIPT=yes - -DATA_START_SYMBOLS='__data_start = . ;'; -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;' - -# This needs to be high enough so that we can load ld.so below it, -# yet low enough to stay away from the mmap area at 0x01100000. -# Also, it is small enough so that relocs which are pointing -# at absolute 0 will still be fixed up. -# These values give us about 0.5MB for ld.so, 16.5MB for user -# programs, and 15MB for mmap which seems a reasonable compromise. -TEXT_START_ADDR=0x00080000 diff --git a/contrib/binutils/ld/emulparams/elf32bmip.sh b/contrib/binutils/ld/emulparams/elf32bmip.sh deleted file mode 100644 index fa7d671ffdf7..000000000000 --- a/contrib/binutils/ld/emulparams/elf32bmip.sh +++ /dev/null @@ -1,36 +0,0 @@ -# If you change this file, please also look at files which source this one: -# elf32b4300.sh elf32bsmip.sh elf32btsmip.sh elf32ebmip.sh elf32lmip.sh - -SCRIPT_NAME=elf -OUTPUT_FORMAT="elf32-bigmips" -BIG_OUTPUT_FORMAT="elf32-bigmips" -LITTLE_OUTPUT_FORMAT="elf32-littlemips" -TEXT_START_ADDR=0x0400000 -test -n "${EMBEDDED}" || DATA_ADDR=0x10000000 -MAXPAGESIZE=0x40000 -NONPAGED_TEXT_START_ADDR=0x0400000 -SHLIB_TEXT_START_ADDR=0x5ffe0000 -test -n "${EMBEDDED}" || TEXT_DYNAMIC= -INITIAL_READONLY_SECTIONS=" - .reginfo ${RELOCATING-0} : { *(.reginfo) } -" -OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' -OTHER_GOT_SYMBOLS=' - _gp = ALIGN(16) + 0x7ff0; -' -OTHER_SDATA_SECTIONS=" - .lit8 ${RELOCATING-0} : { *(.lit8) } - .lit4 ${RELOCATING-0} : { *(.lit4) } -" -TEXT_START_SYMBOLS='_ftext = . ;' -DATA_START_SYMBOLS='_fdata = . ;' -OTHER_BSS_SYMBOLS='_fbss = .;' -OTHER_SECTIONS=' - .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } - .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } -' -ARCH=mips -MACHINE= -TEMPLATE_NAME=elf32 -EXTRA_EM_FILE=mipself -GENERATE_SHLIB_SCRIPT=yes diff --git a/contrib/binutils/ld/emulparams/elf32bmipn32.sh b/contrib/binutils/ld/emulparams/elf32bmipn32.sh deleted file mode 100755 index 8dc17358908e..000000000000 --- a/contrib/binutils/ld/emulparams/elf32bmipn32.sh +++ /dev/null @@ -1,71 +0,0 @@ -# If you change this file, please also look at files which source this one: -# elf64bmip.sh elf64btsmip.sh - -# This is an ELF platform. -SCRIPT_NAME=elf - -# Handle both big- and little-ended 32-bit MIPS objects. -ARCH=mips -OUTPUT_FORMAT="elf32-bigmips" -BIG_OUTPUT_FORMAT="elf32-bigmips" -LITTLE_OUTPUT_FORMAT="elf32-littlemips" - -TEMPLATE_NAME=elf32 - -TEXT_START_ADDR=0x10000000 -MAXPAGESIZE=0x100000 -ENTRY=__start - -# GOT-related settings. -OTHER_GOT_SYMBOLS=' - _gp = ALIGN(16) + 0x7ff0; -' -OTHER_SDATA_SECTIONS=" - .lit8 ${RELOCATING-0} : { *(.lit8) } - .lit4 ${RELOCATING-0} : { *(.lit4) } - .srdata ${RELOCATING-0} : { *(.srdata) } -" - -# Magic symbols. -TEXT_START_SYMBOLS='_ftext = . ;' -DATA_START_SYMBOLS='_fdata = . ;' -OTHER_BSS_SYMBOLS='_fbss = .;' -# IRIX6 defines these symbols. 0x34 is the size of the ELF header. -EXECUTABLE_SYMBOLS=" - __dso_displacement = 0; - __elf_header = ${TEXT_START_ADDR}; - __program_header_table = ${TEXT_START_ADDR} + 0x34; -" - -# There are often dynamic relocations against the .rodata section. -# Setting DT_TEXTREL in the .dynamic section does not convince the -# IRIX6 linker to permit relocations against the text segment. -# Following the IRIX linker, we simply put .rodata in the data -# segment. -WRITABLE_RODATA= - -OTHER_SECTIONS=" - .MIPS.events.text ${RELOCATING-0} : - { - *(.MIPS.events.text${RELOCATING+ .MIPS.events.gnu.linkonce.t*}) - } - .MIPS.content.text ${RELOCATING-0} : - { - *(.MIPS.content.text${RELOCATING+ .MIPS.content.gnu.linkonce.t*}) - } - .MIPS.events.data ${RELOCATING-0} : - { - *(.MIPS.events.data${RELOCATING+ .MIPS.events.gnu.linkonce.d*}) - } - .MIPS.content.data ${RELOCATING-0} : - { - *(.MIPS.content.data${RELOCATING+ .MIPS.content.gnu.linkonce.d*}) - } - .MIPS.events.rodata ${RELOCATING-0} : - { - *(.MIPS.events.rodata${RELOCATING+ .MIPS.events.gnu.linkonce.r*}) - } - .MIPS.content.rodata ${RELOCATING-0} : - { - *(.MIPS.content.rodata${RELOCATING+ .MIPS.content.gnu.linkonce.r*}) - }" diff --git a/contrib/binutils/ld/emulparams/elf32bsmip.sh b/contrib/binutils/ld/emulparams/elf32bsmip.sh deleted file mode 100755 index 5b2939a94f4d..000000000000 --- a/contrib/binutils/ld/emulparams/elf32bsmip.sh +++ /dev/null @@ -1,2 +0,0 @@ -. ${srcdir}/emulparams/elf32bmip.sh -ENTRY=__start diff --git a/contrib/binutils/ld/emulparams/elf32ebmip.sh b/contrib/binutils/ld/emulparams/elf32ebmip.sh deleted file mode 100644 index 704b43ed5756..000000000000 --- a/contrib/binutils/ld/emulparams/elf32ebmip.sh +++ /dev/null @@ -1,2 +0,0 @@ -EMBEDDED=yes -. ${srcdir}/emulparams/elf32bmip.sh diff --git a/contrib/binutils/ld/emulparams/elf32elmip.sh b/contrib/binutils/ld/emulparams/elf32elmip.sh deleted file mode 100644 index c94e503d6041..000000000000 --- a/contrib/binutils/ld/emulparams/elf32elmip.sh +++ /dev/null @@ -1,2 +0,0 @@ -EMBEDDED=yes -. ${srcdir}/emulparams/elf32lmip.sh diff --git a/contrib/binutils/ld/emulparams/elf32lmip.sh b/contrib/binutils/ld/emulparams/elf32lmip.sh deleted file mode 100644 index 14d4ded7f9c5..000000000000 --- a/contrib/binutils/ld/emulparams/elf32lmip.sh +++ /dev/null @@ -1,7 +0,0 @@ -# If you change this file, please also look at files which source this one: -# elf32elmip.sh elf32lsmip.sh - -. ${srcdir}/emulparams/elf32bmip.sh -OUTPUT_FORMAT="elf32-littlemips" -BIG_OUTPUT_FORMAT="elf32-bigmips" -LITTLE_OUTPUT_FORMAT="elf32-littlemips" diff --git a/contrib/binutils/ld/emulparams/elf32lsmip.sh b/contrib/binutils/ld/emulparams/elf32lsmip.sh deleted file mode 100755 index 62e4f98dcf02..000000000000 --- a/contrib/binutils/ld/emulparams/elf32lsmip.sh +++ /dev/null @@ -1,2 +0,0 @@ -. ${srcdir}/emulparams/elf32lmip.sh -ENTRY=__start diff --git a/contrib/binutils/ld/emulparams/elf64_s390.sh b/contrib/binutils/ld/emulparams/elf64_s390.sh deleted file mode 100644 index 8416c89e11f1..000000000000 --- a/contrib/binutils/ld/emulparams/elf64_s390.sh +++ /dev/null @@ -1,11 +0,0 @@ -SCRIPT_NAME=elf -ELFSIZE=64 -OUTPUT_FORMAT="elf64-s390" -TEXT_START_ADDR=0x80000000 -MAXPAGESIZE=0x1000 -NONPAGED_TEXT_START_ADDR=0x80000000 -ARCH="s390:64-bit" -MACHINE= -NOP=0x07070707 -TEMPLATE_NAME=elf32 -GENERATE_SHLIB_SCRIPT=yes diff --git a/contrib/binutils/ld/emulparams/elf64bmip.sh b/contrib/binutils/ld/emulparams/elf64bmip.sh deleted file mode 100755 index 990fcb639d6e..000000000000 --- a/contrib/binutils/ld/emulparams/elf64bmip.sh +++ /dev/null @@ -1,12 +0,0 @@ -. ${srcdir}/emulparams/elf32bmipn32.sh -OUTPUT_FORMAT="elf64-bigmips" -BIG_OUTPUT_FORMAT="elf64-bigmips" -LITTLE_OUTPUT_FORMAT="elf64-littlemips" -ELFSIZE=64 - -# IRIX6 defines these symbols. 0x40 is the size of the ELF header. -EXECUTABLE_SYMBOLS=" - __dso_displacement = 0; - __elf_header = ${TEXT_START_ADDR}; - __program_header_table = ${TEXT_START_ADDR} + 0x40; -" diff --git a/contrib/binutils/ld/emulparams/elf_s390.sh b/contrib/binutils/ld/emulparams/elf_s390.sh deleted file mode 100644 index 2804aceeb9b9..000000000000 --- a/contrib/binutils/ld/emulparams/elf_s390.sh +++ /dev/null @@ -1,10 +0,0 @@ -SCRIPT_NAME=elf -OUTPUT_FORMAT="elf32-s390" -TEXT_START_ADDR=0x00400000 -MAXPAGESIZE=0x1000 -NONPAGED_TEXT_START_ADDR=0x00400000 -ARCH="s390:31-bit" -MACHINE= -NOP=0x07070707 -TEMPLATE_NAME=elf32 -GENERATE_SHLIB_SCRIPT=yes diff --git a/contrib/binutils/ld/emulparams/shelf.sh b/contrib/binutils/ld/emulparams/shelf.sh deleted file mode 100755 index 27b73b695423..000000000000 --- a/contrib/binutils/ld/emulparams/shelf.sh +++ /dev/null @@ -1,20 +0,0 @@ -# If you change this file, please also look at files which source this one: -# shlelf.sh, shelf_nbsd.sh - -SCRIPT_NAME=elf -OUTPUT_FORMAT="elf32-sh" -TEXT_START_ADDR=0x1000 -MAXPAGESIZE=128 -ARCH=sh -MACHINE= -TEMPLATE_NAME=elf32 -GENERATE_SHLIB_SCRIPT=yes -EMBEDDED=yes - -# These are for compatibility with the COFF toolchain. -ENTRY=start -CTOR_START='___ctors = .;' -CTOR_END='___ctors_end = .;' -DTOR_START='___dtors = .;' -DTOR_END='___dtors_end = .;' -STACK_ADDR=0x30000 diff --git a/contrib/binutils/ld/emulparams/shelf_linux.sh b/contrib/binutils/ld/emulparams/shelf_linux.sh deleted file mode 100644 index b841beff407f..000000000000 --- a/contrib/binutils/ld/emulparams/shelf_linux.sh +++ /dev/null @@ -1,2 +0,0 @@ -. ${srcdir}/emulparams/shlelf_linux.sh -OUTPUT_FORMAT="elf32-shbig-linux" diff --git a/contrib/binutils/ld/emulparams/shl.sh b/contrib/binutils/ld/emulparams/shl.sh deleted file mode 100644 index 5fbb165c2bcd..000000000000 --- a/contrib/binutils/ld/emulparams/shl.sh +++ /dev/null @@ -1,2 +0,0 @@ -. ${srcdir}/emulparams/sh.sh -OUTPUT_FORMAT="coff-shl" diff --git a/contrib/binutils/ld/emulparams/shlelf.sh b/contrib/binutils/ld/emulparams/shlelf.sh deleted file mode 100755 index e19678bc710d..000000000000 --- a/contrib/binutils/ld/emulparams/shlelf.sh +++ /dev/null @@ -1,2 +0,0 @@ -. ${srcdir}/emulparams/shelf.sh -OUTPUT_FORMAT="elf32-shl" diff --git a/contrib/binutils/ld/emulparams/tic30aout.sh b/contrib/binutils/ld/emulparams/tic30aout.sh deleted file mode 100755 index 2a4c13f598f7..000000000000 --- a/contrib/binutils/ld/emulparams/tic30aout.sh +++ /dev/null @@ -1,7 +0,0 @@ -SCRIPT_NAME=tic30aout -OUTPUT_FORMAT="a.out-tic30" -OUTPUT_ARCH="tms320c30" -TEXT_START_ADDR=0x0 -TARGET_PAGE_SIZE=128 -ARCH=tms320c30 -BIG=1 diff --git a/contrib/binutils/ld/emulparams/tic30coff.sh b/contrib/binutils/ld/emulparams/tic30coff.sh deleted file mode 100755 index df7794373373..000000000000 --- a/contrib/binutils/ld/emulparams/tic30coff.sh +++ /dev/null @@ -1,7 +0,0 @@ -SCRIPT_NAME=tic30coff -OUTPUT_FORMAT="coff-tic30" -OUTPUT_ARCH="tms320c30" -TEXT_START_ADDR=0x0 -TARGET_PAGE_SIZE=128 -ARCH=tms320c30 -BIG=1 diff --git a/contrib/binutils/ld/emulparams/v850.sh b/contrib/binutils/ld/emulparams/v850.sh deleted file mode 100644 index 78bfbd3882df..000000000000 --- a/contrib/binutils/ld/emulparams/v850.sh +++ /dev/null @@ -1,14 +0,0 @@ -MACHINE= -SCRIPT_NAME=v850 -OUTPUT_FORMAT="elf32-v850" -TEXT_START_ADDR=0x100000 -ZDATA_START_ADDR=0x160 -ROZDATA_START_ADDR="ALIGN (4)" -SDATA_START_ADDR="ALIGN (4)" -ROSDATA_START_ADDR="ALIGN (4)" -TDATA_START_ADDR="ALIGN (4)" -CALL_TABLE_START_ADDR="ALIGN (4)" -ARCH=v850 -MAXPAGESIZE=256 -ENTRY=_start -EMBEDDED=yes diff --git a/contrib/binutils/ld/emultempl/stringify.sed b/contrib/binutils/ld/emultempl/stringify.sed deleted file mode 100644 index a526d3ffc4c5..000000000000 --- a/contrib/binutils/ld/emultempl/stringify.sed +++ /dev/null @@ -1,4 +0,0 @@ -s/["\\]/\\&/g -s/$/\\n\\/ -1 s/^/"/ -$ s/$/n"/ diff --git a/contrib/binutils/ld/scripttempl/elfppc.sc b/contrib/binutils/ld/scripttempl/elfppc.sc deleted file mode 100644 index ddab8f80f814..000000000000 --- a/contrib/binutils/ld/scripttempl/elfppc.sc +++ /dev/null @@ -1,288 +0,0 @@ -# -# Unusual variables checked by this code: -# NOP - two 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) -# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ... -# (e.g., .PARISC.global) -# OTHER_SECTIONS - at the end -# EXECUTABLE_SYMBOLS - symbols that must be defined for an -# executable (e.g., _DYNAMIC_LINK) -# TEXT_START_SYMBOLS - symbols that appear at the start of the -# .text section. -# DATA_START_SYMBOLS - symbols that appear at the start of the -# .data section. -# OTHER_BSS_SYMBOLS - symbols that appear at the start of the -# .bss section besides __bss_start. -# -# When adding sections, do note that the names of some sections are used -# when specifying the start address of the next. -# -test -z "$ENTRY" && ENTRY=_start -test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT} -test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} -test "$LD_FLAG" = "N" && DATA_ADDR=. -SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) }" -SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) }" -INTERP=".interp ${RELOCATING-0} : { *(.interp) }" -PLT=".plt ${RELOCATING-0} : { *(.plt) }" -CTOR=".ctors ${CONSTRUCTING-0} : - { - ${CONSTRUCTING+${CTOR_START}} - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - - KEEP (*crtbegin.o(.ctors)) - - /* We don't want to include the .ctor section from - from the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - ${CONSTRUCTING+${CTOR_END}} - }" - -DTOR=" .dtors ${CONSTRUCTING-0} : - { - ${CONSTRUCTING+${DTOR_START}} - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - ${CONSTRUCTING+${DTOR_END}} - }" - -cat <<EOF -OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", - "${LITTLE_OUTPUT_FORMAT}") -OUTPUT_ARCH(${ARCH}) -ENTRY(${ENTRY}) - -${RELOCATING+${LIB_SEARCH_DIRS}} -${RELOCATING+/* Do we need any of these for elf? - __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */} -${RELOCATING+${EXECUTABLE_SYMBOLS}} -${RELOCATING- /* For some reason, the Solaris linker makes bad executables - if gld -r is used and the intermediate file has sections starting - at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld - bug. But for now assigning the zero vmas works. */} - -${RELOCATING+PROVIDE (__stack = 0);} -${RELOCATING+PROVIDE (___stack = 0);} -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}} - ${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}} - ${CREATE_SHLIB-${INTERP}} - .hash ${RELOCATING-0} : { *(.hash) } - .dynsym ${RELOCATING-0} : { *(.dynsym) } - .dynstr ${RELOCATING-0} : { *(.dynstr) } - .gnu.version ${RELOCATING-0} : { *(.gnu.version) } - .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } - .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } - .rela.text ${RELOCATING-0} : - { - *(.rela.text) - ${RELOCATING+*(.rela.text.*)} - ${RELOCATING+*(.rela.gnu.linkonce.t*)} - } - .rela.data ${RELOCATING-0} : - { - *(.rela.data) - ${RELOCATING+*(.rela.data.*)} - ${RELOCATING+*(.rela.gnu.linkonce.d*)} - } - .rela.rodata ${RELOCATING-0} : - { - *(.rela.rodata) - ${RELOCATING+*(.rela.rodata.*)} - ${RELOCATING+*(.rela.gnu.linkonce.r*)} - } - .rela.got ${RELOCATING-0} : { *(.rela.got) } - .rela.got1 ${RELOCATING-0} : { *(.rela.got1) } - .rela.got2 ${RELOCATING-0} : { *(.rela.got2) } - .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } - .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } - .rela.init ${RELOCATING-0} : { *(.rela.init) } - .rela.fini ${RELOCATING-0} : { *(.rela.fini) } - .rela.bss ${RELOCATING-0} : { *(.rela.bss) } - .rela.plt ${RELOCATING-0} : { *(.rela.plt) } - .rela.sdata ${RELOCATING-0} : { *(.rela.sdata) } - .rela.sbss ${RELOCATING-0} : { *(.rela.sbss) } - .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2) } - .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2) } - .text ${RELOCATING-0} : - { - ${RELOCATING+${TEXT_START_SYMBOLS}} - *(.text) - ${RELOCATING+*(.text.*)} - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - ${RELOCATING+*(.gnu.linkonce.t*)} - } =${NOP-0} - .init ${RELOCATING-0} : { KEEP (*(.init)) } =${NOP-0} - .fini ${RELOCATING-0} : { KEEP (*(.fini)) } =${NOP-0} - .rodata ${RELOCATING-0} : - { - *(.rodata) - ${RELOCATING+*(.rodata.*)} - ${RELOCATING+*(.gnu.linkonce.r*)} - } - .rodata1 ${RELOCATING-0} : { *(.rodata1) } - ${RELOCATING+_etext = .;} - ${RELOCATING+PROVIDE (etext = .);} - ${RELOCATING+PROVIDE (__etext = .);} - ${CREATE_SHLIB-${SDATA2}} - ${CREATE_SHLIB-${SBSS2}} - ${RELOCATING+${OTHER_READONLY_SECTIONS}} - - /* Adjust the address for the data segment. We want to adjust up to - the same address within the page on the next page up. It would - be more correct to do this: - ${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (ALIGN(8) & (${MAXPAGESIZE} - 1))};} - The current expression does not correctly handle the case of a - text segment ending precisely at the end of a page; it causes the - data segment to skip a page. The above expression does not have - this problem, but it will currently (2/95) cause BFD to allocate - a single segment, combining both text and data, for this case. - This will prevent the text segment from being shared among - multiple executions of the program; I think that is more - important than losing a page of the virtual address space (note - that no actual memory is lost; the page which is skipped can not - be referenced). */ - ${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};} - - .data ${RELOCATING-0} : - { - ${RELOCATING+${DATA_START_SYMBOLS}} - *(.data) - ${RELOCATING+*(.data.*)} - ${RELOCATING+*(.gnu.linkonce.d*)} - ${CONSTRUCTING+CONSTRUCTORS} - } - .data1 ${RELOCATING-0} : { *(.data1) } - ${RELOCATING+${OTHER_READWRITE_SECTIONS}} - - .got1 ${RELOCATING-0} : { *(.got1) } - .dynamic ${RELOCATING-0} : { *(.dynamic) } - - /* Put .ctors and .dtors next to the .got2 section, so that the pointers - get relocated with -mrelocatable. Also put in the .fixup pointers. - The current compiler no longer needs this, but keep it around for 2.7.2 */ - - ${RELOCATING+PROVIDE (_GOT2_START_ = .);} - ${RELOCATING+PROVIDE (__GOT2_START_ = .);} - .got2 ${RELOCATING-0} : { *(.got2) } - - ${RELOCATING+PROVIDE (__CTOR_LIST__ = .);} - ${RELOCATING+PROVIDE (___CTOR_LIST__ = .);} - ${RELOCATING+${CTOR}} - ${RELOCATING+PROVIDE (__CTOR_END__ = .);} - ${RELOCATING+PROVIDE (___CTOR_END__ = .);} - - ${RELOCATING+PROVIDE (__DTOR_LIST__ = .);} - ${RELOCATING+PROVIDE (___DTOR_LIST__ = .);} - ${RELOCATING+${DTOR}} - ${RELOCATING+PROVIDE (__DTOR_END__ = .);} - ${RELOCATING+PROVIDE (___DTOR_END__ = .);} - - ${RELOCATING+PROVIDE (_FIXUP_START_ = .);} - ${RELOCATING+PROVIDE (__FIXUP_START_ = .);} - .fixup ${RELOCATING-0} : { *(.fixup) } - ${RELOCATING+PROVIDE (_FIXUP_END_ = .);} - ${RELOCATING+PROVIDE (__FIXUP_END_ = .);} - ${RELOCATING+PROVIDE (_GOT2_END_ = .);} - ${RELOCATING+PROVIDE (__GOT2_END_ = .);} - - ${RELOCATING+PROVIDE (_GOT_START_ = .);} - ${RELOCATING+PROVIDE (__GOT_START_ = .);} - .got ${RELOCATING-0} : { *(.got) } - .got.plt ${RELOCATING-0} : { *(.got.plt) } - ${CREATE_SHLIB+${SDATA2}} - ${CREATE_SHLIB+${SBSS2}} - ${RELOCATING+PROVIDE (_GOT_END_ = .);} - ${RELOCATING+PROVIDE (__GOT_END_ = .);} - - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata ${RELOCATING-0} : { *(.sdata) } - ${RELOCATING+_edata = .;} - ${RELOCATING+PROVIDE (edata = .);} - ${RELOCATING+PROVIDE (__edata = .);} - .sbss ${RELOCATING-0} : - { - ${RELOCATING+PROVIDE (__sbss_start = .);} - ${RELOCATING+PROVIDE (___sbss_start = .);} - *(.sbss) - *(.scommon) - *(.dynsbss) - ${RELOCATING+PROVIDE (__sbss_end = .);} - ${RELOCATING+PROVIDE (___sbss_end = .);} - } - ${PLT} - .bss ${RELOCATING-0} : - { - ${RELOCATING+${OTHER_BSS_SYMBOLS}} - ${RELOCATING+PROVIDE (__bss_start = .);} - ${RELOCATING+PROVIDE (___bss_start = .);} - *(.dynbss) - *(.bss) - *(COMMON) - } - ${RELOCATING+_end = . ;} - ${RELOCATING+PROVIDE (end = .);} - ${RELOCATING+PROVIDE (__end = .);} - - /* These are needed for ELF backends which have not yet been - converted to the new style linker. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* These must appear regardless of ${RELOCATING}. */ - ${OTHER_SECTIONS} -} -EOF diff --git a/contrib/binutils/ld/scripttempl/tic30aout.sc b/contrib/binutils/ld/scripttempl/tic30aout.sc deleted file mode 100644 index 28baed37e614..000000000000 --- a/contrib/binutils/ld/scripttempl/tic30aout.sc +++ /dev/null @@ -1,34 +0,0 @@ -cat <<EOF -OUTPUT_FORMAT("${OUTPUT_FORMAT}") -OUTPUT_ARCH(${ARCH}) - -${STACKZERO+${RELOCATING+${STACKZERO}}} -${RELOCATING+PROVIDE (__stack = 0);} -SECTIONS -{ - ${RELOCATING+. = ${TEXT_START_ADDR};} - .text : - { - CREATE_OBJECT_SYMBOLS - *(.text) - ${RELOCATING+_etext = .;} - ${RELOCATING+__etext = .;} - ${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}} - } - ${RELOCATING+. = ${DATA_ALIGNMENT};} - .data : - { - *(.data) - ${RELOCATING+_edata = .;} - ${RELOCATING+__edata = .;} - } - .bss : - { - ${RELOCATING+ __bss_start = .}; - *(.bss) - *(COMMON) - ${RELOCATING+_end = ALIGN(4) }; - ${RELOCATING+__end = ALIGN(4) }; - } -} -EOF diff --git a/contrib/binutils/ld/scripttempl/tic30coff.sc b/contrib/binutils/ld/scripttempl/tic30coff.sc deleted file mode 100644 index df2d4f737cd3..000000000000 --- a/contrib/binutils/ld/scripttempl/tic30coff.sc +++ /dev/null @@ -1,58 +0,0 @@ -cat <<EOF -OUTPUT_FORMAT("${OUTPUT_FORMAT}") -OUTPUT_ARCH("${OUTPUT_ARCH}") - -MEMORY -{ - rom : ORIGIN = 0x00000300, LENGTH = 16k - ram : ORIGIN = 0x00000300 + 16k, LENGTH = 16k - ramblk0 : ORIGIN = 0x02026000, LENGTH = 0x1000 - ramblk1 : ORIGIN = 0x02027000, LENGTH = 0x1000 -} - -SECTIONS -{ -.vectors 0x00000000 : -{ - *(vectors) -} - -.text : -{ - *(.text) -} > rom - -.const : -{ - *(.const) - __etext = . ; -} > rom - -.mdata : AT( ADDR(.const) + SIZEOF(.const) ) -{ - __data = . ; - *(.data); - __edata = . ; -} > ram - -.bss : -{ - __bss = . ; - *(.bss); - *(COMMON); - __ebss = . ; -} > ram - -.ram0 : -{ - *(ram0) -} > ramblk0 - -.ram1 : -{ - *(ram1) -} > ramblk1 - -} - -EOF diff --git a/contrib/binutils/ld/scripttempl/v850.sc b/contrib/binutils/ld/scripttempl/v850.sc deleted file mode 100644 index 8958321b2b95..000000000000 --- a/contrib/binutils/ld/scripttempl/v850.sc +++ /dev/null @@ -1,230 +0,0 @@ -cat << EOF -OUTPUT_FORMAT("elf32-v850", "elf32-v850", - "elf32-v850") -OUTPUT_ARCH(v850) -ENTRY(_start) -SEARCH_DIR(.); -SECTIONS -{ - /* This saves a little space in the ELF file, since the zda starts - at a higher location that the ELF headers take up. */ - - .zdata ${ZDATA_START_ADDR} : - { - *(.zdata) - *(.zbss) - *(reszdata) - *(.zcommon) - } - - /* This is the read only part of the zero data area. - Having it as a seperate section prevents its - attributes from being inherited by the zdata - section. Specifically it prevents the zdata - section from being marked READONLY. */ - - .rozdata ${ROZDATA_START_ADDR} : - { - *(.rozdata) - *(romzdata) - *(romzbss) - } - - /* Read-only sections, merged into text segment. */ - . = ${TEXT_START_ADDR}; - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .rel.text : { *(.rel.text) } - .rela.text : { *(.rela.text) } - .rel.data : { *(.rel.data) } - .rela.data : { *(.rela.data) } - .rel.rodata : { *(.rel.rodata) } - .rela.rodata : { *(.rela.rodata) } - .rel.gcc_except_table : { *(.rel.gcc_except_table) } - .rela.gcc_except_table : { *(.rela.gcc_except_table) } - .rel.got : { *(.rel.got) } - .rela.got : { *(.rela.got) } - .rel.ctors : { *(.rel.ctors) } - .rela.ctors : { *(.rela.ctors) } - .rel.dtors : { *(.rel.dtors) } - .rela.dtors : { *(.rela.dtors) } - .rel.init : { *(.rel.init) } - .rela.init : { *(.rela.init) } - .rel.fini : { *(.rel.fini) } - .rela.fini : { *(.rela.fini) } - .rel.bss : { *(.rel.bss) } - .rela.bss : { *(.rela.bss) } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } - .init : { KEEP (*(.init)) } =0 - .plt : { *(.plt) } - - .text : - { - *(.text) - ${RELOCATING+*(.text.*)} - - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - } =0 - - ${RELOCATING+_etext = .;} - ${RELOCATING+PROVIDE (etext = .);} - - /* This is special code area at the end of the normal text section. - It contains a small lookup table at the start followed by the - code pointed to by entries in the lookup table. */ - - .call_table_data ${CALL_TABLE_START_ADDR} : - { - ${RELOCATING+PROVIDE(__ctbp = .);} - *(.call_table_data) - } = 0xff /* Fill gaps with 0xff. */ - - .call_table_text : - { - *(.call_table_text) - } - - .fini : { KEEP (*(.fini)) } =0 - .rodata : { *(.rodata) ${RELOCATING+*(.rodata.*)} *(.gnu.linkonce.r*) } - .rodata1 : { *(.rodata1) } - - .data : - { - *(.data) - ${RELOCATING+*(.data.*)} - *(.gnu.linkonce.d*) - CONSTRUCTORS - } - .data1 : { *(.data1) } - .ctors : - { - ${CONSTRUCTING+___ctors = .;} - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*crtend(.ctors)) - ${CONSTRUCTING+___ctors_end = .;} - } - .dtors : - { - ${CONSTRUCTING+___dtors = .;} - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*crtend.o(.dtors)) - ${CONSTRUCTING+___dtors_end = .;} - } - .jcr : - { - KEEP (*(.jcr)) - } - - .gcc_except_table : { *(.gcc_except_table) } - - .got : { *(.got.plt) *(.got) } - .dynamic : { *(.dynamic) } - - .tdata ${TDATA_START_ADDR} : - { - ${RELOCATING+PROVIDE (__ep = .);} - *(.tbyte) - *(.tcommon_byte) - *(.tdata) - *(.tbss) - *(.tcommon) - } - - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - - .sdata ${SDATA_START_ADDR} : - { - ${RELOCATING+PROVIDE (__gp = . + 0x8000);} - *(.sdata) - } - - /* See comment about .rozdata. */ - .rosdata ${ROSDATA_START_ADDR} : - { - *(.rosdata) - } - - /* We place the .sbss data section AFTER the .rosdata section, so that - it can directly preceed the .bss section. This allows runtime startup - code to initialise all the zero-data sections by simply taking the - value of '_edata' and zeroing until it reaches '_end'. */ - - .sbss : - { - ${RELOCATING+__sbss_start = .;} - *(.sbss) - *(.scommon) - } - - ${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;} - ${RELOCATING+PROVIDE (edata = _edata);} - - .bss : - { - ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;} - ${RELOCATING+__real_bss_start = . ;} - *(.dynbss) - *(.bss) - *(COMMON) - } - - ${RELOCATING+_end = . ;} - ${RELOCATING+PROVIDE (end = .);} - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - - /* SGI/MIPS DWARF 2 extensions. */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* User stack. */ - .stack 0x200000 : - { - ${RELOCATING+__stack = .;} - *(.stack) - } -} -EOF diff --git a/contrib/binutils/ld/scripttempl/z8000.sc b/contrib/binutils/ld/scripttempl/z8000.sc deleted file mode 100644 index 646c88080a9a..000000000000 --- a/contrib/binutils/ld/scripttempl/z8000.sc +++ /dev/null @@ -1,57 +0,0 @@ -cat <<EOF -OUTPUT_FORMAT("${OUTPUT_FORMAT}") -OUTPUT_ARCH("${OUTPUT_ARCH}") -ENTRY(_start) - -SECTIONS -{ -.text ${BIG+ ${RELOCATING+ 0x0000000}} : - { - *(.text) - *(.strings) - *(.rdata) - } - -.ctors ${BIG+ ${RELOCATING+ 0x2000000}} : - { - ${CONSTRUCTING+ ___ctors = . ; } - *(.ctors); - ${CONSTRUCTING+ ___ctors_end = . ; } - ___dtors = . ; - *(.dtors); - ${CONSTRUCTING+ ___dtors_end = . ; } - } - -.data ${BIG+ ${RELOCATING+ 0x3000000}} : - { - *(.data) - } - -.bss ${BIG+ ${RELOCATING+ 0x4000000}} : - { - ${RELOCATING+ __start_bss = . ; } - *(.bss); - *(COMMON); - ${RELOCATING+ __end_bss = . ; } - } - -.heap ${BIG+ ${RELOCATING+ 0x5000000}} : - { - ${RELOCATING+ __start_heap = . ; } - ${RELOCATING+ . = . + 20k ; } - ${RELOCATING+ __end_heap = . ; } - } - -.stack ${RELOCATING+ 0xf000 } : - { - ${RELOCATING+ _stack = . ; } - *(.stack) - ${RELOCATING+ __stack_top = . ; } - } - -} -EOF - - - - diff --git a/contrib/binutils/libiberty/acconfig.h b/contrib/binutils/libiberty/acconfig.h deleted file mode 100644 index f7c599df7ac6..000000000000 --- a/contrib/binutils/libiberty/acconfig.h +++ /dev/null @@ -1,11 +0,0 @@ -/* Define if you have the sys_errlist variable. */ -#undef HAVE_SYS_ERRLIST - -/* Define if you have the sys_nerr variable. */ -#undef HAVE_SYS_NERR - -/* Define if you have the sys_siglist variable. */ -#undef HAVE_SYS_SIGLIST - -/* Define if you have the strerror function. */ -#undef HAVE_STRERROR diff --git a/contrib/binutils/libiberty/alloca-botch.h b/contrib/binutils/libiberty/alloca-botch.h deleted file mode 100644 index c909573f58c6..000000000000 --- a/contrib/binutils/libiberty/alloca-botch.h +++ /dev/null @@ -1,5 +0,0 @@ -/* RS/6000 AIX botched alloca and requires a pragma, which ordinary compilers - throw up about, so we have to put it in a specially-configured file. - Like this one. */ - -#pragma alloca diff --git a/contrib/binutils/libiberty/alloca-conf.h b/contrib/binutils/libiberty/alloca-conf.h deleted file mode 100644 index 9c3eea396c19..000000000000 --- a/contrib/binutils/libiberty/alloca-conf.h +++ /dev/null @@ -1,24 +0,0 @@ -#include "config.h" - -#if defined(__GNUC__) && !defined(C_ALLOCA) -# ifndef alloca -# define alloca __builtin_alloca -# endif -#else /* ! defined (__GNUC__) */ -# ifdef _AIX - #pragma alloca -# else -# if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA) -# include <alloca.h> -# else /* ! defined (HAVE_ALLOCA_H) */ -# ifdef __STDC__ -extern PTR alloca (size_t); -# else /* ! defined (__STDC__) */ -extern PTR alloca (); -# endif /* ! defined (__STDC__) */ -# endif /* ! defined (HAVE_ALLOCA_H) */ -# ifdef _WIN32 -# include <malloc.h> -# endif -# endif /* ! defined (_AIX) */ -#endif /* ! defined (__GNUC__) */ diff --git a/contrib/binutils/libiberty/alloca-norm.h b/contrib/binutils/libiberty/alloca-norm.h deleted file mode 100644 index bda4fc049adf..000000000000 --- a/contrib/binutils/libiberty/alloca-norm.h +++ /dev/null @@ -1,25 +0,0 @@ -/* "Normal" configuration for alloca. */ - -#ifdef __GNUC__ -#ifndef alloca -#define alloca __builtin_alloca -#endif -#else /* ! defined (__GNUC__) */ -#if defined (sparc) && defined (sun) -#include <alloca.h> -#ifdef __STDC__ -extern void *__builtin_alloca(); -#else /* ! defined (__STDC__) */ -extern char *__builtin_alloca(); /* Stupid include file doesn't declare it */ -#endif /* ! defined (__STDC__) */ -#else /* ! defined (sparc) || ! defined (sun) */ -#ifdef __STDC__ -PTR alloca (size_t); -#else /* ! defined (__STDC__) */ -PTR alloca (); /* must agree with functions.def */ -#endif /* ! defined (__STDC__) */ -#endif /* ! defined (sparc) || ! defined (sun) */ -#ifdef _WIN32 -#include <malloc.h> -#endif -#endif /* ! defined (__GNUC__) */ diff --git a/contrib/binutils/libiberty/config/mh-sysv b/contrib/binutils/libiberty/config/mh-sysv deleted file mode 100644 index eb102d550108..000000000000 --- a/contrib/binutils/libiberty/config/mh-sysv +++ /dev/null @@ -1 +0,0 @@ -RANLIB=true diff --git a/contrib/binutils/libiberty/config/mh-sysv4 b/contrib/binutils/libiberty/config/mh-sysv4 deleted file mode 100644 index 4d1aa3cd61d5..000000000000 --- a/contrib/binutils/libiberty/config/mh-sysv4 +++ /dev/null @@ -1,3 +0,0 @@ -HDEFINES = -DHAVE_SYSCONF -RANLIB=true -INSTALL = cp diff --git a/contrib/binutils/libiberty/config/mt-mingw32 b/contrib/binutils/libiberty/config/mt-mingw32 deleted file mode 100644 index 2fb17d783d03..000000000000 --- a/contrib/binutils/libiberty/config/mt-mingw32 +++ /dev/null @@ -1,27 +0,0 @@ -# Mingw32 target Makefile fragment. -# The autoconfiguration fails for a Mingw32 target, because of an -# incompatible definition of sys_errlist, which is imported from a DLL. -# Therefore, we compute the dependencies by hand. - -HDEFINES = -DNO_SYS_PARAM_H -DNO_SYS_FILE_H -CONFIG_H = mgconfig.h -NEEDED_LIST = mgneeded-list - -mgconfig.h: Makefile - if [ -f ../newlib/Makefile ]; then \ - $(MAKE) $(FLAGS_TO_PASS) xconfig.h; \ - cp xconfig.h mgconfig.h; \ - else \ - echo "#define NEED_sys_siglist 1" >>mgconfig.h; \ - echo "#define NEED_strsignal 1" >>mgconfig.h; \ - echo "#define NEED_psignal 1" >>mgconfig.h; \ - echo "#define NEED_basename 1" >>mgconfig.h; \ - fi - -mgneeded-list: Makefile - if [ -f ../newlib/Makefile ]; then \ - $(MAKE) $(FLAGS_TO_PASS) xneeded-list; \ - cp xneeded-list mgneeded-list; \ - else \ - echo getopt.o vasprintf.o >mgneeded-list; \ - fi diff --git a/contrib/binutils/libiberty/dummy.c b/contrib/binutils/libiberty/dummy.c deleted file mode 100644 index 08da647e30eb..000000000000 --- a/contrib/binutils/libiberty/dummy.c +++ /dev/null @@ -1,49 +0,0 @@ -#include <ansidecl.h> - -#ifdef __STDC__ -#include <stddef.h> -#define clock_t unsigned long -#define DEF(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME (ARGS); -#define DEFFUNC(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME (ARGS); -#else -#define void int -#define size_t unsigned long -#define clock_t unsigned long -#define DEF(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME (); -#define DEFFUNC(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME (); -#endif - -#define DEFVAR(NAME,DECL,USE) extern DECL; - -#define NOTHING /*nothing*/ - -#include "alloca-conf.h" -#include "functions.def" - -/* Always use our: getopt.o getopt1.o obstack.o spaces.o */ - -int -main (argc, argv) - int argc; char **argv; -{ - -/* Create a dummy function call for each DEF-defined function. */ - -#undef DEF -#undef DEFVAR -#undef DEFFUNC -#undef AND -#define AND = 0; -/* ARGS expands into a set of declaration. NAME ARG_LIST expands - info a function call that uses those variables as actual parameters. - If the function has been DEF'ed correctly, we can pass the right - number and types of parameters, which is nice. (E.g. gcc may - otherwise complain about the wrong number of parameters to certain - builtins.) */ -#define DEF(NAME, RETURN_TYPE, ARG_LIST, ARGS) { ARGS; NAME ARG_LIST; } -#define DEFVAR(NAME, DECL, USE) { USE; } -#define DEFFUNC(NAME, RETURN_TYPE, ARG_LIST, ARGS) { ARGS; NAME ARG_LIST; } -#include "functions.def" - - return (0); -} diff --git a/contrib/binutils/libiberty/functions.def b/contrib/binutils/libiberty/functions.def deleted file mode 100644 index 0f13f107868e..000000000000 --- a/contrib/binutils/libiberty/functions.def +++ /dev/null @@ -1,70 +0,0 @@ -/* - * List of function definitions that may *optionally* be included - * in libiberty.a. The function names must match the filenames, - * e.g. bzero() is defined in bzero.c. (While each file can contain - * extra functions, do not list them.) - * - * In the default libiberty configuration, these object files - * (e.g bzero.o) are included if and only if cc fails to find - * the corresponding function in libc. - */ - -DEF(asprintf, int, (), NOTHING) -DEF(atexit, int, (f), void (*f)()) -DEF(bcmp, int, (s1, s2, length), char *s1 AND char *s2 AND int length ) -DEF(bcopy, void, (s1, s2, length), char *s1 AND char *s2 AND int length ) -DEF(bzero, void, (s, length), char *s AND int length) -DEF(clock, clock_t, (), NOTHING) -DEF(getopt, int, (argc, argv, optstring), - int argc AND char **argv AND CONST char *optstring) -DEF(getpagesize, int , (), NOTHING) -DEF(getcwd, char*, (buf, len), char *buf AND int len) -DEF(index, char*, (s, c), char *s AND int c) -DEF(insque, void, (), NOTHING) -DEF(memchr, PTR, (s, c, length), CONST PTR s AND int c AND size_t length) -DEF(memcmp, int, (s1, s2, length), - CONST PTR s1 AND CONST PTR s2 AND size_t length) -DEF(memcpy, PTR, (s1, s2, length), PTR s1 AND CONST PTR s2 AND size_t length) -DEF(memmove, PTR, (s1, s2, length), PTR s1 AND CONST PTR s2 AND size_t length) -DEF(memset, PTR, (s, val, length), PTR s AND int val AND size_t length ) -DEF(random, long int, (), NOTHING) -DEF(rename, int, (f, t), char *f AND char *t) -DEF(rindex, char*, (s, c), char *s AND int c) -DEF(strcasecmp, int, (s1, s2), char *s1 AND char *s2) -DEF(strncasecmp, int, (s1, s2, n), char *s1 AND char *s2 AND int n) -DEF(strchr, char*, (s, c), CONST char *s AND int c) -DEF(strdup, char*, (s1), char * s1) -DEF(strrchr, char*, (s, c), CONST char *s AND int c) -DEF(strstr, char*, (), NOTHING) -DEF(strtod, double, (), NOTHING) -DEF(strtol, long, (), NOTHING) -DEF(strtoul, unsigned long, (), NOTHING) -DEF(tmpnam, char *, (s), char * s) -DEF(vfork, int, (), NOTHING) -DEF(vfprintf, int, (), NOTHING) -DEF(vprintf, int, (), NOTHING) -DEF(vsprintf, int, (), NOTHING) -DEF(sigsetmask, int, (), NOTHING) -DEF(alloca, PTR, (size), size_t size) -DEF(waitpid, int, (pid, statp, opts), int pid AND int* statp AND int opts ) -DEF(vasprintf, int, (), NOTHING) - -/* List of global variables that we want to look for in the host - environment, and to generate an entry NEED_<variable> in config.h - if they are not found. The first arg is the variable name, the - second arg is how to declare the variable, and the third is how to - use it. */ - -DEFVAR(sys_nerr, int sys_nerr, sys_nerr = 0) -DEFVAR(sys_errlist, char *sys_errlist[], sys_errlist[0] = 0) -DEFVAR(sys_siglist, char *sys_siglist[], sys_siglist[0] = 0) - -/* List of global functions that we want to look for in the host - environment, and to generate an entry NEED_<funcname> in config.h - if they are not found. */ - -DEFFUNC(strerror, char*, (errnoval), int errnoval) -DEFFUNC(psignal, void, (signo, message), unsigned signo AND char *message) -DEFFUNC(basename, char *, (name), CONST char *name) -DEFFUNC(on_exit, void, (f, arg), void (*f)() AND char *arg) -DEFFUNC(strsignal, const char *, (signo), int signo) diff --git a/contrib/binutils/md5.sum b/contrib/binutils/md5.sum deleted file mode 100644 index c62704f18f90..000000000000 --- a/contrib/binutils/md5.sum +++ /dev/null @@ -1,3022 +0,0 @@ -0636e73ff0215e8d672dc4c32c317bb3 COPYING -f30a9716ef3762e3467a2f62bf790f0a COPYING.LIB -9cdb15c1e49c0070192d6d1c7a195e7e Makefile.in -07c33a285703b40cd6f93a478e97e03b README -22383b04c0616f41ee4ba51baca24655 bfd/ChangeLog -ceab81aa1f02825092808fdafba0239d bfd/COPYING -5a266b5dba92eea6d99752a62548bb2d bfd/doc/ChangeLog -1e5a6fbefd1aaed4433ace8afce78961 bfd/doc/Makefile.am -a464bee4132fb2fa44c4d2e46b58a754 bfd/doc/Makefile.in -0fbe144d8d1782e0379db812371c6a57 bfd/doc/aoutx.texi -6f34186ad28a5b230efc088a709560de bfd/doc/archive.texi -f98e3a1458953a5a6fae44a5c5f75e30 bfd/doc/archures.texi -84be077fe0d16ded1d48b6bd4602f737 bfd/doc/bfd.info -a31bdf4569c4f1cd2745113b3083aa30 bfd/doc/bfd.info-1 -6911c8229b2daa3efa2ce01bd699c793 bfd/doc/bfd.info-2 -efa0b7d03876abc3e57a529aa5b43048 bfd/doc/bfd.info-3 -39bdefc46b786b1663d0b84f64fcf04f bfd/doc/bfd.info-4 -b2c4637dbb3c0690b75e900477fa1224 bfd/doc/bfd.info-5 -33ed65a4ba35b35445e5684b8454a0b9 bfd/doc/bfd.info-6 -ba54c1f2d34777c4624608c8cd032ade bfd/doc/bfd.info-7 -0b6e6b0217a3682a89b784120d6c6912 bfd/doc/bfd.texinfo -bf1f24c962732c18cedacc546e577d38 bfd/doc/bfdint.texi -8b6ecc6029ed69110c2fd06605bbb028 bfd/doc/bfdsumm.texi -aeb854f56071a92ed682ea3a47ef412e bfd/doc/bfdt.texi -a08da988e834eaa44ce036daed384f3f bfd/doc/cache.texi -4e6650cba5f9d8f2bc248e7edfe2b166 bfd/doc/chew.c -9b20193a1b085b49ad22e22a94d7eade bfd/doc/coffcode.texi -99105e514872b3e0f5eadbc9844efeed bfd/doc/core.texi -e67d8b07516154c4ddbee2e3bab3d75e bfd/doc/doc.str -c60b298f07f5a175f2325d48bd009bdb bfd/doc/elf.texi -d41d8cd98f00b204e9800998ecf8427e bfd/doc/elfcode.texi -4e84142a7f35ea897af65f69d33fbae5 bfd/doc/format.texi -1d846f321c1f04f609386d3c31201c93 bfd/doc/hash.texi -7ac9a36b8a72594048188cd4ee5012dc bfd/doc/init.texi -e17fcdf3ea8e298f1327ed8c4649a156 bfd/doc/libbfd.texi -6f212b00766abadea5b686c91c024f16 bfd/doc/linker.texi -5fa24958e8a60b2f879af658e615ccc0 bfd/doc/makefile.vms -75adee5262cfe18e955d31dcec3d9a54 bfd/doc/opncls.texi -5bf597a23995b21bfaefa45638e33df3 bfd/doc/proto.str -6f8560b2e86ac189a40bce16c927dcdb bfd/doc/reloc.texi -81e47720738cbb4c3361b092baf90841 bfd/doc/section.texi -fd78f14948d36f7fae45d29db7b0d521 bfd/doc/syms.texi -d193493718f22e2de122b05b741f660b bfd/doc/targets.texi -f7f4648407c03c8d7ecdac1e9b3c267a bfd/po/Make-in -445a1c3ee4b5467304d3568fc54a9530 bfd/po/bfd.pot -6aaeff367ac449364787e94b6db53183 bfd/ChangeLog-9193 -78e72a396e9d529dc2f9e3f6c0eb7efb bfd/ChangeLog-9495 -45851bb85b21afd2c2247c5bd531eda0 bfd/ChangeLog-9697 -3a8b2876879b53a8f247a03416527a48 bfd/ChangeLog-9899 -d618facc3e8ce8bf3d02ba452e1be6ab bfd/MAINTAINERS -cac2c8b510bd39ae04fe5bfce40a197e bfd/Makefile.am -d99c8cebc58f57cc7982b4755bfcb6c5 bfd/Makefile.in -6455e3c85b31e588ecb75f7d3c945c8d bfd/PORTING -11627ef87a2a20a3326b87602d051620 bfd/README -cd26654c6eb30680694867e434e40044 bfd/TODO -fa9dc5a90d06b56e4fc7388caa0936f2 bfd/acinclude.m4 -3d436bc3696617e5f5539e46fbb81763 bfd/aclocal.m4 -783909cb3ba12056ddfd113362c66b8f bfd/aix386-core.c -15d641f38a61d43e9540e89296e67321 bfd/aout-adobe.c -d56d591b9a3938cd12de14ca63863c47 bfd/aout-arm.c -e00ccede7e9e61f87ad5d8b67810817b bfd/aout-cris.c -d80798e7e80396610c9817724df3d0fc bfd/aout-encap.c -0bb2732a15a0255366389fa13f5034b8 bfd/aout-ns32k.c -d4ee6f5c992ea87510be7b202fc06dfb bfd/aout-sparcle.c -2f8b4091d064635ae41681ee597078d0 bfd/aout-target.h -3e051d26fb5cbdd0c8530d67a5a829ad bfd/aout-tic30.c -c2fa21aea08313dffcc9b4a2a3e9ca5b bfd/aout0.c -710ff75a0a234773691c069654dd8ba6 bfd/aout32.c -cae169ce11deb6f450104c569c23c853 bfd/aout64.c -4a67efea73c2bf40983f1570607e10de bfd/aoutf1.h -2e0b7e96647fd0d8a75c730fc92bd7ea bfd/aoutx.h -e9c89491cabfaf3db12368e423003172 bfd/archive.c -ed85bcca32de659b4ac834648c69e47a bfd/archures.c -43473bfc2577fc75e330907ad43b810d bfd/armnetbsd.c -68fc30620cce0b416e21fc8bf9ffb66d bfd/bfd-in.h -d101e9977294c79488c7038e11bb8872 bfd/bfd-in2.h -1ec8f01cd36a0410d6a358c13450d32c bfd/bfd.c -43ab9de01b31034b63b1e34e58e171bf bfd/binary.c -5b0964ce2bef841eca1cc28ac170b340 bfd/bout.c -794d989c69536eac1b969452a240c617 bfd/cache.c -6d3c1b378bc7ed685664fe6eca297523 bfd/cf-i386lynx.c -545c111611d3dddaae8c666293aac89b bfd/cf-m68klynx.c -09a8617f3c790897c5ac230aa7c9e683 bfd/cf-sparclynx.c -ecf07e87f41eacfbb3f69e959b67986f bfd/cisco-core.c -06ecc8e343ca4331ab10c8f00a9df323 bfd/coff-a29k.c -2af31e3d92988fb31c0970a686aa7960 bfd/coff-alpha.c -be66609cf0885355395701084da2a073 bfd/coff-apollo.c -25815e411716c71b2e39e46996716db5 bfd/coff-arm.c -04d8d5fe37fd8bdbf2c70031ff92db80 bfd/coff-aux.c -57df3015110d34f4a343941c45f60577 bfd/coff-go32.c -3546fff401b9a26bcd4121820ea52797 bfd/coff-h8300.c -6e844c7259f2b47eeb578984f8b06b7a bfd/coff-h8500.c -edc1a2a2a4106ddbe929545af6898e31 bfd/coff-i386.c -eedf5424ec64783efbb545eb930fbd8e bfd/coff-i860.c -f03155ea586d01ced8c85c43ec93dc9f bfd/coff-i960.c -eae36e1c87fce17a42f52b56f71d1841 bfd/coff-ia64.c -80ff3a9c87e1335f5fcd991a398c159f bfd/coff-m68k.c -646163dbbe28724f933cc5dff8d6b522 bfd/coff-m88k.c -9fd04d7b0c69cd43a51a42e4cac313e3 bfd/coff-mcore.c -85217ef58e511dbf42d4b007f8f8e624 bfd/coff-mips.c -0fe98f356a19d05611fa133c217e77e5 bfd/coff-pmac.c -b31637614abfd34b5e72ad0f76f6418c bfd/coff-ppc.c -92197be7dfa58b4f3c079ea0e91c165b bfd/coff-rs6000.c -14096c1501e38762f71ecc48819cc389 bfd/coff-sh.c -56dadcdfef723b9fd53ecc9a501f616f bfd/coff-sparc.c -ff09554abd281030f46ccc417c403aa9 bfd/coff-stgo32.c -0a6bcb90289a5f62cb39fb0ec0858560 bfd/coff-svm68k.c -eddc8ea37292e1e57f26435d884e432b bfd/coff-tic30.c -e6300d33022fe5164ebb75d09c20fabb bfd/coff-tic54x.c -015b6a9faba6e0ee871d1c3e751c4261 bfd/coff-tic80.c -f8c6308a039c92faded1d165112668a2 bfd/coff-u68k.c -59a6770435f62b0214de775a03bf4e9c bfd/coff-w65.c -d958f107aae4a2592d9bbc57e2fc50c5 bfd/coff-we32k.c -81a2479479af147514f6cbe7ca941e07 bfd/coff-z8k.c -b599fc0cbd45a2d9cb95845f9802ba28 bfd/coff64-rs6000.c -d4e3ce939d94c50f67c16ba80bbd809f bfd/coffcode.h -3029424ada4af130ef96b8e1d7a99a53 bfd/coffgen.c -94a1415b45d3f1ca4c1cbd2cb591f62d bfd/cofflink.c -c81791ff3f60009e8d28464b6c53c396 bfd/coffswap.h -1d6832ab0a312bf399ac892d9666ef25 bfd/config.bfd -2ebfc42d5d2a4668d364f1b54968b4bc bfd/config.in -d1292a46d15e8d2b2b9c0fc4f837e375 bfd/configure -a8485b69f68d81f4ef2f29b51bb36d85 bfd/configure.com -da932a956ba7ad830b729bafd4af4644 bfd/configure.host -12427c9975895d3dfc3cfa7724e630bc bfd/configure.in -13256bb517cdf3f1b4b04eaabc8a4490 bfd/corefile.c -6bc9b90664a2ebdf2b85f19dce0b7f11 bfd/cpu-a29k.c -f93b02f976ea91934c4118be4ed019d4 bfd/cpu-alpha.c -ebc8e4333cf21216de587d22524c9f57 bfd/cpu-arc.c -2ac57d0ff930768b2fa927123e660ec9 bfd/cpu-arm.c -9b9349ab23aa88786581dc0734f31316 bfd/cpu-avr.c -89de8746c4102f5b0b89ff0b19314d7b bfd/cpu-cris.c -6c476a3781d45cdca390650b9273d3ed bfd/cpu-d10v.c -7a7d89b109710f951f825992832fb422 bfd/cpu-d30v.c -fe25690c8c53442b507f5247c9635748 bfd/cpu-fr30.c -567c27d0eb1ca67f1767099379a5957f bfd/cpu-h8300.c -2b2928d3eba5ec4e99916940f24319b5 bfd/cpu-h8500.c -5e942a325f1b1a2e50767f070ce3895c bfd/cpu-hppa.c -5020c76b76859038dd5a92a46647a667 bfd/cpu-i370.c -03868248f282503ee1ddc86c81d77804 bfd/cpu-i386.c -b6d0fbb65c82465573f28353a930b3b6 bfd/cpu-i860.c -42d1e5cfdae1ac51322e21ac410d7bc9 bfd/cpu-i960.c -b7bffd30c0e7b6134a923b1be64ece2e bfd/cpu-ia64-opc.c -2e48697f67575deb45fb727619267da3 bfd/cpu-ia64.c -cdbfa4a9703bf5bfca24f4b7d6bc49a7 bfd/cpu-m10200.c -3dcc6de8db1ffd6408ad3f3dd080b0d3 bfd/cpu-m10300.c -4b5332540a2a4d907dd2d0d6552b4f2f bfd/cpu-m32r.c -0ff542774da1203f6f6496971e8f33b8 bfd/cpu-m68hc11.c -5f6585a0783899916bc3bd9ce42c0624 bfd/cpu-m68hc12.c -431570536021941e2fb8658707a8deba bfd/cpu-m68k.c -480b3bebf9d0b948bc3d51c23fbd511f bfd/cpu-m88k.c -ecc303dc3afabbc076d866c4b1d40191 bfd/cpu-mcore.c -84aedb91a48659311061f3779e1cc5b2 bfd/cpu-mips.c -a0985008fc628157c9b27afceb9fa5fb bfd/cpu-ns32k.c -57fd58bea31545e419d39485059294a4 bfd/cpu-pj.c -21b3055e3b8cca8b2fa65ea72c010fbf bfd/cpu-powerpc.c -2634d322a7c1b737c5ba95d727e70d5c bfd/cpu-rs6000.c -76591b09ebf820167a73bee3d4f8b608 bfd/cpu-sh.c -6c1f0f9816581e6654cfb4476ec51386 bfd/cpu-sparc.c -4a7876d7cfd8a37c9e37f95d0968e7b4 bfd/cpu-tic30.c -b43f6e6ead72cff7ff28c87cec93a33a bfd/cpu-tic54x.c -424e7a355ca4b115f657609a91ade54e bfd/cpu-tic80.c -6d0acf764ac828e6db63a074a54b80ba bfd/cpu-v850.c -722f3f2dceee71c5eae9ab6d9a12e4a2 bfd/cpu-vax.c -42b04e46e5c22d8231df9062c48f9cf8 bfd/cpu-w65.c -3d3a88c1679b541231b65d10b197595c bfd/cpu-we32k.c -17738f4235390683e20471a7a52ff886 bfd/cpu-z8k.c -bf7c79bca2a5503d8e5a08eb2093e354 bfd/demo64.c -325284c2aa7c21d58bf3592f16147525 bfd/dep-in.sed -66ddc5e71a123f88fae4b649913a3625 bfd/dwarf1.c -8e226ff61ec8397b649fcea23d18c5e6 bfd/dwarf2.c -2bd82ca961cf8804c71a8a0f9418612d bfd/ecoff.c -bb90a452e36b92549e623ae4b11b71b3 bfd/ecofflink.c -338f536d95996bf70af288e87e2661bf bfd/ecoffswap.h -35a5d5aa67cdcb354a57872bd6abf5ab bfd/efi-app-ia32.c -e11d2ca6f1bb770ed54aa40386f69b6b bfd/efi-app-ia64.c -069cfcb9e552adb039a5e7f8f54bf045 bfd/elf-bfd.h -a45567b7ed9963c8917942cfb177f137 bfd/elf-hppa.h -dea405a2cadc109a396e598e426782e3 bfd/elf-m10200.c -b0bf972d5ef56f0c349e552cf6225116 bfd/elf-m10300.c -7557a9d743f544179e1914eafb71ba2e bfd/elf.c -c612153791413796ae7b0afe055e345d bfd/elf32-arc.c -8107b55913a0bf1fe46d8ceed7ae71bf bfd/elf32-arm.h -0ff7faa86372c71faaba9df3828878cc bfd/elf32-avr.c -36378f4202010b3f3b89fd679a49320e bfd/elf32-cris.c -c885ba8e2901116ce03d2b3dccac4e89 bfd/elf32-d10v.c -0235362bfd052c523c133bf570acbd53 bfd/elf32-d30v.c -49faab1462b330c4c49dbe7c9d180eaf bfd/elf32-fr30.c -e8040020c66e66a42fd98d2bc855e805 bfd/elf32-gen.c -3ee4163b4b9d0c3b7a164627c08771c8 bfd/elf32-hppa.c -b7922397f8a9f48d5a4fc64833db13f9 bfd/elf32-hppa.h -f23b710d855b7173334c6718bf6cd688 bfd/elf32-i370.c -90cf2ef15a659400e8feb6645a367f6a bfd/elf32-i386.c -d644f126ec840265005aeb71f67906e7 bfd/elf32-i860.c -95d5d92e7306b53ea5ab95c62e2b5ea1 bfd/elf32-i960.c -bef5efb28c6db1170c54e9fd3497aeee bfd/elf32-m32r.c -3ac813e93933b49eb51dc510faff890b bfd/elf32-m68hc11.c -ebbf73fbb693283520892daf4eaed2de bfd/elf32-m68hc12.c -84b69778a652d2cfc29bcbf5d82d33af bfd/elf32-m68k.c -6d08a2b4a53db400e322f8f712aa9498 bfd/elf32-m88k.c -1f60d815efdef6aeaa046f8b354f53e4 bfd/elf32-mcore.c -4fbbadc82c574345b50e8ce7a7c46cbc bfd/elf32-mips.c -b3684e979f1de64ee10aa23e5685c5c2 bfd/elf32-pj.c -17c6ae4e2299f25c786a18af88639931 bfd/elf32-ppc.c -18f44608c596c17f9b986a18a3c9fa1e bfd/elf32-sh-lin.c -177d3fec0eaa269a02d1d00174ffd176 bfd/elf32-sh.c -b4b4859eb5d5c1c85481a34897fc1cda bfd/elf32-sparc.c -f73cf274c056492df2771950064a22a9 bfd/elf32-v850.c -ed57bd460ee2d4a61a5c445f280f295c bfd/elf32.c -ab7d515fdfd6173798101dd1247c38e4 bfd/elf64-alpha.c -7d66675b4fb106331426ca0775a0dd71 bfd/elf64-gen.c -dfe015d5db4e49f664194f73f3bd3aa6 bfd/elf64-hppa.c -8d4af471848e82a40a426088ad312988 bfd/elf64-hppa.h -fdeb99876d995a5113705d365c39882f bfd/elf64-mips.c -805e4b8c3b808a837780d88677b2b8d8 bfd/elf64-sparc.c -51948652723cb7cbdc5bf48f68972960 bfd/elf64-x86-64.c -0df4bff9f99908d451625f14be3dc667 bfd/elf64.c -04c179c481f73ef38f4fde45099ea774 bfd/elfarm-nabi.c -7a2f68e293672a469707ee7247ca431f bfd/elfarm-oabi.c -1c857bcc6db894788e6d9612d9190fcd bfd/elfcode.h -a179dd23bcf17071bcd156e30739e502 bfd/elfcore.h -4665db235c5fc322fe645ec556a02351 bfd/elflink.c -eec699dcafd99021dcd6ca470b97bfcb bfd/elflink.h -ee628b92cd241097a81fd761ecfe709f bfd/elfxx-ia64.c -0067bc443dde2afdfdcfa15fb2107267 bfd/elfxx-target.h -5f9b71e52009091cb901280cbe42283c bfd/epoc-pe-arm.c -c9f006f05a9b9f4d6be5fa84dcad8b6a bfd/epoc-pei-arm.c -00882a27abee3c09285429e99d2872ee bfd/format.c -4498092435cf035affd5b3f0d859f7f1 bfd/freebsd.h -c16189d94fa43e845e6b066e6bd29401 bfd/gen-aout.c -ee6fc742a96faf09cbe76a5b8933d3c4 bfd/genlink.h -663a6979bd331c91d1385445edeca7b0 bfd/go32stub.h -6e40031d51114640cfeba4f70e8fce2d bfd/hash.c -d231e6f23f8ca89aa2914992a30a7439 bfd/host-aout.c -4967093aecdbcaebab4be47ad87369f0 bfd/hp300bsd.c -23f63c6bf8c8a673de96d7400861f16b bfd/hp300hpux.c -5cfacfdd3fde9b8c36cbec0486280982 bfd/hppabsd-core.c -035696490716fd55aa20a97a0137f622 bfd/hpux-core.c -42b78f2024c6114d60dce39873229d91 bfd/i386aout.c -f9e0718ca8ae927a262a15b909ca38ad bfd/i386bsd.c -ab28a73ed28b2cb083c882f194d8e590 bfd/i386dynix.c -78373f6cb8c37a9bca0681d2a20af1fb bfd/i386freebsd.c -735a4d6ae9285e257a8cdd64b0ead47a bfd/i386linux.c -4209c991c4f25fb8eb32a8f2437f8292 bfd/i386lynx.c -b90ee8151f8b7c972b6dd46d6beede62 bfd/i386mach3.c -0ce260445c167060070abf30a9e53c70 bfd/i386msdos.c -cb70bc2c9f165797e7bdd0999f3abe31 bfd/i386netbsd.c -ab3df517926791ecae7ca2156c959cb3 bfd/i386os9k.c -bcbeff36cc77a574f222cabed9cf99fd bfd/ieee.c -38785bca5642dd3180e2fad821cedd64 bfd/ihex.c -35b7f1acea0a7c53f6785b40d6970b93 bfd/init.c -dbacd89b0524dc23409add426b7472c8 bfd/irix-core.c -00338a689deaa57875ec90cc111c41f0 bfd/libaout.h -d168900c72cfeaf166dafd27860da0c2 bfd/libbfd-in.h -54fd88f9cf5efec9f04566762600d19a bfd/libbfd.c -426446ce4e817753d7424ef4a42e0ea2 bfd/libbfd.h -670240432b1392be37be4e295d43b03b bfd/libcoff-in.h -c00c38f574930e065d00ee76b5b4b6a8 bfd/libcoff.h -dec4128d1fedb44090e144ceff634fd9 bfd/libecoff.h -714e36507b340c549ba044a151edbdb8 bfd/libhppa.h -809c3ca7fcfbcb52a7e89dbb7d3e3201 bfd/libieee.h -71aaf625a223bf8edb9cb1426fa0e575 bfd/libnlm.h -85a8008401af9b2ba92de57c32eee942 bfd/liboasys.h -1ee2ef5ed0cc707ef280e29d5e7d3c3b bfd/libpei.h -c71ee68d6a6055f1b6775ff042e4c300 bfd/linker.c -17e42ae480674d8ab750a635c250225e bfd/lynx-core.c -837d4132caf5e4cb009d65b614bf5ddc bfd/m68k4knetbsd.c -ef9f1794858f2a82cf432f809297307b bfd/m68klinux.c -c7a2b0353c8a2b2796a66ce71991d2e7 bfd/m68klynx.c -c6fc3e1de6dc74acd4945b2190587398 bfd/m68knetbsd.c -32f14321dcbc5b8eda9a2510e3d906af bfd/m88kmach3.c -5de4da6a9169effb512e6ba4d014d420 bfd/makefile.vms -4755d408c8274e1ecccf6218928dcf14 bfd/mipsbsd.c -5971cd61d7c10702978519aa5ed41474 bfd/mpw-config.in -85bd791a2ac9c9d7c2bea1932665d568 bfd/mpw-make.sed -ffdf9f0b0e709d01320c67cbf89eb61a bfd/netbsd-core.c -08197a4e2682c16a478d1d40d26c3ce7 bfd/netbsd.h -7bea89213da645698442c08f787b5ef1 bfd/newsos3.c -5b5a6b2076f5d451f84fbc5e5593df79 bfd/nlm-target.h -3fe07db0117ce532feafa057cd418c00 bfd/nlm.c -6e68f62fb373e47b3b0483f78f68a61d bfd/nlm32-alpha.c -3cc80747d16f524a1fab743e6f4607cd bfd/nlm32-i386.c -67161ce31c23459c26291b06c5571132 bfd/nlm32-ppc.c -62934679d489e139b65d6474d4b85e12 bfd/nlm32-sparc.c -ad09e68167b48df24f238e874a31a152 bfd/nlm32.c -7d6920efa240ddfe625a9d076cd6510e bfd/nlm64.c -a37d20d7c5f95eac0ba8e72ddd34157c bfd/nlmcode.h -651e70e9dc3e8ab81ac750d642be169f bfd/nlmswap.h -8e9c830cacb3843634b4438619c73365 bfd/ns32k.h -9d9d06b881cde8a6f76df36b0478fd03 bfd/ns32knetbsd.c -603c5e4485d4073f712bde82f05c3ab1 bfd/oasys.c -d19472d4764ea44d34f0aa1ae28f8ea1 bfd/opncls.c -286a3a9d629da6889f1bd0222f046dd2 bfd/osf-core.c -359181d31e0067bb155f3130f09014b6 bfd/pc532-mach.c -28eb753042c518eb7613dc0c07a9d712 bfd/pe-arm.c -46dc4c0e41d9ac58d901ba24bf87ec58 bfd/pe-i386.c -eac157e8749a4d566f023fc73ad2701b bfd/pe-mcore.c -10af86983af7f89f498269be562242dc bfd/pe-mips.c -2408372ef3e1635e1f21849c2df91516 bfd/pe-ppc.c -8a9f5341f8b811ff4c9fefafa89a6f58 bfd/pe-sh.c -b1211436c28e181afcc8ff2ecf88cdef bfd/peXXigen.c -9631d64e8b1f1f63001359dd94506a91 bfd/pei-arm.c -351655074548989187fe875754b59a71 bfd/pei-i386.c -dbd6eb2c16f6c94bb0d3af6970467b5c bfd/pei-mcore.c -ea8a74b5980841010a185ebd539e874f bfd/pei-mips.c -f15a63befa27efcdbcd3711ecddd89a2 bfd/pei-ppc.c -46016926e380a707142c8078f62dfb64 bfd/pei-sh.c -c6ba7bb0aee2254c824408f4ebb1bafe bfd/peicode.h -135fcf4f350b6df18bc13667f0877ddd bfd/ppcboot.c -2646e6098d56703b47e5dd24f142f9f9 bfd/ptrace-core.c -bc3a5994f67ded8dd965a8159c3e04f5 bfd/reloc.c -1429ff69337a27fc5e5947c011bacf7a bfd/reloc16.c -d05920c33c8e35c43e6b22ff14b165e3 bfd/riscix.c -0d2c4a7c00dc63b2739abc22c82cfdf1 bfd/rs6000-core.c -98fb2a13f09a7833c9a8cb6d998d55b9 bfd/sco5-core.c -a80fa7325ce9c43ab3c9df9eb86a4e53 bfd/section.c -946a61fb3971a2703997a3e24da9efaf bfd/som.c -f4cab5ccf3d2f6c08f1a0665bd9a9a3a bfd/som.h -bf0c4c812e4319f9fc2891c1ddd22524 bfd/sparclinux.c -795fae048517419029a27b49302244ed bfd/sparclynx.c -ea009eea5d4bd499cfcc6ec25ff8d083 bfd/sparcnetbsd.c -9c5d025db2c856faa1cde13845fe0d6b bfd/srec.c -891289f18ef687556cab8f090331e3fe bfd/stab-syms.c -05ff64098a17cc71f4e623323c2262d3 bfd/stabs.c -1ded054093de910d9786c62bc4fe8cc6 bfd/stamp-h.in -5003da336bebe34495f3eb23f11e8530 bfd/sunos.c -ca78ceb2375111f455986ce25f607e87 bfd/syms.c -bcc86dba28f942df39328408dde24d01 bfd/sysdep.h -d143a64c16594367d7b4034951a1d553 bfd/targets.c -26dac42ee68d1de97152743dd098bd83 bfd/targmatch.sed -7c96f19a6c01b1b4704c8f7915c46a19 bfd/tekhex.c -6aeb10d91a1614ef27dfed54c94ecba8 bfd/trad-core.c -56c006a80866e026335d4db420be7516 bfd/vaxnetbsd.c -70319dc6d45749efd52f9d1393f1688c bfd/versados.c -62552477c5cfcc583cbfdf6da1be2cc6 bfd/vms-gsd.c -03148dc2fdb5f8b2fa0378995908c3ec bfd/vms-hdr.c -9e245904fabf6630c8137c37a2908027 bfd/vms-misc.c -cfe21991d8cccc770d34b0dfefa351fe bfd/vms-tir.c -a953dee93ee3269e5a0d2f0eddc8517a bfd/vms.c -ee46c5eaac647cd1d1685c506202d18e bfd/vms.h -4772c3a29f7fcc7d9c10f1e42fa14cf5 bfd/xcoff-target.h -71e5116d9e043a87784b978c63b82b2d bfd/xcofflink.c -74b9e8377ce5ef7f2ad8914ad5e1dd41 bfd/hosts/alphalinux.h -6626deeac79edaa6eef30082a4fd9dd4 bfd/hosts/alphavms.h -70e1a59995604c3b804469fa27b92d94 bfd/hosts/decstation.h -7f90b6f7c21bcc67525386bdb9399540 bfd/hosts/delta68.h -5a75f0a8518cdf994c6837632317650a bfd/hosts/dpx2.h -6d9ebd0f91f9085690638821e2ce67e0 bfd/hosts/hp300bsd.h -50735617194ee653f1cf99af40a7dbc9 bfd/hosts/i386bsd.h -c3d90b1a06731c814d89371f91583bb9 bfd/hosts/i386linux.h -90fa9751fedd9623f399b8bcd6a646b3 bfd/hosts/i386mach3.h -09a90ebd4e56bce95e72a93c6274997e bfd/hosts/i386sco.h -1d13cbc7201d1b35dfd2353027122d33 bfd/hosts/i860mach3.h -779197139aaf874e61ef9339cdf7df30 bfd/hosts/m68kaux.h -c40f7966cbdb0fac0b4366c9c61eac06 bfd/hosts/m68klinux.h -2563c4d1fef8234619b1c2007dfdaf90 bfd/hosts/m88kmach3.h -8fbd4bfd38ea85aeedac03e1962242dc bfd/hosts/mipsbsd.h -f61dc4a9a9a665ab9fba6861214bdea3 bfd/hosts/mipsmach3.h -d4e865701ae3a5149a05ff92b2542e94 bfd/hosts/news-mips.h -2a46cd81291f56275932a241e022f567 bfd/hosts/news.h -21af1454d516fbfd996f6d6bc3b8db9b bfd/hosts/pc532mach.h -2440e7cdd4e85ead6516650e1329bd0f bfd/hosts/riscos.h -31fe7c1b8aaaf0174c5fe2ef83298ca9 bfd/hosts/symmetry.h -627775bbea4f1d59b97edfa80e81a259 bfd/hosts/tahoe.h -1214020ec5befbef1dda50900deb4740 bfd/hosts/vaxbsd.h -9b476271b3bc5815a37f6b887c092090 bfd/hosts/vaxult.h -9b476271b3bc5815a37f6b887c092090 bfd/hosts/vaxult2.h -9fd8ff8120f96817fe7b034b4ed9b4f5 binutils/po/POTFILES.in -bfb5c178c2404196ab54d7532a61e3d4 binutils/po/Make-in -0c3e2088c29f5140c34d4c1a4cf50efb binutils/po/binutils.pot -327a79cbc083ebf99b8c70353167405b binutils/ChangeLog -2472bb0eaaa74c1313fa692818c05de1 binutils/ChangeLog-9197 -14304b5ca4a2273914dfcad6be18564e binutils/ChangeLog-9899 -13eece6d011b883aa4547d6456769697 binutils/MAINTAINERS -f4074cf64ffef103687013a2e96d6fd0 binutils/Makefile.am -0ceae7f8e4364ac489da69717c9bfea0 binutils/Makefile.in -abacc206a632053405f9da3d19f357c0 binutils/NEWS -d3c110ce10986acf5652bcede3ba5d15 binutils/README -949ae831863e3d2d546a13e90598af7d binutils/acinclude.m4 -c76743519e57c546f30f57013f446bec binutils/aclocal.m4 -c1436a898294a0066903a5104d59658e binutils/addr2line.1 -c1296f6a626273f10323beba4c496201 binutils/addr2line.c -98881d2c88484e6af6d780a96771be58 binutils/ar.1 -a04cdb2cef55746e411d28760663335c binutils/ar.c -ffbb491f2776bf07259287e518ab943e binutils/arlex.c -65306c2e52d8644d8b373eaa39b24062 binutils/arlex.l -ca083bf7f778d5c3abb4dcf85f7fb069 binutils/arparse.c -9f796192da100ab75cc8e8986cf5ec9f binutils/arparse.h -5e234398e134240a685477dd35dfa867 binutils/arparse.y -42e0a4af5d75962dbed3ab8c34b5c3f3 binutils/arsup.c -0bf4eb9b7b9f8964c5d0aea4f501ea70 binutils/arsup.h -f443d4e0d5c81d99f3ca85c213929794 binutils/binutils.info -3d7f73b3f96ca7ba3a1ffb206393592e binutils/binutils.info-1 -519fe824e3b2fbcba9e27c543f16cafb binutils/binutils.info-2 -df7e54f71f2886c89077e97cd576f7ac binutils/binutils.info-3 -4e2cca724195b6b7503bfd507420da3b binutils/binutils.texi -84e127713d45f096f8b6a23cf646e73f binutils/bucomm.c -fb0535da62e6833d2db9abfc40161404 binutils/bucomm.h -6e32645619af004d54c2b09867e2bed8 binutils/budbg.h -0b097861a14f344d75659c82a0329699 binutils/coffdump.c -712cbcb633b810aeca514045f7a091cb binutils/coffgrok.c -727709ba9f525b95a78b7aa3453baffa binutils/coffgrok.h -4e92063f698d7013de0286ef44322816 binutils/config.in -4359fdef33618e0323337df0588c5cc3 binutils/config.texi -ef0db6edcbe0610762e2414a9cfbc8a4 binutils/configure -0df24a539b5dcfb1c9b147d28b80e05d binutils/configure.com -b3a87f9e52b1cc40780b932ba7ea9909 binutils/configure.in -150a0434297702b55b12a72ee3836b4e binutils/cxxfilt.man -bd5c323adf047cfa77d61ab3a1d30948 binutils/debug.c -d067535d0ee0e2dfef7c101ae9ed5afd binutils/debug.h -52960f8f6f672312531d1cdcb4bde2cf binutils/deflex.c -f3bc4c49528dbeb97029c901b2a1cfeb binutils/deflex.l -a5799c90522edb7749356475e2b3c076 binutils/defparse.c -01fa40dc7e4ed75477d60fe6853be93e binutils/defparse.h -4f39891c79936bdfb4f03bb4b5cd1f39 binutils/defparse.y -fb7920a70d8eba8b94fd446da371604e binutils/dep-in.sed -826fb11427b3c2ce4aa0d35d57ebfcdf binutils/dlltool.c -fcd4c7531e0ae0b27cc707d49df82bda binutils/dlltool.h -2d6e186f8e50d1cfd2dbb2c6d77aa25a binutils/dllwrap.c -d7bd6f5d07c781caf5cd1a0b20633900 binutils/filemode.c -321ff0d85aa4e062bb891eba8f971734 binutils/ieee.c -4d04341c680f1136f390abd07d49caef binutils/is-ranlib.c -920b2431a9bafbda1144b22258327b10 binutils/is-strip.c -39ac662d88dea0e279c66fee67cac871 binutils/mac-binutils.r -fb2055ce0e0f73de2e8df95cc40641d9 binutils/makefile.vms-in -f82d9835fa96d421d65a5ea7f5cb5299 binutils/maybe-ranlib.c -aa064dac8c2147d98b05609a47b80ddd binutils/maybe-strip.c -1d9d64c1d1409968c8f722c009b71b32 binutils/mpw-config.in -2ccc0b509ed732287996815f4ec3bb81 binutils/mpw-make.sed -3f9006583fe2a2baee6469944a4d6c06 binutils/nlmconv.1 -d13531ce33278c0b9469db895bb1d7e8 binutils/nlmconv.c -cf949369d105afd57bab40a2101f089b binutils/nlmconv.h -43f2bf49637f73763c155357169d3d6e binutils/nlmheader.c -3426060b7fba0ed0184a410e33bf7fd3 binutils/nlmheader.h -5fd07036b1458259b61aba4be0b68831 binutils/nlmheader.y -216a9371bddca8d4638e129ad21a4337 binutils/nm.1 -59f887c696b56a5fd7c47faa4e031d81 binutils/nm.c -b3c63de023675571764212902c24ee77 binutils/not-ranlib.c -7b521296e81503ee1a37cc77039dc203 binutils/not-strip.c -30b1bb7f3abcfa73a3c6b4b059329712 binutils/objcopy.1 -fb8a2b8519754c33584893536f1c9600 binutils/objcopy.c -542a5564ba0a8082d59cdcdc8151c665 binutils/objdump.1 -8c9fef7b45cd7432093fbf89466a225f binutils/objdump.c -f9e36e9e0cd55ab620e09fdebeca42cb binutils/prdbg.c -020c2cec49a443a1b1865f95077e044e binutils/ranlib.1 -bec38036243f76c13fa87b092c0292e4 binutils/ranlib.sh -352580333a5a5446ee5846eda6ed72e7 binutils/rclex.c -d482dbfc392432a79f29b921679073c2 binutils/rclex.l -218b925653d29f7fa28c0f4a4a7f7423 binutils/rcparse.c -0bb76c3e578d61500674d6fafb307be3 binutils/rcparse.h -df9b51d3071dfd3be7e34e765bbad589 binutils/rcparse.y -ddd9b9d17599b40e8eb39c954503ee6b binutils/rdcoff.c -c13b08d97206def27a7f8612f0b73e89 binutils/rddbg.c -32295c33f18819cfe0d40d7f75213dc2 binutils/readelf.c -301dda393ce6198dab5c0fd289e3d333 binutils/rename.c -d128d999bb8a16ffc6c6a8d10eb05a41 binutils/resbin.c -616cbfbe6d9e4a292c807f7fd9b8f993 binutils/rescoff.c -2560f6c6d92efe9cac783ad2ac24e13a binutils/resrc.c -e266faaa14043a879715b85dbf53d48a binutils/resres.c -b62e62e9c7d29e37c5968c1a005f3eae binutils/sanity.sh -e0d20337f2d99c6f1546cc14750c2af7 binutils/size.1 -c74508b4e2d421b3e011e4334742205c binutils/size.c -f56f7d79f8b8754d1270ad6c8e2215ea binutils/srconv.c -7bdd8bcf3f73100f2ba7a7455c04ee39 binutils/stabs.c -1ded054093de910d9786c62bc4fe8cc6 binutils/stamp-h.in -0548ad6ecd51c170effca26be02c225b binutils/strings.1 -b9c4d10fa3fc66eaf6fb3a525957d563 binutils/strings.c -d2c537d036457e8b2a8ec56ea0a37a60 binutils/strip.1 -35812e6671c0dacf4b209aedd62cb242 binutils/sysdump.c -e5df2443c5572a565ab25e875341c257 binutils/sysinfo.c -c872c0449117476453fa1156a4ddd4fe binutils/sysinfo.h -b5558d092a056006f557bde14786e7f3 binutils/sysinfo.y -360e007536fd5fc8211a294bbaa1a8be binutils/syslex.c -58ee0c7157e6cd1f73af7ae76033054b binutils/syslex.l -2a0d9dfb5514c6c076eae77e837c9418 binutils/sysroff.info -bc126ab62a0177393350b365f3a5e40e binutils/unwind-ia64.c -836ad638b88e86bdb20e53e885f778a2 binutils/unwind-ia64.h -ccedd336cd29294e43a17ba0d6e23c52 binutils/version.c -195751181452e4a1a8f04ec25db22e71 binutils/windres.c -6b39b8d57876e2116d6cc9a25d095196 binutils/windres.h -d5e5a7f1ce5f0bfdac6677f94363937b binutils/winduni.c -656d6daadd2719e5d0c7fe398114e95a binutils/winduni.h -33a17a3bd3de007bd19f721d6499f665 binutils/wrstabs.c -34d0ab842ffa4318e8cbe2bba4c565dd binutils/testsuite/binutils-all/bintest.s -769e0d6ed347b047fb2540949475d543 binutils/testsuite/binutils-all/ar.exp -a1f33ff9c6d058fa281146d85da8a7ad binutils/testsuite/binutils-all/objcopy.exp -d58edef3a25f7729b8fa76f61a2c9648 binutils/testsuite/binutils-all/nm.exp -8e5c9079f46f332db8bbe679b64c878b binutils/testsuite/binutils-all/hppa/addendbug.s -d91ecc8b2ba6965842cf206d8144c3e1 binutils/testsuite/binutils-all/hppa/freg.s -4412faac86e3f31dd926f7cca1b34fda binutils/testsuite/binutils-all/hppa/objdump.exp -8c020e9f1b3dd06718965e6a68bee100 binutils/testsuite/binutils-all/objdump.exp -c6a30881e7a8df05c3769f70c797d338 binutils/testsuite/binutils-all/readelf.exp -fd5d39184621cf8c2e7ff6b2404d299d binutils/testsuite/binutils-all/readelf.h -25d9186ef9252a2db8ef03ad11337e1e binutils/testsuite/binutils-all/readelf.r -93a710740488294f2458be7b750ccadb binutils/testsuite/binutils-all/readelf.s -e597a5420641d9d64c21fee25118b7cc binutils/testsuite/binutils-all/readelf.s-64 -b1d2f987e8bc3b99c2f25d3b1ad0ba7d binutils/testsuite/binutils-all/readelf.ss -22c83167f1761586e80d622551da44d3 binutils/testsuite/binutils-all/readelf.ss-64 -04ab5a3452defc08311819709f841b07 binutils/testsuite/binutils-all/readelf.ss-mips -99e8a65be94223ecc838421b47b19c49 binutils/testsuite/binutils-all/readelf.ss-tmips -ea24bec237106a0e7811279341c8ad4c binutils/testsuite/binutils-all/readelf.wi -472ee848e6a70cc6a512a388ca695d58 binutils/testsuite/binutils-all/size.exp -96869108191b6a2bfb097357132aee71 binutils/testsuite/binutils-all/testprog.c -3be37588c17084be375a802b4d40388e binutils/testsuite/ChangeLog -9fdd25912eef439ee83ad374bfc5a271 binutils/testsuite/config/default.exp -332890f8e08b7aa8c60bb35f6065c211 binutils/testsuite/config/hppa.sed -6c8f3fff368112453697522201a340ce binutils/testsuite/lib/utils-lib.exp -bf1e177862ddef9aa6970474ca011825 config/mpw/ChangeLog -43d2a9ca5ff1a5f5acd3390b7b082830 config/mpw/MoveIfChange -d9387d651ddbc91875c97259d0fc35af config/mpw/README -a31a49fd4c06ba2b08ff299cc2cfac0d config/mpw/forward-include -a9ee17c3900e8edf08a3cf209a87cf2d config/mpw/g-mpw-make.sed -df7cf8189011eae6ec32c27a268ebc06 config/mpw/mpw-touch -082758f13e230f38a846e9017ee6025d config/mpw/mpw-true -39980e1a3d29624ec94a6df2dfb8dcd2 config/mpw/null-command -71b670c5a9868b2833972721f73578e0 config/mpw/open-brace -7588b51a118ab73de5d6a3ba0fc1e47f config/mpw/tr-7to8-src -082758f13e230f38a846e9017ee6025d config/mpw/true -02a96b04d8fd1586bfca132bac4e1a4e config/ChangeLog -70c03dac891f6bc7d806b9427b31bc86 config/acinclude.m4 -141167afa246fce5e59bb9e55cfb2fc8 config/mh-a68bsd -2b5476085f7589e173bd81316a7549c2 config/mh-aix386 -57925a69ccb24ae7ca7cf949a07d26d3 config/mh-apollo68 -9b65dc7f50a7134932aa278ac0378703 config/mh-armpic -8d82479feea57715325ee949952ae5e5 config/mh-cxux -ddde55c2eac58773f99aabb2f011e206 config/mh-cygwin -251cf9b667a963075140fcfa616f06da config/mh-decstation -a3dc79b2e3494813c3a0b352d2185c17 config/mh-delta88 -ab6f38194c18de21e5ac0761d0d6352d config/mh-dgux -615158832b3fca3cea2f51053e67590e config/mh-dgux386 -2738c9de2581bc9c2d21f48950b18bec config/mh-djgpp -9b65dc7f50a7134932aa278ac0378703 config/mh-elfalphapic -153649fe7fb621b814baad06a2bf299f config/mh-hp300 -3330f1730b6b4bb70b09ffe2415c74be config/mh-hpux -3330f1730b6b4bb70b09ffe2415c74be config/mh-hpux8 -9b65dc7f50a7134932aa278ac0378703 config/mh-i370pic -740855ebe34cb2d01fba1f1bcb4264cf config/mh-ia64pic -7add3042f79e57cdcb52abf304c26a70 config/mh-interix -25c3bd9e7778c2c5d799fb6f1615be3f config/mh-irix4 -ffaaae454726b7ec67de856093365ec1 config/mh-irix5 -bc99b6de866022c39cde3cc7eda83fe3 config/mh-irix6 -1acb83eaa6a78c587598bd7efc2025d9 config/mh-lynxos -6bace932d30f092a27fba43e01226c04 config/mh-lynxrs6k -740855ebe34cb2d01fba1f1bcb4264cf config/mh-m68kpic -7bb6a9aa44a68e1e71f76cf8b8c2d135 config/mh-mingw32 -44882b0820862d0e134a8e4e5537afce config/mh-ncr3000 -42f074ecc1191e9ebda8e447c4f46713 config/mh-ncrsvr43 -90b19906d7ba40a6e4b83efb959809c7 config/mh-necv4 -21c5c77600fd6fb58f378ef2acf0190c config/mh-openedition -9b65dc7f50a7134932aa278ac0378703 config/mh-papic -9b65dc7f50a7134932aa278ac0378703 config/mh-ppcpic -e263a8fdee36cbc610757f2317da3991 config/mh-riscos -ac3fc3e8d21f9f9fe83c4cbde3890387 config/mh-sco -c502a579b42cb78af2154966343f491f config/mh-solaris -fa84a282ce7cd6876d1eac368a31a368 config/mh-sparcpic -2e3ce1267c492dd862c48b59eab932ac config/mh-sun3 -278ff58db0fc6c75e1cd39ca2ad1acfe config/mh-sysv -a0992273a62d3448fe6ea65a74250899 config/mh-sysv4 -08516ddc97d1ada83d4bd631bd1964be config/mh-sysv5 -e75a559cf75354c524229f480b5f6e7a config/mh-vaxult2 -740855ebe34cb2d01fba1f1bcb4264cf config/mh-x86pic -f80e59daab2815b9faf70f2fe2f0ec2c config/mpw-mh-mpw -f60c118789c383f2548e2f8969513865 config/mt-aix43 -6eee2b9b80994128082ebcfb8285239d config/mt-armpic -96289d06809692c31d71e69c4bedb6d7 config/mt-d30v -6eee2b9b80994128082ebcfb8285239d config/mt-elfalphapic -6eee2b9b80994128082ebcfb8285239d config/mt-i370pic -4d21c96a048f825b25f5ecb7259866ef config/mt-ia64pic -9c9256a473bc2e1204e258e48246cabf config/mt-linux -4d21c96a048f825b25f5ecb7259866ef config/mt-m68kpic -2067ce86494ccb89791fe169eee8c198 config/mt-netware -5aa8f75c6588d513ce199e2e44c206e2 config/mt-ospace -6eee2b9b80994128082ebcfb8285239d config/mt-papic -6eee2b9b80994128082ebcfb8285239d config/mt-ppcpic -05fc6527f7fe0692e7bd51c24868c2a3 config/mt-sparcpic -4c029f499ccf3ba2561603b2a113178e config/mt-v810 -12b3030d3d59526c374c15af4f5944dd config/mt-wince -4d21c96a048f825b25f5ecb7259866ef config/mt-x86pic -8f1f7dafc590b26d22f3e597284f25b9 config-ml.in -e0d75b8ca062b8ec4eebf664aab1644a config.guess -306d551fd358a6363d2446486f1b8821 config.if -3a43bdabca8b9eca92530bb3ea2eeb24 config.sub -2523c7ca068da11d38e06af6347abce9 configure -0473df9cb9367e9c8a77c289a6f5f764 configure.in -e28364a0df955105a7f6898cc8ca366e etc/Makefile.in -213e80930c0be010bb250612af54775f etc/configure -e9b828169fe54bf6414ec1f4376af077 etc/configure.in -27fb25be358ff0eec0a44ac86f3872ee etc/standards.texi -fc8ef2abb184ab45779484c10d4d8d8f etc/make-stds.texi -a76594be1e11898d26d9bdf1f54af07b etc/standards.info -5ee7bcaad637e7010a2581db7927a16a etc/configure.texi -193f671ff984e81653741fa7c212a232 etc/configure.info -1a911cd9b8902678f64b5e33d457a8bd etc/configure.info-1 -ca127e48a13744e2fff22df3b893264e etc/configure.info-2 -1686cccb56366de0a01e848bfbfd9f22 etc/configure.info-3 -a20b40a0a5d3282f6a97c627be1e38c6 etc/configbuild.ein -570746cd93c4dae506cf2a6153a2a1b3 etc/configbuild.fig -f97ac2d5e05edeb335b73f8b6beef581 etc/configbuild.jin -b2851bb6d77822adc89ffc6d323b5fea etc/configbuild.tin -e67b330b1ad623f1bd3850483cd4666f etc/configdev.ein -c1f7c41d3e596256ab5f5f933a66293f etc/configdev.fig -8e14386548b8da4c5072aa2abea55886 etc/configdev.jin -32fc10cbdbf679bd0ffc8857cf069b43 etc/configdev.tin -e75bd9994061d19f9670d08acbd01eb1 gas/config/aout_gnu.h -a802dbfeda3550bfd22804228399f0c2 gas/config/atof-ieee.c -4027fb83cf42e6199aea0cb2526a06fc gas/config/atof-tahoe.c -14a0f251c1273cce5c62b3a5edfc3dab gas/config/atof-vax.c -09c324e401be218c9f9b18833e2bfd9b gas/config/e-crisaout.c -88c6165199c1aae7bd9c2733ad9a1847 gas/config/e-criself.c -8915ab931627c03103b8ff52bd2060eb gas/config/e-i386aout.c -4592324396b51379efcdefa7b75a17da gas/config/e-i386coff.c -90f70110e875b74bf055abc7f609c4be gas/config/e-i386elf.c -a153ff4dc91266991257426d1a9d7309 gas/config/e-mipsecoff.c -be51facd59d0de4cc60d8b0a64360795 gas/config/e-mipself.c -4f384db2ef30841ca0502269a3e8f438 gas/config/itbl-mips.h -5abd9bcd8f0e5ce25309035cbf3bc0fe gas/config/m68k-parse.h -869147d7bca490ff7f20fbe121715a99 gas/config/m68k-parse.y -0517b56ef366ac53f4921e66d1a85b2b gas/config/m88k-opcode.h -8d517bccecde0b721a58b01a14731bb6 gas/config/obj-aout.c -06b407be57cbacc7ba05787f8072be7d gas/config/obj-aout.h -84532c4badb5b5a414ea7366c240b1f7 gas/config/obj-bout.c -fdc8729ecc7985ac4dc9531bf8ef8e77 gas/config/obj-bout.h -a15d8ba751d3b7dbfb8b378a57fc7fb3 gas/config/obj-coff.c -c8c39016cef6730efd244c450075c988 gas/config/obj-coff.h -6e39bf9284bfa403132fbc486c0058b5 gas/config/obj-ecoff.c -39d1ce7b5d484ca95d660c2a1e4eebd0 gas/config/obj-ecoff.h -5ad09dc220a6763becd6e5916e939354 gas/config/obj-elf.c -34d18bd7dc155d66c4196ab7d06f7240 gas/config/obj-elf.h -fc5244809078292ed69543b590057d60 gas/config/obj-evax.c -409f2700494fb5da88cd17bd13787e30 gas/config/obj-evax.h -1a5fb62914ddd24d361b7b129a038361 gas/config/obj-generic.c -5697e716124f3115e85dea04de9597fc gas/config/obj-generic.h -9e0918da00ab277c95f9a2b9e4f5f29d gas/config/obj-hp300.c -7b4f9af8c88a8fddf18a0b0a2d81b0db gas/config/obj-hp300.h -6bee9b63dc974cdcfd38fc323627c123 gas/config/obj-ieee.c -c3c18ef4a1af26d29718ad6ce33cb4dd gas/config/obj-ieee.h -32d6ee58a1474027c5403a0fae7a9ba4 gas/config/obj-multi.c -9f5bf398a837e7a19947e088a9443b9f gas/config/obj-multi.h -16a236759175a5714c77962a358d3c5c gas/config/obj-som.c -80b8ff6d8f8c6f69b33d1a0275753fe1 gas/config/obj-som.h -8ea02b18794c00460bc81a2b8119739a gas/config/obj-vms.c -92be5fb47ee648292dfb0bc7ff27326b gas/config/obj-vms.h -c1894be92519dd48b0314109f1881012 gas/config/tc-a29k.c -c5139d88aed8bf2b090309497013dd6f gas/config/tc-a29k.h -211e99ec1bb1759368747760c893df82 gas/config/tc-alpha.c -33d0731b8586c060675186d139597c41 gas/config/tc-alpha.h -a8fc2b9440f26a722f34715f08991ba7 gas/config/tc-arc.c -081e35843ad7dcfeb68b50aedcab491e gas/config/tc-arc.h -e15ea2817e89bc3ad3355c2c7207cd87 gas/config/tc-arm.c -c920e78d25bbdd5900958e04709fd4b8 gas/config/tc-arm.h -463b2242e8e491564d5e0e1506bb06de gas/config/tc-avr.c -37d6caa633b2f7901f443b5307e8a905 gas/config/tc-avr.h -00c243430f9f2f60ab15245d6bd15e7e gas/config/tc-cris.c -c201f4750843a1fd322b38f8ed4e6bda gas/config/tc-cris.h -2f9c666879c01e30c44aaf445b1033b5 gas/config/tc-d10v.c -8faf078fa60927d88ed23dbd23ef1a38 gas/config/tc-d10v.h -c08f0392e2dbbddc8f04f0779343f336 gas/config/tc-d30v.c -8b7945ccc65e5da78d3a9fe09c2308e6 gas/config/tc-d30v.h -0ed0301072d2438031d4e222b3d06d57 gas/config/tc-fr30.c -ee4d3a84b465216e750f06b0fcdba621 gas/config/tc-fr30.h -d41d8cd98f00b204e9800998ecf8427e gas/config/tc-generic.c -eec169238b80630136c19235264cb04f gas/config/tc-generic.h -ad92b1751356945284c3450fe0ed00c4 gas/config/tc-h8300.c -801eb9030ae51576454343bceed3f8a4 gas/config/tc-h8300.h -312f280c2f4d500378edd99087c7ff98 gas/config/tc-h8500.c -664c496490b0f88854b345cb940eca9d gas/config/tc-h8500.h -f763378e31a8c10cbb8437e2513b53b5 gas/config/tc-hppa.c -4393890693232f88d07a9e1d76544d0e gas/config/tc-hppa.h -73d71eb5625c8cab823b05718dad8379 gas/config/tc-i370.c -50392712885658244102256d4333dbbb gas/config/tc-i370.h -1287427633324e0b6ef2563288452b55 gas/config/tc-i386.c -0d8b9453c5c2b85fbf52d5d18075bd5e gas/config/tc-i386.h -f8adb51ebafdb40f294def677366a81f gas/config/tc-i860.c -0b60639885f14b9d4262b1b5695e4ddf gas/config/tc-i860.h -cc609a2100c2e89d7c34c9e3a40cc3c1 gas/config/tc-i960.c -f46200f85ff3c2db7a0a88c7834014ce gas/config/tc-i960.h -1ef7e0b07d22b5947cce3237e4c99ead gas/config/tc-ia64.c -55a5ee0b822753196340782ebdb63fb7 gas/config/tc-ia64.h -2c414ce59771fab4925ecdf8d8c0fe68 gas/config/tc-m32r.c -1b6e3bee9d679bdad05dd205bee78995 gas/config/tc-m32r.h -a12bd005331953eec47146cd4b2fcbb3 gas/config/tc-m68851.h -eb109194d0009839d36ba51165ed6082 gas/config/tc-m68hc11.c -a298ed6402724d90e5b8edee560a6a7e gas/config/tc-m68hc11.h -023972affb12beccb32294a9a1908d65 gas/config/tc-m68k.c -20302dc874a9489ce7bb7a38876de1b3 gas/config/tc-m68k.h -6d621a3e526cc0a6d2b657dea4a2305d gas/config/tc-m88k.c -107c3b50693b48561ea3e1f21427f814 gas/config/tc-m88k.h -ef5e629ce116e621dcfdc2f24c9f2511 gas/config/tc-mcore.c -79faecc51abb67e48eac14101fa5f41b gas/config/tc-mcore.h -720b0edaa61cef121c857642cf070877 gas/config/tc-mips.c -f1f594c95b827a8e431f1a7fad5fdca5 gas/config/tc-mips.h -851173367f8b9e7ba049651482357a34 gas/config/tc-mn10200.c -a1d9a4975a26d18367a870bcfd757ad0 gas/config/tc-mn10200.h -15ecdb549363635ad76b2c3a86e700de gas/config/tc-mn10300.c -7f67c8f56a13301960fd818cbbfabcc4 gas/config/tc-mn10300.h -b00eae3c8b6829291b629c31015075e2 gas/config/tc-ns32k.c -2de740c8af5873b4d86571cb87a4278f gas/config/tc-ns32k.h -47f42d9d2b0868e4b8f317101b0c1684 gas/config/tc-pj.c -8dc88fa36c8ae8d4d6dc0dd424b15154 gas/config/tc-pj.h -e53e90d9045ed48820f1b5b07c98bea2 gas/config/tc-ppc.c -801e811b0a3d378913351cdb8556d0c6 gas/config/tc-ppc.h -b9bde6879b21d1fc21732d1c17b243ea gas/config/tc-sh.c -23301ea5ae6486c30131563f56983c4e gas/config/tc-sh.h -2f6a18c71d581798af6ef0148f863c4d gas/config/tc-sparc.c -845af70a42df937b9ebf4c1d19002d75 gas/config/tc-sparc.h -745fe32b81053e3b80ecb325654425ab gas/config/tc-tahoe.c -ffcd4331c7d6d28e97466a66f3620f2b gas/config/tc-tahoe.h -bc08cecd35802bed257d11dc5ee3aa02 gas/config/tc-tic30.c -172636d7d3732eb57c67ead9709d4d96 gas/config/tc-tic30.h -9d9818beb4f8c04429d8442d1624be53 gas/config/tc-tic54x.c -8797523948d01e18fdd637d6dbe36d4d gas/config/tc-tic54x.h -82c9a73a973825d66c344d6e271f4174 gas/config/tc-tic80.c -a8de106e568896428baa8b248f1f7d8f gas/config/tc-tic80.h -dd5e427d8cac9e551d263fddc7144024 gas/config/tc-v850.c -5ce308c35dd719428af4510cb7adde41 gas/config/tc-v850.h -f9107adcd738a440490415bd12bd5db8 gas/config/tc-vax.c -a782b0af9745557989f35bb76a300bc8 gas/config/tc-vax.h -6db1110e7f9a9f839c5bd245aa8b3b34 gas/config/tc-w65.c -7ce6ac4d03348c1102b1d6e4308bf1e2 gas/config/tc-w65.h -3e5bb9333fd37bcbbfc45d3b918e79de gas/config/tc-z8k.c -b985cc503b319a201bc0ddf5a2e9cb23 gas/config/tc-z8k.h -40b4f0d89e0f7a47828f7e6b2eb98cf8 gas/config/te-386bsd.h -0d6f3b4695c8a69980eef0635a4b376b gas/config/te-aux.h -904c7780c93025e1c16bd7facc5eb6d5 gas/config/te-delt88.h -c30935955b6e3e593aec0c121bf741fb gas/config/te-delta.h -47cd21925072d94dd095186c5202b92d gas/config/te-dpx2.h -fbce03dceb71bf68d8c872bbb69b35aa gas/config/te-dynix.h -7e2acd95eb4766b4530cd90d5da12e11 gas/config/te-epoc-pe.h -4215a65e5e9aaf52a39c0277cec05a06 gas/config/te-freebsd.h -9677889ebc4d2d31b7cf1d99bf884883 gas/config/te-generic.h -9c4b72d5db2a3b58fe216e98e5d1604e gas/config/te-go32.h -fdfff2ba26de59e5e34124666bbe255a gas/config/te-hp300.h -e2bdcb851ea04db026cbd75585ce50c7 gas/config/te-hppa.h -ffe54b5f97c4c93a036fcb434b0e2ce3 gas/config/te-hppa64.h -8a89d0db3087edfef6adb3d11e461332 gas/config/te-hppalinux64.h -37ed6767b7669c59a6f01cf229bb2763 gas/config/te-hpux.h -c5c5a24aae2ba252078a1e9aba6f29dc gas/config/te-i386aix.h -48983355f44a1998351bc155fe48f093 gas/config/te-ic960.h -19b403b208d810d952e172e14e5ccc4d gas/config/te-interix.h -4cfb2f20ec1301d37e9ff374e46317ce gas/config/te-linux.h -0525817b2f140459473072028c30da2b gas/config/te-lnews.h -2d77aec1c4985fc5f3a8eee88e95dec7 gas/config/te-lynx.h -36d49af0e764532aaae5a64d2c046790 gas/config/te-mach.h -9f70e9ab23ffcbdddf605e1f7b9479c4 gas/config/te-macos.h -7adae751b97b48a10ca1f8483e539d6b gas/config/te-nbsd.h -42e509551b9c1e76f3a8f4621d2eee03 gas/config/te-nbsd532.h -c34e9c2b58482673113e11fd998598c1 gas/config/te-pc532mach.h -158cb175a491e482d6e0d3412b0bb216 gas/config/te-pe.h -a9cbae48ef62e7a20c33d8a94c576b4b gas/config/te-ppcnw.h -a8a052866cd9c40ef31c0f4eaf7d653f gas/config/te-psos.h -0ff6629cbf363fc1b3d16c4ee4877f1c gas/config/te-riscix.h -4e442b2838e599466e9cc0fa346021fc gas/config/te-sparcaout.h -68cff7532af5d9dc4f8678dbd215506f gas/config/te-sun3.h -589c88a6aa89ffe655b1f8924e13bbd6 gas/config/te-svr4.h -667553559949ecb7bc468a6fda1003f4 gas/config/te-sysv32.h -5e785cb6f9a16599434f78b525b2a943 gas/config/te-tmips.h -5dc896f3c45078f34974fe05fb94ee3e gas/config/te-wince-pe.h -6599faa23572d356256aa616b013c64d gas/config/vax-inst.h -fd1ee35049f9bb5ca0b5b40b8109e49f gas/config/vms-a-conf.h -ed8248ba3c34b041f1d8942b285d6196 gas/config/vms-conf.h -cf987871e5d5e86f6aa12afbc89fc785 gas/CONTRIBUTORS -ceab81aa1f02825092808fdafba0239d gas/COPYING -49b0c513e9e8f5c5f2d0f7a71435c914 gas/ChangeLog -416a26a1162590c860fb1fefffc54cca gas/ChangeLog-9295 -6d8b241f06f94a04f180294552ee41a2 gas/ChangeLog-9697 -f577af562fb6cac4e22d6b5ae67235ac gas/ChangeLog-9899 -d618facc3e8ce8bf3d02ba452e1be6ab gas/MAINTAINERS -c7d8894c1b4cae0cb9632c80b08092d7 gas/Makefile.am -4f2f7020e0b422aca1cc93158938388e gas/Makefile.in -d9a8e0c26cac87a5c4618803fe69ecde gas/NEWS -0ed4366c2ef5bde49890368940dc9fa3 gas/README -e8b1e941cbf0b441da52f38fd2ea9725 gas/README-vms -c66ab308e6d86fac0000d1a9322838b1 gas/acinclude.m4 -43e54453976ff55cd63629d58e04fc0e gas/aclocal.m4 -0713cc4c7ba088fb707c5ccf5420b551 gas/app.c -44c182a81fe50344e603258add9cc6f4 gas/as.c -ce2e7980d3ce0ebb9027297f3059e8b2 gas/as.h -70eee11ef3b99a2aef25cc4e5355cf38 gas/asintl.h -a13029645c6a330d47f64661c7d7e472 gas/atof-generic.c -75bf496ec970dc9712e80b4a5a4af824 gas/bignum-copy.c -c096b326d8cba2abd6ece3ebb29df4c1 gas/bignum.h -00240c3f69e4d6cafdf8b729e6e84d6d gas/bit_fix.h -8fa009ac31ba211585c4f4ad3f80bed7 gas/cgen.c -f2b1a3d53180488da57702ce8d6257d4 gas/cgen.h -65dd281f88f92212b81bb354359b3336 gas/cond.c -e46511c2ddcf00256c007081122f6678 gas/config-gas.com -039f9a3e0b0fa261d5b5c272be4422de gas/config.in -d9692a1b832b0d71391ac34ad78b1b49 gas/configure -aae9c95aaea1df86eb2621b27ed3a99a gas/configure.in -454732b991bc3adfbaed197eb7e87709 gas/debug.c -402433baaaa08f73e6ec935228d2e751 gas/dep-in.sed -e3fd8ef3d3d26dcd037e9bc72b5f1c91 gas/depend.c -4b78ba859f531df84c9d04ba0eadc95f gas/dwarf2dbg.c -191371b169a1a50bf4cfb6e95875f083 gas/dwarf2dbg.h -05e52c03f16bce065122a178cb04f2bf gas/ecoff.c -2ade498ef51a01b944ba9620a2f803f3 gas/ecoff.h -2c00a55daccea8fa31dd514eb9ae7b95 gas/ehopt.c -57b3fe37aafdffc79479ab3da84f901e gas/emul-target.h -305fc57eaa656bac0b150bcc1ca2538d gas/emul.h -c08f06fdeb6fc93631a01d7b53dd846f gas/expr.c -03b127e2410c495a62d3f43bc0351b5c gas/expr.h -35c5208ec46fa524456e2a41c18c67d8 gas/flonum-copy.c -88bdca4528df9b542227513c3617a0b2 gas/flonum-konst.c -2aaf2ac6e8260efb36ebf67b54ac6a78 gas/flonum-mult.c -9b9175f8704d4952a56acef82dd58f85 gas/flonum.h -6727bca8a71f454d76057aaad0b98707 gas/frags.c -8584b7ba7291c886b9db82ad72401cf1 gas/frags.h -49fc4a865d0a8dd8d46951b592d50ebe gas/gasp.c -f728bf7e9df39918cf8c7467d5fa7478 gas/gdbinit.in -00715f54f0585d4c32ab362142dac7a3 gas/hash.c -ef6eb8d70fe48af05178e9af3ed9448b gas/hash.h -e94dab0cc4b68a0ef5ce9dfdfcb09984 gas/input-file.c -0df025a05b963cc8d9a890a686c92334 gas/input-file.h -acbcd05187266da779112cd208f312f8 gas/input-scrub.c -af2dde296a48962feabc18ea603b9480 gas/itbl-lex.c -637856676a2c5e17d45ca48ee4d1edfa gas/itbl-lex.l -fbc898da80a636f469f7765a1c6d50d6 gas/itbl-ops.c -5ae99999af9ac5c1850c36b5f4921be9 gas/itbl-ops.h -8568d6f215619a4ce44c36e32a3e65ff gas/itbl-parse.c -04faf433a35cef1d6b5e9f445aaf6acc gas/itbl-parse.h -b2285f69b5092425e6fa8b4195130f66 gas/itbl-parse.y -c7fe4764b8aa7ac76eeed0a1de98a8d9 gas/link.cmd -687e8b5eb64646e802334fd785512a73 gas/listing.c -fb844327efbb1aeae5f388f656026f39 gas/listing.h -adc284330e8a889f23d9153dc9eba7ad gas/literal.c -962769307588bcf7e9b053afaf508395 gas/m68k-parse.c -afe7080b22bc9b5e058f473469ced030 gas/mac-as.r -b4edaba52caffcedfa007bea5a46ef73 gas/macro.c -9f90a230cb447aa332f3dbf23af429da gas/macro.h -b905aee5c2a099f7d2579459121c7e2b gas/make-gas.com -c3cd93b34bceee0379472974735c6f6b gas/makefile.vms -5ab92a359045f71aec9afc090f1e9ec8 gas/messages.c -829e2d776ea96775c8298d5efddc22e7 gas/mpw-config.in -3c7892f4cb73a22801aa4656e36bb469 gas/mpw-make.sed -d5ef56b704245ff8f113091d867f6c6f gas/obj.h -e09da02faa41e17d061587cf2e6df050 gas/output-file.c -afffb943b1ad26344f206ee6bc357279 gas/output-file.h -486dad21992ef1bbad46ca481351cfdb gas/read.c -aea4edd3f3a9223bdd7b719e6aa46390 gas/read.h -e7258e74de805cdf31e919271531c1b7 gas/sb.c -cff195f2e145a3038579a1501e9fdbf5 gas/sb.h -5364361aa996d6ecf5f78a55b3110b8b gas/stabs.c -1ded054093de910d9786c62bc4fe8cc6 gas/stamp-h.in -dd55eb01ef944ba463cb2ce5f34a7647 gas/struc-symbol.h -f0b4d340f2ea14f0b248792e6c103174 gas/subsegs.c -260af34792338267f3927dc44a3a8197 gas/subsegs.h -752685a6111312f1187d42e7aa0b930b gas/symbols.c -e78b627a67a43e407e6cc9d3966e6474 gas/symbols.h -1da751d730b752f86eca5aaa24c563b2 gas/tc.h -df57d3e0b2752e5caab5294b3acee98c gas/vmsconf.sh -88a4db7edc70e897c4a8923cbf78bf68 gas/write.c -78b058a7d893939c2ab422c2e85789d2 gas/write.h -bb547fe62002b67ae96d3c52f72f9de2 gas/doc/Makefile.am -2423cc0876c2510df60a5275b0bdd5b0 gas/doc/Makefile.in -be60028bc97199721b146eb35125cc2d gas/doc/all.texi -41db9086dadd0f035d15cb3d92bd1203 gas/doc/as.1 -362e4e8e3c9ac37b1cc1148df43222f4 gas/doc/as.info -85161d87cc0e0d4297787c63456db47f gas/doc/as.info-1 -b81884593f4f05d264946d7a4891701e gas/doc/as.info-2 -b2d9e66a77e2e2986070575c066816c5 gas/doc/as.info-3 -26ae00e2c16b261a3a90dcb8cc4d4da7 gas/doc/as.info-4 -a696a5ced8c5d881f5ea63097dfc0597 gas/doc/as.info-5 -e09cf158c7e7cb65bdee3eebcff58ff9 gas/doc/as.info-6 -41fe1393b25845f0a16585f076c52f3c gas/doc/as.info-7 -94705e2e9f12c6ec33493e5dc00d4343 gas/doc/as.info-8 -94123531607079712cdc98925b407eb0 gas/doc/as.info-9 -2fbd5270dcebd346a0991e021a6f8915 gas/doc/as.texinfo -a59215bdf94de57a0285409852af014d gas/doc/c-a29k.texi -e01a5d41dd1d11b839b779cf991abe7b gas/doc/c-arc.texi -6c7a0c6eb13ad819b865fdca9b883da8 gas/doc/c-arm.texi -5dfb627124dfb35ac44d11fdd435d36c gas/doc/c-d10v.texi -670a3dc2d7f147e973d1540d3e02059e gas/doc/c-d30v.texi -6e93279725365b5846b332617955f22b gas/doc/c-h8300.texi -1e370e38bad3cf84368e988413793571 gas/doc/c-h8500.texi -4dc0aab471ec88e9f732b465812e10ab gas/doc/c-hppa.texi -517ef856eea39abb37275974217b7297 gas/doc/c-i370.texi -5e674e1c182709037cb3536a60efb929 gas/doc/c-i386.texi -e8d13a43c909238a5916ce17e31d3ea5 gas/doc/c-i860.texi -42b8ac98b598dd6f2ece88fabb284af0 gas/doc/c-i960.texi -147c08afa3ccc82a2d9485e5f1a59317 gas/doc/c-m32r.texi -fb7536ff2e6681fa34501b7c320df664 gas/doc/c-m68hc11.texi -e0de947758a2e436eb5d00cb411666b7 gas/doc/c-m68k.texi -5be2114dfab16f3522fc347cd44da217 gas/doc/c-mips.texi -677a7e5662a701c8a5f9d82943f36257 gas/doc/c-ns32k.texi -b12cf56f6b45fa508ec963382efcc726 gas/doc/c-pj.texi -a3350f042ea6b18add50514707eb5d13 gas/doc/c-sh.texi -c87b3dff39869ac245c49a82edafb776 gas/doc/c-sparc.texi -29f6dccc43df1302dedd26fca1c362b1 gas/doc/c-tic54x.texi -f5679aeb7a13f072790a4cd15c511019 gas/doc/c-v850.texi -6d7f87c13f69ca2595e95c9eab762d92 gas/doc/c-vax.texi -5810de21486a935844319423d7a6e9cf gas/doc/c-z8k.texi -79b45497aca1b0c05295f8f2faee4b6f gas/doc/gasp.info -8ba1c8507b412944e6c7bdc67da6d964 gas/doc/gasp.texi -4359fdef33618e0323337df0588c5cc3 gas/doc/gasver.texi -73b674cd9bd9d15802cc28334b6a25e1 gas/doc/h8.texi -cf12d9be0d41e433cda51d024905eb5c gas/doc/internals.texi -25c9af2d17e31c41a405f4da0a58984e gas/po/POTFILES.in -bfb5c178c2404196ab54d7532a61e3d4 gas/po/Make-in -8d085be47b4986e1d1f7b90d59722bb2 gas/po/gas.pot -189b37e66fa0d5345240ac619d9c94c3 gas/testsuite/config/default.exp -febbd8dc88b45e9686846ca773346af2 gas/testsuite/ChangeLog -6fdc3af8b63d5c8dd0a98137215d3753 gas/testsuite/gas/all/cofftag.d -acc0977114e4b9e65b9d2aa95c35ff8f gas/testsuite/gas/all/align.d -a60277af402def6d8b222eb7aa29fd72 gas/testsuite/gas/all/align.s -a43c5656afe02c36a6e1ef61a6027724 gas/testsuite/gas/all/cofftag.s -7642a824a63aa87c0f0c07ebab2ea9ba gas/testsuite/gas/all/comment.s -b693149b9cb9c53162d7d2eddc0ee4e8 gas/testsuite/gas/all/cond.d -a0744db73ab7d631e72a1107ffb1c1d8 gas/testsuite/gas/all/cond.s -7ec8ad8becdaf04c09bde661a8ae427e gas/testsuite/gas/all/diff1.s -a3ed4c57221d0e6ae68721825604f04d gas/testsuite/gas/all/float.s -d5cade1146f240feeeb31fa7cee691f3 gas/testsuite/gas/all/gas.exp -ff0067e6fc03e40d69f6d4a3df69c315 gas/testsuite/gas/all/itbl -ae3b5706bcb2b5451fa0da52c419c576 gas/testsuite/gas/all/itbl-test.c -0a1bc24fd58a8e10476fda0bd5b649ed gas/testsuite/gas/all/itbl.s -b61a6aca515ae31b7be7abda0a152bbc gas/testsuite/gas/all/p1480.s -c9637636fc150630e2d44c82892f2551 gas/testsuite/gas/all/p2425.s -856ac38b9fe37e63d8173f9299961115 gas/testsuite/gas/all/struct.d -0b2dc0f909d4928a8de943eade54a345 gas/testsuite/gas/all/struct.s -8ba076a868d6d446a4ab1462add54fd3 gas/testsuite/gas/all/x930509.s -1a8de6cbd6b3c02a2a483c8cd6ce42a7 gas/testsuite/gas/arc/branch.d -19197f29a6d87e3e78495e7a47ebf496 gas/testsuite/gas/arc/adc.d -1b06ceb2288c093be970d894568fa5da gas/testsuite/gas/arc/adc.s -65084e57125295318062997e920c19af gas/testsuite/gas/arc/add.d -75e6baa15e0d53599edfd7ec770375b6 gas/testsuite/gas/arc/add.s -4927747f607ee7be7bf50e7fd6ef02ee gas/testsuite/gas/arc/alias.d -54f01e033f0d248759b8fc6fb71a06db gas/testsuite/gas/arc/alias.s -b8a7885db402fc70652f0410a5820d50 gas/testsuite/gas/arc/and.d -b8fce093a488f7b1c2e6418f7c31c9e3 gas/testsuite/gas/arc/and.s -4bafbcb8f67131a387ad56e5b1bcfac1 gas/testsuite/gas/arc/arc.exp -aa32ccad03a6d294726c0e58e6d2250a gas/testsuite/gas/arc/asl.d -af955c8cf38c553fa4221383c64b6b13 gas/testsuite/gas/arc/asl.s -56384c65539866b6e7fc0a0a05eabce8 gas/testsuite/gas/arc/asr.d -9887c6e68d8176e71d75b9d91604e914 gas/testsuite/gas/arc/asr.s -5288b51666fdc9bb0c65a07671c3c9fd gas/testsuite/gas/arc/b.d -78b81ebb3355a47d5c478e1e56444ffb gas/testsuite/gas/arc/b.s -402522bfb20c4387e1faba27224186ac gas/testsuite/gas/arc/bic.d -ab22388e1552b8926d7b8960f9a6fe20 gas/testsuite/gas/arc/bic.s -ec7abac24fa3c402b31f624a3ff9de77 gas/testsuite/gas/arc/bl.d -e2c237cc25d1cfc82c9285818858e329 gas/testsuite/gas/arc/bl.s -8432db29eb95c38348bb4216a28f43a4 gas/testsuite/gas/arc/branch.s -1165c7d246f9e1a548af4c5b7f4e5f60 gas/testsuite/gas/arc/brk.d -872c85cca67988958ef95591b4fecb7d gas/testsuite/gas/arc/brk.s -acf1eca3b061941ff367bba7654f8a2e gas/testsuite/gas/arc/extb.d -0ab2d9abcadcf93d9b6dd8eb0962d7ab gas/testsuite/gas/arc/extb.s -cb8963efc4b0412d0cf5f6d2d4412d14 gas/testsuite/gas/arc/extw.d -e66a84df62389472e90d215276e87384 gas/testsuite/gas/arc/extw.s -53684f8cb4cc475d5632ffa22555b6c5 gas/testsuite/gas/arc/flag.d -2b6e2dd0335ebc45bb694de8cc2f4c6b gas/testsuite/gas/arc/flag.s -dd35c9020fa1c43318beec05e9d63dd6 gas/testsuite/gas/arc/insn3.d -c9f07db5b59a1a725b1cb520c7dfffe2 gas/testsuite/gas/arc/insn3.s -6623a00a22962dfb1afcb24a2f8920bb gas/testsuite/gas/arc/j.d -7ee6358f55317d08d08f864238c78515 gas/testsuite/gas/arc/j.s -431696fbe85080394483a455208af19c gas/testsuite/gas/arc/jl.d -4a56cf56903f8e4c25dd7865dd1a92df gas/testsuite/gas/arc/jl.s -59910ad05ca1dd842920f3ca9f4b491d gas/testsuite/gas/arc/ld.d -d5a8532516e863d33880e4a649f8ebc9 gas/testsuite/gas/arc/ld.s -4d7ba9b754c7afdba41dfec82239bc30 gas/testsuite/gas/arc/ld2.d -28379656fb4f5c37963ed6991c582ed6 gas/testsuite/gas/arc/ld2.s -af5c07a06b5ab10049b70efc03fe4310 gas/testsuite/gas/arc/lp.d -657d876ad61daec2d6de3a4269bfeaf3 gas/testsuite/gas/arc/lp.s -0b801348feff41c1625f9c681af122c5 gas/testsuite/gas/arc/lsr.d -a9c2ebcafcfc68a8bb7014172813ee2c gas/testsuite/gas/arc/lsr.s -ae005c091f26b4ceac5b19e8c13d8835 gas/testsuite/gas/arc/math.d -c632e7e9e19d65e75557a5e42d513905 gas/testsuite/gas/arc/math.s -42cc6922491da263d6ab87fca2593794 gas/testsuite/gas/arc/mov.d -5bbe3186d21f23263b4a3743cfb1c0e5 gas/testsuite/gas/arc/mov.s -ff9e23ba171eb9fab4ae4bf71ca1964f gas/testsuite/gas/arc/nop.d -4b5a9a087212c040ef94e7cfc7c64113 gas/testsuite/gas/arc/nop.s -c596ab98be90e4fcdb2e92e35e3ca66f gas/testsuite/gas/arc/or.d -a9984178263c3d2fdc55aa82c0850038 gas/testsuite/gas/arc/or.s -152d55e75d6f7079d969d4582e98e32c gas/testsuite/gas/arc/rlc.d -7186c231f11739791f407f6ad9bfdfcd gas/testsuite/gas/arc/rlc.s -f67f42d8077195a9ed9da2cd3ff93889 gas/testsuite/gas/arc/ror.d -0f4fa90aec1e6518392567bb89d7420f gas/testsuite/gas/arc/ror.s -cce2b1054c09a0d526bc548ea162dc6c gas/testsuite/gas/arc/rrc.d -2a33859e8d1450a314390aee1eed985c gas/testsuite/gas/arc/rrc.s -7d0b42fa66729b4df6f26c5daa47c6ee gas/testsuite/gas/arc/sbc.d -6d4e549168ccb7340e4c87d6c3ca9f06 gas/testsuite/gas/arc/sbc.s -b0ae0aa5baea6246ee417710ad641653 gas/testsuite/gas/arc/sexb.d -e3e0516272a27d4fdde6e78fcfc0beae gas/testsuite/gas/arc/sexb.s -753f0757cceff8d9fba7da206607b32c gas/testsuite/gas/arc/sexw.d -505c87905fe1b3b19909f4ff658880e8 gas/testsuite/gas/arc/sexw.s -04e291c6c4227ad3ea068b33bcca2bee gas/testsuite/gas/arc/sleep.d -4b2c68f86079ddc3738d423a7d9286ec gas/testsuite/gas/arc/sleep.s -dd35c9020fa1c43318beec05e9d63dd6 gas/testsuite/gas/arc/sshift.d -285d03daf381a393d3099a8ff7ad1b92 gas/testsuite/gas/arc/sshift.s -15bcea7e5243fe6d08107039eff96e76 gas/testsuite/gas/arc/st.d -0416aa9321cbdc9a725bc459453431cc gas/testsuite/gas/arc/st.s -e913933835012629d5199008027146f4 gas/testsuite/gas/arc/sub.d -beca3fc3b72a58cc4eadd2369592d87f gas/testsuite/gas/arc/sub.s -f2c956a2c8d124cf6924a93a3b18641d gas/testsuite/gas/arc/swi.d -458a27c1ed4ecb3d834bc928af3a1969 gas/testsuite/gas/arc/swi.s -ca575363e502545e2e5d2a6ab64c6af8 gas/testsuite/gas/arc/warn.exp -8bdd04be09313ff33dba220b78d26d8c gas/testsuite/gas/arc/warn.s -9020b43e63291859faac20e7065787d9 gas/testsuite/gas/arc/xor.d -c1a790a7f1cc4e88b2235b226fae54b2 gas/testsuite/gas/arc/xor.s -218ceddbec7e4efdd63a6186a62fded9 gas/testsuite/gas/template -abe5158404494a7b0e74db43f784559a gas/testsuite/gas/alpha/fp.d -eb3ec5f424ad44c0e52fe488caa1402e gas/testsuite/gas/alpha/fp.exp -820ca91b26e95c2ba803e8b9a0ebe76e gas/testsuite/gas/alpha/fp.s -a1361a5b37b54c593cbef99cd85f28a9 gas/testsuite/gas/arm/arch4t.s -e805204a7256772ed77713643ce06a08 gas/testsuite/gas/arm/adrl.d -fea3d814c57f0d641ed3e2b30e3fe9da gas/testsuite/gas/arm/adrl.s -035a15045a9f50492d980d3fac9ef34a gas/testsuite/gas/arm/arm7dm.s -84352b71a635ec348f8370891582ca03 gas/testsuite/gas/arm/arm.exp -217d22388024d3ceb3c80613491f9d13 gas/testsuite/gas/arm/arm3.s -1eb3fbffc325dda43f0f98e8237840f7 gas/testsuite/gas/arm/arm6.s -3b3aa7939f5a6f1b53dc96025bbcfdd4 gas/testsuite/gas/arm/el_segundo.d -b5f8101bcc3f3cc7e46c4e89b30a29f7 gas/testsuite/gas/arm/arm7t.d -acdb01f03b31a3f8cae20ac99db63be5 gas/testsuite/gas/arm/arm7t.s -d594c5bb1795675960702c68c17df8aa gas/testsuite/gas/arm/copro.s -9b3a93b21d21ee58a49c1d0039a555de gas/testsuite/gas/arm/el_segundo.s -6f3f35f3d1f4b051fddba9412542e087 gas/testsuite/gas/arm/float.s -2134e910175749a301307015d968cbb1 gas/testsuite/gas/arm/immed.s -796fb4584e45dbc501f5e85b09182a2d gas/testsuite/gas/arm/inst.d -d451b7fb925e026001176d59277d67c5 gas/testsuite/gas/arm/inst.s -b2fd7458f8e0d2cf15a9249f9fedac4d gas/testsuite/gas/arm/le-fpconst.d -01ece05c7a31cb680e04d26a1f7dc281 gas/testsuite/gas/arm/le-fpconst.s -3613c7ccdfda8492ba8127d99020ff2b gas/testsuite/gas/arm/pic.d -528c3bb56cc6ae2b19157b75203221c6 gas/testsuite/gas/arm/pic.s -55a46d871a3fe4417039c85265d830a1 gas/testsuite/gas/arm/thumb.s -f91305f065fc92ec4cfd34af31197ff7 gas/testsuite/gas/arm/xscale.d -814449ccde23eaac315e913ef381756a gas/testsuite/gas/arm/xscale.s -109b1e2f911068bd6a3280a90061ea8b gas/testsuite/gas/cris/binop-extx.d -eed41e12ba1edecaaa2d3c3789332377 gas/testsuite/gas/cris/addi.d -04449730390af545ba20b42dccd5fe09 gas/testsuite/gas/cris/addi.s -29cdb8544456ec0d40f1b406db48473a gas/testsuite/gas/cris/binop-cmpmove.d -d2a858f83be22b61d2299cc2e5e10a0b gas/testsuite/gas/cris/binop-cmpmovx.d -e31ad643fe65589cbbdb034e1e5f197f gas/testsuite/gas/cris/binop-segref.s -7f94279e488ea079e8a1568dbeb09974 gas/testsuite/gas/cris/binop.d -0128aaa3d875adaf235960d488417afc gas/testsuite/gas/cris/binop.s -a3e707e09eac0416e1d96af6bc910dd0 gas/testsuite/gas/cris/bork.d -67a42ca84f31bc333b785695009221fa gas/testsuite/gas/cris/bork.s -d77f50b1d3d668af993e9fb633b9f401 gas/testsuite/gas/cris/branch-warn-1.s -eb037cb8821e59f91c4e4b787f56cd78 gas/testsuite/gas/cris/branch-warn-2.s -6cf3f5c1d500bd9b0a1de2c3416dffe0 gas/testsuite/gas/cris/branch-warn-3.s -6475601840a6f889ee9eccdc91023bf9 gas/testsuite/gas/cris/branch.d -caff7842b5ef92ca805daf6782c1e414 gas/testsuite/gas/cris/branch.s -4e520a3efff1f37f0de6df15c0a34c10 gas/testsuite/gas/cris/break.d -700be97c0689c4196f0da1842abcc231 gas/testsuite/gas/cris/break.s -2aaf552ea3b069446af5a6a18ad2c7e0 gas/testsuite/gas/cris/brokw-1.d -82d4b8908cfe41325173b31ad92d03fc gas/testsuite/gas/cris/brokw-1.s -a13ae25cf3ec8d458caa16dc63c2b828 gas/testsuite/gas/cris/brokw-2.d -99acc6281a586d428c2e81f5a3e76020 gas/testsuite/gas/cris/brokw-2.s -9fb7e1ca811a353db12fab28f6d7a630 gas/testsuite/gas/cris/brokw-3.d -b5ea3631270db99bda62649c3d96f03d gas/testsuite/gas/cris/brokw-3.s -c4d5e7abbcaf212d987111b7c1e2040e gas/testsuite/gas/cris/bwtest-err-1.s -d80841d50a9461e6e7533c43e44dd4d1 gas/testsuite/gas/cris/ccr.d -fb52bd22addaa45d2f47fc8fc5bcc63f gas/testsuite/gas/cris/ccr.s -0d39e0e05353afc3532e275b909fdbeb gas/testsuite/gas/cris/clear.d -0c2ea11d1047cf554432ca3d4e9d03cc gas/testsuite/gas/cris/continue.d -c87164ab4042aef14e7b7bed37d62d46 gas/testsuite/gas/cris/continue.s -944c9803d087eee985d9f792da7c29be gas/testsuite/gas/cris/cris.exp -ab7c0afd8d2cd448c3b0576af049256b gas/testsuite/gas/cris/diffexp-ovwr.d -a5073cd621e46c9b6b371425b3a8059a gas/testsuite/gas/cris/diffexp-ovwr.s -ee8c39803ebc83959f29ae641da137a0 gas/testsuite/gas/cris/fragtest.d -8de93219134f7b607edec27266d57c27 gas/testsuite/gas/cris/fragtest.s -37ac7adec86ed5a8fd0ef39db9a607f4 gas/testsuite/gas/cris/jump-type.d -1763110b16f52ce71e7111a466e55493 gas/testsuite/gas/cris/labfloat.d -2788020656f9952ba2200bfe6ed8b5f6 gas/testsuite/gas/cris/labfloat.s -63b363c29b7f111d3522135b27a5baac gas/testsuite/gas/cris/macroat.d -f2ac553ad97357a22204205c1c2c64d5 gas/testsuite/gas/cris/macroat.s -7972fbd01b55832d66e9afe5b21a44d9 gas/testsuite/gas/cris/movem-to-reg.d -06f511d9c5dfbbd6ec70e6b5fd954735 gas/testsuite/gas/cris/nosep.d -fc504e0b22b646ea6326e679962d2062 gas/testsuite/gas/cris/nosep.s -e87fda2ed120152aed5ef5927f48514d gas/testsuite/gas/cris/oneop-type.d -2cdc382a264a948b2290859f9b0722f2 gas/testsuite/gas/cris/operand-err-1.s -a9f5ed5476ee8f09aeb8676f6751b01f gas/testsuite/gas/cris/prefix.d -ce78d7541cba3153c036b973d48c2233 gas/testsuite/gas/cris/prefix.s -cef8a89ceeecbfe4d7566ccbfdd4a357 gas/testsuite/gas/cris/pushpop-byte-sreg.d -1e8ffe5e395258d271453a7d182b125e gas/testsuite/gas/cris/pushpop-dcr1-sreg.d -d97ab94343d60cc33c71b43c1fb5cabd gas/testsuite/gas/cris/pushpop-dword-sreg.d -b27c33ec812e847a147601591093ccf0 gas/testsuite/gas/cris/pushpop-word-sreg.d -38ca765cb65923ca112c69a5b347c04e gas/testsuite/gas/cris/pushpop.d -5f57132a6921dd590b853ab871c16039 gas/testsuite/gas/cris/pushpop.s -e4c7c0f31b9839d5536151310f544ee3 gas/testsuite/gas/cris/quick-s6.d -7fa1053d2735accfe207c6bd9dc2c699 gas/testsuite/gas/cris/quick-u5.d -0c9904527686c1ab40e8b41ebd824baf gas/testsuite/gas/cris/quick-u6.d -078d655cbc167283db8ba953c3148a1b gas/testsuite/gas/cris/quick.s -b76b6dbc2e3d8675977eba8b2c80fdeb gas/testsuite/gas/cris/range-err-1.s -fb6ff1ccf6bc8984d311335bb1c65de2 gas/testsuite/gas/cris/range-err-2.s -1aa963985a948084e7f57bc64ae394dc gas/testsuite/gas/cris/rd-regprefix-1.d -483b2b941bdac034989505d636c292bb gas/testsuite/gas/cris/rd-regprefix-1.s -ec4ae60abafccecdf76cfa6db8973836 gas/testsuite/gas/cris/rd-regprefix-1b.d -ba3a8b1d41f12777d99bb3b0f0242e4a gas/testsuite/gas/cris/reg-to-mem.d -c36b1354d494fa3d14e0f53cbdad14d1 gas/testsuite/gas/cris/regprefix-err-1.s -daf514b146b6d788c0d44a44c78fb084 gas/testsuite/gas/cris/regreg.d -57d564c932d2ec3a002e095c03b43755 gas/testsuite/gas/cris/regreg.s -9b3f927669d4ef8900289aa5ec407517 gas/testsuite/gas/cris/return.d -618b1c16f597a8c927d63668befe360c gas/testsuite/gas/cris/return.s -e0ccfd23d8757d8497bf9428ced9a2be gas/testsuite/gas/cris/scc.d -dfef1f180533d93400114eb0106e4047 gas/testsuite/gas/cris/scc.s -a4016c7d0fb8462d531bedf3d29db82a gas/testsuite/gas/cris/sep-err-1.s -0d8192d5d6fc2d3cf97a212a82d0ce7e gas/testsuite/gas/cris/sep-err-2.s -faaccaed133c943daeb19f14b890ac70 gas/testsuite/gas/cris/sep-err-3.s -62e83deae56f617278b9cc972afe4da2 gas/testsuite/gas/cris/separator.d -e929807163f06ba801c4d3d98eef047a gas/testsuite/gas/cris/separator.s -7dd5458e20d0ecb5c21cff9fa0a9f46a gas/testsuite/gas/cris/shexpr-1.d -f6aed27cb988eadba85e4dacfcef485e gas/testsuite/gas/cris/shexpr-1.s -47b5ed349286a89189e5915c07a7d945 gas/testsuite/gas/cris/sreg-to-x.d -36ee6b68e98b7cbd9ffd498673bb83a8 gas/testsuite/gas/cris/string-1.d -ba96569c4c3a69683f9eda2f2e804ac9 gas/testsuite/gas/cris/string-1.s -5649d5e6ddaf6789f15e1b8cb1979b1c gas/testsuite/gas/cris/string-2.d -6ddd84549c2ae105a7ffc9e339d1e37e gas/testsuite/gas/cris/string-2.s -80c15d753b5f84e6b2dc8834e2f8906e gas/testsuite/gas/cris/test.d -b7120a4705aa9a380d545c5a796c3159 gas/testsuite/gas/cris/unimplemented.d -962270c17acff6001a62ba57047c826a gas/testsuite/gas/cris/unimplemented.s -ddd6a1784dc2c7a34042c0a5fb3c1800 gas/testsuite/gas/cris/unop-mem.d -ec2af75e8927ac1b38d610129de5962b gas/testsuite/gas/cris/unop.s -75063b64ce4c7ce0ccb58e946587b1fb gas/testsuite/gas/cris/us-err-1.s -57983a53289a7da6c1ed399d7fe0a3e9 gas/testsuite/gas/cris/us-err-2.s -89b77f3261be6a0b6f7c2117ec573b35 gas/testsuite/gas/cris/us-err-3.s -a325d1070d73f0a40781fd4c0feb8055 gas/testsuite/gas/cris/x-to-byte-sreg.d -5f4256191fa514d404b9b31f0b48d973 gas/testsuite/gas/cris/x-to-dcr1-sreg.d -183314b6dae188dbb4ed4b3dfbfbd02a gas/testsuite/gas/cris/x-to-dword-sreg.d -be4438db4d0c5d5a732331453a4f54b3 gas/testsuite/gas/cris/x-to-word-sreg.d -c1a784e8e7fc1cb601b7c63df2e1320f gas/testsuite/gas/d10v/d10.exp -0004da131d3e5488db3b4b89bd259250 gas/testsuite/gas/d10v/inst.d -bbe173f89d3ad611d31b7cf43d88291c gas/testsuite/gas/d10v/inst.s -d7768075c27bdbdff4a1347c6b1746d0 gas/testsuite/gas/d30v/bittest.d -a15d68d40c502f8fb891fb71e6a331b4 gas/testsuite/gas/d30v/align.d -8ab5843e51782cc8150825c0aed13da9 gas/testsuite/gas/d30v/align.s -8a9471a2ce14a0c94c7af09fd8cf6f7c gas/testsuite/gas/d30v/array.d -afb9ee8fc39b6c6a3b5a607f0958dd2b gas/testsuite/gas/d30v/array.s -36ccce5414200c372215e06d70d6aad0 gas/testsuite/gas/d30v/bittest.l -4b9689db23a80dfeeb4e6217aaf0a8ad gas/testsuite/gas/d30v/bittest.s -df0c590e221f5dd7900a1c128978ecea gas/testsuite/gas/d30v/d30.exp -5c2ba5b08a8d87ddfc1a70cf2d7c90aa gas/testsuite/gas/d30v/guard-debug.d -739c4467a3344e1787f7b4bdbf919705 gas/testsuite/gas/d30v/guard-debug.s -24a691232054571885f6c30112e51658 gas/testsuite/gas/d30v/guard.d -59254ab788d218d38c2c0d6e71251e76 gas/testsuite/gas/d30v/guard.s -748040da85ada059191e19f00e2488f6 gas/testsuite/gas/d30v/inst.d -39cdbdd6bd65bb5930b303daa6d76dcd gas/testsuite/gas/d30v/inst.s -02e401be332104808af7c8300005fe7d gas/testsuite/gas/d30v/label-debug.d -7f982990c748276d508b09332cdae4f6 gas/testsuite/gas/d30v/label-debug.s -c483a48ce51ab77c8dee11cfab64b50a gas/testsuite/gas/d30v/label.d -7f982990c748276d508b09332cdae4f6 gas/testsuite/gas/d30v/label.s -26406f9a3cbcac3df375ce96f2bf6d60 gas/testsuite/gas/d30v/mul.d -d16bd2d8de2333b4d7ee533c7fbdb1c4 gas/testsuite/gas/d30v/mul.s -3f5d45bfe5794cd78197dab5eba2c4e6 gas/testsuite/gas/d30v/opt.d -cd67e61c7ea236940d9b65c880a564b4 gas/testsuite/gas/d30v/opt.s -7ede5044d404df6c8e7e4397218784b3 gas/testsuite/gas/d30v/reloc.d -2ed511260d2382d512257ccd75e39887 gas/testsuite/gas/d30v/reloc.s -d06a422e5cd491385a39700e8488ebe2 gas/testsuite/gas/d30v/serial.l -26005134b177b676ea077b771aa246cc gas/testsuite/gas/d30v/serial.s -ecab3756772637d3e43ed51d3afe89dd gas/testsuite/gas/d30v/serial2.l -4c96fc10e8ae0de631d7681473ac66eb gas/testsuite/gas/d30v/serial2.s -fbd1fa6f75f8a3d34dd0eb6b9bcfecf2 gas/testsuite/gas/d30v/serial2O.l -4c96fc10e8ae0de631d7681473ac66eb gas/testsuite/gas/d30v/serial2O.s -7fc2a4f0d0ed0a1e698ef2e351bacd11 gas/testsuite/gas/d30v/warn_oddreg.l -04cb44d9a5a4e2791243c475947c1dfa gas/testsuite/gas/d30v/warn_oddreg.s -3aa51e33fc3c4fb00d9f02ab8b6c1412 gas/testsuite/gas/elf/ehopt0.d -6d8da292baf24ce6878336c3bed5a1db gas/testsuite/gas/elf/ehopt0.s -7ddf696baeb3e5954c1d5755625f4f5c gas/testsuite/gas/elf/elf.exp -2e585cb42734f16db2d5af3c7e3b8ae0 gas/testsuite/gas/elf/section0.d -94799bbca15898e61e62e52d81f0bcca gas/testsuite/gas/elf/section0.s -045c78bad26109f03785866dccb0aef6 gas/testsuite/gas/elf/section1.d -b892afd90c0c8f8d9b5486dcd484d815 gas/testsuite/gas/elf/section1.s -5c0da9476fde1f1fb1257eb5a7c1864b gas/testsuite/gas/elf/section2.e -365f7f4f8f6fa73bf0c738244defbb98 gas/testsuite/gas/elf/section2.e-mips -10cd1b592475b4aa51fad4414503db94 gas/testsuite/gas/elf/section2.l -5a42c78c814dadc7e4a11cba2a795f97 gas/testsuite/gas/elf/section2.s -8f760ce7cf5b0bcea1fd0c123134bc4b gas/testsuite/gas/fr30/allinsn.d -f43f517834a1bcead42dab25e75f41d0 gas/testsuite/gas/fr30/allinsn.exp -fdf34a19cb21c9273e472a9bb4c9e97f gas/testsuite/gas/fr30/allinsn.s -4a1055775cc266d1a0458ce050e653d3 gas/testsuite/gas/fr30/fr30.exp -2924c535df55b6a32889011860a29689 gas/testsuite/gas/h8300/addsub.s -8b119bf28b7ba30807a8850b9edf96d3 gas/testsuite/gas/h8300/addsubh.s -5b8c73d8de33afa02ff707f67065a1ef gas/testsuite/gas/h8300/addsubs.s -d86b31775e7398f8bc4d446d9d0a017b gas/testsuite/gas/h8300/bitops1.s -15fd0f35907c986489fa36bddebbb526 gas/testsuite/gas/h8300/bitops1h.s -584a7cd8ad886afe1f0d2f9b5d817467 gas/testsuite/gas/h8300/bitops1s.s -30ff0841f2e26ebb8e15aa636a64e4a5 gas/testsuite/gas/h8300/bitops2.s -a741bf520d8175248d8c363dd660cad9 gas/testsuite/gas/h8300/bitops2h.s -2e137c2f7cf12903edc7dd00bfe6d409 gas/testsuite/gas/h8300/bitops2s.s -3d15e82abb0f85bdfacdbb653e083999 gas/testsuite/gas/h8300/bitops3.s -82edeaa989ae932805db0608f8cc235a gas/testsuite/gas/h8300/bitops3h.s -f5395cd9806896db584e3fbbdb548389 gas/testsuite/gas/h8300/bitops3s.s -6249a5e4419949642c98aaa14f3d8b10 gas/testsuite/gas/h8300/bitops4.s -5a394a0dbef8a7f14e4294b4dcfed8a5 gas/testsuite/gas/h8300/bitops4h.s -791083648e92754b6c62f3201681ece1 gas/testsuite/gas/h8300/bitops4s.s -23aecc0c8af29a4bf18f97a9607677d5 gas/testsuite/gas/h8300/branch.s -1f02561f75f4c45679ba42b0492cc58a gas/testsuite/gas/h8300/branchh.s -e251ed292c39572dbd1364f73d5fd32e gas/testsuite/gas/h8300/branchs.s -f0e5262ac4229fe320614df5a40f35e9 gas/testsuite/gas/h8300/cbranch.s -30d75e5d8c2ef426fe42a377456bda0b gas/testsuite/gas/h8300/cbranchh.s -5fdbcffb87056d813eafd925d9c763f0 gas/testsuite/gas/h8300/cbranchs.s -80cc8a6d96ee17417ea03077199ad4d7 gas/testsuite/gas/h8300/cmpsi2.s -3be6267a929c5b26e8f4d69491d0877a gas/testsuite/gas/h8300/compare.s -b2030d679f34f4563b5a00cbe2c1d072 gas/testsuite/gas/h8300/compareh.s -94eec517c2a5cefb40f7bcc8a338a83a gas/testsuite/gas/h8300/compares.s -437e6b6cef5f904dd70a700cd486f7ea gas/testsuite/gas/h8300/decimal.s -9b32251ca7b543949470558b507ca6b3 gas/testsuite/gas/h8300/decimalh.s -56fe63d196d46b2f8dc1c4bfca0c351d gas/testsuite/gas/h8300/decimals.s -0c35be5ae497429ff49aa3076805fda3 gas/testsuite/gas/h8300/divmul.s -d37984dfb136ed1c465a17ac6ff8cbb4 gas/testsuite/gas/h8300/divmulh.s -d37984dfb136ed1c465a17ac6ff8cbb4 gas/testsuite/gas/h8300/divmuls.s -f813008dac0b658d469085e795844664 gas/testsuite/gas/h8300/extendh.s -4d7497fb959f22fd9f7b666d4c61eee6 gas/testsuite/gas/h8300/extends.s -75a67be04365505ad29c72fef5a9ffe9 gas/testsuite/gas/h8300/ffxx1.d -fac5432bff2a42ebe3ace2a5431b0028 gas/testsuite/gas/h8300/ffxx1.s -67fb823dadfe9cc61cc4c40717871318 gas/testsuite/gas/h8300/h8300.exp -d068dc8b49ea5e3a2841052399d04411 gas/testsuite/gas/h8300/incdec.s -57ef072e39a9e088908da70b650fe6b7 gas/testsuite/gas/h8300/incdech.s -68127cbf4156b232462ded46fb1eeb96 gas/testsuite/gas/h8300/incdecs.s -ad670f4be1807bfa3361ea5dfdc0658d gas/testsuite/gas/h8300/logical.s -4baf511d4fbb91925e6de834c9b49ea5 gas/testsuite/gas/h8300/logicalh.s -c4d9cba61beedae407c0c1260e6e1d5d gas/testsuite/gas/h8300/logicals.s -3c56ddac8216a69a609103570d7b3e49 gas/testsuite/gas/h8300/macs.s -fb0d77314633b62d40a4a054311960e8 gas/testsuite/gas/h8300/misc.s -0474a81ccc5b5408fc54aa171faafb52 gas/testsuite/gas/h8300/misch.s -11bb474016acda38cc0db95df94487a3 gas/testsuite/gas/h8300/miscs.s -9193c97fad2ede164c0c90d605b70f46 gas/testsuite/gas/h8300/mov32bug.s -1883f564d24d685c8dc63486f070f4a6 gas/testsuite/gas/h8300/movb.s -fcd326aa9537340e99b1100508c3aa5b gas/testsuite/gas/h8300/movbh.s -7145f97672f9645e3de195a7fdf55a1b gas/testsuite/gas/h8300/movbs.s -d8c9bc7371b9b1d46a2eefb32d90d58d gas/testsuite/gas/h8300/movlh.s -0e5f5a058fd24a750a53bfa817b326a5 gas/testsuite/gas/h8300/movls.s -3674b05426b7d9c23e487af7bb8465e2 gas/testsuite/gas/h8300/movw.s -75e9728e4f42fb7fbedbba7ed96b11db gas/testsuite/gas/h8300/movwh.s -b0068c567a3f9efc6b3b31cf95a5a318 gas/testsuite/gas/h8300/movws.s -911d1f05cbac2099a9f3d2c76df2d656 gas/testsuite/gas/h8300/multiples.s -4393180d58ab1ed9d690f02ff183b6f6 gas/testsuite/gas/h8300/pushpop.s -4d82e273acc364dfaddc59b3a13ee22e gas/testsuite/gas/h8300/pushpoph.s -8ff1c8b35100699d39d44f67e19a5176 gas/testsuite/gas/h8300/pushpops.s -6cc6731a0e070e666e164d9163629113 gas/testsuite/gas/h8300/rotsh.s -7bc113956c8ca4ddcd42503e4bd530e3 gas/testsuite/gas/h8300/rotshh.s -811af24ecd9436d020bfaf84413f5847 gas/testsuite/gas/h8300/rotshs.s -3f42a581ab454d64c32db9aee33ef424 gas/testsuite/gas/hppa/basic/basic.exp -f0fc0667db6fc80b90e168e77d21a710 gas/testsuite/gas/hppa/basic/add.s -98ee4fb8ed790b202a1c065b7e0b997b gas/testsuite/gas/hppa/basic/add2.s -57ad58f96f1a781f50c99315319025b2 gas/testsuite/gas/hppa/basic/addi.s -d9c4ae7672d35624f16301c6c3d2d6e3 gas/testsuite/gas/hppa/basic/branch.s -018bafaddc464bf5344056a4a6ba62aa gas/testsuite/gas/hppa/basic/branch2.s -2744044afb6af0ffe892e71482c7e83b gas/testsuite/gas/hppa/basic/comclr.s -30e98c333c6c3c41f4230609d617d4bd gas/testsuite/gas/hppa/basic/copr.s -18c064b287abc57be5f66793ce0a4ed8 gas/testsuite/gas/hppa/basic/coprmem.s -593e94c43830b50ccf4ccf7aefdabc9a gas/testsuite/gas/hppa/basic/dcor.s -54b1bb4ce869350a6860eea7ef011576 gas/testsuite/gas/hppa/basic/dcor2.s -7f9d07824ecdd65dce64fdbb8ab88668 gas/testsuite/gas/hppa/basic/deposit.s -9e7936d6dca987e90acb029a0794e50c gas/testsuite/gas/hppa/basic/deposit2.s -4179bc45da0c3f5c674c51bce4f3ef42 gas/testsuite/gas/hppa/basic/deposit3.s -5532f754b3ee74d823c916f73352f531 gas/testsuite/gas/hppa/basic/ds.s -ebef581b3abd2e0a860dc45c474dcc77 gas/testsuite/gas/hppa/basic/extract.s -f0c6b56da1f75e189baf27d8c1f535fe gas/testsuite/gas/hppa/basic/extract2.s -51d8fb411be8712bd0c7ce811ad6dc38 gas/testsuite/gas/hppa/basic/extract3.s -a982fc398cedf2e44201d59012ee7066 gas/testsuite/gas/hppa/basic/fmem.s -a0babc25ea6d4372cb5eccc0ae3f4825 gas/testsuite/gas/hppa/basic/fmemLRbug.s -91548514b195f47807497ea510c61712 gas/testsuite/gas/hppa/basic/fp_comp.s -9847e0fce8c6da72b7f980b441367739 gas/testsuite/gas/hppa/basic/fp_comp2.s -698e8f34a3b345696ad42ea0fe3a42dc gas/testsuite/gas/hppa/basic/fp_conv.s -50c67d6e1a3d6914794a948be62b14f6 gas/testsuite/gas/hppa/basic/fp_fcmp.s -67b6a72f5e598098f02c322b08238380 gas/testsuite/gas/hppa/basic/fp_misc.s -bf748287a3393071018df9ef711ff79e gas/testsuite/gas/hppa/basic/imem.s -382400fc1867cc374e7a9a97620ba203 gas/testsuite/gas/hppa/basic/immed.s -3dcb29aed920c5fca9f33ae76fa7bf5e gas/testsuite/gas/hppa/basic/logical.s -40808c7e14c9dd94905f168f5bd28a9d gas/testsuite/gas/hppa/basic/media.s -3f9890f5f05691d773c5252cca7c3bdb gas/testsuite/gas/hppa/basic/perf.s -5cc775342d33290ccc79a2c3392ba59c gas/testsuite/gas/hppa/basic/purge.s -585389c4c1113b467f309f8b53564ddf gas/testsuite/gas/hppa/basic/purge2.s -bc0a3320065bbb6f8c7226807fa35e7d gas/testsuite/gas/hppa/basic/sh1add.s -7682c249ad6ac5dce5a7a0d5c70b9759 gas/testsuite/gas/hppa/basic/sh2add.s -3976fa98bed24429b469cc702b660e93 gas/testsuite/gas/hppa/basic/sh3add.s -69cfdc26fc07d25504dfb30978448340 gas/testsuite/gas/hppa/basic/shift.s -f588468f60d1393a578d3147a655f303 gas/testsuite/gas/hppa/basic/shift2.s -d35888a201d29276d5f468576ce69678 gas/testsuite/gas/hppa/basic/shift3.s -b3128437c366866da97f401491e4854c gas/testsuite/gas/hppa/basic/shladd.s -8ed6a738a1fd2383dbe99d68c8cf59e4 gas/testsuite/gas/hppa/basic/shladd2.s -66715cf6565b3eabaabafd99e8b2dab6 gas/testsuite/gas/hppa/basic/special.s -1af275b55a5680b0a941bfdf1e5496e9 gas/testsuite/gas/hppa/basic/spop.s -cbe82b7200c01fac6ef8ad8c4c90e4a0 gas/testsuite/gas/hppa/basic/sub.s -7f6527cc71e690f05a0d73c733c1b14b gas/testsuite/gas/hppa/basic/sub2.s -c2fd7d2c7fc3f77c944b5af56ebbcb7d gas/testsuite/gas/hppa/basic/subi.s -857c66689b29c2902448ccfc8b55d78a gas/testsuite/gas/hppa/basic/system.s -9dec6c8e5b94b75cb0e0fb27c16ce4ee gas/testsuite/gas/hppa/basic/system2.s -05e8ccf6f72f4a0efbdf0f852a206023 gas/testsuite/gas/hppa/basic/unit.s -1ed85cf259a78d3d86ea435e74dfcbe6 gas/testsuite/gas/hppa/basic/unit2.s -03008cde62428d4ff2464bef8cb8bcd2 gas/testsuite/gas/hppa/basic/weird.s -73cbb56b2c330327d9c06ea89af0cd91 gas/testsuite/gas/hppa/README -d93edd3b974fa05de350f6104c63af74 gas/testsuite/gas/hppa/parse/align1.s -6a7df2ab8d1491f8f64f60fb0a359558 gas/testsuite/gas/hppa/parse/align2.s -85d6e969f063c0bee9565d096c43657e gas/testsuite/gas/hppa/parse/appbug.s -72ae2fe9c7ff74b0267402ab93c59282 gas/testsuite/gas/hppa/parse/badfmpyadd.s -b0dd08d05ad154fa1797fbb7b65f1b3a gas/testsuite/gas/hppa/parse/block1.s -44d0164ab1f3f2f8201ca4cac02f0a91 gas/testsuite/gas/hppa/parse/block2.s -7012f9c767f18688e051c168e218464b gas/testsuite/gas/hppa/parse/calldatabug.s -d26fcb5186e8ffda4892557ecf9d836a gas/testsuite/gas/hppa/parse/callinfobug.s -36132d401bbf31234a71915b94762a26 gas/testsuite/gas/hppa/parse/defbug.s -8355f3baa7c8bf6dfdde12165f166988 gas/testsuite/gas/hppa/parse/entrybug.s -a8c2940c51c368a14265009963ce4a7d gas/testsuite/gas/hppa/parse/exportbug.s -0aa9ab25448da72ed059168f45ee4e11 gas/testsuite/gas/hppa/parse/exprbug.s -464c7378f55821348860da76fd77ed2e gas/testsuite/gas/hppa/parse/fixup7bug.s -69d79811f23cb30bd2c536063a29c137 gas/testsuite/gas/hppa/parse/global.s -eae1949a6363097a7e2ef5bd260b9aa7 gas/testsuite/gas/hppa/parse/labelbug.s -a7ec38bf59489eb49f4bd3ce752f7cb4 gas/testsuite/gas/hppa/parse/linesepbug.s -adf3dd32e97d184fa3a923e977ac0f20 gas/testsuite/gas/hppa/parse/lselbug.s -e09d99b9bb0cc52546de922bf02a3a13 gas/testsuite/gas/hppa/parse/nosubspace.s -8161b5f30367ba86f14e168e2fbf025a gas/testsuite/gas/hppa/parse/parse.exp -030b7a7332dca245ae8a65a00ab8e169 gas/testsuite/gas/hppa/parse/procbug.s -ba4a443e4362a957c9eda52f33e9ed56 gas/testsuite/gas/hppa/parse/regpopbug.s -b19738063af645b6f2231ee644131542 gas/testsuite/gas/hppa/parse/spacebug.s -16d00a249972a7d82fd5b443a6c006ea gas/testsuite/gas/hppa/parse/ssbug.s -6e77c97c02695c15f9f54b9b531a5e2b gas/testsuite/gas/hppa/parse/stdreg.s -e4c3228c9e3a74eb9b2170caafd9cf4c gas/testsuite/gas/hppa/parse/stringer.s -b91fabc2587cd34b7543fe16032d9c3e gas/testsuite/gas/hppa/parse/undefbug.s -ad0e0513effd832ce4787671ac4c5eac gas/testsuite/gas/hppa/parse/versionbug.s -7f9b2353d22448012a9435f7b80ccf1a gas/testsuite/gas/hppa/parse/xmpyubug.s -629e685800d946a73fba78f4f9e2a342 gas/testsuite/gas/hppa/reloc/applybug.s -e7eccf3a36e653b9312fc78bb40a5022 gas/testsuite/gas/hppa/reloc/blebug.s -9c8150c0635455986ba2e99432e230ad gas/testsuite/gas/hppa/reloc/blebug2.s -cfe88051f0bd644932bc22814216e804 gas/testsuite/gas/hppa/reloc/blebug3.s -2e83d05979fd4ec0c399182ad7513423 gas/testsuite/gas/hppa/reloc/exitbug.s -a7ab875345b2ba9a0c1e6aee0c0b23cb gas/testsuite/gas/hppa/reloc/fixupbug.s -84f724d5d6335f9367de5e493847499c gas/testsuite/gas/hppa/reloc/funcrelocbug.s -8fd8e8d6557a090221c4b9382f712183 gas/testsuite/gas/hppa/reloc/labelopbug.s -79c490df3cf5ac395769cfd1378b598b gas/testsuite/gas/hppa/reloc/longcall.s -6fedcfa10d24c76dde19990cbdb53c1a gas/testsuite/gas/hppa/reloc/picreloc.s -a30d0372d62d0a448e374ed80897e3bf gas/testsuite/gas/hppa/reloc/plabelbug.s -f2f905140c0955e2a88e451fad681f42 gas/testsuite/gas/hppa/reloc/r_no_reloc.s -5042b71ae3f83b270fa17a2b7f27fc92 gas/testsuite/gas/hppa/reloc/reduce.s -bc728b6253b6c770472ed22f5def04e0 gas/testsuite/gas/hppa/reloc/reduce2.s -45668f4718492900a833f2d3ebe47e57 gas/testsuite/gas/hppa/reloc/reduce3.s -5fce2ee045a8f221d7d4a0470786d00b gas/testsuite/gas/hppa/reloc/reloc.exp -2813e26c00aa991fb8cc3f67b56ae4f6 gas/testsuite/gas/hppa/reloc/roundmode.s -c690211a1ccb9ebe1cda17e17b5d1cf4 gas/testsuite/gas/hppa/reloc/selectorbug.s -c0e4f0dd244fb83332f776ca09756e5b gas/testsuite/gas/hppa/unsorted/align3.s -a7b6914341e97c943a5b931b5ff724a1 gas/testsuite/gas/hppa/unsorted/align4.s -d5ecda3dffcd60591d33b1718f89d02c gas/testsuite/gas/hppa/unsorted/brlenbug.s -0854f5ede3fb810256df5394b5d17a6f gas/testsuite/gas/hppa/unsorted/common.s -563abc929a52d7539bb83a990fbfcb65 gas/testsuite/gas/hppa/unsorted/fragbug.s -3c295194b6d3754be9b7b7da67fddcb4 gas/testsuite/gas/hppa/unsorted/globalbug.s -af9e915b6ea1a8a691914d94bb230546 gas/testsuite/gas/hppa/unsorted/importbug.s -741867661d59451b7d71d392fc0d7206 gas/testsuite/gas/hppa/unsorted/labeldiffs.s -0aa46fc17784b72b21d387564dddde36 gas/testsuite/gas/hppa/unsorted/locallabel.s -f8705df6b564ae8bc51ff8255048afd1 gas/testsuite/gas/hppa/unsorted/ss_align.s -da24d502a74952b6c5895ffc62d541d1 gas/testsuite/gas/hppa/unsorted/unsorted.exp -dabaf1f82986e409d20127484c8388e3 gas/testsuite/gas/i386/general.l -4f13cd819c9c8bdc0e25c3e1ea7e0be1 gas/testsuite/gas/i386/amd.d -c89704ccdc6abd42145480c444772394 gas/testsuite/gas/i386/amd.s -481a82666e24dd35712ddbe1953070fc gas/testsuite/gas/i386/float.l -0df7ab956e3209428d665890983ef957 gas/testsuite/gas/i386/float.s -c6f32143c1a338a7e3c688cadb2a27b3 gas/testsuite/gas/i386/general.s -f55987a25b2d327d6cce6d34c2f1f3e4 gas/testsuite/gas/i386/i386.exp -54bf1dea9d3fa662fd489d8ba6123a50 gas/testsuite/gas/i386/intel.d -19173fe8ed78eaf92af5f4e7219aed51 gas/testsuite/gas/i386/intel.s -734d748810614b19b03ac10dfde2b1f4 gas/testsuite/gas/i386/intelpic.d -10af8323b3fdfb2580629d4bbb96414f gas/testsuite/gas/i386/intelpic.s -92c2460d4bc6a3d856918e182ca720b3 gas/testsuite/gas/i386/inval.l -ebaaadf5e7218736c6523e8c024e4a63 gas/testsuite/gas/i386/inval.s -e6d4cc21cd6fd3850a2527bd9a0602df gas/testsuite/gas/i386/jump.d -a5ac8a9636b7ab8c6a732203d0914133 gas/testsuite/gas/i386/jump.s -73d7f5fe54695a0d1baff6361ee951af gas/testsuite/gas/i386/jump16.d -72fb343c916713f2da32dd3ebcb13cd7 gas/testsuite/gas/i386/jump16.s -c4bd4a9c5d709255664ff19de89fe4ce gas/testsuite/gas/i386/katmai.d -3e427af40c4ab651d69de595d3f996f7 gas/testsuite/gas/i386/katmai.s -d566afc7ce85d649e11306e09c745945 gas/testsuite/gas/i386/modrm.l -1d1696a1b6db5c16aa2463cdd8b6a045 gas/testsuite/gas/i386/modrm.s -a9f88835bfba484b001209393305e9ab gas/testsuite/gas/i386/naked.d -b4fe60a42e7f416e8bcfc4c911652c79 gas/testsuite/gas/i386/naked.s -91f562b065b071024b4ad049253cc00b gas/testsuite/gas/i386/opcode.d -7c8d765ebc016ae5b7ce8941230d47ba gas/testsuite/gas/i386/opcode.s -d1ab72522efa161dc5bb0d5d34c6cbe3 gas/testsuite/gas/i386/prefix.d -18eb6094372a8ea6dcedecc52d4bbafb gas/testsuite/gas/i386/prefix.s -6d542d1a416f943f08f7081f0ea15d6e gas/testsuite/gas/i386/relax.d -1b8a63c63fa1cb4fd0069ad74110d3a8 gas/testsuite/gas/i386/relax.s -73bd114ee58f8613e40dcc68dc44ecab gas/testsuite/gas/i386/reloc.d -785e2743dba0137e0235c3a40f7ed72b gas/testsuite/gas/i386/reloc.s -2d08693d201a298eb883722a268fb281 gas/testsuite/gas/i386/sse2.d -266867e323b3248cd8cdad201276821d gas/testsuite/gas/i386/sse2.s -108a9548a770fe8d5f7e2f92c9418545 gas/testsuite/gas/i386/ssemmx2.d -e73e0f652b697100e02db9b419b06cd0 gas/testsuite/gas/i386/ssemmx2.s -04f524b94eb61aaf58b37c180ab1e373 gas/testsuite/gas/i386/white.l -305b7d730a90ea5ac8fb330a3bf13fec gas/testsuite/gas/i386/white.s -62171adf925034f2497f65c4381bda77 gas/testsuite/gas/i386/x86_64.d -167651a8472e8240a82c364ac9738761 gas/testsuite/gas/i386/x86_64.s -dbbf38f460db18779a5e3b6d064eb499 gas/testsuite/gas/ia64/dv-branch.d -ec058dd65d1af91fe84f41b725857462 gas/testsuite/gas/ia64/dv-branch.s -956561267da937b1be0fada7c6ea25c7 gas/testsuite/gas/ia64/dv-entry-err.l -e635d21d0f94975c7df306096506d41b gas/testsuite/gas/ia64/dv-entry-err.s -d2c80d56ca498f06aaed101e323f583f gas/testsuite/gas/ia64/dv-imply.d -a4c835f4336ab0d7bea5c1251fe02f94 gas/testsuite/gas/ia64/dv-imply.s -091538d6530e8a161937745d99426d7a gas/testsuite/gas/ia64/dv-mutex-err.l -91d93a728f474aa95c998e07a884224c gas/testsuite/gas/ia64/dv-mutex-err.s -8126eb7a7fcdd728745e456cb576a1e3 gas/testsuite/gas/ia64/dv-mutex.d -91cb93a568ee81bf4a049bfcad3be8f4 gas/testsuite/gas/ia64/dv-mutex.s -faad91ad280ed985504df18b5df67462 gas/testsuite/gas/ia64/dv-raw-err.l -47f0ecc4a6d44c41bceba1bf96951931 gas/testsuite/gas/ia64/dv-raw-err.s -042d6a6ba6e6fab95e540ea3f117cadd gas/testsuite/gas/ia64/dv-safe.d -c06a2d45e380eacc79be2946865839ea gas/testsuite/gas/ia64/dv-safe.s -b08507477c737fd99ecbcdaf985f7864 gas/testsuite/gas/ia64/dv-srlz.d -fcb5ba635bb6c1bf11217572aed8c194 gas/testsuite/gas/ia64/dv-srlz.s -47a1c9e8c8d646cb1276022156938aef gas/testsuite/gas/ia64/dv-war-err.l -96d62a881175a15f9d0eb1464592de82 gas/testsuite/gas/ia64/dv-war-err.s -c29583516e19e2b432fc8be35ccfd38c gas/testsuite/gas/ia64/dv-waw-err.l -5120b50924c7c72ed617ecf58bb839c4 gas/testsuite/gas/ia64/dv-waw-err.s -4702e0589d4ecfea81d623654726c865 gas/testsuite/gas/ia64/fixup-dump.pl -3340310e879de7f94d7008a34cd902e3 gas/testsuite/gas/ia64/ia64.exp -e6ff55117be31d2e2338afa8ba6743e1 gas/testsuite/gas/ia64/opc-a-err.l -c10f248c93a66cf00810e181bcf47859 gas/testsuite/gas/ia64/opc-a-err.s -d01bcbbb33e4aaddf588cf96bb2818c3 gas/testsuite/gas/ia64/opc-a.d -7a4b4b8b83d010b15200291b7428d900 gas/testsuite/gas/ia64/opc-a.pl -25a4e13b65c5c563854c68b27850ec27 gas/testsuite/gas/ia64/opc-a.s -6f669176b63ccb7041cff7a0c43bdd2a gas/testsuite/gas/ia64/opc-b.d -a6e1c6d4094099abc90c4eddf392cf90 gas/testsuite/gas/ia64/opc-b.pl -0a0dcd4d0f92863aacd3374f10cf89d4 gas/testsuite/gas/ia64/opc-b.s -87d4c9bce119a46f50cd7873ecdbb579 gas/testsuite/gas/ia64/opc-f.d -e44f587f12c4e939d44570b92b5ca82b gas/testsuite/gas/ia64/opc-f.pl -7de8eef520f311b774af7bdea416eee9 gas/testsuite/gas/ia64/opc-f.s -08b1ba95e8fd11a0f7f8c1f3705e0be2 gas/testsuite/gas/ia64/opc-i.d -6df89ea375d396efe8cd150381479c12 gas/testsuite/gas/ia64/opc-i.pl -2574b1a2f2579fa030a50947773fa6c0 gas/testsuite/gas/ia64/opc-i.s -95ae13460bb1d9601c083697cac119e9 gas/testsuite/gas/ia64/opc-m.d -85878e0564576b3b7bafb3eb82660f7d gas/testsuite/gas/ia64/opc-m.pl -df0663aeae5336e53e1d06b3e39f6bb2 gas/testsuite/gas/ia64/opc-m.s -42205102976e466e5bbffcdd4d3cfcb7 gas/testsuite/gas/ia64/opc-x.d -da315d802d151e76d7d335473c729f38 gas/testsuite/gas/ia64/opc-x.s -cd152fa44d0a9ca4200fbec848788915 gas/testsuite/gas/ia64/regs.d -e6ce0da8b25a4cd6c5b44068eb4278cd gas/testsuite/gas/ia64/regs.pl -b6c72b3bbf42fd15250f957014a139c9 gas/testsuite/gas/ia64/regs.s -c8161d7293bcc7692937ee4d5b16fc60 gas/testsuite/gas/ieee-fp/x930509a.exp -b0509b0492fd2fc8448b011ae03a41b8 gas/testsuite/gas/ieee-fp/x930509a.s -649f145a8122db7f91f18b85740849a5 gas/testsuite/gas/m32r/allinsn.d -239bb6ea0e35bbe2e8a5939edab2a2cb gas/testsuite/gas/m32r/allinsn.exp -5f9b6e2b9934e8a02576ba496d16ab72 gas/testsuite/gas/m32r/allinsn.s -74ef82c499b9dbc10b25373e6823c276 gas/testsuite/gas/m32r/error.exp -d71cb8f6eee3bbdd0ccecaaca513831a gas/testsuite/gas/m32r/fslot.d -da6bcd9a061b6fdd7a4ee5b2aec6811a gas/testsuite/gas/m32r/fslot.s -da48ccf2513f4723fced3d98ee902eee gas/testsuite/gas/m32r/fslotx.d -c81e23eb3020f45236c4ef7e98a14008 gas/testsuite/gas/m32r/fslotx.s -13b1a745fafe89b83fc828fa73bc0ea5 gas/testsuite/gas/m32r/high-1.d -0c257c8a3667fa667e99bb3cb9aff5a7 gas/testsuite/gas/m32r/high-1.s -873accfff909b6aac6b9a2e8cf961856 gas/testsuite/gas/m32r/interfere.s -d8115906f69c19b93a1fa6deba5b2d70 gas/testsuite/gas/m32r/m32r.exp -6b48ad39eeb0006e1fc1c9010cfbc21d gas/testsuite/gas/m32r/m32rx.d -778e305ed7747652af13150f315591a9 gas/testsuite/gas/m32r/m32rx.exp -3e3e8b05f1651dbc0692a8a20fc804ba gas/testsuite/gas/m32r/m32rx.s -c0b5f95ee4eec971ea74dc81435baec8 gas/testsuite/gas/m32r/outofrange.s -32f8410f7bdb6db49efc7016f230360f gas/testsuite/gas/m32r/relax-1.d -ee56272ade0ca1ed891d0bcdc81d1173 gas/testsuite/gas/m32r/relax-1.s -ffadebffc2057e150da0f56aa0f6d511 gas/testsuite/gas/m32r/relax-2.d -dfd4ad2ea1d8b29e222e48a671c648e1 gas/testsuite/gas/m32r/relax-2.s -debc3c1322cf7602d46e1657a4249b10 gas/testsuite/gas/m32r/uppercase.d -3ad7dc32e323605aaf71cc84e39717df gas/testsuite/gas/m32r/uppercase.s -d21d472754ca0f699e8faf8c95175ec1 gas/testsuite/gas/m32r/wrongsize.s -9187362c4020cfb7b9df8782637bb65d gas/testsuite/gas/m68hc11/all_insns.d -f17b7c3ca3c536ffa8e6df6dc2f439f1 gas/testsuite/gas/m68hc11/all.exp -57022ccbd6cef54a3a8ece7847d6569f gas/testsuite/gas/m68hc11/all_insns.s -7bd42f694ffddccc2e193372d35e2541 gas/testsuite/gas/m68hc11/insns-dwarf2.d -afeb3f5fe5cf302f22c11a8a73c76fe6 gas/testsuite/gas/m68hc11/insns.d -b40598fa9d279a12c73b904dc7f640cd gas/testsuite/gas/m68hc11/insns.s -d77d9f6b2a194247a6d436103c2aa5a6 gas/testsuite/gas/m68hc11/lbranch-dwarf2.d -2ce8f16d1b2813d639637246318a2fa5 gas/testsuite/gas/m68hc11/lbranch.d -270514d96ae94f63ea38a4eb9fccd095 gas/testsuite/gas/m68hc11/lbranch.s -7e3463ce5e0c47ca8bdaaf6f3d443f8d gas/testsuite/gas/m68hc11/malis-include.s -41ba77d190f160fb60f0392b97e0d453 gas/testsuite/gas/m68hc11/malis.d -a469d5986f2366e13cba507b0314fdfd gas/testsuite/gas/m68hc11/malis.s -89d1a83096ae0248028459092e1518ca gas/testsuite/gas/m68hc11/opers12-dwarf2.d -9931e7658c6388e1ad91fb3bb0f38a38 gas/testsuite/gas/m68hc11/opers12.d -bfd8edd9e0edf8fb9cd5ea3ebf070461 gas/testsuite/gas/m68hc11/opers12.s -d36654135443b0740d6b2c78b03ad44b gas/testsuite/gas/m68k/bitfield.d -2a34f43b42955f46a42618a50182de68 gas/testsuite/gas/m68k/all.exp -fa19c98907bd173f6de4c396ef9acd45 gas/testsuite/gas/m68k/bitfield.s -1c229d52fdc1160c9dd9f74b19c1ec69 gas/testsuite/gas/m68k/cas.d -20e0445e36d8d9f35c6022fa7118a3da gas/testsuite/gas/m68k/cas.s -96de03f7fc5967e5d267ae957ac508cf gas/testsuite/gas/m68k/disperr.s -26dfd242ac765008271e85e25d9d8446 gas/testsuite/gas/m68k/fmoveml.d -205a85d6482891f58292e065222b78fa gas/testsuite/gas/m68k/fmoveml.s -b14e11a2793fb32f7d471e31e4ecf7b9 gas/testsuite/gas/m68k/link.d -ea9ee18230b981ada48e2b69bb566220 gas/testsuite/gas/m68k/link.s -85e6de04e2d6138d3b0e1e3e932fc884 gas/testsuite/gas/m68k/op68000.d -d72997199e7c0cfb9dae24c9bc0347fd gas/testsuite/gas/m68k/operands.d -d5012d936b1b45db947e4a29a883fc9d gas/testsuite/gas/m68k/operands.s -b334f15354ebeffb3acba502cc1dae67 gas/testsuite/gas/m68k/p2410.s -ce5152b0da290f444d58c6ef03d48e02 gas/testsuite/gas/m68k/p2663.s -9f97c8240a44cb8d55e355b3577f7a7d gas/testsuite/gas/m68k/pcrel.d -3bc8cba59ef27f67c6c6e2a67717db04 gas/testsuite/gas/m68k/pcrel.s -c1fce4f35335083fbf7d4538c5a7230f gas/testsuite/gas/m68k/pic1.s -6ebe1f8291de253ee6ce0e469b3e03aa gas/testsuite/gas/m68k/t2.d -ba9a3e851cb31d41e5a33c44dc3ebd13 gas/testsuite/gas/m68k/t2.s -3a162ab2de5525fc4745144a511922c9 gas/testsuite/gas/m68k-coff/p2389a.s -4117edd076cf599f92777cbfea5d59ba gas/testsuite/gas/m68k-coff/gas.exp -45f1ecda71b05960409560f553228a2d gas/testsuite/gas/m68k-coff/p2389.s -29f7789ff1bca9100fda6a1276c73f70 gas/testsuite/gas/m68k-coff/p2430a.s -2c65e9837c0fa5884e6d7aa8ab7f5b27 gas/testsuite/gas/m68k-coff/p2430.s -9ae5a3f91535cb9ce86b48698e6096b1 gas/testsuite/gas/m68k-coff/t1.s -abc6ff7e3825198ada07ac55f4f3ab7e gas/testsuite/gas/m88k/m88k.exp -dccbd7ad6ededd07df99af498231642d gas/testsuite/gas/m88k/init.d -ebcd9dfb18999e4f42a3c3d5a53fcb81 gas/testsuite/gas/m88k/init.s -ef6c6bcefee3f0df10bbe2455661acc7 gas/testsuite/gas/macros/macros.exp -06148aa2e0046074be6e05308a79b642 gas/testsuite/gas/macros/err.s -f64593bf9530d575f681a8566ef216c3 gas/testsuite/gas/macros/irp.d -e284db7fba30dba3218492a95521d6b1 gas/testsuite/gas/macros/irp.s -369273a5f986fd76ff12a8c638e722a0 gas/testsuite/gas/macros/strings.d -b320acc9c113dd9d1967db7ee0857e8a gas/testsuite/gas/macros/rept.d -f5abc6437f073dff4af533a36ea9d280 gas/testsuite/gas/macros/rept.s -efbeac5d9e630c2251fa42fd98bdfd47 gas/testsuite/gas/macros/semi.d -e772243ae7fe04097bba952a6d9173bd gas/testsuite/gas/macros/semi.s -8990b11a483140af060adb1ff48c4cc5 gas/testsuite/gas/macros/strings.s -df6bcb5dd71cf55583464fc270bc52a1 gas/testsuite/gas/macros/test1.d -74a3db320fafd23b64c4ab6f48a17246 gas/testsuite/gas/macros/test1.s -ac43f2633f23586812df9e1a40627d82 gas/testsuite/gas/macros/test2.d -0fd6102941c5acb1bb8e85a697a2ff23 gas/testsuite/gas/macros/test2.s -7e8aafe277f842553e1bf935c32fa0e8 gas/testsuite/gas/macros/test3.d -1dbcc25102396060274f0b3d1268f47c gas/testsuite/gas/macros/test3.s -0544bcf7466e18eabd7d715e3059b24f gas/testsuite/gas/mcore/allinsn.d -3f84389ae5d2fa1891f6db5a66746c47 gas/testsuite/gas/mcore/allinsn.exp -0ee353f47d16db7430f79032977dc1af gas/testsuite/gas/mcore/allinsn.s -537103a0821acc23c643173a5b44062a gas/testsuite/gas/mips/break20.d -9c3689024c183a4b37014fce89d4c0eb gas/testsuite/gas/mips/abs.d -93b8bd81a813fed709cc6b5639d4552a gas/testsuite/gas/mips/abs.s -74518b2a94faa95c13c4d18516e73a48 gas/testsuite/gas/mips/add.d -3aee944bf3dc58dded8dd88c0ef7e205 gas/testsuite/gas/mips/add.s -0cecb6450a4984efe4d9dc93d53bb71d gas/testsuite/gas/mips/and.d -31c4e7dfe6203941f0a009c79fe9aedb gas/testsuite/gas/mips/and.s -be2f88510c23cf738e68b90ba8ed4984 gas/testsuite/gas/mips/beq.d -0c68387d4560df31811cf1a8acbc2958 gas/testsuite/gas/mips/beq.s -44bb49c8b2818b785c9ad7d0dec45df4 gas/testsuite/gas/mips/bge.d -eca0c74d018c0e56f81d49381b5f9a6c gas/testsuite/gas/mips/bge.s -c4faa565be53610538b153932918c3c0 gas/testsuite/gas/mips/bgeu.d -5a9a9ba8716b251c9b6aea9a9ddfed78 gas/testsuite/gas/mips/bgeu.s -588722af7a657b70b24f95c275fb2939 gas/testsuite/gas/mips/blt.d -e28cc53eef33d048effa03ff1d696991 gas/testsuite/gas/mips/blt.s -c7725bfac64a9dd54047de1f24f4106d gas/testsuite/gas/mips/bltu.d -08821d562fd1d36b49bb73ec19a1b818 gas/testsuite/gas/mips/bltu.s -01e30fca71ae643c6acb0e4c3d579f1c gas/testsuite/gas/mips/break20.s -dd381a80a3175c0433c2778e559e66f7 gas/testsuite/gas/mips/delay.d -f8386c3523ad68825b3b91215e3ce856 gas/testsuite/gas/mips/delay.s -6ce614bbef53b14bfaae9d392f25d8e4 gas/testsuite/gas/mips/div-ilocks.d -e18c56b9627325cb9dfc2fb280a822a1 gas/testsuite/gas/mips/div.d -6da8cc8418138e9b9ee39ac970e437da gas/testsuite/gas/mips/div.s -e86f1ff9069e89abc5f1398f3c2537ba gas/testsuite/gas/mips/dli.d -89a3d7e768db094a0b11ede7bfca879d gas/testsuite/gas/mips/dli.s -e66f7bf10e7ba1ebcee5676a941b05f8 gas/testsuite/gas/mips/e32-rel2.d -f578f2ded6569ab283de19d512a81cdb gas/testsuite/gas/mips/e32el-rel2.d -ed701440c13f9150f1e0048ee440e710 gas/testsuite/gas/mips/elf-rel.d -eb8cd56831349b3482483c425b481301 gas/testsuite/gas/mips/elf-rel.s -d2a5c89ee0e80dc9e0bc21bb0e30c063 gas/testsuite/gas/mips/elf-rel2.d -f7a0c6062a5a8fe838e93a14441b72bc gas/testsuite/gas/mips/elf-rel2.s -a43901f3dcf1dd5a64c0fd2c23f20f7c gas/testsuite/gas/mips/elf-rel3.d -bed8097caa447a2852d225642aed4711 gas/testsuite/gas/mips/elf-rel3.s -6531d00a109f1e0829eda1178a1b886a gas/testsuite/gas/mips/elf_e_flags.c -6bbeff5a2159c064f18894cc7bd9b7ef gas/testsuite/gas/mips/elf_e_flags.s -4da3a439698c64eaff4bd734ce0c63c4 gas/testsuite/gas/mips/elf_e_flags1.d -f5171663be58260ab0f111c9a75b4bca gas/testsuite/gas/mips/elf_e_flags2.d -9aa4cb59fdd9f8957c758e5bbc51b7d4 gas/testsuite/gas/mips/elf_e_flags3.d -bd5416cb0030cdc4871db84d061ff5c6 gas/testsuite/gas/mips/elf_e_flags4.d -50e4a37ba95ae53c1e082de05669c17a gas/testsuite/gas/mips/elfel-rel.d -4a0d4da918ec2b87774c61b0ac676833 gas/testsuite/gas/mips/elfel-rel2.d -162ad232f56d6e4900c815de5cdaf845 gas/testsuite/gas/mips/elfel-rel3.d -2fd3b92c729abb0ea1523ccf238b5025 gas/testsuite/gas/mips/elfel-rel3.s -b1d5e0f6b6bf2a8981fc5cf052b4a312 gas/testsuite/gas/mips/empic.d -749cf53f3155f1f122aa79bf71ccacbc gas/testsuite/gas/mips/empic.s -b47234477b017d8640d0a583d17b44cb gas/testsuite/gas/mips/itbl -3be9cfa967f82e0b4325b152baf0f23a gas/testsuite/gas/mips/itbl.s -f749ed9a6daa0dcdfd342b2a75b42e76 gas/testsuite/gas/mips/jal-empic.d -21fcb5fb003bdd5da6023ae14ddf8136 gas/testsuite/gas/mips/jal-svr4pic.d -644da8eaec6c846730e2b965a6fb0e39 gas/testsuite/gas/mips/jal-svr4pic.s -fc6fd411b87de4fe1e4103bdfda61933 gas/testsuite/gas/mips/jal-xgot.d -027b54f716266d307c80de2320fcf930 gas/testsuite/gas/mips/jal.d -2a9d8534b670ee90e9212ab2a706cf87 gas/testsuite/gas/mips/jal.s -5ae53c3943254fdd8222308abb126d38 gas/testsuite/gas/mips/la-empic.d -e9c696756945df68acdf916951943741 gas/testsuite/gas/mips/la-empic.s -cbdace2f18d6d189af31230093ca5e3c gas/testsuite/gas/mips/la-svr4pic.d -68a536a51395e0081f92221ec4cb61e8 gas/testsuite/gas/mips/la-xgot.d -6705c5e988e1c2a99690af6dda603789 gas/testsuite/gas/mips/la.d -f479612dc60112156a66a5292a60b205 gas/testsuite/gas/mips/la.s -0417463ce8f1bbac44b82e9a09f58321 gas/testsuite/gas/mips/lb-empic.d -b941d24b4746291a2fe361540766913b gas/testsuite/gas/mips/lb-pic.s -1f66be9b27c8016b848e92a9acd96d5d gas/testsuite/gas/mips/lb-svr4pic.d -2f5e8e5ef8600d736cb629afe7485528 gas/testsuite/gas/mips/lb-xgot-ilocks.d -d9289421eb691d41e325b6dd6a18c1ae gas/testsuite/gas/mips/lb-xgot.d -b9b03ce62abe797e2aef0c820265c772 gas/testsuite/gas/mips/lb.d -e9d35a3d0cdd51294a858378d467574d gas/testsuite/gas/mips/lb.s -5120a014142934b9ec8957e5744a3260 gas/testsuite/gas/mips/ld-empic.d -767e91de3b9f92ce2a668642a2ea2fbe gas/testsuite/gas/mips/ld-ilocks-addr32.d -7cec7e938337dca05a5f45ca501cae66 gas/testsuite/gas/mips/ld-ilocks.d -3e1c4e9e2e45a90c704db383f9551b8a gas/testsuite/gas/mips/ld-pic.s -bdb41be78c421144777ffd68ce9cc12a gas/testsuite/gas/mips/ld-svr4pic.d -30530f8ed4203f0e6335f1f4af66c0ed gas/testsuite/gas/mips/ld-xgot.d -49b44c3c7b60070dfbdd9c8b2f3954ea gas/testsuite/gas/mips/ld.d -8b08d1b9548f0a0ece2cede37c07ec87 gas/testsuite/gas/mips/ld.s -1969dda2d40fff88c811833cd9ae5f51 gas/testsuite/gas/mips/li.d -b5df74ea9e934e9bf65cd0bba8eac411 gas/testsuite/gas/mips/li.s -9dbe0e03a5386d5721ff8fc5391dab33 gas/testsuite/gas/mips/lif-empic.d -3f909a73d3a8fcdb607e4cc27437766a gas/testsuite/gas/mips/lif-svr4pic.d -7005137e25034def6329f2f60e0996fd gas/testsuite/gas/mips/lif-xgot.d -24416fc0940341f36bc025aefc05c604 gas/testsuite/gas/mips/lifloat.d -a0a03d60c7fdb7e812a9f97325945910 gas/testsuite/gas/mips/lifloat.s -642de403c1e77713b324b2a165adf6f8 gas/testsuite/gas/mips/lineno.d -c2034fba9031ad7f3bc0a1128ae6198f gas/testsuite/gas/mips/lineno.s -b9be97c1aa73ebe314f85ce9890aa75e gas/testsuite/gas/mips/mips.exp -a9a10694a9e4101fc40f1b5fa6d8d999 gas/testsuite/gas/mips/mips16-e.d -4785c49a602347865df48551df7121fc gas/testsuite/gas/mips/mips16-e.s -0d9982c499e97a5f2a40d9b592586193 gas/testsuite/gas/mips/mips16-f.d -7146e7075936aa4a1434864cf7bf6d4e gas/testsuite/gas/mips/mips16-f.s -97b3d39a4f90d82f4d405ac12f4d5e72 gas/testsuite/gas/mips/mips16.d -a686ad0a2da9fe043d717c57b4580d0b gas/testsuite/gas/mips/mips16.s -15f633e687d2e28e792496ad3cb4dc4c gas/testsuite/gas/mips/mips32.d -9f4640a5a47e4b1a26a968bc837de82a gas/testsuite/gas/mips/mips32.s -282d43dd59cb14d4ee715f2131946725 gas/testsuite/gas/mips/mips4.d -1d91653bf695ab6b54caf527440eb0b2 gas/testsuite/gas/mips/mips4.s -f35695633c08bea813f1c5da947c770c gas/testsuite/gas/mips/mips4010.d -cd49d59fb8e9057e6313f5ff630015b9 gas/testsuite/gas/mips/mips4010.s -3fadda766878ce990b5372bc2d1096d5 gas/testsuite/gas/mips/mips4100.d -957bb8b99fce311beffd2fe9f3a0eddc gas/testsuite/gas/mips/mips4100.s -1e6151ac3b3ac15d2556fd22174e2a29 gas/testsuite/gas/mips/mips4650.d -5c10900661e0928e9a340c3c925418b1 gas/testsuite/gas/mips/mips4650.s -0b85782f82b845c698359f73731196c5 gas/testsuite/gas/mips/mips64.d -4929310e699e0e1ac8bc28e44030ebff gas/testsuite/gas/mips/mips64.s -d54d4a935c5a458282d8b82f7a890831 gas/testsuite/gas/mips/mipsel16-f.d -56c7733ca5f7e921738b527a5f447964 gas/testsuite/gas/mips/mul-ilocks.d -0b2e9dc8e1a3454098fd8fb66651fc5a gas/testsuite/gas/mips/mul.d -03190409f6e3f76c2b66c8ab590d10bf gas/testsuite/gas/mips/mul.s -24250759fab3a88ba80dc09edff83f78 gas/testsuite/gas/mips/nodelay.d -c46536d17d5ebad3eee458a52073330b gas/testsuite/gas/mips/rol.d -5f8fefb5bda995779109a3d959bc071f gas/testsuite/gas/mips/rol.s -d4c27ce7dd87092e695e4df919a7ef61 gas/testsuite/gas/mips/sb.d -15410af41b16b3678e11c8c7d4d6d7a7 gas/testsuite/gas/mips/sb.s -5d3f8be0295dfe3afa394af2d492190b gas/testsuite/gas/mips/sync.d -ffcef95bbefaf3a59e62285fe39bda76 gas/testsuite/gas/mips/sync.s -bb8eff4fb1f49d667833720ec1ed1a45 gas/testsuite/gas/mips/telempic.d -d7d31ccd74befcdad7317366421d5329 gas/testsuite/gas/mips/tempic.d -7ac6d404e2e9d57ca4cd51e929b836fe gas/testsuite/gas/mips/tmips16-e.d -f02641e647b4b68646fe54322af84d5f gas/testsuite/gas/mips/tmipsel16-e.d -a9f05cfa4f3975b1ec93ee3cc56561ec gas/testsuite/gas/mips/trap20.d -f7d1e998d2057f17dfa22040879794f5 gas/testsuite/gas/mips/trap20.s -0b9071247431c2b789835f4dc4ec45ec gas/testsuite/gas/mips/trunc.d -6206de0006f0d3b3552c2c4de6d4d40c gas/testsuite/gas/mips/trunc.s -e5f5b974d0da7c046bb033afcf60fc48 gas/testsuite/gas/mips/uld.d -4dfc3d5c85518711401b4a15122c6cea gas/testsuite/gas/mips/uld.s -ea3815f56ffded46b428ff097414aa19 gas/testsuite/gas/mips/ulh-empic.d -42668d2b953e17216dad9ff5b51a11b8 gas/testsuite/gas/mips/ulh-pic.s -5158cd2e3607a2a5db193c8407f2b383 gas/testsuite/gas/mips/ulh-svr4pic.d -ed27ca0c51a00192b6d32d81a354aa2a gas/testsuite/gas/mips/ulh-xgot.d -4c374b4e6113d1add0a7b267949a1bf0 gas/testsuite/gas/mips/ulh.d -d4c1e8e91b66176d0dd73baa903929d9 gas/testsuite/gas/mips/ulh.s -8a640531f9842fac05e6a906e0cd4e33 gas/testsuite/gas/mips/ulw.d -ed019962f9d9264d80ac0a3ec29faaf3 gas/testsuite/gas/mips/ulw.s -ab4867894e361a5bd27a784519eabced gas/testsuite/gas/mips/usd.d -c4f723634a0f69013515468922c55a04 gas/testsuite/gas/mips/usd.s -f0fac62ab8f363574dc13b6b5b43ec5d gas/testsuite/gas/mips/ush.d -fa20601e0c404bd38a90edf5f43077bb gas/testsuite/gas/mips/ush.s -3c18be69c1508086bc845c86099ddab6 gas/testsuite/gas/mips/usw.d -59b429c3b2d1ea0daf2377204cbdfdca gas/testsuite/gas/mips/usw.s -b00b8e50d58ac967e8e84c9dc8df9075 gas/testsuite/gas/mn10200/basic.exp -c58581edb3ac95b306f040bbc2c16678 gas/testsuite/gas/mn10200/add.s -b117e36f812c2eb416156d441f26185e gas/testsuite/gas/mn10200/logical.s -9411b8190fac3aad748696ea30bba5b0 gas/testsuite/gas/mn10200/bcc.s -efa2232339233fab01e2fe7ca6c2f3cf gas/testsuite/gas/mn10200/bccx.s -aabf4d8010190b4ebadb4d4dce938282 gas/testsuite/gas/mn10200/bit.s -3f51363ea969316f726dc5529904888e gas/testsuite/gas/mn10200/cmp.s -874b6bc0f155eecbaffecb93a5642416 gas/testsuite/gas/mn10200/ext.s -1ff17a9ade34cc243a67f4e5afb1873e gas/testsuite/gas/mn10200/muldiv.s -ea8599975d89b01f9aaba3b664947565 gas/testsuite/gas/mn10200/mov1.s -3386b14210f3cd873dde20c6166162c6 gas/testsuite/gas/mn10200/mov2.s -a0b70b1cc9ec5e2783428dcc483ee86d gas/testsuite/gas/mn10200/mov3.s -6e62837e492b9688e29de9625549b402 gas/testsuite/gas/mn10200/mov4.s -e37e1b13a06659d005a650675dcf3935 gas/testsuite/gas/mn10200/movb.s -f6ce44141165b449c3cb51ebe486e98e gas/testsuite/gas/mn10200/movbu.s -32dfde7ae5c5361c03c746481b7aee8d gas/testsuite/gas/mn10200/movx.s -723c642cba806a6ce6dda8c3881ef233 gas/testsuite/gas/mn10200/other.s -21b9f1644f5a62fdc603b218708648f3 gas/testsuite/gas/mn10200/shift.s -7ac2864fac53b6b778c4aba3efb1a2e1 gas/testsuite/gas/mn10200/sub.s -3c5d635c4e529ba743b2062006ab8a00 gas/testsuite/gas/mn10300/am33_2.s -02ba050389aba06e510285db97af882b gas/testsuite/gas/mn10300/add.s -3bb44c38f4fbab75c570123d255c57f8 gas/testsuite/gas/mn10300/am33.s -dfe221c89fe65738a2360f231c2b6794 gas/testsuite/gas/mn10300/am33_3.s -593bbef9992d2f23b91f4ea176b28957 gas/testsuite/gas/mn10300/am33_4.s -62ae8325beee2a8180a39e125355ba2b gas/testsuite/gas/mn10300/am33_5.s -90dcb58c5eb364963271d465adac73ef gas/testsuite/gas/mn10300/am33_6.s -ae77079066eabaa0cc3b0db53f95500b gas/testsuite/gas/mn10300/am33_7.s -631a649907d27d317cee70928c6c27fc gas/testsuite/gas/mn10300/am33_8.s -04890830259a2f960fa1ef6f2d344ee8 gas/testsuite/gas/mn10300/basic.exp -9411b8190fac3aad748696ea30bba5b0 gas/testsuite/gas/mn10300/bcc.s -b15e3790182c7ba25b21a4185f2a55e6 gas/testsuite/gas/mn10300/bit.s -647a9c89d56b470cb3fef7839a32834d gas/testsuite/gas/mn10300/cmp.s -3828018d3809076328223d9d3c1e48c5 gas/testsuite/gas/mn10300/ext.s -f6db4622ff4a88bc9ebf44aec56bc245 gas/testsuite/gas/mn10300/extend.s -f2b5260884e40bc35f8694403da505f8 gas/testsuite/gas/mn10300/logical.s -d3d15560536638ff0e38a1cd6bea678a gas/testsuite/gas/mn10300/loop.s -e554261a6559698fe2722b841dd1b5e3 gas/testsuite/gas/mn10300/mov1.s -1453d74ea0d60c24e054f9443aa26fe4 gas/testsuite/gas/mn10300/mov2.s -8d091f8bc50686881c4104f6dc9b6ab7 gas/testsuite/gas/mn10300/mov3.s -e5df57ebcca23c27b6c2399780e9a146 gas/testsuite/gas/mn10300/mov4.s -384122880cfa3e6fa4a8b08c350c62a8 gas/testsuite/gas/mn10300/movbu.s -075a3ba2756f3cf09ac1926492ccf614 gas/testsuite/gas/mn10300/movhu.s -155d5bd225998f0bf8a65d543230adc5 gas/testsuite/gas/mn10300/movm.s -aa222b2f903cde208e2be8c3972e3c8a gas/testsuite/gas/mn10300/muldiv.s -9cbe29313848966be970cdecdc09e7b2 gas/testsuite/gas/mn10300/other.s -293fa500fcb2e85940176a545801b046 gas/testsuite/gas/mn10300/shift.s -ed9edfd6a0eea176f6974376bd321b10 gas/testsuite/gas/mn10300/sub.s -961a51d51720b650cb383a6aa510d4d9 gas/testsuite/gas/mn10300/udf.s -4b259d611c94c789b73572d5b0863a5b gas/testsuite/gas/mri/comment.d -5ffc5b9af8cd82e8ff721a39d583a9cb gas/testsuite/gas/mri/char.d -016f8a629209b7d7313c4a4e3c37c909 gas/testsuite/gas/mri/char.s -84c565776c727a1f5986b5d8d39ba13e gas/testsuite/gas/mri/comment.s -aca62962ea755bbc1aaeb56b32c53974 gas/testsuite/gas/mri/common.d -7b6bfc157de809b518bb8820f293f78c gas/testsuite/gas/mri/common.s -c3db4a831aaf5f148abfde517fff14f2 gas/testsuite/gas/mri/constants.d -df9ad2212b59618793c7080d043c14e4 gas/testsuite/gas/mri/constants.s -2258c0445fb6b2005828c77b96c0520a gas/testsuite/gas/mri/empty.s -78ea402a49a07c1a325a03a28be37678 gas/testsuite/gas/mri/equ.d -83843a1d515852848a6fc1054a984792 gas/testsuite/gas/mri/equ.s -ceec8399c07b39bee0a4ea07eece6d2f gas/testsuite/gas/mri/expr.d -21255a47a57f7e00246072b10af9b641 gas/testsuite/gas/mri/expr.s -bc4dc43acfdddf49f994908c7e26abe6 gas/testsuite/gas/mri/float.d -4f7756364607bd924587f3689b8b16b7 gas/testsuite/gas/mri/float.s -2e7a0a8ee1508d01e6532c6c6c7b11b1 gas/testsuite/gas/mri/for.d -70d33f74b91d862f9f9b6c4dd173ce58 gas/testsuite/gas/mri/for.s -75333d0367e1162e0f31471a7731fbf5 gas/testsuite/gas/mri/if.d -ba2ce35b0663f91570cc0725695f2f0f gas/testsuite/gas/mri/if.s -4b03ed946465a72d469e2aeff2ddd6f5 gas/testsuite/gas/mri/immconst.d -f1f5c0c93c39409b9a82cf956d42e39e gas/testsuite/gas/mri/label.d -ed17ca77ec65b8492a436ad06a222487 gas/testsuite/gas/mri/label.s -31e12f9de66d36f631e1883a3f763077 gas/testsuite/gas/mri/moveml.d -4e57586c117d02856b0a1e2fe1e199cb gas/testsuite/gas/mri/moveml.s -6f90672446c28d52cef0a7a5ce335254 gas/testsuite/gas/mri/mri.exp -4f6263a77a91affd2a0cd34b177000bd gas/testsuite/gas/mri/repeat.d -1684df3330c24639ae41d526858b2a80 gas/testsuite/gas/mri/repeat.s -67ebccbf76d5002534361af491abfddf gas/testsuite/gas/mri/semi.d -da1cdabe1af1adb9735d5d609dccca32 gas/testsuite/gas/mri/semi.s -bf93368342190b86a250e95b9de09d8a gas/testsuite/gas/mri/while.d -cdd1ad74d4bb0147f32931b83c7383be gas/testsuite/gas/mri/while.s -f3a7124485548781ba12a81c18199e29 gas/testsuite/gas/pj/ops.d -308d2177ed3b3b087d977e46c924fc0c gas/testsuite/gas/pj/ops.s -a6667ed6fc7b116477f95ef897bc5444 gas/testsuite/gas/pj/pj.exp -96a9890816c6c3314d3862d35fe59f3f gas/testsuite/gas/ppc/astest.d -5254d1fc440f434a46e97eb96b2735c1 gas/testsuite/gas/ppc/astest.s -b9b4926634e4c4e6e812b47b38a2f84b gas/testsuite/gas/ppc/astest2.d -9ae09fa391c3aa343824a7745551b28e gas/testsuite/gas/ppc/astest2.s -318ca470fd4b138732e4907c229b9bf6 gas/testsuite/gas/ppc/ppc.exp -d2e3625ca66a7c30b9270f806c67c877 gas/testsuite/gas/ppc/simpshft.d -0fc9ce29053c855d0a3abe241d93c961 gas/testsuite/gas/ppc/simpshft.s -f32ff8e646f5d0e0fbc6ecb76c4682e5 gas/testsuite/gas/sh/basic.exp -83d353a7646413b74d2087aa22fae13b gas/testsuite/gas/sh/err-1.s -495cac29a4993f28c4782ef285228c38 gas/testsuite/gas/sh/err.exp -70b8c1e3f6395cf992292993dcbdf601 gas/testsuite/gas/sh/fp.s -4b815d3da1c2d2bceeb98994c659c492 gas/testsuite/gas/sparc/membar.d -392efaa6637a8734d3ab35e579615a53 gas/testsuite/gas/sparc/asi.d -8f35c68aef641d7cc35698d67a32557e gas/testsuite/gas/sparc/asi.s -521b5671f3aa6bae70f78b5f3d37de1a gas/testsuite/gas/sparc/membar.s -12b5e618325d4a4bc80cb8766bbfc064 gas/testsuite/gas/sparc/mism-1.s -706c79f848f389921b20f0f64dde1ecd gas/testsuite/gas/sparc/mismatch.exp -d85c226fa388a66bd2689ba3efedf5e4 gas/testsuite/gas/sparc/prefetch.d -0b615422f6c8ad3fe5c42f2a8c7af1e4 gas/testsuite/gas/sparc/prefetch.s -9c7bc5ce86d96a964c5c7f02d43db0da gas/testsuite/gas/sparc/rdpr.d -09f5e33dbd927c548c928b9db9f14fe0 gas/testsuite/gas/sparc/rdpr.s -78517d2fce6c7707fd2f09689ebc3d72 gas/testsuite/gas/sparc/reloc64.d -7d56aec0e050e09c004a33abd25a9293 gas/testsuite/gas/sparc/reloc64.s -08afa18cf165a3043a6b92153526c876 gas/testsuite/gas/sparc/set64.d -1facb5655fe83c44ac900776c563e717 gas/testsuite/gas/sparc/set64.s -59861c3ea98eff8780189bc79824a7b4 gas/testsuite/gas/sparc/sparc.exp -3564e46bcf53613a512e32f2633c3d05 gas/testsuite/gas/sparc/splet-2.d -69817b445f39a0e3cf591de872fa74e5 gas/testsuite/gas/sparc/splet-2.s -5fa3fb7a059f3fd315df0af21e0c9619 gas/testsuite/gas/sparc/splet.d -6236b0423a317e0a2340bdb317c54d1e gas/testsuite/gas/sparc/splet.s -a6b1a41bb26dc70e130bc42ef7133cc7 gas/testsuite/gas/sparc/synth.d -0e0dead95b89c31c1ed49b21c430bc1a gas/testsuite/gas/sparc/synth.s -b041cafa83c1f1f131ca949780217e54 gas/testsuite/gas/sparc/synth64.d -0303005116e0116e28f1dd473ca39f28 gas/testsuite/gas/sparc/synth64.s -8f196520d2f35fd1890df94723f6aec3 gas/testsuite/gas/sparc/unalign.d -1eeb1d4db023af72c50e896a4bb90638 gas/testsuite/gas/sparc/unalign.s -10dd2c15d6932af5f1203d03fbc6dae6 gas/testsuite/gas/sparc/wrpr.d -d44c4548a463c3e491d6fdaaa0f20177 gas/testsuite/gas/sparc/wrpr.s -f65f40edb42735b8af3a4baaacd662f5 gas/testsuite/gas/sparc-solaris/addend.exp -7dd4467acc1dda3c1753ebcbfeeead33 gas/testsuite/gas/sparc-solaris/addend.s -dd2ab79e6bd90288569274206313966b gas/testsuite/gas/sparc-solaris/gas.exp -b2d813e248b8ec085ca8d551271274bf gas/testsuite/gas/sparc-solaris/sol-cc.s -2e927e8072e145441bb882a01e3ac8cd gas/testsuite/gas/sparc-solaris/sol-gcc.s -54a6b727f437bf7989e266329d0dd875 gas/testsuite/gas/sun4/addend.d -b648f70387617b14507805caeea0b6d6 gas/testsuite/gas/sun4/addend.exp -7dd4467acc1dda3c1753ebcbfeeead33 gas/testsuite/gas/sun4/addend.s -8d19328fb89c3001a897cbf2f4f3b92d gas/testsuite/gas/symver/symver.exp -f942ca1487fba1e0fa62d14b0f2cca1d gas/testsuite/gas/symver/symver0.d -7f2d42503901978e4eb5bab37fd01df2 gas/testsuite/gas/symver/symver0.s -711847708837ed39c80fa62ab704b649 gas/testsuite/gas/symver/symver1.d -1d6eb4d5a6cbf6ac541ca7d4c561b74f gas/testsuite/gas/symver/symver1.s -b44c04d7f2b689d60bccae544b854f95 gas/testsuite/gas/symver/symver2.l -7214f11688ed0284f53c3c060fa973bf gas/testsuite/gas/symver/symver2.s -d37568e052e76a50c9d4775eede01585 gas/testsuite/gas/symver/symver3.l -7f58a39bd0e6eda06fa15260adaa1044 gas/testsuite/gas/symver/symver3.s -aaf2746f913c7c81f487786bd9b99543 gas/testsuite/gas/symver/symver4.l -ff40f84c77b398ca408422048eb1684e gas/testsuite/gas/symver/symver4.s -c2401f7310b24ae252e1905a90fbb133 gas/testsuite/gas/symver/symver5.l -ed56c563fc819e4c50c4160a17f8abae gas/testsuite/gas/symver/symver5.s -a3a92a55022c0edb85d34af1d1739ee8 gas/testsuite/gas/symver/symver6.l -73c983230d1435795774501e7247e78c gas/testsuite/gas/symver/symver6.s -06219e9948de26c5c3c06e783256d8e5 gas/testsuite/gas/tic54x/address.d -78c05303f9f0cbc1a4610cafd8684961 gas/testsuite/gas/tic54x/address.s -fb347ccf07d51593edd432f687aa5376 gas/testsuite/gas/tic54x/addrfar.d -25c170a2e98a7b134c9d90c32965c1b3 gas/testsuite/gas/tic54x/align.d -59a3b1b5bc5d51e4f20df8ea41128d88 gas/testsuite/gas/tic54x/align.s -6b7b3e8e956870e9d7ce471e2a1b6ebf gas/testsuite/gas/tic54x/all-opcodes.d -16b138265d758ee38dbf89a41696f4b4 gas/testsuite/gas/tic54x/all-opcodes.s -6ed8469e573b882990ad930cd270b1b1 gas/testsuite/gas/tic54x/asg.d -64c9ec95e386f8e5d0040c26fee7321c gas/testsuite/gas/tic54x/asg.s -fcd7df0d00621d5b547d92bd23c4ca62 gas/testsuite/gas/tic54x/cons.d -671f83be79acf4e42032f33d828864ac gas/testsuite/gas/tic54x/cons.s -2f04f28d19f65600c0958cf168558a6d gas/testsuite/gas/tic54x/consfar.d -f29bcaee02fc92a68ccfdd32f6999527 gas/testsuite/gas/tic54x/extaddr.d -7eae8033cffbecce992afdaa9c339ff6 gas/testsuite/gas/tic54x/extaddr.s -953d25fcac101a1860be2b36bb61ec50 gas/testsuite/gas/tic54x/field.d -534ff025c4a332a0b3a4811c889d9637 gas/testsuite/gas/tic54x/field.s -e8334221e9d81711a8120983fc654f4b gas/testsuite/gas/tic54x/in_mlib.asm -6b81ff294df52cc2ee0cde1d128f3253 gas/testsuite/gas/tic54x/labels.d -aae9f04acb5f59969bf1f0465d7c78bd gas/testsuite/gas/tic54x/labels.inc -b745801cf3d0eb59ca1b1a583e26a0b1 gas/testsuite/gas/tic54x/labels.s -28e2dc705290da3c4d7010494599f100 gas/testsuite/gas/tic54x/loop.d -4a609e1f44de00f164f48203d5df870b gas/testsuite/gas/tic54x/loop.s -eb2b6fc38f9bd4793dd7020a05122e3b gas/testsuite/gas/tic54x/lp.d -2c650e0c313376b80d7a6950039ff3b4 gas/testsuite/gas/tic54x/lp.s -c8161a6bcb529ab6c94cfa3a3521e429 gas/testsuite/gas/tic54x/macro.d -d76d2e7a0d946a16279b4eeafcfa0cc7 gas/testsuite/gas/tic54x/macro.s -09c277ba1f7d69551c473cd20cbb14bd gas/testsuite/gas/tic54x/macro1.s -ddbfc019917d779c19002992f3929367 gas/testsuite/gas/tic54x/macros.lib -7ad5a03901cc52759b77b30e51f34875 gas/testsuite/gas/tic54x/math.d -1ff7d6cd1fb20b8cde42e82ea5e38dfa gas/testsuite/gas/tic54x/math.s -aa3b0bac4ffdf82c7a4b6121ec3fc560 gas/testsuite/gas/tic54x/opcodes.d -03c7d9751c849b0f4a04ce24d181e494 gas/testsuite/gas/tic54x/opcodes.s -d1f6def2d5b9c1a697baaa24128bc192 gas/testsuite/gas/tic54x/sections.d -4c9b7302923b60d63cd64bee9dd621d5 gas/testsuite/gas/tic54x/sections.s -41deec8226f138d357d5a06609ff7c1b gas/testsuite/gas/tic54x/set.d -cdf1f13fafc4d4abd831567cdda40eff gas/testsuite/gas/tic54x/set.s -cdf7f966b14c2ae2815b55e4b6eaa023 gas/testsuite/gas/tic54x/struct.d -28bcc7e09d20e59e1ccb70e318f45324 gas/testsuite/gas/tic54x/struct.s -3a49bc7e30027613e26e13d25b7f5dbd gas/testsuite/gas/tic54x/subsym.d -a6d4e40952285da31a31a7146766dc04 gas/testsuite/gas/tic54x/subsym.s -a3547e6b13dd61f04ad639ae18c38bb3 gas/testsuite/gas/tic54x/subsym1.s -b2df4dd8056e7236407bbc4c60b27b02 gas/testsuite/gas/tic54x/tic54x.exp -f3ab69523e22267482a9bb7a4ca35543 gas/testsuite/gas/tic80/align.lst -bed809ed517aeb7c1246209c7f5b0ede gas/testsuite/gas/tic80/add.d -98eb432f2b3667f4172bc7bf8279fae8 gas/testsuite/gas/tic80/add.lst -126505861238887b38542c2c007b4f44 gas/testsuite/gas/tic80/add.s -26a1a236ac7ccef8f9d5ae9f771a1e15 gas/testsuite/gas/tic80/align.d -e184de59b384a0b61f611f43fd0481db gas/testsuite/gas/tic80/bitnum.d -0bd85a81ad6b84115fb27616eec5abd5 gas/testsuite/gas/tic80/align.s -4e8424d297ee11749b57a2dec2bfd7be gas/testsuite/gas/tic80/bitnum.lst -8670ee2178617d2fab1746489ec22609 gas/testsuite/gas/tic80/bitnum.s -4d4729704be4f2a668a5b8f589fc6922 gas/testsuite/gas/tic80/ccode.d -ee5b688ae7df591cadc29f06f26845a0 gas/testsuite/gas/tic80/ccode.lst -2b9858d4ebadb84b9197d33ccc1422e1 gas/testsuite/gas/tic80/ccode.s -7a715f4871362014afea0032c8ab1bde gas/testsuite/gas/tic80/cregops.d -74aaf84be9651b7d468afe9d57016a6d gas/testsuite/gas/tic80/cregops.lst -ef4ba470d30ac045a040677b704ffc66 gas/testsuite/gas/tic80/cregops.s -626d4a37405c1c8ebc93a7be21c2a9b0 gas/testsuite/gas/tic80/endmask.d -46833c7025b93bab36f855a40a5be3ce gas/testsuite/gas/tic80/endmask.lst -00643dd65f546646666046d4e2cfdef5 gas/testsuite/gas/tic80/endmask.s -6fa3699cda567401f6236547132b0d20 gas/testsuite/gas/tic80/float.d -f97907246c6a0d4370a3b08b1f7d6829 gas/testsuite/gas/tic80/float.lst -e9392428f1929a6f12c8d0c5bfc7d95c gas/testsuite/gas/tic80/float.s -924d1ef98e49d0d881d7936c76795f26 gas/testsuite/gas/tic80/regops.d -68f717e98126f6612a5fa278576ffcb1 gas/testsuite/gas/tic80/regops.lst -16bbb022a6816956f454d4f141d87b8f gas/testsuite/gas/tic80/regops.s -ff82220cf29c5cd876cb0ba8a495695a gas/testsuite/gas/tic80/regops2.d -207cc576c6c79969fe4510ae1c0fb1e0 gas/testsuite/gas/tic80/regops2.lst -0e21bec7cf7231f015d0890f3c60c750 gas/testsuite/gas/tic80/regops2.s -cab98129d538fef49483e468bea9cab7 gas/testsuite/gas/tic80/regops3.d -fb72f4fadb5605b36c53f5c798139907 gas/testsuite/gas/tic80/regops3.lst -dca27d2d5b2888ad207b35cbb5a5c1bf gas/testsuite/gas/tic80/regops3.s -4a437df1abe33ea3d6b4a744dd1b3c71 gas/testsuite/gas/tic80/regops4.d -d127941ee0d43b5f508f2e40744df9fc gas/testsuite/gas/tic80/regops4.lst -610f8fb61cc924958615f15cbd3fb591 gas/testsuite/gas/tic80/regops4.s -987bf57eb106e1f96eef6b5a8add52c1 gas/testsuite/gas/tic80/relocs1.c -96d6b8f21498eb373bcd7cf1c0438c0c gas/testsuite/gas/tic80/relocs1.d -1932c15229e0d07381c8f8cea548fd75 gas/testsuite/gas/tic80/relocs1.lst -db5aaea7f4cbc104391f2a92ac06f28f gas/testsuite/gas/tic80/relocs1.s -22e1b37d7fdb2c192a1203a5e71a7fad gas/testsuite/gas/tic80/relocs1b.d -e53f695a65c5ec81a507b69f66537d65 gas/testsuite/gas/tic80/relocs2.c -420fdeac1619d019ca440ea87663d870 gas/testsuite/gas/tic80/relocs2.d -04fecb799cbd9447e058e8d53ed75ff4 gas/testsuite/gas/tic80/relocs2.lst -5c763a74cae5be60ace2421226e27631 gas/testsuite/gas/tic80/relocs2.s -2c1dc022a0f215dae6dea890f28798d8 gas/testsuite/gas/tic80/relocs2b.d -d7d5f18226711cd03767a8e2538cdbef gas/testsuite/gas/tic80/tic80.exp -ce0fc256b576a00b3292ad52441d079c gas/testsuite/gas/v850/basic.exp -b3daff1073feeab915c5d25268ab1d71 gas/testsuite/gas/v850/arith.s -d33db5351243bff28f76ada8284737dc gas/testsuite/gas/v850/branch.s -fd5263cb3409650f6bb2e9b610eab2d9 gas/testsuite/gas/v850/bit.s -e3d311e55349338e4876c3711ed91c46 gas/testsuite/gas/v850/compare.s -986292c2ba21464166aa337ab580a139 gas/testsuite/gas/v850/fepsw.s -5f8e79e5bec30791f19218a7ad23040d gas/testsuite/gas/v850/hilo.s -f7d87df456dee97f2d28be5a29afde0a gas/testsuite/gas/v850/hilo2.s -36254aabdcf9005f2dd8e7fba47de388 gas/testsuite/gas/v850/jumps.s -ee5a6da54e89a759bccef5da2ce4747e gas/testsuite/gas/v850/logical.s -79263247214c7d46c383e26aafc74d31 gas/testsuite/gas/v850/mem.s -2db16d6b7c2aa2cc17e621ac1da852eb gas/testsuite/gas/v850/misc.s -8c5fd0446e831223f93adebecec8a2b2 gas/testsuite/gas/v850/move.s -90c3465d11f275837ad5b9cac2dd51c4 gas/testsuite/gas/v850/range.s -10e8b025bce8af1b59c395fc5799236c gas/testsuite/gas/v850/reloc.s -9dab247181eb9a6ca08677f2b567cec0 gas/testsuite/gas/vax/quad.exp -c36a2f8942f73fe7a5550ba90d2ecfd7 gas/testsuite/gas/vax/quad.s -1e191c0d4f723e71c2f4f44b14cfa942 gas/testsuite/gas/vtable/entry0.d -bb679f23724eed5be0d4524e7f14005c gas/testsuite/gas/vtable/entry0.s -0b1998d125aec2d1e508c646ac5da657 gas/testsuite/gas/vtable/entry1.d -bb679f23724eed5be0d4524e7f14005c gas/testsuite/gas/vtable/entry1.s -64f7daf21aa03263ec1f75c8b4ebbebe gas/testsuite/gas/vtable/inherit0.d -a37bd60d99eb2ada7ec2360039dc1b4a gas/testsuite/gas/vtable/inherit0.s -a90dff346874aeab5a7833b62a12e5db gas/testsuite/gas/vtable/inherit1.l -fcc7f1b5a640e5714a1bcd9d50df7979 gas/testsuite/gas/vtable/inherit1.s -1b1f9e422b1d90576fac2ffee6256a9f gas/testsuite/gas/vtable/vtable.exp -5c08b2b199bcea246a03344173d3f96b gas/testsuite/gasp/assign.asm -99deacf6e3a96c8e21a453709af6ca01 gas/testsuite/gasp/INC1.H -a926c95abb0d81a9a764bed20ca06f0c gas/testsuite/gasp/INC2.H -269356bda8c304ef47bacd331b4fc968 gas/testsuite/gasp/mri/embed.asm -fd5ca6b2f3c6e59aa7040e532f28600e gas/testsuite/gasp/mri/embed.out -6b8744910f78aef4b165e287973af04f gas/testsuite/gasp/mri/exists.asm -ac5385c093c3023ebc8370ef66cf3b41 gas/testsuite/gasp/mri/exists.out -ceadf5cddc8000502be2f2fbc24cabec gas/testsuite/gasp/mri/irp.asm -c41e38e1116c0009a93516f09e86f839 gas/testsuite/gasp/mri/irp.out -728e6db3e88d2ddb22e424fc2e404dae gas/testsuite/gasp/mri/irpc.asm -c4d925d7fdc60ddafa773c5b7830cf2e gas/testsuite/gasp/mri/irpc.out -bc9ea91fe33eea9993f7dd5b737cb880 gas/testsuite/gasp/mri/macro.asm -8bf5e77911c284a34bfdf9c3f34d9e49 gas/testsuite/gasp/mri/macro.out -7a68842c90401e4b34071449715e0f0e gas/testsuite/gasp/mri/narg.asm -87693669559588c329af7213cd9c487a gas/testsuite/gasp/mri/narg.out -d0af25ef7f1c265d961ee9e088cf8276 gas/testsuite/gasp/mri/rept.asm -e2065f7a89c27a29049327cf8e31b18e gas/testsuite/gasp/mri/rept.out -563a4800e8b40729415090306bce6554 gas/testsuite/gasp/assign.err -42447b48e38c0caa7934fe72d48f1724 gas/testsuite/gasp/assign.out -7e11017965ff9319ca614e437e3b269a gas/testsuite/gasp/condass.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/condass.err -e7bf1012067a2a9008084234aea5c23c gas/testsuite/gasp/condass.out -03ec63f9050b6d77982db47bd7216cda gas/testsuite/gasp/crash.asm -f92c854daee87f8949312ec1faf02864 gas/testsuite/gasp/crash.err -9f1a1ec87f3fcc35cf3ab8f943ee0f04 gas/testsuite/gasp/crash.out -70aced41deb34edfe61b2888a0f2d2b4 gas/testsuite/gasp/crash1.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/crash1.err -a23d7921aa2ba917503b2994e53ddf1a gas/testsuite/gasp/crash1.out -0a6ae29a56ebe74b4f93dc149949dbe5 gas/testsuite/gasp/crash2.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/crash2.err -d18e176c99fab5d444ef8ef98ef476c1 gas/testsuite/gasp/crash2.out -e8e046b711151d3439e06411493b6b67 gas/testsuite/gasp/data.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/data.err -dd5d6726c6d3ab3b244367d15e5a33a5 gas/testsuite/gasp/data.out -d3a831ce902a2c7a641807d41bf060b3 gas/testsuite/gasp/exp.asm -635e19beab5dc8dbda0faae105390da5 gas/testsuite/gasp/exp.err -3cfa517a87ee6808108dd82d821a9142 gas/testsuite/gasp/exp.out -d9840554d6f6404180190fb46ecfa609 gas/testsuite/gasp/gasp.exp -6952d6e84b8eff6f8ad3735049384d9b gas/testsuite/gasp/include.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/include.err -38f5ce2c3d1abd4c85cbae3381a35d00 gas/testsuite/gasp/include.out -b336cf59f3381637b0bbc85903836f49 gas/testsuite/gasp/listing.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/listing.err -d64ca2c01c09d852ee97d0b9e283f427 gas/testsuite/gasp/listing.out -2cbe9e11582b63f485413fb0c8d4882a gas/testsuite/gasp/macro.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/macro.err -3aeb89bd83e0cf8b84c7281b5191ba07 gas/testsuite/gasp/macro.out -8111773c73a99298c21c45704eb6fa11 gas/testsuite/gasp/mdouble.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/mdouble.err -fbfd85681f676ecec67e21d8aa571bf6 gas/testsuite/gasp/mdouble.out -a7284cd713fd12560f811939fc784860 gas/testsuite/gasp/pl1.asm -76cefca44793036ef20556314fdafadd gas/testsuite/gasp/pl1.err -266d215f1b5b7d6743c3bb75be698654 gas/testsuite/gasp/pl1.out -b67a3bb2f6c1256c5252c8f3b6e76bfd gas/testsuite/gasp/pl2.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/pl2.err -21bd454e41c190fc028359db94f60626 gas/testsuite/gasp/pl2.out -80cb3c666405f7145b2a385fc6e4dfbd gas/testsuite/gasp/pl3.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/pl3.err -089301edb4b459a59d61ffcfe7d709dc gas/testsuite/gasp/pl3.out -b8410781da6854955ede10668b40acb0 gas/testsuite/gasp/pl4.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/pl4.err -4344b2df49ee03937e0e6757e9546441 gas/testsuite/gasp/pl4.out -f0836880911e25120d0e919a3e3c9a6e gas/testsuite/gasp/pl5.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/pl5.err -531bce879bdb6df7858a251b2489548c gas/testsuite/gasp/pl5.out -214848f5a01f2721b749c0d6d179fc7a gas/testsuite/gasp/pl6.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/pl6.err -6c5154a2e0886aa2ed34040e9fe697c4 gas/testsuite/gasp/pl6.out -ed7dc7cdd7cba3f7d2bfd972654e741b gas/testsuite/gasp/pl7.asm -76cefca44793036ef20556314fdafadd gas/testsuite/gasp/pl7.err -2b0bfdec74d0f2d405f6dcaf11e9cb9d gas/testsuite/gasp/pl7.out -c2ec7a594dd444a867ccb269a255c592 gas/testsuite/gasp/pl8.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/pl8.err -a01ab58299b4bbda08c5a55e3152301d gas/testsuite/gasp/pl8.out -1b8fdb309983468765a0f26231b7db2a gas/testsuite/gasp/pr7583.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/pr7583.err -a29f353fa5f949d2eb12b499baf3bd0c gas/testsuite/gasp/pr7583.out -f94a30de39715bba6e11b2720e2a7a24 gas/testsuite/gasp/reg.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/reg.err -129ad1aea55cbd6afe5b5e44c433ee57 gas/testsuite/gasp/reg.out -6287f41f28e5d0a372bcec00489a1fcc gas/testsuite/gasp/rep.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/rep.err -0d497169dff397f2e446fe23b5ee981f gas/testsuite/gasp/rep.out -a91feea67b9afd9c2d123299e917cdb2 gas/testsuite/gasp/repeat.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/repeat.err -7fe9d715fbf1f3e90c282b69c8a388af gas/testsuite/gasp/repeat.out -a0420f1482401d14d10ef4d4c8da644f gas/testsuite/gasp/reperr.asm -76cefca44793036ef20556314fdafadd gas/testsuite/gasp/reperr.err -f4c30bc7915f5d47168f3b47094c1449 gas/testsuite/gasp/reperr.out -e042647132f714b19a98c4ab535fcf69 gas/testsuite/gasp/reperr1.asm -527eea9a7e1feaa36aee5f84c4691465 gas/testsuite/gasp/reperr1.err -5bde34ef89fa801ac3eaf1c59f7d4763 gas/testsuite/gasp/reperr1.out -b4b91fe28ecaa31df9618a2a4a9e2a76 gas/testsuite/gasp/reperr2.asm -443731a66bbfcc1831647071a681f5b1 gas/testsuite/gasp/reperr2.err -a9f1da65b7f9da6492a84ce6296970fa gas/testsuite/gasp/reperr2.out -f85e0a8deb6e54c906e2750b42d7cfd2 gas/testsuite/gasp/reperr3.asm -4eeca830592748b13cde26461bac739b gas/testsuite/gasp/reperr3.err -2f151098b19ade3dad0cbef222e86a5d gas/testsuite/gasp/reperr3.out -1b326c95c48895d14dba16c01e763bb0 gas/testsuite/gasp/sdata.asm -0c62f96d2af905dfa64eb1427a600c11 gas/testsuite/gasp/sdata.err -657f7bdf02673edba4a055158e9cb587 gas/testsuite/gasp/sdata.out -6b52ad9f5150dfabecadf59651b01012 gas/testsuite/gasp/sfunc.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/sfunc.err -3f5c6078bb1164493fd7d975fa78134c gas/testsuite/gasp/sfunc.out -c928b32a65029c49d6add1539b555a17 gas/testsuite/gasp/t1.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/t1.err -37921430797b568a3ac395ffdcd1030c gas/testsuite/gasp/t1.out -94f4985650874fa3f2223be2ca97a494 gas/testsuite/gasp/t2.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/t2.err -e63f0cf737dcecca010288e940156820 gas/testsuite/gasp/t2.out -0aa649aaacfcdbf138acd6302e51444b gas/testsuite/gasp/t3.asm -76cefca44793036ef20556314fdafadd gas/testsuite/gasp/t3.err -cb8d602227b2b4e0ee0cbc24905b1c92 gas/testsuite/gasp/t3.out -65f971bbfd23b3e6f4f256550fa6c999 gas/testsuite/gasp/while.asm -d41d8cd98f00b204e9800998ecf8427e gas/testsuite/gasp/while.err -a68b47ff34892c8fa97aaf9cc09bc975 gas/testsuite/gasp/while.out -133e9f8bb4d12ac7e498f0ac5d0246c0 gas/testsuite/lib/doobjcmp -5725f8e58e03bd6026f3e2721e1db22e gas/testsuite/lib/doboth -aad4965bf0067bf9fb71acc19f7877d4 gas/testsuite/lib/dostriptest -bdf5e4dee40167a92f0a45965b0375b7 gas/testsuite/lib/dotest -af650aab07403b5a05623713b613856f gas/testsuite/lib/dounsreloc -30764ced5c424e3c2c384059cbe2a227 gas/testsuite/lib/dounssym -5cbf6643d54a0c593fffc5eb026afd65 gas/testsuite/lib/gas-defs.exp -d78aaf1191d033531d00fa9888214ee0 gas/testsuite/lib/gas-dg.exp -499042a4448e4b2d3bd2b2a1b0b5d859 gas/testsuite/lib/run -c25a2b439faecdbc5a8cd011fb753f1f gettext.m4 -f830d343ce09eb11786979f2ce0bf68d gprof/po/POTFILES.in -bfb5c178c2404196ab54d7532a61e3d4 gprof/po/Make-in -ba1bcadd6275dd4ce7f7663645c967ac gprof/po/gprof.pot -b167dc5dcf583c07feecea0f8003e647 gprof/.gdbinit -8b210aedaec55d2d7d197fc9fd49e2de gprof/ChangeLog -d618facc3e8ce8bf3d02ba452e1be6ab gprof/MAINTAINERS -deef5e76f10703bf9ad39c89e1900111 gprof/Makefile.am -eb9abc12601593ac6521d4786a708b77 gprof/Makefile.in -55be9544e8fe419300921fa44a0aa692 gprof/NOTES -84c06350a03466660f0f691ed1220657 gprof/TEST -62728c5b834e3893e5414a8bae9a99d8 gprof/TODO -b33dab2d2e4ea1694e3d63ff4715142b gprof/acconfig.h -2e77183c94ff25e517327793c2db2e55 gprof/acinclude.m4 -245c5c6842c9a94a0e48a3d8deeebe75 gprof/aclocal.m4 -e778a923257c810d68dec13fd488eb17 gprof/alpha.c -56d1218121151f1e7557f69ea5241ea0 gprof/basic_blocks.c -ca39735906fdd30d5e4123366e064b55 gprof/basic_blocks.h -fb26efc191946b1c391604afbadfe436 gprof/bb_exit_func.c -67083749ab9eb7b9869f600e24046960 gprof/bbconv.pl -25e7c14a812ac2befca1efaba7326de3 gprof/bsd_callg_bl.c -cadeef23b67be4bb67efb8d51c426a84 gprof/bsd_callg_bl.m -c2d75700c52ecc745ba87093070c2415 gprof/call_graph.c -aaf334303399885b664cb82016829e9a gprof/call_graph.h -d2d5dc44d4751291a986e067fc8487ed gprof/cg_arcs.c -f4b4564ff4855580d031efb91d6b96c8 gprof/cg_arcs.h -d698389b5fb62def7dca627e691f69f2 gprof/cg_dfn.c -9763120b90a70649f8da911568b308fc gprof/cg_dfn.h -f38dbd64edd9486f1caf893b22dc17b9 gprof/cg_print.c -0982459c755ac5d97b53a306ec100aba gprof/cg_print.h -b8cefe113dfdf660fcf039d46fec1d84 gprof/configure -55653a53a4dc8a073937819596bacfeb gprof/configure.in -6124e24af0d750f7ad26144e2e549e25 gprof/corefile.c -69ca0d5792b82ef544c23d1ad975c43e gprof/corefile.h -fb7920a70d8eba8b94fd446da371604e gprof/dep-in.sed -b25cb6184818f6bb4dea4962b70ea3bb gprof/flat_bl.c -d6498bb2d3ec24087785cd109c215067 gprof/flat_bl.m -8929b59fb940ea7c3d784d48d652200d gprof/fsf_callg_bl.c -609bbce6f5cedf6b0c8d25c3061b582a gprof/fsf_callg_bl.m -82f03d11db14e68944e0afe9b989de7d gprof/gconfig.in -95f54ce5c8c2dab23e194640fcd4e7cb gprof/gen-c-prog.awk -9478de676b8aef7172f520c48c6e7b6c gprof/gmon.h -c9a6058973dc17f9603ec7302347c6db gprof/gmon_io.c -16cff2f007a3be70b454770aaa01e8e5 gprof/gmon_io.h -2911752bcbb7d22a193dcc22d3c8abed gprof/gmon_out.h -24d890c7d2b01bf70a015038155504a2 gprof/gprof.1 -180ebbeb622b3f0a7e6f2373b0f9c5f0 gprof/gprof.c -1f49635b9990b75a4f482f23f80639df gprof/gprof.h -fd4e33072a67b1aed065e8a56a681c01 gprof/gprof.info -7a0a344dee265ffc777fed1dac3f40fd gprof/gprof.info-1 -e0558f0ebe0660c2f99b60e45aa3b86e gprof/gprof.info-2 -4f5a8f8d3c765480e3926b416714bb8b gprof/gprof.info-3 -cd3f0020f31b79a9b3c26e7066d24550 gprof/gprof.texi -774dcfa219e6de263957873db9bb656a gprof/hertz.c -02cf975780e3e9ea8f94840e5e907513 gprof/hertz.h -3e1ff6771e7e61c5838928f2c549d985 gprof/hist.c -6926b0108166d8ad8581e568f9c82b3d gprof/hist.h -de5f7a6bc76456fcde059a4c496dcbef gprof/i386.c -a41c773603a5e194a6a96222a73da05d gprof/search_list.c -a0c5df87181a20319a478d8f4c6aad8c gprof/search_list.h -b4d532476731b57e44ba662fc0cded13 gprof/source.c -9a6fbf36a7ef053211da8d84411a00c4 gprof/source.h -fb1a645046a0682ea7c81a99c9d58504 gprof/sparc.c -1ded054093de910d9786c62bc4fe8cc6 gprof/stamp-h.in -0317be88177207a78e64a3ca49783604 gprof/sym_ids.c -c5d1c00631c1434a38b4d75c37996a36 gprof/sym_ids.h -abcb4dccea34be3939eb77be053c32d1 gprof/symtab.c -7bc5ed3a10d3698b36cccd7ab92ee679 gprof/symtab.h -c53db119688d6704d758ca2c264eadfa gprof/tahoe.c -33ade2a875836fa6fe418757473dbe3e gprof/utils.c -9174a73ed79e0d552e57d09390065985 gprof/utils.h -80e67bdaa5940b70f9dd3aa7d3e7c1d1 gprof/vax.c -056e5ad4bbaad338a99f25d1c82a6b54 include/ChangeLog -94d55d512a9ba36caa9b7df079bae19f include/COPYING -6514be18199969dce1c96374a8d2f48f include/aout/ChangeLog -cc18d2a17ec338312f00622e1fa4692e include/aout/adobe.h -a7ad447d7a0696596a330bbe0e1bf620 include/aout/aout64.h -c6b08000298f64bb35885212da785e44 include/aout/ar.h -0b3a71cdc523174aee63e9db7b093187 include/aout/dynix3.h -64818c4cc3aab586e47bc9daa57ed4e2 include/aout/encap.h -d56e5b7b7841033c99960c96365579c4 include/aout/host.h -5d9fed058c072b61553cf62174a8e37e include/aout/hp.h -3b82142ce45a3be868eb0eda0a107c47 include/aout/hp300hpux.h -d82993bf02befd5682dcd44b076ad991 include/aout/hppa.h -e91c2c24d9be7b5cbfa6047d799cb850 include/aout/ranlib.h -d06f0176a5098d444f22d53fabc7c2e8 include/aout/reloc.h -7ab3b77967f4eb33111904b27f0796a2 include/aout/stab.def -4fc8401a176b5d472bc2a60e1a0917ab include/aout/stab_gnu.h -f76759c6246b1e8376e84e0c1d8ef6bc include/aout/sun4.h -e8f3b123eb50e26e1d38ca5af44d9ba1 include/coff/ChangeLog -19860cc610e4a705a4706e96d21c3b83 include/coff/a29k.h -552fa1e45d76f2c7892c12472a3ac391 include/coff/alpha.h -3b46257336484efd619c1d349f26758f include/coff/apollo.h -24e7f4f443444e67f0cf849662f36f90 include/coff/arm.h -7b2f28b2e4bf9e88bb4a23a3e96e99f6 include/coff/aux-coff.h -c6d820306c035dd8dd33743a04701097 include/coff/ecoff.h -5ef1801dfbf3fd9d07b95d8e5a075438 include/coff/go32exe.h -aa8789afe1c0c03506bfe72b6d03e557 include/coff/h8300.h -71e1ab83c4f3edad768f13096af183df include/coff/h8500.h -9f42dbf0d95444bb422133f705ae5b50 include/coff/i386.h -c4f8a3ba91f77c4dafc810968584c027 include/coff/i860.h -10948521baf96106b8b1a493b76e6428 include/coff/i960.h -37b14ce150fc5efb823f8a24bf036917 include/coff/ia64.h -4b9d948ced9fa1991bc044284eda23a2 include/coff/internal.h -f2d5296a6f39f7cb8b11123dc2e9446a include/coff/m68k.h -2ec742a1917661fce2c9a968c67742cd include/coff/m88k.h -ad94876330906bc5cd98ce46ecb3147c include/coff/mcore.h -d78f43558e5749316731ff8da7afbee2 include/coff/mips.h -e592618085487f0bc467ae02d7ebdf27 include/coff/mipspe.h -bbe77385f8f20e3871cd2a3310348376 include/coff/pe.h -c0a52b2daa52523bc0c4a5958af2a055 include/coff/powerpc.h -ca7551ab79d241ffbb45086318f24ec5 include/coff/rs6000.h -58270182d29df55e7ebac9935b7ce813 include/coff/rs6k64.h -6863d4494aaa304631d878c6c0d32bae include/coff/sh.h -d93e26806dd11c6c492db5f4cfc50dbc include/coff/sparc.h -49952fda1e759e5aa659f8f78d7e0ba0 include/coff/sym.h -ac2f6431d01bacf541ecc3e5e8dc5499 include/coff/symconst.h -d404152f19d5fd917f5c213cab9dfe55 include/coff/ti.h -a943e5f95323f5c3a0d0cc76899b3157 include/coff/tic30.h -00a943a23f99cb26ae4ef0f1cd874052 include/coff/tic54x.h -2bea3280a510b0e60456554172c30f7d include/coff/tic80.h -8243e196db4d55775bea63595f65cdc3 include/coff/w65.h -f65be1056446cc9f95448245334c9346 include/coff/we32k.h -5b68b9272205b8a20a37a7244f936e54 include/coff/z8k.h -d618facc3e8ce8bf3d02ba452e1be6ab include/MAINTAINERS -de46742edca3a9276eefa5ae8fdee5eb include/alloca-conf.h -15001c35bd6d66101a28ff4d4f48c6b9 include/ansidecl.h -2aa37081b825fc7f9371fb2f2bb14477 include/bfdlink.h -e4247635fdf4b4f00f70e8d0fb756cf7 include/bin-bugs.h -0134165067ac86d517e032aa5a861e4c include/bout.h -c4f59b0838482455edea3d3ec13bfe62 include/callback.h -96b8f1978567a85a54e7985a848d1bed include/demangle.h -68e677849a73047588da295c7b37165e include/dis-asm.h -bdf2bd343ec6e5fb41e946812accd405 include/dyn-string.h -df592480ae2f45f93360b1f1270756ab include/filenames.h -8a01536b114929e73727fdd96b0f39b0 include/floatformat.h -d54eb7868908574db9965575a16c1819 include/fnmatch.h -b2cd17a9267bc2e92df461d3170cb15c include/fopen-bin.h -87444b5c85b3c2bc734f8b86157b15db include/fopen-same.h -2f3ef0265ac665d61a8721a78c47a79f include/fopen-vms.h -7b08d623511997558fcc99b0df47efc5 include/gdbm.h -3a8f21303285c19af2ff8a2d88c9599d include/getopt.h -0a7705129476cbc81cb4a95a69b5177a include/hashtab.h -09291cabd10c827ec23605fd27575d8b include/hp-symtab.h -4140d269a4d719013db3beba8f684572 include/ieee.h -39f09bdf2a300b24072642a1bb540149 include/libiberty.h -e1b9929975775d9831fb9d726e48230e include/md5.h -07de9606e88a074c745d5bbcd835c1e2 include/oasys.h -88d315194393cec8fa190539965d5113 include/objalloc.h -63b71216672f5453f509d6111030e0ef include/obstack.h -82709f401badc29ca812065155ff60b9 include/os9k.h -a9720ee19979bb321c07fabfa9c50bea include/partition.h -d011632065e457c8589b28d0c53e5b04 include/progress.h -8a280b18f0cabe5ebf764a3030dd481a include/remote-sim.h -12f13d7f77320135261fd50e0abd94ba include/safe-ctype.h -c8670b4767badb71a4da8a851b014eee include/sim-d10v.h -866d60698fbecc154ad3cf29e029ebc6 include/sort.h -d8d1601c2d1ee96513826d0cba20ba1b include/splay-tree.h -4ebaa58a8bcb2ad62a520447123446ed include/symcat.h -dbea2ed322e7ea959fc2a2c3949d01ef include/elf/ChangeLog -f42fa13c6c33a69368f7ba26963fe866 include/elf/alpha.h -3bf4ae3474c9c4b8310da4a84aec1dca include/elf/arc.h -2fe80e192d9659bea7b0bdaa31aa149e include/elf/arm.h -58a80a77bf1669d85ca0d6095e6e85b4 include/elf/avr.h -2cfc0b1bf4c1d7d5bc9fdfe215f72619 include/elf/common.h -81b2f401fb8c6bff37f28f811a70210b include/elf/cris.h -f65a19cb8f5a2d53a4c0f71c90bef0e7 include/elf/d10v.h -e1bbf4eba14b2efe2dd202e9a7038bd1 include/elf/d30v.h -d350084ff96d123c4ee539745ed1ef2c include/elf/dwarf.h -744b35dfe0baf98be9bc289bd0f00448 include/elf/dwarf2.h -bd2e0d99c91c060a6afd29a774572ae9 include/elf/external.h -2adb44173bb9ba06c13aef464c4701a3 include/elf/fr30.h -0899399867f5ede8459434cb58862e61 include/elf/hppa.h -3244632ab2a049af0ebcef9b16c9f0b5 include/elf/i370.h -91ea37d0949ed5198393c4e36cac949b include/elf/i386.h -6e10443e0f1746964a6cc3fa883215b5 include/elf/i860.h -4f6c7e8248b9ec284b181a55ff15a17a include/elf/i960.h -2e5a2836ae170cd5df905e1badfb6c6f include/elf/ia64.h -57a2acfa4c0f4764f1f181b0deee1741 include/elf/internal.h -f2816b5aaef73516d44b235aa098e22a include/elf/m32r.h -d289b5c4850dd5c1979d66a9568ad9db include/elf/m68hc11.h -c8eda6e35260f4d7f9897ad95a2248c5 include/elf/m68k.h -97ed3477e1b76ff78e6ae3c361506869 include/elf/mcore.h -d2fdeb878c7b8c208630b9a9a2ff5e84 include/elf/mips.h -9090a0078b91916eb138a6e96ba1ffab include/elf/mn10200.h -238dcb5869243682d1de4b464c288fbc include/elf/mn10300.h -f9cffe9859496c157656bbd3a7b7459f include/elf/pj.h -9d168cba90f8b5bd18e49bd33876f3c5 include/elf/ppc.h -883bdfc4fbbbd6a89013a5522ce509f9 include/elf/reloc-macros.h -5f9856492ae08f28a4a37826e7398365 include/elf/sh.h -36bd8460c99395fd2c73b66e5882380e include/elf/sparc.h -3aa9b74a41a552e5cff4d62cdb2017db include/elf/v850.h -a02d6617c483d114704d8b89e7af3e0c include/elf/x86-64.h -5dbb507e309b9fe20c45d16972bfb936 include/mpw/sys/resource.h -6bc56500657f8c3b71b20af4c69e967f include/mpw/sys/file.h -6bc56500657f8c3b71b20af4c69e967f include/mpw/sys/param.h -745d20e08d92b71d289da383e8a47168 include/mpw/sys/stat.h -99098422e0de596f6a2e552220346da7 include/mpw/sys/time.h -009a0ee881c63ae879dd80dde06daca5 include/mpw/sys/types.h -34d253468a44fc96db48e38814a2e4ce include/mpw/ChangeLog -ac05e56eb8acd390d0fa557abc21380d include/mpw/README -d1c1f4e66376b9ef2e8d4c79446503ba include/mpw/dir.h -c293cf9a745465e2371edda6e3f700d5 include/mpw/dirent.h -fd0c0ec6483a6ac794cfe370f323c8e7 include/mpw/fcntl.h -211595cb825444acd3656a8172a3261c include/mpw/grp.h -7a2ba7b6e2b168f335e8d53b1003ab24 include/mpw/mpw.h -32f1e7dc45c3a15418ec5e0998f1f8f3 include/mpw/pwd.h -55d48ac5e6e6ef01dcad00aeb8b33831 include/mpw/spin.h -043c8982bc0ff4fd987727abd7341aa9 include/mpw/stat.h -94cd8a35a9f625ee6a4d19ef2a481042 include/mpw/utime.h -30ab289a4d9376ba8ec961019e3c291c include/mpw/varargs.h -17e1d26830cfdfcfd3f10ac77b0fbca8 include/nlm/ChangeLog -ee9fe4c84a50cb6d303eb3848fbd6eba include/nlm/alpha-ext.h -cd1bbe2052d94d6d0ba5892f15b1d48a include/nlm/common.h -3c99c8ba8f85e2cb10829f35e3223113 include/nlm/external.h -119b651e264af67466b26517fa1ab516 include/nlm/i386-ext.h -83eee47917743f8eadb3cab94449dbee include/nlm/internal.h -5446642ff3b9fee027d46b00a0cd9383 include/nlm/ppc-ext.h -12311cd52e4c3cbb45b2f8eb775cc8c4 include/nlm/sparc32-ext.h -de353dec3d3156369ebeda0962c5b39e include/opcode/ChangeLog -462ffbe74d2be5d6f8607b4f072e53f5 include/opcode/a29k.h -0c6d0efab2da874133036face81c3666 include/opcode/alpha.h -0281afdeeedaeafda7a17fd25a67ec00 include/opcode/arc.h -f51724681cb616b8ddaa4ed0aacb67fb include/opcode/arm.h -98fab9ee305c764c0d98bdaa52ddb874 include/opcode/avr.h -32ab4453846d992862d569d9873ba281 include/opcode/cgen.h -b68941a9545d607ec5245a96ccd399c9 include/opcode/convex.h -58d48256e88159d47d7911df439e43f3 include/opcode/cris.h -ac443bb309a4a778383af46b6f101901 include/opcode/d10v.h -61819e55d807e7953d1864c88ba74c1c include/opcode/d30v.h -38c8a41b5a691d7f48cfa40495e0c5a2 include/opcode/h8300.h -b74df8d0c0456132c090adf9b7173a65 include/opcode/hppa.h -7e3c952acc4568fdd1d873147e3c0d2d include/opcode/i370.h -ba1c64016e7e1949f14a81b15651e106 include/opcode/i386.h -b2d9c35e0647c729335b50866309ed9b include/opcode/i860.h -10654d7ed7402428c40546e33e5f147c include/opcode/i960.h -05bf164aa56c4c5ab3dcb35d8785aac1 include/opcode/ia64.h -7628171c45c02183c4c952b6760ebcdd include/opcode/m68hc11.h -ba270bed72f4cbb17d70d9964a2779c7 include/opcode/m68k.h -fad6ef73bfcbcf77fb6ff04c05d2b215 include/opcode/m88k.h -5a1abd8839180eaa24ffd1dff62739f9 include/opcode/mips.h -43e315bf6f41c74ceeb8422191c76ffb include/opcode/mn10200.h -ad7ece4aed093a098c3ea27047837dad include/opcode/mn10300.h -f08f60834808b211b5ea9531e53bfd49 include/opcode/np1.h -8201356f4327535622d9aaefab8f7e42 include/opcode/ns32k.h -2686b284377642c3a6afb790785808f4 include/opcode/pj.h -10a57ede0f7fe1825b0412223edf5852 include/opcode/pn.h -56e3e2af3e522292571f6a8b18255f99 include/opcode/ppc.h -57b6865994b962b82214d3e543408f2a include/opcode/pyr.h -67834671955468c7dcaf51979772ef9c include/opcode/sparc.h -c69e19287023c929ac20ee5311acfadc include/opcode/tahoe.h -2b0f365ad336acad633a116537cfd018 include/opcode/tic30.h -f6d161f577d67533b30aa8fa85ca3c33 include/opcode/tic54x.h -d2c9644c874999bbb1f275ebf8adea86 include/opcode/tic80.h -f02fe800bd8571f3e2677aa2c3a06c90 include/opcode/v850.h -e78acf38376a53ce9ac029cdd1c4d560 include/opcode/vax.h -d41d8cd98f00b204e9800998ecf8427e include/regs/ChangeLog -5afe8eb5573965dfb58378e4e46f3813 install-sh -c3f98161a09663d4152a318793fde272 intl/ChangeLog -e824af0ffcae539e52cac31fa3faf1d5 intl/Makefile.in -ee2ff1244c36ed348643bd1a51001f4f intl/acconfig.h -6e16646448de7fab92862eefbdcca179 intl/aclocal.m4 -da7585912c32cc902a40682c188c9c76 intl/bindtextdom.c -caa3581b00edb0a7d3811a24a3e46c5c intl/cat-compat.c -da5e55ccdeae42d336d8f9225cebfd75 intl/config.h -bd51dd1c7684c9f15ee4532bfd7bf12f intl/config.in -05c6a93ed8c2801c09dfe15e6cd47452 intl/config.status -2f9be0885ee6447a29fd0550b52c40aa intl/configure -eb4685d54a1e3da00cab275a5c3fa6c4 intl/configure.in -b542cbb1c1c4a9dfac867172246e0a20 intl/dcgettext.c -63df19e31e5f6a6df817da915b44ed3d intl/dgettext.c -4db7c1b94ee4cda24bc74474f3a59a3e intl/explodename.c -4b12bb77b2d9d268b8ec6ee39d12c4a8 intl/finddomain.c -a3f9f228e0044a48c00cf5970b8be258 intl/gettext.c -2ba9a94b32d0c8056e617e85ad7a994a intl/gettext.h -5f9d7d7a72a3e8e42034c55b5c7f83eb intl/gettextP.h -5fca7fa018536a827790bf56e384cb5d intl/hash-string.h -93e4ab4b2eba5d2b8a36e1b2380190c5 intl/intl-compat.c -f00903218b78761c55cd76aea43e0cad intl/intlh.inst.in -3ee800e1115b811c49bd4f0b8a6a65aa intl/l10nflist.c -792fd16022a69b1321042701c46218d0 intl/libgettext.h -07e60d7ada1d5cf14da1c4c2823feaf0 intl/libintl.glibc -88c9303406b57aeed1f313b827c28e3a intl/linux-msg.sed -bc7989f895f4e4e38d43419dc0f4777b intl/loadinfo.h -441f20d1c11229acbe9eb350b162548a intl/loadmsgcat.c -122fc9bc010467ff915e57aa7114a780 intl/localealias.c -606344532ffc07b36812c0d04acb1f38 intl/po2tbl.sed.in -1ded054093de910d9786c62bc4fe8cc6 intl/stamp-h -6283160be713ad0dc1102617ada6fa54 intl/textdomain.c -0be261721efcbc3f04680d99e149f18a intl/xopen-msg.sed -c289dc63e731d4a1da809249e0922832 ld/emulparams/aixppc.sh -2e897117043ad88f2c7bcf35a606d76b ld/emulparams/README -4f6b4154113438f7481f4661d09daabe ld/emulparams/a29k.sh -b313a6fa271657abd14511455050cdb2 ld/emulparams/aixrs6.sh -29fda341c48f8b90fbf258b6d475867e ld/emulparams/alpha.sh -91e308e524924e29bc43412f89a2fead ld/emulparams/arcelf.sh -2e08024e0d4b3c527d426e134d4af1ef ld/emulparams/arm_epoc_pe.sh -a061559a038d4e5b1efe929656c6eabd ld/emulparams/armaoutb.sh -a419e5e9b54e9511306099d0f8ddf0a5 ld/emulparams/armaoutl.sh -d7a431dc9e8878378179623ccf9bfb47 ld/emulparams/armcoff.sh -b89887d1de91912a100a09e766faafeb ld/emulparams/armelf.sh -27ee98332d14972c9906e52f38dbc915 ld/emulparams/armelf_linux.sh -4e88bc5535572c27ad8e22ea4f245202 ld/emulparams/armelf_oabi.sh -0f7bcbd8a14e3f6392834cf18fde47fb ld/emulparams/armnbsd.sh -f8974ac24d96f452ff36b40a6203383d ld/emulparams/armpe.sh -d054a3453b323338552bb636ebb8e116 ld/emulparams/avr1200.sh -35959d43d0a857cea44143e597becec1 ld/emulparams/avr23xx.sh -6bce86ca67f3e0d62294eb9bd2635402 ld/emulparams/avr4433.sh -3c8c6bed009efce2bf0242ef1d003245 ld/emulparams/avr44x4.sh -b79ca66a017af6b2cc9612337262291c ld/emulparams/avr85xx.sh -d612b547d13f97624ad3cabe1406a152 ld/emulparams/avrmega103.sh -b9db3ff305090194178987e80d8ed449 ld/emulparams/avrmega161.sh -fe83397f7a2e0de4d02d04b61f229a25 ld/emulparams/avrmega603.sh -d47b82239f4ac8c14355a94378cf39b7 ld/emulparams/coff_sparc.sh -2106e6a6c645d248df9265a8408980c2 ld/emulparams/crisaout.sh -ce0b745d5a04bfd7bb575b1c7180641e ld/emulparams/criself.sh -57b93a092a4cac65e988765446eb13da ld/emulparams/crislinux.sh -4e68ea19373cca478057e6a64814e143 ld/emulparams/d10velf.sh -17e84454d13546953021ef10207da62f ld/emulparams/d30v_e.sh -094a88671f30762402b9e5c78e4e3e9e ld/emulparams/d30v_o.sh -b904add983e2aa12033b4c8812a73cb4 ld/emulparams/d30velf.sh -162d7cba8938432d260e1e9321bf43ce ld/emulparams/delta68.sh -e8fa19901f4c10300649e6c2d30be9f8 ld/emulparams/ebmon29k.sh -b30522a3c37bc370dfe45f546cca3127 ld/emulparams/elf32_i860.sh -3d9de5e9ff61c57dfe7cae3508863c7f ld/emulparams/elf32_i960.sh -5521057ee51d04b9c5be955ad01fa01d ld/emulparams/elf32_sparc.sh -1dd17564c9aff8b6c2e40e7a9f571b7a ld/emulparams/elf32b4300.sh -f64269d5383ab08f0c9e5b79c788caf0 ld/emulparams/elf32bmip.sh -989be87f670515d0a102da2ee6102e7c ld/emulparams/elf32bmipn32.sh -52f1a6b5e20bd996dc715168c8700d56 ld/emulparams/elf32bsmip.sh -09ad12c799e0de160ea05b5e2c67977d ld/emulparams/elf32btsmip.sh -41c14a8d73070481da1f2559785322b0 ld/emulparams/elf32ebmip.sh -6f124bd5baf085b40380db07a4ba7c2e ld/emulparams/elf32elmip.sh -ed5f10fa7edc2674622078dbfd378434 ld/emulparams/elf32fr30.sh -8c345571cb4a1d16f3335639204f1b3b ld/emulparams/elf32i370.sh -e6c4955bf2db80c6964e66af709f05cb ld/emulparams/elf32l4300.sh -0fc4b854a11f17219053f735f3f6cec2 ld/emulparams/elf32lmip.sh -1e20413e271fd05e253b187172ba8137 ld/emulparams/elf32lppc.sh -92f6cc4fe8ca41fb6e6d15cd4f72838f ld/emulparams/elf32lppcsim.sh -1143fb3d9743c026ec587df088bd31f8 ld/emulparams/elf32lsmip.sh -f3acecc64f5801ead7fcc37b95faa23f ld/emulparams/elf32ltsmip.sh -b0bd40fd4790073da2ca8a139dd5abbb ld/emulparams/elf32mcore.sh -5e3d03a5417dbd051c0f465b832d15d4 ld/emulparams/elf32ppc.sh -2d539f783dfb7d0fe71e2554f4b14841 ld/emulparams/elf32ppclinux.sh -7790d9c91fc199cc51434abe289bf438 ld/emulparams/elf32ppcsim.sh -792c26246fde59e0f132bb33c4039b48 ld/emulparams/elf64_ia64.sh -7448f80602579636b9e1898cd5a37228 ld/emulparams/elf64_sparc.sh -ed729adb5c8420afe7245240e95db0f1 ld/emulparams/elf64alpha.sh -769fdd8cbe0bf5e72ca8dca7d78d3259 ld/emulparams/elf64bmip.sh -8135eedeb358358243d545461b0090dd ld/emulparams/elf64btsmip.sh -ff249db25e56dc6b03a8b61eb8a89070 ld/emulparams/elf64hppa.sh -e3f95201ea2635af31251e96b95d75c6 ld/emulparams/elf64ltsmip.sh -7ebad7c632abef6e016c94541d4ad30b ld/emulparams/elf_i386.sh -e853a2e087ac512a0cfa5ffc4baa6474 ld/emulparams/elf_i386_be.sh -05e655e5b9bba0d20b4020d660720f56 ld/emulparams/elf_i386_chaos.sh -b48b2c27f9bc85ff6c979aafcdf82bf3 ld/emulparams/elf_x86_64.sh -a12d58b36cd6e31986d7515c77fec3af ld/emulparams/gld960.sh -16e204dd1b3a385eb2dcf14ccddaa50a ld/emulparams/gld960coff.sh -3a7b9aaf11eae3f3cbd21b6220434ad0 ld/emulparams/h8300.sh -38e60b173489d53692974c5b6a04cfb9 ld/emulparams/h8300h.sh -f9d708a8c553ed19183a1f638fe633b4 ld/emulparams/h8300s.sh -b3b0d0be943fd5517fbc171778f63de0 ld/emulparams/h8500.sh -6dabd6ffde56b2445c38969243d3575e ld/emulparams/h8500b.sh -6d71814235108ce0faa35813c1959495 ld/emulparams/h8500c.sh -e8b9174ddad38feceda59af2dbec0d09 ld/emulparams/h8500m.sh -f0a112f331b4c6bfbfbb1895cdd63eff ld/emulparams/h8500s.sh -54b7e862187330b80b6314b2c1c1b05e ld/emulparams/hp300bsd.sh -4bbb1b67f14d1e124683aecbd19e69cf ld/emulparams/hp3hpux.sh -7af6e1ad74bc71f864b9c04412f1bebc ld/emulparams/hppaelf.sh -dbcd064517314bc119e4b54ae7847284 ld/emulparams/hppalinux.sh -0537af9ab3953ed67d099959cd4e181c ld/emulparams/i386aout.sh -5ed1f528a6752f2ed12d48977cc43da1 ld/emulparams/i386beos.sh -ca54144cdb2703b51ceb13bc03e36c83 ld/emulparams/i386bsd.sh -d05a50688386622b8ad4e4c1f2286662 ld/emulparams/i386coff.sh -8d213758c362dee91c9aca3fe2521321 ld/emulparams/i386go32.sh -da7411bcf5fc48e4739d94a108c64f56 ld/emulparams/i386linux.sh -7d2e038dbd7439a23c353688c7ff6087 ld/emulparams/i386lynx.sh -fdc6893b38868d4006e1d62edc5a09bd ld/emulparams/i386mach.sh -63dc5bed51de89c74fdfb27b20c5dcc9 ld/emulparams/i386moss.sh -95e2973323b32d1896c6e19758582b09 ld/emulparams/i386msdos.sh -fd44b883579ad95580bf3cae88bd91b4 ld/emulparams/i386nbsd.sh -5714ea774490dece5da92c0fc5c72d77 ld/emulparams/i386nw.sh -189c01efee7710b9d1b107f60db173a9 ld/emulparams/i386pe.sh -168c0e6c22de9f60b4cfd893a1e0a4f0 ld/emulparams/i386pe_posix.sh -50cd18f6ac43ffed547adab63eaf7fd0 ld/emulparams/lnk960.sh -02117bc90d8d122568f4695bb15d61b7 ld/emulparams/m32relf.sh -17f327870e9d5f2b67bb6767084eae64 ld/emulparams/m68hc11elf.sh -f11b453814e07dfe2f126c575f25db31 ld/emulparams/m68hc11elfb.sh -30b81dcf1f3db68cdb1e15bce5b41d78 ld/emulparams/m68hc12elf.sh -7d1044ca8b044c1a519d8db2db658577 ld/emulparams/m68hc12elfb.sh -2c03157a829a79d93b2ca4b5005f032a ld/emulparams/m68k4knbsd.sh -173818cf70910edb066aa57cbad66829 ld/emulparams/m68kaout.sh -00b17c39c4dcf1058751dc07f30dbea3 ld/emulparams/m68kaux.sh -f0580d8a518bcc77032874c9cb72809d ld/emulparams/m68kcoff.sh -d82fefa828fc4538f17bb3f788352154 ld/emulparams/m68kelf.sh -7d5b500c05a8f5cd0eccbbc81dc99139 ld/emulparams/m68klinux.sh -89788f2245a4c41e33afab79e70e6bb7 ld/emulparams/m68klynx.sh -37404d78456eeb52a674a4dcbbb9bb36 ld/emulparams/m68knbsd.sh -13f758bfc68e72e4e1df1cc8e8b01407 ld/emulparams/m68kpsos.sh -71a6bb6cc26e527411df45774831e1fc ld/emulparams/m88kbcs.sh -f1fa919d1c7900c6c69ad1137c008524 ld/emulparams/mcorepe.sh -6c5efc2d80801d3ab24a03f11d108e39 ld/emulparams/mipsbig.sh -8589776726fb0a88568b9dbda5660c35 ld/emulparams/mipsbsd.sh -9b4dac4f3c4dcd64fa56cef06eff44fa ld/emulparams/mipsidt.sh -a9f7e459186328fe620a7923de39340c ld/emulparams/mipsidtl.sh -60661603c73c5ec9883d1f65e561e2d6 ld/emulparams/mipslit.sh -8cb42fe6977ca6c642cb7b96a9b0fda0 ld/emulparams/mipslnews.sh -1e83e0caf4fa27128375fc0ee5b0d362 ld/emulparams/mipspe.sh -cb9ddc7149bdc45e4894ad3c5f7043dc ld/emulparams/mn10200.sh -16199cff84a98df6ed43d1032f86d4ac ld/emulparams/mn10300.sh -49337298ecef7c4e2569237b614c9675 ld/emulparams/news.sh -a712bce9b19b7554abdf8de63140c88e ld/emulparams/ns32knbsd.sh -a9ad37848e6c339a4fe81f322c3f3390 ld/emulparams/pc532macha.sh -332eddb90f3e1d4a5a320243735ebf5c ld/emulparams/pjelf.sh -8e2b9fce572d19af6ce84e6efbb74add ld/emulparams/pjlelf.sh -cbcbc06cb401fb2074140cb8b535d4e8 ld/emulparams/ppcmacos.sh -f71b3cd563ff272019f928ca9cbd0eba ld/emulparams/ppcnw.sh -762b6a9cb39066b56d9cee03286dcf82 ld/emulparams/ppcpe.sh -ff7570d6bf2e39ba10e74a394052028b ld/emulparams/riscix.sh -e1c80afa234bc21751979b515fb688e2 ld/emulparams/sa29200.sh -f363ccd6fc740ceec31fa8001cf2e9a0 ld/emulparams/sh.sh -131aec9365eaee35bf7d15d9e28dec96 ld/emulparams/shelf.sh -8b4b3eed32de796acbcf4a2b11a83e3b ld/emulparams/shelf_linux.sh -0806db54e70993cecdd7023f339e4d39 ld/emulparams/shl.sh -70d54bfad0f08afc691f19192fb244f8 ld/emulparams/shlelf.sh -d1cb0ddcc185836f97a39dd37a0f49cb ld/emulparams/shlelf_linux.sh -a316da8cf4e620c00377e161b3a15fa0 ld/emulparams/shpe.sh -6062ec8406144fbbe4ad32e193a7ac04 ld/emulparams/sparcaout.sh -16bbfb9268886d428a81d42f007c5f20 ld/emulparams/sparclinux.sh -d004a32b2e6edcc69d900c2207bcbbbb ld/emulparams/sparclynx.sh -957bd3e925d255ac965dde1aa7303f40 ld/emulparams/sparcnbsd.sh -8f86834d923d64e45861594e4dc8c457 ld/emulparams/st2000.sh -f8ff78cfcc19d1d4389a84330615a363 ld/emulparams/sun3.sh -04380fc27e6223ffc89d2b43f9421434 ld/emulparams/sun4.sh -5d10f221cc393b1ae1719132de13f3da ld/emulparams/tic30aout.sh -4fc903e37671053625509f7486c63816 ld/emulparams/tic30coff.sh -aead097a3385a27cba7210470e150a10 ld/emulparams/tic54xcoff.sh -786ca05591eada9f7fbf7d5804dc0b81 ld/emulparams/tic80coff.sh -31a5bc747cdaf134204652bf78e61771 ld/emulparams/v850.sh -060bf2672cf53a505f23d413017e0be4 ld/emulparams/vanilla.sh -1689044462ea8c0a614ff1b3a91a0192 ld/emulparams/vax.sh -1e240622a795d134bad0e8a60460b9ae ld/emulparams/vsta.sh -7efc4f8c9d1eca2e14084bcd65535b9a ld/emulparams/w65.sh -cd93ec9e7e74cadfaf8044cca1581111 ld/emulparams/z8001.sh -8890ef4fad0e25044c8d3200a9e77ee7 ld/emulparams/z8002.sh -2a5cb94cef3195c5006cbcccd4ea6a78 ld/ChangeLog -1ae0cd65c8a7fb4e347f5a8584cafd1a ld/ChangeLog-9197 -2e154e4e100af48493f6fa789d4517ae ld/ChangeLog-9899 -d618facc3e8ce8bf3d02ba452e1be6ab ld/MAINTAINERS -52fe75d2d3eacdf3865e9968e646030f ld/Makefile.am -4be7a6136d60892a1971cbfbbdd19a6e ld/Makefile.in -8adc4dd7a7707cade1f72f88c49b818a ld/NEWS -d3f15e73b68c6d694e6eddcdc11f1f04 ld/README -01627b664c7e61ab5dc202bb72913e0a ld/TODO -b802b0cc52e6c72a326c11a64c8155a0 ld/acinclude.m4 -f1734965ff3907806ff585fdbcda515d ld/aclocal.m4 -bcd1abcd9f55cd39380e86555cd04488 ld/config.in -bdcfe9939e2b527a2c7ac3a4cbd09f6b ld/configure -59c74394349437e37d4c7e5284aecb50 ld/configure.host -a6a60d7fb5c82dde521faa647f2b2f49 ld/configure.in -d4092cb236ed20c3872e350b7e3863a4 ld/configure.tgt -d3d9eb4581bec474a3cf465160b1371e ld/deffile.h -37e7fb1b97db43bb03690e4e7468f8ee ld/deffilep.y -93fbfa053ffcf82c36613c2e7ca30eda ld/dep-in.sed -e2677a696ed870d444e53cf69e8a69f6 ld/gen-doc.texi -5a7a6887613081ade332f14f1262f907 ld/genscripts.sh -d3d6fc53e5f8d5e5f962266911f0441b ld/h8-doc.texi -a9ea9d042e8f202d1ae318bb4dcdeda6 ld/ld.1 -dc12c63e536bb4d30122799fcfcd61b2 ld/ld.h -9af8fa62657be80f73f1c25215971bcb ld/ld.info -8f0d53a6eedd7210635c279880569300 ld/ld.info-1 -b9e92eaf7909800eb27222331671da4f ld/ld.info-2 -d514b36ea675f9b1770d33101fe77c92 ld/ld.info-3 -84441dd528c1fc2bf3e446b0a20a240b ld/ld.info-4 -07f47d1279b089736e2bfa62102b1ad0 ld/ld.info-5 -c35193580f679ead6fe0137ced6ada69 ld/ld.info-6 -34c8d5659cc0bc70a2448f8e260d73ea ld/ld.texinfo -42041e4e16e2fe5e78b67fbead7a431b ld/ldcref.c -bdd86d7671d31e05370e5c4dd6563c27 ld/ldctor.c -5feb38f9fdfff03477a2e903ab3b0a9a ld/ldctor.h -eb13c3d4870762f25fcd6620cb14e53c ld/ldemul.c -e922c33a61aab25af6710d9809c4f4c0 ld/ldemul.h -a4bd1472be8a8e931a82825b319da567 ld/ldexp.c -ceebb9e2a2f925e2dd6bd5eefdf13166 ld/ldexp.h -367eab4d73a8b2eba9e1f317dcb3b7e9 ld/ldfile.c -16f4a7510b084d57d6bdaf97da6193f8 ld/ldfile.h -9b2dada8716782c20350d43caa2f21b7 ld/ldgram.c -469602bdd786d950e9759b5c1c607058 ld/ldgram.h -615e9abfaa087941ac1a665b03f6c9d5 ld/ldgram.y -991cdf89843c7a85c80939a69f7744e5 ld/ldint.texinfo -8ca47fabed6fbbcd7a76307cd0392d00 ld/ldlang.c -573b0985ee45448098b2ecfd7ef68754 ld/ldlang.h -e3589edbe9619a856c94a9e1472af695 ld/ldlex.c -695387a63964774ce8bad66fa3cbc3ac ld/ldlex.h -ab34ade19af66bcf41fd1cdf8316fbce ld/ldlex.l -0456d4b5849cae5e7b5602e180c81fb1 ld/ldmain.c -9bf1eb955e180d436f5179fba53a1582 ld/ldmain.h -eaf5e555807b6f79e3df15fd87d501ab ld/ldmisc.c -ade62229096754b98373b9ae23d91b70 ld/ldmisc.h -3a602698f02818af629d09f4bd3f7fee ld/ldver.c -672e26e69ab6b241da6d7e5e4775f943 ld/ldver.h -4359fdef33618e0323337df0588c5cc3 ld/ldver.texi -79e7b100959436e9e1e63d4dca95b6ed ld/ldwrite.c -2b0d7a0f98da7f507f182b4dd2f9b616 ld/ldwrite.h -72c0de82995b3f382dd79e9b8aee3744 ld/lexsup.c -d2c2ef9b2c8b24061720ae93db1c4908 ld/mac-ld.r -26d2c38dee9ec69444252636bb0f6cc9 ld/mpw-config.in -75da5b27b1aed0cd7e35b59d9816e8ba ld/mpw-elfmips.c -1aa6339246f903df40d56a6e1741125a ld/mpw-eppcmac.c -d59f31235ae0e62676d70df668146a3a ld/mpw-esh.c -b20a61570cea5126bbe2247bbf21b3c6 ld/mpw-idtmips.c -01eb948a7c267f614ce2d08c8270170f ld/mpw-make.sed -d42ccc86b79c8964f38a1411f8b7c5c3 ld/mri.c -2ad4dc287abf549ea050d6ff283d603c ld/mri.h -98560f9c1fc2227cc7c788586914cc15 ld/pe-dll.c -da3989e60b39997de519cdbb5e6ea757 ld/pe-dll.h -1ded054093de910d9786c62bc4fe8cc6 ld/stamp-h.in -3f6f936b110ea5a5399a1446a3193c62 ld/sysdep.h -33d53fcbafe88b22932a3319277862ea ld/emultempl/armcoff.em -b812a798c37d8d5f5901f1821a8a648a ld/emultempl/README -9b159b0dcd1b4592439409005af127bf ld/emultempl/aix.em -12544d37e7ba4af1aa940499b149eb02 ld/emultempl/armelf.em -9f11acc5b293ac007ef4f30069a0148c ld/emultempl/armelf_oabi.em -995bbfc228460e4eef6eef52a09384a9 ld/emultempl/astring.sed -da24b8a824c3f326149884affe72b954 ld/emultempl/beos.em -d2fc27e169746e4690b9255988f3f959 ld/emultempl/elf32.em -410858b431ec254ac37f760c1ea87f1a ld/emultempl/generic.em -0a9fdf535a7a19ab8b1bad9713888740 ld/emultempl/gld960.em -76c0c089a4a55b0c9621b49d38908e67 ld/emultempl/gld960c.em -6b0ca1358cf1f8c0066f2e5301f46d56 ld/emultempl/hppaelf.em -6f50e5470dba075e580db09276f7d3db ld/emultempl/linux.em -9ee4fb106dcb3642b3c10ffd1e55457a ld/emultempl/lnk960.em -e959cab000712c2d7827b28020188272 ld/emultempl/m68kcoff.em -b995be733fe9aaafa45af874c12102a6 ld/emultempl/m68kelf.em -448e845763e60a5c713e3b2fc9863cf3 ld/emultempl/mipsecoff.em -a8190e4a0b5cca5b8677d8bb2d39940f ld/emultempl/ostring.sed -e14202a045cb3c41ebfe042228e3252d ld/emultempl/pe.em -8be5c13555bd37d1c70bbb1006b583da ld/emultempl/sunos.em -e21fa8d986017ca6352be94fdff217bd ld/emultempl/ticoff.em -1fc5ca4c2d336b91b473c13b241bf2b9 ld/emultempl/vanilla.em -63397aaa2c2074aa7be7ffe57b2e6c69 ld/po/POTFILES.in -ea2baddf1654fa8df40eb033d33b6068 ld/po/Make-in -c8e20dea09bd30058704c752a202c8b9 ld/po/ld.pot -d471f7a5a3dc4deffa1a8f2039a38504 ld/scripttempl/alpha.sc -01c6e3598e372d510730e381dd25c2cd ld/scripttempl/README -fdcbfdd0b93aa6b73e1b73127b28bdae ld/scripttempl/a29k.sc -ebac9206176b1d49526ea9edbc71867a ld/scripttempl/aix.sc -8e2be304cab1b30f2770ca3dd188f47f ld/scripttempl/armaout.sc -11e720b2d4fbd6b8ad9ce26f980acd6a ld/scripttempl/aout.sc -f40cc9e187c16d5d4170456ccb17d03a ld/scripttempl/armcoff.sc -119e975ce8b1005742840a9152c03a99 ld/scripttempl/crisaout.sc -3fb69113f5952434021a5fc481d5b417 ld/scripttempl/delta68.sc -a4e630a7a2094f2b44f19e41069e4433 ld/scripttempl/ebmon29k.sc -2f6206dfef231404aa0babbf12d2b69c ld/scripttempl/elf.sc -c7f5cfe3ed0b5773a9d2107c7fe08475 ld/scripttempl/elf32avr.sc -744fd7db42c234328f24006210a9f7a9 ld/scripttempl/elfd10v.sc -557b6406e74fc2c9cefe6233f95fe5a8 ld/scripttempl/elfd30v.sc -6ad7e39a3e5729ad923402573fd2351f ld/scripttempl/elfi370.sc -e96aae5650c97ddede3769205d9256f6 ld/scripttempl/elfm68hc11.sc -b435ff7b33225c47a2c42481b66fd5b6 ld/scripttempl/elfm68hc12.sc -5393b9689fa4a05d916c9ebbb54f015f ld/scripttempl/epocpe.sc -bb39f599d5755db06b3516d0471fe7f0 ld/scripttempl/h8300.sc -03a31f296b07be57364e68342f141a75 ld/scripttempl/h8300h.sc -b3675a21a2701e05a7895b6a28108d25 ld/scripttempl/h8300s.sc -6c57b9f11a6f50c46ecce9df62061dbf ld/scripttempl/h8500.sc -39da8240aa7f5aca7b23d93bcf243bb8 ld/scripttempl/h8500b.sc -a1235b4e692307533adc69d75c98da06 ld/scripttempl/h8500c.sc -45c5f295e421e663e1843207ae13951a ld/scripttempl/h8500m.sc -b6ce335a288c23cf897c944a84aafe3b ld/scripttempl/h8500s.sc -786aba3e828af6519ac1cb21ca5ebd9e ld/scripttempl/hppaelf.sc -973ec6d5280fe67f4694d07f03b6991e ld/scripttempl/i386beos.sc -89f55fbb09da1e8728f74f0dfda3192d ld/scripttempl/i386coff.sc -606d3f3a80d30603f3bbaf5c75ca3bee ld/scripttempl/i386go32.sc -debc01664da1e6913ca6ee1d350c7c9f ld/scripttempl/i386lynx.sc -dd4667c5e75a68e5bcc4b0769830974b ld/scripttempl/i386msdos.sc -f14aed79776fb856704487766477ef6b ld/scripttempl/i960.sc -ac993ea32406502f14b7089c4239296f ld/scripttempl/m68kaux.sc -0acb5ea28c8feeee6aae68de5fb62a67 ld/scripttempl/m68kcoff.sc -5ac24db89fd94088b97b9b2a9b5c6ea2 ld/scripttempl/m68klynx.sc -66790e6da2a36230461c111c12e5a6fc ld/scripttempl/m88kbcs.sc -d942ea1043bca95ad16a43702655862c ld/scripttempl/mcorepe.sc -13a45868ad3e92575be92f1558d1c9b7 ld/scripttempl/mips.sc -756f010bc1fcebe9cb08b1c8afa66389 ld/scripttempl/mipsbsd.sc -3219d28558d7ee8ceac00771c0f41aad ld/scripttempl/nw.sc -305f38a09603aa92f10e6d0b4cfc7680 ld/scripttempl/pe.sc -47e02e8254495a858dbef6c19c1ac173 ld/scripttempl/pj.sc -219f146ba7cb4c7346c9abd2a6c78798 ld/scripttempl/ppcpe.sc -ab0f8d8220dc084233dee358c5e57433 ld/scripttempl/psos.sc -1ca280b61dcc707ecc1128cfa80b8243 ld/scripttempl/riscix.sc -cd076d3e4b10af9d6eec06ff494e1c6e ld/scripttempl/sa29200.sc -e9bf54b19fd6c440995f4bf7a7a34d64 ld/scripttempl/sh.sc -1231890eaa6427329f4e49ef29a3b632 ld/scripttempl/sparccoff.sc -a56557b365a2fc1cf4070c7c5663b79c ld/scripttempl/sparclynx.sc -6277ea502afc8c184eeccce4362d538b ld/scripttempl/st2000.sc -f9f56c0b4c0548aadba5f30ee7f105fe ld/scripttempl/tic30aout.sc -581d4b5a31b2f67b8274aa96b201af92 ld/scripttempl/tic30coff.sc -d66c340121962b6706c37311253b0ea8 ld/scripttempl/tic54xcoff.sc -b6d1e44df8ff2382dcc53bf1816a4177 ld/scripttempl/tic80coff.sc -9767716444e270cbeda9727d75e12b39 ld/scripttempl/v850.sc -922fccd6995f0a119365fd7ceb7b25ce ld/scripttempl/vanilla.sc -9ef634e16ac4537117ea157867e85207 ld/scripttempl/w65.sc -474b1c82cd04327e7433dd108c93e239 ld/scripttempl/z8000.sc -4c78bc0be539fce5e7b7d076f918b568 ld/testsuite/config/default.exp -3205f2e22c9761eb0c10696266fdaf4d ld/testsuite/ChangeLog -b9b40d74b338fd9bf9a0999931d1b6e8 ld/testsuite/ld-bootstrap/bootstrap.exp -4b9f7ea09166acbf0b5d72c88c5b3956 ld/testsuite/ld-cdtest/cdtest-bar.cc -7d245ef3c98762296b516547243311d0 ld/testsuite/ld-cdtest/cdtest-foo.cc -6db246fa73606a55b99fd68fc8b67e5d ld/testsuite/ld-cdtest/cdtest-foo.h -42bc325afd7f1f937f20faa53c9f1490 ld/testsuite/ld-cdtest/cdtest-main.cc -cfb423f4424fe65c2fe45d99c49ff558 ld/testsuite/ld-cdtest/cdtest.dat -f0953d15141cfb527557cdf3e2491e89 ld/testsuite/ld-cdtest/cdtest.exp -d989349ade37c6c902c049861488e70b ld/testsuite/ld-checks/checks.exp -328c5cac80b76bd422b0b77d5517d175 ld/testsuite/ld-checks/asm.s -536a4d2e63692344109849b984f9da06 ld/testsuite/ld-checks/script -8e56f3234a0494775108d96aa30d18da ld/testsuite/ld-elfvers/vers.exp -5f2c2be170fc2ea8b5f4b1d7e8d72165 ld/testsuite/ld-elfvers/vers1.c -580fae4dde72b7ecb4ddf9a2fb369b72 ld/testsuite/ld-elfvers/vers1.dsym -0f0d48d66a7468bb1ea8f0f907f65f74 ld/testsuite/ld-elfvers/vers1.map -e70fa3cc72507e3c454eeaff68f8c28f ld/testsuite/ld-elfvers/vers1.sym -d739eb560d4a0f23ab4cf60df5378602 ld/testsuite/ld-elfvers/vers1.ver -ca85484e74a669868fc7e52fe11d7fb4 ld/testsuite/ld-elfvers/vers13.asym -e8cdfeee2880948d113226cb5004d92c ld/testsuite/ld-elfvers/vers15.c -63a46548615c9f270349f427719d1b10 ld/testsuite/ld-elfvers/vers15.dsym -46f1035151fe2009e5de509d8f7ebaf2 ld/testsuite/ld-elfvers/vers15.sym -63f2b3b06a796f7a49a90902fbadd4ad ld/testsuite/ld-elfvers/vers15.ver -d71d95fe36a6bc2f88c952ac37cb990a ld/testsuite/ld-elfvers/vers16.c -ff7574e34a600f7ae616a4384f98ad0f ld/testsuite/ld-elfvers/vers16.dsym -d057681641b9fc14e87f35c677b6243d ld/testsuite/ld-elfvers/vers16.map -92e6d0ae0c0aef2c17de9ef04d6bf7f2 ld/testsuite/ld-elfvers/vers16a.c -4d81c8fe8c0b5ea33ef6c4001cfee806 ld/testsuite/ld-elfvers/vers16a.dsym -fb67971a2dd673bf9ae0506459f0bf2d ld/testsuite/ld-elfvers/vers16a.ver -a2e06e03cf5f45c27839f309a5388b81 ld/testsuite/ld-elfvers/vers17.c -35a714a53e208be7dd7f246285c4dd30 ld/testsuite/ld-elfvers/vers17.dsym -db62e32b4b422023390633f11005c406 ld/testsuite/ld-elfvers/vers17.map -bf382203a5c52664aa6e7728abbbd31a ld/testsuite/ld-elfvers/vers17.ver -64ce133534d131385b4d10606c423b81 ld/testsuite/ld-elfvers/vers18.c -3a85e7068b4a30ec5e7585a14b19ce69 ld/testsuite/ld-elfvers/vers18.dsym -31b6949806df3bd1f959a957bed07ff6 ld/testsuite/ld-elfvers/vers18.map -99fdeff24e389af67f2125724e3c0c2b ld/testsuite/ld-elfvers/vers18.sym -3727b5769ad6291477eb3ffaa67eb9d2 ld/testsuite/ld-elfvers/vers18.ver -039a925919afb81dc1ee342704f38935 ld/testsuite/ld-elfvers/vers19.c -c1b9e106ce57e5a1d19a19e5ad108ea6 ld/testsuite/ld-elfvers/vers19.dsym -56042a92306b44d3b68444cb64f9c768 ld/testsuite/ld-elfvers/vers19.ver -0a2838d86e28cda599478f48e5b5bdfd ld/testsuite/ld-elfvers/vers2.c -6c04dd6b5a1f83b8ad01dc66e0cef2c9 ld/testsuite/ld-elfvers/vers2.dsym -0f243904b21ec2e5cda0083a35f9708e ld/testsuite/ld-elfvers/vers2.map -a597d603357c6c6537d1ee1e806a56d6 ld/testsuite/ld-elfvers/vers2.ver -2198856c8569cc7494ffe89650a9e63b ld/testsuite/ld-elfvers/vers3.c -c1b9e106ce57e5a1d19a19e5ad108ea6 ld/testsuite/ld-elfvers/vers3.dsym -d02949a2cd805d83970ffc3229895e01 ld/testsuite/ld-elfvers/vers3.ver -eaeb7b786e1af44d384e8c84dc7a2dc4 ld/testsuite/ld-elfvers/vers4.c -41acbfbc82b54219566366b069b2ce34 ld/testsuite/ld-elfvers/vers4.sym -e878b24651400ca1fb1bdc0c16a22848 ld/testsuite/ld-elfvers/vers4a.dsym -41acbfbc82b54219566366b069b2ce34 ld/testsuite/ld-elfvers/vers4a.sym -e15e85042ec35363e4bc97c35187187a ld/testsuite/ld-elfvers/vers4a.ver -940d06960890b0eb73114f452b44604a ld/testsuite/ld-elfvers/vers5.c -3874cf48820bc48dd48d1ee16551af06 ld/testsuite/ld-elfvers/vers6.c -440222caab8e6f857b77c1ba50d81e84 ld/testsuite/ld-elfvers/vers6.dsym -b355de4ba2834305bca9bf3b7cc91e70 ld/testsuite/ld-elfvers/vers6.sym -c6dda7839f06ae8858d0d413c6b436dc ld/testsuite/ld-elfvers/vers6.ver -8c6338ab91836afb2918ef463e5e899a ld/testsuite/ld-elfvers/vers7.c -9a7ae246a7154e67158fc0cdcda850d8 ld/testsuite/ld-elfvers/vers7.map -8d7f1e06f9194fa66402e5efff269754 ld/testsuite/ld-elfvers/vers7a.c -b3fdb5ca0a4cf57530bf9d838fe825da ld/testsuite/ld-elfvers/vers7a.dsym -d466ec8b7fcadee36db85cac92c1601a ld/testsuite/ld-elfvers/vers7a.sym -3cbade7d1c3f4ac6ccbc83cebf13d3f7 ld/testsuite/ld-elfvers/vers7a.ver -258f61144bcd39b444b75dba182129e6 ld/testsuite/ld-elfvers/vers8.c -3a208e171858590f5717735bf85432b6 ld/testsuite/ld-elfvers/vers8.map -36514fcaa2e950e55d5930aa97782ea2 ld/testsuite/ld-elfvers/vers8.ver -2866447458043d608659fc1fe92f617a ld/testsuite/ld-elfvers/vers9.c -21dcd2120edc32b5e36974abdc6e1f3e ld/testsuite/ld-elfvers/vers9.dsym -0d2f6f5317e5732e649745046ab2ab9a ld/testsuite/ld-elfvers/vers9.sym -ba97850c4c77d6ae99535f328268af22 ld/testsuite/ld-elfvers/vers9.ver -a1502268321d4816ffa1d1bb1cf335e1 ld/testsuite/ld-elfvsb/elf-offset.ld -26f7423a78988457f44e1879ec1ec1b1 ld/testsuite/ld-elfvsb/elfvsb.dat -c7e4e3bb61152914b24ca9d48c7414e8 ld/testsuite/ld-elfvsb/elfvsb.exp -996a5cc52bf7b1f6356ea1e77aaca26e ld/testsuite/ld-elfvsb/main.c -a5d04655b47574a63e0d034c2b15ecf8 ld/testsuite/ld-elfvsb/sh1.c -2a301406fc0d5ccedb5fe48db23d0838 ld/testsuite/ld-elfvsb/sh2.c -b77b2046bde3f0f47b7ed8412f4e095f ld/testsuite/ld-empic/empic.exp -e7337619d5f156145600727d89a92cad ld/testsuite/ld-empic/relax.t -9890e4435b569df5957bf349ae070544 ld/testsuite/ld-empic/relax1.c -06661c7d74d2309ff2e35b10146bd41e ld/testsuite/ld-empic/relax2.c -9bb9724eff6590e585dd1969fac15dff ld/testsuite/ld-empic/relax3.c -c192f60f33fc224b5c2c16766d07994d ld/testsuite/ld-empic/relax4.c -a8b21f91a17c7ecd1f8ca5b7f00e075b ld/testsuite/ld-empic/run.c -37bc1d770c9e77e637c46e1ae7992247 ld/testsuite/ld-empic/runtest1.c -a27a7a90ff46445fa4334638ec71ce3d ld/testsuite/ld-empic/runtest2.c -75a0208d669a12ec40c6c09cda96a4b4 ld/testsuite/ld-empic/runtesti.s -e882253a7b0f660986d5794a36239b1b ld/testsuite/ld-scripts/cross1.c -dacdbdd934565fa39a43a2a2372dfe7f ld/testsuite/ld-scripts/cross1.t -2bad1250e1d3998f3c2d678b1b90d275 ld/testsuite/ld-scripts/cross2.c -f4850b548feaf5705683c9096cad261d ld/testsuite/ld-scripts/cross2.t -6cda0a6cae6d6fe585c175aa49c2578e ld/testsuite/ld-scripts/cross3.c -8e5623c6b47db95f8e2be269f12dd48f ld/testsuite/ld-scripts/crossref.exp -3987c7a541be314eb899fb320d1236aa ld/testsuite/ld-scripts/defined.exp -89dc613e3ce213bd756b77d022667dac ld/testsuite/ld-scripts/defined.s -d3b1800f46a71805045a3a5732fd42bc ld/testsuite/ld-scripts/defined.t -5dc9106fd27359a7db37212f56b0c101 ld/testsuite/ld-scripts/phdrs.exp -9af38df1b2580b0ee309b0acfb185537 ld/testsuite/ld-scripts/phdrs.s -56a4859269de48bfbf859d4d0a327e9f ld/testsuite/ld-scripts/phdrs.t -b4fdfa8cd5673593833160a46be7b211 ld/testsuite/ld-scripts/script.exp -8ef222fed2cbd6222ef9c4bfb5caceb3 ld/testsuite/ld-scripts/script.s -b9bc56b095f61ceef7cb9a948be41609 ld/testsuite/ld-scripts/script.t -a673788e6a586931f65fee9d8964d0b8 ld/testsuite/ld-scripts/scriptm.t -b17503e5b20c63c8c98c18694e77f1c9 ld/testsuite/ld-scripts/sizeof.exp -de2cf65f9506880e63f0fdd46bb23c12 ld/testsuite/ld-scripts/sizeof.s -feffaafc250ae18dfdd493f8a6c4f2c6 ld/testsuite/ld-scripts/sizeof.t -c135cc5906cdf4cfe49d4c51df63c515 ld/testsuite/ld-scripts/weak.exp -3591b42540bac07bfbb66f7f0ce59d88 ld/testsuite/ld-scripts/weak.t -8df46a87530dbe689785bcc1c1a75da7 ld/testsuite/ld-scripts/weak1.s -b3bb044bcdc10e3eccef47d0c2c2429e ld/testsuite/ld-scripts/weak2.s -0490e9a40c7efa469100cf3f29ea8143 ld/testsuite/ld-selective/3.cc -3f6043e6b6bd49e760b9e753b6aaf9ac ld/testsuite/ld-selective/1.c -237d849095a360c8cad108dd7c84812b ld/testsuite/ld-selective/2.c -dcfb7a28e3bdf5d5453248236fbd60bc ld/testsuite/ld-selective/4.cc -a2c9c1152a0133516e4640ed96422473 ld/testsuite/ld-selective/5.cc -c5363d796238787cdb2c6ae148b90831 ld/testsuite/ld-selective/selective.exp -fe57a8477f445b968630a746d538da92 ld/testsuite/ld-sh/sh.exp -1480d5643c4a3a7456700440e9f108dc ld/testsuite/ld-sh/sh1.s -4a6b928d31480c42bc368db1a2d729b3 ld/testsuite/ld-sh/sh2.c -486895674299bb2c523133e56a567c1f ld/testsuite/ld-sh/start.s -a1502268321d4816ffa1d1bb1cf335e1 ld/testsuite/ld-shared/elf-offset.ld -662fbaf1e1bfcf9e0f69ece262c1fbc9 ld/testsuite/ld-shared/main.c -1ac7636415298be4ec10d57894d7bd92 ld/testsuite/ld-shared/sh1.c -dda81aa1c99d9fd983ae39378b5b69fd ld/testsuite/ld-shared/sh2.c -7ac9ed1cf3e4b23bd77743315f0560d5 ld/testsuite/ld-shared/shared.dat -8309ff0409c524b5958d7ffb2295f541 ld/testsuite/ld-shared/shared.exp -8b38128b19d7be0a9f143a3fae14669f ld/testsuite/ld-shared/sun4.dat -e8d8c5ef094b26b46377375f8ef076c3 ld/testsuite/ld-shared/symbolic.dat -bf16787cbff593c9377800bda68bc12b ld/testsuite/ld-shared/xcoff.dat -8541a6beb8232366c133e9097a10c8d2 ld/testsuite/ld-srec/srec.exp -ff2b78b0df3a6bc56644e35ec4f068bd ld/testsuite/ld-srec/sr1.c -6524623299b50b9299f4b3fca543b0fa ld/testsuite/ld-srec/sr2.c -16d9ac8f3038072368a8550eb60b5d26 ld/testsuite/ld-srec/sr3.cc -b619c6e42cb950ef08a2be4baed7e558 ld/testsuite/ld-undefined/undefined.c -80908f8a2cc2983b2e57ab40e0505045 ld/testsuite/ld-undefined/undefined.exp -68086317a3885311286459eb9083c71c ld/testsuite/ld-undefined/weak-undef.exp -d46f02756d74cac491eccd91c9497ca3 ld/testsuite/ld-undefined/weak-undef.s -ff2b7f892a6ef004c2076f2bab575ec0 ld/testsuite/ld-undefined/weak-undef.t -29efa44de09187dfbd1badee054c2ffd ld/testsuite/ld-versados/versados.exp -a3dd5e83356444e20dfff2b6986f9701 ld/testsuite/ld-versados/t1-1.ro -20fa39afdcf19846ef54b8c8a63c09fa ld/testsuite/ld-versados/t1-2.ro -750043b1377753643d66f2ea010d1d64 ld/testsuite/ld-versados/t1.ld -1ea1a397873490e5a225282b08911b79 ld/testsuite/ld-versados/t1.ook -b73a148ff92b3b9f50118dedddc8e9aa ld/testsuite/ld-versados/t2-1.ro -6521d61c4bf4f500cb868ded9a47044e ld/testsuite/ld-versados/t2-2.ro -ed2b6b448335acf507dc34b5a01710d8 ld/testsuite/ld-versados/t2-3.ro -7020c6c2928c89ca798f517226862f1c ld/testsuite/ld-versados/t2.ld -fb1e9ddf26ad5af0d34950d762f68ed9 ld/testsuite/ld-versados/t2.ook -d8417145277c2f71b3d7c058472f3577 ld/testsuite/lib/ld-lib.exp -e2677a696ed870d444e53cf69e8a69f6 ld/configdoc.texi -7b65854f594c84e80295173de277b3dc libiberty/config/mh-cxux7 -4004fdcde347fda58406b4b84a995c66 libiberty/config/mh-aix -b2eafdc4d4e0928a5d0e89d5f6fe116c libiberty/config/mh-beos -044204f5b4bcac5eae2face0602129ae libiberty/config/mh-fbsd21 -904bdcd9daf97fa55a9ca8901ffe7435 libiberty/config/mh-openedition -38e76da568ab25260754fdb9d5080513 libiberty/config/mh-windows -f30a9716ef3762e3467a2f62bf790f0a libiberty/COPYING.LIB -536f1ea00e95287882c108f51be00df5 libiberty/ChangeLog -d43770145fb3c3433ac33986770a7b36 libiberty/Makefile.in -08cc0e5f8cd2cc6bc1e4114011be131b libiberty/README -5ca0eba5b33e5f6952114bfe84c167b9 libiberty/aclocal.m4 -de46742edca3a9276eefa5ae8fdee5eb libiberty/alloca-conf.h -18b3e90c1496f1db337b93a2c3bda513 libiberty/alloca.c -d54574b77c40ff38a37139b4df4918c8 libiberty/argv.c -d837d38495c38d45d1c8bd94eda40b39 libiberty/asprintf.c -d89da155295f797db9f987220ef9af4f libiberty/atexit.c -0ec74e2bf6de5ac2ee096696b3f7dfb5 libiberty/basename.c -8536a9fe63d5270026766fb6a833c0e3 libiberty/bcmp.c -37f840db36868cae15135e9beb9d9c5b libiberty/bcopy.c -c5855ab06709314b196b5ceb7a7cb5dc libiberty/bsearch.c -3e539dda7281866347213ed444830f9b libiberty/bzero.c -fd01fef67ce311c2462b1957ff06282e libiberty/calloc.c -815fb49e28a8980f8b838aaecaefa891 libiberty/choose-temp.c -4c081fe106364d829d16c720e3a99ad0 libiberty/clock.c -6abc10aedbbd94274f97174a9ec454dd libiberty/concat.c -fdaf5fdc2a84ff34103604588aea1a3b libiberty/config.h-vms -bb2688eeee0799b47128613436b5731f libiberty/config.in -6ba918af7eec27cd147903518d519d46 libiberty/config.table -fde4aae2aac71c6837d5db1db1f4b880 libiberty/configure -9cc359fd1437d6afd69b5169104ddffd libiberty/configure.in -8493d27a97881009393ceec1aa431f0e libiberty/copysign.c -4427c696ecc360a813ecf063589f84a3 libiberty/cp-demangle.c -9463d7142e481f2a98e594901ca5a9f6 libiberty/cplus-dem.c -231d3202aadb19e1d3209fa0797b4ec4 libiberty/dyn-string.c -62121149a1d62bef125c75380131b180 libiberty/fdmatch.c -85de4ab7bf13ff400ecbd15001f91950 libiberty/floatformat.c -5a0e7522053fc29b178bcd5ee644aaee libiberty/fnmatch.c -3508056d5c091a4a066ef6895b66a63c libiberty/getcwd.c -2deefd98fad4fd25e2ed0facd2e5518f libiberty/getopt.c -5fd11388f488b53ec69eeb3e71161636 libiberty/getopt1.c -f4ed35bf0db2796c07db055f638abec8 libiberty/getpagesize.c -9fc32d36b7617e6393b8d8aa4dc8a5e0 libiberty/getpwd.c -b9bdf217753be4c1315c3a9689983290 libiberty/getruntime.c -e05e129c9bbfca9c792724adff237e85 libiberty/hashtab.c -d707920a44f45525dc4c6e310926a210 libiberty/hex.c -004477cba1e0a85a2d443bee4a0af269 libiberty/index.c -4c4b7edb35b7ffbbba5e7e2ec399d559 libiberty/insque.c -e331b31ce1cbf27a44f2fbeb54fa7b17 libiberty/makefile.vms -d985e08160b8aec6f4ba23175400181c libiberty/md5.c -cdca3f90987260a7a860aee136ca740a libiberty/memchr.c -2439abd355027df270d48733215f891a libiberty/memcmp.c -f59c3c95c9ab8b66dfccaa3d7ba1f878 libiberty/memcpy.c -8dda7ebe5e2c3c6c28aa53e06b283fcb libiberty/memmove.c -57043300d663328adbb1b40c2cd7793e libiberty/memset.c -bd2a139d55d7bbaeee671b50a45992fa libiberty/mkstemps.c -969668698375a7ecf08bc086b9613a31 libiberty/mpw-config.in -54c65d1bafd7d8d29b9d29761d977020 libiberty/mpw-make.sed -9de6f56befd6350286f5a42836a8433a libiberty/mpw.c -7897e43bedd2def4beb6eb73003efa68 libiberty/msdos.c -9fbb504341d8982f9439a168b9ef825e libiberty/objalloc.c -41b517bd87e0312eb4f1c72f641c2008 libiberty/obstack.c -34f70650591a3e50bf80a47259b21063 libiberty/partition.c -170b24f0daa4451a1a0c61badc6a2592 libiberty/pexecute.c -1c26add2214f8d43e42a3ef76e0a2c4e libiberty/putenv.c -892047691cd75e110b6c995047656068 libiberty/random.c -9afa19a52697f0d83a8f94c8f55b0140 libiberty/rename.c -b751b6a5c19944eded4cfcba1fd527df libiberty/rindex.c -438e62574b58fc80136eb9b43aa4d6b7 libiberty/safe-ctype.c -fb5ea509ef834b0fae40b4de9e121a4e libiberty/setenv.c -1f3c59265795bbeeaa0682e30ec008fa libiberty/sigsetmask.c -bcd38bbff8e80df6e908d7ee57d7b681 libiberty/sort.c -4a3173c26ad8cb30302e1425135647f8 libiberty/spaces.c -ea6978858b89cbdbf2bb796522e38603 libiberty/splay-tree.c -406f9df3aca1c9cb104e35d93aa5f19a libiberty/strcasecmp.c -25493d01cf01dddc7326eb6bb39b59d7 libiberty/strchr.c -352f6f1cb2e6025866d406ede3a475c0 libiberty/strdup.c -db0fc51193ca195a3f588e5184e1987a libiberty/strerror.c -00040f08f420f8336e67840133efdd87 libiberty/strncasecmp.c -2e333001f8ef8e01ae2f153e51b59ce4 libiberty/strncmp.c -19847187ca2ed7b38342718371b57a89 libiberty/strrchr.c -022d5e8aa132e524de1a9e087867161e libiberty/strsignal.c -58984b80dbe4d3364feda5c675b3e23c libiberty/strstr.c -0cd5eef7fa7708a43350f98eacf8776a libiberty/strtod.c -a0e7c73c62ba8a24e1590c27e34c59d3 libiberty/strtol.c -e06d6526f14dcd0834827520331fef16 libiberty/strtoul.c -d0b4c29a87478edc4c2c69c3e9d2be0a libiberty/tmpnam.c -8824ff84682ec60eca212b518429db18 libiberty/vasprintf.c -1e46cffdcdf7e68d72a8f24c71c04d08 libiberty/vfork.c -280fb05a979214b0876be4c9dc7d4061 libiberty/vfprintf.c -9a46f8a6bd6b911849f209d09e94b66f libiberty/vmsbuild.com -893d859616bab673df0504cb02a7feec libiberty/vprintf.c -d187e50a7a7817fcbf2bbd6595093756 libiberty/vsprintf.c -52860722750d8633eb78d1dbe6db4f5b libiberty/waitpid.c -5caf61856a76a6eb1cb52bb1c86501c5 libiberty/xatexit.c -357b147749e719e3c69315ac83c6a4bf libiberty/xexit.c -e404c730a2531595d5fea1c5da957e98 libiberty/xmalloc.c -b0feb91e581c43d5ae41b0576e877ab3 libiberty/xmemdup.c -6ec02ce9b4802dd6939200d4d2faba6a libiberty/xstrdup.c -e70805298181e0f55a52a64b17d72904 libiberty/xstrerror.c -f209fdb2c52db4462c254e6b8d89f2ee libiberty/testsuite/Makefile.in -6319e17edb27c399c30f1596c2ce41b5 libiberty/testsuite/demangle-expected -5cd31fc5e2e642e2de1c3d6a0792b431 libiberty/testsuite/regress-demangle -cc28484945e89f4d469672c4b1beaabe libtool.m4 -30c8f1fcca77253cf9e9657caac44c12 ltcf-c.sh -3a3fcd8d6f8accd80d1d41301045b2d8 ltcf-cxx.sh -1bf2c254103b812c60e6c8e8b90e4c83 ltcf-gcj.sh -9dedd8a70b17964941f1446787f61c2d ltconfig -906ef7ec1319467f83cfc91083949b01 ltmain.sh -734690a438420e8479e15d8ee6971792 makefile.vms -393d298125f8e03c13364afe447b308d missing -fbe2467afef81c41c166173adeb0ee20 mkdep -bc994884d395541d40c4192919a89a21 mkinstalldirs -c71ddf72c059891ca0bd1727f5aa0de1 move-if-change -a8fe1ab072e42efff2a0ec883d91130b mpw-README -af52692753387da2241fc4bc6ccec120 mpw-build.in -5479cbb3e13987fe2170b7a403b82e8f mpw-config.in -d186332a893eacec29defecdc3524ecf mpw-configure -96312bdd41def6a5946784d468dc29d3 mpw-install -7476f5d64c6678694b06bc7aba53fb97 opcodes/po/POTFILES.in -bfb5c178c2404196ab54d7532a61e3d4 opcodes/po/Make-in -87185f7dbaa4e4671dd4d64d491ed41e opcodes/po/opcodes.pot -5d10e6815b371dfeb9c53be2e06fc199 opcodes/ChangeLog -47912714837729ee35d5261ffff2941c opcodes/ChangeLog-9297 -2b70061d7488180442b52de1c9a9e819 opcodes/ChangeLog-9899 -d618facc3e8ce8bf3d02ba452e1be6ab opcodes/MAINTAINERS -253bd0a237fe51f196cde6b19edb1d19 opcodes/Makefile.am -2008005afc9d925a582285b3debb7968 opcodes/Makefile.in -84f5802b0b8a97be111d90fbe1eb5bc1 opcodes/a29k-dis.c -901749e9292ba1f5f109f5cc195bfe8b opcodes/acinclude.m4 -1738493e94ddf315a5f49742feabafdd opcodes/aclocal.m4 -edc549a6c86437daebd9ca4d85dac4d1 opcodes/alpha-dis.c -d57fd8d45f9ef301948abe020b8ea6ed opcodes/alpha-opc.c -407f2ac5f227ea3ab0fdbc29a2c157b8 opcodes/arc-dis.c -b35daf399df5036ff496742fbc5e08ec opcodes/arc-dis.h -8b5ec96c147acb9028e535b3ad80525b opcodes/arc-ext.c -2c085be449e338c2bda530572029c8c9 opcodes/arc-ext.h -6406fb8a25796d8042fcfbea50575876 opcodes/arc-opc.c -9e2b20ce7eeb3a319398ce3eb1d478f7 opcodes/arm-dis.c -011a87a896e0f67c2954e823b7ae037f opcodes/arm-opc.h -598016dc5a3065f79d352c18f24761cb opcodes/avr-dis.c -e9c941efc984cb22a689256e26e43e14 opcodes/cgen-asm.c -84c6a72bc58e3efe77abaa65e9190f86 opcodes/cgen-asm.in -d6cf591b1c7d4d3dbe9306ae800c132f opcodes/cgen-dis.c -7d118a2ff1141006931f55bffcd8e2ea opcodes/cgen-dis.in -b75826a34eee8fb6a90848adcc4377f0 opcodes/cgen-ibld.in -0086c001b35c9036a2d8cacae262aff4 opcodes/cgen-opc.c -95f1a3447a2b756b0f3a2b1cbdb98a16 opcodes/cgen.sh -0063bd27512e913f600d7732d1f6b455 opcodes/config.in -64774095a357e0c5dc0968329dff579c opcodes/configure -bcf375e26bbff52dc5d8df5f33a648d4 opcodes/configure.in -a2f28fa183e6adf5e888277d00a09ec0 opcodes/cris-dis.c -f9210ed755224660483db100711cd468 opcodes/cris-opc.c -3ff7eece27f0263ad962483020d1596d opcodes/d10v-dis.c -0557da1786712b947f0f29cd6141d7e1 opcodes/d10v-opc.c -b8ff24c42fbc4e3520c40784e6d870d6 opcodes/d30v-dis.c -0eebf1cce2cfd05039625773a97b8d40 opcodes/d30v-opc.c -003af092c5d632b4f4d90904faecd02e opcodes/dep-in.sed -21a789d7e4f7c00d4658aa7894ebb5f2 opcodes/dis-buf.c -2900c6f1a9f22b5291942c8ab5a1cc38 opcodes/disassemble.c -8575543eddea6b4909ecdd4aa7f96382 opcodes/fr30-asm.c -91642ad67bfffb844412fe3fc162732b opcodes/fr30-desc.c -44cf09ad36fa37532727361c3d655469 opcodes/fr30-desc.h -621fc334dc302583ba0d3936c47d73f1 opcodes/fr30-dis.c -7e3a44e24211aa6f1791a28192093777 opcodes/fr30-ibld.c -75fd4b7a627f6abf22338ce0f2b5744b opcodes/fr30-opc.c -751349749f75da04fc8ca9f007346f03 opcodes/fr30-opc.h -734b36ee7995c1e6bc93a338b9d66af2 opcodes/h8300-dis.c -dd0cbe2eae0c7d890d713979641e0836 opcodes/h8500-dis.c -be7eeeaaf1ac843e1b1b862a2abbaeab opcodes/h8500-opc.h -9e4136c02128d5cffedc2b42b26e13f8 opcodes/hppa-dis.c -8baa539d215e542bf822c36afd58d1d3 opcodes/i370-dis.c -f2ffaf6eaf3da84601fa3e11c75cb3b6 opcodes/i370-opc.c -5e6140717c388d0ba1193e3b12da9284 opcodes/i386-dis.c -325271abed39e7901f8e311329b7cd40 opcodes/i860-dis.c -e09d15cb2de4a4b71fc524e5dca3ea33 opcodes/i960-dis.c -f0469cd9c1a3c87e3bfd3a24c910f4c6 opcodes/ia64-asmtab.c -4c555d2fbf3bb0d7002a8108f7e28656 opcodes/ia64-asmtab.h -8384cb8430b26dfecca57f6cd6828fcd opcodes/ia64-dis.c -a9d29c4a2268f28092c985c7ad75a13d opcodes/ia64-gen.c -c36c8bd413a36bdbb0769eb453f96233 opcodes/ia64-ic.tbl -0d52960c8b9c111364271ff7c52049b6 opcodes/ia64-opc-a.c -8bc6bf983afd8d19ecbfd3956b3af1c2 opcodes/ia64-opc-b.c -8c9afa7e15881357af5fe46b1f5d80a4 opcodes/ia64-opc-d.c -c617e97d72c9f654b0305faf8b4ae10c opcodes/ia64-opc-f.c -c7e9b3273a3c819c81ad3807e3f86d43 opcodes/ia64-opc-i.c -489e185e02196bd26948258825b9d5ce opcodes/ia64-opc-m.c -5ade2d80b63adb27604e529c84ec0bf1 opcodes/ia64-opc-x.c -729f8bb05396f283169ef6d5cb5c62d1 opcodes/ia64-opc.c -354757cd4b638d7e50f0b34fd6e2c87a opcodes/ia64-opc.h -be62c652f94c6c4e4c7339a42025c43a opcodes/ia64-raw.tbl -b3d7452b4310332b7974b34b09f65a6d opcodes/ia64-war.tbl -a4eed6589f8feed99206080f7362eb7a opcodes/ia64-waw.tbl -a9d541dd9eccd3a1ea0415880b9521a7 opcodes/m10200-dis.c -cdf93ebf301a6f4b4072b2dfe4b56083 opcodes/m10200-opc.c -e999a55493e5bb73dccd2c2f49245bcf opcodes/m10300-dis.c -95476f50fb47e0c8423e8cdba158b341 opcodes/m10300-opc.c -c3c8430e52ed581bb9703f342223cfc1 opcodes/m32r-asm.c -c4ee7ef5b002da4ace8feed1be237d02 opcodes/m32r-desc.c -4842ca40e0cc8f7213279fd51fbb360c opcodes/m32r-desc.h -4d8e90904be8aecf6edf3f9e4affb910 opcodes/m32r-dis.c -452bd9f0a50294c59e6d9ded993b8934 opcodes/m32r-ibld.c -519f99255995a52ea031a68947874d03 opcodes/m32r-opc.c -065e44be10d96ee13c9d99fbd652cb4b opcodes/m32r-opc.h -b04da92be306da6813f23b988280eac7 opcodes/m32r-opinst.c -750ee68160890cb6bb8dc85f42f8fab7 opcodes/m68hc11-dis.c -534406cb1900704eb5bd5a8ab7c15362 opcodes/m68hc11-opc.c -b6d13f9c4898cd69610db32745c555a0 opcodes/m68k-dis.c -f95df4c61edcb7a72e97c651be941245 opcodes/m68k-opc.c -ac754e1e474d8bbd929f0a2f76026917 opcodes/m88k-dis.c -d129eed92c6947db4372b285656ef9a1 opcodes/makefile.vms -deddfa1e5bfc0d1cd272bb335c44f6ed opcodes/mcore-dis.c -5d1d73c7fcd371c3a4bb39d4a8e5cb44 opcodes/mcore-opc.h -378f487e8bd120f93fc5c8df05f10435 opcodes/mips-dis.c -3637f95bf25a1298bdebbbcc1ef8b2be opcodes/mips-opc.c -c5f2a79141b09a53e3430582f3559b7b opcodes/mips16-opc.c -5de239a139c71421a7cce634f8deca83 opcodes/mpw-config.in -031902d455df71012bd4603e5d616ca6 opcodes/mpw-make.sed -8720ca17359e24396f182810719f226a opcodes/ns32k-dis.c -81a682289129e3eefb7cfd6ce9d10d92 opcodes/opintl.h -5fd78854f081acef734b6313c9db3ed8 opcodes/pj-dis.c -7d29ed3a2cb830feadb1382aa3895b6f opcodes/pj-opc.c -ebd0146069b8dc7f178514f29b861060 opcodes/ppc-dis.c -1959550f862696159952f6d1cd19a589 opcodes/ppc-opc.c -81aca074f5c2f015f2607f33e4e2766f opcodes/sh-dis.c -7a4b5aac9ceabeaed3863691a70e6ab6 opcodes/sh-opc.h -ff77e2ad868c4cb2a913a04bbda42594 opcodes/sparc-dis.c -c35af9a7f84cf1a894d7595d914bba1d opcodes/sparc-opc.c -1ded054093de910d9786c62bc4fe8cc6 opcodes/stamp-h.in -8e4842844d864baf1d2056cf0651c2df opcodes/sysdep.h -5909eef2aabc61a8d5e9a71c9734defe opcodes/tic30-dis.c -368332708cdfe65a7195a852455d2e52 opcodes/tic54x-dis.c -971f75d91d6ba40f2040d21eb6f80b1f opcodes/tic54x-opc.c -0bbe03c2f65c1128fd6a0b0916315af3 opcodes/tic80-dis.c -2225052326dd29b94a99ca86fb0086d8 opcodes/tic80-opc.c -b0eefa85cb7a554ecd2056548d6d1b28 opcodes/v850-dis.c -5e2518c50d12ebda6e1fc9dd836c3602 opcodes/v850-opc.c -9f55832c633c46d55657de6006a6a1f0 opcodes/vax-dis.c -3cda2aff2cc4a955064f8a3f58a1887f opcodes/w65-dis.c -988ea26bcea3fd0093c354df06c24c1a opcodes/w65-opc.h -390692c1210bfd6864093e5dda087337 opcodes/z8k-dis.c -2bab6fea415ef1dbac1f958c912bc0d2 opcodes/z8k-opc.h -98b13794afa1b64b2c38411a2c72d404 opcodes/z8kgen.c -0b03c02d551d6f9d9db0c64ddde56500 setup.com -7d7855ad10def38a17850f5b17d3a9dd symlink-tree -0a8fa11d23b640dd1b15a36f8a7f0d3f texinfo/texinfo.tex -7588c5103af27cc93537977f059f52dc ylwrap diff --git a/contrib/binutils/opcodes/acconfig.h b/contrib/binutils/opcodes/acconfig.h deleted file mode 100644 index ef2f4966c1bd..000000000000 --- a/contrib/binutils/opcodes/acconfig.h +++ /dev/null @@ -1,6 +0,0 @@ - -/* Name of package. */ -#undef PACKAGE - -/* Version of package. */ -#undef VERSION diff --git a/contrib/binutils/opcodes/s390-dis.c b/contrib/binutils/opcodes/s390-dis.c deleted file mode 100644 index 8745a8943739..000000000000 --- a/contrib/binutils/opcodes/s390-dis.c +++ /dev/null @@ -1,257 +0,0 @@ -/* s390-dis.c -- Disassemble S390 instructions - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - - This file is part of GDB, GAS and the GNU binutils. - - 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. */ - -#include <stdio.h> -#include "ansidecl.h" -#include "sysdep.h" -#include "dis-asm.h" -#include "opcode/s390.h" - -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; -{ - const struct s390_opcode *opcode; - const struct s390_opcode *opcode_end; - - memset (opc_index, 0, sizeof (opc_index)); - opcode_end = s390_opcodes + s390_num_opcodes; - for (opcode = s390_opcodes; opcode < opcode_end; opcode++) - { - opc_index[(int) opcode->opcode[0]] = opcode - s390_opcodes; - while ((opcode < opcode_end) && - (opcode[1].opcode[0] == opcode->opcode[0])) - opcode++; - } - switch (info->mach) - { - case bfd_mach_s390_31: - current_arch_mask = 1 << S390_OPCODE_ESA; - break; - case bfd_mach_s390_64: - current_arch_mask = 1 << S390_OPCODE_ESAME; - break; - default: - abort (); - } - init_flag = 1; -} - -/* Extracts an operand value from an instruction. */ - -static inline unsigned int -s390_extract_operand (insn, operand) - unsigned char *insn; - const struct s390_operand *operand; -{ - unsigned int val; - int bits; - - /* Extract fragments of the operand byte for byte. */ - insn += operand->shift / 8; - bits = (operand->shift & 7) + operand->bits; - val = 0; - do - { - val <<= 8; - val |= (unsigned int) *insn++; - bits -= 8; - } - while (bits > 0); - val >>= -bits; - val &= ((1U << (operand->bits - 1)) << 1) - 1; - - /* Sign extend value if the operand is signed or pc relative. */ - if ((operand->flags & (S390_OPERAND_SIGNED | S390_OPERAND_PCREL)) - && (val & (1U << (operand->bits - 1)))) - val |= (-1U << (operand->bits - 1)) << 1; - - /* Double value if the operand is pc relative. */ - if (operand->flags & S390_OPERAND_PCREL) - val <<= 1; - - /* Length x in an instructions has real length x+1. */ - if (operand->flags & S390_OPERAND_LENGTH) - val++; - return val; -} - -/* Print a S390 instruction. */ - -int -print_insn_s390 (memaddr, info) - bfd_vma memaddr; - struct disassemble_info *info; -{ - bfd_byte buffer[6]; - const struct s390_opcode *opcode; - const struct s390_opcode *opcode_end; - unsigned int value; - int status, opsize, bufsize; - char separator; - - if (init_flag == 0) - init_disasm (info); - - /* The output looks better if we put 6 bytes on a line. */ - info->bytes_per_line = 6; - - /* Every S390 instruction is max 6 bytes long. */ - memset (buffer, 0, 6); - status = (*info->read_memory_func) (memaddr, buffer, 6, info); - if (status != 0) - { - for (bufsize = 0; bufsize < 6; bufsize++) - if ((*info->read_memory_func) (memaddr, buffer, bufsize + 1, info) != 0) - break; - if (bufsize <= 0) - { - (*info->memory_error_func) (status, memaddr, info); - return -1; - } - /* Opsize calculation looks strange but it works - 00xxxxxx -> 2 bytes, 01xxxxxx/10xxxxxx -> 4 bytes, - 11xxxxxx -> 6 bytes. */ - opsize = ((((buffer[0] >> 6) + 1) >> 1) + 1) << 1; - status = opsize > bufsize; - } - else - { - bufsize = 6; - opsize = ((((buffer[0] >> 6) + 1) >> 1) + 1) << 1; - } - - if (status == 0) - { - /* Find the first match in the opcode table. */ - opcode_end = s390_opcodes + s390_num_opcodes; - for (opcode = s390_opcodes + opc_index[(int) buffer[0]]; - (opcode < opcode_end) && (buffer[0] == opcode->opcode[0]); - opcode++) - { - const struct s390_operand *operand; - const unsigned char *opindex; - - /* Check architecture. */ - if (!(opcode->architecture & current_arch_mask)) - continue; - /* Check signature of the opcode. */ - if ((buffer[1] & opcode->mask[1]) != opcode->opcode[1] - || (buffer[2] & opcode->mask[2]) != opcode->opcode[2] - || (buffer[3] & opcode->mask[3]) != opcode->opcode[3] - || (buffer[4] & opcode->mask[4]) != opcode->opcode[4] - || (buffer[5] & opcode->mask[5]) != opcode->opcode[5]) - continue; - - /* The instruction is valid. */ - if (opcode->operands[0] != 0) - (*info->fprintf_func) (info->stream, "%s\t", opcode->name); - else - (*info->fprintf_func) (info->stream, "%s", opcode->name); - - /* Extract the operands. */ - separator = 0; - for (opindex = opcode->operands; *opindex != 0; opindex++) - { - unsigned int value; - - operand = s390_operands + *opindex; - value = s390_extract_operand (buffer, operand); - - if ((operand->flags & S390_OPERAND_INDEX) && value == 0) - continue; - if ((operand->flags & S390_OPERAND_BASE) && - value == 0 && separator == '(') - { - separator = ','; - continue; - } - - if (separator) - (*info->fprintf_func) (info->stream, "%c", separator); - - if (operand->flags & S390_OPERAND_GPR) - (*info->fprintf_func) (info->stream, "%%r%i", value); - else if (operand->flags & S390_OPERAND_FPR) - (*info->fprintf_func) (info->stream, "%%f%i", value); - else if (operand->flags & S390_OPERAND_AR) - (*info->fprintf_func) (info->stream, "%%a%i", value); - else if (operand->flags & S390_OPERAND_CR) - (*info->fprintf_func) (info->stream, "%%c%i", value); - else if (operand->flags & S390_OPERAND_PCREL) - (*info->print_address_func) (memaddr + (int) value, info); - else if (operand->flags & S390_OPERAND_SIGNED) - (*info->fprintf_func) (info->stream, "%i", (int) value); - else - (*info->fprintf_func) (info->stream, "%i", value); - - if (operand->flags & S390_OPERAND_DISP) - { - separator = '('; - } - else if (operand->flags & S390_OPERAND_BASE) - { - (*info->fprintf_func) (info->stream, ")"); - separator = ','; - } - else - separator = ','; - } - - /* Found instruction, printed it, return its size. */ - return opsize; - } - /* No matching instruction found, fall through to hex print. */ - } - - if (bufsize >= 4) - { - value = (unsigned int) buffer[0]; - value = (value << 8) + (unsigned int) buffer[1]; - value = (value << 8) + (unsigned int) buffer[2]; - value = (value << 8) + (unsigned int) buffer[3]; - (*info->fprintf_func) (info->stream, ".long\t0x%08x", value); - return 4; - } - else if (bufsize >= 2) - { - value = (unsigned int) buffer[0]; - value = (value << 8) + (unsigned int) buffer[1]; - (*info->fprintf_func) (info->stream, ".short\t0x%04x", value); - return 2; - } - else - { - value = (unsigned int) buffer[0]; - (*info->fprintf_func) (info->stream, ".byte\t0x%02x", value); - return 1; - } -} diff --git a/contrib/binutils/opcodes/s390-mkopc.c b/contrib/binutils/opcodes/s390-mkopc.c deleted file mode 100644 index d79ff810f0e5..000000000000 --- a/contrib/binutils/opcodes/s390-mkopc.c +++ /dev/null @@ -1,190 +0,0 @@ -/* s390-mkopc.c -- Generates opcode table out of s390-opc.txt - Copyright 2000, 2001 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - - This file is part of GDB, GAS, and the GNU binutils. - - 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. */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -/* ARCHBITS_ESA and ARCH_ESAME correspond to the bit numbers defined - by s390_opcode_arch_val in include/opcode/s390.h: - ARCHBITS_ESAONLY = (1<<S390_OPCODE_ESA) - ARCHBITS_ESA = (1<<S390_OPCODE_ESA) + (1<<S390_OPCODE_ESAME) - ARCHBITS_ESA = (1<<S390_OPCODE_ESAME). */ -#define ARCHBITS_ESAONLY 1 -#define ARCHBITS_ESA 3 -#define ARCHBITS_ESAME 2 - -struct op_struct - { - char opcode[16]; - char mnemonic[16]; - char format[16]; - int archbits; - unsigned long long sort_value; - int no_nibbles; - }; - -struct op_struct *op_array; -int max_ops; -int no_ops; - -static void -createTable (void) -{ - max_ops = 256; - op_array = malloc (max_ops * sizeof (struct op_struct)); - no_ops = 0; -} - -/* `insertOpcode': insert an op_struct into sorted opcode array. */ - -static void -insertOpcode (char *opcode, char *mnemonic, char *format, int archbits) -{ - char *str; - unsigned long long sort_value; - int no_nibbles; - int ix, k; - - while (no_ops >= max_ops) - { - max_ops = max_ops * 2; - op_array = realloc (op_array, max_ops * sizeof (struct op_struct)); - } - - sort_value = 0; - str = opcode; - for (ix = 0; ix < 16; ix++) - { - if (*str >= '0' && *str <= '9') - sort_value = (sort_value << 4) + (*str - '0'); - else if (*str >= 'a' && *str <= 'f') - sort_value = (sort_value << 4) + (*str - 'a' + 10); - else if (*str >= 'A' && *str <= 'F') - sort_value = (sort_value << 4) + (*str - 'A' + 10); - else if (*str == '?') - sort_value <<= 4; - else - break; - str ++; - } - sort_value <<= 4*(16 - ix); - no_nibbles = ix; - for (ix = 0; ix < no_ops; ix++) - if (sort_value > op_array[ix].sort_value) - break; - for (k = no_ops; k > ix; k--) - op_array[k] = op_array[k-1]; - strcpy(op_array[ix].opcode, opcode); - strcpy(op_array[ix].mnemonic, mnemonic); - strcpy(op_array[ix].format, format); - op_array[ix].sort_value = sort_value; - op_array[ix].no_nibbles = no_nibbles; - op_array[ix].archbits = archbits; - no_ops++; -} - -static char file_header[] = - "/* The opcode table. This file was generated by s390-mkopc.\n\n" - " The format of the opcode table is:\n\n" - " NAME OPCODE MASK OPERANDS\n\n" - " Name is the name of the instruction.\n" - " OPCODE is the instruction opcode.\n" - " MASK is the opcode mask; this is used to tell the disassembler\n" - " which bits in the actual opcode must match OPCODE.\n" - " OPERANDS is the list of operands.\n\n" - " The disassembler reads the table in order and prints the first\n" - " instruction which matches. */\n\n" - "const struct s390_opcode s390_opcodes[] =\n {\n"; - -/* `dumpTable': write opcode table. */ - -static void -dumpTable (void) -{ - char *str; - int ix; - - /* Write hash table entries (slots). */ - printf (file_header); - - for (ix = 0; ix < no_ops; ix++) - { - printf (" { \"%s\", ", op_array[ix].mnemonic); - for (str = op_array[ix].opcode; *str != 0; str++) - if (*str == '?') - *str = '0'; - printf ("OP%i(0x%sLL), ", - op_array[ix].no_nibbles*4, op_array[ix].opcode); - printf ("MASK_%s, INSTR_%s, ", - op_array[ix].format, op_array[ix].format); - printf ("%i}", op_array[ix].archbits); - if (ix < no_ops-1) - printf (",\n"); - else - printf ("\n"); - } - printf ("};\n\n"); - printf ("const int s390_num_opcodes =\n"); - printf (" sizeof (s390_opcodes) / sizeof (s390_opcodes[0]);\n\n"); -} - -int -main (void) -{ - char currentLine[256]; - - createTable (); - - /* Read opcode descriptions from `stdin'. For each mnemonic, - make an entry into the opcode table. */ - while (fgets (currentLine, sizeof (currentLine), stdin) != NULL) - { - char opcode[16]; - char mnemonic[16]; - char format[16]; - char description[64]; - char archtag[16]; - int archbits; - - if (currentLine[0] == '#') - continue; - memset (opcode, 0, 8); - if (sscanf (currentLine, "%15s %15s %15s \"%[^\"]\" %15s", - opcode, mnemonic, format, description, archtag) == 5) - { - if (strcmp (archtag, "esaonly") == 0) - archbits = ARCHBITS_ESAONLY; - else if (strcmp (archtag, "esa") == 0) - archbits = ARCHBITS_ESA; - else if (strcmp (archtag, "esame") == 0) - archbits = ARCHBITS_ESAME; - else - archbits = 0; - insertOpcode (opcode, mnemonic, format, archbits); - } - else - fprintf (stderr, "Couldn't scan line %s\n", currentLine); - } - - dumpTable (); - return 0; -} diff --git a/contrib/binutils/opcodes/s390-opc.c b/contrib/binutils/opcodes/s390-opc.c deleted file mode 100644 index 7cd8231d95a6..000000000000 --- a/contrib/binutils/opcodes/s390-opc.c +++ /dev/null @@ -1,318 +0,0 @@ -/* s390-opc.c -- S390 opcode list - Copyright 2000, 2001 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - - This file is part of GDB, GAS, and the GNU binutils. - - 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. */ - -#include <stdio.h> -#include "ansidecl.h" -#include "opcode/s390.h" - -/* This file holds the S390 opcode table. The opcode table - includes almost all of the extended instruction mnemonics. This - permits the disassembler to use them, and simplifies the assembler - logic, at the cost of increasing the table size. The table is - strictly constant data, so the compiler should be able to put it in - the .text section. - - This file also holds the operand table. All knowledge about - inserting operands into instructions and vice-versa is kept in this - file. */ - -/* The operands table. - The fields are bits, shift, insert, extract, flags. */ - -const struct s390_operand s390_operands[] = -{ -#define UNUSED 0 - { 0, 0, 0 }, /* Indicates the end of the operand list */ - -#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 }, -#define R_16 3 /* GPR starting at position 16 */ - { 4, 16, S390_OPERAND_GPR }, -#define R_20 4 /* GPR starting at position 20 */ - { 4, 20, S390_OPERAND_GPR }, -#define R_24 5 /* GPR starting at position 24 */ - { 4, 24, S390_OPERAND_GPR }, -#define R_28 6 /* GPR starting at position 28 */ - { 4, 28, S390_OPERAND_GPR }, -#define R_32 7 /* GPR starting at position 32 */ - { 4, 32, S390_OPERAND_GPR }, - -#define F_8 8 /* FPR starting at position 8 */ - { 4, 8, S390_OPERAND_FPR }, -#define F_12 9 /* FPR starting at position 12 */ - { 4, 12, S390_OPERAND_FPR }, -#define F_16 10 /* FPR starting at position 16 */ - { 4, 16, S390_OPERAND_FPR }, -#define F_20 11 /* FPR starting at position 16 */ - { 4, 16, S390_OPERAND_FPR }, -#define F_24 12 /* FPR starting at position 24 */ - { 4, 24, S390_OPERAND_FPR }, -#define F_28 13 /* FPR starting at position 28 */ - { 4, 28, S390_OPERAND_FPR }, -#define F_32 14 /* FPR starting at position 32 */ - { 4, 32, S390_OPERAND_FPR }, - -#define A_8 15 /* Access reg. starting at position 8 */ - { 4, 8, S390_OPERAND_AR }, -#define A_12 16 /* Access reg. starting at position 12 */ - { 4, 12, S390_OPERAND_AR }, -#define A_24 17 /* Access reg. starting at position 24 */ - { 4, 24, S390_OPERAND_AR }, -#define A_28 18 /* Access reg. starting at position 28 */ - { 4, 28, S390_OPERAND_AR }, - -#define C_8 19 /* Control reg. starting at position 8 */ - { 4, 8, S390_OPERAND_CR }, -#define C_12 20 /* Control reg. starting at position 12 */ - { 4, 12, S390_OPERAND_CR }, - -#define B_16 21 /* Base register starting at position 16 */ - { 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 }, - -#define X_12 23 /* Index register starting at position 12 */ - { 4, 12, S390_OPERAND_INDEX|S390_OPERAND_GPR }, - -#define D_20 24 /* Displacement starting at position 20 */ - { 12, 20, S390_OPERAND_DISP }, -#define D_36 25 /* Displacement starting at position 36 */ - { 12, 36, S390_OPERAND_DISP }, - -#define L4_8 26 /* 4 bit length starting at position 8 */ - { 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 }, - -#define U4_8 29 /* 4 bit unsigned value starting at 8 */ - { 4, 8, 0 }, -#define U4_12 30 /* 4 bit unsigned value starting at 12 */ - { 4, 12, 0 }, -#define U4_16 31 /* 4 bit unsigned value starting at 16 */ - { 4, 16, 0 }, -#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 }, -#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 }, -#define J16_16 37 /* PC relative jump offset at 16 */ - { 16, 16, S390_OPERAND_PCREL }, -#define J32_16 38 /* PC relative long offset at 16 */ - { 32, 16, S390_OPERAND_PCREL } -}; - - -/* Macros used to form opcodes. */ - -/* 8/16/48 bit opcodes. */ -#define OP8(x) { x, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define OP16(x) { x >> 8, x & 255, 0x00, 0x00, 0x00, 0x00 } -#define OP48(x) { x >> 40, (x >> 32) & 255, (x >> 24) & 255, \ - (x >> 16) & 255, (x >> 8) & 255, x & 255} - -/* The new format of the INSTR_x_y and MASK_x_y defines is based - on the following rules: - 1) the middle part of the definition (x in INSTR_x_y) is the official - names of the instruction format that you can find in the principals - of operation. - 2) the last part of the definition (y in INSTR_x_y) gives you an idea - which operands the binary represenation of the instruction has. - The meanings of the letters in y are: - a - access register - c - control register - d - displacement, 12 bit - f - floating pointer register - i - signed integer, 4 or 8 bit - l - length, 4 or 8 bit - p - pc relative - r - general purpose register - u - unsigned integer, 4 or 8 bit - 0 - operand skipped. - The order of the letters reflects the layout of the format in - storage and not the order of the paramaters of the instructions. - The use of the letters is not a 100% match with the PoP but it is - quite close. - - For example the instruction "mvo" is defined in the PoP as follows: - - MVO D1(L1,B1),D2(L2,B2) [SS] - - -------------------------------------- - | 'F1' | L1 | L2 | B1 | D1 | B2 | D2 | - -------------------------------------- - 0 8 12 16 20 32 36 - - The instruction format is: INSTR_SS_LLRDRD / MASK_SS_LLRDRD. */ - -#define INSTR_E 2, { 0,0,0,0,0,0 } /* e.g. pr */ -#define INSTR_RIE_RRP 6, { R_8,R_12,J16_16,0,0,0 } /* e.g. brxhg */ -#define INSTR_RIL_0P 6, { J32_16,0,0,0,0 } /* e.g. jg */ -#define INSTR_RIL_RP 6, { R_8,J32_16,0,0,0,0 } /* e.g. brasl */ -#define INSTR_RIL_UP 6, { U4_8,J32_16,0,0,0,0 } /* e.g. brcl */ -#define INSTR_RI_0P 4, { J16_16,0,0,0,0,0 } /* e.g. j */ -#define INSTR_RI_RI 4, { R_8,I16_16,0,0,0,0 } /* e.g. ahi */ -#define INSTR_RI_RP 4, { R_8,J16_16,0,0,0,0 } /* e.g. brct */ -#define INSTR_RI_RU 4, { R_8,U16_16,0,0,0,0 } /* e.g. tml */ -#define INSTR_RI_UP 4, { U4_8,J16_16,0,0,0,0 } /* e.g. brc */ -#define INSTR_RRE_00 4, { 0,0,0,0,0,0 } /* e.g. palb */ -#define INSTR_RRE_0R 4, { R_28,0,0,0,0,0 } /* e.g. tb */ -#define INSTR_RRE_AA 4, { A_24,A_28,0,0,0,0 } /* e.g. cpya */ -#define INSTR_RRE_AR 4, { A_24,R_28,0,0,0,0 } /* e.g. sar */ -#define INSTR_RRE_F0 4, { F_24,0,0,0,0,0 } /* e.g. sqer */ -#define INSTR_RRE_FF 4, { F_24,F_28,0,0,0,0 } /* e.g. debr */ -#define INSTR_RRE_R0 4, { R_24,0,0,0,0,0 } /* e.g. ipm */ -#define INSTR_RRE_RA 4, { R_24,A_28,0,0,0,0 } /* e.g. ear */ -#define INSTR_RRE_RF 4, { R_24,F_28,0,0,0,0 } /* e.g. cefbr */ -#define INSTR_RRE_RR 4, { R_24,R_28,0,0,0,0 } /* e.g. lura */ -#define INSTR_RRF_F0FF 4, { F_16,F_24,F_28,0,0,0 } /* e.g. madbr */ -#define INSTR_RRF_FUFF 4, { F_24,F_16,F_28,U4_20,0,0 } /* e.g. didbr */ -#define INSTR_RRF_RURR 4, { R_24,R_28,R_16,U4_20,0,0 } /* e.g. .insn */ -#define INSTR_RRF_U0FF 4, { F_24,U4_16,F_28,0,0,0 } /* e.g. cfxbr */ -#define INSTR_RRF_U0FR 4, { F_24,U4_16,R_28,0,0,0 } /* e.g. cfebr */ -#define INSTR_RRF_U0FR 4, { F_24,U4_16,R_28,0,0,0 } /* e.g. cfxbr */ -#define INSTR_RR_0R 2, { R_12, 0,0,0,0,0 } /* e.g. br */ -#define INSTR_RR_FF 2, { F_8,F_12,0,0,0,0 } /* e.g. adr */ -#define INSTR_RR_R0 2, { R_8, 0,0,0,0,0 } /* e.g. spm */ -#define INSTR_RR_RR 2, { R_8,R_12,0,0,0,0 } /* e.g. lr */ -#define INSTR_RR_U0 2, { U8_8, 0,0,0,0,0 } /* e.g. svc */ -#define INSTR_RR_UR 2, { U4_8,R_12,0,0,0,0 } /* e.g. bcr */ -#define INSTR_RSE_RRRD 6, { R_8,R_12,D_20,B_16,0,0 } /* e.g. lmh */ -#define INSTR_RSE_RURD 6, { R_8,U4_12,D_20,B_16,0,0 } /* e.g. icmh */ -#define INSTR_RSI_RRP 4, { R_8,R_12,J16_16,0,0,0 } /* e.g. brxh */ -#define INSTR_RS_AARD 4, { A_8,A_12,D_20,B_16,0,0 } /* e.g. lam */ -#define INSTR_RS_CCRD 4, { C_8,C_12,D_20,B_16,0,0 } /* e.g. lctl */ -#define INSTR_RS_R0RD 4, { R_8,D_20,B_16,0,0,0 } /* e.g. sll */ -#define INSTR_RS_RRRD 4, { R_8,R_12,D_20,B_16,0,0 } /* e.g. cs */ -#define INSTR_RS_RURD 4, { R_8,U4_12,D_20,B_16,0,0 } /* e.g. icm */ -#define INSTR_RXE_FRRD 6, { F_8,D_20,X_12,B_16,0,0 } /* e.g. axbr */ -#define INSTR_RXE_RRRD 6, { R_8,D_20,X_12,B_16,0,0 } /* e.g. lg */ -#define INSTR_RXF_FRRDF 6, { F_32,F_8,D_20,X_12,B_16,0 } /* e.g. madb */ -#define INSTR_RXF_RRRDR 6, { R_32,R_8,D_20,X_12,B_16,0 } /* e.g. .insn */ -#define INSTR_RX_0RRD 4, { D_20,X_12,B_16,0,0,0 } /* e.g. be */ -#define INSTR_RX_FRRD 4, { F_8,D_20,X_12,B_16,0,0 } /* e.g. ae */ -#define INSTR_RX_RRRD 4, { R_8,D_20,X_12,B_16,0,0 } /* e.g. l */ -#define INSTR_RX_URRD 4, { U4_8,D_20,X_12,B_16,0,0 } /* e.g. bc */ -#define INSTR_SI_URD 4, { D_20,B_16,U8_8,0,0,0 } /* e.g. cli */ -#define INSTR_SSE_RDRD 6, { D_20,B_16,D_36,B_32,0,0 } /* e.g. mvsdk */ -#define INSTR_SS_L0RDRD 6, { D_20,L8_8,B_16,D_36,B_32,0 } /* e.g. mvc */ -#define INSTR_SS_LIRDRD 6, { D_20,L4_8,B_16,D_36,B_32,U4_12 } /* e.g. srp */ -#define INSTR_SS_LLRDRD 6, { D_20,L4_8,B_16,D_36,L4_12,B_32 } /* e.g. pack */ -#define INSTR_SS_RRRDRD 6, { D_20,R_8,B_16,D_36,B_32,R_12 } /* e.g. mvck */ -#define INSTR_SS_RRRDRD2 6, { R_8,D_20,B_16,R_12,D_36,B_32 } /* e.g. plo */ -#define INSTR_SS_RRRDRD3 6, { R_8,R_12,D_20,B_16,D_36,B_32 } /* e.g. lmd */ -#define INSTR_S_00 4, { 0,0,0,0,0,0 } /* e.g. hsch */ -#define INSTR_S_RD 4, { D_20,B_16,0,0,0,0 } /* e.g. lpsw */ - -#define MASK_E { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RIE_RRP { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff } -#define MASK_RIL_0P { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RIL_RP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RIL_UP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RI_0P { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RI_RI { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RI_RP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RI_RU { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RI_UP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RRE_00 { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 } -#define MASK_RRE_0R { 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00 } -#define MASK_RRE_AA { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 } -#define MASK_RRE_AR { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 } -#define MASK_RRE_F0 { 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00 } -#define MASK_RRE_FF { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 } -#define MASK_RRE_R0 { 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00 } -#define MASK_RRE_RA { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 } -#define MASK_RRE_RF { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 } -#define MASK_RRE_RR { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 } -#define MASK_RRF_F0FF { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 } -#define MASK_RRF_FUFF { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RRF_RURR { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RRF_U0FF { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 } -#define MASK_RRF_U0FR { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 } -#define MASK_RRF_U0FR { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 } -#define MASK_RR_0R { 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RR_FF { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RR_R0 { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RR_RR { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RR_U0 { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RR_UR { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RSE_RRRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff } -#define MASK_RSE_RURD { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff } -#define MASK_RSI_RRP { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RS_AARD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RS_CCRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RS_R0RD { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RS_RRRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RS_RURD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RXE_FRRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff } -#define MASK_RXE_RRRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff } -#define MASK_RXF_FRRDF { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff } -#define MASK_RXF_RRRDR { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff } -#define MASK_RX_0RRD { 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RX_FRRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RX_RRRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_RX_URRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_SI_URD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_SSE_RDRD { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } -#define MASK_SS_L0RDRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_SS_LIRDRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_SS_LLRDRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_SS_RRRDRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_SS_RRRDRD2 { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_SS_RRRDRD3 { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } -#define MASK_S_00 { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 } -#define MASK_S_RD { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } - -/* The opcode formats table (blueprints for .insn pseudo mnemonic). */ - -const struct s390_opcode s390_opformats[] = - { - { "e", OP8(0x00LL), MASK_E, INSTR_E, 3 }, - { "ri", OP8(0x00LL), MASK_RI_RI, INSTR_RI_RI, 3 }, - { "rie", OP8(0x00LL), MASK_RIE_RRP, INSTR_RIE_RRP, 3 }, - { "ril", OP8(0x00LL), MASK_RIL_RP, INSTR_RIL_RP, 3 }, - { "rr", OP8(0x00LL), MASK_RR_RR, INSTR_RR_RR, 3 }, - { "rre", OP8(0x00LL), MASK_RRE_RR, INSTR_RRE_RR, 3 }, - { "rrf", OP8(0x00LL), MASK_RRF_RURR, INSTR_RRF_RURR, 3 }, - { "rs", OP8(0x00LL), MASK_RS_RRRD, INSTR_RS_RRRD, 3 }, - { "rse", OP8(0x00LL), MASK_RSE_RRRD, INSTR_RSE_RRRD, 3 }, - { "rsi", OP8(0x00LL), MASK_RSI_RRP, INSTR_RSI_RRP, 3 }, - { "rx", OP8(0x00LL), MASK_RX_RRRD, INSTR_RX_RRRD, 3 }, - { "rxe", OP8(0x00LL), MASK_RXE_RRRD, INSTR_RXE_RRRD, 3 }, - { "rxf", OP8(0x00LL), MASK_RXF_RRRDR, INSTR_RXF_RRRDR,3 }, - { "s", OP8(0x00LL), MASK_S_RD, INSTR_S_RD, 3 }, - { "si", OP8(0x00LL), MASK_SI_URD, INSTR_SI_URD, 3 }, - { "ss", OP8(0x00LL), MASK_SS_RRRDRD, INSTR_SS_RRRDRD,3 }, - { "sse", OP8(0x00LL), MASK_SSE_RDRD, INSTR_SSE_RDRD, 3 }, -}; - -const int s390_num_opformats = - sizeof (s390_opformats) / sizeof (s390_opformats[0]); - -#include "s390-opc.tab" diff --git a/contrib/binutils/opcodes/s390-opc.txt b/contrib/binutils/opcodes/s390-opc.txt deleted file mode 100644 index ddcf0894ea22..000000000000 --- a/contrib/binutils/opcodes/s390-opc.txt +++ /dev/null @@ -1,626 +0,0 @@ -# S/390 opcodes list. Use s390-mkopc to convert it into the opcode table. -# Copyright 2000, 2001 Free Software Foundation, Inc. -# Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -5a a RX_RRRD "add" esa -6a ad RX_FRRD "add normalized (long)" esa -2a adr RR_FF "add normalized (long)" esa -7a ae RX_FRRD "add normalized (short)" esa -3a aer RR_FF "add normalized (short)" esa -4a ah RX_RRRD "add halfword" esa -5e al RX_RRRD "add logical" esa -1e alr RR_RR "add logical" esa -fa ap SS_LLRDRD "add decimal" esa -1a ar RR_RR "add" esa -7e au RX_FRRD "add unnormalized (short)" esa -3e aur RR_FF "add unnormalized (short)" esa -6e aw RX_FRRD "add unnormalized (long)" esa -2e awr RR_FF "add unnormalized (long)" esa -36 axr RR_FF "add normalized" esa -b240 bakr RRE_RR "branch and stack" esa -45 bal RX_RRRD "branch and link" esa -05 balr RR_RR "branch and link" esa -4d bas RX_RRRD "branch and save" esa -0d basr RR_RR "branch and save" esa -0c bassm RR_RR "branch and save and set mode" esa -47 bc RX_URRD "branch on condition" esa -07 bcr RR_UR "branch on condition" esa -46 bct RX_RRRD "branch on count" esa -06 bctr RR_RR "branch on count" esa -b258 bsg RRE_RR "branch in subspace group" esa -0b bsm RR_RR "branch and set mode" esa -86 bxh RS_RRRD "branch on index high" esa -87 bxle RS_RRRD "branch on index low or equal" esa -59 c RX_RRRD "compare" esa -69 cd RX_FRRD "compare (long)" esa -29 cdr RR_FF "compare (long)" esa -bb cds RS_RRRD "compare double and swap" esa -79 ce RX_FRRD "compare (short)" esa -39 cer RR_FF "compare (short)" esa -b21a cfc S_RD "compare and form codeword" esa -49 ch RX_RRRD "compare halfword" esa -55 cl RX_RRRD "compare logical" esa -d5 clc SS_L0RDRD "compare logical" esa -0f clcl RR_RR "compare logical long" esa -95 cli SI_URD "compare logical" esa -bd clm RS_RURD "compare logical characters under mask" esa -15 clr RR_RR "compare logical" esa -b25d clst RRE_RR "compare logical string" esa -b263 cmpsc RRE_RR "compression call" esa -f9 cp SS_LLRDRD "compare decimal" esa -b24d cpya RRE_AA "copy access" esa -19 cr RR_RR "compare" esa -ba cs RS_RRRD "compare and swap" esa -b230 csch S_00 "clear subchannel" esa -b257 cuse RRE_RR "compare until substring equal" esa -b250 csp RRE_RR "compare and swap and purge" esa -4f cvb RX_RRRD "convert to binary" esa -4e cvd RX_RRRD "convert to decimal" esa -5d d RX_RRRD "divide" esa -6d dd RX_FRRD "divide (long)" esa -2d ddr RR_FF "divide (long)" esa -7d de RX_FRRD "divide (short)" esa -3d der RR_FF "divide (short)" esa -83 diag RS_RRRD "diagnose" esa -fd dp SS_LLRDRD "divide decimal" esa -1d dr RR_RR "divide" esa -b22d dxr RRE_F0 "divide (ext.)" esa -b24f ear RRE_RA "extract access" esa -de ed SS_L0RDRD "edit" esa -df edmk SS_L0RDRD "edit and mark" esa -b226 epar RRE_R0 "extract primary ASN" esa -b249 ereg RRE_RR "extract stacked registers" esa -b227 esar RRE_R0 "extract secondary ASN" esa -b24a esta RRE_RR "extract stacked state" esa -44 ex RX_RRRD "execute" esa -24 hdr RR_FF "halve (long)" esa -34 her RR_FF "halve (short)" esa -b231 hsch S_00 "halt subchannel" esa -b224 iac RRE_R0 "insert address space control" esa -43 ic RX_RRRD "insert character" esa -bf icm RS_RURD "insert characters under mask" esa -b20b ipk S_00 "insert PSW key" esa -b222 ipm RRE_R0 "insert program mask" esa -b221 ipte RRE_RR "invalidate page table entry" esa -b229 iske RRE_RR "insert storage key extended" esa -b223 ivsk RRE_RR "insert virtual storage key" esa -58 l RX_RRRD "load" esa -41 la RX_RRRD "load address" esa -51 lae RX_RRRD "load address extended" esa -9a lam RS_AARD "load access multiple" esa -e500 lasp SSE_RDRD "load address space parameters" esa -23 lcdr RR_FF "load complement (long)" esa -33 lcer RR_FF "load complement (short)" esa -13 lcr RR_RR "load complement" esa -b7 lctl RS_CCRD "load control" esa -68 ld RX_FRRD "load (long)" esa -28 ldr RR_FF "load (long)" esa -78 le RX_FRRD "load (short)" esa -38 ler RR_FF "load (short)" esa -48 lh RX_RRRD "load halfword" esa -98 lm RS_RRRD "load multiple" esa -21 lndr RR_FF "load negative (long)" esa -31 lner RR_FF "load negative (short)" esa -11 lnr RR_RR "load negative" esa -20 lpdr RR_FF "load positive (long)" esa -30 lper RR_FF "load positive (short)" esa -10 lpr RR_RR "load positive" esa -82 lpsw S_RD "load PSW" esa -18 lr RR_RR "load" esa -b1 lra RX_RRRD "load real address" esa -25 lrdr RR_FF "load rounded (ext. to long)" esa -35 lrer RR_FF "load rounded (long to short)" esa -22 ltdr RR_FF "load and test (long)" esa -32 lter RR_FF "load and test (short)" esa -12 ltr RR_RR "load and test" esa -b24b lura RRE_RR "load using real address" esa -5c m RX_RRRD "multiply" esa -af mc SI_URD "monitor call" esa -6c md RX_FRRD "multiply (long)" esa -2c mdr RR_FF "multiply (long)" esa -7c me RX_FRRD "multiply (short to long)" esa -3c mer RR_FF "multiply (short to long)" esa -4c mh RX_RRRD "multiply halfword" esa -fc mp SS_LLRDRD "multiply decimal" esa -1c mr RR_RR "multiply" esa -b232 msch S_RD "modify subchannel" esa -b247 msta RRE_R0 "modify stacked state" esa -d2 mvc SS_L0RDRD "move" esa -e50f mvcdk SSE_RDRD "move with destination key" esa -e8 mvcin SS_L0RDRD "move inverse" esa -d9 mvck SS_RRRDRD "move with key" esa -0e mvcl RR_RR "move long" esa -da mvcp SS_RRRDRD "move to primary" esa -db mvcs SS_RRRDRD "move to secondary" esa -e50e mvcsk SSE_RDRD "move with source key" esa -92 mvi SI_URD "move" esa -d1 mvn SS_L0RDRD "move numerics" esa -f1 mvo SS_LLRDRD "move with offset" esa -b254 mvpg RRE_RR "move page" esa -b255 mvst RRE_RR "move string" esa -d3 mvz SS_L0RDRD "move zones" esa -67 mxd RX_FRRD "multiply (long to ext.)" esa -27 mxdr RR_FF "multiply (long to ext.)" esa -26 mxr RR_FF "multiply (ext.)" esa -54 n RX_RRRD "AND" esa -d4 nc SS_L0RDRD "AND" esa -94 ni SI_URD "AND" esa -14 nr RR_RR "AND" esa -56 o RX_RRRD "OR" esa -d6 oc SS_L0RDRD "OR" esa -96 oi SI_URD "OR" esa -16 or RR_RR "OR" esa -f2 pack SS_LLRDRD "pack" esa -b248 palb RRE_00 "purge ALB" esa -b218 pc S_RD "program call" esa -0101 pr E "program return" esa -b228 pt RRE_RR "program transfer" esa -b20d ptlb S_00 "purge TLB" esa -b23b rchp S_00 "reset channel path" esa -b22a rrbe RRE_RR "reset reference bit extended" esa -b238 rsch S_00 "resume subchannel" esa -5b s RX_RRRD "subtract" esa -b219 sac S_RD "set address space control" esa -b279 sacf S_RD "set address space control fast" esa -b237 sal S_00 "set address limit" esa -b24e sar RRE_AR "set access" esa -b23c schm S_00 "set channel monitor" esa -b204 sck S_RD "set clock" esa -b206 sckc S_RD "set clock comparator" esa -6b sd RX_FRRD "subtract normalized (long)" esa -2b sdr RR_FF "subtract normalized (long)" esa -7b se RX_FRRD "subtract normalized (short)" esa -3b ser RR_FF "subtract normalized (short)" esa -4b sh RX_RRRD "subtract halfword" esa -b214 sie S_RD "start interpretive execution" esa -ae sigp RS_RRRD "signal processor" esa -5f sl RX_RRRD "subtract logical" esa -8b sla RS_R0RD "shift left single" esa -8f slda RS_R0RD "shift left double (long)" esa -8d sldl RS_R0RD "shift left double logical (long)" esa -89 sll RS_R0RD "shift left single logical" esa -1f slr RR_RR "subtract logical" esa -fb sp SS_LLRDRD "subtract decimal" esa -b20a spka S_RD "set PSW key from address" esa -04 spm RR_R0 "set program mask" esa -b208 spt S_RD "set CPU timer" esa -b210 spx S_RD "set prefix" esa -b244 sqdr RRE_F0 "square root (long)" esa -b245 sqer RRE_F0 "square root (short)" esa -1b sr RR_RR "subtract" esa -8a sra RS_R0RD "shift right single" esa -8e srda RS_R0RD "shift right double (long)" esa -8c srdl RS_R0RD "shift right double logical (long)" esa -88 srl RS_R0RD "shift right single logical" esa -f0 srp SS_LIRDRD "shift and round decimal" esa -b25e srst RRE_RR "search string" esa -b225 ssar RRE_R0 "set secondary ASN" esa -b233 ssch S_RD "start subchannel" esa -b22b sske RRE_RR "set storage key extended" esa -80 ssm S_RD "set system mask" esa -50 st RX_RRRD "store" esa -9b stam RS_AARD "store access multiple" esa -b212 stap S_RD "store CPU address" esa -42 stc RX_RRRD "store character" esa -b205 stck S_RD "store clock" esa -b207 stckc S_RD "store clock comparator" esa -be stcm RS_RURD "store characters under mask" esa -b23a stcps S_RD "store channel path status" esa -b239 stcrw S_RD "store channel report word" esa -b6 stctl RS_CCRD "store control" esa -60 std RX_FRRD "store (long)" esa -70 ste RX_FRRD "store (short)" esa -40 sth RX_RRRD "store halfword" esa -b202 stidp S_RD "store CPU id" esa -90 stm RS_RRRD "store multiple" esa -ac stnsm SI_URD "store then AND system mask" esa -ad stosm SI_URD "store then OR system mask" esa -b209 stpt S_RD "store CPU timer" esa -b211 stpx S_RD "store prefix" esa -b234 stsch S_RD "store subchannel" esa -b246 stura RRE_RR "store using real address" esa -7f su RX_FRRD "subtract unnormalized (short)" esa -3f sur RR_FF "subtract unnormalized (short)" esa -0a svc RR_U0 "supervisor call" esa -6f sw RX_FRRD "subtract unnormalized (long)" esa -2f swr RR_FF "subtract unnormalized (long)" esa -37 sxr RR_FF "subtract normalized (ext.)" esa -b24c tar RRE_AR "test access" esa -b22c tb RRE_0R "test block" esa -91 tm SI_URD "test under mask" esa -b236 tpi S_RD "test pending interruption" esa -e501 tprot SSE_RDRD "test protection" esa -dc tr SS_L0RDRD "translate" esa -99 trace RS_RRRD "trace" esa -dd trt SS_L0RDRD "translate and test" esa -93 ts S_RD "test and set" esa -b235 tsch S_RD "test subchannel" esa -f3 unpk SS_LLRDRD "unpack" esa -0102 upt E "update tree" esa -57 x RX_RRRD "exclusive OR" esa -d7 xc SS_L0RDRD "exclusive OR" esa -97 xi SI_URD "exclusive OR" esa -17 xr RR_RR "exclusive OR" esa -f8 zap SS_LLRDRD "zero and add" esa -a70a ahi RI_RI "add halfword immediate" esa -84 brxh RSI_RRP "branch relative on index high" esa -85 brxle RSI_RRP "branch relative on index low or equal" esa -a705 bras RI_RP "branch relative and save" esa -a704 brc RI_UP "branch relative on condition" esa -a706 brct RI_RP "branch relative on count" esa -b241 cksm RRE_RR "checksum" esa -a70e chi RI_RI "compare halfword immediate" esa -a9 clcle RS_RRRD "compare logical long extended" esa -a708 lhi RI_RI "load halfword immediate" esa -a8 mvcle RS_RRRD "move long extended" esa -a70c mhi RI_RI "multiply halfword immediate" esa -b252 msr RRE_RR "multiply single" esa -71 ms RX_RRRD "multiply single" esa -a700 tmh RI_RU "test under mask high" esa -a701 tml RI_RU "test under mask low" esa -0700 nopr RR_0R "no operation" esa -0710 bor RR_0R "branch on overflow / if ones" esa -0720 bhr RR_0R "branch on high" esa -0720 bpr RR_0R "branch on plus" esa -0730 bnler RR_0R "branch on not low or equal" esa -0740 blr RR_0R "branch on low" esa -0740 bmr RR_0R "branch on minus / if mixed" esa -0750 bnher RR_0R "branch on not high or equal" esa -0760 blhr RR_0R "branch on low or high" esa -0770 bner RR_0R "branch on not equal" esa -0770 bnzr RR_0R "branch on not zero / if not zeros" esa -0780 ber RR_0R "branch on equal" esa -0780 bzr RR_0R "branch on zero / if zeros" esa -0790 bnlhr RR_0R "branch on not low or high" esa -07a0 bher RR_0R "branch on high or equal" esa -07b0 bnlr RR_0R "branch on not low" esa -07b0 bnmr RR_0R "branch on not minus / if not mixed" esa -07c0 bler RR_0R "brach on low or equal" esa -07d0 bnhr RR_0R "branch on not high" esa -07d0 bnpr RR_0R "branch on not plus" esa -07e0 bnor RR_0R "branch on not overflow / if not ones" esa -07f0 br RR_0R "unconditional branch" esa -4700 nop RX_0RRD "no operation" esa -4710 bo RX_0RRD "branch on overflow / if ones" esa -4720 bh RX_0RRD "branch on high" esa -4720 bp RX_0RRD "branch on plus" esa -4730 bnle RX_0RRD "branch on not low or equal" esa -4740 bl RX_0RRD "branch on low" esa -4740 bm RX_0RRD "branch on minus / if mixed" esa -4750 bnhe RX_0RRD "branch on not high or equal" esa -4760 blh RX_0RRD "branch on low or high" esa -4770 bne RX_0RRD "branch on not equal" esa -4770 bnz RX_0RRD "branch on not zero / if not zeros" esa -4780 be RX_0RRD "branch on equal" esa -4780 bz RX_0RRD "branch on zero / if zeros" esa -4790 bnlh RX_0RRD "branch on not low or high" esa -47a0 bhe RX_0RRD "branch on high or equal" esa -47b0 bnl RX_0RRD "branch on not low" esa -47b0 bnm RX_0RRD "branch on not minus / if not mixed" esa -47c0 ble RX_0RRD "branch on low or equal" esa -47d0 bnh RX_0RRD "branch on not high" esa -47d0 bnp RX_0RRD "branch on not plus" esa -47e0 bno RX_0RRD "branch on not overflow / if not ones" esa -47f0 b RX_0RRD "unconditional branch" esa -a714 jo RI_0P "jump on overflow / if ones" esa -a724 jh RI_0P "jump on A high" esa -a724 jp RI_0P "jump on plus" esa -a734 jnle RI_0P "jump on not low or equal" esa -a744 jl RI_0P "jump on A low" esa -a744 jm RI_0P "jump on minus / if mixed" esa -a754 jnhe RI_0P "jump on not high or equal" esa -a764 jlh RI_0P "jump on low or high" esa -a774 jne RI_0P "jump on A not equal B" esa -a774 jnz RI_0P "jump on not zero / if not zeros" esa -a784 je RI_0P "jump on A equal B" esa -a784 jz RI_0P "jump on zero / if zeros" esa -a794 jnlh RI_0P "jump on not low or high" esa -a7a4 jhe RI_0P "jump on high or equal" esa -a7b4 jnl RI_0P "jump on A not low" esa -a7b4 jnm RI_0P "jump on not minus / if not mixed" esa -a7c4 jle RI_0P "jump on low or equal" esa -a7d4 jnh RI_0P "jump on A not high" esa -a7d4 jnp RI_0P "jump on not plus" esa -a7e4 jno RI_0P "jump on not overflow / if not ones" esa -a7f4 j RI_0P "jump" esa -b34a axbr RRE_FF "add extended bfp" esa -b31a adbr RRE_FF "add long bfp" esa -ed000000001a adb RXE_FRRD "add long bfp" esa -b30a aebr RRE_FF "add short bfp" esa -ed000000000a aeb RXE_FRRD "add short bfp" esa -b349 cxbr RRE_FF "compare extended bfp" esa -b319 cdbr RRE_FF "compare long bfp" esa -ed0000000019 cdb RXE_FRRD "compare long bfp" esa -b309 cebr RRE_FF "compare short bfp" esa -ed0000000009 ceb RXE_FRRD "compare short bfp" esa -b348 kxbr RRE_FF "compare and signal extended bfp" esa -b318 kdbr RRE_FF "compare and signal long bfp" esa -ed0000000018 kdb RXE_FRRD "compare and signal long bfp" esa -b308 kebr RRE_FF "compare and signal short bfp" esa -ed0000000008 keb RXE_FRRD "compare and signal short bfp" esa -b396 cxfbr RRE_RF "convert from fixed 32 to extended bfp" esa -b395 cdfbr RRE_RF "convert from fixed 32 to long bfp" esa -b394 cefbr RRE_RF "convert from fixed 32 to short bfp" esa -b39a cfxbr RRF_U0FR "convert to fixed extended bfp to 32" esa -b399 cfdbr RRF_U0FR "convert to fixed long bfp to 32" esa -b398 cfebr RRF_U0FR "convert to fixed short bfp to 32" esa -b34d dxbr RRE_FF "divide extended bfp" esa -b31d ddbr RRE_FF "divide long bfp" esa -ed000000001d ddb RXE_FRRD "divide long bfp" esa -b30d debr RRE_FF "divide short bfp" esa -ed000000000d deb RXE_FRRD "divide short bfp" esa -b35b didbr RRF_FUFF "divide to integer long bfp" esa -b353 diebr RRF_FUFF "divide to integer short bfp" esa -b38c efpc RRE_RR "extract fpc" esa -b342 ltxbr RRE_FF "load and test extended bfp" esa -b312 ltdbr RRE_FF "load and test long bfp" esa -b302 ltebr RRE_FF "load and test short bfp" esa -b343 lcxbr RRE_FF "load complement extended bfp" esa -b313 lcdbr RRE_FF "load complement long bfp" esa -b303 lcebr RRE_FF "load complement short bfp" esa -b347 fixbr RRF_U0FF "load fp integer extended bfp" esa -b35f fidbr RRF_U0FF "load fp integer long bfp" esa -b357 fiebr RRF_U0FF "load fp integer short bfp" esa -b29d lfpc S_RD "load fpc" esa -b305 lxdbr RRE_FF "load lengthened long to extended bfp" esa -ed0000000005 lxdb RXE_FRRD "load lengthened long to extended bfp" esa -b306 lxebr RRE_FF "load lengthened short to extended bfp" esa -ed0000000006 lxeb RXE_FRRD "load lengthened short to extended bfp" esa -b304 ldebr RRE_FF "load lengthened short to long bfp" esa -ed0000000004 ldeb RXE_FRRD "load lengthened short to long bfp" esa -b341 lnxbr RRE_FF "load negative extended bfp" esa -b311 lndbr RRE_FF "load negative long bfp" esa -b301 lnebr RRE_FF "load negative short bfp" esa -b340 lpxbr RRE_FF "load positive extended bfp" esa -b310 lpdbr RRE_FF "load positive long bfp" esa -b300 lpebr RRE_FF "load positive short bfp" esa -b345 ldxbr RRE_FF "load rounded extended to long bfp" esa -b346 lexbr RRE_FF "load rounded extended to short bfp" esa -b344 ledbr RRE_FF "load rounded long to short bfp" esa -b34c mxbr RRE_FF "multiply extended bfp" esa -b31c mdbr RRE_FF "multiply long bfp" esa -ed000000001c mdb RXE_FRRD "multiply long bfp" esa -b307 mxdbr RRE_FF "multiply long to extended bfp" esa -ed0000000007 mxdb RXE_FRRD "multiply long to extended bfp" esa -b317 meebr RRE_FF "multiply short bfp" esa -ed0000000017 meeb RXE_FRRD "multiply short bfp" esa -b30c mdebr RRE_FF "multiply short to long bfp" esa -ed000000000c mdeb RXE_FRRD "multiply short to long bfp" esa -b31e madbr RRF_F0FF "multiply and add long bfp" esa -ed000000001e madb RXF_FRRDF "multiply and add long bfp" esa -b30e maebr RRF_F0FF "multiply and add short bfp" esa -ed000000000e maeb RXF_FRRDF "multiply and add short bfp" esa -b31f msdbr RRF_F0FF "multiply and subtract long bfp" esa -ed000000001f msdb RXF_FRRDF "multiply and subtract long bfp" esa -b30f msebr RRF_F0FF "multiply and subtract short bfp" esa -ed000000000f mseb RXF_FRRDF "multiply and subtract short bfp" esa -b384 sfpc RRE_RR "set fpc" esa -b299 srnm S_RD "set rounding mode" esa -b316 sqxbr RRE_FF "square root extended bfp" esa -b315 sqdbr RRE_FF "square root long bfp" esa -ed0000000015 sqdb RXE_FRRD "square root long bfp" esa -b314 sqebr RRE_FF "square root short bfp" esa -ed0000000014 sqeb RXE_FRRD "square root short bfp" esa -b29c stfpc S_RD "store fpc" esa -b34b sxbr RRE_FF "subtract extended bfp" esa -b31b sdbr RRE_FF "subtract long bfp" esa -ed000000001b sdb RXE_FRRD "subtract long bfp" esa -b30b sebr RRE_FF "subtract short bfp" esa -ed000000000b seb RXE_FRRD "subtract short bfp" esa -ed0000000012 tcxb RXE_FRRD "test data class extended bfp" esa -ed0000000011 tcdb RXE_FRRD "test data class long bfp" esa -ed0000000010 tceb RXE_FRRD "test data class short bfp" esa -b274 siga S_RD "signal adapter" esa -# are the following instructions confidential ?? -b2a6 cuutf RRE_RR "convert unicode to utf-8" esa -b2a7 cutfu RRE_RR "convert utf-8 to unicode" esa -ee plo SS_RRRDRD2 "perform locked operation" esa -b25a bsa RRE_RR "branch and set authority" esa -b277 rp S_RD "resume program" esa -0107 sckpf E "set clock programmable field" esa -b27d stsi S_RD "store system information" esa -01ff trap2 E "trap" esa -b2ff trap4 S_RD "trap4" esa -# Here are the new esame instructions: -b946 bctgr RRE_RR "branch on count 64" esame -b900 lpgr RRE_RR "load positive 64" esame -b910 lpgfr RRE_RR "load positive 64<32" esame -b901 lngr RRE_RR "load negative 64" esame -b911 lngfr RRE_RR "load negative 64<32" esame -b902 ltgr RRE_RR "load and test 64" esame -b912 ltgfr RRE_RR "load and test 64<32" esame -b903 lcgr RRE_RR "load complement 64" esame -b913 lcgfr RRE_RR "load complement 64<32" esame -b980 ngr RRE_RR "and 64" esame -b921 clgr RRE_RR "compare logical 64" esame -b931 clgfr RRE_RR "compare logical 64<32" esame -b981 ogr RRE_RR "or 64" esame -b982 xgr RRE_RR "exclusive or 64" esame -b904 lgr RRE_RR "load 64" esame -b914 lgfr RRE_RR "load 64<32" esame -b920 cgr RRE_RR "compare 64" esame -b930 cgfr RRE_RR "compare 64<32" esame -b908 agr RRE_RR "add 64" esame -b918 agfr RRE_RR "add 64<32" esame -b909 sgr RRE_RR "subtract 64" esame -b919 sgfr RRE_RR "subtract 64<32" esame -b90a algr RRE_RR "add logical 64" esame -b91a algfr RRE_RR "add logical 64<32" esame -b90b slgr RRE_RR "subtract logical 64" esame -b91b slgfr RRE_RR "subtract logical 64<32" esame -e30000000046 bctg RXE_RRRD "branch on count 64" esame -e3000000002e cvdg RXE_RRRD "convert to decimal 64" esame -e3000000000e cvbg RXE_RRRD "convert to binary 64" esame -e30000000024 stg RXE_RRRD "store 64" esame -e30000000080 ng RXE_RRRD "and 64" esame -e30000000021 clg RXE_RRRD "compare logical 64" esame -e30000000031 clgf RXE_RRRD "comparee logical 64<32" esame -e30000000081 og RXE_RRRD "or 64" esame -e30000000082 xg RXE_RRRD "exclusive or 64" esame -e30000000004 lg RXE_RRRD "load 64" esame -e30000000014 lgf RXE_RRRD "load 64<32" esame -e30000000015 lgh RXE_RRRD "load halfword 64" esame -e30000000020 cg RXE_RRRD "compare 64" esame -e30000000030 cgf RXE_RRRD "compare 64<32" esame -e30000000008 ag RXE_RRRD "add 64" esame -e30000000018 agf RXE_RRRD "add 64<32" esame -e30000000009 sg RXE_RRRD "subtract 64" esame -e30000000019 sgf RXE_RRRD "subtract 64<32" esame -e3000000000a alg RXE_RRRD "add logical 64" esame -e3000000001a algf RXE_RRRD "add logical 64<32" esame -e3000000000b slg RXE_RRRD "subtract logical 64" esame -e3000000001b slgf RXE_RRRD "subtract logical 64<32" esame -e3000000000c msg RXE_RRRD "multiply single 64" esame -e3000000001c msgf RXE_RRRD "multiply single 64<32" esame -ec0000000044 brxhg RIE_RRP "branch relative on index high 64" esame -ec0000000045 brxlg RIE_RRP "branch relative on index low or equal 64" esame -eb0000000044 bxhg RSE_RRRD "branch on index high 64" esame -eb0000000045 bxleg RSE_RRRD "branch on index low or equal 64" esame -eb000000000c srlg RSE_RRRD "shift right single logical 64" esame -eb000000000d sllg RSE_RRRD "shift left single logical 64" esame -eb000000000a srag RSE_RRRD "shift right single 64" esame -eb000000000b slag RSE_RRRD "shift left single 64" esame -eb0000000024 stmg RSE_RRRD "store multiple 64" esame -eb0000000026 stmh RSE_RRRD "store multiple high" esame -eb0000000004 lmg RSE_RRRD "load multiple 64" esame -eb0000000096 lmh RSE_RRRD "load multiple high" esame -ef lmd SS_RRRDRD3 "load multiple disjoint" esame -eb000000000f tracg RSE_RRRD "trace 64" esame -e30000000003 lrag RXE_RRRD "load real address 64" esame -e50000000002 strag SSE_RDRD "store read address" esame -eb0000000025 stctg RSE_RRRD "store control 64" esame -eb000000002f lctlg RSE_RRRD "load control 64" esame -eb0000000030 csg RSE_RRRD "compare and swap 64" esame -eb000000003e cdsg RSE_RRRD "compare double and swap 64" esame -eb0000000020 clmh RSE_RURD "compare logical characters under mask high" esame -eb000000002c stcmh RSE_RURD "store characters under mask high" esame -eb0000000080 icmh RSE_RURD "insert characters under mask high" esame -a700 tmlh RI_RU "test under mask low high" esame -a702 tmhh RI_RU "test under mask high high" esame -a701 tmll RI_RU "test under mask low low" esame -a703 tmhl RI_RU "test under mask high low" esame -c004 brcl RIL_UP "branch relative on condition long" esame -c014 jgo RIL_0P "jump long on overflow / if ones" esame -c024 jgh RIL_0P "jump long on high" esame -c024 jgp RIL_0P "jump long on plus" esame -c034 jgnle RIL_0P "jump long on not low or equal" esame -c044 jgl RIL_0P "jump long on low" esame -c044 jgm RIL_0P "jump long on minus / if mixed" esame -c054 jgnhe RIL_0P "jump long on not high or equal" esame -c064 jglh RIL_0P "jump long on low or high" esame -c074 jgne RIL_0P "jump long on not equal" esame -c074 jgnz RIL_0P "jump long on not zero / if not zeros" esame -c084 jge RIL_0P "jump long on equal" esame -c084 jgz RIL_0P "jump long on zero / if zeros" esame -c094 jgnlh RIL_0P "jump long on not low or high" esame -c0a4 jghe RIL_0P "jump long on high or equal" esame -c0b4 jgnl RIL_0P "jump long on not low" esame -c0b4 jgnm RIL_0P "jump long on not minus / if not mixed" esame -c0c4 jgle RIL_0P "jump long on low or equal" esame -c0d4 jgnh RIL_0P "jump long on not high" esame -c0d4 jgnp RIL_0P "jump long on not plus" esame -c0e4 jgno RIL_0P "jump long on not overflow / if not ones" esame -c0f4 jg RIL_0P "jump long" esame -c005 brasl RIL_RP "branch relative and save long" esame -a707 brctg RI_RP "branch relative on count 64" esame -a709 lghi RI_RI "load halfword immediate 64" esame -a70b aghi RI_RI "add halfword immediate 64" esame -a70d mghi RI_RI "multiply halfword immediate 64" esame -a70f cghi RI_RI "compare halfword immediate 64" esame -b925 sturg RRE_RR "store using real address 64" esame -b90e eregg RRE_RR "extract stacked registers 64" esame -b905 lurag RRE_RR "load using real address 64" esame -b90c msgr RRE_RR "multiply single 64" esame -b91c msgfr RRE_RR "multiply single 64<32" esame -b3a4 cegbr RRE_RR "convert from fixed 64 to short bfp" esame -b3a5 cdgbr RRE_RR "convert from fixed 64 to long bfp" esame -b3a6 cxgbr RRE_RR "convert from fixed 64 to extended bfp" esame -b3a8 cgebr RRF_U0FR "convert to fixed short bfd to 64" esame -b3a9 cgdbr RRF_U0FR "convert to fixed long bfp to 64" esame -b3aa cgxbr RRF_U0FR "convert to fixed extended bfp to 64" esame -b3c4 cegr RRE_RR "convert from fixed 64 to short hfp" esame -b3c5 cdgr RRE_RR "convert from fixed 64 to long hfp" esame -b3c6 cxgr RRE_RR "convert from fixed 64 to extended hfp" esame -b3c8 cger RRF_U0FR "convert to fixed short hfp to 64" esame -b3c9 cgdr RRF_U0FR "convert to fixed long hfp to 64" esame -b3ca cgxr RRF_U0FR "convert to fixed extended hfp to 64" esame -010b tam E "test addressing mode" esame -010c sam24 E "set addressing mode 24" esame -010d sam31 E "set addressing mode 31" esame -010e sam64 E "set addressing mode 64" esame -a500 iihh RI_RU "insert immediate high high" esame -a501 iihl RI_RU "insert immediate high low" esame -a502 iilh RI_RU "insert immediate low high" esame -a503 iill RI_RU "insert immediate low low" esame -a504 nihh RI_RU "and immediate high high" esame -a505 nihl RI_RU "and immediate high low" esame -a506 nilh RI_RU "and immediate low high" esame -a507 nill RI_RU "and immediate low low" esame -a508 oihh RI_RU "or immediate high high" esame -a509 oihl RI_RU "or immediate high low" esame -a50a oilh RI_RU "or immediate low high" esame -a50b oill RI_RU "or immediate low low" esame -a50c llihh RI_RU "load logical immediate high high" esame -a50d llihl RI_RU "load logical immediate high low" esame -a50e llilh RI_RU "load logical immediate low high" esame -a50f llill RI_RU "load logical immediate low low" esame -b2b1 stfl S_RD "store facility list" esame -b2b2 lpswe S_RD "load psw extended" esame -b90d dsgr RRE_RR "divide single 64" esame -b90f lrvgr RRE_RR "load reversed 64" esame -b916 llgfr RRE_RR "load logical 64<32" esame -b917 llgtr RRE_RR "load logical thirty one bits" esame -b91d dsgfr RRE_RR "divide single 64<32" esame -b91f lrvr RRE_RR "load reversed 32" esame -b986 mlgr RRE_RR "multiply logical 64" esame -b987 dlgr RRE_RR "divide logical 64" esame -b988 alcgr RRE_RR "add logical with carry 64" esame -b989 slbgr RRE_RR "subtract logical with borrow 64" esame -b98d epsw RRE_RR "extract psw" esame -b996 mlr RRE_RR "multiply logical 32" esame -b997 dlr RRE_RR "divide logical 32" esame -b998 alcr RRE_RR "add logical with carry 32" esame -b999 slbr RRE_RR "subtract logical with borrow 32" esame -b99d esea RRE_R0 "extract and set extended authority" esame -c000 larl RIL_RP "load address relative long" esame -e3000000000d dsg RXE_RRRD "divide single 64" esame -e3000000000f lrvg RXE_RRRD "load reversed 64" esame -e30000000016 llgf RXE_RRRD "load logical 64<32" esame -e30000000017 llgt RXE_RRRD "load logical thirty one bits" esame -e3000000001d dsgf RXE_RRRD "divide single 64<32" esame -e3000000001e lrv RXE_RRRD "load reversed 32" esame -e3000000001f lrvh RXE_RRRD "load reversed 16" esame -e3000000002f strvg RXE_RRRD "store reversed 64" esame -e3000000003e strv RXE_RRRD "store reversed 32" esame -e3000000003f strvh RXE_RRRD "store reversed 64" esame -e30000000086 mlg RXE_RRRD "multiply logical 64" esame -e30000000087 dlg RXE_RRRD "divide logical 64" esame -e30000000088 alcg RXE_RRRD "add logical with carry 64" esame -e30000000089 slbg RXE_RRRD "subtract logical with borrow 64" esame -e3000000008e stpq RXE_RRRD "store pair to quadword" esame -e3000000008f lpq RXE_RRRD "load pair from quadword" esame -e30000000096 ml RXE_RRRD "multiply logical 32" esame -e30000000097 dl RXE_RRRD "divide logical 32" esame -e30000000098 alc RXE_RRRD "add logical with carry 32" esame -e30000000099 slb RXE_RRRD "subtract logical with borrow 32" esame -e30000000090 llgc RXE_RRRD "load logical character" esame -e30000000091 llgh RXE_RRRD "load logical halfword" esame -eb000000001c rllg RSE_RRRD "rotate left single logical 64" esame -eb000000001d rll RSE_RRRD "rotate left single logical 32" esame -b278 stcke S_RD "store clock extended" esame -b2a5 tre RRE_RR "translate extended" esame -eb000000008e mvclu RSE_RRRD "move long unicode" esame -e9 pka SS_L0RDRD "pack ascii" esame -e1 pku SS_L0RDRD "pack unicode" esame -b993 troo RRE_RR "translate one to one" esame -b992 trot RRE_RR "translate one to two" esame -b991 trto RRE_RR "translate two to one" esame -b990 trtt RRE_RR "translate two to two" esame -ea unpka SS_L0RDRD "unpack ascii" esame -e2 unpku SS_L0RDRD "unpack unicode" esame -b358 thder RRE_RR "convert short bfp to long hfp" esame -b359 thdr RRE_RR "convert long bfp to long hfp" esame -b350 tbedr RRF_U0FF "convert long hfp to short bfp" esame -b351 tbdr RRF_U0FF "convert long hfp to long bfp" esame -b374 lzer RRE_R0 "load short zero" esame -b375 lzdr RRE_R0 "load long zero" esame -b376 lzxr RRE_R0 "load extended zero" esame diff --git a/contrib/binutils/opcodes/tic30-dis.c b/contrib/binutils/opcodes/tic30-dis.c deleted file mode 100644 index 67956f7a380a..000000000000 --- a/contrib/binutils/opcodes/tic30-dis.c +++ /dev/null @@ -1,710 +0,0 @@ -/* Disassembly routines for TMS320C30 architecture - Copyright 1998, 1999, 2000 Free Software Foundation, Inc. - Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) - - 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. */ - -#include <errno.h> -#include <math.h> -#include "sysdep.h" -#include "dis-asm.h" -#include "opcode/tic30.h" - -#define NORMAL_INSN 1 -#define PARALLEL_INSN 2 - -/* Gets the type of instruction based on the top 2 or 3 bits of the - instruction word. */ -#define GET_TYPE(insn) (insn & 0x80000000 ? insn & 0xC0000000 : insn & 0xE0000000) - -/* Instruction types. */ -#define TWO_OPERAND_1 0x00000000 -#define TWO_OPERAND_2 0x40000000 -#define THREE_OPERAND 0x20000000 -#define PAR_STORE 0xC0000000 -#define MUL_ADDS 0x80000000 -#define BRANCHES 0x60000000 - -/* Specific instruction id bits. */ -#define NORMAL_IDEN 0x1F800000 -#define PAR_STORE_IDEN 0x3E000000 -#define MUL_ADD_IDEN 0x2C000000 -#define BR_IMM_IDEN 0x1F000000 -#define BR_COND_IDEN 0x1C3F0000 - -/* Addressing modes. */ -#define AM_REGISTER 0x00000000 -#define AM_DIRECT 0x00200000 -#define AM_INDIRECT 0x00400000 -#define AM_IMM 0x00600000 - -#define P_FIELD 0x03000000 - -#define REG_AR0 0x08 -#define LDP_INSN 0x08700000 - -/* TMS320C30 program counter for current instruction. */ -static unsigned int _pc; - -struct instruction -{ - int type; - template *tm; - partemplate *ptm; -}; - -int get_tic30_instruction PARAMS ((unsigned long, struct instruction *)); -int print_two_operand - PARAMS ((disassemble_info *, unsigned long, struct instruction *)); -int print_three_operand - PARAMS ((disassemble_info *, unsigned long, struct instruction *)); -int print_par_insn - PARAMS ((disassemble_info *, unsigned long, struct instruction *)); -int print_branch - PARAMS ((disassemble_info *, unsigned long, struct instruction *)); -int get_indirect_operand PARAMS ((unsigned short, int, char *)); -int get_register_operand PARAMS ((unsigned char, char *)); -int cnvt_tmsfloat_ieee PARAMS ((unsigned long, int, float *)); - -int -print_insn_tic30 (pc, info) - bfd_vma pc; - disassemble_info *info; -{ - unsigned long insn_word; - struct instruction insn = { 0, NULL, NULL }; - bfd_vma bufaddr = pc - info->buffer_vma; - /* Obtain the current instruction word from the buffer. */ - insn_word = (*(info->buffer + bufaddr) << 24) | (*(info->buffer + bufaddr + 1) << 16) | - (*(info->buffer + bufaddr + 2) << 8) | *(info->buffer + bufaddr + 3); - _pc = pc / 4; - /* Get the instruction refered to by the current instruction word - and print it out based on its type. */ - if (!get_tic30_instruction (insn_word, &insn)) - return -1; - switch (GET_TYPE (insn_word)) - { - case TWO_OPERAND_1: - case TWO_OPERAND_2: - if (!print_two_operand (info, insn_word, &insn)) - return -1; - break; - case THREE_OPERAND: - if (!print_three_operand (info, insn_word, &insn)) - return -1; - break; - case PAR_STORE: - case MUL_ADDS: - if (!print_par_insn (info, insn_word, &insn)) - return -1; - break; - case BRANCHES: - if (!print_branch (info, insn_word, &insn)) - return -1; - break; - } - return 4; -} - -int -get_tic30_instruction (insn_word, insn) - unsigned long insn_word; - struct instruction *insn; -{ - switch (GET_TYPE (insn_word)) - { - case TWO_OPERAND_1: - case TWO_OPERAND_2: - case THREE_OPERAND: - insn->type = NORMAL_INSN; - { - template *current_optab = (template *) tic30_optab; - for (; current_optab < tic30_optab_end; current_optab++) - { - if (GET_TYPE (current_optab->base_opcode) == GET_TYPE (insn_word)) - { - if (current_optab->operands == 0) - { - if (current_optab->base_opcode == insn_word) - { - insn->tm = current_optab; - break; - } - } - else if ((current_optab->base_opcode & NORMAL_IDEN) == (insn_word & NORMAL_IDEN)) - { - insn->tm = current_optab; - break; - } - } - } - } - break; - case PAR_STORE: - insn->type = PARALLEL_INSN; - { - partemplate *current_optab = (partemplate *) tic30_paroptab; - for (; current_optab < tic30_paroptab_end; current_optab++) - { - if (GET_TYPE (current_optab->base_opcode) == GET_TYPE (insn_word)) - { - if ((current_optab->base_opcode & PAR_STORE_IDEN) == (insn_word & PAR_STORE_IDEN)) - { - insn->ptm = current_optab; - break; - } - } - } - } - break; - case MUL_ADDS: - insn->type = PARALLEL_INSN; - { - partemplate *current_optab = (partemplate *) tic30_paroptab; - for (; current_optab < tic30_paroptab_end; current_optab++) - { - if (GET_TYPE (current_optab->base_opcode) == GET_TYPE (insn_word)) - { - if ((current_optab->base_opcode & MUL_ADD_IDEN) == (insn_word & MUL_ADD_IDEN)) - { - insn->ptm = current_optab; - break; - } - } - } - } - break; - case BRANCHES: - insn->type = NORMAL_INSN; - { - template *current_optab = (template *) tic30_optab; - for (; current_optab < tic30_optab_end; current_optab++) - { - if (GET_TYPE (current_optab->base_opcode) == GET_TYPE (insn_word)) - { - if (current_optab->operand_types[0] & Imm24) - { - if ((current_optab->base_opcode & BR_IMM_IDEN) == (insn_word & BR_IMM_IDEN)) - { - insn->tm = current_optab; - break; - } - } - else if (current_optab->operands > 0) - { - if ((current_optab->base_opcode & BR_COND_IDEN) == (insn_word & BR_COND_IDEN)) - { - insn->tm = current_optab; - break; - } - } - else - { - if ((current_optab->base_opcode & (BR_COND_IDEN | 0x00800000)) == (insn_word & (BR_COND_IDEN | 0x00800000))) - { - insn->tm = current_optab; - break; - } - } - } - } - } - break; - default: - return 0; - } - return 1; -} - -int -print_two_operand (info, insn_word, insn) - disassemble_info *info; - unsigned long insn_word; - struct instruction *insn; -{ - char name[12]; - char operand[2][13] = - { - {0}, - {0}}; - float f_number; - - if (insn->tm == NULL) - return 0; - strcpy (name, insn->tm->name); - if (insn->tm->opcode_modifier == AddressMode) - { - int src_op, dest_op; - /* Determine whether instruction is a store or a normal instruction. */ - if ((insn->tm->operand_types[1] & (Direct | Indirect)) == (Direct | Indirect)) - { - src_op = 1; - dest_op = 0; - } - else - { - src_op = 0; - dest_op = 1; - } - /* Get the destination register. */ - if (insn->tm->operands == 2) - get_register_operand ((insn_word & 0x001F0000) >> 16, operand[dest_op]); - /* Get the source operand based on addressing mode. */ - switch (insn_word & AddressMode) - { - case AM_REGISTER: - /* Check for the NOP instruction before getting the operand. */ - if ((insn->tm->operand_types[0] & NotReq) == 0) - get_register_operand ((insn_word & 0x0000001F), operand[src_op]); - break; - case AM_DIRECT: - sprintf (operand[src_op], "@0x%lX", (insn_word & 0x0000FFFF)); - break; - case AM_INDIRECT: - get_indirect_operand ((insn_word & 0x0000FFFF), 2, operand[src_op]); - break; - case AM_IMM: - /* Get the value of the immediate operand based on variable type. */ - switch (insn->tm->imm_arg_type) - { - case Imm_Float: - cnvt_tmsfloat_ieee ((insn_word & 0x0000FFFF), 2, &f_number); - sprintf (operand[src_op], "%2.2f", f_number); - break; - case Imm_SInt: - sprintf (operand[src_op], "%d", (short) (insn_word & 0x0000FFFF)); - break; - case Imm_UInt: - sprintf (operand[src_op], "%lu", (insn_word & 0x0000FFFF)); - break; - default: - return 0; - } - /* Handle special case for LDP instruction. */ - if ((insn_word & 0xFFFFFF00) == LDP_INSN) - { - strcpy (name, "ldp"); - sprintf (operand[0], "0x%06lX", (insn_word & 0x000000FF) << 16); - operand[1][0] = '\0'; - } - } - } - /* Handle case for stack and rotate instructions. */ - else if (insn->tm->operands == 1) - { - if (insn->tm->opcode_modifier == StackOp) - { - get_register_operand ((insn_word & 0x001F0000) >> 16, operand[0]); - } - } - /* Output instruction to stream. */ - info->fprintf_func (info->stream, " %s %s%c%s", name, - operand[0][0] ? operand[0] : "", - operand[1][0] ? ',' : ' ', - operand[1][0] ? operand[1] : ""); - return 1; -} - -int -print_three_operand (info, insn_word, insn) - disassemble_info *info; - unsigned long insn_word; - struct instruction *insn; -{ - char operand[3][13] = - { - {0}, - {0}, - {0}}; - - if (insn->tm == NULL) - return 0; - switch (insn_word & AddressMode) - { - case AM_REGISTER: - get_register_operand ((insn_word & 0x000000FF), operand[0]); - get_register_operand ((insn_word & 0x0000FF00) >> 8, operand[1]); - break; - case AM_DIRECT: - get_register_operand ((insn_word & 0x000000FF), operand[0]); - get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1]); - break; - case AM_INDIRECT: - get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0]); - get_register_operand ((insn_word & 0x0000FF00) >> 8, operand[1]); - break; - case AM_IMM: - get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0]); - get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1]); - break; - default: - return 0; - } - if (insn->tm->operands == 3) - get_register_operand ((insn_word & 0x001F0000) >> 16, operand[2]); - info->fprintf_func (info->stream, " %s %s,%s%c%s", insn->tm->name, - operand[0], operand[1], - operand[2][0] ? ',' : ' ', - operand[2][0] ? operand[2] : ""); - return 1; -} - -int -print_par_insn (info, insn_word, insn) - disassemble_info *info; - unsigned long insn_word; - struct instruction *insn; -{ - size_t i, len; - char *name1, *name2; - char operand[2][3][13] = - { - { - {0}, - {0}, - {0}}, - { - {0}, - {0}, - {0}}}; - - if (insn->ptm == NULL) - return 0; - /* Parse out the names of each of the parallel instructions from the - q_insn1_insn2 format. */ - name1 = (char *) strdup (insn->ptm->name + 2); - name2 = ""; - len = strlen (name1); - for (i = 0; i < len; i++) - { - if (name1[i] == '_') - { - name2 = &name1[i + 1]; - name1[i] = '\0'; - break; - } - } - /* Get the operands of the instruction based on the operand order. */ - switch (insn->ptm->oporder) - { - case OO_4op1: - get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][0]); - get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][1]); - get_register_operand ((insn_word >> 16) & 0x07, operand[1][0]); - get_register_operand ((insn_word >> 22) & 0x07, operand[0][1]); - break; - case OO_4op2: - get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][0]); - get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][0]); - get_register_operand ((insn_word >> 19) & 0x07, operand[1][1]); - get_register_operand ((insn_word >> 22) & 0x07, operand[0][1]); - break; - case OO_4op3: - get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][1]); - get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][1]); - get_register_operand ((insn_word >> 16) & 0x07, operand[1][0]); - get_register_operand ((insn_word >> 22) & 0x07, operand[0][0]); - break; - case OO_5op1: - get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][0]); - get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][1]); - get_register_operand ((insn_word >> 16) & 0x07, operand[1][0]); - get_register_operand ((insn_word >> 19) & 0x07, operand[0][1]); - get_register_operand ((insn_word >> 22) & 0x07, operand[0][2]); - break; - case OO_5op2: - get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][1]); - get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][1]); - get_register_operand ((insn_word >> 16) & 0x07, operand[1][0]); - get_register_operand ((insn_word >> 19) & 0x07, operand[0][0]); - get_register_operand ((insn_word >> 22) & 0x07, operand[0][2]); - break; - case OO_PField: - if (insn_word & 0x00800000) - get_register_operand (0x01, operand[0][2]); - else - get_register_operand (0x00, operand[0][2]); - if (insn_word & 0x00400000) - get_register_operand (0x03, operand[1][2]); - else - get_register_operand (0x02, operand[1][2]); - switch (insn_word & P_FIELD) - { - case 0x00000000: - get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][1]); - get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[0][0]); - get_register_operand ((insn_word >> 16) & 0x07, operand[1][1]); - get_register_operand ((insn_word >> 19) & 0x07, operand[1][0]); - break; - case 0x01000000: - get_indirect_operand ((insn_word & 0x000000FF), 1, operand[1][0]); - get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[0][0]); - get_register_operand ((insn_word >> 16) & 0x07, operand[1][1]); - get_register_operand ((insn_word >> 19) & 0x07, operand[0][1]); - break; - case 0x02000000: - get_indirect_operand ((insn_word & 0x000000FF), 1, operand[1][1]); - get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][0]); - get_register_operand ((insn_word >> 16) & 0x07, operand[0][1]); - get_register_operand ((insn_word >> 19) & 0x07, operand[0][0]); - break; - case 0x03000000: - get_indirect_operand ((insn_word & 0x000000FF), 1, operand[1][1]); - get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[0][0]); - get_register_operand ((insn_word >> 16) & 0x07, operand[1][0]); - get_register_operand ((insn_word >> 19) & 0x07, operand[0][1]); - break; - } - break; - default: - return 0; - } - info->fprintf_func (info->stream, " %s %s,%s%c%s", name1, - operand[0][0], operand[0][1], - operand[0][2][0] ? ',' : ' ', - operand[0][2][0] ? operand[0][2] : ""); - info->fprintf_func (info->stream, "\n\t\t\t|| %s %s,%s%c%s", name2, - operand[1][0], operand[1][1], - operand[1][2][0] ? ',' : ' ', - operand[1][2][0] ? operand[1][2] : ""); - free (name1); - return 1; -} - -int -print_branch (info, insn_word, insn) - disassemble_info *info; - unsigned long insn_word; - struct instruction *insn; -{ - char operand[2][13] = - { - {0}, - {0}}; - unsigned long address; - int print_label = 0; - - if (insn->tm == NULL) - return 0; - /* Get the operands for 24-bit immediate jumps. */ - if (insn->tm->operand_types[0] & Imm24) - { - address = insn_word & 0x00FFFFFF; - sprintf (operand[0], "0x%lX", address); - print_label = 1; - } - /* Get the operand for the trap instruction. */ - else if (insn->tm->operand_types[0] & IVector) - { - address = insn_word & 0x0000001F; - sprintf (operand[0], "0x%lX", address); - } - else - { - address = insn_word & 0x0000FFFF; - /* Get the operands for the DB instructions. */ - if (insn->tm->operands == 2) - { - get_register_operand (((insn_word & 0x01C00000) >> 22) + REG_AR0, operand[0]); - if (insn_word & PCRel) - { - sprintf (operand[1], "%d", (short) address); - print_label = 1; - } - else - get_register_operand (insn_word & 0x0000001F, operand[1]); - } - /* Get the operands for the standard branches. */ - else if (insn->tm->operands == 1) - { - if (insn_word & PCRel) - { - address = (short) address; - sprintf (operand[0], "%ld", address); - print_label = 1; - } - else - get_register_operand (insn_word & 0x0000001F, operand[0]); - } - } - info->fprintf_func (info->stream, " %s %s%c%s", insn->tm->name, - operand[0][0] ? operand[0] : "", - operand[1][0] ? ',' : ' ', - operand[1][0] ? operand[1] : ""); - /* Print destination of branch in relation to current symbol. */ - if (print_label && info->symbols) - { - asymbol *sym = *info->symbols; - - if ((insn->tm->opcode_modifier == PCRel) && (insn_word & PCRel)) - { - address = (_pc + 1 + (short) address) - ((sym->section->vma + sym->value) / 4); - /* Check for delayed instruction, if so adjust destination. */ - if (insn_word & 0x00200000) - address += 2; - } - else - { - address -= ((sym->section->vma + sym->value) / 4); - } - if (address == 0) - info->fprintf_func (info->stream, " <%s>", sym->name); - else - info->fprintf_func (info->stream, " <%s %c %d>", sym->name, - ((short) address < 0) ? '-' : '+', - abs (address)); - } - return 1; -} - -int -get_indirect_operand (fragment, size, buffer) - unsigned short fragment; - int size; - char *buffer; -{ - unsigned char mod; - unsigned arnum; - unsigned char disp; - - if (buffer == NULL) - return 0; - /* Determine which bits identify the sections of the indirect - operand based on the size in bytes. */ - switch (size) - { - case 1: - mod = (fragment & 0x00F8) >> 3; - arnum = (fragment & 0x0007); - disp = 0; - break; - case 2: - mod = (fragment & 0xF800) >> 11; - arnum = (fragment & 0x0700) >> 8; - disp = (fragment & 0x00FF); - break; - default: - return 0; - } - { - const ind_addr_type *current_ind = tic30_indaddr_tab; - for (; current_ind < tic30_indaddrtab_end; current_ind++) - { - if (current_ind->modfield == mod) - { - if (current_ind->displacement == IMPLIED_DISP && size == 2) - { - continue; - } - else - { - size_t i, len; - int bufcnt; - - len = strlen (current_ind->syntax); - for (i = 0, bufcnt = 0; i < len; i++, bufcnt++) - { - buffer[bufcnt] = current_ind->syntax[i]; - if (buffer[bufcnt - 1] == 'a' && buffer[bufcnt] == 'r') - buffer[++bufcnt] = arnum + '0'; - if (buffer[bufcnt] == '(' - && current_ind->displacement == DISP_REQUIRED) - { - sprintf (&buffer[bufcnt + 1], "%u", disp); - bufcnt += strlen (&buffer[bufcnt + 1]); - } - } - buffer[bufcnt + 1] = '\0'; - break; - } - } - } - } - return 1; -} - -int -get_register_operand (fragment, buffer) - unsigned char fragment; - char *buffer; -{ - const reg *current_reg = tic30_regtab; - - if (buffer == NULL) - return 0; - for (; current_reg < tic30_regtab_end; current_reg++) - { - if ((fragment & 0x1F) == current_reg->opcode) - { - strcpy (buffer, current_reg->name); - return 1; - } - } - return 0; -} - -int -cnvt_tmsfloat_ieee (tmsfloat, size, ieeefloat) - unsigned long tmsfloat; - int size; - float *ieeefloat; -{ - unsigned long exp, sign, mant; - - if (size == 2) - { - if ((tmsfloat & 0x0000F000) == 0x00008000) - tmsfloat = 0x80000000; - else - { - tmsfloat <<= 16; - tmsfloat = (long) tmsfloat >> 4; - } - } - exp = tmsfloat & 0xFF000000; - if (exp == 0x80000000) - { - *ieeefloat = 0.0; - return 1; - } - exp += 0x7F000000; - sign = (tmsfloat & 0x00800000) << 8; - mant = tmsfloat & 0x007FFFFF; - if (exp == 0xFF000000) - { - if (mant == 0) - *ieeefloat = ERANGE; - if (sign == 0) - *ieeefloat = 1.0 / 0.0; - else - *ieeefloat = -1.0 / 0.0; - return 1; - } - exp >>= 1; - if (sign) - { - mant = (~mant) & 0x007FFFFF; - mant += 1; - exp += mant & 0x00800000; - exp &= 0x7F800000; - mant &= 0x007FFFFF; - } - if (tmsfloat == 0x80000000) - sign = mant = exp = 0; - tmsfloat = sign | exp | mant; - *ieeefloat = *((float *) &tmsfloat); - return 1; -} diff --git a/contrib/binutils/opcodes/v850-dis.c b/contrib/binutils/opcodes/v850-dis.c deleted file mode 100644 index e72b1e8d2e1d..000000000000 --- a/contrib/binutils/opcodes/v850-dis.c +++ /dev/null @@ -1,384 +0,0 @@ -/* Disassemble V850 instructions. - 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 -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. */ - - -#include <stdio.h> - -#include "sysdep.h" -#include "opcode/v850.h" -#include "dis-asm.h" -#include "opintl.h" - -static const char *const v850_reg_names[] = -{ "r0", "r1", "r2", "sp", "gp", "r5", "r6", "r7", - "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", - "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", - "r24", "r25", "r26", "r27", "r28", "r29", "ep", "lp" }; - -static const char *const v850_sreg_names[] = -{ "eipc", "eipsw", "fepc", "fepsw", "ecr", "psw", "sr6", "sr7", - "sr8", "sr9", "sr10", "sr11", "sr12", "sr13", "sr14", "sr15", - "ctpc", "ctpsw", "dbpc", "dbpsw", "ctbp", "sr21", "sr22", "sr23", - "sr24", "sr25", "sr26", "sr27", "sr28", "sr29", "sr30", "sr31", - "sr16", "sr17", "sr18", "sr19", "sr20", "sr21", "sr22", "sr23", - "sr24", "sr25", "sr26", "sr27", "sr28", "sr29", "sr30", "sr31" }; - -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; - struct disassemble_info *info; - unsigned long insn; -{ - struct v850_opcode * op = (struct v850_opcode *)v850_opcodes; - const struct v850_operand * operand; - int match = 0; - int short_op = ((insn & 0x0600) != 0x0600); - int bytes_read; - int target_processor; - - /* Special case: 32 bit MOV */ - if ((insn & 0xffe0) == 0x0620) - short_op = true; - - bytes_read = short_op ? 2 : 4; - - /* If this is a two byte insn, then mask off the high bits. */ - if (short_op) - insn &= 0xffff; - - switch (info->mach) - { - case 0: - default: - target_processor = PROCESSOR_V850; - break; - - case bfd_mach_v850e: - target_processor = PROCESSOR_V850E; - break; - - case bfd_mach_v850ea: - target_processor = PROCESSOR_V850EA; - break; - } - - /* Find the opcode. */ - while (op->name) - { - if ((op->mask & insn) == op->opcode - && (op->processors & target_processor)) - { - const unsigned char * opindex_ptr; - unsigned int opnum; - unsigned int memop; - - match = 1; - (*info->fprintf_func) (info->stream, "%s\t", op->name); -/*fprintf (stderr, "match: mask: %x insn: %x, opcode: %x, name: %s\n", op->mask, insn, op->opcode, op->name );*/ - - memop = op->memop; - /* Now print the operands. - - MEMOP is the operand number at which a memory - address specification starts, or zero if this - instruction has no memory addresses. - - A memory address is always two arguments. - - This information allows us to determine when to - insert commas into the output stream as well as - when to insert disp[reg] expressions onto the - output stream. */ - - for (opindex_ptr = op->operands, opnum = 1; - *opindex_ptr != 0; - opindex_ptr++, opnum++) - { - long value; - int flag; - int status; - bfd_byte buffer[ 4 ]; - - operand = &v850_operands[*opindex_ptr]; - - if (operand->extract) - value = (operand->extract) (insn, 0); - else - { - if (operand->bits == -1) - value = (insn & operand->shift); - else - value = (insn >> operand->shift) & ((1 << operand->bits) - 1); - - if (operand->flags & V850_OPERAND_SIGNED) - value = ((long)(value << (32 - operand->bits)) - >> (32 - operand->bits)); - } - - /* The first operand is always output without any - special handling. - - For the following arguments: - - If memop && opnum == memop + 1, then we need '[' since - we're about to output the register used in a memory - reference. - - If memop && opnum == memop + 2, then we need ']' since - we just finished the register in a memory reference. We - also need a ',' before this operand. - - Else we just need a comma. - - We may need to output a trailing ']' if the last operand - in an instruction is the register for a memory address. - - The exception (and there's always an exception) is the - "jmp" insn which needs square brackets around it's only - register argument. */ - - if (memop && opnum == memop + 1) info->fprintf_func (info->stream, "["); - else if (memop && opnum == memop + 2) info->fprintf_func (info->stream, "],"); - else if (memop == 1 && opnum == 1 - && (operand->flags & V850_OPERAND_REG)) - info->fprintf_func (info->stream, "["); - else if (opnum > 1) info->fprintf_func (info->stream, ", "); - - /* extract the flags, ignorng ones which do not effect disassembly output. */ - flag = operand->flags; - flag &= ~ V850_OPERAND_SIGNED; - flag &= ~ V850_OPERAND_RELAX; - flag &= - flag; - - switch (flag) - { - case V850_OPERAND_REG: info->fprintf_func (info->stream, "%s", v850_reg_names[value]); break; - case V850_OPERAND_SRG: info->fprintf_func (info->stream, "%s", v850_sreg_names[value]); break; - case V850_OPERAND_CC: info->fprintf_func (info->stream, "%s", v850_cc_names[value]); break; - case V850_OPERAND_EP: info->fprintf_func (info->stream, "ep"); break; - default: info->fprintf_func (info->stream, "%d", value); break; - case V850_OPERAND_DISP: - { - bfd_vma addr = value + memaddr; - - /* On the v850 the top 8 bits of an address are used by an overlay manager. - Thus it may happen that when we are looking for a symbol to match - against an address with some of its top bits set, the search fails to - turn up an exact match. In this case we try to find an exact match - against a symbol in the lower address space, and if we find one, we - use that address. We only do this for JARL instructions however, as - we do not want to misinterpret branch instructions. */ - if (operand->bits == 22) - { - if ( ! info->symbol_at_address_func (addr, info) - && ((addr & 0xFF000000) != 0) - && info->symbol_at_address_func (addr & 0x00FFFFFF, info)) - { - addr &= 0x00FFFFFF; - } - } - info->print_address_func (addr, info); - break; - } - - case V850E_PUSH_POP: - { - static int list12_regs[32] = { 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 29, 28, 23, 22, 21, 20, 27, 26, 25, 24 }; - static int list18_h_regs[32] = { 19, 18, 17, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 30, 31, 29, 28, 23, 22, 21, 20, 27, 26, 25, 24 }; - static int list18_l_regs[32] = { 3, 2, 1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 14, 15, 13, 12, 7, 6, 5, 4, 11, 10, 9, 8 }; - int * regs; - int i; - unsigned long int mask = 0; - int pc = false; - int sr = false; - - - switch (operand->shift) - { - case 0xffe00001: regs = list12_regs; break; - case 0xfff8000f: regs = list18_h_regs; break; - case 0xfff8001f: regs = list18_l_regs; value &= ~0x10; break; /* Do not include magic bit */ - default: - /* xgettext:c-format */ - fprintf (stderr, _("unknown operand shift: %x\n"), operand->shift ); - abort(); - } - - for (i = 0; i < 32; i++) - { - if (value & (1 << i)) - { - switch (regs[ i ]) - { - default: mask |= (1 << regs[ i ]); break; - /* xgettext:c-format */ - case 0: fprintf (stderr, _("unknown pop reg: %d\n"), i ); abort(); - case -1: pc = true; break; - case -2: sr = true; break; - } - } - } - - info->fprintf_func (info->stream, "{"); - - if (mask || pc || sr) - { - if (mask) - { - unsigned int bit; - int shown_one = false; - - for (bit = 0; bit < 32; bit++) - if (mask & (1 << bit)) - { - unsigned long int first = bit; - unsigned long int last; - - if (shown_one) - info->fprintf_func (info->stream, ", "); - else - shown_one = true; - - info->fprintf_func (info->stream, v850_reg_names[first]); - - for (bit++; bit < 32; bit++) - if ((mask & (1 << bit)) == 0) - break; - - last = bit; - - if (last > first + 1) - { - info->fprintf_func (info->stream, " - %s", v850_reg_names[ last - 1 ]); - } - } - } - - if (pc) - info->fprintf_func (info->stream, "%sPC", mask ? ", " : ""); - if (sr) - info->fprintf_func (info->stream, "%sSR", (mask || pc) ? ", " : ""); - } - - info->fprintf_func (info->stream, "}"); - } - break; - - case V850E_IMMEDIATE16: - status = info->read_memory_func (memaddr + bytes_read, buffer, 2, info); - if (status == 0) - { - bytes_read += 2; - value = bfd_getl16 (buffer); - - /* If this is a DISPOSE instruction with ff set to 0x10, then shift value up by 16. */ - if ((insn & 0x001fffc0) == 0x00130780) - value <<= 16; - - info->fprintf_func (info->stream, "0x%x", value); - } - else - { - info->memory_error_func (status, memaddr + bytes_read, info); - } - break; - - case V850E_IMMEDIATE32: - status = info->read_memory_func (memaddr + bytes_read, buffer, 4, info); - if (status == 0) - { - bytes_read += 4; - value = bfd_getl32 (buffer); - info->fprintf_func (info->stream, "0x%lx", value); - } - else - { - info->memory_error_func (status, memaddr + bytes_read, info); - } - break; - } - - /* Handle jmp correctly. */ - if (memop == 1 && opnum == 1 - && ((operand->flags & V850_OPERAND_REG) != 0)) - (*info->fprintf_func) (info->stream, "]"); - } - - /* Close any square bracket we left open. */ - if (memop && opnum == memop + 2) - (*info->fprintf_func) (info->stream, "]"); - - /* All done. */ - break; - } - op++; - } - - if (!match) - { - if (short_op) - info->fprintf_func (info->stream, ".short\t0x%04x", insn); - else - info->fprintf_func (info->stream, ".long\t0x%08x", insn); - } - - return bytes_read; -} - -int -print_insn_v850 (memaddr, info) - bfd_vma memaddr; - struct disassemble_info * info; -{ - int status; - bfd_byte buffer[ 4 ]; - unsigned long insn = 0; - - /* First figure out how big the opcode is. */ - - status = info->read_memory_func (memaddr, buffer, 2, info); - if (status == 0) - { - insn = bfd_getl16 (buffer); - - if ( (insn & 0x0600) == 0x0600 - && (insn & 0xffe0) != 0x0620) - { - /* If this is a 4 byte insn, read 4 bytes of stuff. */ - status = info->read_memory_func (memaddr, buffer, 4, info); - - if (status == 0) - insn = bfd_getl32 (buffer); - } - } - - if (status != 0) - { - info->memory_error_func (status, memaddr, info); - return -1; - } - - /* Make sure we tell our caller how many bytes we consumed. */ - return disassemble (memaddr, info, insn); -} diff --git a/contrib/binutils/opcodes/v850-opc.c b/contrib/binutils/opcodes/v850-opc.c deleted file mode 100644 index 43ce2f15fc20..000000000000 --- a/contrib/binutils/opcodes/v850-opc.c +++ /dev/null @@ -1,813 +0,0 @@ -/* Assemble V850 instructions. - 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 -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. */ - -#include "sysdep.h" -#include "opcode/v850.h" -#include <stdio.h> -#include "opintl.h" - -/* regular opcode */ -#define OP(x) ((x & 0x3f) << 5) -#define OP_MASK OP (0x3f) - -/* conditional branch opcode */ -#define BOP(x) ((0x0b << 7) | (x & 0x0f)) -#define BOP_MASK ((0x0f << 7) | 0x0f) - -/* one-word opcodes */ -#define one(x) ((unsigned int) (x)) - -/* two-word opcodes */ -#define two(x,y) ((unsigned int) (x) | ((unsigned int) (y) << 16)) - -static long unsigned insert_d9 PARAMS ((long unsigned, long, const char **)); -static long unsigned extract_d9 PARAMS ((long unsigned, int *)); -static long unsigned insert_d22 PARAMS ((long unsigned, long, const char **)); -static long unsigned extract_d22 PARAMS ((long unsigned, int *)); -static long unsigned insert_d16_15 PARAMS ((long unsigned, long, const char **)); -static long unsigned extract_d16_15 PARAMS ((long unsigned, int *)); -static long unsigned insert_d8_7 PARAMS ((long unsigned, long, const char **)); -static long unsigned extract_d8_7 PARAMS ((long unsigned, int *)); -static long unsigned insert_d8_6 PARAMS ((long unsigned, long, const char **)); -static long unsigned extract_d8_6 PARAMS ((long unsigned, int *)); -static long unsigned insert_d5_4 PARAMS ((long unsigned, long, const char **)); -static long unsigned extract_d5_4 PARAMS ((long unsigned, int *)); -static long unsigned insert_d16_16 PARAMS ((long unsigned, long, const char **)); -static long unsigned extract_d16_16 PARAMS ((long unsigned, int *)); -static long unsigned insert_i9 PARAMS ((long unsigned, long, const char **)); -static long unsigned extract_i9 PARAMS ((long unsigned, int *)); -static long unsigned insert_u9 PARAMS ((long unsigned, long, const char **)); -static long unsigned extract_u9 PARAMS ((long unsigned, int *)); -static long unsigned insert_spe PARAMS ((long unsigned, long, const char **)); -static long unsigned extract_spe PARAMS ((long unsigned, int *)); -static long unsigned insert_i5div PARAMS ((long unsigned, long, const char **)); -static long unsigned extract_i5div PARAMS ((long unsigned, int *)); - - -/* The functions used to insert and extract complicated operands. */ - -/* Note: There is a conspiracy between these functions and - v850_insert_operand() in gas/config/tc-v850.c. Error messages - containing the string 'out of range' will be ignored unless a - specific command line option is given to GAS. */ - -static const char * not_valid = N_ ("displacement value is not in range and is not aligned"); -static const char * out_of_range = N_ ("displacement value is out of range"); -static const char * not_aligned = N_ ("displacement value is not aligned"); - -static const char * immediate_out_of_range = N_ ("immediate value is out of range"); - -static unsigned long -insert_d9 (insn, value, errmsg) - unsigned long insn; - long value; - const char ** errmsg; -{ - if (value > 0xff || value < -0x100) - { - if ((value % 2) != 0) - * errmsg = _("branch value not in range and to odd offset"); - else - * errmsg = _("branch value out of range"); - } - else if ((value % 2) != 0) - * errmsg = _("branch to odd offset"); - - return (insn | ((value & 0x1f0) << 7) | ((value & 0x0e) << 3)); -} - -static unsigned long -extract_d9 (insn, invalid) - unsigned long insn; - int * invalid ATTRIBUTE_UNUSED; -{ - unsigned long ret = ((insn & 0xf800) >> 7) | ((insn & 0x0070) >> 3); - - if ((insn & 0x8000) != 0) - ret -= 0x0200; - - return ret; -} - -static unsigned long -insert_d22 (insn, value, errmsg) - unsigned long insn; - long value; - const char ** errmsg; -{ - if (value > 0x1fffff || value < -0x200000) - { - if ((value % 2) != 0) - * errmsg = _("branch value not in range and to an odd offset"); - else - * errmsg = _("branch value out of range"); - } - else if ((value % 2) != 0) - * errmsg = _("branch to odd offset"); - - return (insn | ((value & 0xfffe) << 16) | ((value & 0x3f0000) >> 16)); -} - -static unsigned long -extract_d22 (insn, invalid) - unsigned long insn; - int * invalid ATTRIBUTE_UNUSED; -{ - signed long ret = ((insn & 0xfffe0000) >> 16) | ((insn & 0x3f) << 16); - - return (unsigned long) ((ret << 10) >> 10); -} - -static unsigned long -insert_d16_15 (insn, value, errmsg) - unsigned long insn; - long value; - const char ** errmsg; -{ - if (value > 0x7fff || value < -0x8000) - { - if ((value % 2) != 0) - * errmsg = _(not_valid); - else - * errmsg = _(out_of_range); - } - else if ((value % 2) != 0) - * errmsg = _(not_aligned); - - return insn | ((value & 0xfffe) << 16); -} - -static unsigned long -extract_d16_15 (insn, invalid) - unsigned long insn; - int * invalid ATTRIBUTE_UNUSED; -{ - signed long ret = (insn & 0xfffe0000); - - return ret >> 16; -} - -static unsigned long -insert_d8_7 (insn, value, errmsg) - unsigned long insn; - long value; - const char ** errmsg; -{ - if (value > 0xff || value < 0) - { - if ((value % 2) != 0) - * errmsg = _(not_valid); - else - * errmsg = _(out_of_range); - } - else if ((value % 2) != 0) - * errmsg = _(not_aligned); - - value >>= 1; - - return (insn | (value & 0x7f)); -} - -static unsigned long -extract_d8_7 (insn, invalid) - unsigned long insn; - int * invalid ATTRIBUTE_UNUSED; -{ - unsigned long ret = (insn & 0x7f); - - return ret << 1; -} - -static unsigned long -insert_d8_6 (insn, value, errmsg) - unsigned long insn; - long value; - const char ** errmsg; -{ - if (value > 0xff || value < 0) - { - if ((value % 4) != 0) - *errmsg = _(not_valid); - else - * errmsg = _(out_of_range); - } - else if ((value % 4) != 0) - * errmsg = _(not_aligned); - - value >>= 1; - - return (insn | (value & 0x7e)); -} - -static unsigned long -extract_d8_6 (insn, invalid) - unsigned long insn; - int * invalid ATTRIBUTE_UNUSED; -{ - unsigned long ret = (insn & 0x7e); - - return ret << 1; -} - -static unsigned long -insert_d5_4 (insn, value, errmsg) - unsigned long insn; - long value; - const char ** errmsg; -{ - if (value > 0x1f || value < 0) - { - if (value & 1) - * errmsg = _(not_valid); - else - *errmsg = _(out_of_range); - } - else if (value & 1) - * errmsg = _(not_aligned); - - value >>= 1; - - return (insn | (value & 0x0f)); -} - -static unsigned long -extract_d5_4 (insn, invalid) - unsigned long insn; - int * invalid ATTRIBUTE_UNUSED; -{ - unsigned long ret = (insn & 0x0f); - - return ret << 1; -} - -static unsigned long -insert_d16_16 (insn, value, errmsg) - unsigned long insn; - signed long value; - const char ** errmsg; -{ - if (value > 0x7fff || value < -0x8000) - * errmsg = _(out_of_range); - - return (insn | ((value & 0xfffe) << 16) | ((value & 1) << 5)); -} - -static unsigned long -extract_d16_16 (insn, invalid) - unsigned long insn; - int * invalid ATTRIBUTE_UNUSED; -{ - signed long ret = insn & 0xfffe0000; - - ret >>= 16; - - ret |= ((insn & 0x20) >> 5); - - return ret; -} - -static unsigned long -insert_i9 (insn, value, errmsg) - unsigned long insn; - signed long value; - const char ** errmsg; -{ - if (value > 0xff || value < -0x100) - * errmsg = _(immediate_out_of_range); - - return insn | ((value & 0x1e0) << 13) | (value & 0x1f); -} - -static unsigned long -extract_i9 (insn, invalid) - unsigned long insn; - int * invalid ATTRIBUTE_UNUSED; -{ - signed long ret = insn & 0x003c0000; - - ret <<= 10; - ret >>= 23; - - ret |= (insn & 0x1f); - - return ret; -} - -static unsigned long -insert_u9 (insn, v, errmsg) - unsigned long insn; - long v; - const char ** errmsg; -{ - unsigned long value = (unsigned long) v; - if (value > 0x1ff) - * errmsg = _(immediate_out_of_range); - - return insn | ((value & 0x1e0) << 13) | (value & 0x1f); -} - -static unsigned long -extract_u9 (insn, invalid) - unsigned long insn; - int * invalid ATTRIBUTE_UNUSED; -{ - unsigned long ret = insn & 0x003c0000; - - ret >>= 13; - - ret |= (insn & 0x1f); - - return ret; -} - -static unsigned long -insert_spe (insn, v, errmsg) - unsigned long insn; - long v; - const char ** errmsg; -{ - unsigned long value = (unsigned long) v; - - if (value != 3) - * errmsg = _("invalid register for stack adjustment"); - - return insn & (~ 0x180000); -} - -static unsigned long -extract_spe (insn, invalid) - unsigned long insn ATTRIBUTE_UNUSED; - int * invalid ATTRIBUTE_UNUSED; -{ - return 3; -} - -static unsigned long -insert_i5div (insn, v, errmsg) - unsigned long insn; - long v; - const char ** errmsg; -{ - unsigned long value = (unsigned long) v; - - if (value > 0x1ff) - { - if (value & 1) - * errmsg = _("immediate value not in range and not even"); - else - * errmsg = _(immediate_out_of_range); - } - else if (value & 1) - * errmsg = _("immediate value must be even"); - - value = 32 - value; - - return insn | ((value & 0x1e) << 17); -} - -static unsigned long -extract_i5div (insn, invalid) - unsigned long insn; - int * invalid ATTRIBUTE_UNUSED; -{ - unsigned long ret = insn & 0x3c0000; - - ret >>= 17; - - ret = 32 - ret; - - return ret; -} - - -/* Warning: code in gas/config/tc-v850.c examines the contents of this array. - If you change any of the values here, be sure to look for side effects in - that code. */ -const struct v850_operand v850_operands[] = -{ -#define UNUSED 0 - { 0, 0, NULL, NULL, 0 }, - -/* The R1 field in a format 1, 6, 7, or 9 insn. */ -#define R1 (UNUSED + 1) - { 5, 0, NULL, NULL, V850_OPERAND_REG }, - -/* As above, but register 0 is not allowed. */ -#define R1_NOTR0 (R1 + 1) - { 5, 0, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 }, - -/* The R2 field in a format 1, 2, 4, 5, 6, 7, 9 insn. */ -#define R2 (R1_NOTR0 + 1) - { 5, 11, NULL, NULL, V850_OPERAND_REG }, - -/* As above, but register 0 is not allowed. */ -#define R2_NOTR0 (R2 + 1) - { 5, 11, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 }, - -/* The imm5 field in a format 2 insn. */ -#define I5 (R2_NOTR0 + 1) - { 5, 0, NULL, NULL, V850_OPERAND_SIGNED }, - -/* The unsigned imm5 field in a format 2 insn. */ -#define I5U (I5 + 1) - { 5, 0, NULL, NULL, 0 }, - -/* The imm16 field in a format 6 insn. */ -#define I16 (I5U + 1) - { 16, 16, NULL, NULL, V850_OPERAND_SIGNED }, - -/* The signed disp7 field in a format 4 insn. */ -#define D7 (I16 + 1) - { 7, 0, NULL, NULL, 0}, - -/* The disp16 field in a format 6 insn. */ -#define D16_15 (D7 + 1) - { 15, 17, insert_d16_15, extract_d16_15, V850_OPERAND_SIGNED }, - -/* The 3 bit immediate field in format 8 insn. */ -#define B3 (D16_15 + 1) - { 3, 11, NULL, NULL, 0 }, - -/* The 4 bit condition code in a setf instruction */ -#define CCCC (B3 + 1) - { 4, 0, NULL, NULL, V850_OPERAND_CC }, - -/* The unsigned DISP8 field in a format 4 insn. */ -#define D8_7 (CCCC + 1) - { 7, 0, insert_d8_7, extract_d8_7, 0 }, - -/* The unsigned DISP8 field in a format 4 insn. */ -#define D8_6 (D8_7 + 1) - { 6, 1, insert_d8_6, extract_d8_6, 0 }, - -/* System register operands. */ -#define SR1 (D8_6 + 1) - { 5, 0, NULL, NULL, V850_OPERAND_SRG }, - -/* EP Register. */ -#define EP (SR1 + 1) - { 0, 0, NULL, NULL, V850_OPERAND_EP }, - -/* The imm16 field (unsigned) in a format 6 insn. */ -#define I16U (EP + 1) - { 16, 16, NULL, NULL, 0}, - -/* The R2 field as a system register. */ -#define SR2 (I16U + 1) - { 5, 11, NULL, NULL, V850_OPERAND_SRG }, - -/* The disp16 field in a format 8 insn. */ -#define D16 (SR2 + 1) - { 16, 16, NULL, NULL, V850_OPERAND_SIGNED }, - -/* The DISP9 field in a format 3 insn, relaxable. */ -#define D9_RELAX (D16 + 1) - { 9, 0, insert_d9, extract_d9, V850_OPERAND_RELAX | V850_OPERAND_SIGNED | V850_OPERAND_DISP }, - -/* The DISP22 field in a format 4 insn, relaxable. - This _must_ follow D9_RELAX; the assembler assumes that the longer - version immediately follows the shorter version for relaxing. */ -#define D22 (D9_RELAX + 1) - { 22, 0, insert_d22, extract_d22, V850_OPERAND_SIGNED | V850_OPERAND_DISP }, - -/* The signed disp4 field in a format 4 insn. */ -#define D4 (D22 + 1) - { 4, 0, NULL, NULL, 0}, - -/* The unsigned disp5 field in a format 4 insn. */ -#define D5_4 (D4 + 1) - { 4, 0, insert_d5_4, extract_d5_4, 0 }, - -/* The disp16 field in an format 7 unsigned byte load insn. */ -#define D16_16 (D5_4 + 1) - { -1, 0xfffe0020, insert_d16_16, extract_d16_16, 0 }, - -/* Third register in conditional moves. */ -#define R3 (D16_16 + 1) - { 5, 27, NULL, NULL, V850_OPERAND_REG }, - -/* Condition code in conditional moves. */ -#define MOVCC (R3 + 1) - { 4, 17, NULL, NULL, V850_OPERAND_CC }, - -/* The imm9 field in a multiply word. */ -#define I9 (MOVCC + 1) - { 9, 0, insert_i9, extract_i9, V850_OPERAND_SIGNED }, - -/* The unsigned imm9 field in a multiply word. */ -#define U9 (I9 + 1) - { 9, 0, insert_u9, extract_u9, 0 }, - -/* A list of registers in a prepare/dispose instruction. */ -#define LIST12 (U9 + 1) - { -1, 0xffe00001, NULL, NULL, V850E_PUSH_POP }, - -/* The IMM6 field in a call instruction. */ -#define I6 (LIST12 + 1) - { 6, 0, NULL, NULL, 0 }, - -/* The 16 bit immediate following a 32 bit instruction. */ -#define IMM16 (I6 + 1) - { 16, 16, NULL, NULL, V850_OPERAND_SIGNED | V850E_IMMEDIATE16 }, - -/* The 32 bit immediate following a 32 bit instruction. */ -#define IMM32 (IMM16 + 1) - { 0, 0, NULL, NULL, V850E_IMMEDIATE32 }, - -/* The imm5 field in a push/pop instruction. */ -#define IMM5 (IMM32 + 1) - { 5, 1, NULL, NULL, 0 }, - -/* Reg2 in dispose instruction. */ -#define R2DISPOSE (IMM5 + 1) - { 5, 16, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 }, - -/* Stack pointer in prepare instruction. */ -#define SP (R2DISPOSE + 1) - { 2, 19, insert_spe, extract_spe, V850_OPERAND_REG }, - -/* The IMM5 field in a divide N step instruction. */ -#define I5DIV (SP + 1) - { 9, 0, insert_i5div, extract_i5div, V850_OPERAND_SIGNED }, - - /* The list of registers in a PUSHMH/POPMH instruction. */ -#define LIST18_H (I5DIV + 1) - { -1, 0xfff8000f, NULL, NULL, V850E_PUSH_POP }, - - /* The list of registers in a PUSHML/POPML instruction. */ -#define LIST18_L (LIST18_H + 1) - { -1, 0xfff8001f, NULL, NULL, V850E_PUSH_POP }, /* The setting of the 4th bit is a flag to disassmble() in v850-dis.c */ -} ; - - -/* reg-reg instruction format (Format I) */ -#define IF1 {R1, R2} - -/* imm-reg instruction format (Format II) */ -#define IF2 {I5, R2} - -/* conditional branch instruction format (Format III) */ -#define IF3 {D9_RELAX} - -/* 3 operand instruction (Format VI) */ -#define IF6 {I16, R1, R2} - -/* 3 operand instruction (Format VI) */ -#define IF6U {I16U, R1, R2} - - - -/* The opcode table. - - The format of the opcode table is: - - NAME OPCODE MASK { OPERANDS } MEMOP PROCESSOR - - NAME is the name of the instruction. - OPCODE is the instruction opcode. - MASK is the opcode mask; this is used to tell the disassembler - which bits in the actual opcode must match OPCODE. - OPERANDS is the list of operands. - MEMOP specifies which operand (if any) is a memory operand. - PROCESSORS specifies which CPU(s) support the opcode. - - The disassembler reads the table in order and prints the first - instruction which matches, so this table is sorted to put more - specific instructions before more general instructions. It is also - sorted by major opcode. - - The table is also sorted by name. This is used by the assembler. - When parsing an instruction the assembler finds the first occurance - of the name of the instruciton in this table and then attempts to - match the instruction's arguments with description of the operands - associated with the entry it has just found in this table. If the - match fails the assembler looks at the next entry in this table. - If that entry has the same name as the previous entry, then it - tries to match the instruction against that entry and so on. This - is how the assembler copes with multiple, different formats of the - same instruction. */ - -const struct v850_opcode v850_opcodes[] = -{ -{ "breakpoint", 0xffff, 0xffff, {UNUSED}, 0, PROCESSOR_ALL }, - -{ "jmp", one (0x0060), one (0xffe0), {R1}, 1, PROCESSOR_ALL }, - -/* load/store instructions */ -{ "sld.bu", one (0x0300), one (0x0780), {D7, EP, R2_NOTR0}, 1, PROCESSOR_V850EA }, -{ "sld.bu", one (0x0060), one (0x07f0), {D4, EP, R2_NOTR0}, 1, PROCESSOR_V850E }, - -{ "sld.hu", one (0x0400), one (0x0780), {D8_7, EP, R2_NOTR0}, 1, PROCESSOR_V850EA }, -{ "sld.hu", one (0x0070), one (0x07f0), {D5_4, EP, R2_NOTR0}, 1, PROCESSOR_V850E }, - -{ "sld.b", one (0x0060), one (0x07f0), {D4, EP, R2}, 1, PROCESSOR_V850EA }, -{ "sld.b", one (0x0300), one (0x0780), {D7, EP, R2}, 1, PROCESSOR_V850E }, -{ "sld.b", one (0x0300), one (0x0780), {D7, EP, R2}, 1, PROCESSOR_V850 }, - -{ "sld.h", one (0x0070), one (0x07f0), {D5_4, EP, R2}, 1, PROCESSOR_V850EA }, -{ "sld.h", one (0x0400), one (0x0780), {D8_7, EP, R2}, 1, PROCESSOR_V850E }, -{ "sld.h", one (0x0400), one (0x0780), {D8_7, EP, R2}, 1, PROCESSOR_V850 }, -{ "sld.w", one (0x0500), one (0x0781), {D8_6, EP, R2}, 1, PROCESSOR_ALL }, -{ "sst.b", one (0x0380), one (0x0780), {R2, D7, EP}, 2, PROCESSOR_ALL }, -{ "sst.h", one (0x0480), one (0x0780), {R2, D8_7, EP}, 2, PROCESSOR_ALL }, -{ "sst.w", one (0x0501), one (0x0781), {R2, D8_6, EP}, 2, PROCESSOR_ALL }, - -{ "pushml", two (0x07e0, 0x0001), two (0xfff0, 0x0007), {LIST18_L}, 0, PROCESSOR_V850EA }, -{ "pushmh", two (0x07e0, 0x0003), two (0xfff0, 0x0007), {LIST18_H}, 0, PROCESSOR_V850EA }, -{ "popml", two (0x07f0, 0x0001), two (0xfff0, 0x0007), {LIST18_L}, 0, PROCESSOR_V850EA }, -{ "popmh", two (0x07f0, 0x0003), two (0xfff0, 0x0007), {LIST18_H}, 0, PROCESSOR_V850EA }, -{ "prepare", two (0x0780, 0x0003), two (0xffc0, 0x001f), {LIST12, IMM5, SP}, 0, PROCESSOR_NOT_V850 }, -{ "prepare", two (0x0780, 0x000b), two (0xffc0, 0x001f), {LIST12, IMM5, IMM16}, 0, PROCESSOR_NOT_V850 }, -{ "prepare", two (0x0780, 0x0013), two (0xffc0, 0x001f), {LIST12, IMM5, IMM16}, 0, PROCESSOR_NOT_V850 }, -{ "prepare", two (0x0780, 0x001b), two (0xffc0, 0x001f), {LIST12, IMM5, IMM32}, 0, PROCESSOR_NOT_V850 }, -{ "prepare", two (0x0780, 0x0001), two (0xffc0, 0x001f), {LIST12, IMM5}, 0, PROCESSOR_NOT_V850 }, -{ "dispose", one (0x0640), one (0xffc0), {IMM5, LIST12, R2DISPOSE},0, PROCESSOR_NOT_V850 }, -{ "dispose", two (0x0640, 0x0000), two (0xffc0, 0x001f), {IMM5, LIST12}, 0, PROCESSOR_NOT_V850 }, - -{ "ld.b", two (0x0700, 0x0000), two (0x07e0, 0x0000), {D16, R1, R2}, 1, PROCESSOR_ALL }, -{ "ld.h", two (0x0720, 0x0000), two (0x07e0, 0x0001), {D16_15, R1, R2}, 1, PROCESSOR_ALL }, -{ "ld.w", two (0x0720, 0x0001), two (0x07e0, 0x0001), {D16_15, R1, R2}, 1, PROCESSOR_ALL }, -{ "ld.bu", two (0x0780, 0x0001), two (0x07c0, 0x0001), {D16_16, R1, R2_NOTR0}, 1, PROCESSOR_NOT_V850 }, -{ "ld.hu", two (0x07e0, 0x0001), two (0x07e0, 0x0001), {D16_15, R1, R2_NOTR0}, 1, PROCESSOR_NOT_V850 }, -{ "st.b", two (0x0740, 0x0000), two (0x07e0, 0x0000), {R2, D16, R1}, 2, PROCESSOR_ALL }, -{ "st.h", two (0x0760, 0x0000), two (0x07e0, 0x0001), {R2, D16_15, R1}, 2, PROCESSOR_ALL }, -{ "st.w", two (0x0760, 0x0001), two (0x07e0, 0x0001), {R2, D16_15, R1}, 2, PROCESSOR_ALL }, - -/* byte swap/extend instructions */ -{ "zxb", one (0x0080), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 }, -{ "zxh", one (0x00c0), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 }, -{ "sxb", one (0x00a0), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 }, -{ "sxh", one (0x00e0), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 }, -{ "bsh", two (0x07e0, 0x0342), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 }, -{ "bsw", two (0x07e0, 0x0340), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 }, -{ "hsw", two (0x07e0, 0x0344), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 }, - -/* jump table instructions */ -{ "switch", one (0x0040), one (0xffe0), {R1}, 1, PROCESSOR_NOT_V850 }, -{ "callt", one (0x0200), one (0xffc0), {I6}, 0, PROCESSOR_NOT_V850 }, -{ "ctret", two (0x07e0, 0x0144), two (0xffff, 0xffff), {0}, 0, PROCESSOR_NOT_V850 }, - -/* arithmetic operation instructions */ -{ "setf", two (0x07e0, 0x0000), two (0x07f0, 0xffff), {CCCC, R2}, 0, PROCESSOR_ALL }, -{ "cmov", two (0x07e0, 0x0320), two (0x07e0, 0x07e1), {MOVCC, R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, -{ "cmov", two (0x07e0, 0x0300), two (0x07e0, 0x07e1), {MOVCC, I5, R2, R3}, 0, PROCESSOR_NOT_V850 }, - -{ "mul", two (0x07e0, 0x0220), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, -{ "mul", two (0x07e0, 0x0240), two (0x07e0, 0x07c3), {I9, R2, R3}, 0, PROCESSOR_NOT_V850 }, -{ "mulu", two (0x07e0, 0x0222), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, -{ "mulu", two (0x07e0, 0x0242), two (0x07e0, 0x07c3), {U9, R2, R3}, 0, PROCESSOR_NOT_V850 }, - -{ "div", two (0x07e0, 0x02c0), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, -{ "divu", two (0x07e0, 0x02c2), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, -{ "divhu", two (0x07e0, 0x0282), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, -{ "divh", two (0x07e0, 0x0280), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, -{ "divh", OP (0x02), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL }, - -{ "divhn", two (0x07e0, 0x0280), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA }, -{ "divhun", two (0x07e0, 0x0282), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA }, -{ "divn", two (0x07e0, 0x02c0), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA }, -{ "divun", two (0x07e0, 0x02c2), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA }, -{ "sdivhn", two (0x07e0, 0x0180), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA }, -{ "sdivhun", two (0x07e0, 0x0182), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA }, -{ "sdivn", two (0x07e0, 0x01c0), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA }, -{ "sdivun", two (0x07e0, 0x01c2), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA }, - -{ "nop", one (0x00), one (0xffff), {0}, 0, PROCESSOR_ALL }, -{ "mov", OP (0x10), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL }, -{ "mov", one (0x0620), one (0xffe0), {IMM32, R1_NOTR0}, 0, PROCESSOR_NOT_V850 }, -{ "mov", OP (0x00), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL }, -{ "movea", OP (0x31), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL }, -{ "movhi", OP (0x32), OP_MASK, {I16U, R1, R2_NOTR0}, 0, PROCESSOR_ALL }, -{ "add", OP (0x0e), OP_MASK, IF1, 0, PROCESSOR_ALL }, -{ "add", OP (0x12), OP_MASK, IF2, 0, PROCESSOR_ALL }, -{ "addi", OP (0x30), OP_MASK, IF6, 0, PROCESSOR_ALL }, -{ "sub", OP (0x0d), OP_MASK, IF1, 0, PROCESSOR_ALL }, -{ "subr", OP (0x0c), OP_MASK, IF1, 0, PROCESSOR_ALL }, -{ "mulh", OP (0x17), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL }, -{ "mulh", OP (0x07), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL }, -{ "mulhi", OP (0x37), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL }, -{ "cmp", OP (0x0f), OP_MASK, IF1, 0, PROCESSOR_ALL }, -{ "cmp", OP (0x13), OP_MASK, IF2, 0, PROCESSOR_ALL }, - -/* saturated operation instructions */ -{ "satadd", OP (0x11), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL }, -{ "satadd", OP (0x06), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL }, -{ "satsub", OP (0x05), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL }, -{ "satsubi", OP (0x33), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL }, -{ "satsubr", OP (0x04), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL }, - -/* logical operation instructions */ -{ "tst", OP (0x0b), OP_MASK, IF1, 0, PROCESSOR_ALL }, -{ "or", OP (0x08), OP_MASK, IF1, 0, PROCESSOR_ALL }, -{ "ori", OP (0x34), OP_MASK, IF6U, 0, PROCESSOR_ALL }, -{ "and", OP (0x0a), OP_MASK, IF1, 0, PROCESSOR_ALL }, -{ "andi", OP (0x36), OP_MASK, IF6U, 0, PROCESSOR_ALL }, -{ "xor", OP (0x09), OP_MASK, IF1, 0, PROCESSOR_ALL }, -{ "xori", OP (0x35), OP_MASK, IF6U, 0, PROCESSOR_ALL }, -{ "not", OP (0x01), OP_MASK, IF1, 0, PROCESSOR_ALL }, -{ "sar", OP (0x15), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL }, -{ "sar", two (0x07e0, 0x00a0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL }, -{ "shl", OP (0x16), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL }, -{ "shl", two (0x07e0, 0x00c0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL }, -{ "shr", OP (0x14), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL }, -{ "shr", two (0x07e0, 0x0080), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL }, -{ "sasf", two (0x07e0, 0x0200), two (0x07f0, 0xffff), {CCCC, R2}, 0, PROCESSOR_NOT_V850 }, - -/* branch instructions */ - /* signed integer */ -{ "bgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "blt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "ble", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL }, - /* unsigned integer */ -{ "bh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL }, - /* common */ -{ "be", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL }, - /* others */ -{ "bv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bp", BOP (0xc), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bc", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bnc", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bz", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bnz", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "br", BOP (0x5), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "bsa", BOP (0xd), BOP_MASK, IF3, 0, PROCESSOR_ALL }, - -/* Branch macros. - - We use the short form in the opcode/mask fields. The assembler - will twiddle bits as necessary if the long form is needed. */ - - /* signed integer */ -{ "jgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jlt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jle", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL }, - /* unsigned integer */ -{ "jh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL }, - /* common */ -{ "je", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL }, - /* others */ -{ "jv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jp", BOP (0xc), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jc", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jnc", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jz", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jnz", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jsa", BOP (0xd), BOP_MASK, IF3, 0, PROCESSOR_ALL }, -{ "jbr", BOP (0x5), BOP_MASK, IF3, 0, PROCESSOR_ALL }, - -{ "jr", one (0x0780), two (0xffc0, 0x0001), {D22}, 0, PROCESSOR_ALL }, -{ "jarl", one (0x0780), two (0x07c0, 0x0001), {D22, R2}, 0, PROCESSOR_ALL}, - -/* bit manipulation instructions */ -{ "set1", two (0x07c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL }, -{ "set1", two (0x07e0, 0x00e0), two (0x07e0, 0xffff), {R2, R1}, 2, PROCESSOR_NOT_V850 }, -{ "not1", two (0x47c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL }, -{ "not1", two (0x07e0, 0x00e2), two (0x07e0, 0xffff), {R2, R1}, 2, PROCESSOR_NOT_V850 }, -{ "clr1", two (0x87c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL }, -{ "clr1", two (0x07e0, 0x00e4), two (0x07e0, 0xffff), {R2, R1}, 2, PROCESSOR_NOT_V850 }, -{ "tst1", two (0xc7c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL }, -{ "tst1", two (0x07e0, 0x00e6), two (0x07e0, 0xffff), {R2, R1}, 2, PROCESSOR_NOT_V850 }, - -/* special instructions */ -{ "di", two (0x07e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL }, -{ "ei", two (0x87e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL }, -{ "halt", two (0x07e0, 0x0120), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL }, -{ "reti", two (0x07e0, 0x0140), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL }, -{ "trap", two (0x07e0, 0x0100), two (0xffe0, 0xffff), {I5U}, 0, PROCESSOR_ALL }, -{ "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0xffff), {R1, SR2}, 0, PROCESSOR_ALL }, -{ "stsr", two (0x07e0, 0x0040), two (0x07e0, 0xffff), {SR1, R2}, 0, PROCESSOR_ALL }, -{ 0, 0, 0, {0}, 0, 0 }, - -} ; - -const int v850_num_opcodes = - sizeof (v850_opcodes) / sizeof (v850_opcodes[0]); - diff --git a/contrib/binutils/opcodes/z8k-dis.c b/contrib/binutils/opcodes/z8k-dis.c deleted file mode 100644 index 091d9379ddde..000000000000 --- a/contrib/binutils/opcodes/z8k-dis.c +++ /dev/null @@ -1,587 +0,0 @@ -/* Disassemble z8000 code. - Copyright 1992, 1993, 1998, 2000, 2001 - Free Software Foundation, Inc. - -This file is part of GNU Binutils. - -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. */ - -#include "sysdep.h" -#include "dis-asm.h" - -#define DEFINE_TABLE -#include "z8k-opc.h" - -#include <setjmp.h> - -typedef struct { - /* These are all indexed by nibble number (i.e only every other entry - of bytes is used, and every 4th entry of words). */ - unsigned char nibbles[24]; - unsigned char bytes[24]; - unsigned short words[24]; - - /* Nibble number of first word not yet fetched. */ - int max_fetched; - bfd_vma insn_start; - jmp_buf bailout; - - long tabl_index; - char instr_asmsrc[80]; - unsigned long arg_reg[0x0f]; - unsigned long immediate; - unsigned long displacement; - unsigned long address; - unsigned long cond_code; - unsigned long ctrl_code; - unsigned long flags; - 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. */ -#define FETCH_DATA(info, nibble) \ - ((nibble) < ((instr_data_s *) (info->private_data))->max_fetched \ - ? 1 : fetch_data ((info), (nibble))) - -static int -fetch_data (info, nibble) - struct disassemble_info *info; - int nibble; -{ - unsigned char mybuf[20]; - int status; - instr_data_s *priv = (instr_data_s *) info->private_data; - - if ((nibble % 4) != 0) - abort (); - - status = (*info->read_memory_func) (priv->insn_start, - (bfd_byte *) mybuf, - nibble / 2, - info); - if (status != 0) - { - (*info->memory_error_func) (status, priv->insn_start, info); - longjmp (priv->bailout, 1); - } - - { - int i; - unsigned char *p = mybuf; - - for (i = 0; i < nibble;) - { - priv->words[i] = (p[0] << 8) | p[1]; - - priv->bytes[i] = *p; - priv->nibbles[i++] = *p >> 4; - priv->nibbles[i++] = *p & 0xf; - - ++p; - priv->bytes[i] = *p; - priv->nibbles[i++] = *p >> 4; - priv->nibbles[i++] = *p & 0xf; - - ++p; - } - } - priv->max_fetched = nibble; - return 1; -} - -static char *codes[16] = { - "f", - "lt", - "le", - "ule", - "ov/pe", - "mi", - "eq", - "c/ult", - "t", - "ge", - "gt", - "ugt", - "nov/po", - "pl", - "ne", - "nc/uge" -}; - -static char *ctrl_names[8] = { - "<invld>", - "flags", - "fcw", - "refresh", - "psapseg", - "psapoff", - "nspseg", - "nspoff" -}; - -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 *)); -static void unpack_instr PARAMS ((instr_data_s *, int, disassemble_info *)); -static void unparse_instr PARAMS ((instr_data_s *, int)); - -static int -print_insn_z8k (addr, info, is_segmented) - bfd_vma addr; - disassemble_info *info; - int is_segmented; -{ - instr_data_s instr_data; - - info->private_data = (PTR) &instr_data; - instr_data.max_fetched = 0; - instr_data.insn_start = addr; - if (setjmp (instr_data.bailout) != 0) - /* Error return. */ - return -1; - - instr_data.tabl_index = z8k_lookup_instr (instr_data.nibbles, info); - if (instr_data.tabl_index > 0) - { - unpack_instr (&instr_data, is_segmented, info); - unparse_instr (&instr_data, is_segmented); - output_instr (&instr_data, addr, info); - return z8k_table[instr_data.tabl_index].length + seg_length; - } - else - { - FETCH_DATA (info, 4); - (*info->fprintf_func) (info->stream, ".word %02x%02x", - instr_data.bytes[0], instr_data.bytes[2]); - return 2; - } -} - -int -print_insn_z8001 (addr, info) - bfd_vma addr; - disassemble_info *info; -{ - return print_insn_z8k (addr, info, 1); -} - -int -print_insn_z8002 (addr, info) - bfd_vma addr; - disassemble_info *info; -{ - return print_insn_z8k (addr, info, 0); -} - -int -z8k_lookup_instr (nibbles, info) - unsigned char *nibbles; - disassemble_info *info; -{ - - int nibl_index, tabl_index; - int nibl_matched; - unsigned short instr_nibl; - unsigned short tabl_datum, datum_class, datum_value; - - nibl_matched = 0; - tabl_index = 0; - while (!nibl_matched && z8k_table[tabl_index].name) - { - nibl_matched = 1; - for (nibl_index = 0; - nibl_index < z8k_table[tabl_index].length * 2 && nibl_matched; - nibl_index++) - { - if ((nibl_index % 4) == 0) - /* Fetch one word at a time. */ - FETCH_DATA (info, nibl_index + 4); - instr_nibl = nibbles[nibl_index]; - - tabl_datum = z8k_table[tabl_index].byte_info[nibl_index]; - datum_class = tabl_datum & CLASS_MASK; - datum_value = ~CLASS_MASK & tabl_datum; - - switch (datum_class) - { - case CLASS_BIT: - if (datum_value != instr_nibl) - nibl_matched = 0; - break; - case CLASS_00II: - if (!((~instr_nibl) & 0x4)) - nibl_matched = 0; - break; - case CLASS_01II: - if (!(instr_nibl & 0x4)) - nibl_matched = 0; - break; - case CLASS_0CCC: - if (!((~instr_nibl) & 0x8)) - nibl_matched = 0; - break; - case CLASS_1CCC: - if (!(instr_nibl & 0x8)) - nibl_matched = 0; - break; - case CLASS_0DISP7: - if (!((~instr_nibl) & 0x8)) - nibl_matched = 0; - nibl_index += 1; - break; - case CLASS_1DISP7: - if (!(instr_nibl & 0x8)) - nibl_matched = 0; - nibl_index += 1; - break; - case CLASS_REGN0: - if (instr_nibl == 0) - nibl_matched = 0; - break; - case CLASS_BIT_1OR2: - if ((instr_nibl | 0x2) != (datum_value | 0x2)) - nibl_matched = 0; - break; - default: - break; - } - } - if (nibl_matched) - { - return tabl_index; - } - - tabl_index++; - } - return -1; -} - -static void -output_instr (instr_data, addr, info) - instr_data_s *instr_data; - unsigned long addr ATTRIBUTE_UNUSED; - disassemble_info *info; -{ - int loop, loop_limit; - char tmp_str[20]; - char out_str[100]; - - strcpy (out_str, "\t"); - - loop_limit = (z8k_table[instr_data->tabl_index].length + seg_length) * 2; - FETCH_DATA (info, loop_limit); - for (loop = 0; loop < loop_limit; loop++) - { - sprintf (tmp_str, "%x", instr_data->nibbles[loop]); - strcat (out_str, tmp_str); - } - - while (loop++ < 8) - { - strcat (out_str, " "); - } - - strcat (out_str, instr_data->instr_asmsrc); - - (*info->fprintf_func) (info->stream, "%s", out_str); -} - -static void -unpack_instr (instr_data, is_segmented, info) - instr_data_s *instr_data; - int is_segmented; - disassemble_info *info; -{ - int nibl_count, loop; - unsigned short instr_nibl, instr_byte, instr_word; - long instr_long; - unsigned int tabl_datum, datum_class; - unsigned short datum_value; - - nibl_count = 0; - loop = 0; - seg_length = 0; - while (z8k_table[instr_data->tabl_index].byte_info[loop] != 0) - { - FETCH_DATA (info, nibl_count + 4 - (nibl_count % 4)); - instr_nibl = instr_data->nibbles[nibl_count]; - instr_byte = instr_data->bytes[nibl_count & ~1]; - instr_word = instr_data->words[nibl_count & ~3]; - - tabl_datum = z8k_table[instr_data->tabl_index].byte_info[loop]; - datum_class = tabl_datum & CLASS_MASK; - datum_value = tabl_datum & ~CLASS_MASK; - - switch (datum_class) - { - case CLASS_DISP: - switch (datum_value) - { - case ARG_DISP16: - instr_data->displacement = instr_data->insn_start + 4 - + (signed short) (instr_word & 0xffff); - nibl_count += 3; - break; - case ARG_DISP12: - if (instr_word & 0x800) - { - /* neg. 12 bit displacement */ - instr_data->displacement = instr_data->insn_start + 2 - - (signed short) ((instr_word & 0xfff) | 0xf000) * 2; - } - else - { - instr_data->displacement = instr_data->insn_start + 2 - - (instr_word & 0x0fff) * 2; - } - nibl_count += 2; - break; - default: - break; - } - break; - case CLASS_IMM: - switch (datum_value) - { - case ARG_IMM4: - instr_data->immediate = instr_nibl; - break; - case ARG_NIM8: - instr_data->immediate = (-instr_byte); - nibl_count += 1; - break; - case ARG_IMM8: - instr_data->immediate = instr_byte; - nibl_count += 1; - break; - case ARG_IMM16: - instr_data->immediate = instr_word; - nibl_count += 3; - break; - case ARG_IMM32: - FETCH_DATA (info, nibl_count + 8); - instr_long = (instr_data->words[nibl_count] << 16) - | (instr_data->words[nibl_count + 4]); - instr_data->immediate = instr_long; - nibl_count += 7; - break; - case ARG_IMMN: - instr_data->immediate = instr_nibl - 1; - break; - case ARG_IMM4M1: - instr_data->immediate = instr_nibl + 1; - break; - case ARG_IMM_1: - instr_data->immediate = 1; - break; - case ARG_IMM_2: - instr_data->immediate = 2; - break; - case ARG_IMM2: - instr_data->immediate = instr_nibl & 0x3; - break; - default: - break; - } - break; - case CLASS_CC: - instr_data->cond_code = instr_nibl; - break; - case CLASS_ADDRESS: - if (is_segmented) - { - if (instr_nibl & 0x8) - { - 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); - nibl_count += 7; - seg_length = 2; - } - else - { - instr_data->address = ((instr_word & 0x7f00) << 8) - + (instr_word & 0x00ff); - nibl_count += 3; - } - } - else - { - instr_data->address = instr_word; - nibl_count += 3; - } - break; - case CLASS_0CCC: - case CLASS_1CCC: - instr_data->ctrl_code = instr_nibl & 0x7; - break; - case CLASS_0DISP7: - 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; - nibl_count += 1; - break; - case CLASS_01II: - instr_data->interrupts = instr_nibl & 0x3; - break; - case CLASS_00II: - instr_data->interrupts = instr_nibl & 0x3; - break; - case CLASS_BIT: - instr_data->ctrl_code = instr_nibl & 0x7; - break; - case CLASS_FLAGS: - instr_data->flags = instr_nibl; - break; - case CLASS_REG: - instr_data->arg_reg[datum_value] = instr_nibl; - break; - 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; - nibl_count += 1; - break; - default: - abort (); - break; - } - - loop += 1; - nibl_count += 1; - } -} - -static void -unparse_instr (instr_data, is_segmented) - instr_data_s *instr_data; - int is_segmented; -{ - unsigned short datum_value; - unsigned int tabl_datum, datum_class; - int loop, loop_limit; - char out_str[80], tmp_str[25]; - - sprintf (out_str, "\t%s\t", z8k_table[instr_data->tabl_index].name); - - loop_limit = z8k_table[instr_data->tabl_index].noperands; - for (loop = 0; loop < loop_limit; loop++) - { - if (loop) - strcat (out_str, ","); - - tabl_datum = z8k_table[instr_data->tabl_index].arg_info[loop]; - datum_class = tabl_datum & CLASS_MASK; - datum_value = tabl_datum & ~CLASS_MASK; - - switch (datum_class) - { - case CLASS_X: - sprintf (tmp_str, "0x%0lx(R%ld)", instr_data->address, - instr_data->arg_reg[datum_value]); - strcat (out_str, tmp_str); - break; - case CLASS_BA: - sprintf (tmp_str, "r%ld(#%lx)", instr_data->arg_reg[datum_value], - instr_data->immediate); - strcat (out_str, tmp_str); - break; - case CLASS_BX: - sprintf (tmp_str, "r%ld(R%ld)", instr_data->arg_reg[datum_value], - instr_data->arg_reg[ARG_RX]); - strcat (out_str, tmp_str); - break; - case CLASS_DISP: - sprintf (tmp_str, "0x%0lx", instr_data->displacement); - strcat (out_str, tmp_str); - break; - case CLASS_IMM: - sprintf (tmp_str, "#0x%0lx", instr_data->immediate); - strcat (out_str, tmp_str); - break; - case CLASS_CC: - sprintf (tmp_str, "%s", codes[instr_data->cond_code]); - strcat (out_str, tmp_str); - break; - case CLASS_CTRL: - sprintf (tmp_str, "%s", ctrl_names[instr_data->ctrl_code]); - strcat (out_str, tmp_str); - break; - case CLASS_DA: - case CLASS_ADDRESS: - sprintf (tmp_str, "0x%0lx", instr_data->address); - strcat (out_str, tmp_str); - break; - case CLASS_IR: - 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; - case CLASS_FLAGS: - sprintf (tmp_str, "0x%0lx", instr_data->flags); - strcat (out_str, tmp_str); - break; - case CLASS_REG_BYTE: - if (instr_data->arg_reg[datum_value] >= 0x8) - sprintf (tmp_str, "rl%ld", - instr_data->arg_reg[datum_value] - 0x8); - else - sprintf (tmp_str, "rh%ld", instr_data->arg_reg[datum_value]); - strcat (out_str, tmp_str); - break; - case CLASS_REG_WORD: - sprintf (tmp_str, "r%ld", instr_data->arg_reg[datum_value]); - strcat (out_str, tmp_str); - break; - case CLASS_REG_QUAD: - sprintf (tmp_str, "rq%ld", instr_data->arg_reg[datum_value]); - strcat (out_str, tmp_str); - break; - case CLASS_REG_LONG: - sprintf (tmp_str, "rr%ld", instr_data->arg_reg[datum_value]); - 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]); - strcat (out_str, tmp_str); - break; - default: - abort (); - break; - } - } - - strcpy (instr_data->instr_asmsrc, out_str); -} diff --git a/contrib/binutils/opcodes/z8k-opc.h b/contrib/binutils/opcodes/z8k-opc.h deleted file mode 100644 index c62867c4bbf4..000000000000 --- a/contrib/binutils/opcodes/z8k-opc.h +++ /dev/null @@ -1,4479 +0,0 @@ - /* THIS FILE IS AUTOMAGICALLY GENERATED, DON'T EDIT IT */ -#define ARG_MASK 0x0f -#define ARG_SRC 0x01 -#define ARG_DST 0x02 -#define ARG_RS 0x01 -#define ARG_RD 0x02 -#define ARG_RA 0x03 -#define ARG_RB 0x04 -#define ARG_RR 0x05 -#define ARG_RX 0x06 -#define ARG_IMM4 0x01 -#define ARG_IMM8 0x02 -#define ARG_IMM16 0x03 -#define ARG_IMM32 0x04 -#define ARG_IMMN 0x05 -#define ARG_IMMNMINUS1 0x05 -#define ARG_IMM_1 0x06 -#define ARG_IMM_2 0x07 -#define ARG_DISP16 0x08 -#define ARG_NIM8 0x09 -#define ARG_IMM2 0x0a -#define ARG_IMM1OR2 0x0b -#define ARG_DISP12 0x0b -#define ARG_DISP8 0x0c -#define ARG_IMM4M1 0x0d -#define CLASS_MASK 0x1fff0 -#define CLASS_X 0x10 -#define CLASS_BA 0x20 -#define CLASS_DA 0x30 -#define CLASS_BX 0x40 -#define CLASS_DISP 0x50 -#define CLASS_IMM 0x60 -#define CLASS_CC 0x70 -#define CLASS_CTRL 0x80 -#define CLASS_ADDRESS 0xd0 -#define CLASS_0CCC 0xe0 -#define CLASS_1CCC 0xf0 -#define CLASS_0DISP7 0x100 -#define CLASS_1DISP7 0x200 -#define CLASS_01II 0x300 -#define CLASS_00II 0x400 -#define CLASS_BIT 0x500 -#define CLASS_FLAGS 0x600 -#define CLASS_IR 0x700 -#define CLASS_DISP8 0x800 -#define CLASS_BIT_1OR2 0x900 -#define CLASS_REG 0x7000 -#define CLASS_REG_BYTE 0x2000 -#define CLASS_REG_WORD 0x3000 -#define CLASS_REG_QUAD 0x4000 -#define CLASS_REG_LONG 0x5000 -#define CLASS_REGN0 0x8000 -#define CLASS_PR 0x10000 -#define OPC_adc 0 -#define OPC_adcb 1 -#define OPC_add 2 -#define OPC_addb 3 -#define OPC_addl 4 -#define OPC_and 5 -#define OPC_andb 6 -#define OPC_bit 7 -#define OPC_bitb 8 -#define OPC_call 9 -#define OPC_calr 10 -#define OPC_clr 11 -#define OPC_clrb 12 -#define OPC_com 13 -#define OPC_comb 14 -#define OPC_comflg 15 -#define OPC_cp 16 -#define OPC_cpb 17 -#define OPC_cpd 18 -#define OPC_cpdb 19 -#define OPC_cpdr 20 -#define OPC_cpdrb 21 -#define OPC_cpi 22 -#define OPC_cpib 23 -#define OPC_cpir 24 -#define OPC_cpirb 25 -#define OPC_cpl 26 -#define OPC_cpsd 27 -#define OPC_cpsdb 28 -#define OPC_cpsdr 29 -#define OPC_cpsdrb 30 -#define OPC_cpsi 31 -#define OPC_cpsib 32 -#define OPC_cpsir 33 -#define OPC_cpsirb 34 -#define OPC_dab 35 -#define OPC_dbjnz 36 -#define OPC_dec 37 -#define OPC_decb 38 -#define OPC_di 39 -#define OPC_div 40 -#define OPC_divl 41 -#define OPC_djnz 42 -#define OPC_ei 43 -#define OPC_ex 44 -#define OPC_exb 45 -#define OPC_exts 46 -#define OPC_extsb 47 -#define OPC_extsl 48 -#define OPC_halt 49 -#define OPC_in 50 -#define OPC_inb 51 -#define OPC_inc 52 -#define OPC_incb 53 -#define OPC_ind 54 -#define OPC_indb 55 -#define OPC_inib 56 -#define OPC_inibr 57 -#define OPC_iret 58 -#define OPC_jp 59 -#define OPC_jr 60 -#define OPC_ld 61 -#define OPC_lda 62 -#define OPC_ldar 63 -#define OPC_ldb 64 -#define OPC_ldctl 65 -#define OPC_ldir 66 -#define OPC_ldirb 67 -#define OPC_ldk 68 -#define OPC_ldl 69 -#define OPC_ldm 70 -#define OPC_ldps 71 -#define OPC_ldr 72 -#define OPC_ldrb 73 -#define OPC_ldrl 74 -#define OPC_mbit 75 -#define OPC_mreq 76 -#define OPC_mres 77 -#define OPC_mset 78 -#define OPC_mult 79 -#define OPC_multl 80 -#define OPC_neg 81 -#define OPC_negb 82 -#define OPC_nop 83 -#define OPC_or 84 -#define OPC_orb 85 -#define OPC_out 86 -#define OPC_outb 87 -#define OPC_outd 88 -#define OPC_outdb 89 -#define OPC_outib 90 -#define OPC_outibr 91 -#define OPC_pop 92 -#define OPC_popl 93 -#define OPC_push 94 -#define OPC_pushl 95 -#define OPC_res 96 -#define OPC_resb 97 -#define OPC_resflg 98 -#define OPC_ret 99 -#define OPC_rl 100 -#define OPC_rlb 101 -#define OPC_rlc 102 -#define OPC_rlcb 103 -#define OPC_rldb 104 -#define OPC_rr 105 -#define OPC_rrb 106 -#define OPC_rrc 107 -#define OPC_rrcb 108 -#define OPC_rrdb 109 -#define OPC_sbc 110 -#define OPC_sbcb 111 -#define OPC_sda 112 -#define OPC_sdab 113 -#define OPC_sdal 114 -#define OPC_sdl 115 -#define OPC_sdlb 116 -#define OPC_sdll 117 -#define OPC_set 118 -#define OPC_setb 119 -#define OPC_setflg 120 -#define OPC_sinb 121 -#define OPC_sind 122 -#define OPC_sindb 123 -#define OPC_sinib 124 -#define OPC_sinibr 125 -#define OPC_sla 126 -#define OPC_slab 127 -#define OPC_slal 128 -#define OPC_sll 129 -#define OPC_sllb 130 -#define OPC_slll 131 -#define OPC_sout 132 -#define OPC_soutb 133 -#define OPC_soutd 134 -#define OPC_soutdb 135 -#define OPC_soutib 136 -#define OPC_soutibr 137 -#define OPC_sra 138 -#define OPC_srab 139 -#define OPC_sral 140 -#define OPC_srl 141 -#define OPC_srlb 142 -#define OPC_srll 143 -#define OPC_sub 144 -#define OPC_subb 145 -#define OPC_subl 146 -#define OPC_tcc 147 -#define OPC_tccb 148 -#define OPC_test 149 -#define OPC_testb 150 -#define OPC_testl 151 -#define OPC_trdb 152 -#define OPC_trdrb 153 -#define OPC_trib 154 -#define OPC_trirb 155 -#define OPC_trtdrb 156 -#define OPC_trtib 157 -#define OPC_trtirb 158 -#define OPC_trtrb 159 -#define OPC_tset 160 -#define OPC_tsetb 161 -#define OPC_xor 162 -#define OPC_xorb 163 -#define OPC_ldd 164 -#define OPC_lddb 165 -#define OPC_lddr 166 -#define OPC_lddrb 167 -#define OPC_ldi 168 -#define OPC_ldib 169 -#define OPC_sc 170 -#define OPC_bpt 171 -#define OPC_ext0e 172 -#define OPC_ext0f 172 -#define OPC_ext8e 172 -#define OPC_ext8f 172 -#define OPC_rsvd36 172 -#define OPC_rsvd38 172 -#define OPC_rsvd78 172 -#define OPC_rsvd7e 172 -#define OPC_rsvd9d 172 -#define OPC_rsvd9f 172 -#define OPC_rsvdb9 172 -#define OPC_rsvdbf 172 -#define OPC_outi 173 -#define OPC_ldctlb 174 -#define OPC_sin 175 -#define OPC_trtdb 176 -typedef struct { -#ifdef NICENAMES -char *nicename; -int type; -int cycles; -int flags; -#endif -char *name; -unsigned char opcode; -void (*func) PARAMS ((void)); -unsigned int arg_info[4]; -unsigned int byte_info[10]; -int noperands; -int length; -int idx; -} opcode_entry_type; -#ifdef DEFINE_TABLE -opcode_entry_type z8k_table[] = { - - -/* 1011 0101 ssss dddd *** adc rd,rs */ -{ -#ifdef NICENAMES -"adc rd,rs",16,5, -0x3c, -#endif -"adc",OPC_adc,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+0xb,CLASS_BIT+5,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,0}, - - -/* 1011 0100 ssss dddd *** adcb rbd,rbs */ -{ -#ifdef NICENAMES -"adcb rbd,rbs",8,5, -0x3f, -#endif -"adcb",OPC_adcb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+0xb,CLASS_BIT+4,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,1}, - - -/* 0000 0001 ssN0 dddd *** add rd,@rs */ -{ -#ifdef NICENAMES -"add rd,@rs",16,7, -0x3c, -#endif -"add",OPC_add,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+1,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,2}, - - -/* 0100 0001 0000 dddd address_src *** add rd,address_src */ -{ -#ifdef NICENAMES -"add rd,address_src",16,9, -0x3c, -#endif -"add",OPC_add,0,{CLASS_REG_WORD+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,3}, - - -/* 0100 0001 ssN0 dddd address_src *** add rd,address_src(rs) */ -{ -#ifdef NICENAMES -"add rd,address_src(rs)",16,10, -0x3c, -#endif -"add",OPC_add,0,{CLASS_REG_WORD+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+1,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,4}, - - -/* 0000 0001 0000 dddd imm16 *** add rd,imm16 */ -{ -#ifdef NICENAMES -"add rd,imm16",16,7, -0x3c, -#endif -"add",OPC_add,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+0,CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,5}, - - -/* 1000 0001 ssss dddd *** add rd,rs */ -{ -#ifdef NICENAMES -"add rd,rs",16,4, -0x3c, -#endif -"add",OPC_add,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+1,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,6}, - - -/* 0000 0000 ssN0 dddd *** addb rbd,@rs */ -{ -#ifdef NICENAMES -"addb rbd,@rs",8,7, -0x3f, -#endif -"addb",OPC_addb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+0,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,7}, - - -/* 0100 0000 0000 dddd address_src *** addb rbd,address_src */ -{ -#ifdef NICENAMES -"addb rbd,address_src",8,9, -0x3f, -#endif -"addb",OPC_addb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,8}, - - -/* 0100 0000 ssN0 dddd address_src *** addb rbd,address_src(rs) */ -{ -#ifdef NICENAMES -"addb rbd,address_src(rs)",8,10, -0x3f, -#endif -"addb",OPC_addb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+0,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,9}, - - -/* 0000 0000 0000 dddd imm8 imm8 *** addb rbd,imm8 */ -{ -#ifdef NICENAMES -"addb rbd,imm8",8,7, -0x3f, -#endif -"addb",OPC_addb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0,CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,10}, - - -/* 1000 0000 ssss dddd *** addb rbd,rbs */ -{ -#ifdef NICENAMES -"addb rbd,rbs",8,4, -0x3f, -#endif -"addb",OPC_addb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,11}, - - -/* 0001 0110 ssN0 dddd *** addl rrd,@rs */ -{ -#ifdef NICENAMES -"addl rrd,@rs",32,14, -0x3c, -#endif -"addl",OPC_addl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+6,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,12}, - - -/* 0101 0110 0000 dddd address_src *** addl rrd,address_src */ -{ -#ifdef NICENAMES -"addl rrd,address_src",32,15, -0x3c, -#endif -"addl",OPC_addl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+5,CLASS_BIT+6,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,13}, - - -/* 0101 0110 ssN0 dddd address_src *** addl rrd,address_src(rs) */ -{ -#ifdef NICENAMES -"addl rrd,address_src(rs)",32,16, -0x3c, -#endif -"addl",OPC_addl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+6,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,14}, - - -/* 0001 0110 0000 dddd imm32 *** addl rrd,imm32 */ -{ -#ifdef NICENAMES -"addl rrd,imm32",32,14, -0x3c, -#endif -"addl",OPC_addl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IMM+(ARG_IMM32),}, - {CLASS_BIT+1,CLASS_BIT+6,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM32),0,0,0,0,},2,6,15}, - - -/* 1001 0110 ssss dddd *** addl rrd,rrs */ -{ -#ifdef NICENAMES -"addl rrd,rrs",32,8, -0x3c, -#endif -"addl",OPC_addl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+6,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,16}, - - -/* 0000 0111 ssN0 dddd *** and rd,@rs */ -{ -#ifdef NICENAMES -"and rd,@rs",16,7, -0x18, -#endif -"and",OPC_and,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+7,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,17}, - - -/* 0100 0111 0000 dddd address_src *** and rd,address_src */ -{ -#ifdef NICENAMES -"and rd,address_src",16,9, -0x18, -#endif -"and",OPC_and,0,{CLASS_REG_WORD+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+7,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,18}, - - -/* 0100 0111 ssN0 dddd address_src *** and rd,address_src(rs) */ -{ -#ifdef NICENAMES -"and rd,address_src(rs)",16,10, -0x18, -#endif -"and",OPC_and,0,{CLASS_REG_WORD+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+7,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,19}, - - -/* 0000 0111 0000 dddd imm16 *** and rd,imm16 */ -{ -#ifdef NICENAMES -"and rd,imm16",16,7, -0x18, -#endif -"and",OPC_and,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+0,CLASS_BIT+7,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,20}, - - -/* 1000 0111 ssss dddd *** and rd,rs */ -{ -#ifdef NICENAMES -"and rd,rs",16,4, -0x18, -#endif -"and",OPC_and,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+7,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,21}, - - -/* 0000 0110 ssN0 dddd *** andb rbd,@rs */ -{ -#ifdef NICENAMES -"andb rbd,@rs",8,7, -0x1c, -#endif -"andb",OPC_andb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+6,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,22}, - - -/* 0100 0110 0000 dddd address_src *** andb rbd,address_src */ -{ -#ifdef NICENAMES -"andb rbd,address_src",8,9, -0x1c, -#endif -"andb",OPC_andb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+6,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,23}, - - -/* 0100 0110 ssN0 dddd address_src *** andb rbd,address_src(rs) */ -{ -#ifdef NICENAMES -"andb rbd,address_src(rs)",8,10, -0x1c, -#endif -"andb",OPC_andb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+6,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,24}, - - -/* 0000 0110 0000 dddd imm8 imm8 *** andb rbd,imm8 */ -{ -#ifdef NICENAMES -"andb rbd,imm8",8,7, -0x1c, -#endif -"andb",OPC_andb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0,CLASS_BIT+6,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,25}, - - -/* 1000 0110 ssss dddd *** andb rbd,rbs */ -{ -#ifdef NICENAMES -"andb rbd,rbs",8,4, -0x1c, -#endif -"andb",OPC_andb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+6,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,26}, - - -/* 0010 0111 ddN0 imm4 *** bit @rd,imm4 */ -{ -#ifdef NICENAMES -"bit @rd,imm4",16,8, -0x10, -#endif -"bit",OPC_bit,0,{CLASS_IR+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+2,CLASS_BIT+7,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,27}, - - -/* 0110 0111 ddN0 imm4 address_dst *** bit address_dst(rd),imm4 */ -{ -#ifdef NICENAMES -"bit address_dst(rd),imm4",16,11, -0x10, -#endif -"bit",OPC_bit,0,{CLASS_X+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+7,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,28}, - - -/* 0110 0111 0000 imm4 address_dst *** bit address_dst,imm4 */ -{ -#ifdef NICENAMES -"bit address_dst,imm4",16,10, -0x10, -#endif -"bit",OPC_bit,0,{CLASS_DA+(ARG_DST),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+7,CLASS_BIT+0,CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,29}, - - -/* 1010 0111 dddd imm4 *** bit rd,imm4 */ -{ -#ifdef NICENAMES -"bit rd,imm4",16,4, -0x10, -#endif -"bit",OPC_bit,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+0xa,CLASS_BIT+7,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,30}, - - -/* 0010 0111 0000 ssss 0000 dddd 0000 0000 *** bit rd,rs */ -{ -#ifdef NICENAMES -"bit rd,rs",16,10, -0x10, -#endif -"bit",OPC_bit,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+7,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,31}, - - -/* 0010 0110 ddN0 imm4 *** bitb @rd,imm4 */ -{ -#ifdef NICENAMES -"bitb @rd,imm4",8,8, -0x10, -#endif -"bitb",OPC_bitb,0,{CLASS_IR+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+2,CLASS_BIT+6,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,32}, - - -/* 0110 0110 ddN0 imm4 address_dst *** bitb address_dst(rd),imm4 */ -{ -#ifdef NICENAMES -"bitb address_dst(rd),imm4",8,11, -0x10, -#endif -"bitb",OPC_bitb,0,{CLASS_X+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+6,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,33}, - - -/* 0110 0110 0000 imm4 address_dst *** bitb address_dst,imm4 */ -{ -#ifdef NICENAMES -"bitb address_dst,imm4",8,10, -0x10, -#endif -"bitb",OPC_bitb,0,{CLASS_DA+(ARG_DST),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+6,CLASS_BIT+0,CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,34}, - - -/* 1010 0110 dddd imm4 *** bitb rbd,imm4 */ -{ -#ifdef NICENAMES -"bitb rbd,imm4",8,4, -0x10, -#endif -"bitb",OPC_bitb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+0xa,CLASS_BIT+6,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,35}, - - -/* 0010 0110 0000 ssss 0000 dddd 0000 0000 *** bitb rbd,rs */ -{ -#ifdef NICENAMES -"bitb rbd,rs",8,10, -0x10, -#endif -"bitb",OPC_bitb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+6,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,36}, - - -/* 0011 0110 0000 0000 *** bpt */ -{ -#ifdef NICENAMES -"bpt",8,2, -0x00, -#endif -"bpt",OPC_bpt,0,{0}, - {CLASS_BIT+3,CLASS_BIT+6,CLASS_BIT+0,CLASS_BIT+0,0,0,0,0,0,},0,2,37}, - - -/* 0001 1111 ddN0 0000 *** call @rd */ -{ -#ifdef NICENAMES -"call @rd",32,10, -0x00, -#endif -"call",OPC_call,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+1,CLASS_BIT+0xf,CLASS_REGN0+(ARG_RD),CLASS_BIT+0,0,0,0,0,0,},1,2,38}, - - -/* 0101 1111 0000 0000 address_dst *** call address_dst */ -{ -#ifdef NICENAMES -"call address_dst",32,12, -0x00, -#endif -"call",OPC_call,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+5,CLASS_BIT+0xf,CLASS_BIT+0,CLASS_BIT+0,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,39}, - - -/* 0101 1111 ddN0 0000 address_dst *** call address_dst(rd) */ -{ -#ifdef NICENAMES -"call address_dst(rd)",32,13, -0x00, -#endif -"call",OPC_call,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+5,CLASS_BIT+0xf,CLASS_REGN0+(ARG_RD),CLASS_BIT+0,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,40}, - - -/* 1101 disp12 *** calr disp12 */ -{ -#ifdef NICENAMES -"calr disp12",16,10, -0x00, -#endif -"calr",OPC_calr,0,{CLASS_DISP,}, - {CLASS_BIT+0xd,CLASS_DISP+(ARG_DISP12),0,0,0,0,0,0,0,},1,2,41}, - - -/* 0000 1101 ddN0 1000 *** clr @rd */ -{ -#ifdef NICENAMES -"clr @rd",16,8, -0x00, -#endif -"clr",OPC_clr,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+0,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,0,0,0,0,},1,2,42}, - - -/* 0100 1101 0000 1000 address_dst *** clr address_dst */ -{ -#ifdef NICENAMES -"clr address_dst",16,11, -0x00, -#endif -"clr",OPC_clr,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_BIT+0,CLASS_BIT+8,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,43}, - - -/* 0100 1101 ddN0 1000 address_dst *** clr address_dst(rd) */ -{ -#ifdef NICENAMES -"clr address_dst(rd)",16,12, -0x00, -#endif -"clr",OPC_clr,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+8,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,44}, - - -/* 1000 1101 dddd 1000 *** clr rd */ -{ -#ifdef NICENAMES -"clr rd",16,7, -0x00, -#endif -"clr",OPC_clr,0,{CLASS_REG_WORD+(ARG_RD),}, - {CLASS_BIT+8,CLASS_BIT+0xd,CLASS_REG+(ARG_RD),CLASS_BIT+8,0,0,0,0,0,},1,2,45}, - - -/* 0000 1100 ddN0 1000 *** clrb @rd */ -{ -#ifdef NICENAMES -"clrb @rd",8,8, -0x00, -#endif -"clrb",OPC_clrb,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+0,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,0,0,0,0,},1,2,46}, - - -/* 0100 1100 0000 1000 address_dst *** clrb address_dst */ -{ -#ifdef NICENAMES -"clrb address_dst",8,11, -0x00, -#endif -"clrb",OPC_clrb,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_BIT+8,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,47}, - - -/* 0100 1100 ddN0 1000 address_dst *** clrb address_dst(rd) */ -{ -#ifdef NICENAMES -"clrb address_dst(rd)",8,12, -0x00, -#endif -"clrb",OPC_clrb,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+8,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,48}, - - -/* 1000 1100 dddd 1000 *** clrb rbd */ -{ -#ifdef NICENAMES -"clrb rbd",8,7, -0x00, -#endif -"clrb",OPC_clrb,0,{CLASS_REG_BYTE+(ARG_RD),}, - {CLASS_BIT+8,CLASS_BIT+0xc,CLASS_REG+(ARG_RD),CLASS_BIT+8,0,0,0,0,0,},1,2,49}, - - -/* 0000 1101 ddN0 0000 *** com @rd */ -{ -#ifdef NICENAMES -"com @rd",16,12, -0x18, -#endif -"com",OPC_com,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+0,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+0,0,0,0,0,0,},1,2,50}, - - -/* 0100 1101 0000 0000 address_dst *** com address_dst */ -{ -#ifdef NICENAMES -"com address_dst",16,15, -0x18, -#endif -"com",OPC_com,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_BIT+0,CLASS_BIT+0,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,51}, - - -/* 0100 1101 ddN0 0000 address_dst *** com address_dst(rd) */ -{ -#ifdef NICENAMES -"com address_dst(rd)",16,16, -0x18, -#endif -"com",OPC_com,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+0,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,52}, - - -/* 1000 1101 dddd 0000 *** com rd */ -{ -#ifdef NICENAMES -"com rd",16,7, -0x18, -#endif -"com",OPC_com,0,{CLASS_REG_WORD+(ARG_RD),}, - {CLASS_BIT+8,CLASS_BIT+0xd,CLASS_REG+(ARG_RD),CLASS_BIT+0,0,0,0,0,0,},1,2,53}, - - -/* 0000 1100 ddN0 0000 *** comb @rd */ -{ -#ifdef NICENAMES -"comb @rd",8,12, -0x1c, -#endif -"comb",OPC_comb,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+0,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+0,0,0,0,0,0,},1,2,54}, - - -/* 0100 1100 0000 0000 address_dst *** comb address_dst */ -{ -#ifdef NICENAMES -"comb address_dst",8,15, -0x1c, -#endif -"comb",OPC_comb,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_BIT+0,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,55}, - - -/* 0100 1100 ddN0 0000 address_dst *** comb address_dst(rd) */ -{ -#ifdef NICENAMES -"comb address_dst(rd)",8,16, -0x1c, -#endif -"comb",OPC_comb,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+0,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,56}, - - -/* 1000 1100 dddd 0000 *** comb rbd */ -{ -#ifdef NICENAMES -"comb rbd",8,7, -0x1c, -#endif -"comb",OPC_comb,0,{CLASS_REG_BYTE+(ARG_RD),}, - {CLASS_BIT+8,CLASS_BIT+0xc,CLASS_REG+(ARG_RD),CLASS_BIT+0,0,0,0,0,0,},1,2,57}, - - -/* 1000 1101 flags 0101 *** comflg flags */ -{ -#ifdef NICENAMES -"comflg flags",16,7, -0x3c, -#endif -"comflg",OPC_comflg,0,{CLASS_FLAGS,}, - {CLASS_BIT+8,CLASS_BIT+0xd,CLASS_FLAGS,CLASS_BIT+5,0,0,0,0,0,},1,2,58}, - - -/* 0000 1101 ddN0 0001 imm16 *** cp @rd,imm16 */ -{ -#ifdef NICENAMES -"cp @rd,imm16",16,11, -0x3c, -#endif -"cp",OPC_cp,0,{CLASS_IR+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+0,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+1,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,59}, - - -/* 0100 1101 ddN0 0001 address_dst imm16 *** cp address_dst(rd),imm16 */ -{ -#ifdef NICENAMES -"cp address_dst(rd),imm16",16,15, -0x3c, -#endif -"cp",OPC_cp,0,{CLASS_X+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+1,CLASS_ADDRESS+(ARG_DST),CLASS_IMM+(ARG_IMM16),0,0,0,},2,6,60}, - - -/* 0100 1101 0000 0001 address_dst imm16 *** cp address_dst,imm16 */ -{ -#ifdef NICENAMES -"cp address_dst,imm16",16,14, -0x3c, -#endif -"cp",OPC_cp,0,{CLASS_DA+(ARG_DST),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_BIT+0,CLASS_BIT+1,CLASS_ADDRESS+(ARG_DST),CLASS_IMM+(ARG_IMM16),0,0,0,},2,6,61}, - - -/* 0000 1011 ssN0 dddd *** cp rd,@rs */ -{ -#ifdef NICENAMES -"cp rd,@rs",16,7, -0x3c, -#endif -"cp",OPC_cp,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,62}, - - -/* 0100 1011 0000 dddd address_src *** cp rd,address_src */ -{ -#ifdef NICENAMES -"cp rd,address_src",16,9, -0x3c, -#endif -"cp",OPC_cp,0,{CLASS_REG_WORD+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+0xb,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,63}, - - -/* 0100 1011 ssN0 dddd address_src *** cp rd,address_src(rs) */ -{ -#ifdef NICENAMES -"cp rd,address_src(rs)",16,10, -0x3c, -#endif -"cp",OPC_cp,0,{CLASS_REG_WORD+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,64}, - - -/* 0000 1011 0000 dddd imm16 *** cp rd,imm16 */ -{ -#ifdef NICENAMES -"cp rd,imm16",16,7, -0x3c, -#endif -"cp",OPC_cp,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+0,CLASS_BIT+0xb,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,65}, - - -/* 1000 1011 ssss dddd *** cp rd,rs */ -{ -#ifdef NICENAMES -"cp rd,rs",16,4, -0x3c, -#endif -"cp",OPC_cp,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+0xb,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,66}, - - -/* 0000 1100 ddN0 0001 imm8 imm8 *** cpb @rd,imm8 */ -{ -#ifdef NICENAMES -"cpb @rd,imm8",8,11, -0x3c, -#endif -"cpb",OPC_cpb,0,{CLASS_IR+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+1,CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,67}, - - -/* 0100 1100 ddN0 0001 address_dst imm8 imm8 *** cpb address_dst(rd),imm8 */ -{ -#ifdef NICENAMES -"cpb address_dst(rd),imm8",8,15, -0x3c, -#endif -"cpb",OPC_cpb,0,{CLASS_X+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+1,CLASS_ADDRESS+(ARG_DST),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,},2,6,68}, - - -/* 0100 1100 0000 0001 address_dst imm8 imm8 *** cpb address_dst,imm8 */ -{ -#ifdef NICENAMES -"cpb address_dst,imm8",8,14, -0x3c, -#endif -"cpb",OPC_cpb,0,{CLASS_DA+(ARG_DST),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_BIT+1,CLASS_ADDRESS+(ARG_DST),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,},2,6,69}, - - -/* 0000 1010 ssN0 dddd *** cpb rbd,@rs */ -{ -#ifdef NICENAMES -"cpb rbd,@rs",8,7, -0x3c, -#endif -"cpb",OPC_cpb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,70}, - - -/* 0100 1010 0000 dddd address_src *** cpb rbd,address_src */ -{ -#ifdef NICENAMES -"cpb rbd,address_src",8,9, -0x3c, -#endif -"cpb",OPC_cpb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+0xa,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,71}, - - -/* 0100 1010 ssN0 dddd address_src *** cpb rbd,address_src(rs) */ -{ -#ifdef NICENAMES -"cpb rbd,address_src(rs)",8,10, -0x3c, -#endif -"cpb",OPC_cpb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,72}, - - -/* 0000 1010 0000 dddd imm8 imm8 *** cpb rbd,imm8 */ -{ -#ifdef NICENAMES -"cpb rbd,imm8",8,7, -0x3c, -#endif -"cpb",OPC_cpb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0,CLASS_BIT+0xa,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,73}, - - -/* 1000 1010 ssss dddd *** cpb rbd,rbs */ -{ -#ifdef NICENAMES -"cpb rbd,rbs",8,4, -0x3c, -#endif -"cpb",OPC_cpb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+0xa,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,74}, - - -/* 1011 1011 ssN0 1000 0000 rrrr dddd cccc *** cpd rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpd rd,@rs,rr,cc",16,11, -0x3c, -#endif -"cpd",OPC_cpd,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+8,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REG+(ARG_RD),CLASS_CC,0,},4,4,75}, - - -/* 1011 1010 ssN0 1000 0000 rrrr dddd cccc *** cpdb rbd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpdb rbd,@rs,rr,cc",8,11, -0x3c, -#endif -"cpdb",OPC_cpdb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+8,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REG+(ARG_RD),CLASS_CC,0,},4,4,76}, - - -/* 1011 1011 ssN0 1100 0000 rrrr dddd cccc *** cpdr rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpdr rd,@rs,rr,cc",16,11, -0x3c, -#endif -"cpdr",OPC_cpdr,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+0xc,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REG+(ARG_RD),CLASS_CC,0,},4,4,77}, - - -/* 1011 1010 ssN0 1100 0000 rrrr dddd cccc *** cpdrb rbd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpdrb rbd,@rs,rr,cc",8,11, -0x3c, -#endif -"cpdrb",OPC_cpdrb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+0xc,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REG+(ARG_RD),CLASS_CC,0,},4,4,78}, - - -/* 1011 1011 ssN0 0000 0000 rrrr dddd cccc *** cpi rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpi rd,@rs,rr,cc",16,11, -0x3c, -#endif -"cpi",OPC_cpi,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REG+(ARG_RD),CLASS_CC,0,},4,4,79}, - - -/* 1011 1010 ssN0 0000 0000 rrrr dddd cccc *** cpib rbd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpib rbd,@rs,rr,cc",8,11, -0x3c, -#endif -"cpib",OPC_cpib,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REG+(ARG_RD),CLASS_CC,0,},4,4,80}, - - -/* 1011 1011 ssN0 0100 0000 rrrr dddd cccc *** cpir rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpir rd,@rs,rr,cc",16,11, -0x3c, -#endif -"cpir",OPC_cpir,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+4,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REG+(ARG_RD),CLASS_CC,0,},4,4,81}, - - -/* 1011 1010 ssN0 0100 0000 rrrr dddd cccc *** cpirb rbd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpirb rbd,@rs,rr,cc",8,11, -0x3c, -#endif -"cpirb",OPC_cpirb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+4,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REG+(ARG_RD),CLASS_CC,0,},4,4,82}, - - -/* 0001 0000 ssN0 dddd *** cpl rrd,@rs */ -{ -#ifdef NICENAMES -"cpl rrd,@rs",32,14, -0x3c, -#endif -"cpl",OPC_cpl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+0,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,83}, - - -/* 0101 0000 0000 dddd address_src *** cpl rrd,address_src */ -{ -#ifdef NICENAMES -"cpl rrd,address_src",32,15, -0x3c, -#endif -"cpl",OPC_cpl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+5,CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,84}, - - -/* 0101 0000 ssN0 dddd address_src *** cpl rrd,address_src(rs) */ -{ -#ifdef NICENAMES -"cpl rrd,address_src(rs)",32,16, -0x3c, -#endif -"cpl",OPC_cpl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+0,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,85}, - - -/* 0001 0000 0000 dddd imm32 *** cpl rrd,imm32 */ -{ -#ifdef NICENAMES -"cpl rrd,imm32",32,14, -0x3c, -#endif -"cpl",OPC_cpl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IMM+(ARG_IMM32),}, - {CLASS_BIT+1,CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM32),0,0,0,0,},2,6,86}, - - -/* 1001 0000 ssss dddd *** cpl rrd,rrs */ -{ -#ifdef NICENAMES -"cpl rrd,rrs",32,8, -0x3c, -#endif -"cpl",OPC_cpl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,87}, - - -/* 1011 1011 ssN0 1010 0000 rrrr ddN0 cccc *** cpsd @rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpsd @rd,@rs,rr,cc",16,11, -0x3c, -#endif -"cpsd",OPC_cpsd,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+0xa,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_CC,0,},4,4,88}, - - -/* 1011 1010 ssN0 1010 0000 rrrr ddN0 cccc *** cpsdb @rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpsdb @rd,@rs,rr,cc",8,11, -0x3c, -#endif -"cpsdb",OPC_cpsdb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+0xa,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_CC,0,},4,4,89}, - - -/* 1011 1011 ssN0 1110 0000 rrrr ddN0 cccc *** cpsdr @rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpsdr @rd,@rs,rr,cc",16,11, -0x3c, -#endif -"cpsdr",OPC_cpsdr,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+0xe,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_CC,0,},4,4,90}, - - -/* 1011 1010 ssN0 1110 0000 rrrr ddN0 cccc *** cpsdrb @rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpsdrb @rd,@rs,rr,cc",8,11, -0x3c, -#endif -"cpsdrb",OPC_cpsdrb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+0xe,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_CC,0,},4,4,91}, - - -/* 1011 1011 ssN0 0010 0000 rrrr ddN0 cccc *** cpsi @rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpsi @rd,@rs,rr,cc",16,11, -0x3c, -#endif -"cpsi",OPC_cpsi,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_CC,0,},4,4,92}, - - -/* 1011 1010 ssN0 0010 0000 rrrr ddN0 cccc *** cpsib @rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpsib @rd,@rs,rr,cc",8,11, -0x3c, -#endif -"cpsib",OPC_cpsib,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_CC,0,},4,4,93}, - - -/* 1011 1011 ssN0 0110 0000 rrrr ddN0 cccc *** cpsir @rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpsir @rd,@rs,rr,cc",16,11, -0x3c, -#endif -"cpsir",OPC_cpsir,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+6,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_CC,0,},4,4,94}, - - -/* 1011 1010 ssN0 0110 0000 rrrr ddN0 cccc *** cpsirb @rd,@rs,rr,cc */ -{ -#ifdef NICENAMES -"cpsirb @rd,@rs,rr,cc",8,11, -0x3c, -#endif -"cpsirb",OPC_cpsirb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),CLASS_CC,}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+6,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_CC,0,},4,4,95}, - - -/* 1011 0000 dddd 0000 *** dab rbd */ -{ -#ifdef NICENAMES -"dab rbd",8,5, -0x38, -#endif -"dab",OPC_dab,0,{CLASS_REG_BYTE+(ARG_RD),}, - {CLASS_BIT+0xb,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_BIT+0,0,0,0,0,0,},1,2,96}, - - -/* 1111 dddd 0disp7 *** dbjnz rbd,disp7 */ -{ -#ifdef NICENAMES -"dbjnz rbd,disp7",16,11, -0x00, -#endif -"dbjnz",OPC_dbjnz,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_DISP,}, - {CLASS_BIT+0xf,CLASS_REG+(ARG_RD),CLASS_0DISP7,0,0,0,0,0,0,},2,2,97}, - - -/* 0010 1011 ddN0 imm4m1 *** dec @rd,imm4m1 */ -{ -#ifdef NICENAMES -"dec @rd,imm4m1",16,11, -0x1c, -#endif -"dec",OPC_dec,0,{CLASS_IR+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+2,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),0,0,0,0,0,},2,2,98}, - - -/* 0110 1011 ddN0 imm4m1 address_dst *** dec address_dst(rd),imm4m1 */ -{ -#ifdef NICENAMES -"dec address_dst(rd),imm4m1",16,14, -0x1c, -#endif -"dec",OPC_dec,0,{CLASS_X+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+6,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,99}, - - -/* 0110 1011 0000 imm4m1 address_dst *** dec address_dst,imm4m1 */ -{ -#ifdef NICENAMES -"dec address_dst,imm4m1",16,13, -0x1c, -#endif -"dec",OPC_dec,0,{CLASS_DA+(ARG_DST),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+6,CLASS_BIT+0xb,CLASS_BIT+0,CLASS_IMM+(ARG_IMM4M1),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,100}, - - -/* 1010 1011 dddd imm4m1 *** dec rd,imm4m1 */ -{ -#ifdef NICENAMES -"dec rd,imm4m1",16,4, -0x1c, -#endif -"dec",OPC_dec,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+0xa,CLASS_BIT+0xb,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),0,0,0,0,0,},2,2,101}, - - -/* 0010 1010 ddN0 imm4m1 *** decb @rd,imm4m1 */ -{ -#ifdef NICENAMES -"decb @rd,imm4m1",8,11, -0x1c, -#endif -"decb",OPC_decb,0,{CLASS_IR+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+2,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),0,0,0,0,0,},2,2,102}, - - -/* 0110 1010 ddN0 imm4m1 address_dst *** decb address_dst(rd),imm4m1 */ -{ -#ifdef NICENAMES -"decb address_dst(rd),imm4m1",8,14, -0x1c, -#endif -"decb",OPC_decb,0,{CLASS_X+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+6,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,103}, - - -/* 0110 1010 0000 imm4m1 address_dst *** decb address_dst,imm4m1 */ -{ -#ifdef NICENAMES -"decb address_dst,imm4m1",8,13, -0x1c, -#endif -"decb",OPC_decb,0,{CLASS_DA+(ARG_DST),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+6,CLASS_BIT+0xa,CLASS_BIT+0,CLASS_IMM+(ARG_IMM4M1),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,104}, - - -/* 1010 1010 dddd imm4m1 *** decb rbd,imm4m1 */ -{ -#ifdef NICENAMES -"decb rbd,imm4m1",8,4, -0x1c, -#endif -"decb",OPC_decb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+0xa,CLASS_BIT+0xa,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),0,0,0,0,0,},2,2,105}, - - -/* 0111 1100 0000 00ii *** di i2 */ -{ -#ifdef NICENAMES -"di i2",16,7, -0x00, -#endif -"di",OPC_di,0,{CLASS_IMM+(ARG_IMM2),}, - {CLASS_BIT+7,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_00II,0,0,0,0,0,},1,2,106}, - - -/* 0001 1011 ssN0 dddd *** div rrd,@rs */ -{ -#ifdef NICENAMES -"div rrd,@rs",16,107, -0x3c, -#endif -"div",OPC_div,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,107}, - - -/* 0101 1011 0000 dddd address_src *** div rrd,address_src */ -{ -#ifdef NICENAMES -"div rrd,address_src",16,107, -0x3c, -#endif -"div",OPC_div,0,{CLASS_REG_LONG+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+5,CLASS_BIT+0xb,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,108}, - - -/* 0101 1011 ssN0 dddd address_src *** div rrd,address_src(rs) */ -{ -#ifdef NICENAMES -"div rrd,address_src(rs)",16,107, -0x3c, -#endif -"div",OPC_div,0,{CLASS_REG_LONG+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,109}, - - -/* 0001 1011 0000 dddd imm16 *** div rrd,imm16 */ -{ -#ifdef NICENAMES -"div rrd,imm16",16,107, -0x3c, -#endif -"div",OPC_div,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+1,CLASS_BIT+0xb,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,110}, - - -/* 1001 1011 ssss dddd *** div rrd,rs */ -{ -#ifdef NICENAMES -"div rrd,rs",16,107, -0x3c, -#endif -"div",OPC_div,0,{CLASS_REG_LONG+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+0xb,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,111}, - - -/* 0001 1010 ssN0 dddd *** divl rqd,@rs */ -{ -#ifdef NICENAMES -"divl rqd,@rs",32,744, -0x3c, -#endif -"divl",OPC_divl,0,{CLASS_REG_QUAD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,112}, - - -/* 0101 1010 0000 dddd address_src *** divl rqd,address_src */ -{ -#ifdef NICENAMES -"divl rqd,address_src",32,745, -0x3c, -#endif -"divl",OPC_divl,0,{CLASS_REG_QUAD+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+5,CLASS_BIT+0xa,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,113}, - - -/* 0101 1010 ssN0 dddd address_src *** divl rqd,address_src(rs) */ -{ -#ifdef NICENAMES -"divl rqd,address_src(rs)",32,746, -0x3c, -#endif -"divl",OPC_divl,0,{CLASS_REG_QUAD+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,114}, - - -/* 0001 1010 0000 dddd imm32 *** divl rqd,imm32 */ -{ -#ifdef NICENAMES -"divl rqd,imm32",32,744, -0x3c, -#endif -"divl",OPC_divl,0,{CLASS_REG_QUAD+(ARG_RD),CLASS_IMM+(ARG_IMM32),}, - {CLASS_BIT+1,CLASS_BIT+0xa,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM32),0,0,0,0,},2,6,115}, - - -/* 1001 1010 ssss dddd *** divl rqd,rrs */ -{ -#ifdef NICENAMES -"divl rqd,rrs",32,744, -0x3c, -#endif -"divl",OPC_divl,0,{CLASS_REG_QUAD+(ARG_RD),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+0xa,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,116}, - - -/* 1111 dddd 1disp7 *** djnz rd,disp7 */ -{ -#ifdef NICENAMES -"djnz rd,disp7",16,11, -0x00, -#endif -"djnz",OPC_djnz,0,{CLASS_REG_WORD+(ARG_RD),CLASS_DISP,}, - {CLASS_BIT+0xf,CLASS_REG+(ARG_RD),CLASS_1DISP7,0,0,0,0,0,0,},2,2,117}, - - -/* 0111 1100 0000 01ii *** ei i2 */ -{ -#ifdef NICENAMES -"ei i2",16,7, -0x00, -#endif -"ei",OPC_ei,0,{CLASS_IMM+(ARG_IMM2),}, - {CLASS_BIT+7,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_01II,0,0,0,0,0,},1,2,118}, - - -/* 0010 1101 ssN0 dddd *** ex rd,@rs */ -{ -#ifdef NICENAMES -"ex rd,@rs",16,12, -0x00, -#endif -"ex",OPC_ex,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,119}, - - -/* 0110 1101 0000 dddd address_src *** ex rd,address_src */ -{ -#ifdef NICENAMES -"ex rd,address_src",16,15, -0x00, -#endif -"ex",OPC_ex,0,{CLASS_REG_WORD+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+6,CLASS_BIT+0xd,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,120}, - - -/* 0110 1101 ssN0 dddd address_src *** ex rd,address_src(rs) */ -{ -#ifdef NICENAMES -"ex rd,address_src(rs)",16,16, -0x00, -#endif -"ex",OPC_ex,0,{CLASS_REG_WORD+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+6,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,121}, - - -/* 1010 1101 ssss dddd *** ex rd,rs */ -{ -#ifdef NICENAMES -"ex rd,rs",16,6, -0x00, -#endif -"ex",OPC_ex,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+0xa,CLASS_BIT+0xd,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,122}, - - -/* 0010 1100 ssN0 dddd *** exb rbd,@rs */ -{ -#ifdef NICENAMES -"exb rbd,@rs",8,12, -0x00, -#endif -"exb",OPC_exb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,123}, - - -/* 0110 1100 0000 dddd address_src *** exb rbd,address_src */ -{ -#ifdef NICENAMES -"exb rbd,address_src",8,15, -0x00, -#endif -"exb",OPC_exb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+6,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,124}, - - -/* 0110 1100 ssN0 dddd address_src *** exb rbd,address_src(rs) */ -{ -#ifdef NICENAMES -"exb rbd,address_src(rs)",8,16, -0x00, -#endif -"exb",OPC_exb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+6,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,125}, - - -/* 1010 1100 ssss dddd *** exb rbd,rbs */ -{ -#ifdef NICENAMES -"exb rbd,rbs",8,6, -0x00, -#endif -"exb",OPC_exb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+0xa,CLASS_BIT+0xc,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,126}, - - -/* 0000 1110 imm8 *** ext0e imm8 */ -{ -#ifdef NICENAMES -"ext0e imm8",8,10, -0x00, -#endif -"ext0e",OPC_ext0e,0,{CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0,CLASS_BIT+0xe,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},1,2,127}, - - -/* 0000 1111 imm8 *** ext0f imm8 */ -{ -#ifdef NICENAMES -"ext0f imm8",8,10, -0x00, -#endif -"ext0f",OPC_ext0f,0,{CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0,CLASS_BIT+0xf,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},1,2,128}, - - -/* 1000 1110 imm8 *** ext8e imm8 */ -{ -#ifdef NICENAMES -"ext8e imm8",8,10, -0x00, -#endif -"ext8e",OPC_ext8e,0,{CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+8,CLASS_BIT+0xe,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},1,2,129}, - - -/* 1000 1111 imm8 *** ext8f imm8 */ -{ -#ifdef NICENAMES -"ext8f imm8",8,10, -0x00, -#endif -"ext8f",OPC_ext8f,0,{CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+8,CLASS_BIT+0xf,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},1,2,130}, - - -/* 1011 0001 dddd 1010 *** exts rrd */ -{ -#ifdef NICENAMES -"exts rrd",16,11, -0x00, -#endif -"exts",OPC_exts,0,{CLASS_REG_LONG+(ARG_RD),}, - {CLASS_BIT+0xb,CLASS_BIT+1,CLASS_REG+(ARG_RD),CLASS_BIT+0xa,0,0,0,0,0,},1,2,131}, - - -/* 1011 0001 dddd 0000 *** extsb rd */ -{ -#ifdef NICENAMES -"extsb rd",8,11, -0x00, -#endif -"extsb",OPC_extsb,0,{CLASS_REG_WORD+(ARG_RD),}, - {CLASS_BIT+0xb,CLASS_BIT+1,CLASS_REG+(ARG_RD),CLASS_BIT+0,0,0,0,0,0,},1,2,132}, - - -/* 1011 0001 dddd 0111 *** extsl rqd */ -{ -#ifdef NICENAMES -"extsl rqd",32,11, -0x00, -#endif -"extsl",OPC_extsl,0,{CLASS_REG_QUAD+(ARG_RD),}, - {CLASS_BIT+0xb,CLASS_BIT+1,CLASS_REG+(ARG_RD),CLASS_BIT+7,0,0,0,0,0,},1,2,133}, - - -/* 0111 1010 0000 0000 *** halt */ -{ -#ifdef NICENAMES -"halt",16,8, -0x00, -#endif -"halt",OPC_halt,0,{0}, - {CLASS_BIT+7,CLASS_BIT+0xa,CLASS_BIT+0,CLASS_BIT+0,0,0,0,0,0,},0,2,134}, - - -/* 0011 1101 ssN0 dddd *** in rd,@rs */ -{ -#ifdef NICENAMES -"in rd,@rs",16,10, -0x00, -#endif -"in",OPC_in,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,135}, - - -/* 0011 1101 dddd 0100 imm16 *** in rd,imm16 */ -{ -#ifdef NICENAMES -"in rd,imm16",16,12, -0x00, -#endif -"in",OPC_in,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+3,CLASS_BIT+0xd,CLASS_REG+(ARG_RD),CLASS_BIT+4,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,136}, - - -/* 0011 1100 ssN0 dddd *** inb rbd,@rs */ -{ -#ifdef NICENAMES -"inb rbd,@rs",8,12, -0x00, -#endif -"inb",OPC_inb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,137}, - - -/* 0011 1010 dddd 0100 imm16 *** inb rbd,imm16 */ -{ -#ifdef NICENAMES -"inb rbd,imm16",8,10, -0x00, -#endif -"inb",OPC_inb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REG+(ARG_RD),CLASS_BIT+4,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,138}, - - -/* 0010 1001 ddN0 imm4m1 *** inc @rd,imm4m1 */ -{ -#ifdef NICENAMES -"inc @rd,imm4m1",16,11, -0x1c, -#endif -"inc",OPC_inc,0,{CLASS_IR+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+2,CLASS_BIT+9,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),0,0,0,0,0,},2,2,139}, - - -/* 0110 1001 ddN0 imm4m1 address_dst *** inc address_dst(rd),imm4m1 */ -{ -#ifdef NICENAMES -"inc address_dst(rd),imm4m1",16,14, -0x1c, -#endif -"inc",OPC_inc,0,{CLASS_X+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+6,CLASS_BIT+9,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,140}, - - -/* 0110 1001 0000 imm4m1 address_dst *** inc address_dst,imm4m1 */ -{ -#ifdef NICENAMES -"inc address_dst,imm4m1",16,13, -0x1c, -#endif -"inc",OPC_inc,0,{CLASS_DA+(ARG_DST),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+6,CLASS_BIT+9,CLASS_BIT+0,CLASS_IMM+(ARG_IMM4M1),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,141}, - - -/* 1010 1001 dddd imm4m1 *** inc rd,imm4m1 */ -{ -#ifdef NICENAMES -"inc rd,imm4m1",16,4, -0x1c, -#endif -"inc",OPC_inc,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+0xa,CLASS_BIT+9,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),0,0,0,0,0,},2,2,142}, - - -/* 0010 1000 ddN0 imm4m1 *** incb @rd,imm4m1 */ -{ -#ifdef NICENAMES -"incb @rd,imm4m1",8,11, -0x1c, -#endif -"incb",OPC_incb,0,{CLASS_IR+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+2,CLASS_BIT+8,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),0,0,0,0,0,},2,2,143}, - - -/* 0110 1000 ddN0 imm4m1 address_dst *** incb address_dst(rd),imm4m1 */ -{ -#ifdef NICENAMES -"incb address_dst(rd),imm4m1",8,14, -0x1c, -#endif -"incb",OPC_incb,0,{CLASS_X+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+6,CLASS_BIT+8,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,144}, - - -/* 0110 1000 0000 imm4m1 address_dst *** incb address_dst,imm4m1 */ -{ -#ifdef NICENAMES -"incb address_dst,imm4m1",8,13, -0x1c, -#endif -"incb",OPC_incb,0,{CLASS_DA+(ARG_DST),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+6,CLASS_BIT+8,CLASS_BIT+0,CLASS_IMM+(ARG_IMM4M1),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,145}, - - -/* 1010 1000 dddd imm4m1 *** incb rbd,imm4m1 */ -{ -#ifdef NICENAMES -"incb rbd,imm4m1",8,4, -0x1c, -#endif -"incb",OPC_incb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM +(ARG_IMM4M1),}, - {CLASS_BIT+0xa,CLASS_BIT+8,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM4M1),0,0,0,0,0,},2,2,146}, - - -/* 0011 1011 ssN0 1000 0000 aaaa ddN0 1000 *** ind @rd,@rs,ra */ -{ -#ifdef NICENAMES -"ind @rd,@rs,ra",16,21, -0x04, -#endif -"ind",OPC_ind,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+8,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,147}, - - -/* 0011 1010 ssN0 1000 0000 aaaa ddN0 1000 *** indb @rd,@rs,rba */ -{ -#ifdef NICENAMES -"indb @rd,@rs,rba",8,21, -0x04, -#endif -"indb",OPC_indb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_BYTE+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+8,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,148}, - - -/* 0011 1010 ssN0 0000 0000 aaaa ddN0 1000 *** inib @rd,@rs,ra */ -{ -#ifdef NICENAMES -"inib @rd,@rs,ra",8,21, -0x04, -#endif -"inib",OPC_inib,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,149}, - - -/* 0011 1010 ssN0 0000 0000 aaaa ddN0 0000 *** inibr @rd,@rs,ra */ -{ -#ifdef NICENAMES -"inibr @rd,@rs,ra",16,21, -0x04, -#endif -"inibr",OPC_inibr,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+0,0,},3,4,150}, - - -/* 0111 1011 0000 0000 *** iret */ -{ -#ifdef NICENAMES -"iret",16,13, -0x3f, -#endif -"iret",OPC_iret,0,{0}, - {CLASS_BIT+7,CLASS_BIT+0xb,CLASS_BIT+0,CLASS_BIT+0,0,0,0,0,0,},0,2,151}, - - -/* 0001 1110 ddN0 cccc *** jp cc,@rd */ -{ -#ifdef NICENAMES -"jp cc,@rd",16,10, -0x00, -#endif -"jp",OPC_jp,0,{CLASS_CC,CLASS_IR+(ARG_RD),}, - {CLASS_BIT+1,CLASS_BIT+0xe,CLASS_REGN0+(ARG_RD),CLASS_CC,0,0,0,0,0,},2,2,152}, - - -/* 0101 1110 0000 cccc address_dst *** jp cc,address_dst */ -{ -#ifdef NICENAMES -"jp cc,address_dst",16,7, -0x00, -#endif -"jp",OPC_jp,0,{CLASS_CC,CLASS_DA+(ARG_DST),}, - {CLASS_BIT+5,CLASS_BIT+0xe,CLASS_BIT+0,CLASS_CC,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,153}, - - -/* 0101 1110 ddN0 cccc address_dst *** jp cc,address_dst(rd) */ -{ -#ifdef NICENAMES -"jp cc,address_dst(rd)",16,8, -0x00, -#endif -"jp",OPC_jp,0,{CLASS_CC,CLASS_X+(ARG_RD),}, - {CLASS_BIT+5,CLASS_BIT+0xe,CLASS_REGN0+(ARG_RD),CLASS_CC,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,154}, - - -/* 1110 cccc disp8 *** jr cc,disp8 */ -{ -#ifdef NICENAMES -"jr cc,disp8",16,6, -0x00, -#endif -"jr",OPC_jr,0,{CLASS_CC,CLASS_DISP,}, - {CLASS_BIT+0xe,CLASS_CC,CLASS_DISP8,0,0,0,0,0,0,},2,2,155}, - - -/* 0000 1101 ddN0 0101 imm16 *** ld @rd,imm16 */ -{ -#ifdef NICENAMES -"ld @rd,imm16",16,7, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_IR+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+0,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+5,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,156}, - - -/* 0010 1111 ddN0 ssss *** ld @rd,rs */ -{ -#ifdef NICENAMES -"ld @rd,rs",16,8, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_IR+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+0xf,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),0,0,0,0,0,},2,2,157}, - - -/* 0100 1101 ddN0 0101 address_dst imm16 *** ld address_dst(rd),imm16 */ -{ -#ifdef NICENAMES -"ld address_dst(rd),imm16",16,15, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_X+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+5,CLASS_ADDRESS+(ARG_DST),CLASS_IMM+(ARG_IMM16),0,0,0,},2,6,158}, - - -/* 0110 1111 ddN0 ssss address_dst *** ld address_dst(rd),rs */ -{ -#ifdef NICENAMES -"ld address_dst(rd),rs",16,12, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_X+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+6,CLASS_BIT+0xf,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,159}, - - -/* 0100 1101 0000 0101 address_dst imm16 *** ld address_dst,imm16 */ -{ -#ifdef NICENAMES -"ld address_dst,imm16",16,14, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_DA+(ARG_DST),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_BIT+0,CLASS_BIT+5,CLASS_ADDRESS+(ARG_DST),CLASS_IMM+(ARG_IMM16),0,0,0,},2,6,160}, - - -/* 0110 1111 0000 ssss address_dst *** ld address_dst,rs */ -{ -#ifdef NICENAMES -"ld address_dst,rs",16,11, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_DA+(ARG_DST),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+6,CLASS_BIT+0xf,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,161}, - - -/* 0011 0011 ddN0 ssss imm16 *** ld rd(imm16),rs */ -{ -#ifdef NICENAMES -"ld rd(imm16),rs",16,14, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_BA+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+3,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,162}, - - -/* 0111 0011 ddN0 ssss 0000 xxxx 0000 0000 *** ld rd(rx),rs */ -{ -#ifdef NICENAMES -"ld rd(rx),rs",16,14, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_BX+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+7,CLASS_BIT+3,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_REG+(ARG_RX),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,163}, - - -/* 0010 0001 ssN0 dddd *** ld rd,@rs */ -{ -#ifdef NICENAMES -"ld rd,@rs",16,7, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+1,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,164}, - - -/* 0110 0001 0000 dddd address_src *** ld rd,address_src */ -{ -#ifdef NICENAMES -"ld rd,address_src",16,9, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_REG_WORD+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+6,CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,165}, - - -/* 0110 0001 ssN0 dddd address_src *** ld rd,address_src(rs) */ -{ -#ifdef NICENAMES -"ld rd,address_src(rs)",16,10, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_REG_WORD+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+6,CLASS_BIT+1,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,166}, - - -/* 0010 0001 0000 dddd imm16 *** ld rd,imm16 */ -{ -#ifdef NICENAMES -"ld rd,imm16",16,7, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+2,CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,167}, - - -/* 1010 0001 ssss dddd *** ld rd,rs */ -{ -#ifdef NICENAMES -"ld rd,rs",16,3, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+0xa,CLASS_BIT+1,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,168}, - - -/* 0011 0001 ssN0 dddd imm16 *** ld rd,rs(imm16) */ -{ -#ifdef NICENAMES -"ld rd,rs(imm16)",16,14, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_REG_WORD+(ARG_RD),CLASS_BA+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+1,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,169}, - - -/* 0111 0001 ssN0 dddd 0000 xxxx 0000 0000 *** ld rd,rs(rx) */ -{ -#ifdef NICENAMES -"ld rd,rs(rx)",16,14, -0x00, -#endif -"ld",OPC_ld,0,{CLASS_REG_WORD+(ARG_RD),CLASS_BX+(ARG_RS),}, - {CLASS_BIT+7,CLASS_BIT+1,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_REG+(ARG_RX),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,170}, - - -/* 0111 0110 0000 dddd address_src *** lda prd,address_src */ -{ -#ifdef NICENAMES -"lda prd,address_src",16,12, -0x00, -#endif -"lda",OPC_lda,0,{CLASS_PR+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+7,CLASS_BIT+6,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,171}, - - -/* 0111 0110 ssN0 dddd address_src *** lda prd,address_src(rs) */ -{ -#ifdef NICENAMES -"lda prd,address_src(rs)",16,13, -0x00, -#endif -"lda",OPC_lda,0,{CLASS_PR+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+7,CLASS_BIT+6,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,172}, - - -/* 0011 0100 ssN0 dddd imm16 *** lda prd,rs(imm16) */ -{ -#ifdef NICENAMES -"lda prd,rs(imm16)",16,15, -0x00, -#endif -"lda",OPC_lda,0,{CLASS_PR+(ARG_RD),CLASS_BA+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+4,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,173}, - - -/* 0111 0100 ssN0 dddd 0000 xxxx 0000 0000 *** lda prd,rs(rx) */ -{ -#ifdef NICENAMES -"lda prd,rs(rx)",16,15, -0x00, -#endif -"lda",OPC_lda,0,{CLASS_PR+(ARG_RD),CLASS_BX+(ARG_RS),}, - {CLASS_BIT+7,CLASS_BIT+4,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_REG+(ARG_RX),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,174}, - - -/* 0011 0100 0000 dddd disp16 *** ldar prd,disp16 */ -{ -#ifdef NICENAMES -"ldar prd,disp16",16,15, -0x00, -#endif -"ldar",OPC_ldar,0,{CLASS_PR+(ARG_RD),CLASS_DISP,}, - {CLASS_BIT+3,CLASS_BIT+4,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_DISP+(ARG_DISP16),0,0,0,0,},2,4,175}, - - -/* 0000 1100 ddN0 0101 imm8 imm8 *** ldb @rd,imm8 */ -{ -#ifdef NICENAMES -"ldb @rd,imm8",8,7, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_IR+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+5,CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,176}, - - -/* 0010 1110 ddN0 ssss *** ldb @rd,rbs */ -{ -#ifdef NICENAMES -"ldb @rd,rbs",8,8, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_IR+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+0xe,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),0,0,0,0,0,},2,2,177}, - - -/* 0100 1100 ddN0 0101 address_dst imm8 imm8 *** ldb address_dst(rd),imm8 */ -{ -#ifdef NICENAMES -"ldb address_dst(rd),imm8",8,15, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_X+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+5,CLASS_ADDRESS+(ARG_DST),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,},2,6,178}, - - -/* 0110 1110 ddN0 ssss address_dst *** ldb address_dst(rd),rbs */ -{ -#ifdef NICENAMES -"ldb address_dst(rd),rbs",8,12, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_X+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+6,CLASS_BIT+0xe,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,179}, - - -/* 0100 1100 0000 0101 address_dst imm8 imm8 *** ldb address_dst,imm8 */ -{ -#ifdef NICENAMES -"ldb address_dst,imm8",8,14, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_DA+(ARG_DST),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_BIT+5,CLASS_ADDRESS+(ARG_DST),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,},2,6,180}, - - -/* 0110 1110 0000 ssss address_dst *** ldb address_dst,rbs */ -{ -#ifdef NICENAMES -"ldb address_dst,rbs",8,11, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_DA+(ARG_DST),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+6,CLASS_BIT+0xe,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,181}, - - -/* 0010 0000 ssN0 dddd *** ldb rbd,@rs */ -{ -#ifdef NICENAMES -"ldb rbd,@rs",8,7, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+0,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,182}, - - -/* 0110 0000 0000 dddd address_src *** ldb rbd,address_src */ -{ -#ifdef NICENAMES -"ldb rbd,address_src",8,9, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+6,CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,183}, - - -/* 0110 0000 ssN0 dddd address_src *** ldb rbd,address_src(rs) */ -{ -#ifdef NICENAMES -"ldb rbd,address_src(rs)",8,10, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+6,CLASS_BIT+0,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,184}, - - -/* 1100 dddd imm8 *** ldb rbd,imm8 */ -{ -#ifdef NICENAMES -"ldb rbd,imm8",8,5, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xc,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},2,2,185}, - - -/* 1010 0000 ssss dddd *** ldb rbd,rbs */ -{ -#ifdef NICENAMES -"ldb rbd,rbs",8,3, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+0xa,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,186}, - - -/* 0011 0000 ssN0 dddd imm16 *** ldb rbd,rs(imm16) */ -{ -#ifdef NICENAMES -"ldb rbd,rs(imm16)",8,14, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_BA+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+0,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,187}, - - -/* 0111 0000 ssN0 dddd 0000 xxxx 0000 0000 *** ldb rbd,rs(rx) */ -{ -#ifdef NICENAMES -"ldb rbd,rs(rx)",8,14, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_BX+(ARG_RS),}, - {CLASS_BIT+7,CLASS_BIT+0,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_REG+(ARG_RX),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,188}, - - -/* 0011 0010 ddN0 ssss imm16 *** ldb rd(imm16),rbs */ -{ -#ifdef NICENAMES -"ldb rd(imm16),rbs",8,14, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_BA+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+2,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,189}, - - -/* 0111 0010 ddN0 ssss 0000 xxxx 0000 0000 *** ldb rd(rx),rbs */ -{ -#ifdef NICENAMES -"ldb rd(rx),rbs",8,14, -0x00, -#endif -"ldb",OPC_ldb,0,{CLASS_BX+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+7,CLASS_BIT+2,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_REG+(ARG_RX),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,190}, - - -/* 0111 1101 ssss 1ccc *** ldctl ctrl,rs */ -{ -#ifdef NICENAMES -"ldctl ctrl,rs",32,7, -0x00, -#endif -"ldctl",OPC_ldctl,0,{CLASS_CTRL,CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+7,CLASS_BIT+0xd,CLASS_REG+(ARG_RS),CLASS_1CCC,0,0,0,0,0,},2,2,191}, - - -/* 0111 1101 dddd 0ccc *** ldctl rd,ctrl */ -{ -#ifdef NICENAMES -"ldctl rd,ctrl",32,7, -0x00, -#endif -"ldctl",OPC_ldctl,0,{CLASS_REG_WORD+(ARG_RD),CLASS_CTRL,}, - {CLASS_BIT+7,CLASS_BIT+0xd,CLASS_REG+(ARG_RD),CLASS_0CCC,0,0,0,0,0,},2,2,192}, - - -/* 1000 1100 ssss 1001 *** ldctlb ctrl,rbs */ -{ -#ifdef NICENAMES -"ldctlb ctrl,rbs",32,7, -0x3f, -#endif -"ldctlb",OPC_ldctlb,0,{CLASS_CTRL,CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+0xc,CLASS_REG+(ARG_RS),CLASS_BIT+9,0,0,0,0,0,},2,2,193}, - - -/* 1000 1100 dddd 0001 *** ldctlb rbd,ctrl */ -{ -#ifdef NICENAMES -"ldctlb rbd,ctrl",32,7, -0x00, -#endif -"ldctlb",OPC_ldctlb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_CTRL,}, - {CLASS_BIT+8,CLASS_BIT+0xc,CLASS_REG+(ARG_RD),CLASS_BIT+1,0,0,0,0,0,},2,2,194}, - - -/* 1011 1011 ssN0 1001 0000 rrrr ddN0 1000 *** ldd @rd,@rs,rr */ -{ -#ifdef NICENAMES -"ldd @rd,@rs,rr",16,11, -0x04, -#endif -"ldd",OPC_ldd,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,195}, - - -/* 1011 1010 ssN0 1001 0000 rrrr ddN0 1000 *** lddb @rd,@rs,rr */ -{ -#ifdef NICENAMES -"lddb @rd,@rs,rr",8,11, -0x04, -#endif -"lddb",OPC_lddb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,196}, - - -/* 1011 1011 ssN0 1001 0000 rrrr ddN0 0000 *** lddr @rd,@rs,rr */ -{ -#ifdef NICENAMES -"lddr @rd,@rs,rr",16,11, -0x04, -#endif -"lddr",OPC_lddr,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_BIT+0,0,},3,4,197}, - - -/* 1011 1010 ssN0 1001 0000 rrrr ddN0 0000 *** lddrb @rd,@rs,rr */ -{ -#ifdef NICENAMES -"lddrb @rd,@rs,rr",8,11, -0x04, -#endif -"lddrb",OPC_lddrb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_BIT+0,0,},3,4,198}, - - -/* 1011 1011 ssN0 0001 0000 rrrr ddN0 1000 *** ldi @rd,@rs,rr */ -{ -#ifdef NICENAMES -"ldi @rd,@rs,rr",16,11, -0x04, -#endif -"ldi",OPC_ldi,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,199}, - - -/* 1011 1010 ssN0 0001 0000 rrrr ddN0 1000 *** ldib @rd,@rs,rr */ -{ -#ifdef NICENAMES -"ldib @rd,@rs,rr",8,11, -0x04, -#endif -"ldib",OPC_ldib,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,200}, - - -/* 1011 1011 ssN0 0001 0000 rrrr ddN0 0000 *** ldir @rd,@rs,rr */ -{ -#ifdef NICENAMES -"ldir @rd,@rs,rr",16,11, -0x04, -#endif -"ldir",OPC_ldir,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_BIT+0,0,},3,4,201}, - - -/* 1011 1010 ssN0 0001 0000 rrrr ddN0 0000 *** ldirb @rd,@rs,rr */ -{ -#ifdef NICENAMES -"ldirb @rd,@rs,rr",8,11, -0x04, -#endif -"ldirb",OPC_ldirb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RD),CLASS_BIT+0,0,},3,4,202}, - - -/* 1011 1101 dddd imm4 *** ldk rd,imm4 */ -{ -#ifdef NICENAMES -"ldk rd,imm4",16,5, -0x00, -#endif -"ldk",OPC_ldk,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+0xb,CLASS_BIT+0xd,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,203}, - - -/* 0001 1101 ddN0 ssss *** ldl @rd,rrs */ -{ -#ifdef NICENAMES -"ldl @rd,rrs",32,11, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_IR+(ARG_RD),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),0,0,0,0,0,},2,2,204}, - - -/* 0101 1101 ddN0 ssss address_dst *** ldl address_dst(rd),rrs */ -{ -#ifdef NICENAMES -"ldl address_dst(rd),rrs",32,14, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_X+(ARG_RD),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,205}, - - -/* 0101 1101 0000 ssss address_dst *** ldl address_dst,rrs */ -{ -#ifdef NICENAMES -"ldl address_dst,rrs",32,15, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_DA+(ARG_DST),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+0xd,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,206}, - - -/* 0011 0111 ddN0 ssss imm16 *** ldl rd(imm16),rrs */ -{ -#ifdef NICENAMES -"ldl rd(imm16),rrs",32,17, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_BA+(ARG_RD),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+7,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,207}, - - -/* 0111 0111 ddN0 ssss 0000 xxxx 0000 0000 *** ldl rd(rx),rrs */ -{ -#ifdef NICENAMES -"ldl rd(rx),rrs",32,17, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_BX+(ARG_RD),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+7,CLASS_BIT+7,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_REG+(ARG_RX),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,208}, - - -/* 0001 0100 ssN0 dddd *** ldl rrd,@rs */ -{ -#ifdef NICENAMES -"ldl rrd,@rs",32,11, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+4,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,209}, - - -/* 0101 0100 0000 dddd address_src *** ldl rrd,address_src */ -{ -#ifdef NICENAMES -"ldl rrd,address_src",32,12, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+5,CLASS_BIT+4,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,210}, - - -/* 0101 0100 ssN0 dddd address_src *** ldl rrd,address_src(rs) */ -{ -#ifdef NICENAMES -"ldl rrd,address_src(rs)",32,13, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+4,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,211}, - - -/* 0001 0100 0000 dddd imm32 *** ldl rrd,imm32 */ -{ -#ifdef NICENAMES -"ldl rrd,imm32",32,11, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IMM+(ARG_IMM32),}, - {CLASS_BIT+1,CLASS_BIT+4,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM32),0,0,0,0,},2,6,212}, - - -/* 1001 0100 ssss dddd *** ldl rrd,rrs */ -{ -#ifdef NICENAMES -"ldl rrd,rrs",32,5, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+4,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,213}, - - -/* 0011 0101 ssN0 dddd imm16 *** ldl rrd,rs(imm16) */ -{ -#ifdef NICENAMES -"ldl rrd,rs(imm16)",32,17, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_BA+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+5,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,214}, - - -/* 0111 0101 ssN0 dddd 0000 xxxx 0000 0000 *** ldl rrd,rs(rx) */ -{ -#ifdef NICENAMES -"ldl rrd,rs(rx)",32,17, -0x00, -#endif -"ldl",OPC_ldl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_BX+(ARG_RS),}, - {CLASS_BIT+7,CLASS_BIT+5,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_REG+(ARG_RX),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,215}, - - -/* 0001 1100 ddN0 1001 0000 ssss 0000 nminus1 *** ldm @rd,rs,n */ -{ -#ifdef NICENAMES -"ldm @rd,rs,n",16,11, -0x00, -#endif -"ldm",OPC_ldm,0,{CLASS_IR+(ARG_RD),CLASS_REG_WORD+(ARG_RS),CLASS_IMM + (ARG_IMMN),}, - {CLASS_BIT+1,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_IMM+(ARG_IMMNMINUS1),0,},3,4,216}, - - -/* 0101 1100 ddN0 1001 0000 ssss 0000 nminus1 address_dst *** ldm address_dst(rd),rs,n */ -{ -#ifdef NICENAMES -"ldm address_dst(rd),rs,n",16,15, -0x00, -#endif -"ldm",OPC_ldm,0,{CLASS_X+(ARG_RD),CLASS_REG_WORD+(ARG_RS),CLASS_IMM + (ARG_IMMN),}, - {CLASS_BIT+5,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_IMM+(ARG_IMMNMINUS1),CLASS_ADDRESS+(ARG_DST),},3,6,217}, - - -/* 0101 1100 0000 1001 0000 ssss 0000 nminus1 address_dst *** ldm address_dst,rs,n */ -{ -#ifdef NICENAMES -"ldm address_dst,rs,n",16,14, -0x00, -#endif -"ldm",OPC_ldm,0,{CLASS_DA+(ARG_DST),CLASS_REG_WORD+(ARG_RS),CLASS_IMM + (ARG_IMMN),}, - {CLASS_BIT+5,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_IMM+(ARG_IMMNMINUS1),CLASS_ADDRESS+(ARG_DST),},3,6,218}, - - -/* 0001 1100 ssN0 0001 0000 dddd 0000 nminus1 *** ldm rd,@rs,n */ -{ -#ifdef NICENAMES -"ldm rd,@rs,n",16,11, -0x00, -#endif -"ldm",OPC_ldm,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_IMM + (ARG_IMMN),}, - {CLASS_BIT+1,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RS),CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_IMM+(ARG_IMMNMINUS1),0,},3,4,219}, - - -/* 0101 1100 ssN0 0001 0000 dddd 0000 nminus1 address_src *** ldm rd,address_src(rs),n */ -{ -#ifdef NICENAMES -"ldm rd,address_src(rs),n",16,15, -0x00, -#endif -"ldm",OPC_ldm,0,{CLASS_REG_WORD+(ARG_RD),CLASS_X+(ARG_RS),CLASS_IMM + (ARG_IMMN),}, - {CLASS_BIT+5,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RS),CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_IMM+(ARG_IMMNMINUS1),CLASS_ADDRESS+(ARG_SRC),},3,6,220}, - - -/* 0101 1100 0000 0001 0000 dddd 0000 nminus1 address_src *** ldm rd,address_src,n */ -{ -#ifdef NICENAMES -"ldm rd,address_src,n",16,14, -0x00, -#endif -"ldm",OPC_ldm,0,{CLASS_REG_WORD+(ARG_RD),CLASS_DA+(ARG_SRC),CLASS_IMM + (ARG_IMMN),}, - {CLASS_BIT+5,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_IMM+(ARG_IMMNMINUS1),CLASS_ADDRESS+(ARG_SRC),},3,6,221}, - - -/* 0011 1001 ssN0 0000 *** ldps @rs */ -{ -#ifdef NICENAMES -"ldps @rs",16,12, -0x3f, -#endif -"ldps",OPC_ldps,0,{CLASS_IR+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+9,CLASS_REGN0+(ARG_RS),CLASS_BIT+0,0,0,0,0,0,},1,2,222}, - - -/* 0111 1001 0000 0000 address_src *** ldps address_src */ -{ -#ifdef NICENAMES -"ldps address_src",16,16, -0x3f, -#endif -"ldps",OPC_ldps,0,{CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+7,CLASS_BIT+9,CLASS_BIT+0,CLASS_BIT+0,CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},1,4,223}, - - -/* 0111 1001 ssN0 0000 address_src *** ldps address_src(rs) */ -{ -#ifdef NICENAMES -"ldps address_src(rs)",16,17, -0x3f, -#endif -"ldps",OPC_ldps,0,{CLASS_X+(ARG_RS),}, - {CLASS_BIT+7,CLASS_BIT+9,CLASS_REGN0+(ARG_RS),CLASS_BIT+0,CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},1,4,224}, - - -/* 0011 0011 0000 ssss disp16 *** ldr disp16,rs */ -{ -#ifdef NICENAMES -"ldr disp16,rs",16,14, -0x00, -#endif -"ldr",OPC_ldr,0,{CLASS_DISP,CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+3,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_DISP+(ARG_DISP16),0,0,0,0,},2,4,225}, - - -/* 0011 0001 0000 dddd disp16 *** ldr rd,disp16 */ -{ -#ifdef NICENAMES -"ldr rd,disp16",16,14, -0x00, -#endif -"ldr",OPC_ldr,0,{CLASS_REG_WORD+(ARG_RD),CLASS_DISP,}, - {CLASS_BIT+3,CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_DISP+(ARG_DISP16),0,0,0,0,},2,4,226}, - - -/* 0011 0010 0000 ssss disp16 *** ldrb disp16,rbs */ -{ -#ifdef NICENAMES -"ldrb disp16,rbs",8,14, -0x00, -#endif -"ldrb",OPC_ldrb,0,{CLASS_DISP,CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_DISP+(ARG_DISP16),0,0,0,0,},2,4,227}, - - -/* 0011 0000 0000 dddd disp16 *** ldrb rbd,disp16 */ -{ -#ifdef NICENAMES -"ldrb rbd,disp16",8,14, -0x00, -#endif -"ldrb",OPC_ldrb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_DISP,}, - {CLASS_BIT+3,CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_DISP+(ARG_DISP16),0,0,0,0,},2,4,228}, - - -/* 0011 0111 0000 ssss disp16 *** ldrl disp16,rrs */ -{ -#ifdef NICENAMES -"ldrl disp16,rrs",32,17, -0x00, -#endif -"ldrl",OPC_ldrl,0,{CLASS_DISP,CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+7,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_DISP+(ARG_DISP16),0,0,0,0,},2,4,229}, - - -/* 0011 0101 0000 dddd disp16 *** ldrl rrd,disp16 */ -{ -#ifdef NICENAMES -"ldrl rrd,disp16",32,17, -0x00, -#endif -"ldrl",OPC_ldrl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_DISP,}, - {CLASS_BIT+3,CLASS_BIT+5,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_DISP+(ARG_DISP16),0,0,0,0,},2,4,230}, - - -/* 0111 1011 0000 1010 *** mbit */ -{ -#ifdef NICENAMES -"mbit",16,7, -0x38, -#endif -"mbit",OPC_mbit,0,{0}, - {CLASS_BIT+7,CLASS_BIT+0xb,CLASS_BIT+0,CLASS_BIT+0xa,0,0,0,0,0,},0,2,231}, - - -/* 0111 1011 dddd 1101 *** mreq rd */ -{ -#ifdef NICENAMES -"mreq rd",16,12, -0x18, -#endif -"mreq",OPC_mreq,0,{CLASS_REG_WORD+(ARG_RD),}, - {CLASS_BIT+7,CLASS_BIT+0xb,CLASS_REG+(ARG_RD),CLASS_BIT+0xd,0,0,0,0,0,},1,2,232}, - - -/* 0111 1011 0000 1001 *** mres */ -{ -#ifdef NICENAMES -"mres",16,5, -0x00, -#endif -"mres",OPC_mres,0,{0}, - {CLASS_BIT+7,CLASS_BIT+0xb,CLASS_BIT+0,CLASS_BIT+9,0,0,0,0,0,},0,2,233}, - - -/* 0111 1011 0000 1000 *** mset */ -{ -#ifdef NICENAMES -"mset",16,5, -0x00, -#endif -"mset",OPC_mset,0,{0}, - {CLASS_BIT+7,CLASS_BIT+0xb,CLASS_BIT+0,CLASS_BIT+8,0,0,0,0,0,},0,2,234}, - - -/* 0001 1001 ssN0 dddd *** mult rrd,@rs */ -{ -#ifdef NICENAMES -"mult rrd,@rs",16,70, -0x3c, -#endif -"mult",OPC_mult,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+9,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,235}, - - -/* 0101 1001 0000 dddd address_src *** mult rrd,address_src */ -{ -#ifdef NICENAMES -"mult rrd,address_src",16,70, -0x3c, -#endif -"mult",OPC_mult,0,{CLASS_REG_LONG+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+5,CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,236}, - - -/* 0101 1001 ssN0 dddd address_src *** mult rrd,address_src(rs) */ -{ -#ifdef NICENAMES -"mult rrd,address_src(rs)",16,70, -0x3c, -#endif -"mult",OPC_mult,0,{CLASS_REG_LONG+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+9,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,237}, - - -/* 0001 1001 0000 dddd imm16 *** mult rrd,imm16 */ -{ -#ifdef NICENAMES -"mult rrd,imm16",16,70, -0x3c, -#endif -"mult",OPC_mult,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+1,CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,238}, - - -/* 1001 1001 ssss dddd *** mult rrd,rs */ -{ -#ifdef NICENAMES -"mult rrd,rs",16,70, -0x3c, -#endif -"mult",OPC_mult,0,{CLASS_REG_LONG+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+9,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,239}, - - -/* 0001 1000 ssN0 dddd *** multl rqd,@rs */ -{ -#ifdef NICENAMES -"multl rqd,@rs",32,282, -0x3c, -#endif -"multl",OPC_multl,0,{CLASS_REG_QUAD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+8,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,240}, - - -/* 0101 1000 0000 dddd address_src *** multl rqd,address_src */ -{ -#ifdef NICENAMES -"multl rqd,address_src",32,282, -0x3c, -#endif -"multl",OPC_multl,0,{CLASS_REG_QUAD+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+5,CLASS_BIT+8,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,241}, - - -/* 0101 1000 ssN0 dddd address_src *** multl rqd,address_src(rs) */ -{ -#ifdef NICENAMES -"multl rqd,address_src(rs)",32,282, -0x3c, -#endif -"multl",OPC_multl,0,{CLASS_REG_QUAD+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+8,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,242}, - - -/* 0001 1000 0000 dddd imm32 *** multl rqd,imm32 */ -{ -#ifdef NICENAMES -"multl rqd,imm32",32,282, -0x3c, -#endif -"multl",OPC_multl,0,{CLASS_REG_QUAD+(ARG_RD),CLASS_IMM+(ARG_IMM32),}, - {CLASS_BIT+1,CLASS_BIT+8,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM32),0,0,0,0,},2,6,243}, - - -/* 1001 1000 ssss dddd *** multl rqd,rrs */ -{ -#ifdef NICENAMES -"multl rqd,rrs",32,282, -0x3c, -#endif -"multl",OPC_multl,0,{CLASS_REG_QUAD+(ARG_RD),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+8,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,244}, - - -/* 0000 1101 ddN0 0010 *** neg @rd */ -{ -#ifdef NICENAMES -"neg @rd",16,12, -0x3c, -#endif -"neg",OPC_neg,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+0,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+2,0,0,0,0,0,},1,2,245}, - - -/* 0100 1101 0000 0010 address_dst *** neg address_dst */ -{ -#ifdef NICENAMES -"neg address_dst",16,15, -0x3c, -#endif -"neg",OPC_neg,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_BIT+0,CLASS_BIT+2,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,246}, - - -/* 0100 1101 ddN0 0010 address_dst *** neg address_dst(rd) */ -{ -#ifdef NICENAMES -"neg address_dst(rd)",16,16, -0x3c, -#endif -"neg",OPC_neg,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+2,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,247}, - - -/* 1000 1101 dddd 0010 *** neg rd */ -{ -#ifdef NICENAMES -"neg rd",16,7, -0x3c, -#endif -"neg",OPC_neg,0,{CLASS_REG_WORD+(ARG_RD),}, - {CLASS_BIT+8,CLASS_BIT+0xd,CLASS_REG+(ARG_RD),CLASS_BIT+2,0,0,0,0,0,},1,2,248}, - - -/* 0000 1100 ddN0 0010 *** negb @rd */ -{ -#ifdef NICENAMES -"negb @rd",8,12, -0x3c, -#endif -"negb",OPC_negb,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+0,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+2,0,0,0,0,0,},1,2,249}, - - -/* 0100 1100 0000 0010 address_dst *** negb address_dst */ -{ -#ifdef NICENAMES -"negb address_dst",8,15, -0x3c, -#endif -"negb",OPC_negb,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_BIT+2,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,250}, - - -/* 0100 1100 ddN0 0010 address_dst *** negb address_dst(rd) */ -{ -#ifdef NICENAMES -"negb address_dst(rd)",8,16, -0x3c, -#endif -"negb",OPC_negb,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+2,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,251}, - - -/* 1000 1100 dddd 0010 *** negb rbd */ -{ -#ifdef NICENAMES -"negb rbd",8,7, -0x3c, -#endif -"negb",OPC_negb,0,{CLASS_REG_BYTE+(ARG_RD),}, - {CLASS_BIT+8,CLASS_BIT+0xc,CLASS_REG+(ARG_RD),CLASS_BIT+2,0,0,0,0,0,},1,2,252}, - - -/* 1000 1101 0000 0111 *** nop */ -{ -#ifdef NICENAMES -"nop",16,7, -0x00, -#endif -"nop",OPC_nop,0,{0}, - {CLASS_BIT+8,CLASS_BIT+0xd,CLASS_BIT+0,CLASS_BIT+7,0,0,0,0,0,},0,2,253}, - - -/* 0000 0101 ssN0 dddd *** or rd,@rs */ -{ -#ifdef NICENAMES -"or rd,@rs",16,7, -0x38, -#endif -"or",OPC_or,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+5,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,254}, - - -/* 0100 0101 0000 dddd address_src *** or rd,address_src */ -{ -#ifdef NICENAMES -"or rd,address_src",16,9, -0x38, -#endif -"or",OPC_or,0,{CLASS_REG_WORD+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+5,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,255}, - - -/* 0100 0101 ssN0 dddd address_src *** or rd,address_src(rs) */ -{ -#ifdef NICENAMES -"or rd,address_src(rs)",16,10, -0x38, -#endif -"or",OPC_or,0,{CLASS_REG_WORD+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+5,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,256}, - - -/* 0000 0101 0000 dddd imm16 *** or rd,imm16 */ -{ -#ifdef NICENAMES -"or rd,imm16",16,7, -0x38, -#endif -"or",OPC_or,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+0,CLASS_BIT+5,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,257}, - - -/* 1000 0101 ssss dddd *** or rd,rs */ -{ -#ifdef NICENAMES -"or rd,rs",16,4, -0x38, -#endif -"or",OPC_or,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+5,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,258}, - - -/* 0000 0100 ssN0 dddd *** orb rbd,@rs */ -{ -#ifdef NICENAMES -"orb rbd,@rs",8,7, -0x3c, -#endif -"orb",OPC_orb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+4,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,259}, - - -/* 0100 0100 0000 dddd address_src *** orb rbd,address_src */ -{ -#ifdef NICENAMES -"orb rbd,address_src",8,9, -0x3c, -#endif -"orb",OPC_orb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+4,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,260}, - - -/* 0100 0100 ssN0 dddd address_src *** orb rbd,address_src(rs) */ -{ -#ifdef NICENAMES -"orb rbd,address_src(rs)",8,10, -0x3c, -#endif -"orb",OPC_orb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+4,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,261}, - - -/* 0000 0100 0000 dddd imm8 imm8 *** orb rbd,imm8 */ -{ -#ifdef NICENAMES -"orb rbd,imm8",8,7, -0x3c, -#endif -"orb",OPC_orb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0,CLASS_BIT+4,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,262}, - - -/* 1000 0100 ssss dddd *** orb rbd,rbs */ -{ -#ifdef NICENAMES -"orb rbd,rbs",8,4, -0x3c, -#endif -"orb",OPC_orb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+4,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,263}, - - -/* 0011 1111 ddN0 ssss *** out @rd,rs */ -{ -#ifdef NICENAMES -"out @rd,rs",16,0, -0x04, -#endif -"out",OPC_out,0,{CLASS_IR+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+0xf,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),0,0,0,0,0,},2,2,264}, - - -/* 0011 1011 ssss 0110 imm16 *** out imm16,rs */ -{ -#ifdef NICENAMES -"out imm16,rs",16,0, -0x04, -#endif -"out",OPC_out,0,{CLASS_IMM+(ARG_IMM16),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+0xb,CLASS_REG+(ARG_RS),CLASS_BIT+6,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,265}, - - -/* 0011 1110 ddN0 ssss *** outb @rd,rbs */ -{ -#ifdef NICENAMES -"outb @rd,rbs",8,0, -0x04, -#endif -"outb",OPC_outb,0,{CLASS_IR+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+0xe,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),0,0,0,0,0,},2,2,266}, - - -/* 0011 1010 ssss 0110 imm16 *** outb imm16,rbs */ -{ -#ifdef NICENAMES -"outb imm16,rbs",8,0, -0x04, -#endif -"outb",OPC_outb,0,{CLASS_IMM+(ARG_IMM16),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REG+(ARG_RS),CLASS_BIT+6,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,267}, - - -/* 0011 1011 ssN0 1010 0000 aaaa ddN0 1000 *** outd @rd,@rs,ra */ -{ -#ifdef NICENAMES -"outd @rd,@rs,ra",16,0, -0x04, -#endif -"outd",OPC_outd,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+0xa,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,268}, - - -/* 0011 1010 ssN0 1010 0000 aaaa ddN0 1000 *** outdb @rd,@rs,rba */ -{ -#ifdef NICENAMES -"outdb @rd,@rs,rba",16,0, -0x04, -#endif -"outdb",OPC_outdb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_BYTE+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+0xa,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,269}, - - -/* 0011 1011 ssN0 0010 0000 aaaa ddN0 1000 *** outi @rd,@rs,ra */ -{ -#ifdef NICENAMES -"outi @rd,@rs,ra",16,0, -0x04, -#endif -"outi",OPC_outi,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,270}, - - -/* 0011 1010 ssN0 0010 0000 aaaa ddN0 1000 *** outib @rd,@rs,ra */ -{ -#ifdef NICENAMES -"outib @rd,@rs,ra",16,0, -0x04, -#endif -"outib",OPC_outib,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,271}, - - -/* 0011 1010 ssN0 0010 0000 aaaa ddN0 0000 *** outibr @rd,@rs,ra */ -{ -#ifdef NICENAMES -"outibr @rd,@rs,ra",16,0, -0x04, -#endif -"outibr",OPC_outibr,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+0,0,},3,4,272}, - - -/* 0001 0111 ssN0 ddN0 *** pop @rd,@rs */ -{ -#ifdef NICENAMES -"pop @rd,@rs",16,12, -0x00, -#endif -"pop",OPC_pop,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+7,CLASS_REGN0+(ARG_RS),CLASS_REGN0+(ARG_RD),0,0,0,0,0,},2,2,273}, - - -/* 0101 0111 ssN0 ddN0 address_dst *** pop address_dst(rd),@rs */ -{ -#ifdef NICENAMES -"pop address_dst(rd),@rs",16,16, -0x00, -#endif -"pop",OPC_pop,0,{CLASS_X+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+7,CLASS_REGN0+(ARG_RS),CLASS_REGN0+(ARG_RD),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,274}, - - -/* 0101 0111 ssN0 0000 address_dst *** pop address_dst,@rs */ -{ -#ifdef NICENAMES -"pop address_dst,@rs",16,16, -0x00, -#endif -"pop",OPC_pop,0,{CLASS_DA+(ARG_DST),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+7,CLASS_REGN0+(ARG_RS),CLASS_BIT+0,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,275}, - - -/* 1001 0111 ssN0 dddd *** pop rd,@rs */ -{ -#ifdef NICENAMES -"pop rd,@rs",16,8, -0x00, -#endif -"pop",OPC_pop,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+7,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,276}, - - -/* 0001 0101 ssN0 ddN0 *** popl @rd,@rs */ -{ -#ifdef NICENAMES -"popl @rd,@rs",32,19, -0x00, -#endif -"popl",OPC_popl,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+5,CLASS_REGN0+(ARG_RS),CLASS_REGN0+(ARG_RD),0,0,0,0,0,},2,2,277}, - - -/* 0101 0101 ssN0 ddN0 address_dst *** popl address_dst(rd),@rs */ -{ -#ifdef NICENAMES -"popl address_dst(rd),@rs",32,23, -0x00, -#endif -"popl",OPC_popl,0,{CLASS_X+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+5,CLASS_REGN0+(ARG_RS),CLASS_REGN0+(ARG_RD),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,278}, - - -/* 0101 0101 ssN0 0000 address_dst *** popl address_dst,@rs */ -{ -#ifdef NICENAMES -"popl address_dst,@rs",32,23, -0x00, -#endif -"popl",OPC_popl,0,{CLASS_DA+(ARG_DST),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+5,CLASS_REGN0+(ARG_RS),CLASS_BIT+0,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,279}, - - -/* 1001 0101 ssN0 dddd *** popl rrd,@rs */ -{ -#ifdef NICENAMES -"popl rrd,@rs",32,12, -0x00, -#endif -"popl",OPC_popl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+5,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,280}, - - -/* 0001 0011 ddN0 ssN0 *** push @rd,@rs */ -{ -#ifdef NICENAMES -"push @rd,@rs",16,13, -0x00, -#endif -"push",OPC_push,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+3,CLASS_REGN0+(ARG_RD),CLASS_REGN0+(ARG_RS),0,0,0,0,0,},2,2,281}, - - -/* 0101 0011 ddN0 0000 address_src *** push @rd,address_src */ -{ -#ifdef NICENAMES -"push @rd,address_src",16,14, -0x00, -#endif -"push",OPC_push,0,{CLASS_IR+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+5,CLASS_BIT+3,CLASS_REGN0+(ARG_RD),CLASS_BIT+0,CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,282}, - - -/* 0101 0011 ddN0 ssN0 address_src *** push @rd,address_src(rs) */ -{ -#ifdef NICENAMES -"push @rd,address_src(rs)",16,14, -0x00, -#endif -"push",OPC_push,0,{CLASS_IR+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+3,CLASS_REGN0+(ARG_RD),CLASS_REGN0+(ARG_RS),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,283}, - - -/* 0000 1101 ddN0 1001 imm16 *** push @rd,imm16 */ -{ -#ifdef NICENAMES -"push @rd,imm16",16,12, -0x00, -#endif -"push",OPC_push,0,{CLASS_IR+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+0,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+9,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,284}, - - -/* 1001 0011 ddN0 ssss *** push @rd,rs */ -{ -#ifdef NICENAMES -"push @rd,rs",16,9, -0x00, -#endif -"push",OPC_push,0,{CLASS_IR+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+3,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),0,0,0,0,0,},2,2,285}, - - -/* 0001 0001 ddN0 ssN0 *** pushl @rd,@rs */ -{ -#ifdef NICENAMES -"pushl @rd,@rs",32,20, -0x00, -#endif -"pushl",OPC_pushl,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+1,CLASS_REGN0+(ARG_RD),CLASS_REGN0+(ARG_RS),0,0,0,0,0,},2,2,286}, - - -/* 0101 0001 ddN0 0000 address_src *** pushl @rd,address_src */ -{ -#ifdef NICENAMES -"pushl @rd,address_src",32,21, -0x00, -#endif -"pushl",OPC_pushl,0,{CLASS_IR+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+5,CLASS_BIT+1,CLASS_REGN0+(ARG_RD),CLASS_BIT+0,CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,287}, - - -/* 0101 0001 ddN0 ssN0 address_src *** pushl @rd,address_src(rs) */ -{ -#ifdef NICENAMES -"pushl @rd,address_src(rs)",32,21, -0x00, -#endif -"pushl",OPC_pushl,0,{CLASS_IR+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+1,CLASS_REGN0+(ARG_RD),CLASS_REGN0+(ARG_RS),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,288}, - - -/* 1001 0001 ddN0 ssss *** pushl @rd,rrs */ -{ -#ifdef NICENAMES -"pushl @rd,rrs",32,12, -0x00, -#endif -"pushl",OPC_pushl,0,{CLASS_IR+(ARG_RD),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+1,CLASS_REGN0+(ARG_RD),CLASS_REG+(ARG_RS),0,0,0,0,0,},2,2,289}, - - -/* 0010 0011 ddN0 imm4 *** res @rd,imm4 */ -{ -#ifdef NICENAMES -"res @rd,imm4",16,11, -0x00, -#endif -"res",OPC_res,0,{CLASS_IR+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+2,CLASS_BIT+3,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,290}, - - -/* 0110 0011 ddN0 imm4 address_dst *** res address_dst(rd),imm4 */ -{ -#ifdef NICENAMES -"res address_dst(rd),imm4",16,14, -0x00, -#endif -"res",OPC_res,0,{CLASS_X+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+3,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,291}, - - -/* 0110 0011 0000 imm4 address_dst *** res address_dst,imm4 */ -{ -#ifdef NICENAMES -"res address_dst,imm4",16,13, -0x00, -#endif -"res",OPC_res,0,{CLASS_DA+(ARG_DST),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+3,CLASS_BIT+0,CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,292}, - - -/* 1010 0011 dddd imm4 *** res rd,imm4 */ -{ -#ifdef NICENAMES -"res rd,imm4",16,4, -0x00, -#endif -"res",OPC_res,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+0xa,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,293}, - - -/* 0010 0011 0000 ssss 0000 dddd 0000 0000 *** res rd,rs */ -{ -#ifdef NICENAMES -"res rd,rs",16,10, -0x00, -#endif -"res",OPC_res,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+3,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,294}, - - -/* 0010 0010 ddN0 imm4 *** resb @rd,imm4 */ -{ -#ifdef NICENAMES -"resb @rd,imm4",8,11, -0x00, -#endif -"resb",OPC_resb,0,{CLASS_IR+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+2,CLASS_BIT+2,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,295}, - - -/* 0110 0010 ddN0 imm4 address_dst *** resb address_dst(rd),imm4 */ -{ -#ifdef NICENAMES -"resb address_dst(rd),imm4",8,14, -0x00, -#endif -"resb",OPC_resb,0,{CLASS_X+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+2,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,296}, - - -/* 0110 0010 0000 imm4 address_dst *** resb address_dst,imm4 */ -{ -#ifdef NICENAMES -"resb address_dst,imm4",8,13, -0x00, -#endif -"resb",OPC_resb,0,{CLASS_DA+(ARG_DST),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+2,CLASS_BIT+0,CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,297}, - - -/* 1010 0010 dddd imm4 *** resb rbd,imm4 */ -{ -#ifdef NICENAMES -"resb rbd,imm4",8,4, -0x00, -#endif -"resb",OPC_resb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+0xa,CLASS_BIT+2,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,298}, - - -/* 0010 0010 0000 ssss 0000 dddd 0000 0000 *** resb rbd,rs */ -{ -#ifdef NICENAMES -"resb rbd,rs",8,10, -0x00, -#endif -"resb",OPC_resb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,299}, - - -/* 1000 1101 flags 0011 *** resflg flags */ -{ -#ifdef NICENAMES -"resflg flags",16,7, -0x3c, -#endif -"resflg",OPC_resflg,0,{CLASS_FLAGS,}, - {CLASS_BIT+8,CLASS_BIT+0xd,CLASS_FLAGS,CLASS_BIT+3,0,0,0,0,0,},1,2,300}, - - -/* 1001 1110 0000 cccc *** ret cc */ -{ -#ifdef NICENAMES -"ret cc",16,10, -0x00, -#endif -"ret",OPC_ret,0,{CLASS_CC,}, - {CLASS_BIT+9,CLASS_BIT+0xe,CLASS_BIT+0,CLASS_CC,0,0,0,0,0,},1,2,301}, - - -/* 1011 0011 dddd 00I0 *** rl rd,imm1or2 */ -{ -#ifdef NICENAMES -"rl rd,imm1or2",16,6, -0x3c, -#endif -"rl",OPC_rl,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM1OR2),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT_1OR2+0,0,0,0,0,0,},2,2,302}, - - -/* 1011 0010 dddd 00I0 *** rlb rbd,imm1or2 */ -{ -#ifdef NICENAMES -"rlb rbd,imm1or2",8,6, -0x3c, -#endif -"rlb",OPC_rlb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM1OR2),}, - {CLASS_BIT+0xb,CLASS_BIT+2,CLASS_REG+(ARG_RD),CLASS_BIT_1OR2+0,0,0,0,0,0,},2,2,303}, - - -/* 1011 0011 dddd 10I0 *** rlc rd,imm1or2 */ -{ -#ifdef NICENAMES -"rlc rd,imm1or2",16,6, -0x3c, -#endif -"rlc",OPC_rlc,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM1OR2),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT_1OR2+8,0,0,0,0,0,},2,2,304}, - - -/* 1011 0010 dddd 10I0 *** rlcb rbd,imm1or2 */ -{ -#ifdef NICENAMES -"rlcb rbd,imm1or2",8,9, -0x10, -#endif -"rlcb",OPC_rlcb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM1OR2),}, - {CLASS_BIT+0xb,CLASS_BIT+2,CLASS_REG+(ARG_RD),CLASS_BIT_1OR2+8,0,0,0,0,0,},2,2,305}, - - -/* 1011 1110 aaaa bbbb *** rldb rbb,rba */ -{ -#ifdef NICENAMES -"rldb rbb,rba",8,9, -0x10, -#endif -"rldb",OPC_rldb,0,{CLASS_REG_BYTE+(ARG_RB),CLASS_REG_BYTE+(ARG_RA),}, - {CLASS_BIT+0xb,CLASS_BIT+0xe,CLASS_REG+(ARG_RA),CLASS_REG+(ARG_RB),0,0,0,0,0,},2,2,306}, - - -/* 1011 0011 dddd 01I0 *** rr rd,imm1or2 */ -{ -#ifdef NICENAMES -"rr rd,imm1or2",16,6, -0x3c, -#endif -"rr",OPC_rr,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM1OR2),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT_1OR2+4,0,0,0,0,0,},2,2,307}, - - -/* 1011 0010 dddd 01I0 *** rrb rbd,imm1or2 */ -{ -#ifdef NICENAMES -"rrb rbd,imm1or2",8,6, -0x3c, -#endif -"rrb",OPC_rrb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM1OR2),}, - {CLASS_BIT+0xb,CLASS_BIT+2,CLASS_REG+(ARG_RD),CLASS_BIT_1OR2+4,0,0,0,0,0,},2,2,308}, - - -/* 1011 0011 dddd 11I0 *** rrc rd,imm1or2 */ -{ -#ifdef NICENAMES -"rrc rd,imm1or2",16,6, -0x3c, -#endif -"rrc",OPC_rrc,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM1OR2),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT_1OR2+0xc,0,0,0,0,0,},2,2,309}, - - -/* 1011 0010 dddd 11I0 *** rrcb rbd,imm1or2 */ -{ -#ifdef NICENAMES -"rrcb rbd,imm1or2",8,9, -0x10, -#endif -"rrcb",OPC_rrcb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM1OR2),}, - {CLASS_BIT+0xb,CLASS_BIT+2,CLASS_REG+(ARG_RD),CLASS_BIT_1OR2+0xc,0,0,0,0,0,},2,2,310}, - - -/* 1011 1100 aaaa bbbb *** rrdb rbb,rba */ -{ -#ifdef NICENAMES -"rrdb rbb,rba",8,9, -0x10, -#endif -"rrdb",OPC_rrdb,0,{CLASS_REG_BYTE+(ARG_RB),CLASS_REG_BYTE+(ARG_RA),}, - {CLASS_BIT+0xb,CLASS_BIT+0xc,CLASS_REG+(ARG_RA),CLASS_REG+(ARG_RB),0,0,0,0,0,},2,2,311}, - - -/* 0011 0110 imm8 *** rsvd36 */ -{ -#ifdef NICENAMES -"rsvd36",8,10, -0x00, -#endif -"rsvd36",OPC_rsvd36,0,{0}, - {CLASS_BIT+3,CLASS_BIT+6,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},0,2,312}, - - -/* 0011 1000 imm8 *** rsvd38 */ -{ -#ifdef NICENAMES -"rsvd38",8,10, -0x00, -#endif -"rsvd38",OPC_rsvd38,0,{0}, - {CLASS_BIT+3,CLASS_BIT+8,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},0,2,313}, - - -/* 0111 1000 imm8 *** rsvd78 */ -{ -#ifdef NICENAMES -"rsvd78",8,10, -0x00, -#endif -"rsvd78",OPC_rsvd78,0,{0}, - {CLASS_BIT+7,CLASS_BIT+8,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},0,2,314}, - - -/* 0111 1110 imm8 *** rsvd7e */ -{ -#ifdef NICENAMES -"rsvd7e",8,10, -0x00, -#endif -"rsvd7e",OPC_rsvd7e,0,{0}, - {CLASS_BIT+7,CLASS_BIT+0xe,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},0,2,315}, - - -/* 1001 1101 imm8 *** rsvd9d */ -{ -#ifdef NICENAMES -"rsvd9d",8,10, -0x00, -#endif -"rsvd9d",OPC_rsvd9d,0,{0}, - {CLASS_BIT+9,CLASS_BIT+0xd,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},0,2,316}, - - -/* 1001 1111 imm8 *** rsvd9f */ -{ -#ifdef NICENAMES -"rsvd9f",8,10, -0x00, -#endif -"rsvd9f",OPC_rsvd9f,0,{0}, - {CLASS_BIT+9,CLASS_BIT+0xf,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},0,2,317}, - - -/* 1011 1001 imm8 *** rsvdb9 */ -{ -#ifdef NICENAMES -"rsvdb9",8,10, -0x00, -#endif -"rsvdb9",OPC_rsvdb9,0,{0}, - {CLASS_BIT+0xb,CLASS_BIT+9,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},0,2,318}, - - -/* 1011 1111 imm8 *** rsvdbf */ -{ -#ifdef NICENAMES -"rsvdbf",8,10, -0x00, -#endif -"rsvdbf",OPC_rsvdbf,0,{0}, - {CLASS_BIT+0xb,CLASS_BIT+0xf,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},0,2,319}, - - -/* 1011 0111 ssss dddd *** sbc rd,rs */ -{ -#ifdef NICENAMES -"sbc rd,rs",16,5, -0x3c, -#endif -"sbc",OPC_sbc,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+0xb,CLASS_BIT+7,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,320}, - - -/* 1011 0110 ssss dddd *** sbcb rbd,rbs */ -{ -#ifdef NICENAMES -"sbcb rbd,rbs",8,5, -0x3f, -#endif -"sbcb",OPC_sbcb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+0xb,CLASS_BIT+6,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,321}, - - -/* 0111 1111 imm8 *** sc imm8 */ -{ -#ifdef NICENAMES -"sc imm8",8,33, -0x3f, -#endif -"sc",OPC_sc,0,{CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+7,CLASS_BIT+0xf,CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},1,2,322}, - - -/* 1011 0011 dddd 1011 0000 ssss 0000 0000 *** sda rd,rs */ -{ -#ifdef NICENAMES -"sda rd,rs",16,15, -0x3c, -#endif -"sda",OPC_sda,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+0xb,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,323}, - - -/* 1011 0010 dddd 1011 0000 ssss 0000 0000 *** sdab rbd,rs */ -{ -#ifdef NICENAMES -"sdab rbd,rs",8,15, -0x3c, -#endif -"sdab",OPC_sdab,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+0xb,CLASS_BIT+2,CLASS_REG+(ARG_RD),CLASS_BIT+0xb,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,324}, - - -/* 1011 0011 dddd 1111 0000 ssss 0000 0000 *** sdal rrd,rs */ -{ -#ifdef NICENAMES -"sdal rrd,rs",32,15, -0x3c, -#endif -"sdal",OPC_sdal,0,{CLASS_REG_LONG+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+0xf,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,325}, - - -/* 1011 0011 dddd 0011 0000 ssss 0000 0000 *** sdl rd,rs */ -{ -#ifdef NICENAMES -"sdl rd,rs",16,15, -0x38, -#endif -"sdl",OPC_sdl,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+3,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,326}, - - -/* 1011 0010 dddd 0011 0000 ssss 0000 0000 *** sdlb rbd,rs */ -{ -#ifdef NICENAMES -"sdlb rbd,rs",8,15, -0x38, -#endif -"sdlb",OPC_sdlb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+0xb,CLASS_BIT+2,CLASS_REG+(ARG_RD),CLASS_BIT+3,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,327}, - - -/* 1011 0011 dddd 0111 0000 ssss 0000 0000 *** sdll rrd,rs */ -{ -#ifdef NICENAMES -"sdll rrd,rs",32,15, -0x38, -#endif -"sdll",OPC_sdll,0,{CLASS_REG_LONG+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+7,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,328}, - - -/* 0010 0101 ddN0 imm4 *** set @rd,imm4 */ -{ -#ifdef NICENAMES -"set @rd,imm4",16,11, -0x00, -#endif -"set",OPC_set,0,{CLASS_IR+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+2,CLASS_BIT+5,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,329}, - - -/* 0110 0101 ddN0 imm4 address_dst *** set address_dst(rd),imm4 */ -{ -#ifdef NICENAMES -"set address_dst(rd),imm4",16,14, -0x00, -#endif -"set",OPC_set,0,{CLASS_X+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+5,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,330}, - - -/* 0110 0101 0000 imm4 address_dst *** set address_dst,imm4 */ -{ -#ifdef NICENAMES -"set address_dst,imm4",16,13, -0x00, -#endif -"set",OPC_set,0,{CLASS_DA+(ARG_DST),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+5,CLASS_BIT+0,CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,331}, - - -/* 1010 0101 dddd imm4 *** set rd,imm4 */ -{ -#ifdef NICENAMES -"set rd,imm4",16,4, -0x00, -#endif -"set",OPC_set,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+0xa,CLASS_BIT+5,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,332}, - - -/* 0010 0101 0000 ssss 0000 dddd 0000 0000 *** set rd,rs */ -{ -#ifdef NICENAMES -"set rd,rs",16,10, -0x00, -#endif -"set",OPC_set,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+5,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,333}, - - -/* 0010 0100 ddN0 imm4 *** setb @rd,imm4 */ -{ -#ifdef NICENAMES -"setb @rd,imm4",8,11, -0x00, -#endif -"setb",OPC_setb,0,{CLASS_IR+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+2,CLASS_BIT+4,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,334}, - - -/* 0110 0100 ddN0 imm4 address_dst *** setb address_dst(rd),imm4 */ -{ -#ifdef NICENAMES -"setb address_dst(rd),imm4",8,14, -0x00, -#endif -"setb",OPC_setb,0,{CLASS_X+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+4,CLASS_REGN0+(ARG_RD),CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,335}, - - -/* 0110 0100 0000 imm4 address_dst *** setb address_dst,imm4 */ -{ -#ifdef NICENAMES -"setb address_dst,imm4",8,13, -0x00, -#endif -"setb",OPC_setb,0,{CLASS_DA+(ARG_DST),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+6,CLASS_BIT+4,CLASS_BIT+0,CLASS_IMM+(ARG_IMM4),CLASS_ADDRESS+(ARG_DST),0,0,0,0,},2,4,336}, - - -/* 1010 0100 dddd imm4 *** setb rbd,imm4 */ -{ -#ifdef NICENAMES -"setb rbd,imm4",8,4, -0x00, -#endif -"setb",OPC_setb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM +(ARG_IMM4),}, - {CLASS_BIT+0xa,CLASS_BIT+4,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM4),0,0,0,0,0,},2,2,337}, - - -/* 0010 0100 0000 ssss 0000 dddd 0000 0000 *** setb rbd,rs */ -{ -#ifdef NICENAMES -"setb rbd,rs",8,10, -0x00, -#endif -"setb",OPC_setb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+2,CLASS_BIT+4,CLASS_BIT+0,CLASS_REG+(ARG_RS),CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_BIT+0,CLASS_BIT+0,0,},2,4,338}, - - -/* 1000 1101 flags 0001 *** setflg flags */ -{ -#ifdef NICENAMES -"setflg flags",16,7, -0x3c, -#endif -"setflg",OPC_setflg,0,{CLASS_FLAGS,}, - {CLASS_BIT+8,CLASS_BIT+0xd,CLASS_FLAGS,CLASS_BIT+1,0,0,0,0,0,},1,2,339}, - - -/* 0011 1011 dddd 0101 imm16 *** sin rd,imm16 */ -{ -#ifdef NICENAMES -"sin rd,imm16",8,0, -0x00, -#endif -"sin",OPC_sin,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+3,CLASS_BIT+0xb,CLASS_REG+(ARG_RD),CLASS_BIT+5,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,340}, - - -/* 0011 1010 dddd 0101 imm16 *** sinb rbd,imm16 */ -{ -#ifdef NICENAMES -"sinb rbd,imm16",8,0, -0x00, -#endif -"sinb",OPC_sinb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REG+(ARG_RD),CLASS_BIT+5,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,341}, - - -/* 0011 1011 ssN0 1000 0001 aaaa ddN0 1000 *** sind @rd,@rs,ra */ -{ -#ifdef NICENAMES -"sind @rd,@rs,ra",16,0, -0x00, -#endif -"sind",OPC_sind,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+8,CLASS_BIT+1,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,342}, - - -/* 0011 1010 ssN0 1000 0001 aaaa ddN0 1000 *** sindb @rd,@rs,rba */ -{ -#ifdef NICENAMES -"sindb @rd,@rs,rba",8,0, -0x00, -#endif -"sindb",OPC_sindb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_BYTE+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+8,CLASS_BIT+1,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,343}, - - -/* 0011 1010 ssN0 0001 0000 aaaa ddN0 1000 *** sinib @rd,@rs,ra */ -{ -#ifdef NICENAMES -"sinib @rd,@rs,ra",8,0, -0x00, -#endif -"sinib",OPC_sinib,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,344}, - - -/* 0011 1010 ssN0 0001 0000 aaaa ddN0 0000 *** sinibr @rd,@rs,ra */ -{ -#ifdef NICENAMES -"sinibr @rd,@rs,ra",16,0, -0x00, -#endif -"sinibr",OPC_sinibr,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+1,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+0,0,},3,4,345}, - - -/* 1011 0011 dddd 1001 0000 0000 imm8 *** sla rd,imm8 */ -{ -#ifdef NICENAMES -"sla rd,imm8",16,13, -0x3c, -#endif -"sla",OPC_sla,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+9,CLASS_BIT+0,CLASS_BIT+0,CLASS_IMM+(ARG_IMM8),0,0,},2,4,346}, - - -/* 1011 0010 dddd 1001 0000 0000 imm8 *** slab rbd,imm8 */ -{ -#ifdef NICENAMES -"slab rbd,imm8",8,13, -0x3c, -#endif -"slab",OPC_slab,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+2,CLASS_REG+(ARG_RD),CLASS_BIT+9,CLASS_BIT+0,CLASS_BIT+0,CLASS_IMM+(ARG_IMM8),0,0,},2,4,347}, - - -/* 1011 0011 dddd 1101 0000 0000 imm8 *** slal rrd,imm8 */ -{ -#ifdef NICENAMES -"slal rrd,imm8",32,13, -0x3c, -#endif -"slal",OPC_slal,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+0xd,CLASS_BIT+0,CLASS_BIT+0,CLASS_IMM+(ARG_IMM8),0,0,},2,4,348}, - - -/* 1011 0011 dddd 0001 0000 0000 imm8 *** sll rd,imm8 */ -{ -#ifdef NICENAMES -"sll rd,imm8",16,13, -0x38, -#endif -"sll",OPC_sll,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+1,CLASS_BIT+0,CLASS_BIT+0,CLASS_IMM+(ARG_IMM8),0,0,},2,4,349}, - - -/* 1011 0010 dddd 0001 0000 0000 imm8 *** sllb rbd,imm8 */ -{ -#ifdef NICENAMES -"sllb rbd,imm8",8,13, -0x38, -#endif -"sllb",OPC_sllb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+2,CLASS_REG+(ARG_RD),CLASS_BIT+1,CLASS_BIT+0,CLASS_BIT+0,CLASS_IMM+(ARG_IMM8),0,0,},2,4,350}, - - -/* 1011 0011 dddd 0101 0000 0000 imm8 *** slll rrd,imm8 */ -{ -#ifdef NICENAMES -"slll rrd,imm8",32,13, -0x38, -#endif -"slll",OPC_slll,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+5,CLASS_BIT+0,CLASS_BIT+0,CLASS_IMM+(ARG_IMM8),0,0,},2,4,351}, - - -/* 0011 1011 ssss 0111 imm16 *** sout imm16,rs */ -{ -#ifdef NICENAMES -"sout imm16,rs",16,0, -0x00, -#endif -"sout",OPC_sout,0,{CLASS_IMM+(ARG_IMM16),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+0xb,CLASS_REG+(ARG_RS),CLASS_BIT+7,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,352}, - - -/* 0011 1010 ssss 0111 imm16 *** soutb imm16,rbs */ -{ -#ifdef NICENAMES -"soutb imm16,rbs",8,0, -0x00, -#endif -"soutb",OPC_soutb,0,{CLASS_IMM+(ARG_IMM16),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REG+(ARG_RS),CLASS_BIT+7,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,353}, - - -/* 0011 1011 ssN0 1011 0000 aaaa ddN0 1000 *** soutd @rd,@rs,ra */ -{ -#ifdef NICENAMES -"soutd @rd,@rs,ra",16,0, -0x00, -#endif -"soutd",OPC_soutd,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xb,CLASS_REGN0+(ARG_RS),CLASS_BIT+0xb,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,354}, - - -/* 0011 1010 ssN0 1011 0000 aaaa ddN0 1000 *** soutdb @rd,@rs,rba */ -{ -#ifdef NICENAMES -"soutdb @rd,@rs,rba",8,0, -0x00, -#endif -"soutdb",OPC_soutdb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_BYTE+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+0xb,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,355}, - - -/* 0011 1010 ssN0 0011 0000 aaaa ddN0 1000 *** soutib @rd,@rs,ra */ -{ -#ifdef NICENAMES -"soutib @rd,@rs,ra",8,0, -0x00, -#endif -"soutib",OPC_soutib,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+3,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,},3,4,356}, - - -/* 0011 1010 ssN0 0011 0000 aaaa ddN0 0000 *** soutibr @rd,@rs,ra */ -{ -#ifdef NICENAMES -"soutibr @rd,@rs,ra",16,0, -0x00, -#endif -"soutibr",OPC_soutibr,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_WORD+(ARG_RA),}, - {CLASS_BIT+3,CLASS_BIT+0xa,CLASS_REGN0+(ARG_RS),CLASS_BIT+3,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RD),CLASS_BIT+0,0,},3,4,357}, - - -/* 1011 0011 dddd 1001 1111 1111 nim8 *** sra rd,imm8 */ -{ -#ifdef NICENAMES -"sra rd,imm8",16,13, -0x3c, -#endif -"sra",OPC_sra,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+9,CLASS_BIT+0xf,CLASS_BIT+0xf,CLASS_IMM+(ARG_NIM8),0,0,},2,4,358}, - - -/* 1011 0010 dddd 1001 0000 0000 nim8 *** srab rbd,imm8 */ -{ -#ifdef NICENAMES -"srab rbd,imm8",8,13, -0x3c, -#endif -"srab",OPC_srab,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+2,CLASS_REG+(ARG_RD),CLASS_BIT+9,CLASS_BIT+0,CLASS_BIT+0,CLASS_IMM+(ARG_NIM8),0,0,},2,4,359}, - - -/* 1011 0011 dddd 1101 1111 1111 nim8 *** sral rrd,imm8 */ -{ -#ifdef NICENAMES -"sral rrd,imm8",32,13, -0x3c, -#endif -"sral",OPC_sral,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+0xd,CLASS_BIT+0xf,CLASS_BIT+0xf,CLASS_IMM+(ARG_NIM8),0,0,},2,4,360}, - - -/* 1011 0011 dddd 0001 1111 1111 nim8 *** srl rd,imm8 */ -{ -#ifdef NICENAMES -"srl rd,imm8",16,13, -0x3c, -#endif -"srl",OPC_srl,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+1,CLASS_BIT+0xf,CLASS_BIT+0xf,CLASS_IMM+(ARG_NIM8),0,0,},2,4,361}, - - -/* 1011 0010 dddd 0001 0000 0000 nim8 *** srlb rbd,imm8 */ -{ -#ifdef NICENAMES -"srlb rbd,imm8",8,13, -0x3c, -#endif -"srlb",OPC_srlb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+2,CLASS_REG+(ARG_RD),CLASS_BIT+1,CLASS_BIT+0,CLASS_BIT+0,CLASS_IMM+(ARG_NIM8),0,0,},2,4,362}, - - -/* 1011 0011 dddd 0101 1111 1111 nim8 *** srll rrd,imm8 */ -{ -#ifdef NICENAMES -"srll rrd,imm8",32,13, -0x3c, -#endif -"srll",OPC_srll,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0xb,CLASS_BIT+3,CLASS_REG+(ARG_RD),CLASS_BIT+5,CLASS_BIT+0xf,CLASS_BIT+0xf,CLASS_IMM+(ARG_NIM8),0,0,},2,4,363}, - - -/* 0000 0011 ssN0 dddd *** sub rd,@rs */ -{ -#ifdef NICENAMES -"sub rd,@rs",16,7, -0x3c, -#endif -"sub",OPC_sub,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+3,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,364}, - - -/* 0100 0011 0000 dddd address_src *** sub rd,address_src */ -{ -#ifdef NICENAMES -"sub rd,address_src",16,9, -0x3c, -#endif -"sub",OPC_sub,0,{CLASS_REG_WORD+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+3,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,365}, - - -/* 0100 0011 ssN0 dddd address_src *** sub rd,address_src(rs) */ -{ -#ifdef NICENAMES -"sub rd,address_src(rs)",16,10, -0x3c, -#endif -"sub",OPC_sub,0,{CLASS_REG_WORD+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+3,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,366}, - - -/* 0000 0011 0000 dddd imm16 *** sub rd,imm16 */ -{ -#ifdef NICENAMES -"sub rd,imm16",16,7, -0x3c, -#endif -"sub",OPC_sub,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+0,CLASS_BIT+3,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,367}, - - -/* 1000 0011 ssss dddd *** sub rd,rs */ -{ -#ifdef NICENAMES -"sub rd,rs",16,4, -0x3c, -#endif -"sub",OPC_sub,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+3,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,368}, - - -/* 0000 0010 ssN0 dddd *** subb rbd,@rs */ -{ -#ifdef NICENAMES -"subb rbd,@rs",8,7, -0x3f, -#endif -"subb",OPC_subb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+2,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,369}, - - -/* 0100 0010 0000 dddd address_src *** subb rbd,address_src */ -{ -#ifdef NICENAMES -"subb rbd,address_src",8,9, -0x3f, -#endif -"subb",OPC_subb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,370}, - - -/* 0100 0010 ssN0 dddd address_src *** subb rbd,address_src(rs) */ -{ -#ifdef NICENAMES -"subb rbd,address_src(rs)",8,10, -0x3f, -#endif -"subb",OPC_subb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+2,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,371}, - - -/* 0000 0010 0000 dddd imm8 imm8 *** subb rbd,imm8 */ -{ -#ifdef NICENAMES -"subb rbd,imm8",8,7, -0x3f, -#endif -"subb",OPC_subb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0,CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,372}, - - -/* 1000 0010 ssss dddd *** subb rbd,rbs */ -{ -#ifdef NICENAMES -"subb rbd,rbs",8,4, -0x3f, -#endif -"subb",OPC_subb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+2,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,373}, - - -/* 0001 0010 ssN0 dddd *** subl rrd,@rs */ -{ -#ifdef NICENAMES -"subl rrd,@rs",32,14, -0x3c, -#endif -"subl",OPC_subl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+1,CLASS_BIT+2,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,374}, - - -/* 0101 0010 0000 dddd address_src *** subl rrd,address_src */ -{ -#ifdef NICENAMES -"subl rrd,address_src",32,15, -0x3c, -#endif -"subl",OPC_subl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+5,CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,375}, - - -/* 0101 0010 ssN0 dddd address_src *** subl rrd,address_src(rs) */ -{ -#ifdef NICENAMES -"subl rrd,address_src(rs)",32,16, -0x3c, -#endif -"subl",OPC_subl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+5,CLASS_BIT+2,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,376}, - - -/* 0001 0010 0000 dddd imm32 *** subl rrd,imm32 */ -{ -#ifdef NICENAMES -"subl rrd,imm32",32,14, -0x3c, -#endif -"subl",OPC_subl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_IMM+(ARG_IMM32),}, - {CLASS_BIT+1,CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM32),0,0,0,0,},2,6,377}, - - -/* 1001 0010 ssss dddd *** subl rrd,rrs */ -{ -#ifdef NICENAMES -"subl rrd,rrs",32,8, -0x3c, -#endif -"subl",OPC_subl,0,{CLASS_REG_LONG+(ARG_RD),CLASS_REG_LONG+(ARG_RS),}, - {CLASS_BIT+9,CLASS_BIT+2,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,378}, - - -/* 1010 1111 dddd cccc *** tcc cc,rd */ -{ -#ifdef NICENAMES -"tcc cc,rd",16,5, -0x00, -#endif -"tcc",OPC_tcc,0,{CLASS_CC,CLASS_REG_WORD+(ARG_RD),}, - {CLASS_BIT+0xa,CLASS_BIT+0xf,CLASS_REG+(ARG_RD),CLASS_CC,0,0,0,0,0,},2,2,379}, - - -/* 1010 1110 dddd cccc *** tccb cc,rbd */ -{ -#ifdef NICENAMES -"tccb cc,rbd",8,5, -0x00, -#endif -"tccb",OPC_tccb,0,{CLASS_CC,CLASS_REG_BYTE+(ARG_RD),}, - {CLASS_BIT+0xa,CLASS_BIT+0xe,CLASS_REG+(ARG_RD),CLASS_CC,0,0,0,0,0,},2,2,380}, - - -/* 0000 1101 ddN0 0100 *** test @rd */ -{ -#ifdef NICENAMES -"test @rd",16,8, -0x18, -#endif -"test",OPC_test,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+0,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+4,0,0,0,0,0,},1,2,381}, - - -/* 0100 1101 0000 0100 address_dst *** test address_dst */ -{ -#ifdef NICENAMES -"test address_dst",16,11, -0x00, -#endif -"test",OPC_test,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_BIT+0,CLASS_BIT+4,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,382}, - - -/* 0100 1101 ddN0 0100 address_dst *** test address_dst(rd) */ -{ -#ifdef NICENAMES -"test address_dst(rd)",16,12, -0x00, -#endif -"test",OPC_test,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+4,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,383}, - - -/* 1000 1101 dddd 0100 *** test rd */ -{ -#ifdef NICENAMES -"test rd",16,7, -0x00, -#endif -"test",OPC_test,0,{CLASS_REG_WORD+(ARG_RD),}, - {CLASS_BIT+8,CLASS_BIT+0xd,CLASS_REG+(ARG_RD),CLASS_BIT+4,0,0,0,0,0,},1,2,384}, - - -/* 0000 1100 ddN0 0100 *** testb @rd */ -{ -#ifdef NICENAMES -"testb @rd",8,8, -0x1c, -#endif -"testb",OPC_testb,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+0,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+4,0,0,0,0,0,},1,2,385}, - - -/* 0100 1100 0000 0100 address_dst *** testb address_dst */ -{ -#ifdef NICENAMES -"testb address_dst",8,11, -0x1c, -#endif -"testb",OPC_testb,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_BIT+4,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,386}, - - -/* 0100 1100 ddN0 0100 address_dst *** testb address_dst(rd) */ -{ -#ifdef NICENAMES -"testb address_dst(rd)",8,12, -0x1c, -#endif -"testb",OPC_testb,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+4,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,387}, - - -/* 1000 1100 dddd 0100 *** testb rbd */ -{ -#ifdef NICENAMES -"testb rbd",8,7, -0x1c, -#endif -"testb",OPC_testb,0,{CLASS_REG_BYTE+(ARG_RD),}, - {CLASS_BIT+8,CLASS_BIT+0xc,CLASS_REG+(ARG_RD),CLASS_BIT+4,0,0,0,0,0,},1,2,388}, - - -/* 0001 1100 ddN0 1000 *** testl @rd */ -{ -#ifdef NICENAMES -"testl @rd",32,13, -0x18, -#endif -"testl",OPC_testl,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+1,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+8,0,0,0,0,0,},1,2,389}, - - -/* 0101 1100 0000 1000 address_dst *** testl address_dst */ -{ -#ifdef NICENAMES -"testl address_dst",32,16, -0x18, -#endif -"testl",OPC_testl,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+5,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_BIT+8,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,390}, - - -/* 0101 1100 ddN0 1000 address_dst *** testl address_dst(rd) */ -{ -#ifdef NICENAMES -"testl address_dst(rd)",32,17, -0x18, -#endif -"testl",OPC_testl,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+5,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+8,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,391}, - - -/* 1001 1100 dddd 1000 *** testl rrd */ -{ -#ifdef NICENAMES -"testl rrd",32,13, -0x18, -#endif -"testl",OPC_testl,0,{CLASS_REG_LONG+(ARG_RD),}, - {CLASS_BIT+9,CLASS_BIT+0xc,CLASS_REG+(ARG_RD),CLASS_BIT+8,0,0,0,0,0,},1,2,392}, - - -/* 1011 1000 ddN0 1000 0000 aaaa ssN0 0000 *** trdb @rd,@rs,rba */ -{ -#ifdef NICENAMES -"trdb @rd,@rs,rba",8,25, -0x1c, -#endif -"trdb",OPC_trdb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_BYTE+(ARG_RA),}, - {CLASS_BIT+0xb,CLASS_BIT+8,CLASS_REGN0+(ARG_RD),CLASS_BIT+8,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RS),CLASS_BIT+0,0,},3,4,393}, - - -/* 1011 1000 ddN0 1100 0000 aaaa ssN0 0000 *** trdrb @rd,@rs,rba */ -{ -#ifdef NICENAMES -"trdrb @rd,@rs,rba",8,25, -0x1c, -#endif -"trdrb",OPC_trdrb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_BYTE+(ARG_RA),}, - {CLASS_BIT+0xb,CLASS_BIT+8,CLASS_REGN0+(ARG_RD),CLASS_BIT+0xc,CLASS_BIT+0,CLASS_REG+(ARG_RA),CLASS_REGN0+(ARG_RS),CLASS_BIT+0,0,},3,4,394}, - - -/* 1011 1000 ddN0 0000 0000 rrrr ssN0 0000 *** trib @rd,@rs,rbr */ -{ -#ifdef NICENAMES -"trib @rd,@rs,rbr",8,25, -0x1c, -#endif -"trib",OPC_trib,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_BYTE+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+8,CLASS_REGN0+(ARG_RD),CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RS),CLASS_BIT+0,0,},3,4,395}, - - -/* 1011 1000 ddN0 0100 0000 rrrr ssN0 0000 *** trirb @rd,@rs,rbr */ -{ -#ifdef NICENAMES -"trirb @rd,@rs,rbr",8,25, -0x1c, -#endif -"trirb",OPC_trirb,0,{CLASS_IR+(ARG_RD),CLASS_IR+(ARG_RS),CLASS_REG_BYTE+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+8,CLASS_REGN0+(ARG_RD),CLASS_BIT+4,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RS),CLASS_BIT+0,0,},3,4,396}, - - -/* 1011 1000 aaN0 1010 0000 rrrr bbN0 0000 *** trtdb @ra,@rb,rbr */ -{ -#ifdef NICENAMES -"trtdb @ra,@rb,rbr",8,25, -0x1c, -#endif -"trtdb",OPC_trtdb,0,{CLASS_IR+(ARG_RA),CLASS_IR+(ARG_RB),CLASS_REG_BYTE+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+8,CLASS_REGN0+(ARG_RA),CLASS_BIT+0xa,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RB),CLASS_BIT+0,0,},3,4,397}, - - -/* 1011 1000 aaN0 1110 0000 rrrr bbN0 1110 *** trtdrb @ra,@rb,rbr */ -{ -#ifdef NICENAMES -"trtdrb @ra,@rb,rbr",8,25, -0x1c, -#endif -"trtdrb",OPC_trtdrb,0,{CLASS_IR+(ARG_RA),CLASS_IR+(ARG_RB),CLASS_REG_BYTE+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+8,CLASS_REGN0+(ARG_RA),CLASS_BIT+0xe,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RB),CLASS_BIT+0xe,0,},3,4,398}, - - -/* 1011 1000 aaN0 0010 0000 rrrr bbN0 0000 *** trtib @ra,@rb,rbr */ -{ -#ifdef NICENAMES -"trtib @ra,@rb,rbr",8,25, -0x1c, -#endif -"trtib",OPC_trtib,0,{CLASS_IR+(ARG_RA),CLASS_IR+(ARG_RB),CLASS_REG_BYTE+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+8,CLASS_REGN0+(ARG_RA),CLASS_BIT+2,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RB),CLASS_BIT+0,0,},3,4,399}, - - -/* 1011 1000 aaN0 0110 0000 rrrr bbN0 1110 *** trtirb @ra,@rb,rbr */ -{ -#ifdef NICENAMES -"trtirb @ra,@rb,rbr",8,25, -0x1c, -#endif -"trtirb",OPC_trtirb,0,{CLASS_IR+(ARG_RA),CLASS_IR+(ARG_RB),CLASS_REG_BYTE+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+8,CLASS_REGN0+(ARG_RA),CLASS_BIT+6,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RB),CLASS_BIT+0xe,0,},3,4,400}, - - -/* 1011 1000 aaN0 1010 0000 rrrr bbN0 0000 *** trtrb @ra,@rb,rbr */ -{ -#ifdef NICENAMES -"trtrb @ra,@rb,rbr",8,25, -0x1c, -#endif -"trtrb",OPC_trtrb,0,{CLASS_IR+(ARG_RA),CLASS_IR+(ARG_RB),CLASS_REG_BYTE+(ARG_RR),}, - {CLASS_BIT+0xb,CLASS_BIT+8,CLASS_REGN0+(ARG_RA),CLASS_BIT+0xa,CLASS_BIT+0,CLASS_REG+(ARG_RR),CLASS_REGN0+(ARG_RB),CLASS_BIT+0,0,},3,4,401}, - - -/* 0000 1101 ddN0 0110 *** tset @rd */ -{ -#ifdef NICENAMES -"tset @rd",16,11, -0x08, -#endif -"tset",OPC_tset,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+0,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+6,0,0,0,0,0,},1,2,402}, - - -/* 0100 1101 0000 0110 address_dst *** tset address_dst */ -{ -#ifdef NICENAMES -"tset address_dst",16,14, -0x08, -#endif -"tset",OPC_tset,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_BIT+0,CLASS_BIT+6,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,403}, - - -/* 0100 1101 ddN0 0110 address_dst *** tset address_dst(rd) */ -{ -#ifdef NICENAMES -"tset address_dst(rd)",16,15, -0x08, -#endif -"tset",OPC_tset,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+4,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RD),CLASS_BIT+6,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,404}, - - -/* 1000 1101 dddd 0110 *** tset rd */ -{ -#ifdef NICENAMES -"tset rd",16,7, -0x08, -#endif -"tset",OPC_tset,0,{CLASS_REG_WORD+(ARG_RD),}, - {CLASS_BIT+8,CLASS_BIT+0xd,CLASS_REG+(ARG_RD),CLASS_BIT+6,0,0,0,0,0,},1,2,405}, - - -/* 0000 1100 ddN0 0110 *** tsetb @rd */ -{ -#ifdef NICENAMES -"tsetb @rd",8,11, -0x08, -#endif -"tsetb",OPC_tsetb,0,{CLASS_IR+(ARG_RD),}, - {CLASS_BIT+0,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+6,0,0,0,0,0,},1,2,406}, - - -/* 0100 1100 0000 0110 address_dst *** tsetb address_dst */ -{ -#ifdef NICENAMES -"tsetb address_dst",8,14, -0x08, -#endif -"tsetb",OPC_tsetb,0,{CLASS_DA+(ARG_DST),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_BIT+0,CLASS_BIT+6,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,407}, - - -/* 0100 1100 ddN0 0110 address_dst *** tsetb address_dst(rd) */ -{ -#ifdef NICENAMES -"tsetb address_dst(rd)",8,15, -0x08, -#endif -"tsetb",OPC_tsetb,0,{CLASS_X+(ARG_RD),}, - {CLASS_BIT+4,CLASS_BIT+0xc,CLASS_REGN0+(ARG_RD),CLASS_BIT+6,CLASS_ADDRESS+(ARG_DST),0,0,0,0,},1,4,408}, - - -/* 1000 1100 dddd 0110 *** tsetb rbd */ -{ -#ifdef NICENAMES -"tsetb rbd",8,7, -0x08, -#endif -"tsetb",OPC_tsetb,0,{CLASS_REG_BYTE+(ARG_RD),}, - {CLASS_BIT+8,CLASS_BIT+0xc,CLASS_REG+(ARG_RD),CLASS_BIT+6,0,0,0,0,0,},1,2,409}, - - -/* 0000 1001 ssN0 dddd *** xor rd,@rs */ -{ -#ifdef NICENAMES -"xor rd,@rs",16,7, -0x18, -#endif -"xor",OPC_xor,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+9,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,410}, - - -/* 0100 1001 0000 dddd address_src *** xor rd,address_src */ -{ -#ifdef NICENAMES -"xor rd,address_src",16,9, -0x18, -#endif -"xor",OPC_xor,0,{CLASS_REG_WORD+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,411}, - - -/* 0100 1001 ssN0 dddd address_src *** xor rd,address_src(rs) */ -{ -#ifdef NICENAMES -"xor rd,address_src(rs)",16,10, -0x18, -#endif -"xor",OPC_xor,0,{CLASS_REG_WORD+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+9,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,412}, - - -/* 0000 1001 0000 dddd imm16 *** xor rd,imm16 */ -{ -#ifdef NICENAMES -"xor rd,imm16",16,7, -0x18, -#endif -"xor",OPC_xor,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+0,CLASS_BIT+9,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,413}, - - -/* 1000 1001 ssss dddd *** xor rd,rs */ -{ -#ifdef NICENAMES -"xor rd,rs",16,4, -0x18, -#endif -"xor",OPC_xor,0,{CLASS_REG_WORD+(ARG_RD),CLASS_REG_WORD+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+9,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,414}, - - -/* 0000 1000 ssN0 dddd *** xorb rbd,@rs */ -{ -#ifdef NICENAMES -"xorb rbd,@rs",8,7, -0x1c, -#endif -"xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IR+(ARG_RS),}, - {CLASS_BIT+0,CLASS_BIT+8,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,415}, - - -/* 0100 1000 0000 dddd address_src *** xorb rbd,address_src */ -{ -#ifdef NICENAMES -"xorb rbd,address_src",8,9, -0x1c, -#endif -"xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_DA+(ARG_SRC),}, - {CLASS_BIT+4,CLASS_BIT+8,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,416}, - - -/* 0100 1000 ssN0 dddd address_src *** xorb rbd,address_src(rs) */ -{ -#ifdef NICENAMES -"xorb rbd,address_src(rs)",8,10, -0x1c, -#endif -"xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_X+(ARG_RS),}, - {CLASS_BIT+4,CLASS_BIT+8,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,417}, - - -/* 0000 1000 0000 dddd imm8 imm8 *** xorb rbd,imm8 */ -{ -#ifdef NICENAMES -"xorb rbd,imm8",8,7, -0x1c, -#endif -"xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),}, - {CLASS_BIT+0,CLASS_BIT+8,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,418}, - - -/* 1000 1000 ssss dddd *** xorb rbd,rbs */ -{ -#ifdef NICENAMES -"xorb rbd,rbs",8,4, -0x1c, -#endif -"xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+8,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,419}, - - -/* 1000 1000 ssss dddd *** xorb rbd,rbs */ -{ -#ifdef NICENAMES -"xorb rbd,rbs",8,4, -0x01, -#endif -"xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, - {CLASS_BIT+8,CLASS_BIT+8,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,420}, - -/* end marker */ -{ -#ifdef NICENAMES -NULL,0,0, -0, -#endif -NULL,0,0,{0,0,0,0},{0,0,0,0,0,0,0,0,0,0},0,0,0} -}; -#endif diff --git a/contrib/binutils/opcodes/z8kgen.c b/contrib/binutils/opcodes/z8kgen.c deleted file mode 100644 index f171724b7625..000000000000 --- a/contrib/binutils/opcodes/z8kgen.c +++ /dev/null @@ -1,1325 +0,0 @@ -/* - Copyright 2001 Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - 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 program generates z8k-opc.h */ - -#include <stdio.h> -#include "sysdep.h" - -#define BYTE_INFO_LEN 10 - -struct op -{ - char *flags; - int cycles; - char type; - char *bits; - char *name; - char *flavor; -}; - -#define iswhite(x) ((x) == ' ' || (x) == '\t') -struct op opt[] = -{ - "------", 10, 8, "0000 1110 imm8", "ext0e imm8", 0, - "------", 10, 8, "0000 1111 imm8", "ext0f imm8", 0, - "------", 10, 8, "1000 1110 imm8", "ext8e imm8", 0, - "------", 10, 8, "1000 1111 imm8", "ext8f imm8", 0, - - "------", 10, 8, "0011 0110 imm8", "rsvd36", 0, - "------", 10, 8, "0011 1000 imm8", "rsvd38", 0, - "------", 10, 8, "0111 1000 imm8", "rsvd78", 0, - "------", 10, 8, "0111 1110 imm8", "rsvd7e", 0, - - "------", 10, 8, "1001 1101 imm8", "rsvd9d", 0, - "------", 10, 8, "1001 1111 imm8", "rsvd9f", 0, - - "------", 10, 8, "1011 1001 imm8", "rsvdb9", 0, - "------", 10, 8, "1011 1111 imm8", "rsvdbf", 0, - - "---V--", 11, 16, "1011 1011 ssN0 1001 0000 rrrr ddN0 1000", "ldd @rd,@rs,rr", 0, - "---V--", 11, 16, "1011 1011 ssN0 1001 0000 rrrr ddN0 0000", "lddr @rd,@rs,rr", 0, - "---V--", 11, 8, "1011 1010 ssN0 1001 0000 rrrr ddN0 0000", "lddrb @rd,@rs,rr", 0, - "---V--", 11, 16, "1011 1011 ssN0 0001 0000 rrrr ddN0 0000", "ldir @rd,@rs,rr", 0, - "CZSV--", 11, 16, "1011 1011 ssN0 0000 0000 rrrr dddd cccc", "cpi rd,@rs,rr,cc", 0, - "CZSV--", 11, 16, "1011 1011 ssN0 0100 0000 rrrr dddd cccc", "cpir rd,@rs,rr,cc", 0, - "CZSV--", 11, 16, "1011 1011 ssN0 1100 0000 rrrr dddd cccc", "cpdr rd,@rs,rr,cc", 0, - "---V--", 11, 16, "1011 1011 ssN0 0001 0000 rrrr ddN0 1000", "ldi @rd,@rs,rr", 0, - "CZSV--", 11, 16, "1011 1011 ssN0 1000 0000 rrrr dddd cccc", "cpd rd,@rs,rr,cc", 0, - "---V--", 11, 8, "1011 1010 ssN0 0001 0000 rrrr ddN0 0000", "ldirb @rd,@rs,rr", 0, - "---V--", 11, 8, "1011 1010 ssN0 1001 0000 rrrr ddN0 1000", "lddb @rd,@rs,rr", 0, - "---V--", 11, 8, "1011 1010 ssN0 0001 0000 rrrr ddN0 1000", "ldib @rd,@rs,rr", 0, - "CZSV--", 11, 8, "1011 1010 ssN0 1000 0000 rrrr dddd cccc", "cpdb rbd,@rs,rr,cc", 0, - "CZSV--", 11, 8, "1011 1010 ssN0 1100 0000 rrrr dddd cccc", "cpdrb rbd,@rs,rr,cc", 0, - "CZSV--", 11, 8, "1011 1010 ssN0 0000 0000 rrrr dddd cccc", "cpib rbd,@rs,rr,cc", 0, - "CZSV--", 11, 8, "1011 1010 ssN0 0100 0000 rrrr dddd cccc", "cpirb rbd,@rs,rr,cc", 0, - "CZSV--", 11, 16, "1011 1011 ssN0 1010 0000 rrrr ddN0 cccc", "cpsd @rd,@rs,rr,cc", 0, - "CZSV--", 11, 8, "1011 1010 ssN0 1010 0000 rrrr ddN0 cccc", "cpsdb @rd,@rs,rr,cc", 0, - "CZSV--", 11, 16, "1011 1011 ssN0 1110 0000 rrrr ddN0 cccc", "cpsdr @rd,@rs,rr,cc", 0, - "CZSV--", 11, 8, "1011 1010 ssN0 1110 0000 rrrr ddN0 cccc", "cpsdrb @rd,@rs,rr,cc", 0, - "CZSV--", 11, 16, "1011 1011 ssN0 0010 0000 rrrr ddN0 cccc", "cpsi @rd,@rs,rr,cc", 0, - "CZSV--", 11, 8, "1011 1010 ssN0 0010 0000 rrrr ddN0 cccc", "cpsib @rd,@rs,rr,cc", 0, - "CZSV--", 11, 16, "1011 1011 ssN0 0110 0000 rrrr ddN0 cccc", "cpsir @rd,@rs,rr,cc", 0, - "CZSV--", 11, 8, "1011 1010 ssN0 0110 0000 rrrr ddN0 cccc", "cpsirb @rd,@rs,rr,cc", 0, - - "------", 2, 8, "0011 0110 0000 0000", "bpt", 0, - "CZSV--", 5, 16, "1011 0101 ssss dddd", "adc rd,rs", 0, - "CZSVDH", 5, 8, "1011 0100 ssss dddd", "adcb rbd,rbs", 0, - "CZSV--", 7, 16, "0000 0001 ssN0 dddd", "add rd,@rs", 0, - "CZSV--", 9, 16, "0100 0001 0000 dddd address_src", "add rd,address_src", 0, - "CZSV--", 10, 16, "0100 0001 ssN0 dddd address_src", "add rd,address_src(rs)", 0, - "CZSV--", 7, 16, "0000 0001 0000 dddd imm16", "add rd,imm16", 0, - "CZSV--", 4, 16, "1000 0001 ssss dddd", "add rd,rs", 0, - "CZSVDH", 7, 8, "0000 0000 ssN0 dddd", "addb rbd,@rs", 0, - "CZSVDH", 9, 8, "0100 0000 0000 dddd address_src", "addb rbd,address_src", 0, - "CZSVDH", 10, 8, "0100 0000 ssN0 dddd address_src", "addb rbd,address_src(rs)", 0, - "CZSVDH", 7, 8, "0000 0000 0000 dddd imm8 imm8", "addb rbd,imm8", 0, - "CZSVDH", 4, 8, "1000 0000 ssss dddd", "addb rbd,rbs", 0, - "CZSV--", 14, 32, "0001 0110 ssN0 dddd", "addl rrd,@rs", 0, - "CZSV--", 15, 32, "0101 0110 0000 dddd address_src", "addl rrd,address_src", 0, - "CZSV--", 16, 32, "0101 0110 ssN0 dddd address_src", "addl rrd,address_src(rs)", 0, - "CZSV--", 14, 32, "0001 0110 0000 dddd imm32", "addl rrd,imm32", 0, - "CZSV--", 8, 32, "1001 0110 ssss dddd", "addl rrd,rrs", 0, - - "-ZS---", 7, 16, "0000 0111 ssN0 dddd", "and rd,@rs", 0, - "-ZS---", 9, 16, "0100 0111 0000 dddd address_src", "and rd,address_src", 0, - "-ZS---", 10, 16, "0100 0111 ssN0 dddd address_src", "and rd,address_src(rs)", 0, - "-ZS---", 7, 16, "0000 0111 0000 dddd imm16", "and rd,imm16", 0, - "-ZS---", 4, 16, "1000 0111 ssss dddd", "and rd,rs", 0, - "-ZSP--", 7, 8, "0000 0110 ssN0 dddd", "andb rbd,@rs", 0, - "-ZSP--", 9, 8, "0100 0110 0000 dddd address_src", "andb rbd,address_src", 0, - "-ZSP--", 10, 8, "0100 0110 ssN0 dddd address_src", "andb rbd,address_src(rs)", 0, - "-ZSP--", 7, 8, "0000 0110 0000 dddd imm8 imm8", "andb rbd,imm8", 0, - "-ZSP--", 4, 8, "1000 0110 ssss dddd", "andb rbd,rbs", 0, - - "-Z----", 8, 16, "0010 0111 ddN0 imm4", "bit @rd,imm4", 0, - "-Z----", 11, 16, "0110 0111 ddN0 imm4 address_dst", "bit address_dst(rd),imm4", 0, - "-Z----", 10, 16, "0110 0111 0000 imm4 address_dst", "bit address_dst,imm4", 0, - "-Z----", 4, 16, "1010 0111 dddd imm4", "bit rd,imm4", 0, - "-Z----", 10, 16, "0010 0111 0000 ssss 0000 dddd 0000 0000", "bit rd,rs", 0, - - "-Z----", 8, 8, "0010 0110 ddN0 imm4", "bitb @rd,imm4", 0, - "-Z----", 11, 8, "0110 0110 ddN0 imm4 address_dst", "bitb address_dst(rd),imm4", 0, - "-Z----", 10, 8, "0110 0110 0000 imm4 address_dst", "bitb address_dst,imm4", 0, - "-Z----", 4, 8, "1010 0110 dddd imm4", "bitb rbd,imm4", 0, - "-Z----", 10, 8, "0010 0110 0000 ssss 0000 dddd 0000 0000", "bitb rbd,rs", 0, - - "------", 10, 32, "0001 1111 ddN0 0000", "call @rd", 0, - "------", 12, 32, "0101 1111 0000 0000 address_dst", "call address_dst", 0, - "------", 13, 32, "0101 1111 ddN0 0000 address_dst", "call address_dst(rd)", 0, - "------", 10, 16, "1101 disp12", "calr disp12", 0, - - "------", 8, 16, "0000 1101 ddN0 1000", "clr @rd", 0, - "------", 11, 16, "0100 1101 0000 1000 address_dst", "clr address_dst", 0, - "------", 12, 16, "0100 1101 ddN0 1000 address_dst", "clr address_dst(rd)", 0, - "------", 7, 16, "1000 1101 dddd 1000", "clr rd", 0, - "------", 8, 8, "0000 1100 ddN0 1000", "clrb @rd", 0, - "------", 11, 8, "0100 1100 0000 1000 address_dst", "clrb address_dst", 0, - "------", 12, 8, "0100 1100 ddN0 1000 address_dst", "clrb address_dst(rd)", 0, - "------", 7, 8, "1000 1100 dddd 1000", "clrb rbd", 0, - "-ZS---", 12, 16, "0000 1101 ddN0 0000", "com @rd", 0, - "-ZS---", 15, 16, "0100 1101 0000 0000 address_dst", "com address_dst", 0, - "-ZS---", 16, 16, "0100 1101 ddN0 0000 address_dst", "com address_dst(rd)", 0, - "-ZS---", 7, 16, "1000 1101 dddd 0000", "com rd", 0, - "-ZSP--", 12, 8, "0000 1100 ddN0 0000", "comb @rd", 0, - "-ZSP--", 15, 8, "0100 1100 0000 0000 address_dst", "comb address_dst", 0, - "-ZSP--", 16, 8, "0100 1100 ddN0 0000 address_dst", "comb address_dst(rd)", 0, - "-ZSP--", 7, 8, "1000 1100 dddd 0000", "comb rbd", 0, - "CZSP--", 7, 16, "1000 1101 flags 0101", "comflg flags", 0, - - "CZSV--", 11, 16, "0000 1101 ddN0 0001 imm16", "cp @rd,imm16", 0, - "CZSV--", 15, 16, "0100 1101 ddN0 0001 address_dst imm16", "cp address_dst(rd),imm16", 0, - "CZSV--", 14, 16, "0100 1101 0000 0001 address_dst imm16", "cp address_dst,imm16", 0, - - "CZSV--", 7, 16, "0000 1011 ssN0 dddd", "cp rd,@rs", 0, - "CZSV--", 9, 16, "0100 1011 0000 dddd address_src", "cp rd,address_src", 0, - "CZSV--", 10, 16, "0100 1011 ssN0 dddd address_src", "cp rd,address_src(rs)", 0, - "CZSV--", 7, 16, "0000 1011 0000 dddd imm16", "cp rd,imm16", 0, - "CZSV--", 4, 16, "1000 1011 ssss dddd", "cp rd,rs", 0, - - "CZSV--", 11, 8, "0000 1100 ddN0 0001 imm8 imm8", "cpb @rd,imm8", 0, - "CZSV--", 15, 8, "0100 1100 ddN0 0001 address_dst imm8 imm8", "cpb address_dst(rd),imm8", 0, - "CZSV--", 14, 8, "0100 1100 0000 0001 address_dst imm8 imm8", "cpb address_dst,imm8", 0, - "CZSV--", 7, 8, "0000 1010 ssN0 dddd", "cpb rbd,@rs", 0, - "CZSV--", 9, 8, "0100 1010 0000 dddd address_src", "cpb rbd,address_src", 0, - "CZSV--", 10, 8, "0100 1010 ssN0 dddd address_src", "cpb rbd,address_src(rs)", 0, - "CZSV--", 7, 8, "0000 1010 0000 dddd imm8 imm8", "cpb rbd,imm8", 0, - "CZSV--", 4, 8, "1000 1010 ssss dddd", "cpb rbd,rbs", 0, - - "CZSV--", 14, 32, "0001 0000 ssN0 dddd", "cpl rrd,@rs", 0, - "CZSV--", 15, 32, "0101 0000 0000 dddd address_src", "cpl rrd,address_src", 0, - "CZSV--", 16, 32, "0101 0000 ssN0 dddd address_src", "cpl rrd,address_src(rs)", 0, - "CZSV--", 14, 32, "0001 0000 0000 dddd imm32", "cpl rrd,imm32", 0, - "CZSV--", 8, 32, "1001 0000 ssss dddd", "cpl rrd,rrs", 0, - - "CZS---", 5, 8, "1011 0000 dddd 0000", "dab rbd", 0, - "------", 11, 16, "1111 dddd 0disp7", "dbjnz rbd,disp7", 0, - "-ZSV--", 11, 16, "0010 1011 ddN0 imm4m1", "dec @rd,imm4m1", 0, - "-ZSV--", 14, 16, "0110 1011 ddN0 imm4m1 address_dst", "dec address_dst(rd),imm4m1", 0, - "-ZSV--", 13, 16, "0110 1011 0000 imm4m1 address_dst", "dec address_dst,imm4m1", 0, - "-ZSV--", 4, 16, "1010 1011 dddd imm4m1", "dec rd,imm4m1", 0, - "-ZSV--", 11, 8, "0010 1010 ddN0 imm4m1", "decb @rd,imm4m1", 0, - "-ZSV--", 14, 8, "0110 1010 ddN0 imm4m1 address_dst", "decb address_dst(rd),imm4m1", 0, - "-ZSV--", 13, 8, "0110 1010 0000 imm4m1 address_dst", "decb address_dst,imm4m1", 0, - "-ZSV--", 4, 8, "1010 1010 dddd imm4m1", "decb rbd,imm4m1", 0, - - "------", 7, 16, "0111 1100 0000 00ii", "di i2", 0, - "CZSV--", 107, 16, "0001 1011 ssN0 dddd", "div rrd,@rs", 0, - "CZSV--", 107, 16, "0101 1011 0000 dddd address_src", "div rrd,address_src", 0, - "CZSV--", 107, 16, "0101 1011 ssN0 dddd address_src", "div rrd,address_src(rs)", 0, - "CZSV--", 107, 16, "0001 1011 0000 dddd imm16", "div rrd,imm16", 0, - "CZSV--", 107, 16, "1001 1011 ssss dddd", "div rrd,rs", 0, - "CZSV--", 744, 32, "0001 1010 ssN0 dddd", "divl rqd,@rs", 0, - "CZSV--", 745, 32, "0101 1010 0000 dddd address_src", "divl rqd,address_src", 0, - "CZSV--", 746, 32, "0101 1010 ssN0 dddd address_src", "divl rqd,address_src(rs)", 0, - "CZSV--", 744, 32, "0001 1010 0000 dddd imm32", "divl rqd,imm32", 0, - "CZSV--", 744, 32, "1001 1010 ssss dddd", "divl rqd,rrs", 0, - - "------", 11, 16, "1111 dddd 1disp7", "djnz rd,disp7", 0, - "------", 7, 16, "0111 1100 0000 01ii", "ei i2", 0, - "------", 6, 16, "1010 1101 ssss dddd", "ex rd,rs", 0, - "------", 12, 16, "0010 1101 ssN0 dddd", "ex rd,@rs", 0, - "------", 15, 16, "0110 1101 0000 dddd address_src", "ex rd,address_src", 0, - "------", 16, 16, "0110 1101 ssN0 dddd address_src", "ex rd,address_src(rs)", 0, - - "------", 12, 8, "0010 1100 ssN0 dddd", "exb rbd,@rs", 0, - "------", 15, 8, "0110 1100 0000 dddd address_src", "exb rbd,address_src", 0, - "------", 16, 8, "0110 1100 ssN0 dddd address_src", "exb rbd,address_src(rs)", 0, - "------", 6, 8, "1010 1100 ssss dddd", "exb rbd,rbs", 0, - - "------", 11, 16, "1011 0001 dddd 1010", "exts rrd", 0, - "------", 11, 8, "1011 0001 dddd 0000", "extsb rd", 0, - "------", 11, 32, "1011 0001 dddd 0111", "extsl rqd", 0, - - "------", 8, 16, "0111 1010 0000 0000", "halt", 0, - "------", 10, 16, "0011 1101 ssN0 dddd", "in rd,@rs", 0, - "------", 12, 16, "0011 1101 dddd 0100 imm16", "in rd,imm16", 0, - "------", 12, 8, "0011 1100 ssN0 dddd", "inb rbd,@rs", 0, - "------", 10, 8, "0011 1010 dddd 0100 imm16", "inb rbd,imm16", 0, - "-ZSV--", 11, 16, "0010 1001 ddN0 imm4m1", "inc @rd,imm4m1", 0, - "-ZSV--", 14, 16, "0110 1001 ddN0 imm4m1 address_dst", "inc address_dst(rd),imm4m1", 0, - "-ZSV--", 13, 16, "0110 1001 0000 imm4m1 address_dst", "inc address_dst,imm4m1", 0, - "-ZSV--", 4, 16, "1010 1001 dddd imm4m1", "inc rd,imm4m1", 0, - "-ZSV--", 11, 8, "0010 1000 ddN0 imm4m1", "incb @rd,imm4m1", 0, - "-ZSV--", 14, 8, "0110 1000 ddN0 imm4m1 address_dst", "incb address_dst(rd),imm4m1", 0, - "-ZSV--", 13, 8, "0110 1000 0000 imm4m1 address_dst", "incb address_dst,imm4m1", 0, - "-ZSV--", 4, 8, "1010 1000 dddd imm4m1", "incb rbd,imm4m1", 0, - "---V--", 21, 16, "0011 1011 ssN0 1000 0000 aaaa ddN0 1000", "ind @rd,@rs,ra", 0, - "---V--", 21, 8, "0011 1010 ssN0 1000 0000 aaaa ddN0 1000", "indb @rd,@rs,rba", 0, - "---V--", 21, 8, "0011 1010 ssN0 0000 0000 aaaa ddN0 1000", "inib @rd,@rs,ra", 0, - "---V--", 21, 16, "0011 1010 ssN0 0000 0000 aaaa ddN0 0000", "inibr @rd,@rs,ra", 0, - "CZSVDH", 13, 16, "0111 1011 0000 0000", "iret", 0, - "------", 10, 16, "0001 1110 ddN0 cccc", "jp cc,@rd", 0, - "------", 7, 16, "0101 1110 0000 cccc address_dst", "jp cc,address_dst", 0, - "------", 8, 16, "0101 1110 ddN0 cccc address_dst", "jp cc,address_dst(rd)", 0, - "------", 6, 16, "1110 cccc disp8", "jr cc,disp8", 0, - - "------", 7, 16, "0000 1101 ddN0 0101 imm16", "ld @rd,imm16", 0, - "------", 8, 16, "0010 1111 ddN0 ssss", "ld @rd,rs", 0, - "------", 15, 16, "0100 1101 ddN0 0101 address_dst imm16", "ld address_dst(rd),imm16", 0, - "------", 12, 16, "0110 1111 ddN0 ssss address_dst", "ld address_dst(rd),rs", 0, - "------", 14, 16, "0100 1101 0000 0101 address_dst imm16", "ld address_dst,imm16", 0, - "------", 11, 16, "0110 1111 0000 ssss address_dst", "ld address_dst,rs", 0, - "------", 14, 16, "0011 0011 ddN0 ssss imm16", "ld rd(imm16),rs", 0, - "------", 14, 16, "0111 0011 ddN0 ssss 0000 xxxx 0000 0000", "ld rd(rx),rs", 0, - "------", 7, 16, "0010 0001 ssN0 dddd", "ld rd,@rs", 0, - "------", 9, 16, "0110 0001 0000 dddd address_src", "ld rd,address_src", 0, - "------", 10, 16, "0110 0001 ssN0 dddd address_src", "ld rd,address_src(rs)", 0, - "------", 7, 16, "0010 0001 0000 dddd imm16", "ld rd,imm16", 0, - "------", 3, 16, "1010 0001 ssss dddd", "ld rd,rs", 0, - "------", 14, 16, "0011 0001 ssN0 dddd imm16", "ld rd,rs(imm16)", 0, - "------", 14, 16, "0111 0001 ssN0 dddd 0000 xxxx 0000 0000", "ld rd,rs(rx)", 0, - - "------", 7, 8, "0000 1100 ddN0 0101 imm8 imm8", "ldb @rd,imm8", 0, - "------", 8, 8, "0010 1110 ddN0 ssss", "ldb @rd,rbs", 0, - "------", 15, 8, "0100 1100 ddN0 0101 address_dst imm8 imm8", "ldb address_dst(rd),imm8", 0, - "------", 12, 8, "0110 1110 ddN0 ssss address_dst", "ldb address_dst(rd),rbs", 0, - "------", 14, 8, "0100 1100 0000 0101 address_dst imm8 imm8", "ldb address_dst,imm8", 0, - "------", 11, 8, "0110 1110 0000 ssss address_dst", "ldb address_dst,rbs", 0, - "------", 14, 8, "0011 0010 ddN0 ssss imm16", "ldb rd(imm16),rbs", 0, - "------", 14, 8, "0111 0010 ddN0 ssss 0000 xxxx 0000 0000", "ldb rd(rx),rbs", 0, - "------", 7, 8, "0010 0000 ssN0 dddd", "ldb rbd,@rs", 0, - "------", 9, 8, "0110 0000 0000 dddd address_src", "ldb rbd,address_src", 0, - "------", 10, 8, "0110 0000 ssN0 dddd address_src", "ldb rbd,address_src(rs)", 0, - "------", 5, 8, "1100 dddd imm8", "ldb rbd,imm8", 0, - "------", 3, 8, "1010 0000 ssss dddd", "ldb rbd,rbs", 0, - "------", 14, 8, "0011 0000 ssN0 dddd imm16", "ldb rbd,rs(imm16)", 0, - "------", 14, 8, "0111 0000 ssN0 dddd 0000 xxxx 0000 0000", "ldb rbd,rs(rx)", 0, - - "------", 11, 32, "0001 1101 ddN0 ssss", "ldl @rd,rrs", 0, - "------", 14, 32, "0101 1101 ddN0 ssss address_dst", "ldl address_dst(rd),rrs", 0, - "------", 15, 32, "0101 1101 0000 ssss address_dst", "ldl address_dst,rrs", 0, - "------", 17, 32, "0011 0111 ddN0 ssss imm16", "ldl rd(imm16),rrs", 0, - "------", 17, 32, "0111 0111 ddN0 ssss 0000 xxxx 0000 0000", "ldl rd(rx),rrs", 0, - "------", 11, 32, "0001 0100 ssN0 dddd", "ldl rrd,@rs", 0, - "------", 12, 32, "0101 0100 0000 dddd address_src", "ldl rrd,address_src", 0, - "------", 13, 32, "0101 0100 ssN0 dddd address_src", "ldl rrd,address_src(rs)", 0, - "------", 11, 32, "0001 0100 0000 dddd imm32", "ldl rrd,imm32", 0, - "------", 5, 32, "1001 0100 ssss dddd", "ldl rrd,rrs", 0, - "------", 17, 32, "0011 0101 ssN0 dddd imm16", "ldl rrd,rs(imm16)", 0, - "------", 17, 32, "0111 0101 ssN0 dddd 0000 xxxx 0000 0000", "ldl rrd,rs(rx)", 0, - - "------", 12, 16, "0111 0110 0000 dddd address_src", "lda prd,address_src", 0, - "------", 13, 16, "0111 0110 ssN0 dddd address_src", "lda prd,address_src(rs)", 0, - "------", 15, 16, "0011 0100 ssN0 dddd imm16", "lda prd,rs(imm16)", 0, - "------", 15, 16, "0111 0100 ssN0 dddd 0000 xxxx 0000 0000", "lda prd,rs(rx)", 0, - "------", 15, 16, "0011 0100 0000 dddd disp16", "ldar prd,disp16", 0, - "------", 7, 32, "0111 1101 ssss 1ccc", "ldctl ctrl,rs", 0, - "------", 7, 32, "0111 1101 dddd 0ccc", "ldctl rd,ctrl", 0, - - "------", 5, 16, "1011 1101 dddd imm4", "ldk rd,imm4", 0, - - "------", 11, 16, "0001 1100 ddN0 1001 0000 ssss 0000 nminus1", "ldm @rd,rs,n", 0, - "------", 15, 16, "0101 1100 ddN0 1001 0000 ssss 0000 nminus1 address_dst", "ldm address_dst(rd),rs,n", 0, - "------", 14, 16, "0101 1100 0000 1001 0000 ssss 0000 nminus1 address_dst", "ldm address_dst,rs,n", 0, - "------", 11, 16, "0001 1100 ssN0 0001 0000 dddd 0000 nminus1", "ldm rd,@rs,n", 0, - "------", 15, 16, "0101 1100 ssN0 0001 0000 dddd 0000 nminus1 address_src", "ldm rd,address_src(rs),n", 0, - "------", 14, 16, "0101 1100 0000 0001 0000 dddd 0000 nminus1 address_src", "ldm rd,address_src,n", 0, - - "CZSVDH", 12, 16, "0011 1001 ssN0 0000", "ldps @rs", 0, - "CZSVDH", 16, 16, "0111 1001 0000 0000 address_src", "ldps address_src", 0, - "CZSVDH", 17, 16, "0111 1001 ssN0 0000 address_src", "ldps address_src(rs)", 0, - - "------", 14, 16, "0011 0011 0000 ssss disp16", "ldr disp16,rs", 0, - "------", 14, 16, "0011 0001 0000 dddd disp16", "ldr rd,disp16", 0, - "------", 14, 8, "0011 0010 0000 ssss disp16", "ldrb disp16,rbs", 0, - "------", 14, 8, "0011 0000 0000 dddd disp16", "ldrb rbd,disp16", 0, - "------", 17, 32, "0011 0111 0000 ssss disp16", "ldrl disp16,rrs", 0, - "------", 17, 32, "0011 0101 0000 dddd disp16", "ldrl rrd,disp16", 0, - - "CZS---", 7, 16, "0111 1011 0000 1010", "mbit", 0, - "-ZS---", 12, 16, "0111 1011 dddd 1101", "mreq rd", 0, - "------", 5, 16, "0111 1011 0000 1001", "mres", 0, - "------", 5, 16, "0111 1011 0000 1000", "mset", 0, - - "CZSV--", 70, 16, "0001 1001 ssN0 dddd", "mult rrd,@rs", 0, - "CZSV--", 70, 16, "0101 1001 0000 dddd address_src", "mult rrd,address_src", 0, - "CZSV--", 70, 16, "0101 1001 ssN0 dddd address_src", "mult rrd,address_src(rs)", 0, - "CZSV--", 70, 16, "0001 1001 0000 dddd imm16", "mult rrd,imm16", 0, - "CZSV--", 70, 16, "1001 1001 ssss dddd", "mult rrd,rs", 0, - "CZSV--", 282, 32, "0001 1000 ssN0 dddd", "multl rqd,@rs", 0, - "CZSV--", 282, 32, "0101 1000 0000 dddd address_src", "multl rqd,address_src", 0, - "CZSV--", 282, 32, "0101 1000 ssN0 dddd address_src", "multl rqd,address_src(rs)", 0, - "CZSV--", 282, 32, "0001 1000 0000 dddd imm32", "multl rqd,imm32", 0, - "CZSV--", 282, 32, "1001 1000 ssss dddd", "multl rqd,rrs", 0, - "CZSV--", 12, 16, "0000 1101 ddN0 0010", "neg @rd", 0, - "CZSV--", 15, 16, "0100 1101 0000 0010 address_dst", "neg address_dst", 0, - "CZSV--", 16, 16, "0100 1101 ddN0 0010 address_dst", "neg address_dst(rd)", 0, - "CZSV--", 7, 16, "1000 1101 dddd 0010", "neg rd", 0, - "CZSV--", 12, 8, "0000 1100 ddN0 0010", "negb @rd", 0, - "CZSV--", 15, 8, "0100 1100 0000 0010 address_dst", "negb address_dst", 0, - "CZSV--", 16, 8, "0100 1100 ddN0 0010 address_dst", "negb address_dst(rd)", 0, - "CZSV--", 7, 8, "1000 1100 dddd 0010", "negb rbd", 0, - - "------", 7, 16, "1000 1101 0000 0111", "nop", 0, - - "CZS---", 7, 16, "0000 0101 ssN0 dddd", "or rd,@rs", 0, - "CZS---", 9, 16, "0100 0101 0000 dddd address_src", "or rd,address_src", 0, - "CZS---", 10, 16, "0100 0101 ssN0 dddd address_src", "or rd,address_src(rs)", 0, - "CZS---", 7, 16, "0000 0101 0000 dddd imm16", "or rd,imm16", 0, - "CZS---", 4, 16, "1000 0101 ssss dddd", "or rd,rs", 0, - - "CZSP--", 7, 8, "0000 0100 ssN0 dddd", "orb rbd,@rs", 0, - "CZSP--", 9, 8, "0100 0100 0000 dddd address_src", "orb rbd,address_src", 0, - "CZSP--", 10, 8, "0100 0100 ssN0 dddd address_src", "orb rbd,address_src(rs)", 0, - "CZSP--", 7, 8, "0000 0100 0000 dddd imm8 imm8", "orb rbd,imm8", 0, - "CZSP--", 4, 8, "1000 0100 ssss dddd", "orb rbd,rbs", 0, - - "---V--", 0, 16, "0011 1111 ddN0 ssss", "out @rd,rs", 0, - "---V--", 0, 16, "0011 1011 ssss 0110 imm16", "out imm16,rs", 0, - "---V--", 0, 8, "0011 1110 ddN0 ssss", "outb @rd,rbs", 0, - "---V--", 0, 8, "0011 1010 ssss 0110 imm16", "outb imm16,rbs", 0, - "---V--", 0, 16, "0011 1011 ssN0 1010 0000 aaaa ddN0 1000", "outd @rd,@rs,ra", 0, - "---V--", 0, 16, "0011 1010 ssN0 1010 0000 aaaa ddN0 1000", "outdb @rd,@rs,rba", 0, - "---V--", 0, 16, "0011 1011 ssN0 0010 0000 aaaa ddN0 1000", "outi @rd,@rs,ra", 0, - "---V--", 0, 16, "0011 1010 ssN0 0010 0000 aaaa ddN0 1000", "outib @rd,@rs,ra", 0, - "---V--", 0, 16, "0011 1010 ssN0 0010 0000 aaaa ddN0 0000", "outibr @rd,@rs,ra", 0, - - "------", 12, 16, "0001 0111 ssN0 ddN0", "pop @rd,@rs", 0, - "------", 16, 16, "0101 0111 ssN0 ddN0 address_dst", "pop address_dst(rd),@rs", 0, - "------", 16, 16, "0101 0111 ssN0 0000 address_dst", "pop address_dst,@rs", 0, - "------", 8, 16, "1001 0111 ssN0 dddd", "pop rd,@rs", 0, - - "------", 19, 32, "0001 0101 ssN0 ddN0", "popl @rd,@rs", 0, - "------", 23, 32, "0101 0101 ssN0 ddN0 address_dst", "popl address_dst(rd),@rs", 0, - "------", 23, 32, "0101 0101 ssN0 0000 address_dst", "popl address_dst,@rs", 0, - "------", 12, 32, "1001 0101 ssN0 dddd", "popl rrd,@rs", 0, - - "------", 13, 16, "0001 0011 ddN0 ssN0", "push @rd,@rs", 0, - "------", 14, 16, "0101 0011 ddN0 0000 address_src", "push @rd,address_src", 0, - "------", 14, 16, "0101 0011 ddN0 ssN0 address_src", "push @rd,address_src(rs)", 0, - "------", 12, 16, "0000 1101 ddN0 1001 imm16", "push @rd,imm16", 0, - "------", 9, 16, "1001 0011 ddN0 ssss", "push @rd,rs", 0, - - "------", 20, 32, "0001 0001 ddN0 ssN0", "pushl @rd,@rs", 0, - "------", 21, 32, "0101 0001 ddN0 ssN0 address_src", "pushl @rd,address_src(rs)", 0, - "------", 21, 32, "0101 0001 ddN0 0000 address_src", "pushl @rd,address_src", 0, - "------", 12, 32, "1001 0001 ddN0 ssss", "pushl @rd,rrs", 0, - - "------", 11, 16, "0010 0011 ddN0 imm4", "res @rd,imm4", 0, - "------", 14, 16, "0110 0011 ddN0 imm4 address_dst", "res address_dst(rd),imm4", 0, - "------", 13, 16, "0110 0011 0000 imm4 address_dst", "res address_dst,imm4", 0, - "------", 4, 16, "1010 0011 dddd imm4", "res rd,imm4", 0, - "------", 10, 16, "0010 0011 0000 ssss 0000 dddd 0000 0000", "res rd,rs", 0, - - "------", 11, 8, "0010 0010 ddN0 imm4", "resb @rd,imm4", 0, - "------", 14, 8, "0110 0010 ddN0 imm4 address_dst", "resb address_dst(rd),imm4", 0, - "------", 13, 8, "0110 0010 0000 imm4 address_dst", "resb address_dst,imm4", 0, - "------", 4, 8, "1010 0010 dddd imm4", "resb rbd,imm4", 0, - "------", 10, 8, "0010 0010 0000 ssss 0000 dddd 0000 0000", "resb rbd,rs", 0, - - "CZSV--", 7, 16, "1000 1101 flags 0011", "resflg flags", 0, - "------", 10, 16, "1001 1110 0000 cccc", "ret cc", 0, - - "CZSV--", 6, 16, "1011 0011 dddd 00I0", "rl rd,imm1or2", 0, - "CZSV--", 6, 8, "1011 0010 dddd 00I0", "rlb rbd,imm1or2", 0, - "CZSV--", 6, 16, "1011 0011 dddd 10I0", "rlc rd,imm1or2", 0, - - "-Z----", 9, 8, "1011 0010 dddd 10I0", "rlcb rbd,imm1or2", 0, - "-Z----", 9, 8, "1011 1110 aaaa bbbb", "rldb rbb,rba", 0, - - "CZSV--", 6, 16, "1011 0011 dddd 01I0", "rr rd,imm1or2", 0, - "CZSV--", 6, 8, "1011 0010 dddd 01I0", "rrb rbd,imm1or2", 0, - "CZSV--", 6, 16, "1011 0011 dddd 11I0", "rrc rd,imm1or2", 0, - - "-Z----", 9, 8, "1011 0010 dddd 11I0", "rrcb rbd,imm1or2", 0, - "-Z----", 9, 8, "1011 1100 aaaa bbbb", "rrdb rbb,rba", 0, - "CZSV--", 5, 16, "1011 0111 ssss dddd", "sbc rd,rs", 0, - "CZSVDH", 5, 8, "1011 0110 ssss dddd", "sbcb rbd,rbs", 0, - - "CZSVDH", 33, 8, "0111 1111 imm8", "sc imm8", 0, - - "CZSV--", 15, 16, "1011 0011 dddd 1011 0000 ssss 0000 0000", "sda rd,rs", 0, - "CZSV--", 15, 8, "1011 0010 dddd 1011 0000 ssss 0000 0000", "sdab rbd,rs", 0, - "CZSV--", 15, 32, "1011 0011 dddd 1111 0000 ssss 0000 0000", "sdal rrd,rs", 0, - - "CZS---", 15, 16, "1011 0011 dddd 0011 0000 ssss 0000 0000", "sdl rd,rs", 0, - "CZS---", 15, 8, "1011 0010 dddd 0011 0000 ssss 0000 0000", "sdlb rbd,rs", 0, - "CZS---", 15, 32, "1011 0011 dddd 0111 0000 ssss 0000 0000", "sdll rrd,rs", 0, - - "------", 11, 16, "0010 0101 ddN0 imm4", "set @rd,imm4", 0, - "------", 14, 16, "0110 0101 ddN0 imm4 address_dst", "set address_dst(rd),imm4", 0, - "------", 13, 16, "0110 0101 0000 imm4 address_dst", "set address_dst,imm4", 0, - "------", 4, 16, "1010 0101 dddd imm4", "set rd,imm4", 0, - "------", 10, 16, "0010 0101 0000 ssss 0000 dddd 0000 0000", "set rd,rs", 0, - "------", 11, 8, "0010 0100 ddN0 imm4", "setb @rd,imm4", 0, - "------", 14, 8, "0110 0100 ddN0 imm4 address_dst", "setb address_dst(rd),imm4", 0, - "------", 13, 8, "0110 0100 0000 imm4 address_dst", "setb address_dst,imm4", 0, - "------", 4, 8, "1010 0100 dddd imm4", "setb rbd,imm4", 0, - "------", 10, 8, "0010 0100 0000 ssss 0000 dddd 0000 0000", "setb rbd,rs", 0, - - "CZSV--", 7, 16, "1000 1101 flags 0001", "setflg flags", 0, - - "------", 0, 8, "0011 1010 dddd 0101 imm16", "sinb rbd,imm16", 0, - "------", 0, 8, "0011 1011 dddd 0101 imm16", "sin rd,imm16", 0, - "------", 0, 16, "0011 1011 ssN0 1000 0001 aaaa ddN0 1000", "sind @rd,@rs,ra", 0, - "------", 0, 8, "0011 1010 ssN0 1000 0001 aaaa ddN0 1000", "sindb @rd,@rs,rba", 0, - "------", 0, 8, "0011 1010 ssN0 0001 0000 aaaa ddN0 1000", "sinib @rd,@rs,ra", 0, - "------", 0, 16, "0011 1010 ssN0 0001 0000 aaaa ddN0 0000", "sinibr @rd,@rs,ra", 0, - - "CZSV--", 13, 16, "1011 0011 dddd 1001 0000 0000 imm8", "sla rd,imm8", 0, - "CZSV--", 13, 8, "1011 0010 dddd 1001 0000 0000 imm8", "slab rbd,imm8", 0, - "CZSV--", 13, 32, "1011 0011 dddd 1101 0000 0000 imm8", "slal rrd,imm8", 0, - - "CZS---", 13, 16, "1011 0011 dddd 0001 0000 0000 imm8", "sll rd,imm8", 0, - "CZS---", 13, 8, "1011 0010 dddd 0001 0000 0000 imm8", "sllb rbd,imm8", 0, - "CZS---", 13, 32, "1011 0011 dddd 0101 0000 0000 imm8", "slll rrd,imm8", 0, - - "------", 0, 16, "0011 1011 ssss 0111 imm16", "sout imm16,rs", 0, - "------", 0, 8, "0011 1010 ssss 0111 imm16", "soutb imm16,rbs", 0, - "------", 0, 16, "0011 1011 ssN0 1011 0000 aaaa ddN0 1000", "soutd @rd,@rs,ra", 0, - "------", 0, 8, "0011 1010 ssN0 1011 0000 aaaa ddN0 1000", "soutdb @rd,@rs,rba", 0, - "------", 0, 8, "0011 1010 ssN0 0011 0000 aaaa ddN0 1000", "soutib @rd,@rs,ra", 0, - "------", 0, 16, "0011 1010 ssN0 0011 0000 aaaa ddN0 0000", "soutibr @rd,@rs,ra", 0, - - "CZSV--", 13, 16, "1011 0011 dddd 1001 1111 1111 nim8", "sra rd,imm8", 0, - "CZSV--", 13, 8, "1011 0010 dddd 1001 0000 0000 nim8", "srab rbd,imm8", 0, - "CZSV--", 13, 32, "1011 0011 dddd 1101 1111 1111 nim8", "sral rrd,imm8", 0, - - "CZSV--", 13, 16, "1011 0011 dddd 0001 1111 1111 nim8", "srl rd,imm8", 0, - "CZSV--", 13, 8, "1011 0010 dddd 0001 0000 0000 nim8", "srlb rbd,imm8", 0, - "CZSV--", 13, 32, "1011 0011 dddd 0101 1111 1111 nim8", "srll rrd,imm8", 0, - - "CZSV--", 7, 16, "0000 0011 ssN0 dddd", "sub rd,@rs", 0, - "CZSV--", 9, 16, "0100 0011 0000 dddd address_src", "sub rd,address_src", 0, - "CZSV--", 10, 16, "0100 0011 ssN0 dddd address_src", "sub rd,address_src(rs)", 0, - "CZSV--", 7, 16, "0000 0011 0000 dddd imm16", "sub rd,imm16", 0, - "CZSV--", 4, 16, "1000 0011 ssss dddd", "sub rd,rs", 0, - - "CZSVDH", 7, 8, "0000 0010 ssN0 dddd", "subb rbd,@rs", 0, - "CZSVDH", 9, 8, "0100 0010 0000 dddd address_src", "subb rbd,address_src", 0, - "CZSVDH", 10, 8, "0100 0010 ssN0 dddd address_src", "subb rbd,address_src(rs)", 0, - "CZSVDH", 7, 8, "0000 0010 0000 dddd imm8 imm8", "subb rbd,imm8", 0, - "CZSVDH", 4, 8, "1000 0010 ssss dddd", "subb rbd,rbs", 0, - - "CZSV--", 14, 32, "0001 0010 ssN0 dddd", "subl rrd,@rs", 0, - "CZSV--", 15, 32, "0101 0010 0000 dddd address_src", "subl rrd,address_src", 0, - "CZSV--", 16, 32, "0101 0010 ssN0 dddd address_src", "subl rrd,address_src(rs)", 0, - "CZSV--", 14, 32, "0001 0010 0000 dddd imm32", "subl rrd,imm32", 0, - "CZSV--", 8, 32, "1001 0010 ssss dddd", "subl rrd,rrs", 0, - - "------", 5, 16, "1010 1111 dddd cccc", "tcc cc,rd", 0, - "------", 5, 8, "1010 1110 dddd cccc", "tccb cc,rbd", 0, - - "-ZS---", 8, 16, "0000 1101 ddN0 0100", "test @rd", 0, - "------", 11, 16, "0100 1101 0000 0100 address_dst", "test address_dst", 0, - "------", 12, 16, "0100 1101 ddN0 0100 address_dst", "test address_dst(rd)", 0, - "------", 7, 16, "1000 1101 dddd 0100", "test rd", 0, - - "-ZSP--", 8, 8, "0000 1100 ddN0 0100", "testb @rd", 0, - "-ZSP--", 11, 8, "0100 1100 0000 0100 address_dst", "testb address_dst", 0, - "-ZSP--", 12, 8, "0100 1100 ddN0 0100 address_dst", "testb address_dst(rd)", 0, - "-ZSP--", 7, 8, "1000 1100 dddd 0100", "testb rbd", 0, - - "-ZS---", 13, 32, "0001 1100 ddN0 1000", "testl @rd", 0, - "-ZS---", 16, 32, "0101 1100 0000 1000 address_dst", "testl address_dst", 0, - "-ZS---", 17, 32, "0101 1100 ddN0 1000 address_dst", "testl address_dst(rd)", 0, - "-ZS---", 13, 32, "1001 1100 dddd 1000", "testl rrd", 0, - - "-ZSV--", 25, 8, "1011 1000 ddN0 1000 0000 aaaa ssN0 0000", "trdb @rd,@rs,rba", 0, - "-ZSV--", 25, 8, "1011 1000 ddN0 1100 0000 aaaa ssN0 0000", "trdrb @rd,@rs,rba", 0, - "-ZSV--", 25, 8, "1011 1000 ddN0 0000 0000 rrrr ssN0 0000", "trib @rd,@rs,rbr", 0, - "-ZSV--", 25, 8, "1011 1000 ddN0 0100 0000 rrrr ssN0 0000", "trirb @rd,@rs,rbr", 0, - "-ZSV--", 25, 8, "1011 1000 aaN0 1010 0000 rrrr bbN0 0000", "trtdb @ra,@rb,rbr", 0, - "-ZSV--", 25, 8, "1011 1000 aaN0 1110 0000 rrrr bbN0 1110", "trtdrb @ra,@rb,rbr", 0, - "-ZSV--", 25, 8, "1011 1000 aaN0 0010 0000 rrrr bbN0 0000", "trtib @ra,@rb,rbr", 0, - "-ZSV--", 25, 8, "1011 1000 aaN0 0110 0000 rrrr bbN0 1110", "trtirb @ra,@rb,rbr", 0, - "-ZSV--", 25, 8, "1011 1000 aaN0 1010 0000 rrrr bbN0 0000", "trtrb @ra,@rb,rbr", 0, - - "--S---", 11, 16, "0000 1101 ddN0 0110", "tset @rd", 0, - "--S---", 14, 16, "0100 1101 0000 0110 address_dst", "tset address_dst", 0, - "--S---", 15, 16, "0100 1101 ddN0 0110 address_dst", "tset address_dst(rd)", 0, - "--S---", 7, 16, "1000 1101 dddd 0110", "tset rd", 0, - - "--S---", 11, 8, "0000 1100 ddN0 0110", "tsetb @rd", 0, - "--S---", 14, 8, "0100 1100 0000 0110 address_dst", "tsetb address_dst", 0, - "--S---", 15, 8, "0100 1100 ddN0 0110 address_dst", "tsetb address_dst(rd)", 0, - "--S---", 7, 8, "1000 1100 dddd 0110", "tsetb rbd", 0, - - "-ZS---", 7, 16, "0000 1001 ssN0 dddd", "xor rd,@rs", 0, - "-ZS---", 9, 16, "0100 1001 0000 dddd address_src", "xor rd,address_src", 0, - "-ZS---", 10, 16, "0100 1001 ssN0 dddd address_src", "xor rd,address_src(rs)", 0, - "-ZS---", 7, 16, "0000 1001 0000 dddd imm16", "xor rd,imm16", 0, - "-ZS---", 4, 16, "1000 1001 ssss dddd", "xor rd,rs", 0, - - "-ZSP--", 7, 8, "0000 1000 ssN0 dddd", "xorb rbd,@rs", 0, - "-ZSP--", 9, 8, "0100 1000 0000 dddd address_src", "xorb rbd,address_src", 0, - "-ZSP--", 10, 8, "0100 1000 ssN0 dddd address_src", "xorb rbd,address_src(rs)", 0, - "-ZSP--", 7, 8, "0000 1000 0000 dddd imm8 imm8", "xorb rbd,imm8", 0, - "-ZSP--", 4, 8, "1000 1000 ssss dddd", "xorb rbd,rbs", 0, - - "------", 7, 32, "1000 1100 dddd 0001", "ldctlb rbd,ctrl", 0, - "CZSVDH", 7, 32, "1000 1100 ssss 1001", "ldctlb ctrl,rbs", 0, - - "*", 4, 8, "1000 1000 ssss dddd", "xorb rbd,rbs", 0, - "*", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -int -count () -{ - struct op *p = opt; - int r = 0; - - while (p->name) - { - r++; - p++; - } - return r; - -} - -static -int -func (a, b) - struct op *a; - struct op *b; -{ - return strcmp ((a)->name, (b)->name); -} - - -/* opcode - - literal 0000 nnnn insert nnn into stream - operand 0001 nnnn insert operand reg nnn into stream -*/ - -struct tok_struct -{ - - char *match; - char *token; - int length; -}; - -struct tok_struct args[] = -{ - - {"address_src(rs)", "CLASS_X+(ARG_RS)",}, - {"address_dst(rd)", "CLASS_X+(ARG_RD)",}, - - {"rs(imm16)", "CLASS_BA+(ARG_RS)",}, - {"rd(imm16)", "CLASS_BA+(ARG_RD)",}, - {"prd", "CLASS_PR+(ARG_RD)",}, - {"address_src", "CLASS_DA+(ARG_SRC)",}, - {"address_dst", "CLASS_DA+(ARG_DST)",}, - {"rd(rx)", "CLASS_BX+(ARG_RD)",}, - {"rs(rx)", "CLASS_BX+(ARG_RS)",}, - - {"disp16", "CLASS_DISP",}, - {"disp12", "CLASS_DISP",}, - {"disp7", "CLASS_DISP",}, - {"disp8", "CLASS_DISP",}, - {"flags", "CLASS_FLAGS",}, - - {"imm16", "CLASS_IMM+(ARG_IMM16)",}, - {"imm1or2", "CLASS_IMM+(ARG_IMM1OR2)",}, - {"imm32", "CLASS_IMM+(ARG_IMM32)",}, - {"imm4m1", "CLASS_IMM +(ARG_IMM4M1)",}, - {"imm4", "CLASS_IMM +(ARG_IMM4)",}, - {"n", "CLASS_IMM + (ARG_IMMN)",}, - {"ctrl", "CLASS_CTRL",}, - {"rba", "CLASS_REG_BYTE+(ARG_RA)",}, - {"rbb", "CLASS_REG_BYTE+(ARG_RB)",}, - {"rbd", "CLASS_REG_BYTE+(ARG_RD)",}, - {"rbs", "CLASS_REG_BYTE+(ARG_RS)",}, - {"rbr", "CLASS_REG_BYTE+(ARG_RR)",}, - - {"rrd", "CLASS_REG_LONG+(ARG_RD)",}, - {"rrs", "CLASS_REG_LONG+(ARG_RS)",}, - - {"rqd", "CLASS_REG_QUAD+(ARG_RD)",}, - - {"rd", "CLASS_REG_WORD+(ARG_RD)",}, - {"rs", "CLASS_REG_WORD+(ARG_RS)",}, - - {"@rd", "CLASS_IR+(ARG_RD)",}, - {"@ra", "CLASS_IR+(ARG_RA)",}, - {"@rb", "CLASS_IR+(ARG_RB)",}, - {"@rs", "CLASS_IR+(ARG_RS)",}, - - {"imm8", "CLASS_IMM+(ARG_IMM8)",}, - {"i2", "CLASS_IMM+(ARG_IMM2)",}, - {"cc", "CLASS_CC",}, - - {"rr", "CLASS_REG_WORD+(ARG_RR)",}, - {"ra", "CLASS_REG_WORD+(ARG_RA)",}, - {"rs", "CLASS_REG_WORD+(ARG_RS)",}, - - {"1", "CLASS_IMM+(ARG_IMM_1)",}, - {"2", "CLASS_IMM+(ARG_IMM_2)",}, - - 0, 0 -}; - -struct tok_struct toks[] = -{ - "0000", "CLASS_BIT+0", 1, - "0001", "CLASS_BIT+1", 1, - "0010", "CLASS_BIT+2", 1, - "0011", "CLASS_BIT+3", 1, - "0100", "CLASS_BIT+4", 1, - "0101", "CLASS_BIT+5", 1, - "0110", "CLASS_BIT+6", 1, - "0111", "CLASS_BIT+7", 1, - "1000", "CLASS_BIT+8", 1, - "1001", "CLASS_BIT+9", 1, - "1010", "CLASS_BIT+0xa", 1, - "1011", "CLASS_BIT+0xb", 1, - "1100", "CLASS_BIT+0xc", 1, - "1101", "CLASS_BIT+0xd", 1, - "1110", "CLASS_BIT+0xe", 1, - "1111", "CLASS_BIT+0xf", 1, - - "00I0", "CLASS_BIT_1OR2+0", 1, - "00I0", "CLASS_BIT_1OR2+1", 1, - "00I0", "CLASS_BIT_1OR2+2", 1, - "00I0", "CLASS_BIT_1OR2+3", 1, - "01I0", "CLASS_BIT_1OR2+4", 1, - "01I0", "CLASS_BIT_1OR2+5", 1, - "01I0", "CLASS_BIT_1OR2+6", 1, - "01I0", "CLASS_BIT_1OR2+7", 1, - "10I0", "CLASS_BIT_1OR2+8", 1, - "10I0", "CLASS_BIT_1OR2+9", 1, - "10I0", "CLASS_BIT_1OR2+0xa", 1, - "10I0", "CLASS_BIT_1OR2+0xb", 1, - "11I0", "CLASS_BIT_1OR2+0xc", 1, - "11I0", "CLASS_BIT_1OR2+0xd", 1, - "11I0", "CLASS_BIT_1OR2+0xe", 1, - "11I0", "CLASS_BIT_1OR2+0xf", 1, - - "ssss", "CLASS_REG+(ARG_RS)", 1, - "dddd", "CLASS_REG+(ARG_RD)", 1, - "aaaa", "CLASS_REG+(ARG_RA)", 1, - "bbbb", "CLASS_REG+(ARG_RB)", 1, - "rrrr", "CLASS_REG+(ARG_RR)", 1, - - "ssN0", "CLASS_REGN0+(ARG_RS)", 1, - "ddN0", "CLASS_REGN0+(ARG_RD)", 1, - "aaN0", "CLASS_REGN0+(ARG_RA)", 1, - "bbN0", "CLASS_REGN0+(ARG_RB)", 1, - "rrN0", "CLASS_REGN0+(ARG_RR)", 1, - - "cccc", "CLASS_CC", 1, - "nnnn", "CLASS_IMM+(ARG_IMMN)", 1, - "xxxx", "CLASS_REG+(ARG_RX)", 1, - "xxN0", "CLASS_REGN0+(ARG_RX)", 1, - "nminus1", "CLASS_IMM+(ARG_IMMNMINUS1)", 1, - - "disp16", "CLASS_DISP+(ARG_DISP16)", 4, - "disp12", "CLASS_DISP+(ARG_DISP12)", 3, - "flags", "CLASS_FLAGS", 1, - "address_dst", "CLASS_ADDRESS+(ARG_DST)", 4, - "address_src", "CLASS_ADDRESS+(ARG_SRC)", 4, - "imm4m1", "CLASS_IMM+(ARG_IMM4M1)", 1, - "imm4", "CLASS_IMM+(ARG_IMM4)", 1, - - "imm8", "CLASS_IMM+(ARG_IMM8)", 2, - "imm16", "CLASS_IMM+(ARG_IMM16)", 4, - "imm32", "CLASS_IMM+(ARG_IMM32)", 8, - "nim8", "CLASS_IMM+(ARG_NIM8)", 2, - "0ccc", "CLASS_0CCC", 1, - "1ccc", "CLASS_1CCC", 1, - "disp8", "CLASS_DISP8", 2, - "0disp7", "CLASS_0DISP7", 2, - "1disp7", "CLASS_1DISP7", 2, - "01ii", "CLASS_01II", 1, - "00ii", "CLASS_00II", 1, - 0, 0 -}; - -char * -translate (table, x, length) - struct tok_struct *table; - char *x; - int *length; -{ - - int found; - - found = 0; - while (table->match) - { - int l = strlen (table->match); - - if (strncmp (table->match, x, l) == 0) - { - /* Got a hit */ - printf ("%s", table->token); - *length += table->length; - return x + l; - } - - table++; - } - fprintf (stderr, "Can't find %s\n", x); - printf ("**** Can't find %s\n", x); - while (*x) - x++; - return x; -} - -void -chewbits (bits, length) - char *bits; - int *length; -{ - int n = 0; - - *length = 0; - printf ("{"); - while (*bits) - { - while (*bits == ' ') - { - bits++; - } - bits = translate (toks, bits, length); - n++; - printf (","); - - } - while (n < BYTE_INFO_LEN - 1) - { - printf ("0,"); - n++; - } - printf ("}"); -} - - -static -int -chewname (name) - char *name; -{ - char *n; - int nargs = 0; - - n = name; - printf ("\""); - while (*n && !iswhite (*n)) - { - printf ("%c", *n); - n++; - } - printf ("\","); /* Scan the operands and make entires for - them -remember indirect things */ - - n = name; - printf ("OPC_"); - while (*n && !iswhite (*n)) - { - printf ("%c", *n); - n++; - } - printf (",0,{"); - - while (*n) - { - int d; - - while (*n == ',' || iswhite (*n)) - n++; - nargs++; - n = translate (args, n, &d); - printf (","); - } - if (nargs == 0) - { - printf ("0"); - } - printf ("},"); - return nargs; -} - -static -void -sub (x, c) - char *x; - char c; -{ - while (*x) - { - if (x[0] == c && x[1] == c && - x[2] == c && x[3] == c) - { - x[2] = 'N'; - x[3] = '0'; - } - x++; - } -} - - -#if 0 -#define D(x) ((x) == '1' || (x) =='0') -#define M(y) (strncmp(y,x,4)==0) -printmangled (x) - char *x; -{ - return; - while (*x) - { - if (D (x[0]) && D (x[1]) && D (x[2]) && D (x[3])) - { - printf ("XXXX"); - } - else if (M ("ssss")) - { - printf ("ssss"); - } - else if (M ("dddd")) - { - printf ("dddd"); - } - else - printf ("____"); - - x += 4; - - if (x[0] == ' ') - { - printf ("_"); - x++; - } - } - -} - -#endif -/*#define WORK_TYPE*/ -void -print_type (n) - struct op *n; -{ -#ifdef WORK_TYPE - while (*s && !iswhite (*s)) - { - l = *s; - s++; - } - switch (l) - { - case 'l': - printf ("32,"); - break; - case 'b': - printf ("8,"); - break; - default: - printf ("16,"); - break; - } -#else - printf ("%2d,", n->type); -#endif -} - - -void -internal () -{ - int c = count (); - struct op *new = (struct op *) xmalloc (sizeof (struct op) * c); - struct op *p = opt; - memcpy (new, p, c * sizeof (struct op)); - - /* sort all names in table alphabetically */ - qsort (new, c, sizeof (struct op), func); - - p = new; - while (p->flags[0] != '*') - { - /* If there are any @rs, sub the ssss into a ssn0, - (rs), (ssn0) - */ - int loop = 1; - - printf ("\"%s\",%2d, ", p->flags, p->cycles); - while (loop) - { - char *s = p->name; - - loop = 0; - while (*s) - { - if (s[0] == '@') - { - char c; - - /* skip the r and sub the string */ - s++; - c = s[1]; - sub (p->bits, c); - } - if (s[0] == '(' && s[3] == ')') - { - sub (p->bits, s[2]); - } - if (s[0] == '(') - { - sub (p->bits, s[-1]); - } - - s++; - } - - } - print_type (p); - printf ("\"%s\",\"%s\",0,\n", p->bits, p->name); - p++; - } -} - -static -void -gas () -{ - int c = count (); - struct op *p = opt; - int idx = 0; - char *oldname = ""; - struct op *new = (struct op *) xmalloc (sizeof (struct op) * c); - - memcpy (new, p, c * sizeof (struct op)); - - /* sort all names in table alphabetically */ - qsort (new, c, sizeof (struct op), func); - - printf (" /* THIS FILE IS AUTOMAGICALLY GENERATED, DON'T EDIT IT */\n"); - - printf ("#define ARG_MASK 0x0f\n"); - - printf ("#define ARG_SRC 0x01\n"); - printf ("#define ARG_DST 0x02\n"); - - printf ("#define ARG_RS 0x01\n"); - printf ("#define ARG_RD 0x02\n"); - printf ("#define ARG_RA 0x03\n"); - printf ("#define ARG_RB 0x04\n"); - printf ("#define ARG_RR 0x05\n"); - printf ("#define ARG_RX 0x06\n"); - printf ("#define ARG_IMM4 0x01\n"); - printf ("#define ARG_IMM8 0x02\n"); - printf ("#define ARG_IMM16 0x03\n"); - printf ("#define ARG_IMM32 0x04\n"); - printf ("#define ARG_IMMN 0x05\n"); - printf ("#define ARG_IMMNMINUS1 0x05\n"); - printf ("#define ARG_IMM_1 0x06\n"); - printf ("#define ARG_IMM_2 0x07\n"); - printf ("#define ARG_DISP16 0x08\n"); - printf ("#define ARG_NIM8 0x09\n"); - printf ("#define ARG_IMM2 0x0a\n"); - printf ("#define ARG_IMM1OR2 0x0b\n"); - - printf ("#define ARG_DISP12 0x0b\n"); - printf ("#define ARG_DISP8 0x0c\n"); - printf ("#define ARG_IMM4M1 0x0d\n"); - printf ("#define CLASS_MASK 0x1fff0\n"); - printf ("#define CLASS_X 0x10\n"); - printf ("#define CLASS_BA 0x20\n"); - printf ("#define CLASS_DA 0x30\n"); - printf ("#define CLASS_BX 0x40\n"); - printf ("#define CLASS_DISP 0x50\n"); - printf ("#define CLASS_IMM 0x60\n"); - printf ("#define CLASS_CC 0x70\n"); - printf ("#define CLASS_CTRL 0x80\n"); - printf ("#define CLASS_ADDRESS 0xd0\n"); - printf ("#define CLASS_0CCC 0xe0\n"); - printf ("#define CLASS_1CCC 0xf0\n"); - printf ("#define CLASS_0DISP7 0x100\n"); - printf ("#define CLASS_1DISP7 0x200\n"); - printf ("#define CLASS_01II 0x300\n"); - printf ("#define CLASS_00II 0x400\n"); - printf ("#define CLASS_BIT 0x500\n"); - printf ("#define CLASS_FLAGS 0x600\n"); - printf ("#define CLASS_IR 0x700\n"); - printf ("#define CLASS_DISP8 0x800\n"); - - printf ("#define CLASS_BIT_1OR2 0x900\n"); - printf ("#define CLASS_REG 0x7000\n"); - printf ("#define CLASS_REG_BYTE 0x2000\n"); - printf ("#define CLASS_REG_WORD 0x3000\n"); - printf ("#define CLASS_REG_QUAD 0x4000\n"); - printf ("#define CLASS_REG_LONG 0x5000\n"); - printf ("#define CLASS_REGN0 0x8000\n"); - printf ("#define CLASS_PR 0x10000\n"); - - printf ("#define OPC_adc 0\n"); - printf ("#define OPC_adcb 1\n"); - printf ("#define OPC_add 2\n"); - printf ("#define OPC_addb 3\n"); - printf ("#define OPC_addl 4\n"); - printf ("#define OPC_and 5\n"); - printf ("#define OPC_andb 6\n"); - printf ("#define OPC_bit 7\n"); - printf ("#define OPC_bitb 8\n"); - printf ("#define OPC_call 9\n"); - printf ("#define OPC_calr 10\n"); - printf ("#define OPC_clr 11\n"); - printf ("#define OPC_clrb 12\n"); - printf ("#define OPC_com 13\n"); - printf ("#define OPC_comb 14\n"); - printf ("#define OPC_comflg 15\n"); - printf ("#define OPC_cp 16\n"); - printf ("#define OPC_cpb 17\n"); - printf ("#define OPC_cpd 18\n"); - printf ("#define OPC_cpdb 19\n"); - printf ("#define OPC_cpdr 20\n"); - printf ("#define OPC_cpdrb 21\n"); - printf ("#define OPC_cpi 22\n"); - printf ("#define OPC_cpib 23\n"); - printf ("#define OPC_cpir 24\n"); - printf ("#define OPC_cpirb 25\n"); - printf ("#define OPC_cpl 26\n"); - printf ("#define OPC_cpsd 27\n"); - printf ("#define OPC_cpsdb 28\n"); - printf ("#define OPC_cpsdr 29\n"); - printf ("#define OPC_cpsdrb 30\n"); - printf ("#define OPC_cpsi 31\n"); - printf ("#define OPC_cpsib 32\n"); - printf ("#define OPC_cpsir 33\n"); - printf ("#define OPC_cpsirb 34\n"); - printf ("#define OPC_dab 35\n"); - printf ("#define OPC_dbjnz 36\n"); - printf ("#define OPC_dec 37\n"); - printf ("#define OPC_decb 38\n"); - printf ("#define OPC_di 39\n"); - printf ("#define OPC_div 40\n"); - printf ("#define OPC_divl 41\n"); - printf ("#define OPC_djnz 42\n"); - printf ("#define OPC_ei 43\n"); - printf ("#define OPC_ex 44\n"); - printf ("#define OPC_exb 45\n"); - printf ("#define OPC_exts 46\n"); - printf ("#define OPC_extsb 47\n"); - printf ("#define OPC_extsl 48\n"); - printf ("#define OPC_halt 49\n"); - printf ("#define OPC_in 50\n"); - printf ("#define OPC_inb 51\n"); - printf ("#define OPC_inc 52\n"); - printf ("#define OPC_incb 53\n"); - printf ("#define OPC_ind 54\n"); - printf ("#define OPC_indb 55\n"); - printf ("#define OPC_inib 56\n"); - printf ("#define OPC_inibr 57\n"); - printf ("#define OPC_iret 58\n"); - printf ("#define OPC_jp 59\n"); - printf ("#define OPC_jr 60\n"); - printf ("#define OPC_ld 61\n"); - printf ("#define OPC_lda 62\n"); - printf ("#define OPC_ldar 63\n"); - printf ("#define OPC_ldb 64\n"); - printf ("#define OPC_ldctl 65\n"); - printf ("#define OPC_ldir 66\n"); - printf ("#define OPC_ldirb 67\n"); - printf ("#define OPC_ldk 68\n"); - printf ("#define OPC_ldl 69\n"); - printf ("#define OPC_ldm 70\n"); - printf ("#define OPC_ldps 71\n"); - printf ("#define OPC_ldr 72\n"); - printf ("#define OPC_ldrb 73\n"); - printf ("#define OPC_ldrl 74\n"); - printf ("#define OPC_mbit 75\n"); - printf ("#define OPC_mreq 76\n"); - printf ("#define OPC_mres 77\n"); - printf ("#define OPC_mset 78\n"); - printf ("#define OPC_mult 79\n"); - printf ("#define OPC_multl 80\n"); - printf ("#define OPC_neg 81\n"); - printf ("#define OPC_negb 82\n"); - printf ("#define OPC_nop 83\n"); - printf ("#define OPC_or 84\n"); - printf ("#define OPC_orb 85\n"); - printf ("#define OPC_out 86\n"); - printf ("#define OPC_outb 87\n"); - printf ("#define OPC_outd 88\n"); - printf ("#define OPC_outdb 89\n"); - printf ("#define OPC_outib 90\n"); - printf ("#define OPC_outibr 91\n"); - printf ("#define OPC_pop 92\n"); - printf ("#define OPC_popl 93\n"); - printf ("#define OPC_push 94\n"); - printf ("#define OPC_pushl 95\n"); - printf ("#define OPC_res 96\n"); - printf ("#define OPC_resb 97\n"); - printf ("#define OPC_resflg 98\n"); - printf ("#define OPC_ret 99\n"); - printf ("#define OPC_rl 100\n"); - printf ("#define OPC_rlb 101\n"); - printf ("#define OPC_rlc 102\n"); - printf ("#define OPC_rlcb 103\n"); - printf ("#define OPC_rldb 104\n"); - printf ("#define OPC_rr 105\n"); - printf ("#define OPC_rrb 106\n"); - printf ("#define OPC_rrc 107\n"); - printf ("#define OPC_rrcb 108\n"); - printf ("#define OPC_rrdb 109\n"); - printf ("#define OPC_sbc 110\n"); - printf ("#define OPC_sbcb 111\n"); - printf ("#define OPC_sda 112\n"); - printf ("#define OPC_sdab 113\n"); - printf ("#define OPC_sdal 114\n"); - printf ("#define OPC_sdl 115\n"); - printf ("#define OPC_sdlb 116\n"); - printf ("#define OPC_sdll 117\n"); - printf ("#define OPC_set 118\n"); - printf ("#define OPC_setb 119\n"); - printf ("#define OPC_setflg 120\n"); - printf ("#define OPC_sinb 121\n"); - printf ("#define OPC_sind 122\n"); - printf ("#define OPC_sindb 123\n"); - printf ("#define OPC_sinib 124\n"); - printf ("#define OPC_sinibr 125\n"); - printf ("#define OPC_sla 126\n"); - printf ("#define OPC_slab 127\n"); - printf ("#define OPC_slal 128\n"); - printf ("#define OPC_sll 129\n"); - printf ("#define OPC_sllb 130\n"); - printf ("#define OPC_slll 131\n"); - printf ("#define OPC_sout 132\n"); - printf ("#define OPC_soutb 133\n"); - printf ("#define OPC_soutd 134\n"); - printf ("#define OPC_soutdb 135\n"); - printf ("#define OPC_soutib 136\n"); - printf ("#define OPC_soutibr 137\n"); - printf ("#define OPC_sra 138\n"); - printf ("#define OPC_srab 139\n"); - printf ("#define OPC_sral 140\n"); - printf ("#define OPC_srl 141\n"); - printf ("#define OPC_srlb 142\n"); - printf ("#define OPC_srll 143\n"); - printf ("#define OPC_sub 144\n"); - printf ("#define OPC_subb 145\n"); - printf ("#define OPC_subl 146\n"); - printf ("#define OPC_tcc 147\n"); - printf ("#define OPC_tccb 148\n"); - printf ("#define OPC_test 149\n"); - printf ("#define OPC_testb 150\n"); - printf ("#define OPC_testl 151\n"); - printf ("#define OPC_trdb 152\n"); - printf ("#define OPC_trdrb 153\n"); - printf ("#define OPC_trib 154\n"); - printf ("#define OPC_trirb 155\n"); - printf ("#define OPC_trtdrb 156\n"); - printf ("#define OPC_trtib 157\n"); - printf ("#define OPC_trtirb 158\n"); - printf ("#define OPC_trtrb 159\n"); - printf ("#define OPC_tset 160\n"); - printf ("#define OPC_tsetb 161\n"); - printf ("#define OPC_xor 162\n"); - printf ("#define OPC_xorb 163\n"); - - printf ("#define OPC_ldd 164 \n"); - printf ("#define OPC_lddb 165 \n"); - printf ("#define OPC_lddr 166 \n"); - printf ("#define OPC_lddrb 167 \n"); - printf ("#define OPC_ldi 168 \n"); - printf ("#define OPC_ldib 169 \n"); - printf ("#define OPC_sc 170\n"); - printf ("#define OPC_bpt 171\n"); - printf ("#define OPC_ext0e 172\n"); - printf ("#define OPC_ext0f 172\n"); - printf ("#define OPC_ext8e 172\n"); - printf ("#define OPC_ext8f 172\n"); - printf ("#define OPC_rsvd36 172\n"); - printf ("#define OPC_rsvd38 172\n"); - printf ("#define OPC_rsvd78 172\n"); - printf ("#define OPC_rsvd7e 172\n"); - printf ("#define OPC_rsvd9d 172\n"); - printf ("#define OPC_rsvd9f 172\n"); - printf ("#define OPC_rsvdb9 172\n"); - printf ("#define OPC_rsvdbf 172\n"); - printf ("#define OPC_outi 173\n"); - printf ("#define OPC_ldctlb 174\n"); - printf ("#define OPC_sin 175\n"); - printf ("#define OPC_trtdb 176\n"); -#if 0 - for (i = 0; toks[i].token; i++) - printf ("#define %s\t0x%x\n", toks[i].token, i * 16); -#endif - printf ("typedef struct {\n"); - - printf ("#ifdef NICENAMES\n"); - printf ("char *nicename;\n"); - printf ("int type;\n"); - printf ("int cycles;\n"); - printf ("int flags;\n"); - printf ("#endif\n"); - printf ("char *name;\n"); - printf ("unsigned char opcode;\n"); - printf ("void (*func) PARAMS ((void));\n"); - printf ("unsigned int arg_info[4];\n"); - printf ("unsigned int byte_info[%d];\n", BYTE_INFO_LEN); - printf ("int noperands;\n"); - printf ("int length;\n"); - printf ("int idx;\n"); - printf ("} opcode_entry_type;\n"); - printf ("#ifdef DEFINE_TABLE\n"); - printf ("opcode_entry_type z8k_table[] = {\n"); - - while (new->flags && new->flags[0]) - { - int nargs; - int length; - - printf ("\n\n/* %s *** %s */\n", new->bits, new->name); - printf ("{\n"); - - printf ("#ifdef NICENAMES\n"); - printf ("\"%s\",%d,%d,\n", new->name, new->type, new->cycles); - { - int answer = 0; - char *p = new->flags; - - while (*p) - { - answer <<= 1; - - if (*p != '-') - answer |= 1; - p++; - } - printf ("0x%02x,\n", answer); - } - - printf ("#endif\n"); - - nargs = chewname (new->name); - - printf ("\n\t"); - chewbits (new->bits, &length); - length /= 2; - if (length & 1) - abort(); - - printf (",%d,%d,%d", nargs, length, idx); - idx++; - oldname = new->name; - printf ("},\n"); - new++; - } - printf ("\n/* end marker */\n"); - printf ("{\n#ifdef NICENAMES\nNULL,0,0,\n0,\n#endif\n"); - printf ("NULL,0,0,{0,0,0,0},{0,0,0,0,0,0,0,0,0,0},0,0,0}\n};\n"); - printf ("#endif\n"); -} - - -int -main (ac, av) - int ac; - char **av; -{ - struct op *p = opt; - - if (ac == 2 && strcmp (av[1], "-t") == 0) - { - internal (); - } - else if (ac == 2 && strcmp (av[1], "-h") == 0) - { - while (p->name) - { - printf ("%-25s\t%s\n", p->name, p->bits); - p++; - } - } - - else if (ac == 2 && strcmp (av[1], "-a") == 0) - { - gas (); - } - else if (ac == 2 && strcmp (av[1], "-d") == 0) - { - /*dis();*/ - } - else - { - printf ("Usage: %s -t\n", av[0]); - printf ("-t : generate new z8.c internal table\n"); - printf ("-a : generate new table for gas\n"); - printf ("-d : generate new table for disassemble\n"); - printf ("-h : generate new table for humans\n"); - } - return 0; -} |