diff -Nur binutils-2.24.orig/bfd/archures.c binutils-2.24/bfd/archures.c --- binutils-2.24.orig/bfd/archures.c 2013-11-08 11:02:26.000000000 +0100 +++ binutils-2.24/bfd/archures.c 2016-06-30 21:26:12.537888600 +0200 @@ -316,6 +316,12 @@ .#define bfd_mach_arm_ep9312 11 .#define bfd_mach_arm_iWMMXt 12 .#define bfd_mach_arm_iWMMXt2 13 +. bfd_arch_nds32, {* Andes NDS32 *} +.#define bfd_mach_n1 1 +.#define bfd_mach_n1h 2 +.#define bfd_mach_n1h_v2 3 +.#define bfd_mach_n1h_v3 4 +.#define bfd_mach_n1h_v3m 5 . bfd_arch_ns32k, {* National Semiconductors ns32000 *} . bfd_arch_w65, {* WDC 65816 *} . bfd_arch_tic30, {* Texas Instruments TMS320C30 *} @@ -574,6 +580,7 @@ extern const bfd_arch_info_type bfd_moxie_arch; extern const bfd_arch_info_type bfd_msp430_arch; extern const bfd_arch_info_type bfd_mt_arch; +extern const bfd_arch_info_type bfd_nds32_arch; extern const bfd_arch_info_type bfd_nios2_arch; extern const bfd_arch_info_type bfd_ns32k_arch; extern const bfd_arch_info_type bfd_openrisc_arch; @@ -663,6 +670,7 @@ &bfd_moxie_arch, &bfd_msp430_arch, &bfd_mt_arch, + &bfd_nds32_arch, &bfd_nios2_arch, &bfd_ns32k_arch, &bfd_openrisc_arch, diff -Nur binutils-2.24.orig/bfd/bfd.c binutils-2.24/bfd/bfd.c --- binutils-2.24.orig/bfd/bfd.c 2013-11-04 16:33:37.000000000 +0100 +++ binutils-2.24/bfd/bfd.c 2016-06-30 21:26:12.537888600 +0200 @@ -311,6 +311,14 @@ . unsigned int selective_search : 1; .}; . +.{* See note beside bfd_set_section_userdata. *} +.static inline bfd_boolean +.bfd_set_cacheable (bfd * abfd, bfd_boolean val) +.{ +. abfd->cacheable = val; +. return TRUE; +.} +. */ #include "sysdep.h" diff -Nur binutils-2.24.orig/bfd/bfd-in2.h binutils-2.24/bfd/bfd-in2.h --- binutils-2.24.orig/bfd/bfd-in2.h 2013-11-18 09:40:15.000000000 +0100 +++ binutils-2.24/bfd/bfd-in2.h 2016-06-30 21:26:12.541888755 +0200 @@ -299,9 +299,6 @@ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) /* Find the address one past the end of SEC. */ #define bfd_get_section_limit(bfd, sec) \ (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ @@ -524,8 +521,6 @@ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) - extern bfd_boolean bfd_cache_close (bfd *abfd); /* NB: This declaration should match the autogenerated one in libbfd.h. */ @@ -1594,6 +1589,32 @@ int size; }; +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val) +{ + ptr->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val) +{ + ptr->vma = ptr->lma = val; + ptr->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val) +{ + ptr->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ @@ -2071,6 +2092,12 @@ #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 + bfd_arch_nds32, /* Andes NDS32 */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ @@ -3794,6 +3821,229 @@ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* This is a 24-bit reloc for security check sum. */ + BFD_RELOC_NDS32_SECURITY_16, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* Jump-patch table relative relocations. */ + BFD_RELOC_NDS32_ICT, + BFD_RELOC_NDS32_ICT_HI20, + BFD_RELOC_NDS32_ICT_LO12, + BFD_RELOC_NDS32_ICT_25PC, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -6235,6 +6485,14 @@ unsigned int selective_search : 1; }; +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + typedef enum bfd_error { bfd_error_no_error = 0, diff -Nur binutils-2.24.orig/bfd/bfd-in.h binutils-2.24/bfd/bfd-in.h --- binutils-2.24.orig/bfd/bfd-in.h 2013-11-04 16:33:37.000000000 +0100 +++ binutils-2.24/bfd/bfd-in.h 2016-06-30 21:26:12.541888755 +0200 @@ -292,9 +292,6 @@ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) /* Find the address one past the end of SEC. */ #define bfd_get_section_limit(bfd, sec) \ (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ @@ -517,8 +514,6 @@ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) - extern bfd_boolean bfd_cache_close (bfd *abfd); /* NB: This declaration should match the autogenerated one in libbfd.h. */ diff -Nur binutils-2.24.orig/bfd/config.bfd binutils-2.24/bfd/config.bfd --- binutils-2.24.orig/bfd/config.bfd 2013-11-04 16:33:37.000000000 +0100 +++ binutils-2.24/bfd/config.bfd 2016-06-30 21:26:12.541888755 +0200 @@ -6,12 +6,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 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; see the file COPYING3. If not see # . @@ -109,6 +109,7 @@ m88*) targ_archs=bfd_m88k_arch ;; microblaze*) targ_archs=bfd_microblaze_arch ;; mips*) targ_archs=bfd_mips_arch ;; +nds32*) targ_archs=bfd_nds32_arch ;; nios2*) targ_archs=bfd_nios2_arch ;; or32*) targ_archs=bfd_or32_arch ;; pdp11*) targ_archs=bfd_pdp11_arch ;; @@ -1120,6 +1121,28 @@ targ_selvecs=bfd_elf32_msp430_ti_vec ;; + nds32*le-*-linux*) + targ_defvec=bfd_elf32_nds32lelin_vec + targ_selvecs=bfd_elf32_nds32belin_vec + targ_cflags=-DNDS32_LINUX_TOOLCHAIN + ;; + + nds32*be-*-linux*) + targ_defvec=bfd_elf32_nds32belin_vec + targ_selvecs=bfd_elf32_nds32lelin_vec + targ_cflags=-DNDS32_LINUX_TOOLCHAIN + ;; + + nds32*le-*-*) + targ_defvec=bfd_elf32_nds32le_vec + targ_selvecs=bfd_elf32_nds32be_vec + ;; + + nds32*be-*-*) + targ_defvec=bfd_elf32_nds32be_vec + targ_selvecs=bfd_elf32_nds32le_vec + ;; + ns32k-pc532-mach* | ns32k-pc532-ux*) targ_defvec=pc532machaout_vec targ_underscore=yes @@ -1640,12 +1663,12 @@ w65-*-*) targ_defvec=w65_vec ;; - + xgate-*-*) targ_defvec=bfd_elf32_xgate_vec targ_selvecs="bfd_elf32_xgate_vec" ;; - + xstormy16-*-elf) targ_defvec=bfd_elf32_xstormy16_vec ;; diff -Nur binutils-2.24.orig/bfd/configure binutils-2.24/bfd/configure --- binutils-2.24.orig/bfd/configure 2013-12-02 10:30:30.000000000 +0100 +++ binutils-2.24/bfd/configure 2016-06-30 21:26:12.545888911 +0200 @@ -15307,6 +15307,10 @@ tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf32_ntradlittlemips_vec | bfd_elf32_ntradlittlemips_freebsd_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_nds32le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + bfd_elf32_nds32be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + bfd_elf32_nds32lelin_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + bfd_elf32_nds32belin_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;; bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;; bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; diff -Nur binutils-2.24.orig/bfd/configure.in binutils-2.24/bfd/configure.in --- binutils-2.24.orig/bfd/configure.in 2013-12-02 10:30:28.000000000 +0100 +++ binutils-2.24/bfd/configure.in 2016-06-30 21:26:12.545888911 +0200 @@ -796,6 +796,10 @@ tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf32_ntradlittlemips_vec | bfd_elf32_ntradlittlemips_freebsd_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_nds32be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + bfd_elf32_nds32le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + bfd_elf32_nds32belin_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + bfd_elf32_nds32lelin_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;; bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;; bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; diff -Nur binutils-2.24.orig/bfd/cpu-nds32.c binutils-2.24/bfd/cpu-nds32.c --- binutils-2.24.orig/bfd/cpu-nds32.c 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/bfd/cpu-nds32.c 2016-06-30 21:26:12.545888911 +0200 @@ -0,0 +1,44 @@ +/* BFD support for the NDS32 processor + Copyright (C) 2012-2013 Free Software Foundation, Inc. + Contributed by Andes Technology Corporation. + + 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#include "sysdep.h" +#include "bfd.h" +#include "libbfd.h" +#include "elf-bfd.h" + +#define N(number, print, default, next) \ + {32, 32, 8, bfd_arch_nds32, number, "nds32", print, 4, default, \ + bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next } + +#define NEXT &arch_info_struct[0] +#define NDS32V2_NEXT &arch_info_struct[1] +#define NDS32V3_NEXT &arch_info_struct[2] +#define NDS32V3M_NEXT &arch_info_struct[3] + +static const bfd_arch_info_type arch_info_struct[] = { + N (bfd_mach_n1h, "n1h", FALSE, NDS32V2_NEXT), + N (bfd_mach_n1h_v2, "n1h_v2", FALSE, NDS32V3_NEXT), + N (bfd_mach_n1h_v3, "n1h_v3", FALSE, NDS32V3M_NEXT), + N (bfd_mach_n1h_v3m, "n1h_v3m", FALSE, NULL), +}; + +const bfd_arch_info_type bfd_nds32_arch = + N (bfd_mach_n1, "n1h", TRUE, NEXT); diff -Nur binutils-2.24.orig/bfd/doc/aoutx.texi binutils-2.24/bfd/doc/aoutx.texi --- binutils-2.24.orig/bfd/doc/aoutx.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/aoutx.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,213 +0,0 @@ -@section a.out backends - - -@strong{Description}@* -BFD supports a number of different flavours of a.out format, -though the major differences are only the sizes of the -structures on disk, and the shape of the relocation -information. - -The support is split into a basic support file @file{aoutx.h} -and other files which derive functions from the base. One -derivation file is @file{aoutf1.h} (for a.out flavour 1), and -adds to the basic a.out functions support for sun3, sun4, 386 -and 29k a.out files, to create a target jump vector for a -specific target. - -This information is further split out into more specific files -for each machine, including @file{sunos.c} for sun3 and sun4, -@file{newsos3.c} for the Sony NEWS, and @file{demo64.c} for a -demonstration of a 64 bit a.out format. - -The base file @file{aoutx.h} defines general mechanisms for -reading and writing records to and from disk and various -other methods which BFD requires. It is included by -@file{aout32.c} and @file{aout64.c} to form the names -@code{aout_32_swap_exec_header_in}, @code{aout_64_swap_exec_header_in}, etc. - -As an example, this is what goes on to make the back end for a -sun4, from @file{aout32.c}: - -@example - #define ARCH_SIZE 32 - #include "aoutx.h" -@end example - -Which exports names: - -@example - ... - aout_32_canonicalize_reloc - aout_32_find_nearest_line - aout_32_get_lineno - aout_32_get_reloc_upper_bound - ... -@end example - -from @file{sunos.c}: - -@example - #define TARGET_NAME "a.out-sunos-big" - #define VECNAME sunos_big_vec - #include "aoutf1.h" -@end example - -requires all the names from @file{aout32.c}, and produces the jump vector - -@example - sunos_big_vec -@end example - -The file @file{host-aout.c} is a special case. It is for a large set -of hosts that use ``more or less standard'' a.out files, and -for which cross-debugging is not interesting. It uses the -standard 32-bit a.out support routines, but determines the -file offsets and addresses of the text, data, and BSS -sections, the machine architecture and machine type, and the -entry point address, in a host-dependent manner. Once these -values have been determined, generic code is used to handle -the object file. - -When porting it to run on a new system, you must supply: - -@example - HOST_PAGE_SIZE - HOST_SEGMENT_SIZE - HOST_MACHINE_ARCH (optional) - HOST_MACHINE_MACHINE (optional) - HOST_TEXT_START_ADDR - HOST_STACK_END_ADDR -@end example - -in the file @file{../include/sys/h-@var{XXX}.h} (for your host). These -values, plus the structures and macros defined in @file{a.out.h} on -your host system, will produce a BFD target that will access -ordinary a.out files on your host. To configure a new machine -to use @file{host-aout.c}, specify: - -@example - TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec - TDEPFILES= host-aout.o trad-core.o -@end example - -in the @file{config/@var{XXX}.mt} file, and modify @file{configure.in} -to use the -@file{@var{XXX}.mt} file (by setting "@code{bfd_target=XXX}") when your -configuration is selected. - -@subsection Relocations - - -@strong{Description}@* -The file @file{aoutx.h} provides for both the @emph{standard} -and @emph{extended} forms of a.out relocation records. - -The standard records contain only an -address, a symbol index, and a type field. The extended records -(used on 29ks and sparcs) also have a full integer for an -addend. - -@subsection Internal entry points - - -@strong{Description}@* -@file{aoutx.h} exports several routines for accessing the -contents of an a.out file, which are gathered and exported in -turn by various format specific files (eg sunos.c). - -@findex aout_@var{size}_swap_exec_header_in -@subsubsection @code{aout_@var{size}_swap_exec_header_in} -@strong{Synopsis} -@example -void aout_@var{size}_swap_exec_header_in, - (bfd *abfd, - struct external_exec *bytes, - struct internal_exec *execp); -@end example -@strong{Description}@* -Swap the information in an executable header @var{raw_bytes} taken -from a raw byte stream memory image into the internal exec header -structure @var{execp}. - -@findex aout_@var{size}_swap_exec_header_out -@subsubsection @code{aout_@var{size}_swap_exec_header_out} -@strong{Synopsis} -@example -void aout_@var{size}_swap_exec_header_out - (bfd *abfd, - struct internal_exec *execp, - struct external_exec *raw_bytes); -@end example -@strong{Description}@* -Swap the information in an internal exec header structure -@var{execp} into the buffer @var{raw_bytes} ready for writing to disk. - -@findex aout_@var{size}_some_aout_object_p -@subsubsection @code{aout_@var{size}_some_aout_object_p} -@strong{Synopsis} -@example -const bfd_target *aout_@var{size}_some_aout_object_p - (bfd *abfd, - struct internal_exec *execp, - const bfd_target *(*callback_to_real_object_p) (bfd *)); -@end example -@strong{Description}@* -Some a.out variant thinks that the file open in @var{abfd} -checking is an a.out file. Do some more checking, and set up -for access if it really is. Call back to the calling -environment's "finish up" function just before returning, to -handle any last-minute setup. - -@findex aout_@var{size}_mkobject -@subsubsection @code{aout_@var{size}_mkobject} -@strong{Synopsis} -@example -bfd_boolean aout_@var{size}_mkobject, (bfd *abfd); -@end example -@strong{Description}@* -Initialize BFD @var{abfd} for use with a.out files. - -@findex aout_@var{size}_machine_type -@subsubsection @code{aout_@var{size}_machine_type} -@strong{Synopsis} -@example -enum machine_type aout_@var{size}_machine_type - (enum bfd_architecture arch, - unsigned long machine, - bfd_boolean *unknown); -@end example -@strong{Description}@* -Keep track of machine architecture and machine type for -a.out's. Return the @code{machine_type} for a particular -architecture and machine, or @code{M_UNKNOWN} if that exact architecture -and machine can't be represented in a.out format. - -If the architecture is understood, machine type 0 (default) -is always understood. - -@findex aout_@var{size}_set_arch_mach -@subsubsection @code{aout_@var{size}_set_arch_mach} -@strong{Synopsis} -@example -bfd_boolean aout_@var{size}_set_arch_mach, - (bfd *, - enum bfd_architecture arch, - unsigned long machine); -@end example -@strong{Description}@* -Set the architecture and the machine of the BFD @var{abfd} to the -values @var{arch} and @var{machine}. Verify that @var{abfd}'s format -can support the architecture required. - -@findex aout_@var{size}_new_section_hook -@subsubsection @code{aout_@var{size}_new_section_hook} -@strong{Synopsis} -@example -bfd_boolean aout_@var{size}_new_section_hook, - (bfd *abfd, - asection *newsect); -@end example -@strong{Description}@* -Called by the BFD in response to a @code{bfd_make_section} -request. - diff -Nur binutils-2.24.orig/bfd/doc/archive.texi binutils-2.24/bfd/doc/archive.texi --- binutils-2.24.orig/bfd/doc/archive.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/archive.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,105 +0,0 @@ -@section Archives - - -@strong{Description}@* -An archive (or library) is just another BFD. It has a symbol -table, although there's not much a user program will do with it. - -The big difference between an archive BFD and an ordinary BFD -is that the archive doesn't have sections. Instead it has a -chain of BFDs that are considered its contents. These BFDs can -be manipulated like any other. The BFDs contained in an -archive opened for reading will all be opened for reading. You -may put either input or output BFDs into an archive opened for -output; they will be handled correctly when the archive is closed. - -Use @code{bfd_openr_next_archived_file} to step through -the contents of an archive opened for input. You don't -have to read the entire archive if you don't want -to! Read it until you find what you want. - -A BFD returned by @code{bfd_openr_next_archived_file} can be -closed manually with @code{bfd_close}. If you do not close it, -then a second iteration through the members of an archive may -return the same BFD. If you close the archive BFD, then all -the member BFDs will automatically be closed as well. - -Archive contents of output BFDs are chained through the -@code{archive_next} pointer in a BFD. The first one is findable -through the @code{archive_head} slot of the archive. Set it with -@code{bfd_set_archive_head} (q.v.). A given BFD may be in only -one open output archive at a time. - -As expected, the BFD archive code is more general than the -archive code of any given environment. BFD archives may -contain files of different formats (e.g., a.out and coff) and -even different architectures. You may even place archives -recursively into archives! - -This can cause unexpected confusion, since some archive -formats are more expressive than others. For instance, Intel -COFF archives can preserve long filenames; SunOS a.out archives -cannot. If you move a file from the first to the second -format and back again, the filename may be truncated. -Likewise, different a.out environments have different -conventions as to how they truncate filenames, whether they -preserve directory names in filenames, etc. When -interoperating with native tools, be sure your files are -homogeneous. - -Beware: most of these formats do not react well to the -presence of spaces in filenames. We do the best we can, but -can't always handle this case due to restrictions in the format of -archives. Many Unix utilities are braindead in regards to -spaces and such in filenames anyway, so this shouldn't be much -of a restriction. - -Archives are supported in BFD in @code{archive.c}. - -@subsection Archive functions - - -@findex bfd_get_next_mapent -@subsubsection @code{bfd_get_next_mapent} -@strong{Synopsis} -@example -symindex bfd_get_next_mapent - (bfd *abfd, symindex previous, carsym **sym); -@end example -@strong{Description}@* -Step through archive @var{abfd}'s symbol table (if it -has one). Successively update @var{sym} with the next symbol's -information, returning that symbol's (internal) index into the -symbol table. - -Supply @code{BFD_NO_MORE_SYMBOLS} as the @var{previous} entry to get -the first one; returns @code{BFD_NO_MORE_SYMBOLS} when you've already -got the last one. - -A @code{carsym} is a canonical archive symbol. The only -user-visible element is its name, a null-terminated string. - -@findex bfd_set_archive_head -@subsubsection @code{bfd_set_archive_head} -@strong{Synopsis} -@example -bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); -@end example -@strong{Description}@* -Set the head of the chain of -BFDs contained in the archive @var{output} to @var{new_head}. - -@findex bfd_openr_next_archived_file -@subsubsection @code{bfd_openr_next_archived_file} -@strong{Synopsis} -@example -bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); -@end example -@strong{Description}@* -Provided a BFD, @var{archive}, containing an archive and NULL, open -an input BFD on the first contained element and returns that. -Subsequent calls should pass -the archive and the previous return value to return a created -BFD to the next contained element. NULL is returned when there -are no more. - diff -Nur binutils-2.24.orig/bfd/doc/archures.texi binutils-2.24/bfd/doc/archures.texi --- binutils-2.24.orig/bfd/doc/archures.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/archures.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,706 +0,0 @@ -@section Architectures -BFD keeps one atom in a BFD describing the -architecture of the data attached to the BFD: a pointer to a -@code{bfd_arch_info_type}. - -Pointers to structures can be requested independently of a BFD -so that an architecture's information can be interrogated -without access to an open BFD. - -The architecture information is provided by each architecture package. -The set of default architectures is selected by the macro -@code{SELECT_ARCHITECTURES}. This is normally set up in the -@file{config/@var{target}.mt} file of your choice. If the name is not -defined, then all the architectures supported are included. - -When BFD starts up, all the architectures are called with an -initialize method. It is up to the architecture back end to -insert as many items into the list of architectures as it wants to; -generally this would be one for each machine and one for the -default case (an item with a machine field of 0). - -BFD's idea of an architecture is implemented in @file{archures.c}. - -@subsection bfd_architecture - - -@strong{Description}@* -This enum gives the object file's CPU architecture, in a -global sense---i.e., what processor family does it belong to? -Another field indicates which processor within -the family is in use. The machine gives a number which -distinguishes different versions of the architecture, -containing, for example, 2 and 3 for Intel i960 KA and i960 KB, -and 68020 and 68030 for Motorola 68020 and 68030. -@example -enum bfd_architecture -@{ - bfd_arch_unknown, /* File arch not known. */ - bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ - -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 - - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ -#define bfd_mach_sparc 1 -/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ -#define bfd_mach_sparc_sparclet 2 -#define bfd_mach_sparc_sparclite 3 -#define bfd_mach_sparc_v8plus 4 -#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ -#define bfd_mach_sparc_sparclite_le 6 -#define bfd_mach_sparc_v9 7 -#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ -#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ -#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ -/* Nonzero if MACH has the v9 instruction set. */ -#define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ - && (mach) != bfd_mach_sparc_sparclite_le) -/* Nonzero if MACH is a 64 bit sparc architecture. */ -#define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ -#define bfd_mach_mips3000 3000 -#define bfd_mach_mips3900 3900 -#define bfd_mach_mips4000 4000 -#define bfd_mach_mips4010 4010 -#define bfd_mach_mips4100 4100 -#define bfd_mach_mips4111 4111 -#define bfd_mach_mips4120 4120 -#define bfd_mach_mips4300 4300 -#define bfd_mach_mips4400 4400 -#define bfd_mach_mips4600 4600 -#define bfd_mach_mips4650 4650 -#define bfd_mach_mips5000 5000 -#define bfd_mach_mips5400 5400 -#define bfd_mach_mips5500 5500 -#define bfd_mach_mips5900 5900 -#define bfd_mach_mips6000 6000 -#define bfd_mach_mips7000 7000 -#define bfd_mach_mips8000 8000 -#define bfd_mach_mips9000 9000 -#define bfd_mach_mips10000 10000 -#define bfd_mach_mips12000 12000 -#define bfd_mach_mips14000 14000 -#define bfd_mach_mips16000 16000 -#define bfd_mach_mips16 16 -#define bfd_mach_mips5 5 -#define bfd_mach_mips_loongson_2e 3001 -#define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ -#define bfd_mach_mips_octeon 6501 -#define bfd_mach_mips_octeonp 6601 -#define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ -#define bfd_mach_mipsisa32 32 -#define bfd_mach_mipsisa32r2 33 -#define bfd_mach_mipsisa64 64 -#define bfd_mach_mipsisa64r2 65 -#define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ -#define bfd_mach_i386_intel_syntax (1 << 0) -#define bfd_mach_i386_i8086 (1 << 1) -#define bfd_mach_i386_i386 (1 << 2) -#define bfd_mach_x86_64 (1 << 3) -#define bfd_mach_x64_32 (1 << 4) -#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) -#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) -#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ -#define bfd_mach_l1om (1 << 5) -#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ -#define bfd_mach_k1om (1 << 6) -#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) -#define bfd_mach_i386_nacl (1 << 7) -#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) -#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) -#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ - bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ -#define bfd_mach_ppc 32 -#define bfd_mach_ppc64 64 -#define bfd_mach_ppc_403 403 -#define bfd_mach_ppc_403gc 4030 -#define bfd_mach_ppc_405 405 -#define bfd_mach_ppc_505 505 -#define bfd_mach_ppc_601 601 -#define bfd_mach_ppc_602 602 -#define bfd_mach_ppc_603 603 -#define bfd_mach_ppc_ec603e 6031 -#define bfd_mach_ppc_604 604 -#define bfd_mach_ppc_620 620 -#define bfd_mach_ppc_630 630 -#define bfd_mach_ppc_750 750 -#define bfd_mach_ppc_860 860 -#define bfd_mach_ppc_a35 35 -#define bfd_mach_ppc_rs64ii 642 -#define bfd_mach_ppc_rs64iii 643 -#define bfd_mach_ppc_7400 7400 -#define bfd_mach_ppc_e500 500 -#define bfd_mach_ppc_e500mc 5001 -#define bfd_mach_ppc_e500mc64 5005 -#define bfd_mach_ppc_e5500 5006 -#define bfd_mach_ppc_e6500 5007 -#define bfd_mach_ppc_titan 83 -#define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ -#define bfd_mach_rs6k 6000 -#define bfd_mach_rs6k_rs1 6001 -#define bfd_mach_rs6k_rsc 6003 -#define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ -#define bfd_mach_hppa10 10 -#define bfd_mach_hppa11 11 -#define bfd_mach_hppa20 20 -#define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ -#define bfd_mach_d10v 1 -#define bfd_mach_d10v_ts2 2 -#define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ -#define bfd_mach_m6812_default 0 -#define bfd_mach_m6812 1 -#define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ -#define bfd_mach_z8001 1 -#define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b -#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 - bfd_arch_arm, /* Advanced Risc Machines ARM. */ -#define bfd_mach_arm_unknown 0 -#define bfd_mach_arm_2 1 -#define bfd_mach_arm_2a 2 -#define bfd_mach_arm_3 3 -#define bfd_mach_arm_3M 4 -#define bfd_mach_arm_4 5 -#define bfd_mach_arm_4T 6 -#define bfd_mach_arm_5 7 -#define bfd_mach_arm_5T 8 -#define bfd_mach_arm_5TE 9 -#define bfd_mach_arm_XScale 10 -#define bfd_mach_arm_ep9312 11 -#define bfd_mach_arm_iWMMXt 12 -#define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ -#define bfd_mach_tic3x 30 -#define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ - bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI) */ -#define bfd_mach_v850 1 -#define bfd_mach_v850e 'E' -#define bfd_mach_v850e1 '1' -#define bfd_mach_v850e2 0x4532 -#define bfd_mach_v850e2v3 0x45325633 -#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5') */ - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ -#define bfd_mach_m32r 1 /* For backwards compatibility. */ -#define bfd_mach_m32rx 'x' -#define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 -#define bfd_mach_am33 330 -#define bfd_mach_am33_2 332 - bfd_arch_fr30, -#define bfd_mach_fr30 0x46523330 - bfd_arch_frv, -#define bfd_mach_frv 1 -#define bfd_mach_frvsimple 2 -#define bfd_mach_fr300 300 -#define bfd_mach_fr400 400 -#define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ -#define bfd_mach_fr500 500 -#define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ -#define bfd_mach_moxie 1 - bfd_arch_mcore, - bfd_arch_mep, -#define bfd_mach_mep 1 -#define bfd_mach_mep_h1 0x6831 -#define bfd_mach_mep_c5 0x6335 - bfd_arch_metag, -#define bfd_mach_metag 1 - bfd_arch_ia64, /* HP/Intel ia64 */ -#define bfd_mach_ia64_elf64 64 -#define bfd_mach_ia64_elf32 32 - bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ -#define bfd_mach_ip2022 1 -#define bfd_mach_ip2022ext 2 - bfd_arch_iq2000, /* Vitesse IQ2000. */ -#define bfd_mach_iq2000 1 -#define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ -#define bfd_mach_epiphany16 1 -#define bfd_mach_epiphany32 2 - bfd_arch_mt, -#define bfd_mach_ms1 1 -#define bfd_mach_mrisc2 2 -#define bfd_mach_ms2 3 - bfd_arch_pj, - bfd_arch_avr, /* Atmel AVR microcontrollers. */ -#define bfd_mach_avr1 1 -#define bfd_mach_avr2 2 -#define bfd_mach_avr25 25 -#define bfd_mach_avr3 3 -#define bfd_mach_avr31 31 -#define bfd_mach_avr35 35 -#define bfd_mach_avr4 4 -#define bfd_mach_avr5 5 -#define bfd_mach_avr51 51 -#define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ -#define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ -#define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 - bfd_arch_crx, /* National Semiconductor CRX. */ -#define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ -#define bfd_mach_cris_v0_v10 255 -#define bfd_mach_cris_v32 32 -#define bfd_mach_cris_v10_v32 1032 - bfd_arch_rl78, -#define bfd_mach_rl78 0x75 - bfd_arch_rx, /* Renesas RX. */ -#define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ -#define bfd_mach_s390_31 31 -#define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ - bfd_arch_mmix, /* Donald Knuth's educational processor. */ - bfd_arch_xstormy16, -#define bfd_mach_xstormy16 1 - bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp20 20 -#define bfd_mach_msp21 21 -#define bfd_mach_msp22 22 -#define bfd_mach_msp23 23 -#define bfd_mach_msp24 24 -#define bfd_mach_msp26 26 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 -#define bfd_mach_msp430x 45 -#define bfd_mach_msp46 46 -#define bfd_mach_msp47 47 -#define bfd_mach_msp54 54 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ -#define bfd_mach_xc16x 1 -#define bfd_mach_xc16xl 2 -#define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ -#define bfd_mach_xgate 1 - bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ -#define bfd_mach_xtensa 1 - bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ -#define bfd_mach_aarch64 0 -#define bfd_mach_aarch64_ilp32 32 - bfd_arch_nios2, -#define bfd_mach_nios2 0 - bfd_arch_last - @}; -@end example - -@subsection bfd_arch_info - - -@strong{Description}@* -This structure contains information on architectures for use -within BFD. -@example - -typedef struct bfd_arch_info -@{ - int bits_per_word; - int bits_per_address; - int bits_per_byte; - enum bfd_architecture arch; - unsigned long mach; - const char *arch_name; - const char *printable_name; - unsigned int section_align_power; - /* TRUE if this is the default machine for the architecture. - The default arch should be the first entry for an arch so that - all the entries for that arch can be accessed via @code{next}. */ - bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); - - bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); - - /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If - IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is - TRUE, the buffer contains code. */ - void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian, - bfd_boolean code); - - const struct bfd_arch_info *next; -@} -bfd_arch_info_type; - -@end example - -@findex bfd_printable_name -@subsubsection @code{bfd_printable_name} -@strong{Synopsis} -@example -const char *bfd_printable_name (bfd *abfd); -@end example -@strong{Description}@* -Return a printable string representing the architecture and machine -from the pointer to the architecture info structure. - -@findex bfd_scan_arch -@subsubsection @code{bfd_scan_arch} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_scan_arch (const char *string); -@end example -@strong{Description}@* -Figure out if BFD supports any cpu which could be described with -the name @var{string}. Return a pointer to an @code{arch_info} -structure if a machine is found, otherwise NULL. - -@findex bfd_arch_list -@subsubsection @code{bfd_arch_list} -@strong{Synopsis} -@example -const char **bfd_arch_list (void); -@end example -@strong{Description}@* -Return a freshly malloced NULL-terminated vector of the names -of all the valid BFD architectures. Do not modify the names. - -@findex bfd_arch_get_compatible -@subsubsection @code{bfd_arch_get_compatible} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_arch_get_compatible - (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); -@end example -@strong{Description}@* -Determine whether two BFDs' architectures and machine types -are compatible. Calculates the lowest common denominator -between the two architectures and machine types implied by -the BFDs and returns a pointer to an @code{arch_info} structure -describing the compatible machine. - -@findex bfd_default_arch_struct -@subsubsection @code{bfd_default_arch_struct} -@strong{Description}@* -The @code{bfd_default_arch_struct} is an item of -@code{bfd_arch_info_type} which has been initialized to a fairly -generic state. A BFD starts life by pointing to this -structure, until the correct back end has determined the real -architecture of the file. -@example -extern const bfd_arch_info_type bfd_default_arch_struct; -@end example - -@findex bfd_set_arch_info -@subsubsection @code{bfd_set_arch_info} -@strong{Synopsis} -@example -void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -@end example -@strong{Description}@* -Set the architecture info of @var{abfd} to @var{arg}. - -@findex bfd_default_set_arch_mach -@subsubsection @code{bfd_default_set_arch_mach} -@strong{Synopsis} -@example -bfd_boolean bfd_default_set_arch_mach - (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -@end example -@strong{Description}@* -Set the architecture and machine type in BFD @var{abfd} -to @var{arch} and @var{mach}. Find the correct -pointer to a structure and insert it into the @code{arch_info} -pointer. - -@findex bfd_get_arch -@subsubsection @code{bfd_get_arch} -@strong{Synopsis} -@example -enum bfd_architecture bfd_get_arch (bfd *abfd); -@end example -@strong{Description}@* -Return the enumerated type which describes the BFD @var{abfd}'s -architecture. - -@findex bfd_get_mach -@subsubsection @code{bfd_get_mach} -@strong{Synopsis} -@example -unsigned long bfd_get_mach (bfd *abfd); -@end example -@strong{Description}@* -Return the long type which describes the BFD @var{abfd}'s -machine. - -@findex bfd_arch_bits_per_byte -@subsubsection @code{bfd_arch_bits_per_byte} -@strong{Synopsis} -@example -unsigned int bfd_arch_bits_per_byte (bfd *abfd); -@end example -@strong{Description}@* -Return the number of bits in one of the BFD @var{abfd}'s -architecture's bytes. - -@findex bfd_arch_bits_per_address -@subsubsection @code{bfd_arch_bits_per_address} -@strong{Synopsis} -@example -unsigned int bfd_arch_bits_per_address (bfd *abfd); -@end example -@strong{Description}@* -Return the number of bits in one of the BFD @var{abfd}'s -architecture's addresses. - -@findex bfd_default_compatible -@subsubsection @code{bfd_default_compatible} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_default_compatible - (const bfd_arch_info_type *a, const bfd_arch_info_type *b); -@end example -@strong{Description}@* -The default function for testing for compatibility. - -@findex bfd_default_scan -@subsubsection @code{bfd_default_scan} -@strong{Synopsis} -@example -bfd_boolean bfd_default_scan - (const struct bfd_arch_info *info, const char *string); -@end example -@strong{Description}@* -The default function for working out whether this is an -architecture hit and a machine hit. - -@findex bfd_get_arch_info -@subsubsection @code{bfd_get_arch_info} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); -@end example -@strong{Description}@* -Return the architecture info struct in @var{abfd}. - -@findex bfd_lookup_arch -@subsubsection @code{bfd_lookup_arch} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_lookup_arch - (enum bfd_architecture arch, unsigned long machine); -@end example -@strong{Description}@* -Look for the architecture info structure which matches the -arguments @var{arch} and @var{machine}. A machine of 0 matches the -machine/architecture structure which marks itself as the -default. - -@findex bfd_printable_arch_mach -@subsubsection @code{bfd_printable_arch_mach} -@strong{Synopsis} -@example -const char *bfd_printable_arch_mach - (enum bfd_architecture arch, unsigned long machine); -@end example -@strong{Description}@* -Return a printable string representing the architecture and -machine type. - -This routine is depreciated. - -@findex bfd_octets_per_byte -@subsubsection @code{bfd_octets_per_byte} -@strong{Synopsis} -@example -unsigned int bfd_octets_per_byte (bfd *abfd); -@end example -@strong{Description}@* -Return the number of octets (8-bit quantities) per target byte -(minimum addressable unit). In most cases, this will be one, but some -DSP targets have 16, 32, or even 48 bits per byte. - -@findex bfd_arch_mach_octets_per_byte -@subsubsection @code{bfd_arch_mach_octets_per_byte} -@strong{Synopsis} -@example -unsigned int bfd_arch_mach_octets_per_byte - (enum bfd_architecture arch, unsigned long machine); -@end example -@strong{Description}@* -See bfd_octets_per_byte. - -This routine is provided for those cases where a bfd * is not -available - -@findex bfd_arch_default_fill -@subsubsection @code{bfd_arch_default_fill} -@strong{Synopsis} -@example -void *bfd_arch_default_fill (bfd_size_type count, - bfd_boolean is_bigendian, - bfd_boolean code); -@end example -@strong{Description}@* -Allocate via bfd_malloc and return a fill buffer of size COUNT. -If IS_BIGENDIAN is TRUE, the order of bytes is big endian. If -CODE is TRUE, the buffer contains code. - diff -Nur binutils-2.24.orig/bfd/doc/bfd.info binutils-2.24/bfd/doc/bfd.info --- binutils-2.24.orig/bfd/doc/bfd.info 2013-12-02 10:32:19.000000000 +0100 +++ binutils-2.24/bfd/doc/bfd.info 1970-01-01 01:00:00.000000000 +0100 @@ -1,13242 +0,0 @@ -This is bfd.info, produced by makeinfo version 4.8 from bfd.texinfo. - -INFO-DIR-SECTION Software development -START-INFO-DIR-ENTRY -* Bfd: (bfd). The Binary File Descriptor library. -END-INFO-DIR-ENTRY - - This file documents the BFD library. - - Copyright (C) 1991 - 2013 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.3 or -any later version published by the Free Software Foundation; with the -Invariant Sections being "GNU General Public License" and "Funding Free -Software", the Front-Cover texts being (a) (see below), and with the -Back-Cover Texts being (b) (see below). A copy of the license is -included in the section entitled "GNU Free Documentation License". - - (a) The FSF's Front-Cover Text is: - - A GNU Manual - - (b) The FSF's Back-Cover Text is: - - You have freedom to copy and modify this GNU Manual, like GNU -software. Copies published by the Free Software Foundation raise -funds for GNU development. - - -File: bfd.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) - - This file documents the binary file descriptor library libbfd. - -* Menu: - -* Overview:: Overview of BFD -* BFD front end:: BFD front end -* BFD back ends:: BFD back ends -* GNU Free Documentation License:: GNU Free Documentation License -* BFD Index:: BFD Index - - -File: bfd.info, Node: Overview, Next: BFD front end, Prev: Top, Up: Top - -1 Introduction -************** - -BFD is a package which allows applications to use the same routines to -operate on object files whatever the object file format. A new object -file format can be supported simply by creating a new BFD back end and -adding it to the library. - - BFD is split into two parts: the front end, and the back ends (one -for each object file format). - * The front end of BFD provides the interface to the user. It manages - memory and various canonical data structures. The front end also - decides which back end to use and when to call back end routines. - - * The back ends provide BFD its view of the real world. Each back - end provides a set of calls which the BFD front end can use to - maintain its canonical form. The back ends also may keep around - information for their own use, for greater efficiency. - -* Menu: - -* History:: History -* How It Works:: How It Works -* What BFD Version 2 Can Do:: What BFD Version 2 Can Do - - -File: bfd.info, Node: History, Next: How It Works, Prev: Overview, Up: Overview - -1.1 History -=========== - -One spur behind BFD was the desire, on the part of the GNU 960 team at -Intel Oregon, for interoperability of applications on their COFF and -b.out file formats. Cygnus was providing GNU support for the team, and -was contracted to provide the required functionality. - - The name came from a conversation David Wallace was having with -Richard Stallman about the library: RMS said that it would be quite -hard--David said "BFD". Stallman was right, but the name stuck. - - At the same time, Ready Systems wanted much the same thing, but for -different object file formats: IEEE-695, Oasys, Srecords, a.out and 68k -coff. - - BFD was first implemented by members of Cygnus Support; Steve -Chamberlain (`sac@cygnus.com'), John Gilmore (`gnu@cygnus.com'), K. -Richard Pixley (`rich@cygnus.com') and David Henkel-Wallace -(`gumby@cygnus.com'). - - -File: bfd.info, Node: How It Works, Next: What BFD Version 2 Can Do, Prev: History, Up: Overview - -1.2 How To Use BFD -================== - -To use the library, include `bfd.h' and link with `libbfd.a'. - - BFD provides a common interface to the parts of an object file for a -calling application. - - When an application successfully opens a target file (object, -archive, or whatever), a pointer to an internal structure is returned. -This pointer points to a structure called `bfd', described in `bfd.h'. -Our convention is to call this pointer a BFD, and instances of it -within code `abfd'. All operations on the target object file are -applied as methods to the BFD. The mapping is defined within `bfd.h' -in a set of macros, all beginning with `bfd_' to reduce namespace -pollution. - - For example, this sequence does what you would probably expect: -return the number of sections in an object file attached to a BFD -`abfd'. - - #include "bfd.h" - - unsigned int number_of_sections (abfd) - bfd *abfd; - { - return bfd_count_sections (abfd); - } - - The abstraction used within BFD is that an object file has: - - * a header, - - * a number of sections containing raw data (*note Sections::), - - * a set of relocations (*note Relocations::), and - - * some symbol information (*note Symbols::). - Also, BFDs opened for archives have the additional attribute of an -index and contain subordinate BFDs. This approach is fine for a.out and -coff, but loses efficiency when applied to formats such as S-records and -IEEE-695. - - -File: bfd.info, Node: What BFD Version 2 Can Do, Prev: How It Works, Up: Overview - -1.3 What BFD Version 2 Can Do -============================= - -When an object file is opened, BFD subroutines automatically determine -the format of the input object file. They then build a descriptor in -memory with pointers to routines that will be used to access elements of -the object file's data structures. - - As different information from the object files is required, BFD -reads from different sections of the file and processes them. For -example, a very common operation for the linker is processing symbol -tables. Each BFD back end provides a routine for converting between -the object file's representation of symbols and an internal canonical -format. When the linker asks for the symbol table of an object file, it -calls through a memory pointer to the routine from the relevant BFD -back end which reads and converts the table into a canonical form. The -linker then operates upon the canonical form. When the link is finished -and the linker writes the output file's symbol table, another BFD back -end routine is called to take the newly created symbol table and -convert it into the chosen output format. - -* Menu: - -* BFD information loss:: Information Loss -* Canonical format:: The BFD canonical object-file format - - -File: bfd.info, Node: BFD information loss, Next: Canonical format, Up: What BFD Version 2 Can Do - -1.3.1 Information Loss ----------------------- - -_Information can be lost during output._ The output formats supported -by BFD do not provide identical facilities, and information which can -be described in one form has nowhere to go in another format. One -example of this is alignment information in `b.out'. There is nowhere -in an `a.out' format file to store alignment information on the -contained data, so when a file is linked from `b.out' and an `a.out' -image is produced, alignment information will not propagate to the -output file. (The linker will still use the alignment information -internally, so the link is performed correctly). - - Another example is COFF section names. COFF files may contain an -unlimited number of sections, each one with a textual section name. If -the target of the link is a format which does not have many sections -(e.g., `a.out') or has sections without names (e.g., the Oasys format), -the link cannot be done simply. You can circumvent this problem by -describing the desired input-to-output section mapping with the linker -command language. - - _Information can be lost during canonicalization._ The BFD internal -canonical form of the external formats is not exhaustive; there are -structures in input formats for which there is no direct representation -internally. This means that the BFD back ends cannot maintain all -possible data richness through the transformation between external to -internal and back to external formats. - - This limitation is only a problem when an application reads one -format and writes another. Each BFD back end is responsible for -maintaining as much data as possible, and the internal BFD canonical -form has structures which are opaque to the BFD core, and exported only -to the back ends. When a file is read in one format, the canonical form -is generated for BFD and the application. At the same time, the back -end saves away any information which may otherwise be lost. If the data -is then written back in the same format, the back end routine will be -able to use the canonical form provided by the BFD core as well as the -information it prepared earlier. Since there is a great deal of -commonality between back ends, there is no information lost when -linking or copying big endian COFF to little endian COFF, or `a.out' to -`b.out'. When a mixture of formats is linked, the information is only -lost from the files whose format differs from the destination. - - -File: bfd.info, Node: Canonical format, Prev: BFD information loss, Up: What BFD Version 2 Can Do - -1.3.2 The BFD canonical object-file format ------------------------------------------- - -The greatest potential for loss of information occurs when there is the -least overlap between the information provided by the source format, -that stored by the canonical format, and that needed by the destination -format. A brief description of the canonical form may help you -understand which kinds of data you can count on preserving across -conversions. - -_files_ - Information stored on a per-file basis includes target machine - architecture, particular implementation format type, a demand - pageable bit, and a write protected bit. Information like Unix - magic numbers is not stored here--only the magic numbers' meaning, - so a `ZMAGIC' file would have both the demand pageable bit and the - write protected text bit set. The byte order of the target is - stored on a per-file basis, so that big- and little-endian object - files may be used with one another. - -_sections_ - Each section in the input file contains the name of the section, - the section's original address in the object file, size and - alignment information, various flags, and pointers into other BFD - data structures. - -_symbols_ - Each symbol contains a pointer to the information for the object - file which originally defined it, its name, its value, and various - flag bits. When a BFD back end reads in a symbol table, it - relocates all symbols to make them relative to the base of the - section where they were defined. Doing this ensures that each - symbol points to its containing section. Each symbol also has a - varying amount of hidden private data for the BFD back end. Since - the symbol points to the original file, the private data format - for that symbol is accessible. `ld' can operate on a collection - of symbols of wildly different formats without problems. - - Normal global and simple local symbols are maintained on output, - so an output file (no matter its format) will retain symbols - pointing to functions and to global, static, and common variables. - Some symbol information is not worth retaining; in `a.out', type - information is stored in the symbol table as long symbol names. - This information would be useless to most COFF debuggers; the - linker has command line switches to allow users to throw it away. - - There is one word of type information within the symbol, so if the - format supports symbol type information within symbols (for - example, COFF, IEEE, Oasys) and the type is simple enough to fit - within one word (nearly everything but aggregates), the - information will be preserved. - -_relocation level_ - Each canonical BFD relocation record contains a pointer to the - symbol to relocate to, the offset of the data to relocate, the - section the data is in, and a pointer to a relocation type - descriptor. Relocation is performed by passing messages through - the relocation type descriptor and the symbol pointer. Therefore, - relocations can be performed on output data using a relocation - method that is only available in one of the input formats. For - instance, Oasys provides a byte relocation format. A relocation - record requesting this relocation type would point indirectly to a - routine to perform this, so the relocation may be performed on a - byte being written to a 68k COFF file, even though 68k COFF has no - such relocation type. - -_line numbers_ - Object formats can contain, for debugging purposes, some form of - mapping between symbols, source line numbers, and addresses in the - output file. These addresses have to be relocated along with the - symbol information. Each symbol with an associated list of line - number records points to the first record of the list. The head - of a line number list consists of a pointer to the symbol, which - allows finding out the address of the function whose line number - is being described. The rest of the list is made up of pairs: - offsets into the section and line numbers. Any format which can - simply derive this information can pass it successfully between - formats (COFF, IEEE and Oasys). - - -File: bfd.info, Node: BFD front end, Next: BFD back ends, Prev: Overview, Up: Top - -2 BFD Front End -*************** - -* Menu: - -* typedef bfd:: -* Error reporting:: -* Miscellaneous:: -* Memory Usage:: -* Initialization:: -* Sections:: -* Symbols:: -* Archives:: -* Formats:: -* Relocations:: -* Core Files:: -* Targets:: -* Architectures:: -* Opening and Closing:: -* Internal:: -* File Caching:: -* Linker Functions:: -* Hash Tables:: - - -File: bfd.info, Node: typedef bfd, Next: Error reporting, Prev: BFD front end, Up: BFD front end - -2.1 `typedef bfd' -================= - -A BFD has type `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 `bfd'. It contains the -major data about the file and pointers to the rest of the data. - - - enum bfd_direction - { - no_direction = 0, - read_direction = 1, - write_direction = 2, - both_direction = 3 - }; - - struct bfd - { - /* A unique identifier of the BFD */ - unsigned int id; - - /* The filename the application opened the BFD with. */ - const char *filename; - - /* A pointer to the target jump table. */ - const struct bfd_target *xvec; - - /* The IOSTREAM, and corresponding IO vector that provide access - to the file backing the BFD. */ - void *iostream; - const struct bfd_iovec *iovec; - - /* 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... */ - ufile_ptr where; - - /* 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 with which the BFD was opened. */ - enum bfd_direction direction; - - /* Format_specific flags. */ - flagword flags; - - /* Values that may appear in the flags field of a BFD. These also - appear in the object_flags field of the bfd_target structure, where - they indicate the set of flags used by that backend (not all flags - are meaningful for all object file formats) (FIXME: at the moment, - the object_flags values have mostly just been copied from backend - to another, and are not necessarily correct). */ - - #define BFD_NO_FLAGS 0x00 - - /* BFD contains relocation entries. */ - #define HAS_RELOC 0x01 - - /* BFD is directly executable. */ - #define EXEC_P 0x02 - - /* BFD has line number information (basically used for F_LNNO in a - COFF header). */ - #define HAS_LINENO 0x04 - - /* BFD has debugging information. */ - #define HAS_DEBUG 0x08 - - /* BFD has symbols. */ - #define HAS_SYMS 0x10 - - /* BFD has local symbols (basically used for F_LSYMS in a COFF - header). */ - #define HAS_LOCALS 0x20 - - /* BFD is a dynamic object. */ - #define DYNAMIC 0x40 - - /* Text section is write protected (if D_PAGED is not set, this is - like an a.out NMAGIC file) (the linker sets this by default, but - clears it for -r or -N). */ - #define WP_TEXT 0x80 - - /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the - linker sets this by default, but clears it for -r or -n or -N). */ - #define D_PAGED 0x100 - - /* BFD is relaxable (this means that bfd_relax_section may be able to - do something) (sometimes bfd_relax_section can do something even if - this is not set). */ - #define BFD_IS_RELAXABLE 0x200 - - /* This may be set before writing out a BFD to request using a - traditional format. For example, this is used to request that when - writing out an a.out object the symbols not be hashed to eliminate - duplicates. */ - #define BFD_TRADITIONAL_FORMAT 0x400 - - /* This flag indicates that the BFD contents are actually cached - in memory. If this is set, iostream points to a bfd_in_memory - struct. */ - #define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ - #define HAS_LOAD_PAGE 0x1000 - - /* This BFD has been created by the linker and doesn't correspond - to any input file. */ - #define BFD_LINKER_CREATED 0x2000 - - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ - #define BFD_DETERMINISTIC_OUTPUT 0x4000 - - /* Compress sections in this BFD. */ - #define BFD_COMPRESS 0x8000 - - /* Decompress sections in this BFD. */ - #define BFD_DECOMPRESS 0x10000 - - /* BFD is a dummy, for plugins. */ - #define BFD_PLUGIN 0x20000 - - /* Flags bits to be saved in bfd_preserve_save. */ - #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) - - /* Flags bits which are for BFD use only. */ - #define BFD_FLAGS_FOR_BFD_USE_MASK \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) - - /* 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. */ - ufile_ptr origin; - - /* The origin in the archive of the proxy entry. This will - normally be the same as origin, except for thin archives, - when it will contain the current offset of the proxy in the - thin archive rather than the offset of the bfd in its actual - container. */ - ufile_ptr proxy_origin; - - /* A hash table for section names. */ - struct bfd_hash_table section_htab; - - /* Pointer to linked list of sections. */ - struct bfd_section *sections; - - /* The last section on the section list. */ - struct bfd_section *section_last; - - /* 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). - Also used by the linker to cache input BFD symbols. */ - struct bfd_symbol **outsymbols; - - /* Used for slurped dynamic symbol tables. */ - unsigned int dynsymcount; - - /* Pointer to structure which contains architecture information. */ - const struct bfd_arch_info *arch_info; - - /* Stuff only useful for archives. */ - void *arelt_data; - struct bfd *my_archive; /* The containing archive BFD. */ - struct bfd *archive_next; /* The next BFD in the archive. */ - struct bfd *archive_head; /* The first BFD in the archive. */ - struct bfd *nested_archives; /* List of nested archive in a flattened - thin archive. */ - - /* 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 verilog_data_struct *verilog_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 mmo_data_struct *mmo_data; - struct sun_core_struct *sun_core_data; - struct sco5_core_struct *sco5_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; - struct mach_o_data_struct *mach_o_data; - struct mach_o_fat_data_struct *mach_o_fat_data; - struct plugin_data_struct *plugin_data; - struct bfd_pef_data_struct *pef_data; - struct bfd_pef_xlib_data_struct *pef_xlib_data; - struct bfd_sym_data_struct *sym_data; - void *any; - } - tdata; - - /* Used by the application to hold private data. */ - void *usrdata; - - /* Where all the allocated stuff under this BFD goes. This is a - struct objalloc *, but we use void * to avoid requiring the inclusion - of objalloc.h. */ - void *memory; - - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* 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. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; - }; - - -File: bfd.info, Node: Error reporting, Next: Miscellaneous, Prev: typedef bfd, Up: BFD front end - -2.2 Error reporting -=================== - -Most BFD functions return nonzero on success (check their individual -documentation for precise semantics). On an error, they call -`bfd_set_error' to set an error condition that callers can check by -calling `bfd_get_error'. If that returns `bfd_error_system_call', then -check `errno'. - - The easiest way to report a BFD error to the user is to use -`bfd_perror'. - -2.2.1 Type `bfd_error_type' ---------------------------- - -The values returned by `bfd_get_error' are defined by the enumerated -type `bfd_error_type'. - - - typedef enum bfd_error - { - bfd_error_no_error = 0, - bfd_error_system_call, - bfd_error_invalid_target, - bfd_error_wrong_format, - bfd_error_wrong_object_format, - bfd_error_invalid_operation, - bfd_error_no_memory, - bfd_error_no_symbols, - bfd_error_no_armap, - bfd_error_no_more_archived_files, - bfd_error_malformed_archive, - bfd_error_missing_dso, - 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_on_input, - bfd_error_invalid_error_code - } - bfd_error_type; - -2.2.1.1 `bfd_get_error' -....................... - -*Synopsis* - bfd_error_type bfd_get_error (void); - *Description* -Return the current BFD error condition. - -2.2.1.2 `bfd_set_error' -....................... - -*Synopsis* - void bfd_set_error (bfd_error_type error_tag, ...); - *Description* -Set the BFD error condition to be ERROR_TAG. If ERROR_TAG is -bfd_error_on_input, then this function takes two more parameters, the -input bfd where the error occurred, and the bfd_error_type error. - -2.2.1.3 `bfd_errmsg' -.................... - -*Synopsis* - const char *bfd_errmsg (bfd_error_type error_tag); - *Description* -Return a string describing the error ERROR_TAG, or the system error if -ERROR_TAG is `bfd_error_system_call'. - -2.2.1.4 `bfd_perror' -.................... - -*Synopsis* - void bfd_perror (const char *message); - *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 MESSAGE is non-NULL and non-empty, the error -string printed is preceded by MESSAGE, a colon, and a space. It is -followed by a newline. - -2.2.2 BFD error handler ------------------------ - -Some BFD functions want to print messages describing the problem. They -call a BFD error handler function. This function may be overridden by -the program. - - The BFD error handler acts like printf. - - - typedef void (*bfd_error_handler_type) (const char *, ...); - -2.2.2.1 `bfd_set_error_handler' -............................... - -*Synopsis* - bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); - *Description* -Set the BFD error handler function. Returns the previous function. - -2.2.2.2 `bfd_set_error_program_name' -.................................... - -*Synopsis* - void bfd_set_error_program_name (const char *); - *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. - -2.2.2.3 `bfd_get_error_handler' -............................... - -*Synopsis* - bfd_error_handler_type bfd_get_error_handler (void); - *Description* -Return the BFD error handler function. - -2.2.3 BFD assert handler ------------------------- - -If BFD finds an internal inconsistency, the bfd assert handler is -called with information on the BFD version, BFD source file and line. -If this happens, most programs linked against BFD are expected to want -to exit with an error, or mark the current BFD operation as failed, so -it is recommended to override the default handler, which just calls -_bfd_error_handler and continues. - - - typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, - const char *bfd_version, - const char *bfd_file, - int bfd_line); - -2.2.3.1 `bfd_set_assert_handler' -................................ - -*Synopsis* - bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); - *Description* -Set the BFD assert handler function. Returns the previous function. - -2.2.3.2 `bfd_get_assert_handler' -................................ - -*Synopsis* - bfd_assert_handler_type bfd_get_assert_handler (void); - *Description* -Return the BFD assert handler function. - - -File: bfd.info, Node: Miscellaneous, Next: Memory Usage, Prev: Error reporting, Up: BFD front end - -2.3 Miscellaneous -================= - -2.3.1 Miscellaneous functions ------------------------------ - -2.3.1.1 `bfd_get_reloc_upper_bound' -................................... - -*Synopsis* - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); - *Description* -Return the number of bytes required to store the relocation information -associated with section SECT attached to bfd ABFD. If an error occurs, -return -1. - -2.3.1.2 `bfd_canonicalize_reloc' -................................ - -*Synopsis* - long bfd_canonicalize_reloc - (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); - *Description* -Call the back end associated with the open BFD ABFD and translate the -external form of the relocation information attached to SEC into the -internal canonical form. Place the table into memory at LOC, which has -been preallocated, usually by a call to `bfd_get_reloc_upper_bound'. -Returns the number of relocs, or -1 on error. - - The SYMS table is also needed for horrible internal magic reasons. - -2.3.1.3 `bfd_set_reloc' -....................... - -*Synopsis* - void bfd_set_reloc - (bfd *abfd, asection *sec, arelent **rel, unsigned int count); - *Description* -Set the relocation pointer and count within section SEC to the values -REL and COUNT. The argument ABFD is ignored. - -2.3.1.4 `bfd_set_file_flags' -............................ - -*Synopsis* - bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); - *Description* -Set the flag word in the BFD ABFD to the value FLAGS. - - Possible errors are: - * `bfd_error_wrong_format' - The target bfd was not of object format. - - * `bfd_error_invalid_operation' - The target bfd was open for - reading. - - * `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 `D_PAGED' bit on a BFD format which does not - support demand paging. - -2.3.1.5 `bfd_get_arch_size' -........................... - -*Synopsis* - int bfd_get_arch_size (bfd *abfd); - *Description* -Returns the architecture address size, in bits, as determined by the -object file's format. For ELF, this information is included in the -header. - - *Returns* -Returns the arch size in bits if known, `-1' otherwise. - -2.3.1.6 `bfd_get_sign_extend_vma' -................................. - -*Synopsis* - int bfd_get_sign_extend_vma (bfd *abfd); - *Description* -Indicates if the target architecture "naturally" sign extends an -address. Some architectures implicitly sign extend address values when -they are converted to types larger than the size of an address. For -instance, bfd_get_start_address() will return an address sign extended -to fill a bfd_vma when this is the case. - - *Returns* -Returns `1' if the target architecture is known to sign extend -addresses, `0' if the target architecture is known to not sign extend -addresses, and `-1' otherwise. - -2.3.1.7 `bfd_set_start_address' -............................... - -*Synopsis* - bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); - *Description* -Make VMA the entry point of output BFD ABFD. - - *Returns* -Returns `TRUE' on success, `FALSE' otherwise. - -2.3.1.8 `bfd_get_gp_size' -......................... - -*Synopsis* - unsigned int bfd_get_gp_size (bfd *abfd); - *Description* -Return the maximum size of objects to be optimized using the GP -register under MIPS ECOFF. This is typically set by the `-G' argument -to the compiler, assembler or linker. - -2.3.1.9 `bfd_set_gp_size' -......................... - -*Synopsis* - void bfd_set_gp_size (bfd *abfd, unsigned int i); - *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 `-G' argument to -the compiler, assembler or linker. - -2.3.1.10 `bfd_scan_vma' -....................... - -*Synopsis* - bfd_vma bfd_scan_vma (const char *string, const char **end, int base); - *Description* -Convert, like `strtoul', a numerical expression STRING into a `bfd_vma' -integer, and return that integer. (Though without as many bells and -whistles as `strtoul'.) The expression is assumed to be unsigned -(i.e., positive). If given a 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. - - If the value would overflow, the maximum `bfd_vma' value is returned. - -2.3.1.11 `bfd_copy_private_header_data' -....................................... - -*Synopsis* - bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); - *Description* -Copy private BFD header information from the BFD IBFD to the the BFD -OBFD. This copies information that may require sections to exist, but -does not require symbol tables. Return `true' on success, `false' on -error. Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OBFD. - - #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) - -2.3.1.12 `bfd_copy_private_bfd_data' -.................................... - -*Synopsis* - bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); - *Description* -Copy private BFD information from the BFD IBFD to the the BFD OBFD. -Return `TRUE' on success, `FALSE' on error. Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OBFD. - - #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) - -2.3.1.13 `bfd_merge_private_bfd_data' -..................................... - -*Synopsis* - bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - *Description* -Merge private BFD information from the BFD IBFD to the the output file -BFD OBFD when linking. Return `TRUE' on success, `FALSE' on error. -Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OBFD. - - #define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) - -2.3.1.14 `bfd_set_private_flags' -................................ - -*Synopsis* - bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); - *Description* -Set private BFD flag information in the BFD ABFD. Return `TRUE' on -success, `FALSE' on error. Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OBFD. - - #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) - -2.3.1.15 `Other functions' -.......................... - -*Description* -The following functions exist but have not yet been documented. - #define bfd_sizeof_headers(abfd, info) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) - - #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)) - - #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) - - #define bfd_find_line(abfd, syms, sym, file, line) \ - BFD_SEND (abfd, _bfd_find_line, \ - (abfd, syms, sym, file, line)) - - #define bfd_find_inliner_info(abfd, file, func, line) \ - BFD_SEND (abfd, _bfd_find_inliner_info, \ - (abfd, file, func, line)) - - #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_gc_sections(abfd, link_info) \ - BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) - - #define bfd_lookup_section_flags(link_info, flag_info, section) \ - BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section)) - - #define bfd_merge_sections(abfd, link_info) \ - BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) - - #define bfd_is_group_section(abfd, sec) \ - BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) - - #define bfd_discard_group(abfd, sec) \ - BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) - - #define bfd_link_hash_table_create(abfd) \ - BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) - - #define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - - #define bfd_link_add_symbols(abfd, info) \ - BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) - - #define bfd_link_just_syms(abfd, sec, info) \ - BFD_SEND (abfd, _bfd_link_just_syms, (sec, 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_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \ - BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \ - dyncount, dynsyms, ret)) - - #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 - (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, - bfd_boolean, asymbol **); - -2.3.1.16 `bfd_alt_mach_code' -............................ - -*Synopsis* - bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); - *Description* -When more than one machine code number is available for the same -machine type, this function can be used to switch between the preferred -one (alternative == 0) and any others. Currently, only ELF supports -this feature, with up to two alternate machine codes. - -2.3.1.17 `bfd_emul_get_maxpagesize' -................................... - -*Synopsis* - bfd_vma bfd_emul_get_maxpagesize (const char *); - *Description* -Returns the maximum page size, in bytes, as determined by emulation. - - *Returns* -Returns the maximum page size in bytes for ELF, 0 otherwise. - -2.3.1.18 `bfd_emul_set_maxpagesize' -................................... - -*Synopsis* - void bfd_emul_set_maxpagesize (const char *, bfd_vma); - *Description* -For ELF, set the maximum page size for the emulation. It is a no-op -for other formats. - -2.3.1.19 `bfd_emul_get_commonpagesize' -...................................... - -*Synopsis* - bfd_vma bfd_emul_get_commonpagesize (const char *); - *Description* -Returns the common page size, in bytes, as determined by emulation. - - *Returns* -Returns the common page size in bytes for ELF, 0 otherwise. - -2.3.1.20 `bfd_emul_set_commonpagesize' -...................................... - -*Synopsis* - void bfd_emul_set_commonpagesize (const char *, bfd_vma); - *Description* -For ELF, set the common page size for the emulation. It is a no-op for -other formats. - -2.3.1.21 `bfd_demangle' -....................... - -*Synopsis* - char *bfd_demangle (bfd *, const char *, int); - *Description* -Wrapper around cplus_demangle. Strips leading underscores and other -such chars that would otherwise confuse the demangler. If passed a g++ -v3 ABI mangled name, returns a buffer allocated with malloc holding the -demangled name. Returns NULL otherwise and on memory alloc failure. - -2.3.1.22 `struct bfd_iovec' -........................... - -*Description* -The `struct bfd_iovec' contains the internal file I/O class. Each -`BFD' has an instance of this class and all file I/O is routed through -it (it is assumed that the instance implements all methods listed -below). - struct bfd_iovec - { - /* To avoid problems with macros, a "b" rather than "f" - prefix is prepended to each method name. */ - /* Attempt to read/write NBYTES on ABFD's IOSTREAM storing/fetching - bytes starting at PTR. Return the number of bytes actually - transfered (a read past end-of-file returns less than NBYTES), - or -1 (setting `bfd_error') if an error occurs. */ - file_ptr (*bread) (struct bfd *abfd, void *ptr, file_ptr nbytes); - file_ptr (*bwrite) (struct bfd *abfd, const void *ptr, - file_ptr nbytes); - /* Return the current IOSTREAM file offset, or -1 (setting `bfd_error' - if an error occurs. */ - file_ptr (*btell) (struct bfd *abfd); - /* For the following, on successful completion a value of 0 is returned. - Otherwise, a value of -1 is returned (and `bfd_error' is set). */ - int (*bseek) (struct bfd *abfd, file_ptr offset, int whence); - int (*bclose) (struct bfd *abfd); - int (*bflush) (struct bfd *abfd); - int (*bstat) (struct bfd *abfd, struct stat *sb); - /* Mmap a part of the files. ADDR, LEN, PROT, FLAGS and OFFSET are the usual - mmap parameter, except that LEN and OFFSET do not need to be page - aligned. Returns (void *)-1 on failure, mmapped address on success. - Also write in MAP_ADDR the address of the page aligned buffer and in - MAP_LEN the size mapped (a page multiple). Use unmap with MAP_ADDR and - MAP_LEN to unmap. */ - void *(*bmmap) (struct bfd *abfd, void *addr, bfd_size_type len, - int prot, int flags, file_ptr offset, - void **map_addr, bfd_size_type *map_len); - }; - extern const struct bfd_iovec _bfd_memory_iovec; - -2.3.1.23 `bfd_get_mtime' -........................ - -*Synopsis* - long bfd_get_mtime (bfd *abfd); - *Description* -Return the file modification time (as read from the file system, or -from the archive header for archive members). - -2.3.1.24 `bfd_get_size' -....................... - -*Synopsis* - file_ptr bfd_get_size (bfd *abfd); - *Description* -Return the file size (as read from file system) for the file associated -with BFD 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 `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 question, "is -the size reasonable?". - -2.3.1.25 `bfd_mmap' -................... - -*Synopsis* - void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, - int prot, int flags, file_ptr offset, - void **map_addr, bfd_size_type *map_len); - *Description* -Return mmap()ed region of the file, if possible and implemented. LEN -and OFFSET do not need to be page aligned. The page aligned address -and length are written to MAP_ADDR and MAP_LEN. - - -File: bfd.info, Node: Memory Usage, Next: Initialization, Prev: Miscellaneous, Up: BFD front end - -2.4 Memory Usage -================ - -BFD keeps all of its internal structures in obstacks. There is one -obstack per open BFD file, into which the current state is stored. When -a BFD is closed, the obstack is deleted, and so everything which has -been allocated by BFD for the closing file is thrown away. - - BFD does not free anything created by an application, but pointers -into `bfd' structures become invalid on a `bfd_close'; for example, -after a `bfd_close' the vector passed to `bfd_canonicalize_symtab' is -still around, since it has been allocated by the application, but the -data that it pointed to are lost. - - The general rule is to not close a BFD until all operations dependent -upon data from the BFD have been completed, or all the data from within -the file has been copied. To help with the management of memory, there -is a function (`bfd_alloc_size') which returns the number of bytes in -obstacks associated with the supplied BFD. This could be used to select -the greediest open BFD, close it to reclaim the memory, perform some -operation and reopen the BFD again, to get a fresh copy of the data -structures. - - -File: bfd.info, Node: Initialization, Next: Sections, Prev: Memory Usage, Up: BFD front end - -2.5 Initialization -================== - -2.5.1 Initialization functions ------------------------------- - -These are the functions that handle initializing a BFD. - -2.5.1.1 `bfd_init' -.................. - -*Synopsis* - void bfd_init (void); - *Description* -This routine must be called before any other BFD function to initialize -magical internal data structures. - - -File: bfd.info, Node: Sections, Next: Symbols, Prev: Initialization, Up: BFD front end - -2.6 Sections -============ - -The raw data contained within a BFD is maintained through the section -abstraction. A single BFD may have any number of sections. It keeps -hold of them by pointing to the first; each one points to the next in -the list. - - Sections are supported in BFD in `section.c'. - -* Menu: - -* Section Input:: -* Section Output:: -* typedef asection:: -* section prototypes:: - - -File: bfd.info, Node: Section Input, Next: Section Output, Prev: Sections, Up: Sections - -2.6.1 Section input -------------------- - -When a BFD is opened for reading, the section structures are created -and attached to the BFD. - - Each section has a name which describes the section in the outside -world--for example, `a.out' would contain at least three sections, -called `.text', `.data' and `.bss'. - - Names need not be unique; for example a COFF file may have several -sections named `.data'. - - Sometimes a BFD will contain more than the "natural" number of -sections. A back end may attach other sections containing constructor -data, or an application may add a section (using `bfd_make_section') to -the sections attached to an already open BFD. For example, the linker -creates an extra section `COMMON' for each input file's BFD to hold -information about common storage. - - The raw data is not necessarily read in when the section descriptor -is created. Some targets may leave the data in place until a -`bfd_get_section_contents' call is made. Other back ends may read in -all the data at once. For example, an S-record file has to be read -once to determine the size of the data. An IEEE-695 file doesn't -contain raw data in sections, but data and relocation expressions -intermixed, so the data area has to be parsed to get out the data and -relocations. - - -File: bfd.info, Node: Section Output, Next: typedef asection, Prev: Section Input, Up: Sections - -2.6.2 Section output --------------------- - -To write a new object style BFD, the various sections to be written -have to be created. They are attached to the BFD in the same way as -input sections; data is written to the sections using -`bfd_set_section_contents'. - - Any program that creates or combines sections (e.g., the assembler -and linker) must use the `asection' fields `output_section' and -`output_offset' to indicate the file sections to which each section -must be written. (If the section is being created from scratch, -`output_section' should probably point to the section itself and -`output_offset' should probably be zero.) - - The data to be written comes from input sections attached (via -`output_section' pointers) to the output sections. The output section -structure can be considered a filter for the input section: the output -section determines the vma of the output data and the name, but the -input section determines the offset into the output section of the data -to be written. - - E.g., to create a section "O", starting at 0x100, 0x123 long, -containing two subsections, "A" at offset 0x0 (i.e., at vma 0x100) and -"B" at offset 0x20 (i.e., at vma 0x120) the `asection' structures would -look like: - - section name "A" - output_offset 0x00 - size 0x20 - output_section -----------> section name "O" - | vma 0x100 - section name "B" | size 0x123 - output_offset 0x20 | - size 0x103 | - output_section --------| - -2.6.3 Link orders ------------------ - -The data within a section is stored in a "link_order". These are much -like the fixups in `gas'. The link_order abstraction allows a section -to grow and shrink within itself. - - A link_order knows how big it is, and which is the next link_order -and where the raw data for it is; it also points to a list of -relocations which apply to it. - - The link_order is used by the linker to perform relaxing on final -code. The compiler creates code which is as big as necessary to make -it work without relaxing, and the user can select whether to relax. -Sometimes relaxing takes a lot of time. The linker runs around the -relocations to see if any are attached to data which can be shrunk, if -so it does it on a link_order by link_order basis. - - -File: bfd.info, Node: typedef asection, Next: section prototypes, Prev: Section Output, Up: Sections - -2.6.4 typedef asection ----------------------- - -Here is the section structure: - - - typedef struct bfd_section - { - /* The name of the section; the name isn't a copy, the pointer is - the same as that passed to bfd_make_section. */ - const char *name; - - /* A unique sequence number. */ - int id; - - /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; - - /* The next section in the list belonging to the BFD, or NULL. */ - struct bfd_section *next; - - /* The previous section in the list belonging to the BFD, or NULL. */ - struct bfd_section *prev; - - /* The field flags contains attributes of the section. Some - flags are read in from the object file, and some are - synthesized from other information. */ - flagword flags; - - #define SEC_NO_FLAGS 0x000 - - /* Tells the OS to allocate space for this section when loading. - This is clear for a section containing debug information only. */ - #define SEC_ALLOC 0x001 - - /* Tells the OS to load the section from the file when loading. - This is clear for a .bss section. */ - #define SEC_LOAD 0x002 - - /* The section contains data still to be relocated, so there is - some relocation information too. */ - #define SEC_RELOC 0x004 - - /* A signal to the OS that the section contains read only data. */ - #define SEC_READONLY 0x008 - - /* The section contains code only. */ - #define SEC_CODE 0x010 - - /* The section contains data only. */ - #define SEC_DATA 0x020 - - /* The section will reside in ROM. */ - #define SEC_ROM 0x040 - - /* The section contains constructor information. This section - type is used by the linker to create lists of constructors and - destructors used by `g++'. When a back end sees a symbol - which should be used in a constructor list, it creates a new - section for the type of name (e.g., `__CTOR_LIST__'), attaches - the symbol to it, and builds a relocation. To build the lists - of constructors, all the linker has to do is catenate all the - sections called `__CTOR_LIST__' and relocate the data - contained within - exactly the operations it would peform on - standard data. */ - #define SEC_CONSTRUCTOR 0x080 - - /* The section has contents - a data section could be - `SEC_ALLOC' | `SEC_HAS_CONTENTS'; a debug section could be - `SEC_HAS_CONTENTS' */ - #define SEC_HAS_CONTENTS 0x100 - - /* An instruction to the linker to not output the section - even if it has information which would normally be written. */ - #define SEC_NEVER_LOAD 0x200 - - /* The section contains thread local data. */ - #define SEC_THREAD_LOCAL 0x400 - - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ - #define SEC_HAS_GOT_REF 0x800 - - /* The section contains common symbols (symbols may be defined - multiple times, the value of a symbol is the amount of - space it requires, and the largest symbol value is the one - used). Most targets have exactly one of these (which we - translate to bfd_com_section_ptr), but ECOFF has two. */ - #define SEC_IS_COMMON 0x1000 - - /* The section contains only debugging information. For - example, this is set for ELF .debug and .stab sections. - strip tests this flag to see if a section can be - discarded. */ - #define SEC_DEBUGGING 0x2000 - - /* The contents of this section are held in memory pointed to - by the contents field. This is checked by bfd_get_section_contents, - and the data is retrieved from memory if appropriate. */ - #define SEC_IN_MEMORY 0x4000 - - /* The contents of this section are to be excluded by the - linker for executable and shared objects unless those - objects are to be further relocated. */ - #define SEC_EXCLUDE 0x8000 - - /* The contents of this section are to be sorted based on the sum of - the symbol and addend values specified by the associated relocation - entries. Entries without associated relocation entries will be - appended to the end of the section in an unspecified order. */ - #define SEC_SORT_ENTRIES 0x10000 - - /* When linking, duplicate sections of the same name should be - discarded, rather than being combined into a single section as - is usually done. This is similar to how common symbols are - handled. See SEC_LINK_DUPLICATES below. */ - #define SEC_LINK_ONCE 0x20000 - - /* If SEC_LINK_ONCE is set, this bitfield describes how the linker - should handle duplicate sections. */ - #define SEC_LINK_DUPLICATES 0xc0000 - - /* This value for SEC_LINK_DUPLICATES means that duplicate - sections with the same name should simply be discarded. */ - #define SEC_LINK_DUPLICATES_DISCARD 0x0 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if there are any duplicate sections, although - it should still only link one copy. */ - #define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections are a different size. */ - #define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections contain different - contents. */ - #define SEC_LINK_DUPLICATES_SAME_CONTENTS \ - (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE) - - /* This section was created by the linker as part of dynamic - relocation or other arcane processing. It is skipped when - going through the first-pass output, trusting that someone - else up the line will take care of it later. */ - #define SEC_LINKER_CREATED 0x100000 - - /* This section should not be subject to garbage collection. - Also set to inform the linker that this section should not be - listed in the link map as discarded. */ - #define SEC_KEEP 0x200000 - - /* This section contains "short" data, and should be placed - "near" the GP. */ - #define SEC_SMALL_DATA 0x400000 - - /* Attempt to merge identical entities in the section. - Entity size is given in the entsize field. */ - #define SEC_MERGE 0x800000 - - /* If given with SEC_MERGE, entities to merge are zero terminated - strings where entsize specifies character size instead of fixed - size entries. */ - #define SEC_STRINGS 0x1000000 - - /* This section contains data about section groups. */ - #define SEC_GROUP 0x2000000 - - /* The section is a COFF shared library section. This flag is - only for the linker. If this type of section appears in - the input file, the linker must copy it to the output file - without changing the vma or size. FIXME: Although this - was originally intended to be general, it really is COFF - specific (and the flag was renamed to indicate this). It - might be cleaner to have some more general mechanism to - allow the back end to control what the linker does with - sections. */ - #define SEC_COFF_SHARED_LIBRARY 0x4000000 - - /* This input section should be copied to output in reverse order - as an array of pointers. This is for ELF linker internal use - only. */ - #define SEC_ELF_REVERSE_COPY 0x4000000 - - /* This section contains data which may be shared with other - executables or shared objects. This is for COFF only. */ - #define SEC_COFF_SHARED 0x8000000 - - /* When a section with this flag is being linked, then if the size of - the input section is less than a page, it should not cross a page - boundary. If the size of the input section is one page or more, - it should be aligned on a page boundary. This is for TI - TMS320C54X only. */ - #define SEC_TIC54X_BLOCK 0x10000000 - - /* Conditionally link this section; do not link if there are no - references found to any symbol in the section. This is for TI - TMS320C54X only. */ - #define SEC_TIC54X_CLINK 0x20000000 - - /* Indicate that section has the no read flag set. This happens - when memory read flag isn't set. */ - #define SEC_COFF_NOREAD 0x40000000 - - /* End of section flags. */ - - /* Some internal packed boolean fields. */ - - /* See the vma field. */ - unsigned int user_set_vma : 1; - - /* A mark flag used by some of the linker backends. */ - unsigned int linker_mark : 1; - - /* Another mark flag used by some of the linker backends. Set for - output sections that have an input section. */ - unsigned int linker_has_input : 1; - - /* Mark flag used by some linker backends for garbage collection. */ - unsigned int gc_mark : 1; - - /* Section compression status. */ - unsigned int compress_status : 2; - #define COMPRESS_SECTION_NONE 0 - #define COMPRESS_SECTION_DONE 1 - #define DECOMPRESS_SECTION_SIZED 2 - - /* The following flags are used by the ELF linker. */ - - /* Mark sections which have been allocated to segments. */ - unsigned int segment_mark : 1; - - /* Type of sec_info information. */ - unsigned int sec_info_type:3; - #define SEC_INFO_TYPE_NONE 0 - #define SEC_INFO_TYPE_STABS 1 - #define SEC_INFO_TYPE_MERGE 2 - #define SEC_INFO_TYPE_EH_FRAME 3 - #define SEC_INFO_TYPE_JUST_SYMS 4 - - /* Nonzero if this section uses RELA relocations, rather than REL. */ - unsigned int use_rela_p:1; - - /* Bits used by various backends. The generic code doesn't touch - these fields. */ - - unsigned int sec_flg0:1; - unsigned int sec_flg1:1; - unsigned int sec_flg2:1; - unsigned int sec_flg3:1; - unsigned int sec_flg4:1; - unsigned int sec_flg5:1; - - /* End of internal packed boolean fields. */ - - /* The virtual memory address of the section - where it will be - at run time. The symbols are relocated against this. The - user_set_vma flag is maintained by bfd; if it's not set, the - backend can assign addresses (for example, in `a.out', where - the default address for `.data' is dependent on the specific - target and various flags). */ - bfd_vma vma; - - /* The load address of the section - where it would be in a - rom image; really only used for writing section header - information. */ - bfd_vma lma; - - /* The size of the section in octets, as it will be output. - Contains a value even if the section has no contents (e.g., the - size of `.bss'). */ - bfd_size_type size; - - /* For input sections, the original size on disk of the section, in - octets. This field should be set for any section whose size is - changed by linker relaxation. It is required for sections where - the linker relaxation scheme doesn't cache altered section and - reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing - targets), and thus the original size needs to be kept to read the - section multiple times. For output sections, rawsize holds the - section size calculated on a previous linker relaxation pass. */ - bfd_size_type rawsize; - - /* The compressed size of the section in octets. */ - bfd_size_type compressed_size; - - /* Relaxation table. */ - struct relax_table *relax; - - /* Count of used relaxation table entries. */ - int relax_count; - - - /* If this section is going to be output, then this value is the - offset in *bytes* into the output section of the first byte in the - input section (byte ==> smallest addressable unit on the - target). In most cases, if this was going to start at the - 100th octet (8-bit quantity) in the output section, this value - would be 100. However, if the target byte size is 16 bits - (bfd_octets_per_byte is "2"), this value would be 50. */ - bfd_vma output_offset; - - /* The output section through which to map on output. */ - struct bfd_section *output_section; - - /* The alignment requirement of the section, as an exponent of 2 - - e.g., 3 aligns to 2^3 (or 8). */ - unsigned int alignment_power; - - /* If an input section, a pointer to a vector of relocation - records for the data in this section. */ - struct reloc_cache_entry *relocation; - - /* If an output section, a pointer to a vector of pointers to - relocation records for the data in this section. */ - struct reloc_cache_entry **orelocation; - - /* The number of relocation records in one of the above. */ - unsigned reloc_count; - - /* Information below is back end specific - and not always used - or updated. */ - - /* File position of section data. */ - file_ptr filepos; - - /* File position of relocation info. */ - file_ptr rel_filepos; - - /* File position of line data. */ - file_ptr line_filepos; - - /* Pointer to data for applications. */ - void *userdata; - - /* If the SEC_IN_MEMORY flag is set, this points to the actual - contents. */ - unsigned char *contents; - - /* Attached line number information. */ - alent *lineno; - - /* Number of line number records. */ - unsigned int lineno_count; - - /* Entity size for merging purposes. */ - unsigned int entsize; - - /* Points to the kept section if this section is a link-once section, - and is discarded. */ - struct bfd_section *kept_section; - - /* When a section is being output, this value changes as more - linenumbers are written out. */ - file_ptr moving_line_filepos; - - /* What the section number is in the target world. */ - int target_index; - - void *used_by_bfd; - - /* If this is a constructor section then here is a list of the - relocations created to relocate items within it. */ - struct relent_chain *constructor_chain; - - /* The BFD which owns the section. */ - bfd *owner; - - /* A symbol which points at this section only. */ - struct bfd_symbol *symbol; - struct bfd_symbol **symbol_ptr_ptr; - - /* Early in the link process, map_head and map_tail are used to build - a list of input sections attached to an output section. Later, - output sections use these fields for a list of bfd_link_order - structs. */ - union { - struct bfd_link_order *link_order; - struct bfd_section *s; - } map_head, map_tail; - } asection; - - /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a - short address. */ - struct relax_table { - /* Address where bytes may be deleted. */ - bfd_vma addr; - - /* Number of bytes to be deleted. */ - int size; - }; - - /* These sections are global, and are managed by BFD. The application - and target back end are not permitted to change the values in - these sections. */ - extern asection _bfd_std_section[4]; - - #define BFD_ABS_SECTION_NAME "*ABS*" - #define BFD_UND_SECTION_NAME "*UND*" - #define BFD_COM_SECTION_NAME "*COM*" - #define BFD_IND_SECTION_NAME "*IND*" - - /* Pointer to the common section. */ - #define bfd_com_section_ptr (&_bfd_std_section[0]) - /* Pointer to the undefined section. */ - #define bfd_und_section_ptr (&_bfd_std_section[1]) - /* Pointer to the absolute section. */ - #define bfd_abs_section_ptr (&_bfd_std_section[2]) - /* Pointer to the indirect section. */ - #define bfd_ind_section_ptr (&_bfd_std_section[3]) - - #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) - #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) - #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) - - #define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) - - /* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ - #define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) - #define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) - #define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) - #define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) - #define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) - #define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) - - #define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ - /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ - \ - /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ - 0, 0, 1, 0, \ - \ - /* segment_mark, sec_info_type, use_rela_p, */ \ - 0, 0, 0, \ - \ - /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \ - 0, 0, 0, 0, 0, 0, \ - \ - /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \ - 0, 0, 0, 0, 0, 0, 0, \ - \ - /* output_offset, output_section, alignment_power, */ \ - 0, &SEC, 0, \ - \ - /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \ - NULL, NULL, 0, 0, 0, \ - \ - /* line_filepos, userdata, contents, lineno, lineno_count, */ \ - 0, NULL, NULL, NULL, 0, \ - \ - /* entsize, kept_section, moving_line_filepos, */ \ - 0, NULL, 0, \ - \ - /* target_index, used_by_bfd, constructor_chain, owner, */ \ - 0, NULL, NULL, NULL, \ - \ - /* symbol, symbol_ptr_ptr, */ \ - (struct bfd_symbol *) SYM, &SEC.symbol, \ - \ - /* map_head, map_tail */ \ - { NULL }, { NULL } \ - } - - -File: bfd.info, Node: section prototypes, Prev: typedef asection, Up: Sections - -2.6.5 Section prototypes ------------------------- - -These are the functions exported by the section handling part of BFD. - -2.6.5.1 `bfd_section_list_clear' -................................ - -*Synopsis* - void bfd_section_list_clear (bfd *); - *Description* -Clears the section list, and also resets the section count and hash -table entries. - -2.6.5.2 `bfd_get_section_by_name' -................................. - -*Synopsis* - asection *bfd_get_section_by_name (bfd *abfd, const char *name); - *Description* -Return the most recently created section attached to ABFD named NAME. -Return NULL if no such section exists. - -2.6.5.3 `bfd_get_next_section_by_name' -...................................... - -*Synopsis* - asection *bfd_get_next_section_by_name (asection *sec); - *Description* -Given SEC is a section returned by `bfd_get_section_by_name', return -the next most recently created section attached to the same BFD with -the same name. Return NULL if no such section exists. - -2.6.5.4 `bfd_get_linker_section' -................................ - -*Synopsis* - asection *bfd_get_linker_section (bfd *abfd, const char *name); - *Description* -Return the linker created section attached to ABFD named NAME. Return -NULL if no such section exists. - -2.6.5.5 `bfd_get_section_by_name_if' -.................................... - -*Synopsis* - asection *bfd_get_section_by_name_if - (bfd *abfd, - const char *name, - bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), - void *obj); - *Description* -Call the provided function FUNC for each section attached to the BFD -ABFD whose name matches NAME, passing OBJ as an argument. The function -will be called as if by - - func (abfd, the_section, obj); - - It returns the first section for which FUNC returns true, otherwise -`NULL'. - -2.6.5.6 `bfd_get_unique_section_name' -..................................... - -*Synopsis* - char *bfd_get_unique_section_name - (bfd *abfd, const char *templat, int *count); - *Description* -Invent a section name that is unique in ABFD by tacking a dot and a -digit suffix onto the original TEMPLAT. If COUNT is non-NULL, then it -specifies the first number tried as a suffix to generate a unique name. -The value pointed to by COUNT will be incremented in this case. - -2.6.5.7 `bfd_make_section_old_way' -.................................. - -*Synopsis* - asection *bfd_make_section_old_way (bfd *abfd, const char *name); - *Description* -Create a new empty section called NAME and attach it to the end of the -chain of sections for the BFD ABFD. An attempt to create a section with -a name which is already in use returns its pointer without changing the -section chain. - - It has the funny name since this is the way it used to be before it -was rewritten.... - - Possible errors are: - * `bfd_error_invalid_operation' - If output has already started for - this BFD. - - * `bfd_error_no_memory' - If memory allocation fails. - -2.6.5.8 `bfd_make_section_anyway_with_flags' -............................................ - -*Synopsis* - asection *bfd_make_section_anyway_with_flags - (bfd *abfd, const char *name, flagword flags); - *Description* -Create a new empty section called NAME and attach it to the end of the -chain of sections for ABFD. Create a new section even if there is -already a section with that name. Also set the attributes of the new -section to the value FLAGS. - - Return `NULL' and set `bfd_error' on error; possible errors are: - * `bfd_error_invalid_operation' - If output has already started for - ABFD. - - * `bfd_error_no_memory' - If memory allocation fails. - -2.6.5.9 `bfd_make_section_anyway' -................................. - -*Synopsis* - asection *bfd_make_section_anyway (bfd *abfd, const char *name); - *Description* -Create a new empty section called NAME and attach it to the end of the -chain of sections for ABFD. Create a new section even if there is -already a section with that name. - - Return `NULL' and set `bfd_error' on error; possible errors are: - * `bfd_error_invalid_operation' - If output has already started for - ABFD. - - * `bfd_error_no_memory' - If memory allocation fails. - -2.6.5.10 `bfd_make_section_with_flags' -...................................... - -*Synopsis* - asection *bfd_make_section_with_flags - (bfd *, const char *name, flagword flags); - *Description* -Like `bfd_make_section_anyway', but return `NULL' (without calling -bfd_set_error ()) without changing the section chain if there is -already a section named NAME. Also set the attributes of the new -section to the value FLAGS. If there is an error, return `NULL' and set -`bfd_error'. - -2.6.5.11 `bfd_make_section' -........................... - -*Synopsis* - asection *bfd_make_section (bfd *, const char *name); - *Description* -Like `bfd_make_section_anyway', but return `NULL' (without calling -bfd_set_error ()) without changing the section chain if there is -already a section named NAME. If there is an error, return `NULL' and -set `bfd_error'. - -2.6.5.12 `bfd_set_section_flags' -................................ - -*Synopsis* - bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); - *Description* -Set the attributes of the section SEC in the BFD ABFD to the value -FLAGS. Return `TRUE' on success, `FALSE' on error. Possible error -returns are: - - * `bfd_error_invalid_operation' - The section cannot have one or - more of the attributes requested. For example, a .bss section in - `a.out' may not have the `SEC_HAS_CONTENTS' field set. - -2.6.5.13 `bfd_rename_section' -............................. - -*Synopsis* - void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); - *Description* -Rename section SEC in ABFD to NEWNAME. - -2.6.5.14 `bfd_map_over_sections' -................................ - -*Synopsis* - void bfd_map_over_sections - (bfd *abfd, - void (*func) (bfd *abfd, asection *sect, void *obj), - void *obj); - *Description* -Call the provided function FUNC for each section attached to the BFD -ABFD, passing OBJ as an argument. The function will be called as if by - - func (abfd, the_section, obj); - - This is the preferred method for iterating over sections; an -alternative would be to use a loop: - - asection *p; - for (p = abfd->sections; p != NULL; p = p->next) - func (abfd, p, ...) - -2.6.5.15 `bfd_sections_find_if' -............................... - -*Synopsis* - asection *bfd_sections_find_if - (bfd *abfd, - bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), - void *obj); - *Description* -Call the provided function OPERATION for each section attached to the -BFD ABFD, passing OBJ as an argument. The function will be called as if -by - - operation (abfd, the_section, obj); - - It returns the first section for which OPERATION returns true. - -2.6.5.16 `bfd_set_section_size' -............................... - -*Synopsis* - bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); - *Description* -Set SEC to the size VAL. If the operation is ok, then `TRUE' is -returned, else `FALSE'. - - Possible error returns: - * `bfd_error_invalid_operation' - Writing has started to the BFD, so - setting the size is invalid. - -2.6.5.17 `bfd_set_section_contents' -................................... - -*Synopsis* - bfd_boolean bfd_set_section_contents - (bfd *abfd, asection *section, const void *data, - file_ptr offset, bfd_size_type count); - *Description* -Sets the contents of the section SECTION in BFD ABFD to the data -starting in memory at DATA. The data is written to the output section -starting at offset OFFSET for COUNT octets. - - Normally `TRUE' is returned, else `FALSE'. Possible error returns -are: - * `bfd_error_no_contents' - The output section does not have the - `SEC_HAS_CONTENTS' attribute, so nothing can be written to it. - - * and some more too - This routine is front end to the back end function -`_bfd_set_section_contents'. - -2.6.5.18 `bfd_get_section_contents' -................................... - -*Synopsis* - bfd_boolean bfd_get_section_contents - (bfd *abfd, asection *section, void *location, file_ptr offset, - bfd_size_type count); - *Description* -Read data from SECTION in BFD ABFD into memory starting at LOCATION. -The data is read at an offset of OFFSET from the start of the input -section, and is read for COUNT bytes. - - If the contents of a constructor with the `SEC_CONSTRUCTOR' flag set -are requested or if the section does not have the `SEC_HAS_CONTENTS' -flag set, then the LOCATION is filled with zeroes. If no errors occur, -`TRUE' is returned, else `FALSE'. - -2.6.5.19 `bfd_malloc_and_get_section' -..................................... - -*Synopsis* - bfd_boolean bfd_malloc_and_get_section - (bfd *abfd, asection *section, bfd_byte **buf); - *Description* -Read all data from SECTION in BFD ABFD into a buffer, *BUF, malloc'd by -this function. - -2.6.5.20 `bfd_copy_private_section_data' -........................................ - -*Synopsis* - bfd_boolean bfd_copy_private_section_data - (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); - *Description* -Copy private section information from ISEC in the BFD IBFD to the -section OSEC in the BFD OBFD. Return `TRUE' on success, `FALSE' on -error. Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OSEC. - - #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) - -2.6.5.21 `bfd_generic_is_group_section' -....................................... - -*Synopsis* - bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); - *Description* -Returns TRUE if SEC is a member of a group. - -2.6.5.22 `bfd_generic_discard_group' -.................................... - -*Synopsis* - bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); - *Description* -Remove all members of GROUP from the output. - - -File: bfd.info, Node: Symbols, Next: Archives, Prev: Sections, Up: BFD front end - -2.7 Symbols -=========== - -BFD tries to maintain as much symbol information as it can when it -moves information from file to file. BFD passes information to -applications though the `asymbol' structure. When the application -requests the symbol table, BFD reads the table in the native form and -translates parts of it into the internal format. To maintain more than -the information passed to applications, some targets keep some -information "behind the scenes" in a structure only the particular back -end knows about. For example, the coff back end keeps the original -symbol table structure as well as the canonical structure when a BFD is -read in. On output, the coff back end can reconstruct the output symbol -table so that no information is lost, even information unique to coff -which BFD doesn't know or understand. If a coff symbol table were read, -but were written through an a.out back end, all the coff specific -information would be lost. The symbol table of a BFD is not necessarily -read in until a canonicalize request is made. Then the BFD back end -fills in a table provided by the application with pointers to the -canonical information. To output symbols, the application provides BFD -with a table of pointers to pointers to `asymbol's. This allows -applications like the linker to output a symbol as it was read, since -the "behind the scenes" information will be still available. - -* Menu: - -* Reading Symbols:: -* Writing Symbols:: -* Mini Symbols:: -* typedef asymbol:: -* symbol handling functions:: - - -File: bfd.info, Node: Reading Symbols, Next: Writing Symbols, Prev: Symbols, Up: Symbols - -2.7.1 Reading symbols ---------------------- - -There are two stages to reading a symbol table from a BFD: allocating -storage, and the actual reading process. This is an excerpt from an -application which reads the symbol table: - - long storage_needed; - asymbol **symbol_table; - long number_of_symbols; - long i; - - storage_needed = bfd_get_symtab_upper_bound (abfd); - - if (storage_needed < 0) - FAIL - - if (storage_needed == 0) - return; - - symbol_table = xmalloc (storage_needed); - ... - number_of_symbols = - bfd_canonicalize_symtab (abfd, symbol_table); - - if (number_of_symbols < 0) - FAIL - - for (i = 0; i < number_of_symbols; i++) - process_symbol (symbol_table[i]); - - All storage for the symbols themselves is in an objalloc connected -to the BFD; it is freed when the BFD is closed. - - -File: bfd.info, Node: Writing Symbols, Next: Mini Symbols, Prev: Reading Symbols, Up: Symbols - -2.7.2 Writing symbols ---------------------- - -Writing of a symbol table is automatic when a BFD open for writing is -closed. The application attaches a vector of pointers to pointers to -symbols to the BFD being written, and fills in the symbol count. The -close and cleanup code reads through the table provided and performs -all the necessary operations. The BFD output code must always be -provided with an "owned" symbol: one which has come from another BFD, -or one which has been created using `bfd_make_empty_symbol'. Here is an -example showing the creation of a symbol table with only one element: - - #include "sysdep.h" - #include "bfd.h" - int main (void) - { - bfd *abfd; - asymbol *ptrs[2]; - asymbol *new; - - abfd = bfd_openw ("foo","a.out-sunos-big"); - bfd_set_format (abfd, bfd_object); - new = bfd_make_empty_symbol (abfd); - new->name = "dummy_symbol"; - new->section = bfd_make_section_old_way (abfd, ".text"); - new->flags = BSF_GLOBAL; - new->value = 0x12345; - - ptrs[0] = new; - ptrs[1] = 0; - - bfd_set_symtab (abfd, ptrs, 1); - bfd_close (abfd); - return 0; - } - - ./makesym - nm foo - 00012345 A dummy_symbol - - Many formats cannot represent arbitrary symbol information; for -instance, the `a.out' object format does not allow an arbitrary number -of sections. A symbol pointing to a section which is not one of -`.text', `.data' or `.bss' cannot be described. - - -File: bfd.info, Node: Mini Symbols, Next: typedef asymbol, Prev: Writing Symbols, Up: Symbols - -2.7.3 Mini Symbols ------------------- - -Mini symbols provide read-only access to the symbol table. They use -less memory space, but require more time to access. They can be useful -for tools like nm or objdump, which may have to handle symbol tables of -extremely large executables. - - The `bfd_read_minisymbols' function will read the symbols into -memory in an internal form. It will return a `void *' pointer to a -block of memory, a symbol count, and the size of each symbol. The -pointer is allocated using `malloc', and should be freed by the caller -when it is no longer needed. - - The function `bfd_minisymbol_to_symbol' will take a pointer to a -minisymbol, and a pointer to a structure returned by -`bfd_make_empty_symbol', and return a `asymbol' structure. The return -value may or may not be the same as the value from -`bfd_make_empty_symbol' which was passed in. - - -File: bfd.info, Node: typedef asymbol, Next: symbol handling functions, Prev: Mini Symbols, Up: Symbols - -2.7.4 typedef asymbol ---------------------- - -An `asymbol' has the form: - - - typedef struct bfd_symbol - { - /* A pointer to the BFD which owns the symbol. This information - is necessary so that a back end can work out what additional - information (invisible to the application writer) is carried - with the symbol. - - This field is *almost* redundant, since you can use section->owner - instead, except that some symbols point to the global sections - bfd_{abs,com,und}_section. This could be fixed by making - these globals be per-bfd (or per-target-flavor). FIXME. */ - struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ - - /* The text of the symbol. The name is left alone, and not copied; the - application may not alter it. */ - const char *name; - - /* The value of the symbol. This really should be a union of a - numeric value with a pointer, since some flags indicate that - a pointer to another symbol is stored here. */ - symvalue value; - - /* Attributes of a symbol. */ - #define BSF_NO_FLAGS 0x00 - - /* The symbol has local scope; `static' in `C'. The value - is the offset into the section of the data. */ - #define BSF_LOCAL (1 << 0) - - /* The symbol has global scope; initialized data in `C'. The - value is the offset into the section of the data. */ - #define BSF_GLOBAL (1 << 1) - - /* The symbol has global scope and is exported. The value is - the offset into the section of the data. */ - #define BSF_EXPORT BSF_GLOBAL /* No real difference. */ - - /* A normal C symbol would be one of: - `BSF_LOCAL', `BSF_COMMON', `BSF_UNDEFINED' or - `BSF_GLOBAL'. */ - - /* The symbol is a debugging record. The value has an arbitrary - meaning, unless BSF_DEBUGGING_RELOC is also set. */ - #define BSF_DEBUGGING (1 << 2) - - /* The symbol denotes a function entry point. Used in ELF, - perhaps others someday. */ - #define BSF_FUNCTION (1 << 3) - - /* Used by the linker. */ - #define BSF_KEEP (1 << 5) - #define BSF_KEEP_G (1 << 6) - - /* A weak global symbol, overridable without warnings by - a regular global symbol of the same name. */ - #define BSF_WEAK (1 << 7) - - /* This symbol was created to point to a section, e.g. ELF's - STT_SECTION symbols. */ - #define BSF_SECTION_SYM (1 << 8) - - /* The symbol used to be a common symbol, but now it is - allocated. */ - #define BSF_OLD_COMMON (1 << 9) - - /* In some files the type of a symbol sometimes alters its - location in an output file - ie in coff a `ISFCN' symbol - which is also `C_EXT' symbol appears where it was - declared and not at the end of a section. This bit is set - by the target BFD part to convey this information. */ - #define BSF_NOT_AT_END (1 << 10) - - /* Signal that the symbol is the label of constructor section. */ - #define BSF_CONSTRUCTOR (1 << 11) - - /* Signal that the symbol is a warning symbol. The name is a - warning. The name of the next symbol is the one to warn about; - if a reference is made to a symbol with the same name as the next - symbol, a warning is issued by the linker. */ - #define BSF_WARNING (1 << 12) - - /* Signal that the symbol is indirect. This symbol is an indirect - pointer to the symbol with the same name as the next symbol. */ - #define BSF_INDIRECT (1 << 13) - - /* BSF_FILE marks symbols that contain a file name. This is used - for ELF STT_FILE symbols. */ - #define BSF_FILE (1 << 14) - - /* Symbol is from dynamic linking information. */ - #define BSF_DYNAMIC (1 << 15) - - /* The symbol denotes a data object. Used in ELF, and perhaps - others someday. */ - #define BSF_OBJECT (1 << 16) - - /* This symbol is a debugging symbol. The value is the offset - into the section of the data. BSF_DEBUGGING should be set - as well. */ - #define BSF_DEBUGGING_RELOC (1 << 17) - - /* This symbol is thread local. Used in ELF. */ - #define BSF_THREAD_LOCAL (1 << 18) - - /* This symbol represents a complex relocation expression, - with the expression tree serialized in the symbol name. */ - #define BSF_RELC (1 << 19) - - /* This symbol represents a signed complex relocation expression, - with the expression tree serialized in the symbol name. */ - #define BSF_SRELC (1 << 20) - - /* This symbol was created by bfd_get_synthetic_symtab. */ - #define BSF_SYNTHETIC (1 << 21) - - /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. - The dynamic linker will compute the value of this symbol by - calling the function that it points to. BSF_FUNCTION must - also be also set. */ - #define BSF_GNU_INDIRECT_FUNCTION (1 << 22) - /* This symbol is a globally unique data object. The dynamic linker - will make sure that in the entire process there is just one symbol - with this name and type in use. BSF_OBJECT must also be set. */ - #define BSF_GNU_UNIQUE (1 << 23) - - flagword flags; - - /* A pointer to the section to which this symbol is - relative. This will always be non NULL, there are special - sections for undefined and absolute symbols. */ - struct bfd_section *section; - - /* Back end special data. */ - union - { - void *p; - bfd_vma i; - } - udata; - } - asymbol; - - -File: bfd.info, Node: symbol handling functions, Prev: typedef asymbol, Up: Symbols - -2.7.5 Symbol handling functions -------------------------------- - -2.7.5.1 `bfd_get_symtab_upper_bound' -.................................... - -*Description* -Return the number of bytes required to store a vector of pointers to -`asymbols' for all the symbols in the BFD ABFD, including a terminal -NULL pointer. If there are no symbols in the BFD, then return 0. If an -error occurs, return -1. - #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) - -2.7.5.2 `bfd_is_local_label' -............................ - -*Synopsis* - bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); - *Description* -Return TRUE if the given symbol SYM in the BFD ABFD is a compiler -generated local label, else return FALSE. - -2.7.5.3 `bfd_is_local_label_name' -................................. - -*Synopsis* - bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); - *Description* -Return TRUE if a symbol with the name NAME in the BFD ABFD is a -compiler generated local label, else return FALSE. This just checks -whether the name has the form of a local label. - #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) - -2.7.5.4 `bfd_is_target_special_symbol' -...................................... - -*Synopsis* - bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); - *Description* -Return TRUE iff a symbol SYM in the BFD ABFD is something special to -the particular target represented by the BFD. Such symbols should -normally not be mentioned to the user. - #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) - -2.7.5.5 `bfd_canonicalize_symtab' -................................. - -*Description* -Read the symbols from the BFD ABFD, and fills in the vector LOCATION -with pointers to the symbols and a trailing NULL. Return the actual -number of symbol pointers, not including the NULL. - #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) - -2.7.5.6 `bfd_set_symtab' -........................ - -*Synopsis* - bfd_boolean bfd_set_symtab - (bfd *abfd, asymbol **location, unsigned int count); - *Description* -Arrange that when the output BFD ABFD is closed, the table LOCATION of -COUNT pointers to symbols will be written. - -2.7.5.7 `bfd_print_symbol_vandf' -................................ - -*Synopsis* - void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); - *Description* -Print the value and flags of the SYMBOL supplied to the stream FILE. - -2.7.5.8 `bfd_make_empty_symbol' -............................... - -*Description* -Create a new `asymbol' structure for the BFD ABFD and return a pointer -to it. - - This routine is necessary because each back end has private -information surrounding the `asymbol'. Building your own `asymbol' and -pointing to it will not create the private information, and will cause -problems later on. - #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) - -2.7.5.9 `_bfd_generic_make_empty_symbol' -........................................ - -*Synopsis* - asymbol *_bfd_generic_make_empty_symbol (bfd *); - *Description* -Create a new `asymbol' structure for the BFD ABFD and return a pointer -to it. Used by core file routines, binary back-end and anywhere else -where no private info is needed. - -2.7.5.10 `bfd_make_debug_symbol' -................................ - -*Description* -Create a new `asymbol' structure for the BFD ABFD, to be used as a -debugging symbol. Further details of its use have yet to be worked out. - #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) - -2.7.5.11 `bfd_decode_symclass' -.............................. - -*Description* -Return a character corresponding to the symbol class of SYMBOL, or '?' -for an unknown class. - - *Synopsis* - int bfd_decode_symclass (asymbol *symbol); - -2.7.5.12 `bfd_is_undefined_symclass' -.................................... - -*Description* -Returns non-zero if the class symbol returned by bfd_decode_symclass -represents an undefined symbol. Returns zero otherwise. - - *Synopsis* - bfd_boolean bfd_is_undefined_symclass (int symclass); - -2.7.5.13 `bfd_symbol_info' -.......................... - -*Description* -Fill in the basic info about symbol that nm needs. Additional info may -be added by the back-ends after calling this function. - - *Synopsis* - void bfd_symbol_info (asymbol *symbol, symbol_info *ret); - -2.7.5.14 `bfd_copy_private_symbol_data' -....................................... - -*Synopsis* - bfd_boolean bfd_copy_private_symbol_data - (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); - *Description* -Copy private symbol information from ISYM in the BFD IBFD to the symbol -OSYM in the BFD OBFD. Return `TRUE' on success, `FALSE' on error. -Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OSEC. - - #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) - - -File: bfd.info, Node: Archives, Next: Formats, Prev: Symbols, Up: BFD front end - -2.8 Archives -============ - -*Description* -An archive (or library) is just another BFD. It has a symbol table, -although there's not much a user program will do with it. - - The big difference between an archive BFD and an ordinary BFD is -that the archive doesn't have sections. Instead it has a chain of BFDs -that are considered its contents. These BFDs can be manipulated like -any other. The BFDs contained in an archive opened for reading will -all be opened for reading. You may put either input or output BFDs -into an archive opened for output; they will be handled correctly when -the archive is closed. - - Use `bfd_openr_next_archived_file' to step through the contents of -an archive opened for input. You don't have to read the entire archive -if you don't want to! Read it until you find what you want. - - A BFD returned by `bfd_openr_next_archived_file' can be closed -manually with `bfd_close'. If you do not close it, then a second -iteration through the members of an archive may return the same BFD. -If you close the archive BFD, then all the member BFDs will -automatically be closed as well. - - Archive contents of output BFDs are chained through the -`archive_next' pointer in a BFD. The first one is findable through the -`archive_head' slot of the archive. Set it with `bfd_set_archive_head' -(q.v.). A given BFD may be in only one open output archive at a time. - - As expected, the BFD archive code is more general than the archive -code of any given environment. BFD archives may contain files of -different formats (e.g., a.out and coff) and even different -architectures. You may even place archives recursively into archives! - - This can cause unexpected confusion, since some archive formats are -more expressive than others. For instance, Intel COFF archives can -preserve long filenames; SunOS a.out archives cannot. If you move a -file from the first to the second format and back again, the filename -may be truncated. Likewise, different a.out environments have different -conventions as to how they truncate filenames, whether they preserve -directory names in filenames, etc. When interoperating with native -tools, be sure your files are homogeneous. - - Beware: most of these formats do not react well to the presence of -spaces in filenames. We do the best we can, but can't always handle -this case due to restrictions in the format of archives. Many Unix -utilities are braindead in regards to spaces and such in filenames -anyway, so this shouldn't be much of a restriction. - - Archives are supported in BFD in `archive.c'. - -2.8.1 Archive functions ------------------------ - -2.8.1.1 `bfd_get_next_mapent' -............................. - -*Synopsis* - symindex bfd_get_next_mapent - (bfd *abfd, symindex previous, carsym **sym); - *Description* -Step through archive ABFD's symbol table (if it has one). Successively -update SYM with the next symbol's information, returning that symbol's -(internal) index into the symbol table. - - Supply `BFD_NO_MORE_SYMBOLS' as the PREVIOUS entry to get the first -one; returns `BFD_NO_MORE_SYMBOLS' when you've already got the last one. - - A `carsym' is a canonical archive symbol. The only user-visible -element is its name, a null-terminated string. - -2.8.1.2 `bfd_set_archive_head' -.............................. - -*Synopsis* - bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); - *Description* -Set the head of the chain of BFDs contained in the archive OUTPUT to -NEW_HEAD. - -2.8.1.3 `bfd_openr_next_archived_file' -...................................... - -*Synopsis* - bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); - *Description* -Provided a BFD, ARCHIVE, containing an archive and NULL, open an input -BFD on the first contained element and returns that. Subsequent calls -should pass the archive and the previous return value to return a -created BFD to the next contained element. NULL is returned when there -are no more. - - -File: bfd.info, Node: Formats, Next: Relocations, Prev: Archives, Up: BFD front end - -2.9 File formats -================ - -A format is a BFD concept of high level file contents type. The formats -supported by BFD are: - - * `bfd_object' - The BFD may contain data, symbols, relocations and debug info. - - * `bfd_archive' - The BFD contains other BFDs and an optional index. - - * `bfd_core' - The BFD contains the result of an executable core dump. - -2.9.1 File format functions ---------------------------- - -2.9.1.1 `bfd_check_format' -.......................... - -*Synopsis* - bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); - *Description* -Verify if the file attached to the BFD ABFD is compatible with the -format FORMAT (i.e., one of `bfd_object', `bfd_archive' or `bfd_core'). - - If the BFD has been set to a specific target before the call, only -the named target and format combination is checked. If the target has -not been set, or has been set to `default', then all the known target -backends is interrogated to determine a match. If the default target -matches, it is used. If not, exactly one target must recognize the -file, or an error results. - - The function returns `TRUE' on success, otherwise `FALSE' with one -of the following error codes: - - * `bfd_error_invalid_operation' - if `format' is not one of - `bfd_object', `bfd_archive' or `bfd_core'. - - * `bfd_error_system_call' - if an error occured during a read - even - some file mismatches can cause bfd_error_system_calls. - - * `file_not_recognised' - none of the backends recognised the file - format. - - * `bfd_error_file_ambiguously_recognized' - more than one backend - recognised the file format. - -2.9.1.2 `bfd_check_format_matches' -.................................. - -*Synopsis* - bfd_boolean bfd_check_format_matches - (bfd *abfd, bfd_format format, char ***matching); - *Description* -Like `bfd_check_format', except when it returns FALSE with `bfd_errno' -set to `bfd_error_file_ambiguously_recognized'. In that case, if -MATCHING is not NULL, it will be filled in with a NULL-terminated list -of the names of the formats that matched, allocated with `malloc'. -Then the user may choose a format and try again. - - When done with the list that MATCHING points to, the caller should -free it. - -2.9.1.3 `bfd_set_format' -........................ - -*Synopsis* - bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); - *Description* -This function sets the file format of the BFD ABFD to the format -FORMAT. If the target set in the BFD does not support the format -requested, the format is invalid, or the BFD is not open for writing, -then an error occurs. - -2.9.1.4 `bfd_format_string' -........................... - -*Synopsis* - const char *bfd_format_string (bfd_format format); - *Description* -Return a pointer to a const string `invalid', `object', `archive', -`core', or `unknown', depending upon the value of FORMAT. - - -File: bfd.info, Node: Relocations, Next: Core Files, Prev: Formats, Up: BFD front end - -2.10 Relocations -================ - -BFD maintains relocations in much the same way it maintains symbols: -they are left alone until required, then read in en-masse and -translated into an internal form. A common routine -`bfd_perform_relocation' acts upon the canonical form to do the fixup. - - Relocations are maintained on a per section basis, while symbols are -maintained on a per BFD basis. - - All that a back end has to do to fit the BFD interface is to create -a `struct reloc_cache_entry' for each relocation in a particular -section, and fill in the right bits of the structures. - -* Menu: - -* typedef arelent:: -* howto manager:: - - -File: bfd.info, Node: typedef arelent, Next: howto manager, Prev: Relocations, Up: Relocations - -2.10.1 typedef arelent ----------------------- - -This is the structure of a relocation entry: - - - typedef enum bfd_reloc_status - { - /* No errors detected. */ - bfd_reloc_ok, - - /* The relocation was performed, but there was an overflow. */ - bfd_reloc_overflow, - - /* The address to relocate was not within the section supplied. */ - bfd_reloc_outofrange, - - /* Used by special functions. */ - bfd_reloc_continue, - - /* Unsupported relocation size requested. */ - bfd_reloc_notsupported, - - /* Unused. */ - bfd_reloc_other, - - /* The symbol to relocate against was undefined. */ - bfd_reloc_undefined, - - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ - bfd_reloc_dangerous - } - bfd_reloc_status_type; - - - typedef struct reloc_cache_entry - { - /* A pointer into the canonical table of pointers. */ - struct bfd_symbol **sym_ptr_ptr; - - /* offset in section. */ - bfd_size_type address; - - /* addend for relocation value. */ - bfd_vma addend; - - /* Pointer to how to perform the required relocation. */ - reloc_howto_type *howto; - - } - arelent; - *Description* -Here is a description of each of the fields within an `arelent': - - * `sym_ptr_ptr' - The symbol table pointer points to a pointer to the symbol -associated with the relocation request. It is the pointer into the -table returned by the back end's `canonicalize_symtab' action. *Note -Symbols::. The symbol is referenced through a pointer to a pointer so -that tools like the linker can fix up all the symbols of the same name -by modifying only one pointer. The relocation routine looks in the -symbol and uses the base of the section the symbol is attached to and -the value of the symbol as the initial relocation offset. If the symbol -pointer is zero, then the section provided is looked up. - - * `address' - The `address' field gives the offset in bytes from the base of the -section data which owns the relocation record to the first byte of -relocatable information. The actual data relocated will be relative to -this point; for example, a relocation type which modifies the bottom -two bytes of a four byte word would not touch the first byte pointed to -in a big endian world. - - * `addend' - The `addend' is a value provided by the back end to be added (!) to -the relocation offset. Its interpretation is dependent upon the howto. -For example, on the 68k the code: - - char foo[]; - main() - { - return foo[0x12345678]; - } - - Could be compiled into: - - linkw fp,#-4 - moveb @#12345678,d0 - extbl d0 - unlk fp - rts - - This could create a reloc pointing to `foo', but leave the offset in -the data, something like: - - RELOCATION RECORDS FOR [.text]: - offset type value - 00000006 32 _foo - - 00000000 4e56 fffc ; linkw fp,#-4 - 00000004 1039 1234 5678 ; moveb @#12345678,d0 - 0000000a 49c0 ; extbl d0 - 0000000c 4e5e ; unlk fp - 0000000e 4e75 ; rts - - Using coff and an 88k, some instructions don't have enough space in -them to represent the full address range, and pointers have to be -loaded in two parts. So you'd get something like: - - or.u r13,r0,hi16(_foo+0x12345678) - ld.b r2,r13,lo16(_foo+0x12345678) - jmp r1 - - This should create two relocs, both pointing to `_foo', and with -0x12340000 in their addend field. The data would consist of: - - RELOCATION RECORDS FOR [.text]: - offset type value - 00000002 HVRT16 _foo+0x12340000 - 00000006 LVRT16 _foo+0x12340000 - - 00000000 5da05678 ; or.u r13,r0,0x5678 - 00000004 1c4d5678 ; ld.b r2,r13,0x5678 - 00000008 f400c001 ; jmp r1 - - The relocation routine digs out the value from the data, adds it to -the addend to get the original offset, and then adds the value of -`_foo'. Note that all 32 bits have to be kept around somewhere, to cope -with carry from bit 15 to bit 16. - - One further example is the sparc and the a.out format. The sparc has -a similar problem to the 88k, in that some instructions don't have room -for an entire offset, but on the sparc the parts are created in odd -sized lumps. The designers of the a.out format chose to not use the -data within the section for storing part of the offset; all the offset -is kept within the reloc. Anything in the data should be ignored. - - save %sp,-112,%sp - sethi %hi(_foo+0x12345678),%g2 - ldsb [%g2+%lo(_foo+0x12345678)],%i0 - ret - restore - - Both relocs contain a pointer to `foo', and the offsets contain junk. - - RELOCATION RECORDS FOR [.text]: - offset type value - 00000004 HI22 _foo+0x12345678 - 00000008 LO10 _foo+0x12345678 - - 00000000 9de3bf90 ; save %sp,-112,%sp - 00000004 05000000 ; sethi %hi(_foo+0),%g2 - 00000008 f048a000 ; ldsb [%g2+%lo(_foo+0)],%i0 - 0000000c 81c7e008 ; ret - 00000010 81e80000 ; restore - - * `howto' - The `howto' field can be imagined as a relocation instruction. It is -a pointer to a structure which contains information on what to do with -all of the other information in the reloc record and data section. A -back end would normally have a relocation instruction set and turn -relocations into pointers to the correct structure on input - but it -would be possible to create each howto field on demand. - -2.10.1.1 `enum complain_overflow' -................................. - -Indicates what sort of overflow checking should be done when performing -a relocation. - - - enum complain_overflow - { - /* Do not complain on overflow. */ - complain_overflow_dont, - - /* Complain if the value overflows when considered as a signed - number one bit larger than the field. ie. A bitfield of N bits - is allowed to represent -2**n to 2**n-1. */ - complain_overflow_bitfield, - - /* Complain if the value overflows when considered as a signed - number. */ - complain_overflow_signed, - - /* Complain if the value overflows when considered as an - unsigned number. */ - complain_overflow_unsigned - }; - -2.10.1.2 `reloc_howto_type' -........................... - -The `reloc_howto_type' is a structure which contains all the -information that libbfd needs to know to tie up a back end's data. - - struct bfd_symbol; /* Forward declaration. */ - - struct reloc_howto_struct - { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ - unsigned int type; - - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; - - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; - - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; - - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; - - /* What type of overflow error should be checked for when - relocating. */ - enum complain_overflow complain_on_overflow; - - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); - - /* The textual name of the relocation type. */ - char *name; - - /* Some formats record a relocation addend in the section contents - rather than with the relocation. For ELF formats this is the - distinction between USE_REL and USE_RELA (though the code checks - for USE_REL == 1/0). The value of this field is TRUE if the - addend is recorded with the section contents; when performing a - partial link (ld -r) the section contents (the data) will be - modified. The value of this field is FALSE if addends are - recorded with the relocation (in arelent.addend); when performing - a partial link the relocation will be modified. - All relocations for all ELF USE_RELA targets should set this field - to FALSE (values of TRUE should be looked on with suspicion). - However, the converse is not true: not all relocations of all ELF - USE_REL targets set this field to TRUE. Why this is so is peculiar - to each particular target. For relocs that aren't used in partial - links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; - - /* When some formats create PC relative instructions, they leave - the value of the pc of the place being relocated in the offset - slot of the instruction, so that a PC relative relocation can - be made just by adding in an ordinary offset (e.g., sun3 a.out). - Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; - }; - -2.10.1.3 `The HOWTO Macro' -.......................... - -*Description* -The HOWTO define is horrible and will go away. - #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } - - *Description* -And will be replaced with the totally magic way. But for the moment, we -are compatible, so do it this way. - #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - - *Description* -This is used to fill in an empty howto entry in an array. - #define EMPTY_HOWTO(C) \ - HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ - NULL, FALSE, 0, 0, FALSE) - - *Description* -Helper routine to turn a symbol into a relocation value. - #define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - -2.10.1.4 `bfd_get_reloc_size' -............................. - -*Synopsis* - unsigned int bfd_get_reloc_size (reloc_howto_type *); - *Description* -For a reloc_howto_type that operates on a fixed number of bytes, this -returns the number of bytes operated on. - -2.10.1.5 `arelent_chain' -........................ - -*Description* -How relocs are tied together in an `asection': - typedef struct relent_chain - { - arelent relent; - struct relent_chain *next; - } - arelent_chain; - -2.10.1.6 `bfd_check_overflow' -............................. - -*Synopsis* - bfd_reloc_status_type bfd_check_overflow - (enum complain_overflow how, - unsigned int bitsize, - unsigned int rightshift, - unsigned int addrsize, - bfd_vma relocation); - *Description* -Perform overflow checking on RELOCATION which has BITSIZE significant -bits and will be shifted right by RIGHTSHIFT bits, on a machine with -addresses containing ADDRSIZE significant bits. The result is either of -`bfd_reloc_ok' or `bfd_reloc_overflow'. - -2.10.1.7 `bfd_perform_relocation' -................................. - -*Synopsis* - bfd_reloc_status_type bfd_perform_relocation - (bfd *abfd, - arelent *reloc_entry, - void *data, - asection *input_section, - bfd *output_bfd, - char **error_message); - *Description* -If OUTPUT_BFD is supplied to this function, the generated image will be -relocatable; the relocations are copied to the output file after they -have been changed to reflect the new state of the world. There are two -ways of reflecting the results of partial linkage in an output file: by -modifying the output data in place, and by modifying the relocation -record. Some native formats (e.g., basic a.out and basic coff) have no -way of specifying an addend in the relocation type, so the addend has -to go in the output data. This is no big deal since in these formats -the output data slot will always be big enough for the addend. Complex -reloc types with addends were invented to solve just this problem. The -ERROR_MESSAGE argument is set to an error message if this return -`bfd_reloc_dangerous'. - -2.10.1.8 `bfd_install_relocation' -................................. - -*Synopsis* - bfd_reloc_status_type bfd_install_relocation - (bfd *abfd, - arelent *reloc_entry, - void *data, bfd_vma data_start, - asection *input_section, - char **error_message); - *Description* -This looks remarkably like `bfd_perform_relocation', except it does not -expect that the section contents have been filled in. I.e., it's -suitable for use when creating, rather than applying a relocation. - - For now, this function should be considered reserved for the -assembler. - - -File: bfd.info, Node: howto manager, Prev: typedef arelent, Up: Relocations - -2.10.2 The howto manager ------------------------- - -When an application wants to create a relocation, but doesn't know what -the target machine might call it, it can find out by using this bit of -code. - -2.10.2.1 `bfd_reloc_code_type' -.............................. - -*Description* -The insides of a reloc code. The idea is that, eventually, there will -be one enumerator for every type of relocation we ever do. Pass one of -these values to `bfd_reloc_type_lookup', and it'll return a howto -pointer. - - This does mean that the application must determine the correct -enumerator value; you can't get a howto pointer from a random set of -attributes. - - Here are the possible values for `enum bfd_reloc_code_real': - - -- : BFD_RELOC_64 - -- : BFD_RELOC_32 - -- : BFD_RELOC_26 - -- : BFD_RELOC_24 - -- : BFD_RELOC_16 - -- : BFD_RELOC_14 - -- : BFD_RELOC_8 - Basic absolute relocations of N bits. - - -- : BFD_RELOC_64_PCREL - -- : BFD_RELOC_32_PCREL - -- : BFD_RELOC_24_PCREL - -- : BFD_RELOC_16_PCREL - -- : BFD_RELOC_12_PCREL - -- : BFD_RELOC_8_PCREL - PC-relative relocations. Sometimes these are relative to the - address of the relocation itself; sometimes they are relative to - the start of the section containing the relocation. It depends on - the specific target. - - The 24-bit relocation is used in some Intel 960 configurations. - - -- : BFD_RELOC_32_SECREL - Section relative relocations. Some targets need this for DWARF2. - - -- : BFD_RELOC_32_GOT_PCREL - -- : BFD_RELOC_16_GOT_PCREL - -- : BFD_RELOC_8_GOT_PCREL - -- : BFD_RELOC_32_GOTOFF - -- : BFD_RELOC_16_GOTOFF - -- : BFD_RELOC_LO16_GOTOFF - -- : BFD_RELOC_HI16_GOTOFF - -- : BFD_RELOC_HI16_S_GOTOFF - -- : BFD_RELOC_8_GOTOFF - -- : BFD_RELOC_64_PLT_PCREL - -- : BFD_RELOC_32_PLT_PCREL - -- : BFD_RELOC_24_PLT_PCREL - -- : BFD_RELOC_16_PLT_PCREL - -- : BFD_RELOC_8_PLT_PCREL - -- : BFD_RELOC_64_PLTOFF - -- : BFD_RELOC_32_PLTOFF - -- : BFD_RELOC_16_PLTOFF - -- : BFD_RELOC_LO16_PLTOFF - -- : BFD_RELOC_HI16_PLTOFF - -- : BFD_RELOC_HI16_S_PLTOFF - -- : BFD_RELOC_8_PLTOFF - For ELF. - - -- : BFD_RELOC_SIZE32 - -- : BFD_RELOC_SIZE64 - Size relocations. - - -- : BFD_RELOC_68K_GLOB_DAT - -- : BFD_RELOC_68K_JMP_SLOT - -- : BFD_RELOC_68K_RELATIVE - -- : BFD_RELOC_68K_TLS_GD32 - -- : BFD_RELOC_68K_TLS_GD16 - -- : BFD_RELOC_68K_TLS_GD8 - -- : BFD_RELOC_68K_TLS_LDM32 - -- : BFD_RELOC_68K_TLS_LDM16 - -- : BFD_RELOC_68K_TLS_LDM8 - -- : BFD_RELOC_68K_TLS_LDO32 - -- : BFD_RELOC_68K_TLS_LDO16 - -- : BFD_RELOC_68K_TLS_LDO8 - -- : BFD_RELOC_68K_TLS_IE32 - -- : BFD_RELOC_68K_TLS_IE16 - -- : BFD_RELOC_68K_TLS_IE8 - -- : BFD_RELOC_68K_TLS_LE32 - -- : BFD_RELOC_68K_TLS_LE16 - -- : BFD_RELOC_68K_TLS_LE8 - Relocations used by 68K ELF. - - -- : BFD_RELOC_32_BASEREL - -- : BFD_RELOC_16_BASEREL - -- : BFD_RELOC_LO16_BASEREL - -- : BFD_RELOC_HI16_BASEREL - -- : BFD_RELOC_HI16_S_BASEREL - -- : BFD_RELOC_8_BASEREL - -- : BFD_RELOC_RVA - Linkage-table relative. - - -- : BFD_RELOC_8_FFnn - Absolute 8-bit relocation, but used to form an address like 0xFFnn. - - -- : BFD_RELOC_32_PCREL_S2 - -- : BFD_RELOC_16_PCREL_S2 - -- : BFD_RELOC_23_PCREL_S2 - These PC-relative relocations are stored as word displacements - - i.e., byte displacements shifted right two bits. The 30-bit word - displacement (<<32_PCREL_S2>> - 32 bits, shifted 2) is used on the - SPARC. (SPARC tools generally refer to this as <>.) The - signed 16-bit displacement is used on the MIPS, and the 23-bit - displacement is used on the Alpha. - - -- : BFD_RELOC_HI22 - -- : BFD_RELOC_LO10 - High 22 bits and low 10 bits of 32-bit value, placed into lower - bits of the target word. These are used on the SPARC. - - -- : BFD_RELOC_GPREL16 - -- : BFD_RELOC_GPREL32 - For systems that allocate a Global Pointer register, these are - displacements off that register. These relocation types are - handled specially, because the value the register will have is - decided relatively late. - - -- : BFD_RELOC_I960_CALLJ - Reloc types used for i960/b.out. - - -- : BFD_RELOC_NONE - -- : BFD_RELOC_SPARC_WDISP22 - -- : BFD_RELOC_SPARC22 - -- : BFD_RELOC_SPARC13 - -- : BFD_RELOC_SPARC_GOT10 - -- : BFD_RELOC_SPARC_GOT13 - -- : BFD_RELOC_SPARC_GOT22 - -- : BFD_RELOC_SPARC_PC10 - -- : BFD_RELOC_SPARC_PC22 - -- : BFD_RELOC_SPARC_WPLT30 - -- : BFD_RELOC_SPARC_COPY - -- : BFD_RELOC_SPARC_GLOB_DAT - -- : BFD_RELOC_SPARC_JMP_SLOT - -- : BFD_RELOC_SPARC_RELATIVE - -- : BFD_RELOC_SPARC_UA16 - -- : BFD_RELOC_SPARC_UA32 - -- : BFD_RELOC_SPARC_UA64 - -- : BFD_RELOC_SPARC_GOTDATA_HIX22 - -- : BFD_RELOC_SPARC_GOTDATA_LOX10 - -- : BFD_RELOC_SPARC_GOTDATA_OP_HIX22 - -- : BFD_RELOC_SPARC_GOTDATA_OP_LOX10 - -- : BFD_RELOC_SPARC_GOTDATA_OP - -- : BFD_RELOC_SPARC_JMP_IREL - -- : BFD_RELOC_SPARC_IRELATIVE - SPARC ELF relocations. There is probably some overlap with other - relocation types already defined. - - -- : BFD_RELOC_SPARC_BASE13 - -- : BFD_RELOC_SPARC_BASE22 - I think these are specific to SPARC a.out (e.g., Sun 4). - - -- : BFD_RELOC_SPARC_64 - -- : BFD_RELOC_SPARC_10 - -- : BFD_RELOC_SPARC_11 - -- : BFD_RELOC_SPARC_OLO10 - -- : BFD_RELOC_SPARC_HH22 - -- : BFD_RELOC_SPARC_HM10 - -- : BFD_RELOC_SPARC_LM22 - -- : BFD_RELOC_SPARC_PC_HH22 - -- : BFD_RELOC_SPARC_PC_HM10 - -- : BFD_RELOC_SPARC_PC_LM22 - -- : BFD_RELOC_SPARC_WDISP16 - -- : BFD_RELOC_SPARC_WDISP19 - -- : BFD_RELOC_SPARC_7 - -- : BFD_RELOC_SPARC_6 - -- : BFD_RELOC_SPARC_5 - -- : BFD_RELOC_SPARC_DISP64 - -- : BFD_RELOC_SPARC_PLT32 - -- : BFD_RELOC_SPARC_PLT64 - -- : BFD_RELOC_SPARC_HIX22 - -- : BFD_RELOC_SPARC_LOX10 - -- : BFD_RELOC_SPARC_H44 - -- : BFD_RELOC_SPARC_M44 - -- : BFD_RELOC_SPARC_L44 - -- : BFD_RELOC_SPARC_REGISTER - -- : BFD_RELOC_SPARC_H34 - -- : BFD_RELOC_SPARC_SIZE32 - -- : BFD_RELOC_SPARC_SIZE64 - -- : BFD_RELOC_SPARC_WDISP10 - SPARC64 relocations - - -- : BFD_RELOC_SPARC_REV32 - SPARC little endian relocation - - -- : BFD_RELOC_SPARC_TLS_GD_HI22 - -- : BFD_RELOC_SPARC_TLS_GD_LO10 - -- : BFD_RELOC_SPARC_TLS_GD_ADD - -- : BFD_RELOC_SPARC_TLS_GD_CALL - -- : BFD_RELOC_SPARC_TLS_LDM_HI22 - -- : BFD_RELOC_SPARC_TLS_LDM_LO10 - -- : BFD_RELOC_SPARC_TLS_LDM_ADD - -- : BFD_RELOC_SPARC_TLS_LDM_CALL - -- : BFD_RELOC_SPARC_TLS_LDO_HIX22 - -- : BFD_RELOC_SPARC_TLS_LDO_LOX10 - -- : BFD_RELOC_SPARC_TLS_LDO_ADD - -- : BFD_RELOC_SPARC_TLS_IE_HI22 - -- : BFD_RELOC_SPARC_TLS_IE_LO10 - -- : BFD_RELOC_SPARC_TLS_IE_LD - -- : BFD_RELOC_SPARC_TLS_IE_LDX - -- : BFD_RELOC_SPARC_TLS_IE_ADD - -- : BFD_RELOC_SPARC_TLS_LE_HIX22 - -- : BFD_RELOC_SPARC_TLS_LE_LOX10 - -- : BFD_RELOC_SPARC_TLS_DTPMOD32 - -- : BFD_RELOC_SPARC_TLS_DTPMOD64 - -- : BFD_RELOC_SPARC_TLS_DTPOFF32 - -- : BFD_RELOC_SPARC_TLS_DTPOFF64 - -- : BFD_RELOC_SPARC_TLS_TPOFF32 - -- : BFD_RELOC_SPARC_TLS_TPOFF64 - SPARC TLS relocations - - -- : BFD_RELOC_SPU_IMM7 - -- : BFD_RELOC_SPU_IMM8 - -- : BFD_RELOC_SPU_IMM10 - -- : BFD_RELOC_SPU_IMM10W - -- : BFD_RELOC_SPU_IMM16 - -- : BFD_RELOC_SPU_IMM16W - -- : BFD_RELOC_SPU_IMM18 - -- : BFD_RELOC_SPU_PCREL9a - -- : BFD_RELOC_SPU_PCREL9b - -- : BFD_RELOC_SPU_PCREL16 - -- : BFD_RELOC_SPU_LO16 - -- : BFD_RELOC_SPU_HI16 - -- : BFD_RELOC_SPU_PPU32 - -- : BFD_RELOC_SPU_PPU64 - -- : BFD_RELOC_SPU_ADD_PIC - SPU Relocations. - - -- : BFD_RELOC_ALPHA_GPDISP_HI16 - Alpha ECOFF and ELF relocations. Some of these treat the symbol or - "addend" in some special way. For GPDISP_HI16 ("gpdisp") - relocations, the symbol is ignored when writing; when reading, it - will be the absolute section symbol. The addend is the - displacement in bytes of the "lda" instruction from the "ldah" - instruction (which is at the address of this reloc). - - -- : BFD_RELOC_ALPHA_GPDISP_LO16 - For GPDISP_LO16 ("ignore") relocations, the symbol is handled as - with GPDISP_HI16 relocs. The addend is ignored when writing the - relocations out, and is filled in with the file's GP value on - reading, for convenience. - - -- : BFD_RELOC_ALPHA_GPDISP - The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 - relocation except that there is no accompanying GPDISP_LO16 - relocation. - - -- : BFD_RELOC_ALPHA_LITERAL - -- : BFD_RELOC_ALPHA_ELF_LITERAL - -- : BFD_RELOC_ALPHA_LITUSE - The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; - the assembler turns it into a LDQ instruction to load the address - of the symbol, and then fills in a register in the real - instruction. - - The LITERAL reloc, at the LDQ instruction, refers to the .lita - section symbol. The addend is ignored when writing, but is filled - in with the file's GP value on reading, for convenience, as with - the GPDISP_LO16 reloc. - - The ELF_LITERAL reloc is somewhere between 16_GOTOFF and - GPDISP_LO16. It should refer to the symbol to be referenced, as - with 16_GOTOFF, but it generates output not based on the position - within the .got section, but relative to the GP value chosen for - the file during the final link stage. - - The LITUSE reloc, on the instruction using the loaded address, - gives information to the linker that it might be able to use to - optimize away some literal section references. The symbol is - ignored (read as the absolute section symbol), and the "addend" - indicates the type of instruction using the register: 1 - "memory" - fmt insn 2 - byte-manipulation (byte offset reg) 3 - jsr (target - of branch) - - -- : BFD_RELOC_ALPHA_HINT - The HINT relocation indicates a value that should be filled into - the "hint" field of a jmp/jsr/ret instruction, for possible branch- - prediction logic which may be provided on some processors. - - -- : BFD_RELOC_ALPHA_LINKAGE - The LINKAGE relocation outputs a linkage pair in the object file, - which is filled by the linker. - - -- : BFD_RELOC_ALPHA_CODEADDR - The CODEADDR relocation outputs a STO_CA in the object file, which - is filled by the linker. - - -- : BFD_RELOC_ALPHA_GPREL_HI16 - -- : BFD_RELOC_ALPHA_GPREL_LO16 - The GPREL_HI/LO relocations together form a 32-bit offset from the - GP register. - - -- : BFD_RELOC_ALPHA_BRSGP - Like BFD_RELOC_23_PCREL_S2, except that the source and target must - share a common GP, and the target address is adjusted for - STO_ALPHA_STD_GPLOAD. - - -- : BFD_RELOC_ALPHA_NOP - The NOP relocation outputs a NOP if the longword displacement - between two procedure entry points is < 2^21. - - -- : BFD_RELOC_ALPHA_BSR - The BSR relocation outputs a BSR if the longword displacement - between two procedure entry points is < 2^21. - - -- : BFD_RELOC_ALPHA_LDA - The LDA relocation outputs a LDA if the longword displacement - between two procedure entry points is < 2^16. - - -- : BFD_RELOC_ALPHA_BOH - The BOH relocation outputs a BSR if the longword displacement - between two procedure entry points is < 2^21, or else a hint. - - -- : BFD_RELOC_ALPHA_TLSGD - -- : BFD_RELOC_ALPHA_TLSLDM - -- : BFD_RELOC_ALPHA_DTPMOD64 - -- : BFD_RELOC_ALPHA_GOTDTPREL16 - -- : BFD_RELOC_ALPHA_DTPREL64 - -- : BFD_RELOC_ALPHA_DTPREL_HI16 - -- : BFD_RELOC_ALPHA_DTPREL_LO16 - -- : BFD_RELOC_ALPHA_DTPREL16 - -- : BFD_RELOC_ALPHA_GOTTPREL16 - -- : BFD_RELOC_ALPHA_TPREL64 - -- : BFD_RELOC_ALPHA_TPREL_HI16 - -- : BFD_RELOC_ALPHA_TPREL_LO16 - -- : BFD_RELOC_ALPHA_TPREL16 - Alpha thread-local storage relocations. - - -- : BFD_RELOC_MIPS_JMP - -- : BFD_RELOC_MICROMIPS_JMP - The MIPS jump instruction. - - -- : BFD_RELOC_MIPS16_JMP - The MIPS16 jump instruction. - - -- : BFD_RELOC_MIPS16_GPREL - MIPS16 GP relative reloc. - - -- : BFD_RELOC_HI16 - High 16 bits of 32-bit value; simple reloc. - - -- : BFD_RELOC_HI16_S - High 16 bits of 32-bit value but the low 16 bits will be sign - extended and added to form the final result. If the low 16 bits - form a negative number, we need to add one to the high value to - compensate for the borrow when the low bits are added. - - -- : BFD_RELOC_LO16 - Low 16 bits. - - -- : BFD_RELOC_HI16_PCREL - High 16 bits of 32-bit pc-relative value - - -- : BFD_RELOC_HI16_S_PCREL - High 16 bits of 32-bit pc-relative value, adjusted - - -- : BFD_RELOC_LO16_PCREL - Low 16 bits of pc-relative value - - -- : BFD_RELOC_MIPS16_GOT16 - -- : BFD_RELOC_MIPS16_CALL16 - Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of - 16-bit immediate fields - - -- : BFD_RELOC_MIPS16_HI16 - MIPS16 high 16 bits of 32-bit value. - - -- : BFD_RELOC_MIPS16_HI16_S - MIPS16 high 16 bits of 32-bit value but the low 16 bits will be - sign extended and added to form the final result. If the low 16 - bits form a negative number, we need to add one to the high value - to compensate for the borrow when the low bits are added. - - -- : BFD_RELOC_MIPS16_LO16 - MIPS16 low 16 bits. - - -- : BFD_RELOC_MIPS16_TLS_GD - -- : BFD_RELOC_MIPS16_TLS_LDM - -- : BFD_RELOC_MIPS16_TLS_DTPREL_HI16 - -- : BFD_RELOC_MIPS16_TLS_DTPREL_LO16 - -- : BFD_RELOC_MIPS16_TLS_GOTTPREL - -- : BFD_RELOC_MIPS16_TLS_TPREL_HI16 - -- : BFD_RELOC_MIPS16_TLS_TPREL_LO16 - MIPS16 TLS relocations - - -- : BFD_RELOC_MIPS_LITERAL - -- : BFD_RELOC_MICROMIPS_LITERAL - Relocation against a MIPS literal section. - - -- : BFD_RELOC_MICROMIPS_7_PCREL_S1 - -- : BFD_RELOC_MICROMIPS_10_PCREL_S1 - -- : BFD_RELOC_MICROMIPS_16_PCREL_S1 - microMIPS PC-relative relocations. - - -- : BFD_RELOC_MICROMIPS_GPREL16 - -- : BFD_RELOC_MICROMIPS_HI16 - -- : BFD_RELOC_MICROMIPS_HI16_S - -- : BFD_RELOC_MICROMIPS_LO16 - microMIPS versions of generic BFD relocs. - - -- : BFD_RELOC_MIPS_GOT16 - -- : BFD_RELOC_MICROMIPS_GOT16 - -- : BFD_RELOC_MIPS_CALL16 - -- : BFD_RELOC_MICROMIPS_CALL16 - -- : BFD_RELOC_MIPS_GOT_HI16 - -- : BFD_RELOC_MICROMIPS_GOT_HI16 - -- : BFD_RELOC_MIPS_GOT_LO16 - -- : BFD_RELOC_MICROMIPS_GOT_LO16 - -- : BFD_RELOC_MIPS_CALL_HI16 - -- : BFD_RELOC_MICROMIPS_CALL_HI16 - -- : BFD_RELOC_MIPS_CALL_LO16 - -- : BFD_RELOC_MICROMIPS_CALL_LO16 - -- : BFD_RELOC_MIPS_SUB - -- : BFD_RELOC_MICROMIPS_SUB - -- : BFD_RELOC_MIPS_GOT_PAGE - -- : BFD_RELOC_MICROMIPS_GOT_PAGE - -- : BFD_RELOC_MIPS_GOT_OFST - -- : BFD_RELOC_MICROMIPS_GOT_OFST - -- : BFD_RELOC_MIPS_GOT_DISP - -- : BFD_RELOC_MICROMIPS_GOT_DISP - -- : BFD_RELOC_MIPS_SHIFT5 - -- : BFD_RELOC_MIPS_SHIFT6 - -- : BFD_RELOC_MIPS_INSERT_A - -- : BFD_RELOC_MIPS_INSERT_B - -- : BFD_RELOC_MIPS_DELETE - -- : BFD_RELOC_MIPS_HIGHEST - -- : BFD_RELOC_MICROMIPS_HIGHEST - -- : BFD_RELOC_MIPS_HIGHER - -- : BFD_RELOC_MICROMIPS_HIGHER - -- : BFD_RELOC_MIPS_SCN_DISP - -- : BFD_RELOC_MICROMIPS_SCN_DISP - -- : BFD_RELOC_MIPS_REL16 - -- : BFD_RELOC_MIPS_RELGOT - -- : BFD_RELOC_MIPS_JALR - -- : BFD_RELOC_MICROMIPS_JALR - -- : BFD_RELOC_MIPS_TLS_DTPMOD32 - -- : BFD_RELOC_MIPS_TLS_DTPREL32 - -- : BFD_RELOC_MIPS_TLS_DTPMOD64 - -- : BFD_RELOC_MIPS_TLS_DTPREL64 - -- : BFD_RELOC_MIPS_TLS_GD - -- : BFD_RELOC_MICROMIPS_TLS_GD - -- : BFD_RELOC_MIPS_TLS_LDM - -- : BFD_RELOC_MICROMIPS_TLS_LDM - -- : BFD_RELOC_MIPS_TLS_DTPREL_HI16 - -- : BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16 - -- : BFD_RELOC_MIPS_TLS_DTPREL_LO16 - -- : BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16 - -- : BFD_RELOC_MIPS_TLS_GOTTPREL - -- : BFD_RELOC_MICROMIPS_TLS_GOTTPREL - -- : BFD_RELOC_MIPS_TLS_TPREL32 - -- : BFD_RELOC_MIPS_TLS_TPREL64 - -- : BFD_RELOC_MIPS_TLS_TPREL_HI16 - -- : BFD_RELOC_MICROMIPS_TLS_TPREL_HI16 - -- : BFD_RELOC_MIPS_TLS_TPREL_LO16 - -- : BFD_RELOC_MICROMIPS_TLS_TPREL_LO16 - -- : BFD_RELOC_MIPS_EH - MIPS ELF relocations. - - -- : BFD_RELOC_MIPS_COPY - -- : BFD_RELOC_MIPS_JUMP_SLOT - MIPS ELF relocations (VxWorks and PLT extensions). - - -- : BFD_RELOC_MOXIE_10_PCREL - Moxie ELF relocations. - - -- : BFD_RELOC_FRV_LABEL16 - -- : BFD_RELOC_FRV_LABEL24 - -- : BFD_RELOC_FRV_LO16 - -- : BFD_RELOC_FRV_HI16 - -- : BFD_RELOC_FRV_GPREL12 - -- : BFD_RELOC_FRV_GPRELU12 - -- : BFD_RELOC_FRV_GPREL32 - -- : BFD_RELOC_FRV_GPRELHI - -- : BFD_RELOC_FRV_GPRELLO - -- : BFD_RELOC_FRV_GOT12 - -- : BFD_RELOC_FRV_GOTHI - -- : BFD_RELOC_FRV_GOTLO - -- : BFD_RELOC_FRV_FUNCDESC - -- : BFD_RELOC_FRV_FUNCDESC_GOT12 - -- : BFD_RELOC_FRV_FUNCDESC_GOTHI - -- : BFD_RELOC_FRV_FUNCDESC_GOTLO - -- : BFD_RELOC_FRV_FUNCDESC_VALUE - -- : BFD_RELOC_FRV_FUNCDESC_GOTOFF12 - -- : BFD_RELOC_FRV_FUNCDESC_GOTOFFHI - -- : BFD_RELOC_FRV_FUNCDESC_GOTOFFLO - -- : BFD_RELOC_FRV_GOTOFF12 - -- : BFD_RELOC_FRV_GOTOFFHI - -- : BFD_RELOC_FRV_GOTOFFLO - -- : BFD_RELOC_FRV_GETTLSOFF - -- : BFD_RELOC_FRV_TLSDESC_VALUE - -- : BFD_RELOC_FRV_GOTTLSDESC12 - -- : BFD_RELOC_FRV_GOTTLSDESCHI - -- : BFD_RELOC_FRV_GOTTLSDESCLO - -- : BFD_RELOC_FRV_TLSMOFF12 - -- : BFD_RELOC_FRV_TLSMOFFHI - -- : BFD_RELOC_FRV_TLSMOFFLO - -- : BFD_RELOC_FRV_GOTTLSOFF12 - -- : BFD_RELOC_FRV_GOTTLSOFFHI - -- : BFD_RELOC_FRV_GOTTLSOFFLO - -- : BFD_RELOC_FRV_TLSOFF - -- : BFD_RELOC_FRV_TLSDESC_RELAX - -- : BFD_RELOC_FRV_GETTLSOFF_RELAX - -- : BFD_RELOC_FRV_TLSOFF_RELAX - -- : BFD_RELOC_FRV_TLSMOFF - Fujitsu Frv Relocations. - - -- : BFD_RELOC_MN10300_GOTOFF24 - This is a 24bit GOT-relative reloc for the mn10300. - - -- : BFD_RELOC_MN10300_GOT32 - This is a 32bit GOT-relative reloc for the mn10300, offset by two - bytes in the instruction. - - -- : BFD_RELOC_MN10300_GOT24 - This is a 24bit GOT-relative reloc for the mn10300, offset by two - bytes in the instruction. - - -- : BFD_RELOC_MN10300_GOT16 - This is a 16bit GOT-relative reloc for the mn10300, offset by two - bytes in the instruction. - - -- : BFD_RELOC_MN10300_COPY - Copy symbol at runtime. - - -- : BFD_RELOC_MN10300_GLOB_DAT - Create GOT entry. - - -- : BFD_RELOC_MN10300_JMP_SLOT - Create PLT entry. - - -- : BFD_RELOC_MN10300_RELATIVE - Adjust by program base. - - -- : BFD_RELOC_MN10300_SYM_DIFF - Together with another reloc targeted at the same location, allows - for a value that is the difference of two symbols in the same - section. - - -- : BFD_RELOC_MN10300_ALIGN - The addend of this reloc is an alignment power that must be - honoured at the offset's location, regardless of linker relaxation. - - -- : BFD_RELOC_MN10300_TLS_GD - -- : BFD_RELOC_MN10300_TLS_LD - -- : BFD_RELOC_MN10300_TLS_LDO - -- : BFD_RELOC_MN10300_TLS_GOTIE - -- : BFD_RELOC_MN10300_TLS_IE - -- : BFD_RELOC_MN10300_TLS_LE - -- : BFD_RELOC_MN10300_TLS_DTPMOD - -- : BFD_RELOC_MN10300_TLS_DTPOFF - -- : BFD_RELOC_MN10300_TLS_TPOFF - Various TLS-related relocations. - - -- : BFD_RELOC_MN10300_32_PCREL - This is a 32bit pcrel reloc for the mn10300, offset by two bytes - in the instruction. - - -- : BFD_RELOC_MN10300_16_PCREL - This is a 16bit pcrel reloc for the mn10300, offset by two bytes - in the instruction. - - -- : BFD_RELOC_386_GOT32 - -- : BFD_RELOC_386_PLT32 - -- : BFD_RELOC_386_COPY - -- : BFD_RELOC_386_GLOB_DAT - -- : BFD_RELOC_386_JUMP_SLOT - -- : BFD_RELOC_386_RELATIVE - -- : BFD_RELOC_386_GOTOFF - -- : BFD_RELOC_386_GOTPC - -- : BFD_RELOC_386_TLS_TPOFF - -- : BFD_RELOC_386_TLS_IE - -- : BFD_RELOC_386_TLS_GOTIE - -- : BFD_RELOC_386_TLS_LE - -- : BFD_RELOC_386_TLS_GD - -- : BFD_RELOC_386_TLS_LDM - -- : BFD_RELOC_386_TLS_LDO_32 - -- : BFD_RELOC_386_TLS_IE_32 - -- : BFD_RELOC_386_TLS_LE_32 - -- : BFD_RELOC_386_TLS_DTPMOD32 - -- : BFD_RELOC_386_TLS_DTPOFF32 - -- : BFD_RELOC_386_TLS_TPOFF32 - -- : BFD_RELOC_386_TLS_GOTDESC - -- : BFD_RELOC_386_TLS_DESC_CALL - -- : BFD_RELOC_386_TLS_DESC - -- : BFD_RELOC_386_IRELATIVE - i386/elf relocations - - -- : BFD_RELOC_X86_64_GOT32 - -- : BFD_RELOC_X86_64_PLT32 - -- : BFD_RELOC_X86_64_COPY - -- : BFD_RELOC_X86_64_GLOB_DAT - -- : BFD_RELOC_X86_64_JUMP_SLOT - -- : BFD_RELOC_X86_64_RELATIVE - -- : BFD_RELOC_X86_64_GOTPCREL - -- : BFD_RELOC_X86_64_32S - -- : BFD_RELOC_X86_64_DTPMOD64 - -- : BFD_RELOC_X86_64_DTPOFF64 - -- : BFD_RELOC_X86_64_TPOFF64 - -- : BFD_RELOC_X86_64_TLSGD - -- : BFD_RELOC_X86_64_TLSLD - -- : BFD_RELOC_X86_64_DTPOFF32 - -- : BFD_RELOC_X86_64_GOTTPOFF - -- : BFD_RELOC_X86_64_TPOFF32 - -- : BFD_RELOC_X86_64_GOTOFF64 - -- : BFD_RELOC_X86_64_GOTPC32 - -- : BFD_RELOC_X86_64_GOT64 - -- : BFD_RELOC_X86_64_GOTPCREL64 - -- : BFD_RELOC_X86_64_GOTPC64 - -- : BFD_RELOC_X86_64_GOTPLT64 - -- : BFD_RELOC_X86_64_PLTOFF64 - -- : BFD_RELOC_X86_64_GOTPC32_TLSDESC - -- : BFD_RELOC_X86_64_TLSDESC_CALL - -- : BFD_RELOC_X86_64_TLSDESC - -- : BFD_RELOC_X86_64_IRELATIVE - -- : BFD_RELOC_X86_64_PC32_BND - -- : BFD_RELOC_X86_64_PLT32_BND - x86-64/elf relocations - - -- : BFD_RELOC_NS32K_IMM_8 - -- : BFD_RELOC_NS32K_IMM_16 - -- : BFD_RELOC_NS32K_IMM_32 - -- : BFD_RELOC_NS32K_IMM_8_PCREL - -- : BFD_RELOC_NS32K_IMM_16_PCREL - -- : BFD_RELOC_NS32K_IMM_32_PCREL - -- : BFD_RELOC_NS32K_DISP_8 - -- : BFD_RELOC_NS32K_DISP_16 - -- : BFD_RELOC_NS32K_DISP_32 - -- : BFD_RELOC_NS32K_DISP_8_PCREL - -- : BFD_RELOC_NS32K_DISP_16_PCREL - -- : BFD_RELOC_NS32K_DISP_32_PCREL - ns32k relocations - - -- : BFD_RELOC_PDP11_DISP_8_PCREL - -- : BFD_RELOC_PDP11_DISP_6_PCREL - PDP11 relocations - - -- : BFD_RELOC_PJ_CODE_HI16 - -- : BFD_RELOC_PJ_CODE_LO16 - -- : BFD_RELOC_PJ_CODE_DIR16 - -- : BFD_RELOC_PJ_CODE_DIR32 - -- : BFD_RELOC_PJ_CODE_REL16 - -- : BFD_RELOC_PJ_CODE_REL32 - Picojava relocs. Not all of these appear in object files. - - -- : BFD_RELOC_PPC_B26 - -- : BFD_RELOC_PPC_BA26 - -- : BFD_RELOC_PPC_TOC16 - -- : BFD_RELOC_PPC_B16 - -- : BFD_RELOC_PPC_B16_BRTAKEN - -- : BFD_RELOC_PPC_B16_BRNTAKEN - -- : BFD_RELOC_PPC_BA16 - -- : BFD_RELOC_PPC_BA16_BRTAKEN - -- : BFD_RELOC_PPC_BA16_BRNTAKEN - -- : BFD_RELOC_PPC_COPY - -- : BFD_RELOC_PPC_GLOB_DAT - -- : BFD_RELOC_PPC_JMP_SLOT - -- : BFD_RELOC_PPC_RELATIVE - -- : BFD_RELOC_PPC_LOCAL24PC - -- : BFD_RELOC_PPC_EMB_NADDR32 - -- : BFD_RELOC_PPC_EMB_NADDR16 - -- : BFD_RELOC_PPC_EMB_NADDR16_LO - -- : BFD_RELOC_PPC_EMB_NADDR16_HI - -- : BFD_RELOC_PPC_EMB_NADDR16_HA - -- : BFD_RELOC_PPC_EMB_SDAI16 - -- : BFD_RELOC_PPC_EMB_SDA2I16 - -- : BFD_RELOC_PPC_EMB_SDA2REL - -- : BFD_RELOC_PPC_EMB_SDA21 - -- : BFD_RELOC_PPC_EMB_MRKREF - -- : BFD_RELOC_PPC_EMB_RELSEC16 - -- : BFD_RELOC_PPC_EMB_RELST_LO - -- : BFD_RELOC_PPC_EMB_RELST_HI - -- : BFD_RELOC_PPC_EMB_RELST_HA - -- : BFD_RELOC_PPC_EMB_BIT_FLD - -- : BFD_RELOC_PPC_EMB_RELSDA - -- : BFD_RELOC_PPC_VLE_REL8 - -- : BFD_RELOC_PPC_VLE_REL15 - -- : BFD_RELOC_PPC_VLE_REL24 - -- : BFD_RELOC_PPC_VLE_LO16A - -- : BFD_RELOC_PPC_VLE_LO16D - -- : BFD_RELOC_PPC_VLE_HI16A - -- : BFD_RELOC_PPC_VLE_HI16D - -- : BFD_RELOC_PPC_VLE_HA16A - -- : BFD_RELOC_PPC_VLE_HA16D - -- : BFD_RELOC_PPC_VLE_SDA21 - -- : BFD_RELOC_PPC_VLE_SDA21_LO - -- : BFD_RELOC_PPC_VLE_SDAREL_LO16A - -- : BFD_RELOC_PPC_VLE_SDAREL_LO16D - -- : BFD_RELOC_PPC_VLE_SDAREL_HI16A - -- : BFD_RELOC_PPC_VLE_SDAREL_HI16D - -- : BFD_RELOC_PPC_VLE_SDAREL_HA16A - -- : BFD_RELOC_PPC_VLE_SDAREL_HA16D - -- : BFD_RELOC_PPC64_HIGHER - -- : BFD_RELOC_PPC64_HIGHER_S - -- : BFD_RELOC_PPC64_HIGHEST - -- : BFD_RELOC_PPC64_HIGHEST_S - -- : BFD_RELOC_PPC64_TOC16_LO - -- : BFD_RELOC_PPC64_TOC16_HI - -- : BFD_RELOC_PPC64_TOC16_HA - -- : BFD_RELOC_PPC64_TOC - -- : BFD_RELOC_PPC64_PLTGOT16 - -- : BFD_RELOC_PPC64_PLTGOT16_LO - -- : BFD_RELOC_PPC64_PLTGOT16_HI - -- : BFD_RELOC_PPC64_PLTGOT16_HA - -- : BFD_RELOC_PPC64_ADDR16_DS - -- : BFD_RELOC_PPC64_ADDR16_LO_DS - -- : BFD_RELOC_PPC64_GOT16_DS - -- : BFD_RELOC_PPC64_GOT16_LO_DS - -- : BFD_RELOC_PPC64_PLT16_LO_DS - -- : BFD_RELOC_PPC64_SECTOFF_DS - -- : BFD_RELOC_PPC64_SECTOFF_LO_DS - -- : BFD_RELOC_PPC64_TOC16_DS - -- : BFD_RELOC_PPC64_TOC16_LO_DS - -- : BFD_RELOC_PPC64_PLTGOT16_DS - -- : BFD_RELOC_PPC64_PLTGOT16_LO_DS - -- : BFD_RELOC_PPC64_ADDR16_HIGH - -- : BFD_RELOC_PPC64_ADDR16_HIGHA - Power(rs6000) and PowerPC relocations. - - -- : BFD_RELOC_PPC_TLS - -- : BFD_RELOC_PPC_TLSGD - -- : BFD_RELOC_PPC_TLSLD - -- : BFD_RELOC_PPC_DTPMOD - -- : BFD_RELOC_PPC_TPREL16 - -- : BFD_RELOC_PPC_TPREL16_LO - -- : BFD_RELOC_PPC_TPREL16_HI - -- : BFD_RELOC_PPC_TPREL16_HA - -- : BFD_RELOC_PPC_TPREL - -- : BFD_RELOC_PPC_DTPREL16 - -- : BFD_RELOC_PPC_DTPREL16_LO - -- : BFD_RELOC_PPC_DTPREL16_HI - -- : BFD_RELOC_PPC_DTPREL16_HA - -- : BFD_RELOC_PPC_DTPREL - -- : BFD_RELOC_PPC_GOT_TLSGD16 - -- : BFD_RELOC_PPC_GOT_TLSGD16_LO - -- : BFD_RELOC_PPC_GOT_TLSGD16_HI - -- : BFD_RELOC_PPC_GOT_TLSGD16_HA - -- : BFD_RELOC_PPC_GOT_TLSLD16 - -- : BFD_RELOC_PPC_GOT_TLSLD16_LO - -- : BFD_RELOC_PPC_GOT_TLSLD16_HI - -- : BFD_RELOC_PPC_GOT_TLSLD16_HA - -- : BFD_RELOC_PPC_GOT_TPREL16 - -- : BFD_RELOC_PPC_GOT_TPREL16_LO - -- : BFD_RELOC_PPC_GOT_TPREL16_HI - -- : BFD_RELOC_PPC_GOT_TPREL16_HA - -- : BFD_RELOC_PPC_GOT_DTPREL16 - -- : BFD_RELOC_PPC_GOT_DTPREL16_LO - -- : BFD_RELOC_PPC_GOT_DTPREL16_HI - -- : BFD_RELOC_PPC_GOT_DTPREL16_HA - -- : BFD_RELOC_PPC64_TPREL16_DS - -- : BFD_RELOC_PPC64_TPREL16_LO_DS - -- : BFD_RELOC_PPC64_TPREL16_HIGHER - -- : BFD_RELOC_PPC64_TPREL16_HIGHERA - -- : BFD_RELOC_PPC64_TPREL16_HIGHEST - -- : BFD_RELOC_PPC64_TPREL16_HIGHESTA - -- : BFD_RELOC_PPC64_DTPREL16_DS - -- : BFD_RELOC_PPC64_DTPREL16_LO_DS - -- : BFD_RELOC_PPC64_DTPREL16_HIGHER - -- : BFD_RELOC_PPC64_DTPREL16_HIGHERA - -- : BFD_RELOC_PPC64_DTPREL16_HIGHEST - -- : BFD_RELOC_PPC64_DTPREL16_HIGHESTA - -- : BFD_RELOC_PPC64_TPREL16_HIGH - -- : BFD_RELOC_PPC64_TPREL16_HIGHA - -- : BFD_RELOC_PPC64_DTPREL16_HIGH - -- : BFD_RELOC_PPC64_DTPREL16_HIGHA - PowerPC and PowerPC64 thread-local storage relocations. - - -- : BFD_RELOC_I370_D12 - IBM 370/390 relocations - - -- : BFD_RELOC_CTOR - The type of reloc used to build a constructor table - at the moment - probably a 32 bit wide absolute relocation, but the target can - choose. It generally does map to one of the other relocation - types. - - -- : BFD_RELOC_ARM_PCREL_BRANCH - ARM 26 bit pc-relative branch. The lowest two bits must be zero - and are not stored in the instruction. - - -- : BFD_RELOC_ARM_PCREL_BLX - ARM 26 bit pc-relative branch. The lowest bit must be zero and is - not stored in the instruction. The 2nd lowest bit comes from a 1 - bit field in the instruction. - - -- : BFD_RELOC_THUMB_PCREL_BLX - Thumb 22 bit pc-relative branch. The lowest bit must be zero and - is not stored in the instruction. The 2nd lowest bit comes from a - 1 bit field in the instruction. - - -- : BFD_RELOC_ARM_PCREL_CALL - ARM 26-bit pc-relative branch for an unconditional BL or BLX - instruction. - - -- : BFD_RELOC_ARM_PCREL_JUMP - ARM 26-bit pc-relative branch for B or conditional BL instruction. - - -- : BFD_RELOC_THUMB_PCREL_BRANCH7 - -- : BFD_RELOC_THUMB_PCREL_BRANCH9 - -- : BFD_RELOC_THUMB_PCREL_BRANCH12 - -- : BFD_RELOC_THUMB_PCREL_BRANCH20 - -- : BFD_RELOC_THUMB_PCREL_BRANCH23 - -- : BFD_RELOC_THUMB_PCREL_BRANCH25 - Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The - lowest bit must be zero and is not stored in the instruction. - Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an - "nn" one smaller in all cases. Note further that BRANCH23 - corresponds to R_ARM_THM_CALL. - - -- : BFD_RELOC_ARM_OFFSET_IMM - 12-bit immediate offset, used in ARM-format ldr and str - instructions. - - -- : BFD_RELOC_ARM_THUMB_OFFSET - 5-bit immediate offset, used in Thumb-format ldr and str - instructions. - - -- : BFD_RELOC_ARM_TARGET1 - Pc-relative or absolute relocation depending on target. Used for - entries in .init_array sections. - - -- : BFD_RELOC_ARM_ROSEGREL32 - Read-only segment base relative address. - - -- : BFD_RELOC_ARM_SBREL32 - Data segment base relative address. - - -- : BFD_RELOC_ARM_TARGET2 - This reloc is used for references to RTTI data from exception - handling tables. The actual definition depends on the target. It - may be a pc-relative or some form of GOT-indirect relocation. - - -- : BFD_RELOC_ARM_PREL31 - 31-bit PC relative address. - - -- : BFD_RELOC_ARM_MOVW - -- : BFD_RELOC_ARM_MOVT - -- : BFD_RELOC_ARM_MOVW_PCREL - -- : BFD_RELOC_ARM_MOVT_PCREL - -- : BFD_RELOC_ARM_THUMB_MOVW - -- : BFD_RELOC_ARM_THUMB_MOVT - -- : BFD_RELOC_ARM_THUMB_MOVW_PCREL - -- : BFD_RELOC_ARM_THUMB_MOVT_PCREL - Low and High halfword relocations for MOVW and MOVT instructions. - - -- : BFD_RELOC_ARM_JUMP_SLOT - -- : BFD_RELOC_ARM_GLOB_DAT - -- : BFD_RELOC_ARM_GOT32 - -- : BFD_RELOC_ARM_PLT32 - -- : BFD_RELOC_ARM_RELATIVE - -- : BFD_RELOC_ARM_GOTOFF - -- : BFD_RELOC_ARM_GOTPC - -- : BFD_RELOC_ARM_GOT_PREL - Relocations for setting up GOTs and PLTs for shared libraries. - - -- : BFD_RELOC_ARM_TLS_GD32 - -- : BFD_RELOC_ARM_TLS_LDO32 - -- : BFD_RELOC_ARM_TLS_LDM32 - -- : BFD_RELOC_ARM_TLS_DTPOFF32 - -- : BFD_RELOC_ARM_TLS_DTPMOD32 - -- : BFD_RELOC_ARM_TLS_TPOFF32 - -- : BFD_RELOC_ARM_TLS_IE32 - -- : BFD_RELOC_ARM_TLS_LE32 - -- : BFD_RELOC_ARM_TLS_GOTDESC - -- : BFD_RELOC_ARM_TLS_CALL - -- : BFD_RELOC_ARM_THM_TLS_CALL - -- : BFD_RELOC_ARM_TLS_DESCSEQ - -- : BFD_RELOC_ARM_THM_TLS_DESCSEQ - -- : BFD_RELOC_ARM_TLS_DESC - ARM thread-local storage relocations. - - -- : BFD_RELOC_ARM_ALU_PC_G0_NC - -- : BFD_RELOC_ARM_ALU_PC_G0 - -- : BFD_RELOC_ARM_ALU_PC_G1_NC - -- : BFD_RELOC_ARM_ALU_PC_G1 - -- : BFD_RELOC_ARM_ALU_PC_G2 - -- : BFD_RELOC_ARM_LDR_PC_G0 - -- : BFD_RELOC_ARM_LDR_PC_G1 - -- : BFD_RELOC_ARM_LDR_PC_G2 - -- : BFD_RELOC_ARM_LDRS_PC_G0 - -- : BFD_RELOC_ARM_LDRS_PC_G1 - -- : BFD_RELOC_ARM_LDRS_PC_G2 - -- : BFD_RELOC_ARM_LDC_PC_G0 - -- : BFD_RELOC_ARM_LDC_PC_G1 - -- : BFD_RELOC_ARM_LDC_PC_G2 - -- : BFD_RELOC_ARM_ALU_SB_G0_NC - -- : BFD_RELOC_ARM_ALU_SB_G0 - -- : BFD_RELOC_ARM_ALU_SB_G1_NC - -- : BFD_RELOC_ARM_ALU_SB_G1 - -- : BFD_RELOC_ARM_ALU_SB_G2 - -- : BFD_RELOC_ARM_LDR_SB_G0 - -- : BFD_RELOC_ARM_LDR_SB_G1 - -- : BFD_RELOC_ARM_LDR_SB_G2 - -- : BFD_RELOC_ARM_LDRS_SB_G0 - -- : BFD_RELOC_ARM_LDRS_SB_G1 - -- : BFD_RELOC_ARM_LDRS_SB_G2 - -- : BFD_RELOC_ARM_LDC_SB_G0 - -- : BFD_RELOC_ARM_LDC_SB_G1 - -- : BFD_RELOC_ARM_LDC_SB_G2 - ARM group relocations. - - -- : BFD_RELOC_ARM_V4BX - Annotation of BX instructions. - - -- : BFD_RELOC_ARM_IRELATIVE - ARM support for STT_GNU_IFUNC. - - -- : BFD_RELOC_ARM_IMMEDIATE - -- : BFD_RELOC_ARM_ADRL_IMMEDIATE - -- : BFD_RELOC_ARM_T32_IMMEDIATE - -- : BFD_RELOC_ARM_T32_ADD_IMM - -- : BFD_RELOC_ARM_T32_IMM12 - -- : BFD_RELOC_ARM_T32_ADD_PC12 - -- : BFD_RELOC_ARM_SHIFT_IMM - -- : BFD_RELOC_ARM_SMC - -- : BFD_RELOC_ARM_HVC - -- : BFD_RELOC_ARM_SWI - -- : BFD_RELOC_ARM_MULTI - -- : BFD_RELOC_ARM_CP_OFF_IMM - -- : BFD_RELOC_ARM_CP_OFF_IMM_S2 - -- : BFD_RELOC_ARM_T32_CP_OFF_IMM - -- : BFD_RELOC_ARM_T32_CP_OFF_IMM_S2 - -- : BFD_RELOC_ARM_ADR_IMM - -- : BFD_RELOC_ARM_LDR_IMM - -- : BFD_RELOC_ARM_LITERAL - -- : BFD_RELOC_ARM_IN_POOL - -- : BFD_RELOC_ARM_OFFSET_IMM8 - -- : BFD_RELOC_ARM_T32_OFFSET_U8 - -- : BFD_RELOC_ARM_T32_OFFSET_IMM - -- : BFD_RELOC_ARM_HWLITERAL - -- : BFD_RELOC_ARM_THUMB_ADD - -- : BFD_RELOC_ARM_THUMB_IMM - -- : BFD_RELOC_ARM_THUMB_SHIFT - These relocs are only used within the ARM assembler. They are not - (at present) written to any object files. - - -- : BFD_RELOC_SH_PCDISP8BY2 - -- : BFD_RELOC_SH_PCDISP12BY2 - -- : BFD_RELOC_SH_IMM3 - -- : BFD_RELOC_SH_IMM3U - -- : BFD_RELOC_SH_DISP12 - -- : BFD_RELOC_SH_DISP12BY2 - -- : BFD_RELOC_SH_DISP12BY4 - -- : BFD_RELOC_SH_DISP12BY8 - -- : BFD_RELOC_SH_DISP20 - -- : BFD_RELOC_SH_DISP20BY8 - -- : BFD_RELOC_SH_IMM4 - -- : BFD_RELOC_SH_IMM4BY2 - -- : BFD_RELOC_SH_IMM4BY4 - -- : BFD_RELOC_SH_IMM8 - -- : BFD_RELOC_SH_IMM8BY2 - -- : BFD_RELOC_SH_IMM8BY4 - -- : BFD_RELOC_SH_PCRELIMM8BY2 - -- : BFD_RELOC_SH_PCRELIMM8BY4 - -- : BFD_RELOC_SH_SWITCH16 - -- : BFD_RELOC_SH_SWITCH32 - -- : BFD_RELOC_SH_USES - -- : BFD_RELOC_SH_COUNT - -- : BFD_RELOC_SH_ALIGN - -- : BFD_RELOC_SH_CODE - -- : BFD_RELOC_SH_DATA - -- : BFD_RELOC_SH_LABEL - -- : BFD_RELOC_SH_LOOP_START - -- : BFD_RELOC_SH_LOOP_END - -- : BFD_RELOC_SH_COPY - -- : BFD_RELOC_SH_GLOB_DAT - -- : BFD_RELOC_SH_JMP_SLOT - -- : BFD_RELOC_SH_RELATIVE - -- : BFD_RELOC_SH_GOTPC - -- : BFD_RELOC_SH_GOT_LOW16 - -- : BFD_RELOC_SH_GOT_MEDLOW16 - -- : BFD_RELOC_SH_GOT_MEDHI16 - -- : BFD_RELOC_SH_GOT_HI16 - -- : BFD_RELOC_SH_GOTPLT_LOW16 - -- : BFD_RELOC_SH_GOTPLT_MEDLOW16 - -- : BFD_RELOC_SH_GOTPLT_MEDHI16 - -- : BFD_RELOC_SH_GOTPLT_HI16 - -- : BFD_RELOC_SH_PLT_LOW16 - -- : BFD_RELOC_SH_PLT_MEDLOW16 - -- : BFD_RELOC_SH_PLT_MEDHI16 - -- : BFD_RELOC_SH_PLT_HI16 - -- : BFD_RELOC_SH_GOTOFF_LOW16 - -- : BFD_RELOC_SH_GOTOFF_MEDLOW16 - -- : BFD_RELOC_SH_GOTOFF_MEDHI16 - -- : BFD_RELOC_SH_GOTOFF_HI16 - -- : BFD_RELOC_SH_GOTPC_LOW16 - -- : BFD_RELOC_SH_GOTPC_MEDLOW16 - -- : BFD_RELOC_SH_GOTPC_MEDHI16 - -- : BFD_RELOC_SH_GOTPC_HI16 - -- : BFD_RELOC_SH_COPY64 - -- : BFD_RELOC_SH_GLOB_DAT64 - -- : BFD_RELOC_SH_JMP_SLOT64 - -- : BFD_RELOC_SH_RELATIVE64 - -- : BFD_RELOC_SH_GOT10BY4 - -- : BFD_RELOC_SH_GOT10BY8 - -- : BFD_RELOC_SH_GOTPLT10BY4 - -- : BFD_RELOC_SH_GOTPLT10BY8 - -- : BFD_RELOC_SH_GOTPLT32 - -- : BFD_RELOC_SH_SHMEDIA_CODE - -- : BFD_RELOC_SH_IMMU5 - -- : BFD_RELOC_SH_IMMS6 - -- : BFD_RELOC_SH_IMMS6BY32 - -- : BFD_RELOC_SH_IMMU6 - -- : BFD_RELOC_SH_IMMS10 - -- : BFD_RELOC_SH_IMMS10BY2 - -- : BFD_RELOC_SH_IMMS10BY4 - -- : BFD_RELOC_SH_IMMS10BY8 - -- : BFD_RELOC_SH_IMMS16 - -- : BFD_RELOC_SH_IMMU16 - -- : BFD_RELOC_SH_IMM_LOW16 - -- : BFD_RELOC_SH_IMM_LOW16_PCREL - -- : BFD_RELOC_SH_IMM_MEDLOW16 - -- : BFD_RELOC_SH_IMM_MEDLOW16_PCREL - -- : BFD_RELOC_SH_IMM_MEDHI16 - -- : BFD_RELOC_SH_IMM_MEDHI16_PCREL - -- : BFD_RELOC_SH_IMM_HI16 - -- : BFD_RELOC_SH_IMM_HI16_PCREL - -- : BFD_RELOC_SH_PT_16 - -- : BFD_RELOC_SH_TLS_GD_32 - -- : BFD_RELOC_SH_TLS_LD_32 - -- : BFD_RELOC_SH_TLS_LDO_32 - -- : BFD_RELOC_SH_TLS_IE_32 - -- : BFD_RELOC_SH_TLS_LE_32 - -- : BFD_RELOC_SH_TLS_DTPMOD32 - -- : BFD_RELOC_SH_TLS_DTPOFF32 - -- : BFD_RELOC_SH_TLS_TPOFF32 - -- : BFD_RELOC_SH_GOT20 - -- : BFD_RELOC_SH_GOTOFF20 - -- : BFD_RELOC_SH_GOTFUNCDESC - -- : BFD_RELOC_SH_GOTFUNCDESC20 - -- : BFD_RELOC_SH_GOTOFFFUNCDESC - -- : BFD_RELOC_SH_GOTOFFFUNCDESC20 - -- : BFD_RELOC_SH_FUNCDESC - Renesas / SuperH SH relocs. Not all of these appear in object - files. - - -- : BFD_RELOC_ARC_B22_PCREL - ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two - bits must be zero and are not stored in the instruction. The high - 20 bits are installed in bits 26 through 7 of the instruction. - - -- : BFD_RELOC_ARC_B26 - ARC 26 bit absolute branch. The lowest two bits must be zero and - are not stored in the instruction. The high 24 bits are installed - in bits 23 through 0. - - -- : BFD_RELOC_BFIN_16_IMM - ADI Blackfin 16 bit immediate absolute reloc. - - -- : BFD_RELOC_BFIN_16_HIGH - ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. - - -- : BFD_RELOC_BFIN_4_PCREL - ADI Blackfin 'a' part of LSETUP. - - -- : BFD_RELOC_BFIN_5_PCREL - ADI Blackfin. - - -- : BFD_RELOC_BFIN_16_LOW - ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. - - -- : BFD_RELOC_BFIN_10_PCREL - ADI Blackfin. - - -- : BFD_RELOC_BFIN_11_PCREL - ADI Blackfin 'b' part of LSETUP. - - -- : BFD_RELOC_BFIN_12_PCREL_JUMP - ADI Blackfin. - - -- : BFD_RELOC_BFIN_12_PCREL_JUMP_S - ADI Blackfin Short jump, pcrel. - - -- : BFD_RELOC_BFIN_24_PCREL_CALL_X - ADI Blackfin Call.x not implemented. - - -- : BFD_RELOC_BFIN_24_PCREL_JUMP_L - ADI Blackfin Long Jump pcrel. - - -- : BFD_RELOC_BFIN_GOT17M4 - -- : BFD_RELOC_BFIN_GOTHI - -- : BFD_RELOC_BFIN_GOTLO - -- : BFD_RELOC_BFIN_FUNCDESC - -- : BFD_RELOC_BFIN_FUNCDESC_GOT17M4 - -- : BFD_RELOC_BFIN_FUNCDESC_GOTHI - -- : BFD_RELOC_BFIN_FUNCDESC_GOTLO - -- : BFD_RELOC_BFIN_FUNCDESC_VALUE - -- : BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4 - -- : BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI - -- : BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO - -- : BFD_RELOC_BFIN_GOTOFF17M4 - -- : BFD_RELOC_BFIN_GOTOFFHI - -- : BFD_RELOC_BFIN_GOTOFFLO - ADI Blackfin FD-PIC relocations. - - -- : BFD_RELOC_BFIN_GOT - ADI Blackfin GOT relocation. - - -- : BFD_RELOC_BFIN_PLTPC - ADI Blackfin PLTPC relocation. - - -- : BFD_ARELOC_BFIN_PUSH - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_CONST - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_ADD - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_SUB - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_MULT - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_DIV - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_MOD - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_LSHIFT - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_RSHIFT - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_AND - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_OR - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_XOR - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_LAND - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_LOR - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_LEN - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_NEG - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_COMP - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_PAGE - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_HWPAGE - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_ADDR - ADI Blackfin arithmetic relocation. - - -- : BFD_RELOC_D10V_10_PCREL_R - Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2 - bits assumed to be 0. - - -- : BFD_RELOC_D10V_10_PCREL_L - Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2 - bits assumed to be 0. This is the same as the previous reloc - except it is in the left container, i.e., shifted left 15 bits. - - -- : BFD_RELOC_D10V_18 - This is an 18-bit reloc with the right 2 bits assumed to be 0. - - -- : BFD_RELOC_D10V_18_PCREL - This is an 18-bit reloc with the right 2 bits assumed to be 0. - - -- : BFD_RELOC_D30V_6 - Mitsubishi D30V relocs. This is a 6-bit absolute reloc. - - -- : BFD_RELOC_D30V_9_PCREL - This is a 6-bit pc-relative reloc with the right 3 bits assumed to - be 0. - - -- : BFD_RELOC_D30V_9_PCREL_R - This is a 6-bit pc-relative reloc with the right 3 bits assumed to - be 0. Same as the previous reloc but on the right side of the - container. - - -- : BFD_RELOC_D30V_15 - This is a 12-bit absolute reloc with the right 3 bitsassumed to be - 0. - - -- : BFD_RELOC_D30V_15_PCREL - This is a 12-bit pc-relative reloc with the right 3 bits assumed - to be 0. - - -- : BFD_RELOC_D30V_15_PCREL_R - This is a 12-bit pc-relative reloc with the right 3 bits assumed - to be 0. Same as the previous reloc but on the right side of the - container. - - -- : BFD_RELOC_D30V_21 - This is an 18-bit absolute reloc with the right 3 bits assumed to - be 0. - - -- : BFD_RELOC_D30V_21_PCREL - This is an 18-bit pc-relative reloc with the right 3 bits assumed - to be 0. - - -- : BFD_RELOC_D30V_21_PCREL_R - This is an 18-bit pc-relative reloc with the right 3 bits assumed - to be 0. Same as the previous reloc but on the right side of the - container. - - -- : BFD_RELOC_D30V_32 - This is a 32-bit absolute reloc. - - -- : BFD_RELOC_D30V_32_PCREL - This is a 32-bit pc-relative reloc. - - -- : BFD_RELOC_DLX_HI16_S - DLX relocs - - -- : BFD_RELOC_DLX_LO16 - DLX relocs - - -- : BFD_RELOC_DLX_JMP26 - DLX relocs - - -- : BFD_RELOC_M32C_HI8 - -- : BFD_RELOC_M32C_RL_JUMP - -- : BFD_RELOC_M32C_RL_1ADDR - -- : BFD_RELOC_M32C_RL_2ADDR - Renesas M16C/M32C Relocations. - - -- : BFD_RELOC_M32R_24 - Renesas M32R (formerly Mitsubishi M32R) relocs. This is a 24 bit - absolute address. - - -- : BFD_RELOC_M32R_10_PCREL - This is a 10-bit pc-relative reloc with the right 2 bits assumed - to be 0. - - -- : BFD_RELOC_M32R_18_PCREL - This is an 18-bit reloc with the right 2 bits assumed to be 0. - - -- : BFD_RELOC_M32R_26_PCREL - This is a 26-bit reloc with the right 2 bits assumed to be 0. - - -- : BFD_RELOC_M32R_HI16_ULO - This is a 16-bit reloc containing the high 16 bits of an address - used when the lower 16 bits are treated as unsigned. - - -- : BFD_RELOC_M32R_HI16_SLO - This is a 16-bit reloc containing the high 16 bits of an address - used when the lower 16 bits are treated as signed. - - -- : BFD_RELOC_M32R_LO16 - This is a 16-bit reloc containing the lower 16 bits of an address. - - -- : BFD_RELOC_M32R_SDA16 - This is a 16-bit reloc containing the small data area offset for - use in add3, load, and store instructions. - - -- : BFD_RELOC_M32R_GOT24 - -- : BFD_RELOC_M32R_26_PLTREL - -- : BFD_RELOC_M32R_COPY - -- : BFD_RELOC_M32R_GLOB_DAT - -- : BFD_RELOC_M32R_JMP_SLOT - -- : BFD_RELOC_M32R_RELATIVE - -- : BFD_RELOC_M32R_GOTOFF - -- : BFD_RELOC_M32R_GOTOFF_HI_ULO - -- : BFD_RELOC_M32R_GOTOFF_HI_SLO - -- : BFD_RELOC_M32R_GOTOFF_LO - -- : BFD_RELOC_M32R_GOTPC24 - -- : BFD_RELOC_M32R_GOT16_HI_ULO - -- : BFD_RELOC_M32R_GOT16_HI_SLO - -- : BFD_RELOC_M32R_GOT16_LO - -- : BFD_RELOC_M32R_GOTPC_HI_ULO - -- : BFD_RELOC_M32R_GOTPC_HI_SLO - -- : BFD_RELOC_M32R_GOTPC_LO - For PIC. - - -- : BFD_RELOC_V850_9_PCREL - This is a 9-bit reloc - - -- : BFD_RELOC_V850_22_PCREL - This is a 22-bit reloc - - -- : BFD_RELOC_V850_SDA_16_16_OFFSET - This is a 16 bit offset from the short data area pointer. - - -- : BFD_RELOC_V850_SDA_15_16_OFFSET - This is a 16 bit offset (of which only 15 bits are used) from the - short data area pointer. - - -- : BFD_RELOC_V850_ZDA_16_16_OFFSET - This is a 16 bit offset from the zero data area pointer. - - -- : BFD_RELOC_V850_ZDA_15_16_OFFSET - This is a 16 bit offset (of which only 15 bits are used) from the - zero data area pointer. - - -- : BFD_RELOC_V850_TDA_6_8_OFFSET - This is an 8 bit offset (of which only 6 bits are used) from the - tiny data area pointer. - - -- : BFD_RELOC_V850_TDA_7_8_OFFSET - This is an 8bit offset (of which only 7 bits are used) from the - tiny data area pointer. - - -- : BFD_RELOC_V850_TDA_7_7_OFFSET - This is a 7 bit offset from the tiny data area pointer. - - -- : BFD_RELOC_V850_TDA_16_16_OFFSET - This is a 16 bit offset from the tiny data area pointer. - - -- : BFD_RELOC_V850_TDA_4_5_OFFSET - This is a 5 bit offset (of which only 4 bits are used) from the - tiny data area pointer. - - -- : BFD_RELOC_V850_TDA_4_4_OFFSET - This is a 4 bit offset from the tiny data area pointer. - - -- : BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET - This is a 16 bit offset from the short data area pointer, with the - bits placed non-contiguously in the instruction. - - -- : BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET - This is a 16 bit offset from the zero data area pointer, with the - bits placed non-contiguously in the instruction. - - -- : BFD_RELOC_V850_CALLT_6_7_OFFSET - This is a 6 bit offset from the call table base pointer. - - -- : BFD_RELOC_V850_CALLT_16_16_OFFSET - This is a 16 bit offset from the call table base pointer. - - -- : BFD_RELOC_V850_LONGCALL - Used for relaxing indirect function calls. - - -- : BFD_RELOC_V850_LONGJUMP - Used for relaxing indirect jumps. - - -- : BFD_RELOC_V850_ALIGN - Used to maintain alignment whilst relaxing. - - -- : BFD_RELOC_V850_LO16_SPLIT_OFFSET - This is a variation of BFD_RELOC_LO16 that can be used in v850e - ld.bu instructions. - - -- : BFD_RELOC_V850_16_PCREL - This is a 16-bit reloc. - - -- : BFD_RELOC_V850_17_PCREL - This is a 17-bit reloc. - - -- : BFD_RELOC_V850_23 - This is a 23-bit reloc. - - -- : BFD_RELOC_V850_32_PCREL - This is a 32-bit reloc. - - -- : BFD_RELOC_V850_32_ABS - This is a 32-bit reloc. - - -- : BFD_RELOC_V850_16_SPLIT_OFFSET - This is a 16-bit reloc. - - -- : BFD_RELOC_V850_16_S1 - This is a 16-bit reloc. - - -- : BFD_RELOC_V850_LO16_S1 - Low 16 bits. 16 bit shifted by 1. - - -- : BFD_RELOC_V850_CALLT_15_16_OFFSET - This is a 16 bit offset from the call table base pointer. - - -- : BFD_RELOC_V850_32_GOTPCREL - DSO relocations. - - -- : BFD_RELOC_V850_16_GOT - DSO relocations. - - -- : BFD_RELOC_V850_32_GOT - DSO relocations. - - -- : BFD_RELOC_V850_22_PLT_PCREL - DSO relocations. - - -- : BFD_RELOC_V850_32_PLT_PCREL - DSO relocations. - - -- : BFD_RELOC_V850_COPY - DSO relocations. - - -- : BFD_RELOC_V850_GLOB_DAT - DSO relocations. - - -- : BFD_RELOC_V850_JMP_SLOT - DSO relocations. - - -- : BFD_RELOC_V850_RELATIVE - DSO relocations. - - -- : BFD_RELOC_V850_16_GOTOFF - DSO relocations. - - -- : BFD_RELOC_V850_32_GOTOFF - DSO relocations. - - -- : BFD_RELOC_V850_CODE - start code. - - -- : BFD_RELOC_V850_DATA - start data in text. - - -- : BFD_RELOC_TIC30_LDP - This is a 8bit DP reloc for the tms320c30, where the most - significant 8 bits of a 24 bit word are placed into the least - significant 8 bits of the opcode. - - -- : BFD_RELOC_TIC54X_PARTLS7 - This is a 7bit reloc for the tms320c54x, where the least - significant 7 bits of a 16 bit word are placed into the least - significant 7 bits of the opcode. - - -- : BFD_RELOC_TIC54X_PARTMS9 - This is a 9bit DP reloc for the tms320c54x, where the most - significant 9 bits of a 16 bit word are placed into the least - significant 9 bits of the opcode. - - -- : BFD_RELOC_TIC54X_23 - This is an extended address 23-bit reloc for the tms320c54x. - - -- : BFD_RELOC_TIC54X_16_OF_23 - This is a 16-bit reloc for the tms320c54x, where the least - significant 16 bits of a 23-bit extended address are placed into - the opcode. - - -- : BFD_RELOC_TIC54X_MS7_OF_23 - This is a reloc for the tms320c54x, where the most significant 7 - bits of a 23-bit extended address are placed into the opcode. - - -- : BFD_RELOC_C6000_PCR_S21 - -- : BFD_RELOC_C6000_PCR_S12 - -- : BFD_RELOC_C6000_PCR_S10 - -- : BFD_RELOC_C6000_PCR_S7 - -- : BFD_RELOC_C6000_ABS_S16 - -- : BFD_RELOC_C6000_ABS_L16 - -- : BFD_RELOC_C6000_ABS_H16 - -- : BFD_RELOC_C6000_SBR_U15_B - -- : BFD_RELOC_C6000_SBR_U15_H - -- : BFD_RELOC_C6000_SBR_U15_W - -- : BFD_RELOC_C6000_SBR_S16 - -- : BFD_RELOC_C6000_SBR_L16_B - -- : BFD_RELOC_C6000_SBR_L16_H - -- : BFD_RELOC_C6000_SBR_L16_W - -- : BFD_RELOC_C6000_SBR_H16_B - -- : BFD_RELOC_C6000_SBR_H16_H - -- : BFD_RELOC_C6000_SBR_H16_W - -- : BFD_RELOC_C6000_SBR_GOT_U15_W - -- : BFD_RELOC_C6000_SBR_GOT_L16_W - -- : BFD_RELOC_C6000_SBR_GOT_H16_W - -- : BFD_RELOC_C6000_DSBT_INDEX - -- : BFD_RELOC_C6000_PREL31 - -- : BFD_RELOC_C6000_COPY - -- : BFD_RELOC_C6000_JUMP_SLOT - -- : BFD_RELOC_C6000_EHTYPE - -- : BFD_RELOC_C6000_PCR_H16 - -- : BFD_RELOC_C6000_PCR_L16 - -- : BFD_RELOC_C6000_ALIGN - -- : BFD_RELOC_C6000_FPHEAD - -- : BFD_RELOC_C6000_NOCMP - TMS320C6000 relocations. - - -- : BFD_RELOC_FR30_48 - This is a 48 bit reloc for the FR30 that stores 32 bits. - - -- : BFD_RELOC_FR30_20 - This is a 32 bit reloc for the FR30 that stores 20 bits split up - into two sections. - - -- : BFD_RELOC_FR30_6_IN_4 - This is a 16 bit reloc for the FR30 that stores a 6 bit word - offset in 4 bits. - - -- : BFD_RELOC_FR30_8_IN_8 - This is a 16 bit reloc for the FR30 that stores an 8 bit byte - offset into 8 bits. - - -- : BFD_RELOC_FR30_9_IN_8 - This is a 16 bit reloc for the FR30 that stores a 9 bit short - offset into 8 bits. - - -- : BFD_RELOC_FR30_10_IN_8 - This is a 16 bit reloc for the FR30 that stores a 10 bit word - offset into 8 bits. - - -- : BFD_RELOC_FR30_9_PCREL - This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative - short offset into 8 bits. - - -- : BFD_RELOC_FR30_12_PCREL - This is a 16 bit reloc for the FR30 that stores a 12 bit pc - relative short offset into 11 bits. - - -- : BFD_RELOC_MCORE_PCREL_IMM8BY4 - -- : BFD_RELOC_MCORE_PCREL_IMM11BY2 - -- : BFD_RELOC_MCORE_PCREL_IMM4BY2 - -- : BFD_RELOC_MCORE_PCREL_32 - -- : BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2 - -- : BFD_RELOC_MCORE_RVA - Motorola Mcore relocations. - - -- : BFD_RELOC_MEP_8 - -- : BFD_RELOC_MEP_16 - -- : BFD_RELOC_MEP_32 - -- : BFD_RELOC_MEP_PCREL8A2 - -- : BFD_RELOC_MEP_PCREL12A2 - -- : BFD_RELOC_MEP_PCREL17A2 - -- : BFD_RELOC_MEP_PCREL24A2 - -- : BFD_RELOC_MEP_PCABS24A2 - -- : BFD_RELOC_MEP_LOW16 - -- : BFD_RELOC_MEP_HI16U - -- : BFD_RELOC_MEP_HI16S - -- : BFD_RELOC_MEP_GPREL - -- : BFD_RELOC_MEP_TPREL - -- : BFD_RELOC_MEP_TPREL7 - -- : BFD_RELOC_MEP_TPREL7A2 - -- : BFD_RELOC_MEP_TPREL7A4 - -- : BFD_RELOC_MEP_UIMM24 - -- : BFD_RELOC_MEP_ADDR24A4 - -- : BFD_RELOC_MEP_GNU_VTINHERIT - -- : BFD_RELOC_MEP_GNU_VTENTRY - Toshiba Media Processor Relocations. - - -- : BFD_RELOC_METAG_HIADDR16 - -- : BFD_RELOC_METAG_LOADDR16 - -- : BFD_RELOC_METAG_RELBRANCH - -- : BFD_RELOC_METAG_GETSETOFF - -- : BFD_RELOC_METAG_HIOG - -- : BFD_RELOC_METAG_LOOG - -- : BFD_RELOC_METAG_REL8 - -- : BFD_RELOC_METAG_REL16 - -- : BFD_RELOC_METAG_HI16_GOTOFF - -- : BFD_RELOC_METAG_LO16_GOTOFF - -- : BFD_RELOC_METAG_GETSET_GOTOFF - -- : BFD_RELOC_METAG_GETSET_GOT - -- : BFD_RELOC_METAG_HI16_GOTPC - -- : BFD_RELOC_METAG_LO16_GOTPC - -- : BFD_RELOC_METAG_HI16_PLT - -- : BFD_RELOC_METAG_LO16_PLT - -- : BFD_RELOC_METAG_RELBRANCH_PLT - -- : BFD_RELOC_METAG_GOTOFF - -- : BFD_RELOC_METAG_PLT - -- : BFD_RELOC_METAG_COPY - -- : BFD_RELOC_METAG_JMP_SLOT - -- : BFD_RELOC_METAG_RELATIVE - -- : BFD_RELOC_METAG_GLOB_DAT - -- : BFD_RELOC_METAG_TLS_GD - -- : BFD_RELOC_METAG_TLS_LDM - -- : BFD_RELOC_METAG_TLS_LDO_HI16 - -- : BFD_RELOC_METAG_TLS_LDO_LO16 - -- : BFD_RELOC_METAG_TLS_LDO - -- : BFD_RELOC_METAG_TLS_IE - -- : BFD_RELOC_METAG_TLS_IENONPIC - -- : BFD_RELOC_METAG_TLS_IENONPIC_HI16 - -- : BFD_RELOC_METAG_TLS_IENONPIC_LO16 - -- : BFD_RELOC_METAG_TLS_TPOFF - -- : BFD_RELOC_METAG_TLS_DTPMOD - -- : BFD_RELOC_METAG_TLS_DTPOFF - -- : BFD_RELOC_METAG_TLS_LE - -- : BFD_RELOC_METAG_TLS_LE_HI16 - -- : BFD_RELOC_METAG_TLS_LE_LO16 - Imagination Technologies Meta relocations. - - -- : BFD_RELOC_MMIX_GETA - -- : BFD_RELOC_MMIX_GETA_1 - -- : BFD_RELOC_MMIX_GETA_2 - -- : BFD_RELOC_MMIX_GETA_3 - These are relocations for the GETA instruction. - - -- : BFD_RELOC_MMIX_CBRANCH - -- : BFD_RELOC_MMIX_CBRANCH_J - -- : BFD_RELOC_MMIX_CBRANCH_1 - -- : BFD_RELOC_MMIX_CBRANCH_2 - -- : BFD_RELOC_MMIX_CBRANCH_3 - These are relocations for a conditional branch instruction. - - -- : BFD_RELOC_MMIX_PUSHJ - -- : BFD_RELOC_MMIX_PUSHJ_1 - -- : BFD_RELOC_MMIX_PUSHJ_2 - -- : BFD_RELOC_MMIX_PUSHJ_3 - -- : BFD_RELOC_MMIX_PUSHJ_STUBBABLE - These are relocations for the PUSHJ instruction. - - -- : BFD_RELOC_MMIX_JMP - -- : BFD_RELOC_MMIX_JMP_1 - -- : BFD_RELOC_MMIX_JMP_2 - -- : BFD_RELOC_MMIX_JMP_3 - These are relocations for the JMP instruction. - - -- : BFD_RELOC_MMIX_ADDR19 - This is a relocation for a relative address as in a GETA - instruction or a branch. - - -- : BFD_RELOC_MMIX_ADDR27 - This is a relocation for a relative address as in a JMP - instruction. - - -- : BFD_RELOC_MMIX_REG_OR_BYTE - This is a relocation for an instruction field that may be a general - register or a value 0..255. - - -- : BFD_RELOC_MMIX_REG - This is a relocation for an instruction field that may be a general - register. - - -- : BFD_RELOC_MMIX_BASE_PLUS_OFFSET - This is a relocation for two instruction fields holding a register - and an offset, the equivalent of the relocation. - - -- : BFD_RELOC_MMIX_LOCAL - This relocation is an assertion that the expression is not - allocated as a global register. It does not modify contents. - - -- : BFD_RELOC_AVR_7_PCREL - This is a 16 bit reloc for the AVR that stores 8 bit pc relative - short offset into 7 bits. - - -- : BFD_RELOC_AVR_13_PCREL - This is a 16 bit reloc for the AVR that stores 13 bit pc relative - short offset into 12 bits. - - -- : BFD_RELOC_AVR_16_PM - This is a 16 bit reloc for the AVR that stores 17 bit value - (usually program memory address) into 16 bits. - - -- : BFD_RELOC_AVR_LO8_LDI - This is a 16 bit reloc for the AVR that stores 8 bit value (usually - data memory address) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_HI8_LDI - This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 - bit of data memory address) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_HH8_LDI - This is a 16 bit reloc for the AVR that stores 8 bit value (most - high 8 bit of program memory address) into 8 bit immediate value - of LDI insn. - - -- : BFD_RELOC_AVR_MS8_LDI - This is a 16 bit reloc for the AVR that stores 8 bit value (most - high 8 bit of 32 bit value) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_LO8_LDI_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (usually data memory address) into 8 bit immediate value of SUBI - insn. - - -- : BFD_RELOC_AVR_HI8_LDI_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (high 8 bit of data memory address) into 8 bit immediate value of - SUBI insn. - - -- : BFD_RELOC_AVR_HH8_LDI_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (most high 8 bit of program memory address) into 8 bit immediate - value of LDI or SUBI insn. - - -- : BFD_RELOC_AVR_MS8_LDI_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (msb of 32 bit value) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_LO8_LDI_PM - This is a 16 bit reloc for the AVR that stores 8 bit value (usually - command address) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_LO8_LDI_GS - This is a 16 bit reloc for the AVR that stores 8 bit value - (command address) into 8 bit immediate value of LDI insn. If the - address is beyond the 128k boundary, the linker inserts a jump - stub for this reloc in the lower 128k. - - -- : BFD_RELOC_AVR_HI8_LDI_PM - This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 - bit of command address) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_HI8_LDI_GS - This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 - bit of command address) into 8 bit immediate value of LDI insn. - If the address is beyond the 128k boundary, the linker inserts a - jump stub for this reloc below 128k. - - -- : BFD_RELOC_AVR_HH8_LDI_PM - This is a 16 bit reloc for the AVR that stores 8 bit value (most - high 8 bit of command address) into 8 bit immediate value of LDI - insn. - - -- : BFD_RELOC_AVR_LO8_LDI_PM_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (usually command address) into 8 bit immediate value of SUBI insn. - - -- : BFD_RELOC_AVR_HI8_LDI_PM_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (high 8 bit of 16 bit command address) into 8 bit immediate value - of SUBI insn. - - -- : BFD_RELOC_AVR_HH8_LDI_PM_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (high 6 bit of 22 bit command address) into 8 bit immediate value - of SUBI insn. - - -- : BFD_RELOC_AVR_CALL - This is a 32 bit reloc for the AVR that stores 23 bit value into - 22 bits. - - -- : BFD_RELOC_AVR_LDI - This is a 16 bit reloc for the AVR that stores all needed bits for - absolute addressing with ldi with overflow check to linktime - - -- : BFD_RELOC_AVR_6 - This is a 6 bit reloc for the AVR that stores offset for ldd/std - instructions - - -- : BFD_RELOC_AVR_6_ADIW - This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw - instructions - - -- : BFD_RELOC_AVR_8_LO - This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol - in .byte lo8(symbol) - - -- : BFD_RELOC_AVR_8_HI - This is a 8 bit reloc for the AVR that stores bits 8..15 of a - symbol in .byte hi8(symbol) - - -- : BFD_RELOC_AVR_8_HLO - This is a 8 bit reloc for the AVR that stores bits 16..23 of a - symbol in .byte hlo8(symbol) - - -- : BFD_RELOC_RL78_NEG8 - -- : BFD_RELOC_RL78_NEG16 - -- : BFD_RELOC_RL78_NEG24 - -- : BFD_RELOC_RL78_NEG32 - -- : BFD_RELOC_RL78_16_OP - -- : BFD_RELOC_RL78_24_OP - -- : BFD_RELOC_RL78_32_OP - -- : BFD_RELOC_RL78_8U - -- : BFD_RELOC_RL78_16U - -- : BFD_RELOC_RL78_24U - -- : BFD_RELOC_RL78_DIR3U_PCREL - -- : BFD_RELOC_RL78_DIFF - -- : BFD_RELOC_RL78_GPRELB - -- : BFD_RELOC_RL78_GPRELW - -- : BFD_RELOC_RL78_GPRELL - -- : BFD_RELOC_RL78_SYM - -- : BFD_RELOC_RL78_OP_SUBTRACT - -- : BFD_RELOC_RL78_OP_NEG - -- : BFD_RELOC_RL78_OP_AND - -- : BFD_RELOC_RL78_OP_SHRA - -- : BFD_RELOC_RL78_ABS8 - -- : BFD_RELOC_RL78_ABS16 - -- : BFD_RELOC_RL78_ABS16_REV - -- : BFD_RELOC_RL78_ABS32 - -- : BFD_RELOC_RL78_ABS32_REV - -- : BFD_RELOC_RL78_ABS16U - -- : BFD_RELOC_RL78_ABS16UW - -- : BFD_RELOC_RL78_ABS16UL - -- : BFD_RELOC_RL78_RELAX - -- : BFD_RELOC_RL78_HI16 - -- : BFD_RELOC_RL78_HI8 - -- : BFD_RELOC_RL78_LO16 - -- : BFD_RELOC_RL78_CODE - Renesas RL78 Relocations. - - -- : BFD_RELOC_RX_NEG8 - -- : BFD_RELOC_RX_NEG16 - -- : BFD_RELOC_RX_NEG24 - -- : BFD_RELOC_RX_NEG32 - -- : BFD_RELOC_RX_16_OP - -- : BFD_RELOC_RX_24_OP - -- : BFD_RELOC_RX_32_OP - -- : BFD_RELOC_RX_8U - -- : BFD_RELOC_RX_16U - -- : BFD_RELOC_RX_24U - -- : BFD_RELOC_RX_DIR3U_PCREL - -- : BFD_RELOC_RX_DIFF - -- : BFD_RELOC_RX_GPRELB - -- : BFD_RELOC_RX_GPRELW - -- : BFD_RELOC_RX_GPRELL - -- : BFD_RELOC_RX_SYM - -- : BFD_RELOC_RX_OP_SUBTRACT - -- : BFD_RELOC_RX_OP_NEG - -- : BFD_RELOC_RX_ABS8 - -- : BFD_RELOC_RX_ABS16 - -- : BFD_RELOC_RX_ABS16_REV - -- : BFD_RELOC_RX_ABS32 - -- : BFD_RELOC_RX_ABS32_REV - -- : BFD_RELOC_RX_ABS16U - -- : BFD_RELOC_RX_ABS16UW - -- : BFD_RELOC_RX_ABS16UL - -- : BFD_RELOC_RX_RELAX - Renesas RX Relocations. - - -- : BFD_RELOC_390_12 - Direct 12 bit. - - -- : BFD_RELOC_390_GOT12 - 12 bit GOT offset. - - -- : BFD_RELOC_390_PLT32 - 32 bit PC relative PLT address. - - -- : BFD_RELOC_390_COPY - Copy symbol at runtime. - - -- : BFD_RELOC_390_GLOB_DAT - Create GOT entry. - - -- : BFD_RELOC_390_JMP_SLOT - Create PLT entry. - - -- : BFD_RELOC_390_RELATIVE - Adjust by program base. - - -- : BFD_RELOC_390_GOTPC - 32 bit PC relative offset to GOT. - - -- : BFD_RELOC_390_GOT16 - 16 bit GOT offset. - - -- : BFD_RELOC_390_PC12DBL - PC relative 12 bit shifted by 1. - - -- : BFD_RELOC_390_PLT12DBL - 12 bit PC rel. PLT shifted by 1. - - -- : BFD_RELOC_390_PC16DBL - PC relative 16 bit shifted by 1. - - -- : BFD_RELOC_390_PLT16DBL - 16 bit PC rel. PLT shifted by 1. - - -- : BFD_RELOC_390_PC24DBL - PC relative 24 bit shifted by 1. - - -- : BFD_RELOC_390_PLT24DBL - 24 bit PC rel. PLT shifted by 1. - - -- : BFD_RELOC_390_PC32DBL - PC relative 32 bit shifted by 1. - - -- : BFD_RELOC_390_PLT32DBL - 32 bit PC rel. PLT shifted by 1. - - -- : BFD_RELOC_390_GOTPCDBL - 32 bit PC rel. GOT shifted by 1. - - -- : BFD_RELOC_390_GOT64 - 64 bit GOT offset. - - -- : BFD_RELOC_390_PLT64 - 64 bit PC relative PLT address. - - -- : BFD_RELOC_390_GOTENT - 32 bit rel. offset to GOT entry. - - -- : BFD_RELOC_390_GOTOFF64 - 64 bit offset to GOT. - - -- : BFD_RELOC_390_GOTPLT12 - 12-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_390_GOTPLT16 - 16-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_390_GOTPLT32 - 32-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_390_GOTPLT64 - 64-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_390_GOTPLTENT - 32-bit rel. offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_390_PLTOFF16 - 16-bit rel. offset from the GOT to a PLT entry. - - -- : BFD_RELOC_390_PLTOFF32 - 32-bit rel. offset from the GOT to a PLT entry. - - -- : BFD_RELOC_390_PLTOFF64 - 64-bit rel. offset from the GOT to a PLT entry. - - -- : BFD_RELOC_390_TLS_LOAD - -- : BFD_RELOC_390_TLS_GDCALL - -- : BFD_RELOC_390_TLS_LDCALL - -- : BFD_RELOC_390_TLS_GD32 - -- : BFD_RELOC_390_TLS_GD64 - -- : BFD_RELOC_390_TLS_GOTIE12 - -- : BFD_RELOC_390_TLS_GOTIE32 - -- : BFD_RELOC_390_TLS_GOTIE64 - -- : BFD_RELOC_390_TLS_LDM32 - -- : BFD_RELOC_390_TLS_LDM64 - -- : BFD_RELOC_390_TLS_IE32 - -- : BFD_RELOC_390_TLS_IE64 - -- : BFD_RELOC_390_TLS_IEENT - -- : BFD_RELOC_390_TLS_LE32 - -- : BFD_RELOC_390_TLS_LE64 - -- : BFD_RELOC_390_TLS_LDO32 - -- : BFD_RELOC_390_TLS_LDO64 - -- : BFD_RELOC_390_TLS_DTPMOD - -- : BFD_RELOC_390_TLS_DTPOFF - -- : BFD_RELOC_390_TLS_TPOFF - s390 tls relocations. - - -- : BFD_RELOC_390_20 - -- : BFD_RELOC_390_GOT20 - -- : BFD_RELOC_390_GOTPLT20 - -- : BFD_RELOC_390_TLS_GOTIE20 - Long displacement extension. - - -- : BFD_RELOC_390_IRELATIVE - STT_GNU_IFUNC relocation. - - -- : BFD_RELOC_SCORE_GPREL15 - Score relocations Low 16 bit for load/store - - -- : BFD_RELOC_SCORE_DUMMY2 - -- : BFD_RELOC_SCORE_JMP - This is a 24-bit reloc with the right 1 bit assumed to be 0 - - -- : BFD_RELOC_SCORE_BRANCH - This is a 19-bit reloc with the right 1 bit assumed to be 0 - - -- : BFD_RELOC_SCORE_IMM30 - This is a 32-bit reloc for 48-bit instructions. - - -- : BFD_RELOC_SCORE_IMM32 - This is a 32-bit reloc for 48-bit instructions. - - -- : BFD_RELOC_SCORE16_JMP - This is a 11-bit reloc with the right 1 bit assumed to be 0 - - -- : BFD_RELOC_SCORE16_BRANCH - This is a 8-bit reloc with the right 1 bit assumed to be 0 - - -- : BFD_RELOC_SCORE_BCMP - This is a 9-bit reloc with the right 1 bit assumed to be 0 - - -- : BFD_RELOC_SCORE_GOT15 - -- : BFD_RELOC_SCORE_GOT_LO16 - -- : BFD_RELOC_SCORE_CALL15 - -- : BFD_RELOC_SCORE_DUMMY_HI16 - Undocumented Score relocs - - -- : BFD_RELOC_IP2K_FR9 - Scenix IP2K - 9-bit register number / data address - - -- : BFD_RELOC_IP2K_BANK - Scenix IP2K - 4-bit register/data bank number - - -- : BFD_RELOC_IP2K_ADDR16CJP - Scenix IP2K - low 13 bits of instruction word address - - -- : BFD_RELOC_IP2K_PAGE3 - Scenix IP2K - high 3 bits of instruction word address - - -- : BFD_RELOC_IP2K_LO8DATA - -- : BFD_RELOC_IP2K_HI8DATA - -- : BFD_RELOC_IP2K_EX8DATA - Scenix IP2K - ext/low/high 8 bits of data address - - -- : BFD_RELOC_IP2K_LO8INSN - -- : BFD_RELOC_IP2K_HI8INSN - Scenix IP2K - low/high 8 bits of instruction word address - - -- : BFD_RELOC_IP2K_PC_SKIP - Scenix IP2K - even/odd PC modifier to modify snb pcl.0 - - -- : BFD_RELOC_IP2K_TEXT - Scenix IP2K - 16 bit word address in text section. - - -- : BFD_RELOC_IP2K_FR_OFFSET - Scenix IP2K - 7-bit sp or dp offset - - -- : BFD_RELOC_VPE4KMATH_DATA - -- : BFD_RELOC_VPE4KMATH_INSN - Scenix VPE4K coprocessor - data/insn-space addressing - - -- : BFD_RELOC_VTABLE_INHERIT - -- : BFD_RELOC_VTABLE_ENTRY - These two relocations are used by the linker to determine which of - the entries in a C++ virtual function table are actually used. - When the -gc-sections option is given, the linker will zero out - the entries that are not used, so that the code for those - functions need not be included in the output. - - VTABLE_INHERIT is a zero-space relocation used to describe to the - linker the inheritance tree of a C++ virtual function table. The - relocation's symbol should be the parent class' vtable, and the - relocation should be located at the child vtable. - - VTABLE_ENTRY is a zero-space relocation that describes the use of a - virtual function table entry. The reloc's symbol should refer to - the table of the class mentioned in the code. Off of that base, - an offset describes the entry that is being used. For Rela hosts, - this offset is stored in the reloc's addend. For Rel hosts, we - are forced to put this offset in the reloc's section offset. - - -- : BFD_RELOC_IA64_IMM14 - -- : BFD_RELOC_IA64_IMM22 - -- : BFD_RELOC_IA64_IMM64 - -- : BFD_RELOC_IA64_DIR32MSB - -- : BFD_RELOC_IA64_DIR32LSB - -- : BFD_RELOC_IA64_DIR64MSB - -- : BFD_RELOC_IA64_DIR64LSB - -- : BFD_RELOC_IA64_GPREL22 - -- : BFD_RELOC_IA64_GPREL64I - -- : BFD_RELOC_IA64_GPREL32MSB - -- : BFD_RELOC_IA64_GPREL32LSB - -- : BFD_RELOC_IA64_GPREL64MSB - -- : BFD_RELOC_IA64_GPREL64LSB - -- : BFD_RELOC_IA64_LTOFF22 - -- : BFD_RELOC_IA64_LTOFF64I - -- : BFD_RELOC_IA64_PLTOFF22 - -- : BFD_RELOC_IA64_PLTOFF64I - -- : BFD_RELOC_IA64_PLTOFF64MSB - -- : BFD_RELOC_IA64_PLTOFF64LSB - -- : BFD_RELOC_IA64_FPTR64I - -- : BFD_RELOC_IA64_FPTR32MSB - -- : BFD_RELOC_IA64_FPTR32LSB - -- : BFD_RELOC_IA64_FPTR64MSB - -- : BFD_RELOC_IA64_FPTR64LSB - -- : BFD_RELOC_IA64_PCREL21B - -- : BFD_RELOC_IA64_PCREL21BI - -- : BFD_RELOC_IA64_PCREL21M - -- : BFD_RELOC_IA64_PCREL21F - -- : BFD_RELOC_IA64_PCREL22 - -- : BFD_RELOC_IA64_PCREL60B - -- : BFD_RELOC_IA64_PCREL64I - -- : BFD_RELOC_IA64_PCREL32MSB - -- : BFD_RELOC_IA64_PCREL32LSB - -- : BFD_RELOC_IA64_PCREL64MSB - -- : BFD_RELOC_IA64_PCREL64LSB - -- : BFD_RELOC_IA64_LTOFF_FPTR22 - -- : BFD_RELOC_IA64_LTOFF_FPTR64I - -- : BFD_RELOC_IA64_LTOFF_FPTR32MSB - -- : BFD_RELOC_IA64_LTOFF_FPTR32LSB - -- : BFD_RELOC_IA64_LTOFF_FPTR64MSB - -- : BFD_RELOC_IA64_LTOFF_FPTR64LSB - -- : BFD_RELOC_IA64_SEGREL32MSB - -- : BFD_RELOC_IA64_SEGREL32LSB - -- : BFD_RELOC_IA64_SEGREL64MSB - -- : BFD_RELOC_IA64_SEGREL64LSB - -- : BFD_RELOC_IA64_SECREL32MSB - -- : BFD_RELOC_IA64_SECREL32LSB - -- : BFD_RELOC_IA64_SECREL64MSB - -- : BFD_RELOC_IA64_SECREL64LSB - -- : BFD_RELOC_IA64_REL32MSB - -- : BFD_RELOC_IA64_REL32LSB - -- : BFD_RELOC_IA64_REL64MSB - -- : BFD_RELOC_IA64_REL64LSB - -- : BFD_RELOC_IA64_LTV32MSB - -- : BFD_RELOC_IA64_LTV32LSB - -- : BFD_RELOC_IA64_LTV64MSB - -- : BFD_RELOC_IA64_LTV64LSB - -- : BFD_RELOC_IA64_IPLTMSB - -- : BFD_RELOC_IA64_IPLTLSB - -- : BFD_RELOC_IA64_COPY - -- : BFD_RELOC_IA64_LTOFF22X - -- : BFD_RELOC_IA64_LDXMOV - -- : BFD_RELOC_IA64_TPREL14 - -- : BFD_RELOC_IA64_TPREL22 - -- : BFD_RELOC_IA64_TPREL64I - -- : BFD_RELOC_IA64_TPREL64MSB - -- : BFD_RELOC_IA64_TPREL64LSB - -- : BFD_RELOC_IA64_LTOFF_TPREL22 - -- : BFD_RELOC_IA64_DTPMOD64MSB - -- : BFD_RELOC_IA64_DTPMOD64LSB - -- : BFD_RELOC_IA64_LTOFF_DTPMOD22 - -- : BFD_RELOC_IA64_DTPREL14 - -- : BFD_RELOC_IA64_DTPREL22 - -- : BFD_RELOC_IA64_DTPREL64I - -- : BFD_RELOC_IA64_DTPREL32MSB - -- : BFD_RELOC_IA64_DTPREL32LSB - -- : BFD_RELOC_IA64_DTPREL64MSB - -- : BFD_RELOC_IA64_DTPREL64LSB - -- : BFD_RELOC_IA64_LTOFF_DTPREL22 - Intel IA64 Relocations. - - -- : BFD_RELOC_M68HC11_HI8 - Motorola 68HC11 reloc. This is the 8 bit high part of an absolute - address. - - -- : BFD_RELOC_M68HC11_LO8 - Motorola 68HC11 reloc. This is the 8 bit low part of an absolute - address. - - -- : BFD_RELOC_M68HC11_3B - Motorola 68HC11 reloc. This is the 3 bit of a value. - - -- : BFD_RELOC_M68HC11_RL_JUMP - Motorola 68HC11 reloc. This reloc marks the beginning of a - jump/call instruction. It is used for linker relaxation to - correctly identify beginning of instruction and change some - branches to use PC-relative addressing mode. - - -- : BFD_RELOC_M68HC11_RL_GROUP - Motorola 68HC11 reloc. This reloc marks a group of several - instructions that gcc generates and for which the linker - relaxation pass can modify and/or remove some of them. - - -- : BFD_RELOC_M68HC11_LO16 - Motorola 68HC11 reloc. This is the 16-bit lower part of an - address. It is used for 'call' instruction to specify the symbol - address without any special transformation (due to memory bank - window). - - -- : BFD_RELOC_M68HC11_PAGE - Motorola 68HC11 reloc. This is a 8-bit reloc that specifies the - page number of an address. It is used by 'call' instruction to - specify the page number of the symbol. - - -- : BFD_RELOC_M68HC11_24 - Motorola 68HC11 reloc. This is a 24-bit reloc that represents the - address with a 16-bit value and a 8-bit page number. The symbol - address is transformed to follow the 16K memory bank of 68HC12 - (seen as mapped in the window). - - -- : BFD_RELOC_M68HC12_5B - Motorola 68HC12 reloc. This is the 5 bits of a value. - - -- : BFD_RELOC_XGATE_RL_JUMP - Freescale XGATE reloc. This reloc marks the beginning of a - bra/jal instruction. - - -- : BFD_RELOC_XGATE_RL_GROUP - Freescale XGATE reloc. This reloc marks a group of several - instructions that gcc generates and for which the linker - relaxation pass can modify and/or remove some of them. - - -- : BFD_RELOC_XGATE_LO16 - Freescale XGATE reloc. This is the 16-bit lower part of an - address. It is used for the '16-bit' instructions. - - -- : BFD_RELOC_XGATE_GPAGE - Freescale XGATE reloc. - - -- : BFD_RELOC_XGATE_24 - Freescale XGATE reloc. - - -- : BFD_RELOC_XGATE_PCREL_9 - Freescale XGATE reloc. This is a 9-bit pc-relative reloc. - - -- : BFD_RELOC_XGATE_PCREL_10 - Freescale XGATE reloc. This is a 10-bit pc-relative reloc. - - -- : BFD_RELOC_XGATE_IMM8_LO - Freescale XGATE reloc. This is the 16-bit lower part of an - address. It is used for the '16-bit' instructions. - - -- : BFD_RELOC_XGATE_IMM8_HI - Freescale XGATE reloc. This is the 16-bit higher part of an - address. It is used for the '16-bit' instructions. - - -- : BFD_RELOC_XGATE_IMM3 - Freescale XGATE reloc. This is a 3-bit pc-relative reloc. - - -- : BFD_RELOC_XGATE_IMM4 - Freescale XGATE reloc. This is a 4-bit pc-relative reloc. - - -- : BFD_RELOC_XGATE_IMM5 - Freescale XGATE reloc. This is a 5-bit pc-relative reloc. - - -- : BFD_RELOC_M68HC12_9B - Motorola 68HC12 reloc. This is the 9 bits of a value. - - -- : BFD_RELOC_M68HC12_16B - Motorola 68HC12 reloc. This is the 16 bits of a value. - - -- : BFD_RELOC_M68HC12_9_PCREL - Motorola 68HC12/XGATE reloc. This is a PCREL9 branch. - - -- : BFD_RELOC_M68HC12_10_PCREL - Motorola 68HC12/XGATE reloc. This is a PCREL10 branch. - - -- : BFD_RELOC_M68HC12_LO8XG - Motorola 68HC12/XGATE reloc. This is the 8 bit low part of an - absolute address and immediately precedes a matching HI8XG part. - - -- : BFD_RELOC_M68HC12_HI8XG - Motorola 68HC12/XGATE reloc. This is the 8 bit high part of an - absolute address and immediately follows a matching LO8XG part. - - -- : BFD_RELOC_16C_NUM08 - -- : BFD_RELOC_16C_NUM08_C - -- : BFD_RELOC_16C_NUM16 - -- : BFD_RELOC_16C_NUM16_C - -- : BFD_RELOC_16C_NUM32 - -- : BFD_RELOC_16C_NUM32_C - -- : BFD_RELOC_16C_DISP04 - -- : BFD_RELOC_16C_DISP04_C - -- : BFD_RELOC_16C_DISP08 - -- : BFD_RELOC_16C_DISP08_C - -- : BFD_RELOC_16C_DISP16 - -- : BFD_RELOC_16C_DISP16_C - -- : BFD_RELOC_16C_DISP24 - -- : BFD_RELOC_16C_DISP24_C - -- : BFD_RELOC_16C_DISP24a - -- : BFD_RELOC_16C_DISP24a_C - -- : BFD_RELOC_16C_REG04 - -- : BFD_RELOC_16C_REG04_C - -- : BFD_RELOC_16C_REG04a - -- : BFD_RELOC_16C_REG04a_C - -- : BFD_RELOC_16C_REG14 - -- : BFD_RELOC_16C_REG14_C - -- : BFD_RELOC_16C_REG16 - -- : BFD_RELOC_16C_REG16_C - -- : BFD_RELOC_16C_REG20 - -- : BFD_RELOC_16C_REG20_C - -- : BFD_RELOC_16C_ABS20 - -- : BFD_RELOC_16C_ABS20_C - -- : BFD_RELOC_16C_ABS24 - -- : BFD_RELOC_16C_ABS24_C - -- : BFD_RELOC_16C_IMM04 - -- : BFD_RELOC_16C_IMM04_C - -- : BFD_RELOC_16C_IMM16 - -- : BFD_RELOC_16C_IMM16_C - -- : BFD_RELOC_16C_IMM20 - -- : BFD_RELOC_16C_IMM20_C - -- : BFD_RELOC_16C_IMM24 - -- : BFD_RELOC_16C_IMM24_C - -- : BFD_RELOC_16C_IMM32 - -- : BFD_RELOC_16C_IMM32_C - NS CR16C Relocations. - - -- : BFD_RELOC_CR16_NUM8 - -- : BFD_RELOC_CR16_NUM16 - -- : BFD_RELOC_CR16_NUM32 - -- : BFD_RELOC_CR16_NUM32a - -- : BFD_RELOC_CR16_REGREL0 - -- : BFD_RELOC_CR16_REGREL4 - -- : BFD_RELOC_CR16_REGREL4a - -- : BFD_RELOC_CR16_REGREL14 - -- : BFD_RELOC_CR16_REGREL14a - -- : BFD_RELOC_CR16_REGREL16 - -- : BFD_RELOC_CR16_REGREL20 - -- : BFD_RELOC_CR16_REGREL20a - -- : BFD_RELOC_CR16_ABS20 - -- : BFD_RELOC_CR16_ABS24 - -- : BFD_RELOC_CR16_IMM4 - -- : BFD_RELOC_CR16_IMM8 - -- : BFD_RELOC_CR16_IMM16 - -- : BFD_RELOC_CR16_IMM20 - -- : BFD_RELOC_CR16_IMM24 - -- : BFD_RELOC_CR16_IMM32 - -- : BFD_RELOC_CR16_IMM32a - -- : BFD_RELOC_CR16_DISP4 - -- : BFD_RELOC_CR16_DISP8 - -- : BFD_RELOC_CR16_DISP16 - -- : BFD_RELOC_CR16_DISP20 - -- : BFD_RELOC_CR16_DISP24 - -- : BFD_RELOC_CR16_DISP24a - -- : BFD_RELOC_CR16_SWITCH8 - -- : BFD_RELOC_CR16_SWITCH16 - -- : BFD_RELOC_CR16_SWITCH32 - -- : BFD_RELOC_CR16_GOT_REGREL20 - -- : BFD_RELOC_CR16_GOTC_REGREL20 - -- : BFD_RELOC_CR16_GLOB_DAT - NS CR16 Relocations. - - -- : BFD_RELOC_CRX_REL4 - -- : BFD_RELOC_CRX_REL8 - -- : BFD_RELOC_CRX_REL8_CMP - -- : BFD_RELOC_CRX_REL16 - -- : BFD_RELOC_CRX_REL24 - -- : BFD_RELOC_CRX_REL32 - -- : BFD_RELOC_CRX_REGREL12 - -- : BFD_RELOC_CRX_REGREL22 - -- : BFD_RELOC_CRX_REGREL28 - -- : BFD_RELOC_CRX_REGREL32 - -- : BFD_RELOC_CRX_ABS16 - -- : BFD_RELOC_CRX_ABS32 - -- : BFD_RELOC_CRX_NUM8 - -- : BFD_RELOC_CRX_NUM16 - -- : BFD_RELOC_CRX_NUM32 - -- : BFD_RELOC_CRX_IMM16 - -- : BFD_RELOC_CRX_IMM32 - -- : BFD_RELOC_CRX_SWITCH8 - -- : BFD_RELOC_CRX_SWITCH16 - -- : BFD_RELOC_CRX_SWITCH32 - NS CRX Relocations. - - -- : BFD_RELOC_CRIS_BDISP8 - -- : BFD_RELOC_CRIS_UNSIGNED_5 - -- : BFD_RELOC_CRIS_SIGNED_6 - -- : BFD_RELOC_CRIS_UNSIGNED_6 - -- : BFD_RELOC_CRIS_SIGNED_8 - -- : BFD_RELOC_CRIS_UNSIGNED_8 - -- : BFD_RELOC_CRIS_SIGNED_16 - -- : BFD_RELOC_CRIS_UNSIGNED_16 - -- : BFD_RELOC_CRIS_LAPCQ_OFFSET - -- : BFD_RELOC_CRIS_UNSIGNED_4 - These relocs are only used within the CRIS assembler. They are not - (at present) written to any object files. - - -- : BFD_RELOC_CRIS_COPY - -- : BFD_RELOC_CRIS_GLOB_DAT - -- : BFD_RELOC_CRIS_JUMP_SLOT - -- : BFD_RELOC_CRIS_RELATIVE - Relocs used in ELF shared libraries for CRIS. - - -- : BFD_RELOC_CRIS_32_GOT - 32-bit offset to symbol-entry within GOT. - - -- : BFD_RELOC_CRIS_16_GOT - 16-bit offset to symbol-entry within GOT. - - -- : BFD_RELOC_CRIS_32_GOTPLT - 32-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_CRIS_16_GOTPLT - 16-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_CRIS_32_GOTREL - 32-bit offset to symbol, relative to GOT. - - -- : BFD_RELOC_CRIS_32_PLT_GOTREL - 32-bit offset to symbol with PLT entry, relative to GOT. - - -- : BFD_RELOC_CRIS_32_PLT_PCREL - 32-bit offset to symbol with PLT entry, relative to this - relocation. - - -- : BFD_RELOC_CRIS_32_GOT_GD - -- : BFD_RELOC_CRIS_16_GOT_GD - -- : BFD_RELOC_CRIS_32_GD - -- : BFD_RELOC_CRIS_DTP - -- : BFD_RELOC_CRIS_32_DTPREL - -- : BFD_RELOC_CRIS_16_DTPREL - -- : BFD_RELOC_CRIS_32_GOT_TPREL - -- : BFD_RELOC_CRIS_16_GOT_TPREL - -- : BFD_RELOC_CRIS_32_TPREL - -- : BFD_RELOC_CRIS_16_TPREL - -- : BFD_RELOC_CRIS_DTPMOD - -- : BFD_RELOC_CRIS_32_IE - Relocs used in TLS code for CRIS. - - -- : BFD_RELOC_860_COPY - -- : BFD_RELOC_860_GLOB_DAT - -- : BFD_RELOC_860_JUMP_SLOT - -- : BFD_RELOC_860_RELATIVE - -- : BFD_RELOC_860_PC26 - -- : BFD_RELOC_860_PLT26 - -- : BFD_RELOC_860_PC16 - -- : BFD_RELOC_860_LOW0 - -- : BFD_RELOC_860_SPLIT0 - -- : BFD_RELOC_860_LOW1 - -- : BFD_RELOC_860_SPLIT1 - -- : BFD_RELOC_860_LOW2 - -- : BFD_RELOC_860_SPLIT2 - -- : BFD_RELOC_860_LOW3 - -- : BFD_RELOC_860_LOGOT0 - -- : BFD_RELOC_860_SPGOT0 - -- : BFD_RELOC_860_LOGOT1 - -- : BFD_RELOC_860_SPGOT1 - -- : BFD_RELOC_860_LOGOTOFF0 - -- : BFD_RELOC_860_SPGOTOFF0 - -- : BFD_RELOC_860_LOGOTOFF1 - -- : BFD_RELOC_860_SPGOTOFF1 - -- : BFD_RELOC_860_LOGOTOFF2 - -- : BFD_RELOC_860_LOGOTOFF3 - -- : BFD_RELOC_860_LOPC - -- : BFD_RELOC_860_HIGHADJ - -- : BFD_RELOC_860_HAGOT - -- : BFD_RELOC_860_HAGOTOFF - -- : BFD_RELOC_860_HAPC - -- : BFD_RELOC_860_HIGH - -- : BFD_RELOC_860_HIGOT - -- : BFD_RELOC_860_HIGOTOFF - Intel i860 Relocations. - - -- : BFD_RELOC_OPENRISC_ABS_26 - -- : BFD_RELOC_OPENRISC_REL_26 - OpenRISC Relocations. - - -- : BFD_RELOC_H8_DIR16A8 - -- : BFD_RELOC_H8_DIR16R8 - -- : BFD_RELOC_H8_DIR24A8 - -- : BFD_RELOC_H8_DIR24R8 - -- : BFD_RELOC_H8_DIR32A16 - -- : BFD_RELOC_H8_DISP32A16 - H8 elf Relocations. - - -- : BFD_RELOC_XSTORMY16_REL_12 - -- : BFD_RELOC_XSTORMY16_12 - -- : BFD_RELOC_XSTORMY16_24 - -- : BFD_RELOC_XSTORMY16_FPTR16 - Sony Xstormy16 Relocations. - - -- : BFD_RELOC_RELC - Self-describing complex relocations. - - -- : BFD_RELOC_XC16X_PAG - -- : BFD_RELOC_XC16X_POF - -- : BFD_RELOC_XC16X_SEG - -- : BFD_RELOC_XC16X_SOF - Infineon Relocations. - - -- : BFD_RELOC_VAX_GLOB_DAT - -- : BFD_RELOC_VAX_JMP_SLOT - -- : BFD_RELOC_VAX_RELATIVE - Relocations used by VAX ELF. - - -- : BFD_RELOC_MT_PC16 - Morpho MT - 16 bit immediate relocation. - - -- : BFD_RELOC_MT_HI16 - Morpho MT - Hi 16 bits of an address. - - -- : BFD_RELOC_MT_LO16 - Morpho MT - Low 16 bits of an address. - - -- : BFD_RELOC_MT_GNU_VTINHERIT - Morpho MT - Used to tell the linker which vtable entries are used. - - -- : BFD_RELOC_MT_GNU_VTENTRY - Morpho MT - Used to tell the linker which vtable entries are used. - - -- : BFD_RELOC_MT_PCINSN8 - Morpho MT - 8 bit immediate relocation. - - -- : BFD_RELOC_MSP430_10_PCREL - -- : BFD_RELOC_MSP430_16_PCREL - -- : BFD_RELOC_MSP430_16 - -- : BFD_RELOC_MSP430_16_PCREL_BYTE - -- : BFD_RELOC_MSP430_16_BYTE - -- : BFD_RELOC_MSP430_2X_PCREL - -- : BFD_RELOC_MSP430_RL_PCREL - -- : BFD_RELOC_MSP430_ABS8 - -- : BFD_RELOC_MSP430X_PCR20_EXT_SRC - -- : BFD_RELOC_MSP430X_PCR20_EXT_DST - -- : BFD_RELOC_MSP430X_PCR20_EXT_ODST - -- : BFD_RELOC_MSP430X_ABS20_EXT_SRC - -- : BFD_RELOC_MSP430X_ABS20_EXT_DST - -- : BFD_RELOC_MSP430X_ABS20_EXT_ODST - -- : BFD_RELOC_MSP430X_ABS20_ADR_SRC - -- : BFD_RELOC_MSP430X_ABS20_ADR_DST - -- : BFD_RELOC_MSP430X_PCR16 - -- : BFD_RELOC_MSP430X_PCR20_CALL - -- : BFD_RELOC_MSP430X_ABS16 - -- : BFD_RELOC_MSP430_ABS_HI16 - -- : BFD_RELOC_MSP430_PREL31 - -- : BFD_RELOC_MSP430_SYM_DIFF - msp430 specific relocation codes - - -- : BFD_RELOC_NIOS2_S16 - -- : BFD_RELOC_NIOS2_U16 - -- : BFD_RELOC_NIOS2_CALL26 - -- : BFD_RELOC_NIOS2_IMM5 - -- : BFD_RELOC_NIOS2_CACHE_OPX - -- : BFD_RELOC_NIOS2_IMM6 - -- : BFD_RELOC_NIOS2_IMM8 - -- : BFD_RELOC_NIOS2_HI16 - -- : BFD_RELOC_NIOS2_LO16 - -- : BFD_RELOC_NIOS2_HIADJ16 - -- : BFD_RELOC_NIOS2_GPREL - -- : BFD_RELOC_NIOS2_UJMP - -- : BFD_RELOC_NIOS2_CJMP - -- : BFD_RELOC_NIOS2_CALLR - -- : BFD_RELOC_NIOS2_ALIGN - -- : BFD_RELOC_NIOS2_GOT16 - -- : BFD_RELOC_NIOS2_CALL16 - -- : BFD_RELOC_NIOS2_GOTOFF_LO - -- : BFD_RELOC_NIOS2_GOTOFF_HA - -- : BFD_RELOC_NIOS2_PCREL_LO - -- : BFD_RELOC_NIOS2_PCREL_HA - -- : BFD_RELOC_NIOS2_TLS_GD16 - -- : BFD_RELOC_NIOS2_TLS_LDM16 - -- : BFD_RELOC_NIOS2_TLS_LDO16 - -- : BFD_RELOC_NIOS2_TLS_IE16 - -- : BFD_RELOC_NIOS2_TLS_LE16 - -- : BFD_RELOC_NIOS2_TLS_DTPMOD - -- : BFD_RELOC_NIOS2_TLS_DTPREL - -- : BFD_RELOC_NIOS2_TLS_TPREL - -- : BFD_RELOC_NIOS2_COPY - -- : BFD_RELOC_NIOS2_GLOB_DAT - -- : BFD_RELOC_NIOS2_JUMP_SLOT - -- : BFD_RELOC_NIOS2_RELATIVE - -- : BFD_RELOC_NIOS2_GOTOFF - Relocations used by the Altera Nios II core. - - -- : BFD_RELOC_IQ2000_OFFSET_16 - -- : BFD_RELOC_IQ2000_OFFSET_21 - -- : BFD_RELOC_IQ2000_UHI16 - IQ2000 Relocations. - - -- : BFD_RELOC_XTENSA_RTLD - Special Xtensa relocation used only by PLT entries in ELF shared - objects to indicate that the runtime linker should set the value - to one of its own internal functions or data structures. - - -- : BFD_RELOC_XTENSA_GLOB_DAT - -- : BFD_RELOC_XTENSA_JMP_SLOT - -- : BFD_RELOC_XTENSA_RELATIVE - Xtensa relocations for ELF shared objects. - - -- : BFD_RELOC_XTENSA_PLT - Xtensa relocation used in ELF object files for symbols that may - require PLT entries. Otherwise, this is just a generic 32-bit - relocation. - - -- : BFD_RELOC_XTENSA_DIFF8 - -- : BFD_RELOC_XTENSA_DIFF16 - -- : BFD_RELOC_XTENSA_DIFF32 - Xtensa relocations to mark the difference of two local symbols. - These are only needed to support linker relaxation and can be - ignored when not relaxing. The field is set to the value of the - difference assuming no relaxation. The relocation encodes the - position of the first symbol so the linker can determine whether - to adjust the field value. - - -- : BFD_RELOC_XTENSA_SLOT0_OP - -- : BFD_RELOC_XTENSA_SLOT1_OP - -- : BFD_RELOC_XTENSA_SLOT2_OP - -- : BFD_RELOC_XTENSA_SLOT3_OP - -- : BFD_RELOC_XTENSA_SLOT4_OP - -- : BFD_RELOC_XTENSA_SLOT5_OP - -- : BFD_RELOC_XTENSA_SLOT6_OP - -- : BFD_RELOC_XTENSA_SLOT7_OP - -- : BFD_RELOC_XTENSA_SLOT8_OP - -- : BFD_RELOC_XTENSA_SLOT9_OP - -- : BFD_RELOC_XTENSA_SLOT10_OP - -- : BFD_RELOC_XTENSA_SLOT11_OP - -- : BFD_RELOC_XTENSA_SLOT12_OP - -- : BFD_RELOC_XTENSA_SLOT13_OP - -- : BFD_RELOC_XTENSA_SLOT14_OP - Generic Xtensa relocations for instruction operands. Only the slot - number is encoded in the relocation. The relocation applies to the - last PC-relative immediate operand, or if there are no PC-relative - immediates, to the last immediate operand. - - -- : BFD_RELOC_XTENSA_SLOT0_ALT - -- : BFD_RELOC_XTENSA_SLOT1_ALT - -- : BFD_RELOC_XTENSA_SLOT2_ALT - -- : BFD_RELOC_XTENSA_SLOT3_ALT - -- : BFD_RELOC_XTENSA_SLOT4_ALT - -- : BFD_RELOC_XTENSA_SLOT5_ALT - -- : BFD_RELOC_XTENSA_SLOT6_ALT - -- : BFD_RELOC_XTENSA_SLOT7_ALT - -- : BFD_RELOC_XTENSA_SLOT8_ALT - -- : BFD_RELOC_XTENSA_SLOT9_ALT - -- : BFD_RELOC_XTENSA_SLOT10_ALT - -- : BFD_RELOC_XTENSA_SLOT11_ALT - -- : BFD_RELOC_XTENSA_SLOT12_ALT - -- : BFD_RELOC_XTENSA_SLOT13_ALT - -- : BFD_RELOC_XTENSA_SLOT14_ALT - Alternate Xtensa relocations. Only the slot is encoded in the - relocation. The meaning of these relocations is opcode-specific. - - -- : BFD_RELOC_XTENSA_OP0 - -- : BFD_RELOC_XTENSA_OP1 - -- : BFD_RELOC_XTENSA_OP2 - Xtensa relocations for backward compatibility. These have all been - replaced by BFD_RELOC_XTENSA_SLOT0_OP. - - -- : BFD_RELOC_XTENSA_ASM_EXPAND - Xtensa relocation to mark that the assembler expanded the - instructions from an original target. The expansion size is - encoded in the reloc size. - - -- : BFD_RELOC_XTENSA_ASM_SIMPLIFY - Xtensa relocation to mark that the linker should simplify - assembler-expanded instructions. This is commonly used internally - by the linker after analysis of a BFD_RELOC_XTENSA_ASM_EXPAND. - - -- : BFD_RELOC_XTENSA_TLSDESC_FN - -- : BFD_RELOC_XTENSA_TLSDESC_ARG - -- : BFD_RELOC_XTENSA_TLS_DTPOFF - -- : BFD_RELOC_XTENSA_TLS_TPOFF - -- : BFD_RELOC_XTENSA_TLS_FUNC - -- : BFD_RELOC_XTENSA_TLS_ARG - -- : BFD_RELOC_XTENSA_TLS_CALL - Xtensa TLS relocations. - - -- : BFD_RELOC_Z80_DISP8 - 8 bit signed offset in (ix+d) or (iy+d). - - -- : BFD_RELOC_Z8K_DISP7 - DJNZ offset. - - -- : BFD_RELOC_Z8K_CALLR - CALR offset. - - -- : BFD_RELOC_Z8K_IMM4L - 4 bit value. - - -- : BFD_RELOC_LM32_CALL - -- : BFD_RELOC_LM32_BRANCH - -- : BFD_RELOC_LM32_16_GOT - -- : BFD_RELOC_LM32_GOTOFF_HI16 - -- : BFD_RELOC_LM32_GOTOFF_LO16 - -- : BFD_RELOC_LM32_COPY - -- : BFD_RELOC_LM32_GLOB_DAT - -- : BFD_RELOC_LM32_JMP_SLOT - -- : BFD_RELOC_LM32_RELATIVE - Lattice Mico32 relocations. - - -- : BFD_RELOC_MACH_O_SECTDIFF - Difference between two section addreses. Must be followed by a - BFD_RELOC_MACH_O_PAIR. - - -- : BFD_RELOC_MACH_O_LOCAL_SECTDIFF - Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. - - -- : BFD_RELOC_MACH_O_PAIR - Pair of relocation. Contains the first symbol. - - -- : BFD_RELOC_MACH_O_X86_64_BRANCH32 - -- : BFD_RELOC_MACH_O_X86_64_BRANCH8 - PCREL relocations. They are marked as branch to create PLT entry - if required. - - -- : BFD_RELOC_MACH_O_X86_64_GOT - Used when referencing a GOT entry. - - -- : BFD_RELOC_MACH_O_X86_64_GOT_LOAD - Used when loading a GOT entry with movq. It is specially marked - so that the linker could optimize the movq to a leaq if possible. - - -- : BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32 - Symbol will be substracted. Must be followed by a BFD_RELOC_64. - - -- : BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64 - Symbol will be substracted. Must be followed by a BFD_RELOC_64. - - -- : BFD_RELOC_MACH_O_X86_64_PCREL32_1 - Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. - - -- : BFD_RELOC_MACH_O_X86_64_PCREL32_2 - Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. - - -- : BFD_RELOC_MACH_O_X86_64_PCREL32_4 - Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. - - -- : BFD_RELOC_MICROBLAZE_32_LO - This is a 32 bit reloc for the microblaze that stores the low 16 - bits of a value - - -- : BFD_RELOC_MICROBLAZE_32_LO_PCREL - This is a 32 bit pc-relative reloc for the microblaze that stores - the low 16 bits of a value - - -- : BFD_RELOC_MICROBLAZE_32_ROSDA - This is a 32 bit reloc for the microblaze that stores a value - relative to the read-only small data area anchor - - -- : BFD_RELOC_MICROBLAZE_32_RWSDA - This is a 32 bit reloc for the microblaze that stores a value - relative to the read-write small data area anchor - - -- : BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM - This is a 32 bit reloc for the microblaze to handle expressions of - the form "Symbol Op Symbol" - - -- : BFD_RELOC_MICROBLAZE_64_NONE - This is a 64 bit reloc that stores the 32 bit pc relative value in - two words (with an imm instruction). No relocation is done here - - only used for relaxing - - -- : BFD_RELOC_MICROBLAZE_64_GOTPC - This is a 64 bit reloc that stores the 32 bit pc relative value in - two words (with an imm instruction). The relocation is - PC-relative GOT offset - - -- : BFD_RELOC_MICROBLAZE_64_GOT - This is a 64 bit reloc that stores the 32 bit pc relative value in - two words (with an imm instruction). The relocation is GOT offset - - -- : BFD_RELOC_MICROBLAZE_64_PLT - This is a 64 bit reloc that stores the 32 bit pc relative value in - two words (with an imm instruction). The relocation is - PC-relative offset into PLT - - -- : BFD_RELOC_MICROBLAZE_64_GOTOFF - This is a 64 bit reloc that stores the 32 bit GOT relative value - in two words (with an imm instruction). The relocation is - relative offset from _GLOBAL_OFFSET_TABLE_ - - -- : BFD_RELOC_MICROBLAZE_32_GOTOFF - This is a 32 bit reloc that stores the 32 bit GOT relative value - in a word. The relocation is relative offset from - - -- : BFD_RELOC_MICROBLAZE_COPY - This is used to tell the dynamic linker to copy the value out of - the dynamic object into the runtime process image. - - -- : BFD_RELOC_MICROBLAZE_64_TLS - Unused Reloc - - -- : BFD_RELOC_MICROBLAZE_64_TLSGD - This is a 64 bit reloc that stores the 32 bit GOT relative value - of the GOT TLS GD info entry in two words (with an imm - instruction). The relocation is GOT offset. - - -- : BFD_RELOC_MICROBLAZE_64_TLSLD - This is a 64 bit reloc that stores the 32 bit GOT relative value - of the GOT TLS LD info entry in two words (with an imm - instruction). The relocation is GOT offset. - - -- : BFD_RELOC_MICROBLAZE_32_TLSDTPMOD - This is a 32 bit reloc that stores the Module ID to GOT(n). - - -- : BFD_RELOC_MICROBLAZE_32_TLSDTPREL - This is a 32 bit reloc that stores TLS offset to GOT(n+1). - - -- : BFD_RELOC_MICROBLAZE_64_TLSDTPREL - This is a 32 bit reloc for storing TLS offset to two words (uses - imm instruction) - - -- : BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL - This is a 64 bit reloc that stores 32-bit thread pointer relative - offset to two words (uses imm instruction). - - -- : BFD_RELOC_MICROBLAZE_64_TLSTPREL - This is a 64 bit reloc that stores 32-bit thread pointer relative - offset to two words (uses imm instruction). - - -- : BFD_RELOC_AARCH64_RELOC_START - AArch64 pseudo relocation code to mark the start of the AArch64 - relocation enumerators. N.B. the order of the enumerators is - important as several tables in the AArch64 bfd backend are indexed - by these enumerators; make sure they are all synced. - - -- : BFD_RELOC_AARCH64_NONE - AArch64 null relocation code. - - -- : BFD_RELOC_AARCH64_64 - -- : BFD_RELOC_AARCH64_32 - -- : BFD_RELOC_AARCH64_16 - Basic absolute relocations of N bits. These are equivalent to - BFD_RELOC_N and they were added to assist the indexing of the howto - table. - - -- : BFD_RELOC_AARCH64_64_PCREL - -- : BFD_RELOC_AARCH64_32_PCREL - -- : BFD_RELOC_AARCH64_16_PCREL - PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL - and they were added to assist the indexing of the howto table. - - -- : BFD_RELOC_AARCH64_MOVW_G0 - AArch64 MOV[NZK] instruction with most significant bits 0 to 15 of - an unsigned address/value. - - -- : BFD_RELOC_AARCH64_MOVW_G0_NC - AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of - an address/value. No overflow checking. - - -- : BFD_RELOC_AARCH64_MOVW_G1 - AArch64 MOV[NZK] instruction with most significant bits 16 to 31 - of an unsigned address/value. - - -- : BFD_RELOC_AARCH64_MOVW_G1_NC - AArch64 MOV[NZK] instruction with less significant bits 16 to 31 - of an address/value. No overflow checking. - - -- : BFD_RELOC_AARCH64_MOVW_G2 - AArch64 MOV[NZK] instruction with most significant bits 32 to 47 - of an unsigned address/value. - - -- : BFD_RELOC_AARCH64_MOVW_G2_NC - AArch64 MOV[NZK] instruction with less significant bits 32 to 47 - of an address/value. No overflow checking. - - -- : BFD_RELOC_AARCH64_MOVW_G3 - AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 of - a signed or unsigned address/value. - - -- : BFD_RELOC_AARCH64_MOVW_G0_S - AArch64 MOV[NZ] instruction with most significant bits 0 to 15 of - a signed value. Changes instruction to MOVZ or MOVN depending on - the value's sign. - - -- : BFD_RELOC_AARCH64_MOVW_G1_S - AArch64 MOV[NZ] instruction with most significant bits 16 to 31 of - a signed value. Changes instruction to MOVZ or MOVN depending on - the value's sign. - - -- : BFD_RELOC_AARCH64_MOVW_G2_S - AArch64 MOV[NZ] instruction with most significant bits 32 to 47 of - a signed value. Changes instruction to MOVZ or MOVN depending on - the value's sign. - - -- : BFD_RELOC_AARCH64_LD_LO19_PCREL - AArch64 Load Literal instruction, holding a 19 bit pc-relative word - offset. The lowest two bits must be zero and are not stored in the - instruction, giving a 21 bit signed byte offset. - - -- : BFD_RELOC_AARCH64_ADR_LO21_PCREL - AArch64 ADR instruction, holding a simple 21 bit pc-relative byte - offset. - - -- : BFD_RELOC_AARCH64_ADR_HI21_PCREL - AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page - offset, giving a 4KB aligned page base address. - - -- : BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL - AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page - offset, giving a 4KB aligned page base address, but with no - overflow checking. - - -- : BFD_RELOC_AARCH64_ADD_LO12 - AArch64 ADD immediate instruction, holding bits 0 to 11 of the - address. Used in conjunction with - BFD_RELOC_AARCH64_ADR_HI21_PCREL. - - -- : BFD_RELOC_AARCH64_LDST8_LO12 - AArch64 8-bit load/store instruction, holding bits 0 to 11 of the - address. Used in conjunction with - BFD_RELOC_AARCH64_ADR_HI21_PCREL. - - -- : BFD_RELOC_AARCH64_TSTBR14 - AArch64 14 bit pc-relative test bit and branch. The lowest two - bits must be zero and are not stored in the instruction, giving a - 16 bit signed byte offset. - - -- : BFD_RELOC_AARCH64_BRANCH19 - AArch64 19 bit pc-relative conditional branch and compare & branch. - The lowest two bits must be zero and are not stored in the - instruction, giving a 21 bit signed byte offset. - - -- : BFD_RELOC_AARCH64_JUMP26 - AArch64 26 bit pc-relative unconditional branch. The lowest two - bits must be zero and are not stored in the instruction, giving a - 28 bit signed byte offset. - - -- : BFD_RELOC_AARCH64_CALL26 - AArch64 26 bit pc-relative unconditional branch and link. The - lowest two bits must be zero and are not stored in the instruction, - giving a 28 bit signed byte offset. - - -- : BFD_RELOC_AARCH64_LDST16_LO12 - AArch64 16-bit load/store instruction, holding bits 0 to 11 of the - address. Used in conjunction with - BFD_RELOC_AARCH64_ADR_HI21_PCREL. - - -- : BFD_RELOC_AARCH64_LDST32_LO12 - AArch64 32-bit load/store instruction, holding bits 0 to 11 of the - address. Used in conjunction with - BFD_RELOC_AARCH64_ADR_HI21_PCREL. - - -- : BFD_RELOC_AARCH64_LDST64_LO12 - AArch64 64-bit load/store instruction, holding bits 0 to 11 of the - address. Used in conjunction with - BFD_RELOC_AARCH64_ADR_HI21_PCREL. - - -- : BFD_RELOC_AARCH64_LDST128_LO12 - AArch64 128-bit load/store instruction, holding bits 0 to 11 of the - address. Used in conjunction with - BFD_RELOC_AARCH64_ADR_HI21_PCREL. - - -- : BFD_RELOC_AARCH64_GOT_LD_PREL19 - AArch64 Load Literal instruction, holding a 19 bit PC relative word - offset of the global offset table entry for a symbol. The lowest - two bits must be zero and are not stored in the instruction, - giving a 21 bit signed byte offset. This relocation type requires - signed overflow checking. - - -- : BFD_RELOC_AARCH64_ADR_GOT_PAGE - Get to the page base of the global offset table entry for a symbol - as part of an ADRP instruction using a 21 bit PC relative - value.Used in conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. - - -- : BFD_RELOC_AARCH64_LD64_GOT_LO12_NC - Unsigned 12 bit byte offset for 64 bit load/store from the page of - the GOT entry for this symbol. Used in conjunction with - BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in LP64 ABI only. - - -- : BFD_RELOC_AARCH64_LD32_GOT_LO12_NC - Unsigned 12 bit byte offset for 32 bit load/store from the page of - the GOT entry for this symbol. Used in conjunction with - BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in ILP32 ABI only. - - -- : BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21 - Get to the page base of the global offset table entry for a symbols - tls_index structure as part of an adrp instruction using a 21 bit - PC relative value. Used in conjunction with - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. - - -- : BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC - Unsigned 12 bit byte offset to global offset table entry for a - symbols tls_index structure. Used in conjunction with - BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. - - -- : BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1 - AArch64 TLS INITIAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC - AArch64 TLS INITIAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 - AArch64 TLS INITIAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC - AArch64 TLS INITIAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC - AArch64 TLS INITIAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19 - AArch64 TLS INITIAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2 - AArch64 TLS LOCAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1 - AArch64 TLS LOCAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC - AArch64 TLS LOCAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0 - AArch64 TLS LOCAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC - AArch64 TLS LOCAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12 - AArch64 TLS LOCAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12 - AArch64 TLS LOCAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC - AArch64 TLS LOCAL EXEC relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC_LD_PREL19 - AArch64 TLS DESC relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21 - AArch64 TLS DESC relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21 - AArch64 TLS DESC relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC - AArch64 TLS DESC relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC - AArch64 TLS DESC relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC - AArch64 TLS DESC relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC_OFF_G1 - AArch64 TLS DESC relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC - AArch64 TLS DESC relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC_LDR - AArch64 TLS DESC relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC_ADD - AArch64 TLS DESC relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC_CALL - AArch64 TLS DESC relocation. - - -- : BFD_RELOC_AARCH64_COPY - AArch64 TLS relocation. - - -- : BFD_RELOC_AARCH64_GLOB_DAT - AArch64 TLS relocation. - - -- : BFD_RELOC_AARCH64_JUMP_SLOT - AArch64 TLS relocation. - - -- : BFD_RELOC_AARCH64_RELATIVE - AArch64 TLS relocation. - - -- : BFD_RELOC_AARCH64_TLS_DTPMOD - AArch64 TLS relocation. - - -- : BFD_RELOC_AARCH64_TLS_DTPREL - AArch64 TLS relocation. - - -- : BFD_RELOC_AARCH64_TLS_TPREL - AArch64 TLS relocation. - - -- : BFD_RELOC_AARCH64_TLSDESC - AArch64 TLS relocation. - - -- : BFD_RELOC_AARCH64_IRELATIVE - AArch64 support for STT_GNU_IFUNC. - - -- : BFD_RELOC_AARCH64_RELOC_END - AArch64 pseudo relocation code to mark the end of the AArch64 - relocation enumerators that have direct mapping to ELF reloc codes. - There are a few more enumerators after this one; those are mainly - used by the AArch64 assembler for the internal fixup or to select - one of the above enumerators. - - -- : BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP - AArch64 pseudo relocation code to be used internally by the AArch64 - assembler and not (currently) written to any object files. - - -- : BFD_RELOC_AARCH64_LDST_LO12 - AArch64 unspecified load/store instruction, holding bits 0 to 11 - of the address. Used in conjunction with - BFD_RELOC_AARCH64_ADR_HI21_PCREL. - - -- : BFD_RELOC_AARCH64_LD_GOT_LO12_NC - AArch64 pseudo relocation code to be used internally by the AArch64 - assembler and not (currently) written to any object files. - - -- : BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC - AArch64 pseudo relocation code to be used internally by the AArch64 - assembler and not (currently) written to any object files. - - -- : BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC - AArch64 pseudo relocation code to be used internally by the AArch64 - assembler and not (currently) written to any object files. - - -- : BFD_RELOC_TILEPRO_COPY - -- : BFD_RELOC_TILEPRO_GLOB_DAT - -- : BFD_RELOC_TILEPRO_JMP_SLOT - -- : BFD_RELOC_TILEPRO_RELATIVE - -- : BFD_RELOC_TILEPRO_BROFF_X1 - -- : BFD_RELOC_TILEPRO_JOFFLONG_X1 - -- : BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT - -- : BFD_RELOC_TILEPRO_IMM8_X0 - -- : BFD_RELOC_TILEPRO_IMM8_Y0 - -- : BFD_RELOC_TILEPRO_IMM8_X1 - -- : BFD_RELOC_TILEPRO_IMM8_Y1 - -- : BFD_RELOC_TILEPRO_DEST_IMM8_X1 - -- : BFD_RELOC_TILEPRO_MT_IMM15_X1 - -- : BFD_RELOC_TILEPRO_MF_IMM15_X1 - -- : BFD_RELOC_TILEPRO_IMM16_X0 - -- : BFD_RELOC_TILEPRO_IMM16_X1 - -- : BFD_RELOC_TILEPRO_IMM16_X0_LO - -- : BFD_RELOC_TILEPRO_IMM16_X1_LO - -- : BFD_RELOC_TILEPRO_IMM16_X0_HI - -- : BFD_RELOC_TILEPRO_IMM16_X1_HI - -- : BFD_RELOC_TILEPRO_IMM16_X0_HA - -- : BFD_RELOC_TILEPRO_IMM16_X1_HA - -- : BFD_RELOC_TILEPRO_IMM16_X0_PCREL - -- : BFD_RELOC_TILEPRO_IMM16_X1_PCREL - -- : BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL - -- : BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL - -- : BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL - -- : BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL - -- : BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL - -- : BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL - -- : BFD_RELOC_TILEPRO_IMM16_X0_GOT - -- : BFD_RELOC_TILEPRO_IMM16_X1_GOT - -- : BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO - -- : BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO - -- : BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI - -- : BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI - -- : BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA - -- : BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA - -- : BFD_RELOC_TILEPRO_MMSTART_X0 - -- : BFD_RELOC_TILEPRO_MMEND_X0 - -- : BFD_RELOC_TILEPRO_MMSTART_X1 - -- : BFD_RELOC_TILEPRO_MMEND_X1 - -- : BFD_RELOC_TILEPRO_SHAMT_X0 - -- : BFD_RELOC_TILEPRO_SHAMT_X1 - -- : BFD_RELOC_TILEPRO_SHAMT_Y0 - -- : BFD_RELOC_TILEPRO_SHAMT_Y1 - -- : BFD_RELOC_TILEPRO_TLS_GD_CALL - -- : BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD - -- : BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD - -- : BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD - -- : BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD - -- : BFD_RELOC_TILEPRO_TLS_IE_LOAD - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA - -- : BFD_RELOC_TILEPRO_TLS_DTPMOD32 - -- : BFD_RELOC_TILEPRO_TLS_DTPOFF32 - -- : BFD_RELOC_TILEPRO_TLS_TPOFF32 - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI - -- : BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA - -- : BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA - Tilera TILEPro Relocations. - - -- : BFD_RELOC_TILEGX_HW0 - -- : BFD_RELOC_TILEGX_HW1 - -- : BFD_RELOC_TILEGX_HW2 - -- : BFD_RELOC_TILEGX_HW3 - -- : BFD_RELOC_TILEGX_HW0_LAST - -- : BFD_RELOC_TILEGX_HW1_LAST - -- : BFD_RELOC_TILEGX_HW2_LAST - -- : BFD_RELOC_TILEGX_COPY - -- : BFD_RELOC_TILEGX_GLOB_DAT - -- : BFD_RELOC_TILEGX_JMP_SLOT - -- : BFD_RELOC_TILEGX_RELATIVE - -- : BFD_RELOC_TILEGX_BROFF_X1 - -- : BFD_RELOC_TILEGX_JUMPOFF_X1 - -- : BFD_RELOC_TILEGX_JUMPOFF_X1_PLT - -- : BFD_RELOC_TILEGX_IMM8_X0 - -- : BFD_RELOC_TILEGX_IMM8_Y0 - -- : BFD_RELOC_TILEGX_IMM8_X1 - -- : BFD_RELOC_TILEGX_IMM8_Y1 - -- : BFD_RELOC_TILEGX_DEST_IMM8_X1 - -- : BFD_RELOC_TILEGX_MT_IMM14_X1 - -- : BFD_RELOC_TILEGX_MF_IMM14_X1 - -- : BFD_RELOC_TILEGX_MMSTART_X0 - -- : BFD_RELOC_TILEGX_MMEND_X0 - -- : BFD_RELOC_TILEGX_SHAMT_X0 - -- : BFD_RELOC_TILEGX_SHAMT_X1 - -- : BFD_RELOC_TILEGX_SHAMT_Y0 - -- : BFD_RELOC_TILEGX_SHAMT_Y1 - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0 - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0 - -- : BFD_RELOC_TILEGX_IMM16_X0_HW1 - -- : BFD_RELOC_TILEGX_IMM16_X1_HW1 - -- : BFD_RELOC_TILEGX_IMM16_X0_HW2 - -- : BFD_RELOC_TILEGX_IMM16_X1_HW2 - -- : BFD_RELOC_TILEGX_IMM16_X0_HW3 - -- : BFD_RELOC_TILEGX_IMM16_X1_HW3 - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST - -- : BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST - -- : BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST - -- : BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST - -- : BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT - -- : BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT - -- : BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT - -- : BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE - -- : BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE - -- : BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD - -- : BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD - -- : BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL - -- : BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE - -- : BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE - -- : BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE - -- : BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE - -- : BFD_RELOC_TILEGX_TLS_DTPMOD64 - -- : BFD_RELOC_TILEGX_TLS_DTPOFF64 - -- : BFD_RELOC_TILEGX_TLS_TPOFF64 - -- : BFD_RELOC_TILEGX_TLS_DTPMOD32 - -- : BFD_RELOC_TILEGX_TLS_DTPOFF32 - -- : BFD_RELOC_TILEGX_TLS_TPOFF32 - -- : BFD_RELOC_TILEGX_TLS_GD_CALL - -- : BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD - -- : BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD - -- : BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD - -- : BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD - -- : BFD_RELOC_TILEGX_TLS_IE_LOAD - -- : BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD - -- : BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD - -- : BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD - -- : BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD - Tilera TILE-Gx Relocations. - - -- : BFD_RELOC_EPIPHANY_SIMM8 - Adapteva EPIPHANY - 8 bit signed pc-relative displacement - - -- : BFD_RELOC_EPIPHANY_SIMM24 - Adapteva EPIPHANY - 24 bit signed pc-relative displacement - - -- : BFD_RELOC_EPIPHANY_HIGH - Adapteva EPIPHANY - 16 most-significant bits of absolute address - - -- : BFD_RELOC_EPIPHANY_LOW - Adapteva EPIPHANY - 16 least-significant bits of absolute address - - -- : BFD_RELOC_EPIPHANY_SIMM11 - Adapteva EPIPHANY - 11 bit signed number - add/sub immediate - - -- : BFD_RELOC_EPIPHANY_IMM11 - Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st - displacement) - - -- : BFD_RELOC_EPIPHANY_IMM8 - Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. - - - typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; - -2.10.2.2 `bfd_reloc_type_lookup' -................................ - -*Synopsis* - reloc_howto_type *bfd_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); - reloc_howto_type *bfd_reloc_name_lookup - (bfd *abfd, const char *reloc_name); - *Description* -Return a pointer to a howto structure which, when invoked, will perform -the relocation CODE on data from the architecture noted. - -2.10.2.3 `bfd_default_reloc_type_lookup' -........................................ - -*Synopsis* - reloc_howto_type *bfd_default_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); - *Description* -Provides a default relocation lookup routine for any architecture. - -2.10.2.4 `bfd_get_reloc_code_name' -.................................. - -*Synopsis* - const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); - *Description* -Provides a printable name for the supplied relocation code. Useful -mainly for printing error messages. - -2.10.2.5 `bfd_generic_relax_section' -.................................... - -*Synopsis* - bfd_boolean bfd_generic_relax_section - (bfd *abfd, - asection *section, - struct bfd_link_info *, - bfd_boolean *); - *Description* -Provides default handling for relaxing for back ends which don't do -relaxing. - -2.10.2.6 `bfd_generic_gc_sections' -.................................. - -*Synopsis* - bfd_boolean bfd_generic_gc_sections - (bfd *, struct bfd_link_info *); - *Description* -Provides default handling for relaxing for back ends which don't do -section gc - i.e., does nothing. - -2.10.2.7 `bfd_generic_lookup_section_flags' -........................................... - -*Synopsis* - bfd_boolean bfd_generic_lookup_section_flags - (struct bfd_link_info *, struct flag_info *, asection *); - *Description* -Provides default handling for section flags lookup - i.e., does nothing. -Returns FALSE if the section should be omitted, otherwise TRUE. - -2.10.2.8 `bfd_generic_merge_sections' -..................................... - -*Synopsis* - bfd_boolean bfd_generic_merge_sections - (bfd *, struct bfd_link_info *); - *Description* -Provides default handling for SEC_MERGE section merging for back ends -which don't have SEC_MERGE support - i.e., does nothing. - -2.10.2.9 `bfd_generic_get_relocated_section_contents' -..................................................... - -*Synopsis* - bfd_byte *bfd_generic_get_relocated_section_contents - (bfd *abfd, - struct bfd_link_info *link_info, - struct bfd_link_order *link_order, - bfd_byte *data, - bfd_boolean relocatable, - asymbol **symbols); - *Description* -Provides default handling of relocation effort for back ends which -can't be bothered to do it efficiently. - - -File: bfd.info, Node: Core Files, Next: Targets, Prev: Relocations, Up: BFD front end - -2.11 Core files -=============== - -2.11.1 Core file functions --------------------------- - -*Description* -These are functions pertaining to core files. - -2.11.1.1 `bfd_core_file_failing_command' -........................................ - -*Synopsis* - const char *bfd_core_file_failing_command (bfd *abfd); - *Description* -Return a read-only string explaining which program was running when it -failed and produced the core file ABFD. - -2.11.1.2 `bfd_core_file_failing_signal' -....................................... - -*Synopsis* - int bfd_core_file_failing_signal (bfd *abfd); - *Description* -Returns the signal number which caused the core dump which generated -the file the BFD ABFD is attached to. - -2.11.1.3 `bfd_core_file_pid' -............................ - -*Synopsis* - int bfd_core_file_pid (bfd *abfd); - *Description* -Returns the PID of the process the core dump the BFD ABFD is attached -to was generated from. - -2.11.1.4 `core_file_matches_executable_p' -......................................... - -*Synopsis* - bfd_boolean core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); - *Description* -Return `TRUE' if the core file attached to CORE_BFD was generated by a -run of the executable file attached to EXEC_BFD, `FALSE' otherwise. - -2.11.1.5 `generic_core_file_matches_executable_p' -................................................. - -*Synopsis* - bfd_boolean generic_core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); - *Description* -Return TRUE if the core file attached to CORE_BFD was generated by a -run of the executable file attached to EXEC_BFD. The match is based on -executable basenames only. - - Note: When not able to determine the core file failing command or -the executable name, we still return TRUE even though we're not sure -that core file and executable match. This is to avoid generating a -false warning in situations where we really don't know whether they -match or not. - - -File: bfd.info, Node: Targets, Next: Architectures, Prev: Core Files, Up: BFD front end - -2.12 Targets -============ - -*Description* -Each port of BFD to a different machine requires the creation of a -target back end. All the back end provides to the root part of BFD is a -structure containing pointers to functions which perform certain low -level operations on files. BFD translates the applications's requests -through a pointer into calls to the back end routines. - - When a file is opened with `bfd_openr', its format and target are -unknown. BFD uses various mechanisms to determine how to interpret the -file. The operations performed are: - - * Create a BFD by calling the internal routine `_bfd_new_bfd', then - call `bfd_find_target' with the target string supplied to - `bfd_openr' and the new BFD pointer. - - * If a null target string was provided to `bfd_find_target', look up - the environment variable `GNUTARGET' and use that as the target - string. - - * If the target string is still `NULL', or the target string is - `default', then use the first item in the target vector as the - target type, and set `target_defaulted' in the BFD to cause - `bfd_check_format' to loop through all the targets. *Note - bfd_target::. *Note Formats::. - - * Otherwise, inspect the elements in the target vector one by one, - until a match on target name is found. When found, use it. - - * Otherwise return the error `bfd_error_invalid_target' to - `bfd_openr'. - - * `bfd_openr' attempts to open the file using `bfd_open_file', and - returns the BFD. - Once the BFD has been opened and the target selected, the file -format may be determined. This is done by calling `bfd_check_format' on -the BFD with a suggested format. If `target_defaulted' has been set, -each possible target type is tried to see if it recognizes the -specified format. `bfd_check_format' returns `TRUE' when the caller -guesses right. - -* Menu: - -* bfd_target:: - - -File: bfd.info, Node: bfd_target, Prev: Targets, Up: Targets - -2.12.1 bfd_target ------------------ - -*Description* -This structure contains everything that BFD knows about a target. It -includes things like its byte order, name, and which routines to call -to do various operations. - - Every BFD points to a target structure with its `xvec' member. - - The macros below are used to dispatch to functions through the -`bfd_target' vector. They are used in a number of macros further down -in `bfd.h', and are also used when calling various routines by hand -inside the BFD implementation. The ARGLIST argument must be -parenthesized; it contains all the arguments to the called function. - - They make the documentation (more) unpleasant to read, so if someone -wants to fix this and not break the above, please do. - #define BFD_SEND(bfd, message, arglist) \ - ((*((bfd)->xvec->message)) arglist) - - #ifdef DEBUG_BFD_SEND - #undef BFD_SEND - #define BFD_SEND(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - ((*((bfd)->xvec->message)) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) - #endif - For operations which index on the BFD format: - #define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) - - #ifdef DEBUG_BFD_SEND - #undef BFD_SEND_FMT - #define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) - #endif - This is the structure which defines the type of BFD this is. The -`xvec' member of the struct `bfd' itself points here. Each module that -implements access to a different target under BFD, defines one of these. - - FIXME, these names should be rationalised with the names of the -entry points which call them. Too bad we can't have one macro to define -them both! - enum bfd_flavour - { - bfd_target_unknown_flavour, - bfd_target_aout_flavour, - bfd_target_coff_flavour, - bfd_target_ecoff_flavour, - bfd_target_xcoff_flavour, - bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, - bfd_target_tekhex_flavour, - bfd_target_srec_flavour, - bfd_target_verilog_flavour, - bfd_target_ihex_flavour, - bfd_target_som_flavour, - bfd_target_os9k_flavour, - bfd_target_versados_flavour, - bfd_target_msdos_flavour, - bfd_target_ovax_flavour, - bfd_target_evax_flavour, - bfd_target_mmo_flavour, - bfd_target_mach_o_flavour, - bfd_target_pef_flavour, - bfd_target_pef_xlib_flavour, - bfd_target_sym_flavour - }; - - enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; - - /* Forward declaration. */ - typedef struct bfd_link_info _bfd_link_info; - - /* Forward declaration. */ - typedef struct flag_info flag_info; - - typedef struct bfd_target - { - /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; - - /* The "flavour" of a back end is a general indication about - the contents of a file. */ - enum bfd_flavour flavour; - - /* The order of bytes within the data area of a file. */ - enum bfd_endian byteorder; - - /* The order of bytes within the header parts of a file. */ - enum bfd_endian header_byteorder; - - /* A mask of all the flags which an executable may have set - - from the set `BFD_NO_FLAGS', `HAS_RELOC', ...`D_PAGED'. */ - flagword object_flags; - - /* A mask of all the flags which a section may have set - from - the set `SEC_NO_FLAGS', `SEC_ALLOC', ...`SET_NEVER_LOAD'. */ - flagword section_flags; - - /* The character normally found at the front of a symbol. - (if any), perhaps `_'. */ - char symbol_leading_char; - - /* The pad character for file names within an archive header. */ - char ar_pad_char; - - /* The maximum number of characters in an archive header. */ - unsigned char ar_max_namelen; - - /* How well this target matches, used to select between various - possible targets when more than one target matches. */ - unsigned char match_priority; - - /* Entries for byte swapping for data. These are different from the - other entry points, since they don't take a BFD as the first argument. - Certain other handlers could do the same. */ - bfd_uint64_t (*bfd_getx64) (const void *); - bfd_int64_t (*bfd_getx_signed_64) (const void *); - void (*bfd_putx64) (bfd_uint64_t, void *); - bfd_vma (*bfd_getx32) (const void *); - bfd_signed_vma (*bfd_getx_signed_32) (const void *); - void (*bfd_putx32) (bfd_vma, void *); - bfd_vma (*bfd_getx16) (const void *); - bfd_signed_vma (*bfd_getx_signed_16) (const void *); - void (*bfd_putx16) (bfd_vma, void *); - - /* Byte swapping for the headers. */ - bfd_uint64_t (*bfd_h_getx64) (const void *); - bfd_int64_t (*bfd_h_getx_signed_64) (const void *); - void (*bfd_h_putx64) (bfd_uint64_t, void *); - bfd_vma (*bfd_h_getx32) (const void *); - bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); - void (*bfd_h_putx32) (bfd_vma, void *); - bfd_vma (*bfd_h_getx16) (const void *); - bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); - void (*bfd_h_putx16) (bfd_vma, void *); - - /* Format dependent routines: these are vectors of entry points - within the target vector structure, one for each format to check. */ - - /* Check the format of a file being read. Return a `bfd_target *' or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); - - /* Set the format of a file being written. */ - bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); - - /* Write cached information into a file being written, at `bfd_close'. */ - bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); - The general target vector. These vectors are initialized using the -BFD_JUMP_TABLE macros. - - /* Generic entry points. */ - #define BFD_JUMP_TABLE_GENERIC(NAME) \ - NAME##_close_and_cleanup, \ - NAME##_bfd_free_cached_info, \ - NAME##_new_section_hook, \ - NAME##_get_section_contents, \ - NAME##_get_section_contents_in_window - - /* Called when the BFD is being closed to do any necessary cleanup. */ - bfd_boolean (*_close_and_cleanup) (bfd *); - /* Ask the BFD to free all cached information. */ - bfd_boolean (*_bfd_free_cached_info) (bfd *); - /* Called when a new section is created. */ - bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); - /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); - - /* Entry points to copy private data. */ - #define BFD_JUMP_TABLE_COPY(NAME) \ - NAME##_bfd_copy_private_bfd_data, \ - NAME##_bfd_merge_private_bfd_data, \ - _bfd_generic_init_private_section_data, \ - NAME##_bfd_copy_private_section_data, \ - NAME##_bfd_copy_private_symbol_data, \ - NAME##_bfd_copy_private_header_data, \ - NAME##_bfd_set_private_flags, \ - NAME##_bfd_print_private_bfd_data - - /* Called to copy BFD general private data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); - /* Called to merge BFD general private data from one object file - to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); - /* Called to initialize BFD private section data from one object file - to another. */ - #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); - /* Called to copy BFD private section data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); - /* Called to copy BFD private symbol data from one symbol - to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); - /* Called to copy BFD private header data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); - /* Called to set private backend flags. */ - bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); - - /* Called to print private BFD data. */ - bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); - - /* Core file entry points. */ - #define BFD_JUMP_TABLE_CORE(NAME) \ - NAME##_core_file_failing_command, \ - NAME##_core_file_failing_signal, \ - NAME##_core_file_matches_executable_p, \ - NAME##_core_file_pid - - char * (*_core_file_failing_command) (bfd *); - int (*_core_file_failing_signal) (bfd *); - bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); - int (*_core_file_pid) (bfd *); - - /* Archive entry points. */ - #define BFD_JUMP_TABLE_ARCHIVE(NAME) \ - NAME##_slurp_armap, \ - NAME##_slurp_extended_name_table, \ - NAME##_construct_extended_name_table, \ - NAME##_truncate_arname, \ - NAME##_write_armap, \ - NAME##_read_ar_hdr, \ - NAME##_write_ar_hdr, \ - NAME##_openr_next_archived_file, \ - NAME##_get_elt_at_index, \ - NAME##_generic_stat_arch_elt, \ - NAME##_update_armap_timestamp - - bfd_boolean (*_bfd_slurp_armap) (bfd *); - bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); - void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); - void * (*_bfd_read_ar_hdr_fn) (bfd *); - bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); - bfd * (*openr_next_archived_file) (bfd *, bfd *); - #define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) - bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); - int (*_bfd_stat_arch_elt) (bfd *, struct stat *); - bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); - - /* Entry points used for symbols. */ - #define BFD_JUMP_TABLE_SYMBOLS(NAME) \ - NAME##_get_symtab_upper_bound, \ - NAME##_canonicalize_symtab, \ - NAME##_make_empty_symbol, \ - NAME##_print_symbol, \ - NAME##_get_symbol_info, \ - NAME##_bfd_is_local_label_name, \ - NAME##_bfd_is_target_special_symbol, \ - NAME##_get_lineno, \ - NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ - NAME##_find_inliner_info, \ - NAME##_bfd_make_debug_symbol, \ - NAME##_read_minisymbols, \ - NAME##_minisymbol_to_symbol - - long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); - struct bfd_symbol * - (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); - #define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); - #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) - bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); - bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); - alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); - bfd_boolean (*_bfd_find_inliner_info) - (bfd *, const char **, const char **, unsigned int *); - /* Back-door to allow format-aware applications to create debug symbols - while using BFD for everything else. Currently used by the assembler - when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); - #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); - #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); - - /* Routines for relocs. */ - #define BFD_JUMP_TABLE_RELOCS(NAME) \ - NAME##_get_reloc_upper_bound, \ - NAME##_canonicalize_reloc, \ - NAME##_bfd_reloc_type_lookup, \ - NAME##_bfd_reloc_name_lookup - - long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); - /* See documentation on reloc types. */ - reloc_howto_type * - (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); - reloc_howto_type * - (*reloc_name_lookup) (bfd *, const char *); - - - /* Routines used when writing an object file. */ - #define BFD_JUMP_TABLE_WRITE(NAME) \ - NAME##_set_arch_mach, \ - NAME##_set_section_contents - - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); - - /* Routines used by the linker. */ - #define BFD_JUMP_TABLE_LINK(NAME) \ - NAME##_sizeof_headers, \ - NAME##_bfd_get_relocated_section_contents, \ - NAME##_bfd_relax_section, \ - NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ - NAME##_bfd_link_add_symbols, \ - NAME##_bfd_link_just_syms, \ - NAME##_bfd_copy_link_hash_symbol_type, \ - NAME##_bfd_final_link, \ - NAME##_bfd_link_split_section, \ - NAME##_bfd_gc_sections, \ - NAME##_bfd_lookup_section_flags, \ - NAME##_bfd_merge_sections, \ - NAME##_bfd_is_group_section, \ - NAME##_bfd_discard_group, \ - NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol - - int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); - - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); - - /* Create a hash table for the linker. Different backends store - different information in this table. */ - struct bfd_link_hash_table * - (*_bfd_link_hash_table_create) (bfd *); - - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - - /* Add symbols from this object file into the hash table. */ - bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); - - /* Indicate that we are only retrieving symbol values from this section. */ - void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - - /* Copy the symbol type of a linker hash table entry. */ - #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); - - /* Do a link based on the link_order structures attached to each - section of the BFD. */ - bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); - - /* Should this section be split up into smaller pieces during linking. */ - bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); - - /* Remove sections that are not referenced from the output. */ - bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); - - /* Sets the bitmask of allowed and disallowed section flags. */ - bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); - - /* Attempt to merge SEC_MERGE sections. */ - bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); - - /* Is this section a member of a group? */ - bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); - - /* Discard members of a group. */ - bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); - - /* Check if SEC has been already linked during a reloceatable or - final link. */ - bfd_boolean (*_section_already_linked) (bfd *, asection *, - struct bfd_link_info *); - - /* Define a common symbol. */ - bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, - struct bfd_link_hash_entry *); - - /* Routines to handle dynamic symbols and relocs. */ - #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ - NAME##_get_dynamic_symtab_upper_bound, \ - NAME##_canonicalize_dynamic_symtab, \ - NAME##_get_synthetic_symtab, \ - NAME##_get_dynamic_reloc_upper_bound, \ - NAME##_canonicalize_dynamic_reloc - - /* Get the amount of memory required to hold the dynamic symbols. */ - long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); - /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); - /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); - /* Get the amount of memory required to hold the dynamic relocs. */ - long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); - /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); - A pointer to an alternative bfd_target in case the current one is not -satisfactory. This can happen when the target cpu supports both big -and little endian code, and target chosen by the linker has the wrong -endianness. The function open_output() in ld/ldlang.c uses this field -to find an alternative output format that is suitable. - /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; - - /* Data for use by back-end routines, which isn't - generic enough to belong in this structure. */ - const void *backend_data; - - } bfd_target; - -2.12.1.1 `bfd_set_default_target' -................................. - -*Synopsis* - bfd_boolean bfd_set_default_target (const char *name); - *Description* -Set the default target vector to use when recognizing a BFD. This -takes the name of the target, which may be a BFD target name or a -configuration triplet. - -2.12.1.2 `bfd_find_target' -.......................... - -*Synopsis* - const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); - *Description* -Return a pointer to the transfer vector for the object target named -TARGET_NAME. If TARGET_NAME is `NULL', choose the one in the -environment variable `GNUTARGET'; if that is null or not defined, then -choose the first entry in the target list. Passing in the string -"default" or setting the environment variable to "default" will cause -the first entry in the target list to be returned, and -"target_defaulted" will be set in the BFD if ABFD isn't `NULL'. This -causes `bfd_check_format' to loop over all the targets to find the one -that matches the file being read. - -2.12.1.3 `bfd_get_target_info' -.............................. - -*Synopsis* - const bfd_target *bfd_get_target_info (const char *target_name, - bfd *abfd, - bfd_boolean *is_bigendian, - int *underscoring, - const char **def_target_arch); - *Description* -Return a pointer to the transfer vector for the object target named -TARGET_NAME. If TARGET_NAME is `NULL', choose the one in the -environment variable `GNUTARGET'; if that is null or not defined, then -choose the first entry in the target list. Passing in the string -"default" or setting the environment variable to "default" will cause -the first entry in the target list to be returned, and -"target_defaulted" will be set in the BFD if ABFD isn't `NULL'. This -causes `bfd_check_format' to loop over all the targets to find the one -that matches the file being read. If IS_BIGENDIAN is not `NULL', then -set this value to target's endian mode. True for big-endian, FALSE for -little-endian or for invalid target. If UNDERSCORING is not `NULL', -then set this value to target's underscoring mode. Zero for -none-underscoring, -1 for invalid target, else the value of target -vector's symbol underscoring. If DEF_TARGET_ARCH is not `NULL', then -set it to the architecture string specified by the target_name. - -2.12.1.4 `bfd_target_list' -.......................... - -*Synopsis* - const char ** bfd_target_list (void); - *Description* -Return a freshly malloced NULL-terminated vector of the names of all -the valid BFD targets. Do not modify the names. - -2.12.1.5 `bfd_seach_for_target' -............................... - -*Synopsis* - const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); - *Description* -Return a pointer to the first transfer vector in the list of transfer -vectors maintained by BFD that produces a non-zero result when passed -to the function SEARCH_FUNC. The parameter DATA is passed, unexamined, -to the search function. - - -File: bfd.info, Node: Architectures, Next: Opening and Closing, Prev: Targets, Up: BFD front end - -2.13 Architectures -================== - -BFD keeps one atom in a BFD describing the architecture of the data -attached to the BFD: a pointer to a `bfd_arch_info_type'. - - Pointers to structures can be requested independently of a BFD so -that an architecture's information can be interrogated without access -to an open BFD. - - The architecture information is provided by each architecture -package. The set of default architectures is selected by the macro -`SELECT_ARCHITECTURES'. This is normally set up in the -`config/TARGET.mt' file of your choice. If the name is not defined, -then all the architectures supported are included. - - When BFD starts up, all the architectures are called with an -initialize method. It is up to the architecture back end to insert as -many items into the list of architectures as it wants to; generally -this would be one for each machine and one for the default case (an -item with a machine field of 0). - - BFD's idea of an architecture is implemented in `archures.c'. - -2.13.1 bfd_architecture ------------------------ - -*Description* -This enum gives the object file's CPU architecture, in a global -sense--i.e., what processor family does it belong to? Another field -indicates which processor within the family is in use. The machine -gives a number which distinguishes different versions of the -architecture, containing, for example, 2 and 3 for Intel i960 KA and -i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. - enum bfd_architecture - { - bfd_arch_unknown, /* File arch not known. */ - bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ - #define bfd_mach_m68000 1 - #define bfd_mach_m68008 2 - #define bfd_mach_m68010 3 - #define bfd_mach_m68020 4 - #define bfd_mach_m68030 5 - #define bfd_mach_m68040 6 - #define bfd_mach_m68060 7 - #define bfd_mach_cpu32 8 - #define bfd_mach_fido 9 - #define bfd_mach_mcf_isa_a_nodiv 10 - #define bfd_mach_mcf_isa_a 11 - #define bfd_mach_mcf_isa_a_mac 12 - #define bfd_mach_mcf_isa_a_emac 13 - #define bfd_mach_mcf_isa_aplus 14 - #define bfd_mach_mcf_isa_aplus_mac 15 - #define bfd_mach_mcf_isa_aplus_emac 16 - #define bfd_mach_mcf_isa_b_nousp 17 - #define bfd_mach_mcf_isa_b_nousp_mac 18 - #define bfd_mach_mcf_isa_b_nousp_emac 19 - #define bfd_mach_mcf_isa_b 20 - #define bfd_mach_mcf_isa_b_mac 21 - #define bfd_mach_mcf_isa_b_emac 22 - #define bfd_mach_mcf_isa_b_float 23 - #define bfd_mach_mcf_isa_b_float_mac 24 - #define bfd_mach_mcf_isa_b_float_emac 25 - #define bfd_mach_mcf_isa_c 26 - #define bfd_mach_mcf_isa_c_mac 27 - #define bfd_mach_mcf_isa_c_emac 28 - #define bfd_mach_mcf_isa_c_nodiv 29 - #define bfd_mach_mcf_isa_c_nodiv_mac 30 - #define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ - - #define bfd_mach_i960_core 1 - #define bfd_mach_i960_ka_sa 2 - #define bfd_mach_i960_kb_sb 3 - #define bfd_mach_i960_mc 4 - #define bfd_mach_i960_xa 5 - #define bfd_mach_i960_ca 6 - #define bfd_mach_i960_jx 7 - #define bfd_mach_i960_hx 8 - - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ - #define bfd_mach_sparc 1 - /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ - #define bfd_mach_sparc_sparclet 2 - #define bfd_mach_sparc_sparclite 3 - #define bfd_mach_sparc_v8plus 4 - #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ - #define bfd_mach_sparc_sparclite_le 6 - #define bfd_mach_sparc_v9 7 - #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ - #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ - #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ - /* Nonzero if MACH has the v9 instruction set. */ - #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ - && (mach) != bfd_mach_sparc_sparclite_le) - /* Nonzero if MACH is a 64 bit sparc architecture. */ - #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ - #define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ - #define bfd_mach_mips3000 3000 - #define bfd_mach_mips3900 3900 - #define bfd_mach_mips4000 4000 - #define bfd_mach_mips4010 4010 - #define bfd_mach_mips4100 4100 - #define bfd_mach_mips4111 4111 - #define bfd_mach_mips4120 4120 - #define bfd_mach_mips4300 4300 - #define bfd_mach_mips4400 4400 - #define bfd_mach_mips4600 4600 - #define bfd_mach_mips4650 4650 - #define bfd_mach_mips5000 5000 - #define bfd_mach_mips5400 5400 - #define bfd_mach_mips5500 5500 - #define bfd_mach_mips5900 5900 - #define bfd_mach_mips6000 6000 - #define bfd_mach_mips7000 7000 - #define bfd_mach_mips8000 8000 - #define bfd_mach_mips9000 9000 - #define bfd_mach_mips10000 10000 - #define bfd_mach_mips12000 12000 - #define bfd_mach_mips14000 14000 - #define bfd_mach_mips16000 16000 - #define bfd_mach_mips16 16 - #define bfd_mach_mips5 5 - #define bfd_mach_mips_loongson_2e 3001 - #define bfd_mach_mips_loongson_2f 3002 - #define bfd_mach_mips_loongson_3a 3003 - #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ - #define bfd_mach_mips_octeon 6501 - #define bfd_mach_mips_octeonp 6601 - #define bfd_mach_mips_octeon2 6502 - #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ - #define bfd_mach_mipsisa32 32 - #define bfd_mach_mipsisa32r2 33 - #define bfd_mach_mipsisa64 64 - #define bfd_mach_mipsisa64r2 65 - #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ - #define bfd_mach_i386_intel_syntax (1 << 0) - #define bfd_mach_i386_i8086 (1 << 1) - #define bfd_mach_i386_i386 (1 << 2) - #define bfd_mach_x86_64 (1 << 3) - #define bfd_mach_x64_32 (1 << 4) - #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) - #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) - #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ - #define bfd_mach_l1om (1 << 5) - #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ - #define bfd_mach_k1om (1 << 6) - #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - #define bfd_mach_i386_nacl (1 << 7) - #define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) - #define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) - #define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ - #define bfd_mach_h8300 1 - #define bfd_mach_h8300h 2 - #define bfd_mach_h8300s 3 - #define bfd_mach_h8300hn 4 - #define bfd_mach_h8300sn 5 - #define bfd_mach_h8300sx 6 - #define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ - bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ - #define bfd_mach_ppc 32 - #define bfd_mach_ppc64 64 - #define bfd_mach_ppc_403 403 - #define bfd_mach_ppc_403gc 4030 - #define bfd_mach_ppc_405 405 - #define bfd_mach_ppc_505 505 - #define bfd_mach_ppc_601 601 - #define bfd_mach_ppc_602 602 - #define bfd_mach_ppc_603 603 - #define bfd_mach_ppc_ec603e 6031 - #define bfd_mach_ppc_604 604 - #define bfd_mach_ppc_620 620 - #define bfd_mach_ppc_630 630 - #define bfd_mach_ppc_750 750 - #define bfd_mach_ppc_860 860 - #define bfd_mach_ppc_a35 35 - #define bfd_mach_ppc_rs64ii 642 - #define bfd_mach_ppc_rs64iii 643 - #define bfd_mach_ppc_7400 7400 - #define bfd_mach_ppc_e500 500 - #define bfd_mach_ppc_e500mc 5001 - #define bfd_mach_ppc_e500mc64 5005 - #define bfd_mach_ppc_e5500 5006 - #define bfd_mach_ppc_e6500 5007 - #define bfd_mach_ppc_titan 83 - #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ - #define bfd_mach_rs6k 6000 - #define bfd_mach_rs6k_rs1 6001 - #define bfd_mach_rs6k_rsc 6003 - #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ - #define bfd_mach_hppa10 10 - #define bfd_mach_hppa11 11 - #define bfd_mach_hppa20 20 - #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ - #define bfd_mach_d10v 1 - #define bfd_mach_d10v_ts2 2 - #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ - #define bfd_mach_m6812_default 0 - #define bfd_mach_m6812 1 - #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ - #define bfd_mach_z8001 1 - #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ - #define bfd_mach_sh 1 - #define bfd_mach_sh2 0x20 - #define bfd_mach_sh_dsp 0x2d - #define bfd_mach_sh2a 0x2a - #define bfd_mach_sh2a_nofpu 0x2b - #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 - #define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 - #define bfd_mach_sh2a_or_sh4 0x2a3 - #define bfd_mach_sh2a_or_sh3e 0x2a4 - #define bfd_mach_sh2e 0x2e - #define bfd_mach_sh3 0x30 - #define bfd_mach_sh3_nommu 0x31 - #define bfd_mach_sh3_dsp 0x3d - #define bfd_mach_sh3e 0x3e - #define bfd_mach_sh4 0x40 - #define bfd_mach_sh4_nofpu 0x41 - #define bfd_mach_sh4_nommu_nofpu 0x42 - #define bfd_mach_sh4a 0x4a - #define bfd_mach_sh4a_nofpu 0x4b - #define bfd_mach_sh4al_dsp 0x4d - #define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ - #define bfd_mach_alpha_ev4 0x10 - #define bfd_mach_alpha_ev5 0x20 - #define bfd_mach_alpha_ev6 0x30 - bfd_arch_arm, /* Advanced Risc Machines ARM. */ - #define bfd_mach_arm_unknown 0 - #define bfd_mach_arm_2 1 - #define bfd_mach_arm_2a 2 - #define bfd_mach_arm_3 3 - #define bfd_mach_arm_3M 4 - #define bfd_mach_arm_4 5 - #define bfd_mach_arm_4T 6 - #define bfd_mach_arm_5 7 - #define bfd_mach_arm_5T 8 - #define bfd_mach_arm_5TE 9 - #define bfd_mach_arm_XScale 10 - #define bfd_mach_arm_ep9312 11 - #define bfd_mach_arm_iWMMXt 12 - #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ - #define bfd_mach_tic3x 30 - #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ - bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI) */ - #define bfd_mach_v850 1 - #define bfd_mach_v850e 'E' - #define bfd_mach_v850e1 '1' - #define bfd_mach_v850e2 0x4532 - #define bfd_mach_v850e2v3 0x45325633 - #define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5') */ - bfd_arch_arc, /* ARC Cores */ - #define bfd_mach_arc_5 5 - #define bfd_mach_arc_6 6 - #define bfd_mach_arc_7 7 - #define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ - #define bfd_mach_m16c 0x75 - #define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ - #define bfd_mach_m32r 1 /* For backwards compatibility. */ - #define bfd_mach_m32rx 'x' - #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ - #define bfd_mach_mn10300 300 - #define bfd_mach_am33 330 - #define bfd_mach_am33_2 332 - bfd_arch_fr30, - #define bfd_mach_fr30 0x46523330 - bfd_arch_frv, - #define bfd_mach_frv 1 - #define bfd_mach_frvsimple 2 - #define bfd_mach_fr300 300 - #define bfd_mach_fr400 400 - #define bfd_mach_fr450 450 - #define bfd_mach_frvtomcat 499 /* fr500 prototype */ - #define bfd_mach_fr500 500 - #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ - #define bfd_mach_moxie 1 - bfd_arch_mcore, - bfd_arch_mep, - #define bfd_mach_mep 1 - #define bfd_mach_mep_h1 0x6831 - #define bfd_mach_mep_c5 0x6335 - bfd_arch_metag, - #define bfd_mach_metag 1 - bfd_arch_ia64, /* HP/Intel ia64 */ - #define bfd_mach_ia64_elf64 64 - #define bfd_mach_ia64_elf32 32 - bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ - #define bfd_mach_ip2022 1 - #define bfd_mach_ip2022ext 2 - bfd_arch_iq2000, /* Vitesse IQ2000. */ - #define bfd_mach_iq2000 1 - #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ - #define bfd_mach_epiphany16 1 - #define bfd_mach_epiphany32 2 - bfd_arch_mt, - #define bfd_mach_ms1 1 - #define bfd_mach_mrisc2 2 - #define bfd_mach_ms2 3 - bfd_arch_pj, - bfd_arch_avr, /* Atmel AVR microcontrollers. */ - #define bfd_mach_avr1 1 - #define bfd_mach_avr2 2 - #define bfd_mach_avr25 25 - #define bfd_mach_avr3 3 - #define bfd_mach_avr31 31 - #define bfd_mach_avr35 35 - #define bfd_mach_avr4 4 - #define bfd_mach_avr5 5 - #define bfd_mach_avr51 51 - #define bfd_mach_avr6 6 - #define bfd_mach_avrxmega1 101 - #define bfd_mach_avrxmega2 102 - #define bfd_mach_avrxmega3 103 - #define bfd_mach_avrxmega4 104 - #define bfd_mach_avrxmega5 105 - #define bfd_mach_avrxmega6 106 - #define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ - #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ - #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ - #define bfd_mach_cr16c 1 - bfd_arch_crx, /* National Semiconductor CRX. */ - #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ - #define bfd_mach_cris_v0_v10 255 - #define bfd_mach_cris_v32 32 - #define bfd_mach_cris_v10_v32 1032 - bfd_arch_rl78, - #define bfd_mach_rl78 0x75 - bfd_arch_rx, /* Renesas RX. */ - #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ - #define bfd_mach_s390_31 31 - #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ - #define bfd_mach_score3 3 - #define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ - bfd_arch_mmix, /* Donald Knuth's educational processor. */ - bfd_arch_xstormy16, - #define bfd_mach_xstormy16 1 - bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ - #define bfd_mach_msp11 11 - #define bfd_mach_msp110 110 - #define bfd_mach_msp12 12 - #define bfd_mach_msp13 13 - #define bfd_mach_msp14 14 - #define bfd_mach_msp15 15 - #define bfd_mach_msp16 16 - #define bfd_mach_msp20 20 - #define bfd_mach_msp21 21 - #define bfd_mach_msp22 22 - #define bfd_mach_msp23 23 - #define bfd_mach_msp24 24 - #define bfd_mach_msp26 26 - #define bfd_mach_msp31 31 - #define bfd_mach_msp32 32 - #define bfd_mach_msp33 33 - #define bfd_mach_msp41 41 - #define bfd_mach_msp42 42 - #define bfd_mach_msp43 43 - #define bfd_mach_msp44 44 - #define bfd_mach_msp430x 45 - #define bfd_mach_msp46 46 - #define bfd_mach_msp47 47 - #define bfd_mach_msp54 54 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ - #define bfd_mach_xc16x 1 - #define bfd_mach_xc16xl 2 - #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ - #define bfd_mach_xgate 1 - bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ - #define bfd_mach_xtensa 1 - bfd_arch_z80, - #define bfd_mach_z80strict 1 /* No undocumented opcodes. */ - #define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ - #define bfd_mach_z80full 7 /* All undocumented instructions. */ - #define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ - #define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ - #define bfd_mach_tilepro 1 - #define bfd_mach_tilegx 1 - #define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ - #define bfd_mach_aarch64 0 - #define bfd_mach_aarch64_ilp32 32 - bfd_arch_nios2, - #define bfd_mach_nios2 0 - bfd_arch_last - }; - -2.13.2 bfd_arch_info --------------------- - -*Description* -This structure contains information on architectures for use within BFD. - - typedef struct bfd_arch_info - { - int bits_per_word; - int bits_per_address; - int bits_per_byte; - enum bfd_architecture arch; - unsigned long mach; - const char *arch_name; - const char *printable_name; - unsigned int section_align_power; - /* TRUE if this is the default machine for the architecture. - The default arch should be the first entry for an arch so that - all the entries for that arch can be accessed via `next'. */ - bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); - - bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); - - /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If - IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is - TRUE, the buffer contains code. */ - void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian, - bfd_boolean code); - - const struct bfd_arch_info *next; - } - bfd_arch_info_type; - -2.13.2.1 `bfd_printable_name' -............................. - -*Synopsis* - const char *bfd_printable_name (bfd *abfd); - *Description* -Return a printable string representing the architecture and machine -from the pointer to the architecture info structure. - -2.13.2.2 `bfd_scan_arch' -........................ - -*Synopsis* - const bfd_arch_info_type *bfd_scan_arch (const char *string); - *Description* -Figure out if BFD supports any cpu which could be described with the -name STRING. Return a pointer to an `arch_info' structure if a machine -is found, otherwise NULL. - -2.13.2.3 `bfd_arch_list' -........................ - -*Synopsis* - const char **bfd_arch_list (void); - *Description* -Return a freshly malloced NULL-terminated vector of the names of all -the valid BFD architectures. Do not modify the names. - -2.13.2.4 `bfd_arch_get_compatible' -.................................. - -*Synopsis* - const bfd_arch_info_type *bfd_arch_get_compatible - (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); - *Description* -Determine whether two BFDs' architectures and machine types are -compatible. Calculates the lowest common denominator between the two -architectures and machine types implied by the BFDs and returns a -pointer to an `arch_info' structure describing the compatible machine. - -2.13.2.5 `bfd_default_arch_struct' -.................................. - -*Description* -The `bfd_default_arch_struct' is an item of `bfd_arch_info_type' which -has been initialized to a fairly generic state. A BFD starts life by -pointing to this structure, until the correct back end has determined -the real architecture of the file. - extern const bfd_arch_info_type bfd_default_arch_struct; - -2.13.2.6 `bfd_set_arch_info' -............................ - -*Synopsis* - void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); - *Description* -Set the architecture info of ABFD to ARG. - -2.13.2.7 `bfd_default_set_arch_mach' -.................................... - -*Synopsis* - bfd_boolean bfd_default_set_arch_mach - (bfd *abfd, enum bfd_architecture arch, unsigned long mach); - *Description* -Set the architecture and machine type in BFD ABFD to ARCH and MACH. -Find the correct pointer to a structure and insert it into the -`arch_info' pointer. - -2.13.2.8 `bfd_get_arch' -....................... - -*Synopsis* - enum bfd_architecture bfd_get_arch (bfd *abfd); - *Description* -Return the enumerated type which describes the BFD ABFD's architecture. - -2.13.2.9 `bfd_get_mach' -....................... - -*Synopsis* - unsigned long bfd_get_mach (bfd *abfd); - *Description* -Return the long type which describes the BFD ABFD's machine. - -2.13.2.10 `bfd_arch_bits_per_byte' -.................................. - -*Synopsis* - unsigned int bfd_arch_bits_per_byte (bfd *abfd); - *Description* -Return the number of bits in one of the BFD ABFD's architecture's bytes. - -2.13.2.11 `bfd_arch_bits_per_address' -..................................... - -*Synopsis* - unsigned int bfd_arch_bits_per_address (bfd *abfd); - *Description* -Return the number of bits in one of the BFD ABFD's architecture's -addresses. - -2.13.2.12 `bfd_default_compatible' -.................................. - -*Synopsis* - const bfd_arch_info_type *bfd_default_compatible - (const bfd_arch_info_type *a, const bfd_arch_info_type *b); - *Description* -The default function for testing for compatibility. - -2.13.2.13 `bfd_default_scan' -............................ - -*Synopsis* - bfd_boolean bfd_default_scan - (const struct bfd_arch_info *info, const char *string); - *Description* -The default function for working out whether this is an architecture -hit and a machine hit. - -2.13.2.14 `bfd_get_arch_info' -............................. - -*Synopsis* - const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); - *Description* -Return the architecture info struct in ABFD. - -2.13.2.15 `bfd_lookup_arch' -........................... - -*Synopsis* - const bfd_arch_info_type *bfd_lookup_arch - (enum bfd_architecture arch, unsigned long machine); - *Description* -Look for the architecture info structure which matches the arguments -ARCH and MACHINE. A machine of 0 matches the machine/architecture -structure which marks itself as the default. - -2.13.2.16 `bfd_printable_arch_mach' -................................... - -*Synopsis* - const char *bfd_printable_arch_mach - (enum bfd_architecture arch, unsigned long machine); - *Description* -Return a printable string representing the architecture and machine -type. - - This routine is depreciated. - -2.13.2.17 `bfd_octets_per_byte' -............................... - -*Synopsis* - unsigned int bfd_octets_per_byte (bfd *abfd); - *Description* -Return the number of octets (8-bit quantities) per target byte (minimum -addressable unit). In most cases, this will be one, but some DSP -targets have 16, 32, or even 48 bits per byte. - -2.13.2.18 `bfd_arch_mach_octets_per_byte' -......................................... - -*Synopsis* - unsigned int bfd_arch_mach_octets_per_byte - (enum bfd_architecture arch, unsigned long machine); - *Description* -See bfd_octets_per_byte. - - This routine is provided for those cases where a bfd * is not -available - -2.13.2.19 `bfd_arch_default_fill' -................................. - -*Synopsis* - void *bfd_arch_default_fill (bfd_size_type count, - bfd_boolean is_bigendian, - bfd_boolean code); - *Description* -Allocate via bfd_malloc and return a fill buffer of size COUNT. If -IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is -TRUE, the buffer contains code. - - -File: bfd.info, Node: Opening and Closing, Next: Internal, Prev: Architectures, Up: BFD front end - - /* Set to N to open the next N BFDs using an alternate id space. */ - extern unsigned int bfd_use_reserved_id; - -2.14 Opening and closing BFDs -============================= - -2.14.1 Functions for opening and closing ----------------------------------------- - -2.14.1.1 `bfd_fopen' -.................... - -*Synopsis* - bfd *bfd_fopen (const char *filename, const char *target, - const char *mode, int fd); - *Description* -Open the file FILENAME with the target TARGET. Return a pointer to the -created BFD. If FD is not -1, then `fdopen' is used to open the file; -otherwise, `fopen' is used. MODE is passed directly to `fopen' or -`fdopen'. - - Calls `bfd_find_target', so TARGET is interpreted as by that -function. - - The new BFD is marked as cacheable iff FD is -1. - - If `NULL' is returned then an error has occured. Possible errors -are `bfd_error_no_memory', `bfd_error_invalid_target' or `system_call' -error. - - On error, FD is always closed. - -2.14.1.2 `bfd_openr' -.................... - -*Synopsis* - bfd *bfd_openr (const char *filename, const char *target); - *Description* -Open the file FILENAME (using `fopen') with the target TARGET. Return -a pointer to the created BFD. - - Calls `bfd_find_target', so TARGET is interpreted as by that -function. - - If `NULL' is returned then an error has occured. Possible errors -are `bfd_error_no_memory', `bfd_error_invalid_target' or `system_call' -error. - -2.14.1.3 `bfd_fdopenr' -...................... - -*Synopsis* - bfd *bfd_fdopenr (const char *filename, const char *target, int fd); - *Description* -`bfd_fdopenr' is to `bfd_fopenr' much like `fdopen' is to `fopen'. It -opens a BFD on a file already described by the FD supplied. - - When the file is later `bfd_close'd, the file descriptor will be -closed. If the caller desires that this file descriptor be cached by -BFD (opened as needed, closed as needed to free descriptors for other -opens), with the supplied FD used as an initial file descriptor (but -subject to closure at any time), call bfd_set_cacheable(bfd, 1) on the -returned BFD. The default is to assume no caching; the file descriptor -will remain open until `bfd_close', and will not be affected by BFD -operations on other files. - - Possible errors are `bfd_error_no_memory', -`bfd_error_invalid_target' and `bfd_error_system_call'. - - On error, FD is closed. - -2.14.1.4 `bfd_openstreamr' -.......................... - -*Synopsis* - bfd *bfd_openstreamr (const char *, const char *, void *); - *Description* -Open a BFD for read access on an existing stdio stream. When the BFD -is passed to `bfd_close', the stream will be closed. - -2.14.1.5 `bfd_openr_iovec' -.......................... - -*Synopsis* - bfd *bfd_openr_iovec (const char *filename, const char *target, - void *(*open_func) (struct bfd *nbfd, - void *open_closure), - void *open_closure, - file_ptr (*pread_func) (struct bfd *nbfd, - void *stream, - void *buf, - file_ptr nbytes, - file_ptr offset), - int (*close_func) (struct bfd *nbfd, - void *stream), - int (*stat_func) (struct bfd *abfd, - void *stream, - struct stat *sb)); - *Description* -Create and return a BFD backed by a read-only STREAM. The STREAM is -created using OPEN_FUNC, accessed using PREAD_FUNC and destroyed using -CLOSE_FUNC. - - Calls `bfd_find_target', so TARGET is interpreted as by that -function. - - Calls OPEN_FUNC (which can call `bfd_zalloc' and `bfd_get_filename') -to obtain the read-only stream backing the BFD. OPEN_FUNC either -succeeds returning the non-`NULL' STREAM, or fails returning `NULL' -(setting `bfd_error'). - - Calls PREAD_FUNC to request NBYTES of data from STREAM starting at -OFFSET (e.g., via a call to `bfd_read'). PREAD_FUNC either succeeds -returning the number of bytes read (which can be less than NBYTES when -end-of-file), or fails returning -1 (setting `bfd_error'). - - Calls CLOSE_FUNC when the BFD is later closed using `bfd_close'. -CLOSE_FUNC either succeeds returning 0, or fails returning -1 (setting -`bfd_error'). - - Calls STAT_FUNC to fill in a stat structure for bfd_stat, -bfd_get_size, and bfd_get_mtime calls. STAT_FUNC returns 0 on success, -or returns -1 on failure (setting `bfd_error'). - - If `bfd_openr_iovec' returns `NULL' then an error has occurred. -Possible errors are `bfd_error_no_memory', `bfd_error_invalid_target' -and `bfd_error_system_call'. - -2.14.1.6 `bfd_openw' -.................... - -*Synopsis* - bfd *bfd_openw (const char *filename, const char *target); - *Description* -Create a BFD, associated with file FILENAME, using the file format -TARGET, and return a pointer to it. - - Possible errors are `bfd_error_system_call', `bfd_error_no_memory', -`bfd_error_invalid_target'. - -2.14.1.7 `bfd_close' -.................... - -*Synopsis* - bfd_boolean bfd_close (bfd *abfd); - *Description* -Close a BFD. If the BFD was open for writing, then pending operations -are completed and the file written out and closed. If the created file -is executable, then `chmod' is called to mark it as such. - - All memory attached to the BFD is released. - - The file descriptor associated with the BFD is closed (even if it -was passed in to BFD by `bfd_fdopenr'). - - *Returns* -`TRUE' is returned if all is ok, otherwise `FALSE'. - -2.14.1.8 `bfd_close_all_done' -............................. - -*Synopsis* - bfd_boolean bfd_close_all_done (bfd *); - *Description* -Close a BFD. Differs from `bfd_close' since it does not complete any -pending operations. This routine would be used if the application had -just used BFD for swapping and didn't want to use any of the writing -code. - - If the created file is executable, then `chmod' is called to mark it -as such. - - All memory attached to the BFD is released. - - *Returns* -`TRUE' is returned if all is ok, otherwise `FALSE'. - -2.14.1.9 `bfd_create' -..................... - -*Synopsis* - bfd *bfd_create (const char *filename, bfd *templ); - *Description* -Create a new BFD in the manner of `bfd_openw', but without opening a -file. The new BFD takes the target from the target used by TEMPL. The -format is always set to `bfd_object'. - -2.14.1.10 `bfd_make_writable' -............................. - -*Synopsis* - bfd_boolean bfd_make_writable (bfd *abfd); - *Description* -Takes a BFD as created by `bfd_create' and converts it into one like as -returned by `bfd_openw'. It does this by converting the BFD to -BFD_IN_MEMORY. It's assumed that you will call `bfd_make_readable' on -this bfd later. - - *Returns* -`TRUE' is returned if all is ok, otherwise `FALSE'. - -2.14.1.11 `bfd_make_readable' -............................. - -*Synopsis* - bfd_boolean bfd_make_readable (bfd *abfd); - *Description* -Takes a BFD as created by `bfd_create' and `bfd_make_writable' and -converts it into one like as returned by `bfd_openr'. It does this by -writing the contents out to the memory buffer, then reversing the -direction. - - *Returns* -`TRUE' is returned if all is ok, otherwise `FALSE'. - -2.14.1.12 `bfd_alloc' -..................... - -*Synopsis* - void *bfd_alloc (bfd *abfd, bfd_size_type wanted); - *Description* -Allocate a block of WANTED bytes of memory attached to `abfd' and -return a pointer to it. - -2.14.1.13 `bfd_alloc2' -...................... - -*Synopsis* - void *bfd_alloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size); - *Description* -Allocate a block of NMEMB elements of SIZE bytes each of memory -attached to `abfd' and return a pointer to it. - -2.14.1.14 `bfd_zalloc' -...................... - -*Synopsis* - void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); - *Description* -Allocate a block of WANTED bytes of zeroed memory attached to `abfd' -and return a pointer to it. - -2.14.1.15 `bfd_zalloc2' -....................... - -*Synopsis* - void *bfd_zalloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size); - *Description* -Allocate a block of NMEMB elements of SIZE bytes each of zeroed memory -attached to `abfd' and return a pointer to it. - -2.14.1.16 `bfd_calc_gnu_debuglink_crc32' -........................................ - -*Synopsis* - unsigned long bfd_calc_gnu_debuglink_crc32 - (unsigned long crc, const unsigned char *buf, bfd_size_type len); - *Description* -Computes a CRC value as used in the .gnu_debuglink section. Advances -the previously computed CRC value by computing and adding in the crc32 -for LEN bytes of BUF. - - *Returns* -Return the updated CRC32 value. - -2.14.1.17 `bfd_get_debug_link_info' -................................... - -*Synopsis* - char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); - *Description* -fetch the filename and CRC32 value for any separate debuginfo -associated with ABFD. Return NULL if no such info found, otherwise -return filename and update CRC32_OUT. The returned filename is -allocated with `malloc'; freeing it is the responsibility of the caller. - -2.14.1.18 `bfd_get_alt_debug_link_info' -....................................... - -*Synopsis* - char *bfd_get_alt_debug_link_info (bfd *abfd, unsigned long *crc32_out); - *Description* -Fetch the filename and BuildID value for any alternate debuginfo -associated with ABFD. Return NULL if no such info found, otherwise -return filename and update BUILDID_OUT. The returned filename is -allocated with `malloc'; freeing it is the responsibility of the caller. - -2.14.1.19 `separate_debug_file_exists' -...................................... - -*Synopsis* - bfd_boolean separate_debug_file_exists - (char *name, unsigned long crc32); - *Description* -Checks to see if NAME is a file and if its contents match CRC32. - -2.14.1.20 `separate_alt_debug_file_exists' -.......................................... - -*Synopsis* - bfd_boolean separate_alt_debug_file_exists - (char *name, unsigned long crc32); - *Description* -Checks to see if NAME is a file and if its BuildID matches BUILDID. - -2.14.1.21 `find_separate_debug_file' -.................................... - -*Synopsis* - char *find_separate_debug_file (bfd *abfd); - *Description* -Searches ABFD for a section called SECTION_NAME which is expected to -contain a reference to a file containing separate debugging -information. The function scans various locations in the filesystem, -including the file tree rooted at DEBUG_FILE_DIRECTORY, and returns the -first matching filename that it finds. If CHECK_CRC is TRUE then the -contents of the file must also match the CRC value contained in -SECTION_NAME. Returns NULL if no valid file could be found. - -2.14.1.22 `bfd_follow_gnu_debuglink' -.................................... - -*Synopsis* - char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); - *Description* -Takes a BFD and searches it for a .gnu_debuglink section. If this -section is found, it examines the section for the name and checksum of -a '.debug' file containing auxiliary debugging information. It then -searches the filesystem for this .debug file in some standard -locations, including the directory tree rooted at DIR, and if found -returns the full filename. - - If DIR is NULL, it will search a default path configured into libbfd -at build time. [XXX this feature is not currently implemented]. - - *Returns* -`NULL' on any errors or failure to locate the .debug file, otherwise a -pointer to a heap-allocated string containing the filename. The caller -is responsible for freeing this string. - -2.14.1.23 `bfd_follow_gnu_debugaltlink' -....................................... - -*Synopsis* - char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); - *Description* -Takes a BFD and searches it for a .gnu_debugaltlink section. If this -section is found, it examines the section for the name of a file -containing auxiliary debugging information. It then searches the -filesystem for this file in a set of standard locations, including the -directory tree rooted at DIR, and if found returns the full filename. - - If DIR is NULL, it will search a default path configured into libbfd -at build time. [FIXME: This feature is not currently implemented]. - - *Returns* -`NULL' on any errors or failure to locate the debug file, otherwise a -pointer to a heap-allocated string containing the filename. The caller -is responsible for freeing this string. - -2.14.1.24 `bfd_create_gnu_debuglink_section' -............................................ - -*Synopsis* - struct bfd_section *bfd_create_gnu_debuglink_section - (bfd *abfd, const char *filename); - *Description* -Takes a BFD and adds a .gnu_debuglink section to it. The section is -sized to be big enough to contain a link to the specified FILENAME. - - *Returns* -A pointer to the new section is returned if all is ok. Otherwise -`NULL' is returned and bfd_error is set. - -2.14.1.25 `bfd_fill_in_gnu_debuglink_section' -............................................. - -*Synopsis* - bfd_boolean bfd_fill_in_gnu_debuglink_section - (bfd *abfd, struct bfd_section *sect, const char *filename); - *Description* -Takes a BFD and containing a .gnu_debuglink section SECT and fills in -the contents of the section to contain a link to the specified -FILENAME. The filename should be relative to the current directory. - - *Returns* -`TRUE' is returned if all is ok. Otherwise `FALSE' is returned and -bfd_error is set. - - -File: bfd.info, Node: Internal, Next: File Caching, Prev: Opening and Closing, Up: BFD front end - -2.15 Implementation details -=========================== - -2.15.1 Internal functions -------------------------- - -*Description* -These routines are used within BFD. They are not intended for export, -but are documented here for completeness. - -2.15.1.1 `bfd_write_bigendian_4byte_int' -........................................ - -*Synopsis* - bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); - *Description* -Write a 4 byte integer I to the output BFD ABFD, in big endian order -regardless of what else is going on. This is useful in archives. - -2.15.1.2 `bfd_put_size' -....................... - -2.15.1.3 `bfd_get_size' -....................... - -*Description* -These macros as used for reading and writing raw data in sections; each -access (except for bytes) is vectored through the target format of the -BFD and mangled accordingly. The mangling performs any necessary endian -translations and removes alignment restrictions. Note that types -accepted and returned by these macros are identical so they can be -swapped around in macros--for example, `libaout.h' defines `GET_WORD' -to either `bfd_get_32' or `bfd_get_64'. - - In the put routines, VAL must be a `bfd_vma'. If we are on a system -without prototypes, the caller is responsible for making sure that is -true, with a cast if necessary. We don't cast them in the macro -definitions because that would prevent `lint' or `gcc -Wall' from -detecting sins such as passing a pointer. To detect calling these with -less than a `bfd_vma', use `gcc -Wconversion' on a host with 64 bit -`bfd_vma''s. - - /* Byte swapping macros for user section data. */ - - #define bfd_put_8(abfd, val, ptr) \ - ((void) (*((unsigned char *) (ptr)) = (val) & 0xff)) - #define bfd_put_signed_8 \ - bfd_put_8 - #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) - #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) - - #define bfd_put_16(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) - #define bfd_put_signed_16 \ - bfd_put_16 - #define bfd_get_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx16, (ptr)) - #define bfd_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) - - #define bfd_put_32(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) - #define bfd_put_signed_32 \ - bfd_put_32 - #define bfd_get_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx32, (ptr)) - #define bfd_get_signed_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) - - #define bfd_put_64(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) - #define bfd_put_signed_64 \ - bfd_put_64 - #define bfd_get_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx64, (ptr)) - #define bfd_get_signed_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) - - #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ - : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ - : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ - : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ - : (abort (), (bfd_vma) - 1)) - - #define bfd_put(bits, abfd, val, ptr) \ - ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ - : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ - : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ - : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ - : (abort (), (void) 0)) - -2.15.1.4 `bfd_h_put_size' -......................... - -*Description* -These macros have the same function as their `bfd_get_x' brethren, -except that they are used for removing information for the header -records of object files. Believe it or not, some object files keep -their header records in big endian order and their data in little -endian order. - - /* Byte swapping macros for file header data. */ - - #define bfd_h_put_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) - #define bfd_h_put_signed_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) - #define bfd_h_get_8(abfd, ptr) \ - bfd_get_8 (abfd, ptr) - #define bfd_h_get_signed_8(abfd, ptr) \ - bfd_get_signed_8 (abfd, ptr) - - #define bfd_h_put_16(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) - #define bfd_h_put_signed_16 \ - bfd_h_put_16 - #define bfd_h_get_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx16, (ptr)) - #define bfd_h_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) - - #define bfd_h_put_32(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) - #define bfd_h_put_signed_32 \ - bfd_h_put_32 - #define bfd_h_get_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx32, (ptr)) - #define bfd_h_get_signed_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) - - #define bfd_h_put_64(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) - #define bfd_h_put_signed_64 \ - bfd_h_put_64 - #define bfd_h_get_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx64, (ptr)) - #define bfd_h_get_signed_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) - - /* Aliases for the above, which should eventually go away. */ - - #define H_PUT_64 bfd_h_put_64 - #define H_PUT_32 bfd_h_put_32 - #define H_PUT_16 bfd_h_put_16 - #define H_PUT_8 bfd_h_put_8 - #define H_PUT_S64 bfd_h_put_signed_64 - #define H_PUT_S32 bfd_h_put_signed_32 - #define H_PUT_S16 bfd_h_put_signed_16 - #define H_PUT_S8 bfd_h_put_signed_8 - #define H_GET_64 bfd_h_get_64 - #define H_GET_32 bfd_h_get_32 - #define H_GET_16 bfd_h_get_16 - #define H_GET_8 bfd_h_get_8 - #define H_GET_S64 bfd_h_get_signed_64 - #define H_GET_S32 bfd_h_get_signed_32 - #define H_GET_S16 bfd_h_get_signed_16 - #define H_GET_S8 bfd_h_get_signed_8 - -2.15.1.5 `bfd_log2' -................... - -*Synopsis* - unsigned int bfd_log2 (bfd_vma x); - *Description* -Return the log base 2 of the value supplied, rounded up. E.g., an X of -1025 returns 11. A X of 0 returns 0. - - -File: bfd.info, Node: File Caching, Next: Linker Functions, Prev: Internal, Up: BFD front end - -2.16 File caching -================= - -The file caching mechanism is embedded within BFD and allows the -application to open as many BFDs as it wants without regard to the -underlying operating system's file descriptor limit (often as low as 20 -open files). The module in `cache.c' maintains a least recently used -list of `bfd_cache_max_open' files, and exports the name -`bfd_cache_lookup', which runs around and makes sure that the required -BFD is open. If not, then it chooses a file to close, closes it and -opens the one wanted, returning its file handle. - -2.16.1 Caching functions ------------------------- - -2.16.1.1 `bfd_cache_init' -......................... - -*Synopsis* - bfd_boolean bfd_cache_init (bfd *abfd); - *Description* -Add a newly opened BFD to the cache. - -2.16.1.2 `bfd_cache_close' -.......................... - -*Synopsis* - bfd_boolean bfd_cache_close (bfd *abfd); - *Description* -Remove the BFD ABFD from the cache. If the attached file is open, then -close it too. - - *Returns* -`FALSE' is returned if closing the file fails, `TRUE' is returned if -all is well. - -2.16.1.3 `bfd_cache_close_all' -.............................. - -*Synopsis* - bfd_boolean bfd_cache_close_all (void); - *Description* -Remove all BFDs from the cache. If the attached file is open, then -close it too. - - *Returns* -`FALSE' is returned if closing one of the file fails, `TRUE' is -returned if all is well. - -2.16.1.4 `bfd_open_file' -........................ - -*Synopsis* - FILE* bfd_open_file (bfd *abfd); - *Description* -Call the OS to open a file for ABFD. Return the `FILE *' (possibly -`NULL') that results from this operation. Set up the BFD so that -future accesses know the file is open. If the `FILE *' returned is -`NULL', then it won't have been put in the cache, so it won't have to -be removed from it. - - -File: bfd.info, Node: Linker Functions, Next: Hash Tables, Prev: File Caching, Up: BFD front end - -2.17 Linker Functions -===================== - -The linker uses three special entry points in the BFD target vector. -It is not necessary to write special routines for these entry points -when creating a new BFD back end, since generic versions are provided. -However, writing them can speed up linking and make it use -significantly less runtime memory. - - The first routine creates a hash table used by the other routines. -The second routine adds the symbols from an object file to the hash -table. The third routine takes all the object files and links them -together to create the output file. These routines are designed so -that the linker proper does not need to know anything about the symbols -in the object files that it is linking. The linker merely arranges the -sections as directed by the linker script and lets BFD handle the -details of symbols and relocs. - - The second routine and third routines are passed a pointer to a -`struct bfd_link_info' structure (defined in `bfdlink.h') which holds -information relevant to the link, including the linker hash table -(which was created by the first routine) and a set of callback -functions to the linker proper. - - The generic linker routines are in `linker.c', and use the header -file `genlink.h'. As of this writing, the only back ends which have -implemented versions of these routines are a.out (in `aoutx.h') and -ECOFF (in `ecoff.c'). The a.out routines are used as examples -throughout this section. - -* Menu: - -* Creating a Linker Hash Table:: -* Adding Symbols to the Hash Table:: -* Performing the Final Link:: - - -File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions - -2.17.1 Creating a linker hash table ------------------------------------ - -The linker routines must create a hash table, which must be derived -from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash -Tables::, for information on how to create a derived hash table. This -entry point is called using the target vector of the linker output file. - - The `_bfd_link_hash_table_create' entry point must allocate and -initialize an instance of the desired hash table. If the back end does -not require any additional information to be stored with the entries in -the hash table, the entry point may simply create a `struct -bfd_link_hash_table'. Most likely, however, some additional -information will be needed. - - For example, with each entry in the hash table the a.out linker -keeps the index the symbol has in the final output file (this index -number is used so that when doing a relocatable link the symbol index -used in the output file can be quickly filled in when copying over a -reloc). The a.out linker code defines the required structures and -functions for a hash table derived from `struct bfd_link_hash_table'. -The a.out linker hash table is created by the function -`NAME(aout,link_hash_table_create)'; it simply allocates space for the -hash table, initializes it, and returns a pointer to it. - - When writing the linker routines for a new back end, you will -generally not know exactly which fields will be required until you have -finished. You should simply create a new hash table which defines no -additional fields, and then simply add fields as they become necessary. - - -File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions - -2.17.2 Adding symbols to the hash table ---------------------------------------- - -The linker proper will call the `_bfd_link_add_symbols' entry point for -each object file or archive which is to be linked (typically these are -the files named on the command line, but some may also come from the -linker script). The entry point is responsible for examining the file. -For an object file, BFD must add any relevant symbol information to -the hash table. For an archive, BFD must determine which elements of -the archive should be used and adding them to the link. - - The a.out version of this entry point is -`NAME(aout,link_add_symbols)'. - -* Menu: - -* Differing file formats:: -* Adding symbols from an object file:: -* Adding symbols from an archive:: - - -File: bfd.info, Node: Differing file formats, Next: Adding symbols from an object file, Prev: Adding Symbols to the Hash Table, Up: Adding Symbols to the Hash Table - -2.17.2.1 Differing file formats -............................... - -Normally all the files involved in a link will be of the same format, -but it is also possible to link together different format object files, -and the back end must support that. The `_bfd_link_add_symbols' entry -point is called via the target vector of the file to be added. This -has an important consequence: the function may not assume that the hash -table is the type created by the corresponding -`_bfd_link_hash_table_create' vector. All the `_bfd_link_add_symbols' -function can assume about the hash table is that it is derived from -`struct bfd_link_hash_table'. - - Sometimes the `_bfd_link_add_symbols' function must store some -information in the hash table entry to be used by the `_bfd_final_link' -function. In such a case the output bfd xvec must be checked to make -sure that the hash table was created by an object file of the same -format. - - The `_bfd_final_link' routine must be prepared to handle a hash -entry without any extra information added by the -`_bfd_link_add_symbols' function. A hash entry without extra -information will also occur when the linker script directs the linker -to create a symbol. Note that, regardless of how a hash table entry is -added, all the fields will be initialized to some sort of null value by -the hash table entry initialization function. - - See `ecoff_link_add_externals' for an example of how to check the -output bfd before saving information (in this case, the ECOFF external -symbol debugging information) in a hash table entry. - - -File: bfd.info, Node: Adding symbols from an object file, Next: Adding symbols from an archive, Prev: Differing file formats, Up: Adding Symbols to the Hash Table - -2.17.2.2 Adding symbols from an object file -........................................... - -When the `_bfd_link_add_symbols' routine is passed an object file, it -must add all externally visible symbols in that object file to the hash -table. The actual work of adding the symbol to the hash table is -normally handled by the function `_bfd_generic_link_add_one_symbol'. -The `_bfd_link_add_symbols' routine is responsible for reading all the -symbols from the object file and passing the correct information to -`_bfd_generic_link_add_one_symbol'. - - The `_bfd_link_add_symbols' routine should not use -`bfd_canonicalize_symtab' to read the symbols. The point of providing -this routine is to avoid the overhead of converting the symbols into -generic `asymbol' structures. - - `_bfd_generic_link_add_one_symbol' handles the details of combining -common symbols, warning about multiple definitions, and so forth. It -takes arguments which describe the symbol to add, notably symbol flags, -a section, and an offset. The symbol flags include such things as -`BSF_WEAK' or `BSF_INDIRECT'. The section is a section in the object -file, or something like `bfd_und_section_ptr' for an undefined symbol -or `bfd_com_section_ptr' for a common symbol. - - If the `_bfd_final_link' routine is also going to need to read the -symbol information, the `_bfd_link_add_symbols' routine should save it -somewhere attached to the object file BFD. However, the information -should only be saved if the `keep_memory' field of the `info' argument -is TRUE, so that the `-no-keep-memory' linker switch is effective. - - The a.out function which adds symbols from an object file is -`aout_link_add_object_symbols', and most of the interesting work is in -`aout_link_add_symbols'. The latter saves pointers to the hash tables -entries created by `_bfd_generic_link_add_one_symbol' indexed by symbol -number, so that the `_bfd_final_link' routine does not have to call the -hash table lookup routine to locate the entry. - - -File: bfd.info, Node: Adding symbols from an archive, Prev: Adding symbols from an object file, Up: Adding Symbols to the Hash Table - -2.17.2.3 Adding symbols from an archive -....................................... - -When the `_bfd_link_add_symbols' routine is passed an archive, it must -look through the symbols defined by the archive and decide which -elements of the archive should be included in the link. For each such -element it must call the `add_archive_element' linker callback, and it -must add the symbols from the object file to the linker hash table. -(The callback may in fact indicate that a replacement BFD should be -used, in which case the symbols from that BFD should be added to the -linker hash table instead.) - - In most cases the work of looking through the symbols in the archive -should be done by the `_bfd_generic_link_add_archive_symbols' function. -This function builds a hash table from the archive symbol table and -looks through the list of undefined symbols to see which elements -should be included. `_bfd_generic_link_add_archive_symbols' is passed -a function to call to make the final decision about adding an archive -element to the link and to do the actual work of adding the symbols to -the linker hash table. - - The function passed to `_bfd_generic_link_add_archive_symbols' must -read the symbols of the archive element and decide whether the archive -element should be included in the link. If the element is to be -included, the `add_archive_element' linker callback routine must be -called with the element as an argument, and the element's symbols must -be added to the linker hash table just as though the element had itself -been passed to the `_bfd_link_add_symbols' function. The -`add_archive_element' callback has the option to indicate that it would -like to replace the element archive with a substitute BFD, in which -case it is the symbols of that substitute BFD that must be added to the -linker hash table instead. - - When the a.out `_bfd_link_add_symbols' function receives an archive, -it calls `_bfd_generic_link_add_archive_symbols' passing -`aout_link_check_archive_element' as the function argument. -`aout_link_check_archive_element' calls `aout_link_check_ar_symbols'. -If the latter decides to add the element (an element is only added if -it provides a real, non-common, definition for a previously undefined -or common symbol) it calls the `add_archive_element' callback and then -`aout_link_check_archive_element' calls `aout_link_add_symbols' to -actually add the symbols to the linker hash table - possibly those of a -substitute BFD, if the `add_archive_element' callback avails itself of -that option. - - The ECOFF back end is unusual in that it does not normally call -`_bfd_generic_link_add_archive_symbols', because ECOFF archives already -contain a hash table of symbols. The ECOFF back end searches the -archive itself to avoid the overhead of creating a new hash table. - - -File: bfd.info, Node: Performing the Final Link, Prev: Adding Symbols to the Hash Table, Up: Linker Functions - -2.17.3 Performing the final link --------------------------------- - -When all the input files have been processed, the linker calls the -`_bfd_final_link' entry point of the output BFD. This routine is -responsible for producing the final output file, which has several -aspects. It must relocate the contents of the input sections and copy -the data into the output sections. It must build an output symbol -table including any local symbols from the input files and the global -symbols from the hash table. When producing relocatable output, it must -modify the input relocs and write them into the output file. There may -also be object format dependent work to be done. - - The linker will also call the `write_object_contents' entry point -when the BFD is closed. The two entry points must work together in -order to produce the correct output file. - - The details of how this works are inevitably dependent upon the -specific object file format. The a.out `_bfd_final_link' routine is -`NAME(aout,final_link)'. - -* Menu: - -* Information provided by the linker:: -* Relocating the section contents:: -* Writing the symbol table:: - - -File: bfd.info, Node: Information provided by the linker, Next: Relocating the section contents, Prev: Performing the Final Link, Up: Performing the Final Link - -2.17.3.1 Information provided by the linker -........................................... - -Before the linker calls the `_bfd_final_link' entry point, it sets up -some data structures for the function to use. - - The `input_bfds' field of the `bfd_link_info' structure will point -to a list of all the input files included in the link. These files are -linked through the `link_next' field of the `bfd' structure. - - Each section in the output file will have a list of `link_order' -structures attached to the `map_head.link_order' field (the -`link_order' structure is defined in `bfdlink.h'). These structures -describe how to create the contents of the output section in terms of -the contents of various input sections, fill constants, and, -eventually, other types of information. They also describe relocs that -must be created by the BFD backend, but do not correspond to any input -file; this is used to support -Ur, which builds constructors while -generating a relocatable object file. - - -File: bfd.info, Node: Relocating the section contents, Next: Writing the symbol table, Prev: Information provided by the linker, Up: Performing the Final Link - -2.17.3.2 Relocating the section contents -........................................ - -The `_bfd_final_link' function should look through the `link_order' -structures attached to each section of the output file. Each -`link_order' structure should either be handled specially, or it should -be passed to the function `_bfd_default_link_order' which will do the -right thing (`_bfd_default_link_order' is defined in `linker.c'). - - For efficiency, a `link_order' of type `bfd_indirect_link_order' -whose associated section belongs to a BFD of the same format as the -output BFD must be handled specially. This type of `link_order' -describes part of an output section in terms of a section belonging to -one of the input files. The `_bfd_final_link' function should read the -contents of the section and any associated relocs, apply the relocs to -the section contents, and write out the modified section contents. If -performing a relocatable link, the relocs themselves must also be -modified and written out. - - The functions `_bfd_relocate_contents' and -`_bfd_final_link_relocate' provide some general support for performing -the actual relocations, notably overflow checking. Their arguments -include information about the symbol the relocation is against and a -`reloc_howto_type' argument which describes the relocation to perform. -These functions are defined in `reloc.c'. - - The a.out function which handles reading, relocating, and writing -section contents is `aout_link_input_section'. The actual relocation -is done in `aout_link_input_section_std' and -`aout_link_input_section_ext'. - - -File: bfd.info, Node: Writing the symbol table, Prev: Relocating the section contents, Up: Performing the Final Link - -2.17.3.3 Writing the symbol table -................................. - -The `_bfd_final_link' function must gather all the symbols in the input -files and write them out. It must also write out all the symbols in -the global hash table. This must be controlled by the `strip' and -`discard' fields of the `bfd_link_info' structure. - - The local symbols of the input files will not have been entered into -the linker hash table. The `_bfd_final_link' routine must consider -each input file and include the symbols in the output file. It may be -convenient to do this when looking through the `link_order' structures, -or it may be done by stepping through the `input_bfds' list. - - The `_bfd_final_link' routine must also traverse the global hash -table to gather all the externally visible symbols. It is possible -that most of the externally visible symbols may be written out when -considering the symbols of each input file, but it is still necessary -to traverse the hash table since the linker script may have defined -some symbols that are not in any of the input files. - - The `strip' field of the `bfd_link_info' structure controls which -symbols are written out. The possible values are listed in -`bfdlink.h'. If the value is `strip_some', then the `keep_hash' field -of the `bfd_link_info' structure is a hash table of symbols to keep; -each symbol should be looked up in this hash table, and only symbols -which are present should be included in the output file. - - If the `strip' field of the `bfd_link_info' structure permits local -symbols to be written out, the `discard' field is used to further -controls which local symbols are included in the output file. If the -value is `discard_l', then all local symbols which begin with a certain -prefix are discarded; this is controlled by the -`bfd_is_local_label_name' entry point. - - The a.out backend handles symbols by calling -`aout_link_write_symbols' on each input BFD and then traversing the -global hash table with the function `aout_link_write_other_symbol'. It -builds a string table while writing out the symbols, which is written -to the output file at the end of `NAME(aout,final_link)'. - -2.17.3.4 `bfd_link_split_section' -................................. - -*Synopsis* - bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); - *Description* -Return nonzero if SEC should be split during a reloceatable or final -link. - #define bfd_link_split_section(abfd, sec) \ - BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) - -2.17.3.5 `bfd_section_already_linked' -..................................... - -*Synopsis* - bfd_boolean bfd_section_already_linked (bfd *abfd, - asection *sec, - struct bfd_link_info *info); - *Description* -Check if DATA has been already linked during a reloceatable or final -link. Return TRUE if it has. - #define bfd_section_already_linked(abfd, sec, info) \ - BFD_SEND (abfd, _section_already_linked, (abfd, sec, info)) - -2.17.3.6 `bfd_generic_define_common_symbol' -........................................... - -*Synopsis* - bfd_boolean bfd_generic_define_common_symbol - (bfd *output_bfd, struct bfd_link_info *info, - struct bfd_link_hash_entry *h); - *Description* -Convert common symbol H into a defined symbol. Return TRUE on success -and FALSE on failure. - #define bfd_define_common_symbol(output_bfd, info, h) \ - BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) - -2.17.3.7 `bfd_find_version_for_sym' -................................... - -*Synopsis* - struct bfd_elf_version_tree * bfd_find_version_for_sym - (struct bfd_elf_version_tree *verdefs, - const char *sym_name, bfd_boolean *hide); - *Description* -Search an elf version script tree for symbol versioning info and export -/ don't-export status for a given symbol. Return non-NULL on success -and NULL on failure; also sets the output `hide' boolean parameter. - -2.17.3.8 `bfd_hide_sym_by_version' -.................................. - -*Synopsis* - bfd_boolean bfd_hide_sym_by_version - (struct bfd_elf_version_tree *verdefs, const char *sym_name); - *Description* -Search an elf version script tree for symbol versioning info for a -given symbol. Return TRUE if the symbol is hidden. - - -File: bfd.info, Node: Hash Tables, Prev: Linker Functions, Up: BFD front end - -2.18 Hash Tables -================ - -BFD provides a simple set of hash table functions. Routines are -provided to initialize a hash table, to free a hash table, to look up a -string in a hash table and optionally create an entry for it, and to -traverse a hash table. There is currently no routine to delete an -string from a hash table. - - The basic hash table does not permit any data to be stored with a -string. However, a hash table is designed to present a base class from -which other types of hash tables may be derived. These derived types -may store additional information with the string. Hash tables were -implemented in this way, rather than simply providing a data pointer in -a hash table entry, because they were designed for use by the linker -back ends. The linker may create thousands of hash table entries, and -the overhead of allocating private data and storing and following -pointers becomes noticeable. - - The basic hash table code is in `hash.c'. - -* Menu: - -* Creating and Freeing a Hash Table:: -* Looking Up or Entering a String:: -* Traversing a Hash Table:: -* Deriving a New Hash Table Type:: - - -File: bfd.info, Node: Creating and Freeing a Hash Table, Next: Looking Up or Entering a String, Prev: Hash Tables, Up: Hash Tables - -2.18.1 Creating and freeing a hash table ----------------------------------------- - -To create a hash table, create an instance of a `struct bfd_hash_table' -(defined in `bfd.h') and call `bfd_hash_table_init' (if you know -approximately how many entries you will need, the function -`bfd_hash_table_init_n', which takes a SIZE argument, may be used). -`bfd_hash_table_init' returns `FALSE' if some sort of error occurs. - - The function `bfd_hash_table_init' take as an argument a function to -use to create new entries. For a basic hash table, use the function -`bfd_hash_newfunc'. *Note Deriving a New Hash Table Type::, for why -you would want to use a different value for this argument. - - `bfd_hash_table_init' will create an objalloc which will be used to -allocate new entries. You may allocate memory on this objalloc using -`bfd_hash_allocate'. - - Use `bfd_hash_table_free' to free up all the memory that has been -allocated for a hash table. This will not free up the `struct -bfd_hash_table' itself, which you must provide. - - Use `bfd_hash_set_default_size' to set the default size of hash -table to use. - - -File: bfd.info, Node: Looking Up or Entering a String, Next: Traversing a Hash Table, Prev: Creating and Freeing a Hash Table, Up: Hash Tables - -2.18.2 Looking up or entering a string --------------------------------------- - -The function `bfd_hash_lookup' is used both to look up a string in the -hash table and to create a new entry. - - If the CREATE argument is `FALSE', `bfd_hash_lookup' will look up a -string. If the string is found, it will returns a pointer to a `struct -bfd_hash_entry'. If the string is not found in the table -`bfd_hash_lookup' will return `NULL'. You should not modify any of the -fields in the returns `struct bfd_hash_entry'. - - If the CREATE argument is `TRUE', the string will be entered into -the hash table if it is not already there. Either way a pointer to a -`struct bfd_hash_entry' will be returned, either to the existing -structure or to a newly created one. In this case, a `NULL' return -means that an error occurred. - - If the CREATE argument is `TRUE', and a new entry is created, the -COPY argument is used to decide whether to copy the string onto the -hash table objalloc or not. If COPY is passed as `FALSE', you must be -careful not to deallocate or modify the string as long as the hash table -exists. - - -File: bfd.info, Node: Traversing a Hash Table, Next: Deriving a New Hash Table Type, Prev: Looking Up or Entering a String, Up: Hash Tables - -2.18.3 Traversing a hash table ------------------------------- - -The function `bfd_hash_traverse' may be used to traverse a hash table, -calling a function on each element. The traversal is done in a random -order. - - `bfd_hash_traverse' takes as arguments a function and a generic -`void *' pointer. The function is called with a hash table entry (a -`struct bfd_hash_entry *') and the generic pointer passed to -`bfd_hash_traverse'. The function must return a `boolean' value, which -indicates whether to continue traversing the hash table. If the -function returns `FALSE', `bfd_hash_traverse' will stop the traversal -and return immediately. - - -File: bfd.info, Node: Deriving a New Hash Table Type, Prev: Traversing a Hash Table, Up: Hash Tables - -2.18.4 Deriving a new hash table type -------------------------------------- - -Many uses of hash tables want to store additional information which -each entry in the hash table. Some also find it convenient to store -additional information with the hash table itself. This may be done -using a derived hash table. - - Since C is not an object oriented language, creating a derived hash -table requires sticking together some boilerplate routines with a few -differences specific to the type of hash table you want to create. - - An example of a derived hash table is the linker hash table. The -structures for this are defined in `bfdlink.h'. The functions are in -`linker.c'. - - You may also derive a hash table from an already derived hash table. -For example, the a.out linker backend code uses a hash table derived -from the linker hash table. - -* Menu: - -* Define the Derived Structures:: -* Write the Derived Creation Routine:: -* Write Other Derived Routines:: - - -File: bfd.info, Node: Define the Derived Structures, Next: Write the Derived Creation Routine, Prev: Deriving a New Hash Table Type, Up: Deriving a New Hash Table Type - -2.18.4.1 Define the derived structures -...................................... - -You must define a structure for an entry in the hash table, and a -structure for the hash table itself. - - The first field in the structure for an entry in the hash table must -be of the type used for an entry in the hash table you are deriving -from. If you are deriving from a basic hash table this is `struct -bfd_hash_entry', which is defined in `bfd.h'. The first field in the -structure for the hash table itself must be of the type of the hash -table you are deriving from itself. If you are deriving from a basic -hash table, this is `struct bfd_hash_table'. - - For example, the linker hash table defines `struct -bfd_link_hash_entry' (in `bfdlink.h'). The first field, `root', is of -type `struct bfd_hash_entry'. Similarly, the first field in `struct -bfd_link_hash_table', `table', is of type `struct bfd_hash_table'. - - -File: bfd.info, Node: Write the Derived Creation Routine, Next: Write Other Derived Routines, Prev: Define the Derived Structures, Up: Deriving a New Hash Table Type - -2.18.4.2 Write the derived creation routine -........................................... - -You must write a routine which will create and initialize an entry in -the hash table. This routine is passed as the function argument to -`bfd_hash_table_init'. - - In order to permit other hash tables to be derived from the hash -table you are creating, this routine must be written in a standard way. - - The first argument to the creation routine is a pointer to a hash -table entry. This may be `NULL', in which case the routine should -allocate the right amount of space. Otherwise the space has already -been allocated by a hash table type derived from this one. - - After allocating space, the creation routine must call the creation -routine of the hash table type it is derived from, passing in a pointer -to the space it just allocated. This will initialize any fields used -by the base hash table. - - Finally the creation routine must initialize any local fields for -the new hash table type. - - Here is a boilerplate example of a creation routine. FUNCTION_NAME -is the name of the routine. ENTRY_TYPE is the type of an entry in the -hash table you are creating. BASE_NEWFUNC is the name of the creation -routine of the hash table type your hash table is derived from. - - struct bfd_hash_entry * - FUNCTION_NAME (struct bfd_hash_entry *entry, - struct bfd_hash_table *table, - const char *string) - { - struct ENTRY_TYPE *ret = (ENTRY_TYPE *) entry; - - /* Allocate the structure if it has not already been allocated by a - derived class. */ - if (ret == NULL) - { - ret = bfd_hash_allocate (table, sizeof (* ret)); - if (ret == NULL) - return NULL; - } - - /* Call the allocation method of the base class. */ - ret = ((ENTRY_TYPE *) - BASE_NEWFUNC ((struct bfd_hash_entry *) ret, table, string)); - - /* Initialize the local fields here. */ - - return (struct bfd_hash_entry *) ret; - } - *Description* -The creation routine for the linker hash table, which is in `linker.c', -looks just like this example. FUNCTION_NAME is -`_bfd_link_hash_newfunc'. ENTRY_TYPE is `struct bfd_link_hash_entry'. -BASE_NEWFUNC is `bfd_hash_newfunc', the creation routine for a basic -hash table. - - `_bfd_link_hash_newfunc' also initializes the local fields in a -linker hash table entry: `type', `written' and `next'. - - -File: bfd.info, Node: Write Other Derived Routines, Prev: Write the Derived Creation Routine, Up: Deriving a New Hash Table Type - -2.18.4.3 Write other derived routines -..................................... - -You will want to write other routines for your new hash table, as well. - - You will want an initialization routine which calls the -initialization routine of the hash table you are deriving from and -initializes any other local fields. For the linker hash table, this is -`_bfd_link_hash_table_init' in `linker.c'. - - You will want a lookup routine which calls the lookup routine of the -hash table you are deriving from and casts the result. The linker hash -table uses `bfd_link_hash_lookup' in `linker.c' (this actually takes an -additional argument which it uses to decide how to return the looked up -value). - - You may want a traversal routine. This should just call the -traversal routine of the hash table you are deriving from with -appropriate casts. The linker hash table uses `bfd_link_hash_traverse' -in `linker.c'. - - These routines may simply be defined as macros. For example, the -a.out backend linker hash table, which is derived from the linker hash -table, uses macros for the lookup and traversal routines. These are -`aout_link_hash_lookup' and `aout_link_hash_traverse' in aoutx.h. - - -File: bfd.info, Node: BFD back ends, Next: GNU Free Documentation License, Prev: BFD front end, Up: Top - -3 BFD back ends -*************** - -* Menu: - -* What to Put Where:: -* aout :: a.out backends -* coff :: coff backends -* elf :: elf backends -* mmo :: mmo backend - - -File: bfd.info, Node: What to Put Where, Next: aout, Prev: BFD back ends, Up: BFD back ends - -3.1 What to Put Where -===================== - -All of BFD lives in one directory. - - -File: bfd.info, Node: aout, Next: coff, Prev: What to Put Where, Up: BFD back ends - -3.2 a.out backends -================== - -*Description* -BFD supports a number of different flavours of a.out format, though the -major differences are only the sizes of the structures on disk, and the -shape of the relocation information. - - The support is split into a basic support file `aoutx.h' and other -files which derive functions from the base. One derivation file is -`aoutf1.h' (for a.out flavour 1), and adds to the basic a.out functions -support for sun3, sun4, 386 and 29k a.out files, to create a target -jump vector for a specific target. - - This information is further split out into more specific files for -each machine, including `sunos.c' for sun3 and sun4, `newsos3.c' for -the Sony NEWS, and `demo64.c' for a demonstration of a 64 bit a.out -format. - - The base file `aoutx.h' defines general mechanisms for reading and -writing records to and from disk and various other methods which BFD -requires. It is included by `aout32.c' and `aout64.c' to form the names -`aout_32_swap_exec_header_in', `aout_64_swap_exec_header_in', etc. - - As an example, this is what goes on to make the back end for a sun4, -from `aout32.c': - - #define ARCH_SIZE 32 - #include "aoutx.h" - - Which exports names: - - ... - aout_32_canonicalize_reloc - aout_32_find_nearest_line - aout_32_get_lineno - aout_32_get_reloc_upper_bound - ... - - from `sunos.c': - - #define TARGET_NAME "a.out-sunos-big" - #define VECNAME sunos_big_vec - #include "aoutf1.h" - - requires all the names from `aout32.c', and produces the jump vector - - sunos_big_vec - - The file `host-aout.c' is a special case. It is for a large set of -hosts that use "more or less standard" a.out files, and for which -cross-debugging is not interesting. It uses the standard 32-bit a.out -support routines, but determines the file offsets and addresses of the -text, data, and BSS sections, the machine architecture and machine -type, and the entry point address, in a host-dependent manner. Once -these values have been determined, generic code is used to handle the -object file. - - When porting it to run on a new system, you must supply: - - HOST_PAGE_SIZE - HOST_SEGMENT_SIZE - HOST_MACHINE_ARCH (optional) - HOST_MACHINE_MACHINE (optional) - HOST_TEXT_START_ADDR - HOST_STACK_END_ADDR - - in the file `../include/sys/h-XXX.h' (for your host). These values, -plus the structures and macros defined in `a.out.h' on your host -system, will produce a BFD target that will access ordinary a.out files -on your host. To configure a new machine to use `host-aout.c', specify: - - TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec - TDEPFILES= host-aout.o trad-core.o - - in the `config/XXX.mt' file, and modify `configure.in' to use the -`XXX.mt' file (by setting "`bfd_target=XXX'") when your configuration -is selected. - -3.2.1 Relocations ------------------ - -*Description* -The file `aoutx.h' provides for both the _standard_ and _extended_ -forms of a.out relocation records. - - The standard records contain only an address, a symbol index, and a -type field. The extended records (used on 29ks and sparcs) also have a -full integer for an addend. - -3.2.2 Internal entry points ---------------------------- - -*Description* -`aoutx.h' exports several routines for accessing the contents of an -a.out file, which are gathered and exported in turn by various format -specific files (eg sunos.c). - -3.2.2.1 `aout_SIZE_swap_exec_header_in' -....................................... - -*Synopsis* - void aout_SIZE_swap_exec_header_in, - (bfd *abfd, - struct external_exec *bytes, - struct internal_exec *execp); - *Description* -Swap the information in an executable header RAW_BYTES taken from a raw -byte stream memory image into the internal exec header structure EXECP. - -3.2.2.2 `aout_SIZE_swap_exec_header_out' -........................................ - -*Synopsis* - void aout_SIZE_swap_exec_header_out - (bfd *abfd, - struct internal_exec *execp, - struct external_exec *raw_bytes); - *Description* -Swap the information in an internal exec header structure EXECP into -the buffer RAW_BYTES ready for writing to disk. - -3.2.2.3 `aout_SIZE_some_aout_object_p' -...................................... - -*Synopsis* - const bfd_target *aout_SIZE_some_aout_object_p - (bfd *abfd, - struct internal_exec *execp, - const bfd_target *(*callback_to_real_object_p) (bfd *)); - *Description* -Some a.out variant thinks that the file open in ABFD checking is an -a.out file. Do some more checking, and set up for access if it really -is. Call back to the calling environment's "finish up" function just -before returning, to handle any last-minute setup. - -3.2.2.4 `aout_SIZE_mkobject' -............................ - -*Synopsis* - bfd_boolean aout_SIZE_mkobject, (bfd *abfd); - *Description* -Initialize BFD ABFD for use with a.out files. - -3.2.2.5 `aout_SIZE_machine_type' -................................ - -*Synopsis* - enum machine_type aout_SIZE_machine_type - (enum bfd_architecture arch, - unsigned long machine, - bfd_boolean *unknown); - *Description* -Keep track of machine architecture and machine type for a.out's. Return -the `machine_type' for a particular architecture and machine, or -`M_UNKNOWN' if that exact architecture and machine can't be represented -in a.out format. - - If the architecture is understood, machine type 0 (default) is -always understood. - -3.2.2.6 `aout_SIZE_set_arch_mach' -................................. - -*Synopsis* - bfd_boolean aout_SIZE_set_arch_mach, - (bfd *, - enum bfd_architecture arch, - unsigned long machine); - *Description* -Set the architecture and the machine of the BFD ABFD to the values ARCH -and MACHINE. Verify that ABFD's format can support the architecture -required. - -3.2.2.7 `aout_SIZE_new_section_hook' -.................................... - -*Synopsis* - bfd_boolean aout_SIZE_new_section_hook, - (bfd *abfd, - asection *newsect); - *Description* -Called by the BFD in response to a `bfd_make_section' request. - - -File: bfd.info, Node: coff, Next: elf, Prev: aout, Up: BFD back ends - -3.3 coff backends -================= - -BFD supports a number of different flavours of coff format. The major -differences between formats are the sizes and alignments of fields in -structures on disk, and the occasional extra field. - - Coff in all its varieties is implemented with a few common files and -a number of implementation specific files. For example, The 88k bcs -coff format is implemented in the file `coff-m88k.c'. This file -`#include's `coff/m88k.h' which defines the external structure of the -coff format for the 88k, and `coff/internal.h' which defines the -internal structure. `coff-m88k.c' also defines the relocations used by -the 88k format *Note Relocations::. - - The Intel i960 processor version of coff is implemented in -`coff-i960.c'. This file has the same structure as `coff-m88k.c', -except that it includes `coff/i960.h' rather than `coff-m88k.h'. - -3.3.1 Porting to a new version of coff --------------------------------------- - -The recommended method is to select from the existing implementations -the version of coff which is most like the one you want to use. For -example, we'll say that i386 coff is the one you select, and that your -coff flavour is called foo. Copy `i386coff.c' to `foocoff.c', copy -`../include/coff/i386.h' to `../include/coff/foo.h', and add the lines -to `targets.c' and `Makefile.in' so that your new back end is used. -Alter the shapes of the structures in `../include/coff/foo.h' so that -they match what you need. You will probably also have to add `#ifdef's -to the code in `coff/internal.h' and `coffcode.h' if your version of -coff is too wild. - - You can verify that your new BFD backend works quite simply by -building `objdump' from the `binutils' directory, and making sure that -its version of what's going on and your host system's idea (assuming it -has the pretty standard coff dump utility, usually called `att-dump' or -just `dump') are the same. Then clean up your code, and send what -you've done to Cygnus. Then your stuff will be in the next release, and -you won't have to keep integrating it. - -3.3.2 How the coff backend works --------------------------------- - -3.3.2.1 File layout -................... - -The Coff backend is split into generic routines that are applicable to -any Coff target and routines that are specific to a particular target. -The target-specific routines are further split into ones which are -basically the same for all Coff targets except that they use the -external symbol format or use different values for certain constants. - - The generic routines are in `coffgen.c'. These routines work for -any Coff target. They use some hooks into the target specific code; -the hooks are in a `bfd_coff_backend_data' structure, one of which -exists for each target. - - The essentially similar target-specific routines are in -`coffcode.h'. This header file includes executable C code. The -various Coff targets first include the appropriate Coff header file, -make any special defines that are needed, and then include `coffcode.h'. - - Some of the Coff targets then also have additional routines in the -target source file itself. - - For example, `coff-i960.c' includes `coff/internal.h' and -`coff/i960.h'. It then defines a few constants, such as `I960', and -includes `coffcode.h'. Since the i960 has complex relocation types, -`coff-i960.c' also includes some code to manipulate the i960 relocs. -This code is not in `coffcode.h' because it would not be used by any -other target. - -3.3.2.2 Coff long section names -............................... - -In the standard Coff object format, section names are limited to the -eight bytes available in the `s_name' field of the `SCNHDR' section -header structure. The format requires the field to be NUL-padded, but -not necessarily NUL-terminated, so the longest section names permitted -are a full eight characters. - - The Microsoft PE variants of the Coff object file format add an -extension to support the use of long section names. This extension is -defined in section 4 of the Microsoft PE/COFF specification (rev 8.1). -If a section name is too long to fit into the section header's `s_name' -field, it is instead placed into the string table, and the `s_name' -field is filled with a slash ("/") followed by the ASCII decimal -representation of the offset of the full name relative to the string -table base. - - Note that this implies that the extension can only be used in object -files, as executables do not contain a string table. The standard -specifies that long section names from objects emitted into executable -images are to be truncated. - - However, as a GNU extension, BFD can generate executable images that -contain a string table and long section names. This would appear to be -technically valid, as the standard only says that Coff debugging -information is deprecated, not forbidden, and in practice it works, -although some tools that parse PE files expecting the MS standard -format may become confused; `PEview' is one known example. - - The functionality is supported in BFD by code implemented under the -control of the macro `COFF_LONG_SECTION_NAMES'. If not defined, the -format does not support long section names in any way. If defined, it -is used to initialise a flag, `_bfd_coff_long_section_names', and a -hook function pointer, `_bfd_coff_set_long_section_names', in the Coff -backend data structure. The flag controls the generation of long -section names in output BFDs at runtime; if it is false, as it will be -by default when generating an executable image, long section names are -truncated; if true, the long section names extension is employed. The -hook points to a function that allows the value of the flag to be -altered at runtime, on formats that support long section names at all; -on other formats it points to a stub that returns an error indication. - - With input BFDs, the flag is set according to whether any long -section names are detected while reading the section headers. For a -completely new BFD, the flag is set to the default for the target -format. This information can be used by a client of the BFD library -when deciding what output format to generate, and means that a BFD that -is opened for read and subsequently converted to a writeable BFD and -modified in-place will retain whatever format it had on input. - - If `COFF_LONG_SECTION_NAMES' is simply defined (blank), or is -defined to the value "1", then long section names are enabled by -default; if it is defined to the value zero, they are disabled by -default (but still accepted in input BFDs). The header `coffcode.h' -defines a macro, `COFF_DEFAULT_LONG_SECTION_NAMES', which is used in -the backends to initialise the backend data structure fields -appropriately; see the comments for further detail. - -3.3.2.3 Bit twiddling -..................... - -Each flavour of coff supported in BFD has its own header file -describing the external layout of the structures. There is also an -internal description of the coff layout, in `coff/internal.h'. A major -function of the coff backend is swapping the bytes and twiddling the -bits to translate the external form of the structures into the normal -internal form. This is all performed in the `bfd_swap'_thing_direction -routines. Some elements are different sizes between different versions -of coff; it is the duty of the coff version specific include file to -override the definitions of various packing routines in `coffcode.h'. -E.g., the size of line number entry in coff is sometimes 16 bits, and -sometimes 32 bits. `#define'ing `PUT_LNSZ_LNNO' and `GET_LNSZ_LNNO' -will select the correct one. No doubt, some day someone will find a -version of coff which has a varying field size not catered to at the -moment. To port BFD, that person will have to add more `#defines'. -Three of the bit twiddling routines are exported to `gdb'; -`coff_swap_aux_in', `coff_swap_sym_in' and `coff_swap_lineno_in'. `GDB' -reads the symbol table on its own, but uses BFD to fix things up. More -of the bit twiddlers are exported for `gas'; `coff_swap_aux_out', -`coff_swap_sym_out', `coff_swap_lineno_out', `coff_swap_reloc_out', -`coff_swap_filehdr_out', `coff_swap_aouthdr_out', -`coff_swap_scnhdr_out'. `Gas' currently keeps track of all the symbol -table and reloc drudgery itself, thereby saving the internal BFD -overhead, but uses BFD to swap things on the way out, making cross -ports much safer. Doing so also allows BFD (and thus the linker) to -use the same header files as `gas', which makes one avenue to disaster -disappear. - -3.3.2.4 Symbol reading -...................... - -The simple canonical form for symbols used by BFD is not rich enough to -keep all the information available in a coff symbol table. The back end -gets around this problem by keeping the original symbol table around, -"behind the scenes". - - When a symbol table is requested (through a call to -`bfd_canonicalize_symtab'), a request gets through to -`coff_get_normalized_symtab'. This reads the symbol table from the coff -file and swaps all the structures inside into the internal form. It -also fixes up all the pointers in the table (represented in the file by -offsets from the first symbol in the table) into physical pointers to -elements in the new internal table. This involves some work since the -meanings of fields change depending upon context: a field that is a -pointer to another structure in the symbol table at one moment may be -the size in bytes of a structure at the next. Another pass is made -over the table. All symbols which mark file names (`C_FILE' symbols) -are modified so that the internal string points to the value in the -auxent (the real filename) rather than the normal text associated with -the symbol (`".file"'). - - At this time the symbol names are moved around. Coff stores all -symbols less than nine characters long physically within the symbol -table; longer strings are kept at the end of the file in the string -table. This pass moves all strings into memory and replaces them with -pointers to the strings. - - The symbol table is massaged once again, this time to create the -canonical table used by the BFD application. Each symbol is inspected -in turn, and a decision made (using the `sclass' field) about the -various flags to set in the `asymbol'. *Note Symbols::. The generated -canonical table shares strings with the hidden internal symbol table. - - Any linenumbers are read from the coff file too, and attached to the -symbols which own the functions the linenumbers belong to. - -3.3.2.5 Symbol writing -...................... - -Writing a symbol to a coff file which didn't come from a coff file will -lose any debugging information. The `asymbol' structure remembers the -BFD from which the symbol was taken, and on output the back end makes -sure that the same destination target as source target is present. - - When the symbols have come from a coff file then all the debugging -information is preserved. - - Symbol tables are provided for writing to the back end in a vector -of pointers to pointers. This allows applications like the linker to -accumulate and output large symbol tables without having to do too much -byte copying. - - This function runs through the provided symbol table and patches -each symbol marked as a file place holder (`C_FILE') to point to the -next file place holder in the list. It also marks each `offset' field -in the list with the offset from the first symbol of the current symbol. - - Another function of this procedure is to turn the canonical value -form of BFD into the form used by coff. Internally, BFD expects symbol -values to be offsets from a section base; so a symbol physically at -0x120, but in a section starting at 0x100, would have the value 0x20. -Coff expects symbols to contain their final value, so symbols have -their values changed at this point to reflect their sum with their -owning section. This transformation uses the `output_section' field of -the `asymbol''s `asection' *Note Sections::. - - * `coff_mangle_symbols' - This routine runs though the provided symbol table and uses the -offsets generated by the previous pass and the pointers generated when -the symbol table was read in to create the structured hierarchy -required by coff. It changes each pointer to a symbol into the index -into the symbol table of the asymbol. - - * `coff_write_symbols' - This routine runs through the symbol table and patches up the -symbols from their internal form into the coff way, calls the bit -twiddlers, and writes out the table to the file. - -3.3.2.6 `coff_symbol_type' -.......................... - -*Description* -The hidden information for an `asymbol' is described in a -`combined_entry_type': - - - typedef struct coff_ptr_struct - { - /* Remembers the offset from the first symbol in the file for - this symbol. Generated by coff_renumber_symbols. */ - unsigned int offset; - - /* Should the value of this symbol be renumbered. Used for - XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ - unsigned int fix_value : 1; - - /* Should the tag field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_tag : 1; - - /* Should the endidx field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_end : 1; - - /* Should the x_csect.x_scnlen field be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_scnlen : 1; - - /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the - index into the line number entries. Set by coff_slurp_symbol_table. */ - unsigned int fix_line : 1; - - /* The container for the symbol structure as read and translated - from the file. */ - union - { - union internal_auxent auxent; - struct internal_syment syment; - } u; - } combined_entry_type; - - - /* Each canonical asymbol really looks like this: */ - - typedef struct coff_symbol_struct - { - /* The actual symbol which the rest of BFD works with */ - asymbol symbol; - - /* A pointer to the hidden information for this symbol */ - combined_entry_type *native; - - /* A pointer to the linenumber information for this symbol */ - struct lineno_cache_entry *lineno; - - /* Have the line numbers been relocated yet ? */ - bfd_boolean done_lineno; - } coff_symbol_type; - -3.3.2.7 `bfd_coff_backend_data' -............................... - - /* COFF symbol classifications. */ - - enum coff_symbol_classification - { - /* Global symbol. */ - COFF_SYMBOL_GLOBAL, - /* Common symbol. */ - COFF_SYMBOL_COMMON, - /* Undefined symbol. */ - COFF_SYMBOL_UNDEFINED, - /* Local symbol. */ - COFF_SYMBOL_LOCAL, - /* PE section symbol. */ - COFF_SYMBOL_PE_SECTION - }; -Special entry points for gdb to swap in coff symbol table parts: - typedef struct - { - void (*_bfd_coff_swap_aux_in) - (bfd *, void *, int, int, int, int, void *); - - void (*_bfd_coff_swap_sym_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_lineno_in) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_aux_out) - (bfd *, void *, int, int, int, int, void *); - - unsigned int (*_bfd_coff_swap_sym_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_lineno_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_reloc_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_filehdr_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_aouthdr_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_scnhdr_out) - (bfd *, void *, void *); - - unsigned int _bfd_filhsz; - unsigned int _bfd_aoutsz; - unsigned int _bfd_scnhsz; - unsigned int _bfd_symesz; - unsigned int _bfd_auxesz; - unsigned int _bfd_relsz; - unsigned int _bfd_linesz; - unsigned int _bfd_filnmlen; - bfd_boolean _bfd_coff_long_filenames; - - bfd_boolean _bfd_coff_long_section_names; - bfd_boolean (*_bfd_coff_set_long_section_names) - (bfd *, int); - - unsigned int _bfd_coff_default_section_alignment_power; - bfd_boolean _bfd_coff_force_symnames_in_strings; - unsigned int _bfd_coff_debug_string_prefix_length; - - void (*_bfd_coff_swap_filehdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_aouthdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_scnhdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_reloc_in) - (bfd *abfd, void *, void *); - - bfd_boolean (*_bfd_coff_bad_format_hook) - (bfd *, void *); - - bfd_boolean (*_bfd_coff_set_arch_mach_hook) - (bfd *, void *); - - void * (*_bfd_coff_mkobject_hook) - (bfd *, void *, void *); - - bfd_boolean (*_bfd_styp_to_sec_flags_hook) - (bfd *, void *, const char *, asection *, flagword *); - - void (*_bfd_set_alignment_hook) - (bfd *, asection *, void *); - - bfd_boolean (*_bfd_coff_slurp_symbol_table) - (bfd *); - - bfd_boolean (*_bfd_coff_symname_in_debug) - (bfd *, struct internal_syment *); - - bfd_boolean (*_bfd_coff_pointerize_aux_hook) - (bfd *, combined_entry_type *, combined_entry_type *, - unsigned int, combined_entry_type *); - - bfd_boolean (*_bfd_coff_print_aux) - (bfd *, FILE *, combined_entry_type *, combined_entry_type *, - combined_entry_type *, unsigned int); - - void (*_bfd_coff_reloc16_extra_cases) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, - bfd_byte *, unsigned int *, unsigned int *); - - int (*_bfd_coff_reloc16_estimate) - (bfd *, asection *, arelent *, unsigned int, - struct bfd_link_info *); - - enum coff_symbol_classification (*_bfd_coff_classify_symbol) - (bfd *, struct internal_syment *); - - bfd_boolean (*_bfd_coff_compute_section_file_positions) - (bfd *); - - bfd_boolean (*_bfd_coff_start_final_link) - (bfd *, struct bfd_link_info *); - - bfd_boolean (*_bfd_coff_relocate_section) - (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - struct internal_reloc *, struct internal_syment *, asection **); - - reloc_howto_type *(*_bfd_coff_rtype_to_howto) - (bfd *, asection *, struct internal_reloc *, - struct coff_link_hash_entry *, struct internal_syment *, - bfd_vma *); - - bfd_boolean (*_bfd_coff_adjust_symndx) - (bfd *, struct bfd_link_info *, bfd *, asection *, - struct internal_reloc *, bfd_boolean *); - - bfd_boolean (*_bfd_coff_link_add_one_symbol) - (struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, - struct bfd_link_hash_entry **); - - bfd_boolean (*_bfd_coff_link_output_has_begun) - (bfd *, struct coff_final_link_info *); - - bfd_boolean (*_bfd_coff_final_link_postscript) - (bfd *, struct coff_final_link_info *); - - bfd_boolean (*_bfd_coff_print_pdata) - (bfd *, void *); - - } bfd_coff_backend_data; - - #define coff_backend_info(abfd) \ - ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) - - #define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) - - #define bfd_coff_swap_sym_in(a,e,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) - - #define bfd_coff_swap_lineno_in(a,e,i) \ - ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) - - #define bfd_coff_swap_reloc_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) - - #define bfd_coff_swap_lineno_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) - - #define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) - - #define bfd_coff_swap_sym_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) - - #define bfd_coff_swap_scnhdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) - - #define bfd_coff_swap_filehdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) - - #define bfd_coff_swap_aouthdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) - - #define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) - #define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz) - #define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz) - #define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz) - #define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz) - #define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz) - #define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) - #define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen) - #define bfd_coff_long_filenames(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_filenames) - #define bfd_coff_long_section_names(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_section_names) - #define bfd_coff_set_long_section_names(abfd, enable) \ - ((coff_backend_info (abfd)->_bfd_coff_set_long_section_names) (abfd, enable)) - #define bfd_coff_default_section_alignment_power(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power) - #define bfd_coff_swap_filehdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) - - #define bfd_coff_swap_aouthdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) - - #define bfd_coff_swap_scnhdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) - - #define bfd_coff_swap_reloc_in(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) - - #define bfd_coff_bad_format_hook(abfd, filehdr) \ - ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) - - #define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ - ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) - #define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ - ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\ - (abfd, filehdr, aouthdr)) - - #define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ - ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ - (abfd, scnhdr, name, section, flags_ptr)) - - #define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ - ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) - - #define bfd_coff_slurp_symbol_table(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) - - #define bfd_coff_symname_in_debug(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) - - #define bfd_coff_force_symnames_in_strings(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) - - #define bfd_coff_debug_string_prefix_length(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) - - #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ - ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ - (abfd, file, base, symbol, aux, indaux)) - - #define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\ - reloc, data, src_ptr, dst_ptr)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ - (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) - - #define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ - (abfd, section, reloc, shrink, link_info)) - - #define bfd_coff_classify_symbol(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ - (abfd, sym)) - - #define bfd_coff_compute_section_file_positions(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ - (abfd)) - - #define bfd_coff_start_final_link(obfd, info)\ - ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ - (obfd, info)) - #define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ - ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ - (obfd, info, ibfd, o, con, rel, isyms, secs)) - #define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ - ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ - (abfd, sec, rel, h, sym, addendp)) - #define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ - ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ - (obfd, info, ibfd, sec, rel, adjustedp)) - #define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\ - value, string, cp, coll, hashp)\ - ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ - (info, abfd, name, flags, section, value, string, cp, coll, hashp)) - - #define bfd_coff_link_output_has_begun(a,p) \ - ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a, p)) - #define bfd_coff_final_link_postscript(a,p) \ - ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a, p)) - - #define bfd_coff_have_print_pdata(a) \ - (coff_backend_info (a)->_bfd_coff_print_pdata) - #define bfd_coff_print_pdata(a,p) \ - ((coff_backend_info (a)->_bfd_coff_print_pdata) (a, p)) - - /* Macro: Returns true if the bfd is a PE executable as opposed to a - PE object file. */ - #define bfd_pei_p(abfd) \ - (CONST_STRNEQ ((abfd)->xvec->name, "pei-")) - -3.3.2.8 Writing relocations -........................... - -To write relocations, the back end steps though the canonical -relocation table and create an `internal_reloc'. The symbol index to -use is removed from the `offset' field in the symbol table supplied. -The address comes directly from the sum of the section base address and -the relocation offset; the type is dug directly from the howto field. -Then the `internal_reloc' is swapped into the shape of an -`external_reloc' and written out to disk. - -3.3.2.9 Reading linenumbers -........................... - -Creating the linenumber table is done by reading in the entire coff -linenumber table, and creating another table for internal use. - - A coff linenumber table is structured so that each function is -marked as having a line number of 0. Each line within the function is -an offset from the first line in the function. The base of the line -number information for the table is stored in the symbol associated -with the function. - - Note: The PE format uses line number 0 for a flag indicating a new -source file. - - The information is copied from the external to the internal table, -and each symbol which marks a function is marked by pointing its... - - How does this work ? - -3.3.2.10 Reading relocations -............................ - -Coff relocations are easily transformed into the internal BFD form -(`arelent'). - - Reading a coff relocation table is done in the following stages: - - * Read the entire coff relocation table into memory. - - * Process each relocation in turn; first swap it from the external - to the internal form. - - * Turn the symbol referenced in the relocation's symbol index into a - pointer into the canonical symbol table. This table is the same - as the one returned by a call to `bfd_canonicalize_symtab'. The - back end will call that routine and save the result if a - canonicalization hasn't been done. - - * The reloc index is turned into a pointer to a howto structure, in - a back end specific way. For instance, the 386 and 960 use the - `r_type' to directly produce an index into a howto table vector; - the 88k subtracts a number from the `r_type' field and creates an - addend field. - - -File: bfd.info, Node: elf, Next: mmo, Prev: coff, Up: BFD back ends - -3.4 ELF backends -================ - -BFD support for ELF formats is being worked on. Currently, the best -supported back ends are for sparc and i386 (running svr4 or Solaris 2). - - Documentation of the internals of the support code still needs to be -written. The code is changing quickly enough that we haven't bothered -yet. - - -File: bfd.info, Node: mmo, Prev: elf, Up: BFD back ends - -3.5 mmo backend -=============== - -The mmo object format is used exclusively together with Professor -Donald E. Knuth's educational 64-bit processor MMIX. The simulator -`mmix' which is available at -`http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz' -understands this format. That package also includes a combined -assembler and linker called `mmixal'. The mmo format has no advantages -feature-wise compared to e.g. ELF. It is a simple non-relocatable -object format with no support for archives or debugging information, -except for symbol value information and line numbers (which is not yet -implemented in BFD). See -`http://www-cs-faculty.stanford.edu/~knuth/mmix.html' for more -information about MMIX. The ELF format is used for intermediate object -files in the BFD implementation. - -* Menu: - -* File layout:: -* Symbol-table:: -* mmo section mapping:: - - -File: bfd.info, Node: File layout, Next: Symbol-table, Prev: mmo, Up: mmo - -3.5.1 File layout ------------------ - -The mmo file contents is not partitioned into named sections as with -e.g. ELF. Memory areas is formed by specifying the location of the -data that follows. Only the memory area `0x0000...00' to `0x01ff...ff' -is executable, so it is used for code (and constants) and the area -`0x2000...00' to `0x20ff...ff' is used for writable data. *Note mmo -section mapping::. - - There is provision for specifying "special data" of 65536 different -types. We use type 80 (decimal), arbitrarily chosen the same as the -ELF `e_machine' number for MMIX, filling it with section information -normally found in ELF objects. *Note mmo section mapping::. - - Contents is entered as 32-bit words, xor:ed over previous contents, -always zero-initialized. A word that starts with the byte `0x98' forms -a command called a `lopcode', where the next byte distinguished between -the thirteen lopcodes. The two remaining bytes, called the `Y' and `Z' -fields, or the `YZ' field (a 16-bit big-endian number), are used for -various purposes different for each lopcode. As documented in -`http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz', the -lopcodes are: - -`lop_quote' - 0x98000001. The next word is contents, regardless of whether it - starts with 0x98 or not. - -`lop_loc' - 0x9801YYZZ, where `Z' is 1 or 2. This is a location directive, - setting the location for the next data to the next 32-bit word - (for Z = 1) or 64-bit word (for Z = 2), plus Y * 2^56. Normally - `Y' is 0 for the text segment and 2 for the data segment. - -`lop_skip' - 0x9802YYZZ. Increase the current location by `YZ' bytes. - -`lop_fixo' - 0x9803YYZZ, where `Z' is 1 or 2. Store the current location as 64 - bits into the location pointed to by the next 32-bit (Z = 1) or - 64-bit (Z = 2) word, plus Y * 2^56. - -`lop_fixr' - 0x9804YYZZ. `YZ' is stored into the current location plus 2 - 4 * - YZ. - -`lop_fixrx' - 0x980500ZZ. `Z' is 16 or 24. A value `L' derived from the - following 32-bit word are used in a manner similar to `YZ' in - lop_fixr: it is xor:ed into the current location minus 4 * L. The - first byte of the word is 0 or 1. If it is 1, then L = (LOWEST 24 - BITS OF WORD) - 2^Z, if 0, then L = (LOWEST 24 BITS OF WORD). - -`lop_file' - 0x9806YYZZ. `Y' is the file number, `Z' is count of 32-bit words. - Set the file number to `Y' and the line counter to 0. The next Z - * 4 bytes contain the file name, padded with zeros if the count is - not a multiple of four. The same `Y' may occur multiple times, - but `Z' must be 0 for all but the first occurrence. - -`lop_line' - 0x9807YYZZ. `YZ' is the line number. Together with lop_file, it - forms the source location for the next 32-bit word. Note that for - each non-lopcode 32-bit word, line numbers are assumed incremented - by one. - -`lop_spec' - 0x9808YYZZ. `YZ' is the type number. Data until the next lopcode - other than lop_quote forms special data of type `YZ'. *Note mmo - section mapping::. - - Other types than 80, (or type 80 with a content that does not - parse) is stored in sections named `.MMIX.spec_data.N' where N is - the `YZ'-type. The flags for such a sections say not to allocate - or load the data. The vma is 0. Contents of multiple occurrences - of special data N is concatenated to the data of the previous - lop_spec Ns. The location in data or code at which the lop_spec - occurred is lost. - -`lop_pre' - 0x980901ZZ. The first lopcode in a file. The `Z' field forms the - length of header information in 32-bit words, where the first word - tells the time in seconds since `00:00:00 GMT Jan 1 1970'. - -`lop_post' - 0x980a00ZZ. Z > 32. This lopcode follows after all - content-generating lopcodes in a program. The `Z' field denotes - the value of `rG' at the beginning of the program. The following - 256 - Z big-endian 64-bit words are loaded into global registers - `$G' ... `$255'. - -`lop_stab' - 0x980b0000. The next-to-last lopcode in a program. Must follow - immediately after the lop_post lopcode and its data. After this - lopcode follows all symbols in a compressed format (*note - Symbol-table::). - -`lop_end' - 0x980cYYZZ. The last lopcode in a program. It must follow the - lop_stab lopcode and its data. The `YZ' field contains the number - of 32-bit words of symbol table information after the preceding - lop_stab lopcode. - - Note that the lopcode "fixups"; `lop_fixr', `lop_fixrx' and -`lop_fixo' are not generated by BFD, but are handled. They are -generated by `mmixal'. - - This trivial one-label, one-instruction file: - - :Main TRAP 1,2,3 - - can be represented this way in mmo: - - 0x98090101 - lop_pre, one 32-bit word with timestamp. - - 0x98010002 - lop_loc, text segment, using a 64-bit address. - Note that mmixal does not emit this for the file above. - 0x00000000 - Address, high 32 bits. - 0x00000000 - Address, low 32 bits. - 0x98060002 - lop_file, 2 32-bit words for file-name. - 0x74657374 - "test" - 0x2e730000 - ".s\0\0" - 0x98070001 - lop_line, line 1. - 0x00010203 - TRAP 1,2,3 - 0x980a00ff - lop_post, setting $255 to 0. - 0x00000000 - 0x00000000 - 0x980b0000 - lop_stab for ":Main" = 0, serial 1. - 0x203a4040 *Note Symbol-table::. - 0x10404020 - 0x4d206120 - 0x69016e00 - 0x81000000 - 0x980c0005 - lop_end; symbol table contained five 32-bit words. - - -File: bfd.info, Node: Symbol-table, Next: mmo section mapping, Prev: File layout, Up: mmo - -3.5.2 Symbol table format -------------------------- - -From mmixal.w (or really, the generated mmixal.tex) in -`http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz'): -"Symbols are stored and retrieved by means of a `ternary search trie', -following ideas of Bentley and Sedgewick. (See ACM-SIAM Symp. on -Discrete Algorithms `8' (1997), 360-369; R.Sedgewick, `Algorithms in C' -(Reading, Mass. Addison-Wesley, 1998), `15.4'.) Each trie node stores -a character, and there are branches to subtries for the cases where a -given character is less than, equal to, or greater than the character -in the trie. There also is a pointer to a symbol table entry if a -symbol ends at the current node." - - So it's a tree encoded as a stream of bytes. The stream of bytes -acts on a single virtual global symbol, adding and removing characters -and signalling complete symbol points. Here, we read the stream and -create symbols at the completion points. - - First, there's a control byte `m'. If any of the listed bits in `m' -is nonzero, we execute what stands at the right, in the listed order: - - (MMO3_LEFT) - 0x40 - Traverse left trie. - (Read a new command byte and recurse.) - - (MMO3_SYMBITS) - 0x2f - Read the next byte as a character and store it in the - current character position; increment character position. - Test the bits of `m': - - (MMO3_WCHAR) - 0x80 - The character is 16-bit (so read another byte, - merge into current character. - - (MMO3_TYPEBITS) - 0xf - We have a complete symbol; parse the type, value - and serial number and do what should be done - with a symbol. The type and length information - is in j = (m & 0xf). - - (MMO3_REGQUAL_BITS) - j == 0xf: A register variable. The following - byte tells which register. - j <= 8: An absolute symbol. Read j bytes as the - big-endian number the symbol equals. - A j = 2 with two zero bytes denotes an - unknown symbol. - j > 8: As with j <= 8, but add (0x20 << 56) - to the value in the following j - 8 - bytes. - - Then comes the serial number, as a variant of - uleb128, but better named ubeb128: - Read bytes and shift the previous value left 7 - (multiply by 128). Add in the new byte, repeat - until a byte has bit 7 set. The serial number - is the computed value minus 128. - - (MMO3_MIDDLE) - 0x20 - Traverse middle trie. (Read a new command byte - and recurse.) Decrement character position. - - (MMO3_RIGHT) - 0x10 - Traverse right trie. (Read a new command byte and - recurse.) - - Let's look again at the `lop_stab' for the trivial file (*note File -layout::). - - 0x980b0000 - lop_stab for ":Main" = 0, serial 1. - 0x203a4040 - 0x10404020 - 0x4d206120 - 0x69016e00 - 0x81000000 - - This forms the trivial trie (note that the path between ":" and "M" -is redundant): - - 203a ":" - 40 / - 40 / - 10 \ - 40 / - 40 / - 204d "M" - 2061 "a" - 2069 "i" - 016e "n" is the last character in a full symbol, and - with a value represented in one byte. - 00 The value is 0. - 81 The serial number is 1. - - -File: bfd.info, Node: mmo section mapping, Prev: Symbol-table, Up: mmo - -3.5.3 mmo section mapping -------------------------- - -The implementation in BFD uses special data type 80 (decimal) to -encapsulate and describe named sections, containing e.g. debug -information. If needed, any datum in the encapsulation will be quoted -using lop_quote. First comes a 32-bit word holding the number of -32-bit words containing the zero-terminated zero-padded segment name. -After the name there's a 32-bit word holding flags describing the -section type. Then comes a 64-bit big-endian word with the section -length (in bytes), then another with the section start address. -Depending on the type of section, the contents might follow, -zero-padded to 32-bit boundary. For a loadable section (such as data -or code), the contents might follow at some later point, not -necessarily immediately, as a lop_loc with the same start address as in -the section description, followed by the contents. This in effect -forms a descriptor that must be emitted before the actual contents. -Sections described this way must not overlap. - - For areas that don't have such descriptors, synthetic sections are -formed by BFD. Consecutive contents in the two memory areas -`0x0000...00' to `0x01ff...ff' and `0x2000...00' to `0x20ff...ff' are -entered in sections named `.text' and `.data' respectively. If an area -is not otherwise described, but would together with a neighboring lower -area be less than `0x40000000' bytes long, it is joined with the lower -area and the gap is zero-filled. For other cases, a new section is -formed, named `.MMIX.sec.N'. Here, N is a number, a running count -through the mmo file, starting at 0. - - A loadable section specified as: - - .section secname,"ax" - TETRA 1,2,3,4,-1,-2009 - BYTE 80 - - and linked to address `0x4', is represented by the sequence: - - 0x98080050 - lop_spec 80 - 0x00000002 - two 32-bit words for the section name - 0x7365636e - "secn" - 0x616d6500 - "ame\0" - 0x00000033 - flags CODE, READONLY, LOAD, ALLOC - 0x00000000 - high 32 bits of section length - 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits - 0x00000000 - high 32 bits of section address - 0x00000004 - section address is 4 - 0x98010002 - 64 bits with address of following data - 0x00000000 - high 32 bits of address - 0x00000004 - low 32 bits: data starts at address 4 - 0x00000001 - 1 - 0x00000002 - 2 - 0x00000003 - 3 - 0x00000004 - 4 - 0xffffffff - -1 - 0xfffff827 - -2009 - 0x50000000 - 80 as a byte, padded with zeros. - - Note that the lop_spec wrapping does not include the section -contents. Compare this to a non-loaded section specified as: - - .section thirdsec - TETRA 200001,100002 - BYTE 38,40 - - This, when linked to address `0x200000000000001c', is represented by: - - 0x98080050 - lop_spec 80 - 0x00000002 - two 32-bit words for the section name - 0x7365636e - "thir" - 0x616d6500 - "dsec" - 0x00000010 - flag READONLY - 0x00000000 - high 32 bits of section length - 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits - 0x20000000 - high 32 bits of address - 0x0000001c - low 32 bits of address 0x200000000000001c - 0x00030d41 - 200001 - 0x000186a2 - 100002 - 0x26280000 - 38, 40 as bytes, padded with zeros - - For the latter example, the section contents must not be loaded in -memory, and is therefore specified as part of the special data. The -address is usually unimportant but might provide information for e.g. -the DWARF 2 debugging format. - - -File: bfd.info, Node: GNU Free Documentation License, Next: BFD Index, Prev: BFD back ends, Up: Top - - Version 1.3, 3 November 2008 - - Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. - `http://fsf.org/' - - 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 - functional and useful 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, in any medium, - that contains a notice placed by the copyright holder saying it - can be distributed under the terms of this License. Such a notice - grants a world-wide, royalty-free license, unlimited in duration, - to use that work under the conditions stated herein. The - "Document", below, refers to any such manual or work. Any member - of the public is a licensee, and is addressed as "you". You - accept the license if you copy, modify or distribute the work in a - way requiring permission under copyright law. - - 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. (Thus, 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. If a section does not fit the above definition of - Secondary then it is not allowed to be designated as Invariant. - The Document may contain zero Invariant Sections. If the Document - does not identify any Invariant Sections then there are none. - - 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 - Front-Cover Text may be at most 5 words, and a Back-Cover Text may - be at most 25 words. - - A "Transparent" copy of the Document means a machine-readable copy, - represented in a format whose specification is available to the - general public, that is suitable for revising the document - 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, or absence of - markup, has been arranged to thwart or discourage subsequent - modification by readers is not Transparent. An image format is - not Transparent if used for any substantial amount of text. 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, PostScript or PDF designed for - human modification. Examples of transparent image formats include - PNG, XCF and JPG. Opaque formats include 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, PostScript or PDF - 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. - - The "publisher" means any person or entity that distributes copies - of the Document to the public. - - A section "Entitled XYZ" means a named subunit of the Document - whose title either is precisely XYZ or contains XYZ in parentheses - following text that translates XYZ in another language. (Here XYZ - stands for a specific section name mentioned below, such as - "Acknowledgements", "Dedications", "Endorsements", or "History".) - To "Preserve the Title" of such a section when you modify the - Document means that it remains a section "Entitled XYZ" according - to this definition. - - The Document may include Warranty Disclaimers next to the notice - which states that this License applies to the Document. These - Warranty Disclaimers are considered to be included by reference in - this License, but only as regards disclaiming warranties: any other - implication that these Warranty Disclaimers may have is void and - has no effect on the meaning of this License. - - 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 (or copies in media that commonly - have printed covers) 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 computer-network location from - which the general network-using public has access to download - using public-standard network protocols a complete Transparent - copy of the Document, free of added material. 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 fewer than five), unless they release you - from this requirement. - - 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", Preserve 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. For any section Entitled "Acknowledgements" or "Dedications", - Preserve the Title of the section, 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 to be Entitled - "Endorsements" or to conflict in title with any Invariant - Section. - - O. Preserve any Warranty Disclaimers. - - 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, and that you preserve all - their Warranty Disclaimers. - - 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, is called an "aggregate" if the - copyright resulting from the compilation is not used to limit the - legal rights of the compilation's users beyond what the individual - works permit. When the Document is included in an aggregate, this - License does not apply to the other works in the aggregate which - 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 half - of the entire aggregate, the Document's Cover Texts may be placed - on covers that bracket the Document within the aggregate, or the - electronic equivalent of covers if the Document is in electronic - form. Otherwise they must appear on printed covers that bracket - 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, and all the license notices in the - Document, and any Warranty Disclaimers, provided that you also - include the original English version of this License and the - original versions of those notices and disclaimers. In case of a - disagreement between the translation and the original version of - this License or a notice or disclaimer, the original version will - prevail. - - If a section in the Document is Entitled "Acknowledgements", - "Dedications", or "History", the requirement (section 4) to - Preserve its Title (section 1) will typically require changing the - actual title. - - 9. TERMINATION - - You may not copy, modify, sublicense, or distribute the Document - except as expressly provided under this License. Any attempt - otherwise to copy, modify, sublicense, or distribute it is void, - and will automatically terminate your rights under this License. - - However, if you cease all violation of this License, then your - license from a particular copyright holder is reinstated (a) - provisionally, unless and until the copyright holder explicitly - and finally terminates your license, and (b) permanently, if the - copyright holder fails to notify you of the violation by some - reasonable means prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is - reinstated permanently if the copyright holder notifies you of the - violation by some reasonable means, this is the first time you have - received notice of violation of this License (for any work) from - that copyright holder, and you cure the violation prior to 30 days - after your receipt of the notice. - - Termination of your rights under this section does not terminate - the licenses of parties who have received copies or rights from - you under this License. If your rights have been terminated and - not permanently reinstated, receipt of a copy of some or all of - the same material does not give you any rights to use it. - - 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. If the Document specifies that a proxy - can decide which future versions of this License can be used, that - proxy's public statement of acceptance of a version permanently - authorizes you to choose that version for the Document. - - 11. RELICENSING - - "Massive Multiauthor Collaboration Site" (or "MMC Site") means any - World Wide Web server that publishes copyrightable works and also - provides prominent facilities for anybody to edit those works. A - public wiki that anybody can edit is an example of such a server. - A "Massive Multiauthor Collaboration" (or "MMC") contained in the - site means any set of copyrightable works thus published on the MMC - site. - - "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 - license published by Creative Commons Corporation, a not-for-profit - corporation with a principal place of business in San Francisco, - California, as well as future copyleft versions of that license - published by that same organization. - - "Incorporate" means to publish or republish a Document, in whole or - in part, as part of another Document. - - An MMC is "eligible for relicensing" if it is licensed under this - License, and if all works that were first published under this - License somewhere other than this MMC, and subsequently - incorporated in whole or in part into the MMC, (1) had no cover - texts or invariant sections, and (2) were thus incorporated prior - to November 1, 2008. - - The operator of an MMC Site may republish an MMC contained in the - site under CC-BY-SA on the same site at any time before August 1, - 2009, provided the MMC is eligible for relicensing. - - -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: - - 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.3 - or any later version published by the Free Software Foundation; - with no Invariant Sections, no Front-Cover Texts, and no Back-Cover - Texts. A copy of the license is included in the section entitled ``GNU - Free Documentation License''. - - If you have Invariant Sections, Front-Cover Texts and Back-Cover -Texts, replace the "with...Texts." line with this: - - with the Invariant Sections being LIST THEIR TITLES, with - the Front-Cover Texts being LIST, and with the Back-Cover Texts - being LIST. - - If you have Invariant Sections without Cover Texts, or some other -combination of the three, merge those two alternatives to suit the -situation. - - 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. - - -File: bfd.info, Node: BFD Index, Prev: GNU Free Documentation License, Up: Top - -BFD Index -********* - -[index] -* Menu: - -* _bfd_final_link_relocate: Relocating the section contents. - (line 22) -* _bfd_generic_link_add_archive_symbols: Adding symbols from an archive. - (line 15) -* _bfd_generic_link_add_one_symbol: Adding symbols from an object file. - (line 19) -* _bfd_generic_make_empty_symbol: symbol handling functions. - (line 92) -* _bfd_link_add_symbols in target vector: Adding Symbols to the Hash Table. - (line 6) -* _bfd_link_final_link in target vector: Performing the Final Link. - (line 6) -* _bfd_link_hash_table_create in target vector: Creating a Linker Hash Table. - (line 6) -* _bfd_relocate_contents: Relocating the section contents. - (line 22) -* aout_SIZE_machine_type: aout. (line 147) -* aout_SIZE_mkobject: aout. (line 139) -* aout_SIZE_new_section_hook: aout. (line 177) -* aout_SIZE_set_arch_mach: aout. (line 164) -* aout_SIZE_some_aout_object_p: aout. (line 125) -* aout_SIZE_swap_exec_header_in: aout. (line 101) -* aout_SIZE_swap_exec_header_out: aout. (line 113) -* arelent_chain: typedef arelent. (line 336) -* BFD: Overview. (line 6) -* BFD canonical format: Canonical format. (line 11) -* bfd_alloc: Opening and Closing. - (line 218) -* bfd_alloc2: Opening and Closing. - (line 227) -* bfd_alt_mach_code: Miscellaneous. (line 308) -* bfd_arch_bits_per_address: Architectures. (line 584) -* bfd_arch_bits_per_byte: Architectures. (line 576) -* bfd_arch_default_fill: Architectures. (line 665) -* bfd_arch_get_compatible: Architectures. (line 519) -* bfd_arch_list: Architectures. (line 510) -* bfd_arch_mach_octets_per_byte: Architectures. (line 653) -* BFD_ARELOC_BFIN_ADD: howto manager. (line 1120) -* BFD_ARELOC_BFIN_ADDR: howto manager. (line 1171) -* BFD_ARELOC_BFIN_AND: howto manager. (line 1141) -* BFD_ARELOC_BFIN_COMP: howto manager. (line 1162) -* BFD_ARELOC_BFIN_CONST: howto manager. (line 1117) -* BFD_ARELOC_BFIN_DIV: howto manager. (line 1129) -* BFD_ARELOC_BFIN_HWPAGE: howto manager. (line 1168) -* BFD_ARELOC_BFIN_LAND: howto manager. (line 1150) -* BFD_ARELOC_BFIN_LEN: howto manager. (line 1156) -* BFD_ARELOC_BFIN_LOR: howto manager. (line 1153) -* BFD_ARELOC_BFIN_LSHIFT: howto manager. (line 1135) -* BFD_ARELOC_BFIN_MOD: howto manager. (line 1132) -* BFD_ARELOC_BFIN_MULT: howto manager. (line 1126) -* BFD_ARELOC_BFIN_NEG: howto manager. (line 1159) -* BFD_ARELOC_BFIN_OR: howto manager. (line 1144) -* BFD_ARELOC_BFIN_PAGE: howto manager. (line 1165) -* BFD_ARELOC_BFIN_PUSH: howto manager. (line 1114) -* BFD_ARELOC_BFIN_RSHIFT: howto manager. (line 1138) -* BFD_ARELOC_BFIN_SUB: howto manager. (line 1123) -* BFD_ARELOC_BFIN_XOR: howto manager. (line 1147) -* bfd_cache_close: File Caching. (line 26) -* bfd_cache_close_all: File Caching. (line 39) -* bfd_cache_init: File Caching. (line 18) -* bfd_calc_gnu_debuglink_crc32: Opening and Closing. - (line 254) -* bfd_canonicalize_reloc: Miscellaneous. (line 19) -* bfd_canonicalize_symtab: symbol handling functions. - (line 50) -* bfd_check_format: Formats. (line 21) -* bfd_check_format_matches: Formats. (line 52) -* bfd_check_overflow: typedef arelent. (line 348) -* bfd_close: Opening and Closing. - (line 143) -* bfd_close_all_done: Opening and Closing. - (line 161) -* bfd_coff_backend_data: coff. (line 305) -* bfd_copy_private_bfd_data: Miscellaneous. (line 158) -* bfd_copy_private_header_data: Miscellaneous. (line 140) -* bfd_copy_private_section_data: section prototypes. (line 278) -* bfd_copy_private_symbol_data: symbol handling functions. - (line 140) -* bfd_core_file_failing_command: Core Files. (line 12) -* bfd_core_file_failing_signal: Core Files. (line 21) -* bfd_core_file_pid: Core Files. (line 30) -* bfd_create: Opening and Closing. - (line 180) -* bfd_create_gnu_debuglink_section: Opening and Closing. - (line 363) -* bfd_decode_symclass: symbol handling functions. - (line 111) -* bfd_default_arch_struct: Architectures. (line 531) -* bfd_default_compatible: Architectures. (line 593) -* bfd_default_reloc_type_lookup: howto manager. (line 3268) -* bfd_default_scan: Architectures. (line 602) -* bfd_default_set_arch_mach: Architectures. (line 549) -* bfd_demangle: Miscellaneous. (line 359) -* bfd_emul_get_commonpagesize: Miscellaneous. (line 339) -* bfd_emul_get_maxpagesize: Miscellaneous. (line 319) -* bfd_emul_set_commonpagesize: Miscellaneous. (line 350) -* bfd_emul_set_maxpagesize: Miscellaneous. (line 330) -* bfd_errmsg: Error reporting. (line 67) -* bfd_fdopenr: Opening and Closing. - (line 51) -* bfd_fill_in_gnu_debuglink_section: Opening and Closing. - (line 377) -* bfd_find_target: bfd_target. (line 473) -* bfd_find_version_for_sym: Writing the symbol table. - (line 81) -* bfd_follow_gnu_debugaltlink: Opening and Closing. - (line 343) -* bfd_follow_gnu_debuglink: Opening and Closing. - (line 322) -* bfd_fopen: Opening and Closing. - (line 12) -* bfd_format_string: Formats. (line 79) -* bfd_generic_define_common_symbol: Writing the symbol table. - (line 68) -* bfd_generic_discard_group: section prototypes. (line 304) -* bfd_generic_gc_sections: howto manager. (line 3299) -* bfd_generic_get_relocated_section_contents: howto manager. (line 3329) -* bfd_generic_is_group_section: section prototypes. (line 296) -* bfd_generic_lookup_section_flags: howto manager. (line 3309) -* bfd_generic_merge_sections: howto manager. (line 3319) -* bfd_generic_relax_section: howto manager. (line 3286) -* bfd_get_alt_debug_link_info: Opening and Closing. - (line 279) -* bfd_get_arch: Architectures. (line 560) -* bfd_get_arch_info: Architectures. (line 612) -* bfd_get_arch_size: Miscellaneous. (line 63) -* bfd_get_assert_handler: Error reporting. (line 150) -* bfd_get_debug_link_info: Opening and Closing. - (line 268) -* bfd_get_error: Error reporting. (line 48) -* bfd_get_error_handler: Error reporting. (line 118) -* bfd_get_gp_size: Miscellaneous. (line 104) -* bfd_get_linker_section: section prototypes. (line 36) -* bfd_get_mach: Architectures. (line 568) -* bfd_get_mtime: Miscellaneous. (line 410) -* bfd_get_next_mapent: Archives. (line 58) -* bfd_get_next_section_by_name: section prototypes. (line 26) -* bfd_get_reloc_code_name: howto manager. (line 3277) -* bfd_get_reloc_size: typedef arelent. (line 327) -* bfd_get_reloc_upper_bound: Miscellaneous. (line 9) -* bfd_get_section_by_name: section prototypes. (line 17) -* bfd_get_section_by_name_if: section prototypes. (line 45) -* bfd_get_section_contents: section prototypes. (line 251) -* bfd_get_sign_extend_vma: Miscellaneous. (line 76) -* bfd_get_size <1>: Miscellaneous. (line 419) -* bfd_get_size: Internal. (line 25) -* bfd_get_symtab_upper_bound: symbol handling functions. - (line 6) -* bfd_get_target_info: bfd_target. (line 489) -* bfd_get_unique_section_name: section prototypes. (line 64) -* bfd_h_put_size: Internal. (line 97) -* bfd_hash_allocate: Creating and Freeing a Hash Table. - (line 17) -* bfd_hash_lookup: Looking Up or Entering a String. - (line 6) -* bfd_hash_newfunc: Creating and Freeing a Hash Table. - (line 12) -* bfd_hash_set_default_size: Creating and Freeing a Hash Table. - (line 25) -* bfd_hash_table_free: Creating and Freeing a Hash Table. - (line 21) -* bfd_hash_table_init: Creating and Freeing a Hash Table. - (line 6) -* bfd_hash_table_init_n: Creating and Freeing a Hash Table. - (line 6) -* bfd_hash_traverse: Traversing a Hash Table. - (line 6) -* bfd_hide_sym_by_version: Writing the symbol table. - (line 93) -* bfd_init: Initialization. (line 11) -* bfd_install_relocation: typedef arelent. (line 389) -* bfd_is_local_label: symbol handling functions. - (line 17) -* bfd_is_local_label_name: symbol handling functions. - (line 26) -* bfd_is_target_special_symbol: symbol handling functions. - (line 38) -* bfd_is_undefined_symclass: symbol handling functions. - (line 120) -* bfd_link_split_section: Writing the symbol table. - (line 44) -* bfd_log2: Internal. (line 164) -* bfd_lookup_arch: Architectures. (line 620) -* bfd_make_debug_symbol: symbol handling functions. - (line 102) -* bfd_make_empty_symbol: symbol handling functions. - (line 78) -* bfd_make_readable: Opening and Closing. - (line 204) -* bfd_make_section: section prototypes. (line 143) -* bfd_make_section_anyway: section prototypes. (line 114) -* bfd_make_section_anyway_with_flags: section prototypes. (line 96) -* bfd_make_section_old_way: section prototypes. (line 76) -* bfd_make_section_with_flags: section prototypes. (line 130) -* bfd_make_writable: Opening and Closing. - (line 190) -* bfd_malloc_and_get_section: section prototypes. (line 268) -* bfd_map_over_sections: section prototypes. (line 178) -* bfd_merge_private_bfd_data: Miscellaneous. (line 174) -* bfd_mmap: Miscellaneous. (line 448) -* bfd_octets_per_byte: Architectures. (line 643) -* bfd_open_file: File Caching. (line 52) -* bfd_openr: Opening and Closing. - (line 35) -* bfd_openr_iovec: Opening and Closing. - (line 83) -* bfd_openr_next_archived_file: Archives. (line 84) -* bfd_openstreamr: Opening and Closing. - (line 74) -* bfd_openw: Opening and Closing. - (line 131) -* bfd_perform_relocation: typedef arelent. (line 364) -* bfd_perror: Error reporting. (line 76) -* bfd_print_symbol_vandf: symbol handling functions. - (line 70) -* bfd_printable_arch_mach: Architectures. (line 631) -* bfd_printable_name: Architectures. (line 491) -* bfd_put_size: Internal. (line 22) -* BFD_RELOC_12_PCREL: howto manager. (line 39) -* BFD_RELOC_14: howto manager. (line 31) -* BFD_RELOC_16: howto manager. (line 30) -* BFD_RELOC_16_BASEREL: howto manager. (line 99) -* BFD_RELOC_16_GOT_PCREL: howto manager. (line 52) -* BFD_RELOC_16_GOTOFF: howto manager. (line 55) -* BFD_RELOC_16_PCREL: howto manager. (line 38) -* BFD_RELOC_16_PCREL_S2: howto manager. (line 111) -* BFD_RELOC_16_PLT_PCREL: howto manager. (line 63) -* BFD_RELOC_16_PLTOFF: howto manager. (line 67) -* BFD_RELOC_16C_ABS20: howto manager. (line 2236) -* BFD_RELOC_16C_ABS20_C: howto manager. (line 2237) -* BFD_RELOC_16C_ABS24: howto manager. (line 2238) -* BFD_RELOC_16C_ABS24_C: howto manager. (line 2239) -* BFD_RELOC_16C_DISP04: howto manager. (line 2216) -* BFD_RELOC_16C_DISP04_C: howto manager. (line 2217) -* BFD_RELOC_16C_DISP08: howto manager. (line 2218) -* BFD_RELOC_16C_DISP08_C: howto manager. (line 2219) -* BFD_RELOC_16C_DISP16: howto manager. (line 2220) -* BFD_RELOC_16C_DISP16_C: howto manager. (line 2221) -* BFD_RELOC_16C_DISP24: howto manager. (line 2222) -* BFD_RELOC_16C_DISP24_C: howto manager. (line 2223) -* BFD_RELOC_16C_DISP24a: howto manager. (line 2224) -* BFD_RELOC_16C_DISP24a_C: howto manager. (line 2225) -* BFD_RELOC_16C_IMM04: howto manager. (line 2240) -* BFD_RELOC_16C_IMM04_C: howto manager. (line 2241) -* BFD_RELOC_16C_IMM16: howto manager. (line 2242) -* BFD_RELOC_16C_IMM16_C: howto manager. (line 2243) -* BFD_RELOC_16C_IMM20: howto manager. (line 2244) -* BFD_RELOC_16C_IMM20_C: howto manager. (line 2245) -* BFD_RELOC_16C_IMM24: howto manager. (line 2246) -* BFD_RELOC_16C_IMM24_C: howto manager. (line 2247) -* BFD_RELOC_16C_IMM32: howto manager. (line 2248) -* BFD_RELOC_16C_IMM32_C: howto manager. (line 2249) -* BFD_RELOC_16C_NUM08: howto manager. (line 2210) -* BFD_RELOC_16C_NUM08_C: howto manager. (line 2211) -* BFD_RELOC_16C_NUM16: howto manager. (line 2212) -* BFD_RELOC_16C_NUM16_C: howto manager. (line 2213) -* BFD_RELOC_16C_NUM32: howto manager. (line 2214) -* BFD_RELOC_16C_NUM32_C: howto manager. (line 2215) -* BFD_RELOC_16C_REG04: howto manager. (line 2226) -* BFD_RELOC_16C_REG04_C: howto manager. (line 2227) -* BFD_RELOC_16C_REG04a: howto manager. (line 2228) -* BFD_RELOC_16C_REG04a_C: howto manager. (line 2229) -* BFD_RELOC_16C_REG14: howto manager. (line 2230) -* BFD_RELOC_16C_REG14_C: howto manager. (line 2231) -* BFD_RELOC_16C_REG16: howto manager. (line 2232) -* BFD_RELOC_16C_REG16_C: howto manager. (line 2233) -* BFD_RELOC_16C_REG20: howto manager. (line 2234) -* BFD_RELOC_16C_REG20_C: howto manager. (line 2235) -* BFD_RELOC_23_PCREL_S2: howto manager. (line 112) -* BFD_RELOC_24: howto manager. (line 29) -* BFD_RELOC_24_PCREL: howto manager. (line 37) -* BFD_RELOC_24_PLT_PCREL: howto manager. (line 62) -* BFD_RELOC_26: howto manager. (line 28) -* BFD_RELOC_32: howto manager. (line 27) -* BFD_RELOC_32_BASEREL: howto manager. (line 98) -* BFD_RELOC_32_GOT_PCREL: howto manager. (line 51) -* BFD_RELOC_32_GOTOFF: howto manager. (line 54) -* BFD_RELOC_32_PCREL: howto manager. (line 36) -* BFD_RELOC_32_PCREL_S2: howto manager. (line 110) -* BFD_RELOC_32_PLT_PCREL: howto manager. (line 61) -* BFD_RELOC_32_PLTOFF: howto manager. (line 66) -* BFD_RELOC_32_SECREL: howto manager. (line 48) -* BFD_RELOC_386_COPY: howto manager. (line 577) -* BFD_RELOC_386_GLOB_DAT: howto manager. (line 578) -* BFD_RELOC_386_GOT32: howto manager. (line 575) -* BFD_RELOC_386_GOTOFF: howto manager. (line 581) -* BFD_RELOC_386_GOTPC: howto manager. (line 582) -* BFD_RELOC_386_IRELATIVE: howto manager. (line 598) -* BFD_RELOC_386_JUMP_SLOT: howto manager. (line 579) -* BFD_RELOC_386_PLT32: howto manager. (line 576) -* BFD_RELOC_386_RELATIVE: howto manager. (line 580) -* BFD_RELOC_386_TLS_DESC: howto manager. (line 597) -* BFD_RELOC_386_TLS_DESC_CALL: howto manager. (line 596) -* BFD_RELOC_386_TLS_DTPMOD32: howto manager. (line 592) -* BFD_RELOC_386_TLS_DTPOFF32: howto manager. (line 593) -* BFD_RELOC_386_TLS_GD: howto manager. (line 587) -* BFD_RELOC_386_TLS_GOTDESC: howto manager. (line 595) -* BFD_RELOC_386_TLS_GOTIE: howto manager. (line 585) -* BFD_RELOC_386_TLS_IE: howto manager. (line 584) -* BFD_RELOC_386_TLS_IE_32: howto manager. (line 590) -* BFD_RELOC_386_TLS_LDM: howto manager. (line 588) -* BFD_RELOC_386_TLS_LDO_32: howto manager. (line 589) -* BFD_RELOC_386_TLS_LE: howto manager. (line 586) -* BFD_RELOC_386_TLS_LE_32: howto manager. (line 591) -* BFD_RELOC_386_TLS_TPOFF: howto manager. (line 583) -* BFD_RELOC_386_TLS_TPOFF32: howto manager. (line 594) -* BFD_RELOC_390_12: howto manager. (line 1819) -* BFD_RELOC_390_20: howto manager. (line 1931) -* BFD_RELOC_390_COPY: howto manager. (line 1828) -* BFD_RELOC_390_GLOB_DAT: howto manager. (line 1831) -* BFD_RELOC_390_GOT12: howto manager. (line 1822) -* BFD_RELOC_390_GOT16: howto manager. (line 1843) -* BFD_RELOC_390_GOT20: howto manager. (line 1932) -* BFD_RELOC_390_GOT64: howto manager. (line 1873) -* BFD_RELOC_390_GOTENT: howto manager. (line 1879) -* BFD_RELOC_390_GOTOFF64: howto manager. (line 1882) -* BFD_RELOC_390_GOTPC: howto manager. (line 1840) -* BFD_RELOC_390_GOTPCDBL: howto manager. (line 1870) -* BFD_RELOC_390_GOTPLT12: howto manager. (line 1885) -* BFD_RELOC_390_GOTPLT16: howto manager. (line 1888) -* BFD_RELOC_390_GOTPLT20: howto manager. (line 1933) -* BFD_RELOC_390_GOTPLT32: howto manager. (line 1891) -* BFD_RELOC_390_GOTPLT64: howto manager. (line 1894) -* BFD_RELOC_390_GOTPLTENT: howto manager. (line 1897) -* BFD_RELOC_390_IRELATIVE: howto manager. (line 1937) -* BFD_RELOC_390_JMP_SLOT: howto manager. (line 1834) -* BFD_RELOC_390_PC12DBL: howto manager. (line 1846) -* BFD_RELOC_390_PC16DBL: howto manager. (line 1852) -* BFD_RELOC_390_PC24DBL: howto manager. (line 1858) -* BFD_RELOC_390_PC32DBL: howto manager. (line 1864) -* BFD_RELOC_390_PLT12DBL: howto manager. (line 1849) -* BFD_RELOC_390_PLT16DBL: howto manager. (line 1855) -* BFD_RELOC_390_PLT24DBL: howto manager. (line 1861) -* BFD_RELOC_390_PLT32: howto manager. (line 1825) -* BFD_RELOC_390_PLT32DBL: howto manager. (line 1867) -* BFD_RELOC_390_PLT64: howto manager. (line 1876) -* BFD_RELOC_390_PLTOFF16: howto manager. (line 1900) -* BFD_RELOC_390_PLTOFF32: howto manager. (line 1903) -* BFD_RELOC_390_PLTOFF64: howto manager. (line 1906) -* BFD_RELOC_390_RELATIVE: howto manager. (line 1837) -* BFD_RELOC_390_TLS_DTPMOD: howto manager. (line 1926) -* BFD_RELOC_390_TLS_DTPOFF: howto manager. (line 1927) -* BFD_RELOC_390_TLS_GD32: howto manager. (line 1912) -* BFD_RELOC_390_TLS_GD64: howto manager. (line 1913) -* BFD_RELOC_390_TLS_GDCALL: howto manager. (line 1910) -* BFD_RELOC_390_TLS_GOTIE12: howto manager. (line 1914) -* BFD_RELOC_390_TLS_GOTIE20: howto manager. (line 1934) -* BFD_RELOC_390_TLS_GOTIE32: howto manager. (line 1915) -* BFD_RELOC_390_TLS_GOTIE64: howto manager. (line 1916) -* BFD_RELOC_390_TLS_IE32: howto manager. (line 1919) -* BFD_RELOC_390_TLS_IE64: howto manager. (line 1920) -* BFD_RELOC_390_TLS_IEENT: howto manager. (line 1921) -* BFD_RELOC_390_TLS_LDCALL: howto manager. (line 1911) -* BFD_RELOC_390_TLS_LDM32: howto manager. (line 1917) -* BFD_RELOC_390_TLS_LDM64: howto manager. (line 1918) -* BFD_RELOC_390_TLS_LDO32: howto manager. (line 1924) -* BFD_RELOC_390_TLS_LDO64: howto manager. (line 1925) -* BFD_RELOC_390_TLS_LE32: howto manager. (line 1922) -* BFD_RELOC_390_TLS_LE64: howto manager. (line 1923) -* BFD_RELOC_390_TLS_LOAD: howto manager. (line 1909) -* BFD_RELOC_390_TLS_TPOFF: howto manager. (line 1928) -* BFD_RELOC_64: howto manager. (line 26) -* BFD_RELOC_64_PCREL: howto manager. (line 35) -* BFD_RELOC_64_PLT_PCREL: howto manager. (line 60) -* BFD_RELOC_64_PLTOFF: howto manager. (line 65) -* BFD_RELOC_68K_GLOB_DAT: howto manager. (line 78) -* BFD_RELOC_68K_JMP_SLOT: howto manager. (line 79) -* BFD_RELOC_68K_RELATIVE: howto manager. (line 80) -* BFD_RELOC_68K_TLS_GD16: howto manager. (line 82) -* BFD_RELOC_68K_TLS_GD32: howto manager. (line 81) -* BFD_RELOC_68K_TLS_GD8: howto manager. (line 83) -* BFD_RELOC_68K_TLS_IE16: howto manager. (line 91) -* BFD_RELOC_68K_TLS_IE32: howto manager. (line 90) -* BFD_RELOC_68K_TLS_IE8: howto manager. (line 92) -* BFD_RELOC_68K_TLS_LDM16: howto manager. (line 85) -* BFD_RELOC_68K_TLS_LDM32: howto manager. (line 84) -* BFD_RELOC_68K_TLS_LDM8: howto manager. (line 86) -* BFD_RELOC_68K_TLS_LDO16: howto manager. (line 88) -* BFD_RELOC_68K_TLS_LDO32: howto manager. (line 87) -* BFD_RELOC_68K_TLS_LDO8: howto manager. (line 89) -* BFD_RELOC_68K_TLS_LE16: howto manager. (line 94) -* BFD_RELOC_68K_TLS_LE32: howto manager. (line 93) -* BFD_RELOC_68K_TLS_LE8: howto manager. (line 95) -* BFD_RELOC_8: howto manager. (line 32) -* BFD_RELOC_860_COPY: howto manager. (line 2364) -* BFD_RELOC_860_GLOB_DAT: howto manager. (line 2365) -* BFD_RELOC_860_HAGOT: howto manager. (line 2390) -* BFD_RELOC_860_HAGOTOFF: howto manager. (line 2391) -* BFD_RELOC_860_HAPC: howto manager. (line 2392) -* BFD_RELOC_860_HIGH: howto manager. (line 2393) -* BFD_RELOC_860_HIGHADJ: howto manager. (line 2389) -* BFD_RELOC_860_HIGOT: howto manager. (line 2394) -* BFD_RELOC_860_HIGOTOFF: howto manager. (line 2395) -* BFD_RELOC_860_JUMP_SLOT: howto manager. (line 2366) -* BFD_RELOC_860_LOGOT0: howto manager. (line 2378) -* BFD_RELOC_860_LOGOT1: howto manager. (line 2380) -* BFD_RELOC_860_LOGOTOFF0: howto manager. (line 2382) -* BFD_RELOC_860_LOGOTOFF1: howto manager. (line 2384) -* BFD_RELOC_860_LOGOTOFF2: howto manager. (line 2386) -* BFD_RELOC_860_LOGOTOFF3: howto manager. (line 2387) -* BFD_RELOC_860_LOPC: howto manager. (line 2388) -* BFD_RELOC_860_LOW0: howto manager. (line 2371) -* BFD_RELOC_860_LOW1: howto manager. (line 2373) -* BFD_RELOC_860_LOW2: howto manager. (line 2375) -* BFD_RELOC_860_LOW3: howto manager. (line 2377) -* BFD_RELOC_860_PC16: howto manager. (line 2370) -* BFD_RELOC_860_PC26: howto manager. (line 2368) -* BFD_RELOC_860_PLT26: howto manager. (line 2369) -* BFD_RELOC_860_RELATIVE: howto manager. (line 2367) -* BFD_RELOC_860_SPGOT0: howto manager. (line 2379) -* BFD_RELOC_860_SPGOT1: howto manager. (line 2381) -* BFD_RELOC_860_SPGOTOFF0: howto manager. (line 2383) -* BFD_RELOC_860_SPGOTOFF1: howto manager. (line 2385) -* BFD_RELOC_860_SPLIT0: howto manager. (line 2372) -* BFD_RELOC_860_SPLIT1: howto manager. (line 2374) -* BFD_RELOC_860_SPLIT2: howto manager. (line 2376) -* BFD_RELOC_8_BASEREL: howto manager. (line 103) -* BFD_RELOC_8_FFnn: howto manager. (line 107) -* BFD_RELOC_8_GOT_PCREL: howto manager. (line 53) -* BFD_RELOC_8_GOTOFF: howto manager. (line 59) -* BFD_RELOC_8_PCREL: howto manager. (line 40) -* BFD_RELOC_8_PLT_PCREL: howto manager. (line 64) -* BFD_RELOC_8_PLTOFF: howto manager. (line 71) -* BFD_RELOC_AARCH64_16: howto manager. (line 2755) -* BFD_RELOC_AARCH64_16_PCREL: howto manager. (line 2762) -* BFD_RELOC_AARCH64_32: howto manager. (line 2754) -* BFD_RELOC_AARCH64_32_PCREL: howto manager. (line 2761) -* BFD_RELOC_AARCH64_64: howto manager. (line 2753) -* BFD_RELOC_AARCH64_64_PCREL: howto manager. (line 2760) -* BFD_RELOC_AARCH64_ADD_LO12: howto manager. (line 2827) -* BFD_RELOC_AARCH64_ADR_GOT_PAGE: howto manager. (line 2884) -* BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL: howto manager. (line 2822) -* BFD_RELOC_AARCH64_ADR_HI21_PCREL: howto manager. (line 2818) -* BFD_RELOC_AARCH64_ADR_LO21_PCREL: howto manager. (line 2814) -* BFD_RELOC_AARCH64_BRANCH19: howto manager. (line 2842) -* BFD_RELOC_AARCH64_CALL26: howto manager. (line 2852) -* BFD_RELOC_AARCH64_COPY: howto manager. (line 2985) -* BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP: howto manager. (line 3019) -* BFD_RELOC_AARCH64_GLOB_DAT: howto manager. (line 2988) -* BFD_RELOC_AARCH64_GOT_LD_PREL19: howto manager. (line 2877) -* BFD_RELOC_AARCH64_IRELATIVE: howto manager. (line 3009) -* BFD_RELOC_AARCH64_JUMP26: howto manager. (line 2847) -* BFD_RELOC_AARCH64_JUMP_SLOT: howto manager. (line 2991) -* BFD_RELOC_AARCH64_LD32_GOT_LO12_NC: howto manager. (line 2894) -* BFD_RELOC_AARCH64_LD64_GOT_LO12_NC: howto manager. (line 2889) -* BFD_RELOC_AARCH64_LD_GOT_LO12_NC: howto manager. (line 3028) -* BFD_RELOC_AARCH64_LD_LO19_PCREL: howto manager. (line 2809) -* BFD_RELOC_AARCH64_LDST128_LO12: howto manager. (line 2872) -* BFD_RELOC_AARCH64_LDST16_LO12: howto manager. (line 2857) -* BFD_RELOC_AARCH64_LDST32_LO12: howto manager. (line 2862) -* BFD_RELOC_AARCH64_LDST64_LO12: howto manager. (line 2867) -* BFD_RELOC_AARCH64_LDST8_LO12: howto manager. (line 2832) -* BFD_RELOC_AARCH64_LDST_LO12: howto manager. (line 3023) -* BFD_RELOC_AARCH64_MOVW_G0: howto manager. (line 2766) -* BFD_RELOC_AARCH64_MOVW_G0_NC: howto manager. (line 2770) -* BFD_RELOC_AARCH64_MOVW_G0_S: howto manager. (line 2794) -* BFD_RELOC_AARCH64_MOVW_G1: howto manager. (line 2774) -* BFD_RELOC_AARCH64_MOVW_G1_NC: howto manager. (line 2778) -* BFD_RELOC_AARCH64_MOVW_G1_S: howto manager. (line 2799) -* BFD_RELOC_AARCH64_MOVW_G2: howto manager. (line 2782) -* BFD_RELOC_AARCH64_MOVW_G2_NC: howto manager. (line 2786) -* BFD_RELOC_AARCH64_MOVW_G2_S: howto manager. (line 2804) -* BFD_RELOC_AARCH64_MOVW_G3: howto manager. (line 2790) -* BFD_RELOC_AARCH64_NONE: howto manager. (line 2750) -* BFD_RELOC_AARCH64_RELATIVE: howto manager. (line 2994) -* BFD_RELOC_AARCH64_RELOC_END: howto manager. (line 3012) -* BFD_RELOC_AARCH64_RELOC_START: howto manager. (line 2744) -* BFD_RELOC_AARCH64_TLS_DTPMOD: howto manager. (line 2997) -* BFD_RELOC_AARCH64_TLS_DTPREL: howto manager. (line 3000) -* BFD_RELOC_AARCH64_TLS_TPREL: howto manager. (line 3003) -* BFD_RELOC_AARCH64_TLSDESC: howto manager. (line 3006) -* BFD_RELOC_AARCH64_TLSDESC_ADD: howto manager. (line 2979) -* BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC: howto manager. (line 2967) -* BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21: howto manager. (line 2958) -* BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21: howto manager. (line 2955) -* BFD_RELOC_AARCH64_TLSDESC_CALL: howto manager. (line 2982) -* BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC: howto manager. (line 2964) -* BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC: howto manager. (line 2961) -* BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC: howto manager. (line 3036) -* BFD_RELOC_AARCH64_TLSDESC_LD_PREL19: howto manager. (line 2952) -* BFD_RELOC_AARCH64_TLSDESC_LDR: howto manager. (line 2976) -* BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC: howto manager. (line 2973) -* BFD_RELOC_AARCH64_TLSDESC_OFF_G1: howto manager. (line 2970) -* BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC: howto manager. (line 2905) -* BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21: howto manager. (line 2899) -* BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: howto manager. - (line 2916) -* BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC: howto manager. - (line 2922) -* BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: howto manager. - (line 2919) -* BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC: howto manager. - (line 3032) -* BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: howto manager. (line 2925) -* BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: howto manager. - (line 2913) -* BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: howto manager. (line 2910) -* BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12: howto manager. (line 2943) -* BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12: howto manager. (line 2946) -* BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC: howto manager. (line 2949) -* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0: howto manager. (line 2937) -* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC: howto manager. (line 2940) -* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1: howto manager. (line 2931) -* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC: howto manager. (line 2934) -* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2: howto manager. (line 2928) -* BFD_RELOC_AARCH64_TSTBR14: howto manager. (line 2837) -* BFD_RELOC_ALPHA_BOH: howto manager. (line 323) -* BFD_RELOC_ALPHA_BRSGP: howto manager. (line 306) -* BFD_RELOC_ALPHA_BSR: howto manager. (line 315) -* BFD_RELOC_ALPHA_CODEADDR: howto manager. (line 297) -* BFD_RELOC_ALPHA_DTPMOD64: howto manager. (line 329) -* BFD_RELOC_ALPHA_DTPREL16: howto manager. (line 334) -* BFD_RELOC_ALPHA_DTPREL64: howto manager. (line 331) -* BFD_RELOC_ALPHA_DTPREL_HI16: howto manager. (line 332) -* BFD_RELOC_ALPHA_DTPREL_LO16: howto manager. (line 333) -* BFD_RELOC_ALPHA_ELF_LITERAL: howto manager. (line 262) -* BFD_RELOC_ALPHA_GOTDTPREL16: howto manager. (line 330) -* BFD_RELOC_ALPHA_GOTTPREL16: howto manager. (line 335) -* BFD_RELOC_ALPHA_GPDISP: howto manager. (line 256) -* BFD_RELOC_ALPHA_GPDISP_HI16: howto manager. (line 242) -* BFD_RELOC_ALPHA_GPDISP_LO16: howto manager. (line 250) -* BFD_RELOC_ALPHA_GPREL_HI16: howto manager. (line 301) -* BFD_RELOC_ALPHA_GPREL_LO16: howto manager. (line 302) -* BFD_RELOC_ALPHA_HINT: howto manager. (line 288) -* BFD_RELOC_ALPHA_LDA: howto manager. (line 319) -* BFD_RELOC_ALPHA_LINKAGE: howto manager. (line 293) -* BFD_RELOC_ALPHA_LITERAL: howto manager. (line 261) -* BFD_RELOC_ALPHA_LITUSE: howto manager. (line 263) -* BFD_RELOC_ALPHA_NOP: howto manager. (line 311) -* BFD_RELOC_ALPHA_TLSGD: howto manager. (line 327) -* BFD_RELOC_ALPHA_TLSLDM: howto manager. (line 328) -* BFD_RELOC_ALPHA_TPREL16: howto manager. (line 339) -* BFD_RELOC_ALPHA_TPREL64: howto manager. (line 336) -* BFD_RELOC_ALPHA_TPREL_HI16: howto manager. (line 337) -* BFD_RELOC_ALPHA_TPREL_LO16: howto manager. (line 338) -* BFD_RELOC_ARC_B22_PCREL: howto manager. (line 1049) -* BFD_RELOC_ARC_B26: howto manager. (line 1054) -* BFD_RELOC_ARM_ADR_IMM: howto manager. (line 935) -* BFD_RELOC_ARM_ADRL_IMMEDIATE: howto manager. (line 921) -* BFD_RELOC_ARM_ALU_PC_G0: howto manager. (line 885) -* BFD_RELOC_ARM_ALU_PC_G0_NC: howto manager. (line 884) -* BFD_RELOC_ARM_ALU_PC_G1: howto manager. (line 887) -* BFD_RELOC_ARM_ALU_PC_G1_NC: howto manager. (line 886) -* BFD_RELOC_ARM_ALU_PC_G2: howto manager. (line 888) -* BFD_RELOC_ARM_ALU_SB_G0: howto manager. (line 899) -* BFD_RELOC_ARM_ALU_SB_G0_NC: howto manager. (line 898) -* BFD_RELOC_ARM_ALU_SB_G1: howto manager. (line 901) -* BFD_RELOC_ARM_ALU_SB_G1_NC: howto manager. (line 900) -* BFD_RELOC_ARM_ALU_SB_G2: howto manager. (line 902) -* BFD_RELOC_ARM_CP_OFF_IMM: howto manager. (line 931) -* BFD_RELOC_ARM_CP_OFF_IMM_S2: howto manager. (line 932) -* BFD_RELOC_ARM_GLOB_DAT: howto manager. (line 859) -* BFD_RELOC_ARM_GOT32: howto manager. (line 860) -* BFD_RELOC_ARM_GOT_PREL: howto manager. (line 865) -* BFD_RELOC_ARM_GOTOFF: howto manager. (line 863) -* BFD_RELOC_ARM_GOTPC: howto manager. (line 864) -* BFD_RELOC_ARM_HVC: howto manager. (line 928) -* BFD_RELOC_ARM_HWLITERAL: howto manager. (line 942) -* BFD_RELOC_ARM_IMMEDIATE: howto manager. (line 920) -* BFD_RELOC_ARM_IN_POOL: howto manager. (line 938) -* BFD_RELOC_ARM_IRELATIVE: howto manager. (line 917) -* BFD_RELOC_ARM_JUMP_SLOT: howto manager. (line 858) -* BFD_RELOC_ARM_LDC_PC_G0: howto manager. (line 895) -* BFD_RELOC_ARM_LDC_PC_G1: howto manager. (line 896) -* BFD_RELOC_ARM_LDC_PC_G2: howto manager. (line 897) -* BFD_RELOC_ARM_LDC_SB_G0: howto manager. (line 909) -* BFD_RELOC_ARM_LDC_SB_G1: howto manager. (line 910) -* BFD_RELOC_ARM_LDC_SB_G2: howto manager. (line 911) -* BFD_RELOC_ARM_LDR_IMM: howto manager. (line 936) -* BFD_RELOC_ARM_LDR_PC_G0: howto manager. (line 889) -* BFD_RELOC_ARM_LDR_PC_G1: howto manager. (line 890) -* BFD_RELOC_ARM_LDR_PC_G2: howto manager. (line 891) -* BFD_RELOC_ARM_LDR_SB_G0: howto manager. (line 903) -* BFD_RELOC_ARM_LDR_SB_G1: howto manager. (line 904) -* BFD_RELOC_ARM_LDR_SB_G2: howto manager. (line 905) -* BFD_RELOC_ARM_LDRS_PC_G0: howto manager. (line 892) -* BFD_RELOC_ARM_LDRS_PC_G1: howto manager. (line 893) -* BFD_RELOC_ARM_LDRS_PC_G2: howto manager. (line 894) -* BFD_RELOC_ARM_LDRS_SB_G0: howto manager. (line 906) -* BFD_RELOC_ARM_LDRS_SB_G1: howto manager. (line 907) -* BFD_RELOC_ARM_LDRS_SB_G2: howto manager. (line 908) -* BFD_RELOC_ARM_LITERAL: howto manager. (line 937) -* BFD_RELOC_ARM_MOVT: howto manager. (line 849) -* BFD_RELOC_ARM_MOVT_PCREL: howto manager. (line 851) -* BFD_RELOC_ARM_MOVW: howto manager. (line 848) -* BFD_RELOC_ARM_MOVW_PCREL: howto manager. (line 850) -* BFD_RELOC_ARM_MULTI: howto manager. (line 930) -* BFD_RELOC_ARM_OFFSET_IMM: howto manager. (line 822) -* BFD_RELOC_ARM_OFFSET_IMM8: howto manager. (line 939) -* BFD_RELOC_ARM_PCREL_BLX: howto manager. (line 793) -* BFD_RELOC_ARM_PCREL_BRANCH: howto manager. (line 789) -* BFD_RELOC_ARM_PCREL_CALL: howto manager. (line 803) -* BFD_RELOC_ARM_PCREL_JUMP: howto manager. (line 807) -* BFD_RELOC_ARM_PLT32: howto manager. (line 861) -* BFD_RELOC_ARM_PREL31: howto manager. (line 845) -* BFD_RELOC_ARM_RELATIVE: howto manager. (line 862) -* BFD_RELOC_ARM_ROSEGREL32: howto manager. (line 834) -* BFD_RELOC_ARM_SBREL32: howto manager. (line 837) -* BFD_RELOC_ARM_SHIFT_IMM: howto manager. (line 926) -* BFD_RELOC_ARM_SMC: howto manager. (line 927) -* BFD_RELOC_ARM_SWI: howto manager. (line 929) -* BFD_RELOC_ARM_T32_ADD_IMM: howto manager. (line 923) -* BFD_RELOC_ARM_T32_ADD_PC12: howto manager. (line 925) -* BFD_RELOC_ARM_T32_CP_OFF_IMM: howto manager. (line 933) -* BFD_RELOC_ARM_T32_CP_OFF_IMM_S2: howto manager. (line 934) -* BFD_RELOC_ARM_T32_IMM12: howto manager. (line 924) -* BFD_RELOC_ARM_T32_IMMEDIATE: howto manager. (line 922) -* BFD_RELOC_ARM_T32_OFFSET_IMM: howto manager. (line 941) -* BFD_RELOC_ARM_T32_OFFSET_U8: howto manager. (line 940) -* BFD_RELOC_ARM_TARGET1: howto manager. (line 830) -* BFD_RELOC_ARM_TARGET2: howto manager. (line 840) -* BFD_RELOC_ARM_THM_TLS_CALL: howto manager. (line 878) -* BFD_RELOC_ARM_THM_TLS_DESCSEQ: howto manager. (line 880) -* BFD_RELOC_ARM_THUMB_ADD: howto manager. (line 943) -* BFD_RELOC_ARM_THUMB_IMM: howto manager. (line 944) -* BFD_RELOC_ARM_THUMB_MOVT: howto manager. (line 853) -* BFD_RELOC_ARM_THUMB_MOVT_PCREL: howto manager. (line 855) -* BFD_RELOC_ARM_THUMB_MOVW: howto manager. (line 852) -* BFD_RELOC_ARM_THUMB_MOVW_PCREL: howto manager. (line 854) -* BFD_RELOC_ARM_THUMB_OFFSET: howto manager. (line 826) -* BFD_RELOC_ARM_THUMB_SHIFT: howto manager. (line 945) -* BFD_RELOC_ARM_TLS_CALL: howto manager. (line 877) -* BFD_RELOC_ARM_TLS_DESC: howto manager. (line 881) -* BFD_RELOC_ARM_TLS_DESCSEQ: howto manager. (line 879) -* BFD_RELOC_ARM_TLS_DTPMOD32: howto manager. (line 872) -* BFD_RELOC_ARM_TLS_DTPOFF32: howto manager. (line 871) -* BFD_RELOC_ARM_TLS_GD32: howto manager. (line 868) -* BFD_RELOC_ARM_TLS_GOTDESC: howto manager. (line 876) -* BFD_RELOC_ARM_TLS_IE32: howto manager. (line 874) -* BFD_RELOC_ARM_TLS_LDM32: howto manager. (line 870) -* BFD_RELOC_ARM_TLS_LDO32: howto manager. (line 869) -* BFD_RELOC_ARM_TLS_LE32: howto manager. (line 875) -* BFD_RELOC_ARM_TLS_TPOFF32: howto manager. (line 873) -* BFD_RELOC_ARM_V4BX: howto manager. (line 914) -* BFD_RELOC_AVR_13_PCREL: howto manager. (line 1644) -* BFD_RELOC_AVR_16_PM: howto manager. (line 1648) -* BFD_RELOC_AVR_6: howto manager. (line 1735) -* BFD_RELOC_AVR_6_ADIW: howto manager. (line 1739) -* BFD_RELOC_AVR_7_PCREL: howto manager. (line 1640) -* BFD_RELOC_AVR_8_HI: howto manager. (line 1747) -* BFD_RELOC_AVR_8_HLO: howto manager. (line 1751) -* BFD_RELOC_AVR_8_LO: howto manager. (line 1743) -* BFD_RELOC_AVR_CALL: howto manager. (line 1727) -* BFD_RELOC_AVR_HH8_LDI: howto manager. (line 1660) -* BFD_RELOC_AVR_HH8_LDI_NEG: howto manager. (line 1679) -* BFD_RELOC_AVR_HH8_LDI_PM: howto manager. (line 1708) -* BFD_RELOC_AVR_HH8_LDI_PM_NEG: howto manager. (line 1722) -* BFD_RELOC_AVR_HI8_LDI: howto manager. (line 1656) -* BFD_RELOC_AVR_HI8_LDI_GS: howto manager. (line 1702) -* BFD_RELOC_AVR_HI8_LDI_NEG: howto manager. (line 1674) -* BFD_RELOC_AVR_HI8_LDI_PM: howto manager. (line 1698) -* BFD_RELOC_AVR_HI8_LDI_PM_NEG: howto manager. (line 1717) -* BFD_RELOC_AVR_LDI: howto manager. (line 1731) -* BFD_RELOC_AVR_LO8_LDI: howto manager. (line 1652) -* BFD_RELOC_AVR_LO8_LDI_GS: howto manager. (line 1692) -* BFD_RELOC_AVR_LO8_LDI_NEG: howto manager. (line 1669) -* BFD_RELOC_AVR_LO8_LDI_PM: howto manager. (line 1688) -* BFD_RELOC_AVR_LO8_LDI_PM_NEG: howto manager. (line 1713) -* BFD_RELOC_AVR_MS8_LDI: howto manager. (line 1665) -* BFD_RELOC_AVR_MS8_LDI_NEG: howto manager. (line 1684) -* BFD_RELOC_BFIN_10_PCREL: howto manager. (line 1074) -* BFD_RELOC_BFIN_11_PCREL: howto manager. (line 1077) -* BFD_RELOC_BFIN_12_PCREL_JUMP: howto manager. (line 1080) -* BFD_RELOC_BFIN_12_PCREL_JUMP_S: howto manager. (line 1083) -* BFD_RELOC_BFIN_16_HIGH: howto manager. (line 1062) -* BFD_RELOC_BFIN_16_IMM: howto manager. (line 1059) -* BFD_RELOC_BFIN_16_LOW: howto manager. (line 1071) -* BFD_RELOC_BFIN_24_PCREL_CALL_X: howto manager. (line 1086) -* BFD_RELOC_BFIN_24_PCREL_JUMP_L: howto manager. (line 1089) -* BFD_RELOC_BFIN_4_PCREL: howto manager. (line 1065) -* BFD_RELOC_BFIN_5_PCREL: howto manager. (line 1068) -* BFD_RELOC_BFIN_FUNCDESC: howto manager. (line 1095) -* BFD_RELOC_BFIN_FUNCDESC_GOT17M4: howto manager. (line 1096) -* BFD_RELOC_BFIN_FUNCDESC_GOTHI: howto manager. (line 1097) -* BFD_RELOC_BFIN_FUNCDESC_GOTLO: howto manager. (line 1098) -* BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4: howto manager. (line 1100) -* BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI: howto manager. (line 1101) -* BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO: howto manager. (line 1102) -* BFD_RELOC_BFIN_FUNCDESC_VALUE: howto manager. (line 1099) -* BFD_RELOC_BFIN_GOT: howto manager. (line 1108) -* BFD_RELOC_BFIN_GOT17M4: howto manager. (line 1092) -* BFD_RELOC_BFIN_GOTHI: howto manager. (line 1093) -* BFD_RELOC_BFIN_GOTLO: howto manager. (line 1094) -* BFD_RELOC_BFIN_GOTOFF17M4: howto manager. (line 1103) -* BFD_RELOC_BFIN_GOTOFFHI: howto manager. (line 1104) -* BFD_RELOC_BFIN_GOTOFFLO: howto manager. (line 1105) -* BFD_RELOC_BFIN_PLTPC: howto manager. (line 1111) -* BFD_RELOC_C6000_ABS_H16: howto manager. (line 1463) -* BFD_RELOC_C6000_ABS_L16: howto manager. (line 1462) -* BFD_RELOC_C6000_ABS_S16: howto manager. (line 1461) -* BFD_RELOC_C6000_ALIGN: howto manager. (line 1484) -* BFD_RELOC_C6000_COPY: howto manager. (line 1479) -* BFD_RELOC_C6000_DSBT_INDEX: howto manager. (line 1477) -* BFD_RELOC_C6000_EHTYPE: howto manager. (line 1481) -* BFD_RELOC_C6000_FPHEAD: howto manager. (line 1485) -* BFD_RELOC_C6000_JUMP_SLOT: howto manager. (line 1480) -* BFD_RELOC_C6000_NOCMP: howto manager. (line 1486) -* BFD_RELOC_C6000_PCR_H16: howto manager. (line 1482) -* BFD_RELOC_C6000_PCR_L16: howto manager. (line 1483) -* BFD_RELOC_C6000_PCR_S10: howto manager. (line 1459) -* BFD_RELOC_C6000_PCR_S12: howto manager. (line 1458) -* BFD_RELOC_C6000_PCR_S21: howto manager. (line 1457) -* BFD_RELOC_C6000_PCR_S7: howto manager. (line 1460) -* BFD_RELOC_C6000_PREL31: howto manager. (line 1478) -* BFD_RELOC_C6000_SBR_GOT_H16_W: howto manager. (line 1476) -* BFD_RELOC_C6000_SBR_GOT_L16_W: howto manager. (line 1475) -* BFD_RELOC_C6000_SBR_GOT_U15_W: howto manager. (line 1474) -* BFD_RELOC_C6000_SBR_H16_B: howto manager. (line 1471) -* BFD_RELOC_C6000_SBR_H16_H: howto manager. (line 1472) -* BFD_RELOC_C6000_SBR_H16_W: howto manager. (line 1473) -* BFD_RELOC_C6000_SBR_L16_B: howto manager. (line 1468) -* BFD_RELOC_C6000_SBR_L16_H: howto manager. (line 1469) -* BFD_RELOC_C6000_SBR_L16_W: howto manager. (line 1470) -* BFD_RELOC_C6000_SBR_S16: howto manager. (line 1467) -* BFD_RELOC_C6000_SBR_U15_B: howto manager. (line 1464) -* BFD_RELOC_C6000_SBR_U15_H: howto manager. (line 1465) -* BFD_RELOC_C6000_SBR_U15_W: howto manager. (line 1466) -* bfd_reloc_code_type: howto manager. (line 10) -* BFD_RELOC_CR16_ABS20: howto manager. (line 2264) -* BFD_RELOC_CR16_ABS24: howto manager. (line 2265) -* BFD_RELOC_CR16_DISP16: howto manager. (line 2275) -* BFD_RELOC_CR16_DISP20: howto manager. (line 2276) -* BFD_RELOC_CR16_DISP24: howto manager. (line 2277) -* BFD_RELOC_CR16_DISP24a: howto manager. (line 2278) -* BFD_RELOC_CR16_DISP4: howto manager. (line 2273) -* BFD_RELOC_CR16_DISP8: howto manager. (line 2274) -* BFD_RELOC_CR16_GLOB_DAT: howto manager. (line 2284) -* BFD_RELOC_CR16_GOT_REGREL20: howto manager. (line 2282) -* BFD_RELOC_CR16_GOTC_REGREL20: howto manager. (line 2283) -* BFD_RELOC_CR16_IMM16: howto manager. (line 2268) -* BFD_RELOC_CR16_IMM20: howto manager. (line 2269) -* BFD_RELOC_CR16_IMM24: howto manager. (line 2270) -* BFD_RELOC_CR16_IMM32: howto manager. (line 2271) -* BFD_RELOC_CR16_IMM32a: howto manager. (line 2272) -* BFD_RELOC_CR16_IMM4: howto manager. (line 2266) -* BFD_RELOC_CR16_IMM8: howto manager. (line 2267) -* BFD_RELOC_CR16_NUM16: howto manager. (line 2253) -* BFD_RELOC_CR16_NUM32: howto manager. (line 2254) -* BFD_RELOC_CR16_NUM32a: howto manager. (line 2255) -* BFD_RELOC_CR16_NUM8: howto manager. (line 2252) -* BFD_RELOC_CR16_REGREL0: howto manager. (line 2256) -* BFD_RELOC_CR16_REGREL14: howto manager. (line 2259) -* BFD_RELOC_CR16_REGREL14a: howto manager. (line 2260) -* BFD_RELOC_CR16_REGREL16: howto manager. (line 2261) -* BFD_RELOC_CR16_REGREL20: howto manager. (line 2262) -* BFD_RELOC_CR16_REGREL20a: howto manager. (line 2263) -* BFD_RELOC_CR16_REGREL4: howto manager. (line 2257) -* BFD_RELOC_CR16_REGREL4a: howto manager. (line 2258) -* BFD_RELOC_CR16_SWITCH16: howto manager. (line 2280) -* BFD_RELOC_CR16_SWITCH32: howto manager. (line 2281) -* BFD_RELOC_CR16_SWITCH8: howto manager. (line 2279) -* BFD_RELOC_CRIS_16_DTPREL: howto manager. (line 2355) -* BFD_RELOC_CRIS_16_GOT: howto manager. (line 2331) -* BFD_RELOC_CRIS_16_GOT_GD: howto manager. (line 2351) -* BFD_RELOC_CRIS_16_GOT_TPREL: howto manager. (line 2357) -* BFD_RELOC_CRIS_16_GOTPLT: howto manager. (line 2337) -* BFD_RELOC_CRIS_16_TPREL: howto manager. (line 2359) -* BFD_RELOC_CRIS_32_DTPREL: howto manager. (line 2354) -* BFD_RELOC_CRIS_32_GD: howto manager. (line 2352) -* BFD_RELOC_CRIS_32_GOT: howto manager. (line 2328) -* BFD_RELOC_CRIS_32_GOT_GD: howto manager. (line 2350) -* BFD_RELOC_CRIS_32_GOT_TPREL: howto manager. (line 2356) -* BFD_RELOC_CRIS_32_GOTPLT: howto manager. (line 2334) -* BFD_RELOC_CRIS_32_GOTREL: howto manager. (line 2340) -* BFD_RELOC_CRIS_32_IE: howto manager. (line 2361) -* BFD_RELOC_CRIS_32_PLT_GOTREL: howto manager. (line 2343) -* BFD_RELOC_CRIS_32_PLT_PCREL: howto manager. (line 2346) -* BFD_RELOC_CRIS_32_TPREL: howto manager. (line 2358) -* BFD_RELOC_CRIS_BDISP8: howto manager. (line 2309) -* BFD_RELOC_CRIS_COPY: howto manager. (line 2322) -* BFD_RELOC_CRIS_DTP: howto manager. (line 2353) -* BFD_RELOC_CRIS_DTPMOD: howto manager. (line 2360) -* BFD_RELOC_CRIS_GLOB_DAT: howto manager. (line 2323) -* BFD_RELOC_CRIS_JUMP_SLOT: howto manager. (line 2324) -* BFD_RELOC_CRIS_LAPCQ_OFFSET: howto manager. (line 2317) -* BFD_RELOC_CRIS_RELATIVE: howto manager. (line 2325) -* BFD_RELOC_CRIS_SIGNED_16: howto manager. (line 2315) -* BFD_RELOC_CRIS_SIGNED_6: howto manager. (line 2311) -* BFD_RELOC_CRIS_SIGNED_8: howto manager. (line 2313) -* BFD_RELOC_CRIS_UNSIGNED_16: howto manager. (line 2316) -* BFD_RELOC_CRIS_UNSIGNED_4: howto manager. (line 2318) -* BFD_RELOC_CRIS_UNSIGNED_5: howto manager. (line 2310) -* BFD_RELOC_CRIS_UNSIGNED_6: howto manager. (line 2312) -* BFD_RELOC_CRIS_UNSIGNED_8: howto manager. (line 2314) -* BFD_RELOC_CRX_ABS16: howto manager. (line 2297) -* BFD_RELOC_CRX_ABS32: howto manager. (line 2298) -* BFD_RELOC_CRX_IMM16: howto manager. (line 2302) -* BFD_RELOC_CRX_IMM32: howto manager. (line 2303) -* BFD_RELOC_CRX_NUM16: howto manager. (line 2300) -* BFD_RELOC_CRX_NUM32: howto manager. (line 2301) -* BFD_RELOC_CRX_NUM8: howto manager. (line 2299) -* BFD_RELOC_CRX_REGREL12: howto manager. (line 2293) -* BFD_RELOC_CRX_REGREL22: howto manager. (line 2294) -* BFD_RELOC_CRX_REGREL28: howto manager. (line 2295) -* BFD_RELOC_CRX_REGREL32: howto manager. (line 2296) -* BFD_RELOC_CRX_REL16: howto manager. (line 2290) -* BFD_RELOC_CRX_REL24: howto manager. (line 2291) -* BFD_RELOC_CRX_REL32: howto manager. (line 2292) -* BFD_RELOC_CRX_REL4: howto manager. (line 2287) -* BFD_RELOC_CRX_REL8: howto manager. (line 2288) -* BFD_RELOC_CRX_REL8_CMP: howto manager. (line 2289) -* BFD_RELOC_CRX_SWITCH16: howto manager. (line 2305) -* BFD_RELOC_CRX_SWITCH32: howto manager. (line 2306) -* BFD_RELOC_CRX_SWITCH8: howto manager. (line 2304) -* BFD_RELOC_CTOR: howto manager. (line 783) -* BFD_RELOC_D10V_10_PCREL_L: howto manager. (line 1178) -* BFD_RELOC_D10V_10_PCREL_R: howto manager. (line 1174) -* BFD_RELOC_D10V_18: howto manager. (line 1183) -* BFD_RELOC_D10V_18_PCREL: howto manager. (line 1186) -* BFD_RELOC_D30V_15: howto manager. (line 1201) -* BFD_RELOC_D30V_15_PCREL: howto manager. (line 1205) -* BFD_RELOC_D30V_15_PCREL_R: howto manager. (line 1209) -* BFD_RELOC_D30V_21: howto manager. (line 1214) -* BFD_RELOC_D30V_21_PCREL: howto manager. (line 1218) -* BFD_RELOC_D30V_21_PCREL_R: howto manager. (line 1222) -* BFD_RELOC_D30V_32: howto manager. (line 1227) -* BFD_RELOC_D30V_32_PCREL: howto manager. (line 1230) -* BFD_RELOC_D30V_6: howto manager. (line 1189) -* BFD_RELOC_D30V_9_PCREL: howto manager. (line 1192) -* BFD_RELOC_D30V_9_PCREL_R: howto manager. (line 1196) -* BFD_RELOC_DLX_HI16_S: howto manager. (line 1233) -* BFD_RELOC_DLX_JMP26: howto manager. (line 1239) -* BFD_RELOC_DLX_LO16: howto manager. (line 1236) -* BFD_RELOC_EPIPHANY_HIGH: howto manager. (line 3238) -* BFD_RELOC_EPIPHANY_IMM11: howto manager. (line 3247) -* BFD_RELOC_EPIPHANY_IMM8: howto manager. (line 3251) -* BFD_RELOC_EPIPHANY_LOW: howto manager. (line 3241) -* BFD_RELOC_EPIPHANY_SIMM11: howto manager. (line 3244) -* BFD_RELOC_EPIPHANY_SIMM24: howto manager. (line 3235) -* BFD_RELOC_EPIPHANY_SIMM8: howto manager. (line 3232) -* BFD_RELOC_FR30_10_IN_8: howto manager. (line 1508) -* BFD_RELOC_FR30_12_PCREL: howto manager. (line 1516) -* BFD_RELOC_FR30_20: howto manager. (line 1492) -* BFD_RELOC_FR30_48: howto manager. (line 1489) -* BFD_RELOC_FR30_6_IN_4: howto manager. (line 1496) -* BFD_RELOC_FR30_8_IN_8: howto manager. (line 1500) -* BFD_RELOC_FR30_9_IN_8: howto manager. (line 1504) -* BFD_RELOC_FR30_9_PCREL: howto manager. (line 1512) -* BFD_RELOC_FRV_FUNCDESC: howto manager. (line 491) -* BFD_RELOC_FRV_FUNCDESC_GOT12: howto manager. (line 492) -* BFD_RELOC_FRV_FUNCDESC_GOTHI: howto manager. (line 493) -* BFD_RELOC_FRV_FUNCDESC_GOTLO: howto manager. (line 494) -* BFD_RELOC_FRV_FUNCDESC_GOTOFF12: howto manager. (line 496) -* BFD_RELOC_FRV_FUNCDESC_GOTOFFHI: howto manager. (line 497) -* BFD_RELOC_FRV_FUNCDESC_GOTOFFLO: howto manager. (line 498) -* BFD_RELOC_FRV_FUNCDESC_VALUE: howto manager. (line 495) -* BFD_RELOC_FRV_GETTLSOFF: howto manager. (line 502) -* BFD_RELOC_FRV_GETTLSOFF_RELAX: howto manager. (line 515) -* BFD_RELOC_FRV_GOT12: howto manager. (line 488) -* BFD_RELOC_FRV_GOTHI: howto manager. (line 489) -* BFD_RELOC_FRV_GOTLO: howto manager. (line 490) -* BFD_RELOC_FRV_GOTOFF12: howto manager. (line 499) -* BFD_RELOC_FRV_GOTOFFHI: howto manager. (line 500) -* BFD_RELOC_FRV_GOTOFFLO: howto manager. (line 501) -* BFD_RELOC_FRV_GOTTLSDESC12: howto manager. (line 504) -* BFD_RELOC_FRV_GOTTLSDESCHI: howto manager. (line 505) -* BFD_RELOC_FRV_GOTTLSDESCLO: howto manager. (line 506) -* BFD_RELOC_FRV_GOTTLSOFF12: howto manager. (line 510) -* BFD_RELOC_FRV_GOTTLSOFFHI: howto manager. (line 511) -* BFD_RELOC_FRV_GOTTLSOFFLO: howto manager. (line 512) -* BFD_RELOC_FRV_GPREL12: howto manager. (line 483) -* BFD_RELOC_FRV_GPREL32: howto manager. (line 485) -* BFD_RELOC_FRV_GPRELHI: howto manager. (line 486) -* BFD_RELOC_FRV_GPRELLO: howto manager. (line 487) -* BFD_RELOC_FRV_GPRELU12: howto manager. (line 484) -* BFD_RELOC_FRV_HI16: howto manager. (line 482) -* BFD_RELOC_FRV_LABEL16: howto manager. (line 479) -* BFD_RELOC_FRV_LABEL24: howto manager. (line 480) -* BFD_RELOC_FRV_LO16: howto manager. (line 481) -* BFD_RELOC_FRV_TLSDESC_RELAX: howto manager. (line 514) -* BFD_RELOC_FRV_TLSDESC_VALUE: howto manager. (line 503) -* BFD_RELOC_FRV_TLSMOFF: howto manager. (line 517) -* BFD_RELOC_FRV_TLSMOFF12: howto manager. (line 507) -* BFD_RELOC_FRV_TLSMOFFHI: howto manager. (line 508) -* BFD_RELOC_FRV_TLSMOFFLO: howto manager. (line 509) -* BFD_RELOC_FRV_TLSOFF: howto manager. (line 513) -* BFD_RELOC_FRV_TLSOFF_RELAX: howto manager. (line 516) -* BFD_RELOC_GPREL16: howto manager. (line 125) -* BFD_RELOC_GPREL32: howto manager. (line 126) -* BFD_RELOC_H8_DIR16A8: howto manager. (line 2402) -* BFD_RELOC_H8_DIR16R8: howto manager. (line 2403) -* BFD_RELOC_H8_DIR24A8: howto manager. (line 2404) -* BFD_RELOC_H8_DIR24R8: howto manager. (line 2405) -* BFD_RELOC_H8_DIR32A16: howto manager. (line 2406) -* BFD_RELOC_H8_DISP32A16: howto manager. (line 2407) -* BFD_RELOC_HI16: howto manager. (line 352) -* BFD_RELOC_HI16_BASEREL: howto manager. (line 101) -* BFD_RELOC_HI16_GOTOFF: howto manager. (line 57) -* BFD_RELOC_HI16_PCREL: howto manager. (line 364) -* BFD_RELOC_HI16_PLTOFF: howto manager. (line 69) -* BFD_RELOC_HI16_S: howto manager. (line 355) -* BFD_RELOC_HI16_S_BASEREL: howto manager. (line 102) -* BFD_RELOC_HI16_S_GOTOFF: howto manager. (line 58) -* BFD_RELOC_HI16_S_PCREL: howto manager. (line 367) -* BFD_RELOC_HI16_S_PLTOFF: howto manager. (line 70) -* BFD_RELOC_HI22: howto manager. (line 120) -* BFD_RELOC_I370_D12: howto manager. (line 780) -* BFD_RELOC_I960_CALLJ: howto manager. (line 132) -* BFD_RELOC_IA64_COPY: howto manager. (line 2084) -* BFD_RELOC_IA64_DIR32LSB: howto manager. (line 2029) -* BFD_RELOC_IA64_DIR32MSB: howto manager. (line 2028) -* BFD_RELOC_IA64_DIR64LSB: howto manager. (line 2031) -* BFD_RELOC_IA64_DIR64MSB: howto manager. (line 2030) -* BFD_RELOC_IA64_DTPMOD64LSB: howto manager. (line 2094) -* BFD_RELOC_IA64_DTPMOD64MSB: howto manager. (line 2093) -* BFD_RELOC_IA64_DTPREL14: howto manager. (line 2096) -* BFD_RELOC_IA64_DTPREL22: howto manager. (line 2097) -* BFD_RELOC_IA64_DTPREL32LSB: howto manager. (line 2100) -* BFD_RELOC_IA64_DTPREL32MSB: howto manager. (line 2099) -* BFD_RELOC_IA64_DTPREL64I: howto manager. (line 2098) -* BFD_RELOC_IA64_DTPREL64LSB: howto manager. (line 2102) -* BFD_RELOC_IA64_DTPREL64MSB: howto manager. (line 2101) -* BFD_RELOC_IA64_FPTR32LSB: howto manager. (line 2046) -* BFD_RELOC_IA64_FPTR32MSB: howto manager. (line 2045) -* BFD_RELOC_IA64_FPTR64I: howto manager. (line 2044) -* BFD_RELOC_IA64_FPTR64LSB: howto manager. (line 2048) -* BFD_RELOC_IA64_FPTR64MSB: howto manager. (line 2047) -* BFD_RELOC_IA64_GPREL22: howto manager. (line 2032) -* BFD_RELOC_IA64_GPREL32LSB: howto manager. (line 2035) -* BFD_RELOC_IA64_GPREL32MSB: howto manager. (line 2034) -* BFD_RELOC_IA64_GPREL64I: howto manager. (line 2033) -* BFD_RELOC_IA64_GPREL64LSB: howto manager. (line 2037) -* BFD_RELOC_IA64_GPREL64MSB: howto manager. (line 2036) -* BFD_RELOC_IA64_IMM14: howto manager. (line 2025) -* BFD_RELOC_IA64_IMM22: howto manager. (line 2026) -* BFD_RELOC_IA64_IMM64: howto manager. (line 2027) -* BFD_RELOC_IA64_IPLTLSB: howto manager. (line 2083) -* BFD_RELOC_IA64_IPLTMSB: howto manager. (line 2082) -* BFD_RELOC_IA64_LDXMOV: howto manager. (line 2086) -* BFD_RELOC_IA64_LTOFF22: howto manager. (line 2038) -* BFD_RELOC_IA64_LTOFF22X: howto manager. (line 2085) -* BFD_RELOC_IA64_LTOFF64I: howto manager. (line 2039) -* BFD_RELOC_IA64_LTOFF_DTPMOD22: howto manager. (line 2095) -* BFD_RELOC_IA64_LTOFF_DTPREL22: howto manager. (line 2103) -* BFD_RELOC_IA64_LTOFF_FPTR22: howto manager. (line 2060) -* BFD_RELOC_IA64_LTOFF_FPTR32LSB: howto manager. (line 2063) -* BFD_RELOC_IA64_LTOFF_FPTR32MSB: howto manager. (line 2062) -* BFD_RELOC_IA64_LTOFF_FPTR64I: howto manager. (line 2061) -* BFD_RELOC_IA64_LTOFF_FPTR64LSB: howto manager. (line 2065) -* BFD_RELOC_IA64_LTOFF_FPTR64MSB: howto manager. (line 2064) -* BFD_RELOC_IA64_LTOFF_TPREL22: howto manager. (line 2092) -* BFD_RELOC_IA64_LTV32LSB: howto manager. (line 2079) -* BFD_RELOC_IA64_LTV32MSB: howto manager. (line 2078) -* BFD_RELOC_IA64_LTV64LSB: howto manager. (line 2081) -* BFD_RELOC_IA64_LTV64MSB: howto manager. (line 2080) -* BFD_RELOC_IA64_PCREL21B: howto manager. (line 2049) -* BFD_RELOC_IA64_PCREL21BI: howto manager. (line 2050) -* BFD_RELOC_IA64_PCREL21F: howto manager. (line 2052) -* BFD_RELOC_IA64_PCREL21M: howto manager. (line 2051) -* BFD_RELOC_IA64_PCREL22: howto manager. (line 2053) -* BFD_RELOC_IA64_PCREL32LSB: howto manager. (line 2057) -* BFD_RELOC_IA64_PCREL32MSB: howto manager. (line 2056) -* BFD_RELOC_IA64_PCREL60B: howto manager. (line 2054) -* BFD_RELOC_IA64_PCREL64I: howto manager. (line 2055) -* BFD_RELOC_IA64_PCREL64LSB: howto manager. (line 2059) -* BFD_RELOC_IA64_PCREL64MSB: howto manager. (line 2058) -* BFD_RELOC_IA64_PLTOFF22: howto manager. (line 2040) -* BFD_RELOC_IA64_PLTOFF64I: howto manager. (line 2041) -* BFD_RELOC_IA64_PLTOFF64LSB: howto manager. (line 2043) -* BFD_RELOC_IA64_PLTOFF64MSB: howto manager. (line 2042) -* BFD_RELOC_IA64_REL32LSB: howto manager. (line 2075) -* BFD_RELOC_IA64_REL32MSB: howto manager. (line 2074) -* BFD_RELOC_IA64_REL64LSB: howto manager. (line 2077) -* BFD_RELOC_IA64_REL64MSB: howto manager. (line 2076) -* BFD_RELOC_IA64_SECREL32LSB: howto manager. (line 2071) -* BFD_RELOC_IA64_SECREL32MSB: howto manager. (line 2070) -* BFD_RELOC_IA64_SECREL64LSB: howto manager. (line 2073) -* BFD_RELOC_IA64_SECREL64MSB: howto manager. (line 2072) -* BFD_RELOC_IA64_SEGREL32LSB: howto manager. (line 2067) -* BFD_RELOC_IA64_SEGREL32MSB: howto manager. (line 2066) -* BFD_RELOC_IA64_SEGREL64LSB: howto manager. (line 2069) -* BFD_RELOC_IA64_SEGREL64MSB: howto manager. (line 2068) -* BFD_RELOC_IA64_TPREL14: howto manager. (line 2087) -* BFD_RELOC_IA64_TPREL22: howto manager. (line 2088) -* BFD_RELOC_IA64_TPREL64I: howto manager. (line 2089) -* BFD_RELOC_IA64_TPREL64LSB: howto manager. (line 2091) -* BFD_RELOC_IA64_TPREL64MSB: howto manager. (line 2090) -* BFD_RELOC_IP2K_ADDR16CJP: howto manager. (line 1977) -* BFD_RELOC_IP2K_BANK: howto manager. (line 1974) -* BFD_RELOC_IP2K_EX8DATA: howto manager. (line 1985) -* BFD_RELOC_IP2K_FR9: howto manager. (line 1971) -* BFD_RELOC_IP2K_FR_OFFSET: howto manager. (line 1998) -* BFD_RELOC_IP2K_HI8DATA: howto manager. (line 1984) -* BFD_RELOC_IP2K_HI8INSN: howto manager. (line 1989) -* BFD_RELOC_IP2K_LO8DATA: howto manager. (line 1983) -* BFD_RELOC_IP2K_LO8INSN: howto manager. (line 1988) -* BFD_RELOC_IP2K_PAGE3: howto manager. (line 1980) -* BFD_RELOC_IP2K_PC_SKIP: howto manager. (line 1992) -* BFD_RELOC_IP2K_TEXT: howto manager. (line 1995) -* BFD_RELOC_IQ2000_OFFSET_16: howto manager. (line 2508) -* BFD_RELOC_IQ2000_OFFSET_21: howto manager. (line 2509) -* BFD_RELOC_IQ2000_UHI16: howto manager. (line 2510) -* BFD_RELOC_LM32_16_GOT: howto manager. (line 2615) -* BFD_RELOC_LM32_BRANCH: howto manager. (line 2614) -* BFD_RELOC_LM32_CALL: howto manager. (line 2613) -* BFD_RELOC_LM32_COPY: howto manager. (line 2618) -* BFD_RELOC_LM32_GLOB_DAT: howto manager. (line 2619) -* BFD_RELOC_LM32_GOTOFF_HI16: howto manager. (line 2616) -* BFD_RELOC_LM32_GOTOFF_LO16: howto manager. (line 2617) -* BFD_RELOC_LM32_JMP_SLOT: howto manager. (line 2620) -* BFD_RELOC_LM32_RELATIVE: howto manager. (line 2621) -* BFD_RELOC_LO10: howto manager. (line 121) -* BFD_RELOC_LO16: howto manager. (line 361) -* BFD_RELOC_LO16_BASEREL: howto manager. (line 100) -* BFD_RELOC_LO16_GOTOFF: howto manager. (line 56) -* BFD_RELOC_LO16_PCREL: howto manager. (line 370) -* BFD_RELOC_LO16_PLTOFF: howto manager. (line 68) -* BFD_RELOC_M32C_HI8: howto manager. (line 1242) -* BFD_RELOC_M32C_RL_1ADDR: howto manager. (line 1244) -* BFD_RELOC_M32C_RL_2ADDR: howto manager. (line 1245) -* BFD_RELOC_M32C_RL_JUMP: howto manager. (line 1243) -* BFD_RELOC_M32R_10_PCREL: howto manager. (line 1252) -* BFD_RELOC_M32R_18_PCREL: howto manager. (line 1256) -* BFD_RELOC_M32R_24: howto manager. (line 1248) -* BFD_RELOC_M32R_26_PCREL: howto manager. (line 1259) -* BFD_RELOC_M32R_26_PLTREL: howto manager. (line 1278) -* BFD_RELOC_M32R_COPY: howto manager. (line 1279) -* BFD_RELOC_M32R_GLOB_DAT: howto manager. (line 1280) -* BFD_RELOC_M32R_GOT16_HI_SLO: howto manager. (line 1289) -* BFD_RELOC_M32R_GOT16_HI_ULO: howto manager. (line 1288) -* BFD_RELOC_M32R_GOT16_LO: howto manager. (line 1290) -* BFD_RELOC_M32R_GOT24: howto manager. (line 1277) -* BFD_RELOC_M32R_GOTOFF: howto manager. (line 1283) -* BFD_RELOC_M32R_GOTOFF_HI_SLO: howto manager. (line 1285) -* BFD_RELOC_M32R_GOTOFF_HI_ULO: howto manager. (line 1284) -* BFD_RELOC_M32R_GOTOFF_LO: howto manager. (line 1286) -* BFD_RELOC_M32R_GOTPC24: howto manager. (line 1287) -* BFD_RELOC_M32R_GOTPC_HI_SLO: howto manager. (line 1292) -* BFD_RELOC_M32R_GOTPC_HI_ULO: howto manager. (line 1291) -* BFD_RELOC_M32R_GOTPC_LO: howto manager. (line 1293) -* BFD_RELOC_M32R_HI16_SLO: howto manager. (line 1266) -* BFD_RELOC_M32R_HI16_ULO: howto manager. (line 1262) -* BFD_RELOC_M32R_JMP_SLOT: howto manager. (line 1281) -* BFD_RELOC_M32R_LO16: howto manager. (line 1270) -* BFD_RELOC_M32R_RELATIVE: howto manager. (line 1282) -* BFD_RELOC_M32R_SDA16: howto manager. (line 1273) -* BFD_RELOC_M68HC11_24: howto manager. (line 2139) -* BFD_RELOC_M68HC11_3B: howto manager. (line 2114) -* BFD_RELOC_M68HC11_HI8: howto manager. (line 2106) -* BFD_RELOC_M68HC11_LO16: howto manager. (line 2128) -* BFD_RELOC_M68HC11_LO8: howto manager. (line 2110) -* BFD_RELOC_M68HC11_PAGE: howto manager. (line 2134) -* BFD_RELOC_M68HC11_RL_GROUP: howto manager. (line 2123) -* BFD_RELOC_M68HC11_RL_JUMP: howto manager. (line 2117) -* BFD_RELOC_M68HC12_10_PCREL: howto manager. (line 2199) -* BFD_RELOC_M68HC12_16B: howto manager. (line 2193) -* BFD_RELOC_M68HC12_5B: howto manager. (line 2145) -* BFD_RELOC_M68HC12_9_PCREL: howto manager. (line 2196) -* BFD_RELOC_M68HC12_9B: howto manager. (line 2190) -* BFD_RELOC_M68HC12_HI8XG: howto manager. (line 2206) -* BFD_RELOC_M68HC12_LO8XG: howto manager. (line 2202) -* BFD_RELOC_MACH_O_LOCAL_SECTDIFF: howto manager. (line 2628) -* BFD_RELOC_MACH_O_PAIR: howto manager. (line 2631) -* BFD_RELOC_MACH_O_SECTDIFF: howto manager. (line 2624) -* BFD_RELOC_MACH_O_X86_64_BRANCH32: howto manager. (line 2634) -* BFD_RELOC_MACH_O_X86_64_BRANCH8: howto manager. (line 2635) -* BFD_RELOC_MACH_O_X86_64_GOT: howto manager. (line 2639) -* BFD_RELOC_MACH_O_X86_64_GOT_LOAD: howto manager. (line 2642) -* BFD_RELOC_MACH_O_X86_64_PCREL32_1: howto manager. (line 2652) -* BFD_RELOC_MACH_O_X86_64_PCREL32_2: howto manager. (line 2655) -* BFD_RELOC_MACH_O_X86_64_PCREL32_4: howto manager. (line 2658) -* BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32: howto manager. (line 2646) -* BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64: howto manager. (line 2649) -* BFD_RELOC_MCORE_PCREL_32: howto manager. (line 1523) -* BFD_RELOC_MCORE_PCREL_IMM11BY2: howto manager. (line 1521) -* BFD_RELOC_MCORE_PCREL_IMM4BY2: howto manager. (line 1522) -* BFD_RELOC_MCORE_PCREL_IMM8BY4: howto manager. (line 1520) -* BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2: howto manager. (line 1524) -* BFD_RELOC_MCORE_RVA: howto manager. (line 1525) -* BFD_RELOC_MEP_16: howto manager. (line 1529) -* BFD_RELOC_MEP_32: howto manager. (line 1530) -* BFD_RELOC_MEP_8: howto manager. (line 1528) -* BFD_RELOC_MEP_ADDR24A4: howto manager. (line 1545) -* BFD_RELOC_MEP_GNU_VTENTRY: howto manager. (line 1547) -* BFD_RELOC_MEP_GNU_VTINHERIT: howto manager. (line 1546) -* BFD_RELOC_MEP_GPREL: howto manager. (line 1539) -* BFD_RELOC_MEP_HI16S: howto manager. (line 1538) -* BFD_RELOC_MEP_HI16U: howto manager. (line 1537) -* BFD_RELOC_MEP_LOW16: howto manager. (line 1536) -* BFD_RELOC_MEP_PCABS24A2: howto manager. (line 1535) -* BFD_RELOC_MEP_PCREL12A2: howto manager. (line 1532) -* BFD_RELOC_MEP_PCREL17A2: howto manager. (line 1533) -* BFD_RELOC_MEP_PCREL24A2: howto manager. (line 1534) -* BFD_RELOC_MEP_PCREL8A2: howto manager. (line 1531) -* BFD_RELOC_MEP_TPREL: howto manager. (line 1540) -* BFD_RELOC_MEP_TPREL7: howto manager. (line 1541) -* BFD_RELOC_MEP_TPREL7A2: howto manager. (line 1542) -* BFD_RELOC_MEP_TPREL7A4: howto manager. (line 1543) -* BFD_RELOC_MEP_UIMM24: howto manager. (line 1544) -* BFD_RELOC_METAG_COPY: howto manager. (line 1569) -* BFD_RELOC_METAG_GETSET_GOT: howto manager. (line 1561) -* BFD_RELOC_METAG_GETSET_GOTOFF: howto manager. (line 1560) -* BFD_RELOC_METAG_GETSETOFF: howto manager. (line 1553) -* BFD_RELOC_METAG_GLOB_DAT: howto manager. (line 1572) -* BFD_RELOC_METAG_GOTOFF: howto manager. (line 1567) -* BFD_RELOC_METAG_HI16_GOTOFF: howto manager. (line 1558) -* BFD_RELOC_METAG_HI16_GOTPC: howto manager. (line 1562) -* BFD_RELOC_METAG_HI16_PLT: howto manager. (line 1564) -* BFD_RELOC_METAG_HIADDR16: howto manager. (line 1550) -* BFD_RELOC_METAG_HIOG: howto manager. (line 1554) -* BFD_RELOC_METAG_JMP_SLOT: howto manager. (line 1570) -* BFD_RELOC_METAG_LO16_GOTOFF: howto manager. (line 1559) -* BFD_RELOC_METAG_LO16_GOTPC: howto manager. (line 1563) -* BFD_RELOC_METAG_LO16_PLT: howto manager. (line 1565) -* BFD_RELOC_METAG_LOADDR16: howto manager. (line 1551) -* BFD_RELOC_METAG_LOOG: howto manager. (line 1555) -* BFD_RELOC_METAG_PLT: howto manager. (line 1568) -* BFD_RELOC_METAG_REL16: howto manager. (line 1557) -* BFD_RELOC_METAG_REL8: howto manager. (line 1556) -* BFD_RELOC_METAG_RELATIVE: howto manager. (line 1571) -* BFD_RELOC_METAG_RELBRANCH: howto manager. (line 1552) -* BFD_RELOC_METAG_RELBRANCH_PLT: howto manager. (line 1566) -* BFD_RELOC_METAG_TLS_DTPMOD: howto manager. (line 1583) -* BFD_RELOC_METAG_TLS_DTPOFF: howto manager. (line 1584) -* BFD_RELOC_METAG_TLS_GD: howto manager. (line 1573) -* BFD_RELOC_METAG_TLS_IE: howto manager. (line 1578) -* BFD_RELOC_METAG_TLS_IENONPIC: howto manager. (line 1579) -* BFD_RELOC_METAG_TLS_IENONPIC_HI16: howto manager. (line 1580) -* BFD_RELOC_METAG_TLS_IENONPIC_LO16: howto manager. (line 1581) -* BFD_RELOC_METAG_TLS_LDM: howto manager. (line 1574) -* BFD_RELOC_METAG_TLS_LDO: howto manager. (line 1577) -* BFD_RELOC_METAG_TLS_LDO_HI16: howto manager. (line 1575) -* BFD_RELOC_METAG_TLS_LDO_LO16: howto manager. (line 1576) -* BFD_RELOC_METAG_TLS_LE: howto manager. (line 1585) -* BFD_RELOC_METAG_TLS_LE_HI16: howto manager. (line 1586) -* BFD_RELOC_METAG_TLS_LE_LO16: howto manager. (line 1587) -* BFD_RELOC_METAG_TLS_TPOFF: howto manager. (line 1582) -* BFD_RELOC_MICROBLAZE_32_GOTOFF: howto manager. (line 2705) -* BFD_RELOC_MICROBLAZE_32_LO: howto manager. (line 2661) -* BFD_RELOC_MICROBLAZE_32_LO_PCREL: howto manager. (line 2665) -* BFD_RELOC_MICROBLAZE_32_ROSDA: howto manager. (line 2669) -* BFD_RELOC_MICROBLAZE_32_RWSDA: howto manager. (line 2673) -* BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM: howto manager. (line 2677) -* BFD_RELOC_MICROBLAZE_32_TLSDTPMOD: howto manager. (line 2726) -* BFD_RELOC_MICROBLAZE_32_TLSDTPREL: howto manager. (line 2729) -* BFD_RELOC_MICROBLAZE_64_GOT: howto manager. (line 2691) -* BFD_RELOC_MICROBLAZE_64_GOTOFF: howto manager. (line 2700) -* BFD_RELOC_MICROBLAZE_64_GOTPC: howto manager. (line 2686) -* BFD_RELOC_MICROBLAZE_64_NONE: howto manager. (line 2681) -* BFD_RELOC_MICROBLAZE_64_PLT: howto manager. (line 2695) -* BFD_RELOC_MICROBLAZE_64_TLS: howto manager. (line 2713) -* BFD_RELOC_MICROBLAZE_64_TLSDTPREL: howto manager. (line 2732) -* BFD_RELOC_MICROBLAZE_64_TLSGD: howto manager. (line 2716) -* BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL: howto manager. (line 2736) -* BFD_RELOC_MICROBLAZE_64_TLSLD: howto manager. (line 2721) -* BFD_RELOC_MICROBLAZE_64_TLSTPREL: howto manager. (line 2740) -* BFD_RELOC_MICROBLAZE_COPY: howto manager. (line 2709) -* BFD_RELOC_MICROMIPS_10_PCREL_S1: howto manager. (line 404) -* BFD_RELOC_MICROMIPS_16_PCREL_S1: howto manager. (line 405) -* BFD_RELOC_MICROMIPS_7_PCREL_S1: howto manager. (line 403) -* BFD_RELOC_MICROMIPS_CALL16: howto manager. (line 417) -* BFD_RELOC_MICROMIPS_CALL_HI16: howto manager. (line 423) -* BFD_RELOC_MICROMIPS_CALL_LO16: howto manager. (line 425) -* BFD_RELOC_MICROMIPS_GOT16: howto manager. (line 415) -* BFD_RELOC_MICROMIPS_GOT_DISP: howto manager. (line 433) -* BFD_RELOC_MICROMIPS_GOT_HI16: howto manager. (line 419) -* BFD_RELOC_MICROMIPS_GOT_LO16: howto manager. (line 421) -* BFD_RELOC_MICROMIPS_GOT_OFST: howto manager. (line 431) -* BFD_RELOC_MICROMIPS_GOT_PAGE: howto manager. (line 429) -* BFD_RELOC_MICROMIPS_GPREL16: howto manager. (line 408) -* BFD_RELOC_MICROMIPS_HI16: howto manager. (line 409) -* BFD_RELOC_MICROMIPS_HI16_S: howto manager. (line 410) -* BFD_RELOC_MICROMIPS_HIGHER: howto manager. (line 442) -* BFD_RELOC_MICROMIPS_HIGHEST: howto manager. (line 440) -* BFD_RELOC_MICROMIPS_JALR: howto manager. (line 448) -* BFD_RELOC_MICROMIPS_JMP: howto manager. (line 343) -* BFD_RELOC_MICROMIPS_LITERAL: howto manager. (line 400) -* BFD_RELOC_MICROMIPS_LO16: howto manager. (line 411) -* BFD_RELOC_MICROMIPS_SCN_DISP: howto manager. (line 444) -* BFD_RELOC_MICROMIPS_SUB: howto manager. (line 427) -* BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16: howto manager. (line 458) -* BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16: howto manager. (line 460) -* BFD_RELOC_MICROMIPS_TLS_GD: howto manager. (line 454) -* BFD_RELOC_MICROMIPS_TLS_GOTTPREL: howto manager. (line 462) -* BFD_RELOC_MICROMIPS_TLS_LDM: howto manager. (line 456) -* BFD_RELOC_MICROMIPS_TLS_TPREL_HI16: howto manager. (line 466) -* BFD_RELOC_MICROMIPS_TLS_TPREL_LO16: howto manager. (line 468) -* BFD_RELOC_MIPS16_CALL16: howto manager. (line 374) -* BFD_RELOC_MIPS16_GOT16: howto manager. (line 373) -* BFD_RELOC_MIPS16_GPREL: howto manager. (line 349) -* BFD_RELOC_MIPS16_HI16: howto manager. (line 378) -* BFD_RELOC_MIPS16_HI16_S: howto manager. (line 381) -* BFD_RELOC_MIPS16_JMP: howto manager. (line 346) -* BFD_RELOC_MIPS16_LO16: howto manager. (line 387) -* BFD_RELOC_MIPS16_TLS_DTPREL_HI16: howto manager. (line 392) -* BFD_RELOC_MIPS16_TLS_DTPREL_LO16: howto manager. (line 393) -* BFD_RELOC_MIPS16_TLS_GD: howto manager. (line 390) -* BFD_RELOC_MIPS16_TLS_GOTTPREL: howto manager. (line 394) -* BFD_RELOC_MIPS16_TLS_LDM: howto manager. (line 391) -* BFD_RELOC_MIPS16_TLS_TPREL_HI16: howto manager. (line 395) -* BFD_RELOC_MIPS16_TLS_TPREL_LO16: howto manager. (line 396) -* BFD_RELOC_MIPS_CALL16: howto manager. (line 416) -* BFD_RELOC_MIPS_CALL_HI16: howto manager. (line 422) -* BFD_RELOC_MIPS_CALL_LO16: howto manager. (line 424) -* BFD_RELOC_MIPS_COPY: howto manager. (line 472) -* BFD_RELOC_MIPS_DELETE: howto manager. (line 438) -* BFD_RELOC_MIPS_EH: howto manager. (line 469) -* BFD_RELOC_MIPS_GOT16: howto manager. (line 414) -* BFD_RELOC_MIPS_GOT_DISP: howto manager. (line 432) -* BFD_RELOC_MIPS_GOT_HI16: howto manager. (line 418) -* BFD_RELOC_MIPS_GOT_LO16: howto manager. (line 420) -* BFD_RELOC_MIPS_GOT_OFST: howto manager. (line 430) -* BFD_RELOC_MIPS_GOT_PAGE: howto manager. (line 428) -* BFD_RELOC_MIPS_HIGHER: howto manager. (line 441) -* BFD_RELOC_MIPS_HIGHEST: howto manager. (line 439) -* BFD_RELOC_MIPS_INSERT_A: howto manager. (line 436) -* BFD_RELOC_MIPS_INSERT_B: howto manager. (line 437) -* BFD_RELOC_MIPS_JALR: howto manager. (line 447) -* BFD_RELOC_MIPS_JMP: howto manager. (line 342) -* BFD_RELOC_MIPS_JUMP_SLOT: howto manager. (line 473) -* BFD_RELOC_MIPS_LITERAL: howto manager. (line 399) -* BFD_RELOC_MIPS_REL16: howto manager. (line 445) -* BFD_RELOC_MIPS_RELGOT: howto manager. (line 446) -* BFD_RELOC_MIPS_SCN_DISP: howto manager. (line 443) -* BFD_RELOC_MIPS_SHIFT5: howto manager. (line 434) -* BFD_RELOC_MIPS_SHIFT6: howto manager. (line 435) -* BFD_RELOC_MIPS_SUB: howto manager. (line 426) -* BFD_RELOC_MIPS_TLS_DTPMOD32: howto manager. (line 449) -* BFD_RELOC_MIPS_TLS_DTPMOD64: howto manager. (line 451) -* BFD_RELOC_MIPS_TLS_DTPREL32: howto manager. (line 450) -* BFD_RELOC_MIPS_TLS_DTPREL64: howto manager. (line 452) -* BFD_RELOC_MIPS_TLS_DTPREL_HI16: howto manager. (line 457) -* BFD_RELOC_MIPS_TLS_DTPREL_LO16: howto manager. (line 459) -* BFD_RELOC_MIPS_TLS_GD: howto manager. (line 453) -* BFD_RELOC_MIPS_TLS_GOTTPREL: howto manager. (line 461) -* BFD_RELOC_MIPS_TLS_LDM: howto manager. (line 455) -* BFD_RELOC_MIPS_TLS_TPREL32: howto manager. (line 463) -* BFD_RELOC_MIPS_TLS_TPREL64: howto manager. (line 464) -* BFD_RELOC_MIPS_TLS_TPREL_HI16: howto manager. (line 465) -* BFD_RELOC_MIPS_TLS_TPREL_LO16: howto manager. (line 467) -* BFD_RELOC_MMIX_ADDR19: howto manager. (line 1616) -* BFD_RELOC_MMIX_ADDR27: howto manager. (line 1620) -* BFD_RELOC_MMIX_BASE_PLUS_OFFSET: howto manager. (line 1632) -* BFD_RELOC_MMIX_CBRANCH: howto manager. (line 1596) -* BFD_RELOC_MMIX_CBRANCH_1: howto manager. (line 1598) -* BFD_RELOC_MMIX_CBRANCH_2: howto manager. (line 1599) -* BFD_RELOC_MMIX_CBRANCH_3: howto manager. (line 1600) -* BFD_RELOC_MMIX_CBRANCH_J: howto manager. (line 1597) -* BFD_RELOC_MMIX_GETA: howto manager. (line 1590) -* BFD_RELOC_MMIX_GETA_1: howto manager. (line 1591) -* BFD_RELOC_MMIX_GETA_2: howto manager. (line 1592) -* BFD_RELOC_MMIX_GETA_3: howto manager. (line 1593) -* BFD_RELOC_MMIX_JMP: howto manager. (line 1610) -* BFD_RELOC_MMIX_JMP_1: howto manager. (line 1611) -* BFD_RELOC_MMIX_JMP_2: howto manager. (line 1612) -* BFD_RELOC_MMIX_JMP_3: howto manager. (line 1613) -* BFD_RELOC_MMIX_LOCAL: howto manager. (line 1636) -* BFD_RELOC_MMIX_PUSHJ: howto manager. (line 1603) -* BFD_RELOC_MMIX_PUSHJ_1: howto manager. (line 1604) -* BFD_RELOC_MMIX_PUSHJ_2: howto manager. (line 1605) -* BFD_RELOC_MMIX_PUSHJ_3: howto manager. (line 1606) -* BFD_RELOC_MMIX_PUSHJ_STUBBABLE: howto manager. (line 1607) -* BFD_RELOC_MMIX_REG: howto manager. (line 1628) -* BFD_RELOC_MMIX_REG_OR_BYTE: howto manager. (line 1624) -* BFD_RELOC_MN10300_16_PCREL: howto manager. (line 571) -* BFD_RELOC_MN10300_32_PCREL: howto manager. (line 567) -* BFD_RELOC_MN10300_ALIGN: howto manager. (line 552) -* BFD_RELOC_MN10300_COPY: howto manager. (line 535) -* BFD_RELOC_MN10300_GLOB_DAT: howto manager. (line 538) -* BFD_RELOC_MN10300_GOT16: howto manager. (line 531) -* BFD_RELOC_MN10300_GOT24: howto manager. (line 527) -* BFD_RELOC_MN10300_GOT32: howto manager. (line 523) -* BFD_RELOC_MN10300_GOTOFF24: howto manager. (line 520) -* BFD_RELOC_MN10300_JMP_SLOT: howto manager. (line 541) -* BFD_RELOC_MN10300_RELATIVE: howto manager. (line 544) -* BFD_RELOC_MN10300_SYM_DIFF: howto manager. (line 547) -* BFD_RELOC_MN10300_TLS_DTPMOD: howto manager. (line 562) -* BFD_RELOC_MN10300_TLS_DTPOFF: howto manager. (line 563) -* BFD_RELOC_MN10300_TLS_GD: howto manager. (line 556) -* BFD_RELOC_MN10300_TLS_GOTIE: howto manager. (line 559) -* BFD_RELOC_MN10300_TLS_IE: howto manager. (line 560) -* BFD_RELOC_MN10300_TLS_LD: howto manager. (line 557) -* BFD_RELOC_MN10300_TLS_LDO: howto manager. (line 558) -* BFD_RELOC_MN10300_TLS_LE: howto manager. (line 561) -* BFD_RELOC_MN10300_TLS_TPOFF: howto manager. (line 564) -* BFD_RELOC_MOXIE_10_PCREL: howto manager. (line 476) -* BFD_RELOC_MSP430_10_PCREL: howto manager. (line 2448) -* BFD_RELOC_MSP430_16: howto manager. (line 2450) -* BFD_RELOC_MSP430_16_BYTE: howto manager. (line 2452) -* BFD_RELOC_MSP430_16_PCREL: howto manager. (line 2449) -* BFD_RELOC_MSP430_16_PCREL_BYTE: howto manager. (line 2451) -* BFD_RELOC_MSP430_2X_PCREL: howto manager. (line 2453) -* BFD_RELOC_MSP430_ABS8: howto manager. (line 2455) -* BFD_RELOC_MSP430_ABS_HI16: howto manager. (line 2467) -* BFD_RELOC_MSP430_PREL31: howto manager. (line 2468) -* BFD_RELOC_MSP430_RL_PCREL: howto manager. (line 2454) -* BFD_RELOC_MSP430_SYM_DIFF: howto manager. (line 2469) -* BFD_RELOC_MSP430X_ABS16: howto manager. (line 2466) -* BFD_RELOC_MSP430X_ABS20_ADR_DST: howto manager. (line 2463) -* BFD_RELOC_MSP430X_ABS20_ADR_SRC: howto manager. (line 2462) -* BFD_RELOC_MSP430X_ABS20_EXT_DST: howto manager. (line 2460) -* BFD_RELOC_MSP430X_ABS20_EXT_ODST: howto manager. (line 2461) -* BFD_RELOC_MSP430X_ABS20_EXT_SRC: howto manager. (line 2459) -* BFD_RELOC_MSP430X_PCR16: howto manager. (line 2464) -* BFD_RELOC_MSP430X_PCR20_CALL: howto manager. (line 2465) -* BFD_RELOC_MSP430X_PCR20_EXT_DST: howto manager. (line 2457) -* BFD_RELOC_MSP430X_PCR20_EXT_ODST: howto manager. (line 2458) -* BFD_RELOC_MSP430X_PCR20_EXT_SRC: howto manager. (line 2456) -* BFD_RELOC_MT_GNU_VTENTRY: howto manager. (line 2442) -* BFD_RELOC_MT_GNU_VTINHERIT: howto manager. (line 2439) -* BFD_RELOC_MT_HI16: howto manager. (line 2433) -* BFD_RELOC_MT_LO16: howto manager. (line 2436) -* BFD_RELOC_MT_PC16: howto manager. (line 2430) -* BFD_RELOC_MT_PCINSN8: howto manager. (line 2445) -* BFD_RELOC_NIOS2_ALIGN: howto manager. (line 2486) -* BFD_RELOC_NIOS2_CACHE_OPX: howto manager. (line 2476) -* BFD_RELOC_NIOS2_CALL16: howto manager. (line 2488) -* BFD_RELOC_NIOS2_CALL26: howto manager. (line 2474) -* BFD_RELOC_NIOS2_CALLR: howto manager. (line 2485) -* BFD_RELOC_NIOS2_CJMP: howto manager. (line 2484) -* BFD_RELOC_NIOS2_COPY: howto manager. (line 2501) -* BFD_RELOC_NIOS2_GLOB_DAT: howto manager. (line 2502) -* BFD_RELOC_NIOS2_GOT16: howto manager. (line 2487) -* BFD_RELOC_NIOS2_GOTOFF: howto manager. (line 2505) -* BFD_RELOC_NIOS2_GOTOFF_HA: howto manager. (line 2490) -* BFD_RELOC_NIOS2_GOTOFF_LO: howto manager. (line 2489) -* BFD_RELOC_NIOS2_GPREL: howto manager. (line 2482) -* BFD_RELOC_NIOS2_HI16: howto manager. (line 2479) -* BFD_RELOC_NIOS2_HIADJ16: howto manager. (line 2481) -* BFD_RELOC_NIOS2_IMM5: howto manager. (line 2475) -* BFD_RELOC_NIOS2_IMM6: howto manager. (line 2477) -* BFD_RELOC_NIOS2_IMM8: howto manager. (line 2478) -* BFD_RELOC_NIOS2_JUMP_SLOT: howto manager. (line 2503) -* BFD_RELOC_NIOS2_LO16: howto manager. (line 2480) -* BFD_RELOC_NIOS2_PCREL_HA: howto manager. (line 2492) -* BFD_RELOC_NIOS2_PCREL_LO: howto manager. (line 2491) -* BFD_RELOC_NIOS2_RELATIVE: howto manager. (line 2504) -* BFD_RELOC_NIOS2_S16: howto manager. (line 2472) -* BFD_RELOC_NIOS2_TLS_DTPMOD: howto manager. (line 2498) -* BFD_RELOC_NIOS2_TLS_DTPREL: howto manager. (line 2499) -* BFD_RELOC_NIOS2_TLS_GD16: howto manager. (line 2493) -* BFD_RELOC_NIOS2_TLS_IE16: howto manager. (line 2496) -* BFD_RELOC_NIOS2_TLS_LDM16: howto manager. (line 2494) -* BFD_RELOC_NIOS2_TLS_LDO16: howto manager. (line 2495) -* BFD_RELOC_NIOS2_TLS_LE16: howto manager. (line 2497) -* BFD_RELOC_NIOS2_TLS_TPREL: howto manager. (line 2500) -* BFD_RELOC_NIOS2_U16: howto manager. (line 2473) -* BFD_RELOC_NIOS2_UJMP: howto manager. (line 2483) -* BFD_RELOC_NONE: howto manager. (line 135) -* BFD_RELOC_NS32K_DISP_16: howto manager. (line 639) -* BFD_RELOC_NS32K_DISP_16_PCREL: howto manager. (line 642) -* BFD_RELOC_NS32K_DISP_32: howto manager. (line 640) -* BFD_RELOC_NS32K_DISP_32_PCREL: howto manager. (line 643) -* BFD_RELOC_NS32K_DISP_8: howto manager. (line 638) -* BFD_RELOC_NS32K_DISP_8_PCREL: howto manager. (line 641) -* BFD_RELOC_NS32K_IMM_16: howto manager. (line 633) -* BFD_RELOC_NS32K_IMM_16_PCREL: howto manager. (line 636) -* BFD_RELOC_NS32K_IMM_32: howto manager. (line 634) -* BFD_RELOC_NS32K_IMM_32_PCREL: howto manager. (line 637) -* BFD_RELOC_NS32K_IMM_8: howto manager. (line 632) -* BFD_RELOC_NS32K_IMM_8_PCREL: howto manager. (line 635) -* BFD_RELOC_OPENRISC_ABS_26: howto manager. (line 2398) -* BFD_RELOC_OPENRISC_REL_26: howto manager. (line 2399) -* BFD_RELOC_PDP11_DISP_6_PCREL: howto manager. (line 647) -* BFD_RELOC_PDP11_DISP_8_PCREL: howto manager. (line 646) -* BFD_RELOC_PJ_CODE_DIR16: howto manager. (line 652) -* BFD_RELOC_PJ_CODE_DIR32: howto manager. (line 653) -* BFD_RELOC_PJ_CODE_HI16: howto manager. (line 650) -* BFD_RELOC_PJ_CODE_LO16: howto manager. (line 651) -* BFD_RELOC_PJ_CODE_REL16: howto manager. (line 654) -* BFD_RELOC_PJ_CODE_REL32: howto manager. (line 655) -* BFD_RELOC_PPC64_ADDR16_DS: howto manager. (line 717) -* BFD_RELOC_PPC64_ADDR16_HIGH: howto manager. (line 728) -* BFD_RELOC_PPC64_ADDR16_HIGHA: howto manager. (line 729) -* BFD_RELOC_PPC64_ADDR16_LO_DS: howto manager. (line 718) -* BFD_RELOC_PPC64_DTPREL16_DS: howto manager. (line 768) -* BFD_RELOC_PPC64_DTPREL16_HIGH: howto manager. (line 776) -* BFD_RELOC_PPC64_DTPREL16_HIGHA: howto manager. (line 777) -* BFD_RELOC_PPC64_DTPREL16_HIGHER: howto manager. (line 770) -* BFD_RELOC_PPC64_DTPREL16_HIGHERA: howto manager. (line 771) -* BFD_RELOC_PPC64_DTPREL16_HIGHEST: howto manager. (line 772) -* BFD_RELOC_PPC64_DTPREL16_HIGHESTA: howto manager. (line 773) -* BFD_RELOC_PPC64_DTPREL16_LO_DS: howto manager. (line 769) -* BFD_RELOC_PPC64_GOT16_DS: howto manager. (line 719) -* BFD_RELOC_PPC64_GOT16_LO_DS: howto manager. (line 720) -* BFD_RELOC_PPC64_HIGHER: howto manager. (line 705) -* BFD_RELOC_PPC64_HIGHER_S: howto manager. (line 706) -* BFD_RELOC_PPC64_HIGHEST: howto manager. (line 707) -* BFD_RELOC_PPC64_HIGHEST_S: howto manager. (line 708) -* BFD_RELOC_PPC64_PLT16_LO_DS: howto manager. (line 721) -* BFD_RELOC_PPC64_PLTGOT16: howto manager. (line 713) -* BFD_RELOC_PPC64_PLTGOT16_DS: howto manager. (line 726) -* BFD_RELOC_PPC64_PLTGOT16_HA: howto manager. (line 716) -* BFD_RELOC_PPC64_PLTGOT16_HI: howto manager. (line 715) -* BFD_RELOC_PPC64_PLTGOT16_LO: howto manager. (line 714) -* BFD_RELOC_PPC64_PLTGOT16_LO_DS: howto manager. (line 727) -* BFD_RELOC_PPC64_SECTOFF_DS: howto manager. (line 722) -* BFD_RELOC_PPC64_SECTOFF_LO_DS: howto manager. (line 723) -* BFD_RELOC_PPC64_TOC: howto manager. (line 712) -* BFD_RELOC_PPC64_TOC16_DS: howto manager. (line 724) -* BFD_RELOC_PPC64_TOC16_HA: howto manager. (line 711) -* BFD_RELOC_PPC64_TOC16_HI: howto manager. (line 710) -* BFD_RELOC_PPC64_TOC16_LO: howto manager. (line 709) -* BFD_RELOC_PPC64_TOC16_LO_DS: howto manager. (line 725) -* BFD_RELOC_PPC64_TPREL16_DS: howto manager. (line 762) -* BFD_RELOC_PPC64_TPREL16_HIGH: howto manager. (line 774) -* BFD_RELOC_PPC64_TPREL16_HIGHA: howto manager. (line 775) -* BFD_RELOC_PPC64_TPREL16_HIGHER: howto manager. (line 764) -* BFD_RELOC_PPC64_TPREL16_HIGHERA: howto manager. (line 765) -* BFD_RELOC_PPC64_TPREL16_HIGHEST: howto manager. (line 766) -* BFD_RELOC_PPC64_TPREL16_HIGHESTA: howto manager. (line 767) -* BFD_RELOC_PPC64_TPREL16_LO_DS: howto manager. (line 763) -* BFD_RELOC_PPC_B16: howto manager. (line 661) -* BFD_RELOC_PPC_B16_BRNTAKEN: howto manager. (line 663) -* BFD_RELOC_PPC_B16_BRTAKEN: howto manager. (line 662) -* BFD_RELOC_PPC_B26: howto manager. (line 658) -* BFD_RELOC_PPC_BA16: howto manager. (line 664) -* BFD_RELOC_PPC_BA16_BRNTAKEN: howto manager. (line 666) -* BFD_RELOC_PPC_BA16_BRTAKEN: howto manager. (line 665) -* BFD_RELOC_PPC_BA26: howto manager. (line 659) -* BFD_RELOC_PPC_COPY: howto manager. (line 667) -* BFD_RELOC_PPC_DTPMOD: howto manager. (line 735) -* BFD_RELOC_PPC_DTPREL: howto manager. (line 745) -* BFD_RELOC_PPC_DTPREL16: howto manager. (line 741) -* BFD_RELOC_PPC_DTPREL16_HA: howto manager. (line 744) -* BFD_RELOC_PPC_DTPREL16_HI: howto manager. (line 743) -* BFD_RELOC_PPC_DTPREL16_LO: howto manager. (line 742) -* BFD_RELOC_PPC_EMB_BIT_FLD: howto manager. (line 686) -* BFD_RELOC_PPC_EMB_MRKREF: howto manager. (line 681) -* BFD_RELOC_PPC_EMB_NADDR16: howto manager. (line 673) -* BFD_RELOC_PPC_EMB_NADDR16_HA: howto manager. (line 676) -* BFD_RELOC_PPC_EMB_NADDR16_HI: howto manager. (line 675) -* BFD_RELOC_PPC_EMB_NADDR16_LO: howto manager. (line 674) -* BFD_RELOC_PPC_EMB_NADDR32: howto manager. (line 672) -* BFD_RELOC_PPC_EMB_RELSDA: howto manager. (line 687) -* BFD_RELOC_PPC_EMB_RELSEC16: howto manager. (line 682) -* BFD_RELOC_PPC_EMB_RELST_HA: howto manager. (line 685) -* BFD_RELOC_PPC_EMB_RELST_HI: howto manager. (line 684) -* BFD_RELOC_PPC_EMB_RELST_LO: howto manager. (line 683) -* BFD_RELOC_PPC_EMB_SDA21: howto manager. (line 680) -* BFD_RELOC_PPC_EMB_SDA2I16: howto manager. (line 678) -* BFD_RELOC_PPC_EMB_SDA2REL: howto manager. (line 679) -* BFD_RELOC_PPC_EMB_SDAI16: howto manager. (line 677) -* BFD_RELOC_PPC_GLOB_DAT: howto manager. (line 668) -* BFD_RELOC_PPC_GOT_DTPREL16: howto manager. (line 758) -* BFD_RELOC_PPC_GOT_DTPREL16_HA: howto manager. (line 761) -* BFD_RELOC_PPC_GOT_DTPREL16_HI: howto manager. (line 760) -* BFD_RELOC_PPC_GOT_DTPREL16_LO: howto manager. (line 759) -* BFD_RELOC_PPC_GOT_TLSGD16: howto manager. (line 746) -* BFD_RELOC_PPC_GOT_TLSGD16_HA: howto manager. (line 749) -* BFD_RELOC_PPC_GOT_TLSGD16_HI: howto manager. (line 748) -* BFD_RELOC_PPC_GOT_TLSGD16_LO: howto manager. (line 747) -* BFD_RELOC_PPC_GOT_TLSLD16: howto manager. (line 750) -* BFD_RELOC_PPC_GOT_TLSLD16_HA: howto manager. (line 753) -* BFD_RELOC_PPC_GOT_TLSLD16_HI: howto manager. (line 752) -* BFD_RELOC_PPC_GOT_TLSLD16_LO: howto manager. (line 751) -* BFD_RELOC_PPC_GOT_TPREL16: howto manager. (line 754) -* BFD_RELOC_PPC_GOT_TPREL16_HA: howto manager. (line 757) -* BFD_RELOC_PPC_GOT_TPREL16_HI: howto manager. (line 756) -* BFD_RELOC_PPC_GOT_TPREL16_LO: howto manager. (line 755) -* BFD_RELOC_PPC_JMP_SLOT: howto manager. (line 669) -* BFD_RELOC_PPC_LOCAL24PC: howto manager. (line 671) -* BFD_RELOC_PPC_RELATIVE: howto manager. (line 670) -* BFD_RELOC_PPC_TLS: howto manager. (line 732) -* BFD_RELOC_PPC_TLSGD: howto manager. (line 733) -* BFD_RELOC_PPC_TLSLD: howto manager. (line 734) -* BFD_RELOC_PPC_TOC16: howto manager. (line 660) -* BFD_RELOC_PPC_TPREL: howto manager. (line 740) -* BFD_RELOC_PPC_TPREL16: howto manager. (line 736) -* BFD_RELOC_PPC_TPREL16_HA: howto manager. (line 739) -* BFD_RELOC_PPC_TPREL16_HI: howto manager. (line 738) -* BFD_RELOC_PPC_TPREL16_LO: howto manager. (line 737) -* BFD_RELOC_PPC_VLE_HA16A: howto manager. (line 695) -* BFD_RELOC_PPC_VLE_HA16D: howto manager. (line 696) -* BFD_RELOC_PPC_VLE_HI16A: howto manager. (line 693) -* BFD_RELOC_PPC_VLE_HI16D: howto manager. (line 694) -* BFD_RELOC_PPC_VLE_LO16A: howto manager. (line 691) -* BFD_RELOC_PPC_VLE_LO16D: howto manager. (line 692) -* BFD_RELOC_PPC_VLE_REL15: howto manager. (line 689) -* BFD_RELOC_PPC_VLE_REL24: howto manager. (line 690) -* BFD_RELOC_PPC_VLE_REL8: howto manager. (line 688) -* BFD_RELOC_PPC_VLE_SDA21: howto manager. (line 697) -* BFD_RELOC_PPC_VLE_SDA21_LO: howto manager. (line 698) -* BFD_RELOC_PPC_VLE_SDAREL_HA16A: howto manager. (line 703) -* BFD_RELOC_PPC_VLE_SDAREL_HA16D: howto manager. (line 704) -* BFD_RELOC_PPC_VLE_SDAREL_HI16A: howto manager. (line 701) -* BFD_RELOC_PPC_VLE_SDAREL_HI16D: howto manager. (line 702) -* BFD_RELOC_PPC_VLE_SDAREL_LO16A: howto manager. (line 699) -* BFD_RELOC_PPC_VLE_SDAREL_LO16D: howto manager. (line 700) -* BFD_RELOC_RELC: howto manager. (line 2416) -* BFD_RELOC_RL78_16_OP: howto manager. (line 1759) -* BFD_RELOC_RL78_16U: howto manager. (line 1763) -* BFD_RELOC_RL78_24_OP: howto manager. (line 1760) -* BFD_RELOC_RL78_24U: howto manager. (line 1764) -* BFD_RELOC_RL78_32_OP: howto manager. (line 1761) -* BFD_RELOC_RL78_8U: howto manager. (line 1762) -* BFD_RELOC_RL78_ABS16: howto manager. (line 1776) -* BFD_RELOC_RL78_ABS16_REV: howto manager. (line 1777) -* BFD_RELOC_RL78_ABS16U: howto manager. (line 1780) -* BFD_RELOC_RL78_ABS16UL: howto manager. (line 1782) -* BFD_RELOC_RL78_ABS16UW: howto manager. (line 1781) -* BFD_RELOC_RL78_ABS32: howto manager. (line 1778) -* BFD_RELOC_RL78_ABS32_REV: howto manager. (line 1779) -* BFD_RELOC_RL78_ABS8: howto manager. (line 1775) -* BFD_RELOC_RL78_CODE: howto manager. (line 1787) -* BFD_RELOC_RL78_DIFF: howto manager. (line 1766) -* BFD_RELOC_RL78_DIR3U_PCREL: howto manager. (line 1765) -* BFD_RELOC_RL78_GPRELB: howto manager. (line 1767) -* BFD_RELOC_RL78_GPRELL: howto manager. (line 1769) -* BFD_RELOC_RL78_GPRELW: howto manager. (line 1768) -* BFD_RELOC_RL78_HI16: howto manager. (line 1784) -* BFD_RELOC_RL78_HI8: howto manager. (line 1785) -* BFD_RELOC_RL78_LO16: howto manager. (line 1786) -* BFD_RELOC_RL78_NEG16: howto manager. (line 1756) -* BFD_RELOC_RL78_NEG24: howto manager. (line 1757) -* BFD_RELOC_RL78_NEG32: howto manager. (line 1758) -* BFD_RELOC_RL78_NEG8: howto manager. (line 1755) -* BFD_RELOC_RL78_OP_AND: howto manager. (line 1773) -* BFD_RELOC_RL78_OP_NEG: howto manager. (line 1772) -* BFD_RELOC_RL78_OP_SHRA: howto manager. (line 1774) -* BFD_RELOC_RL78_OP_SUBTRACT: howto manager. (line 1771) -* BFD_RELOC_RL78_RELAX: howto manager. (line 1783) -* BFD_RELOC_RL78_SYM: howto manager. (line 1770) -* BFD_RELOC_RVA: howto manager. (line 104) -* BFD_RELOC_RX_16_OP: howto manager. (line 1794) -* BFD_RELOC_RX_16U: howto manager. (line 1798) -* BFD_RELOC_RX_24_OP: howto manager. (line 1795) -* BFD_RELOC_RX_24U: howto manager. (line 1799) -* BFD_RELOC_RX_32_OP: howto manager. (line 1796) -* BFD_RELOC_RX_8U: howto manager. (line 1797) -* BFD_RELOC_RX_ABS16: howto manager. (line 1809) -* BFD_RELOC_RX_ABS16_REV: howto manager. (line 1810) -* BFD_RELOC_RX_ABS16U: howto manager. (line 1813) -* BFD_RELOC_RX_ABS16UL: howto manager. (line 1815) -* BFD_RELOC_RX_ABS16UW: howto manager. (line 1814) -* BFD_RELOC_RX_ABS32: howto manager. (line 1811) -* BFD_RELOC_RX_ABS32_REV: howto manager. (line 1812) -* BFD_RELOC_RX_ABS8: howto manager. (line 1808) -* BFD_RELOC_RX_DIFF: howto manager. (line 1801) -* BFD_RELOC_RX_DIR3U_PCREL: howto manager. (line 1800) -* BFD_RELOC_RX_GPRELB: howto manager. (line 1802) -* BFD_RELOC_RX_GPRELL: howto manager. (line 1804) -* BFD_RELOC_RX_GPRELW: howto manager. (line 1803) -* BFD_RELOC_RX_NEG16: howto manager. (line 1791) -* BFD_RELOC_RX_NEG24: howto manager. (line 1792) -* BFD_RELOC_RX_NEG32: howto manager. (line 1793) -* BFD_RELOC_RX_NEG8: howto manager. (line 1790) -* BFD_RELOC_RX_OP_NEG: howto manager. (line 1807) -* BFD_RELOC_RX_OP_SUBTRACT: howto manager. (line 1806) -* BFD_RELOC_RX_RELAX: howto manager. (line 1816) -* BFD_RELOC_RX_SYM: howto manager. (line 1805) -* BFD_RELOC_SCORE16_BRANCH: howto manager. (line 1959) -* BFD_RELOC_SCORE16_JMP: howto manager. (line 1956) -* BFD_RELOC_SCORE_BCMP: howto manager. (line 1962) -* BFD_RELOC_SCORE_BRANCH: howto manager. (line 1947) -* BFD_RELOC_SCORE_CALL15: howto manager. (line 1967) -* BFD_RELOC_SCORE_DUMMY2: howto manager. (line 1943) -* BFD_RELOC_SCORE_DUMMY_HI16: howto manager. (line 1968) -* BFD_RELOC_SCORE_GOT15: howto manager. (line 1965) -* BFD_RELOC_SCORE_GOT_LO16: howto manager. (line 1966) -* BFD_RELOC_SCORE_GPREL15: howto manager. (line 1940) -* BFD_RELOC_SCORE_IMM30: howto manager. (line 1950) -* BFD_RELOC_SCORE_IMM32: howto manager. (line 1953) -* BFD_RELOC_SCORE_JMP: howto manager. (line 1944) -* BFD_RELOC_SH_ALIGN: howto manager. (line 971) -* BFD_RELOC_SH_CODE: howto manager. (line 972) -* BFD_RELOC_SH_COPY: howto manager. (line 977) -* BFD_RELOC_SH_COPY64: howto manager. (line 1002) -* BFD_RELOC_SH_COUNT: howto manager. (line 970) -* BFD_RELOC_SH_DATA: howto manager. (line 973) -* BFD_RELOC_SH_DISP12: howto manager. (line 953) -* BFD_RELOC_SH_DISP12BY2: howto manager. (line 954) -* BFD_RELOC_SH_DISP12BY4: howto manager. (line 955) -* BFD_RELOC_SH_DISP12BY8: howto manager. (line 956) -* BFD_RELOC_SH_DISP20: howto manager. (line 957) -* BFD_RELOC_SH_DISP20BY8: howto manager. (line 958) -* BFD_RELOC_SH_FUNCDESC: howto manager. (line 1045) -* BFD_RELOC_SH_GLOB_DAT: howto manager. (line 978) -* BFD_RELOC_SH_GLOB_DAT64: howto manager. (line 1003) -* BFD_RELOC_SH_GOT10BY4: howto manager. (line 1006) -* BFD_RELOC_SH_GOT10BY8: howto manager. (line 1007) -* BFD_RELOC_SH_GOT20: howto manager. (line 1039) -* BFD_RELOC_SH_GOT_HI16: howto manager. (line 985) -* BFD_RELOC_SH_GOT_LOW16: howto manager. (line 982) -* BFD_RELOC_SH_GOT_MEDHI16: howto manager. (line 984) -* BFD_RELOC_SH_GOT_MEDLOW16: howto manager. (line 983) -* BFD_RELOC_SH_GOTFUNCDESC: howto manager. (line 1041) -* BFD_RELOC_SH_GOTFUNCDESC20: howto manager. (line 1042) -* BFD_RELOC_SH_GOTOFF20: howto manager. (line 1040) -* BFD_RELOC_SH_GOTOFF_HI16: howto manager. (line 997) -* BFD_RELOC_SH_GOTOFF_LOW16: howto manager. (line 994) -* BFD_RELOC_SH_GOTOFF_MEDHI16: howto manager. (line 996) -* BFD_RELOC_SH_GOTOFF_MEDLOW16: howto manager. (line 995) -* BFD_RELOC_SH_GOTOFFFUNCDESC: howto manager. (line 1043) -* BFD_RELOC_SH_GOTOFFFUNCDESC20: howto manager. (line 1044) -* BFD_RELOC_SH_GOTPC: howto manager. (line 981) -* BFD_RELOC_SH_GOTPC_HI16: howto manager. (line 1001) -* BFD_RELOC_SH_GOTPC_LOW16: howto manager. (line 998) -* BFD_RELOC_SH_GOTPC_MEDHI16: howto manager. (line 1000) -* BFD_RELOC_SH_GOTPC_MEDLOW16: howto manager. (line 999) -* BFD_RELOC_SH_GOTPLT10BY4: howto manager. (line 1008) -* BFD_RELOC_SH_GOTPLT10BY8: howto manager. (line 1009) -* BFD_RELOC_SH_GOTPLT32: howto manager. (line 1010) -* BFD_RELOC_SH_GOTPLT_HI16: howto manager. (line 989) -* BFD_RELOC_SH_GOTPLT_LOW16: howto manager. (line 986) -* BFD_RELOC_SH_GOTPLT_MEDHI16: howto manager. (line 988) -* BFD_RELOC_SH_GOTPLT_MEDLOW16: howto manager. (line 987) -* BFD_RELOC_SH_IMM3: howto manager. (line 951) -* BFD_RELOC_SH_IMM3U: howto manager. (line 952) -* BFD_RELOC_SH_IMM4: howto manager. (line 959) -* BFD_RELOC_SH_IMM4BY2: howto manager. (line 960) -* BFD_RELOC_SH_IMM4BY4: howto manager. (line 961) -* BFD_RELOC_SH_IMM8: howto manager. (line 962) -* BFD_RELOC_SH_IMM8BY2: howto manager. (line 963) -* BFD_RELOC_SH_IMM8BY4: howto manager. (line 964) -* BFD_RELOC_SH_IMM_HI16: howto manager. (line 1028) -* BFD_RELOC_SH_IMM_HI16_PCREL: howto manager. (line 1029) -* BFD_RELOC_SH_IMM_LOW16: howto manager. (line 1022) -* BFD_RELOC_SH_IMM_LOW16_PCREL: howto manager. (line 1023) -* BFD_RELOC_SH_IMM_MEDHI16: howto manager. (line 1026) -* BFD_RELOC_SH_IMM_MEDHI16_PCREL: howto manager. (line 1027) -* BFD_RELOC_SH_IMM_MEDLOW16: howto manager. (line 1024) -* BFD_RELOC_SH_IMM_MEDLOW16_PCREL: howto manager. (line 1025) -* BFD_RELOC_SH_IMMS10: howto manager. (line 1016) -* BFD_RELOC_SH_IMMS10BY2: howto manager. (line 1017) -* BFD_RELOC_SH_IMMS10BY4: howto manager. (line 1018) -* BFD_RELOC_SH_IMMS10BY8: howto manager. (line 1019) -* BFD_RELOC_SH_IMMS16: howto manager. (line 1020) -* BFD_RELOC_SH_IMMS6: howto manager. (line 1013) -* BFD_RELOC_SH_IMMS6BY32: howto manager. (line 1014) -* BFD_RELOC_SH_IMMU16: howto manager. (line 1021) -* BFD_RELOC_SH_IMMU5: howto manager. (line 1012) -* BFD_RELOC_SH_IMMU6: howto manager. (line 1015) -* BFD_RELOC_SH_JMP_SLOT: howto manager. (line 979) -* BFD_RELOC_SH_JMP_SLOT64: howto manager. (line 1004) -* BFD_RELOC_SH_LABEL: howto manager. (line 974) -* BFD_RELOC_SH_LOOP_END: howto manager. (line 976) -* BFD_RELOC_SH_LOOP_START: howto manager. (line 975) -* BFD_RELOC_SH_PCDISP12BY2: howto manager. (line 950) -* BFD_RELOC_SH_PCDISP8BY2: howto manager. (line 949) -* BFD_RELOC_SH_PCRELIMM8BY2: howto manager. (line 965) -* BFD_RELOC_SH_PCRELIMM8BY4: howto manager. (line 966) -* BFD_RELOC_SH_PLT_HI16: howto manager. (line 993) -* BFD_RELOC_SH_PLT_LOW16: howto manager. (line 990) -* BFD_RELOC_SH_PLT_MEDHI16: howto manager. (line 992) -* BFD_RELOC_SH_PLT_MEDLOW16: howto manager. (line 991) -* BFD_RELOC_SH_PT_16: howto manager. (line 1030) -* BFD_RELOC_SH_RELATIVE: howto manager. (line 980) -* BFD_RELOC_SH_RELATIVE64: howto manager. (line 1005) -* BFD_RELOC_SH_SHMEDIA_CODE: howto manager. (line 1011) -* BFD_RELOC_SH_SWITCH16: howto manager. (line 967) -* BFD_RELOC_SH_SWITCH32: howto manager. (line 968) -* BFD_RELOC_SH_TLS_DTPMOD32: howto manager. (line 1036) -* BFD_RELOC_SH_TLS_DTPOFF32: howto manager. (line 1037) -* BFD_RELOC_SH_TLS_GD_32: howto manager. (line 1031) -* BFD_RELOC_SH_TLS_IE_32: howto manager. (line 1034) -* BFD_RELOC_SH_TLS_LD_32: howto manager. (line 1032) -* BFD_RELOC_SH_TLS_LDO_32: howto manager. (line 1033) -* BFD_RELOC_SH_TLS_LE_32: howto manager. (line 1035) -* BFD_RELOC_SH_TLS_TPOFF32: howto manager. (line 1038) -* BFD_RELOC_SH_USES: howto manager. (line 969) -* BFD_RELOC_SIZE32: howto manager. (line 74) -* BFD_RELOC_SIZE64: howto manager. (line 75) -* BFD_RELOC_SPARC13: howto manager. (line 138) -* BFD_RELOC_SPARC22: howto manager. (line 137) -* BFD_RELOC_SPARC_10: howto manager. (line 167) -* BFD_RELOC_SPARC_11: howto manager. (line 168) -* BFD_RELOC_SPARC_5: howto manager. (line 180) -* BFD_RELOC_SPARC_6: howto manager. (line 179) -* BFD_RELOC_SPARC_64: howto manager. (line 166) -* BFD_RELOC_SPARC_7: howto manager. (line 178) -* BFD_RELOC_SPARC_BASE13: howto manager. (line 162) -* BFD_RELOC_SPARC_BASE22: howto manager. (line 163) -* BFD_RELOC_SPARC_COPY: howto manager. (line 145) -* BFD_RELOC_SPARC_DISP64: howto manager. (line 181) -* BFD_RELOC_SPARC_GLOB_DAT: howto manager. (line 146) -* BFD_RELOC_SPARC_GOT10: howto manager. (line 139) -* BFD_RELOC_SPARC_GOT13: howto manager. (line 140) -* BFD_RELOC_SPARC_GOT22: howto manager. (line 141) -* BFD_RELOC_SPARC_GOTDATA_HIX22: howto manager. (line 152) -* BFD_RELOC_SPARC_GOTDATA_LOX10: howto manager. (line 153) -* BFD_RELOC_SPARC_GOTDATA_OP: howto manager. (line 156) -* BFD_RELOC_SPARC_GOTDATA_OP_HIX22: howto manager. (line 154) -* BFD_RELOC_SPARC_GOTDATA_OP_LOX10: howto manager. (line 155) -* BFD_RELOC_SPARC_H34: howto manager. (line 190) -* BFD_RELOC_SPARC_H44: howto manager. (line 186) -* BFD_RELOC_SPARC_HH22: howto manager. (line 170) -* BFD_RELOC_SPARC_HIX22: howto manager. (line 184) -* BFD_RELOC_SPARC_HM10: howto manager. (line 171) -* BFD_RELOC_SPARC_IRELATIVE: howto manager. (line 158) -* BFD_RELOC_SPARC_JMP_IREL: howto manager. (line 157) -* BFD_RELOC_SPARC_JMP_SLOT: howto manager. (line 147) -* BFD_RELOC_SPARC_L44: howto manager. (line 188) -* BFD_RELOC_SPARC_LM22: howto manager. (line 172) -* BFD_RELOC_SPARC_LOX10: howto manager. (line 185) -* BFD_RELOC_SPARC_M44: howto manager. (line 187) -* BFD_RELOC_SPARC_OLO10: howto manager. (line 169) -* BFD_RELOC_SPARC_PC10: howto manager. (line 142) -* BFD_RELOC_SPARC_PC22: howto manager. (line 143) -* BFD_RELOC_SPARC_PC_HH22: howto manager. (line 173) -* BFD_RELOC_SPARC_PC_HM10: howto manager. (line 174) -* BFD_RELOC_SPARC_PC_LM22: howto manager. (line 175) -* BFD_RELOC_SPARC_PLT32: howto manager. (line 182) -* BFD_RELOC_SPARC_PLT64: howto manager. (line 183) -* BFD_RELOC_SPARC_REGISTER: howto manager. (line 189) -* BFD_RELOC_SPARC_RELATIVE: howto manager. (line 148) -* BFD_RELOC_SPARC_REV32: howto manager. (line 196) -* BFD_RELOC_SPARC_SIZE32: howto manager. (line 191) -* BFD_RELOC_SPARC_SIZE64: howto manager. (line 192) -* BFD_RELOC_SPARC_TLS_DTPMOD32: howto manager. (line 217) -* BFD_RELOC_SPARC_TLS_DTPMOD64: howto manager. (line 218) -* BFD_RELOC_SPARC_TLS_DTPOFF32: howto manager. (line 219) -* BFD_RELOC_SPARC_TLS_DTPOFF64: howto manager. (line 220) -* BFD_RELOC_SPARC_TLS_GD_ADD: howto manager. (line 201) -* BFD_RELOC_SPARC_TLS_GD_CALL: howto manager. (line 202) -* BFD_RELOC_SPARC_TLS_GD_HI22: howto manager. (line 199) -* BFD_RELOC_SPARC_TLS_GD_LO10: howto manager. (line 200) -* BFD_RELOC_SPARC_TLS_IE_ADD: howto manager. (line 214) -* BFD_RELOC_SPARC_TLS_IE_HI22: howto manager. (line 210) -* BFD_RELOC_SPARC_TLS_IE_LD: howto manager. (line 212) -* BFD_RELOC_SPARC_TLS_IE_LDX: howto manager. (line 213) -* BFD_RELOC_SPARC_TLS_IE_LO10: howto manager. (line 211) -* BFD_RELOC_SPARC_TLS_LDM_ADD: howto manager. (line 205) -* BFD_RELOC_SPARC_TLS_LDM_CALL: howto manager. (line 206) -* BFD_RELOC_SPARC_TLS_LDM_HI22: howto manager. (line 203) -* BFD_RELOC_SPARC_TLS_LDM_LO10: howto manager. (line 204) -* BFD_RELOC_SPARC_TLS_LDO_ADD: howto manager. (line 209) -* BFD_RELOC_SPARC_TLS_LDO_HIX22: howto manager. (line 207) -* BFD_RELOC_SPARC_TLS_LDO_LOX10: howto manager. (line 208) -* BFD_RELOC_SPARC_TLS_LE_HIX22: howto manager. (line 215) -* BFD_RELOC_SPARC_TLS_LE_LOX10: howto manager. (line 216) -* BFD_RELOC_SPARC_TLS_TPOFF32: howto manager. (line 221) -* BFD_RELOC_SPARC_TLS_TPOFF64: howto manager. (line 222) -* BFD_RELOC_SPARC_UA16: howto manager. (line 149) -* BFD_RELOC_SPARC_UA32: howto manager. (line 150) -* BFD_RELOC_SPARC_UA64: howto manager. (line 151) -* BFD_RELOC_SPARC_WDISP10: howto manager. (line 193) -* BFD_RELOC_SPARC_WDISP16: howto manager. (line 176) -* BFD_RELOC_SPARC_WDISP19: howto manager. (line 177) -* BFD_RELOC_SPARC_WDISP22: howto manager. (line 136) -* BFD_RELOC_SPARC_WPLT30: howto manager. (line 144) -* BFD_RELOC_SPU_ADD_PIC: howto manager. (line 239) -* BFD_RELOC_SPU_HI16: howto manager. (line 236) -* BFD_RELOC_SPU_IMM10: howto manager. (line 227) -* BFD_RELOC_SPU_IMM10W: howto manager. (line 228) -* BFD_RELOC_SPU_IMM16: howto manager. (line 229) -* BFD_RELOC_SPU_IMM16W: howto manager. (line 230) -* BFD_RELOC_SPU_IMM18: howto manager. (line 231) -* BFD_RELOC_SPU_IMM7: howto manager. (line 225) -* BFD_RELOC_SPU_IMM8: howto manager. (line 226) -* BFD_RELOC_SPU_LO16: howto manager. (line 235) -* BFD_RELOC_SPU_PCREL16: howto manager. (line 234) -* BFD_RELOC_SPU_PCREL9a: howto manager. (line 232) -* BFD_RELOC_SPU_PCREL9b: howto manager. (line 233) -* BFD_RELOC_SPU_PPU32: howto manager. (line 237) -* BFD_RELOC_SPU_PPU64: howto manager. (line 238) -* BFD_RELOC_THUMB_PCREL_BLX: howto manager. (line 798) -* BFD_RELOC_THUMB_PCREL_BRANCH12: howto manager. (line 812) -* BFD_RELOC_THUMB_PCREL_BRANCH20: howto manager. (line 813) -* BFD_RELOC_THUMB_PCREL_BRANCH23: howto manager. (line 814) -* BFD_RELOC_THUMB_PCREL_BRANCH25: howto manager. (line 815) -* BFD_RELOC_THUMB_PCREL_BRANCH7: howto manager. (line 810) -* BFD_RELOC_THUMB_PCREL_BRANCH9: howto manager. (line 811) -* BFD_RELOC_TIC30_LDP: howto manager. (line 1430) -* BFD_RELOC_TIC54X_16_OF_23: howto manager. (line 1448) -* BFD_RELOC_TIC54X_23: howto manager. (line 1445) -* BFD_RELOC_TIC54X_MS7_OF_23: howto manager. (line 1453) -* BFD_RELOC_TIC54X_PARTLS7: howto manager. (line 1435) -* BFD_RELOC_TIC54X_PARTMS9: howto manager. (line 1440) -* BFD_RELOC_TILEGX_BROFF_X1: howto manager. (line 3132) -* BFD_RELOC_TILEGX_COPY: howto manager. (line 3128) -* BFD_RELOC_TILEGX_DEST_IMM8_X1: howto manager. (line 3139) -* BFD_RELOC_TILEGX_GLOB_DAT: howto manager. (line 3129) -* BFD_RELOC_TILEGX_HW0: howto manager. (line 3121) -* BFD_RELOC_TILEGX_HW0_LAST: howto manager. (line 3125) -* BFD_RELOC_TILEGX_HW1: howto manager. (line 3122) -* BFD_RELOC_TILEGX_HW1_LAST: howto manager. (line 3126) -* BFD_RELOC_TILEGX_HW2: howto manager. (line 3123) -* BFD_RELOC_TILEGX_HW2_LAST: howto manager. (line 3127) -* BFD_RELOC_TILEGX_HW3: howto manager. (line 3124) -* BFD_RELOC_TILEGX_IMM16_X0_HW0: howto manager. (line 3148) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT: howto manager. (line 3176) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST: howto manager. (line 3156) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT: howto manager. (line 3184) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL: howto manager. (line 3170) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL: howto manager. - (line 3204) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD: howto manager. (line 3198) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE: howto manager. (line 3210) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE: howto manager. (line 3194) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL: howto manager. (line 3162) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL: howto manager. (line 3178) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD: howto manager. (line 3190) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE: howto manager. (line 3202) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE: howto manager. (line 3192) -* BFD_RELOC_TILEGX_IMM16_X0_HW1: howto manager. (line 3150) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST: howto manager. (line 3158) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT: howto manager. (line 3186) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL: howto manager. (line 3172) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL: howto manager. - (line 3206) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD: howto manager. (line 3200) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE: howto manager. (line 3212) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE: howto manager. (line 3196) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL: howto manager. (line 3164) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL: howto manager. (line 3180) -* BFD_RELOC_TILEGX_IMM16_X0_HW2: howto manager. (line 3152) -* BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST: howto manager. (line 3160) -* BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL: howto manager. (line 3174) -* BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL: howto manager. - (line 3208) -* BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL: howto manager. (line 3166) -* BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL: howto manager. (line 3182) -* BFD_RELOC_TILEGX_IMM16_X0_HW3: howto manager. (line 3154) -* BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL: howto manager. (line 3168) -* BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL: howto manager. (line 3188) -* BFD_RELOC_TILEGX_IMM16_X1_HW0: howto manager. (line 3149) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT: howto manager. (line 3177) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST: howto manager. (line 3157) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT: howto manager. (line 3185) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL: howto manager. (line 3171) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL: howto manager. - (line 3205) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD: howto manager. (line 3199) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE: howto manager. (line 3211) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE: howto manager. (line 3195) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL: howto manager. (line 3163) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL: howto manager. (line 3179) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD: howto manager. (line 3191) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE: howto manager. (line 3203) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE: howto manager. (line 3193) -* BFD_RELOC_TILEGX_IMM16_X1_HW1: howto manager. (line 3151) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST: howto manager. (line 3159) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT: howto manager. (line 3187) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL: howto manager. (line 3173) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL: howto manager. - (line 3207) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD: howto manager. (line 3201) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE: howto manager. (line 3213) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE: howto manager. (line 3197) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL: howto manager. (line 3165) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL: howto manager. (line 3181) -* BFD_RELOC_TILEGX_IMM16_X1_HW2: howto manager. (line 3153) -* BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST: howto manager. (line 3161) -* BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL: howto manager. (line 3175) -* BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL: howto manager. - (line 3209) -* BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL: howto manager. (line 3167) -* BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL: howto manager. (line 3183) -* BFD_RELOC_TILEGX_IMM16_X1_HW3: howto manager. (line 3155) -* BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL: howto manager. (line 3169) -* BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL: howto manager. (line 3189) -* BFD_RELOC_TILEGX_IMM8_X0: howto manager. (line 3135) -* BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD: howto manager. (line 3226) -* BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD: howto manager. (line 3221) -* BFD_RELOC_TILEGX_IMM8_X1: howto manager. (line 3137) -* BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD: howto manager. (line 3227) -* BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD: howto manager. (line 3222) -* BFD_RELOC_TILEGX_IMM8_Y0: howto manager. (line 3136) -* BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD: howto manager. (line 3228) -* BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD: howto manager. (line 3223) -* BFD_RELOC_TILEGX_IMM8_Y1: howto manager. (line 3138) -* BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD: howto manager. (line 3229) -* BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD: howto manager. (line 3224) -* BFD_RELOC_TILEGX_JMP_SLOT: howto manager. (line 3130) -* BFD_RELOC_TILEGX_JUMPOFF_X1: howto manager. (line 3133) -* BFD_RELOC_TILEGX_JUMPOFF_X1_PLT: howto manager. (line 3134) -* BFD_RELOC_TILEGX_MF_IMM14_X1: howto manager. (line 3141) -* BFD_RELOC_TILEGX_MMEND_X0: howto manager. (line 3143) -* BFD_RELOC_TILEGX_MMSTART_X0: howto manager. (line 3142) -* BFD_RELOC_TILEGX_MT_IMM14_X1: howto manager. (line 3140) -* BFD_RELOC_TILEGX_RELATIVE: howto manager. (line 3131) -* BFD_RELOC_TILEGX_SHAMT_X0: howto manager. (line 3144) -* BFD_RELOC_TILEGX_SHAMT_X1: howto manager. (line 3145) -* BFD_RELOC_TILEGX_SHAMT_Y0: howto manager. (line 3146) -* BFD_RELOC_TILEGX_SHAMT_Y1: howto manager. (line 3147) -* BFD_RELOC_TILEGX_TLS_DTPMOD32: howto manager. (line 3217) -* BFD_RELOC_TILEGX_TLS_DTPMOD64: howto manager. (line 3214) -* BFD_RELOC_TILEGX_TLS_DTPOFF32: howto manager. (line 3218) -* BFD_RELOC_TILEGX_TLS_DTPOFF64: howto manager. (line 3215) -* BFD_RELOC_TILEGX_TLS_GD_CALL: howto manager. (line 3220) -* BFD_RELOC_TILEGX_TLS_IE_LOAD: howto manager. (line 3225) -* BFD_RELOC_TILEGX_TLS_TPOFF32: howto manager. (line 3219) -* BFD_RELOC_TILEGX_TLS_TPOFF64: howto manager. (line 3216) -* BFD_RELOC_TILEPRO_BROFF_X1: howto manager. (line 3044) -* BFD_RELOC_TILEPRO_COPY: howto manager. (line 3040) -* BFD_RELOC_TILEPRO_DEST_IMM8_X1: howto manager. (line 3051) -* BFD_RELOC_TILEPRO_GLOB_DAT: howto manager. (line 3041) -* BFD_RELOC_TILEPRO_IMM16_X0: howto manager. (line 3054) -* BFD_RELOC_TILEPRO_IMM16_X0_GOT: howto manager. (line 3070) -* BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA: howto manager. (line 3076) -* BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI: howto manager. (line 3074) -* BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO: howto manager. (line 3072) -* BFD_RELOC_TILEPRO_IMM16_X0_HA: howto manager. (line 3060) -* BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL: howto manager. (line 3068) -* BFD_RELOC_TILEPRO_IMM16_X0_HI: howto manager. (line 3058) -* BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL: howto manager. (line 3066) -* BFD_RELOC_TILEPRO_IMM16_X0_LO: howto manager. (line 3056) -* BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL: howto manager. (line 3064) -* BFD_RELOC_TILEPRO_IMM16_X0_PCREL: howto manager. (line 3062) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD: howto manager. (line 3092) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA: howto manager. (line 3098) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI: howto manager. (line 3096) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO: howto manager. (line 3094) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE: howto manager. (line 3100) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA: howto manager. (line 3106) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI: howto manager. (line 3104) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO: howto manager. (line 3102) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE: howto manager. (line 3111) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA: howto manager. (line 3117) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI: howto manager. (line 3115) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO: howto manager. (line 3113) -* BFD_RELOC_TILEPRO_IMM16_X1: howto manager. (line 3055) -* BFD_RELOC_TILEPRO_IMM16_X1_GOT: howto manager. (line 3071) -* BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA: howto manager. (line 3077) -* BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI: howto manager. (line 3075) -* BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO: howto manager. (line 3073) -* BFD_RELOC_TILEPRO_IMM16_X1_HA: howto manager. (line 3061) -* BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL: howto manager. (line 3069) -* BFD_RELOC_TILEPRO_IMM16_X1_HI: howto manager. (line 3059) -* BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL: howto manager. (line 3067) -* BFD_RELOC_TILEPRO_IMM16_X1_LO: howto manager. (line 3057) -* BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL: howto manager. (line 3065) -* BFD_RELOC_TILEPRO_IMM16_X1_PCREL: howto manager. (line 3063) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD: howto manager. (line 3093) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA: howto manager. (line 3099) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI: howto manager. (line 3097) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO: howto manager. (line 3095) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE: howto manager. (line 3101) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA: howto manager. (line 3107) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI: howto manager. (line 3105) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO: howto manager. (line 3103) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE: howto manager. (line 3112) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA: howto manager. (line 3118) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI: howto manager. (line 3116) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO: howto manager. (line 3114) -* BFD_RELOC_TILEPRO_IMM8_X0: howto manager. (line 3047) -* BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD: howto manager. (line 3087) -* BFD_RELOC_TILEPRO_IMM8_X1: howto manager. (line 3049) -* BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD: howto manager. (line 3088) -* BFD_RELOC_TILEPRO_IMM8_Y0: howto manager. (line 3048) -* BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD: howto manager. (line 3089) -* BFD_RELOC_TILEPRO_IMM8_Y1: howto manager. (line 3050) -* BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD: howto manager. (line 3090) -* BFD_RELOC_TILEPRO_JMP_SLOT: howto manager. (line 3042) -* BFD_RELOC_TILEPRO_JOFFLONG_X1: howto manager. (line 3045) -* BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT: howto manager. (line 3046) -* BFD_RELOC_TILEPRO_MF_IMM15_X1: howto manager. (line 3053) -* BFD_RELOC_TILEPRO_MMEND_X0: howto manager. (line 3079) -* BFD_RELOC_TILEPRO_MMEND_X1: howto manager. (line 3081) -* BFD_RELOC_TILEPRO_MMSTART_X0: howto manager. (line 3078) -* BFD_RELOC_TILEPRO_MMSTART_X1: howto manager. (line 3080) -* BFD_RELOC_TILEPRO_MT_IMM15_X1: howto manager. (line 3052) -* BFD_RELOC_TILEPRO_RELATIVE: howto manager. (line 3043) -* BFD_RELOC_TILEPRO_SHAMT_X0: howto manager. (line 3082) -* BFD_RELOC_TILEPRO_SHAMT_X1: howto manager. (line 3083) -* BFD_RELOC_TILEPRO_SHAMT_Y0: howto manager. (line 3084) -* BFD_RELOC_TILEPRO_SHAMT_Y1: howto manager. (line 3085) -* BFD_RELOC_TILEPRO_TLS_DTPMOD32: howto manager. (line 3108) -* BFD_RELOC_TILEPRO_TLS_DTPOFF32: howto manager. (line 3109) -* BFD_RELOC_TILEPRO_TLS_GD_CALL: howto manager. (line 3086) -* BFD_RELOC_TILEPRO_TLS_IE_LOAD: howto manager. (line 3091) -* BFD_RELOC_TILEPRO_TLS_TPOFF32: howto manager. (line 3110) -* bfd_reloc_type_lookup: howto manager. (line 3255) -* BFD_RELOC_V850_16_GOT: howto manager. (line 1394) -* BFD_RELOC_V850_16_GOTOFF: howto manager. (line 1418) -* BFD_RELOC_V850_16_PCREL: howto manager. (line 1364) -* BFD_RELOC_V850_16_S1: howto manager. (line 1382) -* BFD_RELOC_V850_16_SPLIT_OFFSET: howto manager. (line 1379) -* BFD_RELOC_V850_17_PCREL: howto manager. (line 1367) -* BFD_RELOC_V850_22_PCREL: howto manager. (line 1299) -* BFD_RELOC_V850_22_PLT_PCREL: howto manager. (line 1400) -* BFD_RELOC_V850_23: howto manager. (line 1370) -* BFD_RELOC_V850_32_ABS: howto manager. (line 1376) -* BFD_RELOC_V850_32_GOT: howto manager. (line 1397) -* BFD_RELOC_V850_32_GOTOFF: howto manager. (line 1421) -* BFD_RELOC_V850_32_GOTPCREL: howto manager. (line 1391) -* BFD_RELOC_V850_32_PCREL: howto manager. (line 1373) -* BFD_RELOC_V850_32_PLT_PCREL: howto manager. (line 1403) -* BFD_RELOC_V850_9_PCREL: howto manager. (line 1296) -* BFD_RELOC_V850_ALIGN: howto manager. (line 1357) -* BFD_RELOC_V850_CALLT_15_16_OFFSET: howto manager. (line 1388) -* BFD_RELOC_V850_CALLT_16_16_OFFSET: howto manager. (line 1348) -* BFD_RELOC_V850_CALLT_6_7_OFFSET: howto manager. (line 1345) -* BFD_RELOC_V850_CODE: howto manager. (line 1424) -* BFD_RELOC_V850_COPY: howto manager. (line 1406) -* BFD_RELOC_V850_DATA: howto manager. (line 1427) -* BFD_RELOC_V850_GLOB_DAT: howto manager. (line 1409) -* BFD_RELOC_V850_JMP_SLOT: howto manager. (line 1412) -* BFD_RELOC_V850_LO16_S1: howto manager. (line 1385) -* BFD_RELOC_V850_LO16_SPLIT_OFFSET: howto manager. (line 1360) -* BFD_RELOC_V850_LONGCALL: howto manager. (line 1351) -* BFD_RELOC_V850_LONGJUMP: howto manager. (line 1354) -* BFD_RELOC_V850_RELATIVE: howto manager. (line 1415) -* BFD_RELOC_V850_SDA_15_16_OFFSET: howto manager. (line 1305) -* BFD_RELOC_V850_SDA_16_16_OFFSET: howto manager. (line 1302) -* BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET: howto manager. (line 1337) -* BFD_RELOC_V850_TDA_16_16_OFFSET: howto manager. (line 1327) -* BFD_RELOC_V850_TDA_4_4_OFFSET: howto manager. (line 1334) -* BFD_RELOC_V850_TDA_4_5_OFFSET: howto manager. (line 1330) -* BFD_RELOC_V850_TDA_6_8_OFFSET: howto manager. (line 1316) -* BFD_RELOC_V850_TDA_7_7_OFFSET: howto manager. (line 1324) -* BFD_RELOC_V850_TDA_7_8_OFFSET: howto manager. (line 1320) -* BFD_RELOC_V850_ZDA_15_16_OFFSET: howto manager. (line 1312) -* BFD_RELOC_V850_ZDA_16_16_OFFSET: howto manager. (line 1309) -* BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET: howto manager. (line 1341) -* BFD_RELOC_VAX_GLOB_DAT: howto manager. (line 2425) -* BFD_RELOC_VAX_JMP_SLOT: howto manager. (line 2426) -* BFD_RELOC_VAX_RELATIVE: howto manager. (line 2427) -* BFD_RELOC_VPE4KMATH_DATA: howto manager. (line 2001) -* BFD_RELOC_VPE4KMATH_INSN: howto manager. (line 2002) -* BFD_RELOC_VTABLE_ENTRY: howto manager. (line 2006) -* BFD_RELOC_VTABLE_INHERIT: howto manager. (line 2005) -* BFD_RELOC_X86_64_32S: howto manager. (line 608) -* BFD_RELOC_X86_64_COPY: howto manager. (line 603) -* BFD_RELOC_X86_64_DTPMOD64: howto manager. (line 609) -* BFD_RELOC_X86_64_DTPOFF32: howto manager. (line 614) -* BFD_RELOC_X86_64_DTPOFF64: howto manager. (line 610) -* BFD_RELOC_X86_64_GLOB_DAT: howto manager. (line 604) -* BFD_RELOC_X86_64_GOT32: howto manager. (line 601) -* BFD_RELOC_X86_64_GOT64: howto manager. (line 619) -* BFD_RELOC_X86_64_GOTOFF64: howto manager. (line 617) -* BFD_RELOC_X86_64_GOTPC32: howto manager. (line 618) -* BFD_RELOC_X86_64_GOTPC32_TLSDESC: howto manager. (line 624) -* BFD_RELOC_X86_64_GOTPC64: howto manager. (line 621) -* BFD_RELOC_X86_64_GOTPCREL: howto manager. (line 607) -* BFD_RELOC_X86_64_GOTPCREL64: howto manager. (line 620) -* BFD_RELOC_X86_64_GOTPLT64: howto manager. (line 622) -* BFD_RELOC_X86_64_GOTTPOFF: howto manager. (line 615) -* BFD_RELOC_X86_64_IRELATIVE: howto manager. (line 627) -* BFD_RELOC_X86_64_JUMP_SLOT: howto manager. (line 605) -* BFD_RELOC_X86_64_PC32_BND: howto manager. (line 628) -* BFD_RELOC_X86_64_PLT32: howto manager. (line 602) -* BFD_RELOC_X86_64_PLT32_BND: howto manager. (line 629) -* BFD_RELOC_X86_64_PLTOFF64: howto manager. (line 623) -* BFD_RELOC_X86_64_RELATIVE: howto manager. (line 606) -* BFD_RELOC_X86_64_TLSDESC: howto manager. (line 626) -* BFD_RELOC_X86_64_TLSDESC_CALL: howto manager. (line 625) -* BFD_RELOC_X86_64_TLSGD: howto manager. (line 612) -* BFD_RELOC_X86_64_TLSLD: howto manager. (line 613) -* BFD_RELOC_X86_64_TPOFF32: howto manager. (line 616) -* BFD_RELOC_X86_64_TPOFF64: howto manager. (line 611) -* BFD_RELOC_XC16X_PAG: howto manager. (line 2419) -* BFD_RELOC_XC16X_POF: howto manager. (line 2420) -* BFD_RELOC_XC16X_SEG: howto manager. (line 2421) -* BFD_RELOC_XC16X_SOF: howto manager. (line 2422) -* BFD_RELOC_XGATE_24: howto manager. (line 2164) -* BFD_RELOC_XGATE_GPAGE: howto manager. (line 2161) -* BFD_RELOC_XGATE_IMM3: howto manager. (line 2181) -* BFD_RELOC_XGATE_IMM4: howto manager. (line 2184) -* BFD_RELOC_XGATE_IMM5: howto manager. (line 2187) -* BFD_RELOC_XGATE_IMM8_HI: howto manager. (line 2177) -* BFD_RELOC_XGATE_IMM8_LO: howto manager. (line 2173) -* BFD_RELOC_XGATE_LO16: howto manager. (line 2157) -* BFD_RELOC_XGATE_PCREL_10: howto manager. (line 2170) -* BFD_RELOC_XGATE_PCREL_9: howto manager. (line 2167) -* BFD_RELOC_XGATE_RL_GROUP: howto manager. (line 2152) -* BFD_RELOC_XGATE_RL_JUMP: howto manager. (line 2148) -* BFD_RELOC_XSTORMY16_12: howto manager. (line 2411) -* BFD_RELOC_XSTORMY16_24: howto manager. (line 2412) -* BFD_RELOC_XSTORMY16_FPTR16: howto manager. (line 2413) -* BFD_RELOC_XSTORMY16_REL_12: howto manager. (line 2410) -* BFD_RELOC_XTENSA_ASM_EXPAND: howto manager. (line 2582) -* BFD_RELOC_XTENSA_ASM_SIMPLIFY: howto manager. (line 2587) -* BFD_RELOC_XTENSA_DIFF16: howto manager. (line 2529) -* BFD_RELOC_XTENSA_DIFF32: howto manager. (line 2530) -* BFD_RELOC_XTENSA_DIFF8: howto manager. (line 2528) -* BFD_RELOC_XTENSA_GLOB_DAT: howto manager. (line 2518) -* BFD_RELOC_XTENSA_JMP_SLOT: howto manager. (line 2519) -* BFD_RELOC_XTENSA_OP0: howto manager. (line 2576) -* BFD_RELOC_XTENSA_OP1: howto manager. (line 2577) -* BFD_RELOC_XTENSA_OP2: howto manager. (line 2578) -* BFD_RELOC_XTENSA_PLT: howto manager. (line 2523) -* BFD_RELOC_XTENSA_RELATIVE: howto manager. (line 2520) -* BFD_RELOC_XTENSA_RTLD: howto manager. (line 2513) -* BFD_RELOC_XTENSA_SLOT0_ALT: howto manager. (line 2558) -* BFD_RELOC_XTENSA_SLOT0_OP: howto manager. (line 2538) -* BFD_RELOC_XTENSA_SLOT10_ALT: howto manager. (line 2568) -* BFD_RELOC_XTENSA_SLOT10_OP: howto manager. (line 2548) -* BFD_RELOC_XTENSA_SLOT11_ALT: howto manager. (line 2569) -* BFD_RELOC_XTENSA_SLOT11_OP: howto manager. (line 2549) -* BFD_RELOC_XTENSA_SLOT12_ALT: howto manager. (line 2570) -* BFD_RELOC_XTENSA_SLOT12_OP: howto manager. (line 2550) -* BFD_RELOC_XTENSA_SLOT13_ALT: howto manager. (line 2571) -* BFD_RELOC_XTENSA_SLOT13_OP: howto manager. (line 2551) -* BFD_RELOC_XTENSA_SLOT14_ALT: howto manager. (line 2572) -* BFD_RELOC_XTENSA_SLOT14_OP: howto manager. (line 2552) -* BFD_RELOC_XTENSA_SLOT1_ALT: howto manager. (line 2559) -* BFD_RELOC_XTENSA_SLOT1_OP: howto manager. (line 2539) -* BFD_RELOC_XTENSA_SLOT2_ALT: howto manager. (line 2560) -* BFD_RELOC_XTENSA_SLOT2_OP: howto manager. (line 2540) -* BFD_RELOC_XTENSA_SLOT3_ALT: howto manager. (line 2561) -* BFD_RELOC_XTENSA_SLOT3_OP: howto manager. (line 2541) -* BFD_RELOC_XTENSA_SLOT4_ALT: howto manager. (line 2562) -* BFD_RELOC_XTENSA_SLOT4_OP: howto manager. (line 2542) -* BFD_RELOC_XTENSA_SLOT5_ALT: howto manager. (line 2563) -* BFD_RELOC_XTENSA_SLOT5_OP: howto manager. (line 2543) -* BFD_RELOC_XTENSA_SLOT6_ALT: howto manager. (line 2564) -* BFD_RELOC_XTENSA_SLOT6_OP: howto manager. (line 2544) -* BFD_RELOC_XTENSA_SLOT7_ALT: howto manager. (line 2565) -* BFD_RELOC_XTENSA_SLOT7_OP: howto manager. (line 2545) -* BFD_RELOC_XTENSA_SLOT8_ALT: howto manager. (line 2566) -* BFD_RELOC_XTENSA_SLOT8_OP: howto manager. (line 2546) -* BFD_RELOC_XTENSA_SLOT9_ALT: howto manager. (line 2567) -* BFD_RELOC_XTENSA_SLOT9_OP: howto manager. (line 2547) -* BFD_RELOC_XTENSA_TLS_ARG: howto manager. (line 2597) -* BFD_RELOC_XTENSA_TLS_CALL: howto manager. (line 2598) -* BFD_RELOC_XTENSA_TLS_DTPOFF: howto manager. (line 2594) -* BFD_RELOC_XTENSA_TLS_FUNC: howto manager. (line 2596) -* BFD_RELOC_XTENSA_TLS_TPOFF: howto manager. (line 2595) -* BFD_RELOC_XTENSA_TLSDESC_ARG: howto manager. (line 2593) -* BFD_RELOC_XTENSA_TLSDESC_FN: howto manager. (line 2592) -* BFD_RELOC_Z80_DISP8: howto manager. (line 2601) -* BFD_RELOC_Z8K_CALLR: howto manager. (line 2607) -* BFD_RELOC_Z8K_DISP7: howto manager. (line 2604) -* BFD_RELOC_Z8K_IMM4L: howto manager. (line 2610) -* bfd_rename_section: section prototypes. (line 169) -* bfd_scan_arch: Architectures. (line 500) -* bfd_scan_vma: Miscellaneous. (line 124) -* bfd_seach_for_target: bfd_target. (line 524) -* bfd_section_already_linked: Writing the symbol table. - (line 55) -* bfd_section_list_clear: section prototypes. (line 8) -* bfd_sections_find_if: section prototypes. (line 199) -* bfd_set_arch_info: Architectures. (line 541) -* bfd_set_archive_head: Archives. (line 75) -* bfd_set_assert_handler: Error reporting. (line 141) -* bfd_set_default_target: bfd_target. (line 463) -* bfd_set_error: Error reporting. (line 57) -* bfd_set_error_handler: Error reporting. (line 99) -* bfd_set_error_program_name: Error reporting. (line 108) -* bfd_set_file_flags: Miscellaneous. (line 44) -* bfd_set_format: Formats. (line 68) -* bfd_set_gp_size: Miscellaneous. (line 114) -* bfd_set_private_flags: Miscellaneous. (line 191) -* bfd_set_reloc: Miscellaneous. (line 34) -* bfd_set_section_contents: section prototypes. (line 230) -* bfd_set_section_flags: section prototypes. (line 154) -* bfd_set_section_size: section prototypes. (line 216) -* bfd_set_start_address: Miscellaneous. (line 93) -* bfd_set_symtab: symbol handling functions. - (line 60) -* bfd_symbol_info: symbol handling functions. - (line 130) -* bfd_target_list: bfd_target. (line 515) -* bfd_write_bigendian_4byte_int: Internal. (line 13) -* bfd_zalloc: Opening and Closing. - (line 236) -* bfd_zalloc2: Opening and Closing. - (line 245) -* coff_symbol_type: coff. (line 245) -* core_file_matches_executable_p: Core Files. (line 39) -* find_separate_debug_file: Opening and Closing. - (line 308) -* generic_core_file_matches_executable_p: Core Files. (line 49) -* Hash tables: Hash Tables. (line 6) -* internal object-file format: Canonical format. (line 11) -* Linker: Linker Functions. (line 6) -* Other functions: Miscellaneous. (line 206) -* separate_alt_debug_file_exists: Opening and Closing. - (line 299) -* separate_debug_file_exists: Opening and Closing. - (line 290) -* struct bfd_iovec: Miscellaneous. (line 370) -* target vector (_bfd_final_link): Performing the Final Link. - (line 6) -* target vector (_bfd_link_add_symbols): Adding Symbols to the Hash Table. - (line 6) -* target vector (_bfd_link_hash_table_create): Creating a Linker Hash Table. - (line 6) -* The HOWTO Macro: typedef arelent. (line 288) -* what is it?: Overview. (line 6) - - - -Tag Table: -Node: Top1060 -Node: Overview1399 -Node: History2450 -Node: How It Works3396 -Node: What BFD Version 2 Can Do4939 -Node: BFD information loss6254 -Node: Canonical format8786 -Node: BFD front end13158 -Node: typedef bfd13582 -Node: Error reporting24300 -Node: Miscellaneous29167 -Node: Memory Usage46310 -Node: Initialization47538 -Node: Sections47997 -Node: Section Input48480 -Node: Section Output49845 -Node: typedef asection52331 -Node: section prototypes77563 -Node: Symbols87820 -Node: Reading Symbols89415 -Node: Writing Symbols90522 -Node: Mini Symbols92263 -Node: typedef asymbol93237 -Node: symbol handling functions99296 -Node: Archives104638 -Node: Formats108667 -Node: Relocations111615 -Node: typedef arelent112342 -Node: howto manager127978 -Node: Core Files234626 -Node: Targets236664 -Node: bfd_target238634 -Node: Architectures261856 -Node: Opening and Closing288730 -Node: Internal302076 -Node: File Caching308421 -Node: Linker Functions310335 -Node: Creating a Linker Hash Table312008 -Node: Adding Symbols to the Hash Table313746 -Node: Differing file formats314646 -Node: Adding symbols from an object file316371 -Node: Adding symbols from an archive318522 -Node: Performing the Final Link321451 -Node: Information provided by the linker322693 -Node: Relocating the section contents323847 -Node: Writing the symbol table325598 -Node: Hash Tables329982 -Node: Creating and Freeing a Hash Table331180 -Node: Looking Up or Entering a String332430 -Node: Traversing a Hash Table333683 -Node: Deriving a New Hash Table Type334472 -Node: Define the Derived Structures335538 -Node: Write the Derived Creation Routine336619 -Node: Write Other Derived Routines339243 -Node: BFD back ends340558 -Node: What to Put Where340828 -Node: aout341008 -Node: coff347326 -Node: elf375763 -Node: mmo376164 -Node: File layout377092 -Node: Symbol-table382739 -Node: mmo section mapping386508 -Node: GNU Free Documentation License390160 -Node: BFD Index415243 - -End Tag Table diff -Nur binutils-2.24.orig/bfd/doc/bfdio.texi binutils-2.24/bfd/doc/bfdio.texi --- binutils-2.24.orig/bfd/doc/bfdio.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/bfdio.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,95 +0,0 @@ -@findex struct bfd_iovec -@subsubsection @code{struct bfd_iovec} -@strong{Description}@* -The @code{struct bfd_iovec} contains the internal file I/O class. -Each @code{BFD} has an instance of this class and all file I/O is -routed through it (it is assumed that the instance implements -all methods listed below). -@example -struct bfd_iovec -@{ - /* To avoid problems with macros, a "b" rather than "f" - prefix is prepended to each method name. */ - /* Attempt to read/write NBYTES on ABFD's IOSTREAM storing/fetching - bytes starting at PTR. Return the number of bytes actually - transfered (a read past end-of-file returns less than NBYTES), - or -1 (setting @code{bfd_error}) if an error occurs. */ - file_ptr (*bread) (struct bfd *abfd, void *ptr, file_ptr nbytes); - file_ptr (*bwrite) (struct bfd *abfd, const void *ptr, - file_ptr nbytes); - /* Return the current IOSTREAM file offset, or -1 (setting @code{bfd_error} - if an error occurs. */ - file_ptr (*btell) (struct bfd *abfd); - /* For the following, on successful completion a value of 0 is returned. - Otherwise, a value of -1 is returned (and @code{bfd_error} is set). */ - int (*bseek) (struct bfd *abfd, file_ptr offset, int whence); - int (*bclose) (struct bfd *abfd); - int (*bflush) (struct bfd *abfd); - int (*bstat) (struct bfd *abfd, struct stat *sb); - /* Mmap a part of the files. ADDR, LEN, PROT, FLAGS and OFFSET are the usual - mmap parameter, except that LEN and OFFSET do not need to be page - aligned. Returns (void *)-1 on failure, mmapped address on success. - Also write in MAP_ADDR the address of the page aligned buffer and in - MAP_LEN the size mapped (a page multiple). Use unmap with MAP_ADDR and - MAP_LEN to unmap. */ - void *(*bmmap) (struct bfd *abfd, void *addr, bfd_size_type len, - int prot, int flags, file_ptr offset, - void **map_addr, bfd_size_type *map_len); -@}; -extern const struct bfd_iovec _bfd_memory_iovec; -@end example - -@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 -file_ptr 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 question, "is the -size reasonable?". - -@findex bfd_mmap -@subsubsection @code{bfd_mmap} -@strong{Synopsis} -@example -void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, - int prot, int flags, file_ptr offset, - void **map_addr, bfd_size_type *map_len); -@end example -@strong{Description}@* -Return mmap()ed region of the file, if possible and implemented. -LEN and OFFSET do not need to be page aligned. The page aligned -address and length are written to MAP_ADDR and MAP_LEN. - diff -Nur binutils-2.24.orig/bfd/doc/bfdt.texi binutils-2.24/bfd/doc/bfdt.texi --- binutils-2.24.orig/bfd/doc/bfdt.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/bfdt.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,888 +0,0 @@ -@node typedef bfd, Error reporting, BFD front end, BFD front end -@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 - -enum bfd_direction - @{ - no_direction = 0, - read_direction = 1, - write_direction = 2, - both_direction = 3 - @}; - -struct bfd -@{ - /* A unique identifier of the BFD */ - unsigned int id; - - /* The filename the application opened the BFD with. */ - const char *filename; - - /* A pointer to the target jump table. */ - const struct bfd_target *xvec; - - /* The IOSTREAM, and corresponding IO vector that provide access - to the file backing the BFD. */ - void *iostream; - const struct bfd_iovec *iovec; - - /* 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... */ - ufile_ptr where; - - /* 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 with which the BFD was opened. */ - enum bfd_direction direction; - - /* Format_specific flags. */ - flagword flags; - - /* Values that may appear in the flags field of a BFD. These also - appear in the object_flags field of the bfd_target structure, where - they indicate the set of flags used by that backend (not all flags - are meaningful for all object file formats) (FIXME: at the moment, - the object_flags values have mostly just been copied from backend - to another, and are not necessarily correct). */ - -#define BFD_NO_FLAGS 0x00 - - /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 - - /* BFD is directly executable. */ -#define EXEC_P 0x02 - - /* BFD has line number information (basically used for F_LNNO in a - COFF header). */ -#define HAS_LINENO 0x04 - - /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 - - /* BFD has symbols. */ -#define HAS_SYMS 0x10 - - /* BFD has local symbols (basically used for F_LSYMS in a COFF - header). */ -#define HAS_LOCALS 0x20 - - /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 - - /* Text section is write protected (if D_PAGED is not set, this is - like an a.out NMAGIC file) (the linker sets this by default, but - clears it for -r or -N). */ -#define WP_TEXT 0x80 - - /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the - linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 - - /* BFD is relaxable (this means that bfd_relax_section may be able to - do something) (sometimes bfd_relax_section can do something even if - this is not set). */ -#define BFD_IS_RELAXABLE 0x200 - - /* This may be set before writing out a BFD to request using a - traditional format. For example, this is used to request that when - writing out an a.out object the symbols not be hashed to eliminate - duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 - - /* This flag indicates that the BFD contents are actually cached - in memory. If this is set, iostream points to a bfd_in_memory - struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 - - /* This BFD has been created by the linker and doesn't correspond - to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - - /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 - - /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 - - /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 - - /* Flags bits to be saved in bfd_preserve_save. */ -#define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) - - /* Flags bits which are for BFD use only. */ -#define BFD_FLAGS_FOR_BFD_USE_MASK \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) - - /* 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. */ - ufile_ptr origin; - - /* The origin in the archive of the proxy entry. This will - normally be the same as origin, except for thin archives, - when it will contain the current offset of the proxy in the - thin archive rather than the offset of the bfd in its actual - container. */ - ufile_ptr proxy_origin; - - /* A hash table for section names. */ - struct bfd_hash_table section_htab; - - /* Pointer to linked list of sections. */ - struct bfd_section *sections; - - /* The last section on the section list. */ - struct bfd_section *section_last; - - /* 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). - Also used by the linker to cache input BFD symbols. */ - struct bfd_symbol **outsymbols; - - /* Used for slurped dynamic symbol tables. */ - unsigned int dynsymcount; - - /* Pointer to structure which contains architecture information. */ - const struct bfd_arch_info *arch_info; - - /* Stuff only useful for archives. */ - void *arelt_data; - struct bfd *my_archive; /* The containing archive BFD. */ - struct bfd *archive_next; /* The next BFD in the archive. */ - struct bfd *archive_head; /* The first BFD in the archive. */ - struct bfd *nested_archives; /* List of nested archive in a flattened - thin archive. */ - - /* 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 verilog_data_struct *verilog_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 mmo_data_struct *mmo_data; - struct sun_core_struct *sun_core_data; - struct sco5_core_struct *sco5_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; - struct mach_o_data_struct *mach_o_data; - struct mach_o_fat_data_struct *mach_o_fat_data; - struct plugin_data_struct *plugin_data; - struct bfd_pef_data_struct *pef_data; - struct bfd_pef_xlib_data_struct *pef_xlib_data; - struct bfd_sym_data_struct *sym_data; - void *any; - @} - tdata; - - /* Used by the application to hold private data. */ - void *usrdata; - - /* Where all the allocated stuff under this BFD goes. This is a - struct objalloc *, but we use void * to avoid requiring the inclusion - of objalloc.h. */ - void *memory; - - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* 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. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; -@}; - -@end example -@node Error reporting, Miscellaneous, typedef bfd, BFD front end -@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_wrong_object_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_missing_dso, - 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_on_input, - 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}. -If @var{error_tag} is bfd_error_on_input, then this function -takes two more parameters, the input bfd where the error -occurred, and the bfd_error_type error. - -@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 overridden by the program. - -The BFD error handler acts like printf. - - -@example - -typedef void (*bfd_error_handler_type) (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. - -@findex bfd_get_error_handler -@subsubsection @code{bfd_get_error_handler} -@strong{Synopsis} -@example -bfd_error_handler_type bfd_get_error_handler (void); -@end example -@strong{Description}@* -Return the BFD error handler function. - -@subsection BFD assert handler -If BFD finds an internal inconsistency, the bfd assert -handler is called with information on the BFD version, BFD -source file and line. If this happens, most programs linked -against BFD are expected to want to exit with an error, or mark -the current BFD operation as failed, so it is recommended to -override the default handler, which just calls -_bfd_error_handler and continues. - - -@example - -typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, - const char *bfd_version, - const char *bfd_file, - int bfd_line); - -@end example -@findex bfd_set_assert_handler -@subsubsection @code{bfd_set_assert_handler} -@strong{Synopsis} -@example -bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -@end example -@strong{Description}@* -Set the BFD assert handler function. Returns the previous -function. - -@findex bfd_get_assert_handler -@subsubsection @code{bfd_get_assert_handler} -@strong{Synopsis} -@example -bfd_assert_handler_type bfd_get_assert_handler (void); -@end example -@strong{Description}@* -Return the BFD assert handler function. - -@node Miscellaneous, Memory Usage, Error reporting, BFD front end -@section Miscellaneous - - -@subsection Miscellaneous functions - - -@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 -bfd_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_get_arch_size -@subsubsection @code{bfd_get_arch_size} -@strong{Synopsis} -@example -int bfd_get_arch_size (bfd *abfd); -@end example -@strong{Description}@* -Returns the architecture address size, in bits, as determined -by the object file's format. For ELF, this information is -included in the header. - -@strong{Returns}@* -Returns the arch size in bits if known, @code{-1} otherwise. - -@findex bfd_get_sign_extend_vma -@subsubsection @code{bfd_get_sign_extend_vma} -@strong{Synopsis} -@example -int bfd_get_sign_extend_vma (bfd *abfd); -@end example -@strong{Description}@* -Indicates if the target architecture "naturally" sign extends -an address. Some architectures implicitly sign extend address -values when they are converted to types larger than the size -of an address. For instance, bfd_get_start_address() will -return an address sign extended to fill a bfd_vma when this is -the case. - -@strong{Returns}@* -Returns @code{1} if the target architecture is known to sign -extend addresses, @code{0} if the target architecture is known to -not sign extend addresses, and @code{-1} otherwise. - -@findex bfd_set_start_address -@subsubsection @code{bfd_set_start_address} -@strong{Synopsis} -@example -bfd_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_gp_size -@subsubsection @code{bfd_get_gp_size} -@strong{Synopsis} -@example -unsigned 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, unsigned 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. - -If the value would overflow, the maximum @code{bfd_vma} value is -returned. - -@findex bfd_copy_private_header_data -@subsubsection @code{bfd_copy_private_header_data} -@strong{Synopsis} -@example -bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); -@end example -@strong{Description}@* -Copy private BFD header information from the BFD @var{ibfd} to the -the BFD @var{obfd}. This copies information that may require -sections to exist, but does not require symbol tables. 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_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) -@end example - -@findex bfd_copy_private_bfd_data -@subsubsection @code{bfd_copy_private_bfd_data} -@strong{Synopsis} -@example -bfd_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 -bfd_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 -bfd_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 Other functions -@subsubsection @code{Other functions} -@strong{Description}@* -The following functions exist but have not yet been documented. -@example -#define bfd_sizeof_headers(abfd, info) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) - -#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)) - -#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) - -#define bfd_find_line(abfd, syms, sym, file, line) \ - BFD_SEND (abfd, _bfd_find_line, \ - (abfd, syms, sym, file, line)) - -#define bfd_find_inliner_info(abfd, file, func, line) \ - BFD_SEND (abfd, _bfd_find_inliner_info, \ - (abfd, file, func, line)) - -#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_gc_sections(abfd, link_info) \ - BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) - -#define bfd_lookup_section_flags(link_info, flag_info, section) \ - BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section)) - -#define bfd_merge_sections(abfd, link_info) \ - BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) - -#define bfd_is_group_section(abfd, sec) \ - BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) - -#define bfd_discard_group(abfd, sec) \ - BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) - -#define bfd_link_hash_table_create(abfd) \ - BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) - -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - -#define bfd_link_add_symbols(abfd, info) \ - BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) - -#define bfd_link_just_syms(abfd, sec, info) \ - BFD_SEND (abfd, _bfd_link_just_syms, (sec, 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_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \ - BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \ - dyncount, dynsyms, ret)) - -#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 - (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, - bfd_boolean, asymbol **); - -@end example - -@findex bfd_alt_mach_code -@subsubsection @code{bfd_alt_mach_code} -@strong{Synopsis} -@example -bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -@end example -@strong{Description}@* -When more than one machine code number is available for the -same machine type, this function can be used to switch between -the preferred one (alternative == 0) and any others. Currently, -only ELF supports this feature, with up to two alternate -machine codes. - -@findex bfd_emul_get_maxpagesize -@subsubsection @code{bfd_emul_get_maxpagesize} -@strong{Synopsis} -@example -bfd_vma bfd_emul_get_maxpagesize (const char *); -@end example -@strong{Description}@* -Returns the maximum page size, in bytes, as determined by -emulation. - -@strong{Returns}@* -Returns the maximum page size in bytes for ELF, 0 otherwise. - -@findex bfd_emul_set_maxpagesize -@subsubsection @code{bfd_emul_set_maxpagesize} -@strong{Synopsis} -@example -void bfd_emul_set_maxpagesize (const char *, bfd_vma); -@end example -@strong{Description}@* -For ELF, set the maximum page size for the emulation. It is -a no-op for other formats. - -@findex bfd_emul_get_commonpagesize -@subsubsection @code{bfd_emul_get_commonpagesize} -@strong{Synopsis} -@example -bfd_vma bfd_emul_get_commonpagesize (const char *); -@end example -@strong{Description}@* -Returns the common page size, in bytes, as determined by -emulation. - -@strong{Returns}@* -Returns the common page size in bytes for ELF, 0 otherwise. - -@findex bfd_emul_set_commonpagesize -@subsubsection @code{bfd_emul_set_commonpagesize} -@strong{Synopsis} -@example -void bfd_emul_set_commonpagesize (const char *, bfd_vma); -@end example -@strong{Description}@* -For ELF, set the common page size for the emulation. It is -a no-op for other formats. - -@findex bfd_demangle -@subsubsection @code{bfd_demangle} -@strong{Synopsis} -@example -char *bfd_demangle (bfd *, const char *, int); -@end example -@strong{Description}@* -Wrapper around cplus_demangle. Strips leading underscores and -other such chars that would otherwise confuse the demangler. -If passed a g++ v3 ABI mangled name, returns a buffer allocated -with malloc holding the demangled name. Returns NULL otherwise -and on memory alloc failure. - diff -Nur binutils-2.24.orig/bfd/doc/bfdver.texi binutils-2.24/bfd/doc/bfdver.texi --- binutils-2.24.orig/bfd/doc/bfdver.texi 2013-12-02 10:32:19.000000000 +0100 +++ binutils-2.24/bfd/doc/bfdver.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -@set VERSION 2.24 -@set VERSION_PACKAGE (GNU Binutils) -@set UPDATED December 2013 -@set BUGURL @uref{http://www.sourceware.org/bugzilla/} diff -Nur binutils-2.24.orig/bfd/doc/bfdwin.texi binutils-2.24/bfd/doc/bfdwin.texi --- binutils-2.24.orig/bfd/doc/bfdwin.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/bfdwin.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -@findex -@subsubsection @code{} diff -Nur binutils-2.24.orig/bfd/doc/cache.texi binutils-2.24/bfd/doc/cache.texi --- binutils-2.24.orig/bfd/doc/cache.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/cache.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,65 +0,0 @@ -@section File caching -The file caching mechanism is embedded within BFD and allows -the application to open as many BFDs as it wants without -regard to the underlying operating system's file descriptor -limit (often as low as 20 open files). The module in -@code{cache.c} maintains a least recently used list of -@code{bfd_cache_max_open} files, and exports the name -@code{bfd_cache_lookup}, which runs around and makes sure that -the required BFD is open. If not, then it chooses a file to -close, closes it and opens the one wanted, returning its file -handle. - -@subsection Caching functions - - -@findex bfd_cache_init -@subsubsection @code{bfd_cache_init} -@strong{Synopsis} -@example -bfd_boolean bfd_cache_init (bfd *abfd); -@end example -@strong{Description}@* -Add a newly opened BFD to the cache. - -@findex bfd_cache_close -@subsubsection @code{bfd_cache_close} -@strong{Synopsis} -@example -bfd_boolean bfd_cache_close (bfd *abfd); -@end example -@strong{Description}@* -Remove the BFD @var{abfd} from the cache. If the attached file is open, -then close it too. - -@strong{Returns}@* -@code{FALSE} is returned if closing the file fails, @code{TRUE} is -returned if all is well. - -@findex bfd_cache_close_all -@subsubsection @code{bfd_cache_close_all} -@strong{Synopsis} -@example -bfd_boolean bfd_cache_close_all (void); -@end example -@strong{Description}@* -Remove all BFDs from the cache. If the attached file is open, -then close it too. - -@strong{Returns}@* -@code{FALSE} is returned if closing one of the file fails, @code{TRUE} is -returned if all is well. - -@findex bfd_open_file -@subsubsection @code{bfd_open_file} -@strong{Synopsis} -@example -FILE* bfd_open_file (bfd *abfd); -@end example -@strong{Description}@* -Call the OS to open a file for @var{abfd}. Return the @code{FILE *} -(possibly @code{NULL}) that results from this operation. Set up the -BFD so that future accesses know the file is open. If the @code{FILE *} -returned is @code{NULL}, then it won't have been put in the -cache, so it won't have to be removed from it. - diff -Nur binutils-2.24.orig/bfd/doc/coffcode.texi binutils-2.24/bfd/doc/coffcode.texi --- binutils-2.24.orig/bfd/doc/coffcode.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/coffcode.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,686 +0,0 @@ -@section coff backends -BFD supports a number of different flavours of coff format. -The major differences between formats are the sizes and -alignments of fields in structures on disk, and the occasional -extra field. - -Coff in all its varieties is implemented with a few common -files and a number of implementation specific files. For -example, The 88k bcs coff format is implemented in the file -@file{coff-m88k.c}. This file @code{#include}s -@file{coff/m88k.h} which defines the external structure of the -coff format for the 88k, and @file{coff/internal.h} which -defines the internal structure. @file{coff-m88k.c} also -defines the relocations used by the 88k format -@xref{Relocations}. - -The Intel i960 processor version of coff is implemented in -@file{coff-i960.c}. This file has the same structure as -@file{coff-m88k.c}, except that it includes @file{coff/i960.h} -rather than @file{coff-m88k.h}. - -@subsection Porting to a new version of coff -The recommended method is to select from the existing -implementations the version of coff which is most like the one -you want to use. For example, we'll say that i386 coff is -the one you select, and that your coff flavour is called foo. -Copy @file{i386coff.c} to @file{foocoff.c}, copy -@file{../include/coff/i386.h} to @file{../include/coff/foo.h}, -and add the lines to @file{targets.c} and @file{Makefile.in} -so that your new back end is used. Alter the shapes of the -structures in @file{../include/coff/foo.h} so that they match -what you need. You will probably also have to add -@code{#ifdef}s to the code in @file{coff/internal.h} and -@file{coffcode.h} if your version of coff is too wild. - -You can verify that your new BFD backend works quite simply by -building @file{objdump} from the @file{binutils} directory, -and making sure that its version of what's going on and your -host system's idea (assuming it has the pretty standard coff -dump utility, usually called @code{att-dump} or just -@code{dump}) are the same. Then clean up your code, and send -what you've done to Cygnus. Then your stuff will be in the -next release, and you won't have to keep integrating it. - -@subsection How the coff backend works - - -@subsubsection File layout -The Coff backend is split into generic routines that are -applicable to any Coff target and routines that are specific -to a particular target. The target-specific routines are -further split into ones which are basically the same for all -Coff targets except that they use the external symbol format -or use different values for certain constants. - -The generic routines are in @file{coffgen.c}. These routines -work for any Coff target. They use some hooks into the target -specific code; the hooks are in a @code{bfd_coff_backend_data} -structure, one of which exists for each target. - -The essentially similar target-specific routines are in -@file{coffcode.h}. This header file includes executable C code. -The various Coff targets first include the appropriate Coff -header file, make any special defines that are needed, and -then include @file{coffcode.h}. - -Some of the Coff targets then also have additional routines in -the target source file itself. - -For example, @file{coff-i960.c} includes -@file{coff/internal.h} and @file{coff/i960.h}. It then -defines a few constants, such as @code{I960}, and includes -@file{coffcode.h}. Since the i960 has complex relocation -types, @file{coff-i960.c} also includes some code to -manipulate the i960 relocs. This code is not in -@file{coffcode.h} because it would not be used by any other -target. - -@subsubsection Coff long section names -In the standard Coff object format, section names are limited to -the eight bytes available in the @code{s_name} field of the -@code{SCNHDR} section header structure. The format requires the -field to be NUL-padded, but not necessarily NUL-terminated, so -the longest section names permitted are a full eight characters. - -The Microsoft PE variants of the Coff object file format add -an extension to support the use of long section names. This -extension is defined in section 4 of the Microsoft PE/COFF -specification (rev 8.1). If a section name is too long to fit -into the section header's @code{s_name} field, it is instead -placed into the string table, and the @code{s_name} field is -filled with a slash ("/") followed by the ASCII decimal -representation of the offset of the full name relative to the -string table base. - -Note that this implies that the extension can only be used in object -files, as executables do not contain a string table. The standard -specifies that long section names from objects emitted into executable -images are to be truncated. - -However, as a GNU extension, BFD can generate executable images -that contain a string table and long section names. This -would appear to be technically valid, as the standard only says -that Coff debugging information is deprecated, not forbidden, -and in practice it works, although some tools that parse PE files -expecting the MS standard format may become confused; @file{PEview} is -one known example. - -The functionality is supported in BFD by code implemented under -the control of the macro @code{COFF_LONG_SECTION_NAMES}. If not -defined, the format does not support long section names in any way. -If defined, it is used to initialise a flag, -@code{_bfd_coff_long_section_names}, and a hook function pointer, -@code{_bfd_coff_set_long_section_names}, in the Coff backend data -structure. The flag controls the generation of long section names -in output BFDs at runtime; if it is false, as it will be by default -when generating an executable image, long section names are truncated; -if true, the long section names extension is employed. The hook -points to a function that allows the value of the flag to be altered -at runtime, on formats that support long section names at all; on -other formats it points to a stub that returns an error indication. - -With input BFDs, the flag is set according to whether any long section -names are detected while reading the section headers. For a completely -new BFD, the flag is set to the default for the target format. This -information can be used by a client of the BFD library when deciding -what output format to generate, and means that a BFD that is opened -for read and subsequently converted to a writeable BFD and modified -in-place will retain whatever format it had on input. - -If @code{COFF_LONG_SECTION_NAMES} is simply defined (blank), or is -defined to the value "1", then long section names are enabled by -default; if it is defined to the value zero, they are disabled by -default (but still accepted in input BFDs). The header @file{coffcode.h} -defines a macro, @code{COFF_DEFAULT_LONG_SECTION_NAMES}, which is -used in the backends to initialise the backend data structure fields -appropriately; see the comments for further detail. - -@subsubsection Bit twiddling -Each flavour of coff supported in BFD has its own header file -describing the external layout of the structures. There is also -an internal description of the coff layout, in -@file{coff/internal.h}. A major function of the -coff backend is swapping the bytes and twiddling the bits to -translate the external form of the structures into the normal -internal form. This is all performed in the -@code{bfd_swap}_@i{thing}_@i{direction} routines. Some -elements are different sizes between different versions of -coff; it is the duty of the coff version specific include file -to override the definitions of various packing routines in -@file{coffcode.h}. E.g., the size of line number entry in coff is -sometimes 16 bits, and sometimes 32 bits. @code{#define}ing -@code{PUT_LNSZ_LNNO} and @code{GET_LNSZ_LNNO} will select the -correct one. No doubt, some day someone will find a version of -coff which has a varying field size not catered to at the -moment. To port BFD, that person will have to add more @code{#defines}. -Three of the bit twiddling routines are exported to -@code{gdb}; @code{coff_swap_aux_in}, @code{coff_swap_sym_in} -and @code{coff_swap_lineno_in}. @code{GDB} reads the symbol -table on its own, but uses BFD to fix things up. More of the -bit twiddlers are exported for @code{gas}; -@code{coff_swap_aux_out}, @code{coff_swap_sym_out}, -@code{coff_swap_lineno_out}, @code{coff_swap_reloc_out}, -@code{coff_swap_filehdr_out}, @code{coff_swap_aouthdr_out}, -@code{coff_swap_scnhdr_out}. @code{Gas} currently keeps track -of all the symbol table and reloc drudgery itself, thereby -saving the internal BFD overhead, but uses BFD to swap things -on the way out, making cross ports much safer. Doing so also -allows BFD (and thus the linker) to use the same header files -as @code{gas}, which makes one avenue to disaster disappear. - -@subsubsection Symbol reading -The simple canonical form for symbols used by BFD is not rich -enough to keep all the information available in a coff symbol -table. The back end gets around this problem by keeping the original -symbol table around, "behind the scenes". - -When a symbol table is requested (through a call to -@code{bfd_canonicalize_symtab}), a request gets through to -@code{coff_get_normalized_symtab}. This reads the symbol table from -the coff file and swaps all the structures inside into the -internal form. It also fixes up all the pointers in the table -(represented in the file by offsets from the first symbol in -the table) into physical pointers to elements in the new -internal table. This involves some work since the meanings of -fields change depending upon context: a field that is a -pointer to another structure in the symbol table at one moment -may be the size in bytes of a structure at the next. Another -pass is made over the table. All symbols which mark file names -(@code{C_FILE} symbols) are modified so that the internal -string points to the value in the auxent (the real filename) -rather than the normal text associated with the symbol -(@code{".file"}). - -At this time the symbol names are moved around. Coff stores -all symbols less than nine characters long physically -within the symbol table; longer strings are kept at the end of -the file in the string table. This pass moves all strings -into memory and replaces them with pointers to the strings. - -The symbol table is massaged once again, this time to create -the canonical table used by the BFD application. Each symbol -is inspected in turn, and a decision made (using the -@code{sclass} field) about the various flags to set in the -@code{asymbol}. @xref{Symbols}. The generated canonical table -shares strings with the hidden internal symbol table. - -Any linenumbers are read from the coff file too, and attached -to the symbols which own the functions the linenumbers belong to. - -@subsubsection Symbol writing -Writing a symbol to a coff file which didn't come from a coff -file will lose any debugging information. The @code{asymbol} -structure remembers the BFD from which the symbol was taken, and on -output the back end makes sure that the same destination target as -source target is present. - -When the symbols have come from a coff file then all the -debugging information is preserved. - -Symbol tables are provided for writing to the back end in a -vector of pointers to pointers. This allows applications like -the linker to accumulate and output large symbol tables -without having to do too much byte copying. - -This function runs through the provided symbol table and -patches each symbol marked as a file place holder -(@code{C_FILE}) to point to the next file place holder in the -list. It also marks each @code{offset} field in the list with -the offset from the first symbol of the current symbol. - -Another function of this procedure is to turn the canonical -value form of BFD into the form used by coff. Internally, BFD -expects symbol values to be offsets from a section base; so a -symbol physically at 0x120, but in a section starting at -0x100, would have the value 0x20. Coff expects symbols to -contain their final value, so symbols have their values -changed at this point to reflect their sum with their owning -section. This transformation uses the -@code{output_section} field of the @code{asymbol}'s -@code{asection} @xref{Sections}. - -@itemize @bullet - -@item -@code{coff_mangle_symbols} -@end itemize -This routine runs though the provided symbol table and uses -the offsets generated by the previous pass and the pointers -generated when the symbol table was read in to create the -structured hierarchy required by coff. It changes each pointer -to a symbol into the index into the symbol table of the asymbol. - -@itemize @bullet - -@item -@code{coff_write_symbols} -@end itemize -This routine runs through the symbol table and patches up the -symbols from their internal form into the coff way, calls the -bit twiddlers, and writes out the table to the file. - -@findex coff_symbol_type -@subsubsection @code{coff_symbol_type} -@strong{Description}@* -The hidden information for an @code{asymbol} is described in a -@code{combined_entry_type}: - - -@example - -typedef struct coff_ptr_struct -@{ - /* Remembers the offset from the first symbol in the file for - this symbol. Generated by coff_renumber_symbols. */ - unsigned int offset; - - /* Should the value of this symbol be renumbered. Used for - XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ - unsigned int fix_value : 1; - - /* Should the tag field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_tag : 1; - - /* Should the endidx field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_end : 1; - - /* Should the x_csect.x_scnlen field be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_scnlen : 1; - - /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the - index into the line number entries. Set by coff_slurp_symbol_table. */ - unsigned int fix_line : 1; - - /* The container for the symbol structure as read and translated - from the file. */ - union - @{ - union internal_auxent auxent; - struct internal_syment syment; - @} u; -@} combined_entry_type; - - -/* Each canonical asymbol really looks like this: */ - -typedef struct coff_symbol_struct -@{ - /* The actual symbol which the rest of BFD works with */ - asymbol symbol; - - /* A pointer to the hidden information for this symbol */ - combined_entry_type *native; - - /* A pointer to the linenumber information for this symbol */ - struct lineno_cache_entry *lineno; - - /* Have the line numbers been relocated yet ? */ - bfd_boolean done_lineno; -@} coff_symbol_type; -@end example -@findex bfd_coff_backend_data -@subsubsection @code{bfd_coff_backend_data} - -@example -/* COFF symbol classifications. */ - -enum coff_symbol_classification -@{ - /* Global symbol. */ - COFF_SYMBOL_GLOBAL, - /* Common symbol. */ - COFF_SYMBOL_COMMON, - /* Undefined symbol. */ - COFF_SYMBOL_UNDEFINED, - /* Local symbol. */ - COFF_SYMBOL_LOCAL, - /* PE section symbol. */ - COFF_SYMBOL_PE_SECTION -@}; - -@end example -Special entry points for gdb to swap in coff symbol table parts: -@example -typedef struct -@{ - void (*_bfd_coff_swap_aux_in) - (bfd *, void *, int, int, int, int, void *); - - void (*_bfd_coff_swap_sym_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_lineno_in) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_aux_out) - (bfd *, void *, int, int, int, int, void *); - - unsigned int (*_bfd_coff_swap_sym_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_lineno_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_reloc_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_filehdr_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_aouthdr_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_scnhdr_out) - (bfd *, void *, void *); - - unsigned int _bfd_filhsz; - unsigned int _bfd_aoutsz; - unsigned int _bfd_scnhsz; - unsigned int _bfd_symesz; - unsigned int _bfd_auxesz; - unsigned int _bfd_relsz; - unsigned int _bfd_linesz; - unsigned int _bfd_filnmlen; - bfd_boolean _bfd_coff_long_filenames; - - bfd_boolean _bfd_coff_long_section_names; - bfd_boolean (*_bfd_coff_set_long_section_names) - (bfd *, int); - - unsigned int _bfd_coff_default_section_alignment_power; - bfd_boolean _bfd_coff_force_symnames_in_strings; - unsigned int _bfd_coff_debug_string_prefix_length; - - void (*_bfd_coff_swap_filehdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_aouthdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_scnhdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_reloc_in) - (bfd *abfd, void *, void *); - - bfd_boolean (*_bfd_coff_bad_format_hook) - (bfd *, void *); - - bfd_boolean (*_bfd_coff_set_arch_mach_hook) - (bfd *, void *); - - void * (*_bfd_coff_mkobject_hook) - (bfd *, void *, void *); - - bfd_boolean (*_bfd_styp_to_sec_flags_hook) - (bfd *, void *, const char *, asection *, flagword *); - - void (*_bfd_set_alignment_hook) - (bfd *, asection *, void *); - - bfd_boolean (*_bfd_coff_slurp_symbol_table) - (bfd *); - - bfd_boolean (*_bfd_coff_symname_in_debug) - (bfd *, struct internal_syment *); - - bfd_boolean (*_bfd_coff_pointerize_aux_hook) - (bfd *, combined_entry_type *, combined_entry_type *, - unsigned int, combined_entry_type *); - - bfd_boolean (*_bfd_coff_print_aux) - (bfd *, FILE *, combined_entry_type *, combined_entry_type *, - combined_entry_type *, unsigned int); - - void (*_bfd_coff_reloc16_extra_cases) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, - bfd_byte *, unsigned int *, unsigned int *); - - int (*_bfd_coff_reloc16_estimate) - (bfd *, asection *, arelent *, unsigned int, - struct bfd_link_info *); - - enum coff_symbol_classification (*_bfd_coff_classify_symbol) - (bfd *, struct internal_syment *); - - bfd_boolean (*_bfd_coff_compute_section_file_positions) - (bfd *); - - bfd_boolean (*_bfd_coff_start_final_link) - (bfd *, struct bfd_link_info *); - - bfd_boolean (*_bfd_coff_relocate_section) - (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - struct internal_reloc *, struct internal_syment *, asection **); - - reloc_howto_type *(*_bfd_coff_rtype_to_howto) - (bfd *, asection *, struct internal_reloc *, - struct coff_link_hash_entry *, struct internal_syment *, - bfd_vma *); - - bfd_boolean (*_bfd_coff_adjust_symndx) - (bfd *, struct bfd_link_info *, bfd *, asection *, - struct internal_reloc *, bfd_boolean *); - - bfd_boolean (*_bfd_coff_link_add_one_symbol) - (struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, - struct bfd_link_hash_entry **); - - bfd_boolean (*_bfd_coff_link_output_has_begun) - (bfd *, struct coff_final_link_info *); - - bfd_boolean (*_bfd_coff_final_link_postscript) - (bfd *, struct coff_final_link_info *); - - bfd_boolean (*_bfd_coff_print_pdata) - (bfd *, void *); - -@} bfd_coff_backend_data; - -#define coff_backend_info(abfd) \ - ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) - -#define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) - -#define bfd_coff_swap_sym_in(a,e,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) - -#define bfd_coff_swap_lineno_in(a,e,i) \ - ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) - -#define bfd_coff_swap_reloc_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) - -#define bfd_coff_swap_lineno_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) - -#define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) - -#define bfd_coff_swap_sym_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) - -#define bfd_coff_swap_scnhdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) - -#define bfd_coff_swap_filehdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) - -#define bfd_coff_swap_aouthdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) - -#define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) -#define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz) -#define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz) -#define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz) -#define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz) -#define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz) -#define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) -#define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen) -#define bfd_coff_long_filenames(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_filenames) -#define bfd_coff_long_section_names(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_section_names) -#define bfd_coff_set_long_section_names(abfd, enable) \ - ((coff_backend_info (abfd)->_bfd_coff_set_long_section_names) (abfd, enable)) -#define bfd_coff_default_section_alignment_power(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power) -#define bfd_coff_swap_filehdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) - -#define bfd_coff_swap_aouthdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) - -#define bfd_coff_swap_scnhdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) - -#define bfd_coff_swap_reloc_in(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) - -#define bfd_coff_bad_format_hook(abfd, filehdr) \ - ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) - -#define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ - ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) -#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ - ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\ - (abfd, filehdr, aouthdr)) - -#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ - ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ - (abfd, scnhdr, name, section, flags_ptr)) - -#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ - ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) - -#define bfd_coff_slurp_symbol_table(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) - -#define bfd_coff_symname_in_debug(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) - -#define bfd_coff_force_symnames_in_strings(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) - -#define bfd_coff_debug_string_prefix_length(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) - -#define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ - ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ - (abfd, file, base, symbol, aux, indaux)) - -#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\ - reloc, data, src_ptr, dst_ptr)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ - (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) - -#define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ - (abfd, section, reloc, shrink, link_info)) - -#define bfd_coff_classify_symbol(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ - (abfd, sym)) - -#define bfd_coff_compute_section_file_positions(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ - (abfd)) - -#define bfd_coff_start_final_link(obfd, info)\ - ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ - (obfd, info)) -#define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ - ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ - (obfd, info, ibfd, o, con, rel, isyms, secs)) -#define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ - ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ - (abfd, sec, rel, h, sym, addendp)) -#define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ - ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ - (obfd, info, ibfd, sec, rel, adjustedp)) -#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\ - value, string, cp, coll, hashp)\ - ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ - (info, abfd, name, flags, section, value, string, cp, coll, hashp)) - -#define bfd_coff_link_output_has_begun(a,p) \ - ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a, p)) -#define bfd_coff_final_link_postscript(a,p) \ - ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a, p)) - -#define bfd_coff_have_print_pdata(a) \ - (coff_backend_info (a)->_bfd_coff_print_pdata) -#define bfd_coff_print_pdata(a,p) \ - ((coff_backend_info (a)->_bfd_coff_print_pdata) (a, p)) - -/* Macro: Returns true if the bfd is a PE executable as opposed to a - PE object file. */ -#define bfd_pei_p(abfd) \ - (CONST_STRNEQ ((abfd)->xvec->name, "pei-")) -@end example -@subsubsection Writing relocations -To write relocations, the back end steps though the -canonical relocation table and create an -@code{internal_reloc}. The symbol index to use is removed from -the @code{offset} field in the symbol table supplied. The -address comes directly from the sum of the section base -address and the relocation offset; the type is dug directly -from the howto field. Then the @code{internal_reloc} is -swapped into the shape of an @code{external_reloc} and written -out to disk. - -@subsubsection Reading linenumbers -Creating the linenumber table is done by reading in the entire -coff linenumber table, and creating another table for internal use. - -A coff linenumber table is structured so that each function -is marked as having a line number of 0. Each line within the -function is an offset from the first line in the function. The -base of the line number information for the table is stored in -the symbol associated with the function. - -Note: The PE format uses line number 0 for a flag indicating a -new source file. - -The information is copied from the external to the internal -table, and each symbol which marks a function is marked by -pointing its... - -How does this work ? - -@subsubsection Reading relocations -Coff relocations are easily transformed into the internal BFD form -(@code{arelent}). - -Reading a coff relocation table is done in the following stages: - -@itemize @bullet - -@item -Read the entire coff relocation table into memory. - -@item -Process each relocation in turn; first swap it from the -external to the internal form. - -@item -Turn the symbol referenced in the relocation's symbol index -into a pointer into the canonical symbol table. -This table is the same as the one returned by a call to -@code{bfd_canonicalize_symtab}. The back end will call that -routine and save the result if a canonicalization hasn't been done. - -@item -The reloc index is turned into a pointer to a howto -structure, in a back end specific way. For instance, the 386 -and 960 use the @code{r_type} to directly produce an index -into a howto table vector; the 88k subtracts a number from the -@code{r_type} field and creates an addend field. -@end itemize - diff -Nur binutils-2.24.orig/bfd/doc/core.texi binutils-2.24/bfd/doc/core.texi --- binutils-2.24.orig/bfd/doc/core.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/core.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,70 +0,0 @@ -@section Core files - - -@subsection Core file functions - - -@strong{Description}@* -These are functions pertaining to core files. - -@findex bfd_core_file_failing_command -@subsubsection @code{bfd_core_file_failing_command} -@strong{Synopsis} -@example -const char *bfd_core_file_failing_command (bfd *abfd); -@end example -@strong{Description}@* -Return a read-only string explaining which program was running -when it failed and produced the core file @var{abfd}. - -@findex bfd_core_file_failing_signal -@subsubsection @code{bfd_core_file_failing_signal} -@strong{Synopsis} -@example -int bfd_core_file_failing_signal (bfd *abfd); -@end example -@strong{Description}@* -Returns the signal number which caused the core dump which -generated the file the BFD @var{abfd} is attached to. - -@findex bfd_core_file_pid -@subsubsection @code{bfd_core_file_pid} -@strong{Synopsis} -@example -int bfd_core_file_pid (bfd *abfd); -@end example -@strong{Description}@* -Returns the PID of the process the core dump the BFD -@var{abfd} is attached to was generated from. - -@findex core_file_matches_executable_p -@subsubsection @code{core_file_matches_executable_p} -@strong{Synopsis} -@example -bfd_boolean core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); -@end example -@strong{Description}@* -Return @code{TRUE} if the core file attached to @var{core_bfd} -was generated by a run of the executable file attached to -@var{exec_bfd}, @code{FALSE} otherwise. - -@findex generic_core_file_matches_executable_p -@subsubsection @code{generic_core_file_matches_executable_p} -@strong{Synopsis} -@example -bfd_boolean generic_core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); -@end example -@strong{Description}@* -Return TRUE if the core file attached to @var{core_bfd} -was generated by a run of the executable file attached -to @var{exec_bfd}. The match is based on executable -basenames only. - -Note: When not able to determine the core file failing -command or the executable name, we still return TRUE even -though we're not sure that core file and executable match. -This is to avoid generating a false warning in situations -where we really don't know whether they match or not. - diff -Nur binutils-2.24.orig/bfd/doc/elf.texi binutils-2.24/bfd/doc/elf.texi --- binutils-2.24.orig/bfd/doc/elf.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/elf.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,9 +0,0 @@ -@section ELF backends -BFD support for ELF formats is being worked on. -Currently, the best supported back ends are for sparc and i386 -(running svr4 or Solaris 2). - -Documentation of the internals of the support code still needs -to be written. The code is changing quickly enough that we -haven't bothered yet. - diff -Nur binutils-2.24.orig/bfd/doc/format.texi binutils-2.24/bfd/doc/format.texi --- binutils-2.24.orig/bfd/doc/format.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/format.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,112 +0,0 @@ -@section File formats -A format is a BFD concept of high level file contents type. The -formats supported by BFD are: - -@itemize @bullet - -@item -@code{bfd_object} -@end itemize -The BFD may contain data, symbols, relocations and debug info. - -@itemize @bullet - -@item -@code{bfd_archive} -@end itemize -The BFD contains other BFDs and an optional index. - -@itemize @bullet - -@item -@code{bfd_core} -@end itemize -The BFD contains the result of an executable core dump. - -@subsection File format functions - - -@findex bfd_check_format -@subsubsection @code{bfd_check_format} -@strong{Synopsis} -@example -bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); -@end example -@strong{Description}@* -Verify if the file attached to the BFD @var{abfd} is compatible -with the format @var{format} (i.e., one of @code{bfd_object}, -@code{bfd_archive} or @code{bfd_core}). - -If the BFD has been set to a specific target before the -call, only the named target and format combination is -checked. If the target has not been set, or has been set to -@code{default}, then all the known target backends is -interrogated to determine a match. If the default target -matches, it is used. If not, exactly one target must recognize -the file, or an error results. - -The function returns @code{TRUE} on success, otherwise @code{FALSE} -with one of the following error codes: - -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -if @code{format} is not one of @code{bfd_object}, @code{bfd_archive} or -@code{bfd_core}. - -@item -@code{bfd_error_system_call} - -if an error occured during a read - even some file mismatches -can cause bfd_error_system_calls. - -@item -@code{file_not_recognised} - -none of the backends recognised the file format. - -@item -@code{bfd_error_file_ambiguously_recognized} - -more than one backend recognised the file format. -@end itemize - -@findex bfd_check_format_matches -@subsubsection @code{bfd_check_format_matches} -@strong{Synopsis} -@example -bfd_boolean bfd_check_format_matches - (bfd *abfd, bfd_format format, char ***matching); -@end example -@strong{Description}@* -Like @code{bfd_check_format}, except when it returns FALSE with -@code{bfd_errno} set to @code{bfd_error_file_ambiguously_recognized}. In that -case, if @var{matching} is not NULL, it will be filled in with -a NULL-terminated list of the names of the formats that matched, -allocated with @code{malloc}. -Then the user may choose a format and try again. - -When done with the list that @var{matching} points to, the caller -should free it. - -@findex bfd_set_format -@subsubsection @code{bfd_set_format} -@strong{Synopsis} -@example -bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); -@end example -@strong{Description}@* -This function sets the file format of the BFD @var{abfd} to the -format @var{format}. If the target set in the BFD does not -support the format requested, the format is invalid, or the BFD -is not open for writing, then an error occurs. - -@findex bfd_format_string -@subsubsection @code{bfd_format_string} -@strong{Synopsis} -@example -const char *bfd_format_string (bfd_format format); -@end example -@strong{Description}@* -Return a pointer to a const string -@code{invalid}, @code{object}, @code{archive}, @code{core}, or @code{unknown}, -depending upon the value of @var{format}. - diff -Nur binutils-2.24.orig/bfd/doc/hash.texi binutils-2.24/bfd/doc/hash.texi --- binutils-2.24.orig/bfd/doc/hash.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/hash.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,247 +0,0 @@ -@section Hash Tables -@cindex Hash tables -BFD provides a simple set of hash table functions. Routines -are provided to initialize a hash table, to free a hash table, -to look up a string in a hash table and optionally create an -entry for it, and to traverse a hash table. There is -currently no routine to delete an string from a hash table. - -The basic hash table does not permit any data to be stored -with a string. However, a hash table is designed to present a -base class from which other types of hash tables may be -derived. These derived types may store additional information -with the string. Hash tables were implemented in this way, -rather than simply providing a data pointer in a hash table -entry, because they were designed for use by the linker back -ends. The linker may create thousands of hash table entries, -and the overhead of allocating private data and storing and -following pointers becomes noticeable. - -The basic hash table code is in @code{hash.c}. - -@menu -* Creating and Freeing a Hash Table:: -* Looking Up or Entering a String:: -* Traversing a Hash Table:: -* Deriving a New Hash Table Type:: -@end menu - -@node Creating and Freeing a Hash Table, Looking Up or Entering a String, Hash Tables, Hash Tables -@subsection Creating and freeing a hash table -@findex bfd_hash_table_init -@findex bfd_hash_table_init_n -To create a hash table, create an instance of a @code{struct -bfd_hash_table} (defined in @code{bfd.h}) and call -@code{bfd_hash_table_init} (if you know approximately how many -entries you will need, the function @code{bfd_hash_table_init_n}, -which takes a @var{size} argument, may be used). -@code{bfd_hash_table_init} returns @code{FALSE} if some sort of -error occurs. - -@findex bfd_hash_newfunc -The function @code{bfd_hash_table_init} take as an argument a -function to use to create new entries. For a basic hash -table, use the function @code{bfd_hash_newfunc}. @xref{Deriving -a New Hash Table Type}, for why you would want to use a -different value for this argument. - -@findex bfd_hash_allocate -@code{bfd_hash_table_init} will create an objalloc which will be -used to allocate new entries. You may allocate memory on this -objalloc using @code{bfd_hash_allocate}. - -@findex bfd_hash_table_free -Use @code{bfd_hash_table_free} to free up all the memory that has -been allocated for a hash table. This will not free up the -@code{struct bfd_hash_table} itself, which you must provide. - -@findex bfd_hash_set_default_size -Use @code{bfd_hash_set_default_size} to set the default size of -hash table to use. - -@node Looking Up or Entering a String, Traversing a Hash Table, Creating and Freeing a Hash Table, Hash Tables -@subsection Looking up or entering a string -@findex bfd_hash_lookup -The function @code{bfd_hash_lookup} is used both to look up a -string in the hash table and to create a new entry. - -If the @var{create} argument is @code{FALSE}, @code{bfd_hash_lookup} -will look up a string. If the string is found, it will -returns a pointer to a @code{struct bfd_hash_entry}. If the -string is not found in the table @code{bfd_hash_lookup} will -return @code{NULL}. You should not modify any of the fields in -the returns @code{struct bfd_hash_entry}. - -If the @var{create} argument is @code{TRUE}, the string will be -entered into the hash table if it is not already there. -Either way a pointer to a @code{struct bfd_hash_entry} will be -returned, either to the existing structure or to a newly -created one. In this case, a @code{NULL} return means that an -error occurred. - -If the @var{create} argument is @code{TRUE}, and a new entry is -created, the @var{copy} argument is used to decide whether to -copy the string onto the hash table objalloc or not. If -@var{copy} is passed as @code{FALSE}, you must be careful not to -deallocate or modify the string as long as the hash table -exists. - -@node Traversing a Hash Table, Deriving a New Hash Table Type, Looking Up or Entering a String, Hash Tables -@subsection Traversing a hash table -@findex bfd_hash_traverse -The function @code{bfd_hash_traverse} may be used to traverse a -hash table, calling a function on each element. The traversal -is done in a random order. - -@code{bfd_hash_traverse} takes as arguments a function and a -generic @code{void *} pointer. The function is called with a -hash table entry (a @code{struct bfd_hash_entry *}) and the -generic pointer passed to @code{bfd_hash_traverse}. The function -must return a @code{boolean} value, which indicates whether to -continue traversing the hash table. If the function returns -@code{FALSE}, @code{bfd_hash_traverse} will stop the traversal and -return immediately. - -@node Deriving a New Hash Table Type, , Traversing a Hash Table, Hash Tables -@subsection Deriving a new hash table type -Many uses of hash tables want to store additional information -which each entry in the hash table. Some also find it -convenient to store additional information with the hash table -itself. This may be done using a derived hash table. - -Since C is not an object oriented language, creating a derived -hash table requires sticking together some boilerplate -routines with a few differences specific to the type of hash -table you want to create. - -An example of a derived hash table is the linker hash table. -The structures for this are defined in @code{bfdlink.h}. The -functions are in @code{linker.c}. - -You may also derive a hash table from an already derived hash -table. For example, the a.out linker backend code uses a hash -table derived from the linker hash table. - -@menu -* Define the Derived Structures:: -* Write the Derived Creation Routine:: -* Write Other Derived Routines:: -@end menu - -@node Define the Derived Structures, Write the Derived Creation Routine, Deriving a New Hash Table Type, Deriving a New Hash Table Type -@subsubsection Define the derived structures -You must define a structure for an entry in the hash table, -and a structure for the hash table itself. - -The first field in the structure for an entry in the hash -table must be of the type used for an entry in the hash table -you are deriving from. If you are deriving from a basic hash -table this is @code{struct bfd_hash_entry}, which is defined in -@code{bfd.h}. The first field in the structure for the hash -table itself must be of the type of the hash table you are -deriving from itself. If you are deriving from a basic hash -table, this is @code{struct bfd_hash_table}. - -For example, the linker hash table defines @code{struct -bfd_link_hash_entry} (in @code{bfdlink.h}). The first field, -@code{root}, is of type @code{struct bfd_hash_entry}. Similarly, -the first field in @code{struct bfd_link_hash_table}, @code{table}, -is of type @code{struct bfd_hash_table}. - -@node Write the Derived Creation Routine, Write Other Derived Routines, Define the Derived Structures, Deriving a New Hash Table Type -@subsubsection Write the derived creation routine -You must write a routine which will create and initialize an -entry in the hash table. This routine is passed as the -function argument to @code{bfd_hash_table_init}. - -In order to permit other hash tables to be derived from the -hash table you are creating, this routine must be written in a -standard way. - -The first argument to the creation routine is a pointer to a -hash table entry. This may be @code{NULL}, in which case the -routine should allocate the right amount of space. Otherwise -the space has already been allocated by a hash table type -derived from this one. - -After allocating space, the creation routine must call the -creation routine of the hash table type it is derived from, -passing in a pointer to the space it just allocated. This -will initialize any fields used by the base hash table. - -Finally the creation routine must initialize any local fields -for the new hash table type. - -Here is a boilerplate example of a creation routine. -@var{function_name} is the name of the routine. -@var{entry_type} is the type of an entry in the hash table you -are creating. @var{base_newfunc} is the name of the creation -routine of the hash table type your hash table is derived -from. - - -@example -struct bfd_hash_entry * -@var{function_name} (struct bfd_hash_entry *entry, - struct bfd_hash_table *table, - const char *string) -@{ - struct @var{entry_type} *ret = (@var{entry_type} *) entry; - - /* Allocate the structure if it has not already been allocated by a - derived class. */ - if (ret == NULL) - @{ - ret = bfd_hash_allocate (table, sizeof (* ret)); - if (ret == NULL) - return NULL; - @} - - /* Call the allocation method of the base class. */ - ret = ((@var{entry_type} *) - @var{base_newfunc} ((struct bfd_hash_entry *) ret, table, string)); - - /* Initialize the local fields here. */ - - return (struct bfd_hash_entry *) ret; -@} -@end example -@strong{Description}@* -The creation routine for the linker hash table, which is in -@code{linker.c}, looks just like this example. -@var{function_name} is @code{_bfd_link_hash_newfunc}. -@var{entry_type} is @code{struct bfd_link_hash_entry}. -@var{base_newfunc} is @code{bfd_hash_newfunc}, the creation -routine for a basic hash table. - -@code{_bfd_link_hash_newfunc} also initializes the local fields -in a linker hash table entry: @code{type}, @code{written} and -@code{next}. - -@node Write Other Derived Routines, , Write the Derived Creation Routine, Deriving a New Hash Table Type -@subsubsection Write other derived routines -You will want to write other routines for your new hash table, -as well. - -You will want an initialization routine which calls the -initialization routine of the hash table you are deriving from -and initializes any other local fields. For the linker hash -table, this is @code{_bfd_link_hash_table_init} in @code{linker.c}. - -You will want a lookup routine which calls the lookup routine -of the hash table you are deriving from and casts the result. -The linker hash table uses @code{bfd_link_hash_lookup} in -@code{linker.c} (this actually takes an additional argument which -it uses to decide how to return the looked up value). - -You may want a traversal routine. This should just call the -traversal routine of the hash table you are deriving from with -appropriate casts. The linker hash table uses -@code{bfd_link_hash_traverse} in @code{linker.c}. - -These routines may simply be defined as macros. For example, -the a.out backend linker hash table, which is derived from the -linker hash table, uses macros for the lookup and traversal -routines. These are @code{aout_link_hash_lookup} and -@code{aout_link_hash_traverse} in aoutx.h. - diff -Nur binutils-2.24.orig/bfd/doc/init.texi binutils-2.24/bfd/doc/init.texi --- binutils-2.24.orig/bfd/doc/init.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/init.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,16 +0,0 @@ -@section Initialization - - -@subsection Initialization functions -These are the functions that handle initializing a BFD. - -@findex bfd_init -@subsubsection @code{bfd_init} -@strong{Synopsis} -@example -void bfd_init (void); -@end example -@strong{Description}@* -This routine must be called before any other BFD function to -initialize magical internal data structures. - diff -Nur binutils-2.24.orig/bfd/doc/libbfd.texi binutils-2.24/bfd/doc/libbfd.texi --- binutils-2.24.orig/bfd/doc/libbfd.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/libbfd.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,179 +0,0 @@ -@section Implementation details - - -@subsection Internal functions - - -@strong{Description}@* -These routines are used within BFD. -They are not intended for export, but are documented here for -completeness. - -@findex bfd_write_bigendian_4byte_int -@subsubsection @code{bfd_write_bigendian_4byte_int} -@strong{Synopsis} -@example -bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); -@end example -@strong{Description}@* -Write a 4 byte integer @var{i} to the output BFD @var{abfd}, in big -endian order regardless of what else is going on. This is useful in -archives. - -@findex bfd_put_size -@subsubsection @code{bfd_put_size} -@findex bfd_get_size -@subsubsection @code{bfd_get_size} -@strong{Description}@* -These macros as used for reading and writing raw data in -sections; each access (except for bytes) is vectored through -the target format of the BFD and mangled accordingly. The -mangling performs any necessary endian translations and -removes alignment restrictions. Note that types accepted and -returned by these macros are identical so they can be swapped -around in macros---for example, @file{libaout.h} defines @code{GET_WORD} -to either @code{bfd_get_32} or @code{bfd_get_64}. - -In the put routines, @var{val} must be a @code{bfd_vma}. If we are on a -system without prototypes, the caller is responsible for making -sure that is true, with a cast if necessary. We don't cast -them in the macro definitions because that would prevent @code{lint} -or @code{gcc -Wall} from detecting sins such as passing a pointer. -To detect calling these with less than a @code{bfd_vma}, use -@code{gcc -Wconversion} on a host with 64 bit @code{bfd_vma}'s. -@example - -/* Byte swapping macros for user section data. */ - -#define bfd_put_8(abfd, val, ptr) \ - ((void) (*((unsigned char *) (ptr)) = (val) & 0xff)) -#define bfd_put_signed_8 \ - bfd_put_8 -#define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) -#define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) - -#define bfd_put_16(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) -#define bfd_put_signed_16 \ - bfd_put_16 -#define bfd_get_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx16, (ptr)) -#define bfd_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) - -#define bfd_put_32(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) -#define bfd_put_signed_32 \ - bfd_put_32 -#define bfd_get_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx32, (ptr)) -#define bfd_get_signed_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) - -#define bfd_put_64(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) -#define bfd_put_signed_64 \ - bfd_put_64 -#define bfd_get_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx64, (ptr)) -#define bfd_get_signed_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) - -#define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ - : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ - : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ - : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ - : (abort (), (bfd_vma) - 1)) - -#define bfd_put(bits, abfd, val, ptr) \ - ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ - : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ - : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ - : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ - : (abort (), (void) 0)) - -@end example - -@findex bfd_h_put_size -@subsubsection @code{bfd_h_put_size} -@strong{Description}@* -These macros have the same function as their @code{bfd_get_x} -brethren, except that they are used for removing information -for the header records of object files. Believe it or not, -some object files keep their header records in big endian -order and their data in little endian order. -@example - -/* Byte swapping macros for file header data. */ - -#define bfd_h_put_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) -#define bfd_h_put_signed_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) -#define bfd_h_get_8(abfd, ptr) \ - bfd_get_8 (abfd, ptr) -#define bfd_h_get_signed_8(abfd, ptr) \ - bfd_get_signed_8 (abfd, ptr) - -#define bfd_h_put_16(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) -#define bfd_h_put_signed_16 \ - bfd_h_put_16 -#define bfd_h_get_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx16, (ptr)) -#define bfd_h_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) - -#define bfd_h_put_32(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) -#define bfd_h_put_signed_32 \ - bfd_h_put_32 -#define bfd_h_get_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx32, (ptr)) -#define bfd_h_get_signed_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) - -#define bfd_h_put_64(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) -#define bfd_h_put_signed_64 \ - bfd_h_put_64 -#define bfd_h_get_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx64, (ptr)) -#define bfd_h_get_signed_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) - -/* Aliases for the above, which should eventually go away. */ - -#define H_PUT_64 bfd_h_put_64 -#define H_PUT_32 bfd_h_put_32 -#define H_PUT_16 bfd_h_put_16 -#define H_PUT_8 bfd_h_put_8 -#define H_PUT_S64 bfd_h_put_signed_64 -#define H_PUT_S32 bfd_h_put_signed_32 -#define H_PUT_S16 bfd_h_put_signed_16 -#define H_PUT_S8 bfd_h_put_signed_8 -#define H_GET_64 bfd_h_get_64 -#define H_GET_32 bfd_h_get_32 -#define H_GET_16 bfd_h_get_16 -#define H_GET_8 bfd_h_get_8 -#define H_GET_S64 bfd_h_get_signed_64 -#define H_GET_S32 bfd_h_get_signed_32 -#define H_GET_S16 bfd_h_get_signed_16 -#define H_GET_S8 bfd_h_get_signed_8 - - -@end example - -@findex bfd_log2 -@subsubsection @code{bfd_log2} -@strong{Synopsis} -@example -unsigned int bfd_log2 (bfd_vma x); -@end example -@strong{Description}@* -Return the log base 2 of the value supplied, rounded up. E.g., an -@var{x} of 1025 returns 11. A @var{x} of 0 returns 0. - diff -Nur binutils-2.24.orig/bfd/doc/linker.texi binutils-2.24/bfd/doc/linker.texi --- binutils-2.24.orig/bfd/doc/linker.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/linker.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,432 +0,0 @@ -@section Linker Functions -@cindex Linker -The linker uses three special entry points in the BFD target -vector. It is not necessary to write special routines for -these entry points when creating a new BFD back end, since -generic versions are provided. However, writing them can -speed up linking and make it use significantly less runtime -memory. - -The first routine creates a hash table used by the other -routines. The second routine adds the symbols from an object -file to the hash table. The third routine takes all the -object files and links them together to create the output -file. These routines are designed so that the linker proper -does not need to know anything about the symbols in the object -files that it is linking. The linker merely arranges the -sections as directed by the linker script and lets BFD handle -the details of symbols and relocs. - -The second routine and third routines are passed a pointer to -a @code{struct bfd_link_info} structure (defined in -@code{bfdlink.h}) which holds information relevant to the link, -including the linker hash table (which was created by the -first routine) and a set of callback functions to the linker -proper. - -The generic linker routines are in @code{linker.c}, and use the -header file @code{genlink.h}. As of this writing, the only back -ends which have implemented versions of these routines are -a.out (in @code{aoutx.h}) and ECOFF (in @code{ecoff.c}). The a.out -routines are used as examples throughout this section. - -@menu -* Creating a Linker Hash Table:: -* Adding Symbols to the Hash Table:: -* Performing the Final Link:: -@end menu - -@node Creating a Linker Hash Table, Adding Symbols to the Hash Table, Linker Functions, Linker Functions -@subsection Creating a linker hash table -@cindex _bfd_link_hash_table_create in target vector -@cindex target vector (_bfd_link_hash_table_create) -The linker routines must create a hash table, which must be -derived from @code{struct bfd_link_hash_table} described in -@code{bfdlink.c}. @xref{Hash Tables}, for information on how to -create a derived hash table. This entry point is called using -the target vector of the linker output file. - -The @code{_bfd_link_hash_table_create} entry point must allocate -and initialize an instance of the desired hash table. If the -back end does not require any additional information to be -stored with the entries in the hash table, the entry point may -simply create a @code{struct bfd_link_hash_table}. Most likely, -however, some additional information will be needed. - -For example, with each entry in the hash table the a.out -linker keeps the index the symbol has in the final output file -(this index number is used so that when doing a relocatable -link the symbol index used in the output file can be quickly -filled in when copying over a reloc). The a.out linker code -defines the required structures and functions for a hash table -derived from @code{struct bfd_link_hash_table}. The a.out linker -hash table is created by the function -@code{NAME(aout,link_hash_table_create)}; it simply allocates -space for the hash table, initializes it, and returns a -pointer to it. - -When writing the linker routines for a new back end, you will -generally not know exactly which fields will be required until -you have finished. You should simply create a new hash table -which defines no additional fields, and then simply add fields -as they become necessary. - -@node Adding Symbols to the Hash Table, Performing the Final Link, Creating a Linker Hash Table, Linker Functions -@subsection Adding symbols to the hash table -@cindex _bfd_link_add_symbols in target vector -@cindex target vector (_bfd_link_add_symbols) -The linker proper will call the @code{_bfd_link_add_symbols} -entry point for each object file or archive which is to be -linked (typically these are the files named on the command -line, but some may also come from the linker script). The -entry point is responsible for examining the file. For an -object file, BFD must add any relevant symbol information to -the hash table. For an archive, BFD must determine which -elements of the archive should be used and adding them to the -link. - -The a.out version of this entry point is -@code{NAME(aout,link_add_symbols)}. - -@menu -* Differing file formats:: -* Adding symbols from an object file:: -* Adding symbols from an archive:: -@end menu - -@node Differing file formats, Adding symbols from an object file, Adding Symbols to the Hash Table, Adding Symbols to the Hash Table -@subsubsection Differing file formats -Normally all the files involved in a link will be of the same -format, but it is also possible to link together different -format object files, and the back end must support that. The -@code{_bfd_link_add_symbols} entry point is called via the target -vector of the file to be added. This has an important -consequence: the function may not assume that the hash table -is the type created by the corresponding -@code{_bfd_link_hash_table_create} vector. All the -@code{_bfd_link_add_symbols} function can assume about the hash -table is that it is derived from @code{struct -bfd_link_hash_table}. - -Sometimes the @code{_bfd_link_add_symbols} function must store -some information in the hash table entry to be used by the -@code{_bfd_final_link} function. In such a case the output bfd -xvec must be checked to make sure that the hash table was -created by an object file of the same format. - -The @code{_bfd_final_link} routine must be prepared to handle a -hash entry without any extra information added by the -@code{_bfd_link_add_symbols} function. A hash entry without -extra information will also occur when the linker script -directs the linker to create a symbol. Note that, regardless -of how a hash table entry is added, all the fields will be -initialized to some sort of null value by the hash table entry -initialization function. - -See @code{ecoff_link_add_externals} for an example of how to -check the output bfd before saving information (in this -case, the ECOFF external symbol debugging information) in a -hash table entry. - -@node Adding symbols from an object file, Adding symbols from an archive, Differing file formats, Adding Symbols to the Hash Table -@subsubsection Adding symbols from an object file -When the @code{_bfd_link_add_symbols} routine is passed an object -file, it must add all externally visible symbols in that -object file to the hash table. The actual work of adding the -symbol to the hash table is normally handled by the function -@code{_bfd_generic_link_add_one_symbol}. The -@code{_bfd_link_add_symbols} routine is responsible for reading -all the symbols from the object file and passing the correct -information to @code{_bfd_generic_link_add_one_symbol}. - -The @code{_bfd_link_add_symbols} routine should not use -@code{bfd_canonicalize_symtab} to read the symbols. The point of -providing this routine is to avoid the overhead of converting -the symbols into generic @code{asymbol} structures. - -@findex _bfd_generic_link_add_one_symbol -@code{_bfd_generic_link_add_one_symbol} handles the details of -combining common symbols, warning about multiple definitions, -and so forth. It takes arguments which describe the symbol to -add, notably symbol flags, a section, and an offset. The -symbol flags include such things as @code{BSF_WEAK} or -@code{BSF_INDIRECT}. The section is a section in the object -file, or something like @code{bfd_und_section_ptr} for an undefined -symbol or @code{bfd_com_section_ptr} for a common symbol. - -If the @code{_bfd_final_link} routine is also going to need to -read the symbol information, the @code{_bfd_link_add_symbols} -routine should save it somewhere attached to the object file -BFD. However, the information should only be saved if the -@code{keep_memory} field of the @code{info} argument is TRUE, so -that the @code{-no-keep-memory} linker switch is effective. - -The a.out function which adds symbols from an object file is -@code{aout_link_add_object_symbols}, and most of the interesting -work is in @code{aout_link_add_symbols}. The latter saves -pointers to the hash tables entries created by -@code{_bfd_generic_link_add_one_symbol} indexed by symbol number, -so that the @code{_bfd_final_link} routine does not have to call -the hash table lookup routine to locate the entry. - -@node Adding symbols from an archive, , Adding symbols from an object file, Adding Symbols to the Hash Table -@subsubsection Adding symbols from an archive -When the @code{_bfd_link_add_symbols} routine is passed an -archive, it must look through the symbols defined by the -archive and decide which elements of the archive should be -included in the link. For each such element it must call the -@code{add_archive_element} linker callback, and it must add the -symbols from the object file to the linker hash table. (The -callback may in fact indicate that a replacement BFD should be -used, in which case the symbols from that BFD should be added -to the linker hash table instead.) - -@findex _bfd_generic_link_add_archive_symbols -In most cases the work of looking through the symbols in the -archive should be done by the -@code{_bfd_generic_link_add_archive_symbols} function. This -function builds a hash table from the archive symbol table and -looks through the list of undefined symbols to see which -elements should be included. -@code{_bfd_generic_link_add_archive_symbols} is passed a function -to call to make the final decision about adding an archive -element to the link and to do the actual work of adding the -symbols to the linker hash table. - -The function passed to -@code{_bfd_generic_link_add_archive_symbols} must read the -symbols of the archive element and decide whether the archive -element should be included in the link. If the element is to -be included, the @code{add_archive_element} linker callback -routine must be called with the element as an argument, and -the element's symbols must be added to the linker hash table -just as though the element had itself been passed to the -@code{_bfd_link_add_symbols} function. The @code{add_archive_element} -callback has the option to indicate that it would like to -replace the element archive with a substitute BFD, in which -case it is the symbols of that substitute BFD that must be -added to the linker hash table instead. - -When the a.out @code{_bfd_link_add_symbols} function receives an -archive, it calls @code{_bfd_generic_link_add_archive_symbols} -passing @code{aout_link_check_archive_element} as the function -argument. @code{aout_link_check_archive_element} calls -@code{aout_link_check_ar_symbols}. If the latter decides to add -the element (an element is only added if it provides a real, -non-common, definition for a previously undefined or common -symbol) it calls the @code{add_archive_element} callback and then -@code{aout_link_check_archive_element} calls -@code{aout_link_add_symbols} to actually add the symbols to the -linker hash table - possibly those of a substitute BFD, if the -@code{add_archive_element} callback avails itself of that option. - -The ECOFF back end is unusual in that it does not normally -call @code{_bfd_generic_link_add_archive_symbols}, because ECOFF -archives already contain a hash table of symbols. The ECOFF -back end searches the archive itself to avoid the overhead of -creating a new hash table. - -@node Performing the Final Link, , Adding Symbols to the Hash Table, Linker Functions -@subsection Performing the final link -@cindex _bfd_link_final_link in target vector -@cindex target vector (_bfd_final_link) -When all the input files have been processed, the linker calls -the @code{_bfd_final_link} entry point of the output BFD. This -routine is responsible for producing the final output file, -which has several aspects. It must relocate the contents of -the input sections and copy the data into the output sections. -It must build an output symbol table including any local -symbols from the input files and the global symbols from the -hash table. When producing relocatable output, it must -modify the input relocs and write them into the output file. -There may also be object format dependent work to be done. - -The linker will also call the @code{write_object_contents} entry -point when the BFD is closed. The two entry points must work -together in order to produce the correct output file. - -The details of how this works are inevitably dependent upon -the specific object file format. The a.out -@code{_bfd_final_link} routine is @code{NAME(aout,final_link)}. - -@menu -* Information provided by the linker:: -* Relocating the section contents:: -* Writing the symbol table:: -@end menu - -@node Information provided by the linker, Relocating the section contents, Performing the Final Link, Performing the Final Link -@subsubsection Information provided by the linker -Before the linker calls the @code{_bfd_final_link} entry point, -it sets up some data structures for the function to use. - -The @code{input_bfds} field of the @code{bfd_link_info} structure -will point to a list of all the input files included in the -link. These files are linked through the @code{link_next} field -of the @code{bfd} structure. - -Each section in the output file will have a list of -@code{link_order} structures attached to the @code{map_head.link_order} -field (the @code{link_order} structure is defined in -@code{bfdlink.h}). These structures describe how to create the -contents of the output section in terms of the contents of -various input sections, fill constants, and, eventually, other -types of information. They also describe relocs that must be -created by the BFD backend, but do not correspond to any input -file; this is used to support -Ur, which builds constructors -while generating a relocatable object file. - -@node Relocating the section contents, Writing the symbol table, Information provided by the linker, Performing the Final Link -@subsubsection Relocating the section contents -The @code{_bfd_final_link} function should look through the -@code{link_order} structures attached to each section of the -output file. Each @code{link_order} structure should either be -handled specially, or it should be passed to the function -@code{_bfd_default_link_order} which will do the right thing -(@code{_bfd_default_link_order} is defined in @code{linker.c}). - -For efficiency, a @code{link_order} of type -@code{bfd_indirect_link_order} whose associated section belongs -to a BFD of the same format as the output BFD must be handled -specially. This type of @code{link_order} describes part of an -output section in terms of a section belonging to one of the -input files. The @code{_bfd_final_link} function should read the -contents of the section and any associated relocs, apply the -relocs to the section contents, and write out the modified -section contents. If performing a relocatable link, the -relocs themselves must also be modified and written out. - -@findex _bfd_relocate_contents -@findex _bfd_final_link_relocate -The functions @code{_bfd_relocate_contents} and -@code{_bfd_final_link_relocate} provide some general support for -performing the actual relocations, notably overflow checking. -Their arguments include information about the symbol the -relocation is against and a @code{reloc_howto_type} argument -which describes the relocation to perform. These functions -are defined in @code{reloc.c}. - -The a.out function which handles reading, relocating, and -writing section contents is @code{aout_link_input_section}. The -actual relocation is done in @code{aout_link_input_section_std} -and @code{aout_link_input_section_ext}. - -@node Writing the symbol table, , Relocating the section contents, Performing the Final Link -@subsubsection Writing the symbol table -The @code{_bfd_final_link} function must gather all the symbols -in the input files and write them out. It must also write out -all the symbols in the global hash table. This must be -controlled by the @code{strip} and @code{discard} fields of the -@code{bfd_link_info} structure. - -The local symbols of the input files will not have been -entered into the linker hash table. The @code{_bfd_final_link} -routine must consider each input file and include the symbols -in the output file. It may be convenient to do this when -looking through the @code{link_order} structures, or it may be -done by stepping through the @code{input_bfds} list. - -The @code{_bfd_final_link} routine must also traverse the global -hash table to gather all the externally visible symbols. It -is possible that most of the externally visible symbols may be -written out when considering the symbols of each input file, -but it is still necessary to traverse the hash table since the -linker script may have defined some symbols that are not in -any of the input files. - -The @code{strip} field of the @code{bfd_link_info} structure -controls which symbols are written out. The possible values -are listed in @code{bfdlink.h}. If the value is @code{strip_some}, -then the @code{keep_hash} field of the @code{bfd_link_info} -structure is a hash table of symbols to keep; each symbol -should be looked up in this hash table, and only symbols which -are present should be included in the output file. - -If the @code{strip} field of the @code{bfd_link_info} structure -permits local symbols to be written out, the @code{discard} field -is used to further controls which local symbols are included -in the output file. If the value is @code{discard_l}, then all -local symbols which begin with a certain prefix are discarded; -this is controlled by the @code{bfd_is_local_label_name} entry point. - -The a.out backend handles symbols by calling -@code{aout_link_write_symbols} on each input BFD and then -traversing the global hash table with the function -@code{aout_link_write_other_symbol}. It builds a string table -while writing out the symbols, which is written to the output -file at the end of @code{NAME(aout,final_link)}. - -@findex bfd_link_split_section -@subsubsection @code{bfd_link_split_section} -@strong{Synopsis} -@example -bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); -@end example -@strong{Description}@* -Return nonzero if @var{sec} should be split during a -reloceatable or final link. -@example -#define bfd_link_split_section(abfd, sec) \ - BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) - -@end example - -@findex bfd_section_already_linked -@subsubsection @code{bfd_section_already_linked} -@strong{Synopsis} -@example -bfd_boolean bfd_section_already_linked (bfd *abfd, - asection *sec, - struct bfd_link_info *info); -@end example -@strong{Description}@* -Check if @var{data} has been already linked during a reloceatable -or final link. Return TRUE if it has. -@example -#define bfd_section_already_linked(abfd, sec, info) \ - BFD_SEND (abfd, _section_already_linked, (abfd, sec, info)) - -@end example - -@findex bfd_generic_define_common_symbol -@subsubsection @code{bfd_generic_define_common_symbol} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_define_common_symbol - (bfd *output_bfd, struct bfd_link_info *info, - struct bfd_link_hash_entry *h); -@end example -@strong{Description}@* -Convert common symbol @var{h} into a defined symbol. -Return TRUE on success and FALSE on failure. -@example -#define bfd_define_common_symbol(output_bfd, info, h) \ - BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) - -@end example - -@findex bfd_find_version_for_sym -@subsubsection @code{bfd_find_version_for_sym} -@strong{Synopsis} -@example -struct bfd_elf_version_tree * bfd_find_version_for_sym - (struct bfd_elf_version_tree *verdefs, - const char *sym_name, bfd_boolean *hide); -@end example -@strong{Description}@* -Search an elf version script tree for symbol versioning -info and export / don't-export status for a given symbol. -Return non-NULL on success and NULL on failure; also sets -the output @samp{hide} boolean parameter. - -@findex bfd_hide_sym_by_version -@subsubsection @code{bfd_hide_sym_by_version} -@strong{Synopsis} -@example -bfd_boolean bfd_hide_sym_by_version - (struct bfd_elf_version_tree *verdefs, const char *sym_name); -@end example -@strong{Description}@* -Search an elf version script tree for symbol versioning -info for a given symbol. Return TRUE if the symbol is hidden. - diff -Nur binutils-2.24.orig/bfd/doc/mmo.texi binutils-2.24/bfd/doc/mmo.texi --- binutils-2.24.orig/bfd/doc/mmo.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/mmo.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,365 +0,0 @@ -@section mmo backend -The mmo object format is used exclusively together with Professor -Donald E.@: Knuth's educational 64-bit processor MMIX. The simulator -@command{mmix} which is available at -@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz} -understands this format. That package also includes a combined -assembler and linker called @command{mmixal}. The mmo format has -no advantages feature-wise compared to e.g. ELF. It is a simple -non-relocatable object format with no support for archives or -debugging information, except for symbol value information and -line numbers (which is not yet implemented in BFD). See -@url{http://www-cs-faculty.stanford.edu/~knuth/mmix.html} for more -information about MMIX. The ELF format is used for intermediate -object files in the BFD implementation. - -@c We want to xref the symbol table node. A feature in "chew" -@c requires that "commands" do not contain spaces in the -@c arguments. Hence the hyphen in "Symbol-table". -@menu -* File layout:: -* Symbol-table:: -* mmo section mapping:: -@end menu - -@node File layout, Symbol-table, mmo, mmo -@subsection File layout -The mmo file contents is not partitioned into named sections as -with e.g.@: ELF. Memory areas is formed by specifying the -location of the data that follows. Only the memory area -@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} is executable, so -it is used for code (and constants) and the area -@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} is used for -writable data. @xref{mmo section mapping}. - -There is provision for specifying ``special data'' of 65536 -different types. We use type 80 (decimal), arbitrarily chosen the -same as the ELF @code{e_machine} number for MMIX, filling it with -section information normally found in ELF objects. @xref{mmo -section mapping}. - -Contents is entered as 32-bit words, xor:ed over previous -contents, always zero-initialized. A word that starts with the -byte @samp{0x98} forms a command called a @samp{lopcode}, where -the next byte distinguished between the thirteen lopcodes. The -two remaining bytes, called the @samp{Y} and @samp{Z} fields, or -the @samp{YZ} field (a 16-bit big-endian number), are used for -various purposes different for each lopcode. As documented in -@url{http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz}, -the lopcodes are: - -@table @code -@item lop_quote -0x98000001. The next word is contents, regardless of whether it -starts with 0x98 or not. - -@item lop_loc -0x9801YYZZ, where @samp{Z} is 1 or 2. This is a location -directive, setting the location for the next data to the next -32-bit word (for @math{Z = 1}) or 64-bit word (for @math{Z = 2}), -plus @math{Y * 2^56}. Normally @samp{Y} is 0 for the text segment -and 2 for the data segment. - -@item lop_skip -0x9802YYZZ. Increase the current location by @samp{YZ} bytes. - -@item lop_fixo -0x9803YYZZ, where @samp{Z} is 1 or 2. Store the current location -as 64 bits into the location pointed to by the next 32-bit -(@math{Z = 1}) or 64-bit (@math{Z = 2}) word, plus @math{Y * -2^56}. - -@item lop_fixr -0x9804YYZZ. @samp{YZ} is stored into the current location plus -@math{2 - 4 * YZ}. - -@item lop_fixrx -0x980500ZZ. @samp{Z} is 16 or 24. A value @samp{L} derived from -the following 32-bit word are used in a manner similar to -@samp{YZ} in lop_fixr: it is xor:ed into the current location -minus @math{4 * L}. The first byte of the word is 0 or 1. If it -is 1, then @math{L = (@var{lowest 24 bits of word}) - 2^Z}, if 0, -then @math{L = (@var{lowest 24 bits of word})}. - -@item lop_file -0x9806YYZZ. @samp{Y} is the file number, @samp{Z} is count of -32-bit words. Set the file number to @samp{Y} and the line -counter to 0. The next @math{Z * 4} bytes contain the file name, -padded with zeros if the count is not a multiple of four. The -same @samp{Y} may occur multiple times, but @samp{Z} must be 0 for -all but the first occurrence. - -@item lop_line -0x9807YYZZ. @samp{YZ} is the line number. Together with -lop_file, it forms the source location for the next 32-bit word. -Note that for each non-lopcode 32-bit word, line numbers are -assumed incremented by one. - -@item lop_spec -0x9808YYZZ. @samp{YZ} is the type number. Data until the next -lopcode other than lop_quote forms special data of type @samp{YZ}. -@xref{mmo section mapping}. - -Other types than 80, (or type 80 with a content that does not -parse) is stored in sections named @code{.MMIX.spec_data.@var{n}} -where @var{n} is the @samp{YZ}-type. The flags for such a -sections say not to allocate or load the data. The vma is 0. -Contents of multiple occurrences of special data @var{n} is -concatenated to the data of the previous lop_spec @var{n}s. The -location in data or code at which the lop_spec occurred is lost. - -@item lop_pre -0x980901ZZ. The first lopcode in a file. The @samp{Z} field forms the -length of header information in 32-bit words, where the first word -tells the time in seconds since @samp{00:00:00 GMT Jan 1 1970}. - -@item lop_post -0x980a00ZZ. @math{Z > 32}. This lopcode follows after all -content-generating lopcodes in a program. The @samp{Z} field -denotes the value of @samp{rG} at the beginning of the program. -The following @math{256 - Z} big-endian 64-bit words are loaded -into global registers @samp{$G} @dots{} @samp{$255}. - -@item lop_stab -0x980b0000. The next-to-last lopcode in a program. Must follow -immediately after the lop_post lopcode and its data. After this -lopcode follows all symbols in a compressed format -(@pxref{Symbol-table}). - -@item lop_end -0x980cYYZZ. The last lopcode in a program. It must follow the -lop_stab lopcode and its data. The @samp{YZ} field contains the -number of 32-bit words of symbol table information after the -preceding lop_stab lopcode. -@end table - -Note that the lopcode "fixups"; @code{lop_fixr}, @code{lop_fixrx} and -@code{lop_fixo} are not generated by BFD, but are handled. They are -generated by @code{mmixal}. - -This trivial one-label, one-instruction file: - -@example - :Main TRAP 1,2,3 -@end example - -can be represented this way in mmo: - -@example - 0x98090101 - lop_pre, one 32-bit word with timestamp. - - 0x98010002 - lop_loc, text segment, using a 64-bit address. - Note that mmixal does not emit this for the file above. - 0x00000000 - Address, high 32 bits. - 0x00000000 - Address, low 32 bits. - 0x98060002 - lop_file, 2 32-bit words for file-name. - 0x74657374 - "test" - 0x2e730000 - ".s\0\0" - 0x98070001 - lop_line, line 1. - 0x00010203 - TRAP 1,2,3 - 0x980a00ff - lop_post, setting $255 to 0. - 0x00000000 - 0x00000000 - 0x980b0000 - lop_stab for ":Main" = 0, serial 1. - 0x203a4040 @xref{Symbol-table}. - 0x10404020 - 0x4d206120 - 0x69016e00 - 0x81000000 - 0x980c0005 - lop_end; symbol table contained five 32-bit words. -@end example -@node Symbol-table, mmo section mapping, File layout, mmo -@subsection Symbol table format -From mmixal.w (or really, the generated mmixal.tex) in -@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}): -``Symbols are stored and retrieved by means of a @samp{ternary -search trie}, following ideas of Bentley and Sedgewick. (See -ACM--SIAM Symp.@: on Discrete Algorithms @samp{8} (1997), 360--369; -R.@:Sedgewick, @samp{Algorithms in C} (Reading, Mass.@: -Addison--Wesley, 1998), @samp{15.4}.) Each trie node stores a -character, and there are branches to subtries for the cases where -a given character is less than, equal to, or greater than the -character in the trie. There also is a pointer to a symbol table -entry if a symbol ends at the current node.'' - -So it's a tree encoded as a stream of bytes. The stream of bytes -acts on a single virtual global symbol, adding and removing -characters and signalling complete symbol points. Here, we read -the stream and create symbols at the completion points. - -First, there's a control byte @code{m}. If any of the listed bits -in @code{m} is nonzero, we execute what stands at the right, in -the listed order: - -@example - (MMO3_LEFT) - 0x40 - Traverse left trie. - (Read a new command byte and recurse.) - - (MMO3_SYMBITS) - 0x2f - Read the next byte as a character and store it in the - current character position; increment character position. - Test the bits of @code{m}: - - (MMO3_WCHAR) - 0x80 - The character is 16-bit (so read another byte, - merge into current character. - - (MMO3_TYPEBITS) - 0xf - We have a complete symbol; parse the type, value - and serial number and do what should be done - with a symbol. The type and length information - is in j = (m & 0xf). - - (MMO3_REGQUAL_BITS) - j == 0xf: A register variable. The following - byte tells which register. - j <= 8: An absolute symbol. Read j bytes as the - big-endian number the symbol equals. - A j = 2 with two zero bytes denotes an - unknown symbol. - j > 8: As with j <= 8, but add (0x20 << 56) - to the value in the following j - 8 - bytes. - - Then comes the serial number, as a variant of - uleb128, but better named ubeb128: - Read bytes and shift the previous value left 7 - (multiply by 128). Add in the new byte, repeat - until a byte has bit 7 set. The serial number - is the computed value minus 128. - - (MMO3_MIDDLE) - 0x20 - Traverse middle trie. (Read a new command byte - and recurse.) Decrement character position. - - (MMO3_RIGHT) - 0x10 - Traverse right trie. (Read a new command byte and - recurse.) -@end example - -Let's look again at the @code{lop_stab} for the trivial file -(@pxref{File layout}). - -@example - 0x980b0000 - lop_stab for ":Main" = 0, serial 1. - 0x203a4040 - 0x10404020 - 0x4d206120 - 0x69016e00 - 0x81000000 -@end example - -This forms the trivial trie (note that the path between ``:'' and -``M'' is redundant): - -@example - 203a ":" - 40 / - 40 / - 10 \ - 40 / - 40 / - 204d "M" - 2061 "a" - 2069 "i" - 016e "n" is the last character in a full symbol, and - with a value represented in one byte. - 00 The value is 0. - 81 The serial number is 1. -@end example - -@node mmo section mapping, , Symbol-table, mmo -@subsection mmo section mapping -The implementation in BFD uses special data type 80 (decimal) to -encapsulate and describe named sections, containing e.g.@: debug -information. If needed, any datum in the encapsulation will be -quoted using lop_quote. First comes a 32-bit word holding the -number of 32-bit words containing the zero-terminated zero-padded -segment name. After the name there's a 32-bit word holding flags -describing the section type. Then comes a 64-bit big-endian word -with the section length (in bytes), then another with the section -start address. Depending on the type of section, the contents -might follow, zero-padded to 32-bit boundary. For a loadable -section (such as data or code), the contents might follow at some -later point, not necessarily immediately, as a lop_loc with the -same start address as in the section description, followed by the -contents. This in effect forms a descriptor that must be emitted -before the actual contents. Sections described this way must not -overlap. - -For areas that don't have such descriptors, synthetic sections are -formed by BFD. Consecutive contents in the two memory areas -@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} and -@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} are entered in -sections named @code{.text} and @code{.data} respectively. If an area -is not otherwise described, but would together with a neighboring -lower area be less than @samp{0x40000000} bytes long, it is joined -with the lower area and the gap is zero-filled. For other cases, -a new section is formed, named @code{.MMIX.sec.@var{n}}. Here, -@var{n} is a number, a running count through the mmo file, -starting at 0. - -A loadable section specified as: - -@example - .section secname,"ax" - TETRA 1,2,3,4,-1,-2009 - BYTE 80 -@end example - -and linked to address @samp{0x4}, is represented by the sequence: - -@example - 0x98080050 - lop_spec 80 - 0x00000002 - two 32-bit words for the section name - 0x7365636e - "secn" - 0x616d6500 - "ame\0" - 0x00000033 - flags CODE, READONLY, LOAD, ALLOC - 0x00000000 - high 32 bits of section length - 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits - 0x00000000 - high 32 bits of section address - 0x00000004 - section address is 4 - 0x98010002 - 64 bits with address of following data - 0x00000000 - high 32 bits of address - 0x00000004 - low 32 bits: data starts at address 4 - 0x00000001 - 1 - 0x00000002 - 2 - 0x00000003 - 3 - 0x00000004 - 4 - 0xffffffff - -1 - 0xfffff827 - -2009 - 0x50000000 - 80 as a byte, padded with zeros. -@end example - -Note that the lop_spec wrapping does not include the section -contents. Compare this to a non-loaded section specified as: - -@example - .section thirdsec - TETRA 200001,100002 - BYTE 38,40 -@end example - -This, when linked to address @samp{0x200000000000001c}, is -represented by: - -@example - 0x98080050 - lop_spec 80 - 0x00000002 - two 32-bit words for the section name - 0x7365636e - "thir" - 0x616d6500 - "dsec" - 0x00000010 - flag READONLY - 0x00000000 - high 32 bits of section length - 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits - 0x20000000 - high 32 bits of address - 0x0000001c - low 32 bits of address 0x200000000000001c - 0x00030d41 - 200001 - 0x000186a2 - 100002 - 0x26280000 - 38, 40 as bytes, padded with zeros -@end example - -For the latter example, the section contents must not be -loaded in memory, and is therefore specified as part of the -special data. The address is usually unimportant but might -provide information for e.g.@: the DWARF 2 debugging format. diff -Nur binutils-2.24.orig/bfd/doc/opncls.texi binutils-2.24/bfd/doc/opncls.texi --- binutils-2.24.orig/bfd/doc/opncls.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/opncls.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,432 +0,0 @@ - -@example -/* Set to N to open the next N BFDs using an alternate id space. */ -extern unsigned int bfd_use_reserved_id; -@end example -@section Opening and closing BFDs - - -@subsection Functions for opening and closing - - -@findex bfd_fopen -@subsubsection @code{bfd_fopen} -@strong{Synopsis} -@example -bfd *bfd_fopen (const char *filename, const char *target, - const char *mode, int fd); -@end example -@strong{Description}@* -Open the file @var{filename} with the target @var{target}. -Return a pointer to the created BFD. If @var{fd} is not -1, -then @code{fdopen} is used to open the file; otherwise, @code{fopen} -is used. @var{mode} is passed directly to @code{fopen} or -@code{fdopen}. - -Calls @code{bfd_find_target}, so @var{target} is interpreted as by -that function. - -The new BFD is marked as cacheable iff @var{fd} is -1. - -If @code{NULL} is returned then an error has occured. Possible errors -are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or -@code{system_call} error. - -On error, @var{fd} is always closed. - -@findex bfd_openr -@subsubsection @code{bfd_openr} -@strong{Synopsis} -@example -bfd *bfd_openr (const char *filename, const char *target); -@end example -@strong{Description}@* -Open the file @var{filename} (using @code{fopen}) with the target -@var{target}. Return a pointer to the created BFD. - -Calls @code{bfd_find_target}, so @var{target} is interpreted as by -that function. - -If @code{NULL} is returned then an error has occured. Possible errors -are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or -@code{system_call} error. - -@findex bfd_fdopenr -@subsubsection @code{bfd_fdopenr} -@strong{Synopsis} -@example -bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -@end example -@strong{Description}@* -@code{bfd_fdopenr} is to @code{bfd_fopenr} much like @code{fdopen} is to -@code{fopen}. It opens a BFD on a file already described by the -@var{fd} supplied. - -When the file is later @code{bfd_close}d, the file descriptor will -be closed. If the caller desires that this file descriptor be -cached by BFD (opened as needed, closed as needed to free -descriptors for other opens), with the supplied @var{fd} used as -an initial file descriptor (but subject to closure at any time), -call bfd_set_cacheable(bfd, 1) on the returned BFD. The default -is to assume no caching; the file descriptor will remain open -until @code{bfd_close}, and will not be affected by BFD operations -on other files. - -Possible errors are @code{bfd_error_no_memory}, -@code{bfd_error_invalid_target} and @code{bfd_error_system_call}. - -On error, @var{fd} is closed. - -@findex bfd_openstreamr -@subsubsection @code{bfd_openstreamr} -@strong{Synopsis} -@example -bfd *bfd_openstreamr (const char *, const char *, void *); -@end example -@strong{Description}@* -Open a BFD for read access on an existing stdio stream. When -the BFD is passed to @code{bfd_close}, the stream will be closed. - -@findex bfd_openr_iovec -@subsubsection @code{bfd_openr_iovec} -@strong{Synopsis} -@example -bfd *bfd_openr_iovec (const char *filename, const char *target, - void *(*open_func) (struct bfd *nbfd, - void *open_closure), - void *open_closure, - file_ptr (*pread_func) (struct bfd *nbfd, - void *stream, - void *buf, - file_ptr nbytes, - file_ptr offset), - int (*close_func) (struct bfd *nbfd, - void *stream), - int (*stat_func) (struct bfd *abfd, - void *stream, - struct stat *sb)); -@end example -@strong{Description}@* -Create and return a BFD backed by a read-only @var{stream}. -The @var{stream} is created using @var{open_func}, accessed using -@var{pread_func} and destroyed using @var{close_func}. - -Calls @code{bfd_find_target}, so @var{target} is interpreted as by -that function. - -Calls @var{open_func} (which can call @code{bfd_zalloc} and -@code{bfd_get_filename}) to obtain the read-only stream backing -the BFD. @var{open_func} either succeeds returning the -non-@code{NULL} @var{stream}, or fails returning @code{NULL} -(setting @code{bfd_error}). - -Calls @var{pread_func} to request @var{nbytes} of data from -@var{stream} starting at @var{offset} (e.g., via a call to -@code{bfd_read}). @var{pread_func} either succeeds returning the -number of bytes read (which can be less than @var{nbytes} when -end-of-file), or fails returning -1 (setting @code{bfd_error}). - -Calls @var{close_func} when the BFD is later closed using -@code{bfd_close}. @var{close_func} either succeeds returning 0, or -fails returning -1 (setting @code{bfd_error}). - -Calls @var{stat_func} to fill in a stat structure for bfd_stat, -bfd_get_size, and bfd_get_mtime calls. @var{stat_func} returns 0 -on success, or returns -1 on failure (setting @code{bfd_error}). - -If @code{bfd_openr_iovec} returns @code{NULL} then an error has -occurred. Possible errors are @code{bfd_error_no_memory}, -@code{bfd_error_invalid_target} and @code{bfd_error_system_call}. - -@findex bfd_openw -@subsubsection @code{bfd_openw} -@strong{Synopsis} -@example -bfd *bfd_openw (const char *filename, const char *target); -@end example -@strong{Description}@* -Create a BFD, associated with file @var{filename}, using the -file format @var{target}, and return a pointer to it. - -Possible errors are @code{bfd_error_system_call}, @code{bfd_error_no_memory}, -@code{bfd_error_invalid_target}. - -@findex bfd_close -@subsubsection @code{bfd_close} -@strong{Synopsis} -@example -bfd_boolean bfd_close (bfd *abfd); -@end example -@strong{Description}@* -Close a BFD. If the BFD was open for writing, then pending -operations are completed and the file written out and closed. -If the created file is executable, then @code{chmod} is called -to mark it as such. - -All memory attached to the BFD is released. - -The file descriptor associated with the BFD is closed (even -if it was passed in to BFD by @code{bfd_fdopenr}). - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_close_all_done -@subsubsection @code{bfd_close_all_done} -@strong{Synopsis} -@example -bfd_boolean bfd_close_all_done (bfd *); -@end example -@strong{Description}@* -Close a BFD. Differs from @code{bfd_close} since it does not -complete any pending operations. This routine would be used -if the application had just used BFD for swapping and didn't -want to use any of the writing code. - -If the created file is executable, then @code{chmod} is called -to mark it as such. - -All memory attached to the BFD is released. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_create -@subsubsection @code{bfd_create} -@strong{Synopsis} -@example -bfd *bfd_create (const char *filename, bfd *templ); -@end example -@strong{Description}@* -Create a new BFD in the manner of @code{bfd_openw}, but without -opening a file. The new BFD takes the target from the target -used by @var{templ}. The format is always set to @code{bfd_object}. - -@findex bfd_make_writable -@subsubsection @code{bfd_make_writable} -@strong{Synopsis} -@example -bfd_boolean bfd_make_writable (bfd *abfd); -@end example -@strong{Description}@* -Takes a BFD as created by @code{bfd_create} and converts it -into one like as returned by @code{bfd_openw}. It does this -by converting the BFD to BFD_IN_MEMORY. It's assumed that -you will call @code{bfd_make_readable} on this bfd later. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_make_readable -@subsubsection @code{bfd_make_readable} -@strong{Synopsis} -@example -bfd_boolean bfd_make_readable (bfd *abfd); -@end example -@strong{Description}@* -Takes a BFD as created by @code{bfd_create} and -@code{bfd_make_writable} and converts it into one like as -returned by @code{bfd_openr}. It does this by writing the -contents out to the memory buffer, then reversing the -direction. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_alloc -@subsubsection @code{bfd_alloc} -@strong{Synopsis} -@example -void *bfd_alloc (bfd *abfd, bfd_size_type wanted); -@end example -@strong{Description}@* -Allocate a block of @var{wanted} bytes of memory attached to -@code{abfd} and return a pointer to it. - -@findex bfd_alloc2 -@subsubsection @code{bfd_alloc2} -@strong{Synopsis} -@example -void *bfd_alloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size); -@end example -@strong{Description}@* -Allocate a block of @var{nmemb} elements of @var{size} bytes each -of memory attached to @code{abfd} and return a pointer to it. - -@findex bfd_zalloc -@subsubsection @code{bfd_zalloc} -@strong{Synopsis} -@example -void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); -@end example -@strong{Description}@* -Allocate a block of @var{wanted} bytes of zeroed memory -attached to @code{abfd} and return a pointer to it. - -@findex bfd_zalloc2 -@subsubsection @code{bfd_zalloc2} -@strong{Synopsis} -@example -void *bfd_zalloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size); -@end example -@strong{Description}@* -Allocate a block of @var{nmemb} elements of @var{size} bytes each -of zeroed memory attached to @code{abfd} and return a pointer to it. - -@findex bfd_calc_gnu_debuglink_crc32 -@subsubsection @code{bfd_calc_gnu_debuglink_crc32} -@strong{Synopsis} -@example -unsigned long bfd_calc_gnu_debuglink_crc32 - (unsigned long crc, const unsigned char *buf, bfd_size_type len); -@end example -@strong{Description}@* -Computes a CRC value as used in the .gnu_debuglink section. -Advances the previously computed @var{crc} value by computing -and adding in the crc32 for @var{len} bytes of @var{buf}. - -@strong{Returns}@* -Return the updated CRC32 value. - -@findex bfd_get_debug_link_info -@subsubsection @code{bfd_get_debug_link_info} -@strong{Synopsis} -@example -char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); -@end example -@strong{Description}@* -fetch the filename and CRC32 value for any separate debuginfo -associated with @var{abfd}. Return NULL if no such info found, -otherwise return filename and update @var{crc32_out}. The -returned filename is allocated with @code{malloc}; freeing it -is the responsibility of the caller. - -@findex bfd_get_alt_debug_link_info -@subsubsection @code{bfd_get_alt_debug_link_info} -@strong{Synopsis} -@example -char *bfd_get_alt_debug_link_info (bfd *abfd, unsigned long *crc32_out); -@end example -@strong{Description}@* -Fetch the filename and BuildID value for any alternate debuginfo -associated with @var{abfd}. Return NULL if no such info found, -otherwise return filename and update @var{buildid_out}. The -returned filename is allocated with @code{malloc}; freeing it -is the responsibility of the caller. - -@findex separate_debug_file_exists -@subsubsection @code{separate_debug_file_exists} -@strong{Synopsis} -@example -bfd_boolean separate_debug_file_exists - (char *name, unsigned long crc32); -@end example -@strong{Description}@* -Checks to see if @var{name} is a file and if its contents -match @var{crc32}. - -@findex separate_alt_debug_file_exists -@subsubsection @code{separate_alt_debug_file_exists} -@strong{Synopsis} -@example -bfd_boolean separate_alt_debug_file_exists - (char *name, unsigned long crc32); -@end example -@strong{Description}@* -Checks to see if @var{name} is a file and if its BuildID -matches @var{buildid}. - -@findex find_separate_debug_file -@subsubsection @code{find_separate_debug_file} -@strong{Synopsis} -@example -char *find_separate_debug_file (bfd *abfd); -@end example -@strong{Description}@* -Searches @var{abfd} for a section called @var{section_name} which -is expected to contain a reference to a file containing separate -debugging information. The function scans various locations in -the filesystem, including the file tree rooted at -@var{debug_file_directory}, and returns the first matching -filename that it finds. If @var{check_crc} is TRUE then the -contents of the file must also match the CRC value contained in -@var{section_name}. Returns NULL if no valid file could be found. - -@findex bfd_follow_gnu_debuglink -@subsubsection @code{bfd_follow_gnu_debuglink} -@strong{Synopsis} -@example -char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); -@end example -@strong{Description}@* -Takes a BFD and searches it for a .gnu_debuglink section. If this -section is found, it examines the section for the name and checksum -of a '.debug' file containing auxiliary debugging information. It -then searches the filesystem for this .debug file in some standard -locations, including the directory tree rooted at @var{dir}, and if -found returns the full filename. - -If @var{dir} is NULL, it will search a default path configured into -libbfd at build time. [XXX this feature is not currently -implemented]. - -@strong{Returns}@* -@code{NULL} on any errors or failure to locate the .debug file, -otherwise a pointer to a heap-allocated string containing the -filename. The caller is responsible for freeing this string. - -@findex bfd_follow_gnu_debugaltlink -@subsubsection @code{bfd_follow_gnu_debugaltlink} -@strong{Synopsis} -@example -char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); -@end example -@strong{Description}@* -Takes a BFD and searches it for a .gnu_debugaltlink section. If this -section is found, it examines the section for the name of a file -containing auxiliary debugging information. It then searches the -filesystem for this file in a set of standard locations, including -the directory tree rooted at @var{dir}, and if found returns the -full filename. - -If @var{dir} is NULL, it will search a default path configured into -libbfd at build time. [FIXME: This feature is not currently -implemented]. - -@strong{Returns}@* -@code{NULL} on any errors or failure to locate the debug file, -otherwise a pointer to a heap-allocated string containing the -filename. The caller is responsible for freeing this string. - -@findex bfd_create_gnu_debuglink_section -@subsubsection @code{bfd_create_gnu_debuglink_section} -@strong{Synopsis} -@example -struct bfd_section *bfd_create_gnu_debuglink_section - (bfd *abfd, const char *filename); -@end example -@strong{Description}@* -Takes a @var{BFD} and adds a .gnu_debuglink section to it. The section is sized -to be big enough to contain a link to the specified @var{filename}. - -@strong{Returns}@* -A pointer to the new section is returned if all is ok. Otherwise @code{NULL} is -returned and bfd_error is set. - -@findex bfd_fill_in_gnu_debuglink_section -@subsubsection @code{bfd_fill_in_gnu_debuglink_section} -@strong{Synopsis} -@example -bfd_boolean bfd_fill_in_gnu_debuglink_section - (bfd *abfd, struct bfd_section *sect, const char *filename); -@end example -@strong{Description}@* -Takes a @var{BFD} and containing a .gnu_debuglink section @var{SECT} -and fills in the contents of the section to contain a link to the -specified @var{filename}. The filename should be relative to the -current directory. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok. Otherwise @code{FALSE} is returned -and bfd_error is set. - diff -Nur binutils-2.24.orig/bfd/doc/reloc.texi binutils-2.24/bfd/doc/reloc.texi --- binutils-2.24.orig/bfd/doc/reloc.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/reloc.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,3849 +0,0 @@ -@section Relocations -BFD maintains relocations in much the same way it maintains -symbols: they are left alone until required, then read in -en-masse and translated into an internal form. A common -routine @code{bfd_perform_relocation} acts upon the -canonical form to do the fixup. - -Relocations are maintained on a per section basis, -while symbols are maintained on a per BFD basis. - -All that a back end has to do to fit the BFD interface is to create -a @code{struct reloc_cache_entry} for each relocation -in a particular section, and fill in the right bits of the structures. - -@menu -* typedef arelent:: -* howto manager:: -@end menu - - -@node typedef arelent, howto manager, Relocations, Relocations -@subsection typedef arelent -This is the structure of a relocation entry: - - -@example - -typedef enum bfd_reloc_status -@{ - /* No errors detected. */ - bfd_reloc_ok, - - /* The relocation was performed, but there was an overflow. */ - bfd_reloc_overflow, - - /* The address to relocate was not within the section supplied. */ - bfd_reloc_outofrange, - - /* Used by special functions. */ - bfd_reloc_continue, - - /* Unsupported relocation size requested. */ - bfd_reloc_notsupported, - - /* Unused. */ - bfd_reloc_other, - - /* The symbol to relocate against was undefined. */ - bfd_reloc_undefined, - - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ - bfd_reloc_dangerous - @} - bfd_reloc_status_type; - - -typedef struct reloc_cache_entry -@{ - /* A pointer into the canonical table of pointers. */ - struct bfd_symbol **sym_ptr_ptr; - - /* offset in section. */ - bfd_size_type address; - - /* addend for relocation value. */ - bfd_vma addend; - - /* Pointer to how to perform the required relocation. */ - reloc_howto_type *howto; - -@} -arelent; - -@end example -@strong{Description}@* -Here is a description of each of the fields within an @code{arelent}: - -@itemize @bullet - -@item -@code{sym_ptr_ptr} -@end itemize -The symbol table pointer points to a pointer to the symbol -associated with the relocation request. It is the pointer -into the table returned by the back end's -@code{canonicalize_symtab} action. @xref{Symbols}. The symbol is -referenced through a pointer to a pointer so that tools like -the linker can fix up all the symbols of the same name by -modifying only one pointer. The relocation routine looks in -the symbol and uses the base of the section the symbol is -attached to and the value of the symbol as the initial -relocation offset. If the symbol pointer is zero, then the -section provided is looked up. - -@itemize @bullet - -@item -@code{address} -@end itemize -The @code{address} field gives the offset in bytes from the base of -the section data which owns the relocation record to the first -byte of relocatable information. The actual data relocated -will be relative to this point; for example, a relocation -type which modifies the bottom two bytes of a four byte word -would not touch the first byte pointed to in a big endian -world. - -@itemize @bullet - -@item -@code{addend} -@end itemize -The @code{addend} is a value provided by the back end to be added (!) -to the relocation offset. Its interpretation is dependent upon -the howto. For example, on the 68k the code: - -@example - char foo[]; - main() - @{ - return foo[0x12345678]; - @} -@end example - -Could be compiled into: - -@example - linkw fp,#-4 - moveb @@#12345678,d0 - extbl d0 - unlk fp - rts -@end example - -This could create a reloc pointing to @code{foo}, but leave the -offset in the data, something like: - -@example -RELOCATION RECORDS FOR [.text]: -offset type value -00000006 32 _foo - -00000000 4e56 fffc ; linkw fp,#-4 -00000004 1039 1234 5678 ; moveb @@#12345678,d0 -0000000a 49c0 ; extbl d0 -0000000c 4e5e ; unlk fp -0000000e 4e75 ; rts -@end example - -Using coff and an 88k, some instructions don't have enough -space in them to represent the full address range, and -pointers have to be loaded in two parts. So you'd get something like: - -@example - or.u r13,r0,hi16(_foo+0x12345678) - ld.b r2,r13,lo16(_foo+0x12345678) - jmp r1 -@end example - -This should create two relocs, both pointing to @code{_foo}, and with -0x12340000 in their addend field. The data would consist of: - -@example -RELOCATION RECORDS FOR [.text]: -offset type value -00000002 HVRT16 _foo+0x12340000 -00000006 LVRT16 _foo+0x12340000 - -00000000 5da05678 ; or.u r13,r0,0x5678 -00000004 1c4d5678 ; ld.b r2,r13,0x5678 -00000008 f400c001 ; jmp r1 -@end example - -The relocation routine digs out the value from the data, adds -it to the addend to get the original offset, and then adds the -value of @code{_foo}. Note that all 32 bits have to be kept around -somewhere, to cope with carry from bit 15 to bit 16. - -One further example is the sparc and the a.out format. The -sparc has a similar problem to the 88k, in that some -instructions don't have room for an entire offset, but on the -sparc the parts are created in odd sized lumps. The designers of -the a.out format chose to not use the data within the section -for storing part of the offset; all the offset is kept within -the reloc. Anything in the data should be ignored. - -@example - save %sp,-112,%sp - sethi %hi(_foo+0x12345678),%g2 - ldsb [%g2+%lo(_foo+0x12345678)],%i0 - ret - restore -@end example - -Both relocs contain a pointer to @code{foo}, and the offsets -contain junk. - -@example -RELOCATION RECORDS FOR [.text]: -offset type value -00000004 HI22 _foo+0x12345678 -00000008 LO10 _foo+0x12345678 - -00000000 9de3bf90 ; save %sp,-112,%sp -00000004 05000000 ; sethi %hi(_foo+0),%g2 -00000008 f048a000 ; ldsb [%g2+%lo(_foo+0)],%i0 -0000000c 81c7e008 ; ret -00000010 81e80000 ; restore -@end example - -@itemize @bullet - -@item -@code{howto} -@end itemize -The @code{howto} field can be imagined as a -relocation instruction. It is a pointer to a structure which -contains information on what to do with all of the other -information in the reloc record and data section. A back end -would normally have a relocation instruction set and turn -relocations into pointers to the correct structure on input - -but it would be possible to create each howto field on demand. - -@subsubsection @code{enum complain_overflow} -Indicates what sort of overflow checking should be done when -performing a relocation. - - -@example - -enum complain_overflow -@{ - /* Do not complain on overflow. */ - complain_overflow_dont, - - /* Complain if the value overflows when considered as a signed - number one bit larger than the field. ie. A bitfield of N bits - is allowed to represent -2**n to 2**n-1. */ - complain_overflow_bitfield, - - /* Complain if the value overflows when considered as a signed - number. */ - complain_overflow_signed, - - /* Complain if the value overflows when considered as an - unsigned number. */ - complain_overflow_unsigned -@}; -@end example -@subsubsection @code{reloc_howto_type} -The @code{reloc_howto_type} is a structure which contains all the -information that libbfd needs to know to tie up a back end's data. - - -@example -struct bfd_symbol; /* Forward declaration. */ - -struct reloc_howto_struct -@{ - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ - unsigned int type; - - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; - - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; - - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; - - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; - - /* What type of overflow error should be checked for when - relocating. */ - enum complain_overflow complain_on_overflow; - - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); - - /* The textual name of the relocation type. */ - char *name; - - /* Some formats record a relocation addend in the section contents - rather than with the relocation. For ELF formats this is the - distinction between USE_REL and USE_RELA (though the code checks - for USE_REL == 1/0). The value of this field is TRUE if the - addend is recorded with the section contents; when performing a - partial link (ld -r) the section contents (the data) will be - modified. The value of this field is FALSE if addends are - recorded with the relocation (in arelent.addend); when performing - a partial link the relocation will be modified. - All relocations for all ELF USE_RELA targets should set this field - to FALSE (values of TRUE should be looked on with suspicion). - However, the converse is not true: not all relocations of all ELF - USE_REL targets set this field to TRUE. Why this is so is peculiar - to each particular target. For relocs that aren't used in partial - links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; - - /* When some formats create PC relative instructions, they leave - the value of the pc of the place being relocated in the offset - slot of the instruction, so that a PC relative relocation can - be made just by adding in an ordinary offset (e.g., sun3 a.out). - Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; -@}; - -@end example -@findex The HOWTO Macro -@subsubsection @code{The HOWTO Macro} -@strong{Description}@* -The HOWTO define is horrible and will go away. -@example -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - @{ (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC @} -@end example - -@strong{Description}@* -And will be replaced with the totally magic way. But for the -moment, we are compatible, so do it this way. -@example -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - -@end example - -@strong{Description}@* -This is used to fill in an empty howto entry in an array. -@example -#define EMPTY_HOWTO(C) \ - HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ - NULL, FALSE, 0, 0, FALSE) - -@end example - -@strong{Description}@* -Helper routine to turn a symbol into a relocation value. -@example -#define HOWTO_PREPARE(relocation, symbol) \ - @{ \ - if (symbol != NULL) \ - @{ \ - if (bfd_is_com_section (symbol->section)) \ - @{ \ - relocation = 0; \ - @} \ - else \ - @{ \ - relocation = symbol->value; \ - @} \ - @} \ - @} - -@end example - -@findex bfd_get_reloc_size -@subsubsection @code{bfd_get_reloc_size} -@strong{Synopsis} -@example -unsigned int bfd_get_reloc_size (reloc_howto_type *); -@end example -@strong{Description}@* -For a reloc_howto_type that operates on a fixed number of bytes, -this returns the number of bytes operated on. - -@findex arelent_chain -@subsubsection @code{arelent_chain} -@strong{Description}@* -How relocs are tied together in an @code{asection}: -@example -typedef struct relent_chain -@{ - arelent relent; - struct relent_chain *next; -@} -arelent_chain; - -@end example - -@findex bfd_check_overflow -@subsubsection @code{bfd_check_overflow} -@strong{Synopsis} -@example -bfd_reloc_status_type bfd_check_overflow - (enum complain_overflow how, - unsigned int bitsize, - unsigned int rightshift, - unsigned int addrsize, - bfd_vma relocation); -@end example -@strong{Description}@* -Perform overflow checking on @var{relocation} which has -@var{bitsize} significant bits and will be shifted right by -@var{rightshift} bits, on a machine with addresses containing -@var{addrsize} significant bits. The result is either of -@code{bfd_reloc_ok} or @code{bfd_reloc_overflow}. - -@findex bfd_perform_relocation -@subsubsection @code{bfd_perform_relocation} -@strong{Synopsis} -@example -bfd_reloc_status_type bfd_perform_relocation - (bfd *abfd, - arelent *reloc_entry, - void *data, - asection *input_section, - bfd *output_bfd, - char **error_message); -@end example -@strong{Description}@* -If @var{output_bfd} is supplied to this function, the -generated image will be relocatable; the relocations are -copied to the output file after they have been changed to -reflect the new state of the world. There are two ways of -reflecting the results of partial linkage in an output file: -by modifying the output data in place, and by modifying the -relocation record. Some native formats (e.g., basic a.out and -basic coff) have no way of specifying an addend in the -relocation type, so the addend has to go in the output data. -This is no big deal since in these formats the output data -slot will always be big enough for the addend. Complex reloc -types with addends were invented to solve just this problem. -The @var{error_message} argument is set to an error message if -this return @code{bfd_reloc_dangerous}. - -@findex bfd_install_relocation -@subsubsection @code{bfd_install_relocation} -@strong{Synopsis} -@example -bfd_reloc_status_type bfd_install_relocation - (bfd *abfd, - arelent *reloc_entry, - void *data, bfd_vma data_start, - asection *input_section, - char **error_message); -@end example -@strong{Description}@* -This looks remarkably like @code{bfd_perform_relocation}, except it -does not expect that the section contents have been filled in. -I.e., it's suitable for use when creating, rather than applying -a relocation. - -For now, this function should be considered reserved for the -assembler. - - -@node howto manager, , typedef arelent, Relocations -@subsection The howto manager -When an application wants to create a relocation, but doesn't -know what the target machine might call it, it can find out by -using this bit of code. - -@findex bfd_reloc_code_type -@subsubsection @code{bfd_reloc_code_type} -@strong{Description}@* -The insides of a reloc code. The idea is that, eventually, there -will be one enumerator for every type of relocation we ever do. -Pass one of these values to @code{bfd_reloc_type_lookup}, and it'll -return a howto pointer. - -This does mean that the application must determine the correct -enumerator value; you can't get a howto pointer from a random set -of attributes. - -Here are the possible values for @code{enum bfd_reloc_code_real}: - -@deffn {} BFD_RELOC_64 -@deffnx {} BFD_RELOC_32 -@deffnx {} BFD_RELOC_26 -@deffnx {} BFD_RELOC_24 -@deffnx {} BFD_RELOC_16 -@deffnx {} BFD_RELOC_14 -@deffnx {} BFD_RELOC_8 -Basic absolute relocations of N bits. -@end deffn -@deffn {} BFD_RELOC_64_PCREL -@deffnx {} BFD_RELOC_32_PCREL -@deffnx {} BFD_RELOC_24_PCREL -@deffnx {} BFD_RELOC_16_PCREL -@deffnx {} BFD_RELOC_12_PCREL -@deffnx {} BFD_RELOC_8_PCREL -PC-relative relocations. Sometimes these are relative to the address -of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. -@end deffn -@deffn {} BFD_RELOC_32_SECREL -Section relative relocations. Some targets need this for DWARF2. -@end deffn -@deffn {} BFD_RELOC_32_GOT_PCREL -@deffnx {} BFD_RELOC_16_GOT_PCREL -@deffnx {} BFD_RELOC_8_GOT_PCREL -@deffnx {} BFD_RELOC_32_GOTOFF -@deffnx {} BFD_RELOC_16_GOTOFF -@deffnx {} BFD_RELOC_LO16_GOTOFF -@deffnx {} BFD_RELOC_HI16_GOTOFF -@deffnx {} BFD_RELOC_HI16_S_GOTOFF -@deffnx {} BFD_RELOC_8_GOTOFF -@deffnx {} BFD_RELOC_64_PLT_PCREL -@deffnx {} BFD_RELOC_32_PLT_PCREL -@deffnx {} BFD_RELOC_24_PLT_PCREL -@deffnx {} BFD_RELOC_16_PLT_PCREL -@deffnx {} BFD_RELOC_8_PLT_PCREL -@deffnx {} BFD_RELOC_64_PLTOFF -@deffnx {} BFD_RELOC_32_PLTOFF -@deffnx {} BFD_RELOC_16_PLTOFF -@deffnx {} BFD_RELOC_LO16_PLTOFF -@deffnx {} BFD_RELOC_HI16_PLTOFF -@deffnx {} BFD_RELOC_HI16_S_PLTOFF -@deffnx {} BFD_RELOC_8_PLTOFF -For ELF. -@end deffn -@deffn {} BFD_RELOC_SIZE32 -@deffnx {} BFD_RELOC_SIZE64 -Size relocations. -@end deffn -@deffn {} BFD_RELOC_68K_GLOB_DAT -@deffnx {} BFD_RELOC_68K_JMP_SLOT -@deffnx {} BFD_RELOC_68K_RELATIVE -@deffnx {} BFD_RELOC_68K_TLS_GD32 -@deffnx {} BFD_RELOC_68K_TLS_GD16 -@deffnx {} BFD_RELOC_68K_TLS_GD8 -@deffnx {} BFD_RELOC_68K_TLS_LDM32 -@deffnx {} BFD_RELOC_68K_TLS_LDM16 -@deffnx {} BFD_RELOC_68K_TLS_LDM8 -@deffnx {} BFD_RELOC_68K_TLS_LDO32 -@deffnx {} BFD_RELOC_68K_TLS_LDO16 -@deffnx {} BFD_RELOC_68K_TLS_LDO8 -@deffnx {} BFD_RELOC_68K_TLS_IE32 -@deffnx {} BFD_RELOC_68K_TLS_IE16 -@deffnx {} BFD_RELOC_68K_TLS_IE8 -@deffnx {} BFD_RELOC_68K_TLS_LE32 -@deffnx {} BFD_RELOC_68K_TLS_LE16 -@deffnx {} BFD_RELOC_68K_TLS_LE8 -Relocations used by 68K ELF. -@end deffn -@deffn {} BFD_RELOC_32_BASEREL -@deffnx {} BFD_RELOC_16_BASEREL -@deffnx {} BFD_RELOC_LO16_BASEREL -@deffnx {} BFD_RELOC_HI16_BASEREL -@deffnx {} BFD_RELOC_HI16_S_BASEREL -@deffnx {} BFD_RELOC_8_BASEREL -@deffnx {} BFD_RELOC_RVA -Linkage-table relative. -@end deffn -@deffn {} BFD_RELOC_8_FFnn -Absolute 8-bit relocation, but used to form an address like 0xFFnn. -@end deffn -@deffn {} BFD_RELOC_32_PCREL_S2 -@deffnx {} BFD_RELOC_16_PCREL_S2 -@deffnx {} BFD_RELOC_23_PCREL_S2 -These PC-relative relocations are stored as word displacements -- -i.e., byte displacements shifted right two bits. The 30-bit word -displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the -SPARC. (SPARC tools generally refer to this as <>.) The -signed 16-bit displacement is used on the MIPS, and the 23-bit -displacement is used on the Alpha. -@end deffn -@deffn {} BFD_RELOC_HI22 -@deffnx {} BFD_RELOC_LO10 -High 22 bits and low 10 bits of 32-bit value, placed into lower bits of -the target word. These are used on the SPARC. -@end deffn -@deffn {} BFD_RELOC_GPREL16 -@deffnx {} BFD_RELOC_GPREL32 -For systems that allocate a Global Pointer register, these are -displacements off that register. These relocation types are -handled specially, because the value the register will have is -decided relatively late. -@end deffn -@deffn {} BFD_RELOC_I960_CALLJ -Reloc types used for i960/b.out. -@end deffn -@deffn {} BFD_RELOC_NONE -@deffnx {} BFD_RELOC_SPARC_WDISP22 -@deffnx {} BFD_RELOC_SPARC22 -@deffnx {} BFD_RELOC_SPARC13 -@deffnx {} BFD_RELOC_SPARC_GOT10 -@deffnx {} BFD_RELOC_SPARC_GOT13 -@deffnx {} BFD_RELOC_SPARC_GOT22 -@deffnx {} BFD_RELOC_SPARC_PC10 -@deffnx {} BFD_RELOC_SPARC_PC22 -@deffnx {} BFD_RELOC_SPARC_WPLT30 -@deffnx {} BFD_RELOC_SPARC_COPY -@deffnx {} BFD_RELOC_SPARC_GLOB_DAT -@deffnx {} BFD_RELOC_SPARC_JMP_SLOT -@deffnx {} BFD_RELOC_SPARC_RELATIVE -@deffnx {} BFD_RELOC_SPARC_UA16 -@deffnx {} BFD_RELOC_SPARC_UA32 -@deffnx {} BFD_RELOC_SPARC_UA64 -@deffnx {} BFD_RELOC_SPARC_GOTDATA_HIX22 -@deffnx {} BFD_RELOC_SPARC_GOTDATA_LOX10 -@deffnx {} BFD_RELOC_SPARC_GOTDATA_OP_HIX22 -@deffnx {} BFD_RELOC_SPARC_GOTDATA_OP_LOX10 -@deffnx {} BFD_RELOC_SPARC_GOTDATA_OP -@deffnx {} BFD_RELOC_SPARC_JMP_IREL -@deffnx {} BFD_RELOC_SPARC_IRELATIVE -SPARC ELF relocations. There is probably some overlap with other -relocation types already defined. -@end deffn -@deffn {} BFD_RELOC_SPARC_BASE13 -@deffnx {} BFD_RELOC_SPARC_BASE22 -I think these are specific to SPARC a.out (e.g., Sun 4). -@end deffn -@deffn {} BFD_RELOC_SPARC_64 -@deffnx {} BFD_RELOC_SPARC_10 -@deffnx {} BFD_RELOC_SPARC_11 -@deffnx {} BFD_RELOC_SPARC_OLO10 -@deffnx {} BFD_RELOC_SPARC_HH22 -@deffnx {} BFD_RELOC_SPARC_HM10 -@deffnx {} BFD_RELOC_SPARC_LM22 -@deffnx {} BFD_RELOC_SPARC_PC_HH22 -@deffnx {} BFD_RELOC_SPARC_PC_HM10 -@deffnx {} BFD_RELOC_SPARC_PC_LM22 -@deffnx {} BFD_RELOC_SPARC_WDISP16 -@deffnx {} BFD_RELOC_SPARC_WDISP19 -@deffnx {} BFD_RELOC_SPARC_7 -@deffnx {} BFD_RELOC_SPARC_6 -@deffnx {} BFD_RELOC_SPARC_5 -@deffnx {} BFD_RELOC_SPARC_DISP64 -@deffnx {} BFD_RELOC_SPARC_PLT32 -@deffnx {} BFD_RELOC_SPARC_PLT64 -@deffnx {} BFD_RELOC_SPARC_HIX22 -@deffnx {} BFD_RELOC_SPARC_LOX10 -@deffnx {} BFD_RELOC_SPARC_H44 -@deffnx {} BFD_RELOC_SPARC_M44 -@deffnx {} BFD_RELOC_SPARC_L44 -@deffnx {} BFD_RELOC_SPARC_REGISTER -@deffnx {} BFD_RELOC_SPARC_H34 -@deffnx {} BFD_RELOC_SPARC_SIZE32 -@deffnx {} BFD_RELOC_SPARC_SIZE64 -@deffnx {} BFD_RELOC_SPARC_WDISP10 -SPARC64 relocations -@end deffn -@deffn {} BFD_RELOC_SPARC_REV32 -SPARC little endian relocation -@end deffn -@deffn {} BFD_RELOC_SPARC_TLS_GD_HI22 -@deffnx {} BFD_RELOC_SPARC_TLS_GD_LO10 -@deffnx {} BFD_RELOC_SPARC_TLS_GD_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_GD_CALL -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_HI22 -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_LO10 -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_CALL -@deffnx {} BFD_RELOC_SPARC_TLS_LDO_HIX22 -@deffnx {} BFD_RELOC_SPARC_TLS_LDO_LOX10 -@deffnx {} BFD_RELOC_SPARC_TLS_LDO_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_IE_HI22 -@deffnx {} BFD_RELOC_SPARC_TLS_IE_LO10 -@deffnx {} BFD_RELOC_SPARC_TLS_IE_LD -@deffnx {} BFD_RELOC_SPARC_TLS_IE_LDX -@deffnx {} BFD_RELOC_SPARC_TLS_IE_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_LE_HIX22 -@deffnx {} BFD_RELOC_SPARC_TLS_LE_LOX10 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPMOD64 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPOFF64 -@deffnx {} BFD_RELOC_SPARC_TLS_TPOFF32 -@deffnx {} BFD_RELOC_SPARC_TLS_TPOFF64 -SPARC TLS relocations -@end deffn -@deffn {} BFD_RELOC_SPU_IMM7 -@deffnx {} BFD_RELOC_SPU_IMM8 -@deffnx {} BFD_RELOC_SPU_IMM10 -@deffnx {} BFD_RELOC_SPU_IMM10W -@deffnx {} BFD_RELOC_SPU_IMM16 -@deffnx {} BFD_RELOC_SPU_IMM16W -@deffnx {} BFD_RELOC_SPU_IMM18 -@deffnx {} BFD_RELOC_SPU_PCREL9a -@deffnx {} BFD_RELOC_SPU_PCREL9b -@deffnx {} BFD_RELOC_SPU_PCREL16 -@deffnx {} BFD_RELOC_SPU_LO16 -@deffnx {} BFD_RELOC_SPU_HI16 -@deffnx {} BFD_RELOC_SPU_PPU32 -@deffnx {} BFD_RELOC_SPU_PPU64 -@deffnx {} BFD_RELOC_SPU_ADD_PIC -SPU Relocations. -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPDISP_HI16 -Alpha ECOFF and ELF relocations. Some of these treat the symbol or -"addend" in some special way. -For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when -writing; when reading, it will be the absolute section symbol. The -addend is the displacement in bytes of the "lda" instruction from -the "ldah" instruction (which is at the address of this reloc). -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPDISP_LO16 -For GPDISP_LO16 ("ignore") relocations, the symbol is handled as -with GPDISP_HI16 relocs. The addend is ignored when writing the -relocations out, and is filled in with the file's GP value on -reading, for convenience. -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPDISP -The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 -relocation except that there is no accompanying GPDISP_LO16 -relocation. -@end deffn -@deffn {} BFD_RELOC_ALPHA_LITERAL -@deffnx {} BFD_RELOC_ALPHA_ELF_LITERAL -@deffnx {} BFD_RELOC_ALPHA_LITUSE -The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; -the assembler turns it into a LDQ instruction to load the address of -the symbol, and then fills in a register in the real instruction. - -The LITERAL reloc, at the LDQ instruction, refers to the .lita -section symbol. The addend is ignored when writing, but is filled -in with the file's GP value on reading, for convenience, as with the -GPDISP_LO16 reloc. - -The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16. -It should refer to the symbol to be referenced, as with 16_GOTOFF, -but it generates output not based on the position within the .got -section, but relative to the GP value chosen for the file during the -final link stage. - -The LITUSE reloc, on the instruction using the loaded address, gives -information to the linker that it might be able to use to optimize -away some literal section references. The symbol is ignored (read -as the absolute section symbol), and the "addend" indicates the type -of instruction using the register: -1 - "memory" fmt insn -2 - byte-manipulation (byte offset reg) -3 - jsr (target of branch) -@end deffn -@deffn {} BFD_RELOC_ALPHA_HINT -The HINT relocation indicates a value that should be filled into the -"hint" field of a jmp/jsr/ret instruction, for possible branch- -prediction logic which may be provided on some processors. -@end deffn -@deffn {} BFD_RELOC_ALPHA_LINKAGE -The LINKAGE relocation outputs a linkage pair in the object file, -which is filled by the linker. -@end deffn -@deffn {} BFD_RELOC_ALPHA_CODEADDR -The CODEADDR relocation outputs a STO_CA in the object file, -which is filled by the linker. -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPREL_HI16 -@deffnx {} BFD_RELOC_ALPHA_GPREL_LO16 -The GPREL_HI/LO relocations together form a 32-bit offset from the -GP register. -@end deffn -@deffn {} BFD_RELOC_ALPHA_BRSGP -Like BFD_RELOC_23_PCREL_S2, except that the source and target must -share a common GP, and the target address is adjusted for -STO_ALPHA_STD_GPLOAD. -@end deffn -@deffn {} BFD_RELOC_ALPHA_NOP -The NOP relocation outputs a NOP if the longword displacement -between two procedure entry points is < 2^21. -@end deffn -@deffn {} BFD_RELOC_ALPHA_BSR -The BSR relocation outputs a BSR if the longword displacement -between two procedure entry points is < 2^21. -@end deffn -@deffn {} BFD_RELOC_ALPHA_LDA -The LDA relocation outputs a LDA if the longword displacement -between two procedure entry points is < 2^16. -@end deffn -@deffn {} BFD_RELOC_ALPHA_BOH -The BOH relocation outputs a BSR if the longword displacement -between two procedure entry points is < 2^21, or else a hint. -@end deffn -@deffn {} BFD_RELOC_ALPHA_TLSGD -@deffnx {} BFD_RELOC_ALPHA_TLSLDM -@deffnx {} BFD_RELOC_ALPHA_DTPMOD64 -@deffnx {} BFD_RELOC_ALPHA_GOTDTPREL16 -@deffnx {} BFD_RELOC_ALPHA_DTPREL64 -@deffnx {} BFD_RELOC_ALPHA_DTPREL_HI16 -@deffnx {} BFD_RELOC_ALPHA_DTPREL_LO16 -@deffnx {} BFD_RELOC_ALPHA_DTPREL16 -@deffnx {} BFD_RELOC_ALPHA_GOTTPREL16 -@deffnx {} BFD_RELOC_ALPHA_TPREL64 -@deffnx {} BFD_RELOC_ALPHA_TPREL_HI16 -@deffnx {} BFD_RELOC_ALPHA_TPREL_LO16 -@deffnx {} BFD_RELOC_ALPHA_TPREL16 -Alpha thread-local storage relocations. -@end deffn -@deffn {} BFD_RELOC_MIPS_JMP -@deffnx {} BFD_RELOC_MICROMIPS_JMP -The MIPS jump instruction. -@end deffn -@deffn {} BFD_RELOC_MIPS16_JMP -The MIPS16 jump instruction. -@end deffn -@deffn {} BFD_RELOC_MIPS16_GPREL -MIPS16 GP relative reloc. -@end deffn -@deffn {} BFD_RELOC_HI16 -High 16 bits of 32-bit value; simple reloc. -@end deffn -@deffn {} BFD_RELOC_HI16_S -High 16 bits of 32-bit value but the low 16 bits will be sign -extended and added to form the final result. If the low 16 -bits form a negative number, we need to add one to the high value -to compensate for the borrow when the low bits are added. -@end deffn -@deffn {} BFD_RELOC_LO16 -Low 16 bits. -@end deffn -@deffn {} BFD_RELOC_HI16_PCREL -High 16 bits of 32-bit pc-relative value -@end deffn -@deffn {} BFD_RELOC_HI16_S_PCREL -High 16 bits of 32-bit pc-relative value, adjusted -@end deffn -@deffn {} BFD_RELOC_LO16_PCREL -Low 16 bits of pc-relative value -@end deffn -@deffn {} BFD_RELOC_MIPS16_GOT16 -@deffnx {} BFD_RELOC_MIPS16_CALL16 -Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of -16-bit immediate fields -@end deffn -@deffn {} BFD_RELOC_MIPS16_HI16 -MIPS16 high 16 bits of 32-bit value. -@end deffn -@deffn {} BFD_RELOC_MIPS16_HI16_S -MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign -extended and added to form the final result. If the low 16 -bits form a negative number, we need to add one to the high value -to compensate for the borrow when the low bits are added. -@end deffn -@deffn {} BFD_RELOC_MIPS16_LO16 -MIPS16 low 16 bits. -@end deffn -@deffn {} BFD_RELOC_MIPS16_TLS_GD -@deffnx {} BFD_RELOC_MIPS16_TLS_LDM -@deffnx {} BFD_RELOC_MIPS16_TLS_DTPREL_HI16 -@deffnx {} BFD_RELOC_MIPS16_TLS_DTPREL_LO16 -@deffnx {} BFD_RELOC_MIPS16_TLS_GOTTPREL -@deffnx {} BFD_RELOC_MIPS16_TLS_TPREL_HI16 -@deffnx {} BFD_RELOC_MIPS16_TLS_TPREL_LO16 -MIPS16 TLS relocations -@end deffn -@deffn {} BFD_RELOC_MIPS_LITERAL -@deffnx {} BFD_RELOC_MICROMIPS_LITERAL -Relocation against a MIPS literal section. -@end deffn -@deffn {} BFD_RELOC_MICROMIPS_7_PCREL_S1 -@deffnx {} BFD_RELOC_MICROMIPS_10_PCREL_S1 -@deffnx {} BFD_RELOC_MICROMIPS_16_PCREL_S1 -microMIPS PC-relative relocations. -@end deffn -@deffn {} BFD_RELOC_MICROMIPS_GPREL16 -@deffnx {} BFD_RELOC_MICROMIPS_HI16 -@deffnx {} BFD_RELOC_MICROMIPS_HI16_S -@deffnx {} BFD_RELOC_MICROMIPS_LO16 -microMIPS versions of generic BFD relocs. -@end deffn -@deffn {} BFD_RELOC_MIPS_GOT16 -@deffnx {} BFD_RELOC_MICROMIPS_GOT16 -@deffnx {} BFD_RELOC_MIPS_CALL16 -@deffnx {} BFD_RELOC_MICROMIPS_CALL16 -@deffnx {} BFD_RELOC_MIPS_GOT_HI16 -@deffnx {} BFD_RELOC_MICROMIPS_GOT_HI16 -@deffnx {} BFD_RELOC_MIPS_GOT_LO16 -@deffnx {} BFD_RELOC_MICROMIPS_GOT_LO16 -@deffnx {} BFD_RELOC_MIPS_CALL_HI16 -@deffnx {} BFD_RELOC_MICROMIPS_CALL_HI16 -@deffnx {} BFD_RELOC_MIPS_CALL_LO16 -@deffnx {} BFD_RELOC_MICROMIPS_CALL_LO16 -@deffnx {} BFD_RELOC_MIPS_SUB -@deffnx {} BFD_RELOC_MICROMIPS_SUB -@deffnx {} BFD_RELOC_MIPS_GOT_PAGE -@deffnx {} BFD_RELOC_MICROMIPS_GOT_PAGE -@deffnx {} BFD_RELOC_MIPS_GOT_OFST -@deffnx {} BFD_RELOC_MICROMIPS_GOT_OFST -@deffnx {} BFD_RELOC_MIPS_GOT_DISP -@deffnx {} BFD_RELOC_MICROMIPS_GOT_DISP -@deffnx {} BFD_RELOC_MIPS_SHIFT5 -@deffnx {} BFD_RELOC_MIPS_SHIFT6 -@deffnx {} BFD_RELOC_MIPS_INSERT_A -@deffnx {} BFD_RELOC_MIPS_INSERT_B -@deffnx {} BFD_RELOC_MIPS_DELETE -@deffnx {} BFD_RELOC_MIPS_HIGHEST -@deffnx {} BFD_RELOC_MICROMIPS_HIGHEST -@deffnx {} BFD_RELOC_MIPS_HIGHER -@deffnx {} BFD_RELOC_MICROMIPS_HIGHER -@deffnx {} BFD_RELOC_MIPS_SCN_DISP -@deffnx {} BFD_RELOC_MICROMIPS_SCN_DISP -@deffnx {} BFD_RELOC_MIPS_REL16 -@deffnx {} BFD_RELOC_MIPS_RELGOT -@deffnx {} BFD_RELOC_MIPS_JALR -@deffnx {} BFD_RELOC_MICROMIPS_JALR -@deffnx {} BFD_RELOC_MIPS_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL32 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPMOD64 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL64 -@deffnx {} BFD_RELOC_MIPS_TLS_GD -@deffnx {} BFD_RELOC_MICROMIPS_TLS_GD -@deffnx {} BFD_RELOC_MIPS_TLS_LDM -@deffnx {} BFD_RELOC_MICROMIPS_TLS_LDM -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL_HI16 -@deffnx {} BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL_LO16 -@deffnx {} BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16 -@deffnx {} BFD_RELOC_MIPS_TLS_GOTTPREL -@deffnx {} BFD_RELOC_MICROMIPS_TLS_GOTTPREL -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL32 -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL64 -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL_HI16 -@deffnx {} BFD_RELOC_MICROMIPS_TLS_TPREL_HI16 -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL_LO16 -@deffnx {} BFD_RELOC_MICROMIPS_TLS_TPREL_LO16 -@deffnx {} BFD_RELOC_MIPS_EH -MIPS ELF relocations. -@end deffn -@deffn {} BFD_RELOC_MIPS_COPY -@deffnx {} BFD_RELOC_MIPS_JUMP_SLOT -MIPS ELF relocations (VxWorks and PLT extensions). -@end deffn -@deffn {} BFD_RELOC_MOXIE_10_PCREL -Moxie ELF relocations. -@end deffn -@deffn {} BFD_RELOC_FRV_LABEL16 -@deffnx {} BFD_RELOC_FRV_LABEL24 -@deffnx {} BFD_RELOC_FRV_LO16 -@deffnx {} BFD_RELOC_FRV_HI16 -@deffnx {} BFD_RELOC_FRV_GPREL12 -@deffnx {} BFD_RELOC_FRV_GPRELU12 -@deffnx {} BFD_RELOC_FRV_GPREL32 -@deffnx {} BFD_RELOC_FRV_GPRELHI -@deffnx {} BFD_RELOC_FRV_GPRELLO -@deffnx {} BFD_RELOC_FRV_GOT12 -@deffnx {} BFD_RELOC_FRV_GOTHI -@deffnx {} BFD_RELOC_FRV_GOTLO -@deffnx {} BFD_RELOC_FRV_FUNCDESC -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOT12 -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTHI -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTLO -@deffnx {} BFD_RELOC_FRV_FUNCDESC_VALUE -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFF12 -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFFHI -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFFLO -@deffnx {} BFD_RELOC_FRV_GOTOFF12 -@deffnx {} BFD_RELOC_FRV_GOTOFFHI -@deffnx {} BFD_RELOC_FRV_GOTOFFLO -@deffnx {} BFD_RELOC_FRV_GETTLSOFF -@deffnx {} BFD_RELOC_FRV_TLSDESC_VALUE -@deffnx {} BFD_RELOC_FRV_GOTTLSDESC12 -@deffnx {} BFD_RELOC_FRV_GOTTLSDESCHI -@deffnx {} BFD_RELOC_FRV_GOTTLSDESCLO -@deffnx {} BFD_RELOC_FRV_TLSMOFF12 -@deffnx {} BFD_RELOC_FRV_TLSMOFFHI -@deffnx {} BFD_RELOC_FRV_TLSMOFFLO -@deffnx {} BFD_RELOC_FRV_GOTTLSOFF12 -@deffnx {} BFD_RELOC_FRV_GOTTLSOFFHI -@deffnx {} BFD_RELOC_FRV_GOTTLSOFFLO -@deffnx {} BFD_RELOC_FRV_TLSOFF -@deffnx {} BFD_RELOC_FRV_TLSDESC_RELAX -@deffnx {} BFD_RELOC_FRV_GETTLSOFF_RELAX -@deffnx {} BFD_RELOC_FRV_TLSOFF_RELAX -@deffnx {} BFD_RELOC_FRV_TLSMOFF -Fujitsu Frv Relocations. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOTOFF24 -This is a 24bit GOT-relative reloc for the mn10300. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOT32 -This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes -in the instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOT24 -This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes -in the instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOT16 -This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes -in the instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_COPY -Copy symbol at runtime. -@end deffn -@deffn {} BFD_RELOC_MN10300_GLOB_DAT -Create GOT entry. -@end deffn -@deffn {} BFD_RELOC_MN10300_JMP_SLOT -Create PLT entry. -@end deffn -@deffn {} BFD_RELOC_MN10300_RELATIVE -Adjust by program base. -@end deffn -@deffn {} BFD_RELOC_MN10300_SYM_DIFF -Together with another reloc targeted at the same location, -allows for a value that is the difference of two symbols -in the same section. -@end deffn -@deffn {} BFD_RELOC_MN10300_ALIGN -The addend of this reloc is an alignment power that must -be honoured at the offset's location, regardless of linker -relaxation. -@end deffn -@deffn {} BFD_RELOC_MN10300_TLS_GD -@deffnx {} BFD_RELOC_MN10300_TLS_LD -@deffnx {} BFD_RELOC_MN10300_TLS_LDO -@deffnx {} BFD_RELOC_MN10300_TLS_GOTIE -@deffnx {} BFD_RELOC_MN10300_TLS_IE -@deffnx {} BFD_RELOC_MN10300_TLS_LE -@deffnx {} BFD_RELOC_MN10300_TLS_DTPMOD -@deffnx {} BFD_RELOC_MN10300_TLS_DTPOFF -@deffnx {} BFD_RELOC_MN10300_TLS_TPOFF -Various TLS-related relocations. -@end deffn -@deffn {} BFD_RELOC_MN10300_32_PCREL -This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the -instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_16_PCREL -This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the -instruction. -@end deffn -@deffn {} BFD_RELOC_386_GOT32 -@deffnx {} BFD_RELOC_386_PLT32 -@deffnx {} BFD_RELOC_386_COPY -@deffnx {} BFD_RELOC_386_GLOB_DAT -@deffnx {} BFD_RELOC_386_JUMP_SLOT -@deffnx {} BFD_RELOC_386_RELATIVE -@deffnx {} BFD_RELOC_386_GOTOFF -@deffnx {} BFD_RELOC_386_GOTPC -@deffnx {} BFD_RELOC_386_TLS_TPOFF -@deffnx {} BFD_RELOC_386_TLS_IE -@deffnx {} BFD_RELOC_386_TLS_GOTIE -@deffnx {} BFD_RELOC_386_TLS_LE -@deffnx {} BFD_RELOC_386_TLS_GD -@deffnx {} BFD_RELOC_386_TLS_LDM -@deffnx {} BFD_RELOC_386_TLS_LDO_32 -@deffnx {} BFD_RELOC_386_TLS_IE_32 -@deffnx {} BFD_RELOC_386_TLS_LE_32 -@deffnx {} BFD_RELOC_386_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_386_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_386_TLS_TPOFF32 -@deffnx {} BFD_RELOC_386_TLS_GOTDESC -@deffnx {} BFD_RELOC_386_TLS_DESC_CALL -@deffnx {} BFD_RELOC_386_TLS_DESC -@deffnx {} BFD_RELOC_386_IRELATIVE -i386/elf relocations -@end deffn -@deffn {} BFD_RELOC_X86_64_GOT32 -@deffnx {} BFD_RELOC_X86_64_PLT32 -@deffnx {} BFD_RELOC_X86_64_COPY -@deffnx {} BFD_RELOC_X86_64_GLOB_DAT -@deffnx {} BFD_RELOC_X86_64_JUMP_SLOT -@deffnx {} BFD_RELOC_X86_64_RELATIVE -@deffnx {} BFD_RELOC_X86_64_GOTPCREL -@deffnx {} BFD_RELOC_X86_64_32S -@deffnx {} BFD_RELOC_X86_64_DTPMOD64 -@deffnx {} BFD_RELOC_X86_64_DTPOFF64 -@deffnx {} BFD_RELOC_X86_64_TPOFF64 -@deffnx {} BFD_RELOC_X86_64_TLSGD -@deffnx {} BFD_RELOC_X86_64_TLSLD -@deffnx {} BFD_RELOC_X86_64_DTPOFF32 -@deffnx {} BFD_RELOC_X86_64_GOTTPOFF -@deffnx {} BFD_RELOC_X86_64_TPOFF32 -@deffnx {} BFD_RELOC_X86_64_GOTOFF64 -@deffnx {} BFD_RELOC_X86_64_GOTPC32 -@deffnx {} BFD_RELOC_X86_64_GOT64 -@deffnx {} BFD_RELOC_X86_64_GOTPCREL64 -@deffnx {} BFD_RELOC_X86_64_GOTPC64 -@deffnx {} BFD_RELOC_X86_64_GOTPLT64 -@deffnx {} BFD_RELOC_X86_64_PLTOFF64 -@deffnx {} BFD_RELOC_X86_64_GOTPC32_TLSDESC -@deffnx {} BFD_RELOC_X86_64_TLSDESC_CALL -@deffnx {} BFD_RELOC_X86_64_TLSDESC -@deffnx {} BFD_RELOC_X86_64_IRELATIVE -@deffnx {} BFD_RELOC_X86_64_PC32_BND -@deffnx {} BFD_RELOC_X86_64_PLT32_BND -x86-64/elf relocations -@end deffn -@deffn {} BFD_RELOC_NS32K_IMM_8 -@deffnx {} BFD_RELOC_NS32K_IMM_16 -@deffnx {} BFD_RELOC_NS32K_IMM_32 -@deffnx {} BFD_RELOC_NS32K_IMM_8_PCREL -@deffnx {} BFD_RELOC_NS32K_IMM_16_PCREL -@deffnx {} BFD_RELOC_NS32K_IMM_32_PCREL -@deffnx {} BFD_RELOC_NS32K_DISP_8 -@deffnx {} BFD_RELOC_NS32K_DISP_16 -@deffnx {} BFD_RELOC_NS32K_DISP_32 -@deffnx {} BFD_RELOC_NS32K_DISP_8_PCREL -@deffnx {} BFD_RELOC_NS32K_DISP_16_PCREL -@deffnx {} BFD_RELOC_NS32K_DISP_32_PCREL -ns32k relocations -@end deffn -@deffn {} BFD_RELOC_PDP11_DISP_8_PCREL -@deffnx {} BFD_RELOC_PDP11_DISP_6_PCREL -PDP11 relocations -@end deffn -@deffn {} BFD_RELOC_PJ_CODE_HI16 -@deffnx {} BFD_RELOC_PJ_CODE_LO16 -@deffnx {} BFD_RELOC_PJ_CODE_DIR16 -@deffnx {} BFD_RELOC_PJ_CODE_DIR32 -@deffnx {} BFD_RELOC_PJ_CODE_REL16 -@deffnx {} BFD_RELOC_PJ_CODE_REL32 -Picojava relocs. Not all of these appear in object files. -@end deffn -@deffn {} BFD_RELOC_PPC_B26 -@deffnx {} BFD_RELOC_PPC_BA26 -@deffnx {} BFD_RELOC_PPC_TOC16 -@deffnx {} BFD_RELOC_PPC_B16 -@deffnx {} BFD_RELOC_PPC_B16_BRTAKEN -@deffnx {} BFD_RELOC_PPC_B16_BRNTAKEN -@deffnx {} BFD_RELOC_PPC_BA16 -@deffnx {} BFD_RELOC_PPC_BA16_BRTAKEN -@deffnx {} BFD_RELOC_PPC_BA16_BRNTAKEN -@deffnx {} BFD_RELOC_PPC_COPY -@deffnx {} BFD_RELOC_PPC_GLOB_DAT -@deffnx {} BFD_RELOC_PPC_JMP_SLOT -@deffnx {} BFD_RELOC_PPC_RELATIVE -@deffnx {} BFD_RELOC_PPC_LOCAL24PC -@deffnx {} BFD_RELOC_PPC_EMB_NADDR32 -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16 -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16_LO -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16_HI -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16_HA -@deffnx {} BFD_RELOC_PPC_EMB_SDAI16 -@deffnx {} BFD_RELOC_PPC_EMB_SDA2I16 -@deffnx {} BFD_RELOC_PPC_EMB_SDA2REL -@deffnx {} BFD_RELOC_PPC_EMB_SDA21 -@deffnx {} BFD_RELOC_PPC_EMB_MRKREF -@deffnx {} BFD_RELOC_PPC_EMB_RELSEC16 -@deffnx {} BFD_RELOC_PPC_EMB_RELST_LO -@deffnx {} BFD_RELOC_PPC_EMB_RELST_HI -@deffnx {} BFD_RELOC_PPC_EMB_RELST_HA -@deffnx {} BFD_RELOC_PPC_EMB_BIT_FLD -@deffnx {} BFD_RELOC_PPC_EMB_RELSDA -@deffnx {} BFD_RELOC_PPC_VLE_REL8 -@deffnx {} BFD_RELOC_PPC_VLE_REL15 -@deffnx {} BFD_RELOC_PPC_VLE_REL24 -@deffnx {} BFD_RELOC_PPC_VLE_LO16A -@deffnx {} BFD_RELOC_PPC_VLE_LO16D -@deffnx {} BFD_RELOC_PPC_VLE_HI16A -@deffnx {} BFD_RELOC_PPC_VLE_HI16D -@deffnx {} BFD_RELOC_PPC_VLE_HA16A -@deffnx {} BFD_RELOC_PPC_VLE_HA16D -@deffnx {} BFD_RELOC_PPC_VLE_SDA21 -@deffnx {} BFD_RELOC_PPC_VLE_SDA21_LO -@deffnx {} BFD_RELOC_PPC_VLE_SDAREL_LO16A -@deffnx {} BFD_RELOC_PPC_VLE_SDAREL_LO16D -@deffnx {} BFD_RELOC_PPC_VLE_SDAREL_HI16A -@deffnx {} BFD_RELOC_PPC_VLE_SDAREL_HI16D -@deffnx {} BFD_RELOC_PPC_VLE_SDAREL_HA16A -@deffnx {} BFD_RELOC_PPC_VLE_SDAREL_HA16D -@deffnx {} BFD_RELOC_PPC64_HIGHER -@deffnx {} BFD_RELOC_PPC64_HIGHER_S -@deffnx {} BFD_RELOC_PPC64_HIGHEST -@deffnx {} BFD_RELOC_PPC64_HIGHEST_S -@deffnx {} BFD_RELOC_PPC64_TOC16_LO -@deffnx {} BFD_RELOC_PPC64_TOC16_HI -@deffnx {} BFD_RELOC_PPC64_TOC16_HA -@deffnx {} BFD_RELOC_PPC64_TOC -@deffnx {} BFD_RELOC_PPC64_PLTGOT16 -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_LO -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_HI -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_HA -@deffnx {} BFD_RELOC_PPC64_ADDR16_DS -@deffnx {} BFD_RELOC_PPC64_ADDR16_LO_DS -@deffnx {} BFD_RELOC_PPC64_GOT16_DS -@deffnx {} BFD_RELOC_PPC64_GOT16_LO_DS -@deffnx {} BFD_RELOC_PPC64_PLT16_LO_DS -@deffnx {} BFD_RELOC_PPC64_SECTOFF_DS -@deffnx {} BFD_RELOC_PPC64_SECTOFF_LO_DS -@deffnx {} BFD_RELOC_PPC64_TOC16_DS -@deffnx {} BFD_RELOC_PPC64_TOC16_LO_DS -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_DS -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_LO_DS -@deffnx {} BFD_RELOC_PPC64_ADDR16_HIGH -@deffnx {} BFD_RELOC_PPC64_ADDR16_HIGHA -Power(rs6000) and PowerPC relocations. -@end deffn -@deffn {} BFD_RELOC_PPC_TLS -@deffnx {} BFD_RELOC_PPC_TLSGD -@deffnx {} BFD_RELOC_PPC_TLSLD -@deffnx {} BFD_RELOC_PPC_DTPMOD -@deffnx {} BFD_RELOC_PPC_TPREL16 -@deffnx {} BFD_RELOC_PPC_TPREL16_LO -@deffnx {} BFD_RELOC_PPC_TPREL16_HI -@deffnx {} BFD_RELOC_PPC_TPREL16_HA -@deffnx {} BFD_RELOC_PPC_TPREL -@deffnx {} BFD_RELOC_PPC_DTPREL16 -@deffnx {} BFD_RELOC_PPC_DTPREL16_LO -@deffnx {} BFD_RELOC_PPC_DTPREL16_HI -@deffnx {} BFD_RELOC_PPC_DTPREL16_HA -@deffnx {} BFD_RELOC_PPC_DTPREL -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16 -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_LO -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_HI -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_HA -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16 -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_LO -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_HI -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_HA -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16 -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_LO -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_HI -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_HA -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16 -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_LO -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_HI -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_HA -@deffnx {} BFD_RELOC_PPC64_TPREL16_DS -@deffnx {} BFD_RELOC_PPC64_TPREL16_LO_DS -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHER -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHERA -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHEST -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHESTA -@deffnx {} BFD_RELOC_PPC64_DTPREL16_DS -@deffnx {} BFD_RELOC_PPC64_DTPREL16_LO_DS -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHER -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHERA -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHEST -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHESTA -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGH -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHA -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGH -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHA -PowerPC and PowerPC64 thread-local storage relocations. -@end deffn -@deffn {} BFD_RELOC_I370_D12 -IBM 370/390 relocations -@end deffn -@deffn {} BFD_RELOC_CTOR -The type of reloc used to build a constructor table - at the moment -probably a 32 bit wide absolute relocation, but the target can choose. -It generally does map to one of the other relocation types. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_BRANCH -ARM 26 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_BLX -ARM 26 bit pc-relative branch. The lowest bit must be zero and is -not stored in the instruction. The 2nd lowest bit comes from a 1 bit -field in the instruction. -@end deffn -@deffn {} BFD_RELOC_THUMB_PCREL_BLX -Thumb 22 bit pc-relative branch. The lowest bit must be zero and is -not stored in the instruction. The 2nd lowest bit comes from a 1 bit -field in the instruction. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_CALL -ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_JUMP -ARM 26-bit pc-relative branch for B or conditional BL instruction. -@end deffn -@deffn {} BFD_RELOC_THUMB_PCREL_BRANCH7 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH9 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH12 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH20 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH23 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH25 -Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. -The lowest bit must be zero and is not stored in the instruction. -Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an -"nn" one smaller in all cases. Note further that BRANCH23 -corresponds to R_ARM_THM_CALL. -@end deffn -@deffn {} BFD_RELOC_ARM_OFFSET_IMM -12-bit immediate offset, used in ARM-format ldr and str instructions. -@end deffn -@deffn {} BFD_RELOC_ARM_THUMB_OFFSET -5-bit immediate offset, used in Thumb-format ldr and str instructions. -@end deffn -@deffn {} BFD_RELOC_ARM_TARGET1 -Pc-relative or absolute relocation depending on target. Used for -entries in .init_array sections. -@end deffn -@deffn {} BFD_RELOC_ARM_ROSEGREL32 -Read-only segment base relative address. -@end deffn -@deffn {} BFD_RELOC_ARM_SBREL32 -Data segment base relative address. -@end deffn -@deffn {} BFD_RELOC_ARM_TARGET2 -This reloc is used for references to RTTI data from exception handling -tables. The actual definition depends on the target. It may be a -pc-relative or some form of GOT-indirect relocation. -@end deffn -@deffn {} BFD_RELOC_ARM_PREL31 -31-bit PC relative address. -@end deffn -@deffn {} BFD_RELOC_ARM_MOVW -@deffnx {} BFD_RELOC_ARM_MOVT -@deffnx {} BFD_RELOC_ARM_MOVW_PCREL -@deffnx {} BFD_RELOC_ARM_MOVT_PCREL -@deffnx {} BFD_RELOC_ARM_THUMB_MOVW -@deffnx {} BFD_RELOC_ARM_THUMB_MOVT -@deffnx {} BFD_RELOC_ARM_THUMB_MOVW_PCREL -@deffnx {} BFD_RELOC_ARM_THUMB_MOVT_PCREL -Low and High halfword relocations for MOVW and MOVT instructions. -@end deffn -@deffn {} BFD_RELOC_ARM_JUMP_SLOT -@deffnx {} BFD_RELOC_ARM_GLOB_DAT -@deffnx {} BFD_RELOC_ARM_GOT32 -@deffnx {} BFD_RELOC_ARM_PLT32 -@deffnx {} BFD_RELOC_ARM_RELATIVE -@deffnx {} BFD_RELOC_ARM_GOTOFF -@deffnx {} BFD_RELOC_ARM_GOTPC -@deffnx {} BFD_RELOC_ARM_GOT_PREL -Relocations for setting up GOTs and PLTs for shared libraries. -@end deffn -@deffn {} BFD_RELOC_ARM_TLS_GD32 -@deffnx {} BFD_RELOC_ARM_TLS_LDO32 -@deffnx {} BFD_RELOC_ARM_TLS_LDM32 -@deffnx {} BFD_RELOC_ARM_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_ARM_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_ARM_TLS_TPOFF32 -@deffnx {} BFD_RELOC_ARM_TLS_IE32 -@deffnx {} BFD_RELOC_ARM_TLS_LE32 -@deffnx {} BFD_RELOC_ARM_TLS_GOTDESC -@deffnx {} BFD_RELOC_ARM_TLS_CALL -@deffnx {} BFD_RELOC_ARM_THM_TLS_CALL -@deffnx {} BFD_RELOC_ARM_TLS_DESCSEQ -@deffnx {} BFD_RELOC_ARM_THM_TLS_DESCSEQ -@deffnx {} BFD_RELOC_ARM_TLS_DESC -ARM thread-local storage relocations. -@end deffn -@deffn {} BFD_RELOC_ARM_ALU_PC_G0_NC -@deffnx {} BFD_RELOC_ARM_ALU_PC_G0 -@deffnx {} BFD_RELOC_ARM_ALU_PC_G1_NC -@deffnx {} BFD_RELOC_ARM_ALU_PC_G1 -@deffnx {} BFD_RELOC_ARM_ALU_PC_G2 -@deffnx {} BFD_RELOC_ARM_LDR_PC_G0 -@deffnx {} BFD_RELOC_ARM_LDR_PC_G1 -@deffnx {} BFD_RELOC_ARM_LDR_PC_G2 -@deffnx {} BFD_RELOC_ARM_LDRS_PC_G0 -@deffnx {} BFD_RELOC_ARM_LDRS_PC_G1 -@deffnx {} BFD_RELOC_ARM_LDRS_PC_G2 -@deffnx {} BFD_RELOC_ARM_LDC_PC_G0 -@deffnx {} BFD_RELOC_ARM_LDC_PC_G1 -@deffnx {} BFD_RELOC_ARM_LDC_PC_G2 -@deffnx {} BFD_RELOC_ARM_ALU_SB_G0_NC -@deffnx {} BFD_RELOC_ARM_ALU_SB_G0 -@deffnx {} BFD_RELOC_ARM_ALU_SB_G1_NC -@deffnx {} BFD_RELOC_ARM_ALU_SB_G1 -@deffnx {} BFD_RELOC_ARM_ALU_SB_G2 -@deffnx {} BFD_RELOC_ARM_LDR_SB_G0 -@deffnx {} BFD_RELOC_ARM_LDR_SB_G1 -@deffnx {} BFD_RELOC_ARM_LDR_SB_G2 -@deffnx {} BFD_RELOC_ARM_LDRS_SB_G0 -@deffnx {} BFD_RELOC_ARM_LDRS_SB_G1 -@deffnx {} BFD_RELOC_ARM_LDRS_SB_G2 -@deffnx {} BFD_RELOC_ARM_LDC_SB_G0 -@deffnx {} BFD_RELOC_ARM_LDC_SB_G1 -@deffnx {} BFD_RELOC_ARM_LDC_SB_G2 -ARM group relocations. -@end deffn -@deffn {} BFD_RELOC_ARM_V4BX -Annotation of BX instructions. -@end deffn -@deffn {} BFD_RELOC_ARM_IRELATIVE -ARM support for STT_GNU_IFUNC. -@end deffn -@deffn {} BFD_RELOC_ARM_IMMEDIATE -@deffnx {} BFD_RELOC_ARM_ADRL_IMMEDIATE -@deffnx {} BFD_RELOC_ARM_T32_IMMEDIATE -@deffnx {} BFD_RELOC_ARM_T32_ADD_IMM -@deffnx {} BFD_RELOC_ARM_T32_IMM12 -@deffnx {} BFD_RELOC_ARM_T32_ADD_PC12 -@deffnx {} BFD_RELOC_ARM_SHIFT_IMM -@deffnx {} BFD_RELOC_ARM_SMC -@deffnx {} BFD_RELOC_ARM_HVC -@deffnx {} BFD_RELOC_ARM_SWI -@deffnx {} BFD_RELOC_ARM_MULTI -@deffnx {} BFD_RELOC_ARM_CP_OFF_IMM -@deffnx {} BFD_RELOC_ARM_CP_OFF_IMM_S2 -@deffnx {} BFD_RELOC_ARM_T32_CP_OFF_IMM -@deffnx {} BFD_RELOC_ARM_T32_CP_OFF_IMM_S2 -@deffnx {} BFD_RELOC_ARM_ADR_IMM -@deffnx {} BFD_RELOC_ARM_LDR_IMM -@deffnx {} BFD_RELOC_ARM_LITERAL -@deffnx {} BFD_RELOC_ARM_IN_POOL -@deffnx {} BFD_RELOC_ARM_OFFSET_IMM8 -@deffnx {} BFD_RELOC_ARM_T32_OFFSET_U8 -@deffnx {} BFD_RELOC_ARM_T32_OFFSET_IMM -@deffnx {} BFD_RELOC_ARM_HWLITERAL -@deffnx {} BFD_RELOC_ARM_THUMB_ADD -@deffnx {} BFD_RELOC_ARM_THUMB_IMM -@deffnx {} BFD_RELOC_ARM_THUMB_SHIFT -These relocs are only used within the ARM assembler. They are not -(at present) written to any object files. -@end deffn -@deffn {} BFD_RELOC_SH_PCDISP8BY2 -@deffnx {} BFD_RELOC_SH_PCDISP12BY2 -@deffnx {} BFD_RELOC_SH_IMM3 -@deffnx {} BFD_RELOC_SH_IMM3U -@deffnx {} BFD_RELOC_SH_DISP12 -@deffnx {} BFD_RELOC_SH_DISP12BY2 -@deffnx {} BFD_RELOC_SH_DISP12BY4 -@deffnx {} BFD_RELOC_SH_DISP12BY8 -@deffnx {} BFD_RELOC_SH_DISP20 -@deffnx {} BFD_RELOC_SH_DISP20BY8 -@deffnx {} BFD_RELOC_SH_IMM4 -@deffnx {} BFD_RELOC_SH_IMM4BY2 -@deffnx {} BFD_RELOC_SH_IMM4BY4 -@deffnx {} BFD_RELOC_SH_IMM8 -@deffnx {} BFD_RELOC_SH_IMM8BY2 -@deffnx {} BFD_RELOC_SH_IMM8BY4 -@deffnx {} BFD_RELOC_SH_PCRELIMM8BY2 -@deffnx {} BFD_RELOC_SH_PCRELIMM8BY4 -@deffnx {} BFD_RELOC_SH_SWITCH16 -@deffnx {} BFD_RELOC_SH_SWITCH32 -@deffnx {} BFD_RELOC_SH_USES -@deffnx {} BFD_RELOC_SH_COUNT -@deffnx {} BFD_RELOC_SH_ALIGN -@deffnx {} BFD_RELOC_SH_CODE -@deffnx {} BFD_RELOC_SH_DATA -@deffnx {} BFD_RELOC_SH_LABEL -@deffnx {} BFD_RELOC_SH_LOOP_START -@deffnx {} BFD_RELOC_SH_LOOP_END -@deffnx {} BFD_RELOC_SH_COPY -@deffnx {} BFD_RELOC_SH_GLOB_DAT -@deffnx {} BFD_RELOC_SH_JMP_SLOT -@deffnx {} BFD_RELOC_SH_RELATIVE -@deffnx {} BFD_RELOC_SH_GOTPC -@deffnx {} BFD_RELOC_SH_GOT_LOW16 -@deffnx {} BFD_RELOC_SH_GOT_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOT_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOT_HI16 -@deffnx {} BFD_RELOC_SH_GOTPLT_LOW16 -@deffnx {} BFD_RELOC_SH_GOTPLT_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOTPLT_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOTPLT_HI16 -@deffnx {} BFD_RELOC_SH_PLT_LOW16 -@deffnx {} BFD_RELOC_SH_PLT_MEDLOW16 -@deffnx {} BFD_RELOC_SH_PLT_MEDHI16 -@deffnx {} BFD_RELOC_SH_PLT_HI16 -@deffnx {} BFD_RELOC_SH_GOTOFF_LOW16 -@deffnx {} BFD_RELOC_SH_GOTOFF_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOTOFF_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOTOFF_HI16 -@deffnx {} BFD_RELOC_SH_GOTPC_LOW16 -@deffnx {} BFD_RELOC_SH_GOTPC_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOTPC_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOTPC_HI16 -@deffnx {} BFD_RELOC_SH_COPY64 -@deffnx {} BFD_RELOC_SH_GLOB_DAT64 -@deffnx {} BFD_RELOC_SH_JMP_SLOT64 -@deffnx {} BFD_RELOC_SH_RELATIVE64 -@deffnx {} BFD_RELOC_SH_GOT10BY4 -@deffnx {} BFD_RELOC_SH_GOT10BY8 -@deffnx {} BFD_RELOC_SH_GOTPLT10BY4 -@deffnx {} BFD_RELOC_SH_GOTPLT10BY8 -@deffnx {} BFD_RELOC_SH_GOTPLT32 -@deffnx {} BFD_RELOC_SH_SHMEDIA_CODE -@deffnx {} BFD_RELOC_SH_IMMU5 -@deffnx {} BFD_RELOC_SH_IMMS6 -@deffnx {} BFD_RELOC_SH_IMMS6BY32 -@deffnx {} BFD_RELOC_SH_IMMU6 -@deffnx {} BFD_RELOC_SH_IMMS10 -@deffnx {} BFD_RELOC_SH_IMMS10BY2 -@deffnx {} BFD_RELOC_SH_IMMS10BY4 -@deffnx {} BFD_RELOC_SH_IMMS10BY8 -@deffnx {} BFD_RELOC_SH_IMMS16 -@deffnx {} BFD_RELOC_SH_IMMU16 -@deffnx {} BFD_RELOC_SH_IMM_LOW16 -@deffnx {} BFD_RELOC_SH_IMM_LOW16_PCREL -@deffnx {} BFD_RELOC_SH_IMM_MEDLOW16 -@deffnx {} BFD_RELOC_SH_IMM_MEDLOW16_PCREL -@deffnx {} BFD_RELOC_SH_IMM_MEDHI16 -@deffnx {} BFD_RELOC_SH_IMM_MEDHI16_PCREL -@deffnx {} BFD_RELOC_SH_IMM_HI16 -@deffnx {} BFD_RELOC_SH_IMM_HI16_PCREL -@deffnx {} BFD_RELOC_SH_PT_16 -@deffnx {} BFD_RELOC_SH_TLS_GD_32 -@deffnx {} BFD_RELOC_SH_TLS_LD_32 -@deffnx {} BFD_RELOC_SH_TLS_LDO_32 -@deffnx {} BFD_RELOC_SH_TLS_IE_32 -@deffnx {} BFD_RELOC_SH_TLS_LE_32 -@deffnx {} BFD_RELOC_SH_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_SH_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_SH_TLS_TPOFF32 -@deffnx {} BFD_RELOC_SH_GOT20 -@deffnx {} BFD_RELOC_SH_GOTOFF20 -@deffnx {} BFD_RELOC_SH_GOTFUNCDESC -@deffnx {} BFD_RELOC_SH_GOTFUNCDESC20 -@deffnx {} BFD_RELOC_SH_GOTOFFFUNCDESC -@deffnx {} BFD_RELOC_SH_GOTOFFFUNCDESC20 -@deffnx {} BFD_RELOC_SH_FUNCDESC -Renesas / SuperH SH relocs. Not all of these appear in object files. -@end deffn -@deffn {} BFD_RELOC_ARC_B22_PCREL -ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. -@end deffn -@deffn {} BFD_RELOC_ARC_B26 -ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. -@end deffn -@deffn {} BFD_RELOC_BFIN_16_IMM -ADI Blackfin 16 bit immediate absolute reloc. -@end deffn -@deffn {} BFD_RELOC_BFIN_16_HIGH -ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. -@end deffn -@deffn {} BFD_RELOC_BFIN_4_PCREL -ADI Blackfin 'a' part of LSETUP. -@end deffn -@deffn {} BFD_RELOC_BFIN_5_PCREL -ADI Blackfin. -@end deffn -@deffn {} BFD_RELOC_BFIN_16_LOW -ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. -@end deffn -@deffn {} BFD_RELOC_BFIN_10_PCREL -ADI Blackfin. -@end deffn -@deffn {} BFD_RELOC_BFIN_11_PCREL -ADI Blackfin 'b' part of LSETUP. -@end deffn -@deffn {} BFD_RELOC_BFIN_12_PCREL_JUMP -ADI Blackfin. -@end deffn -@deffn {} BFD_RELOC_BFIN_12_PCREL_JUMP_S -ADI Blackfin Short jump, pcrel. -@end deffn -@deffn {} BFD_RELOC_BFIN_24_PCREL_CALL_X -ADI Blackfin Call.x not implemented. -@end deffn -@deffn {} BFD_RELOC_BFIN_24_PCREL_JUMP_L -ADI Blackfin Long Jump pcrel. -@end deffn -@deffn {} BFD_RELOC_BFIN_GOT17M4 -@deffnx {} BFD_RELOC_BFIN_GOTHI -@deffnx {} BFD_RELOC_BFIN_GOTLO -@deffnx {} BFD_RELOC_BFIN_FUNCDESC -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOT17M4 -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTHI -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTLO -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_VALUE -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4 -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO -@deffnx {} BFD_RELOC_BFIN_GOTOFF17M4 -@deffnx {} BFD_RELOC_BFIN_GOTOFFHI -@deffnx {} BFD_RELOC_BFIN_GOTOFFLO -ADI Blackfin FD-PIC relocations. -@end deffn -@deffn {} BFD_RELOC_BFIN_GOT -ADI Blackfin GOT relocation. -@end deffn -@deffn {} BFD_RELOC_BFIN_PLTPC -ADI Blackfin PLTPC relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_PUSH -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_CONST -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_ADD -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_SUB -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_MULT -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_DIV -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_MOD -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LSHIFT -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_RSHIFT -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_AND -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_OR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_XOR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LAND -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LOR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LEN -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_NEG -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_COMP -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_PAGE -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_HWPAGE -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_ADDR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_RELOC_D10V_10_PCREL_R -Mitsubishi D10V relocs. -This is a 10-bit reloc with the right 2 bits -assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D10V_10_PCREL_L -Mitsubishi D10V relocs. -This is a 10-bit reloc with the right 2 bits -assumed to be 0. This is the same as the previous reloc -except it is in the left container, i.e., -shifted left 15 bits. -@end deffn -@deffn {} BFD_RELOC_D10V_18 -This is an 18-bit reloc with the right 2 bits -assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D10V_18_PCREL -This is an 18-bit reloc with the right 2 bits -assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_6 -Mitsubishi D30V relocs. -This is a 6-bit absolute reloc. -@end deffn -@deffn {} BFD_RELOC_D30V_9_PCREL -This is a 6-bit pc-relative reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_9_PCREL_R -This is a 6-bit pc-relative reloc with -the right 3 bits assumed to be 0. Same -as the previous reloc but on the right side -of the container. -@end deffn -@deffn {} BFD_RELOC_D30V_15 -This is a 12-bit absolute reloc with the -right 3 bitsassumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_15_PCREL -This is a 12-bit pc-relative reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_15_PCREL_R -This is a 12-bit pc-relative reloc with -the right 3 bits assumed to be 0. Same -as the previous reloc but on the right side -of the container. -@end deffn -@deffn {} BFD_RELOC_D30V_21 -This is an 18-bit absolute reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_21_PCREL -This is an 18-bit pc-relative reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_21_PCREL_R -This is an 18-bit pc-relative reloc with -the right 3 bits assumed to be 0. Same -as the previous reloc but on the right side -of the container. -@end deffn -@deffn {} BFD_RELOC_D30V_32 -This is a 32-bit absolute reloc. -@end deffn -@deffn {} BFD_RELOC_D30V_32_PCREL -This is a 32-bit pc-relative reloc. -@end deffn -@deffn {} BFD_RELOC_DLX_HI16_S -DLX relocs -@end deffn -@deffn {} BFD_RELOC_DLX_LO16 -DLX relocs -@end deffn -@deffn {} BFD_RELOC_DLX_JMP26 -DLX relocs -@end deffn -@deffn {} BFD_RELOC_M32C_HI8 -@deffnx {} BFD_RELOC_M32C_RL_JUMP -@deffnx {} BFD_RELOC_M32C_RL_1ADDR -@deffnx {} BFD_RELOC_M32C_RL_2ADDR -Renesas M16C/M32C Relocations. -@end deffn -@deffn {} BFD_RELOC_M32R_24 -Renesas M32R (formerly Mitsubishi M32R) relocs. -This is a 24 bit absolute address. -@end deffn -@deffn {} BFD_RELOC_M32R_10_PCREL -This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_M32R_18_PCREL -This is an 18-bit reloc with the right 2 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_M32R_26_PCREL -This is a 26-bit reloc with the right 2 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_M32R_HI16_ULO -This is a 16-bit reloc containing the high 16 bits of an address -used when the lower 16 bits are treated as unsigned. -@end deffn -@deffn {} BFD_RELOC_M32R_HI16_SLO -This is a 16-bit reloc containing the high 16 bits of an address -used when the lower 16 bits are treated as signed. -@end deffn -@deffn {} BFD_RELOC_M32R_LO16 -This is a 16-bit reloc containing the lower 16 bits of an address. -@end deffn -@deffn {} BFD_RELOC_M32R_SDA16 -This is a 16-bit reloc containing the small data area offset for use in -add3, load, and store instructions. -@end deffn -@deffn {} BFD_RELOC_M32R_GOT24 -@deffnx {} BFD_RELOC_M32R_26_PLTREL -@deffnx {} BFD_RELOC_M32R_COPY -@deffnx {} BFD_RELOC_M32R_GLOB_DAT -@deffnx {} BFD_RELOC_M32R_JMP_SLOT -@deffnx {} BFD_RELOC_M32R_RELATIVE -@deffnx {} BFD_RELOC_M32R_GOTOFF -@deffnx {} BFD_RELOC_M32R_GOTOFF_HI_ULO -@deffnx {} BFD_RELOC_M32R_GOTOFF_HI_SLO -@deffnx {} BFD_RELOC_M32R_GOTOFF_LO -@deffnx {} BFD_RELOC_M32R_GOTPC24 -@deffnx {} BFD_RELOC_M32R_GOT16_HI_ULO -@deffnx {} BFD_RELOC_M32R_GOT16_HI_SLO -@deffnx {} BFD_RELOC_M32R_GOT16_LO -@deffnx {} BFD_RELOC_M32R_GOTPC_HI_ULO -@deffnx {} BFD_RELOC_M32R_GOTPC_HI_SLO -@deffnx {} BFD_RELOC_M32R_GOTPC_LO -For PIC. -@end deffn -@deffn {} BFD_RELOC_V850_9_PCREL -This is a 9-bit reloc -@end deffn -@deffn {} BFD_RELOC_V850_22_PCREL -This is a 22-bit reloc -@end deffn -@deffn {} BFD_RELOC_V850_SDA_16_16_OFFSET -This is a 16 bit offset from the short data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_SDA_15_16_OFFSET -This is a 16 bit offset (of which only 15 bits are used) from the -short data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_ZDA_16_16_OFFSET -This is a 16 bit offset from the zero data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_ZDA_15_16_OFFSET -This is a 16 bit offset (of which only 15 bits are used) from the -zero data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_6_8_OFFSET -This is an 8 bit offset (of which only 6 bits are used) from the -tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_7_8_OFFSET -This is an 8bit offset (of which only 7 bits are used) from the tiny -data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_7_7_OFFSET -This is a 7 bit offset from the tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_16_16_OFFSET -This is a 16 bit offset from the tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_4_5_OFFSET -This is a 5 bit offset (of which only 4 bits are used) from the tiny -data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_4_4_OFFSET -This is a 4 bit offset from the tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET -This is a 16 bit offset from the short data area pointer, with the -bits placed non-contiguously in the instruction. -@end deffn -@deffn {} BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET -This is a 16 bit offset from the zero data area pointer, with the -bits placed non-contiguously in the instruction. -@end deffn -@deffn {} BFD_RELOC_V850_CALLT_6_7_OFFSET -This is a 6 bit offset from the call table base pointer. -@end deffn -@deffn {} BFD_RELOC_V850_CALLT_16_16_OFFSET -This is a 16 bit offset from the call table base pointer. -@end deffn -@deffn {} BFD_RELOC_V850_LONGCALL -Used for relaxing indirect function calls. -@end deffn -@deffn {} BFD_RELOC_V850_LONGJUMP -Used for relaxing indirect jumps. -@end deffn -@deffn {} BFD_RELOC_V850_ALIGN -Used to maintain alignment whilst relaxing. -@end deffn -@deffn {} BFD_RELOC_V850_LO16_SPLIT_OFFSET -This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu -instructions. -@end deffn -@deffn {} BFD_RELOC_V850_16_PCREL -This is a 16-bit reloc. -@end deffn -@deffn {} BFD_RELOC_V850_17_PCREL -This is a 17-bit reloc. -@end deffn -@deffn {} BFD_RELOC_V850_23 -This is a 23-bit reloc. -@end deffn -@deffn {} BFD_RELOC_V850_32_PCREL -This is a 32-bit reloc. -@end deffn -@deffn {} BFD_RELOC_V850_32_ABS -This is a 32-bit reloc. -@end deffn -@deffn {} BFD_RELOC_V850_16_SPLIT_OFFSET -This is a 16-bit reloc. -@end deffn -@deffn {} BFD_RELOC_V850_16_S1 -This is a 16-bit reloc. -@end deffn -@deffn {} BFD_RELOC_V850_LO16_S1 -Low 16 bits. 16 bit shifted by 1. -@end deffn -@deffn {} BFD_RELOC_V850_CALLT_15_16_OFFSET -This is a 16 bit offset from the call table base pointer. -@end deffn -@deffn {} BFD_RELOC_V850_32_GOTPCREL -DSO relocations. -@end deffn -@deffn {} BFD_RELOC_V850_16_GOT -DSO relocations. -@end deffn -@deffn {} BFD_RELOC_V850_32_GOT -DSO relocations. -@end deffn -@deffn {} BFD_RELOC_V850_22_PLT_PCREL -DSO relocations. -@end deffn -@deffn {} BFD_RELOC_V850_32_PLT_PCREL -DSO relocations. -@end deffn -@deffn {} BFD_RELOC_V850_COPY -DSO relocations. -@end deffn -@deffn {} BFD_RELOC_V850_GLOB_DAT -DSO relocations. -@end deffn -@deffn {} BFD_RELOC_V850_JMP_SLOT -DSO relocations. -@end deffn -@deffn {} BFD_RELOC_V850_RELATIVE -DSO relocations. -@end deffn -@deffn {} BFD_RELOC_V850_16_GOTOFF -DSO relocations. -@end deffn -@deffn {} BFD_RELOC_V850_32_GOTOFF -DSO relocations. -@end deffn -@deffn {} BFD_RELOC_V850_CODE -start code. -@end deffn -@deffn {} BFD_RELOC_V850_DATA -start data in text. -@end deffn -@deffn {} BFD_RELOC_TIC30_LDP -This is a 8bit DP reloc for the tms320c30, where the most -significant 8 bits of a 24 bit word are placed into the least -significant 8 bits of the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_PARTLS7 -This is a 7bit reloc for the tms320c54x, where the least -significant 7 bits of a 16 bit word are placed into the least -significant 7 bits of the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_PARTMS9 -This is a 9bit DP reloc for the tms320c54x, where the most -significant 9 bits of a 16 bit word are placed into the least -significant 9 bits of the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_23 -This is an extended address 23-bit reloc for the tms320c54x. -@end deffn -@deffn {} BFD_RELOC_TIC54X_16_OF_23 -This is a 16-bit reloc for the tms320c54x, where the least -significant 16 bits of a 23-bit extended address are placed into -the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_MS7_OF_23 -This is a reloc for the tms320c54x, where the most -significant 7 bits of a 23-bit extended address are placed into -the opcode. -@end deffn -@deffn {} BFD_RELOC_C6000_PCR_S21 -@deffnx {} BFD_RELOC_C6000_PCR_S12 -@deffnx {} BFD_RELOC_C6000_PCR_S10 -@deffnx {} BFD_RELOC_C6000_PCR_S7 -@deffnx {} BFD_RELOC_C6000_ABS_S16 -@deffnx {} BFD_RELOC_C6000_ABS_L16 -@deffnx {} BFD_RELOC_C6000_ABS_H16 -@deffnx {} BFD_RELOC_C6000_SBR_U15_B -@deffnx {} BFD_RELOC_C6000_SBR_U15_H -@deffnx {} BFD_RELOC_C6000_SBR_U15_W -@deffnx {} BFD_RELOC_C6000_SBR_S16 -@deffnx {} BFD_RELOC_C6000_SBR_L16_B -@deffnx {} BFD_RELOC_C6000_SBR_L16_H -@deffnx {} BFD_RELOC_C6000_SBR_L16_W -@deffnx {} BFD_RELOC_C6000_SBR_H16_B -@deffnx {} BFD_RELOC_C6000_SBR_H16_H -@deffnx {} BFD_RELOC_C6000_SBR_H16_W -@deffnx {} BFD_RELOC_C6000_SBR_GOT_U15_W -@deffnx {} BFD_RELOC_C6000_SBR_GOT_L16_W -@deffnx {} BFD_RELOC_C6000_SBR_GOT_H16_W -@deffnx {} BFD_RELOC_C6000_DSBT_INDEX -@deffnx {} BFD_RELOC_C6000_PREL31 -@deffnx {} BFD_RELOC_C6000_COPY -@deffnx {} BFD_RELOC_C6000_JUMP_SLOT -@deffnx {} BFD_RELOC_C6000_EHTYPE -@deffnx {} BFD_RELOC_C6000_PCR_H16 -@deffnx {} BFD_RELOC_C6000_PCR_L16 -@deffnx {} BFD_RELOC_C6000_ALIGN -@deffnx {} BFD_RELOC_C6000_FPHEAD -@deffnx {} BFD_RELOC_C6000_NOCMP -TMS320C6000 relocations. -@end deffn -@deffn {} BFD_RELOC_FR30_48 -This is a 48 bit reloc for the FR30 that stores 32 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_20 -This is a 32 bit reloc for the FR30 that stores 20 bits split up into -two sections. -@end deffn -@deffn {} BFD_RELOC_FR30_6_IN_4 -This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in -4 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_8_IN_8 -This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset -into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_9_IN_8 -This is a 16 bit reloc for the FR30 that stores a 9 bit short offset -into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_10_IN_8 -This is a 16 bit reloc for the FR30 that stores a 10 bit word offset -into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_9_PCREL -This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative -short offset into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_12_PCREL -This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative -short offset into 11 bits. -@end deffn -@deffn {} BFD_RELOC_MCORE_PCREL_IMM8BY4 -@deffnx {} BFD_RELOC_MCORE_PCREL_IMM11BY2 -@deffnx {} BFD_RELOC_MCORE_PCREL_IMM4BY2 -@deffnx {} BFD_RELOC_MCORE_PCREL_32 -@deffnx {} BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2 -@deffnx {} BFD_RELOC_MCORE_RVA -Motorola Mcore relocations. -@end deffn -@deffn {} BFD_RELOC_MEP_8 -@deffnx {} BFD_RELOC_MEP_16 -@deffnx {} BFD_RELOC_MEP_32 -@deffnx {} BFD_RELOC_MEP_PCREL8A2 -@deffnx {} BFD_RELOC_MEP_PCREL12A2 -@deffnx {} BFD_RELOC_MEP_PCREL17A2 -@deffnx {} BFD_RELOC_MEP_PCREL24A2 -@deffnx {} BFD_RELOC_MEP_PCABS24A2 -@deffnx {} BFD_RELOC_MEP_LOW16 -@deffnx {} BFD_RELOC_MEP_HI16U -@deffnx {} BFD_RELOC_MEP_HI16S -@deffnx {} BFD_RELOC_MEP_GPREL -@deffnx {} BFD_RELOC_MEP_TPREL -@deffnx {} BFD_RELOC_MEP_TPREL7 -@deffnx {} BFD_RELOC_MEP_TPREL7A2 -@deffnx {} BFD_RELOC_MEP_TPREL7A4 -@deffnx {} BFD_RELOC_MEP_UIMM24 -@deffnx {} BFD_RELOC_MEP_ADDR24A4 -@deffnx {} BFD_RELOC_MEP_GNU_VTINHERIT -@deffnx {} BFD_RELOC_MEP_GNU_VTENTRY -Toshiba Media Processor Relocations. -@end deffn -@deffn {} BFD_RELOC_METAG_HIADDR16 -@deffnx {} BFD_RELOC_METAG_LOADDR16 -@deffnx {} BFD_RELOC_METAG_RELBRANCH -@deffnx {} BFD_RELOC_METAG_GETSETOFF -@deffnx {} BFD_RELOC_METAG_HIOG -@deffnx {} BFD_RELOC_METAG_LOOG -@deffnx {} BFD_RELOC_METAG_REL8 -@deffnx {} BFD_RELOC_METAG_REL16 -@deffnx {} BFD_RELOC_METAG_HI16_GOTOFF -@deffnx {} BFD_RELOC_METAG_LO16_GOTOFF -@deffnx {} BFD_RELOC_METAG_GETSET_GOTOFF -@deffnx {} BFD_RELOC_METAG_GETSET_GOT -@deffnx {} BFD_RELOC_METAG_HI16_GOTPC -@deffnx {} BFD_RELOC_METAG_LO16_GOTPC -@deffnx {} BFD_RELOC_METAG_HI16_PLT -@deffnx {} BFD_RELOC_METAG_LO16_PLT -@deffnx {} BFD_RELOC_METAG_RELBRANCH_PLT -@deffnx {} BFD_RELOC_METAG_GOTOFF -@deffnx {} BFD_RELOC_METAG_PLT -@deffnx {} BFD_RELOC_METAG_COPY -@deffnx {} BFD_RELOC_METAG_JMP_SLOT -@deffnx {} BFD_RELOC_METAG_RELATIVE -@deffnx {} BFD_RELOC_METAG_GLOB_DAT -@deffnx {} BFD_RELOC_METAG_TLS_GD -@deffnx {} BFD_RELOC_METAG_TLS_LDM -@deffnx {} BFD_RELOC_METAG_TLS_LDO_HI16 -@deffnx {} BFD_RELOC_METAG_TLS_LDO_LO16 -@deffnx {} BFD_RELOC_METAG_TLS_LDO -@deffnx {} BFD_RELOC_METAG_TLS_IE -@deffnx {} BFD_RELOC_METAG_TLS_IENONPIC -@deffnx {} BFD_RELOC_METAG_TLS_IENONPIC_HI16 -@deffnx {} BFD_RELOC_METAG_TLS_IENONPIC_LO16 -@deffnx {} BFD_RELOC_METAG_TLS_TPOFF -@deffnx {} BFD_RELOC_METAG_TLS_DTPMOD -@deffnx {} BFD_RELOC_METAG_TLS_DTPOFF -@deffnx {} BFD_RELOC_METAG_TLS_LE -@deffnx {} BFD_RELOC_METAG_TLS_LE_HI16 -@deffnx {} BFD_RELOC_METAG_TLS_LE_LO16 -Imagination Technologies Meta relocations. -@end deffn -@deffn {} BFD_RELOC_MMIX_GETA -@deffnx {} BFD_RELOC_MMIX_GETA_1 -@deffnx {} BFD_RELOC_MMIX_GETA_2 -@deffnx {} BFD_RELOC_MMIX_GETA_3 -These are relocations for the GETA instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_CBRANCH -@deffnx {} BFD_RELOC_MMIX_CBRANCH_J -@deffnx {} BFD_RELOC_MMIX_CBRANCH_1 -@deffnx {} BFD_RELOC_MMIX_CBRANCH_2 -@deffnx {} BFD_RELOC_MMIX_CBRANCH_3 -These are relocations for a conditional branch instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_PUSHJ -@deffnx {} BFD_RELOC_MMIX_PUSHJ_1 -@deffnx {} BFD_RELOC_MMIX_PUSHJ_2 -@deffnx {} BFD_RELOC_MMIX_PUSHJ_3 -@deffnx {} BFD_RELOC_MMIX_PUSHJ_STUBBABLE -These are relocations for the PUSHJ instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_JMP -@deffnx {} BFD_RELOC_MMIX_JMP_1 -@deffnx {} BFD_RELOC_MMIX_JMP_2 -@deffnx {} BFD_RELOC_MMIX_JMP_3 -These are relocations for the JMP instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_ADDR19 -This is a relocation for a relative address as in a GETA instruction or -a branch. -@end deffn -@deffn {} BFD_RELOC_MMIX_ADDR27 -This is a relocation for a relative address as in a JMP instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_REG_OR_BYTE -This is a relocation for an instruction field that may be a general -register or a value 0..255. -@end deffn -@deffn {} BFD_RELOC_MMIX_REG -This is a relocation for an instruction field that may be a general -register. -@end deffn -@deffn {} BFD_RELOC_MMIX_BASE_PLUS_OFFSET -This is a relocation for two instruction fields holding a register and -an offset, the equivalent of the relocation. -@end deffn -@deffn {} BFD_RELOC_MMIX_LOCAL -This relocation is an assertion that the expression is not allocated as -a global register. It does not modify contents. -@end deffn -@deffn {} BFD_RELOC_AVR_7_PCREL -This is a 16 bit reloc for the AVR that stores 8 bit pc relative -short offset into 7 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_13_PCREL -This is a 16 bit reloc for the AVR that stores 13 bit pc relative -short offset into 12 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_16_PM -This is a 16 bit reloc for the AVR that stores 17 bit value (usually -program memory address) into 16 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (usually -data memory address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit -of data memory address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit -of program memory address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_MS8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit -of 32 bit value) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(usually data memory address) into 8 bit immediate value of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(high 8 bit of data memory address) into 8 bit immediate value of -SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(most high 8 bit of program memory address) into 8 bit immediate value -of LDI or SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_MS8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb -of 32 bit value) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI_PM -This is a 16 bit reloc for the AVR that stores 8 bit value (usually -command address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI_GS -This is a 16 bit reloc for the AVR that stores 8 bit value -(command address) into 8 bit immediate value of LDI insn. If the address -is beyond the 128k boundary, the linker inserts a jump stub for this reloc -in the lower 128k. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI_PM -This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit -of command address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI_GS -This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit -of command address) into 8 bit immediate value of LDI insn. If the address -is beyond the 128k boundary, the linker inserts a jump stub for this reloc -below 128k. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI_PM -This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit -of command address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI_PM_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(usually command address) into 8 bit immediate value of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI_PM_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(high 8 bit of 16 bit command address) into 8 bit immediate value -of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI_PM_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(high 6 bit of 22 bit command address) into 8 bit immediate -value of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_CALL -This is a 32 bit reloc for the AVR that stores 23 bit value -into 22 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_LDI -This is a 16 bit reloc for the AVR that stores all needed bits -for absolute addressing with ldi with overflow check to linktime -@end deffn -@deffn {} BFD_RELOC_AVR_6 -This is a 6 bit reloc for the AVR that stores offset for ldd/std -instructions -@end deffn -@deffn {} BFD_RELOC_AVR_6_ADIW -This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw -instructions -@end deffn -@deffn {} BFD_RELOC_AVR_8_LO -This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol -in .byte lo8(symbol) -@end deffn -@deffn {} BFD_RELOC_AVR_8_HI -This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol -in .byte hi8(symbol) -@end deffn -@deffn {} BFD_RELOC_AVR_8_HLO -This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol -in .byte hlo8(symbol) -@end deffn -@deffn {} BFD_RELOC_RL78_NEG8 -@deffnx {} BFD_RELOC_RL78_NEG16 -@deffnx {} BFD_RELOC_RL78_NEG24 -@deffnx {} BFD_RELOC_RL78_NEG32 -@deffnx {} BFD_RELOC_RL78_16_OP -@deffnx {} BFD_RELOC_RL78_24_OP -@deffnx {} BFD_RELOC_RL78_32_OP -@deffnx {} BFD_RELOC_RL78_8U -@deffnx {} BFD_RELOC_RL78_16U -@deffnx {} BFD_RELOC_RL78_24U -@deffnx {} BFD_RELOC_RL78_DIR3U_PCREL -@deffnx {} BFD_RELOC_RL78_DIFF -@deffnx {} BFD_RELOC_RL78_GPRELB -@deffnx {} BFD_RELOC_RL78_GPRELW -@deffnx {} BFD_RELOC_RL78_GPRELL -@deffnx {} BFD_RELOC_RL78_SYM -@deffnx {} BFD_RELOC_RL78_OP_SUBTRACT -@deffnx {} BFD_RELOC_RL78_OP_NEG -@deffnx {} BFD_RELOC_RL78_OP_AND -@deffnx {} BFD_RELOC_RL78_OP_SHRA -@deffnx {} BFD_RELOC_RL78_ABS8 -@deffnx {} BFD_RELOC_RL78_ABS16 -@deffnx {} BFD_RELOC_RL78_ABS16_REV -@deffnx {} BFD_RELOC_RL78_ABS32 -@deffnx {} BFD_RELOC_RL78_ABS32_REV -@deffnx {} BFD_RELOC_RL78_ABS16U -@deffnx {} BFD_RELOC_RL78_ABS16UW -@deffnx {} BFD_RELOC_RL78_ABS16UL -@deffnx {} BFD_RELOC_RL78_RELAX -@deffnx {} BFD_RELOC_RL78_HI16 -@deffnx {} BFD_RELOC_RL78_HI8 -@deffnx {} BFD_RELOC_RL78_LO16 -@deffnx {} BFD_RELOC_RL78_CODE -Renesas RL78 Relocations. -@end deffn -@deffn {} BFD_RELOC_RX_NEG8 -@deffnx {} BFD_RELOC_RX_NEG16 -@deffnx {} BFD_RELOC_RX_NEG24 -@deffnx {} BFD_RELOC_RX_NEG32 -@deffnx {} BFD_RELOC_RX_16_OP -@deffnx {} BFD_RELOC_RX_24_OP -@deffnx {} BFD_RELOC_RX_32_OP -@deffnx {} BFD_RELOC_RX_8U -@deffnx {} BFD_RELOC_RX_16U -@deffnx {} BFD_RELOC_RX_24U -@deffnx {} BFD_RELOC_RX_DIR3U_PCREL -@deffnx {} BFD_RELOC_RX_DIFF -@deffnx {} BFD_RELOC_RX_GPRELB -@deffnx {} BFD_RELOC_RX_GPRELW -@deffnx {} BFD_RELOC_RX_GPRELL -@deffnx {} BFD_RELOC_RX_SYM -@deffnx {} BFD_RELOC_RX_OP_SUBTRACT -@deffnx {} BFD_RELOC_RX_OP_NEG -@deffnx {} BFD_RELOC_RX_ABS8 -@deffnx {} BFD_RELOC_RX_ABS16 -@deffnx {} BFD_RELOC_RX_ABS16_REV -@deffnx {} BFD_RELOC_RX_ABS32 -@deffnx {} BFD_RELOC_RX_ABS32_REV -@deffnx {} BFD_RELOC_RX_ABS16U -@deffnx {} BFD_RELOC_RX_ABS16UW -@deffnx {} BFD_RELOC_RX_ABS16UL -@deffnx {} BFD_RELOC_RX_RELAX -Renesas RX Relocations. -@end deffn -@deffn {} BFD_RELOC_390_12 -Direct 12 bit. -@end deffn -@deffn {} BFD_RELOC_390_GOT12 -12 bit GOT offset. -@end deffn -@deffn {} BFD_RELOC_390_PLT32 -32 bit PC relative PLT address. -@end deffn -@deffn {} BFD_RELOC_390_COPY -Copy symbol at runtime. -@end deffn -@deffn {} BFD_RELOC_390_GLOB_DAT -Create GOT entry. -@end deffn -@deffn {} BFD_RELOC_390_JMP_SLOT -Create PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_RELATIVE -Adjust by program base. -@end deffn -@deffn {} BFD_RELOC_390_GOTPC -32 bit PC relative offset to GOT. -@end deffn -@deffn {} BFD_RELOC_390_GOT16 -16 bit GOT offset. -@end deffn -@deffn {} BFD_RELOC_390_PC12DBL -PC relative 12 bit shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PLT12DBL -12 bit PC rel. PLT shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PC16DBL -PC relative 16 bit shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PLT16DBL -16 bit PC rel. PLT shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PC24DBL -PC relative 24 bit shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PLT24DBL -24 bit PC rel. PLT shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PC32DBL -PC relative 32 bit shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PLT32DBL -32 bit PC rel. PLT shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_GOTPCDBL -32 bit PC rel. GOT shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_GOT64 -64 bit GOT offset. -@end deffn -@deffn {} BFD_RELOC_390_PLT64 -64 bit PC relative PLT address. -@end deffn -@deffn {} BFD_RELOC_390_GOTENT -32 bit rel. offset to GOT entry. -@end deffn -@deffn {} BFD_RELOC_390_GOTOFF64 -64 bit offset to GOT. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT12 -12-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT16 -16-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT32 -32-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT64 -64-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLTENT -32-bit rel. offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_PLTOFF16 -16-bit rel. offset from the GOT to a PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_PLTOFF32 -32-bit rel. offset from the GOT to a PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_PLTOFF64 -64-bit rel. offset from the GOT to a PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_TLS_LOAD -@deffnx {} BFD_RELOC_390_TLS_GDCALL -@deffnx {} BFD_RELOC_390_TLS_LDCALL -@deffnx {} BFD_RELOC_390_TLS_GD32 -@deffnx {} BFD_RELOC_390_TLS_GD64 -@deffnx {} BFD_RELOC_390_TLS_GOTIE12 -@deffnx {} BFD_RELOC_390_TLS_GOTIE32 -@deffnx {} BFD_RELOC_390_TLS_GOTIE64 -@deffnx {} BFD_RELOC_390_TLS_LDM32 -@deffnx {} BFD_RELOC_390_TLS_LDM64 -@deffnx {} BFD_RELOC_390_TLS_IE32 -@deffnx {} BFD_RELOC_390_TLS_IE64 -@deffnx {} BFD_RELOC_390_TLS_IEENT -@deffnx {} BFD_RELOC_390_TLS_LE32 -@deffnx {} BFD_RELOC_390_TLS_LE64 -@deffnx {} BFD_RELOC_390_TLS_LDO32 -@deffnx {} BFD_RELOC_390_TLS_LDO64 -@deffnx {} BFD_RELOC_390_TLS_DTPMOD -@deffnx {} BFD_RELOC_390_TLS_DTPOFF -@deffnx {} BFD_RELOC_390_TLS_TPOFF -s390 tls relocations. -@end deffn -@deffn {} BFD_RELOC_390_20 -@deffnx {} BFD_RELOC_390_GOT20 -@deffnx {} BFD_RELOC_390_GOTPLT20 -@deffnx {} BFD_RELOC_390_TLS_GOTIE20 -Long displacement extension. -@end deffn -@deffn {} BFD_RELOC_390_IRELATIVE -STT_GNU_IFUNC relocation. -@end deffn -@deffn {} BFD_RELOC_SCORE_GPREL15 -Score relocations -Low 16 bit for load/store -@end deffn -@deffn {} BFD_RELOC_SCORE_DUMMY2 -@deffnx {} BFD_RELOC_SCORE_JMP -This is a 24-bit reloc with the right 1 bit assumed to be 0 -@end deffn -@deffn {} BFD_RELOC_SCORE_BRANCH -This is a 19-bit reloc with the right 1 bit assumed to be 0 -@end deffn -@deffn {} BFD_RELOC_SCORE_IMM30 -This is a 32-bit reloc for 48-bit instructions. -@end deffn -@deffn {} BFD_RELOC_SCORE_IMM32 -This is a 32-bit reloc for 48-bit instructions. -@end deffn -@deffn {} BFD_RELOC_SCORE16_JMP -This is a 11-bit reloc with the right 1 bit assumed to be 0 -@end deffn -@deffn {} BFD_RELOC_SCORE16_BRANCH -This is a 8-bit reloc with the right 1 bit assumed to be 0 -@end deffn -@deffn {} BFD_RELOC_SCORE_BCMP -This is a 9-bit reloc with the right 1 bit assumed to be 0 -@end deffn -@deffn {} BFD_RELOC_SCORE_GOT15 -@deffnx {} BFD_RELOC_SCORE_GOT_LO16 -@deffnx {} BFD_RELOC_SCORE_CALL15 -@deffnx {} BFD_RELOC_SCORE_DUMMY_HI16 -Undocumented Score relocs -@end deffn -@deffn {} BFD_RELOC_IP2K_FR9 -Scenix IP2K - 9-bit register number / data address -@end deffn -@deffn {} BFD_RELOC_IP2K_BANK -Scenix IP2K - 4-bit register/data bank number -@end deffn -@deffn {} BFD_RELOC_IP2K_ADDR16CJP -Scenix IP2K - low 13 bits of instruction word address -@end deffn -@deffn {} BFD_RELOC_IP2K_PAGE3 -Scenix IP2K - high 3 bits of instruction word address -@end deffn -@deffn {} BFD_RELOC_IP2K_LO8DATA -@deffnx {} BFD_RELOC_IP2K_HI8DATA -@deffnx {} BFD_RELOC_IP2K_EX8DATA -Scenix IP2K - ext/low/high 8 bits of data address -@end deffn -@deffn {} BFD_RELOC_IP2K_LO8INSN -@deffnx {} BFD_RELOC_IP2K_HI8INSN -Scenix IP2K - low/high 8 bits of instruction word address -@end deffn -@deffn {} BFD_RELOC_IP2K_PC_SKIP -Scenix IP2K - even/odd PC modifier to modify snb pcl.0 -@end deffn -@deffn {} BFD_RELOC_IP2K_TEXT -Scenix IP2K - 16 bit word address in text section. -@end deffn -@deffn {} BFD_RELOC_IP2K_FR_OFFSET -Scenix IP2K - 7-bit sp or dp offset -@end deffn -@deffn {} BFD_RELOC_VPE4KMATH_DATA -@deffnx {} BFD_RELOC_VPE4KMATH_INSN -Scenix VPE4K coprocessor - data/insn-space addressing -@end deffn -@deffn {} BFD_RELOC_VTABLE_INHERIT -@deffnx {} BFD_RELOC_VTABLE_ENTRY -These two relocations are used by the linker to determine which of -the entries in a C++ virtual function table are actually used. When -the --gc-sections option is given, the linker will zero out the entries -that are not used, so that the code for those functions need not be -included in the output. - -VTABLE_INHERIT is a zero-space relocation used to describe to the -linker the inheritance tree of a C++ virtual function table. The -relocation's symbol should be the parent class' vtable, and the -relocation should be located at the child vtable. - -VTABLE_ENTRY is a zero-space relocation that describes the use of a -virtual function table entry. The reloc's symbol should refer to the -table of the class mentioned in the code. Off of that base, an offset -describes the entry that is being used. For Rela hosts, this offset -is stored in the reloc's addend. For Rel hosts, we are forced to put -this offset in the reloc's section offset. -@end deffn -@deffn {} BFD_RELOC_IA64_IMM14 -@deffnx {} BFD_RELOC_IA64_IMM22 -@deffnx {} BFD_RELOC_IA64_IMM64 -@deffnx {} BFD_RELOC_IA64_DIR32MSB -@deffnx {} BFD_RELOC_IA64_DIR32LSB -@deffnx {} BFD_RELOC_IA64_DIR64MSB -@deffnx {} BFD_RELOC_IA64_DIR64LSB -@deffnx {} BFD_RELOC_IA64_GPREL22 -@deffnx {} BFD_RELOC_IA64_GPREL64I -@deffnx {} BFD_RELOC_IA64_GPREL32MSB -@deffnx {} BFD_RELOC_IA64_GPREL32LSB -@deffnx {} BFD_RELOC_IA64_GPREL64MSB -@deffnx {} BFD_RELOC_IA64_GPREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF22 -@deffnx {} BFD_RELOC_IA64_LTOFF64I -@deffnx {} BFD_RELOC_IA64_PLTOFF22 -@deffnx {} BFD_RELOC_IA64_PLTOFF64I -@deffnx {} BFD_RELOC_IA64_PLTOFF64MSB -@deffnx {} BFD_RELOC_IA64_PLTOFF64LSB -@deffnx {} BFD_RELOC_IA64_FPTR64I -@deffnx {} BFD_RELOC_IA64_FPTR32MSB -@deffnx {} BFD_RELOC_IA64_FPTR32LSB -@deffnx {} BFD_RELOC_IA64_FPTR64MSB -@deffnx {} BFD_RELOC_IA64_FPTR64LSB -@deffnx {} BFD_RELOC_IA64_PCREL21B -@deffnx {} BFD_RELOC_IA64_PCREL21BI -@deffnx {} BFD_RELOC_IA64_PCREL21M -@deffnx {} BFD_RELOC_IA64_PCREL21F -@deffnx {} BFD_RELOC_IA64_PCREL22 -@deffnx {} BFD_RELOC_IA64_PCREL60B -@deffnx {} BFD_RELOC_IA64_PCREL64I -@deffnx {} BFD_RELOC_IA64_PCREL32MSB -@deffnx {} BFD_RELOC_IA64_PCREL32LSB -@deffnx {} BFD_RELOC_IA64_PCREL64MSB -@deffnx {} BFD_RELOC_IA64_PCREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR22 -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64I -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR32MSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR32LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64MSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64LSB -@deffnx {} BFD_RELOC_IA64_SEGREL32MSB -@deffnx {} BFD_RELOC_IA64_SEGREL32LSB -@deffnx {} BFD_RELOC_IA64_SEGREL64MSB -@deffnx {} BFD_RELOC_IA64_SEGREL64LSB -@deffnx {} BFD_RELOC_IA64_SECREL32MSB -@deffnx {} BFD_RELOC_IA64_SECREL32LSB -@deffnx {} BFD_RELOC_IA64_SECREL64MSB -@deffnx {} BFD_RELOC_IA64_SECREL64LSB -@deffnx {} BFD_RELOC_IA64_REL32MSB -@deffnx {} BFD_RELOC_IA64_REL32LSB -@deffnx {} BFD_RELOC_IA64_REL64MSB -@deffnx {} BFD_RELOC_IA64_REL64LSB -@deffnx {} BFD_RELOC_IA64_LTV32MSB -@deffnx {} BFD_RELOC_IA64_LTV32LSB -@deffnx {} BFD_RELOC_IA64_LTV64MSB -@deffnx {} BFD_RELOC_IA64_LTV64LSB -@deffnx {} BFD_RELOC_IA64_IPLTMSB -@deffnx {} BFD_RELOC_IA64_IPLTLSB -@deffnx {} BFD_RELOC_IA64_COPY -@deffnx {} BFD_RELOC_IA64_LTOFF22X -@deffnx {} BFD_RELOC_IA64_LDXMOV -@deffnx {} BFD_RELOC_IA64_TPREL14 -@deffnx {} BFD_RELOC_IA64_TPREL22 -@deffnx {} BFD_RELOC_IA64_TPREL64I -@deffnx {} BFD_RELOC_IA64_TPREL64MSB -@deffnx {} BFD_RELOC_IA64_TPREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_TPREL22 -@deffnx {} BFD_RELOC_IA64_DTPMOD64MSB -@deffnx {} BFD_RELOC_IA64_DTPMOD64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_DTPMOD22 -@deffnx {} BFD_RELOC_IA64_DTPREL14 -@deffnx {} BFD_RELOC_IA64_DTPREL22 -@deffnx {} BFD_RELOC_IA64_DTPREL64I -@deffnx {} BFD_RELOC_IA64_DTPREL32MSB -@deffnx {} BFD_RELOC_IA64_DTPREL32LSB -@deffnx {} BFD_RELOC_IA64_DTPREL64MSB -@deffnx {} BFD_RELOC_IA64_DTPREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_DTPREL22 -Intel IA64 Relocations. -@end deffn -@deffn {} BFD_RELOC_M68HC11_HI8 -Motorola 68HC11 reloc. -This is the 8 bit high part of an absolute address. -@end deffn -@deffn {} BFD_RELOC_M68HC11_LO8 -Motorola 68HC11 reloc. -This is the 8 bit low part of an absolute address. -@end deffn -@deffn {} BFD_RELOC_M68HC11_3B -Motorola 68HC11 reloc. -This is the 3 bit of a value. -@end deffn -@deffn {} BFD_RELOC_M68HC11_RL_JUMP -Motorola 68HC11 reloc. -This reloc marks the beginning of a jump/call instruction. -It is used for linker relaxation to correctly identify beginning -of instruction and change some branches to use PC-relative -addressing mode. -@end deffn -@deffn {} BFD_RELOC_M68HC11_RL_GROUP -Motorola 68HC11 reloc. -This reloc marks a group of several instructions that gcc generates -and for which the linker relaxation pass can modify and/or remove -some of them. -@end deffn -@deffn {} BFD_RELOC_M68HC11_LO16 -Motorola 68HC11 reloc. -This is the 16-bit lower part of an address. It is used for 'call' -instruction to specify the symbol address without any special -transformation (due to memory bank window). -@end deffn -@deffn {} BFD_RELOC_M68HC11_PAGE -Motorola 68HC11 reloc. -This is a 8-bit reloc that specifies the page number of an address. -It is used by 'call' instruction to specify the page number of -the symbol. -@end deffn -@deffn {} BFD_RELOC_M68HC11_24 -Motorola 68HC11 reloc. -This is a 24-bit reloc that represents the address with a 16-bit -value and a 8-bit page number. The symbol address is transformed -to follow the 16K memory bank of 68HC12 (seen as mapped in the window). -@end deffn -@deffn {} BFD_RELOC_M68HC12_5B -Motorola 68HC12 reloc. -This is the 5 bits of a value. -@end deffn -@deffn {} BFD_RELOC_XGATE_RL_JUMP -Freescale XGATE reloc. -This reloc marks the beginning of a bra/jal instruction. -@end deffn -@deffn {} BFD_RELOC_XGATE_RL_GROUP -Freescale XGATE reloc. -This reloc marks a group of several instructions that gcc generates -and for which the linker relaxation pass can modify and/or remove -some of them. -@end deffn -@deffn {} BFD_RELOC_XGATE_LO16 -Freescale XGATE reloc. -This is the 16-bit lower part of an address. It is used for the '16-bit' -instructions. -@end deffn -@deffn {} BFD_RELOC_XGATE_GPAGE -Freescale XGATE reloc. -@end deffn -@deffn {} BFD_RELOC_XGATE_24 -Freescale XGATE reloc. -@end deffn -@deffn {} BFD_RELOC_XGATE_PCREL_9 -Freescale XGATE reloc. -This is a 9-bit pc-relative reloc. -@end deffn -@deffn {} BFD_RELOC_XGATE_PCREL_10 -Freescale XGATE reloc. -This is a 10-bit pc-relative reloc. -@end deffn -@deffn {} BFD_RELOC_XGATE_IMM8_LO -Freescale XGATE reloc. -This is the 16-bit lower part of an address. It is used for the '16-bit' -instructions. -@end deffn -@deffn {} BFD_RELOC_XGATE_IMM8_HI -Freescale XGATE reloc. -This is the 16-bit higher part of an address. It is used for the '16-bit' -instructions. -@end deffn -@deffn {} BFD_RELOC_XGATE_IMM3 -Freescale XGATE reloc. -This is a 3-bit pc-relative reloc. -@end deffn -@deffn {} BFD_RELOC_XGATE_IMM4 -Freescale XGATE reloc. -This is a 4-bit pc-relative reloc. -@end deffn -@deffn {} BFD_RELOC_XGATE_IMM5 -Freescale XGATE reloc. -This is a 5-bit pc-relative reloc. -@end deffn -@deffn {} BFD_RELOC_M68HC12_9B -Motorola 68HC12 reloc. -This is the 9 bits of a value. -@end deffn -@deffn {} BFD_RELOC_M68HC12_16B -Motorola 68HC12 reloc. -This is the 16 bits of a value. -@end deffn -@deffn {} BFD_RELOC_M68HC12_9_PCREL -Motorola 68HC12/XGATE reloc. -This is a PCREL9 branch. -@end deffn -@deffn {} BFD_RELOC_M68HC12_10_PCREL -Motorola 68HC12/XGATE reloc. -This is a PCREL10 branch. -@end deffn -@deffn {} BFD_RELOC_M68HC12_LO8XG -Motorola 68HC12/XGATE reloc. -This is the 8 bit low part of an absolute address and immediately precedes -a matching HI8XG part. -@end deffn -@deffn {} BFD_RELOC_M68HC12_HI8XG -Motorola 68HC12/XGATE reloc. -This is the 8 bit high part of an absolute address and immediately follows -a matching LO8XG part. -@end deffn -@deffn {} BFD_RELOC_16C_NUM08 -@deffnx {} BFD_RELOC_16C_NUM08_C -@deffnx {} BFD_RELOC_16C_NUM16 -@deffnx {} BFD_RELOC_16C_NUM16_C -@deffnx {} BFD_RELOC_16C_NUM32 -@deffnx {} BFD_RELOC_16C_NUM32_C -@deffnx {} BFD_RELOC_16C_DISP04 -@deffnx {} BFD_RELOC_16C_DISP04_C -@deffnx {} BFD_RELOC_16C_DISP08 -@deffnx {} BFD_RELOC_16C_DISP08_C -@deffnx {} BFD_RELOC_16C_DISP16 -@deffnx {} BFD_RELOC_16C_DISP16_C -@deffnx {} BFD_RELOC_16C_DISP24 -@deffnx {} BFD_RELOC_16C_DISP24_C -@deffnx {} BFD_RELOC_16C_DISP24a -@deffnx {} BFD_RELOC_16C_DISP24a_C -@deffnx {} BFD_RELOC_16C_REG04 -@deffnx {} BFD_RELOC_16C_REG04_C -@deffnx {} BFD_RELOC_16C_REG04a -@deffnx {} BFD_RELOC_16C_REG04a_C -@deffnx {} BFD_RELOC_16C_REG14 -@deffnx {} BFD_RELOC_16C_REG14_C -@deffnx {} BFD_RELOC_16C_REG16 -@deffnx {} BFD_RELOC_16C_REG16_C -@deffnx {} BFD_RELOC_16C_REG20 -@deffnx {} BFD_RELOC_16C_REG20_C -@deffnx {} BFD_RELOC_16C_ABS20 -@deffnx {} BFD_RELOC_16C_ABS20_C -@deffnx {} BFD_RELOC_16C_ABS24 -@deffnx {} BFD_RELOC_16C_ABS24_C -@deffnx {} BFD_RELOC_16C_IMM04 -@deffnx {} BFD_RELOC_16C_IMM04_C -@deffnx {} BFD_RELOC_16C_IMM16 -@deffnx {} BFD_RELOC_16C_IMM16_C -@deffnx {} BFD_RELOC_16C_IMM20 -@deffnx {} BFD_RELOC_16C_IMM20_C -@deffnx {} BFD_RELOC_16C_IMM24 -@deffnx {} BFD_RELOC_16C_IMM24_C -@deffnx {} BFD_RELOC_16C_IMM32 -@deffnx {} BFD_RELOC_16C_IMM32_C -NS CR16C Relocations. -@end deffn -@deffn {} BFD_RELOC_CR16_NUM8 -@deffnx {} BFD_RELOC_CR16_NUM16 -@deffnx {} BFD_RELOC_CR16_NUM32 -@deffnx {} BFD_RELOC_CR16_NUM32a -@deffnx {} BFD_RELOC_CR16_REGREL0 -@deffnx {} BFD_RELOC_CR16_REGREL4 -@deffnx {} BFD_RELOC_CR16_REGREL4a -@deffnx {} BFD_RELOC_CR16_REGREL14 -@deffnx {} BFD_RELOC_CR16_REGREL14a -@deffnx {} BFD_RELOC_CR16_REGREL16 -@deffnx {} BFD_RELOC_CR16_REGREL20 -@deffnx {} BFD_RELOC_CR16_REGREL20a -@deffnx {} BFD_RELOC_CR16_ABS20 -@deffnx {} BFD_RELOC_CR16_ABS24 -@deffnx {} BFD_RELOC_CR16_IMM4 -@deffnx {} BFD_RELOC_CR16_IMM8 -@deffnx {} BFD_RELOC_CR16_IMM16 -@deffnx {} BFD_RELOC_CR16_IMM20 -@deffnx {} BFD_RELOC_CR16_IMM24 -@deffnx {} BFD_RELOC_CR16_IMM32 -@deffnx {} BFD_RELOC_CR16_IMM32a -@deffnx {} BFD_RELOC_CR16_DISP4 -@deffnx {} BFD_RELOC_CR16_DISP8 -@deffnx {} BFD_RELOC_CR16_DISP16 -@deffnx {} BFD_RELOC_CR16_DISP20 -@deffnx {} BFD_RELOC_CR16_DISP24 -@deffnx {} BFD_RELOC_CR16_DISP24a -@deffnx {} BFD_RELOC_CR16_SWITCH8 -@deffnx {} BFD_RELOC_CR16_SWITCH16 -@deffnx {} BFD_RELOC_CR16_SWITCH32 -@deffnx {} BFD_RELOC_CR16_GOT_REGREL20 -@deffnx {} BFD_RELOC_CR16_GOTC_REGREL20 -@deffnx {} BFD_RELOC_CR16_GLOB_DAT -NS CR16 Relocations. -@end deffn -@deffn {} BFD_RELOC_CRX_REL4 -@deffnx {} BFD_RELOC_CRX_REL8 -@deffnx {} BFD_RELOC_CRX_REL8_CMP -@deffnx {} BFD_RELOC_CRX_REL16 -@deffnx {} BFD_RELOC_CRX_REL24 -@deffnx {} BFD_RELOC_CRX_REL32 -@deffnx {} BFD_RELOC_CRX_REGREL12 -@deffnx {} BFD_RELOC_CRX_REGREL22 -@deffnx {} BFD_RELOC_CRX_REGREL28 -@deffnx {} BFD_RELOC_CRX_REGREL32 -@deffnx {} BFD_RELOC_CRX_ABS16 -@deffnx {} BFD_RELOC_CRX_ABS32 -@deffnx {} BFD_RELOC_CRX_NUM8 -@deffnx {} BFD_RELOC_CRX_NUM16 -@deffnx {} BFD_RELOC_CRX_NUM32 -@deffnx {} BFD_RELOC_CRX_IMM16 -@deffnx {} BFD_RELOC_CRX_IMM32 -@deffnx {} BFD_RELOC_CRX_SWITCH8 -@deffnx {} BFD_RELOC_CRX_SWITCH16 -@deffnx {} BFD_RELOC_CRX_SWITCH32 -NS CRX Relocations. -@end deffn -@deffn {} BFD_RELOC_CRIS_BDISP8 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_5 -@deffnx {} BFD_RELOC_CRIS_SIGNED_6 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_6 -@deffnx {} BFD_RELOC_CRIS_SIGNED_8 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_8 -@deffnx {} BFD_RELOC_CRIS_SIGNED_16 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_16 -@deffnx {} BFD_RELOC_CRIS_LAPCQ_OFFSET -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_4 -These relocs are only used within the CRIS assembler. They are not -(at present) written to any object files. -@end deffn -@deffn {} BFD_RELOC_CRIS_COPY -@deffnx {} BFD_RELOC_CRIS_GLOB_DAT -@deffnx {} BFD_RELOC_CRIS_JUMP_SLOT -@deffnx {} BFD_RELOC_CRIS_RELATIVE -Relocs used in ELF shared libraries for CRIS. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_GOT -32-bit offset to symbol-entry within GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_16_GOT -16-bit offset to symbol-entry within GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_GOTPLT -32-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_CRIS_16_GOTPLT -16-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_GOTREL -32-bit offset to symbol, relative to GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_PLT_GOTREL -32-bit offset to symbol with PLT entry, relative to GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_PLT_PCREL -32-bit offset to symbol with PLT entry, relative to this relocation. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_GOT_GD -@deffnx {} BFD_RELOC_CRIS_16_GOT_GD -@deffnx {} BFD_RELOC_CRIS_32_GD -@deffnx {} BFD_RELOC_CRIS_DTP -@deffnx {} BFD_RELOC_CRIS_32_DTPREL -@deffnx {} BFD_RELOC_CRIS_16_DTPREL -@deffnx {} BFD_RELOC_CRIS_32_GOT_TPREL -@deffnx {} BFD_RELOC_CRIS_16_GOT_TPREL -@deffnx {} BFD_RELOC_CRIS_32_TPREL -@deffnx {} BFD_RELOC_CRIS_16_TPREL -@deffnx {} BFD_RELOC_CRIS_DTPMOD -@deffnx {} BFD_RELOC_CRIS_32_IE -Relocs used in TLS code for CRIS. -@end deffn -@deffn {} BFD_RELOC_860_COPY -@deffnx {} BFD_RELOC_860_GLOB_DAT -@deffnx {} BFD_RELOC_860_JUMP_SLOT -@deffnx {} BFD_RELOC_860_RELATIVE -@deffnx {} BFD_RELOC_860_PC26 -@deffnx {} BFD_RELOC_860_PLT26 -@deffnx {} BFD_RELOC_860_PC16 -@deffnx {} BFD_RELOC_860_LOW0 -@deffnx {} BFD_RELOC_860_SPLIT0 -@deffnx {} BFD_RELOC_860_LOW1 -@deffnx {} BFD_RELOC_860_SPLIT1 -@deffnx {} BFD_RELOC_860_LOW2 -@deffnx {} BFD_RELOC_860_SPLIT2 -@deffnx {} BFD_RELOC_860_LOW3 -@deffnx {} BFD_RELOC_860_LOGOT0 -@deffnx {} BFD_RELOC_860_SPGOT0 -@deffnx {} BFD_RELOC_860_LOGOT1 -@deffnx {} BFD_RELOC_860_SPGOT1 -@deffnx {} BFD_RELOC_860_LOGOTOFF0 -@deffnx {} BFD_RELOC_860_SPGOTOFF0 -@deffnx {} BFD_RELOC_860_LOGOTOFF1 -@deffnx {} BFD_RELOC_860_SPGOTOFF1 -@deffnx {} BFD_RELOC_860_LOGOTOFF2 -@deffnx {} BFD_RELOC_860_LOGOTOFF3 -@deffnx {} BFD_RELOC_860_LOPC -@deffnx {} BFD_RELOC_860_HIGHADJ -@deffnx {} BFD_RELOC_860_HAGOT -@deffnx {} BFD_RELOC_860_HAGOTOFF -@deffnx {} BFD_RELOC_860_HAPC -@deffnx {} BFD_RELOC_860_HIGH -@deffnx {} BFD_RELOC_860_HIGOT -@deffnx {} BFD_RELOC_860_HIGOTOFF -Intel i860 Relocations. -@end deffn -@deffn {} BFD_RELOC_OPENRISC_ABS_26 -@deffnx {} BFD_RELOC_OPENRISC_REL_26 -OpenRISC Relocations. -@end deffn -@deffn {} BFD_RELOC_H8_DIR16A8 -@deffnx {} BFD_RELOC_H8_DIR16R8 -@deffnx {} BFD_RELOC_H8_DIR24A8 -@deffnx {} BFD_RELOC_H8_DIR24R8 -@deffnx {} BFD_RELOC_H8_DIR32A16 -@deffnx {} BFD_RELOC_H8_DISP32A16 -H8 elf Relocations. -@end deffn -@deffn {} BFD_RELOC_XSTORMY16_REL_12 -@deffnx {} BFD_RELOC_XSTORMY16_12 -@deffnx {} BFD_RELOC_XSTORMY16_24 -@deffnx {} BFD_RELOC_XSTORMY16_FPTR16 -Sony Xstormy16 Relocations. -@end deffn -@deffn {} BFD_RELOC_RELC -Self-describing complex relocations. -@end deffn -@deffn {} BFD_RELOC_XC16X_PAG -@deffnx {} BFD_RELOC_XC16X_POF -@deffnx {} BFD_RELOC_XC16X_SEG -@deffnx {} BFD_RELOC_XC16X_SOF -Infineon Relocations. -@end deffn -@deffn {} BFD_RELOC_VAX_GLOB_DAT -@deffnx {} BFD_RELOC_VAX_JMP_SLOT -@deffnx {} BFD_RELOC_VAX_RELATIVE -Relocations used by VAX ELF. -@end deffn -@deffn {} BFD_RELOC_MT_PC16 -Morpho MT - 16 bit immediate relocation. -@end deffn -@deffn {} BFD_RELOC_MT_HI16 -Morpho MT - Hi 16 bits of an address. -@end deffn -@deffn {} BFD_RELOC_MT_LO16 -Morpho MT - Low 16 bits of an address. -@end deffn -@deffn {} BFD_RELOC_MT_GNU_VTINHERIT -Morpho MT - Used to tell the linker which vtable entries are used. -@end deffn -@deffn {} BFD_RELOC_MT_GNU_VTENTRY -Morpho MT - Used to tell the linker which vtable entries are used. -@end deffn -@deffn {} BFD_RELOC_MT_PCINSN8 -Morpho MT - 8 bit immediate relocation. -@end deffn -@deffn {} BFD_RELOC_MSP430_10_PCREL -@deffnx {} BFD_RELOC_MSP430_16_PCREL -@deffnx {} BFD_RELOC_MSP430_16 -@deffnx {} BFD_RELOC_MSP430_16_PCREL_BYTE -@deffnx {} BFD_RELOC_MSP430_16_BYTE -@deffnx {} BFD_RELOC_MSP430_2X_PCREL -@deffnx {} BFD_RELOC_MSP430_RL_PCREL -@deffnx {} BFD_RELOC_MSP430_ABS8 -@deffnx {} BFD_RELOC_MSP430X_PCR20_EXT_SRC -@deffnx {} BFD_RELOC_MSP430X_PCR20_EXT_DST -@deffnx {} BFD_RELOC_MSP430X_PCR20_EXT_ODST -@deffnx {} BFD_RELOC_MSP430X_ABS20_EXT_SRC -@deffnx {} BFD_RELOC_MSP430X_ABS20_EXT_DST -@deffnx {} BFD_RELOC_MSP430X_ABS20_EXT_ODST -@deffnx {} BFD_RELOC_MSP430X_ABS20_ADR_SRC -@deffnx {} BFD_RELOC_MSP430X_ABS20_ADR_DST -@deffnx {} BFD_RELOC_MSP430X_PCR16 -@deffnx {} BFD_RELOC_MSP430X_PCR20_CALL -@deffnx {} BFD_RELOC_MSP430X_ABS16 -@deffnx {} BFD_RELOC_MSP430_ABS_HI16 -@deffnx {} BFD_RELOC_MSP430_PREL31 -@deffnx {} BFD_RELOC_MSP430_SYM_DIFF -msp430 specific relocation codes -@end deffn -@deffn {} BFD_RELOC_NIOS2_S16 -@deffnx {} BFD_RELOC_NIOS2_U16 -@deffnx {} BFD_RELOC_NIOS2_CALL26 -@deffnx {} BFD_RELOC_NIOS2_IMM5 -@deffnx {} BFD_RELOC_NIOS2_CACHE_OPX -@deffnx {} BFD_RELOC_NIOS2_IMM6 -@deffnx {} BFD_RELOC_NIOS2_IMM8 -@deffnx {} BFD_RELOC_NIOS2_HI16 -@deffnx {} BFD_RELOC_NIOS2_LO16 -@deffnx {} BFD_RELOC_NIOS2_HIADJ16 -@deffnx {} BFD_RELOC_NIOS2_GPREL -@deffnx {} BFD_RELOC_NIOS2_UJMP -@deffnx {} BFD_RELOC_NIOS2_CJMP -@deffnx {} BFD_RELOC_NIOS2_CALLR -@deffnx {} BFD_RELOC_NIOS2_ALIGN -@deffnx {} BFD_RELOC_NIOS2_GOT16 -@deffnx {} BFD_RELOC_NIOS2_CALL16 -@deffnx {} BFD_RELOC_NIOS2_GOTOFF_LO -@deffnx {} BFD_RELOC_NIOS2_GOTOFF_HA -@deffnx {} BFD_RELOC_NIOS2_PCREL_LO -@deffnx {} BFD_RELOC_NIOS2_PCREL_HA -@deffnx {} BFD_RELOC_NIOS2_TLS_GD16 -@deffnx {} BFD_RELOC_NIOS2_TLS_LDM16 -@deffnx {} BFD_RELOC_NIOS2_TLS_LDO16 -@deffnx {} BFD_RELOC_NIOS2_TLS_IE16 -@deffnx {} BFD_RELOC_NIOS2_TLS_LE16 -@deffnx {} BFD_RELOC_NIOS2_TLS_DTPMOD -@deffnx {} BFD_RELOC_NIOS2_TLS_DTPREL -@deffnx {} BFD_RELOC_NIOS2_TLS_TPREL -@deffnx {} BFD_RELOC_NIOS2_COPY -@deffnx {} BFD_RELOC_NIOS2_GLOB_DAT -@deffnx {} BFD_RELOC_NIOS2_JUMP_SLOT -@deffnx {} BFD_RELOC_NIOS2_RELATIVE -@deffnx {} BFD_RELOC_NIOS2_GOTOFF -Relocations used by the Altera Nios II core. -@end deffn -@deffn {} BFD_RELOC_IQ2000_OFFSET_16 -@deffnx {} BFD_RELOC_IQ2000_OFFSET_21 -@deffnx {} BFD_RELOC_IQ2000_UHI16 -IQ2000 Relocations. -@end deffn -@deffn {} BFD_RELOC_XTENSA_RTLD -Special Xtensa relocation used only by PLT entries in ELF shared -objects to indicate that the runtime linker should set the value -to one of its own internal functions or data structures. -@end deffn -@deffn {} BFD_RELOC_XTENSA_GLOB_DAT -@deffnx {} BFD_RELOC_XTENSA_JMP_SLOT -@deffnx {} BFD_RELOC_XTENSA_RELATIVE -Xtensa relocations for ELF shared objects. -@end deffn -@deffn {} BFD_RELOC_XTENSA_PLT -Xtensa relocation used in ELF object files for symbols that may require -PLT entries. Otherwise, this is just a generic 32-bit relocation. -@end deffn -@deffn {} BFD_RELOC_XTENSA_DIFF8 -@deffnx {} BFD_RELOC_XTENSA_DIFF16 -@deffnx {} BFD_RELOC_XTENSA_DIFF32 -Xtensa relocations to mark the difference of two local symbols. -These are only needed to support linker relaxation and can be ignored -when not relaxing. The field is set to the value of the difference -assuming no relaxation. The relocation encodes the position of the -first symbol so the linker can determine whether to adjust the field -value. -@end deffn -@deffn {} BFD_RELOC_XTENSA_SLOT0_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT1_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT2_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT3_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT4_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT5_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT6_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT7_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT8_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT9_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT10_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT11_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT12_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT13_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT14_OP -Generic Xtensa relocations for instruction operands. Only the slot -number is encoded in the relocation. The relocation applies to the -last PC-relative immediate operand, or if there are no PC-relative -immediates, to the last immediate operand. -@end deffn -@deffn {} BFD_RELOC_XTENSA_SLOT0_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT1_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT2_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT3_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT4_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT5_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT6_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT7_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT8_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT9_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT10_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT11_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT12_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT13_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT14_ALT -Alternate Xtensa relocations. Only the slot is encoded in the -relocation. The meaning of these relocations is opcode-specific. -@end deffn -@deffn {} BFD_RELOC_XTENSA_OP0 -@deffnx {} BFD_RELOC_XTENSA_OP1 -@deffnx {} BFD_RELOC_XTENSA_OP2 -Xtensa relocations for backward compatibility. These have all been -replaced by BFD_RELOC_XTENSA_SLOT0_OP. -@end deffn -@deffn {} BFD_RELOC_XTENSA_ASM_EXPAND -Xtensa relocation to mark that the assembler expanded the -instructions from an original target. The expansion size is -encoded in the reloc size. -@end deffn -@deffn {} BFD_RELOC_XTENSA_ASM_SIMPLIFY -Xtensa relocation to mark that the linker should simplify -assembler-expanded instructions. This is commonly used -internally by the linker after analysis of a -BFD_RELOC_XTENSA_ASM_EXPAND. -@end deffn -@deffn {} BFD_RELOC_XTENSA_TLSDESC_FN -@deffnx {} BFD_RELOC_XTENSA_TLSDESC_ARG -@deffnx {} BFD_RELOC_XTENSA_TLS_DTPOFF -@deffnx {} BFD_RELOC_XTENSA_TLS_TPOFF -@deffnx {} BFD_RELOC_XTENSA_TLS_FUNC -@deffnx {} BFD_RELOC_XTENSA_TLS_ARG -@deffnx {} BFD_RELOC_XTENSA_TLS_CALL -Xtensa TLS relocations. -@end deffn -@deffn {} BFD_RELOC_Z80_DISP8 -8 bit signed offset in (ix+d) or (iy+d). -@end deffn -@deffn {} BFD_RELOC_Z8K_DISP7 -DJNZ offset. -@end deffn -@deffn {} BFD_RELOC_Z8K_CALLR -CALR offset. -@end deffn -@deffn {} BFD_RELOC_Z8K_IMM4L -4 bit value. -@end deffn -@deffn {} BFD_RELOC_LM32_CALL -@deffnx {} BFD_RELOC_LM32_BRANCH -@deffnx {} BFD_RELOC_LM32_16_GOT -@deffnx {} BFD_RELOC_LM32_GOTOFF_HI16 -@deffnx {} BFD_RELOC_LM32_GOTOFF_LO16 -@deffnx {} BFD_RELOC_LM32_COPY -@deffnx {} BFD_RELOC_LM32_GLOB_DAT -@deffnx {} BFD_RELOC_LM32_JMP_SLOT -@deffnx {} BFD_RELOC_LM32_RELATIVE -Lattice Mico32 relocations. -@end deffn -@deffn {} BFD_RELOC_MACH_O_SECTDIFF -Difference between two section addreses. Must be followed by a -BFD_RELOC_MACH_O_PAIR. -@end deffn -@deffn {} BFD_RELOC_MACH_O_LOCAL_SECTDIFF -Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. -@end deffn -@deffn {} BFD_RELOC_MACH_O_PAIR -Pair of relocation. Contains the first symbol. -@end deffn -@deffn {} BFD_RELOC_MACH_O_X86_64_BRANCH32 -@deffnx {} BFD_RELOC_MACH_O_X86_64_BRANCH8 -PCREL relocations. They are marked as branch to create PLT entry if -required. -@end deffn -@deffn {} BFD_RELOC_MACH_O_X86_64_GOT -Used when referencing a GOT entry. -@end deffn -@deffn {} BFD_RELOC_MACH_O_X86_64_GOT_LOAD -Used when loading a GOT entry with movq. It is specially marked so that -the linker could optimize the movq to a leaq if possible. -@end deffn -@deffn {} BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32 -Symbol will be substracted. Must be followed by a BFD_RELOC_64. -@end deffn -@deffn {} BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64 -Symbol will be substracted. Must be followed by a BFD_RELOC_64. -@end deffn -@deffn {} BFD_RELOC_MACH_O_X86_64_PCREL32_1 -Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. -@end deffn -@deffn {} BFD_RELOC_MACH_O_X86_64_PCREL32_2 -Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. -@end deffn -@deffn {} BFD_RELOC_MACH_O_X86_64_PCREL32_4 -Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_32_LO -This is a 32 bit reloc for the microblaze that stores the -low 16 bits of a value -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_32_LO_PCREL -This is a 32 bit pc-relative reloc for the microblaze that -stores the low 16 bits of a value -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_32_ROSDA -This is a 32 bit reloc for the microblaze that stores a -value relative to the read-only small data area anchor -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_32_RWSDA -This is a 32 bit reloc for the microblaze that stores a -value relative to the read-write small data area anchor -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM -This is a 32 bit reloc for the microblaze to handle -expressions of the form "Symbol Op Symbol" -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_64_NONE -This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is -done here - only used for relaxing -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_64_GOTPC -This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). The relocation is -PC-relative GOT offset -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_64_GOT -This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). The relocation is -GOT offset -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_64_PLT -This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). The relocation is -PC-relative offset into PLT -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_64_GOTOFF -This is a 64 bit reloc that stores the 32 bit GOT relative -value in two words (with an imm instruction). The relocation is -relative offset from _GLOBAL_OFFSET_TABLE_ -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_32_GOTOFF -This is a 32 bit reloc that stores the 32 bit GOT relative -value in a word. The relocation is relative offset from -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_COPY -This is used to tell the dynamic linker to copy the value out of -the dynamic object into the runtime process image. -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_64_TLS -Unused Reloc -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_64_TLSGD -This is a 64 bit reloc that stores the 32 bit GOT relative value -of the GOT TLS GD info entry in two words (with an imm instruction). The -relocation is GOT offset. -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_64_TLSLD -This is a 64 bit reloc that stores the 32 bit GOT relative value -of the GOT TLS LD info entry in two words (with an imm instruction). The -relocation is GOT offset. -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_32_TLSDTPMOD -This is a 32 bit reloc that stores the Module ID to GOT(n). -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_32_TLSDTPREL -This is a 32 bit reloc that stores TLS offset to GOT(n+1). -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_64_TLSDTPREL -This is a 32 bit reloc for storing TLS offset to two words (uses imm -instruction) -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL -This is a 64 bit reloc that stores 32-bit thread pointer relative offset -to two words (uses imm instruction). -@end deffn -@deffn {} BFD_RELOC_MICROBLAZE_64_TLSTPREL -This is a 64 bit reloc that stores 32-bit thread pointer relative offset -to two words (uses imm instruction). -@end deffn -@deffn {} BFD_RELOC_AARCH64_RELOC_START -AArch64 pseudo relocation code to mark the start of the AArch64 -relocation enumerators. N.B. the order of the enumerators is -important as several tables in the AArch64 bfd backend are indexed -by these enumerators; make sure they are all synced. -@end deffn -@deffn {} BFD_RELOC_AARCH64_NONE -AArch64 null relocation code. -@end deffn -@deffn {} BFD_RELOC_AARCH64_64 -@deffnx {} BFD_RELOC_AARCH64_32 -@deffnx {} BFD_RELOC_AARCH64_16 -Basic absolute relocations of N bits. These are equivalent to -BFD_RELOC_N and they were added to assist the indexing of the howto -table. -@end deffn -@deffn {} BFD_RELOC_AARCH64_64_PCREL -@deffnx {} BFD_RELOC_AARCH64_32_PCREL -@deffnx {} BFD_RELOC_AARCH64_16_PCREL -PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL -and they were added to assist the indexing of the howto table. -@end deffn -@deffn {} BFD_RELOC_AARCH64_MOVW_G0 -AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. -@end deffn -@deffn {} BFD_RELOC_AARCH64_MOVW_G0_NC -AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. -@end deffn -@deffn {} BFD_RELOC_AARCH64_MOVW_G1 -AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. -@end deffn -@deffn {} BFD_RELOC_AARCH64_MOVW_G1_NC -AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. -@end deffn -@deffn {} BFD_RELOC_AARCH64_MOVW_G2 -AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. -@end deffn -@deffn {} BFD_RELOC_AARCH64_MOVW_G2_NC -AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. -@end deffn -@deffn {} BFD_RELOC_AARCH64_MOVW_G3 -AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. -@end deffn -@deffn {} BFD_RELOC_AARCH64_MOVW_G0_S -AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. -@end deffn -@deffn {} BFD_RELOC_AARCH64_MOVW_G1_S -AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. -@end deffn -@deffn {} BFD_RELOC_AARCH64_MOVW_G2_S -AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. -@end deffn -@deffn {} BFD_RELOC_AARCH64_LD_LO19_PCREL -AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. -@end deffn -@deffn {} BFD_RELOC_AARCH64_ADR_LO21_PCREL -AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. -@end deffn -@deffn {} BFD_RELOC_AARCH64_ADR_HI21_PCREL -AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page -offset, giving a 4KB aligned page base address. -@end deffn -@deffn {} BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL -AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page -offset, giving a 4KB aligned page base address, but with no overflow -checking. -@end deffn -@deffn {} BFD_RELOC_AARCH64_ADD_LO12 -AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. -@end deffn -@deffn {} BFD_RELOC_AARCH64_LDST8_LO12 -AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TSTBR14 -AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. -@end deffn -@deffn {} BFD_RELOC_AARCH64_BRANCH19 -AArch64 19 bit pc-relative conditional branch and compare & branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 21 bit signed byte offset. -@end deffn -@deffn {} BFD_RELOC_AARCH64_JUMP26 -AArch64 26 bit pc-relative unconditional branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. -@end deffn -@deffn {} BFD_RELOC_AARCH64_CALL26 -AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. -@end deffn -@deffn {} BFD_RELOC_AARCH64_LDST16_LO12 -AArch64 16-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. -@end deffn -@deffn {} BFD_RELOC_AARCH64_LDST32_LO12 -AArch64 32-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. -@end deffn -@deffn {} BFD_RELOC_AARCH64_LDST64_LO12 -AArch64 64-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. -@end deffn -@deffn {} BFD_RELOC_AARCH64_LDST128_LO12 -AArch64 128-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. -@end deffn -@deffn {} BFD_RELOC_AARCH64_GOT_LD_PREL19 -AArch64 Load Literal instruction, holding a 19 bit PC relative word -offset of the global offset table entry for a symbol. The lowest two -bits must be zero and are not stored in the instruction, giving a 21 -bit signed byte offset. This relocation type requires signed overflow -checking. -@end deffn -@deffn {} BFD_RELOC_AARCH64_ADR_GOT_PAGE -Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. -@end deffn -@deffn {} BFD_RELOC_AARCH64_LD64_GOT_LO12_NC -Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in LP64 ABI only. -@end deffn -@deffn {} BFD_RELOC_AARCH64_LD32_GOT_LO12_NC -Unsigned 12 bit byte offset for 32 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in ILP32 ABI only. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21 -Get to the page base of the global offset table entry for a symbols -tls_index structure as part of an adrp instruction using a 21 bit PC -relative value. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC -Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1 -AArch64 TLS INITIAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC -AArch64 TLS INITIAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 -AArch64 TLS INITIAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC -AArch64 TLS INITIAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC -AArch64 TLS INITIAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19 -AArch64 TLS INITIAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2 -AArch64 TLS LOCAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1 -AArch64 TLS LOCAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC -AArch64 TLS LOCAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0 -AArch64 TLS LOCAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC -AArch64 TLS LOCAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12 -AArch64 TLS LOCAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12 -AArch64 TLS LOCAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC -AArch64 TLS LOCAL EXEC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_LD_PREL19 -AArch64 TLS DESC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21 -AArch64 TLS DESC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21 -AArch64 TLS DESC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC -AArch64 TLS DESC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC -AArch64 TLS DESC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC -AArch64 TLS DESC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_OFF_G1 -AArch64 TLS DESC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC -AArch64 TLS DESC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_LDR -AArch64 TLS DESC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_ADD -AArch64 TLS DESC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_CALL -AArch64 TLS DESC relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_COPY -AArch64 TLS relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_GLOB_DAT -AArch64 TLS relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_JUMP_SLOT -AArch64 TLS relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_RELATIVE -AArch64 TLS relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLS_DTPMOD -AArch64 TLS relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLS_DTPREL -AArch64 TLS relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLS_TPREL -AArch64 TLS relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC -AArch64 TLS relocation. -@end deffn -@deffn {} BFD_RELOC_AARCH64_IRELATIVE -AArch64 support for STT_GNU_IFUNC. -@end deffn -@deffn {} BFD_RELOC_AARCH64_RELOC_END -AArch64 pseudo relocation code to mark the end of the AArch64 -relocation enumerators that have direct mapping to ELF reloc codes. -There are a few more enumerators after this one; those are mainly -used by the AArch64 assembler for the internal fixup or to select -one of the above enumerators. -@end deffn -@deffn {} BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP -AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. -@end deffn -@deffn {} BFD_RELOC_AARCH64_LDST_LO12 -AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. -@end deffn -@deffn {} BFD_RELOC_AARCH64_LD_GOT_LO12_NC -AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC -AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. -@end deffn -@deffn {} BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC -AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. -@end deffn -@deffn {} BFD_RELOC_TILEPRO_COPY -@deffnx {} BFD_RELOC_TILEPRO_GLOB_DAT -@deffnx {} BFD_RELOC_TILEPRO_JMP_SLOT -@deffnx {} BFD_RELOC_TILEPRO_RELATIVE -@deffnx {} BFD_RELOC_TILEPRO_BROFF_X1 -@deffnx {} BFD_RELOC_TILEPRO_JOFFLONG_X1 -@deffnx {} BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT -@deffnx {} BFD_RELOC_TILEPRO_IMM8_X0 -@deffnx {} BFD_RELOC_TILEPRO_IMM8_Y0 -@deffnx {} BFD_RELOC_TILEPRO_IMM8_X1 -@deffnx {} BFD_RELOC_TILEPRO_IMM8_Y1 -@deffnx {} BFD_RELOC_TILEPRO_DEST_IMM8_X1 -@deffnx {} BFD_RELOC_TILEPRO_MT_IMM15_X1 -@deffnx {} BFD_RELOC_TILEPRO_MF_IMM15_X1 -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0 -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1 -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_LO -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_LO -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_HI -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_HI -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_HA -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_HA -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_PCREL -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_PCREL -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_GOT -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_GOT -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA -@deffnx {} BFD_RELOC_TILEPRO_MMSTART_X0 -@deffnx {} BFD_RELOC_TILEPRO_MMEND_X0 -@deffnx {} BFD_RELOC_TILEPRO_MMSTART_X1 -@deffnx {} BFD_RELOC_TILEPRO_MMEND_X1 -@deffnx {} BFD_RELOC_TILEPRO_SHAMT_X0 -@deffnx {} BFD_RELOC_TILEPRO_SHAMT_X1 -@deffnx {} BFD_RELOC_TILEPRO_SHAMT_Y0 -@deffnx {} BFD_RELOC_TILEPRO_SHAMT_Y1 -@deffnx {} BFD_RELOC_TILEPRO_TLS_GD_CALL -@deffnx {} BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD -@deffnx {} BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD -@deffnx {} BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD -@deffnx {} BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD -@deffnx {} BFD_RELOC_TILEPRO_TLS_IE_LOAD -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA -@deffnx {} BFD_RELOC_TILEPRO_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_TILEPRO_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_TILEPRO_TLS_TPOFF32 -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA -@deffnx {} BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA -Tilera TILEPro Relocations. -@end deffn -@deffn {} BFD_RELOC_TILEGX_HW0 -@deffnx {} BFD_RELOC_TILEGX_HW1 -@deffnx {} BFD_RELOC_TILEGX_HW2 -@deffnx {} BFD_RELOC_TILEGX_HW3 -@deffnx {} BFD_RELOC_TILEGX_HW0_LAST -@deffnx {} BFD_RELOC_TILEGX_HW1_LAST -@deffnx {} BFD_RELOC_TILEGX_HW2_LAST -@deffnx {} BFD_RELOC_TILEGX_COPY -@deffnx {} BFD_RELOC_TILEGX_GLOB_DAT -@deffnx {} BFD_RELOC_TILEGX_JMP_SLOT -@deffnx {} BFD_RELOC_TILEGX_RELATIVE -@deffnx {} BFD_RELOC_TILEGX_BROFF_X1 -@deffnx {} BFD_RELOC_TILEGX_JUMPOFF_X1 -@deffnx {} BFD_RELOC_TILEGX_JUMPOFF_X1_PLT -@deffnx {} BFD_RELOC_TILEGX_IMM8_X0 -@deffnx {} BFD_RELOC_TILEGX_IMM8_Y0 -@deffnx {} BFD_RELOC_TILEGX_IMM8_X1 -@deffnx {} BFD_RELOC_TILEGX_IMM8_Y1 -@deffnx {} BFD_RELOC_TILEGX_DEST_IMM8_X1 -@deffnx {} BFD_RELOC_TILEGX_MT_IMM14_X1 -@deffnx {} BFD_RELOC_TILEGX_MF_IMM14_X1 -@deffnx {} BFD_RELOC_TILEGX_MMSTART_X0 -@deffnx {} BFD_RELOC_TILEGX_MMEND_X0 -@deffnx {} BFD_RELOC_TILEGX_SHAMT_X0 -@deffnx {} BFD_RELOC_TILEGX_SHAMT_X1 -@deffnx {} BFD_RELOC_TILEGX_SHAMT_Y0 -@deffnx {} BFD_RELOC_TILEGX_SHAMT_Y1 -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0 -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0 -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW1 -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW1 -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW2 -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW2 -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW3 -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW3 -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE -@deffnx {} BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE -@deffnx {} BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE -@deffnx {} BFD_RELOC_TILEGX_TLS_DTPMOD64 -@deffnx {} BFD_RELOC_TILEGX_TLS_DTPOFF64 -@deffnx {} BFD_RELOC_TILEGX_TLS_TPOFF64 -@deffnx {} BFD_RELOC_TILEGX_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_TILEGX_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_TILEGX_TLS_TPOFF32 -@deffnx {} BFD_RELOC_TILEGX_TLS_GD_CALL -@deffnx {} BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD -@deffnx {} BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD -@deffnx {} BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD -@deffnx {} BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD -@deffnx {} BFD_RELOC_TILEGX_TLS_IE_LOAD -@deffnx {} BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD -@deffnx {} BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD -@deffnx {} BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD -@deffnx {} BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD -Tilera TILE-Gx Relocations. -@end deffn -@deffn {} BFD_RELOC_EPIPHANY_SIMM8 -Adapteva EPIPHANY - 8 bit signed pc-relative displacement -@end deffn -@deffn {} BFD_RELOC_EPIPHANY_SIMM24 -Adapteva EPIPHANY - 24 bit signed pc-relative displacement -@end deffn -@deffn {} BFD_RELOC_EPIPHANY_HIGH -Adapteva EPIPHANY - 16 most-significant bits of absolute address -@end deffn -@deffn {} BFD_RELOC_EPIPHANY_LOW -Adapteva EPIPHANY - 16 least-significant bits of absolute address -@end deffn -@deffn {} BFD_RELOC_EPIPHANY_SIMM11 -Adapteva EPIPHANY - 11 bit signed number - add/sub immediate -@end deffn -@deffn {} BFD_RELOC_EPIPHANY_IMM11 -Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) -@end deffn -@deffn {} BFD_RELOC_EPIPHANY_IMM8 -Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. -@end deffn - -@example - -typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; -@end example -@findex bfd_reloc_type_lookup -@subsubsection @code{bfd_reloc_type_lookup} -@strong{Synopsis} -@example -reloc_howto_type *bfd_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); -reloc_howto_type *bfd_reloc_name_lookup - (bfd *abfd, const char *reloc_name); -@end example -@strong{Description}@* -Return a pointer to a howto structure which, when -invoked, will perform the relocation @var{code} on data from the -architecture noted. - -@findex bfd_default_reloc_type_lookup -@subsubsection @code{bfd_default_reloc_type_lookup} -@strong{Synopsis} -@example -reloc_howto_type *bfd_default_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); -@end example -@strong{Description}@* -Provides a default relocation lookup routine for any architecture. - -@findex bfd_get_reloc_code_name -@subsubsection @code{bfd_get_reloc_code_name} -@strong{Synopsis} -@example -const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); -@end example -@strong{Description}@* -Provides a printable name for the supplied relocation code. -Useful mainly for printing error messages. - -@findex bfd_generic_relax_section -@subsubsection @code{bfd_generic_relax_section} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_relax_section - (bfd *abfd, - asection *section, - struct bfd_link_info *, - bfd_boolean *); -@end example -@strong{Description}@* -Provides default handling for relaxing for back ends which -don't do relaxing. - -@findex bfd_generic_gc_sections -@subsubsection @code{bfd_generic_gc_sections} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_gc_sections - (bfd *, struct bfd_link_info *); -@end example -@strong{Description}@* -Provides default handling for relaxing for back ends which -don't do section gc -- i.e., does nothing. - -@findex bfd_generic_lookup_section_flags -@subsubsection @code{bfd_generic_lookup_section_flags} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_lookup_section_flags - (struct bfd_link_info *, struct flag_info *, asection *); -@end example -@strong{Description}@* -Provides default handling for section flags lookup --- i.e., does nothing. -Returns FALSE if the section should be omitted, otherwise TRUE. - -@findex bfd_generic_merge_sections -@subsubsection @code{bfd_generic_merge_sections} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_merge_sections - (bfd *, struct bfd_link_info *); -@end example -@strong{Description}@* -Provides default handling for SEC_MERGE section merging for back ends -which don't have SEC_MERGE support -- i.e., does nothing. - -@findex bfd_generic_get_relocated_section_contents -@subsubsection @code{bfd_generic_get_relocated_section_contents} -@strong{Synopsis} -@example -bfd_byte *bfd_generic_get_relocated_section_contents - (bfd *abfd, - struct bfd_link_info *link_info, - struct bfd_link_order *link_order, - bfd_byte *data, - bfd_boolean relocatable, - asymbol **symbols); -@end example -@strong{Description}@* -Provides default handling of relocation effort for back ends -which can't be bothered to do it efficiently. - diff -Nur binutils-2.24.orig/bfd/doc/section.texi binutils-2.24/bfd/doc/section.texi --- binutils-2.24.orig/bfd/doc/section.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/section.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,1035 +0,0 @@ -@section Sections -The raw data contained within a BFD is maintained through the -section abstraction. A single BFD may have any number of -sections. It keeps hold of them by pointing to the first; -each one points to the next in the list. - -Sections are supported in BFD in @code{section.c}. - -@menu -* Section Input:: -* Section Output:: -* typedef asection:: -* section prototypes:: -@end menu - -@node Section Input, Section Output, Sections, Sections -@subsection Section input -When a BFD is opened for reading, the section structures are -created and attached to the BFD. - -Each section has a name which describes the section in the -outside world---for example, @code{a.out} would contain at least -three sections, called @code{.text}, @code{.data} and @code{.bss}. - -Names need not be unique; for example a COFF file may have several -sections named @code{.data}. - -Sometimes a BFD will contain more than the ``natural'' number of -sections. A back end may attach other sections containing -constructor data, or an application may add a section (using -@code{bfd_make_section}) to the sections attached to an already open -BFD. For example, the linker creates an extra section -@code{COMMON} for each input file's BFD to hold information about -common storage. - -The raw data is not necessarily read in when -the section descriptor is created. Some targets may leave the -data in place until a @code{bfd_get_section_contents} call is -made. Other back ends may read in all the data at once. For -example, an S-record file has to be read once to determine the -size of the data. An IEEE-695 file doesn't contain raw data in -sections, but data and relocation expressions intermixed, so -the data area has to be parsed to get out the data and -relocations. - -@node Section Output, typedef asection, Section Input, Sections -@subsection Section output -To write a new object style BFD, the various sections to be -written have to be created. They are attached to the BFD in -the same way as input sections; data is written to the -sections using @code{bfd_set_section_contents}. - -Any program that creates or combines sections (e.g., the assembler -and linker) must use the @code{asection} fields @code{output_section} and -@code{output_offset} to indicate the file sections to which each -section must be written. (If the section is being created from -scratch, @code{output_section} should probably point to the section -itself and @code{output_offset} should probably be zero.) - -The data to be written comes from input sections attached -(via @code{output_section} pointers) to -the output sections. The output section structure can be -considered a filter for the input section: the output section -determines the vma of the output data and the name, but the -input section determines the offset into the output section of -the data to be written. - -E.g., to create a section "O", starting at 0x100, 0x123 long, -containing two subsections, "A" at offset 0x0 (i.e., at vma -0x100) and "B" at offset 0x20 (i.e., at vma 0x120) the @code{asection} -structures would look like: - -@example - section name "A" - output_offset 0x00 - size 0x20 - output_section -----------> section name "O" - | vma 0x100 - section name "B" | size 0x123 - output_offset 0x20 | - size 0x103 | - output_section --------| -@end example - -@subsection Link orders -The data within a section is stored in a @dfn{link_order}. -These are much like the fixups in @code{gas}. The link_order -abstraction allows a section to grow and shrink within itself. - -A link_order knows how big it is, and which is the next -link_order and where the raw data for it is; it also points to -a list of relocations which apply to it. - -The link_order is used by the linker to perform relaxing on -final code. The compiler creates code which is as big as -necessary to make it work without relaxing, and the user can -select whether to relax. Sometimes relaxing takes a lot of -time. The linker runs around the relocations to see if any -are attached to data which can be shrunk, if so it does it on -a link_order by link_order basis. - - -@node typedef asection, section prototypes, Section Output, Sections -@subsection typedef asection -Here is the section structure: - - -@example - -typedef struct bfd_section -@{ - /* The name of the section; the name isn't a copy, the pointer is - the same as that passed to bfd_make_section. */ - const char *name; - - /* A unique sequence number. */ - int id; - - /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; - - /* The next section in the list belonging to the BFD, or NULL. */ - struct bfd_section *next; - - /* The previous section in the list belonging to the BFD, or NULL. */ - struct bfd_section *prev; - - /* The field flags contains attributes of the section. Some - flags are read in from the object file, and some are - synthesized from other information. */ - flagword flags; - -#define SEC_NO_FLAGS 0x000 - - /* Tells the OS to allocate space for this section when loading. - This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 - - /* Tells the OS to load the section from the file when loading. - This is clear for a .bss section. */ -#define SEC_LOAD 0x002 - - /* The section contains data still to be relocated, so there is - some relocation information too. */ -#define SEC_RELOC 0x004 - - /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 - - /* The section contains code only. */ -#define SEC_CODE 0x010 - - /* The section contains data only. */ -#define SEC_DATA 0x020 - - /* The section will reside in ROM. */ -#define SEC_ROM 0x040 - - /* The section contains constructor information. This section - type is used by the linker to create lists of constructors and - destructors used by @code{g++}. When a back end sees a symbol - which should be used in a constructor list, it creates a new - section for the type of name (e.g., @code{__CTOR_LIST__}), attaches - the symbol to it, and builds a relocation. To build the lists - of constructors, all the linker has to do is catenate all the - sections called @code{__CTOR_LIST__} and relocate the data - contained within - exactly the operations it would peform on - standard data. */ -#define SEC_CONSTRUCTOR 0x080 - - /* The section has contents - a data section could be - @code{SEC_ALLOC} | @code{SEC_HAS_CONTENTS}; a debug section could be - @code{SEC_HAS_CONTENTS} */ -#define SEC_HAS_CONTENTS 0x100 - - /* An instruction to the linker to not output the section - even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 - - /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 - - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 - - /* The section contains common symbols (symbols may be defined - multiple times, the value of a symbol is the amount of - space it requires, and the largest symbol value is the one - used). Most targets have exactly one of these (which we - translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 - - /* The section contains only debugging information. For - example, this is set for ELF .debug and .stab sections. - strip tests this flag to see if a section can be - discarded. */ -#define SEC_DEBUGGING 0x2000 - - /* The contents of this section are held in memory pointed to - by the contents field. This is checked by bfd_get_section_contents, - and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 - - /* The contents of this section are to be excluded by the - linker for executable and shared objects unless those - objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 - - /* The contents of this section are to be sorted based on the sum of - the symbol and addend values specified by the associated relocation - entries. Entries without associated relocation entries will be - appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 - - /* When linking, duplicate sections of the same name should be - discarded, rather than being combined into a single section as - is usually done. This is similar to how common symbols are - handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 - - /* If SEC_LINK_ONCE is set, this bitfield describes how the linker - should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 - - /* This value for SEC_LINK_DUPLICATES means that duplicate - sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if there are any duplicate sections, although - it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections are a different size. */ -#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections contain different - contents. */ -#define SEC_LINK_DUPLICATES_SAME_CONTENTS \ - (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE) - - /* This section was created by the linker as part of dynamic - relocation or other arcane processing. It is skipped when - going through the first-pass output, trusting that someone - else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 - - /* This section should not be subject to garbage collection. - Also set to inform the linker that this section should not be - listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 - - /* This section contains "short" data, and should be placed - "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 - - /* Attempt to merge identical entities in the section. - Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 - - /* If given with SEC_MERGE, entities to merge are zero terminated - strings where entsize specifies character size instead of fixed - size entries. */ -#define SEC_STRINGS 0x1000000 - - /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 - - /* The section is a COFF shared library section. This flag is - only for the linker. If this type of section appears in - the input file, the linker must copy it to the output file - without changing the vma or size. FIXME: Although this - was originally intended to be general, it really is COFF - specific (and the flag was renamed to indicate this). It - might be cleaner to have some more general mechanism to - allow the back end to control what the linker does with - sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 - - /* This input section should be copied to output in reverse order - as an array of pointers. This is for ELF linker internal use - only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 - - /* This section contains data which may be shared with other - executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 - - /* When a section with this flag is being linked, then if the size of - the input section is less than a page, it should not cross a page - boundary. If the size of the input section is one page or more, - it should be aligned on a page boundary. This is for TI - TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 - - /* Conditionally link this section; do not link if there are no - references found to any symbol in the section. This is for TI - TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 - - /* Indicate that section has the no read flag set. This happens - when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 - - /* End of section flags. */ - - /* Some internal packed boolean fields. */ - - /* See the vma field. */ - unsigned int user_set_vma : 1; - - /* A mark flag used by some of the linker backends. */ - unsigned int linker_mark : 1; - - /* Another mark flag used by some of the linker backends. Set for - output sections that have an input section. */ - unsigned int linker_has_input : 1; - - /* Mark flag used by some linker backends for garbage collection. */ - unsigned int gc_mark : 1; - - /* Section compression status. */ - unsigned int compress_status : 2; -#define COMPRESS_SECTION_NONE 0 -#define COMPRESS_SECTION_DONE 1 -#define DECOMPRESS_SECTION_SIZED 2 - - /* The following flags are used by the ELF linker. */ - - /* Mark sections which have been allocated to segments. */ - unsigned int segment_mark : 1; - - /* Type of sec_info information. */ - unsigned int sec_info_type:3; -#define SEC_INFO_TYPE_NONE 0 -#define SEC_INFO_TYPE_STABS 1 -#define SEC_INFO_TYPE_MERGE 2 -#define SEC_INFO_TYPE_EH_FRAME 3 -#define SEC_INFO_TYPE_JUST_SYMS 4 - - /* Nonzero if this section uses RELA relocations, rather than REL. */ - unsigned int use_rela_p:1; - - /* Bits used by various backends. The generic code doesn't touch - these fields. */ - - unsigned int sec_flg0:1; - unsigned int sec_flg1:1; - unsigned int sec_flg2:1; - unsigned int sec_flg3:1; - unsigned int sec_flg4:1; - unsigned int sec_flg5:1; - - /* End of internal packed boolean fields. */ - - /* The virtual memory address of the section - where it will be - at run time. The symbols are relocated against this. The - user_set_vma flag is maintained by bfd; if it's not set, the - backend can assign addresses (for example, in @code{a.out}, where - the default address for @code{.data} is dependent on the specific - target and various flags). */ - bfd_vma vma; - - /* The load address of the section - where it would be in a - rom image; really only used for writing section header - information. */ - bfd_vma lma; - - /* The size of the section in octets, as it will be output. - Contains a value even if the section has no contents (e.g., the - size of @code{.bss}). */ - bfd_size_type size; - - /* For input sections, the original size on disk of the section, in - octets. This field should be set for any section whose size is - changed by linker relaxation. It is required for sections where - the linker relaxation scheme doesn't cache altered section and - reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing - targets), and thus the original size needs to be kept to read the - section multiple times. For output sections, rawsize holds the - section size calculated on a previous linker relaxation pass. */ - bfd_size_type rawsize; - - /* The compressed size of the section in octets. */ - bfd_size_type compressed_size; - - /* Relaxation table. */ - struct relax_table *relax; - - /* Count of used relaxation table entries. */ - int relax_count; - - - /* If this section is going to be output, then this value is the - offset in *bytes* into the output section of the first byte in the - input section (byte ==> smallest addressable unit on the - target). In most cases, if this was going to start at the - 100th octet (8-bit quantity) in the output section, this value - would be 100. However, if the target byte size is 16 bits - (bfd_octets_per_byte is "2"), this value would be 50. */ - bfd_vma output_offset; - - /* The output section through which to map on output. */ - struct bfd_section *output_section; - - /* The alignment requirement of the section, as an exponent of 2 - - e.g., 3 aligns to 2^3 (or 8). */ - unsigned int alignment_power; - - /* If an input section, a pointer to a vector of relocation - records for the data in this section. */ - struct reloc_cache_entry *relocation; - - /* If an output section, a pointer to a vector of pointers to - relocation records for the data in this section. */ - struct reloc_cache_entry **orelocation; - - /* The number of relocation records in one of the above. */ - unsigned reloc_count; - - /* Information below is back end specific - and not always used - or updated. */ - - /* File position of section data. */ - file_ptr filepos; - - /* File position of relocation info. */ - file_ptr rel_filepos; - - /* File position of line data. */ - file_ptr line_filepos; - - /* Pointer to data for applications. */ - void *userdata; - - /* If the SEC_IN_MEMORY flag is set, this points to the actual - contents. */ - unsigned char *contents; - - /* Attached line number information. */ - alent *lineno; - - /* Number of line number records. */ - unsigned int lineno_count; - - /* Entity size for merging purposes. */ - unsigned int entsize; - - /* Points to the kept section if this section is a link-once section, - and is discarded. */ - struct bfd_section *kept_section; - - /* When a section is being output, this value changes as more - linenumbers are written out. */ - file_ptr moving_line_filepos; - - /* What the section number is in the target world. */ - int target_index; - - void *used_by_bfd; - - /* If this is a constructor section then here is a list of the - relocations created to relocate items within it. */ - struct relent_chain *constructor_chain; - - /* The BFD which owns the section. */ - bfd *owner; - - /* A symbol which points at this section only. */ - struct bfd_symbol *symbol; - struct bfd_symbol **symbol_ptr_ptr; - - /* Early in the link process, map_head and map_tail are used to build - a list of input sections attached to an output section. Later, - output sections use these fields for a list of bfd_link_order - structs. */ - union @{ - struct bfd_link_order *link_order; - struct bfd_section *s; - @} map_head, map_tail; -@} asection; - -/* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a - short address. */ -struct relax_table @{ - /* Address where bytes may be deleted. */ - bfd_vma addr; - - /* Number of bytes to be deleted. */ - int size; -@}; - -/* These sections are global, and are managed by BFD. The application - and target back end are not permitted to change the values in - these sections. */ -extern asection _bfd_std_section[4]; - -#define BFD_ABS_SECTION_NAME "*ABS*" -#define BFD_UND_SECTION_NAME "*UND*" -#define BFD_COM_SECTION_NAME "*COM*" -#define BFD_IND_SECTION_NAME "*IND*" - -/* Pointer to the common section. */ -#define bfd_com_section_ptr (&_bfd_std_section[0]) -/* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&_bfd_std_section[1]) -/* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&_bfd_std_section[2]) -/* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&_bfd_std_section[3]) - -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) - -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) - -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - @{ \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - @} \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - @{ \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - @{ \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - @} \ - else \ - @{ \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - @} \ - _abfd->section_last = _s; \ - @} \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - @{ \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - @{ \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - @} \ - else \ - @{ \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - @} \ - _abfd->sections = _s; \ - @} \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - @{ \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - @} \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - @{ \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - @} \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) - -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ - /* name, id, index, next, prev, flags, user_set_vma, */ \ - @{ NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ - \ - /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ - 0, 0, 1, 0, \ - \ - /* segment_mark, sec_info_type, use_rela_p, */ \ - 0, 0, 0, \ - \ - /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \ - 0, 0, 0, 0, 0, 0, \ - \ - /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \ - 0, 0, 0, 0, 0, 0, 0, \ - \ - /* output_offset, output_section, alignment_power, */ \ - 0, &SEC, 0, \ - \ - /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \ - NULL, NULL, 0, 0, 0, \ - \ - /* line_filepos, userdata, contents, lineno, lineno_count, */ \ - 0, NULL, NULL, NULL, 0, \ - \ - /* entsize, kept_section, moving_line_filepos, */ \ - 0, NULL, 0, \ - \ - /* target_index, used_by_bfd, constructor_chain, owner, */ \ - 0, NULL, NULL, NULL, \ - \ - /* symbol, symbol_ptr_ptr, */ \ - (struct bfd_symbol *) SYM, &SEC.symbol, \ - \ - /* map_head, map_tail */ \ - @{ NULL @}, @{ NULL @} \ - @} - -@end example - -@node section prototypes, , typedef asection, Sections -@subsection Section prototypes -These are the functions exported by the section handling part of BFD. - -@findex bfd_section_list_clear -@subsubsection @code{bfd_section_list_clear} -@strong{Synopsis} -@example -void bfd_section_list_clear (bfd *); -@end example -@strong{Description}@* -Clears the section list, and also resets the section count and -hash table entries. - -@findex bfd_get_section_by_name -@subsubsection @code{bfd_get_section_by_name} -@strong{Synopsis} -@example -asection *bfd_get_section_by_name (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Return the most recently created section attached to @var{abfd} -named @var{name}. Return NULL if no such section exists. - -@findex bfd_get_next_section_by_name -@subsubsection @code{bfd_get_next_section_by_name} -@strong{Synopsis} -@example -asection *bfd_get_next_section_by_name (asection *sec); -@end example -@strong{Description}@* -Given @var{sec} is a section returned by @code{bfd_get_section_by_name}, -return the next most recently created section attached to the same -BFD with the same name. Return NULL if no such section exists. - -@findex bfd_get_linker_section -@subsubsection @code{bfd_get_linker_section} -@strong{Synopsis} -@example -asection *bfd_get_linker_section (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Return the linker created section attached to @var{abfd} -named @var{name}. Return NULL if no such section exists. - -@findex bfd_get_section_by_name_if -@subsubsection @code{bfd_get_section_by_name_if} -@strong{Synopsis} -@example -asection *bfd_get_section_by_name_if - (bfd *abfd, - const char *name, - bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), - void *obj); -@end example -@strong{Description}@* -Call the provided function @var{func} for each section -attached to the BFD @var{abfd} whose name matches @var{name}, -passing @var{obj} as an argument. The function will be called -as if by - -@example - func (abfd, the_section, obj); -@end example - -It returns the first section for which @var{func} returns true, -otherwise @code{NULL}. - -@findex bfd_get_unique_section_name -@subsubsection @code{bfd_get_unique_section_name} -@strong{Synopsis} -@example -char *bfd_get_unique_section_name - (bfd *abfd, const char *templat, int *count); -@end example -@strong{Description}@* -Invent a section name that is unique in @var{abfd} by tacking -a dot and a digit suffix onto the original @var{templat}. If -@var{count} is non-NULL, then it specifies the first number -tried as a suffix to generate a unique name. The value -pointed to by @var{count} will be incremented in this case. - -@findex bfd_make_section_old_way -@subsubsection @code{bfd_make_section_old_way} -@strong{Synopsis} -@example -asection *bfd_make_section_old_way (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Create a new empty section called @var{name} -and attach it to the end of the chain of sections for the -BFD @var{abfd}. An attempt to create a section with a name which -is already in use returns its pointer without changing the -section chain. - -It has the funny name since this is the way it used to be -before it was rewritten.... - -Possible errors are: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -If output has already started for this BFD. -@item -@code{bfd_error_no_memory} - -If memory allocation fails. -@end itemize - -@findex bfd_make_section_anyway_with_flags -@subsubsection @code{bfd_make_section_anyway_with_flags} -@strong{Synopsis} -@example -asection *bfd_make_section_anyway_with_flags - (bfd *abfd, const char *name, flagword flags); -@end example -@strong{Description}@* -Create a new empty section called @var{name} and attach it to the end of -the chain of sections for @var{abfd}. Create a new section even if there -is already a section with that name. Also set the attributes of the -new section to the value @var{flags}. - -Return @code{NULL} and set @code{bfd_error} on error; possible errors are: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - If output has already started for @var{abfd}. -@item -@code{bfd_error_no_memory} - If memory allocation fails. -@end itemize - -@findex bfd_make_section_anyway -@subsubsection @code{bfd_make_section_anyway} -@strong{Synopsis} -@example -asection *bfd_make_section_anyway (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Create a new empty section called @var{name} and attach it to the end of -the chain of sections for @var{abfd}. Create a new section even if there -is already a section with that name. - -Return @code{NULL} and set @code{bfd_error} on error; possible errors are: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - If output has already started for @var{abfd}. -@item -@code{bfd_error_no_memory} - If memory allocation fails. -@end itemize - -@findex bfd_make_section_with_flags -@subsubsection @code{bfd_make_section_with_flags} -@strong{Synopsis} -@example -asection *bfd_make_section_with_flags - (bfd *, const char *name, flagword flags); -@end example -@strong{Description}@* -Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling -bfd_set_error ()) without changing the section chain if there is already a -section named @var{name}. Also set the attributes of the new section to -the value @var{flags}. If there is an error, return @code{NULL} and set -@code{bfd_error}. - -@findex bfd_make_section -@subsubsection @code{bfd_make_section} -@strong{Synopsis} -@example -asection *bfd_make_section (bfd *, const char *name); -@end example -@strong{Description}@* -Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling -bfd_set_error ()) without changing the section chain if there is already a -section named @var{name}. If there is an error, return @code{NULL} and set -@code{bfd_error}. - -@findex bfd_set_section_flags -@subsubsection @code{bfd_set_section_flags} -@strong{Synopsis} -@example -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); -@end example -@strong{Description}@* -Set the attributes of the section @var{sec} in the BFD -@var{abfd} to the value @var{flags}. Return @code{TRUE} on success, -@code{FALSE} on error. Possible error returns are: - -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -The section cannot have one or more of the attributes -requested. For example, a .bss section in @code{a.out} may not -have the @code{SEC_HAS_CONTENTS} field set. -@end itemize - -@findex bfd_rename_section -@subsubsection @code{bfd_rename_section} -@strong{Synopsis} -@example -void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); -@end example -@strong{Description}@* -Rename section @var{sec} in @var{abfd} to @var{newname}. - -@findex bfd_map_over_sections -@subsubsection @code{bfd_map_over_sections} -@strong{Synopsis} -@example -void bfd_map_over_sections - (bfd *abfd, - void (*func) (bfd *abfd, asection *sect, void *obj), - void *obj); -@end example -@strong{Description}@* -Call the provided function @var{func} for each section -attached to the BFD @var{abfd}, passing @var{obj} as an -argument. The function will be called as if by - -@example - func (abfd, the_section, obj); -@end example - -This is the preferred method for iterating over sections; an -alternative would be to use a loop: - -@example - asection *p; - for (p = abfd->sections; p != NULL; p = p->next) - func (abfd, p, ...) -@end example - -@findex bfd_sections_find_if -@subsubsection @code{bfd_sections_find_if} -@strong{Synopsis} -@example -asection *bfd_sections_find_if - (bfd *abfd, - bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), - void *obj); -@end example -@strong{Description}@* -Call the provided function @var{operation} for each section -attached to the BFD @var{abfd}, passing @var{obj} as an -argument. The function will be called as if by - -@example - operation (abfd, the_section, obj); -@end example - -It returns the first section for which @var{operation} returns true. - -@findex bfd_set_section_size -@subsubsection @code{bfd_set_section_size} -@strong{Synopsis} -@example -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); -@end example -@strong{Description}@* -Set @var{sec} to the size @var{val}. If the operation is -ok, then @code{TRUE} is returned, else @code{FALSE}. - -Possible error returns: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -Writing has started to the BFD, so setting the size is invalid. -@end itemize - -@findex bfd_set_section_contents -@subsubsection @code{bfd_set_section_contents} -@strong{Synopsis} -@example -bfd_boolean bfd_set_section_contents - (bfd *abfd, asection *section, const void *data, - file_ptr offset, bfd_size_type count); -@end example -@strong{Description}@* -Sets the contents of the section @var{section} in BFD -@var{abfd} to the data starting in memory at @var{data}. The -data is written to the output section starting at offset -@var{offset} for @var{count} octets. - -Normally @code{TRUE} is returned, else @code{FALSE}. Possible error -returns are: -@itemize @bullet - -@item -@code{bfd_error_no_contents} - -The output section does not have the @code{SEC_HAS_CONTENTS} -attribute, so nothing can be written to it. -@item -and some more too -@end itemize -This routine is front end to the back end function -@code{_bfd_set_section_contents}. - -@findex bfd_get_section_contents -@subsubsection @code{bfd_get_section_contents} -@strong{Synopsis} -@example -bfd_boolean bfd_get_section_contents - (bfd *abfd, asection *section, void *location, file_ptr offset, - bfd_size_type count); -@end example -@strong{Description}@* -Read data from @var{section} in BFD @var{abfd} -into memory starting at @var{location}. The data is read at an -offset of @var{offset} from the start of the input section, -and is read for @var{count} bytes. - -If the contents of a constructor with the @code{SEC_CONSTRUCTOR} -flag set are requested or if the section does not have the -@code{SEC_HAS_CONTENTS} flag set, then the @var{location} is filled -with zeroes. If no errors occur, @code{TRUE} is returned, else -@code{FALSE}. - -@findex bfd_malloc_and_get_section -@subsubsection @code{bfd_malloc_and_get_section} -@strong{Synopsis} -@example -bfd_boolean bfd_malloc_and_get_section - (bfd *abfd, asection *section, bfd_byte **buf); -@end example -@strong{Description}@* -Read all data from @var{section} in BFD @var{abfd} -into a buffer, *@var{buf}, malloc'd by this function. - -@findex bfd_copy_private_section_data -@subsubsection @code{bfd_copy_private_section_data} -@strong{Synopsis} -@example -bfd_boolean bfd_copy_private_section_data - (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); -@end example -@strong{Description}@* -Copy private section information from @var{isec} in the BFD -@var{ibfd} to the section @var{osec} in 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{osec}. -@end itemize -@example -#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) -@end example - -@findex bfd_generic_is_group_section -@subsubsection @code{bfd_generic_is_group_section} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); -@end example -@strong{Description}@* -Returns TRUE if @var{sec} is a member of a group. - -@findex bfd_generic_discard_group -@subsubsection @code{bfd_generic_discard_group} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); -@end example -@strong{Description}@* -Remove all members of @var{group} from the output. - diff -Nur binutils-2.24.orig/bfd/doc/syms.texi binutils-2.24/bfd/doc/syms.texi --- binutils-2.24.orig/bfd/doc/syms.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/syms.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,480 +0,0 @@ -@section Symbols -BFD tries to maintain as much symbol information as it can when -it moves information from file to file. BFD passes information -to applications though the @code{asymbol} structure. When the -application requests the symbol table, BFD reads the table in -the native form and translates parts of it into the internal -format. To maintain more than the information passed to -applications, some targets keep some information ``behind the -scenes'' in a structure only the particular back end knows -about. For example, the coff back end keeps the original -symbol table structure as well as the canonical structure when -a BFD is read in. On output, the coff back end can reconstruct -the output symbol table so that no information is lost, even -information unique to coff which BFD doesn't know or -understand. If a coff symbol table were read, but were written -through an a.out back end, all the coff specific information -would be lost. The symbol table of a BFD -is not necessarily read in until a canonicalize request is -made. Then the BFD back end fills in a table provided by the -application with pointers to the canonical information. To -output symbols, the application provides BFD with a table of -pointers to pointers to @code{asymbol}s. This allows applications -like the linker to output a symbol as it was read, since the ``behind -the scenes'' information will be still available. -@menu -* Reading Symbols:: -* Writing Symbols:: -* Mini Symbols:: -* typedef asymbol:: -* symbol handling functions:: -@end menu - -@node Reading Symbols, Writing Symbols, Symbols, Symbols -@subsection Reading symbols -There are two stages to reading a symbol table from a BFD: -allocating storage, and the actual reading process. This is an -excerpt from an application which reads the symbol table: - -@example - long storage_needed; - asymbol **symbol_table; - long number_of_symbols; - long i; - - storage_needed = bfd_get_symtab_upper_bound (abfd); - - if (storage_needed < 0) - FAIL - - if (storage_needed == 0) - return; - - symbol_table = xmalloc (storage_needed); - ... - number_of_symbols = - bfd_canonicalize_symtab (abfd, symbol_table); - - if (number_of_symbols < 0) - FAIL - - for (i = 0; i < number_of_symbols; i++) - process_symbol (symbol_table[i]); -@end example - -All storage for the symbols themselves is in an objalloc -connected to the BFD; it is freed when the BFD is closed. - -@node Writing Symbols, Mini Symbols, Reading Symbols, Symbols -@subsection Writing symbols -Writing of a symbol table is automatic when a BFD open for -writing is closed. The application attaches a vector of -pointers to pointers to symbols to the BFD being written, and -fills in the symbol count. The close and cleanup code reads -through the table provided and performs all the necessary -operations. The BFD output code must always be provided with an -``owned'' symbol: one which has come from another BFD, or one -which has been created using @code{bfd_make_empty_symbol}. Here is an -example showing the creation of a symbol table with only one element: - -@example - #include "sysdep.h" - #include "bfd.h" - int main (void) - @{ - bfd *abfd; - asymbol *ptrs[2]; - asymbol *new; - - abfd = bfd_openw ("foo","a.out-sunos-big"); - bfd_set_format (abfd, bfd_object); - new = bfd_make_empty_symbol (abfd); - new->name = "dummy_symbol"; - new->section = bfd_make_section_old_way (abfd, ".text"); - new->flags = BSF_GLOBAL; - new->value = 0x12345; - - ptrs[0] = new; - ptrs[1] = 0; - - bfd_set_symtab (abfd, ptrs, 1); - bfd_close (abfd); - return 0; - @} - - ./makesym - nm foo - 00012345 A dummy_symbol -@end example - -Many formats cannot represent arbitrary symbol information; for -instance, the @code{a.out} object format does not allow an -arbitrary number of sections. A symbol pointing to a section -which is not one of @code{.text}, @code{.data} or @code{.bss} cannot -be described. - -@node Mini Symbols, typedef asymbol, Writing Symbols, Symbols -@subsection Mini Symbols -Mini symbols provide read-only access to the symbol table. -They use less memory space, but require more time to access. -They can be useful for tools like nm or objdump, which may -have to handle symbol tables of extremely large executables. - -The @code{bfd_read_minisymbols} function will read the symbols -into memory in an internal form. It will return a @code{void *} -pointer to a block of memory, a symbol count, and the size of -each symbol. The pointer is allocated using @code{malloc}, and -should be freed by the caller when it is no longer needed. - -The function @code{bfd_minisymbol_to_symbol} will take a pointer -to a minisymbol, and a pointer to a structure returned by -@code{bfd_make_empty_symbol}, and return a @code{asymbol} structure. -The return value may or may not be the same as the value from -@code{bfd_make_empty_symbol} which was passed in. - - -@node typedef asymbol, symbol handling functions, Mini Symbols, Symbols -@subsection typedef asymbol -An @code{asymbol} has the form: - - -@example - -typedef struct bfd_symbol -@{ - /* A pointer to the BFD which owns the symbol. This information - is necessary so that a back end can work out what additional - information (invisible to the application writer) is carried - with the symbol. - - This field is *almost* redundant, since you can use section->owner - instead, except that some symbols point to the global sections - bfd_@{abs,com,und@}_section. This could be fixed by making - these globals be per-bfd (or per-target-flavor). FIXME. */ - struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ - - /* The text of the symbol. The name is left alone, and not copied; the - application may not alter it. */ - const char *name; - - /* The value of the symbol. This really should be a union of a - numeric value with a pointer, since some flags indicate that - a pointer to another symbol is stored here. */ - symvalue value; - - /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 - - /* The symbol has local scope; @code{static} in @code{C}. The value - is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) - - /* The symbol has global scope; initialized data in @code{C}. The - value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) - - /* The symbol has global scope and is exported. The value is - the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ - - /* A normal C symbol would be one of: - @code{BSF_LOCAL}, @code{BSF_COMMON}, @code{BSF_UNDEFINED} or - @code{BSF_GLOBAL}. */ - - /* The symbol is a debugging record. The value has an arbitrary - meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) - - /* The symbol denotes a function entry point. Used in ELF, - perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) - - /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) - - /* A weak global symbol, overridable without warnings by - a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) - - /* This symbol was created to point to a section, e.g. ELF's - STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) - - /* The symbol used to be a common symbol, but now it is - allocated. */ -#define BSF_OLD_COMMON (1 << 9) - - /* In some files the type of a symbol sometimes alters its - location in an output file - ie in coff a @code{ISFCN} symbol - which is also @code{C_EXT} symbol appears where it was - declared and not at the end of a section. This bit is set - by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) - - /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) - - /* Signal that the symbol is a warning symbol. The name is a - warning. The name of the next symbol is the one to warn about; - if a reference is made to a symbol with the same name as the next - symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) - - /* Signal that the symbol is indirect. This symbol is an indirect - pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) - - /* BSF_FILE marks symbols that contain a file name. This is used - for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) - - /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) - - /* The symbol denotes a data object. Used in ELF, and perhaps - others someday. */ -#define BSF_OBJECT (1 << 16) - - /* This symbol is a debugging symbol. The value is the offset - into the section of the data. BSF_DEBUGGING should be set - as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) - - /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) - - /* This symbol represents a complex relocation expression, - with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) - - /* This symbol represents a signed complex relocation expression, - with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) - - /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) - - /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. - The dynamic linker will compute the value of this symbol by - calling the function that it points to. BSF_FUNCTION must - also be also set. */ -#define BSF_GNU_INDIRECT_FUNCTION (1 << 22) - /* This symbol is a globally unique data object. The dynamic linker - will make sure that in the entire process there is just one symbol - with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) - - flagword flags; - - /* A pointer to the section to which this symbol is - relative. This will always be non NULL, there are special - sections for undefined and absolute symbols. */ - struct bfd_section *section; - - /* Back end special data. */ - union - @{ - void *p; - bfd_vma i; - @} - udata; -@} -asymbol; - -@end example - -@node symbol handling functions, , typedef asymbol, Symbols -@subsection Symbol handling functions - - -@findex bfd_get_symtab_upper_bound -@subsubsection @code{bfd_get_symtab_upper_bound} -@strong{Description}@* -Return the number of bytes required to store a vector of pointers -to @code{asymbols} for all the symbols in the BFD @var{abfd}, -including a terminal NULL pointer. If there are no symbols in -the BFD, then return 0. If an error occurs, return -1. -@example -#define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) - -@end example - -@findex bfd_is_local_label -@subsubsection @code{bfd_is_local_label} -@strong{Synopsis} -@example -bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); -@end example -@strong{Description}@* -Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is -a compiler generated local label, else return FALSE. - -@findex bfd_is_local_label_name -@subsubsection @code{bfd_is_local_label_name} -@strong{Synopsis} -@example -bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Return TRUE if a symbol with the name @var{name} in the BFD -@var{abfd} is a compiler generated local label, else return -FALSE. This just checks whether the name has the form of a -local label. -@example -#define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) - -@end example - -@findex bfd_is_target_special_symbol -@subsubsection @code{bfd_is_target_special_symbol} -@strong{Synopsis} -@example -bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); -@end example -@strong{Description}@* -Return TRUE iff a symbol @var{sym} in the BFD @var{abfd} is something -special to the particular target represented by the BFD. Such symbols -should normally not be mentioned to the user. -@example -#define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) - -@end example - -@findex bfd_canonicalize_symtab -@subsubsection @code{bfd_canonicalize_symtab} -@strong{Description}@* -Read the symbols from the BFD @var{abfd}, and fills in -the vector @var{location} with pointers to the symbols and -a trailing NULL. -Return the actual number of symbol pointers, not -including the NULL. -@example -#define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) - -@end example - -@findex bfd_set_symtab -@subsubsection @code{bfd_set_symtab} -@strong{Synopsis} -@example -bfd_boolean bfd_set_symtab - (bfd *abfd, asymbol **location, unsigned int count); -@end example -@strong{Description}@* -Arrange that when the output BFD @var{abfd} is closed, -the table @var{location} of @var{count} pointers to symbols -will be written. - -@findex bfd_print_symbol_vandf -@subsubsection @code{bfd_print_symbol_vandf} -@strong{Synopsis} -@example -void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); -@end example -@strong{Description}@* -Print the value and flags of the @var{symbol} supplied to the -stream @var{file}. - -@findex bfd_make_empty_symbol -@subsubsection @code{bfd_make_empty_symbol} -@strong{Description}@* -Create a new @code{asymbol} structure for the BFD @var{abfd} -and return a pointer to it. - -This routine is necessary because each back end has private -information surrounding the @code{asymbol}. Building your own -@code{asymbol} and pointing to it will not create the private -information, and will cause problems later on. -@example -#define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) - -@end example - -@findex _bfd_generic_make_empty_symbol -@subsubsection @code{_bfd_generic_make_empty_symbol} -@strong{Synopsis} -@example -asymbol *_bfd_generic_make_empty_symbol (bfd *); -@end example -@strong{Description}@* -Create a new @code{asymbol} structure for the BFD @var{abfd} -and return a pointer to it. Used by core file routines, -binary back-end and anywhere else where no private info -is needed. - -@findex bfd_make_debug_symbol -@subsubsection @code{bfd_make_debug_symbol} -@strong{Description}@* -Create a new @code{asymbol} structure for the BFD @var{abfd}, -to be used as a debugging symbol. Further details of its use have -yet to be worked out. -@example -#define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) - -@end example - -@findex bfd_decode_symclass -@subsubsection @code{bfd_decode_symclass} -@strong{Description}@* -Return a character corresponding to the symbol -class of @var{symbol}, or '?' for an unknown class. - -@strong{Synopsis} -@example -int bfd_decode_symclass (asymbol *symbol); -@end example -@findex bfd_is_undefined_symclass -@subsubsection @code{bfd_is_undefined_symclass} -@strong{Description}@* -Returns non-zero if the class symbol returned by -bfd_decode_symclass represents an undefined symbol. -Returns zero otherwise. - -@strong{Synopsis} -@example -bfd_boolean bfd_is_undefined_symclass (int symclass); -@end example -@findex bfd_symbol_info -@subsubsection @code{bfd_symbol_info} -@strong{Description}@* -Fill in the basic info about symbol that nm needs. -Additional info may be added by the back-ends after -calling this function. - -@strong{Synopsis} -@example -void bfd_symbol_info (asymbol *symbol, symbol_info *ret); -@end example -@findex bfd_copy_private_symbol_data -@subsubsection @code{bfd_copy_private_symbol_data} -@strong{Synopsis} -@example -bfd_boolean bfd_copy_private_symbol_data - (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); -@end example -@strong{Description}@* -Copy private symbol information from @var{isym} in the BFD -@var{ibfd} to the symbol @var{osym} in 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{osec}. -@end itemize -@example -#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) - -@end example - diff -Nur binutils-2.24.orig/bfd/doc/targets.texi binutils-2.24/bfd/doc/targets.texi --- binutils-2.24.orig/bfd/doc/targets.texi 2013-11-18 09:49:27.000000000 +0100 +++ binutils-2.24/bfd/doc/targets.texi 1970-01-01 01:00:00.000000000 +0100 @@ -1,621 +0,0 @@ -@section Targets - - -@strong{Description}@* -Each port of BFD to a different machine requires the creation -of a target back end. All the back end provides to the root -part of BFD is a structure containing pointers to functions -which perform certain low level operations on files. BFD -translates the applications's requests through a pointer into -calls to the back end routines. - -When a file is opened with @code{bfd_openr}, its format and -target are unknown. BFD uses various mechanisms to determine -how to interpret the file. The operations performed are: - -@itemize @bullet - -@item -Create a BFD by calling the internal routine -@code{_bfd_new_bfd}, then call @code{bfd_find_target} with the -target string supplied to @code{bfd_openr} and the new BFD pointer. - -@item -If a null target string was provided to @code{bfd_find_target}, -look up the environment variable @code{GNUTARGET} and use -that as the target string. - -@item -If the target string is still @code{NULL}, or the target string is -@code{default}, then use the first item in the target vector -as the target type, and set @code{target_defaulted} in the BFD to -cause @code{bfd_check_format} to loop through all the targets. -@xref{bfd_target}. @xref{Formats}. - -@item -Otherwise, inspect the elements in the target vector -one by one, until a match on target name is found. When found, -use it. - -@item -Otherwise return the error @code{bfd_error_invalid_target} to -@code{bfd_openr}. - -@item -@code{bfd_openr} attempts to open the file using -@code{bfd_open_file}, and returns the BFD. -@end itemize -Once the BFD has been opened and the target selected, the file -format may be determined. This is done by calling -@code{bfd_check_format} on the BFD with a suggested format. -If @code{target_defaulted} has been set, each possible target -type is tried to see if it recognizes the specified format. -@code{bfd_check_format} returns @code{TRUE} when the caller guesses right. -@menu -* bfd_target:: -@end menu - -@node bfd_target, , Targets, Targets - -@subsection bfd_target - - -@strong{Description}@* -This structure contains everything that BFD knows about a -target. It includes things like its byte order, name, and which -routines to call to do various operations. - -Every BFD points to a target structure with its @code{xvec} -member. - -The macros below are used to dispatch to functions through the -@code{bfd_target} vector. They are used in a number of macros further -down in @file{bfd.h}, and are also used when calling various -routines by hand inside the BFD implementation. The @var{arglist} -argument must be parenthesized; it contains all the arguments -to the called function. - -They make the documentation (more) unpleasant to read, so if -someone wants to fix this and not break the above, please do. -@example -#define BFD_SEND(bfd, message, arglist) \ - ((*((bfd)->xvec->message)) arglist) - -#ifdef DEBUG_BFD_SEND -#undef BFD_SEND -#define BFD_SEND(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - ((*((bfd)->xvec->message)) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) -#endif -@end example -For operations which index on the BFD format: -@example -#define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) - -#ifdef DEBUG_BFD_SEND -#undef BFD_SEND_FMT -#define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) -#endif - -@end example -This is the structure which defines the type of BFD this is. The -@code{xvec} member of the struct @code{bfd} itself points here. Each -module that implements access to a different target under BFD, -defines one of these. - -FIXME, these names should be rationalised with the names of -the entry points which call them. Too bad we can't have one -macro to define them both! -@example -enum bfd_flavour -@{ - bfd_target_unknown_flavour, - bfd_target_aout_flavour, - bfd_target_coff_flavour, - bfd_target_ecoff_flavour, - bfd_target_xcoff_flavour, - bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, - bfd_target_tekhex_flavour, - bfd_target_srec_flavour, - bfd_target_verilog_flavour, - bfd_target_ihex_flavour, - bfd_target_som_flavour, - bfd_target_os9k_flavour, - bfd_target_versados_flavour, - bfd_target_msdos_flavour, - bfd_target_ovax_flavour, - bfd_target_evax_flavour, - bfd_target_mmo_flavour, - bfd_target_mach_o_flavour, - bfd_target_pef_flavour, - bfd_target_pef_xlib_flavour, - bfd_target_sym_flavour -@}; - -enum bfd_endian @{ BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN @}; - -/* Forward declaration. */ -typedef struct bfd_link_info _bfd_link_info; - -/* Forward declaration. */ -typedef struct flag_info flag_info; - -typedef struct bfd_target -@{ - /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; - - /* The "flavour" of a back end is a general indication about - the contents of a file. */ - enum bfd_flavour flavour; - - /* The order of bytes within the data area of a file. */ - enum bfd_endian byteorder; - - /* The order of bytes within the header parts of a file. */ - enum bfd_endian header_byteorder; - - /* A mask of all the flags which an executable may have set - - from the set @code{BFD_NO_FLAGS}, @code{HAS_RELOC}, ...@code{D_PAGED}. */ - flagword object_flags; - - /* A mask of all the flags which a section may have set - from - the set @code{SEC_NO_FLAGS}, @code{SEC_ALLOC}, ...@code{SET_NEVER_LOAD}. */ - flagword section_flags; - - /* The character normally found at the front of a symbol. - (if any), perhaps `_'. */ - char symbol_leading_char; - - /* The pad character for file names within an archive header. */ - char ar_pad_char; - - /* The maximum number of characters in an archive header. */ - unsigned char ar_max_namelen; - - /* How well this target matches, used to select between various - possible targets when more than one target matches. */ - unsigned char match_priority; - - /* Entries for byte swapping for data. These are different from the - other entry points, since they don't take a BFD as the first argument. - Certain other handlers could do the same. */ - bfd_uint64_t (*bfd_getx64) (const void *); - bfd_int64_t (*bfd_getx_signed_64) (const void *); - void (*bfd_putx64) (bfd_uint64_t, void *); - bfd_vma (*bfd_getx32) (const void *); - bfd_signed_vma (*bfd_getx_signed_32) (const void *); - void (*bfd_putx32) (bfd_vma, void *); - bfd_vma (*bfd_getx16) (const void *); - bfd_signed_vma (*bfd_getx_signed_16) (const void *); - void (*bfd_putx16) (bfd_vma, void *); - - /* Byte swapping for the headers. */ - bfd_uint64_t (*bfd_h_getx64) (const void *); - bfd_int64_t (*bfd_h_getx_signed_64) (const void *); - void (*bfd_h_putx64) (bfd_uint64_t, void *); - bfd_vma (*bfd_h_getx32) (const void *); - bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); - void (*bfd_h_putx32) (bfd_vma, void *); - bfd_vma (*bfd_h_getx16) (const void *); - bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); - void (*bfd_h_putx16) (bfd_vma, void *); - - /* Format dependent routines: these are vectors of entry points - within the target vector structure, one for each format to check. */ - - /* Check the format of a file being read. Return a @code{bfd_target *} or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); - - /* Set the format of a file being written. */ - bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); - - /* Write cached information into a file being written, at @code{bfd_close}. */ - bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); - -@end example -The general target vector. These vectors are initialized using the -BFD_JUMP_TABLE macros. -@example - - /* Generic entry points. */ -#define BFD_JUMP_TABLE_GENERIC(NAME) \ - NAME##_close_and_cleanup, \ - NAME##_bfd_free_cached_info, \ - NAME##_new_section_hook, \ - NAME##_get_section_contents, \ - NAME##_get_section_contents_in_window - - /* Called when the BFD is being closed to do any necessary cleanup. */ - bfd_boolean (*_close_and_cleanup) (bfd *); - /* Ask the BFD to free all cached information. */ - bfd_boolean (*_bfd_free_cached_info) (bfd *); - /* Called when a new section is created. */ - bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); - /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); - - /* Entry points to copy private data. */ -#define BFD_JUMP_TABLE_COPY(NAME) \ - NAME##_bfd_copy_private_bfd_data, \ - NAME##_bfd_merge_private_bfd_data, \ - _bfd_generic_init_private_section_data, \ - NAME##_bfd_copy_private_section_data, \ - NAME##_bfd_copy_private_symbol_data, \ - NAME##_bfd_copy_private_header_data, \ - NAME##_bfd_set_private_flags, \ - NAME##_bfd_print_private_bfd_data - - /* Called to copy BFD general private data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); - /* Called to merge BFD general private data from one object file - to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); - /* Called to initialize BFD private section data from one object file - to another. */ -#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); - /* Called to copy BFD private section data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); - /* Called to copy BFD private symbol data from one symbol - to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); - /* Called to copy BFD private header data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); - /* Called to set private backend flags. */ - bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); - - /* Called to print private BFD data. */ - bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); - - /* Core file entry points. */ -#define BFD_JUMP_TABLE_CORE(NAME) \ - NAME##_core_file_failing_command, \ - NAME##_core_file_failing_signal, \ - NAME##_core_file_matches_executable_p, \ - NAME##_core_file_pid - - char * (*_core_file_failing_command) (bfd *); - int (*_core_file_failing_signal) (bfd *); - bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); - int (*_core_file_pid) (bfd *); - - /* Archive entry points. */ -#define BFD_JUMP_TABLE_ARCHIVE(NAME) \ - NAME##_slurp_armap, \ - NAME##_slurp_extended_name_table, \ - NAME##_construct_extended_name_table, \ - NAME##_truncate_arname, \ - NAME##_write_armap, \ - NAME##_read_ar_hdr, \ - NAME##_write_ar_hdr, \ - NAME##_openr_next_archived_file, \ - NAME##_get_elt_at_index, \ - NAME##_generic_stat_arch_elt, \ - NAME##_update_armap_timestamp - - bfd_boolean (*_bfd_slurp_armap) (bfd *); - bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); - void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); - void * (*_bfd_read_ar_hdr_fn) (bfd *); - bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); - bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) - bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); - int (*_bfd_stat_arch_elt) (bfd *, struct stat *); - bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); - - /* Entry points used for symbols. */ -#define BFD_JUMP_TABLE_SYMBOLS(NAME) \ - NAME##_get_symtab_upper_bound, \ - NAME##_canonicalize_symtab, \ - NAME##_make_empty_symbol, \ - NAME##_print_symbol, \ - NAME##_get_symbol_info, \ - NAME##_bfd_is_local_label_name, \ - NAME##_bfd_is_target_special_symbol, \ - NAME##_get_lineno, \ - NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ - NAME##_find_inliner_info, \ - NAME##_bfd_make_debug_symbol, \ - NAME##_read_minisymbols, \ - NAME##_minisymbol_to_symbol - - long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); - struct bfd_symbol * - (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) - bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); - bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); - alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); - bfd_boolean (*_bfd_find_inliner_info) - (bfd *, const char **, const char **, unsigned int *); - /* Back-door to allow format-aware applications to create debug symbols - while using BFD for everything else. Currently used by the assembler - when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); -#define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); -#define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); - - /* Routines for relocs. */ -#define BFD_JUMP_TABLE_RELOCS(NAME) \ - NAME##_get_reloc_upper_bound, \ - NAME##_canonicalize_reloc, \ - NAME##_bfd_reloc_type_lookup, \ - NAME##_bfd_reloc_name_lookup - - long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); - /* See documentation on reloc types. */ - reloc_howto_type * - (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); - reloc_howto_type * - (*reloc_name_lookup) (bfd *, const char *); - - - /* Routines used when writing an object file. */ -#define BFD_JUMP_TABLE_WRITE(NAME) \ - NAME##_set_arch_mach, \ - NAME##_set_section_contents - - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); - - /* Routines used by the linker. */ -#define BFD_JUMP_TABLE_LINK(NAME) \ - NAME##_sizeof_headers, \ - NAME##_bfd_get_relocated_section_contents, \ - NAME##_bfd_relax_section, \ - NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ - NAME##_bfd_link_add_symbols, \ - NAME##_bfd_link_just_syms, \ - NAME##_bfd_copy_link_hash_symbol_type, \ - NAME##_bfd_final_link, \ - NAME##_bfd_link_split_section, \ - NAME##_bfd_gc_sections, \ - NAME##_bfd_lookup_section_flags, \ - NAME##_bfd_merge_sections, \ - NAME##_bfd_is_group_section, \ - NAME##_bfd_discard_group, \ - NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol - - int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); - - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); - - /* Create a hash table for the linker. Different backends store - different information in this table. */ - struct bfd_link_hash_table * - (*_bfd_link_hash_table_create) (bfd *); - - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - - /* Add symbols from this object file into the hash table. */ - bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); - - /* Indicate that we are only retrieving symbol values from this section. */ - void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - - /* Copy the symbol type of a linker hash table entry. */ -#define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); - - /* Do a link based on the link_order structures attached to each - section of the BFD. */ - bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); - - /* Should this section be split up into smaller pieces during linking. */ - bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); - - /* Remove sections that are not referenced from the output. */ - bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); - - /* Sets the bitmask of allowed and disallowed section flags. */ - bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); - - /* Attempt to merge SEC_MERGE sections. */ - bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); - - /* Is this section a member of a group? */ - bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); - - /* Discard members of a group. */ - bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); - - /* Check if SEC has been already linked during a reloceatable or - final link. */ - bfd_boolean (*_section_already_linked) (bfd *, asection *, - struct bfd_link_info *); - - /* Define a common symbol. */ - bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, - struct bfd_link_hash_entry *); - - /* Routines to handle dynamic symbols and relocs. */ -#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ - NAME##_get_dynamic_symtab_upper_bound, \ - NAME##_canonicalize_dynamic_symtab, \ - NAME##_get_synthetic_symtab, \ - NAME##_get_dynamic_reloc_upper_bound, \ - NAME##_canonicalize_dynamic_reloc - - /* Get the amount of memory required to hold the dynamic symbols. */ - long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); - /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); - /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); - /* Get the amount of memory required to hold the dynamic relocs. */ - long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); - /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); - -@end example -A pointer to an alternative bfd_target in case the current one is not -satisfactory. This can happen when the target cpu supports both big -and little endian code, and target chosen by the linker has the wrong -endianness. The function open_output() in ld/ldlang.c uses this field -to find an alternative output format that is suitable. -@example - /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; - - /* Data for use by back-end routines, which isn't - generic enough to belong in this structure. */ - const void *backend_data; - -@} bfd_target; - -@end example - -@findex bfd_set_default_target -@subsubsection @code{bfd_set_default_target} -@strong{Synopsis} -@example -bfd_boolean bfd_set_default_target (const char *name); -@end example -@strong{Description}@* -Set the default target vector to use when recognizing a BFD. -This takes the name of the target, which may be a BFD target -name or a configuration triplet. - -@findex bfd_find_target -@subsubsection @code{bfd_find_target} -@strong{Synopsis} -@example -const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); -@end example -@strong{Description}@* -Return a pointer to the transfer vector for the object target -named @var{target_name}. If @var{target_name} is @code{NULL}, -choose the one in the environment variable @code{GNUTARGET}; if -that is null or not defined, then choose the first entry in the -target list. Passing in the string "default" or setting the -environment variable to "default" will cause the first entry in -the target list to be returned, and "target_defaulted" will be -set in the BFD if @var{abfd} isn't @code{NULL}. This causes -@code{bfd_check_format} to loop over all the targets to find the -one that matches the file being read. - -@findex bfd_get_target_info -@subsubsection @code{bfd_get_target_info} -@strong{Synopsis} -@example -const bfd_target *bfd_get_target_info (const char *target_name, - bfd *abfd, - bfd_boolean *is_bigendian, - int *underscoring, - const char **def_target_arch); -@end example -@strong{Description}@* -Return a pointer to the transfer vector for the object target -named @var{target_name}. If @var{target_name} is @code{NULL}, -choose the one in the environment variable @code{GNUTARGET}; if -that is null or not defined, then choose the first entry in the -target list. Passing in the string "default" or setting the -environment variable to "default" will cause the first entry in -the target list to be returned, and "target_defaulted" will be -set in the BFD if @var{abfd} isn't @code{NULL}. This causes -@code{bfd_check_format} to loop over all the targets to find the -one that matches the file being read. -If @var{is_bigendian} is not @code{NULL}, then set this value to target's -endian mode. True for big-endian, FALSE for little-endian or for -invalid target. -If @var{underscoring} is not @code{NULL}, then set this value to target's -underscoring mode. Zero for none-underscoring, -1 for invalid target, -else the value of target vector's symbol underscoring. -If @var{def_target_arch} is not @code{NULL}, then set it to the architecture -string specified by the target_name. - -@findex bfd_target_list -@subsubsection @code{bfd_target_list} -@strong{Synopsis} -@example -const char ** bfd_target_list (void); -@end example -@strong{Description}@* -Return a freshly malloced NULL-terminated -vector of the names of all the valid BFD targets. Do not -modify the names. - -@findex bfd_seach_for_target -@subsubsection @code{bfd_seach_for_target} -@strong{Synopsis} -@example -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); -@end example -@strong{Description}@* -Return a pointer to the first transfer vector in the list of -transfer vectors maintained by BFD that produces a non-zero -result when passed to the function @var{search_func}. The -parameter @var{data} is passed, unexamined, to the search -function. - diff -Nur binutils-2.24.orig/bfd/elf32-nds32.c binutils-2.24/bfd/elf32-nds32.c --- binutils-2.24.orig/bfd/elf32-nds32.c 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/bfd/elf32-nds32.c 2016-06-30 21:26:12.569889845 +0200 @@ -0,0 +1,20274 @@ +/* NDS32-specific support for 32-bit ELF. + Copyright (C) 2012-2013 Free Software Foundation, Inc. + Contributed by Andes Technology Corporation. + + 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA.*/ + + +#include "sysdep.h" +#include "bfd.h" +#include "bfd_stdint.h" +#include "bfdlink.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "libiberty.h" +#include "bfd_stdint.h" +#include "elf/nds32.h" +#include "opcode/nds32.h" +#include "elf32-nds32.h" +#include "opcode/cgen.h" +#include "../opcodes/nds32-opc.h" + +/* Relocation HOWTO functions. */ +static bfd_reloc_status_type nds32_elf_ignore_reloc + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); +static bfd_reloc_status_type nds32_elf_9_pcrel_reloc + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); +static bfd_reloc_status_type nds32_elf_hi20_reloc + (bfd *, arelent *, asymbol *, void *, + asection *, bfd *, char **); +static bfd_reloc_status_type nds32_elf_lo12_reloc + (bfd *, arelent *, asymbol *, void *, + asection *, bfd *, char **); +static bfd_reloc_status_type nds32_elf_generic_reloc + (bfd *, arelent *, asymbol *, void *, + asection *, bfd *, char **); +static bfd_reloc_status_type nds32_elf_sda15_reloc + (bfd *, arelent *, asymbol *, void *, + asection *, bfd *, char **); + +/* Helper functions for HOWTO. */ +static bfd_reloc_status_type nds32_elf_do_9_pcrel_reloc + (bfd *, reloc_howto_type *, asection *, bfd_byte *, bfd_vma, + asection *, bfd_vma, bfd_vma); +static void nds32_elf_relocate_hi20 + (bfd *, int, Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_byte *, bfd_vma); +static reloc_howto_type *bfd_elf32_bfd_reloc_type_table_lookup + (enum elf_nds32_reloc_type); +static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup + (bfd *, bfd_reloc_code_real_type); + +/* Target hooks. */ +static void nds32_info_to_howto_rel + (bfd *, arelent *, Elf_Internal_Rela *dst); +static void nds32_info_to_howto + (bfd *, arelent *, Elf_Internal_Rela *dst); +static bfd_boolean nds32_elf_add_symbol_hook + (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **, + flagword *, asection **, bfd_vma *); +static bfd_boolean nds32_elf_relocate_section + (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **); +static bfd_boolean nds32_elf_object_p (bfd *); +static void nds32_elf_final_write_processing (bfd *, bfd_boolean); +static bfd_boolean nds32_elf_set_private_flags (bfd *, flagword); +static bfd_boolean nds32_elf_merge_private_bfd_data (bfd *, bfd *); +static bfd_boolean nds32_elf_print_private_bfd_data (bfd *, void *); +static bfd_boolean nds32_elf_gc_sweep_hook + (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); +static bfd_boolean nds32_elf_check_relocs + (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); +static asection *nds32_elf_gc_mark_hook + (asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *); +static bfd_boolean nds32_elf_adjust_dynamic_symbol + (struct bfd_link_info *, struct elf_link_hash_entry *); +static bfd_boolean nds32_elf_size_dynamic_sections + (bfd *, struct bfd_link_info *); +static bfd_boolean nds32_elf_create_dynamic_sections + (bfd *, struct bfd_link_info *); +static bfd_boolean nds32_elf_finish_dynamic_sections + (bfd *, struct bfd_link_info *info); +static bfd_boolean nds32_elf_finish_dynamic_symbol + (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *); +static bfd_boolean nds32_elf_mkobject (bfd *); + +/* Nds32 helper functions. */ +static bfd_reloc_status_type nds32_elf_final_sda_base + (bfd *, struct bfd_link_info *, bfd_vma *, bfd_boolean); +static bfd_boolean allocate_dynrelocs (struct elf_link_hash_entry *, void *); +static bfd_boolean readonly_dynrelocs (struct elf_link_hash_entry *, void *); +static Elf_Internal_Rela *find_relocs_at_address + (Elf_Internal_Rela *, Elf_Internal_Rela *, + Elf_Internal_Rela *, enum elf_nds32_reloc_type); +static bfd_vma calculate_memory_address +(bfd *, Elf_Internal_Rela *, Elf_Internal_Sym *, Elf_Internal_Shdr *); +static int nds32_get_section_contents (bfd *, asection *, + bfd_byte **, bfd_boolean); +static int nds32_elf_ex9_init (void); +static bfd_boolean nds32_elf_ex9_build_hash_table +(bfd *, asection *, struct bfd_link_info *); +static bfd_boolean nds32_elf_ex9_itb_base (struct bfd_link_info *); +static void nds32_elf_ex9_import_table (struct bfd_link_info *); +static void nds32_elf_ex9_finish (struct bfd_link_info *); +static void nds32_elf_ex9_reloc_jmp (struct bfd_link_info *); +static void nds32_elf_get_insn_with_reg + (Elf_Internal_Rela *, uint32_t, uint32_t *); +static int nds32_get_local_syms (bfd *, asection *ATTRIBUTE_UNUSED, + Elf_Internal_Sym **); +static bfd_boolean nds32_elf_ex9_replace_instruction + (struct bfd_link_info *, bfd *, asection *); +static int nds32_elf_ifc_init (void); +static bfd_boolean nds32_elf_ifc_calc (struct bfd_link_info *, bfd *, + asection *); +static void nds32_elf_ifc_cse_algo (struct bfd_link_info *); +static bfd_boolean nds32_elf_ifc_finish (struct bfd_link_info *); +static bfd_boolean nds32_elf_ifc_replace (struct bfd_link_info *); +static bfd_boolean nds32_elf_ifc_trace_code (struct bfd_link_info *, + bfd *,asection *); +static bfd_boolean nds32_elf_ifc_reloc (void); +static bfd_boolean nds32_relax_fp_as_gp + (struct bfd_link_info *link_info, bfd *abfd, asection *sec, + Elf_Internal_Rela *internal_relocs, Elf_Internal_Rela *irelend, + Elf_Internal_Sym *isymbuf); +static bfd_boolean nds32_fag_remove_unused_fpbase + (bfd *abfd, asection *sec, Elf_Internal_Rela *internal_relocs, + Elf_Internal_Rela *irelend); +static bfd_byte* +nds32_elf_get_relocated_section_contents (bfd *abfd, + struct bfd_link_info *link_info, + struct bfd_link_order *link_order, + bfd_byte *data, + bfd_boolean relocatable, + asymbol **symbols); +static void nds32_elf_ict_hash_init (void); +static void nds32_elf_ict_relocate (struct bfd_link_info *); +static asection* +nds32_elf_get_target_section (struct bfd_link_info *, char *); + +enum +{ + MACH_V1 = bfd_mach_n1h, + MACH_V2 = bfd_mach_n1h_v2, + MACH_V3 = bfd_mach_n1h_v3, + MACH_V3M = bfd_mach_n1h_v3m, +}; + +#define MIN(a, b) ((a) > (b) ? (b) : (a)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + +/* True if insn is 4byte. */ +#define INSN_32BIT(insn) ((((insn) & 0x80000000) == 0 ? (TRUE) : (FALSE))) + +/* The name of the dynamic interpreter. This is put in the .interp + section. */ +#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" + +/**/ +#define NDS32_GUARD_SEC_P(flags) ((flags) & SEC_ALLOC \ + && (flags) & SEC_LOAD \ + && (flags) & SEC_READONLY) + +/* The nop opcode we use. */ +#define NDS32_NOP32 0x40000009 +#define NDS32_NOP16 0x9200 + +/* The size in bytes of an entry in the procedure linkage table. */ +#define PLT_ENTRY_SIZE 24 +#define PLT_HEADER_SIZE 24 + +/* The first entry in a procedure linkage table are reserved, + and the initial contents are unimportant (we zero them out). + Subsequent entries look like this. */ +#define PLT0_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(.got+4) */ +#define PLT0_ENTRY_WORD1 0x58f78000 /* ori r15, r25, LO12(.got+4) */ +#define PLT0_ENTRY_WORD2 0x05178000 /* lwi r17, [r15+0] */ +#define PLT0_ENTRY_WORD3 0x04f78001 /* lwi r15, [r15+4] */ +#define PLT0_ENTRY_WORD4 0x4a003c00 /* jr r15 */ + +/* $ta is change to $r15 (from $r25). */ +#define PLT0_PIC_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(got[1]@GOT) */ +#define PLT0_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[1]@GOT) */ +#define PLT0_PIC_ENTRY_WORD2 0x40f7f400 /* add r15, gp, r15 */ +#define PLT0_PIC_ENTRY_WORD3 0x05178000 /* lwi r17, [r15+0] */ +#define PLT0_PIC_ENTRY_WORD4 0x04f78001 /* lwi r15, [r15+4] */ +#define PLT0_PIC_ENTRY_WORD5 0x4a003c00 /* jr r15 */ + +#define PLT_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(&got[n+3]) */ +#define PLT_ENTRY_WORD1 0x04f78000 /* lwi r15, r15, LO12(&got[n+3]) */ +#define PLT_ENTRY_WORD2 0x4a003c00 /* jr r15 */ +#define PLT_ENTRY_WORD3 0x45000000 /* movi r16, sizeof(RELA) * n */ +#define PLT_ENTRY_WORD4 0x48000000 /* j .plt0. */ + +#define PLT_PIC_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(got[n+3]@GOT) */ +#define PLT_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[n+3]@GOT) */ +#define PLT_PIC_ENTRY_WORD2 0x38febc02 /* lw r15, [gp+r15] */ +#define PLT_PIC_ENTRY_WORD3 0x4a003c00 /* jr r15 */ +#define PLT_PIC_ENTRY_WORD4 0x45000000 /* movi r16, sizeof(RELA) * n */ +#define PLT_PIC_ENTRY_WORD5 0x48000000 /* j .plt0 */ + +/* These are macros used to get the relocation accurate value. */ +#define ACCURATE_8BIT_S1 (0x100) +#define ACCURATE_U9BIT_S1 (0x400) +#define ACCURATE_12BIT_S1 (0x2000) +#define ACCURATE_14BIT_S1 (0x4000) +#define ACCURATE_19BIT (0x40000) + +/* These are macros used to get the relocation conservative value. */ +#define CONSERVATIVE_8BIT_S1 (0x100 - 4) +#define CONSERVATIVE_14BIT_S1 (0x4000 - 4) +#define CONSERVATIVE_16BIT_S1 (0x10000 - 4) +#define CONSERVATIVE_24BIT_S1 (0x1000000 - 4) +/* These must be more conservative because the address may be in + different segment. */ +#define CONSERVATIVE_15BIT (0x4000 - 0x1000) +#define CONSERVATIVE_15BIT_S1 (0x8000 - 0x1000) +#define CONSERVATIVE_15BIT_S2 (0x10000 - 0x1000) +#define CONSERVATIVE_19BIT (0x40000 - 0x1000) +#define CONSERVATIVE_20BIT (0x80000 - 0x1000) + +#define NDS32_ICT_SECTION ".nds32.ict" + +/* Size of small data/bss sections, used to calculate SDA_BASE. */ +static long got_size = 0; +static int is_SDA_BASE_set = 0; +static int is_ITB_BASE_set = 0; + +/* Convert ELF-VER in eflags to string for debugging purpose. */ +static const char *const nds32_elfver_strtab[] = { + "ELF-1.2", + "ELF-1.3", + "ELF-1.4", +}; + +/* The nds32 linker needs to keep track of the number of relocs that it + decides to copy in check_relocs for each symbol. This is so that + it can discard PC relative relocs if it doesn't need them when + linking with -Bsymbolic. We store the information in a field + extending the regular ELF linker hash table. */ + +/* This structure keeps track of the number of PC relative relocs we + have copied for a given symbol. */ + +struct elf_nds32_pcrel_relocs_copied +{ + /* Next section. */ + struct elf_nds32_pcrel_relocs_copied *next; + /* A section in dynobj. */ + asection *section; + /* Number of relocs copied in this section. */ + bfd_size_type count; +}; + +/* The sh 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_nds32_dyn_relocs +{ + struct elf_nds32_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; +}; + +/* Nds32 ELF linker hash entry. */ + +enum elf_nds32_tls_type +{ + GOT_UNKNOWN = (0), + GOT_NORMAL = (1 << 0), + GOT_TLS_LE = (1 << 1), + GOT_TLS_IE = (1 << 2), + GOT_TLS_IEGP = (1 << 3), + GOT_TLS_LD = (1 << 4), + GOT_TLS_GD = (1 << 5), + GOT_TLS_DESC = (1 << 6), +}; + +struct elf_nds32_link_hash_entry +{ + struct elf_link_hash_entry root; + + /* Track dynamic relocs copied for this symbol. */ + struct elf_nds32_dyn_relocs *dyn_relocs; + + /* For checking relocation type. */ + enum elf_nds32_tls_type tls_type; + + int offset_to_gp; + + /* For saving function attribute indirect_call and entry address. */ + bfd_boolean indirect_call; +}; + +/* Get the nds32 ELF linker hash table from a link_info structure. */ + +#define FP_BASE_NAME "_FP_BASE_" +static int check_start_export_sym = 0; +static size_t ex9_relax_size = 0; /* Save ex9 predicted reducing size. */ +static asection *ex9_section = NULL; +/* File for exporting indirect call table. */ +static FILE *ict_file = NULL; +static bfd_boolean ignore_indirect_call = FALSE; + +/* Rom-patch symbol hash table. */ +struct elf_nds32_ict_hash_entry +{ + struct bfd_hash_entry root; + struct elf_link_hash_entry *h; + unsigned int order; +}; + +/* Rom-patch hash table. */ +static struct bfd_hash_table indirect_call_table; + +/* Table to save initial crc table. */ +static unsigned short byte_crc_table[256]; +static unsigned short byte_inv_crc_table[256]; + +/* The offset for executable tls relaxation. */ +#define TP_OFFSET 0x0 + +typedef struct +{ + int min_id; + int max_id; + int count; + int bias; + int init; +} elf32_nds32_relax_group_t; + +struct elf_nds32_obj_tdata +{ + struct elf_obj_tdata root; + + /* tls_type for each local got entry. */ + char *local_got_tls_type; + + unsigned int hdr_size; + + /* GOTPLT entries for TLS descriptors. */ + bfd_vma *local_tlsdesc_gotent; + + int* offset_to_gp; + + /* for R_NDS32_RELAX_GROUP handling. */ + elf32_nds32_relax_group_t relax_group; +}; + +#define elf_nds32_tdata(bfd) \ + ((struct elf_nds32_obj_tdata *) (bfd)->tdata.any) + +#define elf32_nds32_local_got_tls_type(bfd) \ + (elf_nds32_tdata (bfd)->local_got_tls_type) + +#define elf32_nds32_local_gp_offset(bfd) \ + (elf_nds32_tdata (bfd)->offset_to_gp) + +#define elf32_nds32_relax_group_ptr(bfd) \ + &(elf_nds32_tdata (bfd)->relax_group) + +#define elf32_nds32_hash_entry(ent) ((struct elf_nds32_link_hash_entry *)(ent)) + +bfd_boolean +nds32_elf_mkobject (bfd *abfd) +{ + return bfd_elf_allocate_object (abfd, sizeof (struct elf_nds32_obj_tdata), + NDS32_ELF_DATA); +} + + +/* Relocations used for relocation. */ +/* NOTE! + the index order must be the same with elf_nds32_reloc_type in + include/elf/nds32.h + */ +#define HOWTO2(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ + [C] = HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) + +static reloc_howto_type nds32_elf_howto_table[] = { + /* This reloc does nothing. */ + HOWTO2 (R_NDS32_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_NDS32_NONE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 16 bit absolute relocation. */ + HOWTO2 (R_NDS32_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + nds32_elf_generic_reloc,/* special_function */ + "R_NDS32_16", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 32 bit absolute relocation. */ + HOWTO2 (R_NDS32_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + nds32_elf_generic_reloc,/* special_function */ + "R_NDS32_32", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 20 bit address. */ + HOWTO2 (R_NDS32_20, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned,/* complain_on_overflow */ + nds32_elf_generic_reloc,/* special_function */ + "R_NDS32_20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* An PC Relative 9-bit relocation, shifted by 2. + This reloc is complicated because relocations are relative to pc & -4. + i.e. branches in the right insn slot use the address of the left insn + slot for pc. */ + /* ??? It's not clear whether this should have partial_inplace set or not. + Branch relaxing in the assembler can store the addend in the insn, + and if bfd_install_relocation gets called the addend may get added + again. */ + HOWTO2 (R_NDS32_9_PCREL, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + nds32_elf_9_pcrel_reloc,/* special_function */ + "R_NDS32_9_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A relative 15 bit relocation, right shifted by 1. */ + HOWTO2 (R_NDS32_15_PCREL, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 14, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_15_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0x3fff, /* src_mask */ + 0x3fff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A relative 17 bit relocation, right shifted by 1. */ + HOWTO2 (R_NDS32_17_PCREL, /* type */ + 1, /* 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_NDS32_17_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A relative 25 bit relocation, right shifted by 1. */ + /* ??? It's not clear whether this should have partial_inplace set or not. + Branch relaxing in the assembler can store the addend in the insn, + and if bfd_install_relocation gets called the addend may get added + again. */ + HOWTO2 (R_NDS32_25_PCREL, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_25_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* High 20 bits of address when lower 12 is or'd in. */ + HOWTO2 (R_NDS32_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_hi20_reloc, /* special_function */ + "R_NDS32_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Lower 12 bits of address. */ + HOWTO2 (R_NDS32_LO12S3, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 9, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_lo12_reloc, /* special_function */ + "R_NDS32_LO12S3", /* name */ + FALSE, /* partial_inplace */ + 0x000001ff, /* src_mask */ + 0x000001ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Lower 12 bits of address. */ + HOWTO2 (R_NDS32_LO12S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_lo12_reloc, /* special_function */ + "R_NDS32_LO12S2", /* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Lower 12 bits of address. */ + HOWTO2 (R_NDS32_LO12S1, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_lo12_reloc, /* special_function */ + "R_NDS32_LO12S1", /* name */ + FALSE, /* partial_inplace */ + 0x000007ff, /* src_mask */ + 0x000007ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Lower 12 bits of address. */ + HOWTO2 (R_NDS32_LO12S0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_lo12_reloc, /* special_function */ + "R_NDS32_LO12S0", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Small data area 15 bits offset. */ + HOWTO2 (R_NDS32_SDA15S3, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + nds32_elf_sda15_reloc, /* special_function */ + "R_NDS32_SDA15S3", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Small data area 15 bits offset. */ + HOWTO2 (R_NDS32_SDA15S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + nds32_elf_sda15_reloc, /* special_function */ + "R_NDS32_SDA15S2", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Small data area 15 bits offset. */ + HOWTO2 (R_NDS32_SDA15S1, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + nds32_elf_sda15_reloc, /* special_function */ + "R_NDS32_SDA15S1", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Small data area 15 bits offset. */ + HOWTO2 (R_NDS32_SDA15S0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + nds32_elf_sda15_reloc, /* special_function */ + "R_NDS32_SDA15S0", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO2 (R_NDS32_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_NDS32_GNU_VTINHERIT",/* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO2 (R_NDS32_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_NDS32_GNU_VTENTRY", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 16 bit absolute relocation. */ + HOWTO2 (R_NDS32_16_RELA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_16_RELA", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 32 bit absolute relocation. */ + HOWTO2 (R_NDS32_32_RELA, /* 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_NDS32_32_RELA", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 20 bit address. */ + HOWTO2 (R_NDS32_20_RELA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_20_RELA", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_9_PCREL_RELA, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_9_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A relative 15 bit relocation, right shifted by 1. */ + HOWTO2 (R_NDS32_15_PCREL_RELA,/* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 14, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_15_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x3fff, /* src_mask */ + 0x3fff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A relative 17 bit relocation, right shifted by 1. */ + HOWTO2 (R_NDS32_17_PCREL_RELA,/* type */ + 1, /* 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_NDS32_17_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A relative 25 bit relocation, right shifted by 2. */ + HOWTO2 (R_NDS32_25_PCREL_RELA,/* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_25_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* High 20 bits of address when lower 16 is or'd in. */ + HOWTO2 (R_NDS32_HI20_RELA, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_HI20_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Lower 12 bits of address. */ + HOWTO2 (R_NDS32_LO12S3_RELA, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 9, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S3_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x000001ff, /* src_mask */ + 0x000001ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Lower 12 bits of address. */ + HOWTO2 (R_NDS32_LO12S2_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S2_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Lower 12 bits of address. */ + HOWTO2 (R_NDS32_LO12S1_RELA, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S1_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x000007ff, /* src_mask */ + 0x000007ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Lower 12 bits of address. */ + HOWTO2 (R_NDS32_LO12S0_RELA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S0_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Small data area 15 bits offset. */ + HOWTO2 (R_NDS32_SDA15S3_RELA, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA15S3_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Small data area 15 bits offset. */ + HOWTO2 (R_NDS32_SDA15S2_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA15S2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_SDA15S1_RELA, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA15S1_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_SDA15S0_RELA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA15S0_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO2 (R_NDS32_RELA_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_NDS32_RELA_GNU_VTINHERIT",/* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO2 (R_NDS32_RELA_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_NDS32_RELA_GNU_VTENTRY",/* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like R_NDS32_20, but referring to the GOT table entry for + the symbol. */ + HOWTO2 (R_NDS32_GOT20, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like R_NDS32_PCREL, but referring to the procedure linkage table + entry for the symbol. */ + HOWTO2 (R_NDS32_25_PLTREL, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_25_PLTREL", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* This is used only by the dynamic linker. The symbol should exist + both in the object being run and in some shared library. The + dynamic linker copies the data addressed by the symbol from the + shared library into the object, because the object being + run has to have the data at some particular address. */ + HOWTO2 (R_NDS32_COPY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_COPY", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like R_NDS32_20, but used when setting global offset table + entries. */ + HOWTO2 (R_NDS32_GLOB_DAT, /* 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_NDS32_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Marks a procedure linkage table entry for a symbol. */ + HOWTO2 (R_NDS32_JMP_SLOT, /* 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_NDS32_JMP_SLOT", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used only by the dynamic linker. When the object is run, this + longword is set to the load address of the object, plus the + addend. */ + HOWTO2 (R_NDS32_RELATIVE, /* 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_NDS32_RELATIVE", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_GOTOFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTOFF", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* An PC Relative 20-bit relocation used when setting PIC offset + table register. */ + HOWTO2 (R_NDS32_GOTPC20, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTPC20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Like R_NDS32_HI20, but referring to the GOT table entry for + the symbol. */ + HOWTO2 (R_NDS32_GOT_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOT_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* An PC Relative relocation used when setting PIC offset table register. + Like R_NDS32_HI20, but referring to the GOT table entry for + the symbol. */ + HOWTO2 (R_NDS32_GOTPC_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTPC_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOTPC_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTPC_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_GOTOFF_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTOFF_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOTOFF_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTOFF_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Alignment hint for relaxable instruction. This is used with + R_NDS32_LABEL as a pair. Relax this instruction from 4 bytes to 2 + in order to make next label aligned on word boundary. */ + HOWTO2 (R_NDS32_INSN16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_INSN16", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Alignment hint for label. */ + HOWTO2 (R_NDS32_LABEL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LABEL", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for unconditional call sequence */ + HOWTO2 (R_NDS32_LONGCALL1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional call sequence. */ + HOWTO2 (R_NDS32_LONGCALL2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional call sequence. */ + HOWTO2 (R_NDS32_LONGCALL3, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL3", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for unconditional branch sequence. */ + HOWTO2 (R_NDS32_LONGJUMP1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional branch sequence. */ + HOWTO2 (R_NDS32_LONGJUMP2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional branch sequence. */ + HOWTO2 (R_NDS32_LONGJUMP3, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP3", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for load/store sequence. */ + HOWTO2 (R_NDS32_LOADSTORE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LOADSTORE", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for load/store sequence. */ + HOWTO2 (R_NDS32_9_FIXED_RELA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_9_FIXED_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for load/store sequence. */ + HOWTO2 (R_NDS32_15_FIXED_RELA,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_15_FIXED_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00003fff, /* src_mask */ + 0x00003fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for load/store sequence. */ + HOWTO2 (R_NDS32_17_FIXED_RELA,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_17_FIXED_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for load/store sequence. */ + HOWTO2 (R_NDS32_25_FIXED_RELA,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_25_FIXED_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* High 20 bits of PLT symbol offset relative to PC. */ + HOWTO2 (R_NDS32_PLTREL_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLTREL_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Low 12 bits of PLT symbol offset relative to PC. */ + HOWTO2 (R_NDS32_PLTREL_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLTREL_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* High 20 bits of PLT symbol offset relative to GOT (GP). */ + HOWTO2 (R_NDS32_PLT_GOTREL_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLT_GOTREL_HI20",/* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Low 12 bits of PLT symbol offset relative to GOT (GP). */ + HOWTO2 (R_NDS32_PLT_GOTREL_LO12,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLT_GOTREL_LO12",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Small data area 12 bits offset. */ + HOWTO2 (R_NDS32_SDA12S2_DP_RELA,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA12S2_DP_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Small data area 12 bits offset. */ + HOWTO2 (R_NDS32_SDA12S2_SP_RELA,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA12S2_SP_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* Lower 12 bits of address. */ + + HOWTO2 (R_NDS32_LO12S2_DP_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S2_DP_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Lower 12 bits of address. */ + HOWTO2 (R_NDS32_LO12S2_SP_RELA,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S2_SP_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* Lower 12 bits of address. Special identity for or case. */ + HOWTO2 (R_NDS32_LO12S0_ORI_RELA,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S0_ORI_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* Small data area 19 bits offset. */ + HOWTO2 (R_NDS32_SDA16S3_RELA, /* type */ + 3, /* 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_NDS32_SDA16S3_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Small data area 15 bits offset. */ + HOWTO2 (R_NDS32_SDA17S2_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 17, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA17S2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0001ffff, /* src_mask */ + 0x0001ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_SDA18S1_RELA, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA18S1_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0003ffff, /* src_mask */ + 0x0003ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_SDA19S0_RELA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA19S0_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0007ffff, /* src_mask */ + 0x0007ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_DWARF2_OP1_RELA,/* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DWARF2_OP1_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_DWARF2_OP2_RELA,/* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DWARF2_OP2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_DWARF2_LEB_RELA,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DWARF2_LEB_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_UPDATE_TA_RELA,/* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_UPDATE_TA_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* Like R_NDS32_PCREL, but referring to the procedure linkage table + entry for the symbol. */ + HOWTO2 (R_NDS32_9_PLTREL, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_9_PLTREL", /* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + /* Low 20 bits of PLT symbol offset relative to GOT (GP). */ + HOWTO2 (R_NDS32_PLT_GOTREL_LO20,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLT_GOTREL_LO20",/* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* low 15 bits of PLT symbol offset relative to GOT (GP) */ + HOWTO2 (R_NDS32_PLT_GOTREL_LO15,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLT_GOTREL_LO15",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* Low 19 bits of PLT symbol offset relative to GOT (GP). */ + HOWTO2 (R_NDS32_PLT_GOTREL_LO19,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLT_GOTREL_LO19",/* name */ + FALSE, /* partial_inplace */ + 0x0007ffff, /* src_mask */ + 0x0007ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOT_LO15, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT_LO15", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOT_LO19, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT_LO19", /* name */ + FALSE, /* partial_inplace */ + 0x0007ffff, /* src_mask */ + 0x0007ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOTOFF_LO15, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTOFF_LO15", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOTOFF_LO19, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTOFF_LO19", /* name */ + FALSE, /* partial_inplace */ + 0x0007ffff, /* src_mask */ + 0x0007ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* GOT 15 bits offset. */ + HOWTO2 (R_NDS32_GOT15S2_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT15S2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* GOT 17 bits offset. */ + HOWTO2 (R_NDS32_GOT17S2_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 17, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT17S2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0001ffff, /* src_mask */ + 0x0001ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* A 5 bit address. */ + HOWTO2 (R_NDS32_5_RELA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_5_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x1f, /* src_mask */ + 0x1f, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_10_UPCREL_RELA,/* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 9, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_10_UPCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x1ff, /* src_mask */ + 0x1ff, /* dst_mask */ + TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA_FP7U2_RELA,/* type */ + 2, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 7, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA_FP7U2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0000007f, /* src_mask */ + 0x0000007f, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_WORD_9_PCREL_RELA,/* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_WORD_9_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_25_ABS_RELA, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_25_ABS_RELA", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A relative 17 bit relocation for ifc, right shifted by 1. */ + HOWTO2 (R_NDS32_17IFC_PCREL_RELA,/* type */ + 1, /* 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_NDS32_17IFC_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A relative unsigned 10 bit relocation for ifc, right shifted by 1. */ + HOWTO2 (R_NDS32_10IFCU_PCREL_RELA,/* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 9, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_10IFCU_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x1ff, /* src_mask */ + 0x1ff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Relax hint for unconditional call sequence */ + HOWTO2 (R_NDS32_LONGCALL4, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL4", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional call sequence. */ + HOWTO2 (R_NDS32_LONGCALL5, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL5", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional call sequence. */ + HOWTO2 (R_NDS32_LONGCALL6, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL6", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for unconditional branch sequence. */ + HOWTO2 (R_NDS32_LONGJUMP4, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP4", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional branch sequence. */ + HOWTO2 (R_NDS32_LONGJUMP5, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP5", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional branch sequence. */ + HOWTO2 (R_NDS32_LONGJUMP6, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP6", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional branch sequence. */ + HOWTO2 (R_NDS32_LONGJUMP7, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP7", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Check sum value for security. */ + HOWTO2 (R_NDS32_SECURITY_16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 5, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SECURITY_16", /* name */ + FALSE, /* partial_inplace */ + 0x1fffe0, /* src_mask */ + 0x1fffe0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* TLS LE TP offset relocation */ + HOWTO2 (R_NDS32_TLS_TPOFF, /* 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_NDS32_TLS_TPOFF", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like R_NDS32_HI20, but referring to the TLS LE entry for the symbol. */ + HOWTO2 (R_NDS32_TLS_LE_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_LE_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 20 bit address. */ + HOWTO2 (R_NDS32_TLS_LE_20, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_LE_15S0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_15S0", /* name */ + FALSE, /* partial_inplace */ + 0x7fff, /* src_mask */ + 0x7fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_LE_15S1, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_15S1", /* name */ + FALSE, /* partial_inplace */ + 0x7fff, /* src_mask */ + 0x7fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_LE_15S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_15S2", /* name */ + FALSE, /* partial_inplace */ + 0x7fff, /* src_mask */ + 0x7fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like R_NDS32_HI20, but referring to the TLS IE entry for the symbol. */ + HOWTO2 (R_NDS32_TLS_IE_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IE_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_IE_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IE_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_IE_LO12S2,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IE_LO12S2",/* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like R_NDS32_HI20, but referring to the TLS IE (PIE) entry for the symbol. */ + HOWTO2 (R_NDS32_TLS_IEGP_HI20,/* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IEGP_HI20",/* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_TLS_IEGP_LO12,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IEGP_LO12",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_TLS_IEGP_LO12S2,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IEGP_LO12S2",/* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS description relocation */ + HOWTO2 (R_NDS32_TLS_DESC, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_hi20_reloc, /* special_function */ + "R_NDS32_TLS_DESC_HI20",/* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description offset high part. */ + HOWTO2 (R_NDS32_TLS_DESC_HI20,/* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_hi20_reloc, /* special_function */ + "R_NDS32_TLS_DESC_HI20",/* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* TLS GD/LD description offset low part. */ + HOWTO2 (R_NDS32_TLS_DESC_LO12,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_lo12_reloc, /* special_function */ + "R_NDS32_TLS_DESC_LO12",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description offset set (movi). */ + HOWTO2 (R_NDS32_TLS_DESC_20, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_DESC_20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description offset set (lwi.gp). */ + HOWTO2 (R_NDS32_TLS_DESC_SDA17S2,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 17, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_DESC_SDA17S2",/* name */ + FALSE, /* partial_inplace */ + 0x0001ffff, /* src_mask */ + 0x0001ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Jump-patch table relocations. */ + /* High 20 bits of jump-patch table address. */ + HOWTO2 (R_NDS32_ICT_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_ICT_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* Lower 12 bits of jump-patch table address. */ + HOWTO2 (R_NDS32_ICT_LO12,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_ICT_LO12",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* A relative 25 bit relocation, right shifted by 2. */ + HOWTO2 (R_NDS32_ICT_25PC,/* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_ICT_25PC",/* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ +}; + +/* Relocations used for relaxation. */ +#define HOWTO3(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ + [C-R_NDS32_RELAX_ENTRY] = HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) + +static reloc_howto_type nds32_elf_relax_howto_table[] = { + HOWTO3 (R_NDS32_RELAX_ENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_RELAX_ENTRY", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_GOT_SUFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_GOT_SUFF", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_GOTOFF_SUFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_GOTOFF_SUFF", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_PLT_GOT_SUFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_PLT_GOT_SUFF",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_MULCALL_SUFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_MULCALL_SUFF",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_PTR, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_PTR", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_PTR_COUNT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_PTR_COUNT", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_PTR_RESOLVED, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_PTR_RESOLVED",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_PLTBLOCK, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_PLTBLOCK", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_RELAX_REGION_BEGIN,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_RELAX_REGION_BEGIN",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_RELAX_REGION_END,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_RELAX_REGION_END",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_MINUEND, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_MINUEND", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_SUBTRAHEND, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_SUBTRAHEND", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_DIFF8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DIFF8", /* name */ + FALSE, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_DIFF16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DIFF16", /* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_DIFF32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DIFF32", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_DIFF_ULEB128, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DIFF_ULEB128",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_DATA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DATA", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_TRAN, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TRAN", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_EMPTY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_EMPTY", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO3 (R_NDS32_TLS_LE_ADD, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_LE_ADD", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_TLS_LE_LS, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_LE_LS", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO3 (R_NDS32_TLS_IEGP_LW, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_IEGP_LW", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description address base addition. */ + HOWTO3 (R_NDS32_TLS_DESC_ADD, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_DESC_ADD",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description function load. */ + HOWTO3 (R_NDS32_TLS_DESC_FUNC,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_DESC_FUNC",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS DESC resolve function call. */ + HOWTO3 (R_NDS32_TLS_DESC_CALL,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_DESC_CALL",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS DESC variable access. */ + HOWTO3 (R_NDS32_TLS_DESC_MEM, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_DESC_MEM",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description mark (@tlsdec). */ + HOWTO3 (R_NDS32_RELAX_REMOVE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_REMOVE", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description mark (@tlsdec). */ + HOWTO3 (R_NDS32_RELAX_GROUP, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_GROUP", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ +}; + + +static unsigned long dl_tlsdesc_lazy_trampoline[] = +{ + 0x46200000, /* sethi $r2,#0x0 */ + 0x58210000, /* ori $r2,$r2,#0x0 */ + 0x40217400, /* add $r2,$r2,$gp */ + 0x04210000, /* lwi $r2,[$r2+#0x0] */ + 0x46300000, /* sethi $r3,#0x0 */ + 0x58318000, /* ori $r3,$r3,#0x0 */ + 0x4031f400, /* add $r3,$r3,$gp */ + 0x4a000800, /* jr $r2 */ +}; + +/* === code === */ + +static void +nds32_put_trampoline (void *contents, const unsigned long *template, + unsigned count) +{ + unsigned ix; + + for (ix = 0; ix != count; ix++) + { + unsigned long insn = template[ix]; + bfd_putb32 (insn, (char *) contents + ix * 4); + } +} + +/* nds32_insertion_sort sorts an array with nmemb elements of size size. + This prototype is the same as qsort (). */ + +void +nds32_insertion_sort (void *base, size_t nmemb, size_t size, + int (*compar) (const void *lhs, const void *rhs)) +{ + char *ptr = (char *) base; + int i, j; + char *tmp = alloca (size); + + /* If i is less than j, i is inserted before j. + + |---- j ----- i --------------| + \ / \ / + sorted unsorted + */ + + for (i = 1; i < (int) nmemb; i++) + { + for (j = (i - 1); j >= 0; j--) + if (compar (ptr + i * size, ptr + j * size) >= 0) + break; + + j++; + + if (i == j) + continue; /* i is in order. */ + + memcpy (tmp, ptr + i * size, size); + memmove (ptr + (j + 1) * size, ptr + j * size, (i - j) * size); + memcpy (ptr + j * size, tmp, size); + } +} + +/* Sort relocation by r_offset. + + We didn't use qsort () in stdlib, because quick-sort is not a stable sorting + algorithm. Relocations at the same r_offset must keep their order. + For example, RELAX_ENTRY must be the very first relocation entry. + + Currently, this function implements insertion-sort. + + FIXME: If we already sort them in assembler, why bother sort them + here again? */ + +static int +compar_reloc (const void *lhs, const void *rhs) +{ + const Elf_Internal_Rela *l = (const Elf_Internal_Rela *) lhs; + const Elf_Internal_Rela *r = (const Elf_Internal_Rela *) rhs; + + if (l->r_offset > r->r_offset) + return 1; + else if (l->r_offset == r->r_offset) + return 0; + else + return -1; +} + +/* Functions listed below are only used for old relocs. + nds32_elf_9_pcrel_reloc + nds32_elf_do_9_pcrel_reloc + nds32_elf_hi20_reloc + nds32_elf_relocate_hi20 + nds32_elf_lo12_reloc + nds32_elf_sda15_reloc + nds32_elf_generic_reloc */ + +/* Handle the R_NDS32_9_PCREL & R_NDS32_9_PCREL_RELA reloc. */ + +static bfd_reloc_status_type +nds32_elf_9_pcrel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) +{ + /* This part is from bfd_elf_generic_reloc. */ + 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 (output_bfd != NULL) + { + /* FIXME: See bfd_perform_relocation. Is this right? */ + return bfd_reloc_continue; + } + + return nds32_elf_do_9_pcrel_reloc (abfd, reloc_entry->howto, + input_section, + data, reloc_entry->address, + symbol->section, + (symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset), + reloc_entry->addend); +} + +/* Utility to actually perform an R_NDS32_9_PCREL reloc. */ +#define N_ONES(n) (((((bfd_vma) 1 << ((n) - 1)) - 1) << 1) | 1) + +static bfd_reloc_status_type +nds32_elf_do_9_pcrel_reloc (bfd *abfd, reloc_howto_type *howto, + asection *input_section, bfd_byte *data, + bfd_vma offset, + asection *symbol_section ATTRIBUTE_UNUSED, + bfd_vma symbol_value, bfd_vma addend) +{ + bfd_signed_vma relocation; + unsigned short x; + bfd_reloc_status_type status; + + /* Sanity check the address (offset in section). */ + if (offset > bfd_get_section_limit (abfd, input_section)) + return bfd_reloc_outofrange; + + relocation = symbol_value + addend; + /* Make it pc relative. */ + relocation -= (input_section->output_section->vma + + input_section->output_offset); + /* These jumps mask off the lower two bits of the current address + before doing pcrel calculations. */ + relocation -= (offset & -(bfd_vma) 2); + + if (relocation < -ACCURATE_8BIT_S1 || relocation >= ACCURATE_8BIT_S1) + status = bfd_reloc_overflow; + else + status = bfd_reloc_ok; + + x = bfd_getb16 (data + offset); + + relocation >>= howto->rightshift; + relocation <<= howto->bitpos; + x = (x & ~howto->dst_mask) + | (((x & howto->src_mask) + relocation) & howto->dst_mask); + + bfd_putb16 ((bfd_vma) x, data + offset); + + return status; +} + +/* Handle the R_NDS32_HI20_[SU]LO relocs. + HI20_SLO is for the add3 and load/store with displacement instructions. + HI20 is for the or3 instruction. + For R_NDS32_HI20_SLO, the lower 16 bits are sign extended when added to + the high 16 bytes so if the lower 16 bits are negative (bit 15 == 1) then + we must add one to the high 16 bytes (which will get subtracted off when + the low 16 bits are added). + These relocs have to be done in combination with an R_NDS32_LO12 reloc + because there is a carry from the LO12 to the HI20. Here we just save + the information we need; we do the actual relocation when we see the LO12. + This code is copied from the elf32-mips.c. We also support an arbitrary + number of HI20 relocs to be associated with a single LO12 reloc. The + assembler sorts the relocs to ensure each HI20 immediately precedes its + LO12. However if there are multiple copies, the assembler may not find + the real LO12 so it picks the first one it finds. */ + +struct nds32_hi20 +{ + struct nds32_hi20 *next; + bfd_byte *addr; + bfd_vma addend; +}; + +static struct nds32_hi20 *nds32_hi20_list; + +static bfd_reloc_status_type +nds32_elf_hi20_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data, asection *input_section, + bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED) +{ + bfd_reloc_status_type ret; + bfd_vma relocation; + struct nds32_hi20 *n; + + /* This part is from bfd_elf_generic_reloc. + 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; + } + + /* Sanity check the address (offset in section). */ + if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) + return bfd_reloc_outofrange; + + 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; + + /* Save the information, and let LO12 do the actual relocation. */ + n = (struct nds32_hi20 *) 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 = nds32_hi20_list; + nds32_hi20_list = n; + + if (output_bfd != (bfd *) NULL) + reloc_entry->address += input_section->output_offset; + + return ret; +} + +/* Handle an NDS32 ELF HI20 reloc. */ + +static void +nds32_elf_relocate_hi20 (bfd *input_bfd ATTRIBUTE_UNUSED, + int type ATTRIBUTE_UNUSED, Elf_Internal_Rela *relhi, + Elf_Internal_Rela *rello, bfd_byte *contents, + bfd_vma addend) +{ + unsigned long insn; + bfd_vma addlo; + + insn = bfd_getb32 (contents + relhi->r_offset); + + addlo = bfd_getb32 (contents + rello->r_offset); + addlo &= 0xfff; + + addend += ((insn & 0xfffff) << 20) + addlo; + + insn = (insn & 0xfff00000) | ((addend >> 12) & 0xfffff); + bfd_putb32 (insn, contents + relhi->r_offset); +} + +/* Do an R_NDS32_LO12 relocation. This is a straightforward 12 bit + inplace relocation; this function exists in order to do the + R_NDS32_HI20_[SU]LO relocation described above. */ + +static bfd_reloc_status_type +nds32_elf_lo12_reloc (bfd *input_bfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) +{ + /* This part is from bfd_elf_generic_reloc. + If we're relocating, and this an external symbol, we don't want + to change anything. */ + 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 (nds32_hi20_list != NULL) + { + struct nds32_hi20 *l; + + l = nds32_hi20_list; + while (l != NULL) + { + unsigned long insn; + unsigned long val; + unsigned long vallo; + struct nds32_hi20 *next; + + /* Do the HI20 relocation. Note that we actually don't need + to know anything about the LO12 itself, except where to + find the low 12 bits of the addend needed by the LO12. */ + insn = bfd_getb32 (l->addr); + vallo = bfd_getb32 ((bfd_byte *) data + reloc_entry->address); + vallo &= 0xfff; + switch (reloc_entry->howto->type) + { + case R_NDS32_LO12S3: + vallo <<= 3; + break; + + case R_NDS32_LO12S2: + vallo <<= 2; + break; + + case R_NDS32_LO12S1: + vallo <<= 1; + break; + + case R_NDS32_LO12S0: + vallo <<= 0; + break; + } + + val = ((insn & 0xfffff) << 12) + vallo; + val += l->addend; + + insn = (insn & ~(bfd_vma) 0xfffff) | ((val >> 12) & 0xfffff); + bfd_putb32 ((bfd_vma) insn, l->addr); + + next = l->next; + free (l); + l = next; + } + + nds32_hi20_list = NULL; + } + + /* Now do the LO12 reloc in the usual way. + ??? It would be nice to call bfd_elf_generic_reloc here, + but we have partial_inplace set. bfd_elf_generic_reloc will + pass the handling back to bfd_install_relocation which will install + a section relative addend which is wrong. */ + return nds32_elf_generic_reloc (input_bfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); +} + +/* Do generic partial_inplace relocation. + This is a local replacement for bfd_elf_generic_reloc. */ + +static bfd_reloc_status_type +nds32_elf_generic_reloc (bfd *input_bfd, arelent *reloc_entry, + asymbol *symbol, void *data, asection *input_section, + bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED) +{ + bfd_reloc_status_type ret; + bfd_vma relocation; + bfd_byte *inplace_address; + + /* This part is from bfd_elf_generic_reloc. + If we're relocating, and this an external symbol, we don't want + to change anything. */ + 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; + } + + /* Now do the reloc in the usual way. + ??? It would be nice to call bfd_elf_generic_reloc here, + but we have partial_inplace set. bfd_elf_generic_reloc will + pass the handling back to bfd_install_relocation which will install + a section relative addend which is wrong. */ + + /* Sanity check the address (offset in section). */ + if (reloc_entry->address > bfd_get_section_limit (input_bfd, input_section)) + return bfd_reloc_outofrange; + + 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) || output_bfd != (bfd *) NULL) + relocation = 0; + else + relocation = symbol->value; + + /* Only do this for a final link. */ + if (output_bfd == (bfd *) NULL) + { + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + } + + relocation += reloc_entry->addend; + switch (reloc_entry->howto->type) + { + case R_NDS32_LO12S3: + relocation >>= 3; + break; + + case R_NDS32_LO12S2: + relocation >>= 2; + break; + + case R_NDS32_LO12S1: + relocation >>= 1; + break; + + case R_NDS32_LO12S0: + default: + relocation >>= 0; + break; + } + + inplace_address = (bfd_byte *) data + reloc_entry->address; + +#define DOIT(x) \ + x = ((x & ~reloc_entry->howto->dst_mask) | \ + (((x & reloc_entry->howto->src_mask) + relocation) & \ + reloc_entry->howto->dst_mask)) + + switch (reloc_entry->howto->size) + { + case 1: + { + short x = bfd_getb16 (inplace_address); + + DOIT (x); + bfd_putb16 ((bfd_vma) x, inplace_address); + } + break; + case 2: + { + unsigned long x = bfd_getb32 (inplace_address); + + DOIT (x); + bfd_putb32 ((bfd_vma) x, inplace_address); + } + break; + default: + BFD_ASSERT (0); + } + + if (output_bfd != (bfd *) NULL) + reloc_entry->address += input_section->output_offset; + + return ret; +} + +/* Handle the R_NDS32_SDA15 reloc. + This reloc is used to compute the address of objects in the small data area + and to perform loads and stores from that area. + The lower 15 bits are sign extended and added to the register specified + in the instruction, which is assumed to point to _SDA_BASE_. + + Since the lower 15 bits offset is left-shifted 0, 1 or 2 bits depending on + the access size, this must be taken care of. */ + +static bfd_reloc_status_type +nds32_elf_sda15_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data ATTRIBUTE_UNUSED, + asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) +{ + /* This part is from bfd_elf_generic_reloc. */ + 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 (output_bfd != NULL) + { + /* FIXME: See bfd_perform_relocation. Is this right? */ + return bfd_reloc_continue; + } + + /* FIXME: not sure what to do here yet. But then again, the linker + may never call us. */ + abort (); +} + +/* nds32_elf_ignore_reloc is the special function for + relocation types which don't need to be relocated + like relaxation relocation types. + This function simply return bfd_reloc_ok when it is + invoked. */ + +static bfd_reloc_status_type +nds32_elf_ignore_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol ATTRIBUTE_UNUSED, + void *data ATTRIBUTE_UNUSED, asection *input_section, + bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED) +{ + if (output_bfd != NULL) + reloc_entry->address += input_section->output_offset; + + return bfd_reloc_ok; +} + + +/* Map BFD reloc types to NDS32 ELF reloc types. */ + +struct nds32_reloc_map_entry +{ + bfd_reloc_code_real_type bfd_reloc_val; + unsigned char elf_reloc_val; +}; + +static const struct nds32_reloc_map_entry nds32_reloc_map[] = { + {BFD_RELOC_NONE, R_NDS32_NONE}, + {BFD_RELOC_16, R_NDS32_16_RELA}, + {BFD_RELOC_32, R_NDS32_32_RELA}, + {BFD_RELOC_NDS32_20, R_NDS32_20_RELA}, + {BFD_RELOC_NDS32_5, R_NDS32_5_RELA}, + {BFD_RELOC_NDS32_9_PCREL, R_NDS32_9_PCREL_RELA}, + {BFD_RELOC_NDS32_WORD_9_PCREL, R_NDS32_WORD_9_PCREL_RELA}, + {BFD_RELOC_NDS32_15_PCREL, R_NDS32_15_PCREL_RELA}, + {BFD_RELOC_NDS32_17_PCREL, R_NDS32_17_PCREL_RELA}, + {BFD_RELOC_NDS32_25_PCREL, R_NDS32_25_PCREL_RELA}, + {BFD_RELOC_NDS32_10_UPCREL, R_NDS32_10_UPCREL_RELA}, + {BFD_RELOC_NDS32_HI20, R_NDS32_HI20_RELA}, + {BFD_RELOC_NDS32_LO12S3, R_NDS32_LO12S3_RELA}, + {BFD_RELOC_NDS32_LO12S2, R_NDS32_LO12S2_RELA}, + {BFD_RELOC_NDS32_LO12S1, R_NDS32_LO12S1_RELA}, + {BFD_RELOC_NDS32_LO12S0, R_NDS32_LO12S0_RELA}, + {BFD_RELOC_NDS32_LO12S0_ORI, R_NDS32_LO12S0_ORI_RELA}, + {BFD_RELOC_NDS32_SDA15S3, R_NDS32_SDA15S3_RELA}, + {BFD_RELOC_NDS32_SDA15S2, R_NDS32_SDA15S2_RELA}, + {BFD_RELOC_NDS32_SDA15S1, R_NDS32_SDA15S1_RELA}, + {BFD_RELOC_NDS32_SDA15S0, R_NDS32_SDA15S0_RELA}, + {BFD_RELOC_VTABLE_INHERIT, R_NDS32_RELA_GNU_VTINHERIT}, + {BFD_RELOC_VTABLE_ENTRY, R_NDS32_RELA_GNU_VTENTRY}, + + {BFD_RELOC_NDS32_GOT20, R_NDS32_GOT20}, + {BFD_RELOC_NDS32_9_PLTREL, R_NDS32_9_PLTREL}, + {BFD_RELOC_NDS32_25_PLTREL, R_NDS32_25_PLTREL}, + {BFD_RELOC_NDS32_COPY, R_NDS32_COPY}, + {BFD_RELOC_NDS32_GLOB_DAT, R_NDS32_GLOB_DAT}, + {BFD_RELOC_NDS32_JMP_SLOT, R_NDS32_JMP_SLOT}, + {BFD_RELOC_NDS32_RELATIVE, R_NDS32_RELATIVE}, + {BFD_RELOC_NDS32_GOTOFF, R_NDS32_GOTOFF}, + {BFD_RELOC_NDS32_GOTPC20, R_NDS32_GOTPC20}, + {BFD_RELOC_NDS32_GOT_HI20, R_NDS32_GOT_HI20}, + {BFD_RELOC_NDS32_GOT_LO12, R_NDS32_GOT_LO12}, + {BFD_RELOC_NDS32_GOT_LO15, R_NDS32_GOT_LO15}, + {BFD_RELOC_NDS32_GOT_LO19, R_NDS32_GOT_LO19}, + {BFD_RELOC_NDS32_GOTPC_HI20, R_NDS32_GOTPC_HI20}, + {BFD_RELOC_NDS32_GOTPC_LO12, R_NDS32_GOTPC_LO12}, + {BFD_RELOC_NDS32_GOTOFF_HI20, R_NDS32_GOTOFF_HI20}, + {BFD_RELOC_NDS32_GOTOFF_LO12, R_NDS32_GOTOFF_LO12}, + {BFD_RELOC_NDS32_GOTOFF_LO15, R_NDS32_GOTOFF_LO15}, + {BFD_RELOC_NDS32_GOTOFF_LO19, R_NDS32_GOTOFF_LO19}, + {BFD_RELOC_NDS32_INSN16, R_NDS32_INSN16}, + {BFD_RELOC_NDS32_LABEL, R_NDS32_LABEL}, + {BFD_RELOC_NDS32_LONGCALL1, R_NDS32_LONGCALL1}, + {BFD_RELOC_NDS32_LONGCALL2, R_NDS32_LONGCALL2}, + {BFD_RELOC_NDS32_LONGCALL3, R_NDS32_LONGCALL3}, + {BFD_RELOC_NDS32_LONGCALL4, R_NDS32_LONGCALL4}, + {BFD_RELOC_NDS32_LONGCALL5, R_NDS32_LONGCALL5}, + {BFD_RELOC_NDS32_LONGCALL6, R_NDS32_LONGCALL6}, + {BFD_RELOC_NDS32_LONGJUMP1, R_NDS32_LONGJUMP1}, + {BFD_RELOC_NDS32_LONGJUMP2, R_NDS32_LONGJUMP2}, + {BFD_RELOC_NDS32_LONGJUMP3, R_NDS32_LONGJUMP3}, + {BFD_RELOC_NDS32_LONGJUMP4, R_NDS32_LONGJUMP4}, + {BFD_RELOC_NDS32_LONGJUMP5, R_NDS32_LONGJUMP5}, + {BFD_RELOC_NDS32_LONGJUMP6, R_NDS32_LONGJUMP6}, + {BFD_RELOC_NDS32_LONGJUMP7, R_NDS32_LONGJUMP7}, + {BFD_RELOC_NDS32_SECURITY_16, R_NDS32_SECURITY_16}, + {BFD_RELOC_NDS32_LOADSTORE, R_NDS32_LOADSTORE}, + {BFD_RELOC_NDS32_9_FIXED, R_NDS32_9_FIXED_RELA}, + {BFD_RELOC_NDS32_15_FIXED, R_NDS32_15_FIXED_RELA}, + {BFD_RELOC_NDS32_17_FIXED, R_NDS32_17_FIXED_RELA}, + {BFD_RELOC_NDS32_25_FIXED, R_NDS32_25_FIXED_RELA}, + {BFD_RELOC_NDS32_PLTREL_HI20, R_NDS32_PLTREL_HI20}, + {BFD_RELOC_NDS32_PLTREL_LO12, R_NDS32_PLTREL_LO12}, + {BFD_RELOC_NDS32_PLT_GOTREL_HI20, R_NDS32_PLT_GOTREL_HI20}, + {BFD_RELOC_NDS32_PLT_GOTREL_LO12, R_NDS32_PLT_GOTREL_LO12}, + {BFD_RELOC_NDS32_PLT_GOTREL_LO15, R_NDS32_PLT_GOTREL_LO15}, + {BFD_RELOC_NDS32_PLT_GOTREL_LO19, R_NDS32_PLT_GOTREL_LO19}, + {BFD_RELOC_NDS32_PLT_GOTREL_LO20, R_NDS32_PLT_GOTREL_LO20}, + {BFD_RELOC_NDS32_SDA12S2_DP, R_NDS32_SDA12S2_DP_RELA}, + {BFD_RELOC_NDS32_SDA12S2_SP, R_NDS32_SDA12S2_SP_RELA}, + {BFD_RELOC_NDS32_LO12S2_DP, R_NDS32_LO12S2_DP_RELA}, + {BFD_RELOC_NDS32_LO12S2_SP, R_NDS32_LO12S2_SP_RELA}, + {BFD_RELOC_NDS32_SDA16S3, R_NDS32_SDA16S3_RELA}, + {BFD_RELOC_NDS32_SDA17S2, R_NDS32_SDA17S2_RELA}, + {BFD_RELOC_NDS32_SDA18S1, R_NDS32_SDA18S1_RELA}, + {BFD_RELOC_NDS32_SDA19S0, R_NDS32_SDA19S0_RELA}, + {BFD_RELOC_NDS32_SDA_FP7U2_RELA, R_NDS32_SDA_FP7U2_RELA}, + {BFD_RELOC_NDS32_DWARF2_OP1, R_NDS32_DWARF2_OP1_RELA}, + {BFD_RELOC_NDS32_DWARF2_OP2, R_NDS32_DWARF2_OP2_RELA}, + {BFD_RELOC_NDS32_DWARF2_LEB, R_NDS32_DWARF2_LEB_RELA}, + {BFD_RELOC_NDS32_UPDATE_TA, R_NDS32_UPDATE_TA_RELA}, + {BFD_RELOC_NDS32_GOT_SUFF, R_NDS32_GOT_SUFF}, + {BFD_RELOC_NDS32_GOTOFF_SUFF, R_NDS32_GOTOFF_SUFF}, + {BFD_RELOC_NDS32_GOT15S2, R_NDS32_GOT15S2_RELA}, + {BFD_RELOC_NDS32_GOT17S2, R_NDS32_GOT17S2_RELA}, + {BFD_RELOC_NDS32_PTR, R_NDS32_PTR}, + {BFD_RELOC_NDS32_PTR_COUNT, R_NDS32_PTR_COUNT}, + {BFD_RELOC_NDS32_PLT_GOT_SUFF, R_NDS32_PLT_GOT_SUFF}, + {BFD_RELOC_NDS32_PTR_RESOLVED, R_NDS32_PTR_RESOLVED}, + {BFD_RELOC_NDS32_RELAX_ENTRY, R_NDS32_RELAX_ENTRY}, + {BFD_RELOC_NDS32_MULCALL_SUFF, R_NDS32_MULCALL_SUFF}, + {BFD_RELOC_NDS32_PLTBLOCK, R_NDS32_PLTBLOCK}, + {BFD_RELOC_NDS32_RELAX_REGION_BEGIN, R_NDS32_RELAX_REGION_BEGIN}, + {BFD_RELOC_NDS32_RELAX_REGION_END, R_NDS32_RELAX_REGION_END}, + {BFD_RELOC_NDS32_MINUEND, R_NDS32_MINUEND}, + {BFD_RELOC_NDS32_SUBTRAHEND, R_NDS32_SUBTRAHEND}, + {BFD_RELOC_NDS32_EMPTY, R_NDS32_EMPTY}, + + {BFD_RELOC_NDS32_DIFF8, R_NDS32_DIFF8}, + {BFD_RELOC_NDS32_DIFF16, R_NDS32_DIFF16}, + {BFD_RELOC_NDS32_DIFF32, R_NDS32_DIFF32}, + {BFD_RELOC_NDS32_DIFF_ULEB128, R_NDS32_DIFF_ULEB128}, + {BFD_RELOC_NDS32_25_ABS, R_NDS32_25_ABS_RELA}, + {BFD_RELOC_NDS32_DATA, R_NDS32_DATA}, + {BFD_RELOC_NDS32_TRAN, R_NDS32_TRAN}, + {BFD_RELOC_NDS32_17IFC_PCREL, R_NDS32_17IFC_PCREL_RELA}, + {BFD_RELOC_NDS32_10IFCU_PCREL, R_NDS32_10IFCU_PCREL_RELA}, + {BFD_RELOC_NDS32_TLS_LE_HI20, R_NDS32_TLS_LE_HI20}, + {BFD_RELOC_NDS32_TLS_LE_LO12, R_NDS32_TLS_LE_LO12}, + {BFD_RELOC_NDS32_TLS_LE_ADD, R_NDS32_TLS_LE_ADD}, + {BFD_RELOC_NDS32_TLS_LE_LS, R_NDS32_TLS_LE_LS}, + {BFD_RELOC_NDS32_TLS_IE_HI20, R_NDS32_TLS_IE_HI20}, + {BFD_RELOC_NDS32_TLS_IE_LO12S2, R_NDS32_TLS_IE_LO12S2}, + {BFD_RELOC_NDS32_TLS_LE_20, R_NDS32_TLS_LE_20}, + {BFD_RELOC_NDS32_TLS_LE_15S0, R_NDS32_TLS_LE_15S0}, + {BFD_RELOC_NDS32_TLS_LE_15S1, R_NDS32_TLS_LE_15S1}, + {BFD_RELOC_NDS32_TLS_LE_15S2, R_NDS32_TLS_LE_15S2}, + + {BFD_RELOC_NDS32_TLS_DESC, R_NDS32_TLS_DESC}, + {BFD_RELOC_NDS32_TLS_DESC_HI20, R_NDS32_TLS_DESC_HI20}, + {BFD_RELOC_NDS32_TLS_DESC_LO12, R_NDS32_TLS_DESC_LO12}, + {BFD_RELOC_NDS32_TLS_DESC_ADD, R_NDS32_TLS_DESC_ADD}, + {BFD_RELOC_NDS32_TLS_DESC_FUNC, R_NDS32_TLS_DESC_FUNC}, + {BFD_RELOC_NDS32_TLS_DESC_CALL, R_NDS32_TLS_DESC_CALL}, + {BFD_RELOC_NDS32_TLS_DESC_MEM, R_NDS32_TLS_DESC_MEM}, + {BFD_RELOC_NDS32_TLS_DESC_20, R_NDS32_TLS_DESC_20}, + {BFD_RELOC_NDS32_TLS_DESC_SDA17S2, R_NDS32_TLS_DESC_SDA17S2}, + {BFD_RELOC_NDS32_TLS_IE_LO12, R_NDS32_TLS_IE_LO12}, + {BFD_RELOC_NDS32_TLS_IEGP_HI20, R_NDS32_TLS_IEGP_HI20}, + {BFD_RELOC_NDS32_TLS_IEGP_LO12, R_NDS32_TLS_IEGP_LO12}, + {BFD_RELOC_NDS32_TLS_IEGP_LO12S2, R_NDS32_TLS_IEGP_LO12S2}, + {BFD_RELOC_NDS32_TLS_IEGP_LW, R_NDS32_TLS_IEGP_LW}, + + {BFD_RELOC_NDS32_REMOVE, R_NDS32_RELAX_REMOVE}, + {BFD_RELOC_NDS32_GROUP, R_NDS32_RELAX_GROUP}, + + {BFD_RELOC_NDS32_ICT_HI20, R_NDS32_ICT_HI20}, + {BFD_RELOC_NDS32_ICT_LO12, R_NDS32_ICT_LO12}, + {BFD_RELOC_NDS32_ICT_25PC, R_NDS32_ICT_25PC}, +}; + +/* Patch tag. */ + +/* Reserve space for COUNT dynamic relocations in relocation selection + SRELOC. */ + +static inline void +elf32_nds32_allocate_dynrelocs (struct bfd_link_info *info, asection *sreloc, + bfd_size_type count) +{ + BFD_ASSERT (elf_hash_table (info)->dynamic_sections_created); + if (sreloc == NULL) + abort (); + sreloc->size += sizeof (Elf32_External_Rela) * count; +} + +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE (nds32_elf_howto_table); i++) + if (nds32_elf_howto_table[i].name != NULL + && strcasecmp (nds32_elf_howto_table[i].name, r_name) == 0) + return &nds32_elf_howto_table[i]; + + for (i = 0; i < ARRAY_SIZE (nds32_elf_relax_howto_table); i++) + if (nds32_elf_relax_howto_table[i].name != NULL + && strcasecmp (nds32_elf_relax_howto_table[i].name, r_name) == 0) + return &nds32_elf_relax_howto_table[i]; + + return NULL; +} + +static reloc_howto_type * +bfd_elf32_bfd_reloc_type_table_lookup (enum elf_nds32_reloc_type code) +{ + if (code < R_NDS32_RELAX_ENTRY) + { + BFD_ASSERT (code < ARRAY_SIZE (nds32_elf_howto_table)); + return &nds32_elf_howto_table[code]; + } + else + { + if ((size_t) (code - R_NDS32_RELAX_ENTRY) >= + ARRAY_SIZE (nds32_elf_relax_howto_table)) + { + int i = code; + i += 1; + } + + BFD_ASSERT ((size_t) (code - R_NDS32_RELAX_ENTRY) + < ARRAY_SIZE (nds32_elf_relax_howto_table)); + return &nds32_elf_relax_howto_table[code - R_NDS32_RELAX_ENTRY]; + } +} + +static reloc_howto_type * +bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE (nds32_reloc_map); i++) + { + if (nds32_reloc_map[i].bfd_reloc_val == code) + return bfd_elf32_bfd_reloc_type_table_lookup + (nds32_reloc_map[i].elf_reloc_val); + } + + return NULL; +} + +/* Set the howto pointer for an NDS32 ELF reloc. */ + +static void +nds32_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, + Elf_Internal_Rela *dst) +{ + enum elf_nds32_reloc_type r_type; + + r_type = ELF32_R_TYPE (dst->r_info); + BFD_ASSERT (ELF32_R_TYPE (dst->r_info) <= R_NDS32_GNU_VTENTRY); + cache_ptr->howto = bfd_elf32_bfd_reloc_type_table_lookup (r_type); +} + +static void +nds32_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, + Elf_Internal_Rela *dst) +{ + BFD_ASSERT ((ELF32_R_TYPE (dst->r_info) == R_NDS32_NONE) + || ((ELF32_R_TYPE (dst->r_info) > R_NDS32_GNU_VTENTRY) + && (ELF32_R_TYPE (dst->r_info) < R_NDS32_max))); + cache_ptr->howto = + bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (dst->r_info)); +} + +/* Support for core dump NOTE sections. + Reference to include/linux/elfcore.h in Linux. */ + +static bfd_boolean +nds32_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) +{ + int offset; + size_t size; + + switch (note->descsz) + { + case 0x114: + /* Linux/NDS32 32-bit, ABI1 */ + + /* 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; + size = 200; + break; + + case 0xfc: + /* Linux/NDS32 32-bit */ + + /* 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; + size = 176; + break; + + default: + return FALSE; + } + + /* Make a ".reg" section. */ + return _bfd_elfcore_make_pseudosection (abfd, ".reg", + size, note->descpos + offset); +} + +static bfd_boolean +nds32_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) +{ + switch (note->descsz) + { + case 124: + /* Linux/NDS32 */ + + /* __kernel_uid_t, __kernel_gid_t are short on NDS32 platform. */ + elf_tdata (abfd)->core->program = + _bfd_elfcore_strndup (abfd, note->descdata + 28, 16); + elf_tdata (abfd)->core->command = + _bfd_elfcore_strndup (abfd, note->descdata + 44, 80); + + default: + return FALSE; + } + + /* 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; +} + +/* Hook called by the linker routine which adds symbols from an object + file. We must handle the special NDS32 section numbers here. + We also keep watching for whether we need to create the sdata special + linker sections. */ + +static bfd_boolean +nds32_elf_add_symbol_hook (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Sym *sym, + const char **namep ATTRIBUTE_UNUSED, + flagword *flagsp ATTRIBUTE_UNUSED, + asection **secp, bfd_vma *valp) +{ + 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) + || ELF_ST_TYPE (sym->st_info) == STT_TLS) + break; + + /* st_value is the alignemnt constraint. + That might be its actual size if it is an array or structure. */ + switch (sym->st_value) + { + case 1: + *secp = bfd_make_section_old_way (abfd, ".scommon_b"); + break; + case 2: + *secp = bfd_make_section_old_way (abfd, ".scommon_h"); + break; + case 4: + *secp = bfd_make_section_old_way (abfd, ".scommon_w"); + break; + case 8: + *secp = bfd_make_section_old_way (abfd, ".scommon_d"); + break; + default: + return TRUE; + } + + (*secp)->flags |= SEC_IS_COMMON; + *valp = sym->st_size; + break; + } + + return TRUE; +} + + +/* This function can figure out the best location for a base register to access + data relative to this base register + INPUT: + sda_d0: size of first DOUBLE WORD data section + sda_w0: size of first WORD data section + sda_h0: size of first HALF WORD data section + sda_b : size of BYTE data section + sda_hi: size of second HALF WORD data section + sda_w1: size of second WORD data section + sda_d1: size of second DOUBLE WORD data section + OUTPUT: + offset (always positive) from the beginning of sda_d0 if OK + a negative error value if fail + NOTE: + these 7 sections have to be located back to back if exist + a pass in 0 value for non-existing section */ + +/* Due to the interpretation of simm15 field of load/store depending on + data accessing size, the organization of base register relative data shall + like the following figure + ------------------------------------------- + | DOUBLE WORD sized data (range +/- 128K) + ------------------------------------------- + | WORD sized data (range +/- 64K) + ------------------------------------------- + | HALF WORD sized data (range +/- 32K) + ------------------------------------------- + | BYTE sized data (range +/- 16K) + ------------------------------------------- + | HALF WORD sized data (range +/- 32K) + ------------------------------------------- + | WORD sized data (range +/- 64K) + ------------------------------------------- + | DOUBLE WORD sized data (range +/- 128K) + ------------------------------------------- + Its base register shall be set to access these data freely. */ + +/* We have to figure out the SDA_BASE value, so that we can adjust the + symbol value correctly. We look up the symbol _SDA_BASE_ 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 relocatable output. */ + +static asection *sda_rela_sec = NULL; + +#define SDA_SECTION_NUM 10 + +static bfd_reloc_status_type +nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, + bfd_vma *psb, bfd_boolean add_symbol) +{ + int relax_fp_as_gp; + struct elf_nds32_link_hash_table *table; + struct bfd_link_hash_entry *h, *h2; + long unsigned int total = 0; + asection *first = NULL, *final = NULL, *temp; + bfd_vma sda_base = 0; + + h = bfd_link_hash_lookup (info->hash, "_SDA_BASE_", FALSE, FALSE, TRUE); + if (!h || (h->type != bfd_link_hash_defined && h->type != bfd_link_hash_defweak)) + { + /* The first section must be 4-byte aligned to promise _SDA_BASE_ being + 4 byte-aligned. Therefore, it has to set the first section ".data" + 4 byte-aligned. */ + static const char sec_name[SDA_SECTION_NUM][10] = { + ".data", ".got", ".sdata_d", ".sdata_w", ".sdata_h", ".sdata_b", + ".sbss_b", ".sbss_h", ".sbss_w", ".sbss_d" + }; + size_t i = 0; + + if (output_bfd->sections == NULL) + { + *psb = elf_gp (output_bfd); + return bfd_reloc_ok; + } + + /* Get the first and final section. */ + while (i < ARRAY_SIZE (sec_name)) + { + temp = bfd_get_section_by_name (output_bfd, sec_name[i]); + if (temp && !first && (temp->size != 0 || temp->rawsize != 0)) + first = temp; + if (temp && (temp->size != 0 || temp->rawsize != 0)) + final = temp; + + /* Summarize the sections in order to check if joining .bss. */ + if (temp && temp->size != 0) + total += temp->size; + else if (temp && temp->rawsize != 0) + total += temp->rawsize; + + i++; + } + + /* Check .bss size. */ + temp = bfd_get_section_by_name (output_bfd, ".bss"); + if (temp) + { + if (temp->size != 0) + total += temp->size; + else if (temp->rawsize != 0) + total += temp->rawsize; + + if (total < 0x80000) + { + if (!first && (temp->size != 0 || temp->rawsize != 0)) + first = temp; + if ((temp->size != 0 || temp->rawsize != 0)) + final = temp; + } + } + + if (first && final) + { + /* The middle of data region. */ + sda_base = final->vma / 2 + final->rawsize / 2 + first->vma / 2; + + /* Find the section sda_base located. */ + i = 0; + while (i < ARRAY_SIZE (sec_name)) + { + final = bfd_get_section_by_name (output_bfd, sec_name[i]); + if (final && (final->size != 0 || final->rawsize != 0) + && sda_base >= final->vma) + { + first = final; + i++; + } + else + break; + } + } + else + { + /* If there is not any default data section in output bfd, try to find + the first data section. If no data section be found, just simplily + choose the first output section. */ + temp = output_bfd->sections; + while (temp) + { + if (temp->flags & SEC_ALLOC + && (((temp->flags & SEC_DATA) + && ((temp->flags & SEC_READONLY) == 0)) + || (temp->flags & SEC_LOAD) == 0) + && (temp->size != 0 || temp->rawsize != 0)) + { + if (!first) + first = temp; + final = temp; + } + temp = temp->next; + } + + /* There is no data or bss section. */ + if (!first || (first->size == 0 && first->rawsize == 0)) + { + first = output_bfd->sections; + while (first && first->size == 0 && first->rawsize == 0) + first = first->next; + } + + /* There is no concrete section. */ + if (!first) + { + *psb = elf_gp (output_bfd); + return bfd_reloc_ok; + } + + if (final && (final->vma + final->rawsize - first->vma) <= 0x4000) + sda_base = final->vma / 2 + final->rawsize / 2 + first->vma / 2; + else + sda_base = first->vma + 0x2000; + } + + sda_base -= first->vma; + sda_base = sda_base & (~7); + + if (!_bfd_generic_link_add_one_symbol + (info, output_bfd, "_SDA_BASE_", BSF_GLOBAL | BSF_WEAK, first, + (bfd_vma) sda_base, (const char *) NULL, FALSE, + get_elf_backend_data (output_bfd)->collect, &h)) + return FALSE; + + sda_rela_sec = first; + + } + + /* Set _FP_BASE_ to _SDA_BASE_. */ + table = nds32_elf_hash_table (info); + relax_fp_as_gp = table->relax_fp_as_gp; + h2 = bfd_link_hash_lookup (info->hash, FP_BASE_NAME, FALSE, FALSE, FALSE); + /* _SDA_BASE_ is difined in linker script. */ + if (!first) + { + first = h->u.def.section; + sda_base = h->u.def.value; + } + + if (relax_fp_as_gp && h2 + && (h2->type == bfd_link_hash_undefweak + || h2->type == bfd_link_hash_undefined)) + { + /* Define a weak FP_BASE_NAME here to prevent the undefined symbol. + And set FP equal to SDA_BASE to do relaxation for + la $fp, _FP_BASE_. */ + if (!_bfd_generic_link_add_one_symbol + (info, output_bfd, FP_BASE_NAME, BSF_GLOBAL | BSF_WEAK, + first, sda_base, (const char *) NULL, + FALSE, get_elf_backend_data (output_bfd)->collect, &h2)) + return FALSE; + } + + if (add_symbol == TRUE) + { + if (h) + { + /* Now set gp. */ + elf_gp (output_bfd) = (h->u.def.value + + h->u.def.section->output_section->vma + + h->u.def.section->output_offset); + } + else + { + (*_bfd_error_handler) (_("error: Can't find symbol: _SDA_BASE_.")); + return bfd_reloc_dangerous; + } + } + + *psb = h->u.def.value + h->u.def.section->output_section->vma + + h->u.def.section->output_offset; + return bfd_reloc_ok; +} + + +/* Return size of a PLT entry. */ +#define elf_nds32_sizeof_plt(info) PLT_ENTRY_SIZE + + +/* Create an entry in an nds32 ELF linker hash table. */ + +static struct bfd_hash_entry * +nds32_elf_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) +{ + struct elf_nds32_link_hash_entry *ret; + + ret = (struct elf_nds32_link_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (ret == NULL) + ret = (struct elf_nds32_link_hash_entry *) + bfd_hash_allocate (table, sizeof (struct elf_nds32_link_hash_entry)); + + if (ret == NULL) + return (struct bfd_hash_entry *) ret; + + /* Call the allocation method of the superclass. */ + ret = (struct elf_nds32_link_hash_entry *) + _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, table, string); + + if (ret != NULL) + { + struct elf_nds32_link_hash_entry *eh; + + eh = (struct elf_nds32_link_hash_entry *) ret; + eh->dyn_relocs = NULL; + eh->tls_type = GOT_UNKNOWN; + eh->offset_to_gp = 0; + eh->indirect_call = FALSE; + } + + return (struct bfd_hash_entry *) ret; +} + +/* Create an nds32 ELF linker hash table. */ + +static struct bfd_link_hash_table * +nds32_elf_link_hash_table_create (bfd *abfd) +{ + struct elf_nds32_link_hash_table *ret; + + bfd_size_type amt = sizeof (struct elf_nds32_link_hash_table); + + ret = (struct elf_nds32_link_hash_table *) bfd_zmalloc (amt); + if (ret == NULL) + return NULL; + + /* patch tag. */ + if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, + nds32_elf_link_hash_newfunc, + sizeof (struct elf_nds32_link_hash_entry), + NDS32_ELF_DATA)) + { + free (ret); + return NULL; + } + + ret->sdynbss = NULL; + ret->srelbss = NULL; + ret->sym_ld_script = NULL; + ret->ex9_export_file = NULL; + ret->ex9_import_file = NULL; + + return &ret->root.root; +} + +/* Create .got, .gotplt, and .rela.got sections in DYNOBJ, and set up + shortcuts to them in our hash table. */ + +static bfd_boolean +create_got_section (bfd *dynobj, struct bfd_link_info *info) +{ + struct elf_link_hash_table *ehtab; + + if (!_bfd_elf_create_got_section (dynobj, info)) + return FALSE; + + ehtab = elf_hash_table (info); + ehtab->sgot = bfd_get_section_by_name (dynobj, ".got"); + ehtab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); + if (!ehtab->sgot || !ehtab->sgotplt) + abort (); + + /* _bfd_elf_create_got_section will create it for us. */ + ehtab->srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + if (ehtab->srelgot == NULL + || !bfd_set_section_flags (dynobj, ehtab->srelgot, + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (dynobj, ehtab->srelgot, 2)) + return FALSE; + + return TRUE; +} + +/* Create dynamic sections when linking against a dynamic object. */ + +static bfd_boolean +nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) +{ + struct elf_link_hash_table *ehtab; + struct elf_nds32_link_hash_table *htab; + flagword flags, pltflags; + register asection *s; + const struct elf_backend_data *bed; + int ptralign = 2; /* 32-bit */ + const char *secname; + char *relname; + flagword secflags; + asection *sec; + + bed = get_elf_backend_data (abfd); + ehtab = elf_hash_table (info); + htab = nds32_elf_hash_table (info); + + /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and + .rel[a].bss sections. */ + + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_LINKER_CREATED); + + pltflags = flags; + pltflags |= SEC_CODE; + if (bed->plt_not_loaded) + pltflags &= ~(SEC_LOAD | SEC_HAS_CONTENTS); + if (bed->plt_readonly) + pltflags |= SEC_READONLY; + + s = bfd_make_section (abfd, ".plt"); + ehtab->splt = s; + if (s == NULL + || !bfd_set_section_flags (abfd, s, pltflags) + || !bfd_set_section_alignment (abfd, s, bed->plt_alignment)) + return FALSE; + + if (bed->want_plt_sym) + { + /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the + .plt section. */ + struct bfd_link_hash_entry *bh = NULL; + struct elf_link_hash_entry *h; + + if (!(_bfd_generic_link_add_one_symbol + (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s, + (bfd_vma) 0, (const char *) NULL, FALSE, + get_elf_backend_data (abfd)->collect, &bh))) + return FALSE; + + h = (struct elf_link_hash_entry *) bh; + h->def_regular = 1; + h->type = STT_OBJECT; + + if (info->shared && !bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + s = bfd_make_section (abfd, + bed->default_use_rela_p ? ".rela.plt" : ".rel.plt"); + ehtab->srelplt = s; + if (s == NULL + || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || !bfd_set_section_alignment (abfd, s, ptralign)) + return FALSE; + + if (ehtab->sgot == NULL && !create_got_section (abfd, info)) + return FALSE; + + for (sec = abfd->sections; sec; sec = sec->next) + { + secflags = bfd_get_section_flags (abfd, sec); + if ((secflags & (SEC_DATA | SEC_LINKER_CREATED)) + || ((secflags & SEC_HAS_CONTENTS) != SEC_HAS_CONTENTS)) + continue; + secname = bfd_get_section_name (abfd, sec); + relname = (char *) bfd_malloc ((bfd_size_type) strlen (secname) + 6); + strcpy (relname, ".rela"); + strcat (relname, secname); + if (bfd_get_section_by_name (abfd, secname)) + continue; + s = bfd_make_section (abfd, relname); + if (s == NULL + || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || !bfd_set_section_alignment (abfd, s, ptralign)) + return FALSE; + } + + if (bed->want_dynbss) + { + /* The .dynbss section is a place to put symbols which are defined + by dynamic objects, are referenced by regular objects, and are + not functions. We must allocate space for them in the process + image and use a R_*_COPY reloc to tell the dynamic linker to + initialize them at run time. The linker script puts the .dynbss + section into the .bss section of the final image. */ + s = bfd_make_section (abfd, ".dynbss"); + htab->sdynbss = s; + if (s == NULL + || !bfd_set_section_flags (abfd, s, SEC_ALLOC | SEC_LINKER_CREATED)) + return FALSE; + /* The .rel[a].bss section holds copy relocs. This section is not + normally needed. We need to create it here, though, so that the + linker will map it to an output section. We can't just create it + only if we need it, because we will not know whether we need it + until we have seen all the input files, and the first time the + main linker code calls BFD after examining all the input files + (size_dynamic_sections) the input sections have already been + mapped to the output sections. If the section turns out not to + be needed, we can discard it later. We will never need this + section when generating a shared object, since they do not use + copy relocs. */ + if (!info->shared) + { + s = bfd_make_section (abfd, (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss")); + htab->srelbss = s; + if (s == NULL + || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || !bfd_set_section_alignment (abfd, s, ptralign)) + return FALSE; + } + } + + return TRUE; +} + +/* Copy the extra info we tack onto an elf_link_hash_entry. */ +static void +nds32_elf_copy_indirect_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) +{ + struct elf_nds32_link_hash_entry *edir, *eind; + + edir = (struct elf_nds32_link_hash_entry *) dir; + eind = (struct elf_nds32_link_hash_entry *) ind; + + if (eind->dyn_relocs != NULL) + { + if (edir->dyn_relocs != NULL) + { + struct elf_nds32_dyn_relocs **pp; + struct elf_nds32_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_nds32_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; + } + + if (ind->root.type == bfd_link_hash_indirect) + { + if (dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } + } + + _bfd_elf_link_hash_copy_indirect (info, dir, ind); +} + + +/* 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 bfd_boolean +nds32_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) +{ + struct elf_nds32_link_hash_table *htab; + struct elf_nds32_link_hash_entry *eh; + struct elf_nds32_dyn_relocs *p; + bfd *dynobj; + asection *s; + unsigned int power_of_two; + + dynobj = elf_hash_table (info)->dynobj; + + /* Make sure we know what is going on here. */ + BFD_ASSERT (dynobj != NULL + && (h->needs_plt + || h->u.weakdef != NULL + || (h->def_dynamic && h->ref_regular && !h->def_regular))); + + + /* If this is a function, put it in the procedure linkage table. We + will fill in the contents of the procedure linkage table later, + when we know the address of the .got section. */ + if (h->type == STT_FUNC || h->needs_plt) + { + if (!info->shared + && !h->def_dynamic + && !h->ref_dynamic + && h->root.type != bfd_link_hash_undefweak + && h->root.type != bfd_link_hash_undefined) + { + /* This case can occur if we saw a PLT reloc in an input + file, but the symbol was never referred to by a dynamic + object. In such a case, we don't actually need to build + a procedure linkage table, and we can just do a PCREL + reloc instead. */ + h->plt.offset = (bfd_vma) - 1; + h->needs_plt = 0; + } + + return TRUE; + } + else + 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->u.weakdef != NULL) + { + BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined + || h->u.weakdef->root.type == bfd_link_hash_defweak); + h->root.u.def.section = h->u.weakdef->root.u.def.section; + h->root.u.def.value = h->u.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->non_got_ref) + return TRUE; + + /* If -z nocopyreloc was given, we won't generate them either. */ + if (info->nocopyreloc) + { + h->non_got_ref = 0; + return TRUE; + } + + eh = (struct elf_nds32_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 | SEC_HAS_CONTENTS)) != 0) + break; + } + + /* If we didn't find any dynamic relocs in sections which needs the + copy reloc, then we'll be keeping the dynamic relocs and avoiding + the copy reloc. */ + if (p == NULL) + { + h->non_got_ref = 0; + 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 = nds32_elf_hash_table (info); + s = htab->sdynbss; + BFD_ASSERT (s != NULL); + + /* We must generate a R_NDS32_COPY reloc to tell the dynamic linker + to copy the initial value out of the dynamic object and into the + runtime process image. We need to remember the offset into the + .rela.bss section we are going to use. */ + if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) + { + asection *srel; + + srel = htab->srelbss; + BFD_ASSERT (srel != NULL); + srel->size += sizeof (Elf32_External_Rela); + h->needs_copy = 1; + } + + /* 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->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); + if (power_of_two > bfd_get_section_alignment (dynobj, s)) + { + if (!bfd_set_section_alignment (dynobj, s, power_of_two)) + return FALSE; + } + + /* Define the symbol as being at this point in the section. */ + h->root.u.def.section = s; + h->root.u.def.value = s->size; + + /* Increment the section size to make room for the symbol. */ + s->size += h->size; + + return TRUE; +} + +/* Allocate space in .plt, .got and associated reloc sections for + dynamic relocs. */ + +static bfd_boolean +allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) +{ + struct bfd_link_info *info; + struct elf_link_hash_table *ehtab; + struct elf_nds32_link_hash_table *htab; + struct elf_nds32_link_hash_entry *eh; + struct elf_nds32_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) + return TRUE; + + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + eh = (struct elf_nds32_link_hash_entry *) h; + + info = (struct bfd_link_info *) inf; + ehtab = elf_hash_table (info); + htab = nds32_elf_hash_table (info); + if (htab == NULL) + return FALSE; + + if ((htab->root.dynamic_sections_created || h->type == STT_GNU_IFUNC) + && h->plt.refcount > 0 + && !(info->pie && h->def_regular)) + { + /* 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->forced_local) + { + if (!bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)) + { + asection *s = ehtab->splt; + + /* If this is the first .plt entry, make room for the special + first entry. */ + if (s->size == 0) + s->size += PLT_ENTRY_SIZE; + + h->plt.offset = s->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->def_regular) + { + h->root.u.def.section = s; + h->root.u.def.value = h->plt.offset; + } + + /* Make room for this entry. */ + s->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. */ + ehtab->sgotplt->size += 4; + + /* We also need to make an entry in the .rel.plt section. */ + ehtab->srelplt->size += sizeof (Elf32_External_Rela); + htab->next_tls_desc_index++; + } + else + { + h->plt.offset = (bfd_vma) - 1; + h->needs_plt = 0; + } + } + else + { + h->plt.offset = (bfd_vma) - 1; + h->needs_plt = 0; + } + + if (h->got.refcount > 0) + { + asection *sgot; + bfd_boolean dyn; + int tls_type = elf32_nds32_hash_entry (h)->tls_type; + + /* 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->forced_local) + { + if (!bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + sgot = elf_hash_table (info)->sgot; + h->got.offset = sgot->size; + + if (tls_type == GOT_UNKNOWN) + abort (); + + /* Non-TLS symbols, and TLS_IE need one GOT slot. */ + if (tls_type & (GOT_NORMAL | GOT_TLS_IE | GOT_TLS_IEGP)) + sgot->size += 4; + else + { + /* TLS_DESC, TLS_GD, and TLS_LD need 2 consecutive GOT slots. */ + if (tls_type & GOT_TLS_DESC) + sgot->size += 8; + } + + dyn = htab->root.dynamic_sections_created; + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)) + { + if (tls_type == GOT_TLS_DESC) + { + /* TLS_DESC needs a relocation slot within .rela.plt. */ + htab->num_tls_desc++; + ehtab->srelplt->size += sizeof (Elf32_External_Rela); + htab->tls_trampoline = -1; + } + else + { + /* other relocations need a relocation slot within .rela.got. */ + ehtab->srelgot->size += sizeof (Elf32_External_Rela); + } + } + } + else + h->got.offset = (bfd_vma) -1; + + 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->def_regular && (h->forced_local || info->symbolic)) + { + struct elf_nds32_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->non_got_ref + && ((h->def_dynamic + && !h->def_regular) + || (htab->root.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->forced_local) + { + if (!bfd_elf_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->size += p->count * sizeof (Elf32_External_Rela); + } + + return TRUE; +} + +/* Add relocation REL to the end of relocation section SRELOC. */ + +static void +elf32_nds32_add_dynreloc (bfd *output_bfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *sreloc, Elf_Internal_Rela *rel) +{ + bfd_byte *loc; + if (sreloc == NULL) + abort (); + + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); + if (sreloc->reloc_count * sizeof (Elf32_External_Rela) > sreloc->size) + abort (); + + bfd_elf32_swap_reloca_out (output_bfd, rel, loc); +} + +/* Find any dynamic relocs that apply to read-only sections. */ + +static bfd_boolean +readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) +{ + struct elf_nds32_link_hash_entry *eh; + struct elf_nds32_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_nds32_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 bfd_boolean +nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) +{ + bfd *dynobj; + asection *s; + bfd_boolean plt; + bfd_boolean relocs; + bfd *ibfd; + struct elf_nds32_link_hash_table *htab; + + htab = nds32_elf_hash_table (info); + if (htab == NULL) + return FALSE; + + 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->executable) + { + s = bfd_get_section_by_name (dynobj, ".interp"); + BFD_ASSERT (s != NULL); + s->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 *sgot; + char *local_tls_type; + unsigned long symndx; + bfd_vma *local_tlsdesc_gotent; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) + continue; + + for (s = ibfd->sections; s != NULL; s = s->next) + { + struct elf_nds32_dyn_relocs *p; + + for (p = ((struct elf_nds32_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) + { + asection *sreloc = elf_section_data (p->sec)->sreloc; + sreloc->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; + sgot = elf_hash_table (info)->sgot; + local_tls_type = elf32_nds32_local_got_tls_type (ibfd); + local_tlsdesc_gotent = elf32_nds32_local_tlsdesc_gotent (ibfd); + for (symndx = 0; local_got < end_local_got; + ++local_got, ++local_tls_type, ++local_tlsdesc_gotent, ++symndx) + { + if (*local_got > 0) + { + int num_of_got_entry_needed = 0; + *local_got = sgot->size; + *local_tlsdesc_gotent = sgot->size; + + /* TLS_NORMAL, and TLS_IE need one slot in .got. */ + if (*local_tls_type & (GOT_NORMAL | GOT_TLS_IE | GOT_TLS_IEGP)) + num_of_got_entry_needed = 1; + /* TLS_GD, TLS_LD, and TLS_DESC need an 8-byte structure in the GOT. */ + else if (*local_tls_type & GOT_TLS_DESC) + num_of_got_entry_needed = 2; + + sgot->size += (num_of_got_entry_needed << 2); + + /* non-relax-able TLS_DESCs need a slot in .rela.plt. + others need a slot in .rela.got. */ + if (*local_tls_type == GOT_TLS_DESC) + { + if (info->shared) + { + htab->num_tls_desc++; + htab->root.srelplt->size += sizeof (Elf32_External_Rela); + htab->tls_trampoline = -1; + } + else + { + /* TLS_DESC -> TLS_LE */ + } + } + else + { + htab->root.srelgot->size += sizeof (Elf32_External_Rela); + } + } + else + { + *local_got = (bfd_vma) -1; + *local_tlsdesc_gotent = (bfd_vma) -1; + } + } + } + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ + elf_link_hash_traverse (&htab->root, allocate_dynrelocs, (void *) info); + + /* For every jump slot reserved in the sgotplt, reloc_count is + incremented. However, when we reserve space for TLS descriptors, + it's not incremented, so in order to compute the space reserved + for them, it suffices to multiply the reloc count by the jump + slot size. */ + if (htab->root.srelplt) + htab->sgotplt_jump_table_size = elf32_nds32_compute_jump_table_size (htab); + + if (htab->tls_trampoline) + { + htab->tls_trampoline = htab->root.splt->size; + + /* If we're not using lazy TLS relocations, don't generate the + PLT and GOT entries they require. */ + if (!(info->flags & DF_BIND_NOW)) + { + htab->dt_tlsdesc_got = htab->root.sgot->size; + htab->root.sgot->size += 4; + + htab->dt_tlsdesc_plt = htab->root.splt->size; + htab->root.splt->size += 4 * ARRAY_SIZE (dl_tlsdesc_lazy_trampoline); + } + } + + /* We now have determined the sizes of the various dynamic sections. + Allocate memory for them. */ + /* The check_relocs and adjust_dynamic_symbol entry points have + determined the sizes of the various dynamic sections. Allocate + memory for them. */ + plt = FALSE; + relocs = FALSE; + for (s = dynobj->sections; s != NULL; s = s->next) + { + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + + if (s == htab->root.splt) + { + /* Strip this section if we don't need it; see the + comment below. */ + plt = s->size != 0; + } + else if (s == elf_hash_table (info)->sgot) + { + got_size += s->size; + } + else if (s == elf_hash_table (info)->sgotplt) + { + got_size += s->size; + } + else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + { + if (s->size != 0 && s != elf_hash_table (info)->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->size == 0) + { + /* If we don't need this section, strip it from the + output file. This is mostly to handle .rela.bss and + .rela.plt. We must create both sections in + create_dynamic_sections, because they must be created + before the linker maps input sections to output + sections. The linker does that before + adjust_dynamic_symbol is called, and it is that + function which decides whether anything needs to go + into these sections. */ + s->flags |= SEC_EXCLUDE; + 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_NDS32_NONE reloc instead + of garbage. */ + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size); + if (s->contents == NULL) + return FALSE; + } + + + if (htab->root.dynamic_sections_created) + { + /* Add some entries to the .dynamic section. We fill in the + values later, in nds32_elf_finish_dynamic_sections, but we + must add the entries now so that we get the correct size for + the .dynamic section. The DT_DEBUG entry is filled in by the + dynamic linker and used by the debugger. */ +#define add_dynamic_entry(TAG, VAL) _bfd_elf_add_dynamic_entry (info, TAG, VAL) + + if (info->executable) + { + if (!add_dynamic_entry (DT_DEBUG, 0)) + return FALSE; + } + + if (elf_hash_table (info)->splt->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 (plt) + { + if (htab->dt_tlsdesc_plt + && (!add_dynamic_entry (DT_TLSDESC_PLT, 0) + || !add_dynamic_entry (DT_TLSDESC_GOT, 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->root, readonly_dynrelocs, + (void *) info); + + if ((info->flags & DF_TEXTREL) != 0) + { + if (!add_dynamic_entry (DT_TEXTREL, 0)) + return FALSE; + } + } + } +#undef add_dynamic_entry + + return TRUE; +} + +static bfd_reloc_status_type +nds32_relocate_contents (reloc_howto_type *howto, bfd *input_bfd, + bfd_vma relocation, bfd_byte *location) +{ + int size; + bfd_vma x = 0; + bfd_reloc_status_type flag; + unsigned int rightshift = howto->rightshift; + unsigned int bitpos = howto->bitpos; + + /* If the size is negative, negate RELOCATION. This isn't very + general. */ + if (howto->size < 0) + relocation = -relocation; + + /* Get the value we are going to relocate. */ + size = bfd_get_reloc_size (howto); + switch (size) + { + default: + case 0: + case 1: + case 8: + abort (); + break; + case 2: + x = bfd_getb16 (location); + break; + case 4: + x = bfd_getb32 (location); + break; + } + + /* Check for overflow. FIXME: We may drop bits during the addition + which we don't check for. We must either check at every single + operation, which would be tedious, or we must do the computations + in a type larger than bfd_vma, which would be inefficient. */ + flag = bfd_reloc_ok; + if (howto->complain_on_overflow != complain_overflow_dont) + { + bfd_vma addrmask, fieldmask, signmask, ss; + bfd_vma a, b, sum; + + /* Get the values to be added together. For signed and unsigned + relocations, we assume that all values should be truncated to + the size of an address. For bitfields, all the bits matter. + See also bfd_check_overflow. */ + fieldmask = N_ONES (howto->bitsize); + signmask = ~fieldmask; + addrmask = N_ONES (bfd_arch_bits_per_address (input_bfd)) | fieldmask; + a = (relocation & addrmask) >> rightshift; + b = (x & howto->src_mask & addrmask) >> bitpos; + + switch (howto->complain_on_overflow) + { + case complain_overflow_signed: + /* If any sign bits are set, all sign bits must be set. + That is, A must be a valid negative address after + shifting. */ + signmask = ~(fieldmask >> 1); + /* Fall through. */ + + case complain_overflow_bitfield: + /* Much like the signed check, but for a field one bit + wider. We allow a bitfield to represent numbers in the + range -2**n to 2**n-1, where n is the number of bits in the + field. Note that when bfd_vma is 32 bits, a 32-bit reloc + can't overflow, which is exactly what we want. */ + ss = a & signmask; + if (ss != 0 && ss != ((addrmask >> rightshift) & signmask)) + flag = bfd_reloc_overflow; + + /* We only need this next bit of code if the sign bit of B + is below the sign bit of A. This would only happen if + SRC_MASK had fewer bits than BITSIZE. Note that if + SRC_MASK has more bits than BITSIZE, we can get into + trouble; we would need to verify that B is in range, as + we do for A above. */ + ss = ((~howto->src_mask) >> 1) & howto->src_mask; + ss >>= bitpos; + + /* Set all the bits above the sign bit. */ + b = (b ^ ss) - ss; + + /* Now we can do the addition. */ + sum = a + b; + + /* See if the result has the correct sign. Bits above the + sign bit are junk now; ignore them. If the sum is + positive, make sure we did not have all negative inputs; + if the sum is negative, make sure we did not have all + positive inputs. The test below looks only at the sign + bits, and it really just + SIGN (A) == SIGN (B) && SIGN (A) != SIGN (SUM) + + We mask with addrmask here to explicitly allow an address + wrap-around. The Linux kernel relies on it, and it is + the only way to write assembler code which can run when + loaded at a location 0x80000000 away from the location at + which it is linked. */ + if (((~(a ^ b)) & (a ^ sum)) & signmask & addrmask) + flag = bfd_reloc_overflow; + + break; + + case complain_overflow_unsigned: + /* Checking for an unsigned overflow is relatively easy: + trim the addresses and add, and trim the result as well. + Overflow is normally indicated when the result does not + fit in the field. However, we also need to consider the + case when, e.g., fieldmask is 0x7fffffff or smaller, an + input is 0x80000000, and bfd_vma is only 32 bits; then we + will get sum == 0, but there is an overflow, since the + inputs did not fit in the field. Instead of doing a + separate test, we can check for this by or-ing in the + operands when testing for the sum overflowing its final + field. */ + sum = (a + b) & addrmask; + if ((a | b | sum) & signmask) + flag = bfd_reloc_overflow; + break; + + default: + abort (); + } + } + + /* Put RELOCATION in the right bits. */ + relocation >>= (bfd_vma) rightshift; + relocation <<= (bfd_vma) bitpos; + + /* Add RELOCATION to the right bits of X. */ + /* FIXME : 090616 + Because the relaxation may generate duplicate relocation at one address, + an addition to immediate in the instruction may cause the relocation added + several times. + This bug should be fixed in assembler, but a check is also needed here. */ + if (howto->partial_inplace) + x = ((x & ~howto->dst_mask) + | (((x & howto->src_mask) + relocation) & howto->dst_mask)); + else + x = ((x & ~howto->dst_mask) | ((relocation) & howto->dst_mask)); + + + /* Put the relocated value back in the object file. */ + switch (size) + { + default: + case 0: + case 1: + case 8: + abort (); + break; + case 2: + bfd_putb16 (x, location); + break; + case 4: + bfd_putb32 (x, location); + break; + } + + return flag; +} + +static bfd_reloc_status_type +nds32_elf_final_link_relocate (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; + + /* Sanity check the address. */ + if (address > bfd_get_section_limit (input_bfd, input_section)) + return bfd_reloc_outofrange; + + /* This function assumes that we are dealing with a basic relocation + against a symbol. We want to compute the value of the symbol to + relocate to. This is just VALUE, the value of the symbol, plus + ADDEND, any addend associated with the reloc. */ + relocation = value + addend; + + /* If the relocation is PC relative, we want to set RELOCATION to + the distance between the symbol (currently in RELOCATION) and the + location we are relocating. Some targets (e.g., i386-aout) + arrange for the contents of the section to be the negative of the + offset of the location within the section; for such targets + pcrel_offset is FALSE. Other targets (e.g., m88kbcs or ELF) + simply leave the contents of the section as zero; for such + targets pcrel_offset is TRUE. If pcrel_offset is FALSE we do not + need to subtract out the offset of the location within the + section (which is just ADDRESS). */ + if (howto->pc_relative) + { + relocation -= (input_section->output_section->vma + + input_section->output_offset); + if (howto->pcrel_offset) + relocation -= address; + } + + return nds32_relocate_contents (howto, input_bfd, relocation, + contents + address); +} + +static bfd_boolean +nds32_elf_output_symbol_hook (struct bfd_link_info *info, + const char *name, + Elf_Internal_Sym *elfsym ATTRIBUTE_UNUSED, + asection *input_sec, + struct elf_link_hash_entry *h ATTRIBUTE_UNUSED) +{ + const char *source; + FILE *sym_ld_script = NULL; + struct elf_nds32_link_hash_table *table; + + table = nds32_elf_hash_table (info); + sym_ld_script = table->sym_ld_script; + if (!sym_ld_script) + return TRUE; + + if (!h || !name || *name == '\0') + return TRUE; + + if (input_sec->flags & SEC_EXCLUDE) + return TRUE; + + if (!check_start_export_sym) + { + fprintf (sym_ld_script, "SECTIONS\n{\n"); + check_start_export_sym = 1; + } + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + if (!h->root.u.def.section->output_section) + return TRUE; + + if (bfd_is_const_section (input_sec)) + source = input_sec->name; + else + source = input_sec->owner->filename; + + fprintf (sym_ld_script, "\t%s = 0x%08lx;\t /* %s */\n", + h->root.root.string, + (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset), source); + } + + return TRUE; +} + +/* Relocate an NDS32/D ELF section. + There is some attempt to make this function usable for many architectures, + both for RELA and REL type relocs, if only to serve as a learning tool. + + The RELOCATE_SECTION function is called by the new ELF backend linker + to handle the relocations for a section. + + The relocs are always passed as Rela structures; if the section + actually uses Rel structures, the r_addend field will always be + zero. + + This function is responsible for adjust the section contents as + necessary, and (if using Rela relocs and generating a + relocatable output file) adjusting the reloc addend as + necessary. + + This function does not have to worry about setting the reloc + address or the reloc symbol index. + + LOCAL_SYMS is a pointer to the swapped in local symbols. + + LOCAL_SECTIONS is an array giving the section in the input file + corresponding to the st_shndx field of each local symbol. + + The global hash table entry for the global symbols can be found + via elf_sym_hashes (input_bfd). + + When generating relocatable output, this function must handle + STB_LOCAL/STT_SECTION symbols specially. The output symbol is + going to be the section symbol corresponding to the output + section, which means that the addend must be adjusted + accordingly. */ + +/* Return the base VMA address which should be subtracted from real addresses + when resolving @dtpoff relocation. + This is PT_TLS segment p_vaddr. */ + +/* Return the relocation value for @tpoff relocation + if STT_TLS virtual address is ADDRESS. */ + +/* Return the relocation value for @gottpoff relocation + if STT_TLS virtual address is ADDRESS. */ +static bfd_vma +gottpoff (struct bfd_link_info *info, bfd_vma address) +{ + bfd_vma tp_base; + bfd_vma tp_offset; + + /* If tls_sec is NULL, we should have signalled an error already. */ + if (elf_hash_table (info)->tls_sec == NULL) + return 0; + + tp_base = elf_hash_table (info)->tls_sec->vma; + tp_offset = address - tp_base; + + return tp_offset; +} + +#define POLY 0x755b /* crc = (0x10000 | POLY) >> 1 = 0xbaad. */ +#define INV_POLY 0xb55d + +/* Initial the crc table value. */ + +static void +nds32_precompute_byte_crc_table (void) +{ + int i; + int j; + unsigned short r; + r = 0; + for (i = 0; i < 0x100; ++i) + { + r = i << 8; + for (j = 7; j >= 0; --j) + { + unsigned short p = (r & 0x8000) ? POLY : 0; + r = (r << 1) ^ p; + } + byte_crc_table[i] = r; + } +} + +static void +nds32_precompute_byte_inv_crc_table (void) +{ + int i; + int j; + unsigned short r; + r = 0; + for (i = 0; i < 0x100; ++i) + { + r = i << 8; + for (j = 7; j >= 0; --j) + { + unsigned short p = (r & 0x8000) ? INV_POLY : 0; + r = (r << 1) ^ p; + } + byte_inv_crc_table[i] = r; + } +} + +/* Perform the crc computation. */ + +static void +nds32_crc_compute (bfd_byte *ptr, unsigned int size, unsigned short *sum) +{ + unsigned char b; + + if (size == 2) + { + b = *ptr++ ^ (*sum >> 8); + *sum = (0xffff & (*sum << 8)) ^ byte_crc_table[b]; + b = *ptr++ ^ (*sum >> 8); + *sum = (0xffff & (*sum << 8)) ^ byte_crc_table[b]; + b = (*sum >> 8); + *sum = (0xffff & (*sum << 8)) ^ byte_crc_table[b]; + b = (*sum >> 8); + *sum = (0xffff & (*sum << 8)) ^ byte_crc_table[b]; + } + else + { + b = *ptr++ ^ (*sum >> 8); + *sum = (0xffff & (*sum << 8)) ^ byte_crc_table[b]; + b = *ptr++ ^ (*sum >> 8); + *sum = (0xffff & (*sum << 8)) ^ byte_crc_table[b]; + b = *ptr++ ^ (*sum >> 8); + *sum = (0xffff & (*sum << 8)) ^ byte_crc_table[b]; + b = *ptr++ ^ (*sum >> 8); + *sum = (0xffff & (*sum << 8)) ^ byte_crc_table[b]; + } +} + +static void +nds32_crc_final (int num, unsigned short *sum) +{ + int i, tmp, r = 0; + unsigned short crc, inv_crc = 0; + + crc = *sum; + /* Reverse it. */ + for (i = 0; i < 16; ++i) + { + tmp = crc & 0x1; + inv_crc = (inv_crc << 1) | tmp; + crc = crc >> 1; + } + + for (i = 0; i < num + 2; ++i) + { + if (i == 0) + tmp = (inv_crc >> 8) ^ (r >> 8); + else if (i == 1) + tmp = (inv_crc & 0xff) ^ (r >> 8); + else + tmp = (r >> 8); + r = (0xffff & (r << 8)) ^ byte_inv_crc_table[tmp]; + } + crc = r; + inv_crc = 0; + + for (i = 0; i < 16; ++i) + { + tmp = crc & 0x1; + inv_crc = (inv_crc << 1) | tmp; + crc = crc >> 1; + } + + *sum = inv_crc; +} + +/* Traverse the security region and get the crc. */ + +static bfd_vma +nds32_elf_crc_relocation (Elf_Internal_Rela *start_rel, + Elf_Internal_Rela *end_rel, + Elf_Internal_Rela *irelend, + bfd_byte *contents) +{ + static bfd_boolean init = FALSE; + bfd_byte *location; + bfd_vma address; + bfd_vma x; + unsigned short sum = 0; + int num = 0; + static bfd_byte *ex9_contents = NULL; + Elf_Internal_Rela *irel; + bfd_boolean ex_final = FALSE; + + if (init == FALSE) + { + nds32_precompute_byte_crc_table (); + nds32_precompute_byte_inv_crc_table (); + init = TRUE; + if (ex9_section) + nds32_get_section_contents (ex9_section->owner, ex9_section, + &ex9_contents, TRUE); + } + + /* Check the final instruction is isps or not. */ + irel = end_rel; + while (irel < irelend && irel->r_offset == end_rel->r_offset) + { + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_SECURITY_16 + && irel->r_addend == NDS32_SECURITY_RESTART) + { + ex_final = TRUE; + break; + } + irel++; + } + + + /* It doesn't have to add crc itself. */ + + for (address = start_rel->r_offset + 4; address <= end_rel->r_offset;) + { + /* Don't check the next crc itself. */ + if (address == end_rel->r_offset && ex_final) + break; + + num += 4; + location = contents + address; + x = bfd_getb32 (location); + if (INSN_32BIT (x)) + { + /* 4byte instruction. */ + nds32_crc_compute (location, 4, &sum); + address += 4; + } + else + { + /* 2byte instruction. */ + /* Ex9 has to fetch table instruction. */ + if (((x >> 16) & 0xfe00) == INSN_EX9_IT_1 && ((x >> 16) & 0x1e0)) + { + if (!ex9_contents) + (*_bfd_error_handler) (_("SIG error: Can't get ex9 contents.")); + nds32_crc_compute (ex9_contents + ((x >> 16) & 0x1ff) * 4, + 4, &sum); + } + else if (((x >> 16) & 0xffe0) == INSN_EX9_IT_2) + { + if (!ex9_contents) + (*_bfd_error_handler) (_("SIG error: Can't get ex9 contents.")); + nds32_crc_compute (ex9_contents + ((x >> 16) & 0x1f) * 4, + 4, &sum); + } + else + nds32_crc_compute (location, 2, &sum); + address += 2; + } + } + + nds32_crc_final (num, &sum); + + return sum; +} + +/* Move all SECURITY_16 to the final one for each instruction. */ + +static void +nds32_elf_crc_adjust_reloc (Elf_Internal_Rela *relocs, + Elf_Internal_Rela *relend) +{ + Elf_Internal_Rela *rel, *crc_rel = NULL; + Elf_Internal_Rela rel_temp; + + for (rel = relocs; rel < relend; rel++) + { + if (crc_rel && crc_rel->r_offset == rel->r_offset) + { + memcpy (&rel_temp, rel, sizeof (Elf_Internal_Rela)); + memcpy (rel, crc_rel, sizeof (Elf_Internal_Rela)); + memcpy (crc_rel, &rel_temp, sizeof (Elf_Internal_Rela)); + crc_rel = rel; + } + else if (ELF32_R_TYPE (rel->r_info) == R_NDS32_SECURITY_16) + { + crc_rel = rel; + continue; + } + } +} + +static bfd_boolean +patch_tls_desc_to_ie (bfd_byte *contents, Elf_Internal_Rela *rel, bfd *ibfd) +{ + /* TLS_GD/TLS_LD model #1 + 46 00 00 00 sethi $r0,#0x0 + 58 00 00 00 ori $r0,$r0,#0x0 + 40 00 74 00 add $r0,$r0,$gp + 04 10 00 00 lwi $r1,[$r0+#0x0] + 4b e0 04 01 jral $lp,$r1 */ + + /* TLS_GD/TLS_LD model #2 + 46 00 00 00 sethi $r0,#0x0 + 58 00 00 00 ori $r0,$r0,#0x0 + 38 10 74 02 lw $r1,[$r0+($gp<<#0x0)] <= TODO: not necessary $r1 register allocation + 40 00 74 00 add $r0,$r0,$gp + 4b e0 04 01 jral $lp,$r1 */ + + /* TLS_IE model (non-PIC) + 46 00 00 00 sethi $r0,#0x0 + 04 00 00 00 lwi $r0,[$r0+#0x0] + 38 00 64 02 lw $r0,[$r0+($r25<<#0x0)] */ + + /* TLS_IE model (PIC) + 46 00 00 00 sethi $r0,#0x0 + 58 00 00 00 ori $r0,$r0,#0x0 + 38 00 74 02 lw $r0,[$r0+($gp<<#0x0)] + 38 00 64 02 lw $r0,[$r0+($r25<<#0x0)] */ + + /* TLS_GD_TO_IE model + 46 00 00 00 sethi $r0,#0x0 + 58 00 00 00 ori $r0,$r0,#0x0 + 40 00 74 00 add $r0,$rM,$gp + 04 00 00 01 lwi $r0,[$r0+#0x4] + 40 00 64 00 add $r0,$r0,$r25 */ + + bfd_boolean rz = FALSE; + + typedef struct + { + uint32_t opcode; + uint32_t mask; + } pat_t; + + uint32_t patch[3] = + { + 0x40007400, /* add $r0,$rM,$gp */ + 0x04000001, /* lwi $r0,[$r0+#0x4] */ + 0x40006400, /* add $r0,$r0,$r25 */ + }; + + pat_t mode0[3] = + { + { 0x40000000, 0xfe0003ff }, + { 0x04000000, 0xfe000000 }, + { 0x4be00001, 0xffff83ff }, + }; + + pat_t mode1[3] = + { + { 0x38007402, 0xfe007fff }, + { 0x40007400, 0xfe007fff }, + { 0x4be00001, 0xffff83ff }, + }; + + unsigned char *p = contents + rel->r_offset; + + uint32_t insn; + uint32_t regidx = 0; + insn = bfd_getb32 (p); + if (INSN_SETHI == (0xfe0fffffu & insn)) + { + regidx = 0x1f & (insn >> 20); + p += 4; + } + + insn = bfd_getb32 (p); + if (INSN_ORI == (0xfe007fffu & insn)) + { + regidx = 0x1f & (insn >> 20); + p += 4; + } + + if (patch[2] == bfd_getb32 (p + 8)) /* character instruction */ + { + /* already patched? */ + if ((patch[0] == (0xfff07fffu & bfd_getb32 (p + 0))) && + (patch[1] == bfd_getb32 (p + 4))) + rz = TRUE; + } + else if (mode0[0].opcode == (mode0[0].mask & bfd_getb32 (p + 0))) + { + if ((mode0[1].opcode == (mode0[1].mask & bfd_getb32 (p + 4))) && + (mode0[2].opcode == (mode0[2].mask & bfd_getb32 (p + 8)))) + { + bfd_putb32 (patch[0] | (regidx << 15), p + 0); + bfd_putb32 (patch[1], p + 4); + bfd_putb32 (patch[2], p + 8); + rz = TRUE; + } + } + else if (mode1[0].opcode == (mode1[0].mask & bfd_getb32 (p + 0))) + { + if ((mode1[1].opcode == (mode1[1].mask & bfd_getb32 (p + 4))) && + (mode1[2].opcode == (mode1[2].mask & bfd_getb32 (p + 8)))) + { + bfd_putb32 (patch[0] | (regidx << 15), p + 0); + bfd_putb32 (patch[1], p + 4); + bfd_putb32 (patch[2], p + 8); + rz = TRUE; + } + } + + if (!rz) + { + printf ("%s: %s @ 0x%08x\n", __func__, ibfd->filename, + (int) rel->r_offset); + BFD_ASSERT(0); /* unsupported pattern */ + } + + return rz; +} + +static enum elf_nds32_tls_type +get_tls_type (enum elf_nds32_reloc_type r_type, struct elf_link_hash_entry *h); + +static unsigned int +ones32 (register unsigned int x) +{ + /* 32-bit recursive reduction using SWAR... + but first step is mapping 2-bit values + into sum of 2 1-bit values in sneaky way. */ + x -= ((x >> 1) & 0x55555555); + x = (((x >> 2) & 0x33333333) + (x & 0x33333333)); + x = (((x >> 4) + x) & 0x0f0f0f0f); + x += (x >> 8); + x += (x >> 16); + return (x & 0x0000003f); +} + +static unsigned int +fls (register unsigned int x) +{ + return ffs (x & (-x)); +} + +#define nds32_elf_local_tlsdesc_gotent(bfd) \ + (elf_nds32_tdata (bfd)->local_tlsdesc_gotent) + +static bfd_boolean +nds32_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, + 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, *relend; + bfd_boolean ret = TRUE; /* Assume success. */ + int align = 0; + bfd_reloc_status_type r; + const char *errmsg = NULL; + bfd_vma gp; + struct elf_link_hash_table *ehtab; + struct elf_nds32_link_hash_table *htab; + bfd *dynobj; + bfd_vma *local_got_offsets; + asection *sgot, *splt, *sreloc; + bfd_vma high_address; + struct elf_nds32_link_hash_table *table; + int eliminate_gc_relocs; + bfd_vma fpbase_addr; + Elf_Internal_Rela *crc_rel = NULL; + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + ehtab = elf_hash_table (info); + htab = nds32_elf_hash_table (info); + high_address = bfd_get_section_limit (input_bfd, input_section); + + dynobj = htab->root.dynobj; + local_got_offsets = elf_local_got_offsets (input_bfd); + + sgot = ehtab->sgot; + splt = ehtab->splt; + sreloc = NULL; + + rel = relocs; + relend = relocs + input_section->reloc_count; + + table = nds32_elf_hash_table (info); + eliminate_gc_relocs = table->eliminate_gc_relocs; + + /* explain _SDA_BASE_ */ + /* By this time, we can adjust the value of _SDA_BASE_. */ + if ((!info->relocatable)) + { + is_SDA_BASE_set = 1; + r = nds32_elf_final_sda_base (output_bfd, info, &gp, TRUE); + if (r != bfd_reloc_ok) + return FALSE; + } + +#ifdef NDS32_LINUX_TOOLCHAIN + /* Do TLS model conversion once at first. */ + nds32_elf_unify_tls_model (input_bfd, input_section, contents, info); +#endif + + if (is_ITB_BASE_set == 0) + { + /* Set the _ITB_BASE_. */ + if (!nds32_elf_ex9_itb_base (info)) + { + (*_bfd_error_handler) (_("%B: error: Cannot set _ITB_BASE_"), + output_bfd); + bfd_set_error (bfd_error_bad_value); + } + } + + if (table->target_optimize & NDS32_RELAX_IFC_ON) + if (!nds32_elf_ifc_reloc ()) + (*_bfd_error_handler) (_("error: IFC relocation error.")); + + /* Relocation for .ex9.itable. */ + if ((table->target_optimize & NDS32_RELAX_EX9_ON) + || (table->ex9_import_file && table->update_ex9_table)) + nds32_elf_ex9_reloc_jmp (info); + + if (indirect_call_table.count > 0) + nds32_elf_ict_relocate (info); + + /* Use gp as fp to prevent truncated fit. Because in relaxation time + the fp value is set as gp, and it has be reverted for instruction + setting fp. */ + fpbase_addr = elf_gp (output_bfd); + + /* Move all SECURITY_16 to the final one for each instruction. */ + nds32_elf_crc_adjust_reloc (relocs, relend); + + /* Deal with (dynamic) relocations. */ + for (rel = relocs; rel < relend; rel++) + { + enum elf_nds32_reloc_type r_type; + reloc_howto_type *howto = NULL; + unsigned long r_symndx; + struct elf_link_hash_entry *h = NULL; + struct bfd_link_hash_entry *h2; + Elf_Internal_Sym *sym = NULL; + asection *sec; + bfd_vma relocation; + struct elf_nds32_ict_hash_entry *entry; + bfd_vma relocation_sym = 0xdeadbeef; + Elf_Internal_Rela *lorel; + bfd_vma off; + + /* We can't modify r_addend here as elf_link_input_bfd has an assert to + ensure it's zero (we use REL relocs, not RELA). Therefore this + should be assigning zero to `addend', but for clarity we use + `r_addend'. */ + + bfd_vma addend = rel->r_addend; + bfd_vma offset = rel->r_offset; + + r_type = ELF32_R_TYPE (rel->r_info); + if (r_type >= R_NDS32_max) + { + (*_bfd_error_handler) (_("%B: error: unknown relocation type %d."), + input_bfd, r_type); + bfd_set_error (bfd_error_bad_value); + ret = FALSE; + continue; + } + + if (r_type == R_NDS32_GNU_VTENTRY + || r_type == R_NDS32_GNU_VTINHERIT + || r_type == R_NDS32_NONE + || r_type == R_NDS32_RELA_GNU_VTENTRY + || r_type == R_NDS32_RELA_GNU_VTINHERIT + || (r_type >= R_NDS32_INSN16 && r_type <= R_NDS32_25_FIXED_RELA) + || r_type == R_NDS32_DATA + || r_type == R_NDS32_TRAN + || (r_type >= R_NDS32_LONGCALL4 && r_type <= R_NDS32_LONGJUMP7)) + continue; + + /* Save security beginning. */ + if (r_type == R_NDS32_SECURITY_16 && crc_rel == NULL) + { + crc_rel = rel; + continue; + } + + /* If we enter the fp-as-gp region. Resolve the address of best fp-base. */ + if (ELF32_R_TYPE (rel->r_info) == R_NDS32_RELAX_REGION_BEGIN + && (rel->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG)) + { + int dist; + + /* Distance to relocation of best fp-base is encoded in R_SYM. */ + dist = rel->r_addend >> 16; + fpbase_addr = calculate_memory_address (input_bfd, rel + dist, + local_syms, symtab_hdr); + } + else if (ELF32_R_TYPE (rel->r_info) == R_NDS32_RELAX_REGION_END + && (rel->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG)) + { + fpbase_addr = elf_gp (output_bfd); + } + + if (((r_type >= R_NDS32_DWARF2_OP1_RELA + && r_type <= R_NDS32_DWARF2_LEB_RELA) || r_type >= R_NDS32_RELAX_ENTRY) + && !info->relocatable) + continue; + + howto = bfd_elf32_bfd_reloc_type_table_lookup (r_type); + r_symndx = ELF32_R_SYM (rel->r_info); + + /* This is a final link. */ + sym = NULL; + sec = NULL; + h = NULL; + + if (r_symndx < symtab_hdr->sh_info) + { + /* Local symbol. */ + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + addend = rel->r_addend; + + /* keep symbol location for static TLS_IE GOT entry */ + relocation_sym = relocation; + } + else + { + /* External symbol. */ + bfd_boolean warned, unresolved_reloc; + int symndx = r_symndx - symtab_hdr->sh_info; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, h, sec, + relocation, unresolved_reloc, warned); + + /* keep symbol location for static TLS_IE GOT entry */ + relocation_sym = relocation; + + /* la $fp, _FP_BASE_ is per-function (region). + Handle it specially. */ + switch ((int) r_type) + { + case R_NDS32_SDA19S0_RELA: + case R_NDS32_SDA15S0_RELA: + case R_NDS32_20_RELA: + if (strcmp (elf_sym_hashes (input_bfd)[symndx]->root.root.string, + FP_BASE_NAME) == 0) + { + relocation = fpbase_addr; + break; + } + } + } + + if (info->relocatable) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend += sec->output_offset + sym->st_value; + + continue; + } + + /* Sanity check the address. */ + if (offset > high_address) + { + r = bfd_reloc_outofrange; + goto check_reloc; + } + + if ((r_type >= R_NDS32_DWARF2_OP1_RELA + && r_type <= R_NDS32_DWARF2_LEB_RELA) + || r_type >= R_NDS32_RELAX_ENTRY) + continue; + + switch ((int) r_type) + { + case R_NDS32_GOTOFF: + /* Relocation is relative to the start of the global offset + table (for ld24 rx, #uimm24), e.g. access at label + addend + + ld24 rx. #label@GOTOFF + addend + sub rx, r12. */ + case R_NDS32_GOTOFF_HI20: + case R_NDS32_GOTOFF_LO12: + case R_NDS32_GOTOFF_LO15: + case R_NDS32_GOTOFF_LO19: + BFD_ASSERT (sgot != NULL); + + relocation -= elf_gp (output_bfd); + break; + + case R_NDS32_9_PLTREL: + case R_NDS32_25_PLTREL: + /* Relocation is to the entry for this symbol in the + procedure linkage table. */ + + /* The native assembler will generate a 25_PLTREL reloc + for a local symbol if you assemble a call from one + section to another when using -K pic. */ + if (h == NULL) + break; + + if (h->forced_local) + break; + + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when + using -Bsymbolic. */ + if (h->plt.offset == (bfd_vma) - 1) + break; + + relocation = (splt->output_section->vma + + splt->output_offset + h->plt.offset); + break; + + case R_NDS32_PLT_GOTREL_HI20: + case R_NDS32_PLT_GOTREL_LO12: + case R_NDS32_PLT_GOTREL_LO15: + case R_NDS32_PLT_GOTREL_LO19: + case R_NDS32_PLT_GOTREL_LO20: + if (h == NULL + || h->forced_local + || h->plt.offset == (bfd_vma) -1 + || (info->pie && h->def_regular)) + { + /* TODO: find better checking to optimize PIE PLT relocations. */ + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when + using -Bsymbolic. */ + if (h) + h->plt.offset = (bfd_vma) -1; /* cancel PLT trampoline. */ + relocation -= elf_gp(output_bfd); + break; + } + + relocation = (splt->output_section->vma + + splt->output_offset + h->plt.offset); + + relocation -= elf_gp (output_bfd); + break; + + case R_NDS32_PLTREL_HI20: + case R_NDS32_PLTREL_LO12: + + /* Relocation is to the entry for this symbol in the + procedure linkage table. */ + + /* The native assembler will generate a 25_PLTREL reloc + for a local symbol if you assemble a call from one + section to another when using -K pic. */ + if (h == NULL) + break; + + if (h->forced_local) + break; + + if (h->plt.offset == (bfd_vma) - 1) + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when + using -Bsymbolic. */ + break; + + if (splt == NULL) + break; + + relocation = (splt->output_section->vma + + splt->output_offset + + h->plt.offset + 4) + - (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + + break; + + case R_NDS32_GOTPC20: + /* .got(_GLOBAL_OFFSET_TABLE_) - pc relocation + ld24 rx,#_GLOBAL_OFFSET_TABLE_ */ + relocation = elf_gp (output_bfd); + break; + + case R_NDS32_GOTPC_HI20: + case R_NDS32_GOTPC_LO12: + /* .got(_GLOBAL_OFFSET_TABLE_) - pc relocation + bl .+4 + seth rx,#high(_GLOBAL_OFFSET_TABLE_) + or3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4) + or + bl .+4 + seth rx,#shigh(_GLOBAL_OFFSET_TABLE_) + add3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4) */ + relocation = elf_gp (output_bfd); + relocation -= (input_section->output_section->vma + + input_section->output_offset + rel->r_offset); + break; + + case R_NDS32_GOT20: + /* Fall through. */ + case R_NDS32_GOT_HI20: + case R_NDS32_GOT_LO12: + case R_NDS32_GOT_LO15: + case R_NDS32_GOT_LO19: + /* Relocation is to the entry for this symbol in the global + offset table. */ + BFD_ASSERT (sgot != NULL); + + if (h != NULL) /* External symbol */ + { + bfd_boolean dyn; + + off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) - 1); + dyn = htab->root.dynamic_sections_created; + if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) + || (info->shared + && (info->symbolic + || h->dynindx == -1 + || h->forced_local) && h->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 4, we use the + least significant bit to record whether we have + initialized it already. + + When doing a dynamic link, we create a .rela.got + relocation entry to initialize the value. This + is done in the finish_dynamic_symbol routine. */ + if ((off & 1) != 0) /* clear LSB */ + off &= ~1; + else + { + bfd_put_32 (output_bfd, relocation, sgot->contents + off); + h->got.offset |= 1; /* mark initialized */ + } + } + relocation = sgot->output_section->vma + sgot->output_offset + off + - elf_gp (output_bfd); + } + else /* Local symbol */ + { + bfd_byte *loc; + + BFD_ASSERT (local_got_offsets != NULL + && local_got_offsets[r_symndx] != (bfd_vma) - 1); + + off = local_got_offsets[r_symndx]; + + /* The offset must always be a multiple of 4. We use + the least significant bit to record whether we have + already processed this entry. */ + if ((off & 1) != 0) /* clear LSB */ + off &= ~1; + else + { + bfd_put_32 (output_bfd, relocation, sgot->contents + off); + + if (info->shared) + { + asection *srelgot; + Elf_Internal_Rela outrel; + + /* We need to generate a R_NDS32_RELATIVE reloc + for the dynamic linker. */ + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + BFD_ASSERT (srelgot != NULL); + + outrel.r_offset = (elf_gp (output_bfd) + + sgot->output_offset + off); + outrel.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE); + outrel.r_addend = relocation; + loc = srelgot->contents; + loc += + srelgot->reloc_count * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + ++srelgot->reloc_count; + } + local_got_offsets[r_symndx] |= 1; + } + relocation = sgot->output_section->vma + sgot->output_offset + off + - elf_gp (output_bfd); + } + + break; + + case R_NDS32_25_PCREL_RELA: + case R_NDS32_HI20_RELA: + case R_NDS32_LO12S0_RELA: + /* Merge normal and indirect call functions. */ + if (!ignore_indirect_call && h + && elf32_nds32_hash_entry (h)->indirect_call) + { + (*_bfd_error_handler) + (_("%B: Warning: there are mixed" + " indirect call function \'%s\'\n"), + input_bfd, h->root.root.string); + + entry = (struct elf_nds32_ict_hash_entry*) + bfd_hash_lookup (&indirect_call_table, h->root.root.string, + FALSE, FALSE); + if (!entry) + { + (*_bfd_error_handler) + (_("%B %A: internal error indirect call relocation " + "0x%lx without hash.\n"), + input_bfd, sec, rel->r_offset); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + h2 = bfd_link_hash_lookup (info->hash, + "_INDIRECT_CALL_TABLE_BASE_", + FALSE, FALSE, FALSE); + relocation = ((h2->u.def.value + + h2->u.def.section->output_section->vma + + h2->u.def.section->output_offset) + + (entry->order * 4)); + break; + } + + /* Fall through. */ + case R_NDS32_16_RELA: + case R_NDS32_20_RELA: + case R_NDS32_5_RELA: + case R_NDS32_32_RELA: + case R_NDS32_9_PCREL_RELA: + case R_NDS32_WORD_9_PCREL_RELA: + case R_NDS32_10_UPCREL_RELA: + case R_NDS32_15_PCREL_RELA: + case R_NDS32_17_PCREL_RELA: + case R_NDS32_LO12S3_RELA: + case R_NDS32_LO12S2_RELA: + case R_NDS32_LO12S2_DP_RELA: + case R_NDS32_LO12S2_SP_RELA: + case R_NDS32_LO12S1_RELA: + case R_NDS32_LO12S0_ORI_RELA: + if (info->shared && r_symndx != 0 + && (input_section->flags & SEC_ALLOC) != 0 + && (eliminate_gc_relocs == 0 + || (sec && (sec->flags & SEC_EXCLUDE) == 0)) + && ((r_type != R_NDS32_9_PCREL_RELA + && r_type != R_NDS32_WORD_9_PCREL_RELA + && r_type != R_NDS32_10_UPCREL_RELA + && r_type != R_NDS32_15_PCREL_RELA + && r_type != R_NDS32_17_PCREL_RELA + && r_type != R_NDS32_25_PCREL_RELA + && !(r_type == R_NDS32_32_RELA + && strcmp (input_section->name, ".eh_frame") == 0)) + || (h != NULL && h->dynindx != -1 + && (!info->symbolic || !h->def_regular)))) + { + Elf_Internal_Rela outrel; + bfd_boolean skip, relocate; + bfd_byte *loc; + + /* When generating a shared object, these relocations + are copied into the output file to be resolved at run + time. */ + + if (sreloc == NULL) + { + const char *name; + + name = bfd_elf_string_from_elf_section + (input_bfd, elf_elfheader (input_bfd)->e_shstrndx, + elf_section_data (input_section)->rela.hdr->sh_name); + if (name == NULL) + return FALSE; + + BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (input_bfd, + input_section), + name + 5) == 0); + + sreloc = bfd_get_section_by_name (dynobj, name); + BFD_ASSERT (sreloc != NULL); + } + + skip = FALSE; + 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 (r_type == R_NDS32_17_PCREL_RELA + || r_type == R_NDS32_15_PCREL_RELA + || r_type == R_NDS32_25_PCREL_RELA) + { + BFD_ASSERT (h != NULL && h->dynindx != -1); + outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); + outrel.r_addend = rel->r_addend; + } + else + { + /* h->dynindx may be -1 if this symbol was marked to + become local. */ + if (h == NULL + || ((info->symbolic || h->dynindx == -1) + && h->def_regular) + || (info->pie && h->def_regular)) + { + relocate = TRUE; + outrel.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE); + outrel.r_addend = relocation + rel->r_addend; + if (h) + h->plt.offset = (bfd_vma) -1; /* cancel PLT trampoline. */ + } + else + { + if (h->dynindx == -1) + { + (*_bfd_error_handler) + (_("%B: relocation %s against `%s' can not be used when" + "making a shared object; recompile with -fPIC"), + input_bfd, nds32_elf_howto_table[r_type].name, h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); + outrel.r_addend = rel->r_addend; + } + } + + loc = sreloc->contents; + loc += sreloc->reloc_count * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + ++sreloc->reloc_count; + + /* 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; + + case R_NDS32_25_ABS_RELA: + if (info->shared) + { + (*_bfd_error_handler) + (_("%s: warning: cannot deal R_NDS32_25_ABS_RELA in shared mode."), + bfd_get_filename (input_bfd)); + return FALSE; + } + break; + + case R_NDS32_9_PCREL: + r = nds32_elf_do_9_pcrel_reloc (input_bfd, howto, input_section, + contents, offset, + sec, relocation, addend); + goto check_reloc; + + case R_NDS32_HI20: + /* We allow an arbitrary number of HI20 relocs before the + LO12 reloc. This permits GCC to emit the HI and LO relocs + itself. */ + for (lorel = rel + 1; + (lorel < relend + && ELF32_R_TYPE (lorel->r_info) == R_NDS32_HI20); lorel++) + continue; + if (lorel < relend + && (ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S3 + || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S2 + || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S1 + || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S0)) + { + nds32_elf_relocate_hi20 (input_bfd, r_type, rel, lorel, + contents, relocation + addend); + r = bfd_reloc_ok; + } + else + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, offset, relocation, + addend); + + goto check_reloc; + + case R_NDS32_GOT17S2_RELA: + case R_NDS32_GOT15S2_RELA: + BFD_ASSERT (sgot != NULL); + + if (h != NULL) + { + bfd_boolean dyn; + + off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) - 1); + + dyn = htab->root.dynamic_sections_created; + if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL + (dyn, info->shared, h) || (info->shared + && (info->symbolic + || h->dynindx == -1 + || h->forced_local) + && h->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 4, we use the + least significant bit to record whether we have + initialized it already. + + When doing a dynamic link, we create a .rela.got + relocation entry to initialize the value. This + is done in the finish_dynamic_symbol routine. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_32 (output_bfd, relocation, + sgot->contents + off); + h->got.offset |= 1; + } + } + } + else + { + bfd_byte *loc; + + BFD_ASSERT (local_got_offsets != NULL + && local_got_offsets[r_symndx] != (bfd_vma) - 1); + + off = local_got_offsets[r_symndx]; + + /* The offset must always be a multiple of 4. We use + the least significant bit to record whether we have + already processed this entry. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_32 (output_bfd, relocation, sgot->contents + off); + + if (info->shared) + { + asection *srelgot; + Elf_Internal_Rela outrel; + + /* We need to generate a R_NDS32_RELATIVE reloc + for the dynamic linker. */ + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + BFD_ASSERT (srelgot != NULL); + + outrel.r_offset = (elf_gp (output_bfd) + + sgot->output_offset + off); + outrel.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE); + outrel.r_addend = relocation; + loc = srelgot->contents; + loc += + srelgot->reloc_count * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + ++srelgot->reloc_count; + } + local_got_offsets[r_symndx] |= 1; + } + } + relocation = sgot->output_section->vma + sgot->output_offset + off + - elf_gp (output_bfd); + + if (relocation & align) + { + /* Incorrect alignment. */ + (*_bfd_error_handler) + (_("%B: warning: unaligned access to GOT entry."), input_bfd); + ret = FALSE; + r = bfd_reloc_dangerous; + goto check_reloc; + } + break; + + case R_NDS32_SDA16S3_RELA: + case R_NDS32_SDA15S3_RELA: + case R_NDS32_SDA15S3: + align = 0x7; + goto handle_sda; + + case R_NDS32_SDA17S2_RELA: + case R_NDS32_SDA15S2_RELA: + case R_NDS32_SDA12S2_SP_RELA: + case R_NDS32_SDA12S2_DP_RELA: + case R_NDS32_SDA15S2: + case R_NDS32_SDA_FP7U2_RELA: + align = 0x3; + goto handle_sda; + + case R_NDS32_SDA18S1_RELA: + case R_NDS32_SDA15S1_RELA: + case R_NDS32_SDA15S1: + align = 0x1; + goto handle_sda; + + case R_NDS32_SDA19S0_RELA: + case R_NDS32_SDA15S0_RELA: + case R_NDS32_SDA15S0: + align = 0x0; +handle_sda: + BFD_ASSERT (sec != NULL); + + /* If the symbol is in the abs section, the out_bfd will be null. + This happens when the relocation has a symbol@GOTOFF. */ + r = nds32_elf_final_sda_base (output_bfd, info, &gp, FALSE); + if (r != bfd_reloc_ok) + { + (*_bfd_error_handler) + (_("%B: warning: relocate SDA_BASE failed."), input_bfd); + ret = FALSE; + goto check_reloc; + } + + /* At this point `relocation' contains the object's + address. */ + if (r_type == R_NDS32_SDA_FP7U2_RELA) + { + relocation -= fpbase_addr; + } + else + relocation -= gp; + /* Now it contains the offset from _SDA_BASE_. */ + + /* Make sure alignment is correct. */ + + if (relocation & align) + { + /* Incorrect alignment. */ + (*_bfd_error_handler) + (_("%B(%A): warning: unaligned small data access of type %d."), + input_bfd, input_section, r_type); + ret = FALSE; + goto check_reloc; + } + + break; + case R_NDS32_17IFC_PCREL_RELA: + case R_NDS32_10IFCU_PCREL_RELA: + /* do nothing */ + break; + + case R_NDS32_TLS_LE_HI20: + case R_NDS32_TLS_LE_LO12: + case R_NDS32_TLS_LE_20: + case R_NDS32_TLS_LE_15S0: + case R_NDS32_TLS_LE_15S1: + case R_NDS32_TLS_LE_15S2: + if (elf_hash_table (info)->tls_sec != NULL) + relocation -= (elf_hash_table (info)->tls_sec->vma + TP_OFFSET); + break; + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12S2: + case R_NDS32_TLS_DESC_HI20: + case R_NDS32_TLS_DESC_LO12: + case R_NDS32_TLS_IE_LO12: + case R_NDS32_TLS_IEGP_HI20: + case R_NDS32_TLS_IEGP_LO12: + case R_NDS32_TLS_IEGP_LO12S2: + { + /* Relocation is to the entry for this symbol in the global + offset table. */ + enum elf_nds32_tls_type tls_type, org_tls_type, eff_tls_type; + asection *srelgot; + Elf_Internal_Rela outrel; + bfd_byte *loc; + int indx = 0; + + eff_tls_type = org_tls_type = get_tls_type (r_type, h); + + BFD_ASSERT (sgot != NULL); + if (h != NULL) + { + bfd_boolean dyn; + + off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) -1); + dyn = htab->root.dynamic_sections_created; + tls_type = ((struct elf_nds32_link_hash_entry *) h)->tls_type; + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) + && (!info->shared + || !SYMBOL_REFERENCES_LOCAL (info, h))) + indx = h->dynindx; + } + else + { + BFD_ASSERT (local_got_offsets != NULL + && local_got_offsets[r_symndx] != (bfd_vma) - 1); + + off = local_got_offsets[r_symndx]; + tls_type = elf32_nds32_local_got_tls_type (input_bfd)[r_symndx]; + } + + relocation = sgot->output_section->vma + sgot->output_offset + off; + + if (1 < ones32 (tls_type)) + { + eff_tls_type = 1 << (fls (tls_type) - 1); + /* TLS model shall be handled in nds32_elf_unify_tls_model () */ + + /* TLS model X -> LE is not implement yet! + * workaround here! */ + if (eff_tls_type == GOT_TLS_LE) + { + eff_tls_type = 1 << (fls (tls_type ^ eff_tls_type) - 1); + } + } + + /* The offset must always be a multiple of 4. We use + the least significant bit to record whether we have + already processed this entry. */ + bfd_boolean need_relocs = FALSE; + srelgot = ehtab->srelgot; + if ((info->shared || indx != 0) + && (h == NULL || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) + { + need_relocs = TRUE; + BFD_ASSERT (srelgot != NULL); + } + + if (off & 1) + { + off &= ~1; + relocation &= ~1; + + if (eff_tls_type & GOT_TLS_DESC) + { + relocation -= elf_gp (output_bfd); + if ((R_NDS32_TLS_DESC_HI20 == r_type) && (!need_relocs)) + { + /* TLS model shall be converted */ + BFD_ASSERT(0); + } + } + else if (eff_tls_type & GOT_TLS_IEGP) + { + relocation -= elf_gp (output_bfd); + } + } + else + { + if ((eff_tls_type & GOT_TLS_LE) && (tls_type ^ eff_tls_type)) + { + /* TLS model workaround shall be applied */ + BFD_ASSERT(0); + } + else if (eff_tls_type & (GOT_TLS_IE | GOT_TLS_IEGP)) + { + if (eff_tls_type & GOT_TLS_IEGP) + relocation -= elf_gp(output_bfd); + + if (need_relocs) + { + if (indx == 0) + outrel.r_addend = gottpoff (info, relocation_sym); + else + outrel.r_addend = 0; + outrel.r_offset = (sgot->output_section->vma + + sgot->output_offset + off); + outrel.r_info = ELF32_R_INFO (indx, R_NDS32_TLS_TPOFF); + + elf32_nds32_add_dynreloc (output_bfd, info, srelgot, + &outrel); + } + else + { + bfd_put_32 (output_bfd, gottpoff (info, relocation_sym), + sgot->contents + off); + } + } + else if (eff_tls_type & GOT_TLS_DESC) + { + relocation -= elf_gp (output_bfd); + if (need_relocs) + { + asection *srelplt; + srelplt = ehtab->srelplt; + + if (indx == 0) + outrel.r_addend = gottpoff (info, relocation_sym); + else + outrel.r_addend = 0; + outrel.r_offset = (sgot->output_section->vma + + sgot->output_offset + off); + outrel.r_info = ELF32_R_INFO (indx, R_NDS32_TLS_DESC); + + loc = srelplt->contents; + loc += htab->next_tls_desc_index++ * sizeof (Elf32_External_Rela); + BFD_ASSERT (loc + sizeof (Elf32_External_Rela) + <= srelplt->contents + srelplt->size); + + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + } + else + { + /* feed me! */ + bfd_put_32 (output_bfd, 0xdeadbeef, + sgot->contents + off); + bfd_put_32 (output_bfd, gottpoff (info, relocation_sym), + sgot->contents + off + 4); + patch_tls_desc_to_ie (contents, rel, input_bfd); + BFD_ASSERT(0); + } + } + else + { + /* TLS model workaround shall be applied */ + BFD_ASSERT(0); + } + + if (h != NULL) + h->got.offset |= 1; + else + local_got_offsets[r_symndx] |= 1; + } + } + break; + + case R_NDS32_SECURITY_16: + relocation = nds32_elf_crc_relocation (crc_rel, rel, relend, + contents); + crc_rel->r_addend = NDS32_SECURITY_NONE; + r = nds32_elf_final_link_relocate (howto, input_bfd, + input_section, contents, + crc_rel->r_offset, relocation, + crc_rel->r_addend); + crc_rel = NULL; + goto check_reloc; + break; + /* DON'T fall through. */ + case R_NDS32_ICT_HI20: + case R_NDS32_ICT_LO12: + case R_NDS32_ICT_25PC: + if (!ignore_indirect_call) + { + entry = (struct elf_nds32_ict_hash_entry*) + bfd_hash_lookup (&indirect_call_table, h->root.root.string, + FALSE, FALSE); + if (!entry) + { + (*_bfd_error_handler) + (_("%B %A: internal error indirect call relocation " + "0x%lx without hash.\n"), + input_bfd, sec, rel->r_offset); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + h2 = bfd_link_hash_lookup (info->hash, + "_INDIRECT_CALL_TABLE_BASE_", + FALSE, FALSE, FALSE); + relocation = ((h2->u.def.value + + h2->u.def.section->output_section->vma + + h2->u.def.section->output_offset) + + (entry->order * 4)); + } + break; + /* DON'T fall through. */ + + default: + /* OLD_NDS32_RELOC. */ + + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, offset, relocation, addend); + goto check_reloc; + } + + switch ((int) r_type) + { + case R_NDS32_20_RELA: + case R_NDS32_5_RELA: + case R_NDS32_9_PCREL_RELA: + case R_NDS32_WORD_9_PCREL_RELA: + case R_NDS32_10_UPCREL_RELA: + case R_NDS32_15_PCREL_RELA: + case R_NDS32_17_PCREL_RELA: + case R_NDS32_25_PCREL_RELA: + case R_NDS32_25_ABS_RELA: + case R_NDS32_HI20_RELA: + case R_NDS32_LO12S3_RELA: + case R_NDS32_LO12S2_RELA: + case R_NDS32_LO12S2_DP_RELA: + case R_NDS32_LO12S2_SP_RELA: + case R_NDS32_LO12S1_RELA: + case R_NDS32_LO12S0_RELA: + case R_NDS32_LO12S0_ORI_RELA: + case R_NDS32_SDA16S3_RELA: + case R_NDS32_SDA17S2_RELA: + case R_NDS32_SDA18S1_RELA: + case R_NDS32_SDA19S0_RELA: + case R_NDS32_SDA15S3_RELA: + case R_NDS32_SDA15S2_RELA: + case R_NDS32_SDA12S2_DP_RELA: + case R_NDS32_SDA12S2_SP_RELA: + case R_NDS32_SDA15S1_RELA: + case R_NDS32_SDA15S0_RELA: + case R_NDS32_SDA_FP7U2_RELA: + case R_NDS32_9_PLTREL: + case R_NDS32_25_PLTREL: + case R_NDS32_GOT20: + case R_NDS32_GOT_HI20: + case R_NDS32_GOT_LO12: + case R_NDS32_GOT_LO15: + case R_NDS32_GOT_LO19: + case R_NDS32_GOT15S2_RELA: + case R_NDS32_GOT17S2_RELA: + case R_NDS32_GOTPC20: + case R_NDS32_GOTPC_HI20: + case R_NDS32_GOTPC_LO12: + case R_NDS32_GOTOFF: + case R_NDS32_GOTOFF_HI20: + case R_NDS32_GOTOFF_LO12: + case R_NDS32_GOTOFF_LO15: + case R_NDS32_GOTOFF_LO19: + case R_NDS32_PLTREL_HI20: + case R_NDS32_PLTREL_LO12: + case R_NDS32_PLT_GOTREL_HI20: + case R_NDS32_PLT_GOTREL_LO12: + case R_NDS32_PLT_GOTREL_LO15: + case R_NDS32_PLT_GOTREL_LO19: + case R_NDS32_PLT_GOTREL_LO20: + case R_NDS32_17IFC_PCREL_RELA: + case R_NDS32_10IFCU_PCREL_RELA: + case R_NDS32_TLS_LE_HI20: + case R_NDS32_TLS_LE_LO12: + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12S2: + case R_NDS32_TLS_LE_20: + case R_NDS32_TLS_LE_15S0: + case R_NDS32_TLS_LE_15S1: + case R_NDS32_TLS_LE_15S2: + case R_NDS32_TLS_DESC_HI20: + case R_NDS32_TLS_DESC_LO12: + case R_NDS32_TLS_IE_LO12: + case R_NDS32_TLS_IEGP_HI20: + case R_NDS32_TLS_IEGP_LO12: + case R_NDS32_TLS_IEGP_LO12S2: + /* Instruction related relocs must handle endian properly. */ + /* NOTE: PIC IS NOT HANDLE YET; DO IT LATER. */ + r = nds32_elf_final_link_relocate (howto, input_bfd, + input_section, contents, + rel->r_offset, relocation, + rel->r_addend); + break; + + case R_NDS32_ICT_HI20: + case R_NDS32_ICT_LO12: + case R_NDS32_ICT_25PC: + r = nds32_elf_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, 0); + break; + + default: + /* All other relocs can use default handler. */ + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, rel->r_addend); + break; + } + +check_reloc: + + if (r != bfd_reloc_ok) + { + /* FIXME: This should be generic enough to go in a utility. */ + 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 || *name == '\0') + name = bfd_section_name (input_bfd, sec); + } + + if (errmsg != NULL) + goto common_error; + + switch (r) + { + case bfd_reloc_overflow: + if (!((*info->callbacks->reloc_overflow) + (info, (h ? &h->root : NULL), name, howto->name, + (bfd_vma) 0, input_bfd, input_section, offset))) + return FALSE; + break; + + case bfd_reloc_undefined: + if (!((*info->callbacks->undefined_symbol) + (info, name, input_bfd, input_section, offset, TRUE))) + return FALSE; + break; + + case bfd_reloc_outofrange: + errmsg = _("internal error: out of range error"); + goto common_error; + + case bfd_reloc_notsupported: + errmsg = _("internal error: unsupported relocation error"); + goto common_error; + + case bfd_reloc_dangerous: + errmsg = _("internal error: dangerous error"); + goto common_error; + + default: + errmsg = _("internal error: unknown error"); + /* Fall through. */ + +common_error: + if (!((*info->callbacks->warning) + (info, errmsg, name, input_bfd, input_section, offset))) + return FALSE; + break; + } + } + } + + /* Resotre header size to avoid overflow load. */ + if (elf_nds32_tdata (input_bfd)->hdr_size != 0) + symtab_hdr->sh_size = elf_nds32_tdata (input_bfd)->hdr_size; + + return ret; +} + +/* Finish up dynamic symbol handling. We set the contents of various + dynamic sections here. */ + +static bfd_boolean +nds32_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) +{ + struct elf_link_hash_table *ehtab; + struct elf_nds32_link_hash_entry *hent; + bfd_byte *loc; + + ehtab = elf_hash_table (info); + hent = (struct elf_nds32_link_hash_entry *) h; + + if (h->plt.offset != (bfd_vma) - 1) + { + asection *splt; + asection *sgot; + asection *srela; + + bfd_vma plt_index; + bfd_vma got_offset; + bfd_vma local_plt_offset; + Elf_Internal_Rela rela; + + /* This symbol has an entry in the procedure linkage table. Set + it up. */ + + BFD_ASSERT (h->dynindx != -1); + + splt = ehtab->splt; + sgot = ehtab->sgotplt; + srela = ehtab->srelplt; + BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL); + + /* Get the index in the procedure linkage table which + corresponds to this symbol. This is the index of this symbol + in all the symbols for which we are making plt entries. The + first entry in the procedure linkage table is reserved. */ + plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1; + + /* Get the offset into the .got table of the entry that + corresponds to this function. Each .got entry is 4 bytes. + The first three are reserved. */ + got_offset = (plt_index + 3) * 4; + + /* Fill in the entry in the procedure linkage table. */ + if (!info->shared) + { + unsigned long insn; + + insn = PLT_ENTRY_WORD0 + (((sgot->output_section->vma + + sgot->output_offset + got_offset) >> 12) + & 0xfffff); + bfd_putb32 (insn, splt->contents + h->plt.offset); + + insn = PLT_ENTRY_WORD1 + (((sgot->output_section->vma + + sgot->output_offset + got_offset) & 0x0fff) + >> 2); + bfd_putb32 (insn, splt->contents + h->plt.offset + 4); + + insn = PLT_ENTRY_WORD2; + bfd_putb32 (insn, splt->contents + h->plt.offset + 8); + + insn = PLT_ENTRY_WORD3 + (plt_index & 0x7ffff); + bfd_putb32 (insn, splt->contents + h->plt.offset + 12); + + insn = PLT_ENTRY_WORD4 + + (((unsigned int) ((-(h->plt.offset + 16)) >> 1)) & 0xffffff); + bfd_putb32 (insn, splt->contents + h->plt.offset + 16); + local_plt_offset = 12; + } + else + { + /* sda_base must be set at this time. */ + unsigned long insn; + long offset; + + /* FIXME, sda_base is 65536, it will damage opcode. */ + offset = sgot->output_section->vma + sgot->output_offset + got_offset + - elf_gp (output_bfd); + insn = PLT_PIC_ENTRY_WORD0 + ((offset >> 12) & 0xfffff); + bfd_putb32 (insn, splt->contents + h->plt.offset); + + insn = PLT_PIC_ENTRY_WORD1 + (offset & 0xfff); + bfd_putb32 (insn, splt->contents + h->plt.offset + 4); + + insn = PLT_PIC_ENTRY_WORD2; + bfd_putb32 (insn, splt->contents + h->plt.offset + 8); + + insn = PLT_PIC_ENTRY_WORD3; + bfd_putb32 (insn, splt->contents + h->plt.offset + 12); + + insn = PLT_PIC_ENTRY_WORD4 + (plt_index & 0x7fffff); + bfd_putb32 (insn, splt->contents + h->plt.offset + 16); + + insn = PLT_PIC_ENTRY_WORD5 + + (((unsigned int) ((-(h->plt.offset + 20)) >> 1)) & 0xffffff); + bfd_putb32 (insn, splt->contents + h->plt.offset + 20); + + local_plt_offset = 16; + } + + /* Fill in the entry in the global offset table, + so it will fall through to the next instruction for the first time. */ + bfd_put_32 (output_bfd, + (splt->output_section->vma + splt->output_offset + + h->plt.offset + local_plt_offset), + sgot->contents + got_offset); + + /* Fill in the entry in the .rela.plt section. */ + rela.r_offset = (sgot->output_section->vma + + sgot->output_offset + got_offset); + rela.r_info = ELF32_R_INFO (h->dynindx, R_NDS32_JMP_SLOT); + rela.r_addend = 0; + loc = srela->contents; + loc += plt_index * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); + + if (!h->def_regular) + { + /* Mark the symbol as undefined, rather than as defined in + the .plt section. Leave the value alone. */ + sym->st_shndx = SHN_UNDEF; + if (!h->ref_regular_nonweak) + sym->st_value = 0; + } + } + + if ((h->got.offset != (bfd_vma) -1) && (hent->tls_type == GOT_NORMAL)) + { + asection *sgot; + asection *srelagot; + Elf_Internal_Rela rela; + + /* This symbol has an entry in the global offset table. + Set it up. */ + + sgot = ehtab->sgot; + srelagot = ehtab->srelgot; + BFD_ASSERT (sgot != NULL && srelagot != NULL); + + rela.r_offset = (sgot->output_section->vma + + sgot->output_offset + (h->got.offset & ~1)); + + /* If this is a -Bsymbolic link, and the symbol is defined + locally, we just want to emit a RELATIVE reloc. Likewise if + the symbol was forced to be local because of a version file. + 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->forced_local) + && h->def_regular) + || (info->pie && h->def_regular)) + { + rela.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE); + rela.r_addend = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + + /* FIXME: cancel PLT trampoline, too late ?? */ + /* h->plt.offset = (bfd_vma) -1; */ + } + else + { + BFD_ASSERT ((h->got.offset & 1) == 0); + bfd_put_32 (output_bfd, (bfd_vma) 0, + sgot->contents + h->got.offset); + rela.r_info = ELF32_R_INFO (h->dynindx, R_NDS32_GLOB_DAT); + rela.r_addend = 0; + } + + loc = srelagot->contents; + loc += srelagot->reloc_count * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); + ++srelagot->reloc_count; + BFD_ASSERT (loc < (srelagot->contents + srelagot->size)); + } + + if (h->needs_copy) + { + asection *s; + Elf_Internal_Rela rela; + + /* This symbols needs a copy reloc. Set it up. */ + + BFD_ASSERT (h->dynindx != -1 + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak)); + + s = bfd_get_section_by_name (h->root.u.def.section->owner, ".rela.bss"); + BFD_ASSERT (s != NULL); + + rela.r_offset = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + rela.r_info = ELF32_R_INFO (h->dynindx, R_NDS32_COPY); + rela.r_addend = 0; + loc = s->contents; + loc += s->reloc_count * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); + ++s->reloc_count; + } + + /* Mark some specially defined symbols as absolute. */ + if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + sym->st_shndx = SHN_ABS; + + return TRUE; +} + + +/* Finish up the dynamic sections. */ + +static bfd_boolean +nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) +{ + bfd *dynobj; + asection *sdyn; + asection *sgotplt; + struct elf_link_hash_table *ehtab; + struct elf_nds32_link_hash_table *htab; + + ehtab = elf_hash_table (info); + htab = nds32_elf_hash_table (info); + if (htab == NULL) + return FALSE; + + dynobj = elf_hash_table (info)->dynobj; + + sgotplt = ehtab->sgotplt; + /* A broken linker script might have discarded the dynamic sections. + Catch this here so that we do not seg-fault later on. */ + if (sgotplt != NULL && bfd_is_abs_section (sgotplt->output_section)) + return FALSE; + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + + if (elf_hash_table (info)->dynamic_sections_created) + { + asection *splt; + Elf32_External_Dyn *dyncon, *dynconend; + + BFD_ASSERT (sgotplt != NULL && sdyn != NULL); + + dyncon = (Elf32_External_Dyn *) sdyn->contents; + dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size); + + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + asection *s; + + bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); + + switch (dyn.d_tag) + { + default: + break; + + case DT_PLTGOT: + /* name = ".got"; */ + s = ehtab->sgot->output_section; + goto get_vma; + case DT_JMPREL: + s = ehtab->srelplt->output_section; +get_vma: + BFD_ASSERT (s != NULL); + dyn.d_un.d_ptr = s->vma; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_PLTRELSZ: + s = ehtab->srelplt->output_section; + BFD_ASSERT (s != NULL); + dyn.d_un.d_val = s->size; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_RELASZ: + /* My reading of the SVR4 ABI indicates that the + procedure linkage table relocs (DT_JMPREL) should be + included in the overall relocs (DT_RELA). This is + what Solaris does. However, UnixWare can not handle + that case. 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. */ + if (ehtab->srelplt != NULL) + { + s = ehtab->srelplt->output_section; + dyn.d_un.d_val -= s->size; + } + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_TLSDESC_PLT: + s = htab->root.splt; + dyn.d_un.d_ptr = (s->output_section->vma + s->output_offset + + htab->dt_tlsdesc_plt); + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_TLSDESC_GOT: + s = htab->root.sgot; + dyn.d_un.d_ptr = (s->output_section->vma + s->output_offset + + htab->dt_tlsdesc_got); + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + } + } + + /* Fill in the first entry in the procedure linkage table. */ + splt = ehtab->splt; + if (splt && splt->size > 0) + { + if (info->shared) + { + unsigned long insn; + long offset; + + /* FIXME, sda_base is 65536, it will damage opcode. */ + offset = sgotplt->output_section->vma + sgotplt->output_offset + 4 + - elf_gp (output_bfd); + insn = PLT0_PIC_ENTRY_WORD0 | ((offset >> 12) & 0xfffff); + bfd_putb32 (insn, splt->contents); + + /* here has a typo? */ + insn = PLT0_PIC_ENTRY_WORD1 | (offset & 0xfff); + bfd_putb32 (insn, splt->contents + 4); + + insn = PLT0_PIC_ENTRY_WORD2; + bfd_putb32 (insn, splt->contents + 8); + + insn = PLT0_PIC_ENTRY_WORD3; + bfd_putb32 (insn, splt->contents + 12); + + insn = PLT0_PIC_ENTRY_WORD4; + bfd_putb32 (insn, splt->contents + 16); + + insn = PLT0_PIC_ENTRY_WORD5; + bfd_putb32 (insn, splt->contents + 20); + } + else + { + unsigned long insn; + unsigned long addr; + + /* addr = .got + 4 */ + addr = sgotplt->output_section->vma + sgotplt->output_offset + 4; + insn = PLT0_ENTRY_WORD0 | ((addr >> 12) & 0xfffff); + bfd_putb32 (insn, splt->contents); + + insn = PLT0_ENTRY_WORD1 | (addr & 0x0fff); + bfd_putb32 (insn, splt->contents + 4); + + insn = PLT0_ENTRY_WORD2; + bfd_putb32 (insn, splt->contents + 8); + + insn = PLT0_ENTRY_WORD3; + bfd_putb32 (insn, splt->contents + 12); + + insn = PLT0_ENTRY_WORD4; + bfd_putb32 (insn, splt->contents + 16); + } + + elf_section_data (splt->output_section)->this_hdr.sh_entsize = + PLT_ENTRY_SIZE; + } + + if (htab->dt_tlsdesc_plt) + { + /* Calculate addresses. */ + asection *sgot = sgot = ehtab->sgot; + bfd_vma pltgot = sgotplt->output_section->vma + + sgotplt->output_offset; + bfd_vma tlsdesc_got = sgot->output_section->vma + sgot->output_offset + + htab->dt_tlsdesc_got; + + /* Get GP offset. */ + pltgot -= elf_gp (output_bfd) - 4; /* PLTGOT[1] */ + tlsdesc_got -= elf_gp (output_bfd); + + /* Do relocation. */ + dl_tlsdesc_lazy_trampoline[0] += ((1 << 20) - 1) & (tlsdesc_got >> 12); + dl_tlsdesc_lazy_trampoline[1] += 0xfff & tlsdesc_got; + dl_tlsdesc_lazy_trampoline[4] += ((1 << 20) - 1) & (pltgot >> 12); + dl_tlsdesc_lazy_trampoline[5] += 0xfff & pltgot; + + /* TODO: relaxation. */ + + /* Insert .plt. */ + nds32_put_trampoline (splt->contents + htab->dt_tlsdesc_plt, + dl_tlsdesc_lazy_trampoline, + ARRAY_SIZE (dl_tlsdesc_lazy_trampoline)); + } + } + + /* Fill in the first three entries in the global offset table. */ + if (sgotplt && sgotplt->size > 0) + { + if (sdyn == NULL) + bfd_put_32 (output_bfd, (bfd_vma) 0, sgotplt->contents); + else + bfd_put_32 (output_bfd, + sdyn->output_section->vma + sdyn->output_offset, + sgotplt->contents); + bfd_put_32 (output_bfd, (bfd_vma) 0, sgotplt->contents + 4); + bfd_put_32 (output_bfd, (bfd_vma) 0, sgotplt->contents + 8); + + elf_section_data (sgotplt->output_section)->this_hdr.sh_entsize = 4; + } + + return TRUE; +} + + +/* Set the right machine number. */ + +static bfd_boolean +nds32_elf_object_p (bfd *abfd) +{ + static unsigned int cur_arch = 0; + + if (E_N1_ARCH != (elf_elfheader (abfd)->e_flags & EF_NDS_ARCH)) + { + /* E_N1_ARCH is a wild card, so it is set only when no others exist. */ + cur_arch = (elf_elfheader (abfd)->e_flags & EF_NDS_ARCH); + } + + switch (cur_arch) + { + default: + case E_N1_ARCH: + bfd_default_set_arch_mach (abfd, bfd_arch_nds32, bfd_mach_n1); + break; + case E_N1H_ARCH: + bfd_default_set_arch_mach (abfd, bfd_arch_nds32, bfd_mach_n1h); + break; + case E_NDS_ARCH_STAR_V2_0: + bfd_default_set_arch_mach (abfd, bfd_arch_nds32, bfd_mach_n1h_v2); + break; + case E_NDS_ARCH_STAR_V3_0: + bfd_default_set_arch_mach (abfd, bfd_arch_nds32, bfd_mach_n1h_v3); + break; + case E_NDS_ARCH_STAR_V3_M: + bfd_default_set_arch_mach (abfd, bfd_arch_nds32, bfd_mach_n1h_v3m); + break; + } + + return TRUE; +} + +/* Store the machine number in the flags field. */ + +static void +nds32_elf_final_write_processing (bfd *abfd, + bfd_boolean linker ATTRIBUTE_UNUSED) +{ + unsigned long val; + static unsigned int cur_mach = 0; + unsigned int i; + + if (bfd_mach_n1 != bfd_get_mach (abfd)) + { + cur_mach = bfd_get_mach (abfd); + } + + switch (cur_mach) + { + case bfd_mach_n1: + /* Only happen when object is empty, since the case is abandon. */ + val = E_N1_ARCH; + val |= E_NDS_ABI_AABI; + val |= E_NDS32_ELF_VER_1_4; + break; + case bfd_mach_n1h: + val = E_N1H_ARCH; + break; + case bfd_mach_n1h_v2: + val = E_NDS_ARCH_STAR_V2_0; + break; + case bfd_mach_n1h_v3: + val = E_NDS_ARCH_STAR_V3_0; + break; + case bfd_mach_n1h_v3m: + val = E_NDS_ARCH_STAR_V3_M; + break; + default: + val = 0; + break; + } + + elf_elfheader (abfd)->e_flags &= ~EF_NDS_ARCH; + elf_elfheader (abfd)->e_flags |= val; + + if (ict_file) + { + fprintf (ict_file, ".section " NDS32_ICT_SECTION ", \"ax\"\n" + ".globl _INDIRECT_CALL_TABLE_BASE_\n" + "_INDIRECT_CALL_TABLE_BASE_:\n"); + /* Output rom patch entries. */ + indirect_call_table.frozen = 1; + for (i = 0; i < indirect_call_table.size; i++) + { + struct bfd_hash_entry *p; + struct elf_nds32_ict_hash_entry *entry; + + for (p = indirect_call_table.table[i]; p != NULL; p = p->next) + { + entry = (struct elf_nds32_ict_hash_entry *) p; + fprintf (ict_file, "\tj\t%s\n", entry->root.string); + } + } + indirect_call_table.frozen = 0; + } +} + +/* Function to keep NDS32 specific file flags. */ + +static bfd_boolean +nds32_elf_set_private_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; +} + +static unsigned int +convert_e_flags (unsigned int e_flags, unsigned int arch) +{ + if ((e_flags & EF_NDS_ARCH) == E_NDS_ARCH_STAR_V0_9) + { + /* From 0.9 to 1.0. */ + e_flags = (e_flags & (~EF_NDS_ARCH)) | E_NDS_ARCH_STAR_V1_0; + + /* Invert E_NDS32_HAS_NO_MAC_INST. */ + e_flags ^= E_NDS32_HAS_NO_MAC_INST; + if (arch == E_NDS_ARCH_STAR_V1_0) + { + /* Done. */ + return e_flags; + } + } + + /* From 1.0 to 2.0. */ + e_flags = (e_flags & (~EF_NDS_ARCH)) | E_NDS_ARCH_STAR_V2_0; + + /* Clear E_NDS32_HAS_MFUSR_PC_INST. */ + e_flags &= ~E_NDS32_HAS_MFUSR_PC_INST; + + /* Invert E_NDS32_HAS_NO_MAC_INST. */ + e_flags ^= E_NDS32_HAS_NO_MAC_INST; + return e_flags; +} + +static bfd_boolean +nds32_check_vec_size (bfd *ibfd) +{ + static unsigned int nds32_vec_size = 0; + + asection *sec_t = NULL; + bfd_byte *contents = NULL; + + sec_t = bfd_get_section_by_name (ibfd, ".nds32_e_flags"); + + if (sec_t && sec_t->size >= 4) + { + /* Get vec_size in file. */ + unsigned int flag_t; + + nds32_get_section_contents (ibfd, sec_t, &contents, TRUE); + flag_t = bfd_get_32 (ibfd, contents); + + /* The value could only be 4 or 16. */ + + if (!nds32_vec_size) + /* Set if not set yet. */ + nds32_vec_size = (flag_t & 0x3); + else if (nds32_vec_size != (flag_t & 0x3)) + { + (*_bfd_error_handler) (_("%B: ISR vector size mismatch" + " with previous modules, previous %u-byte, current %u-byte"), + ibfd, + nds32_vec_size == 1 ? 4 : nds32_vec_size == 2 ? 16 : 0xffffffff, + (flag_t & 0x3) == 1 ? 4 : (flag_t & 0x3) == 2 ? 16 : 0xffffffff); + return FALSE; + } + else + /* Only keep the first vec_size section. */ + sec_t->flags |= SEC_EXCLUDE; + } + + return TRUE; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ + +static bfd_boolean +nds32_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) +{ + flagword out_flags; + flagword in_flags; + flagword out_16regs; + flagword in_no_mac; + flagword out_no_mac; + flagword in_16regs; + flagword out_version; + flagword in_version; + flagword out_fpu_config; + flagword in_fpu_config; + + /* TODO: Revise to use object-attributes instead. */ + if (!nds32_check_vec_size (ibfd)) + return FALSE; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return TRUE; + + if (bfd_little_endian (ibfd) != bfd_little_endian (obfd)) + { + (*_bfd_error_handler) + (_("%B: warning: Endian mismatch with previous modules."), ibfd); + + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + /* [Bug 11585] [Ticket 7067] -B option in objcopy cannot work as expected. + e_flags = 0 shall be treat as generic one. + no checking, and no merging. + */ + if (elf_elfheader (ibfd)->e_flags) + { + in_version = elf_elfheader (ibfd)->e_flags & EF_NDS32_ELF_VERSION; + if (in_version == E_NDS32_ELF_VER_1_2) + { + (*_bfd_error_handler) + (_("%B: warning: Older version of object file encountered, " + "Please recompile with current tool chain."), ibfd); + } + + /* We may need to merge V1 and V2 arch object files to V2. */ + if ((elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH) + != (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH)) + { + /* Need to convert version. */ + if ((elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH) + == E_NDS_ARCH_STAR_RESERVED) + { + elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + } + else if ((elf_elfheader (obfd)->e_flags & EF_NDS_ARCH) + == E_NDS_ARCH_STAR_V0_9 + || (elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH) + > (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH)) + { + elf_elfheader (obfd)->e_flags = + convert_e_flags (elf_elfheader (obfd)->e_flags, + (elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH)); + } + else + { + elf_elfheader (ibfd)->e_flags = + convert_e_flags (elf_elfheader (ibfd)->e_flags, + (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH)); + } + } + + /* Extract some flags. */ + in_flags = elf_elfheader (ibfd)->e_flags + & (~(E_NDS32_HAS_REDUCED_REGS | EF_NDS32_ELF_VERSION + | E_NDS32_HAS_NO_MAC_INST | E_NDS32_FPU_REG_CONF)); + + /* The following flags need special treatment. */ + in_16regs = elf_elfheader (ibfd)->e_flags & E_NDS32_HAS_REDUCED_REGS; + in_no_mac = elf_elfheader (ibfd)->e_flags & E_NDS32_HAS_NO_MAC_INST; + in_fpu_config = elf_elfheader (ibfd)->e_flags & E_NDS32_FPU_REG_CONF; + + /* Extract some flags. */ + out_flags = elf_elfheader (obfd)->e_flags + & (~(E_NDS32_HAS_REDUCED_REGS | EF_NDS32_ELF_VERSION + | E_NDS32_HAS_NO_MAC_INST | E_NDS32_FPU_REG_CONF)); + + /* The following flags need special treatment. */ + out_16regs = elf_elfheader (obfd)->e_flags & E_NDS32_HAS_REDUCED_REGS; + out_no_mac = elf_elfheader (obfd)->e_flags & E_NDS32_HAS_NO_MAC_INST; + out_fpu_config = elf_elfheader (obfd)->e_flags & E_NDS32_FPU_REG_CONF; + out_version = elf_elfheader (obfd)->e_flags & EF_NDS32_ELF_VERSION; + 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 = elf_elfheader (ibfd)->e_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 & EF_NDS_ABI) != (out_flags & EF_NDS_ABI)) + { + (*_bfd_error_handler) + (_("%B: error: ABI mismatch with previous modules."), ibfd); + + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + if ((in_flags & EF_NDS_ARCH) != (out_flags & EF_NDS_ARCH)) + { + if (((in_flags & EF_NDS_ARCH) != E_N1_ARCH)) + { + (*_bfd_error_handler) + (_("%B: error: Instruction set mismatch with previous modules."), ibfd); + + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + } + + /* When linking with V1.2 and V1.3 objects together the output is V1.2. + and perf ext1 and DIV are mergerd to perf ext1. */ + if (in_version == E_NDS32_ELF_VER_1_2 || out_version == E_NDS32_ELF_VER_1_2) + { + elf_elfheader (obfd)->e_flags = + (in_flags & (~(E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) + | (out_flags & (~(E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) + | (((in_flags & (E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) + ? E_NDS32_HAS_EXT_INST : 0) + | (((out_flags & (E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) + ? E_NDS32_HAS_EXT_INST : 0) + | (in_16regs & out_16regs) | (in_no_mac & out_no_mac) + | ((in_version > out_version) ? out_version : in_version); + } + else + { + if (in_version != out_version) + (*_bfd_error_handler) ( + _("%B: warning: Incompatible elf-versions %s and %s."), ibfd, + nds32_elfver_strtab[out_version], + nds32_elfver_strtab[in_version]); + + elf_elfheader (obfd)->e_flags = in_flags | out_flags + | (in_16regs & out_16regs) | (in_no_mac & out_no_mac) + | (in_fpu_config > out_fpu_config ? in_fpu_config : out_fpu_config) + | (in_version > out_version ? out_version : in_version); + } + } + return TRUE; +} + +/* Display the flags field. */ + +static bfd_boolean +nds32_elf_print_private_bfd_data (bfd *abfd, void *ptr) +{ + FILE *file = (FILE *) ptr; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + _bfd_elf_print_private_bfd_data (abfd, ptr); + + fprintf (file, _("private flags = %lx"), elf_elfheader (abfd)->e_flags); + + switch (elf_elfheader (abfd)->e_flags & EF_NDS_ARCH) + { + default: + case E_N1_ARCH: + fprintf (file, _(": n1 instructions")); + break; + case E_N1H_ARCH: + fprintf (file, _(": n1h instructions")); + break; + } + + fputc ('\n', file); + + return TRUE; +} + +static unsigned int +nds32_elf_action_discarded (asection *sec) +{ + + if (strncmp + (".gcc_except_table", sec->name, sizeof (".gcc_except_table") - 1) == 0) + return 0; + + return _bfd_elf_default_action_discarded (sec); +} + +static asection * +nds32_elf_gc_mark_hook (asection *sec, struct bfd_link_info *info, + 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_NDS32_GNU_VTINHERIT: + case R_NDS32_GNU_VTENTRY: + case R_NDS32_RELA_GNU_VTINHERIT: + case R_NDS32_RELA_GNU_VTENTRY: + return NULL; + } + + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); +} + +static bfd_boolean +nds32_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, asection *sec, + const Elf_Internal_Rela *relocs) +{ + /* Update the got entry reference counts for the section being removed. */ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + bfd_signed_vma *local_got_refcounts; + const Elf_Internal_Rela *rel, *relend; + + 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++) + { + unsigned long r_symndx; + struct elf_link_hash_entry *h = NULL; + + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + /* External symbol. */ + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } + + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_NDS32_GOT_HI20: + case R_NDS32_GOT_LO12: + case R_NDS32_GOT_LO15: + case R_NDS32_GOT_LO19: + case R_NDS32_GOT17S2_RELA: + case R_NDS32_GOT15S2_RELA: + case R_NDS32_GOTOFF: + case R_NDS32_GOTOFF_HI20: + case R_NDS32_GOTOFF_LO12: + case R_NDS32_GOTOFF_LO15: + case R_NDS32_GOTOFF_LO19: + case R_NDS32_GOT20: + case R_NDS32_GOTPC_HI20: + case R_NDS32_GOTPC_LO12: + case R_NDS32_GOTPC20: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount--; + } + else + { + if (local_got_refcounts && local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx]--; + } + break; + + case R_NDS32_16_RELA: + case R_NDS32_20_RELA: + case R_NDS32_5_RELA: + case R_NDS32_32_RELA: + case R_NDS32_HI20_RELA: + case R_NDS32_LO12S3_RELA: + case R_NDS32_LO12S2_RELA: + case R_NDS32_LO12S2_DP_RELA: + case R_NDS32_LO12S2_SP_RELA: + case R_NDS32_LO12S1_RELA: + case R_NDS32_LO12S0_RELA: + case R_NDS32_LO12S0_ORI_RELA: + case R_NDS32_SDA16S3_RELA: + case R_NDS32_SDA17S2_RELA: + case R_NDS32_SDA18S1_RELA: + case R_NDS32_SDA19S0_RELA: + case R_NDS32_SDA15S3_RELA: + case R_NDS32_SDA15S2_RELA: + case R_NDS32_SDA12S2_DP_RELA: + case R_NDS32_SDA12S2_SP_RELA: + case R_NDS32_SDA15S1_RELA: + case R_NDS32_SDA15S0_RELA: + case R_NDS32_SDA_FP7U2_RELA: + case R_NDS32_15_PCREL_RELA: + case R_NDS32_17_PCREL_RELA: + case R_NDS32_25_PCREL_RELA: + if (h != NULL) + { + struct elf_nds32_link_hash_entry *eh; + struct elf_nds32_dyn_relocs **pp; + struct elf_nds32_dyn_relocs *p; + + if (!info->shared && h->plt.refcount > 0) + h->plt.refcount -= 1; + + eh = (struct elf_nds32_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_NDS32_15_PCREL_RELA + || ELF32_R_TYPE (rel->r_info) == R_NDS32_17_PCREL_RELA + || ELF32_R_TYPE (rel->r_info) == R_NDS32_25_PCREL_RELA) + p->pc_count -= 1; + p->count -= 1; + if (p->count == 0) + *pp = p->next; + break; + } + } + break; + + case R_NDS32_9_PLTREL: + case R_NDS32_25_PLTREL: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount--; + } + break; + + default: + break; + } + } + + return TRUE; +} + +static enum elf_nds32_tls_type +get_tls_type (enum elf_nds32_reloc_type r_type, + struct elf_link_hash_entry *h ATTRIBUTE_UNUSED) +{ + enum elf_nds32_tls_type tls_type; + switch (r_type) + { + case R_NDS32_TLS_LE_HI20: + case R_NDS32_TLS_LE_LO12: + tls_type = GOT_TLS_LE; + break; + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12S2: + case R_NDS32_TLS_IE_LO12: + tls_type = GOT_TLS_IE; + break; + case R_NDS32_TLS_IEGP_HI20: + case R_NDS32_TLS_IEGP_LO12: + case R_NDS32_TLS_IEGP_LO12S2: + tls_type = GOT_TLS_IEGP; + break; + case R_NDS32_TLS_DESC_HI20: + case R_NDS32_TLS_DESC_LO12: + case R_NDS32_TLS_DESC_ADD: + case R_NDS32_TLS_DESC_FUNC: + case R_NDS32_TLS_DESC_CALL: + tls_type = GOT_TLS_DESC; + break; + default: + tls_type = GOT_NORMAL; + break; + } + return tls_type; +} + +/* Ensure that we have allocated bookkeeping structures for ABFD's local + symbols. */ + +static bfd_boolean +elf32_nds32_allocate_local_sym_info (bfd *abfd) +{ + if (elf_local_got_refcounts (abfd) == NULL) + { + bfd_size_type num_syms; + bfd_size_type size; + char *data; + + num_syms = elf_tdata (abfd)->symtab_hdr.sh_info; + /* This space is for got_refcounts, got_tls_type, tlsdesc_gotent, and + gp_offset. The details can refer to struct elf_nds32_obj_tdata. */ + size = num_syms * (sizeof (bfd_signed_vma) + sizeof (char) + + sizeof (bfd_vma) + sizeof (int) + + sizeof (bfd_boolean) + sizeof (bfd_vma)); + data = bfd_zalloc (abfd, size); + if (data == NULL) + return FALSE; + + elf_local_got_refcounts (abfd) = (bfd_signed_vma *) data; + data += num_syms * sizeof (bfd_signed_vma); + + elf32_nds32_local_got_tls_type (abfd) = (char *) data; + data += num_syms * sizeof (char); + + elf32_nds32_local_tlsdesc_gotent (abfd) = (bfd_vma *) data; + data += num_syms * sizeof (bfd_vma); + + elf32_nds32_local_gp_offset (abfd) = (int *) data; + data += num_syms * sizeof (int); + } + + return TRUE; +} + +/* Look through the relocs for a section during the first phase. + Since we don't do .gots or .plts, we just need to consider the + virtual table relocs for gc. */ + +static bfd_boolean +nds32_elf_check_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, **sym_hashes_end; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; + struct elf_link_hash_table *ehtab; + struct elf_nds32_link_hash_table *htab; + bfd *dynobj; + asection *sreloc = NULL; + + /* No need for relocation if relocatable already. */ + if (info->relocatable) + { + elf32_nds32_check_relax_group (abfd, sec); + return TRUE; + } + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = + sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym); + if (!elf_bad_symtab (abfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + ehtab = elf_hash_table (info); + htab = nds32_elf_hash_table (info); + dynobj = htab->root.dynobj; + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) + { + enum elf_nds32_reloc_type r_type; + struct elf_link_hash_entry *h; + unsigned long r_symndx; + enum elf_nds32_tls_type tls_type, old_tls_type; + struct elf_nds32_ict_hash_entry *entry; + + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + 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; + } + + /* create .got section if necessary + Some relocs require a global offset table. We create + got section here, since these relocation need a got section + and if it is not created yet. */ + if (ehtab->sgot == NULL) + { + switch (r_type) + { + case R_NDS32_GOT_HI20: + case R_NDS32_GOT_LO12: + case R_NDS32_GOT_LO15: + case R_NDS32_GOT_LO19: + case R_NDS32_GOT17S2_RELA: + case R_NDS32_GOT15S2_RELA: + case R_NDS32_GOTOFF: + case R_NDS32_GOTOFF_HI20: + case R_NDS32_GOTOFF_LO12: + case R_NDS32_GOTOFF_LO15: + case R_NDS32_GOTOFF_LO19: + case R_NDS32_GOTPC20: + case R_NDS32_GOTPC_HI20: + case R_NDS32_GOTPC_LO12: + case R_NDS32_GOT20: + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12: + case R_NDS32_TLS_IE_LO12S2: + case R_NDS32_TLS_IEGP_HI20: + case R_NDS32_TLS_IEGP_LO12: + case R_NDS32_TLS_IEGP_LO12S2: + case R_NDS32_TLS_DESC_HI20: + case R_NDS32_TLS_DESC_LO12: + if (dynobj == NULL) + htab->root.dynobj = dynobj = abfd; + if (!create_got_section (dynobj, info)) + return FALSE; + break; + + default: + break; + } + } + + /* Check relocation type. */ + switch ((int) r_type) + { + case R_NDS32_TLS_LE_HI20: + case R_NDS32_TLS_LE_LO12: + case R_NDS32_GOT_HI20: + case R_NDS32_GOT_LO12: + case R_NDS32_GOT_LO15: + case R_NDS32_GOT_LO19: + case R_NDS32_GOT20: + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12: + case R_NDS32_TLS_IE_LO12S2: + case R_NDS32_TLS_IEGP_HI20: + case R_NDS32_TLS_IEGP_LO12: + case R_NDS32_TLS_IEGP_LO12S2: + case R_NDS32_TLS_DESC_HI20: + case R_NDS32_TLS_DESC_LO12: + tls_type = get_tls_type (r_type, h); + if (h) + { + if (tls_type != GOT_TLS_LE) + h->got.refcount += 1; + old_tls_type = elf32_nds32_hash_entry (h)->tls_type; + } + else + { + /* This is a global offset table entry for a local symbol. */ + if (!elf32_nds32_allocate_local_sym_info (abfd)) + return FALSE; + + BFD_ASSERT (r_symndx < symtab_hdr->sh_info); + if (tls_type != GOT_TLS_LE) + elf_local_got_refcounts (abfd)[r_symndx] += 1; + old_tls_type = elf32_nds32_local_got_tls_type (abfd)[r_symndx]; + } + + /* We would already issued an error message if there + is a TLS/non-TLS mismatch, based on the symbol + type. So just combine any TLS types needed. */ + if (old_tls_type != GOT_UNKNOWN && old_tls_type != GOT_NORMAL + && tls_type != GOT_NORMAL) + tls_type |= old_tls_type; + + /* DESC to IE/IEGP if link to executable */ + if ((tls_type & GOT_TLS_DESC) && (info->executable)) + tls_type |= (info->pie ? GOT_TLS_IEGP : GOT_TLS_IE); + + if (old_tls_type != tls_type) + { + if (h != NULL) + elf32_nds32_hash_entry (h)->tls_type = tls_type; + else + elf32_nds32_local_got_tls_type (abfd)[r_symndx] = tls_type; + } + break; + + case R_NDS32_9_PLTREL: + case R_NDS32_25_PLTREL: + case R_NDS32_PLTREL_HI20: + case R_NDS32_PLTREL_LO12: + case R_NDS32_PLT_GOTREL_HI20: + case R_NDS32_PLT_GOTREL_LO12: + case R_NDS32_PLT_GOTREL_LO15: + case R_NDS32_PLT_GOTREL_LO19: + case R_NDS32_PLT_GOTREL_LO20: + /* This symbol requires a procedure linkage table entry. + We actually build the entry in adjust_dynamic_symbol, + because this might be a case of linking PIC code without + linking in any dynamic objects, in which case we don't + need to generate a procedure linkage table after all. */ + + /* If this is a local symbol, we resolve it directly without + creating a procedure linkage table entry. */ + /* explain: continue v.s. break here following: */ + if (h == NULL) + continue; + + if (h->forced_local + || (info->pie && h->def_regular)) + break; + + elf32_nds32_hash_entry (h)->tls_type = GOT_NORMAL; + h->needs_plt = 1; + h->plt.refcount += 1; + break; + + case R_NDS32_16_RELA: + case R_NDS32_20_RELA: + case R_NDS32_5_RELA: + case R_NDS32_32_RELA: + case R_NDS32_HI20_RELA: + case R_NDS32_LO12S3_RELA: + case R_NDS32_LO12S2_RELA: + case R_NDS32_LO12S2_DP_RELA: + case R_NDS32_LO12S2_SP_RELA: + case R_NDS32_LO12S1_RELA: + case R_NDS32_LO12S0_RELA: + case R_NDS32_LO12S0_ORI_RELA: + case R_NDS32_SDA16S3_RELA: + case R_NDS32_SDA17S2_RELA: + case R_NDS32_SDA18S1_RELA: + case R_NDS32_SDA19S0_RELA: + case R_NDS32_SDA15S3_RELA: + case R_NDS32_SDA15S2_RELA: + case R_NDS32_SDA12S2_DP_RELA: + case R_NDS32_SDA12S2_SP_RELA: + case R_NDS32_SDA15S1_RELA: + case R_NDS32_SDA15S0_RELA: + case R_NDS32_SDA_FP7U2_RELA: + case R_NDS32_15_PCREL_RELA: + case R_NDS32_17_PCREL_RELA: + case R_NDS32_25_PCREL_RELA: + + if (h != NULL && !info->shared) + { + h->non_got_ref = 1; + 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). We account for that possibility below by + storing information in the dyn_relocs 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 + && ((r_type != R_NDS32_25_PCREL_RELA + && r_type != R_NDS32_15_PCREL_RELA + && r_type != R_NDS32_17_PCREL_RELA + && !(r_type == R_NDS32_32_RELA + && strcmp (sec->name, ".eh_frame") == 0)) + || (h != NULL + && (!info->symbolic + || h->root.type == bfd_link_hash_defweak + || !h->def_regular)))) + || (!info->shared + && (sec->flags & SEC_ALLOC) != 0 + && h != NULL + && (h->root.type == bfd_link_hash_defweak + || !h->def_regular))) + { + struct elf_nds32_dyn_relocs *p; + struct elf_nds32_dyn_relocs **head; + + if (dynobj == NULL) + htab->root.dynobj = dynobj = abfd; + + /* When creating a shared object, we must copy these + relocs into the output file. We create a reloc + section in dynobj and make room for the reloc. */ + if (sreloc == NULL) + { + const char *name; + + name = bfd_elf_string_from_elf_section + (abfd, elf_elfheader (abfd)->e_shstrndx, + elf_section_data (sec)->rela.hdr->sh_name); + if (name == NULL) + return FALSE; + + BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + name + 5) == 0); + + sreloc = bfd_get_section_by_name (dynobj, name); + if (sreloc == NULL) + { + flagword flags; + + sreloc = bfd_make_section (dynobj, name); + flags = (SEC_HAS_CONTENTS | SEC_READONLY + | SEC_IN_MEMORY | SEC_LINKER_CREATED); + if ((sec->flags & SEC_ALLOC) != 0) + flags |= SEC_ALLOC | SEC_LOAD; + if (sreloc == NULL + || !bfd_set_section_flags (dynobj, sreloc, flags) + || !bfd_set_section_alignment (dynobj, sreloc, 2)) + return FALSE; + + elf_section_type (sreloc) = SHT_RELA; + } + 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_nds32_link_hash_entry *) h)->dyn_relocs; + else + { + asection *s; + + Elf_Internal_Sym *isym; + isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); + if (isym == NULL) + return FALSE; + + /* Track dynamic relocs needed for local syms too. */ + s = bfd_section_from_elf_index (abfd, isym->st_shndx); + if (s == NULL) + return FALSE; + + head = ((struct elf_nds32_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_nds32_dyn_relocs *) bfd_alloc (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_NDS32_25_PCREL_RELA + || ELF32_R_TYPE (rel->r_info) == R_NDS32_15_PCREL_RELA + || ELF32_R_TYPE (rel->r_info) == R_NDS32_17_PCREL_RELA) + p->pc_count += 1; + } + break; + + /* Merge jump-patch table symbol here. */ + case R_NDS32_ICT_HI20: + case R_NDS32_ICT_LO12: + case R_NDS32_ICT_25PC: + if (rel->r_addend != 0) + { + (*_bfd_error_handler) + (_("%B %s: Error: Rom-patch relocation offset: 0x%lx " + "with addend 0x%lx\n"), + abfd, sec->name, rel->r_offset, rel->r_addend); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + if (h) + { + elf32_nds32_hash_entry (h)->indirect_call = TRUE; + entry = (struct elf_nds32_ict_hash_entry *) + bfd_hash_lookup (&indirect_call_table, h->root.root.string, + TRUE, TRUE); + entry->h = h; + if (entry == NULL) + { + (*_bfd_error_handler) + (_("%B: failed creating indirect call %s hash table\n"), + abfd, h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + } + else + { + /* Rom-patch functions cannot be local. */ + (*_bfd_error_handler) + (_("%B: indirect call relocation with local symbol.\n"), abfd); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + break; + + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_NDS32_RELA_GNU_VTINHERIT: + case R_NDS32_GNU_VTINHERIT: + if (!bfd_elf_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_NDS32_GNU_VTENTRY: + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset)) + return FALSE; + break; + case R_NDS32_RELA_GNU_VTENTRY: + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return FALSE; + break; + } + } + + return TRUE; +} + +/* Write VAL in uleb128 format to P, returning a pointer to the + following byte. + This code is copied from elf-attr.c. */ + +static bfd_byte * +write_uleb128 (bfd_byte *p, unsigned int val) +{ + bfd_byte c; + do + { + c = val & 0x7f; + val >>= 7; + if (val) + c |= 0x80; + *(p++) = c; + } + while (val); + return p; +} + +static bfd_signed_vma +calculate_offset (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr) +{ + bfd_signed_vma foff; + bfd_vma symval, addend; + asection *sym_sec; + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + Elf_Internal_Sym *isym; + + /* A local symbol. */ + isym = isymbuf + ELF32_R_SYM (irel->r_info); + + if (isym->st_shndx == SHN_UNDEF) + sym_sec = bfd_und_section_ptr; + else if (isym->st_shndx == SHN_ABS) + sym_sec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + sym_sec = bfd_com_section_ptr; + else + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + symval = isym->st_value + sym_sec->output_section->vma + + sym_sec->output_offset; + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + + /* An external symbol. */ + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + /* This appears to be a reference to an undefined + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ + return 0; + + if (h->root.u.def.section->flags & SEC_MERGE) + { + sym_sec = h->root.u.def.section; + symval = _bfd_merged_section_offset (abfd, &sym_sec, + elf_section_data (sym_sec)->sec_info, + h->root.u.def.value); + symval = symval + sym_sec->output_section->vma + + sym_sec->output_offset; + } + else + symval = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } + + addend = irel->r_addend; + + foff = (symval + addend + - (irel->r_offset + sec->output_section->vma + sec->output_offset)); + return foff; +} + +static bfd_vma +calculate_plt_memory_address (bfd *abfd, struct bfd_link_info *link_info, + Elf_Internal_Sym *isymbuf, + Elf_Internal_Rela *irel, + Elf_Internal_Shdr *symtab_hdr) +{ + bfd_vma symval; + + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + Elf_Internal_Sym *isym; + asection *sym_sec; + /* A local symbol. */ + isym = isymbuf + ELF32_R_SYM (irel->r_info); + + if (isym->st_shndx == SHN_UNDEF) + sym_sec = bfd_und_section_ptr; + else if (isym->st_shndx == SHN_ABS) + sym_sec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + sym_sec = bfd_com_section_ptr; + else + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + symval = isym->st_value + sym_sec->output_section->vma + + sym_sec->output_offset; + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + struct elf_link_hash_table *ehtab; + asection *splt; + + /* An external symbol. */ + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + ehtab = elf_hash_table (link_info); + splt = ehtab->splt; + + 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->plt.offset == (bfd_vma) - 1) + { + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + /* This appears to be a reference to an undefined + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ + return 0; + symval = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } + else + symval = splt->output_section->vma + h->plt.offset; + } + + return symval; +} + +static bfd_signed_vma +calculate_plt_offset (bfd *abfd, asection *sec, struct bfd_link_info *link_info, + Elf_Internal_Sym *isymbuf, Elf_Internal_Rela *irel, + Elf_Internal_Shdr *symtab_hdr) +{ + bfd_vma foff; + if ((foff = calculate_plt_memory_address (abfd, link_info, isymbuf, irel, + symtab_hdr)) == 0) + return 0; + else + return foff - (irel->r_offset + + sec->output_section->vma + sec->output_offset); +} + +/* Convert a 32-bit instruction to 16-bit one. + INSN is the input 32-bit instruction, INSN16 is the output 16-bit + instruction. If INSN_TYPE is not NULL, it the CGEN instruction + type of INSN16. Return 1 if successful. */ + +static int +nds32_convert_32_to_16_alu1 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, + int *pinsn_type) +{ + uint16_t insn16 = 0; + int insn_type; + unsigned long mach = bfd_get_mach (abfd); + + if (N32_SH5 (insn) != 0) + return 0; + + switch (N32_SUB5 (insn)) + { + case N32_ALU1_ADD_SLLI: + case N32_ALU1_ADD_SRLI: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) && N32_IS_RB3 (insn)) + { + insn16 = N16_TYPE333 (ADD333, N32_RT5 (insn), N32_RA5 (insn), + N32_RB5 (insn)); + insn_type = NDS32_INSN_ADD333; + } + else if (N32_IS_RT4 (insn)) + { + if (N32_RT5 (insn) == N32_RA5 (insn)) + insn16 = N16_TYPE45 (ADD45, N32_RT54 (insn), N32_RB5 (insn)); + else if (N32_RT5 (insn) == N32_RB5 (insn)) + insn16 = N16_TYPE45 (ADD45, N32_RT54 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_ADD45; + } + break; + + case N32_ALU1_SUB_SLLI: + case N32_ALU1_SUB_SRLI: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) && N32_IS_RB3 (insn)) + { + insn16 = N16_TYPE333 (SUB333, N32_RT5 (insn), N32_RA5 (insn), + N32_RB5 (insn)); + insn_type = NDS32_INSN_SUB333; + } + else if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn)) + { + insn16 = N16_TYPE45 (SUB45, N32_RT54 (insn), N32_RB5 (insn)); + insn_type = NDS32_INSN_SUB45; + } + break; + + case N32_ALU1_AND_SLLI: + case N32_ALU1_AND_SRLI: + /* and $rt, $rt, $rb -> and33 for v3, v3m. */ + if (mach >= MACH_V3 && N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && N32_IS_RB3 (insn)) + { + if (N32_RT5 (insn) == N32_RA5 (insn)) + insn16 = N16_MISC33 (AND33, N32_RT5 (insn), N32_RB5 (insn)); + else if (N32_RT5 (insn) == N32_RB5 (insn)) + insn16 = N16_MISC33 (AND33, N32_RT5 (insn), N32_RA5 (insn)); + if (insn16) + insn_type = NDS32_INSN_AND33; + } + break; + + case N32_ALU1_XOR_SLLI: + case N32_ALU1_XOR_SRLI: + /* xor $rt, $rt, $rb -> xor33 for v3, v3m. */ + if (mach >= MACH_V3 && N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && N32_IS_RB3 (insn)) + { + if (N32_RT5 (insn) == N32_RA5 (insn)) + insn16 = N16_MISC33 (XOR33, N32_RT5 (insn), N32_RB5 (insn)); + else if (N32_RT5 (insn) == N32_RB5 (insn)) + insn16 = N16_MISC33 (XOR33, N32_RT5 (insn), N32_RA5 (insn)); + if (insn16) + insn_type = NDS32_INSN_XOR33; + } + break; + + case N32_ALU1_OR_SLLI: + case N32_ALU1_OR_SRLI: + /* or $rt, $rt, $rb -> or33 for v3, v3m. */ + if (mach >= MACH_V3 && N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && N32_IS_RB3 (insn)) + { + if (N32_RT5 (insn) == N32_RA5 (insn)) + insn16 = N16_MISC33 (OR33, N32_RT5 (insn), N32_RB5 (insn)); + else if (N32_RT5 (insn) == N32_RB5 (insn)) + insn16 = N16_MISC33 (OR33, N32_RT5 (insn), N32_RA5 (insn)); + if (insn16) + insn_type = NDS32_INSN_OR33; + } + break; + case N32_ALU1_NOR: + /* nor $rt, $ra, $ra -> not33 for v3, v3m. */ + if (mach >= MACH_V3 && N32_IS_RT3 (insn) && N32_IS_RB3 (insn) + && N32_RA5 (insn) == N32_RB5 (insn)) + { + insn16 = N16_MISC33 (NOT33, N32_RT5 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_NOT33; + } + break; + case N32_ALU1_SRAI: + if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn)) + { + insn16 = N16_TYPE45 (SRAI45, N32_RT54 (insn), N32_UB5 (insn)); + insn_type = NDS32_INSN_SRAI45; + } + break; + + case N32_ALU1_SRLI: + if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn)) + { + insn16 = N16_TYPE45 (SRLI45, N32_RT54 (insn), N32_UB5 (insn)); + insn_type = NDS32_INSN_SRLI45; + } + break; + + case N32_ALU1_SLLI: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) && N32_UB5 (insn) < 8) + { + insn16 = N16_TYPE333 (SLLI333, N32_RT5 (insn), N32_RA5 (insn), + N32_UB5 (insn)); + insn_type = NDS32_INSN_SLLI333; + } + break; + + case N32_ALU1_ZEH: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)) + { + insn16 = N16_BFMI333 (ZEH33, N32_RT5 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_ZEH33; + } + break; + + case N32_ALU1_SEB: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)) + { + insn16 = N16_BFMI333 (SEB33, N32_RT5 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_SEB33; + } + break; + + case N32_ALU1_SEH: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)) + { + insn16 = N16_BFMI333 (SEH33, N32_RT5 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_SEH33; + } + break; + + case N32_ALU1_SLT: + if (N32_RT5 (insn) == REG_R15 && N32_IS_RA4 (insn)) + { + /* Implicit r15. */ + insn16 = N16_TYPE45 (SLT45, N32_RA54 (insn), N32_RB5 (insn)); + insn_type = NDS32_INSN_SLT45; + } + break; + + case N32_ALU1_SLTS: + if (N32_RT5 (insn) == REG_R15 && N32_IS_RA4 (insn)) + { + /* Implicit r15. */ + insn16 = N16_TYPE45 (SLTS45, N32_RA54 (insn), N32_RB5 (insn)); + insn_type = NDS32_INSN_SLTS45; + } + break; + } + + if ((insn16 & 0x8000) == 0) + return 0; + + if (pinsn16) + *pinsn16 = insn16; + if (pinsn_type) + *pinsn_type = insn_type; + return 1; +} + +static int +nds32_convert_32_to_16_alu2 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, + int *pinsn_type) +{ + uint16_t insn16 = 0; + int insn_type; + unsigned long mach = bfd_get_mach (abfd); + + /* TODO: bset, bclr, btgl, btst. */ + if (__GF (insn, 6, 4) != 0) + return 0; + + switch (N32_IMMU (insn, 6)) + { + case N32_ALU2_MUL: + if (mach >= MACH_V3 && N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && N32_IS_RB3 (insn)) + { + if (N32_RT5 (insn) == N32_RA5 (insn)) + insn16 = N16_MISC33 (MUL33, N32_RT5 (insn), N32_RB5 (insn)); + else if (N32_RT5 (insn) == N32_RB5 (insn)) + insn16 = N16_MISC33 (MUL33, N32_RT5 (insn), N32_RA5 (insn)); + if (insn16) + insn_type = NDS32_INSN_MUL33; + } + } + + if ((insn16 & 0x8000) == 0) + return 0; + + if (pinsn16) + *pinsn16 = insn16; + if (pinsn_type) + *pinsn_type = insn_type; + return 1; +} + +int +nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, + int *pinsn_type) +{ + int op6; + uint16_t insn16 = 0; + int insn_type; + unsigned long mach = bfd_get_mach (abfd); + + /* Decode 32-bit instruction. */ + if (insn & 0x80000000) + { + /* Not 32-bit insn. */ + return 0; + } + + op6 = N32_OP6 (insn); + + /* Convert it to 16-bit instruction. */ + switch (op6) + { + case N32_OP6_MOVI: + if (IS_WITHIN_S (N32_IMM20S (insn), 5)) + { + insn16 = N16_TYPE55 (MOVI55, N32_RT5 (insn), N32_IMM20S (insn)); + insn_type = NDS32_INSN_MOVI55; + } + else if (mach >= MACH_V3 && N32_IMM20S (insn) >= 16 + && N32_IMM20S (insn) < 48 && N32_IS_RT4 (insn)) + { + insn16 = N16_TYPE45 (MOVPI45, N32_RT54 (insn), + N32_IMM20S (insn) - 16); + insn_type = NDS32_INSN_MOVPI45; + } + break; + + case N32_OP6_ADDI: + if (N32_IMM15S (insn) == 0) + { + /* Do not convert `addi $sp, $sp, 0' to `mov55 $sp, $sp', + because `mov55 $sp, $sp' is ifret16 in V3 ISA. */ + if (mach <= MACH_V2 + || N32_RT5 (insn) != REG_SP || N32_RA5 (insn) != REG_SP) + { + insn16 = N16_TYPE55 (MOV55, N32_RT5 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_MOV55; + } + } + else if (N32_IMM15S (insn) > 0) + { + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) && N32_IMM15S (insn) < 8) + { + insn16 = N16_TYPE333 (ADDI333, N32_RT5 (insn), N32_RA5 (insn), + N32_IMM15S (insn)); + insn_type = NDS32_INSN_ADDI333; + } + else if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn) + && N32_IMM15S (insn) < 32) + { + insn16 = N16_TYPE45 (ADDI45, N32_RT54 (insn), N32_IMM15S (insn)); + insn_type = NDS32_INSN_ADDI45; + } + else if (mach >= MACH_V2 && N32_RT5 (insn) == REG_SP + && N32_RT5 (insn) == N32_RA5 (insn) + && N32_IMM15S (insn) < 512) + { + insn16 = N16_TYPE10 (ADDI10S, N32_IMM15S (insn)); + insn_type = NDS32_INSN_ADDI10_SP; + } + else if (mach >= MACH_V3 && N32_IS_RT3 (insn) + && N32_RA5 (insn) == REG_SP && N32_IMM15S (insn) < 256 + && (N32_IMM15S (insn) % 4 == 0)) + { + insn16 = N16_TYPE36 (ADDRI36_SP, N32_RT5 (insn), + N32_IMM15S (insn) >> 2); + insn_type = NDS32_INSN_ADDRI36_SP; + } + } + else + { + /* Less than 0. */ + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) && N32_IMM15S (insn) > -8) + { + insn16 = N16_TYPE333 (SUBI333, N32_RT5 (insn), N32_RA5 (insn), + 0 - N32_IMM15S (insn)); + insn_type = NDS32_INSN_SUBI333; + } + else if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn) + && N32_IMM15S (insn) > -32) + { + insn16 = N16_TYPE45 (SUBI45, N32_RT54 (insn), 0 - N32_IMM15S (insn)); + insn_type = NDS32_INSN_SUBI45; + } + else if (mach >= MACH_V2 && N32_RT5 (insn) == REG_SP + && N32_RT5 (insn) == N32_RA5 (insn) + && N32_IMM15S (insn) >= -512) + { + insn16 = N16_TYPE10 (ADDI10S, N32_IMM15S (insn)); + insn_type = NDS32_INSN_ADDI10_SP; + } + } + break; + + case N32_OP6_ORI: + if (N32_IMM15S (insn) == 0) + { + /* Do not convert `ori $sp, $sp, 0' to `mov55 $sp, $sp', + because `mov55 $sp, $sp' is ifret16 in V3 ISA. */ + if (mach <= MACH_V2 + || N32_RT5 (insn) != REG_SP || N32_RA5 (insn) != REG_SP) + { + insn16 = N16_TYPE55 (MOV55, N32_RT5 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_MOV55; + } + } + break; + + case N32_OP6_SUBRI: + if (mach >= MACH_V3 && N32_IS_RT3 (insn) + && N32_IS_RA3 (insn) && N32_IMM15S (insn) == 0) + { + insn16 = N16_MISC33 (NEG33, N32_RT5 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_NEG33; + } + break; + + case N32_OP6_ANDI: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)) + { + if (N32_IMM15U (insn) == 1) + { + insn16 = N16_BFMI333 (XLSB33, N32_RT5 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_XLSB33; + } + else if (N32_IMM15U (insn) == 0x7ff) + { + insn16 = N16_BFMI333 (X11B33, N32_RT5 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_X11B33; + } + else if (N32_IMM15U (insn) == 0xff) + { + insn16 = N16_BFMI333 (ZEB33, N32_RT5 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_ZEB33; + } + else if (mach >= MACH_V3 && N32_RT5 (insn) == N32_RA5 (insn) + && N32_IMM15U (insn) < 256) + { + int imm15u = N32_IMM15U (insn); + + if (__builtin_popcount (imm15u) == 1) + { + /* BMSKI33 */ + int imm3u = __builtin_ctz (imm15u); + + insn16 = N16_BFMI333 (BMSKI33, N32_RT5 (insn), imm3u); + insn_type = NDS32_INSN_BMSKI33; + } + else if (imm15u != 0 && __builtin_popcount (imm15u + 1) == 1) + { + /* FEXTI33 */ + int imm3u = __builtin_ctz (imm15u + 1) - 1; + + insn16 = N16_BFMI333 (FEXTI33, N32_RT5 (insn), imm3u); + insn_type = NDS32_INSN_FEXTI33; + } + } + } + break; + + case N32_OP6_SLTI: + if (N32_RT5 (insn) == REG_R15 && N32_IS_RA4 (insn) + && IS_WITHIN_U (N32_IMM15S (insn), 5)) + { + insn16 = N16_TYPE45 (SLTI45, N32_RA54 (insn), N32_IMM15S (insn)); + insn_type = NDS32_INSN_SLTI45; + } + break; + + case N32_OP6_SLTSI: + if (N32_RT5 (insn) == REG_R15 && N32_IS_RA4 (insn) + && IS_WITHIN_U (N32_IMM15S (insn), 5)) + { + insn16 = N16_TYPE45 (SLTSI45, N32_RA54 (insn), N32_IMM15S (insn)); + insn_type = NDS32_INSN_SLTSI45; + } + break; + + case N32_OP6_LWI: + if (N32_IS_RT4 (insn) && N32_IMM15S (insn) == 0) + { + insn16 = N16_TYPE45 (LWI450, N32_RT54 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_LWI450; + } + else if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && IS_WITHIN_U (N32_IMM15S (insn), 3)) + { + insn16 = N16_TYPE333 (LWI333, N32_RT5 (insn), N32_RA5 (insn), + N32_IMM15S (insn)); + insn_type = NDS32_INSN_LWI333; + } + else if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_FP + && IS_WITHIN_U (N32_IMM15S (insn), 7)) + { + insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 0, N32_IMM15S (insn)); + insn_type = NDS32_INSN_LWI37; + } + else if (mach >= MACH_V2 && N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_SP + && IS_WITHIN_U (N32_IMM15S (insn), 7)) + { + insn16 = N16_TYPE37 (XWI37SP, N32_RT5 (insn), 0, N32_IMM15S (insn)); + insn_type = NDS32_INSN_LWI37_SP; + } + else if (mach >= MACH_V2 && N32_IS_RT4 (insn) && N32_RA5 (insn) == REG_R8 + && -32 <= N32_IMM15S (insn) && N32_IMM15S (insn) < 0) + { + insn16 = N16_TYPE45 (LWI45_FE, N32_RT54 (insn), + N32_IMM15S (insn) + 32); + insn_type = NDS32_INSN_LWI45_FE; + } + break; + + case N32_OP6_SWI: + if (N32_IS_RT4 (insn) && N32_IMM15S (insn) == 0) + { + insn16 = N16_TYPE45 (SWI450, N32_RT54 (insn), N32_RA5 (insn)); + insn_type = NDS32_INSN_SWI450; + } + else if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && IS_WITHIN_U (N32_IMM15S (insn), 3)) + { + insn16 = N16_TYPE333 (SWI333, N32_RT5 (insn), N32_RA5 (insn), + N32_IMM15S (insn)); + insn_type = NDS32_INSN_SWI333; + } + else if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_FP + && IS_WITHIN_U (N32_IMM15S (insn), 7)) + { + insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 1, N32_IMM15S (insn)); + insn_type = NDS32_INSN_SWI37; + } + else if (mach >= MACH_V2 && N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_SP + && IS_WITHIN_U (N32_IMM15S (insn), 7)) + { + insn16 = N16_TYPE37 (XWI37SP, N32_RT5 (insn), 1, N32_IMM15S (insn)); + insn_type = NDS32_INSN_SWI37_SP; + } + break; + + case N32_OP6_LWI_BI: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && IS_WITHIN_U (N32_IMM15S (insn), 3)) + { + insn16 = N16_TYPE333 (LWI333_BI, N32_RT5 (insn), N32_RA5 (insn), + N32_IMM15S (insn)); + insn_type = NDS32_INSN_LWI333_BI; + } + break; + + case N32_OP6_SWI_BI: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && IS_WITHIN_U (N32_IMM15S (insn), 3)) + { + insn16 = N16_TYPE333 (SWI333_BI, N32_RT5 (insn), N32_RA5 (insn), + N32_IMM15S (insn)); + insn_type = NDS32_INSN_SWI333_BI; + } + break; + + case N32_OP6_LHI: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && IS_WITHIN_U (N32_IMM15S (insn), 3)) + { + insn16 = N16_TYPE333 (LHI333, N32_RT5 (insn), N32_RA5 (insn), + N32_IMM15S (insn)); + insn_type = NDS32_INSN_LHI333; + } + break; + + case N32_OP6_SHI: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && IS_WITHIN_U (N32_IMM15S (insn), 3)) + { + insn16 = N16_TYPE333 (SHI333, N32_RT5 (insn), N32_RA5 (insn), + N32_IMM15S (insn)); + insn_type = NDS32_INSN_SHI333; + } + break; + + case N32_OP6_LBI: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && IS_WITHIN_U (N32_IMM15S (insn), 3)) + { + insn16 = N16_TYPE333 (LBI333, N32_RT5 (insn), N32_RA5 (insn), + N32_IMM15S (insn)); + insn_type = NDS32_INSN_LBI333; + } + break; + + case N32_OP6_SBI: + if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) + && IS_WITHIN_U (N32_IMM15S (insn), 3)) + { + insn16 = N16_TYPE333 (SBI333, N32_RT5 (insn), N32_RA5 (insn), + N32_IMM15S (insn)); + insn_type = NDS32_INSN_SBI333; + } + break; + + case N32_OP6_ALU1: + return nds32_convert_32_to_16_alu1 (abfd, insn, pinsn16, pinsn_type); + + case N32_OP6_ALU2: + return nds32_convert_32_to_16_alu2 (abfd, insn, pinsn16, pinsn_type); + + case N32_OP6_BR1: + if (!IS_WITHIN_S (N32_IMM14S (insn), 8)) + goto done; + + if ((insn & __BIT (14)) == 0) + { + /* N32_BR1_BEQ */ + if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5 + && N32_RT5 (insn) != REG_R5) + insn16 = N16_TYPE38 (BEQS38, N32_RT5 (insn), N32_IMM14S (insn)); + else if (N32_IS_RA3 (insn) && N32_RT5 (insn) == REG_R5 + && N32_RA5 (insn) != REG_R5) + insn16 = N16_TYPE38 (BEQS38, N32_RA5 (insn), N32_IMM14S (insn)); + insn_type = NDS32_INSN_BEQS38; + break; + } + else + { + /* N32_BR1_BNE */ + if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5 + && N32_RT5 (insn) != REG_R5) + insn16 = N16_TYPE38 (BNES38, N32_RT5 (insn), N32_IMM14S (insn)); + else if (N32_IS_RA3 (insn) && N32_RT5 (insn) == REG_R5 + && N32_RA5 (insn) != REG_R5) + insn16 = N16_TYPE38 (BNES38, N32_RA5 (insn), N32_IMM14S (insn)); + insn_type = NDS32_INSN_BNES38; + break; + } + break; + + case N32_OP6_BR2: + switch (N32_BR2_SUB (insn)) + { + case N32_BR2_BEQZ: + if (N32_IS_RT3 (insn) && IS_WITHIN_S (N32_IMM16S (insn), 8)) + { + insn16 = N16_TYPE38 (BEQZ38, N32_RT5 (insn), N32_IMM16S (insn)); + insn_type = NDS32_INSN_BEQZ38; + } + else if (N32_RT5 (insn) == REG_R15 && IS_WITHIN_S (N32_IMM16S (insn), 8)) + { + insn16 = N16_TYPE8 (BEQZS8, N32_IMM16S (insn)); + insn_type = NDS32_INSN_BEQZS8; + } + break; + + case N32_BR2_BNEZ: + if (N32_IS_RT3 (insn) && IS_WITHIN_S (N32_IMM16S (insn), 8)) + { + insn16 = N16_TYPE38 (BNEZ38, N32_RT5 (insn), N32_IMM16S (insn)); + insn_type = NDS32_INSN_BNEZ38; + } + else if (N32_RT5 (insn) == REG_R15 && IS_WITHIN_S (N32_IMM16S (insn), 8)) + { + insn16 = N16_TYPE8 (BNEZS8, N32_IMM16S (insn)); + insn_type = NDS32_INSN_BNEZS8; + } + break; + + case N32_BR2_SOP0: + if (__GF (insn, 20, 5) == 0 && IS_WITHIN_U (N32_IMM16S (insn), 9)) + { + insn16 = N16_TYPE9 (IFCALL9, N32_IMM16S (insn)); + insn_type = NDS32_INSN_IFCALL9; + } + break; + } + break; + + case N32_OP6_JI: + if ((insn & __BIT (24)) == 0) + { + /* N32_JI_J */ + if (IS_WITHIN_S (N32_IMM24S (insn), 8)) + { + insn16 = N16_TYPE8 (J8, N32_IMM24S (insn)); + insn_type = NDS32_INSN_J8; + } + } + break; + + case N32_OP6_JREG: + if (__GF (insn, 8, 2) != 0) + goto done; + + switch (N32_IMMU (insn, 5)) + { + case N32_JREG_JR: + if (N32_JREG_HINT (insn) == 0) + { + /* jr */ + insn16 = N16_TYPE5 (JR5, N32_RB5 (insn)); + insn_type = NDS32_INSN_JR5; + } + else if (N32_JREG_HINT (insn) == 1) + { + /* ret */ + insn16 = N16_TYPE5 (RET5, N32_RB5 (insn)); + insn_type = NDS32_INSN_RET5; + } + else if (N32_JREG_HINT (insn) == 3) + { + /* ifret = mov55 $sp, $sp */ + insn16 = N16_TYPE55 (MOV55, REG_SP, REG_SP); + insn_type = NDS32_INSN_IFRET; + } + break; + + case N32_JREG_JRAL: + /* It's convertible when return rt5 is $lp and address + translation is kept. */ + if (N32_RT5 (insn) == REG_LP && N32_JREG_HINT (insn) == 0) + { + insn16 = N16_TYPE5 (JRAL5, N32_RB5 (insn)); + insn_type = NDS32_INSN_JRAL5; + } + break; + } + break; + + case N32_OP6_MISC: + if (N32_SUB5 (insn) == N32_MISC_BREAK && N32_SWID (insn) < 32) + { + /* For v3, swid above 31 are used for ex9.it. */ + insn16 = N16_TYPE5 (BREAK16, N32_SWID (insn)); + insn_type = NDS32_INSN_BREAK16; + } + break; + + default: + /* This instruction has no 16-bit variant. */ + goto done; + } + +done: + /* Bit-15 of insn16 should be set for a valid instruction. */ + if ((insn16 & 0x8000) == 0) + return 0; + + if (pinsn16) + *pinsn16 = insn16; + if (pinsn_type) + *pinsn_type = insn_type; + return 1; +} + +static int +special_convert_32_to_16 (unsigned long insn, uint16_t *pinsn16, + Elf_Internal_Rela *reloc) +{ + uint16_t insn16 = 0; + + if ((reloc->r_addend & R_NDS32_INSN16_FP7U2_FLAG) == 0 + || (ELF32_R_TYPE (reloc->r_info) != R_NDS32_INSN16)) + return 0; + + if (!N32_IS_RT3 (insn)) + return 0; + + switch (N32_OP6 (insn)) + { + case N32_OP6_LWI: + if (N32_RA5 (insn) == REG_GP && IS_WITHIN_U (N32_IMM15S (insn), 7)) + insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 0, N32_IMM15S (insn)); + break; + case N32_OP6_SWI: + if (N32_RA5 (insn) == REG_GP && IS_WITHIN_U (N32_IMM15S (insn), 7)) + insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 1, N32_IMM15S (insn)); + break; + case N32_OP6_HWGP: + if (!IS_WITHIN_U (N32_IMM17S (insn), 7)) + break; + + if (__GF (insn, 17, 3) == 6) + insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 0, N32_IMM17S (insn)); + else if (__GF (insn, 17, 3) == 7) + insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 1, N32_IMM17S (insn)); + break; + } + + if ((insn16 & 0x8000) == 0) + return 0; + + *pinsn16 = insn16; + return 1; +} + +/* Convert a 16-bit instruction to 32-bit one. + INSN16 it the input and PINSN it the point to output. + Return non-zero on successful. Otherwise 0 is returned. */ + +int +nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn) +{ + uint32_t insn = 0xffffffff; + unsigned long mach = bfd_get_mach (abfd); + + /* NOTE: push25, pop25 and movd44 do not have 32-bit variants. */ + + switch (__GF (insn16, 9, 6)) + { + case 0x4: /* add45 */ + insn = N32_ALU1 (ADD, N16_RT4 (insn16), N16_RT4 (insn16), N16_RA5 (insn16)); + goto done; + case 0x5: /* sub45 */ + insn = N32_ALU1 (SUB, N16_RT4 (insn16), N16_RT4 (insn16), N16_RA5 (insn16)); + goto done; + case 0x6: /* addi45 */ + insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16), N16_IMM5U (insn16)); + goto done; + case 0x7: /* subi45 */ + insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16), -N16_IMM5U (insn16)); + goto done; + case 0x8: /* srai45 */ + insn = N32_ALU1 (SRAI, N16_RT4 (insn16), N16_RT4 (insn16), N16_IMM5U (insn16)); + goto done; + case 0x9: /* srli45 */ + insn = N32_ALU1 (SRLI, N16_RT4 (insn16), N16_RT4 (insn16), N16_IMM5U (insn16)); + goto done; + + case 0xa: /* slli333 */ + insn = N32_ALU1 (SLLI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + goto done; + case 0xc: /* add333 */ + insn = N32_ALU1 (ADD, N16_RT3 (insn16), N16_RA3 (insn16), N16_RB3 (insn16)); + goto done; + case 0xd: /* sub333 */ + insn = N32_ALU1 (SUB, N16_RT3 (insn16), N16_RA3 (insn16), N16_RB3 (insn16)); + goto done; + case 0xe: /* addi333 */ + insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + goto done; + case 0xf: /* subi333 */ + insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16), -N16_IMM3U (insn16)); + goto done; + + case 0x10: /* lwi333 */ + insn = N32_TYPE2 (LWI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + goto done; + case 0x12: /* lhi333 */ + insn = N32_TYPE2 (LHI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + goto done; + case 0x13: /* lbi333 */ + insn = N32_TYPE2 (LBI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + goto done; + case 0x11: /* lwi333.bi */ + insn = N32_TYPE2 (LWI_BI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + goto done; + case 0x14: /* swi333 */ + insn = N32_TYPE2 (SWI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + goto done; + case 0x16: /* shi333 */ + insn = N32_TYPE2 (SHI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + goto done; + case 0x17: /* sbi333 */ + insn = N32_TYPE2 (SBI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + goto done; + case 0x15: /* swi333.bi */ + insn = N32_TYPE2 (SWI_BI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + goto done; + + case 0x18: /* addri36.sp */ + insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), REG_SP, N16_IMM6U (insn16) << 2); + goto done; + + case 0x19: /* lwi45.fe */ + insn = N32_TYPE2 (LWI, N16_RT4 (insn16), REG_R8, (N16_IMM5U (insn16) - 32)); + goto done; + case 0x1a: /* lwi450 */ + insn = N32_TYPE2 (LWI, N16_RT4 (insn16), N16_RA5 (insn16), 0); + goto done; + case 0x1b: /* swi450 */ + insn = N32_TYPE2 (SWI, N16_RT4 (insn16), N16_RA5 (insn16), 0); + goto done; + + /* These are r15 implied instructions. */ + case 0x30: /* slts45 */ + insn = N32_ALU1 (SLTS, REG_TA, N16_RT4 (insn16), N16_RA5 (insn16)); + goto done; + case 0x31: /* slt45 */ + insn = N32_ALU1 (SLT, REG_TA, N16_RT4 (insn16), N16_RA5 (insn16)); + goto done; + case 0x32: /* sltsi45 */ + insn = N32_TYPE2 (SLTSI, REG_TA, N16_RT4 (insn16), N16_IMM5U (insn16)); + goto done; + case 0x33: /* slti45 */ + insn = N32_TYPE2 (SLTI, REG_TA, N16_RT4 (insn16), N16_IMM5U (insn16)); + goto done; + case 0x34: /* beqzs8, bnezs8 */ + if (insn16 & __BIT (8)) + insn = N32_BR2 (BNEZ, REG_TA, N16_IMM8S (insn16)); + else + insn = N32_BR2 (BEQZ, REG_TA, N16_IMM8S (insn16)); + goto done; + + case 0x35: /* break16, ex9.it */ + /* Only consider range of v3 break16. */ + insn = N32_TYPE0 (MISC, (N16_IMM5U (insn16) << 5) | N32_MISC_BREAK); + goto done; + + case 0x3c: /* ifcall9 */ + insn = N32_BR2 (SOP0, 0, N16_IMM9U (insn16)); + goto done; + case 0x3d: /* movpi45 */ + insn = N32_TYPE1 (MOVI, N16_RT4 (insn16), N16_IMM5U (insn16) + 16); + goto done; + + case 0x3f: /* MISC33 */ + switch (insn16 & 0x7) + { + case 2: /* neg33 */ + insn = N32_TYPE2 (SUBRI, N16_RT3 (insn16), N16_RA3 (insn16), 0); + break; + case 3: /* not33 */ + insn = N32_ALU1 (NOR, N16_RT3 (insn16), N16_RA3 (insn16), N16_RA3 (insn16)); + break; + case 4: /* mul33 */ + insn = N32_ALU2 (MUL, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); + break; + case 5: /* xor33 */ + insn = N32_ALU1 (XOR, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); + break; + case 6: /* and33 */ + insn = N32_ALU1 (AND, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); + break; + case 7: /* or33 */ + insn = N32_ALU1 (OR, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); + break; + } + goto done; + + case 0xb: /* ... */ + switch (insn16 & 0x7) + { + case 0: /* zeb33 */ + insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RA3 (insn16), 0xff); + break; + case 1: /* zeh33 */ + insn = N32_ALU1 (ZEH, N16_RT3 (insn16), N16_RA3 (insn16), 0); + break; + case 2: /* seb33 */ + insn = N32_ALU1 (SEB, N16_RT3 (insn16), N16_RA3 (insn16), 0); + break; + case 3: /* seh33 */ + insn = N32_ALU1 (SEH, N16_RT3 (insn16), N16_RA3 (insn16), 0); + break; + case 4: /* xlsb33 */ + insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RA3 (insn16), 1); + break; + case 5: /* x11b33 */ + insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RA3 (insn16), 0x7ff); + break; + case 6: /* bmski33 */ + insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RT3 (insn16), + 1 << __GF (insn16, 3, 3)); + break; + case 7: /* fexti33 */ + insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RT3 (insn16), + (1 << (__GF (insn16, 3, 3) + 1)) - 1); + break; + } + goto done; + } + + switch (__GF (insn16, 10, 5)) + { + case 0x0: /* mov55 or ifret16 */ + if (mach >= MACH_V3 && N16_RT5 (insn16) == REG_SP + && N16_RT5 (insn16) == N16_RA5 (insn16)) + insn = N32_JREG (JR, 0, 0, 0, 3); + else + insn = N32_TYPE2 (ADDI, N16_RT5 (insn16), N16_RA5 (insn16), 0); + goto done; + case 0x1: /* movi55 */ + insn = N32_TYPE1 (MOVI, N16_RT5 (insn16), N16_IMM5S (insn16)); + goto done; + case 0x1b: /* addi10s (V2) */ + insn = N32_TYPE2 (ADDI, REG_SP, REG_SP, N16_IMM10S (insn16)); + goto done; + } + + switch (__GF (insn16, 11, 4)) + { + case 0x7: /* lwi37.fp/swi37.fp */ + if (insn16 & __BIT (7)) /* swi37.fp */ + insn = N32_TYPE2 (SWI, N16_RT38 (insn16), REG_FP, N16_IMM7U (insn16)); + else /* lwi37.fp */ + insn = N32_TYPE2 (LWI, N16_RT38 (insn16), REG_FP, N16_IMM7U (insn16)); + goto done; + case 0x8: /* beqz38 */ + insn = N32_BR2 (BEQZ, N16_RT38 (insn16), N16_IMM8S (insn16)); + goto done; + case 0x9: /* bnez38 */ + insn = N32_BR2 (BNEZ, N16_RT38 (insn16), N16_IMM8S (insn16)); + goto done; + case 0xa: /* beqs38/j8, implied r5 */ + if (N16_RT38 (insn16) == 5) + insn = N32_JI (J, N16_IMM8S (insn16)); + else + insn = N32_BR1 (BEQ, N16_RT38 (insn16), REG_R5, N16_IMM8S (insn16)); + goto done; + case 0xb: /* bnes38 and others */ + if (N16_RT38 (insn16) == 5) + { + switch (__GF (insn16, 5, 3)) + { + case 0: /* jr5 */ + insn = N32_JREG (JR, 0, N16_RA5 (insn16), 0, 0); + break; + case 4: /* ret5 */ + insn = N32_JREG (JR, 0, N16_RA5 (insn16), 0, 1); + break; + case 1: /* jral5 */ + insn = N32_JREG (JRAL, REG_LP, N16_RA5 (insn16), 0, 0); + break; + case 2: /* ex9.it imm5 */ + /* ex9.it had no 32-bit variantl. */ + break; + case 5: /* add5.pc */ + /* add5.pc had no 32-bit variantl. */ + break; + } + } + else /* bnes38 */ + insn = N32_BR1 (BNE, N16_RT38 (insn16), REG_R5, N16_IMM8S (insn16)); + goto done; + case 0xe: /* lwi37/swi37 */ + if (insn16 & (1 << 7)) /* swi37.sp */ + insn = N32_TYPE2 (SWI, N16_RT38 (insn16), REG_SP, N16_IMM7U (insn16)); + else /* lwi37.sp */ + insn = N32_TYPE2 (LWI, N16_RT38 (insn16), REG_SP, N16_IMM7U (insn16)); + goto done; + } + +done: + if (insn & 0x80000000) + return 0; + + if (pinsn) + *pinsn = insn; + return 1; +} + +static bfd_boolean +is_sda_access_insn (unsigned long insn) +{ + switch (N32_OP6 (insn)) + { + case N32_OP6_LWI: + case N32_OP6_LHI: + case N32_OP6_LHSI: + case N32_OP6_LBI: + case N32_OP6_LBSI: + case N32_OP6_SWI: + case N32_OP6_SHI: + case N32_OP6_SBI: + case N32_OP6_LWC: + case N32_OP6_LDC: + case N32_OP6_SWC: + case N32_OP6_SDC: + return TRUE; + default: + ; + } + return FALSE; +} + +static unsigned long +turn_insn_to_sda_access (uint32_t insn, bfd_signed_vma type, uint32_t *pinsn) +{ + uint32_t oinsn = 0; + + switch (type) + { + case R_NDS32_GOT_LO12: + case R_NDS32_GOTOFF_LO12: + case R_NDS32_PLTREL_LO12: + case R_NDS32_PLT_GOTREL_LO12: + case R_NDS32_LO12S0_RELA: + switch (N32_OP6 (insn)) + { + case N32_OP6_LBI: + /* lbi.gp */ + oinsn = N32_TYPE1 (LBGP, N32_RT5 (insn), 0); + break; + case N32_OP6_LBSI: + /* lbsi.gp */ + oinsn = N32_TYPE1 (LBGP, N32_RT5 (insn), __BIT (19)); + break; + case N32_OP6_SBI: + /* sbi.gp */ + oinsn = N32_TYPE1 (SBGP, N32_RT5 (insn), 0); + break; + case N32_OP6_ORI: + /* addi.gp */ + oinsn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19)); + break; + } + break; + + case R_NDS32_LO12S1_RELA: + switch (N32_OP6 (insn)) + { + case N32_OP6_LHI: + /* lhi.gp */ + oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), 0); + break; + case N32_OP6_LHSI: + /* lhsi.gp */ + oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (18)); + break; + case N32_OP6_SHI: + /* shi.gp */ + oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (19)); + break; + } + break; + + case R_NDS32_LO12S2_RELA: + switch (N32_OP6 (insn)) + { + case N32_OP6_LWI: + /* lwi.gp */ + oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (6, 17, 3)); + break; + case N32_OP6_SWI: + /* swi.gp */ + oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (7, 17, 3)); + break; + } + break; + + case R_NDS32_LO12S2_DP_RELA: + case R_NDS32_LO12S2_SP_RELA: + oinsn = (insn & 0x7ff07000) | (REG_GP << 15); + break; + } + + if (oinsn) + *pinsn = oinsn; + + return oinsn != 0; +} + +/* Linker hasn't found the correct merge section for non-section symbol + in relax time, this work is left to the function elf_link_input_bfd(). + So for non-section symbol, _bfd_merged_section_offset is also needed + to find the correct symbol address. */ + +static bfd_vma +nds32_elf_rela_local_sym (bfd *abfd, Elf_Internal_Sym *sym, + asection **psec, Elf_Internal_Rela *rel) +{ + asection *sec = *psec; + bfd_vma relocation; + + relocation = (sec->output_section->vma + + sec->output_offset + sym->st_value); + if ((sec->flags & SEC_MERGE) && sec->sec_info_type == SEC_INFO_TYPE_MERGE) + { + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend = + _bfd_merged_section_offset (abfd, psec, + elf_section_data (sec)->sec_info, + sym->st_value + rel->r_addend); + else + rel->r_addend = + _bfd_merged_section_offset (abfd, psec, + elf_section_data (sec)->sec_info, + sym->st_value) + rel->r_addend; + + if (sec != *psec) + { + /* If we have changed the section, and our original section is + marked with SEC_EXCLUDE, it means that the original + SEC_MERGE section has been completely subsumed in some + other SEC_MERGE section. In this case, we need to leave + some info around for --emit-relocs. */ + if ((sec->flags & SEC_EXCLUDE) != 0) + sec->kept_section = *psec; + sec = *psec; + } + rel->r_addend -= relocation; + rel->r_addend += sec->output_section->vma + sec->output_offset; + } + return relocation; +} + +static bfd_vma +calculate_memory_address (bfd *abfd, Elf_Internal_Rela *irel, + Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + bfd_signed_vma foff; + bfd_vma symval, addend; + Elf_Internal_Rela irel_fn; + Elf_Internal_Sym *isym; + asection *sym_sec; + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + /* A local symbol. */ + isym = isymbuf + ELF32_R_SYM (irel->r_info); + + if (isym->st_shndx == SHN_UNDEF) + sym_sec = bfd_und_section_ptr; + else if (isym->st_shndx == SHN_ABS) + sym_sec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + sym_sec = bfd_com_section_ptr; + else + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + memcpy (&irel_fn, irel, sizeof (Elf_Internal_Rela)); + symval = nds32_elf_rela_local_sym (abfd, isym, &sym_sec, &irel_fn); + addend = irel_fn.r_addend; + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + + /* An external symbol. */ + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + 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) + /* This appears to be a reference to an undefined + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ + return 0; + + if (h->root.u.def.section->flags & SEC_MERGE) + { + sym_sec = h->root.u.def.section; + symval = _bfd_merged_section_offset (abfd, &sym_sec, elf_section_data + (sym_sec)->sec_info, h->root.u.def.value); + symval = symval + sym_sec->output_section->vma + + sym_sec->output_offset; + } + else + symval = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + addend = irel->r_addend; + } + + foff = symval + addend; + + return foff; +} + +static bfd_vma +calculate_got_memory_address (bfd *abfd, struct bfd_link_info *link_info, + Elf_Internal_Rela *irel, + Elf_Internal_Shdr *symtab_hdr) +{ + int symndx; + bfd_vma *local_got_offsets; + /* Get the value of the symbol referred to by the reloc. */ + struct elf_link_hash_entry *h; + struct elf_link_hash_table *ehtab = elf_hash_table (link_info); + + /* An external symbol. */ + symndx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[symndx]; + 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 (symndx >= 0) + { + BFD_ASSERT (h != NULL); + return ehtab->sgot->output_section->vma + ehtab->sgot->output_offset + + h->got.offset; + } + local_got_offsets = elf_local_got_offsets (abfd); + BFD_ASSERT (local_got_offsets != NULL); + return ehtab->sgot->output_section->vma + ehtab->sgot->output_offset + + local_got_offsets[ELF32_R_SYM (irel->r_info)]; + + /* The _GLOBAL_OFFSET_TABLE_ may be undefweak(or should be?). */ + /* The check of h->root.type is passed. */ +} + +static int +is_16bit_NOP (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec, Elf_Internal_Rela *rel) +{ + bfd_byte *contents; + unsigned short insn16; + + if (!(rel->r_addend & R_NDS32_INSN16_CONVERT_FLAG)) + return FALSE; + contents = elf_section_data (sec)->this_hdr.contents; + insn16 = bfd_getb16 (contents + rel->r_offset); + if (insn16 == NDS32_NOP16) + return TRUE; + return FALSE; +} + +/* It checks whether the instruction could be converted to + 16-bit form and returns the converted one. + + `internal_relocs' is supposed to be sorted. */ + +static int +is_convert_32_to_16 (bfd *abfd, asection *sec, + Elf_Internal_Rela *reloc, + Elf_Internal_Rela *internal_relocs, + Elf_Internal_Rela *irelend, + uint16_t *insn16) +{ +#define NORMAL_32_TO_16 (1 << 0) +#define SPECIAL_32_TO_16 (1 << 1) + bfd_byte *contents = NULL; + bfd_signed_vma off; + bfd_vma mem_addr; + uint32_t insn = 0; + Elf_Internal_Rela *pc_rel; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Sym *isymbuf = NULL; + int convert_type; + bfd_vma offset; + + if (reloc->r_offset + 4 > sec->size) + return FALSE; + + offset = reloc->r_offset; + + if (!nds32_get_section_contents (abfd, sec, &contents, TRUE)) + return FALSE; + insn = bfd_getb32 (contents + offset); + + if (nds32_convert_32_to_16 (abfd, insn, insn16, NULL)) + convert_type = NORMAL_32_TO_16; + else if (special_convert_32_to_16 (insn, insn16, reloc)) + convert_type = SPECIAL_32_TO_16; + else + return FALSE; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + if (!nds32_get_local_syms (abfd, sec, &isymbuf)) + return FALSE; + + /* Find the first relocation of the same relocation-type, + so we iteratie them forward. */ + pc_rel = reloc; + while ((pc_rel - 1) >= internal_relocs && pc_rel[-1].r_offset == offset) + pc_rel--; + + for (; pc_rel < irelend && pc_rel->r_offset == offset; pc_rel++) + { + if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_15_PCREL_RELA + || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_17_PCREL_RELA + || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_25_PCREL_RELA + || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_25_PLTREL) + { + off = calculate_offset (abfd, sec, pc_rel, isymbuf, symtab_hdr); + if (off >= ACCURATE_8BIT_S1 || off < -ACCURATE_8BIT_S1 + || off == 0) + return FALSE; + break; + } + else if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_20_RELA) + { + /* movi => movi55 */ + mem_addr = calculate_memory_address (abfd, pc_rel, isymbuf, symtab_hdr); + /* mem_addr is unsigned, but the value should be between [-16, 15]. */ + if ((mem_addr + 0x10) >> 5) + return FALSE; + break; + } + else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_TLS_LE_20) + || (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_TLS_LE_LO12)) + { + /* It never happen movi to movi55 for R_NDS32_TLS_LE_20, + because it can be relaxed to addi for TLS_LE_ADD. */ + return FALSE; + } + else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_SDA15S2_RELA + || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_SDA17S2_RELA) + && (reloc->r_addend & R_NDS32_INSN16_FP7U2_FLAG) + && convert_type == SPECIAL_32_TO_16) + { + /* fp-as-gp + We've selected a best fp-base for this access, so we can + always resolve it anyway. Do nothing. */ + break; + } + else if ((ELF32_R_TYPE (pc_rel->r_info) > R_NDS32_NONE + && (ELF32_R_TYPE (pc_rel->r_info) < R_NDS32_RELA_GNU_VTINHERIT)) + || ((ELF32_R_TYPE (pc_rel->r_info) > R_NDS32_RELA_GNU_VTENTRY) + && (ELF32_R_TYPE (pc_rel->r_info) < R_NDS32_INSN16)) + || ((ELF32_R_TYPE (pc_rel->r_info) > R_NDS32_LOADSTORE) + && (ELF32_R_TYPE (pc_rel->r_info) < R_NDS32_DWARF2_OP1_RELA))) + { + /* Prevent unresolved addi instruction translate to addi45 or addi333. */ + return FALSE; + } + else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_17IFC_PCREL_RELA)) + { + off = calculate_offset (abfd, sec, pc_rel, isymbuf, symtab_hdr); + if (off >= ACCURATE_U9BIT_S1 || off <= 0) + return FALSE; + break; + } + } + + return TRUE; +} + +static void +nds32_elf_write_16 (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *contents, + Elf_Internal_Rela *reloc, + Elf_Internal_Rela *internal_relocs, + Elf_Internal_Rela *irelend, + unsigned short insn16) +{ + Elf_Internal_Rela *pc_rel; + bfd_vma offset; + + offset = reloc->r_offset; + bfd_putb16 (insn16, contents + offset); + /* Find the first relocation of the same relocation-type, + so we iteratie them forward. */ + pc_rel = reloc; + while ((pc_rel - 1) > internal_relocs && pc_rel[-1].r_offset == offset) + pc_rel--; + + for (; pc_rel < irelend && pc_rel->r_offset == offset; pc_rel++) + { + if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_15_PCREL_RELA + || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_17_PCREL_RELA + || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_25_PCREL_RELA) + { + pc_rel->r_info = + ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_9_PCREL_RELA); + } + else if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_25_PLTREL) + pc_rel->r_info = + ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_9_PLTREL); + else if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_20_RELA) + pc_rel->r_info = + ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_5_RELA); + else if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_SDA15S2_RELA + || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_SDA17S2_RELA) + pc_rel->r_info = + ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_SDA_FP7U2_RELA); + else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_17IFC_PCREL_RELA)) + pc_rel->r_info = + ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_10IFCU_PCREL_RELA); + } +} + +/* Find a relocation of type specified by `reloc_type' + of the same r_offset with reloc. + If not found, return irelend. + + Assuming relocations are sorted by r_offset, + we find the relocation from `reloc' backward untill relocs, + or find it from `reloc' forward untill irelend. */ + +static Elf_Internal_Rela * +find_relocs_at_address (Elf_Internal_Rela *reloc, + Elf_Internal_Rela *relocs, + Elf_Internal_Rela *irelend, + enum elf_nds32_reloc_type reloc_type) +{ + Elf_Internal_Rela *rel_t; + + /* Find backward. */ + for (rel_t = reloc; + rel_t >= relocs && rel_t->r_offset == reloc->r_offset; + rel_t--) + if (ELF32_R_TYPE (rel_t->r_info) == reloc_type) + return rel_t; + + /* We didn't find it backward. Try find it forward. */ + for (rel_t = reloc; + rel_t < irelend && rel_t->r_offset == reloc->r_offset; + rel_t++) + if (ELF32_R_TYPE (rel_t->r_info) == reloc_type) + return rel_t; + + return irelend; +} + +/* Find a relocation of specified type and offset. + `reloc' is just a refence point to find a relocation at specified offset. + If not found, return irelend. + + Assuming relocations are sorted by r_offset, + we find the relocation from `reloc' backward untill relocs, + or find it from `reloc' forward untill irelend. */ + +static Elf_Internal_Rela * +find_relocs_at_address_addr (Elf_Internal_Rela *reloc, + Elf_Internal_Rela *relocs, + Elf_Internal_Rela *irelend, + unsigned char reloc_type, + bfd_vma offset_p) +{ + Elf_Internal_Rela *rel_t = NULL; + + /* First, we try to find a relocation of offset `offset_p', + and then we use find_relocs_at_address to find specific type. */ + + if (reloc->r_offset > offset_p) + { + /* Find backward. */ + for (rel_t = reloc; + rel_t >= relocs && rel_t->r_offset > offset_p; rel_t--) + /* Do nothing. */; + } + else if (reloc->r_offset < offset_p) + { + /* Find forward. */ + for (rel_t = reloc; + rel_t < irelend && rel_t->r_offset < offset_p; rel_t++) + /* Do nothing. */; + } + else + rel_t = reloc; + + /* Not found? */ + if (rel_t < relocs || rel_t == irelend || rel_t->r_offset != offset_p) + return irelend; + + return find_relocs_at_address (rel_t, relocs, irelend, reloc_type); +} + +static bfd_boolean +nds32_elf_check_dup_relocs (Elf_Internal_Rela *reloc, + Elf_Internal_Rela *internal_relocs, + Elf_Internal_Rela *irelend, + unsigned char reloc_type) +{ + Elf_Internal_Rela *rel_t; + + for (rel_t = reloc; + rel_t >= internal_relocs && rel_t->r_offset == reloc->r_offset; + rel_t--) + if (ELF32_R_TYPE (rel_t->r_info) == reloc_type) + { + if (ELF32_R_SYM (rel_t->r_info) == ELF32_R_SYM (reloc->r_info) + && rel_t->r_addend == reloc->r_addend) + continue; + return TRUE; + } + + for (rel_t = reloc; rel_t < irelend && rel_t->r_offset == reloc->r_offset; + rel_t++) + if (ELF32_R_TYPE (rel_t->r_info) == reloc_type) + { + if (ELF32_R_SYM (rel_t->r_info) == ELF32_R_SYM (reloc->r_info) + && rel_t->r_addend == reloc->r_addend) + continue; + return TRUE; + } + + return FALSE; +} + +typedef struct nds32_elf_blank nds32_elf_blank_t; +struct nds32_elf_blank +{ + /* Where the blank begins. */ + bfd_vma offset; + /* The size of the blank. */ + bfd_vma size; + /* The accumulative size before this blank. */ + bfd_vma total_size; + nds32_elf_blank_t *next; + nds32_elf_blank_t *prev; +}; + +static nds32_elf_blank_t *blank_free_list = NULL; + +static nds32_elf_blank_t * +create_nds32_elf_blank (bfd_vma offset_p, bfd_vma size_p) +{ + nds32_elf_blank_t *blank_t; + + if (blank_free_list) + { + blank_t = blank_free_list; + blank_free_list = blank_free_list->next; + } + else + blank_t = bfd_malloc (sizeof (nds32_elf_blank_t)); + + if (blank_t == NULL) + return NULL; + + blank_t->offset = offset_p; + blank_t->size = size_p; + blank_t->total_size = 0; + blank_t->next = NULL; + blank_t->prev = NULL; + + return blank_t; +} + +static void +remove_nds32_elf_blank (nds32_elf_blank_t *blank_p) +{ + if (blank_free_list) + { + blank_free_list->prev = blank_p; + blank_p->next = blank_free_list; + } + else + blank_p->next = NULL; + + blank_p->prev = NULL; + blank_free_list = blank_p; +} + +static void +clean_nds32_elf_blank (void) +{ + nds32_elf_blank_t *blank_t; + + while (blank_free_list) + { + blank_t = blank_free_list; + blank_free_list = blank_free_list->next; + free (blank_t); + } +} + +static nds32_elf_blank_t * +search_nds32_elf_blank (nds32_elf_blank_t *blank_p, bfd_vma addr) +{ + nds32_elf_blank_t *blank_t; + + if (!blank_p) + return NULL; + blank_t = blank_p; + + while (blank_t && addr < blank_t->offset) + blank_t = blank_t->prev; + while (blank_t && blank_t->next && addr >= blank_t->next->offset) + blank_t = blank_t->next; + + return blank_t; +} + +static bfd_vma +get_nds32_elf_blank_total (nds32_elf_blank_t **blank_p, bfd_vma addr, + int overwrite) +{ + nds32_elf_blank_t *blank_t; + + blank_t = search_nds32_elf_blank (*blank_p, addr); + if (!blank_t) + return 0; + + if (overwrite) + *blank_p = blank_t; + + if (addr < blank_t->offset + blank_t->size) + return blank_t->total_size + (addr - blank_t->offset); + else + return blank_t->total_size + blank_t->size; +} + +static bfd_boolean +insert_nds32_elf_blank (nds32_elf_blank_t **blank_p, bfd_vma addr, bfd_vma len) +{ + nds32_elf_blank_t *blank_t, *blank_t2; + + if (!*blank_p) + { + *blank_p = create_nds32_elf_blank (addr, len); + return *blank_p ? TRUE : FALSE; + } + + blank_t = search_nds32_elf_blank (*blank_p, addr); + + if (blank_t == NULL) + { + blank_t = create_nds32_elf_blank (addr, len); + if (!blank_t) + return FALSE; + while ((*blank_p)->prev != NULL) + *blank_p = (*blank_p)->prev; + blank_t->next = *blank_p; + (*blank_p)->prev = blank_t; + (*blank_p) = blank_t; + return TRUE; + } + + if (addr < blank_t->offset + blank_t->size + && ((addr + len) > (blank_t->offset + blank_t->size))) + blank_t->size = addr + len - blank_t->offset - blank_t->size; + else + { + blank_t2 = create_nds32_elf_blank (addr, len); + if (!blank_t2) + return FALSE; + if (blank_t->next) + { + blank_t->next->prev = blank_t2; + blank_t2->next = blank_t->next; + } + blank_t2->prev = blank_t; + blank_t->next = blank_t2; + *blank_p = blank_t2; + } + + return TRUE; +} + +static bfd_boolean +insert_nds32_elf_blank_recalc_total (nds32_elf_blank_t **blank_p, bfd_vma addr, + bfd_vma len) +{ + nds32_elf_blank_t *blank_t; + + if (!insert_nds32_elf_blank (blank_p, addr, len)) + return FALSE; + + blank_t = *blank_p; + + if (!blank_t->prev) + { + blank_t->total_size = 0; + blank_t = blank_t->next; + } + + while (blank_t) + { + blank_t->total_size = blank_t->prev->total_size + blank_t->prev->size; + blank_t = blank_t->next; + } + + return TRUE; +} + +static void +calc_nds32_blank_total (nds32_elf_blank_t *blank_p) +{ + nds32_elf_blank_t *blank_t; + bfd_vma total_size = 0; + + if (!blank_p) + return; + + blank_t = blank_p; + while (blank_t->prev) + blank_t = blank_t->prev; + while (blank_t) + { + blank_t->total_size = total_size; + total_size += blank_t->size; + blank_t = blank_t->next; + } +} + +static bfd_boolean +nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec, + nds32_elf_blank_t *blank_p) +{ + Elf_Internal_Shdr *symtab_hdr; /* Symbol table header of this bfd. */ + Elf_Internal_Sym *isym = NULL; /* Symbol table of this bfd. */ + Elf_Internal_Sym *isymend; /* Symbol entry iterator. */ + unsigned int sec_shndx; /* The section the be relaxed. */ + bfd_byte *contents; /* Contents data of iterating section. */ + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irel; + Elf_Internal_Rela *irelend; + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry **end_hashes; + unsigned int symcount; + asection *sect; + nds32_elf_blank_t *blank_t; + nds32_elf_blank_t *blank_t2; + nds32_elf_blank_t *blank_head; + + blank_head = blank_t = blank_p; + while (blank_head->prev != NULL) + blank_head = blank_head->prev; + while (blank_t->next != NULL) + blank_t = blank_t->next; + + if (blank_t->offset + blank_t->size <= sec->size) + { + blank_t->next = create_nds32_elf_blank (sec->size + 4, 0); + blank_t->next->prev = blank_t; + } + if (blank_head->offset > 0) + { + blank_head->prev = create_nds32_elf_blank (0, 0); + blank_head->prev->next = blank_head; + blank_head = blank_head->prev; + } + + sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); + + /* The deletion must stop at the next ALIGN reloc for an alignment + power larger than the number of bytes we are deleting. */ + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + if (!nds32_get_local_syms (abfd, sec, &isym)) + return FALSE; + + if (isym == NULL) + { + isym = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, NULL, NULL, NULL); + symtab_hdr->contents = (bfd_byte *) isym; + } + + if (isym == NULL || symtab_hdr->sh_info == 0) + return FALSE; + + blank_t = blank_head; + calc_nds32_blank_total (blank_head); + + for (sect = abfd->sections; sect != NULL; sect = sect->next) + { + /* Adjust all the relocs. */ + + /* Relocations MUST be kept in memory, because relaxation adjust them. */ + internal_relocs = _bfd_elf_link_read_relocs (abfd, sect, NULL, NULL, + TRUE /* keep_memory */); + irelend = internal_relocs + sect->reloc_count; + + blank_t = blank_head; + blank_t2 = blank_head; + + if (!(sect->flags & SEC_RELOC)) + continue; + + nds32_get_section_contents (abfd, sect, &contents, TRUE); + + for (irel = internal_relocs; irel < irelend; irel++) + { + bfd_vma raddr; + + if (ELF32_R_TYPE (irel->r_info) >= R_NDS32_DIFF8 + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_DIFF32 + && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx) + { + unsigned long val = 0; + unsigned long mask; + long before, between; + long offset; + + switch (ELF32_R_TYPE (irel->r_info)) + { + case R_NDS32_DIFF8: + offset = bfd_get_8 (abfd, contents + irel->r_offset); + break; + case R_NDS32_DIFF16: + offset = bfd_get_16 (abfd, contents + irel->r_offset); + break; + case R_NDS32_DIFF32: + val = bfd_get_32 (abfd, contents + irel->r_offset); + /* Get the signed bit and mask for the high part. The + gcc will alarm when right shift 32-bit since the + type size of long may be 32-bit. */ + mask = 0 - (val >> 31); + if (mask) + offset = (val | (mask - 0xffffffff)); + else + offset = val; + break; + default: + BFD_ASSERT (0); + } + + /* DIFF value + 0 |encoded in location| + |------------|-------------------|--------- + sym+off(addend) + -- before ---| ***************** + --------------------- between ---| + + We only care how much data are relax between DIFF, marked as ***. */ + + before = get_nds32_elf_blank_total (&blank_t, irel->r_addend, 0); + between = get_nds32_elf_blank_total (&blank_t, irel->r_addend + offset, 0); + if (between == before) + goto done_adjust_diff; + + switch (ELF32_R_TYPE (irel->r_info)) + { + case R_NDS32_DIFF8: + bfd_put_8 (abfd, offset - (between - before), contents + irel->r_offset); + break; + case R_NDS32_DIFF16: + bfd_put_16 (abfd, offset - (between - before), contents + irel->r_offset); + break; + case R_NDS32_DIFF32: + bfd_put_32 (abfd, offset - (between - before), contents + irel->r_offset); + break; + } + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_DIFF_ULEB128 + && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx) + { + bfd_vma val = 0; + unsigned int len = 0; + unsigned long before, between; + bfd_byte *endp, *p; + + val = read_unsigned_leb128 (abfd, contents + irel->r_offset, &len); + + before = get_nds32_elf_blank_total (&blank_t, irel->r_addend, 0); + between = get_nds32_elf_blank_total (&blank_t, irel->r_addend + val, 0); + if (between == before) + goto done_adjust_diff; + + p = contents + irel->r_offset; + endp = p + len -1; + memset (p, 0x80, len); + *(endp) = 0; + p = write_uleb128 (p, val - (between - before)) - 1; + if (p < endp) + *p |= 0x80; + } +done_adjust_diff: + + if (sec == sect) + { + raddr = irel->r_offset; + irel->r_offset -= get_nds32_elf_blank_total (&blank_t2, irel->r_offset, 1); + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE) + continue; + if (blank_t2 && blank_t2->next + && (blank_t2->offset > raddr || blank_t2->next->offset <= raddr)) + (*_bfd_error_handler) (_("%B: %s\n"), abfd, + "Error: search_nds32_elf_blank reports wrong node"); + + /* Mark reloc in deleted portion as NONE. + For some relocs like R_NDS32_LABEL that doesn't modify the + content in the section. R_NDS32_LABEL doesn't belong to the + instruction in the section, so we should preserve it. */ + if (raddr >= blank_t2->offset + && raddr < blank_t2->offset + blank_t2->size + && ELF32_R_TYPE (irel->r_info) != R_NDS32_LABEL + && ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_REGION_BEGIN + && ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_REGION_END + && ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY + && ELF32_R_TYPE (irel->r_info) != R_NDS32_SUBTRAHEND + && ELF32_R_TYPE (irel->r_info) != R_NDS32_MINUEND) + { + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_NDS32_NONE); + continue; + } + } + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL + || ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY) + continue; + + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info + && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx + && ELF_ST_TYPE (isym[ELF32_R_SYM (irel->r_info)].st_info) == STT_SECTION) + { + if (irel->r_addend <= sec->size) + irel->r_addend -= + get_nds32_elf_blank_total (&blank_t, irel->r_addend, 1); + } + } + } + + /* Adjust the local symbols defined in this section. */ + blank_t = blank_head; + for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++) + { + if (isym->st_shndx == sec_shndx) + { + if (isym->st_value <= sec->size) + { + bfd_vma ahead; + bfd_vma orig_addr = isym->st_value; + + ahead = get_nds32_elf_blank_total (&blank_t, isym->st_value, 1); + isym->st_value -= ahead; + + /* Adjust function size. */ + if (ELF32_ST_TYPE (isym->st_info) == STT_FUNC && isym->st_size > 0) + isym->st_size -= get_nds32_elf_blank_total + (&blank_t, orig_addr + isym->st_size, 0) - ahead; + } + } + } + + /* Now adjust the global symbols defined in this section. */ + symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) + - symtab_hdr->sh_info); + sym_hashes = elf_sym_hashes (abfd); + end_hashes = sym_hashes + symcount; + blank_t = blank_head; + for (; sym_hashes < end_hashes; sym_hashes++) + { + struct elf_link_hash_entry *sym_hash = *sym_hashes; + + if ((sym_hash->root.type == bfd_link_hash_defined + || sym_hash->root.type == bfd_link_hash_defweak) + && sym_hash->root.u.def.section == sec) + { + if (sym_hash->root.u.def.value <= sec->size) + { + bfd_vma ahead; + bfd_vma orig_addr = sym_hash->root.u.def.value; + + ahead = get_nds32_elf_blank_total (&blank_t, sym_hash->root.u.def.value, 1); + sym_hash->root.u.def.value -= ahead; + + /* Adjust function size. */ + if (sym_hash->type == STT_FUNC) + sym_hash->size -= get_nds32_elf_blank_total + (&blank_t, orig_addr + sym_hash->size, 0) - ahead; + + } + } + } + + contents = elf_section_data (sec)->this_hdr.contents; + blank_t = blank_head; + while (blank_t->next) + { + /* Actually delete the bytes. */ + + /* If current blank is the last blank overlap with current section, + go to finish process. */ + if (sec->size <= (blank_t->next->offset)) + break; + + memmove (contents + blank_t->offset - blank_t->total_size, + contents + blank_t->offset + blank_t->size, + blank_t->next->offset - (blank_t->offset + blank_t->size)); + + blank_t = blank_t->next; + } + + if (sec->size > (blank_t->offset + blank_t->size)) + { + /* There are remaining code between blank and section boundary. + Move the remaining code to appropriate location. */ + memmove (contents + blank_t->offset - blank_t->total_size, + contents + blank_t->offset + blank_t->size, + sec->size - (blank_t->offset + blank_t->size)); + sec->size -= blank_t->total_size + blank_t->size; + } + else + /* This blank is not entirely included in the section, + reduce the section size by only part of the blank size. */ + sec->size -= blank_t->total_size + (sec->size - blank_t->offset); + + while (blank_head) + { + blank_t = blank_head; + blank_head = blank_head->next; + remove_nds32_elf_blank (blank_t); + } + + return TRUE; +} + +/* Get the contents of a section. */ + +static int +nds32_get_section_contents (bfd *abfd, asection *sec, + bfd_byte **contents_p, bfd_boolean cache) +{ + /* Get the section contents. */ + if (elf_section_data (sec)->this_hdr.contents != NULL) + *contents_p = elf_section_data (sec)->this_hdr.contents; + else + { + if (!bfd_malloc_and_get_section (abfd, sec, contents_p)) + return FALSE; + if (cache) + elf_section_data (sec)->this_hdr.contents = *contents_p; + } + + return TRUE; +} + +/* Get the contents of the internal symbol of abfd. */ + +static int +nds32_get_local_syms (bfd *abfd, asection *sec ATTRIBUTE_UNUSED, + Elf_Internal_Sym **isymbuf_p) +{ + Elf_Internal_Shdr *symtab_hdr; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + /* Read this BFD's local symbols if we haven't done so already. */ + if (*isymbuf_p == NULL && symtab_hdr->sh_info != 0) + { + *isymbuf_p = (Elf_Internal_Sym *) symtab_hdr->contents; + if (*isymbuf_p == NULL) + { + *isymbuf_p = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (*isymbuf_p == NULL) + return FALSE; + } + } + symtab_hdr->contents = (bfd_byte *) (*isymbuf_p); + + return TRUE; +} + +/* Range of small data. */ +static bfd_vma sdata_range[2][2]; +static bfd_vma const sdata_init_range[2] = +{ ACCURATE_12BIT_S1, ACCURATE_19BIT }; + +static int +nds32_elf_insn_size (bfd *abfd ATTRIBUTE_UNUSED, + bfd_byte *contents, bfd_vma addr) +{ + unsigned long insn = bfd_getb32 (contents + addr); + + if (insn & 0x80000000) + return 2; + + return 4; +} + +/* Set the gp relax range. We have to measure the safe range + to do gp relaxation. */ + +static void +relax_range_measurement (bfd *abfd) +{ + asection *sec_f, *sec_b; + /* For upper bound. */ + bfd_vma maxpgsz = get_elf_backend_data (abfd)->maxpagesize; + bfd_vma align; + static int decide_relax_range = 0; + int i; + int range_number = ARRAY_SIZE (sdata_init_range); + + if (decide_relax_range) + return; + decide_relax_range = 1; + + if (sda_rela_sec == NULL) + { + /* Since there is no data sections, we assume the range is page size. */ + for (i = 0; i < range_number; i++) + { + sdata_range[i][0] = sdata_init_range[i] - 0x1000; + sdata_range[i][1] = sdata_init_range[i] - 0x1000; + } + return; + } + + /* Get the biggest alignment power after the gp located section. */ + sec_f = sda_rela_sec->output_section; + sec_b = sec_f->next; + align = 0; + while (sec_b != NULL) + { + if ((unsigned)(1 << sec_b->alignment_power) > align) + align = (1 << sec_b->alignment_power); + sec_b = sec_b->next; + } + + /* I guess we can not determine the section before + gp located section, so we assume the align is max page size. */ + for (i = 0; i < range_number; i++) + { + sdata_range[i][1] = sdata_init_range[i] - align; + BFD_ASSERT (sdata_range[i][1] <= sdata_init_range[i]); + sdata_range[i][0] = sdata_init_range[i] - maxpgsz; + BFD_ASSERT (sdata_range[i][0] <= sdata_init_range[i]); + } +} + +/* These are macros used to check flags encoded in r_addend. + They are only used by nds32_elf_relax_section (). */ +#define GET_SEQ_LEN(addend) ((addend) & 0x000000ff) +#define IS_1ST_CONVERT(addend) ((addend) & 0x80000000) +#define IS_OPTIMIZE(addend) ((addend) & 0x40000000) +#define IS_16BIT_ON(addend) ((addend) & 0x20000000) + +/* Relax LONGCALL1 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longcall1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 3 variations for LONGCALL1 + case 4-4-2; 16-bit on, optimize off or optimize for space + sethi ta, hi20(symbol) ; LONGCALL1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral5 ta ; + + case 4-4-4; 16-bit off, optimize don't care + sethi ta, hi20(symbol) ; LONGCALL1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral ta ; + + case 4-4-4; 16-bit on, optimize for speed + sethi ta, hi20(symbol) ; LONGCALL1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral ta ; + Check code for -mlong-calls output. */ + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ + uint32_t insn; + Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *irelend; + bfd_signed_vma foff; + uint16_t insn16; + + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; + + hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr); + lo_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LO12S0_ORI_RELA, + laddr + 4); + + if (hi_irelfn == irelend || lo_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL1 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr); + + /* This condition only happened when symbol is undefined. */ + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; + + /* Relax to: jal symbol; 25_PCREL */ + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + + /* Replace the long call with a jal. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + R_NDS32_25_PCREL_RELA); + irel->r_addend = hi_irelfn->r_addend; + + /* We don't resolve this here but resolve it in relocate_section. */ + insn = INSN_JAL; + bfd_putb32 (insn, contents + irel->r_offset); + + hi_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); + *insn_len = 4; + + if (seq_len & 0x2) + { + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + *insn_len); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_INSN16); + lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + *insn_len += 2; + } + return TRUE; +} + +#define CONVERT_CONDITION_CALL(insn) (((insn) & 0xffff0000) ^ 0x90000) +/* Relax LONGCALL2 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longcall2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* bltz rt, .L1 ; LONGCALL2 + jal symbol ; 25_PCREL + .L1: */ + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + bfd_vma laddr; + uint32_t insn; + Elf_Internal_Rela *i1_irelfn, *cond_irelfn, *irelend; + bfd_signed_vma foff; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + i1_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_25_PCREL_RELA, laddr + 4); + + if (i1_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL2 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + insn = bfd_getb32 (contents + laddr); + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, i1_irelfn, isymbuf, symtab_hdr); + + if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1 + || foff >= CONSERVATIVE_16BIT_S1) + return FALSE; + + /* Relax to bgezal rt, label ; 17_PCREL + or bltzal rt, label ; 17_PCREL */ + + /* Convert to complimentary conditional call. */ + insn = CONVERT_CONDITION_CALL (insn); + + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + + /* Clean unnessary relocations. */ + i1_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), R_NDS32_NONE); + cond_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_17_PCREL_RELA, laddr); + if (cond_irelfn != irelend) + cond_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irelfn->r_info), R_NDS32_NONE); + + /* Replace the long call with a bgezal. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), + R_NDS32_17_PCREL_RELA); + irel->r_addend = i1_irelfn->r_addend; + + bfd_putb32 (insn, contents + irel->r_offset); + + *insn_len = 4; + return TRUE; +} + +/* Relax LONGCALL3 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longcall3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 3 variations for LONGCALL3 + case 4-4-4-2; 16-bit on, optimize off or optimize for space + bltz rt, $1 ; LONGCALL3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral5 ta ; + $1 + + case 4-4-4-4; 16-bit off, optimize don't care + bltz rt, $1 ; LONGCALL3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral ta ; + $1 + + case 4-4-4-4; 16-bit on, optimize for speed + bltz rt, $1 ; LONGCALL3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral ta ; + $1 */ + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ + uint32_t insn; + Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *cond_irelfn, *irelend; + bfd_signed_vma foff; + uint16_t insn16; + + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; + + hi_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr + 4); + lo_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LO12S0_ORI_RELA, laddr + 8); + + if (hi_irelfn == irelend || lo_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL3 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr); + + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; + + insn = bfd_getb32 (contents + laddr); + if (foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) + { + /* Relax to bgezal rt, label ; 17_PCREL + or bltzal rt, label ; 17_PCREL */ + + /* Convert to complimentary conditional call. */ + insn = CONVERT_CONDITION_CALL (insn); + bfd_putb32 (insn, contents + irel->r_offset); + + *insn_len = 4; + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); + hi_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); + + cond_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_17_PCREL_RELA, laddr); + if (cond_irelfn != irelend) + { + cond_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + R_NDS32_17_PCREL_RELA); + cond_irelfn->r_addend = hi_irelfn->r_addend; + } + + if (seq_len & 0x2) + { + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + *insn_len); + hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + R_NDS32_INSN16); + hi_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + insn_len += 2; + } + } + else if (foff >= -CONSERVATIVE_24BIT_S1 && foff < CONSERVATIVE_24BIT_S1) + { + /* Relax to the following instruction sequence + bltz rt, $1 ; LONGCALL2 + jal symbol ; 25_PCREL + $1 */ + *insn_len = 8; + insn = INSN_JAL; + bfd_putb32 (insn, contents + hi_irelfn->r_offset); + + hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + R_NDS32_25_PCREL_RELA); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_LONGCALL2); + + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); + + if (seq_len & 0x2) + { + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + *insn_len); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_INSN16); + lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + insn_len += 2; + } + } + return TRUE; +} + +/* Relax LONGJUMP1 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longjump1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 3 variations for LONGJUMP1 + case 4-4-2; 16-bit bit on, optimize off or optimize for space + sethi ta, hi20(symbol) ; LONGJUMP1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr5 ta ; + + case 4-4-4; 16-bit off, optimize don't care + sethi ta, hi20(symbol) ; LONGJUMP1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr ta ; + + case 4-4-4; 16-bit on, optimize for speed + sethi ta, hi20(symbol) ; LONGJUMP1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr ta ; */ + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ + int insn16_on; /* 16-bit on/off. */ + uint32_t insn; + Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *irelend; + bfd_signed_vma foff; + uint16_t insn16; + unsigned long reloc; + + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; + insn16_on = IS_16BIT_ON (irel->r_addend); + + hi_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr); + lo_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LO12S0_ORI_RELA, laddr + 4); + if (hi_irelfn == irelend || lo_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP1 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr); + + if (foff == 0 || foff >= CONSERVATIVE_24BIT_S1 + || foff < -CONSERVATIVE_24BIT_S1) + return FALSE; + + if (insn16_on && foff >= -ACCURATE_8BIT_S1 + && foff < ACCURATE_8BIT_S1 && (seq_len & 0x2)) + { + /* j8 label */ + /* 16-bit on, but not optimized for speed. */ + reloc = R_NDS32_9_PCREL_RELA; + insn16 = INSN_J8; + bfd_putb16 (insn16, contents + irel->r_offset); + *insn_len = 2; + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + } + else + { + /* j label */ + reloc = R_NDS32_25_PCREL_RELA; + insn = INSN_J; + bfd_putb32 (insn, contents + irel->r_offset); + *insn_len = 4; + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_INSN16); + irel->r_addend = 0; + } + + hi_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), reloc); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); + + if ((seq_len & 0x2) && ((*insn_len & 2) == 0)) + { + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + *insn_len); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), + R_NDS32_INSN16); + lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + *insn_len += 2; + } + return TRUE; +} + +/* Revert condition branch. This function does not check if the input + instruction is condition branch or not. */ + +static void +nds32_elf_convert_branch (uint16_t insn16, uint32_t insn, + uint16_t *re_insn16, uint32_t *re_insn) +{ + uint32_t comp_insn = 0; + uint16_t comp_insn16 = 0; + + if (insn) + { + if (N32_OP6 (insn) == N32_OP6_BR1) + { + /* beqs label. */ + comp_insn = (insn ^ 0x4000) & 0xffffc000; + if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5) + { + /* Insn can be contracted to 16-bit implied r5. */ + comp_insn16 = + (comp_insn & 0x4000) ? INSN_BNES38 : INSN_BEQS38; + comp_insn16 |= (N32_RT5 (insn) & 0x7) << 8; + } + } + else if (N32_OP6 (insn) == N32_OP6_BR3) + { + /* bnec $ta, imm11, label. */ + comp_insn = (insn ^ 0x80000) & 0xffffff00; + } + else + { + comp_insn = (insn ^ 0x10000) & 0xffffc000; + if (N32_BR2_SUB (insn) == N32_BR2_BEQZ + || N32_BR2_SUB (insn) == N32_BR2_BNEZ) + { + if (N32_IS_RT3 (insn)) + { + /* Insn can be contracted to 16-bit. */ + comp_insn16 = + (comp_insn & 0x10000) ? INSN_BNEZ38 : INSN_BEQZ38; + comp_insn16 |= (N32_RT5 (insn) & 0x7) << 8; + } + else if (N32_RT5 (insn) == REG_R15) + { + /* Insn can be contracted to 16-bit. */ + comp_insn16 = + (comp_insn & 0x10000) ? INSN_BNES38 : INSN_BEQS38; + } + } + } + } + else + { + switch ((insn16 & 0xf000) >> 12) + { + case 0xc: + /* beqz38 or bnez38 */ + comp_insn16 = (insn16 ^ 0x0800) & 0xff00; + comp_insn = (comp_insn16 & 0x0800) ? INSN_BNEZ : INSN_BEQZ; + comp_insn |= ((comp_insn16 & 0x0700) >> 8) << 20; + break; + + case 0xd: + /* beqs38 or bnes38 */ + comp_insn16 = (insn16 ^ 0x0800) & 0xff00; + comp_insn = (comp_insn16 & 0x0800) ? INSN_BNE : INSN_BEQ; + comp_insn |= (((comp_insn16 & 0x0700) >> 8) << 20) + | (REG_R5 << 15); + break; + + case 0xe: + /* beqzS8 or bnezS8 */ + comp_insn16 = (insn16 ^ 0x0100) & 0xff00; + comp_insn = (comp_insn16 & 0x0100) ? INSN_BNEZ : INSN_BEQZ; + comp_insn |= REG_R15 << 20; + break; + + default: + break; + } + } + if (comp_insn && re_insn) + *re_insn = comp_insn; + if (comp_insn16 && re_insn16) + *re_insn16 = comp_insn16; +} + +/* Relax LONGJUMP2 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longjump2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 3 variations for LONGJUMP2 + case 2-4; 1st insn convertible, 16-bit on, + optimize off or optimize for space + bnes38 rt, ra, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1: + + case 4-4; 1st insn not convertible + bne rt, ra, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1: + + case 4-4; 1st insn convertible, 16-bit on, optimize for speed + bne rt, ra, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1: */ + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ + Elf_Internal_Rela *i2_irelfn, *cond_irelfn, *irelend; + int first_size; + unsigned int i; + bfd_signed_vma foff; + uint32_t insn, re_insn = 0; + uint16_t insn16, re_insn16 = 0; + unsigned long reloc, cond_reloc; + + enum elf_nds32_reloc_type checked_types[] = + { R_NDS32_15_PCREL_RELA, R_NDS32_9_PCREL_RELA }; + + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; + first_size = (seq_len == 6) ? 2 : 4; + + i2_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, + irelend, R_NDS32_25_PCREL_RELA, + laddr + first_size); + + for (i = 0; i < ARRAY_SIZE (checked_types); i++) + { + cond_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + checked_types[i], laddr); + if (cond_irelfn != irelend) + break; + } + + if (i2_irelfn == irelend || cond_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP2 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = + calculate_offset (abfd, sec, i2_irelfn, isymbuf, symtab_hdr); + if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1 + || foff >= CONSERVATIVE_16BIT_S1) + return FALSE; + + /* Get the all corresponding instructions. */ + if (first_size == 4) + { + insn = bfd_getb32 (contents + laddr); + nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn); + } + else + { + insn16 = bfd_getb16 (contents + laddr); + nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn); + } + + if (re_insn16 && foff >= -(ACCURATE_8BIT_S1 - first_size) + && foff < ACCURATE_8BIT_S1 - first_size) + { + if (first_size == 4) + { + /* Don't convert it to 16-bit now, keep this as relaxable for + ``label reloc; INSN16''. */ + + /* Save comp_insn32 to buffer. */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = (N32_OP6 (re_insn) == N32_OP6_BR1) ? + R_NDS32_15_PCREL_RELA : R_NDS32_17_PCREL_RELA; + cond_reloc = R_NDS32_INSN16; + } + else + { + bfd_putb16 (re_insn16, contents + irel->r_offset); + *insn_len = 2; + reloc = R_NDS32_9_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + } + } + else if (N32_OP6 (re_insn) == N32_OP6_BR1 + && (foff >= -(ACCURATE_14BIT_S1 - first_size) + && foff < ACCURATE_14BIT_S1 - first_size)) + { + /* beqs label ; 15_PCREL */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = R_NDS32_15_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + } + else if (N32_OP6 (re_insn) == N32_OP6_BR2 + && foff >= -CONSERVATIVE_16BIT_S1 + && foff < CONSERVATIVE_16BIT_S1) + { + /* beqz label ; 17_PCREL */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = R_NDS32_17_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + } + else + return FALSE; + + /* Set all relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), reloc); + irel->r_addend = i2_irelfn->r_addend; + + cond_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irelfn->r_info), + cond_reloc); + cond_irelfn->r_addend = 0; + + if ((seq_len ^ *insn_len ) & 0x2) + { + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + 4); + i2_irelfn->r_offset = 4; + i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), + R_NDS32_INSN16); + i2_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + *insn_len += 2; + } + else + i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), + R_NDS32_NONE); + return TRUE; +} + +/* Relax LONGJUMP3 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 5 variations for LONGJUMP3 + case 1: 2-4-4-2; 1st insn convertible, 16-bit on, + optimize off or optimize for space + bnes38 rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr5 ta ; + $1: ; + + case 2: 2-4-4-2; 1st insn convertible, 16-bit on, optimize for speed + bnes38 rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr5 ta ; + $1: ; LABEL + + case 3: 4-4-4-2; 1st insn not convertible, 16-bit on, + optimize off or optimize for space + bne rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr5 ta ; + $1: ; + + case 4: 4-4-4-4; 1st insn don't care, 16-bit off, optimize don't care + 16-bit off if no INSN16 + bne rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr ta ; + $1: ; + + case 5: 4-4-4-4; 1st insn not convertible, 16-bit on, optimize for speed + 16-bit off if no INSN16 + bne rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr ta ; + $1: ; LABEL */ + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + enum elf_nds32_reloc_type checked_types[] = + { R_NDS32_15_PCREL_RELA, R_NDS32_9_PCREL_RELA }; + + int reloc_off = 0, cond_removed = 0, convertible; + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ + Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *cond_irelfn, *irelend; + int first_size; + unsigned int i; + bfd_signed_vma foff; + uint32_t insn, re_insn = 0; + uint16_t insn16, re_insn16 = 0; + unsigned long reloc, cond_reloc; + + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; + + convertible = IS_1ST_CONVERT (irel->r_addend); + + if (convertible) + first_size = 2; + else + first_size = 4; + + /* Get all needed relocations. */ + hi_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr + first_size); + lo_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LO12S0_ORI_RELA, + laddr + first_size + 4); + + for (i = 0; i < ARRAY_SIZE (checked_types); i++) + { + cond_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + checked_types[i], laddr); + if (cond_irelfn != irelend) + break; + } + + if (hi_irelfn == irelend || lo_irelfn == irelend || cond_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP3 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr); + + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; + + /* Get the all corresponding instructions. */ + if (first_size == 4) + { + insn = bfd_getb32 (contents + laddr); + nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn); + } + else + { + insn16 = bfd_getb16 (contents + laddr); + nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn); + } + + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + + if (re_insn16 && foff >= -ACCURATE_8BIT_S1 - first_size + && foff < ACCURATE_8BIT_S1 - first_size) + { + if (!(seq_len & 0x2)) + { + /* Don't convert it to 16-bit now, keep this as relaxable + for ``label reloc; INSN1a''6. */ + /* Save comp_insn32 to buffer. */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = (N32_OP6 (re_insn) == N32_OP6_BR1) ? + R_NDS32_15_PCREL_RELA : R_NDS32_17_PCREL_RELA; + cond_reloc = R_NDS32_INSN16; + } + else + { + /* Not optimize for speed; convert sequence to 16-bit. */ + /* Save comp_insn16 to buffer. */ + bfd_putb16 (re_insn16, contents + irel->r_offset); + *insn_len = 2; + reloc = R_NDS32_9_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + } + cond_removed = 1; + } + else if (N32_OP6 (re_insn) == N32_OP6_BR1 + && (foff >= -(ACCURATE_14BIT_S1 - first_size) + && foff < ACCURATE_14BIT_S1 - first_size)) + { + /* beqs label ; 15_PCREL */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = R_NDS32_15_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + cond_removed = 1; + } + else if (N32_OP6 (re_insn) == N32_OP6_BR2 + && foff >= -CONSERVATIVE_16BIT_S1 + && foff < CONSERVATIVE_16BIT_S1) + { + /* beqz label ; 17_PCREL */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = R_NDS32_17_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + cond_removed = 1; + } + else if (foff >= -CONSERVATIVE_24BIT_S1 - reloc_off + && foff < CONSERVATIVE_24BIT_S1 - reloc_off) + { + /* Relax to one of the following 3 variations + + case 2-4; 1st insn convertible, 16-bit on, optimize off or optimize + for space + bnes38 rt, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1 + + case 4-4; 1st insn not convertible, others don't care + bne rt, ra, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1 + + case 4-4; 1st insn convertible, 16-bit on, optimize for speed + bne rt, ra, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1 */ + + /* Offset for first instruction. */ + + /* Use j label as second instruction. */ + *insn_len = 4 + first_size; + insn = INSN_J; + bfd_putb32 (insn, contents + hi_irelfn->r_offset); + reloc = R_NDS32_LONGJUMP2; + cond_reloc = R_NDS32_25_PLTREL; + } + else + return FALSE; + + if (cond_removed == 1) + { + /* Set all relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), reloc); + irel->r_addend = hi_irelfn->r_addend; + + cond_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irelfn->r_info), + cond_reloc); + cond_irelfn->r_addend = 0; + hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + R_NDS32_NONE); + } + else + { + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); + irel->r_addend = irel->r_addend; + hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + cond_reloc); + } + + if ((seq_len ^ *insn_len ) & 0x2) + { + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + *insn_len); + lo_irelfn->r_offset = *insn_len; + lo_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), + R_NDS32_INSN16); + lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + *insn_len += 2; + } + else + lo_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), + R_NDS32_NONE); + return TRUE; +} + +/* Relax LONGCALL4 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longcall4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* The pattern for LONGCALL4. Support for function cse. + sethi ta, hi20(symbol) ; LONGCALL4/HI20 + ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR + jral ta ; PTR_RES/EMPTY/INSN16 */ + + bfd_vma laddr; + uint32_t insn; + Elf_Internal_Rela *hi_irel, *ptr_irel, *insn_irel, *em_irel, *call_irel; + Elf_Internal_Rela *irelend; + bfd_signed_vma foff; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + hi_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr); + + if (hi_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL4 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irel, isymbuf, symtab_hdr); + + /* This condition only happened when symbol is undefined. */ + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; + + /* Relax to: jal symbol; 25_PCREL */ + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + + ptr_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, irel->r_addend); + em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_EMPTY, irel->r_addend); + + if (ptr_irel == irelend || em_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL4 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + /* Check these is enough space to insert jal in R_NDS32_EMPTY. */ + insn = bfd_getb32 (contents + irel->r_addend); + if (insn & 0x80000000) + return FALSE; + + /* Replace the long call with a jal. */ + em_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), + R_NDS32_25_PCREL_RELA); + ptr_irel->r_addend = 1; + + /* We don't resolve this here but resolve it in relocate_section. */ + insn = INSN_JAL; + bfd_putb32 (insn, contents + em_irel->r_offset); + + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + + /* If there is function cse, HI20 can not remove now. */ + call_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LONGCALL4, laddr); + if (call_irel == irelend) + { + *insn_len = 0; + hi_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irel->r_info), R_NDS32_NONE); + } + + insn_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, irel->r_addend); + if (insn_irel != irelend) + insn_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + + return TRUE; +} + +/* Relax LONGCALL5 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longcall5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* The pattern for LONGCALL5. + bltz rt, .L1 ; LONGCALL5/17_PCREL + jal symbol ; 25_PCREL + .L1: */ + + bfd_vma laddr; + uint32_t insn; + Elf_Internal_Rela *cond_irel, *irelend; + bfd_signed_vma foff; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_25_PCREL_RELA, irel->r_addend); + if (cond_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL5 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr); + + if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1 + || foff >= CONSERVATIVE_16BIT_S1) + return FALSE; + + /* Relax to bgezal rt, label ; 17_PCREL + or bltzal rt, label ; 17_PCREL */ + + /* Convert to complimentary conditional call. */ + insn = CONVERT_CONDITION_CALL (insn); + + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + + /* Modify relocation and contents. */ + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_17_PCREL_RELA); + + /* Replace the long call with a bgezal. */ + bfd_putb32 (insn, contents + cond_irel->r_offset); + *insn_len = 0; + + /* Clean unnessary relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + + cond_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_17_PCREL_RELA, laddr); + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE); + + return TRUE; +} + +/* Relax LONGCALL6 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longcall6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* The pattern for LONGCALL6. + bltz rt, .L1 ; LONGCALL6/17_PCREL + sethi ta, hi20(symbol) ; HI20/PTR + ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR + jral ta ; PTR_RES/EMPTY/INSN16 + .L1 */ + + bfd_vma laddr; + uint32_t insn; + Elf_Internal_Rela *em_irel, *cond_irel, *irelend; + bfd_signed_vma foff; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_EMPTY, irel->r_addend); + + if (em_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL6 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, em_irel, isymbuf, symtab_hdr); + + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; + + /* Check these is enough space to insert jal in R_NDS32_EMPTY. */ + insn = bfd_getb32 (contents + irel->r_addend); + if (insn & 0x80000000) + return FALSE; + + insn = bfd_getb32 (contents + laddr); + if (foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) + { + /* Relax to bgezal rt, label ; 17_PCREL + or bltzal rt, label ; 17_PCREL */ + + /* Convert to complimentary conditional call. */ + *insn_len = 0; + insn = CONVERT_CONDITION_CALL (insn); + bfd_putb32 (insn, contents + em_irel->r_offset); + + em_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), R_NDS32_17_PCREL_RELA); + + /* Set resolved relocation. */ + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, irel->r_addend); + if (cond_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL6 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + cond_irel->r_addend = 1; + + /* Clear relocations. */ + + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_17_PCREL_RELA, laddr); + if (cond_irel != irelend) + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE); + + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, irel->r_addend); + if (cond_irel != irelend) + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE); + + } + else if (foff >= -CONSERVATIVE_24BIT_S1 && foff < CONSERVATIVE_24BIT_S1) + { + /* Relax to the following instruction sequence + bltz rt, .L1 ; LONGCALL2/17_PCREL + jal symbol ; 25_PCREL/PTR_RES + .L1 */ + *insn_len = 4; + /* Convert instruction. */ + insn = INSN_JAL; + bfd_putb32 (insn, contents + em_irel->r_offset); + + /* Convert relocations. */ + em_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), + R_NDS32_25_PCREL_RELA); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_LONGCALL5); + + /* Set resolved relocation. */ + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, irel->r_addend); + if (cond_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL6 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + cond_irel->r_addend = 1; + + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, irel->r_addend); + if (cond_irel != irelend) + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE); + } + return TRUE; +} + +/* Relax LONGJUMP4 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longjump4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* The pattern for LONGJUMP4. + sethi ta, hi20(symbol) ; LONGJUMP4/HI20 + ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR + jr ta ; PTR_RES/INSN16/EMPTY */ + + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ + uint32_t insn; + Elf_Internal_Rela *hi_irel, *ptr_irel, *em_irel, *call_irel, *irelend; + bfd_signed_vma foff; + + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + hi_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr); + + if (hi_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP4 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irel, isymbuf, symtab_hdr); + + if (foff == 0 || foff >= CONSERVATIVE_24BIT_S1 + || foff < -CONSERVATIVE_24BIT_S1) + return FALSE; + + /* Convert it to "j label", it may be converted to j8 in the final + pass of relaxation. Therefore, we do not consider this currently.*/ + ptr_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, irel->r_addend); + em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_EMPTY, irel->r_addend); + + if (ptr_irel == irelend || em_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP4 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + em_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), R_NDS32_25_PCREL_RELA); + ptr_irel->r_addend = 1; + + /* Write instruction. */ + insn = INSN_J; + bfd_putb32 (insn, contents + em_irel->r_offset); + + /* Clear relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + + /* If there is function cse, HI20 can not remove now. */ + call_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LONGJUMP4, laddr); + if (call_irel == irelend) + { + *insn_len = 0; + hi_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irel->r_info), R_NDS32_NONE); + } + + return TRUE; +} + +/* Relax LONGJUMP5 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longjump5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + int *seq_len, bfd_byte *contents, + Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 2 variations for LONGJUMP5 + case 2-4; 1st insn convertible, 16-bit on. + bnes38 rt, ra, .L1 ; LONGJUMP5/9_PCREL/INSN16 + j label ; 25_PCREL/INSN16 + $1: + + case 4-4; 1st insn not convertible + bne rt, ra, .L1 ; LONGJUMP5/15_PCREL/INSN16 + j label ; 25_PCREL/INSN16 + .L1: */ + + bfd_vma laddr; + Elf_Internal_Rela *cond_irel, *irelend; + unsigned int i; + bfd_signed_vma foff; + uint32_t insn, re_insn = 0; + uint16_t insn16, re_insn16 = 0; + unsigned long reloc; + + enum elf_nds32_reloc_type checked_types[] = + { R_NDS32_17_PCREL_RELA, R_NDS32_15_PCREL_RELA, + R_NDS32_9_PCREL_RELA, R_NDS32_INSN16 }; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_25_PCREL_RELA, irel->r_addend); + if (cond_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP5 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr); + + if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1 + || foff >= CONSERVATIVE_16BIT_S1) + return FALSE; + + /* Get the all corresponding instructions. */ + insn = bfd_getb32 (contents + laddr); + /* Check instruction size. */ + if (insn & 0x80000000) + { + *seq_len = 0; + insn16 = insn >> 16; + nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn); + } + else + nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn); + + if (N32_OP6 (re_insn) == N32_OP6_BR1 + && (foff >= -CONSERVATIVE_14BIT_S1 && foff < CONSERVATIVE_14BIT_S1)) + { + /* beqs label ; 15_PCREL. */ + bfd_putb32 (re_insn, contents + cond_irel->r_offset); + reloc = R_NDS32_15_PCREL_RELA; + } + else if (N32_OP6 (re_insn) == N32_OP6_BR2 + && foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) + { + /* beqz label ; 17_PCREL. */ + bfd_putb32 (re_insn, contents + cond_irel->r_offset); + reloc = R_NDS32_17_PCREL_RELA; + } + else if ( N32_OP6 (re_insn) == N32_OP6_BR3 + && foff >= -CONSERVATIVE_8BIT_S1 && foff < CONSERVATIVE_8BIT_S1) + { + /* beqc label ; 9_PCREL. */ + bfd_putb32 (re_insn, contents + cond_irel->r_offset); + reloc = R_NDS32_WORD_9_PCREL_RELA; + } + else + return FALSE; + + /* Set all relocations. */ + cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), reloc); + + /* Clean relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + for (i = 0; i < ARRAY_SIZE (checked_types); i++) + { + cond_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + checked_types[i], laddr); + if (cond_irel != irelend) + { + if (*seq_len == 0 + && (ELF32_R_TYPE (cond_irel->r_info) == R_NDS32_INSN16)) + { + /* If the branch instruction is 2 byte, it cannot remove + directly. Only convert it to nop16 and remove it after + checking alignment issue. */ + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + laddr); + cond_irel->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + } + else + cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), + R_NDS32_NONE); + } + } + *insn_len = 0; + + return TRUE; +} + +/* Relax LONGJUMP6 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longjump6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + int *seq_len, bfd_byte *contents, + Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 5 variations for LONGJUMP6 + case : 2-4-4-4; 1st insn convertible, 16-bit on. + bnes38 rt, ra, .L1 ; LONGJUMP6/15_PCREL/INSN16 + sethi ta, hi20(symbol) ; HI20/PTR + ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR + jr ta ; PTR_RES/INSN16/EMPTY + .L1: + + case : 4-4-4-4; 1st insn not convertible, 16-bit on. + bne rt, ra, .L1 ; LONGJUMP6/15_PCREL/INSN16 + sethi ta, hi20(symbol) ; HI20/PTR + ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR + jr ta ; PTR_RES/INSN16/EMPTY + .L1: */ + + enum elf_nds32_reloc_type checked_types[] = + { R_NDS32_17_PCREL_RELA, R_NDS32_15_PCREL_RELA, + R_NDS32_9_PCREL_RELA, R_NDS32_INSN16 }; + + int reloc_off = 0, cond_removed = 0; + bfd_vma laddr; + Elf_Internal_Rela *cond_irel, *em_irel, *irelend, *insn_irel; + unsigned int i; + bfd_signed_vma foff; + uint32_t insn, re_insn = 0; + uint16_t insn16, re_insn16 = 0; + unsigned long reloc; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_EMPTY, irel->r_addend); + + if (em_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP6 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, em_irel, isymbuf, symtab_hdr); + + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; + + insn = bfd_getb32 (contents + laddr); + /* Check instruction size. */ + if (insn & 0x80000000) + { + *seq_len = 0; + insn16 = insn >> 16; + nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn); + } + else + nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn); + + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + + if (N32_OP6 (re_insn) == N32_OP6_BR1 + && (foff >= -CONSERVATIVE_14BIT_S1 && foff < CONSERVATIVE_14BIT_S1)) + { + /* beqs label ; 15_PCREL */ + bfd_putb32 (re_insn, contents + em_irel->r_offset); + reloc = R_NDS32_15_PCREL_RELA; + cond_removed = 1; + } + else if (N32_OP6 (re_insn) == N32_OP6_BR2 + && foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) + { + /* beqz label ; 17_PCREL */ + bfd_putb32 (re_insn, contents + em_irel->r_offset); + reloc = R_NDS32_17_PCREL_RELA; + cond_removed = 1; + } + else if (foff >= -CONSERVATIVE_24BIT_S1 - reloc_off + && foff < CONSERVATIVE_24BIT_S1 - reloc_off) + { + /* Relax to one of the following 2 variations + + case 2-4; 1st insn convertible, 16-bit on. + bnes38 rt, ra, .L1 ; LONGJUMP5/9_PCREL/INSN16 + j label ; 25_PCREL/INSN16 + $1: + + case 4-4; 1st insn not convertible + bne rt, ra, .L1 ; LONGJUMP5/15_PCREL/INSN16 + j label ; 25_PCREL/INSN16 + .L1: */ + + /* Use j label as second instruction. */ + insn = INSN_J; + reloc = R_NDS32_25_PCREL_RELA; + bfd_putb32 (insn, contents + em_irel->r_offset); + } + else + return FALSE; + + /* Set all relocations. */ + em_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), reloc); + + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, em_irel->r_offset); + cond_irel->r_addend = 1; + + /* Use INSN16 of first branch instruction to distinguish if keeping + INSN16 of final instruction or not. */ + insn_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, irel->r_offset); + if (insn_irel == irelend) + { + /* Clean the final INSN16. */ + insn_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, em_irel->r_offset); + insn_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), + R_NDS32_NONE); + } + + if (cond_removed == 1) + { + *insn_len = 0; + + /* Clear relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + + for (i = 0; i < ARRAY_SIZE (checked_types); i++) + { + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + checked_types[i], laddr); + if (cond_irel != irelend) + { + if (*seq_len == 0 + && (ELF32_R_TYPE (cond_irel->r_info) == R_NDS32_INSN16)) + { + /* If the branch instruction is 2 byte, it cannot remove + directly. Only convert it to nop16 and remove it after + checking alignment issue. */ + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + laddr); + cond_irel->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + } + else + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE); + } + } + } + else + { + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_NDS32_LONGJUMP5); + } + + return TRUE; +} + +/* Relax LONGJUMP7 relocation for nds32_elf_relax_section.*/ + +static bfd_boolean +nds32_elf_relax_longjump7 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + int *seq_len, bfd_byte *contents, + Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 2 variations for LONGJUMP5 + case 2-4; 1st insn convertible, 16-bit on. + movi55 ta, imm11 ; LONGJUMP7/INSN16 + beq rt, ta, label ; 15_PCREL + + case 4-4; 1st insn not convertible + movi55 ta, imm11 ; LONGJUMP7/INSN16 + beq rt, ta, label ; 15_PCREL */ + + bfd_vma laddr; + Elf_Internal_Rela *cond_irel, *irelend, *insn_irel; + bfd_signed_vma foff; + uint32_t insn, re_insn = 0; + uint16_t insn16; + uint32_t imm11; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_15_PCREL_RELA, irel->r_addend); + if (cond_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP7 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr); + + if (foff == 0 || foff < -CONSERVATIVE_8BIT_S1 + || foff >= CONSERVATIVE_8BIT_S1) + return FALSE; + + /* Get the first instruction for its size. */ + insn = bfd_getb32 (contents + laddr); + if (insn & 0x80000000) + { + *seq_len = 0; + /* Get the immediate from movi55. */ + imm11 = N16_IMM5S (insn >> 16); + } + else + { + /* Get the immediate from movi. */ + imm11 = N32_IMM20S (insn); + } + + /* Get the branch instruction. */ + insn = bfd_getb32 (contents + irel->r_addend); + /* Convert instruction to BR3. */ + if ((insn >> 14) & 0x1) + re_insn = N32_BR3 (BNEC, N32_RT5 (insn), imm11, 0); + else + re_insn = N32_BR3 (BEQC, N32_RT5 (insn), imm11, 0); + + bfd_putb32 (re_insn, contents + cond_irel->r_offset); + + /* Set all relocations. */ + cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), + R_NDS32_WORD_9_PCREL_RELA); + + /* Clean relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + insn_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, irel->r_offset); + if (insn_irel != irelend) + { + if (*seq_len == 0) + { + /* If the first insntruction is 16bit, convert it to nop16. */ + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + laddr); + insn_irel->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + } + else + cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), + R_NDS32_NONE); + } + *insn_len = 0; + + return TRUE; +} + +/* Record the offset to gp, and check if it changed after relaxing. + If the offset is fixed or the offset is near enough, try to relax + the pattern. This is avoid truncated to fit when relaxing fixed + address symbol. Ex: _stack. */ +static bfd_boolean +nds32_elf_relax_guard (bfd_vma *access_addr, bfd_vma local_sda, asection *sec, + Elf_Internal_Rela *irel, bfd_boolean *again, + bfd_boolean init, + struct elf_nds32_link_hash_table *table, + Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr) + +{ + /* The default linker script value. */ + int offset_to_gp; + static bfd_boolean sec_pass = FALSE; + static asection *first_sec = NULL, *sym_sec; + /* Record the number of instructions which may be removed. */ + static int count = 0, record_count; + Elf_Internal_Sym *isym; + struct elf_link_hash_entry *h = NULL; + int indx; + unsigned long r_symndx; + bfd *abfd = sec->owner; + static bfd_vma record_sda = 0; + int sda_offset = 0; + + /* Force doing relaxation when hyper-relax is high. */ + if (table->hyper_relax == 2) + return TRUE; + + /* Record the first section to get the round. */ + if (init) + { + if (!first_sec) + first_sec = sec; + else if (first_sec == sec) + { + record_count = count; + count = 0; + sec_pass = TRUE; + } + + if (!sec_pass) + *again = TRUE; + + return TRUE;; + } + + if (record_sda == 0) + record_sda = local_sda; + else if (local_sda > record_sda) + /* In normal case, SDA is fixed or smaller except there is + DATA_SEGMENT_ALIGN in linker script.*/ + sda_offset = local_sda - record_sda; + + /* Although we doesn't delete all instructions here, counting all of + them to be conservative. */ + count++; + + r_symndx = ELF32_R_SYM (irel->r_info); + /* Global symbols. */ + if (r_symndx >= symtab_hdr->sh_info) + { + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + sym_sec = h->root.u.def.section; + if (NDS32_GUARD_SEC_P (sym_sec->flags) + || bfd_is_abs_section (sym_sec)) + { + /* Forbid doing relaxation when hyper-relax is low. */ + if (table->hyper_relax == 0) + return FALSE; + + offset_to_gp = *access_addr - local_sda; + if (elf32_nds32_hash_entry (h)->offset_to_gp == 0) + elf32_nds32_hash_entry (h)->offset_to_gp = offset_to_gp; + else if (abs (elf32_nds32_hash_entry (h)->offset_to_gp) + < abs (offset_to_gp) - sda_offset) + { + if (*access_addr >= local_sda) + *access_addr += (record_count * 4); + else + *access_addr -= (record_count * 4); + } + return sec_pass; + } + } + else + { + if (!elf32_nds32_allocate_local_sym_info (abfd)) + return FALSE; + isym = isymbuf + r_symndx; + + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + if (NDS32_GUARD_SEC_P (sym_sec->flags)) + { + /* Forbid doing relaxation when hyper-relax is low. */ + if (table->hyper_relax == 0) + return FALSE; + + offset_to_gp = *access_addr - local_sda; + if (elf32_nds32_local_gp_offset (abfd)[r_symndx] == 0) + elf32_nds32_local_gp_offset (abfd)[r_symndx] = offset_to_gp; + else if (abs (elf32_nds32_local_gp_offset (abfd)[r_symndx]) + < abs (offset_to_gp) - sda_offset) + { + if (*access_addr >= local_sda) + *access_addr += (record_count * 4); + else + *access_addr -= (record_count * 4); + } + return sec_pass; + } + } + + return TRUE; +} +#define GET_LOADSTORE_RANGE(addend) (((addend) >> 8) & 0x3f) + +/* Relax LOADSTORE relocation for nds32_elf_relax_section. */ + +static bfd_boolean +nds32_elf_relax_loadstore (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr, int load_store_relax, + struct elf_nds32_link_hash_table *table) +{ + int eliminate_sethi = 0, range_type, i; + bfd_vma local_sda, laddr; + int seq_len; /* Original length of instruction sequence. */ + uint32_t insn; + Elf_Internal_Rela *hi_irelfn = NULL, *irelend; + bfd_vma access_addr = 0; + bfd_vma range_l = 0, range_h = 0; /* Upper/lower bound. */ + enum elf_nds32_reloc_type checked_types[] = + { R_NDS32_HI20_RELA, R_NDS32_GOT_HI20, + R_NDS32_GOTPC_HI20, R_NDS32_GOTOFF_HI20, + R_NDS32_PLTREL_HI20, R_NDS32_PLT_GOTREL_HI20, + R_NDS32_TLS_LE_HI20, R_NDS32_TLS_IE_HI20, + R_NDS32_TLS_IEGP_HI20, R_NDS32_TLS_DESC_HI20 + }; + + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; + + /* Get the high part relocation. */ + for (i = 0; (unsigned) i < ARRAY_SIZE (checked_types); i++) + { + hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, + checked_types[i], laddr); + if (hi_irelfn != irelend) + break; + } + + if (hi_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LOADSTORE points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + + range_type = GET_LOADSTORE_RANGE (irel->r_addend); + nds32_elf_final_sda_base (sec->output_section->owner, + link_info, &local_sda, FALSE); + + switch (ELF32_R_TYPE (hi_irelfn->r_info)) + { + case R_NDS32_HI20_RELA: + insn = bfd_getb32 (contents + laddr); + access_addr = + calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr); + + /* Try movi. */ + if (range_type == NDS32_LOADSTORE_IMM) + { + struct elf_link_hash_entry *h = NULL; + int indx; + + if (ELF32_R_SYM (hi_irelfn->r_info) >= symtab_hdr->sh_info) + { + indx = ELF32_R_SYM (hi_irelfn->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + } + + if ((access_addr < CONSERVATIVE_20BIT) + && (!h || (h && strcmp (h->root.root.string, FP_BASE_NAME) != 0))) + { + eliminate_sethi = 1; + break; + } + } + + if (!nds32_elf_relax_guard (&access_addr, local_sda, sec, hi_irelfn, + NULL, FALSE, table, isymbuf, symtab_hdr)) + return FALSE; + + + if (!load_store_relax) + return FALSE; + + /* Case for set gp register. */ + if (N32_RT5 (insn) == REG_GP) + break; + + if (range_type == NDS32_LOADSTORE_FLOAT_S + || range_type == NDS32_LOADSTORE_FLOAT_S) + { + range_l = sdata_range[0][0]; + range_h = sdata_range[0][1]; + } + else + { + range_l = sdata_range[1][0]; + range_h = sdata_range[1][1]; + } + break; + + case R_NDS32_GOT_HI20: + access_addr = + calculate_got_memory_address (abfd, link_info, hi_irelfn, symtab_hdr); + + /* If this symbol is not in .got, the return value will be -1. + Since the gp value is set to SDA_BASE but not GLOBAL_OFFSET_TABLE, + a negative offset is allowed. */ + if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT) + eliminate_sethi = 1; + break; + + case R_NDS32_PLT_GOTREL_HI20: + access_addr = calculate_plt_memory_address (abfd, link_info, isymbuf, + hi_irelfn, symtab_hdr); + + if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT) + eliminate_sethi = 1; + break; + + case R_NDS32_GOTOFF_HI20: + access_addr = + calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr); + + if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT) + eliminate_sethi = 1; + break; + + case R_NDS32_GOTPC_HI20: + /* The access_addr must consider r_addend of hi_irel. */ + access_addr = sec->output_section->vma + sec->output_offset + + irel->r_offset + hi_irelfn->r_addend; + + if ((bfd_signed_vma) (local_sda - access_addr) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (local_sda - access_addr) >= -CONSERVATIVE_20BIT) + eliminate_sethi = 1; + break; + + case R_NDS32_TLS_LE_HI20: + access_addr = + calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr); + BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL); + access_addr -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET); + if ((range_type == NDS32_LOADSTORE_IMM) + && (bfd_signed_vma) (access_addr) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (access_addr) >= -CONSERVATIVE_20BIT) + eliminate_sethi = 1; + break; + + /* TODO: TLS IE/IEGP */ + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IEGP_HI20: + break; + + /* TODO: TLS DESC */ + case R_NDS32_TLS_DESC_HI20: + break; + + default: + return FALSE; + } + + /* Delete sethi instruction. */ + if (eliminate_sethi == 1 + || (local_sda <= access_addr && (access_addr - local_sda) < range_h) + || (local_sda > access_addr && (local_sda - access_addr) <= range_l)) + { + hi_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + *insn_len = 0; + } + return TRUE; +} + +/* Relax LO12 relocation for nds32_elf_relax_section.*/ + +static void +nds32_elf_relax_lo12 (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, bfd_byte *contents, + Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr, + struct elf_nds32_link_hash_table *table) +{ + uint32_t insn; + bfd_vma local_sda, laddr; + unsigned long reloc; + bfd_vma access_addr; + bfd_vma range_l = 0, range_h = 0; /* Upper/lower bound. */ + Elf_Internal_Rela *irelfn = NULL, *irelend; + struct elf_link_hash_entry *h = NULL; + int indx; + + /* For SDA base relative relaxation. */ + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &local_sda, FALSE); + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + + if (!is_sda_access_insn (insn) && N32_OP6 (insn) != N32_OP6_ORI) + return; + + access_addr = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + + if (ELF32_R_SYM (irel->r_info) >= symtab_hdr->sh_info) + { + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + } + + /* Try movi. */ + if (N32_OP6 (insn) == N32_OP6_ORI && access_addr < CONSERVATIVE_20BIT + && (!h || (h && strcmp (h->root.root.string, FP_BASE_NAME) != 0))) + { + reloc = R_NDS32_20_RELA; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); + insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0); + bfd_putb32 (insn, contents + laddr); + } + else + { + if (!nds32_elf_relax_guard (&access_addr, local_sda, sec, irel, NULL, + FALSE, table, isymbuf, symtab_hdr)) + return; + + range_l = sdata_range[1][0]; + range_h = sdata_range[1][1]; + switch (ELF32_R_TYPE (irel->r_info)) + { + case R_NDS32_LO12S0_RELA: + reloc = R_NDS32_SDA19S0_RELA; + break; + case R_NDS32_LO12S1_RELA: + reloc = R_NDS32_SDA18S1_RELA; + break; + case R_NDS32_LO12S2_RELA: + reloc = R_NDS32_SDA17S2_RELA; + break; + case R_NDS32_LO12S2_DP_RELA: + range_l = sdata_range[0][0]; + range_h = sdata_range[0][1]; + reloc = R_NDS32_SDA12S2_DP_RELA; + break; + case R_NDS32_LO12S2_SP_RELA: + range_l = sdata_range[0][0]; + range_h = sdata_range[0][1]; + reloc = R_NDS32_SDA12S2_SP_RELA; + break; + default: + return; + } + + /* There are range_h and range_l because linker has to promise + all sections move cross one page together. */ + if ((local_sda <= access_addr && (access_addr - local_sda) < range_h) + || (local_sda > access_addr && (local_sda - access_addr) <= range_l)) + { + if (N32_OP6 (insn) == N32_OP6_ORI && N32_RT5 (insn) == REG_GP) + { + /* Maybe we should add R_NDS32_INSN16 reloc type here + or manually do some optimization. sethi can't be + eliminated when updating $gp so the relative ori + needs to be preserved. */ + return; + } + if (!turn_insn_to_sda_access (insn, ELF32_R_TYPE (irel->r_info), + &insn)) + return; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); + bfd_putb32 (insn, contents + laddr); + + irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_INSN16); + /* SDA17 must keep INSN16 for converting fp_as_gp. */ + if (irelfn != irelend && reloc != R_NDS32_SDA17S2_RELA) + irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (irelfn->r_info), R_NDS32_NONE); + + } + } + return; +} + +/* Relax low part of PIC instruction pattern. */ + +static void +nds32_elf_relax_piclo12 (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + uint32_t insn; + bfd_vma local_sda, laddr; + bfd_signed_vma foff; + unsigned long reloc; + + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &local_sda, FALSE); + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + + if (N32_OP6 (insn) != N32_OP6_ORI) + return; + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOT_LO12) + { + foff = calculate_got_memory_address (abfd, link_info, irel, + symtab_hdr) - local_sda; + reloc = R_NDS32_GOT20; + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_PLT_GOTREL_LO12) + { + foff = calculate_plt_memory_address (abfd, link_info, isymbuf, irel, + symtab_hdr) - local_sda; + reloc = R_NDS32_PLT_GOTREL_LO20; + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTOFF_LO12) + { + foff = calculate_memory_address (abfd, irel, isymbuf, + symtab_hdr) - local_sda; + reloc = R_NDS32_GOTOFF; + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTPC_LO12) + { + foff = local_sda - sec->output_section->vma + sec->output_offset + + irel->r_offset + irel->r_addend; + reloc = R_NDS32_GOTPC20; + } + else + return; + + if ((foff < CONSERVATIVE_20BIT) && (foff >= -CONSERVATIVE_20BIT)) + { + /* Turn into MOVI. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); + insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0); + bfd_putb32 (insn, contents + laddr); + } +} + +/* Relax low part of LE TLS instruction pattern. */ + +static void +nds32_elf_relax_letlslo12 (struct bfd_link_info *link_info, bfd *abfd, + Elf_Internal_Rela *irel, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + uint32_t insn; + bfd_vma laddr; + bfd_signed_vma foff; + unsigned long reloc; + + laddr = irel->r_offset; + foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL); + foff -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET); + insn = bfd_getb32 (contents + laddr); + + if ( (bfd_signed_vma) (foff) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (foff) >= -CONSERVATIVE_20BIT) + { + /* Pattern sethi-ori transform to movi. */ + reloc = R_NDS32_TLS_LE_20; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); + insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0); + bfd_putb32 (insn, contents + laddr); + } +} + +/* Relax LE TLS calculate address instruction pattern. */ + +static void +nds32_elf_relax_letlsadd (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again) +{ + /* Local TLS non-pic + sethi ta, hi20(symbol@tpoff) ; TLS_LE_HI20 + ori ta, ta, lo12(symbol@tpoff) ; TLS_LE_LO12 + add ra, ta, tp ; TLS_LE_ADD */ + + uint32_t insn; + bfd_vma laddr; + bfd_signed_vma foff; + Elf_Internal_Rela *i1_irelfn, *irelend; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED); + foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL); + foff -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET); + + /* The range is +/-16k. */ + if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT + && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT) + { + /* Transform add to addi. */ + insn = N32_TYPE2 (ADDI, N32_RT5 (insn), N32_RB5 (insn), 0); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S0); + + bfd_putb32 (insn, contents + laddr); + if (i1_irelfn != irelend) + { + i1_irelfn->r_addend |= 1; + *again = TRUE; + } + } +} + +/* Relax LE TLS load store instruction pattern. */ + +static void +nds32_elf_relax_letlsls (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again) +{ + uint32_t insn; + bfd_vma laddr; + bfd_signed_vma foff; + Elf_Internal_Rela *i1_irelfn, *irelend; + int success = 0; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED); + foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL); + foff -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET); + + switch ((N32_OP6 (insn) << 8) | (insn & 0xff)) + { + case (N32_OP6_MEM << 8) | N32_MEM_LB: + case (N32_OP6_MEM << 8) | N32_MEM_SB: + case (N32_OP6_MEM << 8) | N32_MEM_LBS: + /* The range is +/-16k. */ + if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT + && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT) + { + insn = + ((insn & 0xff) << 25) | (insn & 0x1f00000) | ((insn & 0x7c00) << 5); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S0); + success = 1; + break; + } + case (N32_OP6_MEM << 8) | N32_MEM_LH: + case (N32_OP6_MEM << 8) | N32_MEM_SH: + case (N32_OP6_MEM << 8) | N32_MEM_LHS: + /* The range is +/-32k. */ + if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT_S1 + && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT_S1) + { + insn = + ((insn & 0xff) << 25) | (insn & 0x1f00000) | ((insn & 0x7c00) << 5); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S1); + success = 1; + break; + } + case (N32_OP6_MEM << 8) | N32_MEM_LW: + case (N32_OP6_MEM << 8) | N32_MEM_SW: + /* The range is +/-64k. */ + if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT_S2 + && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT_S2) + { + insn = + ((insn & 0xff) << 25) | (insn & 0x1f00000) | ((insn & 0x7c00) << 5); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S2); + success = 1; + break; + } + default: + break; + } + + if (success) + { + bfd_putb32 (insn, contents + laddr); + if (i1_irelfn != irelend) + { + i1_irelfn->r_addend |= 1; + *again = TRUE; + } + } +} + +/* Relax PTR relocation for nds32_elf_relax_section. */ + +static bfd_boolean +nds32_elf_relax_ptr (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + int *seq_len, bfd_byte *contents) +{ + Elf_Internal_Rela *ptr_irel, *irelend, *count_irel, *re_irel; + + irelend = internal_relocs + sec->reloc_count; + + re_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, irel->r_addend); + + if (re_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_PTR points to unrecognized reloc at 0x%lx.", + abfd, (long) irel->r_offset); + return FALSE; + } + + if (re_irel->r_addend != 1) + return FALSE; + + /* Pointed target is relaxed and no longer needs this void *, + change the type to NONE. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + + /* Find PTR_COUNT to decide remove it or not. If PTR_COUNT does + not exist, it means only count 1 and remove it directly. */ + /* TODO: I hope we can obsolate R_NDS32_COUNT in the future. */ + count_irel = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_COUNT); + ptr_irel = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR); + if (count_irel != irelend) + { + if (--count_irel->r_addend > 0) + return FALSE; + } + + if (ptr_irel != irelend) + return FALSE; + + /* If the PTR_COUNT is already 0, remove current instruction. */ + *seq_len = nds32_elf_insn_size (abfd, contents, irel->r_offset); + *insn_len = 0; + return TRUE; +} + +/* Relax PLT_GOT_SUFF relocation for nds32_elf_relax_section. */ + +static void +nds32_elf_relax_pltgot_suff (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again) +{ + uint32_t insn; + bfd_signed_vma foff; + Elf_Internal_Rela *i1_irelfn, *irelend; + bfd_vma local_sda, laddr; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + + /* FIXME: It's a little trouble to turn JRAL5 to JAL since + we need additional space. It might be help if we could + borrow some space from instructions to be eliminated + such as sethi, ori, add. */ + if (insn & 0x80000000) + return; + + if (nds32_elf_check_dup_relocs + (irel, internal_relocs, irelend, R_NDS32_PLT_GOT_SUFF)) + return; + + i1_irelfn = + find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED); + + /* FIXIT 090606 + The boundary should be reduced since the .plt section hasn't + been created and the address of specific entry is still unknown + Maybe the range between the function call and the begin of the + .text section can be used to decide if the .plt is in the range + of function call. */ + + if (N32_OP6 (insn) == N32_OP6_ALU1 + && N32_SUB5 (insn) == N32_ALU1_ADD) + { + /* Get the value of the symbol referred to by the reloc. */ + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &local_sda, FALSE); + foff = (bfd_signed_vma) (calculate_plt_memory_address + (abfd, link_info, isymbuf, irel, + symtab_hdr) - local_sda); + /* This condition only happened when symbol is undefined. */ + if (foff == 0) + return; + + if (foff < -CONSERVATIVE_19BIT || foff >= CONSERVATIVE_19BIT) + return; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_NDS32_PLT_GOTREL_LO19); + /* addi.gp */ + insn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19)); + } + else if (N32_OP6 (insn) == N32_OP6_JREG + && N32_SUB5 (insn) == N32_JREG_JRAL) + { + /* Get the value of the symbol referred to by the reloc. */ + foff = + calculate_plt_offset (abfd, sec, link_info, isymbuf, irel, symtab_hdr); + /* This condition only happened when symbol is undefined. */ + if (foff == 0) + return; + if (foff < -CONSERVATIVE_24BIT_S1 || foff >= CONSERVATIVE_24BIT_S1) + return; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_25_PLTREL); + insn = INSN_JAL; + } + else + return; + + bfd_putb32 (insn, contents + laddr); + if (i1_irelfn != irelend) + { + i1_irelfn->r_addend |= 1; + *again = TRUE; + } +} + +/* Relax GOT_SUFF relocation for nds32_elf_relax_section. */ + +static void +nds32_elf_relax_got_suff (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, Elf_Internal_Shdr *symtab_hdr, + bfd_boolean *again) +{ + uint32_t insn; + bfd_signed_vma foff; + Elf_Internal_Rela *i1_irelfn, *irelend; + bfd_vma local_sda, laddr; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + if (insn & 0x80000000) + return; + + if (nds32_elf_check_dup_relocs + (irel, internal_relocs, irelend, R_NDS32_GOT_SUFF)) + return; + + i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED); + + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &local_sda, FALSE); + foff = calculate_got_memory_address (abfd, link_info, irel, + symtab_hdr) - local_sda; + + if (foff < CONSERVATIVE_19BIT && foff >= -CONSERVATIVE_19BIT) + { + /* Turn LW to LWI.GP. Change relocation type to R_NDS32_GOT_REL. */ + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (6, 17, 3)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_GOT17S2_RELA); + bfd_putb32 (insn, contents + laddr); + if (i1_irelfn != irelend) + { + i1_irelfn->r_addend |= 1; + *again = TRUE; + } + } +} + +/* Relax PLT_GOT_SUFF relocation for nds32_elf_relax_section. */ + +static void +nds32_elf_relax_gotoff_suff (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again) +{ + int opc_insn_gotoff; + uint32_t insn; + bfd_signed_vma foff; + Elf_Internal_Rela *i1_irelfn, *i2_irelfn, *irelend; + bfd_vma local_sda, laddr; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + + if (insn & 0x80000000) + return; + + if (nds32_elf_check_dup_relocs + (irel, internal_relocs, irelend, R_NDS32_GOTOFF_SUFF)) + return; + + i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED); + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &local_sda, FALSE); + foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + foff = foff - local_sda; + + if (foff >= CONSERVATIVE_19BIT || foff < -CONSERVATIVE_19BIT) + return; + + /* Concatenate opcode and sub-opcode for switch case. + It may be MEM or ALU1. */ + opc_insn_gotoff = (N32_OP6 (insn) << 8) | (insn & 0xff); + switch (opc_insn_gotoff) + { + case (N32_OP6_MEM << 8) | N32_MEM_LW: + /* 4-byte aligned. */ + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (6, 17, 3)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA17S2_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_SW: + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (7, 17, 3)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA17S2_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_LH: + /* 2-byte aligned. */ + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), 0); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_LHS: + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (18)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_SH: + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (19)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_LB: + /* 1-byte aligned. */ + insn = N32_TYPE1 (LBGP, N32_RT5 (insn), 0); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_LBS: + insn = N32_TYPE1 (LBGP, N32_RT5 (insn), __BIT (19)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_SB: + insn = N32_TYPE1 (SBGP, N32_RT5 (insn), 0); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); + break; + case (N32_OP6_ALU1 << 8) | N32_ALU1_ADD: + insn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); + break; + default: + return; + } + + bfd_putb32 (insn, contents + laddr); + if (i1_irelfn != irelend) + { + i1_irelfn->r_addend |= 1; + *again = TRUE; + } + if ((i2_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_INSN16)) != irelend) + i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + +} + +static bfd_boolean +nds32_relax_adjust_label (bfd *abfd, asection *sec, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, + nds32_elf_blank_t **relax_blank_list, + int optimize, int opt_size) +{ + /* This code block is used to adjust 4-byte alignment by relax a pair + of instruction a time. + + It recognizes three types of relocations. + 1. R_NDS32_LABEL - a alignment. + 2. R_NDS32_INSN16 - relax a 32-bit instruction to 16-bit. + 3. is_16bit_NOP () - remove a 16-bit instruction. */ + + /* TODO: It seems currently implementation only support 4-byte alignment. + We should handle any-alignment. */ + + Elf_Internal_Rela *insn_rel = NULL, *label_rel = NULL, *irel; + Elf_Internal_Rela *tmp_rel, *tmp2_rel = NULL; + Elf_Internal_Rela rel_temp; + Elf_Internal_Rela *irelend; + bfd_vma address; + uint16_t insn16; + + /* Checking for branch relaxation relies on the relocations to + be sorted on 'r_offset'. This is not guaranteed so we must sort. */ + nds32_insertion_sort (internal_relocs, sec->reloc_count, + sizeof (Elf_Internal_Rela), compar_reloc); + + irelend = internal_relocs + sec->reloc_count; + + /* Force R_NDS32_LABEL before R_NDS32_INSN16. */ + /* FIXME: Can we generate the right order in assembler? + So we don't have to swapping them here. */ + + for (label_rel = internal_relocs, insn_rel = internal_relocs; + label_rel < irelend; label_rel++) + { + if (ELF32_R_TYPE (label_rel->r_info) != R_NDS32_LABEL) + continue; + + /* Find the first reloc has the same offset with label_rel. */ + while (insn_rel < irelend && insn_rel->r_offset < label_rel->r_offset) + insn_rel++; + + for (;insn_rel < irelend && insn_rel->r_offset == label_rel->r_offset; + insn_rel++) + /* Check if there were R_NDS32_INSN16 and R_NDS32_LABEL at the same + address. */ + if (ELF32_R_TYPE (insn_rel->r_info) == R_NDS32_INSN16) + break; + + if (insn_rel < irelend && insn_rel->r_offset == label_rel->r_offset + && insn_rel < label_rel) + { + /* Swap the two reloc if the R_NDS32_INSN16 is + before R_NDS32_LABEL. */ + memcpy (&rel_temp, insn_rel, sizeof (Elf_Internal_Rela)); + memcpy (insn_rel, label_rel, sizeof (Elf_Internal_Rela)); + memcpy (label_rel, &rel_temp, sizeof (Elf_Internal_Rela)); + } + } + + label_rel = NULL; + insn_rel = NULL; + /* If there were a sequence of R_NDS32_LABEL end up with .align 2 + or higher, remove other R_NDS32_LABEL with lower alignment. + If an R_NDS32_INSN16 in between R_NDS32_LABELs must be converted, + then the R_NDS32_LABEL sequence is broke. */ + for (tmp_rel = internal_relocs; tmp_rel < irelend; tmp_rel++) + { + if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_LABEL) + { + if (label_rel == NULL) + { + if (tmp_rel->r_addend < 2) + label_rel = tmp_rel; + continue; + } + else if (tmp_rel->r_addend > 1) + { + /* Remove all LABEL relocation from label_rel to tmp_rel + including relocations with same offset as tmp_rel. */ + for (tmp2_rel = label_rel; tmp2_rel < tmp_rel; tmp2_rel++) + { + if (tmp2_rel->r_offset == tmp_rel->r_offset) + break; + + if (ELF32_R_TYPE (tmp2_rel->r_info) == R_NDS32_LABEL + && tmp2_rel->r_addend < 2) + tmp2_rel->r_info = + ELF32_R_INFO (ELF32_R_SYM (tmp2_rel->r_info), + R_NDS32_NONE); + } + label_rel = NULL; + } + } + else if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_INSN16 && label_rel) + { + /* A new INSN16 which can be converted, so clear label_rel. */ + if (is_convert_32_to_16 (abfd, sec, tmp_rel, internal_relocs, + irelend, &insn16) + || is_16bit_NOP (abfd, sec, tmp_rel)) + label_rel = NULL; + } + } + + label_rel = NULL; + insn_rel = NULL; + /* Optimized for speed and nothing has not been relaxed. + It's time to align labels. + We may convert a 16-bit instruction right before a label to + 32-bit, in order to align the label if necessary + all reloc entries has been sorted by r_offset. */ + for (irel = internal_relocs; + irel < irelend && irel->r_offset < sec->size; irel++) + { + if (ELF32_R_TYPE (irel->r_info) != R_NDS32_INSN16 + && ELF32_R_TYPE (irel->r_info) != R_NDS32_LABEL) + continue; + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_INSN16) + { + /* A new INSN16 found, resize the old one. */ + if (is_convert_32_to_16 + (abfd, sec, irel, internal_relocs, irelend, &insn16) + || is_16bit_NOP (abfd, sec, irel)) + { + if (insn_rel) + { + /* Previous INSN16 reloc exists, reduce its + size to 16-bit. */ + if (is_convert_32_to_16 (abfd, sec, insn_rel, internal_relocs, + irelend, &insn16)) + { + nds32_elf_write_16 (abfd, contents, insn_rel, + internal_relocs, irelend, insn16); + + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset + 2, 2)) + return FALSE; + } + else if (is_16bit_NOP (abfd, sec, insn_rel)) + { + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset, 2)) + return FALSE; + } + insn_rel->r_info = + ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info), R_NDS32_NONE); + } + /* Save the new one for later use. */ + insn_rel = irel; + } + else + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_NDS32_NONE); + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL) + { + /* Search for label. */ + int force_relax = 0; + + /* Label on 16-bit instruction or optimization + needless, just reset this reloc. */ + insn16 = bfd_getb16 (contents + irel->r_offset); + if ((irel->r_addend & 0x1f) < 2 && (!optimize || (insn16 & 0x8000))) + { + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + continue; + } + + address = + irel->r_offset - get_nds32_elf_blank_total (relax_blank_list, + irel->r_offset, 1); + + if (!insn_rel) + { + /* Check if there is case which can not be aligned. */ + if (irel->r_addend == 2 && address & 0x2) + return FALSE; + continue; + } + + /* Try to align this label. */ + + if ((irel->r_addend & 0x1f) < 2) + { + /* Check if there is a INSN16 at the same address. + Label_rel always seats before insn_rel after + our sort. */ + + /* Search for INSN16 at LABEL location. If INSN16 is at + same location and this LABEL alignment is lower than 2, + the INSN16 can be converted to 2-byte. */ + for (tmp_rel = irel; + tmp_rel < irelend && tmp_rel->r_offset == irel->r_offset; + tmp_rel++) + { + if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_INSN16 + && (is_convert_32_to_16 + (abfd, sec, tmp_rel, internal_relocs, + irelend, &insn16) + || is_16bit_NOP (abfd, sec, tmp_rel))) + { + force_relax = 1; + break; + } + } + } + + if (force_relax || irel->r_addend == 1 || address & 0x2) + { + /* Label not aligned. */ + /* Previous reloc exists, reduce its size to 16-bit. */ + if (is_convert_32_to_16 (abfd, sec, insn_rel, + internal_relocs, irelend, &insn16)) + { + nds32_elf_write_16 (abfd, contents, insn_rel, + internal_relocs, irelend, insn16); + + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset + 2, 2)) + return FALSE; + } + else if (is_16bit_NOP (abfd, sec, insn_rel)) + { + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset, 2)) + return FALSE; + } + + } + /* INSN16 reloc is used. */ + insn_rel = NULL; + } + } + + address = + sec->size - get_nds32_elf_blank_total (relax_blank_list, sec->size, 0); + if (insn_rel && (address & 0x2 || opt_size)) + { + if (is_convert_32_to_16 (abfd, sec, insn_rel, internal_relocs, + irelend, &insn16)) + { + nds32_elf_write_16 (abfd, contents, insn_rel, internal_relocs, + irelend, insn16); + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset + 2, 2)) + return FALSE; + insn_rel->r_info = ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info), + R_NDS32_NONE); + } + else if (is_16bit_NOP (abfd, sec, insn_rel)) + { + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset, 2)) + return FALSE; + insn_rel->r_info = ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info), + R_NDS32_NONE); + } + } + insn_rel = NULL; + return TRUE; +} + +/* Pick relaxation round. */ + +static int +nds32_elf_pick_relax (bfd_boolean init, asection *sec, bfd_boolean *again, + struct elf_nds32_link_hash_table *table, + struct bfd_link_info *link_info) +{ + static asection *final_sec, *first_sec = NULL; + static bfd_boolean normal_again = FALSE; + static bfd_boolean set = FALSE; + static bfd_boolean first = TRUE; + int round_table[] = { + NDS32_RELAX_IFC_ROUND, + NDS32_RELAX_NORMAL_ROUND, + NDS32_RELAX_JUMP_IFC_ROUND, + NDS32_RELAX_EX9_BUILD_ROUND, + NDS32_RELAX_EX9_REPLACE_ROUND, + }; + static int pass = 0; + static int relax_round; + + /* The new round. */ + if (init && first_sec == sec) + { + set = TRUE; + normal_again = FALSE; + } + + if (first) + { + /* Run an empty run to get the final section. */ + relax_round = NDS32_RELAX_EMPTY_ROUND; + + /* We have to do ifc optimization before general relax. + Decide the first round here. */ + if (table->target_optimize & NDS32_RELAX_IFC_ON) + pass = 0; + else + pass = 1; + + /* It has to enter relax again because we can + not make sure what the final turn is. */ + *again = TRUE; + + first = FALSE; + first_sec = sec; + } + + if (!set) + { + /* Not reenter yet. */ + final_sec = sec; + return relax_round; + } + + relax_round = round_table[pass]; + + if (!init && relax_round == NDS32_RELAX_NORMAL_ROUND && *again) + normal_again = TRUE; + + if (!init && final_sec == sec) + { + switch (relax_round) + { + case NDS32_RELAX_IFC_ROUND: + nds32_elf_ifc_cse_algo (link_info); + *again = TRUE; + pass++; + break; + case NDS32_RELAX_NORMAL_ROUND: + if (!normal_again) + { + /* Normal relaxation done. */ + if (table->target_optimize & NDS32_RELAX_IFC_ON) + { + pass++; + *again = TRUE; + } + else if (table->target_optimize & NDS32_RELAX_EX9_ON) + { + pass += 2; /* NDS32_RELAX_EX9_BUILD_ROUND */ + *again = TRUE; + } + else if (table->ex9_import_file) + { + /* Import ex9 table. */ + if (table->update_ex9_table) + pass += 2; /* NDS32_RELAX_EX9_BUILD_ROUND */ + else + pass += 3; /* NDS32_RELAX_EX9_REPLACE_ROUND */ + nds32_elf_ex9_import_table (link_info); + *again = TRUE; + } + } + break; + case NDS32_RELAX_JUMP_IFC_ROUND: + if (!nds32_elf_ifc_finish (link_info)) + (*_bfd_error_handler) (_("error: Jump IFC Fail.")); + if (table->target_optimize & NDS32_RELAX_EX9_ON) + { + pass++; + *again = TRUE; + } + break; + case NDS32_RELAX_EX9_BUILD_ROUND: + nds32_elf_ex9_finish (link_info); + pass++; + *again = TRUE; + break; + case NDS32_RELAX_EX9_REPLACE_ROUND: + if (table->target_optimize & NDS32_RELAX_IFC_ON) + { + /* Do jump IFC optimization again. */ + if (!nds32_elf_ifc_finish (link_info)) + (*_bfd_error_handler) (_("error: Jump IFC Fail.")); + } + break; + default: + break; + } + } + + return relax_round; +} + +static bfd_boolean +nds32_elf_relax_section (bfd *abfd, asection *sec, + struct bfd_link_info *link_info, bfd_boolean *again) +{ + nds32_elf_blank_t *relax_blank_list = NULL; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irel; + Elf_Internal_Rela *irelend; + Elf_Internal_Sym *isymbuf = NULL; + bfd_byte *contents = NULL; + bfd_boolean result = TRUE; + int optimize = 0; + int opt_size = 0; + uint32_t insn; + uint16_t insn16; + + /* Target dependent option. */ + struct elf_nds32_link_hash_table *table; + int load_store_relax; + int relax_round; + + relax_blank_list = NULL; + *again = FALSE; + + /* Nothing to do for + relocatable link or + non-relocatable section or + non-code section or + empty content or + no reloc entry. */ + if (link_info->relocatable + || (sec->flags & SEC_RELOC) == 0 + || (sec->flags & SEC_EXCLUDE) == 1 + || (sec->flags & SEC_CODE) == 0 + || sec->size == 0 + || sec->reloc_count == 0) + return TRUE; + + /* 09.12.11 Workaround. */ + /* We have to adjust align for R_NDS32_LABEL if needed. + The adjust approach only can fix 2-byte align once. */ + if (sec->alignment_power > 2) + return TRUE; + +#ifdef NDS32_LINUX_TOOLCHAIN + /* Do TLS model conversion once at first. */ + nds32_elf_unify_tls_model (abfd, sec, contents, link_info); +#endif + + /* The optimization type to do. */ + + table = nds32_elf_hash_table (link_info); + relax_round = nds32_elf_pick_relax (TRUE, sec, again, table, link_info); + + switch (relax_round) + { + case NDS32_RELAX_JUMP_IFC_ROUND: + /* Here is the entrance of ifc jump relaxation. */ + if (!nds32_elf_ifc_calc (link_info, abfd, sec)) + return FALSE; + nds32_elf_pick_relax (FALSE, sec, again, table, link_info); + return TRUE; + + case NDS32_RELAX_EX9_BUILD_ROUND: + /* Here is the entrance of ex9 relaxation. There are two pass of + ex9 relaxation. The one is to traverse all instructions and build + the hash table. The other one is to compare instructions and replace + it by ex9.it. */ + if (!nds32_elf_ex9_build_hash_table (abfd, sec, link_info)) + return FALSE; + nds32_elf_pick_relax (FALSE, sec, again, table, link_info); + return TRUE; + + case NDS32_RELAX_EX9_REPLACE_ROUND: + if (!nds32_elf_ex9_replace_instruction (link_info, abfd, sec)) + return FALSE; + return TRUE; + + case NDS32_RELAX_IFC_ROUND: + /* The entrance of link time ifc. We must to do it before all relaxation + beginging, because it may magnify size. */ + if (!nds32_elf_ifc_trace_code (link_info, abfd, sec)) + return FALSE; + nds32_elf_pick_relax (FALSE, sec, again, table, link_info); + return TRUE; + + case NDS32_RELAX_EMPTY_ROUND: + nds32_elf_pick_relax (FALSE, sec, again, table, link_info); + return TRUE; + + case NDS32_RELAX_NORMAL_ROUND: + /* Save the first section for abs symbol relaxation. */ + nds32_elf_relax_guard (NULL, 0, sec, NULL, again, TRUE, + table, NULL, NULL); + default: + if (sec->reloc_count == 0) + return TRUE; + break; + } + + /* The begining of general relaxation. */ + + if (is_SDA_BASE_set == 0) + { + bfd_vma gp; + is_SDA_BASE_set = 1; + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &gp, FALSE); + relax_range_measurement (abfd); + } + + if (is_ITB_BASE_set == 0) + { + /* Set the _ITB_BASE_. */ + if (!nds32_elf_ex9_itb_base (link_info)) + { + (*_bfd_error_handler) (_("%B: error: Cannot set _ITB_BASE_"), abfd); + bfd_set_error (bfd_error_bad_value); + } + } + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + /* Relocations MUST be kept in memory, because relaxation adjust them. */ + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + TRUE /* keep_memory */); + if (internal_relocs == NULL) + goto error_return; + + irelend = internal_relocs + sec->reloc_count; + irel = find_relocs_at_address (internal_relocs, internal_relocs, + irelend, R_NDS32_RELAX_ENTRY); + + if (irel == irelend) + return TRUE; + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY) + { + if (irel->r_addend & R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG) + { + nds32_elf_pick_relax (FALSE, sec, again, table, link_info); + return TRUE; + } + + if (irel->r_addend & R_NDS32_RELAX_ENTRY_OPTIMIZE_FLAG) + optimize = 1; + + if (irel->r_addend & R_NDS32_RELAX_ENTRY_OPTIMIZE_FOR_SPACE_FLAG) + opt_size = 1; + } + + load_store_relax = table->load_store_relax; + + /* Get symbol table and section content. */ + if (!nds32_get_section_contents (abfd, sec, &contents, TRUE) + || !nds32_get_local_syms (abfd, sec, &isymbuf)) + goto error_return; + + /* Do relax loop only when finalize is not done. + Take care of relaxable relocs except INSN16. */ + for (irel = internal_relocs; irel < irelend; irel++) + { + int seq_len; /* Original length of instruction sequence. */ + int insn_len = 0; /* Final length of instruction sequence. */ + bfd_boolean removed; + + insn = 0; + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL + && (irel->r_addend & 0x1f) >= 2) + optimize = 1; + + /* Relocation Types + R_NDS32_LONGCALL1 53 + R_NDS32_LONGCALL2 54 + R_NDS32_LONGCALL3 55 + R_NDS32_LONGJUMP1 56 + R_NDS32_LONGJUMP2 57 + R_NDS32_LONGJUMP3 58 + R_NDS32_LOADSTORE 59 */ + if (ELF32_R_TYPE (irel->r_info) >= R_NDS32_LONGCALL1 + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_LOADSTORE) + seq_len = GET_SEQ_LEN (irel->r_addend); + + /* Relocation Types + R_NDS32_LONGCALL4 107 + R_NDS32_LONGCALL5 108 + R_NDS32_LONGCALL6 109 + R_NDS32_LONGJUMP4 110 + R_NDS32_LONGJUMP5 111 + R_NDS32_LONGJUMP6 112 + R_NDS32_LONGJUMP7 113 */ + else if (ELF32_R_TYPE (irel->r_info) >= R_NDS32_LONGCALL4 + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_LONGJUMP7) + seq_len = 4; + + /* Relocation Types + R_NDS32_LO12S0_RELA 30 + R_NDS32_LO12S1_RELA 29 + R_NDS32_LO12S2_RELA 28 + R_NDS32_LO12S2_SP_RELA 71 + R_NDS32_LO12S2_DP_RELA 70 + R_NDS32_GOT_LO12 46 + R_NDS32_GOTOFF_LO12 50 + R_NDS32_PLTREL_LO12 65 + R_NDS32_PLT_GOTREL_LO12 67 + R_NDS32_17IFC_PCREL_RELA 96 + R_NDS32_GOT_SUFF 193 + R_NDS32_GOTOFF_SUFF 194 + R_NDS32_PLT_GOT_SUFF 195 + R_NDS32_MULCALL_SUFF 196 + R_NDS32_PTR 197 */ + else if ((ELF32_R_TYPE (irel->r_info) <= R_NDS32_LO12S0_RELA + && ELF32_R_TYPE (irel->r_info) >= R_NDS32_LO12S2_RELA) + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_SP_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_DP_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOT_LO12 + || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTOFF_LO12 + || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTPC_LO12 + || ELF32_R_TYPE (irel->r_info) == R_NDS32_PLTREL_LO12 + || ELF32_R_TYPE (irel->r_info) == R_NDS32_PLT_GOTREL_LO12 + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_GOT_SUFF + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_PTR) + || ELF32_R_TYPE (irel->r_info) == R_NDS32_17IFC_PCREL_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_LO12 + || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_ADD + || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_LS) + seq_len = 0; + else + continue; + + insn_len = seq_len; + removed = FALSE; + + switch (ELF32_R_TYPE (irel->r_info)) + { + case R_NDS32_LONGCALL1: + removed = nds32_elf_relax_longcall1 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGCALL2: + removed = nds32_elf_relax_longcall2 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGCALL3: + removed = nds32_elf_relax_longcall3 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGJUMP1: + removed = nds32_elf_relax_longjump1 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGJUMP2: + removed = nds32_elf_relax_longjump2 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGJUMP3: + removed = nds32_elf_relax_longjump3 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGCALL4: + removed = nds32_elf_relax_longcall4 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGCALL5: + removed = nds32_elf_relax_longcall5 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGCALL6: + removed = nds32_elf_relax_longcall6 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGJUMP4: + removed = nds32_elf_relax_longjump4 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGJUMP5: + removed = nds32_elf_relax_longjump5 (abfd, sec, irel, internal_relocs, + &insn_len, &seq_len, contents, + isymbuf, symtab_hdr); + break; + case R_NDS32_LONGJUMP6: + removed = nds32_elf_relax_longjump6 (abfd, sec, irel, internal_relocs, + &insn_len, &seq_len, contents, + isymbuf, symtab_hdr); + break; + case R_NDS32_LONGJUMP7: + removed = nds32_elf_relax_longjump7 (abfd, sec, irel, internal_relocs, + &insn_len, &seq_len, contents, + isymbuf, symtab_hdr); + break; + case R_NDS32_LOADSTORE: + removed = nds32_elf_relax_loadstore (link_info, abfd, sec, irel, + internal_relocs, &insn_len, + contents, isymbuf, symtab_hdr, + load_store_relax, table); + break; + case R_NDS32_LO12S0_RELA: + case R_NDS32_LO12S1_RELA: + case R_NDS32_LO12S2_RELA: + case R_NDS32_LO12S2_DP_RELA: + case R_NDS32_LO12S2_SP_RELA: + /* Relax for low part. */ + nds32_elf_relax_lo12 (link_info, abfd, sec, irel, internal_relocs, + contents, isymbuf, symtab_hdr, table); + + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_GOT_LO12: + case R_NDS32_GOTOFF_LO12: + case R_NDS32_PLTREL_LO12: + case R_NDS32_PLT_GOTREL_LO12: + case R_NDS32_GOTPC_LO12: + /* Relax for PIC gp-relative low part. */ + nds32_elf_relax_piclo12 (link_info, abfd, sec, irel, contents, + isymbuf, symtab_hdr); + + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_TLS_LE_LO12: + /* Relax for LE TLS low part. */ + nds32_elf_relax_letlslo12 (link_info, abfd, irel, contents, + isymbuf, symtab_hdr); + + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_TLS_LE_ADD: + nds32_elf_relax_letlsadd (link_info, abfd, sec, irel, internal_relocs, + contents, isymbuf, symtab_hdr, again); + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_TLS_LE_LS: + nds32_elf_relax_letlsls (link_info, abfd, sec, irel, internal_relocs, + contents, isymbuf, symtab_hdr, again); + continue; + case R_NDS32_PTR: + removed = nds32_elf_relax_ptr (abfd, sec, irel, internal_relocs, + &insn_len, &seq_len, contents); + break; + case R_NDS32_PLT_GOT_SUFF: + nds32_elf_relax_pltgot_suff (link_info, abfd, sec, irel, + internal_relocs, contents, + isymbuf, symtab_hdr, again); + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_GOT_SUFF: + nds32_elf_relax_got_suff (link_info, abfd, sec, irel, + internal_relocs, contents, + symtab_hdr, again); + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_GOTOFF_SUFF: + nds32_elf_relax_gotoff_suff (link_info, abfd, sec, irel, + internal_relocs, contents, + isymbuf, symtab_hdr, again); + /* It is impossible to delete blank, so just continue. */ + continue; + default: + continue; + + } + if (removed && seq_len - insn_len > 0) + { + if (!insert_nds32_elf_blank + (&relax_blank_list, irel->r_offset + insn_len, + seq_len - insn_len)) + goto error_return; + *again = TRUE; + } + } + + calc_nds32_blank_total (relax_blank_list); + + if (table->relax_fp_as_gp) + { + if (!nds32_relax_fp_as_gp (link_info, abfd, sec, internal_relocs, + irelend, isymbuf)) + goto error_return; + + if (*again == FALSE) + { + if (!nds32_fag_remove_unused_fpbase (abfd, sec, internal_relocs, + irelend)) + goto error_return; + } + } + + nds32_elf_pick_relax (FALSE, sec, again, table, link_info); + + if (*again == FALSE) + { + if (!nds32_relax_adjust_label (abfd, sec, internal_relocs, contents, + &relax_blank_list, optimize, opt_size)) + goto error_return; + } + + /* It doesn't matter optimize_for_space_no_align anymore. + If object file is assembled with flag '-Os', + the we don't adjust jump-destination on 4-byte boundary. */ + + if (relax_blank_list) + { + nds32_elf_relax_delete_blanks (abfd, sec, relax_blank_list); + relax_blank_list = NULL; + } + + if (*again == FALSE) + { + /* Closing the section, so we don't relax it anymore. */ + bfd_vma sec_size_align; + Elf_Internal_Rela *tmp_rel; + + /* Pad to alignment boundary. Only handle current section alignment. */ + sec_size_align = (sec->size + (~((bfd_vma)(-1) << sec->alignment_power))) + & ((bfd_vma)(-1) << sec->alignment_power); + if ((sec_size_align - sec->size) & 0x2) + { + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + sec->size); + sec->size += 2; + } + + while (sec_size_align != sec->size) + { + insn = NDS32_NOP32; + bfd_putb32 (insn, contents + sec->size); + sec->size += 4; + } + + tmp_rel = find_relocs_at_address (internal_relocs, internal_relocs, + irelend, R_NDS32_RELAX_ENTRY); + if (tmp_rel != irelend) + tmp_rel->r_addend |= R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG; + + clean_nds32_elf_blank (); + } + +finish: + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + + if (isymbuf != NULL && symtab_hdr->contents != (bfd_byte *) isymbuf) + free (isymbuf); + + return result; + +error_return: + result = FALSE; + goto finish; +} + +static struct bfd_elf_special_section const nds32_elf_special_sections[] = { + {".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE}, + {".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE}, + {NULL, 0, 0, 0, 0} +}; + +static bfd_boolean +nds32_elf_output_arch_syms (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info, + void *finfo ATTRIBUTE_UNUSED, + bfd_boolean (*func) (void *, const char *, + Elf_Internal_Sym *, + asection *, + struct elf_link_hash_entry *) + ATTRIBUTE_UNUSED) +{ + FILE *sym_ld_script = NULL; + struct elf_nds32_link_hash_table *table; + + table = nds32_elf_hash_table (info); + sym_ld_script = table->sym_ld_script; + + if (check_start_export_sym) + fprintf (sym_ld_script, "}\n"); + + return TRUE; +} + +static enum elf_reloc_type_class +nds32_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, + const asection *rel_sec ATTRIBUTE_UNUSED, + const Elf_Internal_Rela *rela) +{ + switch ((int) ELF32_R_TYPE (rela->r_info)) + { + case R_NDS32_RELATIVE: + return reloc_class_relative; + case R_NDS32_JMP_SLOT: + return reloc_class_plt; + case R_NDS32_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + +/* Put target dependent option into info hash table. */ +void +bfd_elf32_nds32_set_target_option (struct bfd_link_info *link_info, + int relax_fp_as_gp, + int eliminate_gc_relocs, + FILE * sym_ld_script, int load_store_relax, + int target_optimize, int relax_status, + int relax_round, FILE * ex9_export_file, + FILE * ex9_import_file, + int update_ex9_table, int ex9_limit, + bfd_boolean ex9_loop_aware, + bfd_boolean ifc_loop_aware, + int hyper_relax) +{ + struct elf_nds32_link_hash_table *table; + + /* Initialize indirect call hash table. */ + nds32_elf_ict_hash_init (); + + table = nds32_elf_hash_table (link_info); + if (table == NULL) + return; + + table->relax_fp_as_gp = relax_fp_as_gp; + table->eliminate_gc_relocs = eliminate_gc_relocs; + table->sym_ld_script = sym_ld_script; + table ->load_store_relax = load_store_relax; + table->target_optimize = target_optimize; + table->relax_status = relax_status; + table->relax_round = relax_round; + table->ex9_export_file = ex9_export_file; + table->ex9_import_file = ex9_import_file; + table->update_ex9_table = update_ex9_table; + table->ex9_limit = ex9_limit; + table->ex9_loop_aware = ex9_loop_aware; + table->ifc_loop_aware = ifc_loop_aware; + table->hyper_relax = hyper_relax; + + /* We have to do ifc optimization before general relax. */ + if (target_optimize & NDS32_RELAX_IFC_ON) + { + /* Initialize ifc hash table. */ + if (!nds32_elf_ifc_init ()) + return; + } + if (target_optimize & NDS32_RELAX_EX9_ON + || (ex9_import_file != NULL && update_ex9_table == 1)) + { + /* Initialize ex9 hash table. */ + if (!nds32_elf_ex9_init ()) + return; + } +} + +void +bfd_elf32_nds32_append_section (struct bfd_link_info *link_info, + bfd *abfd, int target_optimize) +{ + asection *itable; + struct bfd_link_hash_entry *h; + unsigned int i, count = 0; + + /* Insert section ".ex9.itable". */ + if (target_optimize & NDS32_RELAX_EX9_ON) + { + itable = bfd_make_section_with_flags (abfd, ".ex9.itable", + SEC_CODE | SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS | SEC_READONLY + | SEC_IN_MEMORY | SEC_KEEP + | SEC_RELOC); + if (itable) + { + itable->gc_mark = 1; + itable->alignment_power = 2; + itable->size = 0x1000; + itable->contents = bfd_zalloc (abfd, itable->size); + + /* Add a symbol in the head of ex9.itable to objdump clearly. */ + h = bfd_link_hash_lookup (link_info->hash, "_EX9_BASE_", + FALSE, FALSE, FALSE); + _bfd_generic_link_add_one_symbol + (link_info, link_info->output_bfd, "_EX9_BASE_", + BSF_GLOBAL | BSF_WEAK, itable, 0, (const char *) NULL, FALSE, + get_elf_backend_data (link_info->output_bfd)->collect, &h); + } + } + + /* Count number of indirect call function. */ + indirect_call_table.frozen = 1; + for (i = 0; i < indirect_call_table.size; i++) + { + struct bfd_hash_entry *p; + struct elf_nds32_ict_hash_entry *entry; + + for (p = indirect_call_table.table[i]; p != NULL; p = p->next) + { + entry = (struct elf_nds32_ict_hash_entry *) p; + entry->order = count; + count++; + } + } + indirect_call_table.frozen = 0; + + if (count) + { + h = bfd_link_hash_lookup (link_info->hash, "_INDIRECT_CALL_TABLE_BASE_", + FALSE, FALSE, FALSE); + if (h && (h->type == bfd_link_hash_defined + || h->type == bfd_link_hash_defweak + || h->type == bfd_link_hash_common)) + { + (*_bfd_error_handler) (_("Warning: _INDIRECT_CALL_TABLE_BASE_ has already" + "be defined. All ICT suffix is ignored.")); + ignore_indirect_call = TRUE; + return; + } + + itable = bfd_make_section_with_flags (abfd, NDS32_ICT_SECTION, + SEC_CODE | SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS | SEC_READONLY + | SEC_IN_MEMORY | SEC_KEEP + | SEC_RELOC); + if (itable) + { + itable->gc_mark = 1; + itable->alignment_power = 2; + itable->size = count * 4; + itable->contents = bfd_zalloc (abfd, itable->size); + + /* Add a symbol in the head of .nds32.ict to objdump clearly. */ + h = bfd_link_hash_lookup (link_info->hash, + "_INDIRECT_CALL_TABLE_BASE_", + FALSE, FALSE, FALSE); + _bfd_generic_link_add_one_symbol + (link_info, link_info->output_bfd, "_INDIRECT_CALL_TABLE_BASE_", + BSF_GLOBAL | BSF_WEAK, itable, 0, (const char *) NULL, FALSE, + get_elf_backend_data (link_info->output_bfd)->collect, &h); + } + + ict_file = fopen ("nds32_ict.s", FOPEN_WT); + if(ict_file == NULL) + (*_bfd_error_handler) (_("Warning: Fail to build nds32_ict.s.")); + } +} + +/* These functions and data-structures are used for fp-as-gp + optimization. */ + +#define FAG_THRESHOLD 3 /* At least 3 gp-access. */ +/* lwi37.fp covers 508 bytes, but there may be 32-byte padding between + the read-only section and read-write section. */ +#define FAG_WINDOW (508 - 32) + +/* An nds32_fag represent a gp-relative access. + We find best fp-base by using a sliding window + to find a base address which can cover most gp-access. */ +struct nds32_fag +{ + struct nds32_fag *next; /* NULL-teminated linked list. */ + bfd_vma addr; /* The address of this fag. */ + Elf_Internal_Rela **relas; /* The relocations associated with this fag. + It is used for applying FP7U2_FLAG. */ + int count; /* How many times this address is referred. + There should be exactly `count' relocations + in relas. */ + int relas_capcity; /* The buffer size of relas. + We use an array instead of linked-list, + and realloc is used to adjust buffer size. */ +}; + +static void +nds32_fag_init (struct nds32_fag *head) +{ + memset (head, 0, sizeof (struct nds32_fag)); +} + +static void +nds32_fag_verify (struct nds32_fag *head) +{ + struct nds32_fag *iter; + struct nds32_fag *prev; + + prev = NULL; + iter = head->next; + while (iter) + { + if (prev && prev->addr >= iter->addr) + puts ("Bug in fp-as-gp insertion."); + prev = iter; + iter = iter->next; + } +} + +/* Insert a fag in ascending order. + If a fag of the same address already exists, + they are chained by relas array. */ + +static void +nds32_fag_insert (struct nds32_fag *head, bfd_vma addr, + Elf_Internal_Rela * rel) +{ + struct nds32_fag *iter; + struct nds32_fag *new_fag; + const int INIT_RELAS_CAP = 4; + + for (iter = head; + iter->next && iter->next->addr <= addr; + iter = iter->next) + /* Find somewhere to insert. */ ; + + /* `iter' will be equal to `head' if the list is empty. */ + if (iter != head && iter->addr == addr) + { + /* The address exists in the list. + Insert `rel' into relocation list, relas. */ + + /* Check whether relas is big enough. */ + if (iter->count >= iter->relas_capcity) + { + iter->relas_capcity *= 2; + iter->relas = bfd_realloc + (iter->relas, iter->relas_capcity * sizeof (void *)); + } + iter->relas[iter->count++] = rel; + return; + } + + /* This is a new address. Create a fag node for it. */ + new_fag = bfd_malloc (sizeof (struct nds32_fag)); + memset (new_fag, 0, sizeof (*new_fag)); + new_fag->addr = addr; + new_fag->count = 1; + new_fag->next = iter->next; + new_fag->relas_capcity = INIT_RELAS_CAP; + new_fag->relas = (Elf_Internal_Rela **) + bfd_malloc (new_fag->relas_capcity * sizeof (void *)); + new_fag->relas[0] = rel; + iter->next = new_fag; + + nds32_fag_verify (head); +} + +static void +nds32_fag_free_list (struct nds32_fag *head) +{ + struct nds32_fag *iter; + + iter = head->next; + while (iter) + { + struct nds32_fag *tmp = iter; + iter = iter->next; + free (tmp->relas); + tmp->relas = NULL; + free (tmp); + } +} + +/* Find the best fp-base address. + The relocation associated with that address is returned, + so we can track the symbol instead of a fixed address. + + When relaxation, the address of an datum may change, + because a text section is shrinked, so the data section + moves forward. If the aligments of text and data section + are different, their distance may change too. + Therefore, tracking a fixed address is not appriate. */ + +static int +nds32_fag_find_base (struct nds32_fag *head, struct nds32_fag **bestpp) +{ + struct nds32_fag *base; /* First fag in the window. */ + struct nds32_fag *last; /* First fag outside the window. */ + int accu = 0; /* Usage accumulation. */ + struct nds32_fag *best; /* Best fag. */ + int baccu = 0; /* Best accumulation. */ + + /* Use first fag for initial, and find the last fag in the window. + + In each iteration, we could simply subtract previous fag + and accumulate following fags which are inside the window, + untill we each the end. */ + + if (head->next == NULL) + { + *bestpp = NULL; + return 0; + } + + /* Initialize base. */ + base = head->next; + best = base; + for (last = base; + last && last->addr < base->addr + FAG_WINDOW; + last = last->next) + accu += last->count; + + baccu = accu; + + /* Record the best base in each iteration. */ + while (base->next) + { + accu -= base->count; + base = base->next; + /* Account fags in window. */ + for (/* Nothing. */; + last && last->addr < base->addr + FAG_WINDOW; + last = last->next) + accu += last->count; + + /* A better fp-base? */ + if (accu > baccu) + { + best = base; + baccu = accu; + } + } + + if (bestpp) + *bestpp = best; + return baccu; +} + +/* Apply R_NDS32_INSN16_FP7U2_FLAG on gp-relative accesses, + so we can convert it fo fp-relative access later. + `best_fag' is the best fp-base. Only those inside the window + of best_fag is applied the flag. */ + +static bfd_boolean +nds32_fag_mark_relax (struct bfd_link_info *link_info, + asection *sec, struct nds32_fag *best_fag, + Elf_Internal_Rela *internal_relocs, + Elf_Internal_Rela *irelend) +{ + struct nds32_fag *ifag; + bfd_vma best_fpbase, gp; + bfd *output_bfd; + + output_bfd = sec->output_section->owner; + nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE); + best_fpbase = best_fag->addr; + + if (best_fpbase > gp + sdata_range[1][1] + || best_fpbase < gp - sdata_range[1][0]) + return FALSE; + + /* Mark these inside the window R_NDS32_INSN16_FP7U2_FLAG flag, + so we know they can be converted to lwi37.fp. */ + for (ifag = best_fag; + ifag && ifag->addr < best_fpbase + FAG_WINDOW; ifag = ifag->next) + { + int i; + + for (i = 0; i < ifag->count; i++) + { + Elf_Internal_Rela *insn16_rel; + Elf_Internal_Rela *fag_rel; + + fag_rel = ifag->relas[i]; + + /* Only if this is within the WINDOWS, FP7U2_FLAG + is applied. */ + + insn16_rel = find_relocs_at_address + (fag_rel, internal_relocs, irelend, R_NDS32_INSN16); + + if (insn16_rel != irelend) + insn16_rel->r_addend = R_NDS32_INSN16_FP7U2_FLAG; + } + } + return TRUE; +} + +/* Reset INSN16 to clean fp as gp. */ + +static void +nds32_fag_unmark_relax (struct nds32_fag *fag, + Elf_Internal_Rela *internal_relocs, + Elf_Internal_Rela *irelend) +{ + struct nds32_fag *ifag; + int i; + Elf_Internal_Rela *insn16_rel; + Elf_Internal_Rela *fag_rel; + + for (ifag = fag; ifag; ifag = ifag->next) + { + for (i = 0; i < ifag->count; i++) + { + fag_rel = ifag->relas[i]; + + /* Restore the INSN16 relocation. */ + insn16_rel = find_relocs_at_address + (fag_rel, internal_relocs, irelend, R_NDS32_INSN16); + + if (insn16_rel != irelend) + insn16_rel->r_addend &= ~R_NDS32_INSN16_FP7U2_FLAG; + } + } +} + +/* This is the main function of fp-as-gp optimization. + It should be called by relax_section. */ + +static bfd_boolean +nds32_relax_fp_as_gp (struct bfd_link_info *link_info, + bfd *abfd, asection *sec, + Elf_Internal_Rela *internal_relocs, + Elf_Internal_Rela *irelend, + Elf_Internal_Sym *isymbuf) +{ + Elf_Internal_Rela *begin_rel = NULL; + Elf_Internal_Rela *irel; + struct nds32_fag fag_head; + Elf_Internal_Shdr *symtab_hdr; + bfd_byte *contents; + bfd_boolean ifc_inside = FALSE; + + /* FIXME: Can we bfd_elf_link_read_relocs for the relocs? */ + + /* Per-function fp-base selection. + 1. Create a list for all the gp-relative access. + 2. Base on those gp-relative address, + find a fp-base which can cover most access. + 3. Use the fp-base for fp-as-gp relaxation. + + NOTE: If fp-as-gp is not worth to do, (e.g., less than 3 times), + we should + 1. delete the `la $fp, _FP_BASE_' instruction and + 2. not convert lwi.gp to lwi37.fp. + + To delete the _FP_BASE_ instruction, we simply apply + R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG flag in the r_addend to disable it. + + To suppress the conversion, we simply NOT to apply + R_NDS32_INSN16_FP7U2_FLAG flag. */ + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + if (!nds32_get_section_contents (abfd, sec, &contents, TRUE) + || !nds32_get_local_syms (abfd, sec, &isymbuf)) + return FALSE; + + /* Check whether it is worth for fp-as-gp optimization, + i.e., at least 3 gp-load. + + Set R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG if we should NOT + apply this optimization. */ + + for (irel = internal_relocs; irel < irelend; irel++) + { + /* We recognize R_NDS32_RELAX_REGION_BEGIN/_END for the region. + One we enter the begin of the region, we track all the LW/ST + instructions, so when we leave the region, we try to find + the best fp-base address for those LW/ST instructions. */ + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN + && (irel->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG)) + { + /* Begin of the region. */ + if (begin_rel) + (*_bfd_error_handler) (_("%B: Nested OMIT_FP in %A."), abfd, sec); + + begin_rel = irel; + nds32_fag_init (&fag_head); + ifc_inside = FALSE; + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END + && (irel->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG)) + { + int accu; + struct nds32_fag *best_fag, *tmp_fag; + int dist; + + /* End of the region. + Check whether it is worth to do fp-as-gp. */ + + if (begin_rel == NULL) + { + (*_bfd_error_handler) (_("%B: Unmatched OMIT_FP in %A."), abfd, sec); + continue; + } + + accu = nds32_fag_find_base (&fag_head, &best_fag); + + /* Clean FP7U2_FLAG because they may set ever. */ + tmp_fag = fag_head.next; + nds32_fag_unmark_relax (tmp_fag, internal_relocs, irelend); + + /* Check if it is worth, and FP_BASE is near enough to SDA_BASE. */ + if (accu < FAG_THRESHOLD + || !nds32_fag_mark_relax (link_info, sec, best_fag, + internal_relocs, irelend)) + { + /* Not worth to do fp-as-gp. */ + begin_rel->r_addend |= R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG; + begin_rel->r_addend &= ~R_NDS32_RELAX_REGION_OMIT_FP_FLAG; + irel->r_addend |= R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG; + irel->r_addend &= ~R_NDS32_RELAX_REGION_OMIT_FP_FLAG; + nds32_fag_free_list (&fag_head); + begin_rel = NULL; + continue; + } + + /* R_SYM of R_NDS32_RELAX_REGION_BEGIN is not used by assembler, + so we use it to record the distance to the reloction of best + fp-base. */ + dist = best_fag->relas[0] - begin_rel; + BFD_ASSERT (dist > 0 && dist < 0xffffff); + /* Use high 16 bits of addend to record the _FP_BASE_ matched + relocation. And get the base value when relocating. */ + begin_rel->r_addend &= (0x1 << 16) - 1; + begin_rel->r_addend |= dist << 16; + + nds32_fag_free_list (&fag_head); + begin_rel = NULL; + } + + if (begin_rel == NULL || ifc_inside) + /* Skip if we are not in the region of fp-as-gp. */ + continue; + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_SDA15S2_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_SDA17S2_RELA) + { + bfd_vma addr; + uint32_t insn; + + /* A gp-relative access is found. Insert it to the fag-list. */ + + /* Rt is necessary an RT3, so it can be converted to lwi37.fp. */ + insn = bfd_getb32 (contents + irel->r_offset); + if (!N32_IS_RT3 (insn)) + continue; + + addr = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + nds32_fag_insert (&fag_head, addr, irel); + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_SDA_FP7U2_RELA) + { + begin_rel = NULL; + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_17IFC_PCREL_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_10IFCU_PCREL_RELA) + { + /* Suppress fp as gp when encounter ifc. */ + ifc_inside = TRUE; + } + } + + return TRUE; +} + +/* Remove unused `la $fp, _FD_BASE_' instruction. */ + +static bfd_boolean +nds32_fag_remove_unused_fpbase (bfd *abfd, asection *sec, + Elf_Internal_Rela *internal_relocs, + Elf_Internal_Rela *irelend) +{ + Elf_Internal_Rela *irel; + Elf_Internal_Shdr *symtab_hdr; + bfd_byte *contents = NULL; + nds32_elf_blank_t *relax_blank_list = NULL; + bfd_boolean result = TRUE; + bfd_boolean unused_region = FALSE; + + /* + NOTE: Disable fp-as-gp if we encounter ifcall relocations. + * R_NDS32_17IFC_PCREL_RELA + * R_NDS32_10IFCU_PCREL_RELA + + CASE?????????????? + */ + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + nds32_get_section_contents (abfd, sec, &contents, TRUE); + + for (irel = internal_relocs; irel < irelend; irel++) + { + /* To remove unused fp-base, we simply find the REGION_NOT_OMIT_FP + we marked to in previous pass. + DO NOT scan relocations again, since we've alreadly decided it + and set the flag. */ + const char *syname; + int syndx; + uint32_t insn; + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN + && (irel->r_addend & R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG)) + unused_region = TRUE; + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END + && (irel->r_addend & R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG)) + unused_region = FALSE; + + /* We're not in the region. */ + if (!unused_region) + continue; + + /* _FP_BASE_ must be a GLOBAL symbol. */ + syndx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + continue; + + /* The symbol name must be _FP_BASE_. */ + syname = elf_sym_hashes (abfd)[syndx]->root.root.string; + if (strcmp (syname, FP_BASE_NAME) != 0) + continue; + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_SDA19S0_RELA) + { + /* addi.gp $fp, -256 */ + insn = bfd_getb32 (contents + irel->r_offset); + if (insn != INSN_ADDIGP_TO_FP) + continue; + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_SDA15S0_RELA) + { + /* addi $fp, $gp, -256 */ + insn = bfd_getb32 (contents + irel->r_offset); + if (insn != INSN_ADDI_GP_TO_FP) + continue; + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_20_RELA) + { + /* movi $fp, FP_BASE */ + insn = bfd_getb32 (contents + irel->r_offset); + if (insn != INSN_MOVI_TO_FP) + continue; + } + else + continue; + + /* We got here because a FP_BASE instruction is found. */ + if (!insert_nds32_elf_blank_recalc_total + (&relax_blank_list, irel->r_offset, 4)) + goto error_return; + } + +finish: + if (relax_blank_list) + { + nds32_elf_relax_delete_blanks (abfd, sec, relax_blank_list); + relax_blank_list = NULL; + } + return result; + +error_return: + result = FALSE; + goto finish; +} + +/* This is a version of bfd_generic_get_relocated_section_contents. + We need this variety because relaxation will modify the dwarf + infomation. When there is undefined symbol reference error mesage, + linker need to dump line number where the symbol be used. However + the address is be relaxed, it can not get the original dwarf contents. + The variety only modify function call for reading in the section. */ + +static bfd_byte * +nds32_elf_get_relocated_section_contents (bfd *abfd, + struct bfd_link_info *link_info, + struct bfd_link_order *link_order, + bfd_byte *data, + bfd_boolean relocatable, + asymbol **symbols) +{ + bfd *input_bfd = link_order->u.indirect.section->owner; + asection *input_section = link_order->u.indirect.section; + long reloc_size; + arelent **reloc_vector; + long reloc_count; + + reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section); + if (reloc_size < 0) + return NULL; + + /* Read in the section. */ + if (!nds32_get_section_contents (input_bfd, input_section, &data, FALSE)) + return NULL; + + if (reloc_size == 0) + return data; + + reloc_vector = (arelent **) bfd_malloc (reloc_size); + if (reloc_vector == NULL) + return NULL; + + 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 (parent = reloc_vector; *parent != NULL; parent++) + { + char *error_message = NULL; + asymbol *symbol; + bfd_reloc_status_type r; + + symbol = *(*parent)->sym_ptr_ptr; + if (symbol->section && discarded_section (symbol->section)) + { + bfd_byte *p; + static reloc_howto_type none_howto + = HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, + "unused", FALSE, 0, 0, FALSE); + + p = data + (*parent)->address * bfd_octets_per_byte (input_bfd); + _bfd_clear_contents ((*parent)->howto, input_bfd, input_section, + p); + (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; + (*parent)->addend = 0; + (*parent)->howto = &none_howto; + r = bfd_reloc_ok; + } + else + r = bfd_perform_relocation (input_bfd, *parent, data, + input_section, + relocatable ? abfd : NULL, + &error_message); + + if (relocatable) + { + 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 != 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, NULL, + 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: + /* PR ld/13730: + This error can result when processing some partially + complete binaries. Do not abort, but issue an error + message instead. */ + link_info->callbacks->einfo + (_("%X%P: %B(%A): relocation \"%R\" goes out of range\n"), + abfd, input_section, * parent); + goto error_return; + + default: + abort (); + break; + } + } + } + } + + free (reloc_vector); + return data; + +error_return: + free (reloc_vector); + return NULL; +} + +/* Check target symbol. */ + +static bfd_boolean +nds32_elf_is_target_special_symbol (bfd *abfd ATTRIBUTE_UNUSED, asymbol *sym) +{ + if (!sym || !sym->name || sym->name[0] != '$') + return FALSE; + return TRUE; +} + +/* nds32 find maybe function sym. Ignore target special symbol + first, and then go the general function. */ + +static bfd_size_type +nds32_elf_maybe_function_sym (const asymbol *sym, asection *sec, + bfd_vma *code_off) +{ + if (nds32_elf_is_target_special_symbol (NULL, (asymbol *) sym)) + return 0; + + return _bfd_elf_maybe_function_sym (sym, sec, code_off); +} + + +/* Link-time IFC relaxation. + In this optimization, we chains jump instructions + of the same destination with ifcall. */ + + +/* List to save jal and j relocation. */ +struct elf_nds32_ifc_symbol_entry +{ + asection *sec; + struct elf_link_hash_entry *h; + struct elf_nds32_ifc_irel_list *irel_head; + unsigned long insn; + int times; + int enable; /* Apply ifc. */ + int ex9_enable; /* Apply ifc after ex9. */ + struct elf_nds32_ifc_symbol_entry *next; +}; + +struct elf_nds32_ifc_irel_list +{ + Elf_Internal_Rela *irel; + asection *sec; + bfd_vma addr; + /* If this is set, then it is the last instruction for + ifc-chain, so it must be keep for the actual branching. */ + int keep; + struct elf_nds32_ifc_irel_list *next; +}; + +static struct elf_nds32_ifc_symbol_entry *ifc_symbol_head = NULL; + +/* Insert symbol of jal and j for ifc. */ + +static void +nds32_elf_ifc_insert_symbol (asection *sec, + struct elf_link_hash_entry *h, + Elf_Internal_Rela *irel, + unsigned long insn) +{ + struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head; + + /* Check there is target of existing entry the same as the new one. */ + while (ptr != NULL) + { + if (((h == NULL && ptr->sec == sec + && ELF32_R_SYM (ptr->irel_head->irel->r_info) == ELF32_R_SYM (irel->r_info) + && ptr->irel_head->irel->r_addend == irel->r_addend) + || h != NULL) + && ptr->h == h + && ptr->insn == insn) + { + /* The same target exist, so insert into list. */ + struct elf_nds32_ifc_irel_list *irel_list = ptr->irel_head; + + while (irel_list->next != NULL) + irel_list = irel_list->next; + irel_list->next = bfd_malloc (sizeof (struct elf_nds32_ifc_irel_list)); + irel_list = irel_list->next; + irel_list->irel = irel; + irel_list->keep = 1; + + if (h == NULL) + irel_list->sec = NULL; + else + irel_list->sec = sec; + irel_list->next = NULL; + return; + } + if (ptr->next == NULL) + break; + ptr = ptr->next; + } + + /* There is no same target entry, so build a new one. */ + if (ifc_symbol_head == NULL) + { + ifc_symbol_head = bfd_malloc (sizeof (struct elf_nds32_ifc_symbol_entry)); + ptr = ifc_symbol_head; + } + else + { + ptr->next = bfd_malloc (sizeof (struct elf_nds32_ifc_symbol_entry)); + ptr = ptr->next; + } + + ptr->h = h; + ptr->irel_head = bfd_malloc (sizeof (struct elf_nds32_ifc_irel_list)); + ptr->irel_head->irel = irel; + ptr->insn = insn; + ptr->irel_head->keep = 1; + + if (h == NULL) + { + /* Local symbols. */ + ptr->sec = sec; + ptr->irel_head->sec = NULL; + } + else + { + /* Global symbol. */ + ptr->sec = NULL; + ptr->irel_head->sec = sec; + } + + ptr->irel_head->next = NULL; + ptr->times = 0; + ptr->enable = 0; + ptr->ex9_enable = 0; + ptr->next = NULL; +} + +/* Check if ignoring ifc. */ + +static bfd_boolean +nds32_elf_ifc_check_region (Elf_Internal_Rela **irel, + Elf_Internal_Rela *irelend, + struct bfd_link_info *info) +{ + struct elf_nds32_link_hash_table *table; + int nest = 0; + bfd_boolean ifc_loop_aware; + bfd_boolean security = FALSE; + + table = nds32_elf_hash_table (info); + ifc_loop_aware = table->ifc_loop_aware; + + if ((ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_RELAX_REGION_BEGIN + && ((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_IFC_FLAG + || (ifc_loop_aware == 1 + && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG)) + || (*irel)->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG)) + || (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_SECURITY_16)) + { + /* Check the region if loop, no_ifc, or security. If it is true, + ignore the region till region end. */ + if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_SECURITY_16) + security = TRUE; + else + nest++; + + (*irel)++; + while ((*irel) != NULL && (*irel) < irelend) + { + if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_RELAX_REGION_BEGIN + && ((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_IFC_FLAG + || (ifc_loop_aware == 1 + && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG)) + || (*irel)->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG)) + nest++; + + else if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_SECURITY_16 + && (*irel)->r_addend != NDS32_SECURITY_END) + security = TRUE; + + if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_RELAX_REGION_END + && ((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_IFC_FLAG + || (ifc_loop_aware == 1 + && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG)) + || (*irel)->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG)) + { + if (nest > 0) + nest--; + } + else if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_SECURITY_16 + && (*irel)->r_addend == NDS32_SECURITY_END) + security = FALSE; + + if (nest <= 0 && !security) + break; + + (*irel)++; + } + return TRUE; + } + + return FALSE; +} + +/* Gather all jal and j instructions. */ + +static bfd_boolean +nds32_elf_ifc_calc (struct bfd_link_info *info, + bfd *abfd, asection *sec) +{ + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irelend; + Elf_Internal_Rela *irel; + Elf_Internal_Shdr *symtab_hdr; + bfd_byte *contents = NULL; + uint32_t insn, insn_with_reg; + unsigned long r_symndx; + struct elf_link_hash_entry *h; + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd); + + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + TRUE /* keep_memory */); + irelend = internal_relocs + sec->reloc_count; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + /* Check if the object enable ifc. */ + irel = find_relocs_at_address (internal_relocs, internal_relocs, irelend, + R_NDS32_RELAX_ENTRY); + + if (irel == NULL + || irel >= irelend + || ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY + || (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY + && !(irel->r_addend & R_NDS32_RELAX_ENTRY_IFC_FLAG))) + return TRUE; + + if (!nds32_get_section_contents (abfd, sec, &contents, TRUE)) + return FALSE; + + while (irel != NULL && irel < irelend) + { + /* Traverse all relocation and gather all of them to build the list. */ + + if (nds32_elf_ifc_check_region (&irel, irelend, info)) + if (irel == NULL || irel >= irelend) + return TRUE; + + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA) + { + insn = bfd_getb32 (contents + irel->r_offset); + nds32_elf_get_insn_with_reg (irel, insn, &insn_with_reg); + r_symndx = ELF32_R_SYM (irel->r_info); + if (r_symndx < symtab_hdr->sh_info) + { + /* Local symbol. */ + nds32_elf_ifc_insert_symbol (sec, NULL, irel, insn_with_reg); + } + else + { + /* External symbol. */ + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + nds32_elf_ifc_insert_symbol (sec, h, irel, insn_with_reg); + } + } + irel++; + } + return TRUE; +} + +/* Determine whether j and jal should be substituted. */ + +static void +nds32_elf_ifc_filter (struct bfd_link_info *info) +{ + struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head; + struct elf_nds32_ifc_irel_list *irel_ptr = NULL; + struct elf_nds32_ifc_irel_list *irel_keeper = NULL; + struct elf_nds32_link_hash_table *table; + int target_optimize; + bfd_vma address; + + table = nds32_elf_hash_table (info); + target_optimize = table->target_optimize; + while (ptr) + { + irel_ptr = ptr->irel_head; + if (ptr->h == NULL) + { + /* Local symbol. */ + irel_keeper = irel_ptr; + while (irel_ptr && irel_ptr->next) + { + /* Check there is jump target can be used. */ + if ((irel_ptr->next->irel->r_offset + - irel_keeper->irel->r_offset) > 1022) + irel_keeper = irel_ptr->next; + else + { + ptr->enable = 1; + irel_ptr->keep = 0; + } + irel_ptr = irel_ptr->next; + } + } + else + { + /* Global symbol. */ + /* We have to get the absolute address and decide + whether to keep it or not.*/ + while (irel_ptr) + { + address = (irel_ptr->irel->r_offset + + irel_ptr->sec->output_section->vma + + irel_ptr->sec->output_offset); + irel_ptr->addr = address; + irel_ptr = irel_ptr->next; + } + + irel_ptr = ptr->irel_head; + while (irel_ptr) + { + /* Sort by address. */ + struct elf_nds32_ifc_irel_list *irel_dest = irel_ptr; + struct elf_nds32_ifc_irel_list *irel_temp = irel_ptr; + struct elf_nds32_ifc_irel_list *irel_ptr_prev = NULL; + struct elf_nds32_ifc_irel_list *irel_dest_prev = NULL; + + /* Get the smallest one. */ + while (irel_temp->next) + { + if (irel_temp->next->addr < irel_dest->addr) + { + irel_dest_prev = irel_temp; + irel_dest = irel_temp->next; + } + irel_temp = irel_temp->next; + } + + if (irel_dest != irel_ptr) + { + if (irel_ptr_prev) + irel_ptr_prev->next = irel_dest; + if (irel_dest_prev) + irel_dest_prev->next = irel_ptr; + irel_temp = irel_ptr->next; + irel_ptr->next = irel_dest->next; + irel_dest->next = irel_temp; + } + irel_ptr_prev = irel_ptr; + irel_ptr = irel_ptr->next; + } + + irel_ptr = ptr->irel_head; + irel_keeper = irel_ptr; + while (irel_ptr && irel_ptr->next) + { + if ((irel_ptr->next->addr - irel_keeper->addr) > 1022) + irel_keeper = irel_ptr->next; + else + { + ptr->enable = 1; + irel_ptr->keep = 0; + } + irel_ptr = irel_ptr->next; + } + } + + /* Ex9 enable. Reserve it for ex9. */ + if ((target_optimize & NDS32_RELAX_EX9_ON) + && ptr->irel_head != irel_keeper) + ptr->enable = 0; + ptr = ptr->next; + } +} + +/* Determine whether j and jal should be substituted after ex9 done. */ + +static void +nds32_elf_ifc_filter_after_ex9 (void) +{ + struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head; + struct elf_nds32_ifc_irel_list *irel_ptr = NULL; + + while (ptr) + { + if (ptr->enable == 0) + { + /* Check whether ifc is applied or not. */ + irel_ptr = ptr->irel_head; + ptr->ex9_enable = 1; + while (irel_ptr) + { + if (ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_TRAN) + { + /* Ex9 already. */ + ptr->ex9_enable = 0; + break; + } + irel_ptr = irel_ptr->next; + } + } + ptr = ptr->next; + } +} + +/* Wrapper to do ifc relaxation. */ + +bfd_boolean +nds32_elf_ifc_finish (struct bfd_link_info *info) +{ + int relax_status; + struct elf_nds32_link_hash_table *table; + + table = nds32_elf_hash_table (info); + relax_status = table->relax_status; + + if (!(relax_status & NDS32_RELAX_JUMP_IFC_DONE)) + nds32_elf_ifc_filter (info); + else + nds32_elf_ifc_filter_after_ex9 (); + + if (!nds32_elf_ifc_replace (info)) + return FALSE; + + if (table) + table->relax_status |= NDS32_RELAX_JUMP_IFC_DONE; + return TRUE; +} + +/* Traverse the result of ifc filter and replace it with ifcall9. */ + +static bfd_boolean +nds32_elf_ifc_replace (struct bfd_link_info *info) +{ + struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head; + struct elf_nds32_ifc_irel_list *irel_ptr = NULL; + nds32_elf_blank_t *relax_blank_list = NULL; + bfd_byte *contents = NULL; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irel; + Elf_Internal_Rela *irelend; + unsigned short insn16 = INSN_IFCALL9; + struct elf_nds32_link_hash_table *table; + int relax_status; + + table = nds32_elf_hash_table (info); + relax_status = table->relax_status; + + while (ptr) + { + /* Traverse the ifc gather list, and replace the + filter entries by ifcall9. */ + if ((!(relax_status & NDS32_RELAX_JUMP_IFC_DONE) + && ptr->enable == 1) + || ((relax_status & NDS32_RELAX_JUMP_IFC_DONE) + && ptr->ex9_enable == 1)) + { + irel_ptr = ptr->irel_head; + if (ptr->h == NULL) + { + /* Local symbol. */ + internal_relocs = _bfd_elf_link_read_relocs + (ptr->sec->owner, ptr->sec, NULL, NULL, TRUE /* keep_memory */); + irelend = internal_relocs + ptr->sec->reloc_count; + + if (!nds32_get_section_contents (ptr->sec->owner, ptr->sec, + &contents, TRUE)) + return FALSE; + + while (irel_ptr) + { + if (irel_ptr->keep == 0 && irel_ptr->next) + { + /* The one can be replaced. We have to check whether + there is any alignment point in the region. */ + irel = irel_ptr->irel; + while (((irel_ptr->next->keep == 0 + && irel < irel_ptr->next->irel) + || (irel_ptr->next->keep == 1 && irel < irelend)) + && !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL + && (irel->r_addend & 0x1f) == 2)) + irel++; + if (irel >= irelend + || !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL + && (irel->r_addend & 0x1f) == 2 + && ((irel->r_offset - get_nds32_elf_blank_total + (&relax_blank_list, irel->r_offset, 1)) + & 0x02) == 0)) + { + /* Replace by ifcall9. */ + bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); + if (!insert_nds32_elf_blank_recalc_total + (&relax_blank_list, irel_ptr->irel->r_offset + 2, 2)) + return FALSE; + irel_ptr->irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), + R_NDS32_10IFCU_PCREL_RELA); + } + } + irel_ptr = irel_ptr->next; + } + + /* Delete the redundant code. */ + if (relax_blank_list) + { + nds32_elf_relax_delete_blanks (ptr->sec->owner, ptr->sec, + relax_blank_list); + relax_blank_list = NULL; + } + } + else + { + /* Global symbol. */ + while (irel_ptr) + { + if (irel_ptr->keep == 0 && irel_ptr->next) + { + /* The one can be replaced, and we have to check + whether there is any alignment point in the region. */ + internal_relocs = _bfd_elf_link_read_relocs + (irel_ptr->sec->owner, irel_ptr->sec, NULL, NULL, + TRUE /* keep_memory */); + irelend = internal_relocs + irel_ptr->sec->reloc_count; + if (!nds32_get_section_contents (irel_ptr->sec->owner, + irel_ptr->sec, &contents, + TRUE)) + return FALSE; + + irel = irel_ptr->irel; + while (((irel_ptr->sec == irel_ptr->next->sec + && irel_ptr->next->keep == 0 + && irel < irel_ptr->next->irel) + || ((irel_ptr->sec != irel_ptr->next->sec + || irel_ptr->next->keep == 1) + && irel < irelend)) + && !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL + && (irel->r_addend & 0x1f) == 2)) + irel++; + if (irel >= irelend + || !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL + && (irel->r_addend & 0x1f) == 2 + && ((irel->r_offset + - get_nds32_elf_blank_total (&relax_blank_list, + irel->r_offset, 1)) & 0x02) == 0)) + { + /* Replace by ifcall9. */ + bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); + if (!insert_nds32_elf_blank_recalc_total + (&relax_blank_list, irel_ptr->irel->r_offset + 2, 2)) + return FALSE; + + /* Delete the redundant code, and clear the relocation. */ + nds32_elf_relax_delete_blanks (irel_ptr->sec->owner, + irel_ptr->sec, + relax_blank_list); + irel_ptr->irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), + R_NDS32_10IFCU_PCREL_RELA); + relax_blank_list = NULL; + } + } + + irel_ptr = irel_ptr->next; + } + } + } + ptr = ptr->next; + } + + return TRUE; +} + +/* Relocate ifcall. */ + +static bfd_boolean +nds32_elf_ifc_reloc (void) +{ + struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head; + struct elf_nds32_ifc_irel_list *irel_ptr = NULL; + struct elf_nds32_ifc_irel_list *irel_keeper = NULL; + bfd_vma relocation, address; + unsigned short insn16; + static bfd_boolean done = FALSE; + + if (done) + return TRUE; + + done = TRUE; + + bfd_byte *contents = NULL; + + while (ptr) + { + /* Check the entry is enable ifcall. */ + if (ptr->enable == 1 || ptr->ex9_enable == 1) + { + /* Get the reserve jump. */ + irel_ptr = ptr->irel_head; + while (irel_ptr) + { + if (irel_ptr->keep == 1) + { + irel_keeper = irel_ptr; + break; + } + irel_ptr = irel_ptr->next; + } + + irel_ptr = ptr->irel_head; + if (ptr->h == NULL) + { + /* Local symbol. */ + if (!nds32_get_section_contents (ptr->sec->owner, ptr->sec, + &contents, TRUE)) + return FALSE; + + while (irel_ptr) + { + if (irel_ptr->keep == 0 + && ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_10IFCU_PCREL_RELA) + { + relocation = irel_keeper->irel->r_offset; + relocation = relocation - irel_ptr->irel->r_offset; + while (irel_keeper && relocation > 1022) + { + irel_keeper = irel_keeper->next; + if (irel_keeper && irel_keeper->keep == 1) + { + relocation = irel_keeper->irel->r_offset; + relocation = relocation - irel_ptr->irel->r_offset; + } + } + if (relocation > 1022) + { + /* Double check. */ + irel_keeper = ptr->irel_head; + while (irel_keeper) + { + if (irel_keeper->keep == 1) + { + relocation = irel_keeper->irel->r_offset; + relocation = relocation - irel_ptr->irel->r_offset; + } + if (relocation <= 1022) + break; + irel_keeper = irel_keeper->next; + } + if (!irel_keeper) + return FALSE; + } + irel_ptr->irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), + R_NDS32_NONE); + insn16 = INSN_IFCALL9 | (relocation >> 1); + bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); + } + irel_ptr = irel_ptr->next; + } + } + else + { + /* Global symbol. */ + while (irel_ptr) + { + if (irel_ptr->keep == 0 + && ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_10IFCU_PCREL_RELA) + { + /* Get the distance between ifcall and jump. */ + relocation = (irel_keeper->irel->r_offset + + irel_keeper->sec->output_section->vma + + irel_keeper->sec->output_offset); + address = (irel_ptr->irel->r_offset + + irel_ptr->sec->output_section->vma + + irel_ptr->sec->output_offset); + relocation = relocation - address; + + /* The distance is over ragne, find callee again. */ + while (irel_keeper && relocation > 1022) + { + irel_keeper = irel_keeper->next; + if (irel_keeper && irel_keeper->keep ==1) + { + relocation = (irel_keeper->irel->r_offset + + irel_keeper->sec->output_section->vma + + irel_keeper->sec->output_offset); + relocation = relocation - address; + } + } + + if (relocation > 1022) + { + /* Double check. */ + irel_keeper = ptr->irel_head; + while (irel_keeper) + { + if (irel_keeper->keep == 1) + { + + relocation = (irel_keeper->irel->r_offset + + irel_keeper->sec->output_section->vma + + irel_keeper->sec->output_offset); + relocation = relocation - address; + } + if (relocation <= 1022) + break; + irel_keeper = irel_keeper->next; + } + if (!irel_keeper) + return FALSE; + } + if (!nds32_get_section_contents + (irel_ptr->sec->owner, irel_ptr->sec, &contents, TRUE)) + return FALSE; + insn16 = INSN_IFCALL9 | (relocation >> 1); + bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); + irel_ptr->irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), + R_NDS32_NONE); + } + irel_ptr =irel_ptr->next; + } + } + } + ptr = ptr->next; + } + + return TRUE; +} + +/* End of IFC relaxation. */ + +/* EX9 Instruction Table Relaxation. */ +#define EX9_SECTION ".ex9.itable" + +/* Global hash list. */ +struct elf_link_hash_entry_list +{ + struct elf_link_hash_entry *h; + struct elf_link_hash_entry_list *next; +}; + +/* Save different destination but same insn. */ +struct elf_link_hash_entry_mul_list +{ + /* Global symbol times. */ + int times; + /* Save relocation for each global symbol but useful?? */ + Elf_Internal_Rela *irel; + /* For sethi, two sethi may have the same high-part but different low-parts. */ + Elf_Internal_Rela rel_backup; + struct elf_link_hash_entry_list *h_list; + struct elf_link_hash_entry_mul_list *next; +}; + +/* Instruction hash table. */ +struct elf_nds32_code_hash_entry +{ + struct bfd_hash_entry root; + int times; + /* For insn that can use relocation or constant ex: sethi. */ + int const_insn; + asection *sec; + struct elf_link_hash_entry_mul_list *m_list; + /* Using r_addend. */ + Elf_Internal_Rela *irel; + /* Using r_info. */ + Elf_Internal_Rela rel_backup; +}; + +/* Instruction count list. */ +struct elf_nds32_insn_times_entry +{ + const char *string; + int times; + int order; + asection *sec; + struct elf_link_hash_entry_mul_list *m_list; + Elf_Internal_Rela *irel; + Elf_Internal_Rela rel_backup; + struct elf_nds32_insn_times_entry *next; +}; + +/* J and JAL symbol list. */ +struct elf_nds32_symbol_entry +{ + char *string; + unsigned long insn; + struct elf_nds32_symbol_entry *next; +}; + +/* Relocation list. */ +struct elf_nds32_irel_entry +{ + Elf_Internal_Rela *irel; + struct elf_nds32_irel_entry *next; +}; + +/* ex9.it insn need to be fixed. */ +struct elf_nds32_ex9_refix +{ + Elf_Internal_Rela *irel; + asection *sec; + struct elf_link_hash_entry *h; + int order; + struct elf_nds32_ex9_refix *next; +}; + +static struct bfd_hash_table ex9_code_table; +static struct elf_nds32_insn_times_entry *ex9_insn_head = NULL; +static struct elf_nds32_ex9_refix *ex9_refix_head = NULL; + +/* EX9 hash function. */ + +static struct bfd_hash_entry * +nds32_elf_code_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) +{ + struct elf_nds32_code_hash_entry *ret; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = (struct bfd_hash_entry *) + bfd_hash_allocate (table, sizeof (*ret)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = bfd_hash_newfunc (entry, table, string); + if (entry == NULL) + return entry; + + ret = (struct elf_nds32_code_hash_entry*) entry; + ret->times = 0; + ret->const_insn = 0; + ret->m_list = NULL; + ret->sec = NULL; + ret->irel = NULL; + return &ret->root; +} + +/* Insert ex9 entry + this insert must be stable sorted by times. */ + +static void +nds32_elf_ex9_insert_entry (struct elf_nds32_insn_times_entry *ptr) +{ + struct elf_nds32_insn_times_entry *temp; + struct elf_nds32_insn_times_entry *temp2; + + if (ex9_insn_head == NULL) + { + ex9_insn_head = ptr; + ptr->next = NULL; + } + else + { + temp = ex9_insn_head; + temp2 = ex9_insn_head; + while (temp->next && + (temp->next->times >= ptr->times + || temp->times == -1)) + { + if (temp->times == -1) + temp2 = temp; + temp = temp->next; + } + if (ptr->times > temp->times && temp->times != -1) + { + ptr->next = temp; + if (temp2->times == -1) + temp2->next = ptr; + else + ex9_insn_head = ptr; + } + else if (temp->next == NULL) + { + temp->next = ptr; + ptr->next = NULL; + } + else + { + ptr->next = temp->next; + temp->next = ptr; + } + } +} + +/* Examine each insn times in hash table. + Handle multi-link hash entry. + + TODO: This function doesn't assign so much info since it is fake. */ + +static int +nds32_elf_examine_insn_times (struct elf_nds32_code_hash_entry *h) +{ + struct elf_nds32_insn_times_entry *ptr; + int times; + + if (h->m_list == NULL) + { + /* Local symbol insn or insn without relocation. */ + if (h->times < 3) + return TRUE; + + ptr = (struct elf_nds32_insn_times_entry *) + bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); + ptr->times = h->times; + ptr->string = h->root.string; + ptr->m_list = NULL; + ptr->sec = h->sec; + ptr->irel = h->irel; + ptr->rel_backup = h->rel_backup; + nds32_elf_ex9_insert_entry (ptr); + } + else + { + /* Global symbol insn. */ + /* Only sethi insn has multiple m_list. */ + struct elf_link_hash_entry_mul_list *m_list = h->m_list; + + times = 0; + while (m_list) + { + times += m_list->times; + m_list = m_list->next; + } + if (times >= 3) + { + m_list = h->m_list; + ptr = (struct elf_nds32_insn_times_entry *) + bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); + ptr->times = times; /* Use the total times. */ + ptr->string = h->root.string; + ptr->m_list = m_list; + ptr->sec = h->sec; + ptr->irel = m_list->irel; + ptr->rel_backup = m_list->rel_backup; + nds32_elf_ex9_insert_entry (ptr); + } + if (h->const_insn == 1) + { + /* sethi with constant value. */ + if (h->times < 3) + return TRUE; + + ptr = (struct elf_nds32_insn_times_entry *) + bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); + ptr->times = h->times; + ptr->string = h->root.string; + ptr->m_list = NULL; + ptr->sec = NULL; + ptr->irel = NULL; + ptr->rel_backup = h->rel_backup; + nds32_elf_ex9_insert_entry (ptr); + } + } + return TRUE; +} + +/* Count each insn times in hash table. + Handle multi-link hash entry. */ + +static int +nds32_elf_count_insn_times (struct elf_nds32_code_hash_entry *h) +{ + int reservation, times; + unsigned long relocation, min_relocation; + struct elf_nds32_insn_times_entry *ptr; + + if (h->m_list == NULL) + { + /* Local symbol insn or insn without relocation. */ + if (h->times < 3) + return TRUE; + ptr = (struct elf_nds32_insn_times_entry *) + bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); + ptr->times = h->times; + ptr->string = h->root.string; + ptr->m_list = NULL; + ptr->sec = h->sec; + ptr->irel = h->irel; + ptr->rel_backup = h->rel_backup; + nds32_elf_ex9_insert_entry (ptr); + } + else + { + /* Global symbol insn. */ + /* Only sethi insn has multiple m_list. */ + struct elf_link_hash_entry_mul_list *m_list = h->m_list; + + if (ELF32_R_TYPE (m_list->rel_backup.r_info) == R_NDS32_HI20_RELA + && m_list->next != NULL) + { + /* Sethi insn has different symbol or addend but has same hi20. */ + times = 0; + reservation = 1; + relocation = 0; + min_relocation = 0xffffffff; + while (m_list) + { + /* Get the minimum sethi address + and calculate how many entry the sethi-list have to use. */ + if ((m_list->h_list->h->root.type == bfd_link_hash_defined + || m_list->h_list->h->root.type == bfd_link_hash_defweak) + && (m_list->h_list->h->root.u.def.section != NULL + && m_list->h_list->h->root.u.def.section->output_section != NULL)) + { + relocation = (m_list->h_list->h->root.u.def.value + + m_list->h_list->h->root.u.def.section->output_section->vma + + m_list->h_list->h->root.u.def.section->output_offset); + relocation += m_list->irel->r_addend; + } + else + relocation = 0; + if (relocation < min_relocation) + min_relocation = relocation; + times += m_list->times; + m_list = m_list->next; + } + if (min_relocation < ex9_relax_size) + reservation = (min_relocation >> 12) + 1; + else + reservation = (min_relocation >> 12) + - ((min_relocation - ex9_relax_size) >> 12) + 1; + if ((reservation * 3) <= times) + { + /* Efficient enough to use ex9. */ + int i; + + for (i = reservation ; i > 0; i--) + { + /* Allocate number of reservation ex9 entry. */ + ptr = (struct elf_nds32_insn_times_entry *) + bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); + ptr->times = h->m_list->times / reservation; + ptr->string = h->root.string; + ptr->m_list = h->m_list; + ptr->sec = h->sec; + ptr->irel = h->m_list->irel; + ptr->rel_backup = h->m_list->rel_backup; + nds32_elf_ex9_insert_entry (ptr); + } + } + } + else + { + /* Normal global symbol that means no different address symbol + using same ex9 entry. */ + if (m_list->times >= 3) + { + ptr = (struct elf_nds32_insn_times_entry *) + bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); + ptr->times = m_list->times; + ptr->string = h->root.string; + ptr->m_list = h->m_list; + ptr->sec = h->sec; + ptr->irel = h->m_list->irel; + ptr->rel_backup = h->m_list->rel_backup; + nds32_elf_ex9_insert_entry (ptr); + } + } + + if (h->const_insn == 1) + { + /* sethi with constant value. */ + if (h->times < 3) + return TRUE; + + ptr = (struct elf_nds32_insn_times_entry *) + bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); + ptr->times = h->times; + ptr->string = h->root.string; + ptr->m_list = NULL; + ptr->sec = NULL; + ptr->irel = NULL; + ptr->rel_backup = h->rel_backup; + nds32_elf_ex9_insert_entry (ptr); + } + } + + return TRUE; +} + +/* Hash table traverse function. */ + +static void +nds32_elf_code_hash_traverse (int (*func) (struct elf_nds32_code_hash_entry*)) +{ + unsigned int i; + + ex9_code_table.frozen = 1; + for (i = 0; i < ex9_code_table.size; i++) + { + struct bfd_hash_entry *p; + + for (p = ex9_code_table.table[i]; p != NULL; p = p->next) + if (!func ((struct elf_nds32_code_hash_entry *) p)) + goto out; + } +out: + ex9_code_table.frozen = 0; +} + + +/* Give order number to insn list. */ + +static void +nds32_elf_order_insn_times (struct bfd_link_info *info) +{ + struct elf_nds32_insn_times_entry *ex9_insn; + struct elf_nds32_insn_times_entry *temp = NULL; + struct elf_nds32_link_hash_table *table; + int ex9_limit; + int number = 0; + + if (ex9_insn_head == NULL) + return; + +/* The max number of entries is 512. */ + ex9_insn = ex9_insn_head; + table = nds32_elf_hash_table (info); + ex9_limit = table->ex9_limit; + + ex9_insn = ex9_insn_head; + + while (ex9_insn != NULL && number < ex9_limit) + { + ex9_insn->order = number; + number++; + temp = ex9_insn; + ex9_insn = ex9_insn->next; + } + + if (ex9_insn && temp) + temp->next = NULL; + + while (ex9_insn != NULL) + { + /* Free useless entry. */ + temp = ex9_insn; + ex9_insn = ex9_insn->next; + free (temp); + } +} + +/* Get section .ex9.itable. */ + +static asection* +nds32_elf_ex9_get_section (bfd *input_bfds) +{ + asection *sec = NULL; + bfd *abfd; + + if (ex9_section != NULL) + return ex9_section; + + for (abfd = input_bfds; abfd != NULL; abfd = abfd->link_next) + { + sec = bfd_get_section_by_name (abfd, EX9_SECTION); + if (sec != NULL) + break; + } + + ex9_section = sec; + return sec; +} + +/* Build .ex9.itable section. */ + +static void +nds32_elf_ex9_build_itable (struct bfd_link_info *link_info) +{ + asection *table_sec; + struct elf_nds32_insn_times_entry *ptr; + int number = 0; + bfd_byte *contents = NULL; + struct elf_nds32_link_hash_table *table; + + table = nds32_elf_hash_table (link_info); + + /* Find the section .ex9.itable, and put all entries into it. */ + table_sec = nds32_elf_ex9_get_section (link_info->input_bfds); + + if (table_sec != NULL) + { + if (!nds32_get_section_contents (table_sec->owner, table_sec, + &contents, TRUE)) + return; + + for (ptr = ex9_insn_head; ptr !=NULL ; ptr = ptr->next) + number++; + + table_sec->size = number * 4; + + if (number == 0) + return; + + /* Check $itb register if set. */ + if (!table->ex9_import_file + && !bfd_link_hash_lookup (link_info->hash, "_ITB_BASE_", + FALSE, FALSE, TRUE)) + { + (*_bfd_error_handler) + (_("\nError: Instruction Table(IT) is used, but Instruction " + "Table Base($ITB) isn't set.\nPlease add the following " + "instructions in _start of crt0.S:\n" + "\"la $r0,_ITB_BASE_;mtusr $r0,$ITB\"")); + exit (1); + } + + elf_elfheader (link_info->output_bfd)->e_flags |= E_NDS32_HAS_EX9_INST; + number = 0; + for (ptr = ex9_insn_head; ptr !=NULL ; ptr = ptr->next) + { + long val; + + val = strtol (ptr->string, NULL, 16); + bfd_putb32 ((bfd_vma) val, (char *) contents + (number * 4)); + number++; + } + } +} + +/* Get insn with regs according to relocation type. */ + +static void +nds32_elf_get_insn_with_reg (Elf_Internal_Rela *irel, + uint32_t insn, uint32_t *insn_with_reg) +{ + reloc_howto_type *howto = NULL; + + if (irel == NULL + || (ELF32_R_TYPE (irel->r_info) >= (int) ARRAY_SIZE (nds32_elf_howto_table) + && (ELF32_R_TYPE (irel->r_info) - R_NDS32_RELAX_ENTRY) + >= (int) ARRAY_SIZE (nds32_elf_relax_howto_table))) + { + *insn_with_reg = insn; + return; + } + + howto = bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (irel->r_info)); + *insn_with_reg = insn & (0xffffffff ^ howto->dst_mask); +} + +/* Mask number of address bits according to relocation. */ + +static unsigned long +nds32_elf_irel_mask (Elf_Internal_Rela *irel) +{ + reloc_howto_type *howto = NULL; + + if (irel == NULL + || (ELF32_R_TYPE (irel->r_info) >= (int) ARRAY_SIZE (nds32_elf_howto_table) + && (ELF32_R_TYPE (irel->r_info) - R_NDS32_RELAX_ENTRY) + >= (int) ARRAY_SIZE (nds32_elf_relax_howto_table))) + return 0; + + howto = bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (irel->r_info)); + return howto->dst_mask; +} + +static void +nds32_elf_insert_irel_entry (struct elf_nds32_irel_entry **irel_list, + struct elf_nds32_irel_entry *irel_ptr) +{ + if (*irel_list == NULL) + { + *irel_list = irel_ptr; + irel_ptr->next = NULL; + } + else + { + irel_ptr->next = *irel_list; + *irel_list = irel_ptr; + } +} + +static void +nds32_elf_ex9_insert_fix (asection * sec, Elf_Internal_Rela * irel, + struct elf_link_hash_entry *h, int order) +{ + struct elf_nds32_ex9_refix *ptr; + + ptr = bfd_malloc (sizeof (struct elf_nds32_ex9_refix)); + ptr->sec = sec; + ptr->irel = irel; + ptr->h = h; + ptr->order = order; + ptr->next = NULL; + + if (ex9_refix_head == NULL) + ex9_refix_head = ptr; + else + { + struct elf_nds32_ex9_refix *temp = ex9_refix_head; + + while (temp->next != NULL) + temp = temp->next; + temp->next = ptr; + } +} + +enum +{ + DATA_EXIST = 1, + CLEAN_PRE = 1 << 1, + PUSH_PRE = 1 << 2 +}; + +/* Check relocation type if supporting for ex9. */ + +static int +nds32_elf_ex9_relocation_check (struct bfd_link_info *info, + Elf_Internal_Rela **irel, + Elf_Internal_Rela *irelend, + nds32_elf_blank_t *relax_blank_list, + asection *sec, bfd_vma *off, + bfd_byte *contents) +{ + /* Suppress ex9 if `.no_relax ex9' or inner loop. */ + bfd_boolean nested_ex9, nested_loop; + bfd_boolean ex9_loop_aware; + /* We use the highest 1 byte of result to record + how many bytes location counter has to move. */ + int result = 0; + Elf_Internal_Rela *irel_save = NULL; + struct elf_nds32_link_hash_table *table; + + table = nds32_elf_hash_table (info); + ex9_loop_aware = table->ex9_loop_aware; + + while ((*irel) != NULL && (*irel) < irelend && *off == (*irel)->r_offset) + { + switch (ELF32_R_TYPE ((*irel)->r_info)) + { + case R_NDS32_RELAX_REGION_BEGIN: + /* Ignore code block. */ + nested_ex9 = FALSE; + nested_loop = FALSE; + if (((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG) + || (ex9_loop_aware + && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG))) + { + /* Check the region if loop or not. If it is true and + ex9-loop-aware is true, ignore the region till region end. */ + /* To save the status for in .no_relax ex9 region and + loop region to conform the block can do ex9 relaxation. */ + nested_ex9 = ((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG); + nested_loop = (ex9_loop_aware + && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG)); + while ((*irel) && (*irel) < irelend && (nested_ex9 || nested_loop)) + { + (*irel)++; + if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_RELAX_REGION_BEGIN) + { + /* There may be nested region. */ + if (((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG) != 0) + nested_ex9 = TRUE; + else if (ex9_loop_aware + && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG)) + nested_loop = TRUE; + } + else if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_RELAX_REGION_END) + { + /* The end of region. */ + if (((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG) != 0) + nested_ex9 = FALSE; + else if (ex9_loop_aware + && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG)) + nested_loop = FALSE; + } + else if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_LABEL + && ((*irel)->r_addend & 0x1f) == 2) + { + /* Alignment exist in the region. */ + result |= CLEAN_PRE; + if (((*irel)->r_offset - + get_nds32_elf_blank_total (&relax_blank_list, + (*irel)->r_offset, 0)) & 0x02) + result |= PUSH_PRE; + } + } + if ((*irel) >= irelend) + *off = sec->size; + else + *off = (*irel)->r_offset; + + /* The final instruction in the region, regard this one as data to ignore it. */ + result |= DATA_EXIST; + return result; + } + break; + + case R_NDS32_LABEL: + if (((*irel)->r_addend & 0x1f) == 2) + { + /* Check this point is align and decide to do ex9 or not. */ + result |= CLEAN_PRE; + if (((*irel)->r_offset - + get_nds32_elf_blank_total (&relax_blank_list, + (*irel)->r_offset, 0)) & 0x02) + result |= PUSH_PRE; + } + break; + case R_NDS32_32_RELA: + /* Data. */ + result |= (4 << 24); + result |= DATA_EXIST; + break; + case R_NDS32_16_RELA: + /* Data. */ + result |= (2 << 24); + result |= DATA_EXIST; + break; + case R_NDS32_DATA: + /* Data. */ + /* The least code alignment is 2. If the data is only one byte, + we have to shift one more byte. */ + if ((*irel)->r_addend == 1) + result |= ((*irel)->r_addend << 25) ; + else + result |= ((*irel)->r_addend << 24) ; + + result |= DATA_EXIST; + break; + + case R_NDS32_25_PCREL_RELA: + case R_NDS32_SDA16S3_RELA: + case R_NDS32_SDA15S3_RELA: + case R_NDS32_SDA15S3: + case R_NDS32_SDA17S2_RELA: + case R_NDS32_SDA15S2_RELA: + case R_NDS32_SDA12S2_SP_RELA: + case R_NDS32_SDA12S2_DP_RELA: + case R_NDS32_SDA15S2: + case R_NDS32_SDA18S1_RELA: + case R_NDS32_SDA15S1_RELA: + case R_NDS32_SDA15S1: + case R_NDS32_SDA19S0_RELA: + case R_NDS32_SDA15S0_RELA: + case R_NDS32_SDA15S0: + case R_NDS32_HI20_RELA: + case R_NDS32_LO12S0_ORI_RELA: + case R_NDS32_LO12S0_RELA: + case R_NDS32_LO12S1_RELA: + case R_NDS32_LO12S2_RELA: + case R_NDS32_20_RELA: + /* These relocation is supported ex9 relaxation currently. */ + /* We have to save the relocation for using later, since we have + to check there is any alignment in the same address. */ + irel_save = *irel; + break; + default: + /* Not support relocations. */ + if (ELF32_R_TYPE ((*irel)->r_info) < ARRAY_SIZE (nds32_elf_howto_table) + && ELF32_R_TYPE ((*irel)->r_info) != R_NDS32_NONE + && ELF32_R_TYPE ((*irel)->r_info) != R_NDS32_INSN16 + && ELF32_R_TYPE ((*irel)->r_info) != R_NDS32_LOADSTORE) + { + /* Note: To optimize aggressively, it maybe can ignore + R_NDS32_INSN16 here. But we have to consider + if there is any side-effect. */ + if (!(result & DATA_EXIST)) + { + /* We have to confirm there is no data relocation in the + same address. In general case, this won't happen. */ + /* We have to do ex9 conservative, for those relocation not + considerd we ignore instruction. */ + result |= DATA_EXIST; + if (*(contents + *off) & 0x80) + result |= (2 << 24); + else + result |= (4 << 24); + break; + } + } + } + if ((*irel) < irelend + && ((*irel) + 1) < irelend + && (*irel)->r_offset == ((*irel) + 1)->r_offset) + /* There are relocations pointing to the same address, we have to + check all of them. */ + (*irel)++; + else + { + if (irel_save) + *irel = irel_save; + return result; + } + } + return result; +} + +/* Replace with ex9 instruction. */ +static bfd_boolean +nds32_elf_ex9_push_insn (uint16_t insn16, bfd_byte *contents, bfd_vma pre_off, + nds32_elf_blank_t **relax_blank_list, + struct elf_nds32_irel_entry *pre_irel_ptr, + struct elf_nds32_irel_entry **irel_list) +{ + if (insn16 != 0) + { + /* Implement the ex9 relaxation. */ + bfd_putb16 (insn16, contents + pre_off); + if (!insert_nds32_elf_blank_recalc_total (relax_blank_list, + pre_off + 2, 2)) + return FALSE; + if (pre_irel_ptr != NULL) + nds32_elf_insert_irel_entry (irel_list, pre_irel_ptr); + } + return TRUE; +} + +/* Replace input file instruction which is in ex9 itable. */ + +static bfd_boolean +nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asection *sec) +{ + struct elf_nds32_insn_times_entry *ex9_insn = ex9_insn_head; + bfd_byte *contents = NULL; + bfd_vma off; + uint16_t insn16, insn_ex9; + /* `pre_*' are used to track previous instruction that can use ex9.it. */ + bfd_vma pre_off = -1; + uint16_t pre_insn16 = 0; + struct elf_nds32_irel_entry *pre_irel_ptr = NULL; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irel; + Elf_Internal_Rela *irelend; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Sym *isym = NULL; + nds32_elf_blank_t *relax_blank_list = NULL; + uint32_t insn = 0; + uint32_t insn_with_reg = 0; + uint32_t it_insn; + uint32_t it_insn_with_reg; + unsigned long r_symndx; + asection *isec; + struct elf_nds32_irel_entry *irel_list = NULL; + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd); + int data_flag, do_replace, save_irel; + struct elf_link_hash_entry_list *h_list; + + + /* Load section instructions, relocations, and symbol table. */ + if (!nds32_get_section_contents (abfd, sec, &contents, TRUE) + || !nds32_get_local_syms (abfd, sec, &isym)) + return FALSE; + internal_relocs = + _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, TRUE /* keep_memory */); + irelend = internal_relocs + sec->reloc_count; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + off = 0; + + /* Check if the object enable ex9. */ + irel = find_relocs_at_address (internal_relocs, internal_relocs, + irelend, R_NDS32_RELAX_ENTRY); + + /* Check this section trigger ex9 relaxation. */ + if (irel == NULL + || irel >= irelend + || ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY + || (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY + && !(irel->r_addend & R_NDS32_RELAX_ENTRY_EX9_FLAG))) + return TRUE; + + irel = internal_relocs; + + /* Check alignment and fetch proper relocation. */ + while (off < sec->size) + { + struct elf_link_hash_entry *h = NULL; + struct elf_nds32_irel_entry *irel_ptr = NULL; + + /* Syn the instruction and the relocation. */ + while (irel != NULL && irel < irelend && irel->r_offset < off) + irel++; + + data_flag = nds32_elf_ex9_relocation_check (info, &irel, irelend, + relax_blank_list, sec, + &off, contents); + if (data_flag & PUSH_PRE) + if (!nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off, + &relax_blank_list, pre_irel_ptr, + &irel_list)) + return FALSE; + + if (data_flag & CLEAN_PRE) + { + pre_off = 0; + pre_insn16 = 0; + pre_irel_ptr = NULL; + } + if (data_flag & DATA_EXIST) + { + /* We save the move offset in the highest byte. */ + off += (data_flag >> 24); + continue; + } + + if (*(contents + off) & 0x80) + { + /* 2-byte instruction. */ + off += 2; + continue; + } + + /* Load the instruction and its opcode with register for comparing. */ + ex9_insn = ex9_insn_head; + insn = bfd_getb32 (contents + off); + insn_with_reg = 0; + /* Insn with relocation. Mask instruction. */ + if (irel != NULL && irel < irelend && irel->r_offset == off) + nds32_elf_get_insn_with_reg (irel, insn, &insn_with_reg); + + while (ex9_insn) + { + it_insn = strtol (ex9_insn->string, NULL, 16); + it_insn_with_reg = 0; + do_replace = 0; + save_irel = 0; + + if (irel != NULL && irel < irelend && irel->r_offset == off + && ex9_insn->irel != NULL) + nds32_elf_get_insn_with_reg (ex9_insn->irel, it_insn, + &it_insn_with_reg); + + /* Instruction and ex9 both have relocation. */ + if (insn_with_reg != 0 && it_insn_with_reg != 0 + && (ELF32_R_TYPE (irel->r_info) == + ELF32_R_TYPE (ex9_insn->irel->r_info)) + && (insn_with_reg == it_insn_with_reg)) + { + /* Insn relocation and format is the same as table entry. */ + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_ORI_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S1_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_RELA + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3 + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0_RELA) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA12S2_DP_RELA + && ELF32_R_TYPE (irel->r_info) <= + R_NDS32_SDA12S2_SP_RELA) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA16S3_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA19S0_RELA) + || ELF32_R_TYPE (irel->r_info) == R_NDS32_20_RELA) + { + r_symndx = ELF32_R_SYM (irel->r_info); + if (r_symndx < symtab_hdr->sh_info) + { + /* Local symbol. */ + int shndx = isym[r_symndx].st_shndx; + + isec = elf_elfsections (abfd)[shndx]->bfd_section; + if (ex9_insn->sec == isec + && ex9_insn->irel->r_addend == irel->r_addend + && ex9_insn->irel->r_info == irel->r_info) + { + do_replace = 1; + save_irel = 1; + } + } + else if (ex9_insn->m_list) + { + /* External symbol. */ + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + h_list = ex9_insn->m_list->h_list; + while (h_list) + { + if (ex9_insn->m_list->irel->r_addend == irel->r_addend + && h == h_list->h) + { + do_replace = 1; + save_irel = 1; + break; + } + h_list = h_list->next; + } + } + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_HI20_RELA) + { + r_symndx = ELF32_R_SYM (irel->r_info); + if (r_symndx < symtab_hdr->sh_info) + { + /* Local symbols. Compare its base symbol + and offset. */ + int shndx = isym[r_symndx].st_shndx; + + isec = elf_elfsections (abfd)[shndx]->bfd_section; + if (ex9_insn->sec == isec + && ex9_insn->irel->r_addend == irel->r_addend + && ex9_insn->irel->r_info == irel->r_info) + { + do_replace = 1; + save_irel = 1; + } + } + else + { + /* External symbol. */ + struct elf_link_hash_entry_mul_list *m_list; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + m_list = ex9_insn->m_list; + + while (m_list && !do_replace) + { + h_list = m_list->h_list; + while (h_list) + { + if (h == h_list->h + && m_list->irel->r_addend == irel->r_addend) + { + do_replace = 1; + save_irel = 1; + /* sethi multiple entry must be fixed. */ + if (ex9_insn->next && ex9_insn->m_list + && ex9_insn->m_list == ex9_insn->next->m_list) + nds32_elf_ex9_insert_fix (sec, irel, h, + ex9_insn->order); + break; + } + h_list = h_list->next; + } + m_list = m_list->next; + } + } + } + } + /* Import table: Check the symbol hash table and the + jump target. Only R_NDS32_25_PCREL_RELA now. */ + else if (insn_with_reg != 0 && ex9_insn->times == -1 + && ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA) + { + nds32_elf_get_insn_with_reg (irel, it_insn, &it_insn_with_reg); + if (insn_with_reg == it_insn_with_reg) + { + char code[10]; + bfd_vma relocation; + + r_symndx = ELF32_R_SYM (irel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section != NULL + && h->root.u.def.section->output_section != NULL + && h->root.u.def.section->gc_mark == 1 + && bfd_is_abs_section (h->root.u.def.section) + && h->root.u.def.value > sec->size) + { + relocation = h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset; + relocation += irel->r_addend; + insn = insn_with_reg + | ((relocation >> 1) & 0xffffff); + snprintf (code, sizeof (code), "%08x", insn); + if (strcmp (code, ex9_insn->string) == 0) + { + do_replace = 1; + save_irel = 1; + } + } + } + } + } + else if ((irel == NULL || irel >= irelend || irel->r_offset != off) + && insn == it_insn && ex9_insn->irel == NULL) + { + /* Instruction without relocation, we only + have to compare their byte code. */ + do_replace = 1; + } + + /* Insntruction match so replacing the code here. */ + if (do_replace == 1) + { + /* There are two formats of ex9 instruction. */ + if (ex9_insn->order < 32) + insn_ex9 = INSN_EX9_IT_2; + else + insn_ex9 = INSN_EX9_IT_1; + insn16 = insn_ex9 | ex9_insn->order; + + /* Insert ex9 instruction. */ + nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off, + &relax_blank_list, pre_irel_ptr, + &irel_list); + pre_off = off; + pre_insn16 = insn16; + + if (save_irel) + { + /* For instuction with relocation do relax. */ + irel_ptr = (struct elf_nds32_irel_entry *) + bfd_malloc (sizeof (struct elf_nds32_irel_entry)); + irel_ptr->irel = irel; + irel_ptr->next = NULL; + pre_irel_ptr = irel_ptr; + } + else + pre_irel_ptr = NULL; + break; + } + ex9_insn = ex9_insn->next; + } + off += 4; + } + + /* Insert ex9 instruction. */ + nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off, + &relax_blank_list, pre_irel_ptr, + &irel_list); + + /* Delete the redundant code. */ + if (relax_blank_list) + { + nds32_elf_relax_delete_blanks (abfd, sec, relax_blank_list); + relax_blank_list = NULL; + } + + /* Clear the relocation that is replaced by ex9. */ + while (irel_list) + { + struct elf_nds32_irel_entry *irel_ptr; + + irel_ptr = irel_list; + irel_list = irel_ptr->next; + irel_ptr->irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), R_NDS32_TRAN); + free (irel_ptr); + } + return TRUE; +} + +/* Initialize ex9 hash table. */ + +static int +nds32_elf_ex9_init (void) +{ + if (!bfd_hash_table_init_n (&ex9_code_table, nds32_elf_code_hash_newfunc, + sizeof (struct elf_nds32_code_hash_entry), + 1023)) + { + (*_bfd_error_handler) (_("Linker: cannot init ex9 hash table error \n")); + return FALSE; + } + return TRUE; +} + +/* Predict how many bytes will be relaxed with ex9 and ifc. */ + +static void +nds32_elf_ex9_total_relax (struct bfd_link_info *info) +{ + struct elf_nds32_insn_times_entry *ex9_insn; + struct elf_nds32_insn_times_entry *temp; + int target_optimize; + struct elf_nds32_link_hash_table *table; + + if (ex9_insn_head == NULL) + return; + + table = nds32_elf_hash_table (info); + target_optimize = table->target_optimize; + ex9_insn = ex9_insn_head; + while (ex9_insn) + { + ex9_relax_size = ex9_insn->times * 2 + ex9_relax_size; + temp = ex9_insn; + ex9_insn = ex9_insn->next; + free (temp); + } + ex9_insn_head = NULL; + + if ((target_optimize & NDS32_RELAX_IFC_ON)) + { + /* Examine the potential of ifc reduce size. */ + struct elf_nds32_ifc_symbol_entry *ifc_ent = ifc_symbol_head; + struct elf_nds32_ifc_irel_list *irel_ptr = NULL; + int size = 0; + + while (ifc_ent) + { + if (ifc_ent->enable == 0) + { + /* Not ifc yet. */ + irel_ptr = ifc_ent->irel_head; + while (irel_ptr) + { + size += 2; + irel_ptr = irel_ptr->next; + } + } + size -= 2; + ifc_ent = ifc_ent->next; + } + ex9_relax_size += size; + } +} + +/* Finish ex9 table. */ + +void +nds32_elf_ex9_finish (struct bfd_link_info *link_info) +{ + nds32_elf_code_hash_traverse (nds32_elf_examine_insn_times); + nds32_elf_order_insn_times (link_info); + nds32_elf_ex9_total_relax (link_info); + /* Traverse the hash table and count its times. */ + nds32_elf_code_hash_traverse (nds32_elf_count_insn_times); + nds32_elf_order_insn_times (link_info); + nds32_elf_ex9_build_itable (link_info); +} + +/* Relocate the entries in ex9 table. */ + +static bfd_vma +nds32_elf_ex9_reloc_insn (struct elf_nds32_insn_times_entry *ptr, + struct bfd_link_info *link_info) +{ + Elf_Internal_Sym *isym = NULL; + bfd_vma relocation = -1; + struct elf_link_hash_entry *h; + + if (ptr->m_list != NULL) + { + /* Global symbol. */ + h = ptr->m_list->h_list->h; + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section != NULL + && h->root.u.def.section->output_section != NULL) + { + + relocation = h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset; + relocation += ptr->m_list->irel->r_addend; + } + else + relocation = 0; + } + else if (ptr->sec !=NULL) + { + /* Local symbol. */ + Elf_Internal_Sym sym; + asection *sec = NULL; + asection isec; + asection *isec_ptr = &isec; + Elf_Internal_Rela irel_backup = *(ptr->irel); + asection *sec_backup = ptr->sec; + bfd *abfd = ptr->sec->owner; + + if (!nds32_get_local_syms (abfd, sec, &isym)) + return FALSE; + isym = isym + ELF32_R_SYM (ptr->irel->r_info); + + sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + if (sec != NULL) + *isec_ptr = *sec; + sym = *isym; + + /* The purpose is same as elf_link_input_bfd. */ + if (isec_ptr != NULL + && isec_ptr->sec_info_type == SEC_INFO_TYPE_MERGE + && ELF_ST_TYPE (isym->st_info) != STT_SECTION) + { + sym.st_value = + _bfd_merged_section_offset (ptr->sec->output_section->owner, &isec_ptr, + elf_section_data (isec_ptr)->sec_info, + isym->st_value); + } + relocation = _bfd_elf_rela_local_sym (link_info->output_bfd, &sym, + &ptr->sec, ptr->irel); + if (ptr->irel != NULL) + relocation += ptr->irel->r_addend; + + /* Restore origin value since there may be some insntructions that + could not be replaced with ex9.it. */ + *(ptr->irel) = irel_backup; + ptr->sec = sec_backup; + } + + return relocation; +} + +/* Import ex9 table and build list. */ + +void +nds32_elf_ex9_import_table (struct bfd_link_info *info) +{ + int num = 0; + bfd_byte *contents; + unsigned long insn; + FILE *ex9_import_file; + int update_ex9_table; + struct elf_nds32_link_hash_table *table; + + table = nds32_elf_hash_table (info); + ex9_import_file = table->ex9_import_file; + rewind (table->ex9_import_file); + + contents = bfd_malloc (sizeof (bfd_byte) * 4); + + /* Read instructions from the input file and build the list. */ + while (!feof (ex9_import_file)) + { + char *code; + struct elf_nds32_insn_times_entry *ptr; + size_t nread; + + nread = fread (contents, sizeof (bfd_byte) * 4, 1, ex9_import_file); + /* Ignore the final byte 0x0a. */ + if (nread < 1) + break; + insn = bfd_getb32 (contents); + code = bfd_malloc (sizeof (char) * 9); + snprintf (code, 9, "%08lx", insn); + ptr = bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); + ptr->string = code; + ptr->order = num; + ptr->times = -1; + ptr->sec = NULL; + ptr->m_list = NULL; + ptr->rel_backup.r_offset = 0; + ptr->rel_backup.r_info = 0; + ptr->rel_backup.r_addend = 0; + ptr->irel = NULL; + ptr->next = NULL; + nds32_elf_ex9_insert_entry (ptr); + num++; + } + + update_ex9_table = table->update_ex9_table; + if (update_ex9_table == 1) + { + /* It has to consider of sethi need to use multiple page + but it not be done yet. */ + nds32_elf_code_hash_traverse (nds32_elf_examine_insn_times); + nds32_elf_order_insn_times (info); + } +} + +/* Export ex9 table. */ + +static void +nds32_elf_ex9_export (struct bfd_link_info *info, + bfd_byte *contents, int size) +{ + FILE *ex9_export_file; + struct elf_nds32_link_hash_table *table; + + table = nds32_elf_hash_table (info); + ex9_export_file = table->ex9_export_file; + fwrite (contents, sizeof (bfd_byte), size, ex9_export_file); + fclose (ex9_export_file); +} + +/* Adjust relocations of J and JAL in ex9.itable. + Export ex9 table. */ + +static void +nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) +{ + asection *table_sec = NULL; + struct elf_nds32_insn_times_entry *ex9_insn = ex9_insn_head; + struct elf_nds32_insn_times_entry *temp_ptr, *temp_ptr2; + uint32_t insn, insn_with_reg, source_insn; + bfd_byte *contents = NULL, *source_contents = NULL; + int size = 0; + bfd_vma gp; + int shift, update_ex9_table, offset = 0; + reloc_howto_type *howto = NULL; + Elf_Internal_Rela rel_backup; + unsigned short insn_ex9; + struct elf_nds32_link_hash_table *table; + FILE *ex9_export_file; + static bfd_boolean done = FALSE; + + if (done) + return; + + done = TRUE; + + table = nds32_elf_hash_table (link_info); + if (table) + table->relax_status |= NDS32_RELAX_EX9_DONE; + + update_ex9_table = table->update_ex9_table; + + /* Generated ex9.itable exactly. */ + if (update_ex9_table == 0) + { + bfd *output_bfd; + table_sec = nds32_elf_ex9_get_section (link_info->input_bfds); + + if (table_sec == NULL) + { + (*_bfd_error_handler) (_("ld: error cannot find ex9 section.\n")); + return; + } + + output_bfd = table_sec->output_section->owner; + nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE); + if (table_sec->size == 0) + return; + + if (!nds32_get_section_contents (table_sec->owner, table_sec, + &contents, TRUE)) + return; + } + else + { + /* Set gp. */ + bfd *output_bfd; + + output_bfd = link_info->input_bfds->sections->output_section->owner; + nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE); + contents = bfd_malloc (sizeof (bfd_byte) * 2048); + } + + /* Relocate instruction. */ + while (ex9_insn) + { + bfd_vma relocation, min_relocation = 0xffffffff; + + insn = strtol (ex9_insn->string, NULL, 16); + insn_with_reg = 0; + if (ex9_insn->m_list != NULL || ex9_insn->sec != NULL) + { + if (ex9_insn->m_list) + rel_backup = ex9_insn->m_list->rel_backup; + else + rel_backup = ex9_insn->rel_backup; + + nds32_elf_get_insn_with_reg (&rel_backup, insn, &insn_with_reg); + howto = + bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE + (rel_backup.r_info)); + shift = howto->rightshift; + if (ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_25_PCREL_RELA + || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S0_ORI_RELA + || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S0_RELA + || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S1_RELA + || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S2_RELA + || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_20_RELA) + { + relocation = nds32_elf_ex9_reloc_insn (ex9_insn, link_info); + insn = + insn_with_reg | ((relocation >> shift) & + nds32_elf_irel_mask (&rel_backup)); + bfd_putb32 (insn, contents + (ex9_insn->order) * 4); + } + else if ((ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA15S3 + && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA15S0) + || (ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA15S3_RELA + && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA15S0_RELA) + || (ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA12S2_DP_RELA + && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA12S2_SP_RELA) + || (ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA16S3_RELA + && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA19S0_RELA)) + { + relocation = nds32_elf_ex9_reloc_insn (ex9_insn, link_info); + insn = + insn_with_reg | (((relocation - gp) >> shift) & + nds32_elf_irel_mask (&rel_backup)); + bfd_putb32 (insn, contents + (ex9_insn->order) * 4); + } + else if (ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_HI20_RELA) + { + /* Sethi may be multiple entry for one insn. */ + if (ex9_insn->next && ex9_insn->m_list + && ex9_insn->m_list == ex9_insn->next->m_list) + { + struct elf_link_hash_entry_mul_list *m_list; + struct elf_nds32_ex9_refix *fix_ptr; + struct elf_link_hash_entry *h; + + temp_ptr = ex9_insn; + temp_ptr2 = ex9_insn; + m_list = ex9_insn->m_list; + while (m_list) + { + h = m_list->h_list->h; + relocation = h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset; + relocation += m_list->irel->r_addend; + + if (relocation < min_relocation) + min_relocation = relocation; + m_list = m_list->next; + } + relocation = min_relocation; + + /* Put insntruction into ex9 table. */ + insn = insn_with_reg + | ((relocation >> shift) & nds32_elf_irel_mask (&rel_backup)); + bfd_putb32 (insn, contents + (ex9_insn->order) * 4); + relocation = relocation + 0x1000; /* hi20 */ + + while (ex9_insn->next && ex9_insn->m_list + && ex9_insn->m_list == ex9_insn->next->m_list) + { + /* Multiple sethi. */ + ex9_insn = ex9_insn->next; + size += 4; + insn = + insn_with_reg | ((relocation >> shift) & + nds32_elf_irel_mask (&rel_backup)); + bfd_putb32 (insn, contents + (ex9_insn->order) * 4); + relocation = relocation + 0x1000; /* hi20 */ + } + + fix_ptr = ex9_refix_head; + while (fix_ptr) + { + /* Fix ex9 insn. */ + /* temp_ptr2 points to the head of multiple sethi. */ + temp_ptr = temp_ptr2; + while (fix_ptr->order != temp_ptr->order && fix_ptr->next) + { + fix_ptr = fix_ptr->next; + } + if (fix_ptr->order != temp_ptr->order) + break; + + /* Set source insn. */ + relocation = + fix_ptr->h->root.u.def.value + + fix_ptr->h->root.u.def.section->output_section->vma + + fix_ptr->h->root.u.def.section->output_offset; + relocation += fix_ptr->irel->r_addend; + /* sethi imm is imm20s. */ + source_insn = insn_with_reg | ((relocation >> shift) & 0xfffff); + + while (temp_ptr) + { + /* Match entry and source code. */ + insn = bfd_getb32 (contents + (temp_ptr->order) * 4 + offset); + if (insn == source_insn) + { + /* Fix the ex9 insn. */ + if (temp_ptr->order != fix_ptr->order) + { + if (!nds32_get_section_contents + (fix_ptr->sec->owner, fix_ptr->sec, + &source_contents, TRUE)) + (*_bfd_error_handler) + (_("Linker: error cannot fixed ex9 relocation \n")); + if (temp_ptr->order < 32) + insn_ex9 = INSN_EX9_IT_2; + else + insn_ex9 = INSN_EX9_IT_1; + insn_ex9 = insn_ex9 | temp_ptr->order; + bfd_putb16 (insn_ex9, source_contents + fix_ptr->irel->r_offset); + } + break; + } + else + { + if (!temp_ptr->next || temp_ptr->m_list != temp_ptr->next->m_list) + (*_bfd_error_handler) + (_("Linker: error cannot fixed ex9 relocation \n")); + else + temp_ptr = temp_ptr->next; + } + } + fix_ptr = fix_ptr->next; + } + } + else + { + relocation = nds32_elf_ex9_reloc_insn (ex9_insn, link_info); + insn = insn_with_reg + | ((relocation >> shift) & nds32_elf_irel_mask (&rel_backup)); + bfd_putb32 (insn, contents + (ex9_insn->order) * 4); + } + } + } + else + { + /* Insn without relocation does not have to be fixed + if need to update export table. */ + if (update_ex9_table == 1) + bfd_putb32 (insn, contents + (ex9_insn->order) * 4); + } + ex9_insn = ex9_insn->next; + size += 4; + } + + ex9_export_file = table->ex9_export_file; + if (ex9_export_file != NULL) + nds32_elf_ex9_export (link_info, contents, table_sec->size); + else if (update_ex9_table == 1) + { + table->ex9_export_file = table->ex9_import_file; + rewind (table->ex9_export_file); + nds32_elf_ex9_export (link_info, contents, size); + } +} + +/* Check this instruction is convertable to ex9. */ +static bfd_boolean +nds32_elf_ex9_check_available (uint32_t insn) +{ + if (N32_OP6 (insn) == N32_OP6_MISC + && (N32_SUB5 (insn) == N32_MISC_SYSCALL + || N32_SUB5 (insn) == N32_MISC_BREAK + || N32_SUB5 (insn) == N32_MISC_TEQZ + || N32_SUB5 (insn) == N32_MISC_TNEZ + || N32_SUB5 (insn) == N32_MISC_TRAP)) + return FALSE; + return TRUE; +} + +/* Generate ex9 hash table. */ + +static bfd_boolean +nds32_elf_ex9_build_hash_table (bfd *abfd, asection *sec, + struct bfd_link_info *link_info) +{ + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irelend; + Elf_Internal_Rela *irel; + Elf_Internal_Rela *jrel; + Elf_Internal_Rela rel_backup; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Sym *isym = NULL; + asection *isec; + struct elf_link_hash_entry **sym_hashes; + bfd_byte *contents = NULL; + bfd_vma off = 0; + unsigned long r_symndx; + uint32_t insn, insn_with_reg; + struct elf_link_hash_entry *h; + int data_flag, shift, align; + bfd_vma relocation; + /* Suppress ex9 if `.no_relax ex9' or inner loop. */ + reloc_howto_type *howto = NULL; + + sym_hashes = elf_sym_hashes (abfd); + /* Load section instructions, relocations, and symbol table. */ + if (!nds32_get_section_contents (abfd, sec, &contents, TRUE)) + return FALSE; + + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + TRUE /* keep_memory */); + irelend = internal_relocs + sec->reloc_count; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + if (!nds32_get_local_syms (abfd, sec, &isym)) + return FALSE; + + /* Check the object if enable ex9. */ + irel = find_relocs_at_address (internal_relocs, internal_relocs, irelend, + R_NDS32_RELAX_ENTRY); + + /* Check this section trigger ex9 relaxation. */ + if (irel == NULL + || irel >= irelend + || ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY + || (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY + && !(irel->r_addend & R_NDS32_RELAX_ENTRY_EX9_FLAG))) + return TRUE; + + irel = internal_relocs; + + /* Push each insn into hash table. */ + while (off < sec->size) + { + char code[10]; + struct elf_nds32_code_hash_entry *entry; + + while (irel != NULL && irel < irelend && irel->r_offset < off) + irel++; + + data_flag = nds32_elf_ex9_relocation_check (link_info, &irel, irelend, + NULL, sec, &off, contents); + if (data_flag & DATA_EXIST) + { + /* We save the move offset in the highest byte. */ + off += (data_flag >> 24); + continue; + } + + /* Ignore 2-byte instruction. */ + if (*(contents + off) & 0x80) + { + off += 2; + continue; + } + + insn = bfd_getb32 (contents + off); + if (!nds32_elf_ex9_check_available (insn)) + { + off += 4; + continue; + } + + h = NULL; + isec = NULL; + jrel = NULL; + rel_backup.r_info = 0; + rel_backup.r_offset = 0; + rel_backup.r_addend = 0; + /* Load the instruction and its opcode with register for comparing. */ + insn_with_reg = 0; + if (irel != NULL && irel < irelend && irel->r_offset == off) + { + nds32_elf_get_insn_with_reg (irel, insn, &insn_with_reg); + howto = bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (irel->r_info)); + shift = howto->rightshift; + align = (1 << shift) - 1; + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_HI20_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_ORI_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S1_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_RELA + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3 + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0_RELA) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA12S2_DP_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA12S2_SP_RELA) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA16S3_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA19S0_RELA) + || ELF32_R_TYPE (irel->r_info) == R_NDS32_20_RELA) + { + r_symndx = ELF32_R_SYM (irel->r_info); + jrel = irel; + rel_backup = *irel; + if (r_symndx < symtab_hdr->sh_info) + { + /* Local symbol. */ + int shndx = isym[r_symndx].st_shndx; + + bfd_vma st_value = (isym + r_symndx)->st_value; + isec = elf_elfsections (abfd)[shndx]->bfd_section; + relocation = (isec->output_section->vma + isec->output_offset + + st_value + irel->r_addend); + } + else + { + /* External symbol. */ + bfd_boolean warned ATTRIBUTE_UNUSED; + bfd_boolean unresolved_reloc ATTRIBUTE_UNUSED; + asection *sym_sec; + + /* Maybe there is a better way to get h and relocation */ + RELOC_FOR_GLOBAL_SYMBOL (link_info, abfd, sec, irel, + r_symndx, symtab_hdr, sym_hashes, + h, sym_sec, relocation, + unresolved_reloc, warned); + relocation += irel->r_addend; + if ((h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + || strcmp (h->root.root.string, "_FP_BASE_") == 0) + { + off += 4; + continue; + } + } + + /* Check for gp relative instruction alignment. */ + if ((ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3 + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0_RELA) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA12S2_DP_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA12S2_SP_RELA) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA16S3_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA19S0_RELA)) + { + bfd_vma gp; + bfd *output_bfd = sec->output_section->owner; + bfd_reloc_status_type r; + + /* If the symbol is in the abs section, the out_bfd will be + null. This happens when the relocation has a + symbol@GOTOFF. */ + r = nds32_elf_final_sda_base (output_bfd, link_info, + &gp, FALSE); + if (r != bfd_reloc_ok) + { + off += 4; + continue; + } + + relocation -= gp; + + /* Make sure alignment is correct. */ + if (relocation & align) + { + /* Incorrect alignment. */ + (*_bfd_error_handler) + (_("%s: warning: unaligned small data access. " + "For entry: {%d, %d, %d}, addr = 0x%x, align = 0x%x."), + bfd_get_filename (abfd), irel->r_offset, + irel->r_info, irel->r_addend, relocation, align); + off += 4; + continue; + } + } + + insn = insn_with_reg + | ((relocation >> shift) & nds32_elf_irel_mask (irel)); + } + else + { + off += 4; + continue; + } + } + + snprintf (code, sizeof (code), "%08x", insn); + /* Copy "code". */ + entry = (struct elf_nds32_code_hash_entry*) + bfd_hash_lookup (&ex9_code_table, code, TRUE, TRUE); + if (entry == NULL) + { + (*_bfd_error_handler) + (_("%P%F: failed creating ex9.it %s hash table: %E\n"), code); + return FALSE; + } + if (h) + { + if (h->root.type == bfd_link_hash_undefined) + return TRUE; + /* Global symbol. */ + /* In order to do sethi with different symbol but same value. */ + if (entry->m_list == NULL) + { + struct elf_link_hash_entry_mul_list *m_list_new; + struct elf_link_hash_entry_list *h_list_new; + + m_list_new = (struct elf_link_hash_entry_mul_list *) + bfd_malloc (sizeof (struct elf_link_hash_entry_mul_list)); + h_list_new = (struct elf_link_hash_entry_list *) + bfd_malloc (sizeof (struct elf_link_hash_entry_list)); + entry->m_list = m_list_new; + m_list_new->h_list = h_list_new; + m_list_new->rel_backup = rel_backup; + m_list_new->times = 1; + m_list_new->irel = jrel; + m_list_new->next = NULL; + h_list_new->h = h; + h_list_new->next = NULL; + } + else + { + struct elf_link_hash_entry_mul_list *m_list = entry->m_list; + struct elf_link_hash_entry_list *h_list; + + while (m_list) + { + /* Build the different symbols that point to the same address. */ + h_list = m_list->h_list; + if (h_list->h->root.u.def.value == h->root.u.def.value + && h_list->h->root.u.def.section->output_section->vma + == h->root.u.def.section->output_section->vma + && h_list->h->root.u.def.section->output_offset + == h->root.u.def.section->output_offset + && m_list->rel_backup.r_addend == rel_backup.r_addend) + { + m_list->times++; + m_list->irel = jrel; + while (h_list->h != h && h_list->next) + h_list = h_list->next; + if (h_list->h != h) + { + struct elf_link_hash_entry_list *h_list_new; + + h_list_new = (struct elf_link_hash_entry_list *) + bfd_malloc (sizeof (struct elf_link_hash_entry_list)); + h_list->next = h_list_new; + h_list_new->h = h; + h_list_new->next = NULL; + } + break; + } + /* The sethi case may have different address but the + hi20 is the same. */ + else if (ELF32_R_TYPE (jrel->r_info) == R_NDS32_HI20_RELA + && m_list->next == NULL) + { + struct elf_link_hash_entry_mul_list *m_list_new; + struct elf_link_hash_entry_list *h_list_new; + + m_list_new = (struct elf_link_hash_entry_mul_list *) + bfd_malloc (sizeof (struct elf_link_hash_entry_mul_list)); + h_list_new = (struct elf_link_hash_entry_list *) + bfd_malloc (sizeof (struct elf_link_hash_entry_list)); + m_list->next = m_list_new; + m_list_new->h_list = h_list_new; + m_list_new->rel_backup = rel_backup; + m_list_new->times = 1; + m_list_new->irel = jrel; + m_list_new->next = NULL; + h_list_new->h = h; + h_list_new->next = NULL; + break; + } + m_list = m_list->next; + } + if (!m_list) + { + off += 4; + continue; + } + } + } + else + { + /* Local symbol and insn without relocation*/ + entry->times++; + entry->rel_backup = rel_backup; + } + + /* Use in sethi insn with constant and global symbol in same format. */ + if (!jrel) + entry->const_insn = 1; + else + entry->irel = jrel; + entry->sec = isec; + off += 4; + } + return TRUE; +} + +/* Set the _ITB_BASE_, and point it to ex9 table. */ + +bfd_boolean +nds32_elf_ex9_itb_base (struct bfd_link_info *link_info) +{ + asection *sec; + bfd *output_bfd = NULL; + struct bfd_link_hash_entry *bh = NULL; + + if (is_ITB_BASE_set == 1) + return TRUE; + + is_ITB_BASE_set = 1; + + sec = nds32_elf_ex9_get_section (link_info->input_bfds); + if (sec != NULL) + output_bfd = sec->output_section->owner; + + if (output_bfd == NULL) + { + output_bfd = link_info->output_bfd; + if (output_bfd->sections == NULL) + return TRUE; + else + sec = bfd_abs_section_ptr; + } + + /* Do not define _ITB_BASE_ if it is not used. + And remain user to set it if needed. */ + + bh = bfd_link_hash_lookup (link_info->hash, "_ITB_BASE_", + FALSE, FALSE, TRUE); + if (!bh) + return TRUE; + + return (_bfd_generic_link_add_one_symbol + (link_info, output_bfd, "_ITB_BASE_", BSF_GLOBAL | BSF_WEAK, + sec, 0, (const char *) NULL, FALSE, + get_elf_backend_data (output_bfd)->collect, &bh)); +} +/* End EX9.IT */ + + +/* Begining IFC. This is common code ifc optimization. */ + +struct elf_nds32_ifc_code_hash_entry; +struct elf_nds32_ifc_unit; + +/* Save the offset and section. */ + +struct elf_nds32_ifc_member +{ + unsigned long int offset; + asection *sec; + + /* Link to its unit. */ + struct elf_nds32_ifc_unit *unit_p; + + /* Link to its previous entry. */ + struct elf_nds32_ifc_code_hash_entry *pre_entry; + + /* Save next insnstrution member to find group quickly. */ + struct elf_nds32_ifc_member *next_member; + struct elf_nds32_ifc_member *pre_member; + /* Save the jump target for the previous instruction. */ + struct bfd_link_hash_entry *bh; + bfd_boolean dead; + struct elf_nds32_ifc_member *next; +}; + +/* The unit of elf_nds32_ifc_code_hash_entry. */ + +struct elf_nds32_ifc_unit +{ + int times; + int done; + struct elf_nds32_ifc_member *member; + + /* Link to its entry. */ + struct elf_nds32_ifc_code_hash_entry *entry_p; + + /* Save next insnstruction entry. */ + struct elf_nds32_ifc_code_hash_entry *hash; + struct elf_nds32_ifc_unit *next; +}; + +/* Instruction hash table. */ + +struct elf_nds32_ifc_code_hash_entry +{ + struct bfd_hash_entry root; + int times; + int size; + struct elf_nds32_ifc_unit *unit; + struct elf_link_hash_entry *h; + + /* Save the max times unit in this entry. */ + struct elf_nds32_ifc_unit *max_unit; + struct elf_nds32_ifc_code_hash_entry *next; /* For sort times. */ + int round; /* Save round of nds32_elf_ifc_find_cse to avoid reentrance. */ + struct elf_nds32_ifc_code_hash_entry *max_next; + bfd_boolean end; /* This is instruction can break ifc block. */ + int max_times; +}; + +/* Structure for replace using. */ + +struct elf_nds32_ifc_insn_member +{ + struct elf_nds32_ifc_member *member; + struct elf_nds32_ifc_insn_member *next; +}; + +struct elf_nds32_ifc_insn_stack +{ + int live; + int extend; + int choose; + struct elf_nds32_ifc_insn_member *imember; + struct elf_nds32_ifc_insn_stack *next; +}; + +/* Save members in the same section. */ + +struct elf_nds32_ifc_sec_member +{ + struct elf_nds32_ifc_member *member; + struct elf_nds32_ifc_sec_member *next; +}; + +struct elf_nds32_ifc_sec_block +{ + asection *sec; + struct elf_nds32_ifc_sec_member *smember; + struct elf_nds32_ifc_sec_block *next; +}; + +struct elf_nds32_ifc_barrier +{ + bfd_vma offset; + struct elf_nds32_ifc_barrier *next; +}; + +/* Ifc global symbol. */ +struct bfd_hash_table ifc_code_table; +struct elf_nds32_ifc_code_hash_entry *ifc_insn_head = NULL; +struct elf_nds32_ifc_sec_block *ifc_block_head = NULL; + +/* IFC hash function. */ + +static struct bfd_hash_entry * +nds32_elf_ifc_code_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) +{ + struct elf_nds32_ifc_code_hash_entry *ret; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = (struct bfd_hash_entry *) + bfd_hash_allocate (table, sizeof (*ret)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = bfd_hash_newfunc (entry, table, string); + if (entry == NULL) + return entry; + + ret = (struct elf_nds32_ifc_code_hash_entry*) entry; + ret->times = 0; + ret->unit = NULL; + ret->next = NULL; + ret->size = 0; + ret->h = NULL; + ret->max_unit = NULL; + ret->round = 0; + ret->max_next = NULL; + ret->max_times = 0; + ret->end = FALSE; + return &ret->root; +} + +/* Do TLS model conversion. */ + +typedef struct relax_group_list_t +{ + Elf_Internal_Rela *relo; + struct relax_group_list_t *next; + struct relax_group_list_t *next_sibling; + int id; +} relax_group_list_t; + +int +list_insert (relax_group_list_t *pHead, Elf_Internal_Rela *pElem); + +int +list_insert_sibling (relax_group_list_t *pNode, Elf_Internal_Rela *pElem); + +void +dump_chain (relax_group_list_t *pHead); + +int +list_insert (relax_group_list_t *pHead, Elf_Internal_Rela *pElem) +{ + relax_group_list_t *pNext = pHead; + + /* find place */ + while (pNext->next) + { + if (pNext->next->id > (int) pElem->r_addend) + break; + + pNext = pNext->next; + } + + /* insert node */ + relax_group_list_t *pNew = bfd_malloc (sizeof (relax_group_list_t)); + if (!pNew) + return FALSE; + + relax_group_list_t *tmp = pNext->next; + pNext->next = pNew; + + pNew->id = pElem->r_addend; + pNew->relo = pElem; + pNew->next = tmp; + pNew->next_sibling = NULL; + + return TRUE; +} + +int +list_insert_sibling (relax_group_list_t *pNode, Elf_Internal_Rela *pElem) +{ + relax_group_list_t *pNext = pNode; + + /* find place */ + while (pNext->next_sibling) + { + pNext = pNext->next_sibling; + } + + /* insert node */ + relax_group_list_t *pNew = bfd_malloc (sizeof (relax_group_list_t)); + if (!pNew) + return FALSE; + + relax_group_list_t *tmp = pNext->next_sibling; + pNext->next_sibling = pNew; + + pNew->id = -1; + pNew->relo = pElem; + pNew->next = NULL; + pNew->next_sibling = tmp; + + return TRUE; +} + +void +dump_chain (relax_group_list_t *pHead) +{ + relax_group_list_t *pNext = pHead->next; + while (pNext) + { + printf("group %d @ 0x%08x", pNext->id, (unsigned)pNext->relo->r_offset); + relax_group_list_t *pNextSib = pNext->next_sibling; + while (pNextSib) + { + printf(", %d", (unsigned) ELF32_R_TYPE (pNextSib->relo->r_info)); + pNextSib = pNextSib->next_sibling; + } + pNext = pNext->next; + printf("\n"); + } +} + +/* check R_NDS32_RELAX_GROUP of each section. + * there might be multiple sections in one object file. + */ +int +elf32_nds32_check_relax_group (bfd *abfd, asection *asec) +{ + elf32_nds32_relax_group_t *relax_group_ptr = + elf32_nds32_relax_group_ptr (abfd); + + int min_id = relax_group_ptr->min_id; + int max_id = relax_group_ptr->max_id; + + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + Elf_Internal_Rela *relocs; + enum elf_nds32_reloc_type rtype; + + do + { + /* Relocations MUST be kept in memory, because relaxation adjust them. */ + relocs = _bfd_elf_link_read_relocs (abfd, asec, NULL, NULL, + TRUE /* keep_memory */); + if (relocs == NULL) + break; + + /* check R_NDS32_RELAX_GROUP */ + relend = relocs + asec->reloc_count; + for (rel = relocs; rel < relend; rel++) + { + int id; + rtype = ELF32_R_TYPE (rel->r_info); + if (rtype != R_NDS32_RELAX_GROUP) + continue; + + id = rel->r_addend; + if (id < min_id) + min_id = id; + else if (id > max_id) + max_id = id; + } + } + while (FALSE); + + if ((relocs != NULL) && (elf_section_data (asec)->relocs != relocs)) + free (relocs); + + if ((min_id != relax_group_ptr->min_id) + || (max_id != relax_group_ptr->max_id)) + { + relax_group_ptr->count = max_id - min_id + 1; + BFD_ASSERT(min_id <= relax_group_ptr->min_id); + relax_group_ptr->min_id = min_id; + BFD_ASSERT(max_id >= relax_group_ptr->max_id); + relax_group_ptr->max_id = max_id; + } + + return relax_group_ptr->count; +} + +/* reorder RELAX_GROUP ID when command line option '-r' is applied */ +/* TODO: find a way to free me. */ +struct section_id_list_t *relax_group_section_id_list = NULL; + +struct section_id_list_t * +elf32_nds32_lookup_section_id (int id, struct section_id_list_t **lst_ptr) +{ + struct section_id_list_t *result = NULL; + struct section_id_list_t *lst = *lst_ptr; + + if (NULL == lst) + { + result = (struct section_id_list_t *) calloc ( + 1, sizeof (struct section_id_list_t)); + BFD_ASSERT (result); /* feed me */ + result->id = id; + *lst_ptr = result; + } + else + { + struct section_id_list_t *cur = lst; + struct section_id_list_t *prv = NULL; + struct section_id_list_t *sec = NULL; + while (cur) + { + if (cur->id < id) + { + prv = cur; + cur = cur->next; + continue; + } + + if (cur->id > id) + { + cur = NULL; /* to insert after prv */ + sec = cur; /* in case prv == NULL */ + } + + break; + } + + if (NULL == cur) + { + /* insert after prv */ + result = (struct section_id_list_t *) calloc ( + 1, sizeof (struct section_id_list_t)); + BFD_ASSERT (result); /* feed me */ + result->id = id; + if (NULL != prv) + { + result->next = prv->next; + prv->next = result; + } + else + { + *lst_ptr = result; + result->next = sec; + } + } + } + + return result; +} + +int +elf32_nds32_unify_relax_group (bfd *abfd, asection *asec) +{ + static int next_relax_group_bias = 0; + + elf32_nds32_relax_group_t *relax_group_ptr = + elf32_nds32_relax_group_ptr (abfd); + + bfd_boolean result = TRUE; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + Elf_Internal_Rela *relocs = NULL; + enum elf_nds32_reloc_type rtype; + struct section_id_list_t *node = NULL; + int count = 0; + + do + { + if (0 == relax_group_ptr->count) + break; + + /* check if this section has handled */ + node = elf32_nds32_lookup_section_id (asec->id, &relax_group_section_id_list); + if (NULL == node) + break; /* hit, the section id has handled. */ + + /* Relocations MUST be kept in memory, because relaxation adjust them. */ + relocs = _bfd_elf_link_read_relocs (abfd, asec, NULL, NULL, + TRUE /* keep_memory */); + if (relocs == NULL) + { + BFD_ASSERT (0); /* feed me */ + break; + } + + /* allocate group id bias for this bfd! */ + if (0 == relax_group_ptr->init) + { + relax_group_ptr->bias = next_relax_group_bias; + next_relax_group_bias += relax_group_ptr->count; + relax_group_ptr->init = 1; + } + + /* reorder relax group groups */ + relend = relocs + asec->reloc_count; + for (rel = relocs; rel < relend; rel++) + { + rtype = ELF32_R_TYPE(rel->r_info); + if (rtype != R_NDS32_RELAX_GROUP) + continue; + + /* change it */ + rel->r_addend += relax_group_ptr->bias; + /* debugging count */ + count++; + } + } + while (FALSE); + + if (relocs != NULL && elf_section_data (asec)->relocs != relocs) + free (relocs); + + return result; +} + +int +nds32_elf_unify_tls_model (bfd *inbfd, asection *insec, bfd_byte *incontents, + struct bfd_link_info *lnkinfo) +{ + bfd_boolean result = TRUE; + Elf_Internal_Rela *irel; + Elf_Internal_Rela *irelend; + Elf_Internal_Rela *internal_relocs; + unsigned long r_symndx; + enum elf_nds32_reloc_type r_type; + + Elf_Internal_Sym *local_syms = NULL; + bfd_byte *contents = NULL; + + relax_group_list_t chain = { .id = -1, .next = NULL, .next_sibling = NULL }; + + Elf_Internal_Shdr *symtab_hdr = &elf_tdata (inbfd)->symtab_hdr; + struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; + sym_hashes = elf_sym_hashes (inbfd); + sym_hashes_end = + sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym); + if (!elf_bad_symtab (inbfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + /* reorder RELAX_GROUP when command line option '-r' is applied */ + if (lnkinfo->relocatable) + { + elf32_nds32_unify_relax_group (inbfd, insec); + /* goto finish; */ + return result; + } + + /* Relocations MUST be kept in memory, because relaxation adjust them. */ + internal_relocs = _bfd_elf_link_read_relocs (inbfd, insec, NULL, NULL, + TRUE /* keep_memory */); + if (internal_relocs == NULL) + goto error_return; + + irelend = internal_relocs + insec->reloc_count; + irel = find_relocs_at_address (internal_relocs, internal_relocs, + irelend, R_NDS32_RELAX_ENTRY); + if (irel == irelend) + goto finish; + + /* chain/remove groups */ + for (irel = internal_relocs; irel < irelend; irel++) + { + r_symndx = ELF32_R_SYM (irel->r_info); + r_type = ELF32_R_TYPE (irel->r_info); + if (r_type != R_NDS32_RELAX_GROUP) + continue; + + /* remove it */ + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_NONE); + /* chain it now */ + if (!list_insert (&chain, irel)) + goto error_return; + } + + /* collect group relocations */ + /* presume relocations are sorted */ + relax_group_list_t *pNext = chain.next; + if (pNext) + { + for (irel = internal_relocs; irel < irelend; irel++) + { + if (irel->r_offset == pNext->relo->r_offset) + { + /* ignore Non-TLS relocation types */ + r_type = ELF32_R_TYPE (irel->r_info); + if ((R_NDS32_TLS_TPOFF > r_type) + || (R_NDS32_RELAX_ENTRY == r_type)) + continue; + + if (!list_insert_sibling (pNext, irel)) + goto error_return; + } + else if (irel->r_offset > pNext->relo->r_offset) + { + pNext = pNext->next; + if (!pNext) + break; + + bfd_vma current_offset = pNext->relo->r_offset; + if (irel->r_offset > current_offset) + irel = internal_relocs; /* restart from head */ + else + --irel; /* check current irel again */ + continue; + } + else + { + //printf("irel->off = 0x%08x, pNext->relo->off = 0x%08x (0x%08x)\n", (unsigned)irel->r_offset, (unsigned)pNext->relo->r_offset, (unsigned)first_offset); + } + } + } + +#ifdef DUBUG_VERBOSE + dump_chain(&chain); +#endif + + /* Get symbol table and section content. */ + if (incontents) + contents = incontents; + else if (!nds32_get_section_contents (inbfd, insec, &contents, TRUE) + || !nds32_get_local_syms (inbfd, insec, &local_syms)) + goto error_return; + + char *local_got_tls_type = elf32_nds32_local_got_tls_type (inbfd); + + /* convert TLS model each group if necessary */ + pNext = chain.next; + int cur_grp_id = -1; + int sethi_rt = -1; + int add_rt = -1; + enum elf_nds32_tls_type tls_type, org_tls_type, eff_tls_type; + tls_type = org_tls_type = eff_tls_type = 0; + while (pNext) + { + relax_group_list_t *pNextSig = pNext->next_sibling; + while (pNextSig) + { + struct elf_link_hash_entry *h = NULL; + irel = pNextSig->relo; + r_symndx = ELF32_R_SYM(irel->r_info); + r_type = ELF32_R_TYPE(irel->r_info); + + if (pNext->id != cur_grp_id) + { + cur_grp_id = pNext->id; + org_tls_type = get_tls_type (r_type, NULL); + if (r_symndx >= symtab_hdr->sh_info) + { + 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; + tls_type = ((struct elf_nds32_link_hash_entry *) h)->tls_type; + } + else + { + /* TODO: find local symbol hash if necessary? */ + tls_type = local_got_tls_type ? local_got_tls_type[r_symndx] : GOT_NORMAL; + } + + eff_tls_type = 1 << (fls (tls_type) - 1); + sethi_rt = N32_RT5(bfd_getb32 (contents + irel->r_offset)); + } + + if (eff_tls_type != org_tls_type) + { + switch (org_tls_type) + { + case GOT_TLS_DESC: + switch (eff_tls_type) + { + case GOT_TLS_IE: + switch (r_type) + { + case R_NDS32_TLS_DESC_HI20: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IE_HI20); + break; + case R_NDS32_TLS_DESC_LO12: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IE_LO12); + break; + case R_NDS32_TLS_DESC_ADD: + { + uint32_t insn = bfd_getb32 ( + contents + irel->r_offset); + add_rt = N32_RT5 (insn); + insn = N32_TYPE2 (LWI, add_rt, sethi_rt, 0); + bfd_putb32 (insn, contents + irel->r_offset); + + irel->r_info = ELF32_R_INFO(r_symndx, R_NDS32_NONE); +/* irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_IE_LW); +*/ + } + break; + case R_NDS32_TLS_DESC_FUNC: + bfd_putb32 (INSN_NOP, contents + irel->r_offset); + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_RELAX_REMOVE); + break; + case R_NDS32_TLS_DESC_CALL: + { + uint32_t insn = N32_ALU1(ADD, REG_R0, add_rt, + REG_TP); + bfd_putb32 (insn, contents + irel->r_offset); + + irel->r_info = ELF32_R_INFO(r_symndx, R_NDS32_NONE); + } + break; + case R_NDS32_LOADSTORE: + case R_NDS32_PTR: + case R_NDS32_PTR_RESOLVED: + case R_NDS32_NONE: + case R_NDS32_LABEL: + break; + default: + BFD_ASSERT(0); + break; + } + break; + case GOT_TLS_IEGP: + switch (r_type) + { + case R_NDS32_TLS_DESC_HI20: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IEGP_HI20); + break; + case R_NDS32_TLS_DESC_LO12: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IEGP_LO12); + break; + case R_NDS32_TLS_DESC_ADD: + { + uint32_t insn = bfd_getb32 ( + contents + irel->r_offset); + add_rt = N32_RT5 (insn); + insn = N32_MEM(LW, add_rt, sethi_rt, REG_GP, 0); + bfd_putb32 (insn, contents + irel->r_offset); + + irel->r_info = ELF32_R_INFO(r_symndx, R_NDS32_NONE); +/* irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_IEGP_LW); +*/ + } + break; + case R_NDS32_TLS_DESC_FUNC: + bfd_putb32 (INSN_NOP, contents + irel->r_offset); + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_RELAX_REMOVE); + break; + case R_NDS32_TLS_DESC_CALL: + { + uint32_t insn = N32_ALU1(ADD, REG_R0, add_rt, + REG_TP); + bfd_putb32 (insn, contents + irel->r_offset); + + irel->r_info = ELF32_R_INFO(r_symndx, R_NDS32_NONE); + } + break; + case R_NDS32_LOADSTORE: + case R_NDS32_PTR: + case R_NDS32_PTR_RESOLVED: + case R_NDS32_NONE: + case R_NDS32_LABEL: + break; + default: + BFD_ASSERT(0); + break; + } + break; + default: +#ifdef DEBUG_VERBOSE + printf ( + "SKIP: %s: %s @ 0x%08x tls_type = 0x%08x, eff_tls_type = 0x%08x, org_tls_type = 0x%08x\n", + inbfd->filename, h ? h->root.root.string : "local", + (unsigned) irel->r_offset, tls_type, eff_tls_type, + org_tls_type); +#endif + break; + } + break; + case GOT_TLS_IEGP: + switch (eff_tls_type) + { + case GOT_TLS_IE: + switch (r_type) + { + case R_NDS32_TLS_IEGP_HI20: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IE_HI20); + break; + case R_NDS32_TLS_IEGP_LO12: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IE_LO12); + break; + case R_NDS32_PTR_RESOLVED: + { + uint32_t insn = bfd_getb32 ( + contents + irel->r_offset); + add_rt = N32_RT5 (insn); + insn = N32_TYPE2 (LWI, add_rt, sethi_rt, 0); + bfd_putb32 (insn, contents + irel->r_offset); + } + break; + case R_NDS32_LOADSTORE: + case R_NDS32_PTR: + case R_NDS32_NONE: + case R_NDS32_LABEL: + break; + default: + BFD_ASSERT(0); + break; + } + break; + default: +#ifdef DEBUG_VERBOSE + printf ( + "SKIP: %s: %s @ 0x%08x tls_type = 0x%08x, eff_tls_type = 0x%08x, org_tls_type = 0x%08x\n", + inbfd->filename, h ? h->root.root.string : "local", + (unsigned) irel->r_offset, tls_type, eff_tls_type, + org_tls_type); +#endif + break; + } + break; + default: +#ifdef DEBUG_VERBOSE + printf ( + "SKIP: %s: %s @ 0x%08x tls_type = 0x%08x, eff_tls_type = 0x%08x, org_tls_type = 0x%08x\n", + inbfd->filename, h ? h->root.root.string : "local", + (unsigned) irel->r_offset, tls_type, eff_tls_type, + org_tls_type); +#endif + break; + } + } + pNextSig = pNextSig->next_sibling; + } + +#if 1 + pNext = pNext->next; +#else + while (pNext) + { + if (pNext->id != cur_grp_id) + break; + pNext = pNext->next; + } +#endif + } + +finish: + if (incontents) + contents = NULL; + + if (internal_relocs != NULL + && elf_section_data (insec)->relocs != internal_relocs) + free (internal_relocs); + + if (contents != NULL + && elf_section_data (insec)->this_hdr.contents != contents) + free (contents); + + if (local_syms != NULL && symtab_hdr->contents != (bfd_byte *) local_syms) + free (local_syms); + + if (chain.next) + { + pNext = chain.next; + relax_group_list_t *pDel; + while (pNext) + { + pDel = pNext; + pNext = pNext->next; + free (pDel); + } + } + + return result; + +error_return: + result = FALSE; + goto finish; +} + +/* Initialize ifc hash table. */ + +static int +nds32_elf_ifc_init (void) +{ + static bfd_boolean done = FALSE; + if (done) + return TRUE; + + done = TRUE; + if (!bfd_hash_table_init (&ifc_code_table, nds32_elf_ifc_code_hash_newfunc, + sizeof (struct elf_nds32_ifc_code_hash_entry))) + { + (*_bfd_error_handler) (_("Ld error: cannot init ifc hash table\n")); + return FALSE; + } + return TRUE; +} + +/* New a unit and insert ifc hash entry. */ + +static void +nds32_elf_ifc_new_ifc_unit (struct elf_nds32_ifc_code_hash_entry *entry, + struct elf_nds32_ifc_code_hash_entry *pre_entry, + struct elf_nds32_ifc_member *child, + struct elf_nds32_ifc_member *pre_child) +{ + struct elf_nds32_ifc_unit *ptr_unit, *temp_unit; + struct elf_nds32_ifc_member *ptr_member; + + if (!pre_entry || !pre_child) + return; + + /* Find unit in entry. */ + ptr_unit = pre_entry->unit; + temp_unit = ptr_unit; + while (ptr_unit && ptr_unit->hash != entry) + { + temp_unit = ptr_unit; + ptr_unit = ptr_unit->next; + } + if (!ptr_unit) + { + ptr_unit = bfd_malloc (sizeof (struct elf_nds32_ifc_unit)); + if (!pre_entry->unit) + pre_entry->unit = ptr_unit; + else + temp_unit->next = ptr_unit; + ptr_unit->times = 0; + ptr_unit->member = NULL; + ptr_unit->hash = entry; + ptr_unit->next = NULL; + ptr_unit->entry_p = pre_entry; + ptr_unit->done = 0; + } + pre_child->next_member = child; + pre_child->unit_p = ptr_unit; + ptr_unit->times++; + if (!pre_entry->max_unit + || pre_entry->max_unit->times < ptr_unit->times) + pre_entry->max_unit = ptr_unit; + + /* Insert member into unit. */ + ptr_member = ptr_unit->member; + while (ptr_member && ptr_member->next) + ptr_member = ptr_member->next; + + if (!ptr_member) + ptr_unit->member = pre_child; + else + ptr_member->next = pre_child; +} + +/* Insert the symbol and relocation barrier list. */ + +static void +nds32_elf_ifc_insert_barrier (int offset, + struct elf_nds32_ifc_barrier ** barrier) +{ + struct elf_nds32_ifc_barrier *new_barrier; + struct elf_nds32_ifc_barrier *last_barrier; + + /* The symbol is in this section. */ + new_barrier = malloc (sizeof (struct elf_nds32_ifc_barrier)); + new_barrier->offset = offset; + new_barrier->next = NULL; + if (*barrier == NULL) + *barrier = new_barrier; + else + { + if (new_barrier->offset < (*barrier)->offset) + { + new_barrier->next = *barrier; + *barrier = new_barrier; + } + else + { + last_barrier = *barrier; + while (last_barrier->next + && last_barrier->next->offset < new_barrier->offset) + last_barrier = last_barrier->next; + new_barrier->next = last_barrier->next; + last_barrier->next = new_barrier; + } + } +} + +/* Build barrier list. */ + +static bfd_boolean +nds32_elf_ifc_build_barrier (bfd *abfd, asection *sec, + struct elf_nds32_ifc_barrier **barrier) +{ + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd); + Elf_Internal_Shdr *hdr; + bfd_size_type symcount; + bfd_size_type extsymcount; + struct bfd_link_hash_entry *bh; + Elf_Internal_Rela *internal_relocs, *irelend, *irel; + unsigned int sec_shndx; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Sym *isym = NULL; + unsigned int i; + + /* Scan global symbol. */ + if (sym_hashes) + { + if (!(abfd->flags & DYNAMIC) || elf_dynsymtab (abfd) == 0) + hdr = &elf_tdata (abfd)->symtab_hdr; + else + return FALSE; + + /* Check for the symbol existence. */ + symcount = hdr->sh_size / bed->s->sizeof_sym; + extsymcount = symcount - hdr->sh_info; + for (i = 0; i < extsymcount; i++) + { + bh = (struct bfd_link_hash_entry *) *(sym_hashes + i); + if (bh->u.def.section == sec) + nds32_elf_ifc_insert_barrier (bh->u.def.value, barrier); + } + } + + /* Scan relocations to get the local target. */ + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + TRUE /* keep_memory */); + irelend = internal_relocs + sec->reloc_count; + sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + if (!nds32_get_local_syms (abfd, sec, &isym)) + return FALSE; + + for (i = 0; i < symtab_hdr->sh_info; i++) + { + if ((isym + i)->st_value > 0 + && (isym + i)->st_shndx == sec_shndx + && (isym + i)->st_value <= sec->size + && ELF32_ST_TYPE ((isym + i)->st_info) == STT_FUNC) + { + nds32_elf_ifc_insert_barrier ((isym + i)->st_value, barrier); + } + } + + for (irel = internal_relocs; irel < irelend; irel++) + { + if (ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY + && ELF32_R_TYPE (irel->r_info) != R_NDS32_LABEL + && ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info + && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx) + { + /* FIXME: DIFFxx relcoations have to be do something more. */ + nds32_elf_ifc_insert_barrier (irel->r_addend, barrier); + } + } + return TRUE; +} + +/* Trace all section and build the instruction list. */ +/* We collect all instruction here, and put each same insntruction in + the same hash entry. Each entry has to save all appearance section + and offset. */ + +static bfd_boolean +nds32_elf_ifc_trace_code (struct bfd_link_info *link_info, + bfd *abfd, asection *sec) +{ + Elf_Internal_Rela *internal_relocs, *irelend, *irel; + bfd_byte *contents = NULL; + unsigned int off = 0, insn_size; + unsigned long insn; + struct elf_nds32_ifc_code_hash_entry *entry, *pre_entry; + struct elf_nds32_ifc_member *pre_child, *child; + struct elf_nds32_ifc_sec_block *block; + struct elf_nds32_ifc_sec_member *smember, *cur_smember;; + char code[20]; + struct elf_nds32_ifc_barrier *barrier = NULL, *ptr_barrier; + bfd_boolean ignore, end; + struct elf_link_hash_entry **sym_hashes; + unsigned long r_symndx; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *isymbuf = NULL; + + pre_entry = NULL; + pre_child = NULL; + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + TRUE /* keep_memory */); + irelend = internal_relocs + sec->reloc_count; + + /* Check the object if enable ifc. */ + irel = find_relocs_at_address (internal_relocs, internal_relocs, irelend, + R_NDS32_RELAX_ENTRY); + + /* Check this section trigger ifc relaxation. */ + if (irel == NULL + || irel >= irelend + || ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY + || (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY + && !(irel->r_addend & R_NDS32_RELAX_ENTRY_IFC_FLAG))) + return TRUE; + + if (!nds32_get_section_contents (abfd, sec, &contents, TRUE)) + return FALSE; + + elf_section_data (sec)->relocs = internal_relocs; + sym_hashes = elf_sym_hashes (abfd); + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + nds32_get_local_syms (abfd, sec, &isymbuf); + /* Backup header size and restore it after relocation because ifc + optimization may modify this value. */ + elf_nds32_tdata (abfd)->hdr_size = symtab_hdr->sh_size; + + /* Build barrier list. If there is any label or target in somewhere, + this instruction can not be delete. It has to traverse global symbol + hash table and relocations to get all possible label. */ + nds32_elf_ifc_build_barrier (abfd, sec, &barrier); + + /* Start to traverse content. */ + irel = internal_relocs; + ptr_barrier = barrier; + + block = malloc (sizeof (struct elf_nds32_ifc_sec_block)); + block->sec = sec; + block->smember = NULL; + block->next = ifc_block_head; + ifc_block_head = block; + cur_smember = NULL; + + while (off < sec->size) + { + h = NULL; + ignore = FALSE; + end = FALSE; + + while (irel != NULL && irel < irelend && irel->r_offset < off) + irel++; + while (ptr_barrier && ptr_barrier->offset < off) + ptr_barrier = ptr_barrier->next; + + /* Get binary code. */ + if (*(contents + off) & 0x80) + { + /* 16-bit instuction. */ + insn = bfd_getb16 (contents + off); + snprintf (code, sizeof (code), "%04lx", insn); + insn_size = 2; + + /* Clean insntruction regiter for jr5 and jral5. */ + switch (insn & 0xff00) + { + /* Because there is no relocation for jr5 and jral5 in case + longjump and longcall, it has to ignore it for ifc. */ + /* jr5 ret5 jral5 add5.pc ex9.it. */ + case INSN_JR5: + ignore = TRUE; + break; + default: + break; + } + } + else + { + /* 32-bit instuction. */ + insn = bfd_getb32 (contents + off); + snprintf (code, sizeof (code), "%08lx", insn); + insn_size = 4; + switch (N32_OP6 (insn)) + { + case N32_OP6_JREG: + /* jr and jral. */ + ignore = TRUE; + break; + case N32_OP6_MISC: + if (N32_SUB5 (insn) == N32_MISC_MTSR + || N32_SUB5 (insn) == N32_MISC_MFSR) + ignore = TRUE; + break; + case N32_OP6_ALU2: + if (N32_SUB6 (insn) == N32_ALU2_MTUSR + || N32_SUB6 (insn) == N32_ALU2_MFUSR) + ignore = TRUE; + break; + default: + break; + } + } + + /* Check the IFC ignored region. */ + if (irel && irel < irelend + && nds32_elf_ifc_check_region (&irel, irelend, link_info)) + { + if (irel == NULL || irel >= irelend) + return TRUE; + off = irel->r_offset; + off += ((*(contents + off) & 0x80) != 0 ? 2 : 4); + pre_entry = NULL; + pre_child = NULL; + continue; + } + /* Ignore instruction with relocation. */ + /* It can add instruction with relocation to ifc in the future. + I think only the global target can do. We may try to compare + post and link ifc to know what kinds of relocation are most needed + being done first. */ + else if (ignore == TRUE) + { + /* Set a new basic block. */ + off += insn_size; + pre_entry = NULL; + pre_child = NULL; + continue; + } + else if (irel < irelend && irel->r_offset == off + && (ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3 + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0_RELA) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA12S2_DP_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA12S2_SP_RELA) + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA16S3_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA19S0_RELA))) + { + r_symndx = ELF32_R_SYM (irel->r_info); + if (r_symndx < symtab_hdr->sh_info) + { + /* Ignore local symbol, so set a new basic block. */ + off += insn_size; + pre_entry = NULL; + pre_child = NULL; + continue; + } + else + { + /* Global jump target, keep going. */ + bfd_boolean warned ATTRIBUTE_UNUSED; + bfd_boolean unresolved_reloc ATTRIBUTE_UNUSED; + bfd_vma relocation; + asection *sym_sec; + + RELOC_FOR_GLOBAL_SYMBOL (link_info, abfd, sec, irel, + r_symndx, symtab_hdr, sym_hashes, + h, sym_sec, relocation, + unresolved_reloc, warned); + relocation += irel->r_addend; + /* J and JAL has to shift one bit. Here, we use absolute addresss + to build hash entry. */ + snprintf (code, sizeof (code), "%08lx%08lx", relocation, insn); + } + + if ((ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA + && (insn == INSN_JAL || insn == INSN_J))) + end = TRUE; + } + else if (irel < irelend && irel->r_offset == off + && ELF32_R_TYPE (irel->r_info) >= R_NDS32_9_PCREL_RELA + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_17_PCREL_RELA) + { + r_symndx = ELF32_R_SYM (irel->r_info); + if (r_symndx < symtab_hdr->sh_info) + { + /* Local symbol. */ + bfd_vma relocation; + int shndx = isymbuf[r_symndx].st_shndx; + + bfd_vma st_value = (isymbuf + r_symndx)->st_value; + asection *isec = elf_elfsections (abfd)[shndx]->bfd_section; + relocation = isec->output_section->vma + isec->output_offset + + st_value + irel->r_addend; + snprintf (code, sizeof (code), "%08lx%08lx", relocation, + (insn_size == 4) ? insn : insn << 16); + } + else + { + /* Ignore global condition branch target. */ + off += insn_size; + pre_entry = NULL; + pre_child = NULL; + continue; + } + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_9_PCREL_RELA + && (insn == INSN_J8)) + end = TRUE; + } + else if (irel < irelend && irel->r_offset == off) + { + while (irel < irelend && irel->r_offset == off) + { + switch (ELF32_R_TYPE (irel->r_info)) + { + case R_NDS32_32_RELA: + /* Data. */ + insn_size = 4; + break; + case R_NDS32_16_RELA: + /* Data. */ + insn_size = 2; + break; + case R_NDS32_DATA: + /* Data. */ + /* The least code alignment is 2. If the data is only one byte, + we have to shift one more byte. */ + if (irel->r_addend == 1) + insn_size = 2; + else + insn_size = irel->r_addend; + break; + default: + break; + } + irel++; + } + /* Set a new basic block. */ + off += insn_size; + pre_entry = NULL; + pre_child = NULL; + continue; + } + + if (ptr_barrier && ptr_barrier->offset == off) + { + /* If there is symbol at the instruction, this one only can be the + begining of basic block. We have to promise there is no jump + target or label in the common block, because if the block be + converted ifcall the label will disapear. */ + pre_entry = NULL; + pre_child = NULL; + } + + off += insn_size; + /* Hash and copy "code". */ + entry = (struct elf_nds32_ifc_code_hash_entry *) + bfd_hash_lookup (&ifc_code_table, code, TRUE, TRUE); + if (entry == NULL) + { + (*_bfd_error_handler) + (_("%P%F: failed creating ifc %s hash table: %E\n"), code); + return FALSE; + } + + entry->size = insn_size; + + /* It is hard to do ifc, when the sequence instructions are the same. */ + if (entry == pre_entry + || (h && entry->h && entry->h != h)) + { + pre_entry = NULL; + pre_child = NULL; + continue; + } + + entry->times++; + entry->h = h; + entry->end = end; + + /* Build list between current and previous instruction. + First round: generate entry A and member B. */ + /* List: code_hash_entry->unit->member. + Example: ABCAB + 12345 + {entry} [unit] (member) + {A} -> [B] -> (1) -> (4) */ + + child = bfd_malloc (sizeof (struct elf_nds32_ifc_member)); + child->offset = off; + child->sec = sec; + /* For B member, its pre_entry is null. + For C member, its pre_entry is A. */ + child->pre_entry = pre_entry; + child->unit_p = NULL; + child->next = NULL; + child->next_member = NULL; + child->pre_member = pre_child; + child->dead = FALSE; + child->bh = NULL; + + /* Build section instruction list to adjust offset + when increasing or decreasing later. */ + smember = malloc (sizeof (struct elf_nds32_ifc_sec_member)) ; + smember->member = child; + smember->next = NULL; + if (!cur_smember) + { + block->smember = smember; + cur_smember = smember; + } + else + { + cur_smember->next = smember; + cur_smember = smember; + } + + nds32_elf_ifc_new_ifc_unit (entry, pre_entry, child, pre_child); + if (end) + { + pre_child = NULL; + pre_entry = NULL; + } + else + { + pre_child = child; + pre_entry = entry; + } + } + return TRUE; +} + +/* Insert the entry in sort by its times. */ + +static void +nds32_elf_ifc_order_insn_times (struct elf_nds32_ifc_code_hash_entry *entry) +{ + struct elf_nds32_ifc_code_hash_entry *ptr = ifc_insn_head; + + /* First entry. */ + if (!ifc_insn_head) + ifc_insn_head = entry; + else if (!entry->max_unit) + { + /* There is no max_unit in current list. */ + while (ptr->next) + ptr = ptr->next; + entry->next = ptr->next; + ptr->next = entry; + } + else + { + entry->max_times = entry->max_unit->times; + if (!ptr->max_unit + || ptr->max_unit->times < entry->max_unit->times) + { + /* The new one is the bigest one. */ + entry->next = ptr; + ifc_insn_head = entry; + return; + } + while (ptr->next && ptr->next->unit + && ptr->next->unit->times > entry->unit->times) + ptr = ptr->next; + entry->next = ptr->next; + ptr->next = entry; + } +} + +/* IFC hash table traverse function. */ + +static void +nds32_elf_ifc_code_hash_traverse (void (*func) (struct elf_nds32_ifc_code_hash_entry*)) +{ + unsigned int i; + + ifc_code_table.frozen = 1; + for (i = 0; i < ifc_code_table.size; i++) + { + struct bfd_hash_entry *p; + + for (p = ifc_code_table.table[i]; p != NULL; p = p->next) + func ((struct elf_nds32_ifc_code_hash_entry *) p); + } + ifc_code_table.frozen = 0; +} + +/* Push common subexpression. */ + +static void +nds32_elf_ifc_push_stack (struct elf_nds32_ifc_insn_stack **stack, + struct elf_nds32_ifc_unit *unit) +{ + struct elf_nds32_ifc_member *member; + struct elf_nds32_ifc_insn_stack *ptr; + struct elf_nds32_ifc_insn_member *imember, *ptr_imember; + + /* Get the first member in the same unit. */ + member = unit->member->unit_p->member; + + if (!*stack) + { + /* The first instruction in common subexpression. */ + while (member) + { + /* The newest one stack is as the head. */ + if (!member->dead) + { + ptr = bfd_malloc (sizeof (struct elf_nds32_ifc_insn_stack)); + imember = bfd_malloc (sizeof (struct elf_nds32_ifc_insn_member)); + imember->member = member; + imember->next = NULL; + ptr->imember = imember; + ptr->next = *stack; + ptr->live = 1; + ptr->extend = 0; + *stack = ptr; + } + member = member->next; + } + } + else + { + /* Initial stack state, because we have to trigger them after + matching new member. */ + ptr = *stack; + while (ptr) + { + ptr->choose = ptr->live; + ptr->live = 0; + ptr = ptr->next; + } + + while (member) + { + /* Find the same common subexpression stack and push. */ + ptr = *stack; + while (!member->dead && ptr) + { + if (ptr->live == 0 && ptr->choose == 1) + { + ptr_imember = ptr->imember; + /* Go to the final imember. */ + while (ptr_imember && ptr_imember->next) + ptr_imember = ptr_imember->next; + + if (ptr_imember->member->next_member == member) + { + /* When the final member next one match the new member, + insert it into list. */ + imember = bfd_malloc (sizeof (struct elf_nds32_ifc_insn_member)); + imember->member = member; + imember->next = NULL; + ptr->live = 1; + ptr_imember->next = imember; + break; + } + } + ptr = ptr->next; + } + member = member->next; + } + } +} + +/* Pop common subexpression. */ + +static void +nds32_elf_ifc_pop_stack (struct elf_nds32_ifc_insn_stack **stack, + struct elf_nds32_ifc_unit *unit) +{ + if (!*stack) + return; + + struct elf_nds32_ifc_insn_stack *ptr; + struct elf_nds32_ifc_insn_member *imember, *temp_member; + struct elf_nds32_ifc_member *member; + + ptr = *stack; + while (ptr) + { + ptr->live = 0; + ptr = ptr->next; + } + + ptr = *stack; + while (ptr) + { + /* Get the first member in the same unit. */ + member = unit->member->unit_p->member; + while (member) + { + imember = ptr->imember; + while (imember) + { + if (imember->member == member) + { + ptr->live = 1; + temp_member = imember->next; + imember->next = NULL; + imember = temp_member; + break; + } + imember = imember->next; + } + while (imember) + { + temp_member = imember; + imember = imember->next; + free (temp_member); + } + if (ptr->live) + break; + member = member->next; + } + ptr = ptr->next; + } +} + +/* Find the common down. */ + +static int +nds32_elf_ifc_find_cse_recur (struct elf_nds32_ifc_unit *ptr, + struct elf_nds32_ifc_insn_stack **stack, + int total) +{ + struct elf_nds32_ifc_member *member = ptr->member; + struct elf_nds32_ifc_unit *unit_head, *unit_current, *unit_pre = NULL; + struct elf_nds32_ifc_insn_stack *stack_ptr; + struct elf_nds32_ifc_insn_member *imember; + unit_head = NULL; + int gain, gc_size; + int abandon; + + /* Push current member into stack. */ + nds32_elf_ifc_push_stack (stack, ptr); + + if (!*stack) + return 0; + + /* The instruction will close ifc state. */ + if (ptr->hash->end) + return ptr->times * ptr->hash->size; + + /* Find the unit its max next instruction. */ + stack_ptr = *stack; + while (stack_ptr) + { + if (stack_ptr->live) + { + /* Get the final instruction. */ + imember = stack_ptr->imember; + while (imember->next) + imember = imember->next; + member = imember->member; + if (!member->next_member->dead) + { + unit_current = unit_head; + while (unit_current) + { + /* Check if the hash entry exist. */ + unit_pre = unit_current; + if (member->next_member->unit_p + && member->next_member->unit_p->hash + == unit_current->hash + && (!unit_current->hash->h + || unit_current->hash->h + == member->next_member->unit_p->hash->h)) + { + unit_current->times++; + break; + } + unit_current = unit_current->next; + } + /* New a unit group. */ + if (member->next_member->unit_p + && !member->next_member->unit_p->hash->round + && !unit_current) + { + unit_current = bfd_malloc (sizeof (struct elf_nds32_ifc_unit)); + unit_current->hash = member->next_member->unit_p->hash; + unit_current->times = 1; + unit_current->next = NULL; + unit_current->member = member->next_member; + unit_current->entry_p = member->next_member->unit_p->entry_p; + if (!unit_head) + unit_head = unit_current; + else + unit_pre->next = unit_current; + } + } + } + stack_ptr = stack_ptr->next; + } + + /* Find the max next instruction unit. */ + unit_current = unit_head; + unit_pre = unit_head; + while (unit_current) + { + if (unit_current->times > unit_pre->times) + unit_pre = unit_current; + unit_current = unit_current->next; + } + + if (!unit_pre || unit_pre->times < 2) + { + unit_current = unit_head; + while (unit_current) + { + unit_current = unit_current->next; + free (unit_head); + unit_head = unit_current; + } + return ptr->times * ptr->hash->size; + } + + /* Total code size and abandoned unit size. */ + total = total + ptr->hash->size; + abandon = unit_pre->times; + gc_size = total * (ptr->times - abandon); + + /* It have to estimate the longer common subexpression is profit. + Example: ABC ABC ABD. + We have to calculate ABC or AB is profit. */ + + ptr->hash->round = 1; + gain = nds32_elf_ifc_find_cse_recur (unit_pre, stack, total); + ptr->hash->round = 0; + + /* Free memory. */ + unit_current = unit_head; + while (unit_current) + { + unit_current = unit_current->next; + free (unit_head); + unit_head = unit_current; + } + + if (gain > gc_size + || gain == 0) + { + /* Return total gain if adapt this edge. */ + return (ptr->times - abandon) * ptr->hash->size + gain; + } + else + { + /* It is not more benifit to link deeper, and pop it. */ + nds32_elf_ifc_pop_stack (stack, ptr); + return 0; + } +} + +/* Reallocate section contents. */ + +static void +nds32_elf_ifc_reallocate_contents (asection *sec, int modify, + bfd_byte **contents) +{ + /* This function is highly dangerous, but I have to implement it. */ + sec->size += modify; + bfd_byte *p = bfd_malloc (sec->size * sizeof (bfd_byte)); + memset (p, 0, sec->size * sizeof (bfd_byte)); + memcpy (p, *contents, sec->size - modify); + free (*contents); + *contents = p; + elf_section_data (sec)->this_hdr.contents = p; +} + +/* Insert a symbol in symbol table. */ + +static int +nds32_elf_ifc_insert_sym_hash (bfd *abfd, + struct bfd_link_hash_entry *bh) +{ + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd); + struct elf_link_hash_entry **sym_hash; + bfd_size_type amt; + Elf_Internal_Shdr *hdr; + bfd_size_type symcount; + bfd_size_type extsymcount; + bfd_size_type i; + + /* No symbol hash exsitence. */ + if (!sym_hashes) + return -1; + + if (!(abfd->flags & DYNAMIC) || elf_dynsymtab (abfd) == 0) + hdr = &elf_tdata (abfd)->symtab_hdr; + else + return -1; + + /* Check for the symbol existance. */ + symcount = hdr->sh_size / bed->s->sizeof_sym; + extsymcount = symcount - hdr->sh_info; + for (i = 0; i < extsymcount; i++) + { + if ((struct bfd_link_hash_entry *) *(sym_hashes + i) == bh) + return i + hdr->sh_info; + } + + /* Add one more entry. */ + hdr->sh_size += bed->s->sizeof_sym; + + symcount = hdr->sh_size / bed->s->sizeof_sym; + if (elf_bad_symtab (abfd)) + extsymcount = symcount; + else + extsymcount = symcount - hdr->sh_info; + + sym_hash = NULL; + if (extsymcount != 0) + { + /* We store a pointer to the hash table entry for each external + symbol. */ + amt = extsymcount * sizeof (struct elf_link_hash_entry *); + sym_hash = bfd_malloc (amt); + memset (sym_hash, 0, amt); + if (sym_hash == NULL) + return -1; + memcpy (sym_hash, sym_hashes, + amt - sizeof (struct elf_link_hash_entry *)); + memcpy (sym_hash + extsymcount -1, &bh, + sizeof (struct elf_link_hash_entry *)); + elf_sym_hashes (abfd) = sym_hash; + /* TODO: Since sym_hashes is allocated by bfd_zalloc, it can not + be free directly. We have to record the memory allocated by + ourselves and free it. */ + return (symcount - 1); + } + else + return -1; +} + +/* Insert relocation. */ + +static void +nds32_elf_ifc_insert_relocation (struct bfd_link_info *info, + bfd *abfd, asection *sec, + struct bfd_link_hash_entry *bh, + bfd_vma offset, + bfd_boolean align, + bfd_vma clean_off) +{ + /* Insert a new relocation into section rela, and this is very force + implementation. It may cause unknown problem. */ + + Elf_Internal_Rela *relocs, *internal_relocs, *irelend; + long unsigned int size, extsymcount; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + unsigned int count = 0; + int num = 2; + + /* If the reduction size is not 4 bytes aligment, it has to insert + one more relocation. */ + if (!align) + num = 3; + + /* Insert the jump target in symbol hash. */ + extsymcount = nds32_elf_ifc_insert_sym_hash (abfd, bh); + if (extsymcount <= 0) + return; + + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, + NULL, NULL, FALSE); + irelend = internal_relocs + sec->reloc_count; + + /* The common block including relocation, it has to been cleaned. */ + relocs = internal_relocs; + while (relocs && relocs < irelend) + { + if (relocs->r_offset >= offset && relocs->r_offset <= clean_off) + relocs->r_info = ELF32_R_INFO (ELF32_R_SYM (relocs->r_info), + R_NDS32_NONE); + relocs++; + } + + /* We have to insert two relocations; one for ifc and + another is for alignment.*/ + sec->reloc_count += num; + size = sec->reloc_count; + size *= bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela); + relocs = (Elf_Internal_Rela *) bfd_malloc (size); + memset (relocs, 0, size); + elf_section_data (sec)->relocs = relocs; + while ((internal_relocs + count) < irelend + && (internal_relocs + count)->r_offset <= offset) + count++; + + /* Copy the front part where the offset is smaller. */ + memcpy (relocs, internal_relocs, + (bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela) * count)); + + /* Insert new relocations. */ + irelend = relocs + count; + /* Set relocation. */ + irelend->r_offset = offset; + irelend->r_info = + ELF32_R_INFO (extsymcount, R_NDS32_17IFC_PCREL_RELA); + irelend->r_addend = 0; + + irelend++; + /* Set relocation. */ + irelend->r_offset = offset; + irelend->r_info = ELF32_R_INFO (0, R_NDS32_INSN16); + irelend->r_addend = 0; + + /* One more relocation for alignment. */ + if (!align) + { + irelend++; + irelend->r_offset = offset + 4; + irelend->r_info = ELF32_R_INFO (0, R_NDS32_INSN16); + irelend->r_addend = 1; + /* Put offset. */ + } + + /* Copy the rest part. */ + irelend++; + memcpy (irelend, internal_relocs + count, + size - (bed->s->int_rels_per_ext_rel * + sizeof (Elf_Internal_Rela) * (count + num))); + if (!info->keep_memory) + free (internal_relocs); +} + +/* Adjust insntruction map offset. Variable "adjust" is recorded the size + after relaxing. */ + +static void +nds32_elf_ifc_adjust_block (asection *sec, bfd_vma offset, int size, int adjust) +{ + struct elf_nds32_ifc_sec_block *block; + struct elf_nds32_ifc_sec_member *smember; + + block = ifc_block_head; + while (block->sec != sec) + block = block->next; + + smember = block->smember; + while (smember->member->offset < offset) + smember = smember->next; + + while (size < 0 + && smember + && smember->member->offset < offset - size + adjust) + { + /* The offset result may smaller than zero, so we set its value as the + ifcall. */ + smember->member->offset = offset; + smember = smember->next; + } + while (smember) + { + smember->member->offset += size; + smember = smember->next; + } +} + +/* Adjust relocation and symbol. */ + +static void +nds32_elf_ifc_enlarge (bfd *abfd, asection *sec, bfd_vma off, int size) +{ + unsigned int sec_shndx; /* The section the be relaxed. */ + Elf_Internal_Shdr *symtab_hdr; /* Symbol table header of this bfd. */ + Elf_Internal_Sym *isym; /* Symbol table of this bfd. */ + Elf_Internal_Sym *isymend; /* Symbol entry iterator. */ + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irel; + Elf_Internal_Rela *irelend; + unsigned int symcount; + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry **end_hashes; + asection *sect; + bfd_byte *contents; + + sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + isym = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isym == NULL) + { + isym = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, NULL, NULL, NULL); + symtab_hdr->contents = (bfd_byte *) isym; + } + + if (isym == NULL || symtab_hdr->sh_info == 0) + return; + + for (sect = abfd->sections; sect != NULL; sect = sect->next) + { + /* Adjust all the relocs. */ + + if ((sect->flags & SEC_RELOC) == 0) + continue; + + /* Relocations MUST be kept in memory, because relaxation adjust them. */ + internal_relocs = _bfd_elf_link_read_relocs (abfd, sect, NULL, NULL, + TRUE /* keep_memory */); + irelend = internal_relocs + sect->reloc_count; + + if (!nds32_get_section_contents (abfd, sect, &contents, TRUE)) + continue; + + for (irel = internal_relocs; irel < irelend; irel++) + { + if (ELF32_R_TYPE (irel->r_info) >= R_NDS32_DIFF8 + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_DIFF32 + && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx) + { + unsigned long val, mask; + + switch (ELF32_R_TYPE (irel->r_info)) + { + case R_NDS32_DIFF8: + val = bfd_get_8 (abfd, contents + irel->r_offset); + break; + case R_NDS32_DIFF16: + val = bfd_get_16 (abfd, contents + irel->r_offset); + break; + case R_NDS32_DIFF32: + val = bfd_get_32 (abfd, contents + irel->r_offset); + mask = 0 - (val >> 31); + if (mask) + val = (val | (mask - 0xffffffff)); + break; + default: + BFD_ASSERT (0); + } + + if ((off > irel->r_addend && off <= irel->r_addend + val) + || (off <= irel->r_addend && off > irel->r_addend + val)) + { + /* The offset is incresed. */ + switch (ELF32_R_TYPE (irel->r_info)) + { + /* It may overflow. */ + case R_NDS32_DIFF8: + bfd_put_8 (abfd, val + size, contents + irel->r_offset); + break; + case R_NDS32_DIFF16: + bfd_put_16 (abfd, val + size, contents + irel->r_offset); + break; + case R_NDS32_DIFF32: + bfd_put_32 (abfd, val + size, contents + irel->r_offset); + break; + } + } + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_DIFF_ULEB128 + && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx) + { + bfd_vma val = 0; + unsigned int len = 0; + bfd_byte *endp, *p; + + val = read_unsigned_leb128 (abfd, contents + irel->r_offset, &len); + + if (off >= irel->r_addend + && off < irel->r_addend + val) + { + /* The offset is incresed. */ + p = contents + irel->r_offset; + endp = p + len -1; + memset (p, 0x80, len); + *(endp) = 0; + /* It may overflow. */ + p = write_uleb128 (p, val + size) - 1; + if (p < endp) + *p |= 0x80; + } + } + + if (sec == sect) + { + if (irel->r_offset >= off) + irel->r_offset += size; + } + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL + || ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY) + continue; + + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info + && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx + && ELF_ST_TYPE (isym[ELF32_R_SYM (irel->r_info)].st_info) == STT_SECTION) + { + if (irel->r_addend <= sec->size + && irel->r_addend >= off) + irel->r_addend += size; + } + } + } + + /* Adjust the local symbols defined in this section. */ + for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++) + { + if (isym->st_shndx == sec_shndx) + { + if (isym->st_value <= sec->size) + { + if (isym->st_value >= off) + isym->st_value += size; + /* Adjust function size. */ + else if (ELF32_ST_TYPE (isym->st_info) == STT_FUNC && isym->st_size > 0 + && (isym->st_value + isym->st_size) >= off) + isym->st_size += size; + } + } + } + /* Now adjust the global symbols defined in this section. */ + symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) + - symtab_hdr->sh_info); + sym_hashes = elf_sym_hashes (abfd); + end_hashes = sym_hashes + symcount; + for (; sym_hashes < end_hashes; sym_hashes++) + { + struct elf_link_hash_entry *sym_hash = *sym_hashes; + + if ((sym_hash->root.type == bfd_link_hash_defined + || sym_hash->root.type == bfd_link_hash_defweak) + && sym_hash->root.u.def.section == sec) + { + if (sym_hash->root.u.def.value <= sec->size) + { + if (sym_hash->root.u.def.value >= off) + sym_hash->root.u.def.value += size; + + /* Adjust function size. */ + else if (sym_hash->type == STT_FUNC + && (sym_hash->root.u.def.value + sym_hash->size) >= off) + sym_hash->size += size; + + } + } + } + nds32_elf_ifc_adjust_block (sec, off, size, 0); +} + +/* Check distance between branch become farer if it + cause relocation overfolw. */ + +static bfd_boolean +nds32_elf_ifc_check_overflow (struct elf_nds32_ifc_insn_stack *ptr) +{ + struct elf_nds32_ifc_insn_member *imember; + struct elf_nds32_ifc_member *member; + asection *sec; + bfd_vma offset; + Elf_Internal_Rela *irel, *internal_relocs, *irelend; + unsigned int sec_shndx; + bfd *abfd; + Elf_Internal_Sym *isym = NULL; /* Symbol table of this bfd. */ + Elf_Internal_Shdr *symtab_hdr; + + /* Get the common block final instruction address. */ + imember = ptr->imember; + while (imember->next) + imember = imember->next; + member = imember->member; + /* Add the final instruction and its instruction size to get + the address inserted the ifret16. */ + offset = member->offset + member->unit_p->hash->size; + + sec = member->sec; + abfd = sec->owner; + sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + if (!nds32_get_local_syms (abfd, sec, &isym)) + return FALSE; + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + TRUE /* keep_memory */); + irelend = internal_relocs + sec->reloc_count; + + for (irel = internal_relocs; irel < irelend; irel++) + { + if (ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY + && ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info + && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx) + { + /* Get the distance between caller and callee. */ + unsigned int distance; + if (irel->r_offset < offset && irel->r_addend > offset) + distance = irel->r_addend - irel->r_offset; + else if (irel->r_offset > offset && irel->r_addend < offset) + distance = irel->r_offset - irel->r_addend; + else + continue; + + /* In current, just check pc relative jump here. It may has to + check more relocation in the feature. */ + switch (ELF32_R_TYPE (irel->r_info)) + { + /* It has to subtruct 5 since it has to + consider the 4 bytes for ifret. */ + case R_NDS32_9_PCREL_RELA: + if (distance > ((1 << 8) - 5)) + return FALSE; + break; + case R_NDS32_15_PCREL_RELA: + if (distance > ((1 << 14) - 5)) + return FALSE; + break; + default: + break; + } + } + } + return TRUE; +} + + +/* Insert a INSN16 relocation for relaxing ifret. */ + +static void +nds32_elf_ifc_insert_insn16_reloc (struct bfd_link_info *info, + bfd *abfd, asection *sec, + unsigned long int offset) +{ + /* Insert a new relocation into section rela, and this is very force + implementation. It may cause unknown problem. */ + + Elf_Internal_Rela *relocs, *internal_relocs, *irelend; + long unsigned int size; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + unsigned int count = 0; + + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, + NULL, NULL, FALSE); + irelend = internal_relocs + sec->reloc_count; + + /* We have to insert two relocations; one for ifc and + another is for alignment.*/ + sec->reloc_count += 1; + size = sec->reloc_count; + size *= bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela); + relocs = (Elf_Internal_Rela *) bfd_malloc (size); + memset (relocs, 0, size); + elf_section_data (sec)->relocs = relocs; + while ((internal_relocs + count) < irelend + && (internal_relocs + count)->r_offset <= offset) + count++; + + /* Copy the front part where the offset is smaller. */ + memcpy (relocs, internal_relocs, + (bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela) * count)); + + /* Insert new relocations. */ + irelend = relocs + count; + + /* Set relocation. */ + irelend->r_offset = offset; + irelend->r_info = ELF32_R_INFO (0, R_NDS32_INSN16); + irelend->r_addend = 0; + + irelend++; + /* Copy the rest part. */ + memcpy (irelend, internal_relocs + count, + size - (bed->s->int_rels_per_ext_rel * + sizeof (Elf_Internal_Rela) * (count + 1))); + if (!info->keep_memory) + free (internal_relocs); +} + +/* Push new element into the head of stack. */ + +static void +nds32_elf_ifc_extend_stack (struct elf_nds32_ifc_insn_stack *stack, + struct elf_nds32_ifc_unit *unit) +{ + struct elf_nds32_ifc_insn_stack *stackP = stack; + struct elf_nds32_ifc_member *pre_member; + struct elf_nds32_ifc_insn_member *imember; + struct elf_nds32_ifc_code_hash_entry *hash; + + while (stackP) + { + stackP->choose = stackP->extend; + stackP->extend = 0; + stackP= stackP->next; + } + + hash = unit->entry_p; + stackP = stack; + while (stackP) + { + if (stackP->choose && stackP->extend == 0) + { + pre_member = stackP->imember->member->pre_member; + if (pre_member && !pre_member->dead + && pre_member->unit_p->entry_p == hash) + { + stackP->extend = 1; + imember = malloc (sizeof (struct elf_nds32_ifc_insn_member)); + imember->member = pre_member; + imember->next = stackP->imember; + stackP->imember = imember; + } + } + stackP = stackP->next; + } +} + +/* Search stack extend up. */ + +static bfd_boolean +nds32_elf_ifc_extend_up (struct elf_nds32_ifc_insn_stack *stack) +{ + struct elf_nds32_ifc_insn_stack *stackP = stack; + struct elf_nds32_ifc_member *memberP; + struct elf_nds32_ifc_insn_member *imember; + struct elf_nds32_ifc_unit *unitP, *unit_head = NULL, *unit_tail = NULL; + + while (stackP) + { + if (stackP->extend + && nds32_elf_ifc_check_overflow (stackP)) + { + /* Get previos member. */ + unitP = unit_head; + memberP = stackP->imember->member->pre_member; + if (memberP && !memberP->dead) + { + while (unitP) + { + unit_tail = unitP; + if (memberP && memberP->unit_p->entry_p == unitP->entry_p + && (!unitP->entry_p->h + || unitP->entry_p->h == memberP->unit_p->entry_p->h)) + { + unitP->times++; + break; + } + unitP = unitP->next; + } + + /* Can't find matched unit so new one. */ + if (!unitP) + { + /* Check this instruction is not in stack. I can't find a + better way currently. */ + imember = stackP->imember; + while (imember) + { + if (imember->member->unit_p->hash + == memberP->unit_p->entry_p) + break; + imember = imember->next; + } + if (!imember) + { + unitP = malloc (sizeof (struct elf_nds32_ifc_unit)); + unitP->times = 1; + unitP->member = memberP; + unitP->entry_p = memberP->unit_p->entry_p; + unitP->hash = memberP->unit_p->hash; + unitP->next = NULL; + if (!unit_head) + unit_head = unitP; + else + unit_tail->next = unitP; + } + } + } + } + stackP = stackP->next; + } + + /* Find a max one unit. */ + unitP = unit_head; + unit_tail = unit_head; + while (unitP) + { + if (unitP->times > unit_tail->times) + unit_tail = unitP; + unitP = unitP->next; + } + if (!unit_tail || unit_tail->times < 2) + return FALSE; + else + { + nds32_elf_ifc_extend_stack (stack, unit_tail); + unit_tail->hash->round = 1; + nds32_elf_ifc_extend_up (stack); + unit_tail->hash->round = 0; + return TRUE; + } +} + +/* Check this stack is worth to be used. */ + +static bfd_boolean +nds32_elf_ifc_check (struct elf_nds32_ifc_insn_stack *stack, + struct elf_nds32_ifc_insn_stack **base, + bfd_boolean extend) +{ + struct elf_nds32_ifc_insn_stack *ptr; + struct elf_nds32_ifc_insn_member *imember; + bfd_vma insn_sz; + + ptr = stack; + while (ptr) + { + if ((extend && ptr->extend) + || (!extend && ptr->live + && nds32_elf_ifc_check_overflow (ptr))) + break; + ptr = ptr->next; + } + *base = ptr; + + if (!*base) + return FALSE; + + /* Conform the code size can be reduced. */ + ptr = stack; + while (ptr) + { + if (ptr->live && ptr != *base) + break; + ptr = ptr->next; + } + if (!ptr) + return FALSE; + + /* Get the end offset of common. */ + imember = (*base)->imember; + insn_sz = imember->member->unit_p->entry_p->size; + insn_sz += imember->member->unit_p->hash->size; + while (imember->next) + { + imember = imember->next; + insn_sz += imember->member->unit_p->hash->size; + } + /* The ifc does not trigger, clear all stack. */ + if (insn_sz < 8) + return FALSE; + + return TRUE; +} + +/* Insert a new ifc target symbol. */ + +#define IFC_TARGET_NAME 10 +static void +nds32_elf_ifc_insert_target (struct elf_nds32_ifc_insn_stack *base, + bfd_vma off, + struct bfd_link_info *info, + struct bfd_link_hash_entry **bh) +{ + static char name[45] = "$nds32ifc_a"; /* Is this enough? */ + int temp_num; + static int hash_num = IFC_TARGET_NAME; + asection *sec = base->imember->member->sec; + bfd *abfd = sec->owner; + + *bh = bfd_link_hash_lookup (info->hash, name, + FALSE, FALSE, TRUE); + /* Insert a global symbol for ifc target. */ + _bfd_generic_link_add_one_symbol + (info, info->output_bfd, name, BSF_GLOBAL, + sec, off, (const char *) NULL, TRUE, /* copy */ + get_elf_backend_data (info->output_bfd)->collect, + bh); + + + /* Adjust ifc target name for next time. */ + temp_num = hash_num; + while (name[temp_num] >= 'z' && temp_num >= IFC_TARGET_NAME) + { + temp_num--; + } + + if (temp_num < IFC_TARGET_NAME) + { + /* Add one more bit and reset all bits. */ + hash_num++; + temp_num = hash_num; + while (temp_num >= IFC_TARGET_NAME) + { + name[temp_num] = 'a'; + temp_num--; + } + name[hash_num + 1] = '\0'; + } + else if (temp_num == hash_num) + { + /* Add latest one bit. */ + name[temp_num]++; + } + else + { + /* Add carry bit and reset low significant bits. */ + name[temp_num]++; + while (temp_num < hash_num) + { + temp_num++; + name[temp_num] = 'a'; + } + } + /* Insert the global symbol into branch target bfd to adjust + when relaxing. */ + if (nds32_elf_ifc_insert_sym_hash (abfd, *bh) < 0) + return; +} + +/* Replace common code with ifc. In this functionm, it has to check + whether relocation is overflow after insert ifret16. If it is fine, + insert ifret16 into one common block, and replace other common with + ifcall and insert relocation for it. */ + +static void +nds32_elf_ifc_replace_common (struct elf_nds32_ifc_insn_stack *stack, + struct bfd_link_info *info) +{ + struct elf_nds32_ifc_insn_stack *ptr, *base; + struct elf_nds32_ifc_insn_member *imember, *base_imember; + struct elf_nds32_ifc_member *member; + bfd_byte *contents = NULL; + bfd_vma off, insn_sz, relocation, clean_off, base_off; + nds32_elf_blank_t *relax_blank_list = NULL; + struct bfd_link_hash_entry *bh; + asection *sec; + bfd *abfd; + bfd_boolean align_mask, extend; + + if (!stack) + return; + + /* Set extend for all live stack. */ + ptr = stack; + while (ptr) + { + ptr->extend = ptr->live; + ptr = ptr->next; + } + extend = nds32_elf_ifc_extend_up (stack); + + if (!nds32_elf_ifc_check (stack, &base, extend)) + { + ptr = stack; + while (ptr) + { + ptr->live = 0; + ptr = ptr->next; + } + return; + } + + /* Get the total block size. */ + imember = base->imember; + while (imember->next) + { + imember = imember->next; + insn_sz += imember->member->unit_p->hash->size; + } + /* Find the base block. */ + member = imember->member; + /* Final instruction offset. */ + off = member->offset; + /* Final instruction size. */ + insn_sz = member->unit_p->hash->size; + sec = member->sec; + abfd = member->sec->owner; + + if (!member->unit_p->hash->end) + { + /* Stack is the ifc base. Insert ifret16 into the block. */ + if (!nds32_get_section_contents (abfd, sec, &contents, TRUE)) + return; + + /* Adjust contents. */ + nds32_elf_ifc_reallocate_contents (sec, 4, &contents); + memmove (contents + off + 4 + insn_sz, + contents + off + insn_sz, + sec->size - off - insn_sz - 4); + + /* Adjust relocation and symbols. */ + nds32_elf_ifc_enlarge (abfd, sec, off + insn_sz, 4); + + /* Put ifret. It insert 32-bits ret since it has to consider alignment + in the future. */ + bfd_putb32 (INSN_IFRET, contents + off + insn_sz); + + /* Insert relocation for convert to 16-bits if possible. */ + nds32_elf_ifc_insert_insn16_reloc (info, abfd, sec, off + insn_sz); + } + + + off = base->imember->member->offset + - base->imember->member->unit_p->entry_p->size; + + /* The common block address. */ + relocation = off + sec->output_offset + sec->output_section->vma; + + /* Others has to exchange to ifcall, and insert relocation. */ + ptr = stack; + while (ptr) + { + if (ptr->live && ptr != base) + { + insn_sz = 0; + imember = ptr->imember; + member = imember->member; + sec = member->sec; + abfd = member->sec->owner; + + /* Check the range enough for ifcall. */ + off = member->offset - member->unit_p->entry_p->size + + sec->output_offset + sec->output_section->vma; + /* The larget range 16s and right shift one bit. Do it conservatively, + so pick range 0xf000. */ + if ((off > relocation && (off - relocation) > 0xf000) + || (off < relocation && (relocation - off) > 0xf000)) + { + ptr = ptr->next; + continue; + } + + /* The first insntruction offset. */ + off = member->offset - member->unit_p->entry_p->size; + + /* Get the total insntruntion size of the common subexpression. */ + insn_sz += member->unit_p->entry_p->size; + while (imember && member->unit_p) + { + member = imember->member; + insn_sz += member->unit_p->hash->size; + imember = imember->next; + } + + if (!nds32_get_section_contents (abfd, sec, &contents, TRUE)) + { + (*_bfd_error_handler) + (_("Linker: relax for ifc get section contents error.\n")); + return; + } + + /* Check the total size of common if 4 bytes multiple or not. */ + align_mask = ((insn_sz % 4) == 0) ? TRUE : FALSE; + clean_off = off + insn_sz - 2; + + /* Find the member match to base block. */ + base_imember = base->imember; + imember = ptr->imember; + while (imember->member->unit_p != base_imember->member->unit_p) + base_imember = base_imember->next; + if (!imember) + { + (*_bfd_error_handler) + (_("Linker: relax for ifc error.\n")); + return; + } + bh = base_imember->member->bh; + if (!bh) + { + base_off = base_imember->member->offset + - base_imember->member->unit_p->entry_p->size; + /* Insert a global symbol for ifc target. */ + nds32_elf_ifc_insert_target (base, base_off, info, &bh); + base_imember->member->bh = bh; + } + + /* Insert two relocations IFCALL and INSN16. */ + nds32_elf_ifc_insert_relocation (info, abfd, sec, bh, off, + align_mask, clean_off); + + bfd_putb32 (INSN_IFCALL, contents + off); + + if (!align_mask) + bfd_putb16 (INSN_NOP16, contents + off + 4); + + if (align_mask && !insert_nds32_elf_blank_recalc_total + (&relax_blank_list, off + 4, insn_sz - 4)) + return; + else if (!align_mask && !insert_nds32_elf_blank_recalc_total + (&relax_blank_list, off + 6, insn_sz - 6)) + return; + if (relax_blank_list) + { + nds32_elf_relax_delete_blanks (abfd, sec, relax_blank_list); + relax_blank_list = NULL; + } + nds32_elf_ifc_adjust_block (sec, off, ((align_mask) ? 4 : 6) - insn_sz, + (align_mask) ? 4 : 6); + } + ptr = ptr->next; + } +} + +/* Free heap and set dead member. */ + +static void +nds32_elf_ifc_release_member (struct elf_nds32_ifc_insn_stack *stack) +{ + struct elf_nds32_ifc_insn_stack *ptr, *temp_ptr; + struct elf_nds32_ifc_insn_member *imember, *temp; + + ptr = stack; + while (ptr) + { + if (ptr->live) + { + imember = ptr->imember; + while (imember) + { + /* Set edge dead. */ + imember->member->dead = TRUE; + imember->member->unit_p->times--; + /* Since the previous insntruction is used, + set the edge dead, too. */ + imember->member->next_member->dead = TRUE; + if (imember->member->pre_member) + imember->member->pre_member->dead = TRUE; + temp = imember; + imember = imember->next; + free (temp); + } + } + temp_ptr = ptr; + ptr = ptr->next; + free (temp_ptr); + } +} + +/* Get the new max_unit for entry. */ + +static bfd_boolean +nds32_elf_ifc_next_max (struct elf_nds32_ifc_code_hash_entry *entry) +{ + struct elf_nds32_ifc_unit *unitP, *max_unit; + + unitP = entry->unit; + max_unit = entry->unit; + while (unitP) + { + if (unitP->times > max_unit->times + && !unitP->done) + max_unit = unitP; + unitP = unitP->next; + } + if (!max_unit->done && max_unit->times >= 2) + { + entry->max_unit = max_unit; + entry->max_times = max_unit->times; + return TRUE; + } + return FALSE; +} + +/* Find cse block here. */ + +static void +nds32_elf_ifc_find_cse (struct bfd_link_info *info) +{ + /* Example: insntruction ABCABCB. In the first round we will choose B, + and find its next possible insntruction. In the end of this round, + we will know the max appearance times is 2, and the insntruction is C. */ + struct elf_nds32_ifc_code_hash_entry *ptr = ifc_insn_head; + struct elf_nds32_ifc_insn_stack *stack; + + while (ptr) + { + stack = NULL; + if (ptr->max_unit && ptr->max_times >= 2) + { + /* We save some infomation for ifc search back, but not + implement yet. It may can be done hear. */ + ptr->max_unit->done = 1; + ptr->round = 1; + nds32_elf_ifc_find_cse_recur (ptr->max_unit, &stack, ptr->size); + nds32_elf_ifc_replace_common (stack, info); + ptr->round = 0; + nds32_elf_ifc_release_member (stack); + if (nds32_elf_ifc_next_max (ptr)) + continue; + } + ptr = ptr->next; + } +} + +/* To find the cse and relax it. */ + +static void +nds32_elf_ifc_cse_algo (struct bfd_link_info *info) +{ + /* Order the insntruction by max_unit times. */ + nds32_elf_ifc_code_hash_traverse (nds32_elf_ifc_order_insn_times); + + /* Find common subexpression. */ + nds32_elf_ifc_find_cse (info); +} +/* End IFC. */ + + +/* Rom-patch table hash function. */ + +static struct bfd_hash_entry * +nds32_elf_ict_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) +{ + struct elf_nds32_ict_hash_entry *ret; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = (struct bfd_hash_entry *) + bfd_hash_allocate (table, sizeof (*ret)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = bfd_hash_newfunc (entry, table, string); + if (entry == NULL) + return entry; + + ret = (struct elf_nds32_ict_hash_entry*) entry; + ret->order = 0; + return &ret->root; +} + +static void +nds32_elf_ict_hash_init (void) +{ + if (!bfd_hash_table_init_n (&indirect_call_table, nds32_elf_ict_hash_newfunc, + sizeof (struct elf_nds32_ict_hash_entry), + 1023)) + (*_bfd_error_handler) (_("ld error: cannot init rom patch hash table\n")); + return; +} + +/* Relocate for NDS32_ICT_SECTION. */ +static void +nds32_elf_ict_relocate (struct bfd_link_info *info) +{ + static bfd_boolean done = FALSE; + asection *sec; + bfd_byte *contents = NULL; + uint32_t insn; + unsigned int i; + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *h2; + bfd_vma relocation, base; + + if (done) + return; + + done = TRUE; + + sec = nds32_elf_get_target_section (info, NDS32_ICT_SECTION); + h2 = bfd_link_hash_lookup (info->hash, "_INDIRECT_CALL_TABLE_BASE_", + FALSE, FALSE, FALSE); + base = ((h2->u.def.value + + h2->u.def.section->output_section->vma + + h2->u.def.section->output_offset)); + + if (!nds32_get_section_contents (sec->owner, sec, &contents, TRUE)) + return; + + indirect_call_table.frozen = 1; + for (i = 0; i < indirect_call_table.size; i++) + { + struct bfd_hash_entry *p; + struct elf_nds32_ict_hash_entry *entry; + + for (p = indirect_call_table.table[i]; p != NULL; p = p->next) + { + entry = (struct elf_nds32_ict_hash_entry *) p; + insn = INSN_J; + h = entry->h; + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section != NULL + && h->root.u.def.section->output_section != NULL) + { + + relocation = h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset; + insn |= ((relocation - base - entry->order * 4) >> 1) & 0xffffff; + } + else + relocation = 0; + + bfd_putb32 (insn, contents + (entry->order) * 4); + } + } + indirect_call_table.frozen = 0; +} + +static asection* +nds32_elf_get_target_section (struct bfd_link_info *info, char *name) +{ + asection *sec = NULL; + bfd *abfd; + + for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) + { + sec = bfd_get_section_by_name (abfd, name); + if (sec != NULL) + break; + } + + return sec; +} + + +#define ELF_ARCH bfd_arch_nds32 +#define ELF_MACHINE_CODE EM_NDS32 +#define ELF_MAXPAGESIZE 0x1000 +#define ELF_TARGET_ID NDS32_ELF_DATA + +#define TARGET_BIG_SYM bfd_elf32_nds32be_vec +#define TARGET_BIG_NAME "elf32-nds32be" +#define TARGET_LITTLE_SYM bfd_elf32_nds32le_vec +#define TARGET_LITTLE_NAME "elf32-nds32le" + +#define elf_info_to_howto nds32_info_to_howto +#define elf_info_to_howto_rel nds32_info_to_howto_rel + +#define bfd_elf32_bfd_link_hash_table_create nds32_elf_link_hash_table_create +#define bfd_elf32_bfd_merge_private_bfd_data nds32_elf_merge_private_bfd_data +#define bfd_elf32_bfd_print_private_bfd_data nds32_elf_print_private_bfd_data +#define bfd_elf32_bfd_relax_section nds32_elf_relax_section +#define bfd_elf32_bfd_set_private_flags nds32_elf_set_private_flags + +#define bfd_elf32_mkobject nds32_elf_mkobject +#define elf_backend_action_discarded nds32_elf_action_discarded +#define elf_backend_add_symbol_hook nds32_elf_add_symbol_hook +#define elf_backend_check_relocs nds32_elf_check_relocs +#define elf_backend_adjust_dynamic_symbol nds32_elf_adjust_dynamic_symbol +#define elf_backend_create_dynamic_sections nds32_elf_create_dynamic_sections +#define elf_backend_finish_dynamic_sections nds32_elf_finish_dynamic_sections +#define elf_backend_finish_dynamic_symbol nds32_elf_finish_dynamic_symbol +#define elf_backend_size_dynamic_sections nds32_elf_size_dynamic_sections +#define elf_backend_relocate_section nds32_elf_relocate_section +#define elf_backend_gc_mark_hook nds32_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook nds32_elf_gc_sweep_hook +#define elf_backend_grok_prstatus nds32_elf_grok_prstatus +#define elf_backend_grok_psinfo nds32_elf_grok_psinfo +#define elf_backend_reloc_type_class nds32_elf_reloc_type_class +#define elf_backend_copy_indirect_symbol nds32_elf_copy_indirect_symbol +#define elf_backend_link_output_symbol_hook nds32_elf_output_symbol_hook +#define elf_backend_output_arch_syms nds32_elf_output_arch_syms +#define elf_backend_object_p nds32_elf_object_p +#define elf_backend_final_write_processing nds32_elf_final_write_processing +#define elf_backend_special_sections nds32_elf_special_sections +#define bfd_elf32_bfd_get_relocated_section_contents \ + nds32_elf_get_relocated_section_contents +#define bfd_elf32_bfd_is_target_special_symbol nds32_elf_is_target_special_symbol +#define elf_backend_maybe_function_sym nds32_elf_maybe_function_sym + +#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_may_use_rel_p 1 +#define elf_backend_default_use_rela_p 1 +#define elf_backend_may_use_rela_p 1 + +#include "elf32-target.h" + +#undef ELF_MAXPAGESIZE +#define ELF_MAXPAGESIZE 0x2000 + +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elf32_nds32belin_vec +#undef TARGET_BIG_NAME +#define TARGET_BIG_NAME "elf32-nds32be-linux" +#undef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM bfd_elf32_nds32lelin_vec +#undef TARGET_LITTLE_NAME +#define TARGET_LITTLE_NAME "elf32-nds32le-linux" +#undef elf32_bed +#define elf32_bed elf32_nds32_lin_bed + +#include "elf32-target.h" diff -Nur binutils-2.24.orig/bfd/elf32-nds32.h binutils-2.24/bfd/elf32-nds32.h --- binutils-2.24.orig/bfd/elf32-nds32.h 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/bfd/elf32-nds32.h 2016-06-30 21:26:12.569889845 +0200 @@ -0,0 +1,215 @@ +/* NDS32-specific support for 32-bit ELF. + Copyright (C) 2012-2013 Free Software Foundation, Inc. + Contributed by Andes Technology Corporation. + + 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA.*/ + +#ifndef ELF32_NDS32_H +#define ELF32_NDS32_H + +/* + * Relocation flags encoded in r_addend. + */ + +/* Relocation flags for R_NDS32_ERLAX_ENTRY. */ + +/* Set if relax on this section is done or disabled. */ +#define R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG (1 << 31) +/* Optimize for performance. */ +#define R_NDS32_RELAX_ENTRY_OPTIMIZE_FLAG (1 << 30) +/* Optimize for size. Branch destination 4-byte adjustment + may be disabled. */ +#define R_NDS32_RELAX_ENTRY_OPTIMIZE_FOR_SPACE_FLAG (1 << 29) +/* To distinguish the assembly code generated by compiler + or written manually. */ +#define R_NDS32_RELAX_ENTRY_VERBATIM_FLAG (1 << 28) +/* EX9 and link-time IFC must be explicitly enabled, so we + won't mess up handcraft assembly code. */ +/* Enable EX9 optimization for this section. */ +#define R_NDS32_RELAX_ENTRY_EX9_FLAG (1 << 2) +/* Enable IFC optimization for this section. */ +#define R_NDS32_RELAX_ENTRY_IFC_FLAG (1 << 3) + + +/* Relocation flags for R_NDS32_INSN16. */ + +/* Tag the nop16 can be removed. */ +#define R_NDS32_INSN16_CONVERT_FLAG (1 << 0) +/* Convert a gp-relative access (e.g., lwi.gp) + to fp-as-gp access (lwi37.fp). + This value is used by linker internally only. + It's fine to change the vlaue. */ +#define R_NDS32_INSN16_FP7U2_FLAG (1 << 1) + +/* Relocation flags for R_NDS32_RELAX_REGION_OMIT_FP_START/END. */ + +/* OMIT_FP_FLAG marks the region for applying fp-as-gp + optimization. */ +#define R_NDS32_RELAX_REGION_OMIT_FP_FLAG (1 << 0) +/* NOT_OMIT_FP_FLAG is set if this region is not worth + for fp-as-gp. */ +#define R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG (1 << 1) +/* Suppress EX9 optimization in the region. */ +#define R_NDS32_RELAX_REGION_NO_EX9_FLAG (1 << 2) +/* A Innermost loop region. Some optimizations is suppressed + in this region due to performance drop. */ +#define R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG (1 << 4) +/* Suppress IFC optimization in the region. */ +#define R_NDS32_RELAX_REGION_NO_IFC_FLAG (1 << 5) + +/* Tag range for LOADSTORE relocation. */ +enum +{ + NDS32_LOADSTORE_NONE = 0x0, + NDS32_LOADSTORE_BYTE = 0x1, + NDS32_LOADSTORE_HALF = 0x2, + NDS32_LOADSTORE_WORD = 0x4, + NDS32_LOADSTORE_FLOAT_S = 0x8, + NDS32_LOADSTORE_FLOAT_D = 0x10, + NDS32_LOADSTORE_IMM = 0x20 +}; + +/* Relax tag for nds32_elf_relax_section, we have to specify which + optimization do in this round. */ +enum +{ + NDS32_RELAX_NONE_ROUND = 0, + NDS32_RELAX_NORMAL_ROUND, + NDS32_RELAX_JUMP_IFC_ROUND, + NDS32_RELAX_IFC_ROUND, + NDS32_RELAX_EX9_BUILD_ROUND, + NDS32_RELAX_EX9_REPLACE_ROUND, + NDS32_RELAX_EMPTY_ROUND +}; + +/* Security tag. */ +enum +{ + NDS32_SECURITY_NONE = 0, + NDS32_SECURITY_START, + NDS32_SECURITY_RESTART, + NDS32_SECURITY_END +}; + +/* There are two state in IFC optimization including general ifc (post-opt) + and jump ifc (j and jal). Therefore, we have to use two different mask to + distinguish them. */ +/* Optimization status mask. */ +#define NDS32_RELAX_JUMP_IFC_DONE (1 << 0) +#define NDS32_RELAX_EX9_DONE (1 << 1) +#define NDS32_RELAX_IFC_DONE (1 << 2) + +/* Optimization turn on mask. */ +#define NDS32_RELAX_IFC_ON (1 << 0) +#define NDS32_RELAX_EX9_ON (1 << 1) + +void nds32_insertion_sort + (void *base, size_t nmemb, size_t size, + int (*compar) (const void *lhs, const void *rhs)); + +struct section_id_list_t +{ + int id; + struct section_id_list_t *next; +}; + +struct section_id_list_t * + elf32_nds32_lookup_section_id (int id, struct section_id_list_t **lst_ptr); +int elf32_nds32_check_relax_group (bfd *bfd, asection *sec); +int elf32_nds32_unify_relax_group (bfd *abfd, asection *asec); +int nds32_elf_unify_tls_model (bfd *inbfd, asection *insec, + bfd_byte *incontents, + struct bfd_link_info *lnkinfo); + +void bfd_elf32_nds32_set_target_option (struct bfd_link_info *, int, int, + FILE *, int, int, int, int, FILE *, + FILE *, int, int, bfd_boolean, + bfd_boolean, bfd_boolean); +void bfd_elf32_nds32_append_section (struct bfd_link_info*, bfd *, int); +int nds32_convert_32_to_16 + (bfd *abfd, uint32_t insn, uint16_t *pinsn16, int *pinsn_type); +int nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn); + +#define nds32_elf_hash_table(info) \ + (elf_hash_table_id ((struct elf_link_hash_table *) ((info)->hash)) \ + == NDS32_ELF_DATA ? ((struct elf_nds32_link_hash_table *) ((info)->hash)) : NULL) + +#define elf32_nds32_compute_jump_table_size(htab) \ + ((htab)->next_tls_desc_index * 4) + +#define elf32_nds32_local_tlsdesc_gotent(bfd) \ + (elf_nds32_tdata (bfd)->local_tlsdesc_gotent) + +/* Hash table structure for target nds32. There are some members to + save target options passed from nds32elf.em to bfd. */ + +struct elf_nds32_link_hash_table +{ + struct elf_link_hash_table root; + + /* ?? Short-cuts to get to dynamic linker sections. */ + asection *sdynbss; + asection *srelbss; + + /* Small local sym to section mapping cache. */ + struct sym_cache sym_cache; + + /* Target dependent options. */ + int relax_fp_as_gp; /* --mrelax-omit-fp */ + int eliminate_gc_relocs; /* --meliminate-gc-relocs */ + FILE *sym_ld_script; /* --mgen-symbol-ld-script= */ + /* Disable if linking a dynamically linked executable. */ + int load_store_relax; + int target_optimize; /* Switch optimization. */ + int relax_status; /* Finished optimization. */ + int relax_round; /* Going optimization. */ + FILE *ex9_export_file; /* --mexport-ex9= */ + FILE *ex9_import_file; /* --mimport-ex9= */ + int update_ex9_table; /* --mupdate-ex9. */ + int ex9_limit; + bfd_boolean ex9_loop_aware; /* Ignore ex9 if inside a loop. */ + bfd_boolean ifc_loop_aware; /* Ignore ifc if inside a loop. */ + bfd_boolean hyper_relax; /* Relax for symbol not in RW sections. */ + + /* The offset into splt of the PLT entry for the TLS descriptor + resolver. Special values are 0, if not necessary (or not found + to be necessary yet), and -1 if needed but not determined + yet. */ + bfd_vma dt_tlsdesc_plt; + + /* The offset into sgot of the GOT entry used by the PLT entry + above. */ + bfd_vma dt_tlsdesc_got; + + /* Offset in .plt section of tls_nds32_trampoline. */ + bfd_vma tls_trampoline; + + /* The index of the next unused R_NDS32_TLS_DESC slot in .rel.plt. */ + bfd_vma next_tls_desc_index; + + /* How many R_NDS32_TLS_DESC relocations were generated so far. */ + bfd_vma num_tls_desc; + + /* The amount of space used by the reserved portion of the sgotplt + section, plus whatever space is used by the jump slots. */ + bfd_vma sgotplt_jump_table_size; + + /* True if the target uses REL relocations. */ + int use_rel; +}; +#endif diff -Nur binutils-2.24.orig/bfd/elf-bfd.h binutils-2.24/bfd/elf-bfd.h --- binutils-2.24.orig/bfd/elf-bfd.h 2013-11-08 11:13:48.000000000 +0100 +++ binutils-2.24/bfd/elf-bfd.h 2016-06-30 21:26:12.569889845 +0200 @@ -419,6 +419,7 @@ MICROBLAZE_ELF_DATA, MIPS_ELF_DATA, MN10300_ELF_DATA, + NDS32_ELF_DATA, NIOS2_ELF_DATA, PPC32_ELF_DATA, PPC64_ELF_DATA, diff -Nur binutils-2.24.orig/bfd/libbfd.c binutils-2.24/bfd/libbfd.c --- binutils-2.24.orig/bfd/libbfd.c 2013-11-04 16:33:37.000000000 +0100 +++ binutils-2.24/bfd/libbfd.c 2016-06-30 21:26:12.569889845 +0200 @@ -550,11 +550,10 @@ .*/ /* Sign extension to bfd_signed_vma. */ -#define COERCE16(x) (((bfd_signed_vma) (x) ^ 0x8000) - 0x8000) -#define COERCE32(x) (((bfd_signed_vma) (x) ^ 0x80000000) - 0x80000000) -#define EIGHT_GAZILLION ((bfd_int64_t) 1 << 63) +#define COERCE16(x) (((bfd_vma) (x) ^ 0x8000) - 0x8000) +#define COERCE32(x) (((bfd_vma) (x) ^ 0x80000000) - 0x80000000) #define COERCE64(x) \ - (((bfd_int64_t) (x) ^ EIGHT_GAZILLION) - EIGHT_GAZILLION) + (((bfd_uint64_t) (x) ^ ((bfd_uint64_t) 1 << 63)) - ((bfd_uint64_t) 1 << 63)) bfd_vma bfd_getb16 (const void *p) diff -Nur binutils-2.24.orig/bfd/libbfd.h binutils-2.24/bfd/libbfd.h --- binutils-2.24.orig/bfd/libbfd.h 2013-11-18 09:40:15.000000000 +0100 +++ binutils-2.24/bfd/libbfd.h 2016-06-30 21:26:12.569889845 +0200 @@ -1746,6 +1746,141 @@ "BFD_RELOC_M32R_GOTPC_HI_ULO", "BFD_RELOC_M32R_GOTPC_HI_SLO", "BFD_RELOC_M32R_GOTPC_LO", + "BFD_RELOC_NDS32_20", + "BFD_RELOC_NDS32_9_PCREL", + "BFD_RELOC_NDS32_WORD_9_PCREL", + "BFD_RELOC_NDS32_15_PCREL", + "BFD_RELOC_NDS32_17_PCREL", + "BFD_RELOC_NDS32_25_PCREL", + "BFD_RELOC_NDS32_HI20", + "BFD_RELOC_NDS32_LO12S3", + "BFD_RELOC_NDS32_LO12S2", + "BFD_RELOC_NDS32_LO12S1", + "BFD_RELOC_NDS32_LO12S0", + "BFD_RELOC_NDS32_LO12S0_ORI", + "BFD_RELOC_NDS32_SDA15S3", + "BFD_RELOC_NDS32_SDA15S2", + "BFD_RELOC_NDS32_SDA15S1", + "BFD_RELOC_NDS32_SDA15S0", + "BFD_RELOC_NDS32_SDA16S3", + "BFD_RELOC_NDS32_SDA17S2", + "BFD_RELOC_NDS32_SDA18S1", + "BFD_RELOC_NDS32_SDA19S0", + "BFD_RELOC_NDS32_SECURITY_16", + "BFD_RELOC_NDS32_GOT20", + "BFD_RELOC_NDS32_9_PLTREL", + "BFD_RELOC_NDS32_25_PLTREL", + "BFD_RELOC_NDS32_COPY", + "BFD_RELOC_NDS32_GLOB_DAT", + "BFD_RELOC_NDS32_JMP_SLOT", + "BFD_RELOC_NDS32_RELATIVE", + "BFD_RELOC_NDS32_GOTOFF", + "BFD_RELOC_NDS32_GOTOFF_HI20", + "BFD_RELOC_NDS32_GOTOFF_LO12", + "BFD_RELOC_NDS32_GOTPC20", + "BFD_RELOC_NDS32_GOT_HI20", + "BFD_RELOC_NDS32_GOT_LO12", + "BFD_RELOC_NDS32_GOTPC_HI20", + "BFD_RELOC_NDS32_GOTPC_LO12", + "BFD_RELOC_NDS32_INSN16", + "BFD_RELOC_NDS32_LABEL", + "BFD_RELOC_NDS32_LONGCALL1", + "BFD_RELOC_NDS32_LONGCALL2", + "BFD_RELOC_NDS32_LONGCALL3", + "BFD_RELOC_NDS32_LONGJUMP1", + "BFD_RELOC_NDS32_LONGJUMP2", + "BFD_RELOC_NDS32_LONGJUMP3", + "BFD_RELOC_NDS32_LOADSTORE", + "BFD_RELOC_NDS32_9_FIXED", + "BFD_RELOC_NDS32_15_FIXED", + "BFD_RELOC_NDS32_17_FIXED", + "BFD_RELOC_NDS32_25_FIXED", + "BFD_RELOC_NDS32_LONGCALL4", + "BFD_RELOC_NDS32_LONGCALL5", + "BFD_RELOC_NDS32_LONGCALL6", + "BFD_RELOC_NDS32_LONGJUMP4", + "BFD_RELOC_NDS32_LONGJUMP5", + "BFD_RELOC_NDS32_LONGJUMP6", + "BFD_RELOC_NDS32_LONGJUMP7", + "BFD_RELOC_NDS32_PLTREL_HI20", + "BFD_RELOC_NDS32_PLTREL_LO12", + "BFD_RELOC_NDS32_PLT_GOTREL_HI20", + "BFD_RELOC_NDS32_PLT_GOTREL_LO12", + "BFD_RELOC_NDS32_SDA12S2_DP", + "BFD_RELOC_NDS32_SDA12S2_SP", + "BFD_RELOC_NDS32_LO12S2_DP", + "BFD_RELOC_NDS32_LO12S2_SP", + "BFD_RELOC_NDS32_DWARF2_OP1", + "BFD_RELOC_NDS32_DWARF2_OP2", + "BFD_RELOC_NDS32_DWARF2_LEB", + "BFD_RELOC_NDS32_UPDATE_TA", + "BFD_RELOC_NDS32_PLT_GOTREL_LO20", + "BFD_RELOC_NDS32_PLT_GOTREL_LO15", + "BFD_RELOC_NDS32_PLT_GOTREL_LO19", + "BFD_RELOC_NDS32_GOT_LO15", + "BFD_RELOC_NDS32_GOT_LO19", + "BFD_RELOC_NDS32_GOTOFF_LO15", + "BFD_RELOC_NDS32_GOTOFF_LO19", + "BFD_RELOC_NDS32_GOT15S2", + "BFD_RELOC_NDS32_GOT17S2", + "BFD_RELOC_NDS32_5", + "BFD_RELOC_NDS32_10_UPCREL", + "BFD_RELOC_NDS32_SDA_FP7U2_RELA", + "BFD_RELOC_NDS32_RELAX_ENTRY", + "BFD_RELOC_NDS32_GOT_SUFF", + "BFD_RELOC_NDS32_GOTOFF_SUFF", + "BFD_RELOC_NDS32_PLT_GOT_SUFF", + "BFD_RELOC_NDS32_MULCALL_SUFF", + "BFD_RELOC_NDS32_PTR", + "BFD_RELOC_NDS32_PTR_COUNT", + "BFD_RELOC_NDS32_PTR_RESOLVED", + "BFD_RELOC_NDS32_PLTBLOCK", + "BFD_RELOC_NDS32_RELAX_REGION_BEGIN", + "BFD_RELOC_NDS32_RELAX_REGION_END", + "BFD_RELOC_NDS32_MINUEND", + "BFD_RELOC_NDS32_SUBTRAHEND", + "BFD_RELOC_NDS32_DIFF8", + "BFD_RELOC_NDS32_DIFF16", + "BFD_RELOC_NDS32_DIFF32", + "BFD_RELOC_NDS32_DIFF_ULEB128", + "BFD_RELOC_NDS32_EMPTY", + "BFD_RELOC_NDS32_25_ABS", + "BFD_RELOC_NDS32_DATA", + "BFD_RELOC_NDS32_TRAN", + "BFD_RELOC_NDS32_17IFC_PCREL", + "BFD_RELOC_NDS32_10IFCU_PCREL", + "BFD_RELOC_NDS32_TPOFF", + "BFD_RELOC_NDS32_GOTTPOFF", + "BFD_RELOC_NDS32_TLS_LE_HI20", + "BFD_RELOC_NDS32_TLS_LE_LO12", + "BFD_RELOC_NDS32_TLS_LE_20", + "BFD_RELOC_NDS32_TLS_LE_15S0", + "BFD_RELOC_NDS32_TLS_LE_15S1", + "BFD_RELOC_NDS32_TLS_LE_15S2", + "BFD_RELOC_NDS32_TLS_LE_ADD", + "BFD_RELOC_NDS32_TLS_LE_LS", + "BFD_RELOC_NDS32_TLS_IE_HI20", + "BFD_RELOC_NDS32_TLS_IE_LO12", + "BFD_RELOC_NDS32_TLS_IE_LO12S2", + "BFD_RELOC_NDS32_TLS_IEGP_HI20", + "BFD_RELOC_NDS32_TLS_IEGP_LO12", + "BFD_RELOC_NDS32_TLS_IEGP_LO12S2", + "BFD_RELOC_NDS32_TLS_IEGP_LW", + "BFD_RELOC_NDS32_TLS_DESC", + "BFD_RELOC_NDS32_TLS_DESC_HI20", + "BFD_RELOC_NDS32_TLS_DESC_LO12", + "BFD_RELOC_NDS32_TLS_DESC_20", + "BFD_RELOC_NDS32_TLS_DESC_SDA17S2", + "BFD_RELOC_NDS32_TLS_DESC_ADD", + "BFD_RELOC_NDS32_TLS_DESC_FUNC", + "BFD_RELOC_NDS32_TLS_DESC_CALL", + "BFD_RELOC_NDS32_TLS_DESC_MEM", + "BFD_RELOC_NDS32_REMOVE", + "BFD_RELOC_NDS32_GROUP", + "BFD_RELOC_NDS32_ICT", + "BFD_RELOC_NDS32_ICT_HI20", + "BFD_RELOC_NDS32_ICT_LO12", + "BFD_RELOC_NDS32_ICT_25PC", "BFD_RELOC_V850_9_PCREL", "BFD_RELOC_V850_22_PCREL", "BFD_RELOC_V850_SDA_16_16_OFFSET", diff -Nur binutils-2.24.orig/bfd/Makefile.am binutils-2.24/bfd/Makefile.am --- binutils-2.24.orig/bfd/Makefile.am 2013-12-02 10:30:28.000000000 +0100 +++ binutils-2.24/bfd/Makefile.am 2016-06-30 21:26:12.573890000 +0200 @@ -136,6 +136,7 @@ cpu-moxie.lo \ cpu-msp430.lo \ cpu-mt.lo \ + cpu-nds32.lo \ cpu-nios2.lo \ cpu-ns32k.lo \ cpu-openrisc.lo \ @@ -220,6 +221,7 @@ cpu-moxie.c \ cpu-msp430.c \ cpu-mt.c \ + cpu-nds32.c \ cpu-ns32k.c \ cpu-nios2.c \ cpu-openrisc.c \ @@ -349,6 +351,7 @@ elf32-moxie.lo \ elf32-msp430.lo \ elf32-mt.lo \ + elf32-nds32.lo \ elf32-nios2.lo \ elf32-openrisc.lo \ elf32-or32.lo \ @@ -537,6 +540,7 @@ elf32-moxie.c \ elf32-msp430.c \ elf32-mt.c \ + elf32-nds32.c \ elf32-nios2.c \ elf32-openrisc.c \ elf32-or32.c \ diff -Nur binutils-2.24.orig/bfd/Makefile.in binutils-2.24/bfd/Makefile.in --- binutils-2.24.orig/bfd/Makefile.in 2013-12-02 10:30:30.000000000 +0100 +++ binutils-2.24/bfd/Makefile.in 2016-06-30 21:26:12.573890000 +0200 @@ -437,6 +437,7 @@ cpu-moxie.lo \ cpu-msp430.lo \ cpu-mt.lo \ + cpu-nds32.lo \ cpu-nios2.lo \ cpu-ns32k.lo \ cpu-openrisc.lo \ @@ -521,6 +522,7 @@ cpu-moxie.c \ cpu-msp430.c \ cpu-mt.c \ + cpu-nds32.c \ cpu-ns32k.c \ cpu-nios2.c \ cpu-openrisc.c \ @@ -651,6 +653,7 @@ elf32-moxie.lo \ elf32-msp430.lo \ elf32-mt.lo \ + elf32-nds32.lo \ elf32-nios2.lo \ elf32-openrisc.lo \ elf32-or32.lo \ @@ -839,6 +842,7 @@ elf32-moxie.c \ elf32-msp430.c \ elf32-mt.c \ + elf32-nds32.c \ elf32-nios2.c \ elf32-openrisc.c \ elf32-or32.c \ @@ -1352,6 +1356,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-moxie.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-msp430.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-mt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-nds32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-nios2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-ns32k.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-openrisc.Plo@am__quote@ @@ -1442,6 +1447,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-moxie.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-msp430.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-mt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-nds32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-nios2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-openrisc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-or32.Plo@am__quote@ diff -Nur binutils-2.24.orig/bfd/reloc.c binutils-2.24/bfd/reloc.c --- binutils-2.24.orig/bfd/reloc.c 2013-11-18 09:40:15.000000000 +0100 +++ binutils-2.24/bfd/reloc.c 2016-06-30 21:26:12.573890000 +0200 @@ -3839,6 +3839,366 @@ ENUM + BFD_RELOC_NDS32_20 +ENUMDOC + NDS32 relocs. + This is a 20 bit absolute address. +ENUM + BFD_RELOC_NDS32_9_PCREL +ENUMDOC + This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. +ENUM + BFD_RELOC_NDS32_WORD_9_PCREL +ENUMDOC + This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. +ENUM + BFD_RELOC_NDS32_15_PCREL +ENUMDOC + This is an 15-bit reloc with the right 1 bit assumed to be 0. +ENUM + BFD_RELOC_NDS32_17_PCREL +ENUMDOC + This is an 17-bit reloc with the right 1 bit assumed to be 0. +ENUM + BFD_RELOC_NDS32_25_PCREL +ENUMDOC + This is a 25-bit reloc with the right 1 bit assumed to be 0. +ENUM + BFD_RELOC_NDS32_HI20 +ENUMDOC + This is a 20-bit reloc containing the high 20 bits of an address + used with the lower 12 bits +ENUM + BFD_RELOC_NDS32_LO12S3 +ENUMDOC + This is a 12-bit reloc containing the lower 12 bits of an address + then shift right by 3. This is used with ldi,sdi... +ENUM + BFD_RELOC_NDS32_LO12S2 +ENUMDOC + This is a 12-bit reloc containing the lower 12 bits of an address + then shift left by 2. This is used with lwi,swi... +ENUM + BFD_RELOC_NDS32_LO12S1 +ENUMDOC + This is a 12-bit reloc containing the lower 12 bits of an address + then shift left by 1. This is used with lhi,shi... +ENUM + BFD_RELOC_NDS32_LO12S0 +ENUMDOC + This is a 12-bit reloc containing the lower 12 bits of an address + then shift left by 0. This is used with lbisbi... +ENUM + BFD_RELOC_NDS32_LO12S0_ORI +ENUMDOC + This is a 12-bit reloc containing the lower 12 bits of an address + then shift left by 0. This is only used with branch relaxations +ENUM + BFD_RELOC_NDS32_SDA15S3 +ENUMDOC + This is a 15-bit reloc containing the small data area 18-bit signed offset + and shift left by 3 for use in ldi, sdi... +ENUM + BFD_RELOC_NDS32_SDA15S2 +ENUMDOC + This is a 15-bit reloc containing the small data area 17-bit signed offset + and shift left by 2 for use in lwi, swi... +ENUM + BFD_RELOC_NDS32_SDA15S1 +ENUMDOC + This is a 15-bit reloc containing the small data area 16-bit signed offset + and shift left by 1 for use in lhi, shi... +ENUM + BFD_RELOC_NDS32_SDA15S0 +ENUMDOC + This is a 15-bit reloc containing the small data area 15-bit signed offset + and shift left by 0 for use in lbi, sbi... +ENUM + BFD_RELOC_NDS32_SDA16S3 +ENUMDOC + This is a 16-bit reloc containing the small data area 16-bit signed offset + and shift left by 3 +ENUM + BFD_RELOC_NDS32_SDA17S2 +ENUMDOC + This is a 17-bit reloc containing the small data area 17-bit signed offset + and shift left by 2 for use in lwi.gp, swi.gp... +ENUM + BFD_RELOC_NDS32_SDA18S1 +ENUMDOC + This is a 18-bit reloc containing the small data area 18-bit signed offset + and shift left by 1 for use in lhi.gp, shi.gp... +ENUM + BFD_RELOC_NDS32_SDA19S0 +ENUMDOC + This is a 19-bit reloc containing the small data area 19-bit signed offset + and shift left by 0 for use in lbi.gp, sbi.gp... +ENUM + BFD_RELOC_NDS32_SECURITY_16 +ENUMDOC + This is a 24-bit reloc for security check sum. +ENUM + BFD_RELOC_NDS32_GOT20 +ENUMX + BFD_RELOC_NDS32_9_PLTREL +ENUMX + BFD_RELOC_NDS32_25_PLTREL +ENUMX + BFD_RELOC_NDS32_COPY +ENUMX + BFD_RELOC_NDS32_GLOB_DAT +ENUMX + BFD_RELOC_NDS32_JMP_SLOT +ENUMX + BFD_RELOC_NDS32_RELATIVE +ENUMX + BFD_RELOC_NDS32_GOTOFF +ENUMX + BFD_RELOC_NDS32_GOTOFF_HI20 +ENUMX + BFD_RELOC_NDS32_GOTOFF_LO12 +ENUMX + BFD_RELOC_NDS32_GOTPC20 +ENUMX + BFD_RELOC_NDS32_GOT_HI20 +ENUMX + BFD_RELOC_NDS32_GOT_LO12 +ENUMX + BFD_RELOC_NDS32_GOTPC_HI20 +ENUMX + BFD_RELOC_NDS32_GOTPC_LO12 +ENUMDOC + for PIC +ENUM + BFD_RELOC_NDS32_INSN16 +ENUMX + BFD_RELOC_NDS32_LABEL +ENUMX + BFD_RELOC_NDS32_LONGCALL1 +ENUMX + BFD_RELOC_NDS32_LONGCALL2 +ENUMX + BFD_RELOC_NDS32_LONGCALL3 +ENUMX + BFD_RELOC_NDS32_LONGJUMP1 +ENUMX + BFD_RELOC_NDS32_LONGJUMP2 +ENUMX + BFD_RELOC_NDS32_LONGJUMP3 +ENUMX + BFD_RELOC_NDS32_LOADSTORE +ENUMX + BFD_RELOC_NDS32_9_FIXED +ENUMX + BFD_RELOC_NDS32_15_FIXED +ENUMX + BFD_RELOC_NDS32_17_FIXED +ENUMX + BFD_RELOC_NDS32_25_FIXED +ENUMX + BFD_RELOC_NDS32_LONGCALL4 +ENUMX + BFD_RELOC_NDS32_LONGCALL5 +ENUMX + BFD_RELOC_NDS32_LONGCALL6 +ENUMX + BFD_RELOC_NDS32_LONGJUMP4 +ENUMX + BFD_RELOC_NDS32_LONGJUMP5 +ENUMX + BFD_RELOC_NDS32_LONGJUMP6 +ENUMX + BFD_RELOC_NDS32_LONGJUMP7 +ENUMDOC + for relax +ENUM + BFD_RELOC_NDS32_PLTREL_HI20 +ENUMX + BFD_RELOC_NDS32_PLTREL_LO12 +ENUMX + BFD_RELOC_NDS32_PLT_GOTREL_HI20 +ENUMX + BFD_RELOC_NDS32_PLT_GOTREL_LO12 +ENUMDOC + for PIC +ENUM + BFD_RELOC_NDS32_SDA12S2_DP +ENUMX + BFD_RELOC_NDS32_SDA12S2_SP +ENUMX + BFD_RELOC_NDS32_LO12S2_DP +ENUMX + BFD_RELOC_NDS32_LO12S2_SP +ENUMDOC + for floating point +ENUM + BFD_RELOC_NDS32_DWARF2_OP1 +ENUMX + BFD_RELOC_NDS32_DWARF2_OP2 +ENUMX + BFD_RELOC_NDS32_DWARF2_LEB +ENUMDOC + for dwarf2 debug_line. +ENUM + BFD_RELOC_NDS32_UPDATE_TA +ENUMDOC + for eliminate 16-bit instructions +ENUM + BFD_RELOC_NDS32_PLT_GOTREL_LO20 +ENUMX + BFD_RELOC_NDS32_PLT_GOTREL_LO15 +ENUMX + BFD_RELOC_NDS32_PLT_GOTREL_LO19 +ENUMX + BFD_RELOC_NDS32_GOT_LO15 +ENUMX + BFD_RELOC_NDS32_GOT_LO19 +ENUMX + BFD_RELOC_NDS32_GOTOFF_LO15 +ENUMX + BFD_RELOC_NDS32_GOTOFF_LO19 +ENUMX + BFD_RELOC_NDS32_GOT15S2 +ENUMX + BFD_RELOC_NDS32_GOT17S2 +ENUMDOC + for PIC object relaxation +ENUM + BFD_RELOC_NDS32_5 +ENUMDOC + NDS32 relocs. + This is a 5 bit absolute address. +ENUM + BFD_RELOC_NDS32_10_UPCREL +ENUMDOC + This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. +ENUM + BFD_RELOC_NDS32_SDA_FP7U2_RELA +ENUMDOC + If fp were omitted, fp can used as another gp. +ENUM + BFD_RELOC_NDS32_RELAX_ENTRY +ENUMX + BFD_RELOC_NDS32_GOT_SUFF +ENUMX + BFD_RELOC_NDS32_GOTOFF_SUFF +ENUMX + BFD_RELOC_NDS32_PLT_GOT_SUFF +ENUMX + BFD_RELOC_NDS32_MULCALL_SUFF +ENUMX + BFD_RELOC_NDS32_PTR +ENUMX + BFD_RELOC_NDS32_PTR_COUNT +ENUMX + BFD_RELOC_NDS32_PTR_RESOLVED +ENUMX + BFD_RELOC_NDS32_PLTBLOCK +ENUMX + BFD_RELOC_NDS32_RELAX_REGION_BEGIN +ENUMX + BFD_RELOC_NDS32_RELAX_REGION_END +ENUMX + BFD_RELOC_NDS32_MINUEND +ENUMX + BFD_RELOC_NDS32_SUBTRAHEND +ENUMX + BFD_RELOC_NDS32_DIFF8 +ENUMX + BFD_RELOC_NDS32_DIFF16 +ENUMX + BFD_RELOC_NDS32_DIFF32 +ENUMX + BFD_RELOC_NDS32_DIFF_ULEB128 +ENUMX + BFD_RELOC_NDS32_EMPTY +ENUMDOC + relaxation relative relocation types +ENUM + BFD_RELOC_NDS32_25_ABS +ENUMDOC + This is a 25 bit absolute address. +ENUM + BFD_RELOC_NDS32_DATA +ENUMX + BFD_RELOC_NDS32_TRAN +ENUMX + BFD_RELOC_NDS32_17IFC_PCREL +ENUMX + BFD_RELOC_NDS32_10IFCU_PCREL +ENUMDOC + For ex9 and ifc using. +ENUM + BFD_RELOC_NDS32_TPOFF +ENUMX + BFD_RELOC_NDS32_GOTTPOFF +ENUMX + BFD_RELOC_NDS32_TLS_LE_HI20 +ENUMX + BFD_RELOC_NDS32_TLS_LE_LO12 +ENUMX + BFD_RELOC_NDS32_TLS_LE_20 +ENUMX + BFD_RELOC_NDS32_TLS_LE_15S0 +ENUMX + BFD_RELOC_NDS32_TLS_LE_15S1 +ENUMX + BFD_RELOC_NDS32_TLS_LE_15S2 +ENUMX + BFD_RELOC_NDS32_TLS_LE_ADD +ENUMX + BFD_RELOC_NDS32_TLS_LE_LS +ENUMX + BFD_RELOC_NDS32_TLS_IE_HI20 +ENUMX + BFD_RELOC_NDS32_TLS_IE_LO12 +ENUMX + BFD_RELOC_NDS32_TLS_IE_LO12S2 +ENUMX + BFD_RELOC_NDS32_TLS_IEGP_HI20 +ENUMX + BFD_RELOC_NDS32_TLS_IEGP_LO12 +ENUMX + BFD_RELOC_NDS32_TLS_IEGP_LO12S2 +ENUMX + BFD_RELOC_NDS32_TLS_IEGP_LW +ENUMX + BFD_RELOC_NDS32_TLS_DESC +ENUMX + BFD_RELOC_NDS32_TLS_DESC_HI20 +ENUMX + BFD_RELOC_NDS32_TLS_DESC_LO12 +ENUMX + BFD_RELOC_NDS32_TLS_DESC_20 +ENUMX + BFD_RELOC_NDS32_TLS_DESC_SDA17S2 +ENUMX + BFD_RELOC_NDS32_TLS_DESC_ADD +ENUMX + BFD_RELOC_NDS32_TLS_DESC_FUNC +ENUMX + BFD_RELOC_NDS32_TLS_DESC_CALL +ENUMX + BFD_RELOC_NDS32_TLS_DESC_MEM +ENUMX + BFD_RELOC_NDS32_REMOVE +ENUMX + BFD_RELOC_NDS32_GROUP +ENUMDOC + For TLS. + +ENUM + BFD_RELOC_NDS32_ICT +ENUMX + BFD_RELOC_NDS32_ICT_HI20 +ENUMX + BFD_RELOC_NDS32_ICT_LO12 +ENUMX + BFD_RELOC_NDS32_ICT_25PC +ENUMDOC + Jump-patch table relative relocations. + +ENUM BFD_RELOC_V850_9_PCREL ENUMDOC This is a 9-bit reloc diff -Nur binutils-2.24.orig/bfd/section.c binutils-2.24/bfd/section.c --- binutils-2.24.orig/bfd/section.c 2013-11-04 16:33:37.000000000 +0100 +++ binutils-2.24/bfd/section.c 2016-06-30 21:26:12.573890000 +0200 @@ -542,6 +542,32 @@ . int size; .}; . +.{* Note: the following are provided as inline functions rather than macros +. because not all callers use the return value. A macro implementation +. would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some +. compilers will complain about comma expressions that have no effect. *} +.static inline bfd_boolean +.bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val) +.{ +. ptr->userdata = val; +. return TRUE; +.} +. +.static inline bfd_boolean +.bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val) +.{ +. ptr->vma = ptr->lma = val; +. ptr->user_set_vma = TRUE; +. return TRUE; +.} +. +.static inline bfd_boolean +.bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val) +.{ +. ptr->alignment_power = val; +. return TRUE; +.} +. .{* These sections are global, and are managed by BFD. The application . and target back end are not permitted to change the values in . these sections. *} diff -Nur binutils-2.24.orig/bfd/targets.c binutils-2.24/bfd/targets.c --- binutils-2.24.orig/bfd/targets.c 2013-11-04 16:33:37.000000000 +0100 +++ binutils-2.24/bfd/targets.c 2016-06-30 21:26:12.573890000 +0200 @@ -673,6 +673,10 @@ extern const bfd_target bfd_elf32_ntradlittlemips_vec; extern const bfd_target bfd_elf32_ntradbigmips_freebsd_vec; extern const bfd_target bfd_elf32_ntradlittlemips_freebsd_vec; +extern const bfd_target bfd_elf32_nds32be_vec; +extern const bfd_target bfd_elf32_nds32le_vec; +extern const bfd_target bfd_elf32_nds32belin_vec; +extern const bfd_target bfd_elf32_nds32lelin_vec; extern const bfd_target bfd_elf32_openrisc_vec; extern const bfd_target bfd_elf32_or32_big_vec; extern const bfd_target bfd_elf32_pj_vec; @@ -1061,6 +1065,10 @@ &bfd_elf32_ntradbigmips_freebsd_vec, &bfd_elf32_ntradlittlemips_freebsd_vec, #endif + &bfd_elf32_nds32be_vec, + &bfd_elf32_nds32le_vec, + &bfd_elf32_nds32belin_vec, + &bfd_elf32_nds32lelin_vec, &bfd_elf32_openrisc_vec, &bfd_elf32_or32_big_vec, &bfd_elf32_pj_vec, diff -Nur binutils-2.24.orig/binutils/arlex.c binutils-2.24/binutils/arlex.c --- binutils-2.24.orig/binutils/arlex.c 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/arlex.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,2036 +0,0 @@ - -#line 3 "arlex.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern yy_size_t yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); - -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; - -typedef int yy_state_type; - -extern int yylineno; - -int yylineno = 1; - -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (yy_size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 40 -#define YY_END_OF_BUFFER 41 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[177] = - { 0, - 0, 0, 41, 40, 39, 38, 35, 32, 33, 36, - 40, 34, 37, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 36, 31, 37, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 7, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 22, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - - 35, 35, 35, 10, 11, 12, 35, 15, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 25, 26, 27, - 35, 30, 35, 35, 35, 3, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 18, 35, 35, 35, 35, - 35, 35, 35, 1, 2, 4, 5, 35, 35, 35, - 35, 35, 16, 17, 19, 20, 35, 35, 35, 35, - 35, 35, 8, 9, 13, 14, 35, 23, 24, 28, - 29, 35, 35, 6, 21, 0 - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 1, 4, 1, 1, 1, 5, - 6, 7, 8, 9, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 10, 1, - 1, 1, 1, 1, 11, 12, 13, 14, 15, 16, - 4, 17, 18, 4, 4, 19, 20, 21, 22, 23, - 4, 24, 25, 26, 27, 28, 4, 29, 30, 4, - 1, 4, 1, 1, 4, 1, 31, 32, 33, 34, - - 35, 36, 4, 37, 38, 4, 4, 39, 40, 41, - 42, 43, 4, 44, 45, 46, 47, 48, 4, 49, - 50, 4, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int32_t yy_meta[51] = - { 0, - 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 - } ; - -static yyconst flex_int16_t yy_base[180] = - { 0, - 0, 0, 193, 194, 194, 194, 0, 194, 194, 0, - 190, 194, 0, 177, 32, 37, 32, 163, 174, 170, - 164, 171, 174, 169, 149, 15, 22, 17, 135, 146, - 142, 136, 143, 146, 141, 0, 0, 194, 0, 161, - 159, 158, 153, 147, 156, 143, 149, 148, 141, 150, - 141, 135, 138, 127, 125, 124, 119, 113, 122, 109, - 115, 114, 107, 116, 107, 101, 104, 43, 136, 135, - 130, 129, 0, 119, 123, 118, 114, 118, 119, 122, - 124, 25, 104, 103, 98, 97, 0, 87, 91, 86, - 82, 86, 87, 90, 92, 105, 100, 97, 94, 93, - - 105, 106, 102, 0, 0, 0, 104, 0, 92, 75, - 70, 67, 64, 63, 75, 76, 72, 0, 0, 0, - 74, 0, 62, 91, 88, 0, 86, 85, 73, 85, - 79, 83, 70, 62, 59, 0, 57, 56, 44, 56, - 50, 54, 41, 0, 0, 0, 0, 63, 58, 59, - 67, 66, 0, 0, 0, 0, 38, 33, 34, 42, - 41, 51, 0, 0, 0, 0, 30, 0, 0, 0, - 0, 43, 21, 0, 0, 194, 65, 66, 69 - } ; - -static yyconst flex_int16_t yy_def[180] = - { 0, - 176, 1, 176, 176, 176, 176, 177, 176, 176, 178, - 176, 176, 179, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 178, 176, 179, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 0, 176, 176, 176 - } ; - -static yyconst flex_int16_t yy_nxt[245] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 7, 15, 16, 17, 18, 19, 7, 20, 7, - 7, 21, 7, 22, 23, 7, 7, 24, 7, 7, - 25, 7, 26, 27, 28, 29, 30, 7, 31, 7, - 7, 32, 7, 33, 34, 7, 7, 35, 7, 7, - 41, 43, 45, 55, 44, 42, 57, 59, 56, 58, - 46, 96, 97, 110, 111, 60, 37, 36, 37, 39, - 175, 39, 174, 173, 172, 171, 170, 169, 168, 167, - 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, - - 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, - 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, - 116, 115, 114, 113, 112, 109, 108, 107, 106, 105, - 104, 103, 102, 101, 100, 99, 98, 95, 94, 93, - 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, - 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, - 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, - 62, 61, 54, 53, 52, 51, 50, 49, 48, 47, - 40, 38, 176, 3, 176, 176, 176, 176, 176, 176, - - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176 - } ; - -static yyconst flex_int16_t yy_chk[245] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 15, 16, 17, 26, 16, 15, 27, 28, 26, 27, - 17, 68, 68, 82, 82, 28, 178, 177, 178, 179, - 173, 179, 172, 167, 162, 161, 160, 159, 158, 157, - 152, 151, 150, 149, 148, 143, 142, 141, 140, 139, - 138, 137, 135, 134, 133, 132, 131, 130, 129, 128, - - 127, 125, 124, 123, 121, 117, 116, 115, 114, 113, - 112, 111, 110, 109, 107, 103, 102, 101, 100, 99, - 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, - 88, 86, 85, 84, 83, 81, 80, 79, 78, 77, - 76, 75, 74, 72, 71, 70, 69, 67, 66, 65, - 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, - 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, - 44, 43, 42, 41, 40, 35, 34, 33, 32, 31, - 30, 29, 25, 24, 23, 22, 21, 20, 19, 18, - 14, 11, 3, 176, 176, 176, 176, 176, 176, 176, - - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "arlex.l" -#define YY_NO_INPUT 1 -#line 4 "arlex.l" -/* arlex.l - Strange script language lexer */ - -/* Copyright 1992, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2011 - 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 3 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., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - - -/* Contributed by Steve Chamberlain . */ - -#define DONTDECLARE_MALLOC -#include "ansidecl.h" -#include "libiberty.h" -#include "arparse.h" - -#ifndef YY_NO_UNPUT -#define YY_NO_UNPUT -#endif - -extern int yylex (void); - -int linenumber; -#line 599 "arlex.c" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy (void ); - -int yyget_debug (void ); - -void yyset_debug (int debug_flag ); - -YY_EXTRA_TYPE yyget_extra (void ); - -void yyset_extra (YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in (void ); - -void yyset_in (FILE * in_str ); - -FILE *yyget_out (void ); - -void yyset_out (FILE * out_str ); - -yy_size_t yyget_leng (void ); - -char *yyget_text (void ); - -int yyget_lineno (void ); - -void yyset_lineno (int line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap (void ); -#else -extern int yywrap (void ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - yy_size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 46 "arlex.l" - - -#line 782 "arlex.c" - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 177 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 194 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 48 "arlex.l" -{ return ADDLIB; } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 49 "arlex.l" -{ return ADDMOD; } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 50 "arlex.l" -{ return CLEAR; } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 51 "arlex.l" -{ return CREATE; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 52 "arlex.l" -{ return DELETE; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 53 "arlex.l" -{ return DIRECTORY; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 54 "arlex.l" -{ return END; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 55 "arlex.l" -{ return EXTRACT; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 56 "arlex.l" -{ return FULLDIR; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 57 "arlex.l" -{ return HELP; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 58 "arlex.l" -{ return LIST; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 59 "arlex.l" -{ return OPEN; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 60 "arlex.l" -{ return REPLACE; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 61 "arlex.l" -{ return VERBOSE; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 62 "arlex.l" -{ return SAVE; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 63 "arlex.l" -{ return ADDLIB; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 64 "arlex.l" -{ return ADDMOD; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 65 "arlex.l" -{ return CLEAR; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 66 "arlex.l" -{ return CREATE; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 67 "arlex.l" -{ return DELETE; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 68 "arlex.l" -{ return DIRECTORY; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 69 "arlex.l" -{ return END; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 70 "arlex.l" -{ return EXTRACT; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 71 "arlex.l" -{ return FULLDIR; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 72 "arlex.l" -{ return HELP; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 73 "arlex.l" -{ return LIST; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 74 "arlex.l" -{ return OPEN; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 75 "arlex.l" -{ return REPLACE; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 76 "arlex.l" -{ return VERBOSE; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 77 "arlex.l" -{ return SAVE; } - YY_BREAK -case 31: -/* rule 31 can match eol */ -YY_RULE_SETUP -#line 78 "arlex.l" -{ linenumber ++; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 79 "arlex.l" -{ return '('; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 80 "arlex.l" -{ return ')'; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 81 "arlex.l" -{ return ','; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 82 "arlex.l" -{ - yylval.name = xstrdup (yytext); - return FILENAME; - } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 86 "arlex.l" -{ } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 87 "arlex.l" -{ } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 88 "arlex.l" -{ } - YY_BREAK -case 39: -/* rule 39 can match eol */ -YY_RULE_SETUP -#line 89 "arlex.l" -{ linenumber ++; return NEWLINE; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 91 "arlex.l" -ECHO; - YY_BREAK -#line 1070 "arlex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 177 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 177 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 176); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer(b,file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); - - yyfree((void *) b ); -} - -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer(b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) -{ - - return yy_scan_bytes(yystr,strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n, i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -yy_size_t yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param line_number - * - */ -void yyset_lineno (int line_number ) -{ - - yylineno = line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * in_str ) -{ - yyin = in_str ; -} - -void yyset_out (FILE * out_str ) -{ - yyout = out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int bdebug ) -{ - yy_flex_debug = bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return (void *) malloc( size ); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 91 "arlex.l" - - -#ifndef yywrap -/* Needed for lex, though not flex. */ -int yywrap(void) { return 1; } -#endif - diff -Nur binutils-2.24.orig/binutils/arparse.c binutils-2.24/binutils/arparse.c --- binutils-2.24.orig/binutils/arparse.c 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/arparse.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1770 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NEWLINE = 258, - VERBOSE = 259, - FILENAME = 260, - ADDLIB = 261, - LIST = 262, - ADDMOD = 263, - CLEAR = 264, - CREATE = 265, - DELETE = 266, - DIRECTORY = 267, - END = 268, - EXTRACT = 269, - FULLDIR = 270, - HELP = 271, - QUIT = 272, - REPLACE = 273, - SAVE = 274, - OPEN = 275 - }; -#endif -/* Tokens. */ -#define NEWLINE 258 -#define VERBOSE 259 -#define FILENAME 260 -#define ADDLIB 261 -#define LIST 262 -#define ADDMOD 263 -#define CLEAR 264 -#define CREATE 265 -#define DELETE 266 -#define DIRECTORY 267 -#define END 268 -#define EXTRACT 269 -#define FULLDIR 270 -#define HELP 271 -#define QUIT 272 -#define REPLACE 273 -#define SAVE 274 -#define OPEN 275 - - - - -/* Copy the first part of user declarations. */ -#line 1 "arparse.y" - -/* arparse.y - Stange script language parser */ - -/* Copyright 1992, 1993, 1995, 1997, 1999, 2002, 2003, 2005, 2007 - 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 3 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., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - - -/* Contributed by Steve Chamberlain - sac@cygnus.com - -*/ -#define DONTDECLARE_MALLOC -#include "sysdep.h" -#include "bfd.h" -#include "arsup.h" -extern int verbose; -extern int yylex (void); -static int yyerror (const char *); - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 38 "arparse.y" -{ - char *name; -struct list *list ; - -} -/* Line 193 of yacc.c. */ -#line 179 "arparse.c" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 216 of yacc.c. */ -#line 192 "arparse.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 34 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 24 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 22 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 42 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 53 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 275 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 21, 22, 2, 2, 23, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 11, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 45, 48, 51, 53, 56, 59, 61, - 63, 66, 69, 73, 78, 80, 81, 85, 86, 90, - 91, 93, 94 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 25, 0, -1, -1, 26, 27, -1, 27, 28, -1, - -1, 29, 3, -1, 37, -1, 38, -1, 45, -1, - 40, -1, 39, -1, 32, -1, 34, -1, 36, -1, - 30, -1, 31, -1, 33, -1, 35, -1, 13, -1, - 1, -1, 5, -1, -1, 14, 43, -1, 18, 43, - -1, 9, -1, 11, 43, -1, 8, 43, -1, 7, - -1, 19, -1, 20, 5, -1, 10, 5, -1, 6, - 5, 42, -1, 12, 5, 42, 41, -1, 5, -1, - -1, 21, 43, 22, -1, -1, 43, 44, 5, -1, - -1, 23, -1, -1, 4, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = -{ - 0, 69, 69, 69, 73, 74, 78, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 102, 107, 112, 117, 121, 126, 131, - 138, 143, 149, 153, 160, 162, 166, 169, 173, 179, - 184, 185, 190 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "NEWLINE", "VERBOSE", "FILENAME", - "ADDLIB", "LIST", "ADDMOD", "CLEAR", "CREATE", "DELETE", "DIRECTORY", - "END", "EXTRACT", "FULLDIR", "HELP", "QUIT", "REPLACE", "SAVE", "OPEN", - "'('", "')'", "','", "$accept", "start", "@1", "session", "command_line", - "command", "extract_command", "replace_command", "clear_command", - "delete_command", "addmod_command", "list_command", "save_command", - "open_command", "create_command", "addlib_command", "directory_command", - "optional_filename", "modulelist", "modulename", "optcomma", - "verbose_command", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 40, 41, 44 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 24, 26, 25, 27, 27, 28, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 41, 42, 42, 43, 43, - 44, 44, 45 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 2, 0, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 2, 2, 1, 2, 2, 1, 1, - 2, 2, 3, 4, 1, 0, 3, 0, 3, 0, - 1, 0, 1 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 0, 5, 1, 0, 20, 42, 21, 0, 28, - 39, 25, 0, 39, 0, 19, 39, 39, 29, 0, - 4, 0, 15, 16, 12, 17, 13, 18, 14, 7, - 8, 11, 10, 9, 37, 27, 31, 26, 37, 23, - 24, 30, 6, 39, 32, 40, 0, 35, 41, 38, - 34, 33, 36 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 1, 2, 4, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 51, 44, 35, - 46, 33 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -14 -static const yytype_int8 yypact[] = -{ - -14, 1, -14, -14, 5, -14, -14, -14, 2, -14, - -14, -14, 21, -14, 22, -14, -14, -14, -14, 23, - -14, 26, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, 10, -3, -14, -3, 10, -3, - -3, -14, -14, -14, -14, -14, 27, 28, -1, -14, - -14, -14, -14 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -4, -13, - -14, -14 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -42 -static const yytype_int8 yytable[] = -{ - 37, 3, -41, 39, 40, -3, 5, 34, -22, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 45, 52, 45, 17, 18, 19, 36, 38, 41, 42, - 48, 43, 49, 50, 47 -}; - -static const yytype_uint8 yycheck[] = -{ - 13, 0, 5, 16, 17, 0, 1, 5, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 23, 22, 23, 18, 19, 20, 5, 5, 5, 3, - 43, 21, 5, 5, 38 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 25, 26, 0, 27, 1, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 18, 19, 20, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 45, 5, 43, 5, 43, 5, 43, - 43, 5, 3, 21, 42, 23, 44, 42, 43, 5, - 5, 41, 22 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 69 "arparse.y" - { prompt(); } - break; - - case 6: -#line 78 "arparse.y" - { prompt(); } - break; - - case 19: -#line 94 "arparse.y" - { ar_end(); return 0; } - break; - - case 21: -#line 96 "arparse.y" - { yyerror("foo"); } - break; - - case 23: -#line 103 "arparse.y" - { ar_extract((yyvsp[(2) - (2)].list)); } - break; - - case 24: -#line 108 "arparse.y" - { ar_replace((yyvsp[(2) - (2)].list)); } - break; - - case 25: -#line 113 "arparse.y" - { ar_clear(); } - break; - - case 26: -#line 118 "arparse.y" - { ar_delete((yyvsp[(2) - (2)].list)); } - break; - - case 27: -#line 122 "arparse.y" - { ar_addmod((yyvsp[(2) - (2)].list)); } - break; - - case 28: -#line 127 "arparse.y" - { ar_list(); } - break; - - case 29: -#line 132 "arparse.y" - { ar_save(); } - break; - - case 30: -#line 139 "arparse.y" - { ar_open((yyvsp[(2) - (2)].name),0); } - break; - - case 31: -#line 144 "arparse.y" - { ar_open((yyvsp[(2) - (2)].name),1); } - break; - - case 32: -#line 150 "arparse.y" - { ar_addlib((yyvsp[(2) - (3)].name),(yyvsp[(3) - (3)].list)); } - break; - - case 33: -#line 154 "arparse.y" - { ar_directory((yyvsp[(2) - (4)].name), (yyvsp[(3) - (4)].list), (yyvsp[(4) - (4)].name)); } - break; - - case 34: -#line 161 "arparse.y" - { (yyval.name) = (yyvsp[(1) - (1)].name); } - break; - - case 35: -#line 162 "arparse.y" - { (yyval.name) = 0; } - break; - - case 36: -#line 167 "arparse.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); } - break; - - case 37: -#line 169 "arparse.y" - { (yyval.list) = 0; } - break; - - case 38: -#line 174 "arparse.y" - { struct list *n = (struct list *) malloc(sizeof(struct list)); - n->next = (yyvsp[(1) - (3)].list); - n->name = (yyvsp[(3) - (3)].name); - (yyval.list) = n; - } - break; - - case 39: -#line 179 "arparse.y" - { (yyval.list) = 0; } - break; - - case 42: -#line 191 "arparse.y" - { verbose = !verbose; } - break; - - -/* Line 1267 of yacc.c. */ -#line 1546 "arparse.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -#line 195 "arparse.y" - - -static int -yyerror (const char *x ATTRIBUTE_UNUSED) -{ - extern int linenumber; - - printf (_("Syntax error in archive script, line %d\n"), linenumber + 1); - return 0; -} - diff -Nur binutils-2.24.orig/binutils/arparse.h binutils-2.24/binutils/arparse.h --- binutils-2.24.orig/binutils/arparse.h 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/arparse.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,102 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NEWLINE = 258, - VERBOSE = 259, - FILENAME = 260, - ADDLIB = 261, - LIST = 262, - ADDMOD = 263, - CLEAR = 264, - CREATE = 265, - DELETE = 266, - DIRECTORY = 267, - END = 268, - EXTRACT = 269, - FULLDIR = 270, - HELP = 271, - QUIT = 272, - REPLACE = 273, - SAVE = 274, - OPEN = 275 - }; -#endif -/* Tokens. */ -#define NEWLINE 258 -#define VERBOSE 259 -#define FILENAME 260 -#define ADDLIB 261 -#define LIST 262 -#define ADDMOD 263 -#define CLEAR 264 -#define CREATE 265 -#define DELETE 266 -#define DIRECTORY 267 -#define END 268 -#define EXTRACT 269 -#define FULLDIR 270 -#define HELP 271 -#define QUIT 272 -#define REPLACE 273 -#define SAVE 274 -#define OPEN 275 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 38 "arparse.y" -{ - char *name; -struct list *list ; - -} -/* Line 1529 of yacc.c. */ -#line 95 "arparse.h" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - diff -Nur binutils-2.24.orig/binutils/deflex.c binutils-2.24/binutils/deflex.c --- binutils-2.24.orig/binutils/deflex.c 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/deflex.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,2105 +0,0 @@ - -#line 3 "deflex.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern yy_size_t yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); - -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; - -typedef int yy_state_type; - -extern int yylineno; - -int yylineno = 1; - -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (yy_size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 42 -#define YY_END_OF_BUFFER 43 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[199] = - { 0, - 0, 0, 43, 42, 34, 36, 35, 33, 42, 28, - 42, 31, 41, 39, 27, 32, 38, 40, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 0, 29, 28, 0, 30, 31, 27, - 32, 37, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 12, 6, 28, - 7, 28, 28, 28, 28, 28, 28, 28, 28, 1, - - 28, 28, 28, 16, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 17, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 14, 28, 28, 28, 19, 21, 28, 28, - 28, 28, 28, 28, 18, 9, 28, 10, 28, 28, - 2, 28, 28, 15, 28, 28, 28, 28, 11, 13, - 28, 5, 28, 28, 22, 28, 8, 28, 28, 28, - 28, 28, 28, 20, 4, 28, 28, 28, 24, 28, - 26, 28, 3, 28, 28, 23, 25, 0 - - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 6, 1, 7, 1, 1, 8, 1, - 1, 9, 1, 10, 7, 11, 12, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 7, 14, 12, - 15, 12, 7, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 7, 26, 27, 28, 29, 30, 31, - 7, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 1, 1, 1, 1, 7, 1, 22, 22, 22, 22, - - 22, 22, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 22, - 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int32_t yy_meta[41] = - { 0, - 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, - 1, 4, 5, 1, 1, 4, 6, 6, 6, 6, - 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 - } ; - -static yyconst flex_int16_t yy_base[206] = - { 0, - 0, 0, 230, 231, 231, 231, 231, 231, 223, 0, - 220, 0, 231, 231, 0, 0, 212, 0, 209, 195, - 24, 186, 202, 14, 197, 186, 27, 188, 198, 25, - 197, 196, 184, 209, 231, 0, 206, 231, 0, 0, - 0, 231, 0, 180, 27, 178, 178, 27, 193, 178, - 183, 189, 179, 177, 175, 178, 185, 182, 183, 170, - 181, 165, 164, 170, 173, 172, 159, 174, 171, 170, - 158, 156, 156, 151, 152, 149, 161, 34, 145, 160, - 145, 146, 154, 157, 147, 141, 139, 0, 0, 138, - 0, 139, 135, 137, 135, 135, 29, 149, 140, 0, - - 136, 139, 145, 0, 136, 139, 132, 132, 30, 132, - 135, 138, 129, 119, 118, 126, 116, 122, 119, 115, - 115, 124, 127, 109, 112, 121, 119, 106, 111, 108, - 106, 0, 106, 103, 112, 99, 91, 97, 99, 95, - 88, 99, 0, 93, 103, 94, 0, 0, 97, 91, - 87, 90, 84, 83, 0, 0, 95, 0, 97, 80, - 0, 92, 91, 0, 78, 70, 91, 74, 0, 0, - 82, 0, 89, 88, 0, 84, 0, 82, 85, 83, - 69, 66, 56, 0, 0, 39, 36, 35, 0, 44, - 0, 43, 0, 40, 39, 0, 0, 231, 67, 71, - - 77, 83, 85, 91, 95 - } ; - -static yyconst flex_int16_t yy_def[206] = - { 0, - 198, 1, 198, 198, 198, 198, 198, 198, 199, 200, - 201, 202, 198, 198, 203, 204, 198, 205, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 199, 198, 200, 201, 198, 202, 203, - 204, 198, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 0, 198, 198, - - 198, 198, 198, 198, 198 - } ; - -static yyconst flex_int16_t yy_nxt[272] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 4, 15, 16, 17, 18, 10, 19, 20, 21, - 22, 10, 10, 23, 24, 10, 25, 26, 27, 10, - 28, 29, 30, 31, 10, 32, 33, 10, 10, 10, - 46, 50, 51, 54, 47, 58, 66, 70, 59, 60, - 101, 118, 129, 119, 130, 67, 55, 71, 61, 197, - 196, 195, 194, 193, 192, 191, 102, 34, 34, 34, - 34, 34, 34, 36, 36, 36, 36, 37, 37, 37, - 37, 37, 37, 39, 190, 39, 39, 39, 39, 40, - 40, 41, 189, 41, 41, 41, 41, 43, 188, 187, - - 43, 186, 185, 184, 183, 182, 181, 180, 179, 178, - 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, - 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, - 137, 136, 135, 134, 133, 132, 131, 128, 127, 126, - 125, 124, 123, 122, 121, 120, 117, 116, 115, 114, - 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, - 103, 100, 99, 98, 97, 96, 95, 94, 93, 92, - 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, - - 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, - 69, 68, 65, 38, 35, 64, 63, 62, 57, 56, - 53, 52, 49, 48, 45, 44, 42, 38, 35, 198, - 3, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198 - } ; - -static yyconst flex_int16_t yy_chk[272] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 21, 24, 24, 27, 21, 30, 45, 48, 30, 30, - 78, 97, 109, 97, 109, 45, 27, 48, 30, 195, - 194, 192, 190, 188, 187, 186, 78, 199, 199, 199, - 199, 199, 199, 200, 200, 200, 200, 201, 201, 201, - 201, 201, 201, 202, 183, 202, 202, 202, 202, 203, - 203, 204, 182, 204, 204, 204, 204, 205, 181, 180, - - 205, 179, 178, 176, 174, 173, 171, 168, 167, 166, - 165, 163, 162, 160, 159, 157, 154, 153, 152, 151, - 150, 149, 146, 145, 144, 142, 141, 140, 139, 138, - 137, 136, 135, 134, 133, 131, 130, 129, 128, 127, - 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, - 116, 115, 114, 113, 112, 111, 110, 108, 107, 106, - 105, 103, 102, 101, 99, 98, 96, 95, 94, 93, - 92, 90, 87, 86, 85, 84, 83, 82, 81, 80, - 79, 77, 76, 75, 74, 73, 72, 71, 70, 69, - 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, - - 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, - 47, 46, 44, 37, 34, 33, 32, 31, 29, 28, - 26, 25, 23, 22, 20, 19, 17, 11, 9, 3, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "deflex.l" -#line 2 "deflex.l" - -/* Copyright 1995, 1997, 1998, 1999, 2002, 2003, 2004, 2005, 2007 - 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 3 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., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - - -/* Contributed by Steve Chamberlain: sac@cygnus.com */ - -#define DONTDECLARE_MALLOC -#include "libiberty.h" -#include "defparse.h" -#include "dlltool.h" - -#define YY_NO_UNPUT - -int linenumber; - -#line 610 "deflex.c" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy (void ); - -int yyget_debug (void ); - -void yyset_debug (int debug_flag ); - -YY_EXTRA_TYPE yyget_extra (void ); - -void yyset_extra (YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in (void ); - -void yyset_in (FILE * in_str ); - -FILE *yyget_out (void ); - -void yyset_out (FILE * out_str ); - -yy_size_t yyget_leng (void ); - -char *yyget_text (void ); - -int yyget_lineno (void ); - -void yyset_lineno (int line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap (void ); -#else -extern int yywrap (void ); -#endif -#endif - - static void yyunput (int c,char *buf_ptr ); - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - yy_size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 36 "deflex.l" - -#line 794 "deflex.c" - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 199 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 231 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 37 "deflex.l" -{ return NAME;} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 38 "deflex.l" -{ return LIBRARY;} - YY_BREAK -case 3: -YY_RULE_SETUP -#line 39 "deflex.l" -{ return DESCRIPTION;} - YY_BREAK -case 4: -YY_RULE_SETUP -#line 40 "deflex.l" -{ return STACKSIZE;} - YY_BREAK -case 5: -YY_RULE_SETUP -#line 41 "deflex.l" -{ return HEAPSIZE;} - YY_BREAK -case 6: -YY_RULE_SETUP -#line 42 "deflex.l" -{ return CODE;} - YY_BREAK -case 7: -YY_RULE_SETUP -#line 43 "deflex.l" -{ return DATA;} - YY_BREAK -case 8: -YY_RULE_SETUP -#line 44 "deflex.l" -{ return SECTIONS;} - YY_BREAK -case 9: -YY_RULE_SETUP -#line 45 "deflex.l" -{ return EXPORTS;} - YY_BREAK -case 10: -YY_RULE_SETUP -#line 46 "deflex.l" -{ return IMPORTS;} - YY_BREAK -case 11: -YY_RULE_SETUP -#line 47 "deflex.l" -{ return VERSIONK;} - YY_BREAK -case 12: -YY_RULE_SETUP -#line 48 "deflex.l" -{ return BASE;} - YY_BREAK -case 13: -YY_RULE_SETUP -#line 49 "deflex.l" -{ return CONSTANT; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 50 "deflex.l" -{ return NONAME; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 51 "deflex.l" -{ return PRIVATE; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 52 "deflex.l" -{ return READ;} - YY_BREAK -case 17: -YY_RULE_SETUP -#line 53 "deflex.l" -{ return WRITE;} - YY_BREAK -case 18: -YY_RULE_SETUP -#line 54 "deflex.l" -{ return EXECUTE;} - YY_BREAK -case 19: -YY_RULE_SETUP -#line 55 "deflex.l" -{ return SHARED;} - YY_BREAK -case 20: -YY_RULE_SETUP -#line 56 "deflex.l" -{ return NONSHARED;} - YY_BREAK -case 21: -YY_RULE_SETUP -#line 57 "deflex.l" -{ return SINGLE;} - YY_BREAK -case 22: -YY_RULE_SETUP -#line 58 "deflex.l" -{ return MULTIPLE;} - YY_BREAK -case 23: -YY_RULE_SETUP -#line 59 "deflex.l" -{ return INITINSTANCE;} - YY_BREAK -case 24: -YY_RULE_SETUP -#line 60 "deflex.l" -{ return INITGLOBAL;} - YY_BREAK -case 25: -YY_RULE_SETUP -#line 61 "deflex.l" -{ return TERMINSTANCE;} - YY_BREAK -case 26: -YY_RULE_SETUP -#line 62 "deflex.l" -{ return TERMGLOBAL;} - YY_BREAK -case 27: -YY_RULE_SETUP -#line 64 "deflex.l" -{ yylval.number = strtol (yytext,0,0); - return NUMBER; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 67 "deflex.l" -{ - yylval.id = xstrdup (yytext); - return ID; - } - YY_BREAK -case 29: -/* rule 29 can match eol */ -YY_RULE_SETUP -#line 72 "deflex.l" -{ - yylval.id = xstrdup (yytext+1); - yylval.id[yyleng-2] = 0; - return ID; - } - YY_BREAK -case 30: -/* rule 30 can match eol */ -YY_RULE_SETUP -#line 78 "deflex.l" -{ - yylval.id = xstrdup (yytext+1); - yylval.id[yyleng-2] = 0; - return ID; - } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 83 "deflex.l" -{ } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 84 "deflex.l" -{ } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 85 "deflex.l" -{ } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 86 "deflex.l" -{ } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 87 "deflex.l" -{ } - YY_BREAK -case 36: -/* rule 36 can match eol */ -YY_RULE_SETUP -#line 88 "deflex.l" -{ linenumber ++ ;} - YY_BREAK -case 37: -YY_RULE_SETUP -#line 89 "deflex.l" -{ return EQUAL;} - YY_BREAK -case 38: -YY_RULE_SETUP -#line 90 "deflex.l" -{ return '=';} - YY_BREAK -case 39: -YY_RULE_SETUP -#line 91 "deflex.l" -{ return '.';} - YY_BREAK -case 40: -YY_RULE_SETUP -#line 92 "deflex.l" -{ return '@';} - YY_BREAK -case 41: -YY_RULE_SETUP -#line 93 "deflex.l" -{ return ',';} - YY_BREAK -case 42: -YY_RULE_SETUP -#line 94 "deflex.l" -ECHO; - YY_BREAK -#line 1102 "deflex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 199 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 199 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 198); - - return yy_is_jam ? 0 : yy_current_state; -} - - static void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up yytext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer(b,file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); - - yyfree((void *) b ); -} - -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer(b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) -{ - - return yy_scan_bytes(yystr,strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n, i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -yy_size_t yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param line_number - * - */ -void yyset_lineno (int line_number ) -{ - - yylineno = line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * in_str ) -{ - yyin = in_str ; -} - -void yyset_out (FILE * out_str ) -{ - yyout = out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int bdebug ) -{ - yy_flex_debug = bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return (void *) malloc( size ); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 94 "deflex.l" - - -#ifndef yywrap -/* Needed for lex, though not flex. */ -int yywrap(void) { return 1; } -#endif - diff -Nur binutils-2.24.orig/binutils/defparse.c binutils-2.24/binutils/defparse.c --- binutils-2.24.orig/binutils/defparse.c 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/defparse.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,2142 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NAME = 258, - LIBRARY = 259, - DESCRIPTION = 260, - STACKSIZE = 261, - HEAPSIZE = 262, - CODE = 263, - DATA = 264, - SECTIONS = 265, - EXPORTS = 266, - IMPORTS = 267, - VERSIONK = 268, - BASE = 269, - CONSTANT = 270, - READ = 271, - WRITE = 272, - EXECUTE = 273, - SHARED = 274, - NONSHARED = 275, - NONAME = 276, - PRIVATE = 277, - SINGLE = 278, - MULTIPLE = 279, - INITINSTANCE = 280, - INITGLOBAL = 281, - TERMINSTANCE = 282, - TERMGLOBAL = 283, - EQUAL = 284, - ID = 285, - NUMBER = 286 - }; -#endif -/* Tokens. */ -#define NAME 258 -#define LIBRARY 259 -#define DESCRIPTION 260 -#define STACKSIZE 261 -#define HEAPSIZE 262 -#define CODE 263 -#define DATA 264 -#define SECTIONS 265 -#define EXPORTS 266 -#define IMPORTS 267 -#define VERSIONK 268 -#define BASE 269 -#define CONSTANT 270 -#define READ 271 -#define WRITE 272 -#define EXECUTE 273 -#define SHARED 274 -#define NONSHARED 275 -#define NONAME 276 -#define PRIVATE 277 -#define SINGLE 278 -#define MULTIPLE 279 -#define INITINSTANCE 280 -#define INITGLOBAL 281 -#define TERMINSTANCE 282 -#define TERMGLOBAL 283 -#define EQUAL 284 -#define ID 285 -#define NUMBER 286 - - - - -/* Copy the first part of user declarations. */ -#line 1 "defparse.y" - /* defparse.y - parser for .def files */ - -/* Copyright 1995, 1997, 1998, 1999, 2001, 2004, 2005, 2007 - 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 3 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., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - -#include "sysdep.h" -#include "bfd.h" -#include "libiberty.h" -#include "dlltool.h" - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 29 "defparse.y" -{ - char *id; - const char *id_const; - int number; -} -/* Line 193 of yacc.c. */ -#line 192 "defparse.c" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 216 of yacc.c. */ -#line 205 "defparse.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 66 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 141 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 36 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 26 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 98 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 139 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 286 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 34, 2, 32, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 33, 2, 2, 35, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 6, 8, 12, 17, 20, 23, 27, - 31, 34, 37, 40, 43, 46, 51, 52, 55, 64, - 67, 69, 78, 87, 94, 101, 108, 115, 120, 125, - 128, 130, 133, 137, 139, 141, 142, 145, 146, 148, - 150, 152, 154, 156, 158, 160, 162, 163, 165, 166, - 168, 169, 171, 172, 174, 176, 178, 180, 182, 184, - 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, - 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, - 227, 230, 234, 238, 240, 241, 244, 245, 248, 249, - 252, 253, 257, 258, 259, 263, 265, 267, 269 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 37, 0, -1, 37, 38, -1, 38, -1, 3, 55, - 59, -1, 4, 55, 59, 60, -1, 11, 39, -1, - 5, 30, -1, 6, 31, 47, -1, 7, 31, 47, - -1, 8, 45, -1, 9, 45, -1, 10, 43, -1, - 12, 41, -1, 13, 31, -1, 13, 31, 32, 31, - -1, -1, 39, 40, -1, 30, 58, 56, 50, 49, - 51, 52, 57, -1, 41, 42, -1, 42, -1, 30, - 33, 30, 32, 30, 32, 30, 57, -1, 30, 33, - 30, 32, 30, 32, 31, 57, -1, 30, 33, 30, - 32, 30, 57, -1, 30, 33, 30, 32, 31, 57, - -1, 30, 32, 30, 32, 30, 57, -1, 30, 32, - 30, 32, 31, 57, -1, 30, 32, 30, 57, -1, - 30, 32, 31, 57, -1, 43, 44, -1, 44, -1, - 30, 45, -1, 45, 46, 48, -1, 48, -1, 34, - -1, -1, 34, 31, -1, -1, 16, -1, 17, -1, - 18, -1, 19, -1, 20, -1, 23, -1, 24, -1, - 15, -1, -1, 21, -1, -1, 9, -1, -1, 22, - -1, -1, 3, -1, 5, -1, 6, -1, 7, -1, - 8, -1, 9, -1, 10, -1, 11, -1, 12, -1, - 13, -1, 14, -1, 15, -1, 21, -1, 22, -1, - 16, -1, 17, -1, 18, -1, 19, -1, 20, -1, - 23, -1, 24, -1, 25, -1, 26, -1, 27, -1, - 28, -1, 30, -1, 32, 53, -1, 32, 54, -1, - 53, 32, 54, -1, 30, 32, 54, -1, 54, -1, - -1, 35, 31, -1, -1, 29, 54, -1, -1, 33, - 54, -1, -1, 14, 33, 31, -1, -1, -1, 60, - 46, 61, -1, 25, -1, 26, -1, 27, -1, 28, - -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = -{ - 0, 49, 49, 50, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 69, 71, 75, 80, - 81, 85, 87, 89, 91, 93, 95, 97, 99, 104, - 105, 109, 113, 114, 118, 119, 121, 122, 126, 127, - 128, 129, 130, 131, 132, 136, 137, 141, 142, 146, - 147, 151, 152, 155, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 186, 187, - 193, 199, 205, 212, 213, 217, 218, 222, 223, 227, - 228, 231, 232, 235, 237, 241, 242, 243, 244 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "NAME", "LIBRARY", "DESCRIPTION", - "STACKSIZE", "HEAPSIZE", "CODE", "DATA", "SECTIONS", "EXPORTS", - "IMPORTS", "VERSIONK", "BASE", "CONSTANT", "READ", "WRITE", "EXECUTE", - "SHARED", "NONSHARED", "NONAME", "PRIVATE", "SINGLE", "MULTIPLE", - "INITINSTANCE", "INITGLOBAL", "TERMINSTANCE", "TERMGLOBAL", "EQUAL", - "ID", "NUMBER", "'.'", "'='", "','", "'@'", "$accept", "start", - "command", "explist", "expline", "implist", "impline", "seclist", - "secline", "attr_list", "opt_comma", "opt_number", "attr", - "opt_CONSTANT", "opt_NONAME", "opt_DATA", "opt_PRIVATE", - "keyword_as_name", "opt_name2", "opt_name", "opt_ordinal", - "opt_import_name", "opt_equal_name", "opt_base", "option_list", "option", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 46, 61, 44, 64 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 36, 37, 37, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 39, 39, 40, 41, - 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, - 43, 44, 45, 45, 46, 46, 47, 47, 48, 48, - 48, 48, 48, 48, 48, 49, 49, 50, 50, 51, - 51, 52, 52, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 54, 54, - 54, 54, 54, 55, 55, 56, 56, 57, 57, 58, - 58, 59, 59, 60, 60, 61, 61, 61, 61 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 2, 1, 3, 4, 2, 2, 3, 3, - 2, 2, 2, 2, 2, 4, 0, 2, 8, 2, - 1, 8, 8, 6, 6, 6, 6, 4, 4, 2, - 1, 2, 3, 1, 1, 0, 2, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 3, 3, 1, 0, 2, 0, 2, 0, 2, - 0, 3, 0, 0, 3, 1, 1, 1, 1 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 84, 84, 0, 0, 0, 0, 0, 0, 16, - 0, 0, 0, 3, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 67, 68, 69, 70, - 71, 65, 66, 72, 73, 74, 75, 76, 77, 78, - 0, 0, 83, 92, 92, 7, 37, 37, 38, 39, - 40, 41, 42, 43, 44, 10, 33, 11, 0, 12, - 30, 6, 0, 13, 20, 14, 1, 2, 0, 79, - 80, 0, 0, 4, 93, 0, 8, 9, 34, 0, - 31, 29, 90, 17, 0, 0, 19, 0, 82, 81, - 0, 5, 36, 32, 0, 86, 88, 88, 0, 15, - 91, 0, 89, 0, 48, 0, 0, 27, 28, 0, - 95, 96, 97, 98, 94, 85, 47, 46, 87, 88, - 88, 88, 88, 45, 50, 25, 26, 0, 23, 24, - 49, 52, 88, 88, 51, 88, 21, 22, 18 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 12, 13, 61, 83, 63, 64, 59, 60, 55, - 79, 76, 56, 124, 117, 131, 135, 41, 42, 43, - 104, 107, 95, 73, 91, 114 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -96 -static const yytype_int8 yypact[] = -{ - 38, 61, 61, -22, -1, 8, 39, 39, -7, -96, - 23, 59, 92, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, -96, -96, -96, -96, -96, 62, - 61, 79, -96, 96, 96, -96, 80, 80, -96, -96, - -96, -96, -96, -96, -96, -13, -96, -13, 39, -7, - -96, 82, 1, 23, -96, 81, -96, -96, 61, 79, - -96, 61, 83, -96, -96, 84, -96, -96, -96, 39, - -13, -96, 85, -96, 5, 87, -96, 88, -96, -96, - 89, -12, -96, -96, 61, 86, -20, 93, 91, -96, - -96, -8, -96, 94, 103, 61, 30, -96, -96, 76, - -96, -96, -96, -96, -96, -96, -96, 111, -96, 93, - 93, 0, 93, -96, 118, -96, -96, 78, -96, -96, - -96, 106, 93, 93, -96, 93, -96, -96, -96 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -96, -96, 117, -96, -96, -96, 67, -96, 72, -6, - 41, 90, 54, -96, -96, -96, -96, 95, -40, 132, - -96, -95, -96, 97, -96, -96 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -36 -static const yytype_int16 yytable[] = -{ - 70, 57, 108, -35, -35, -35, -35, -35, 45, 105, - -35, -35, 106, -35, -35, -35, -35, 110, 111, 112, - 113, 78, 78, 58, 125, 126, 128, 129, 88, 105, - 46, 89, 127, 84, 85, 96, 97, 136, 137, 47, - 138, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 80, 62, 102, 48, 49, 50, 51, 52, - 119, 120, 53, 54, 14, 118, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 65, 39, 66, 40, 68, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 121, 122, 132, 133, - 72, 71, 82, 87, 75, 92, 90, 98, 94, 99, - 100, 103, 105, 109, 116, 115, 123, 130, 134, 67, - 86, 81, 101, 93, 44, 69, 0, 77, 0, 0, - 0, 74 -}; - -static const yytype_int16 yycheck[] = -{ - 40, 7, 97, 16, 17, 18, 19, 20, 30, 29, - 23, 24, 32, 25, 26, 27, 28, 25, 26, 27, - 28, 34, 34, 30, 119, 120, 121, 122, 68, 29, - 31, 71, 32, 32, 33, 30, 31, 132, 133, 31, - 135, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 58, 30, 94, 16, 17, 18, 19, 20, - 30, 31, 23, 24, 3, 105, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 31, 30, 0, 32, 32, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 30, 31, 30, 31, - 14, 32, 30, 32, 34, 31, 33, 30, 33, 31, - 31, 35, 29, 32, 21, 31, 15, 9, 22, 12, - 63, 59, 91, 79, 2, 40, -1, 47, -1, -1, - -1, 44 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 37, 38, 3, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, - 32, 53, 54, 55, 55, 30, 31, 31, 16, 17, - 18, 19, 20, 23, 24, 45, 48, 45, 30, 43, - 44, 39, 30, 41, 42, 31, 0, 38, 32, 53, - 54, 32, 14, 59, 59, 34, 47, 47, 34, 46, - 45, 44, 30, 40, 32, 33, 42, 32, 54, 54, - 33, 60, 31, 48, 33, 58, 30, 31, 30, 31, - 31, 46, 54, 35, 56, 29, 32, 57, 57, 32, - 25, 26, 27, 28, 61, 31, 21, 50, 54, 30, - 31, 30, 31, 15, 49, 57, 57, 32, 57, 57, - 9, 51, 30, 31, 22, 52, 57, 57, 57 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 4: -#line 54 "defparse.y" - { def_name ((yyvsp[(2) - (3)].id), (yyvsp[(3) - (3)].number)); } - break; - - case 5: -#line 55 "defparse.y" - { def_library ((yyvsp[(2) - (4)].id), (yyvsp[(3) - (4)].number)); } - break; - - case 7: -#line 57 "defparse.y" - { def_description ((yyvsp[(2) - (2)].id));} - break; - - case 8: -#line 58 "defparse.y" - { def_stacksize ((yyvsp[(2) - (3)].number), (yyvsp[(3) - (3)].number));} - break; - - case 9: -#line 59 "defparse.y" - { def_heapsize ((yyvsp[(2) - (3)].number), (yyvsp[(3) - (3)].number));} - break; - - case 10: -#line 60 "defparse.y" - { def_code ((yyvsp[(2) - (2)].number));} - break; - - case 11: -#line 61 "defparse.y" - { def_data ((yyvsp[(2) - (2)].number));} - break; - - case 14: -#line 64 "defparse.y" - { def_version ((yyvsp[(2) - (2)].number),0);} - break; - - case 15: -#line 65 "defparse.y" - { def_version ((yyvsp[(2) - (4)].number),(yyvsp[(4) - (4)].number));} - break; - - case 18: -#line 77 "defparse.y" - { def_exports ((yyvsp[(1) - (8)].id), (yyvsp[(2) - (8)].id), (yyvsp[(3) - (8)].number), (yyvsp[(4) - (8)].number), (yyvsp[(5) - (8)].number), (yyvsp[(6) - (8)].number), (yyvsp[(7) - (8)].number), (yyvsp[(8) - (8)].id));} - break; - - case 21: -#line 86 "defparse.y" - { def_import ((yyvsp[(1) - (8)].id),(yyvsp[(3) - (8)].id),(yyvsp[(5) - (8)].id),(yyvsp[(7) - (8)].id), 0, (yyvsp[(8) - (8)].id)); } - break; - - case 22: -#line 88 "defparse.y" - { def_import ((yyvsp[(1) - (8)].id),(yyvsp[(3) - (8)].id),(yyvsp[(5) - (8)].id), 0,(yyvsp[(7) - (8)].number), (yyvsp[(8) - (8)].id)); } - break; - - case 23: -#line 90 "defparse.y" - { def_import ((yyvsp[(1) - (6)].id),(yyvsp[(3) - (6)].id), 0,(yyvsp[(5) - (6)].id), 0, (yyvsp[(6) - (6)].id)); } - break; - - case 24: -#line 92 "defparse.y" - { def_import ((yyvsp[(1) - (6)].id),(yyvsp[(3) - (6)].id), 0, 0,(yyvsp[(5) - (6)].number), (yyvsp[(6) - (6)].id)); } - break; - - case 25: -#line 94 "defparse.y" - { def_import ( 0,(yyvsp[(1) - (6)].id),(yyvsp[(3) - (6)].id),(yyvsp[(5) - (6)].id), 0, (yyvsp[(6) - (6)].id)); } - break; - - case 26: -#line 96 "defparse.y" - { def_import ( 0,(yyvsp[(1) - (6)].id),(yyvsp[(3) - (6)].id), 0,(yyvsp[(5) - (6)].number), (yyvsp[(6) - (6)].id)); } - break; - - case 27: -#line 98 "defparse.y" - { def_import ( 0,(yyvsp[(1) - (4)].id), 0,(yyvsp[(3) - (4)].id), 0, (yyvsp[(4) - (4)].id)); } - break; - - case 28: -#line 100 "defparse.y" - { def_import ( 0,(yyvsp[(1) - (4)].id), 0, 0,(yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].id)); } - break; - - case 31: -#line 109 "defparse.y" - { def_section ((yyvsp[(1) - (2)].id),(yyvsp[(2) - (2)].number));} - break; - - case 36: -#line 121 "defparse.y" - { (yyval.number)=(yyvsp[(2) - (2)].number);} - break; - - case 37: -#line 122 "defparse.y" - { (yyval.number)=-1;} - break; - - case 38: -#line 126 "defparse.y" - { (yyval.number) = 1; } - break; - - case 39: -#line 127 "defparse.y" - { (yyval.number) = 2; } - break; - - case 40: -#line 128 "defparse.y" - { (yyval.number) = 4; } - break; - - case 41: -#line 129 "defparse.y" - { (yyval.number) = 8; } - break; - - case 42: -#line 130 "defparse.y" - { (yyval.number) = 0; } - break; - - case 43: -#line 131 "defparse.y" - { (yyval.number) = 0; } - break; - - case 44: -#line 132 "defparse.y" - { (yyval.number) = 0; } - break; - - case 45: -#line 136 "defparse.y" - {(yyval.number)=1;} - break; - - case 46: -#line 137 "defparse.y" - {(yyval.number)=0;} - break; - - case 47: -#line 141 "defparse.y" - {(yyval.number)=1;} - break; - - case 48: -#line 142 "defparse.y" - {(yyval.number)=0;} - break; - - case 49: -#line 146 "defparse.y" - { (yyval.number) = 1; } - break; - - case 50: -#line 147 "defparse.y" - { (yyval.number) = 0; } - break; - - case 51: -#line 151 "defparse.y" - { (yyval.number) = 1; } - break; - - case 52: -#line 152 "defparse.y" - { (yyval.number) = 0; } - break; - - case 53: -#line 155 "defparse.y" - { (yyval.id_const) = "NAME"; } - break; - - case 54: -#line 160 "defparse.y" - { (yyval.id_const) = "DESCRIPTION"; } - break; - - case 55: -#line 161 "defparse.y" - { (yyval.id_const) = "STACKSIZE"; } - break; - - case 56: -#line 162 "defparse.y" - { (yyval.id_const) = "HEAPSIZE"; } - break; - - case 57: -#line 163 "defparse.y" - { (yyval.id_const) = "CODE"; } - break; - - case 58: -#line 164 "defparse.y" - { (yyval.id_const) = "DATA"; } - break; - - case 59: -#line 165 "defparse.y" - { (yyval.id_const) = "SECTIONS"; } - break; - - case 60: -#line 166 "defparse.y" - { (yyval.id_const) = "EXPORTS"; } - break; - - case 61: -#line 167 "defparse.y" - { (yyval.id_const) = "IMPORTS"; } - break; - - case 62: -#line 168 "defparse.y" - { (yyval.id_const) = "VERSION"; } - break; - - case 63: -#line 169 "defparse.y" - { (yyval.id_const) = "BASE"; } - break; - - case 64: -#line 170 "defparse.y" - { (yyval.id_const) = "CONSTANT"; } - break; - - case 65: -#line 171 "defparse.y" - { (yyval.id_const) = "NONAME"; } - break; - - case 66: -#line 172 "defparse.y" - { (yyval.id_const) = "PRIVATE"; } - break; - - case 67: -#line 173 "defparse.y" - { (yyval.id_const) = "READ"; } - break; - - case 68: -#line 174 "defparse.y" - { (yyval.id_const) = "WRITE"; } - break; - - case 69: -#line 175 "defparse.y" - { (yyval.id_const) = "EXECUTE"; } - break; - - case 70: -#line 176 "defparse.y" - { (yyval.id_const) = "SHARED"; } - break; - - case 71: -#line 177 "defparse.y" - { (yyval.id_const) = "NONSHARED"; } - break; - - case 72: -#line 178 "defparse.y" - { (yyval.id_const) = "SINGLE"; } - break; - - case 73: -#line 179 "defparse.y" - { (yyval.id_const) = "MULTIPLE"; } - break; - - case 74: -#line 180 "defparse.y" - { (yyval.id_const) = "INITINSTANCE"; } - break; - - case 75: -#line 181 "defparse.y" - { (yyval.id_const) = "INITGLOBAL"; } - break; - - case 76: -#line 182 "defparse.y" - { (yyval.id_const) = "TERMINSTANCE"; } - break; - - case 77: -#line 183 "defparse.y" - { (yyval.id_const) = "TERMGLOBAL"; } - break; - - case 78: -#line 186 "defparse.y" - { (yyval.id) = (yyvsp[(1) - (1)].id); } - break; - - case 79: -#line 188 "defparse.y" - { - char *name = xmalloc (strlen ((yyvsp[(2) - (2)].id_const)) + 2); - sprintf (name, ".%s", (yyvsp[(2) - (2)].id_const)); - (yyval.id) = name; - } - break; - - case 80: -#line 194 "defparse.y" - { - char *name = xmalloc (strlen ((yyvsp[(2) - (2)].id)) + 2); - sprintf (name, ".%s", (yyvsp[(2) - (2)].id)); - (yyval.id) = name; - } - break; - - case 81: -#line 200 "defparse.y" - { - char *name = xmalloc (strlen ((yyvsp[(1) - (3)].id_const)) + 1 + strlen ((yyvsp[(3) - (3)].id)) + 1); - sprintf (name, "%s.%s", (yyvsp[(1) - (3)].id_const), (yyvsp[(3) - (3)].id)); - (yyval.id) = name; - } - break; - - case 82: -#line 206 "defparse.y" - { - char *name = xmalloc (strlen ((yyvsp[(1) - (3)].id)) + 1 + strlen ((yyvsp[(3) - (3)].id)) + 1); - sprintf (name, "%s.%s", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id)); - (yyval.id) = name; - } - break; - - case 83: -#line 212 "defparse.y" - { (yyval.id) =(yyvsp[(1) - (1)].id); } - break; - - case 84: -#line 213 "defparse.y" - { (yyval.id)=""; } - break; - - case 85: -#line 217 "defparse.y" - { (yyval.number)=(yyvsp[(2) - (2)].number);} - break; - - case 86: -#line 218 "defparse.y" - { (yyval.number)=-1;} - break; - - case 87: -#line 222 "defparse.y" - { (yyval.id) = (yyvsp[(2) - (2)].id); } - break; - - case 88: -#line 223 "defparse.y" - { (yyval.id) = 0; } - break; - - case 89: -#line 227 "defparse.y" - { (yyval.id) = (yyvsp[(2) - (2)].id); } - break; - - case 90: -#line 228 "defparse.y" - { (yyval.id) = 0; } - break; - - case 91: -#line 231 "defparse.y" - { (yyval.number)= (yyvsp[(3) - (3)].number);} - break; - - case 92: -#line 232 "defparse.y" - { (yyval.number)=-1;} - break; - - -/* Line 1267 of yacc.c. */ -#line 1929 "defparse.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - - diff -Nur binutils-2.24.orig/binutils/defparse.h binutils-2.24/binutils/defparse.h --- binutils-2.24.orig/binutils/defparse.h 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/defparse.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,124 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NAME = 258, - LIBRARY = 259, - DESCRIPTION = 260, - STACKSIZE = 261, - HEAPSIZE = 262, - CODE = 263, - DATA = 264, - SECTIONS = 265, - EXPORTS = 266, - IMPORTS = 267, - VERSIONK = 268, - BASE = 269, - CONSTANT = 270, - READ = 271, - WRITE = 272, - EXECUTE = 273, - SHARED = 274, - NONSHARED = 275, - NONAME = 276, - PRIVATE = 277, - SINGLE = 278, - MULTIPLE = 279, - INITINSTANCE = 280, - INITGLOBAL = 281, - TERMINSTANCE = 282, - TERMGLOBAL = 283, - EQUAL = 284, - ID = 285, - NUMBER = 286 - }; -#endif -/* Tokens. */ -#define NAME 258 -#define LIBRARY 259 -#define DESCRIPTION 260 -#define STACKSIZE 261 -#define HEAPSIZE 262 -#define CODE 263 -#define DATA 264 -#define SECTIONS 265 -#define EXPORTS 266 -#define IMPORTS 267 -#define VERSIONK 268 -#define BASE 269 -#define CONSTANT 270 -#define READ 271 -#define WRITE 272 -#define EXECUTE 273 -#define SHARED 274 -#define NONSHARED 275 -#define NONAME 276 -#define PRIVATE 277 -#define SINGLE 278 -#define MULTIPLE 279 -#define INITINSTANCE 280 -#define INITGLOBAL 281 -#define TERMINSTANCE 282 -#define TERMGLOBAL 283 -#define EQUAL 284 -#define ID 285 -#define NUMBER 286 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 29 "defparse.y" -{ - char *id; - const char *id_const; - int number; -} -/* Line 1529 of yacc.c. */ -#line 117 "defparse.h" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - diff -Nur binutils-2.24.orig/binutils/doc/addr2line.1 binutils-2.24/binutils/doc/addr2line.1 --- binutils-2.24.orig/binutils/doc/addr2line.1 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/doc/addr2line.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,299 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "ADDR2LINE 1" -.TH ADDR2LINE 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -addr2line \- convert addresses into file names and line numbers. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -addr2line [\fB\-a\fR|\fB\-\-addresses\fR] - [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]] - [\fB\-e\fR \fIfilename\fR|\fB\-\-exe=\fR\fIfilename\fR] - [\fB\-f\fR|\fB\-\-functions\fR] [\fB\-s\fR|\fB\-\-basename\fR] - [\fB\-i\fR|\fB\-\-inlines\fR] - [\fB\-p\fR|\fB\-\-pretty\-print\fR] - [\fB\-j\fR|\fB\-\-section=\fR\fIname\fR] - [\fB\-H\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] - [addr addr ...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBaddr2line\fR translates addresses into file names and line numbers. -Given an address in an executable or an offset in a section of a relocatable -object, it uses the debugging information to figure out which file name and -line number are associated with it. -.PP -The executable or relocatable object to use is specified with the \fB\-e\fR -option. The default is the file \fIa.out\fR. The section in the relocatable -object to use is specified with the \fB\-j\fR option. -.PP -\&\fBaddr2line\fR has two modes of operation. -.PP -In the first, hexadecimal addresses are specified on the command line, -and \fBaddr2line\fR displays the file name and line number for each -address. -.PP -In the second, \fBaddr2line\fR reads hexadecimal addresses from -standard input, and prints the file name and line number for each -address on standard output. In this mode, \fBaddr2line\fR may be used -in a pipe to convert dynamically chosen addresses. -.PP -The format of the output is \fB\s-1FILENAME:LINENO\s0\fR. The file name and -line number for each input address is printed on separate lines. -.PP -If the \fB\-f\fR option is used, then each \fB\s-1FILENAME:LINENO\s0\fR -line is preceded by \fB\s-1FUNCTIONNAME\s0\fR which is the name of the -function containing the address. -.PP -If the \fB\-i\fR option is used and the code at the given address is -present there because of inlining by the compiler then the -\&\fB{\s-1FUNCTIONNAME\s0} \s-1FILENAME:LINENO\s0\fR information for the inlining -function will be displayed afterwards. This continues recursively -until there is no more inlining to report. -.PP -If the \fB\-a\fR option is used then the output is prefixed by the -input address. -.PP -If the \fB\-p\fR option is used then the output for each input -address is displayed on one, possibly quite long, line. If -\&\fB\-p\fR is not used then the output is broken up into multiple -lines, based on the paragraphs above. -.PP -If the file name or function name can not be determined, -\&\fBaddr2line\fR will print two question marks in their place. If the -line number can not be determined, \fBaddr2line\fR will print 0. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-addresses\fR" 4 -.IX Item "--addresses" -.PD -Display the address before the function name, file and line number -information. The address is printed with a \fB0x\fR prefix to easily -identify it. -.IP "\fB\-b\fR \fIbfdname\fR" 4 -.IX Item "-b bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Specify that the object-code format for the object files is -\&\fIbfdname\fR. -.IP "\fB\-C\fR" 4 -.IX Item "-C" -.PD 0 -.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 -.IX Item "--demangle[=style]" -.PD -Decode (\fIdemangle\fR) 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. -.IP "\fB\-e\fR \fIfilename\fR" 4 -.IX Item "-e filename" -.PD 0 -.IP "\fB\-\-exe=\fR\fIfilename\fR" 4 -.IX Item "--exe=filename" -.PD -Specify the name of the executable for which addresses should be -translated. The default file is \fIa.out\fR. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -.PD 0 -.IP "\fB\-\-functions\fR" 4 -.IX Item "--functions" -.PD -Display function names as well as file and line number information. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-basenames\fR" 4 -.IX Item "--basenames" -.PD -Display only the base of each file name. -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-inlines\fR" 4 -.IX Item "--inlines" -.PD -If the address belongs to a function that was inlined, the source -information for all enclosing scopes back to the first non-inlined -function will also be printed. For example, if \f(CW\*(C`main\*(C'\fR inlines -\&\f(CW\*(C`callee1\*(C'\fR which inlines \f(CW\*(C`callee2\*(C'\fR, and address is from -\&\f(CW\*(C`callee2\*(C'\fR, the source information for \f(CW\*(C`callee1\*(C'\fR and \f(CW\*(C`main\*(C'\fR -will also be printed. -.IP "\fB\-j\fR" 4 -.IX Item "-j" -.PD 0 -.IP "\fB\-\-section\fR" 4 -.IX Item "--section" -.PD -Read offsets relative to the specified section instead of absolute addresses. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-pretty\-print\fR" 4 -.IX Item "--pretty-print" -.PD -Make the output more human friendly: each location are printed on one line. -If option \fB\-i\fR is specified, lines for all enclosing scopes are -prefixed with \fB(inlined by)\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/ar.1 binutils-2.24/binutils/doc/ar.1 --- binutils-2.24.orig/binutils/doc/ar.1 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/doc/ar.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,461 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "AR 1" -.TH AR 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -ar \- create, modify, and extract from archives -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -ar [\fB\-\-plugin\fR \fIname\fR] [\fB\-X32_64\fR] [\fB\-\fR]\fIp\fR[\fImod\fR [\fIrelpos\fR] [\fIcount\fR]] [\fB\-\-target\fR \fIbfdname\fR] \fIarchive\fR [\fImember\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \s-1GNU\s0 \fBar\fR program creates, modifies, and extracts from -archives. An \fIarchive\fR is a single file holding a collection of -other files in a structure that makes it possible to retrieve -the original individual files (called \fImembers\fR of the archive). -.PP -The original files' contents, mode (permissions), timestamp, owner, and -group are preserved in the archive, and can be restored on -extraction. -.PP -\&\s-1GNU\s0 \fBar\fR can maintain archives whose members have names of any -length; however, depending on how \fBar\fR 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). -.PP -\&\fBar\fR is considered a binary utility because archives of this sort -are most often used as \fIlibraries\fR holding commonly needed -subroutines. -.PP -\&\fBar\fR creates an index to the symbols defined in relocatable -object modules in the archive when you specify the modifier \fBs\fR. -Once created, this index is updated in the archive whenever \fBar\fR -makes a change to its contents (save for the \fBq\fR 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. -.PP -You may use \fBnm \-s\fR or \fBnm \-\-print\-armap\fR to list this index -table. If an archive lacks the table, another form of \fBar\fR called -\&\fBranlib\fR can be used to add just the table. -.PP -\&\s-1GNU\s0 \fBar\fR can optionally create a \fIthin\fR archive, -which contains a symbol index and references to the original copies -of the member files of the archive. This is useful for building -libraries for use within a local build tree, where the relocatable -objects are expected to remain available, and copying the contents of -each object would only waste time and space. -.PP -An archive can either be \fIthin\fR or it can be normal. It cannot -be both at the same time. Once an archive is created its format -cannot be changed without first deleting it and then creating a new -archive in its place. -.PP -Thin archives are also \fIflattened\fR, so that adding one thin -archive to another thin archive does not nest it, as would happen with -a normal archive. Instead the elements of the first archive are added -individually to the second archive. -.PP -The paths to the elements of the archive are stored relative to the -archive itself. -.PP -\&\s-1GNU\s0 \fBar\fR is designed to be compatible with two different -facilities. You can control its activity using command-line options, -like the different varieties of \fBar\fR on Unix systems; or, if you -specify the single command-line option \fB\-M\fR, you can control it -with a script supplied via standard input, like the \s-1MRI\s0 \*(L"librarian\*(R" -program. -.SH "OPTIONS" -.IX Header "OPTIONS" -\&\s-1GNU\s0 \fBar\fR allows you to mix the operation code \fIp\fR and modifier -flags \fImod\fR in any order, within the first command-line argument. -.PP -If you wish, you may begin the first command-line argument with a -dash. -.PP -The \fIp\fR keyletter specifies what operation to execute; it may be -any of the following, but you must specify only one of them: -.IP "\fBd\fR" 4 -.IX Item "d" -\&\fIDelete\fR modules from the archive. Specify the names of modules to -be deleted as \fImember\fR...; the archive is untouched if you -specify no files to delete. -.Sp -If you specify the \fBv\fR modifier, \fBar\fR lists each module -as it is deleted. -.IP "\fBm\fR" 4 -.IX Item "m" -Use this operation to \fImove\fR members in an archive. -.Sp -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. -.Sp -If no modifiers are used with \f(CW\*(C`m\*(C'\fR, any members you name in the -\&\fImember\fR arguments are moved to the \fIend\fR of the archive; -you can use the \fBa\fR, \fBb\fR, or \fBi\fR modifiers to move them to a -specified place instead. -.IP "\fBp\fR" 4 -.IX Item "p" -\&\fIPrint\fR the specified members of the archive, to the standard -output file. If the \fBv\fR modifier is specified, show the member -name before copying its contents to standard output. -.Sp -If you specify no \fImember\fR arguments, all the files in the archive are -printed. -.IP "\fBq\fR" 4 -.IX Item "q" -\&\fIQuick append\fR; Historically, add the files \fImember\fR... to the end of -\&\fIarchive\fR, without checking for replacement. -.Sp -The modifiers \fBa\fR, \fBb\fR, and \fBi\fR do \fInot\fR affect this -operation; new members are always placed at the end of the archive. -.Sp -The modifier \fBv\fR makes \fBar\fR list each file as it is appended. -.Sp -Since the point of this operation is speed, implementations of -\&\fBar\fR have the option of not updating the archive's symbol -table if one exists. Too many different systems however assume that -symbol tables are always up-to-date, so \s-1GNU\s0 \fBar\fR will -rebuild the table even with a quick append. -.Sp -Note \- \s-1GNU\s0 \fBar\fR treats the command \fBqs\fR as a -synonym for \fBr\fR \- replacing already existing files in the -archive and appending new ones at the end. -.IP "\fBr\fR" 4 -.IX Item "r" -Insert the files \fImember\fR... into \fIarchive\fR (with -\&\fIreplacement\fR). This operation differs from \fBq\fR in that any -previously existing members are deleted if their names match those being -added. -.Sp -If one of the files named in \fImember\fR... does not exist, \fBar\fR -displays an error message, and leaves undisturbed any existing members -of the archive matching that name. -.Sp -By default, new members are added at the end of the file; but you may -use one of the modifiers \fBa\fR, \fBb\fR, or \fBi\fR to request -placement relative to some existing member. -.Sp -The modifier \fBv\fR used with this operation elicits a line of -output for each file inserted, along with one of the letters \fBa\fR or -\&\fBr\fR to indicate whether the file was appended (no old member -deleted) or replaced. -.IP "\fBs\fR" 4 -.IX Item "s" -Add an index to the archive, or update it if it already exists. Note -this command is an exception to the rule that there can only be one -command letter, as it is possible to use it as either a command or a -modifier. In either case it does the same thing. -.IP "\fBt\fR" 4 -.IX Item "t" -Display a \fItable\fR listing the contents of \fIarchive\fR, or those -of the files listed in \fImember\fR... 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 \fBv\fR modifier. -.Sp -If you do not specify a \fImember\fR, all files in the archive -are listed. -.Sp -If there is more than one file with the same name (say, \fBfie\fR) in -an archive (say \fBb.a\fR), \fBar t b.a fie\fR lists only the -first instance; to see them all, you must ask for a complete -listing\-\-\-in our example, \fBar t b.a\fR. -.IP "\fBx\fR" 4 -.IX Item "x" -\&\fIExtract\fR members (named \fImember\fR) from the archive. You can -use the \fBv\fR modifier with this operation, to request that -\&\fBar\fR list each name as it extracts it. -.Sp -If you do not specify a \fImember\fR, all files in the archive -are extracted. -.Sp -Files cannot be extracted from a thin archive. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Displays the list of command line options supported by \fBar\fR -and then exits. -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -Displays the version information of \fBar\fR and then exits. -.PP -A number of modifiers (\fImod\fR) may immediately follow the \fIp\fR -keyletter, to specify variations on an operation's behavior: -.IP "\fBa\fR" 4 -.IX Item "a" -Add new files \fIafter\fR an existing member of the -archive. If you use the modifier \fBa\fR, the name of an existing archive -member must be present as the \fIrelpos\fR argument, before the -\&\fIarchive\fR specification. -.IP "\fBb\fR" 4 -.IX Item "b" -Add new files \fIbefore\fR an existing member of the -archive. If you use the modifier \fBb\fR, the name of an existing archive -member must be present as the \fIrelpos\fR argument, before the -\&\fIarchive\fR specification. (same as \fBi\fR). -.IP "\fBc\fR" 4 -.IX Item "c" -\&\fICreate\fR the archive. The specified \fIarchive\fR 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. -.IP "\fBD\fR" 4 -.IX Item "D" -Operate in \fIdeterministic\fR mode. When adding files and the archive -index use zero for UIDs, GIDs, timestamps, and use consistent file modes -for all files. When this option is used, if \fBar\fR is used with -identical options and identical input files, multiple runs will create -identical output files regardless of the input files' owners, groups, -file modes, or modification times. -.Sp -If \fIbinutils\fR was configured with -\&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by default. -It can be disabled with the \fBU\fR modifier, below. -.IP "\fBf\fR" 4 -.IX Item "f" -Truncate names in the archive. \s-1GNU\s0 \fBar\fR will normally permit file -names of any length. This will cause it to create archives which are -not compatible with the native \fBar\fR program on some systems. If -this is a concern, the \fBf\fR modifier may be used to truncate file -names when putting them in the archive. -.IP "\fBi\fR" 4 -.IX Item "i" -Insert new files \fIbefore\fR an existing member of the -archive. If you use the modifier \fBi\fR, the name of an existing archive -member must be present as the \fIrelpos\fR argument, before the -\&\fIarchive\fR specification. (same as \fBb\fR). -.IP "\fBl\fR" 4 -.IX Item "l" -This modifier is accepted but not used. -.IP "\fBN\fR" 4 -.IX Item "N" -Uses the \fIcount\fR parameter. This is used if there are multiple -entries in the archive with the same name. Extract or delete instance -\&\fIcount\fR of the given name from the archive. -.IP "\fBo\fR" 4 -.IX Item "o" -Preserve the \fIoriginal\fR 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. -.IP "\fBP\fR" 4 -.IX Item "P" -Use the full path name when matching names in the archive. \s-1GNU\s0 -\&\fBar\fR can not create an archive with a full path name (such archives -are not \s-1POSIX\s0 complaint), but other archive creators can. This option -will cause \s-1GNU\s0 \fBar\fR 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. -.IP "\fBs\fR" 4 -.IX Item "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 \fBar s\fR on an -archive is equivalent to running \fBranlib\fR on it. -.IP "\fBS\fR" 4 -.IX Item "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 -\&\fBS\fR modifier on the last execution of \fBar\fR, or you must run -\&\fBranlib\fR on the archive. -.IP "\fBT\fR" 4 -.IX Item "T" -Make the specified \fIarchive\fR a \fIthin\fR archive. If it already -exists and is a regular archive, the existing members must be present -in the same directory as \fIarchive\fR. -.IP "\fBu\fR" 4 -.IX Item "u" -Normally, \fBar r\fR... inserts all files -listed into the archive. If you would like to insert \fIonly\fR those -of the files you list that are newer than existing members of the same -names, use this modifier. The \fBu\fR modifier is allowed only for the -operation \fBr\fR (replace). In particular, the combination \fBqu\fR is -not allowed, since checking the timestamps would lose any speed -advantage from the operation \fBq\fR. -.IP "\fBU\fR" 4 -.IX Item "U" -Do \fInot\fR operate in \fIdeterministic\fR mode. This is the inverse -of the \fBD\fR modifier, above: added files and the archive index will -get their actual \s-1UID\s0, \s-1GID\s0, timestamp, and file mode values. -.Sp -This is the default unless \fIbinutils\fR was configured with -\&\fB\-\-enable\-deterministic\-archives\fR. -.IP "\fBv\fR" 4 -.IX Item "v" -This modifier requests the \fIverbose\fR version of an operation. Many -operations display additional information, such as filenames processed, -when the modifier \fBv\fR is appended. -.IP "\fBV\fR" 4 -.IX Item "V" -This modifier shows the version number of \fBar\fR. -.PP -\&\fBar\fR ignores an initial option spelt \fB\-X32_64\fR, for -compatibility with \s-1AIX\s0. The behaviour produced by this option is the -default for \s-1GNU\s0 \fBar\fR. \fBar\fR does not support any of the other -\&\fB\-X\fR options; in particular, it does not support \fB\-X32\fR -which is the default for \s-1AIX\s0 \fBar\fR. -.PP -The optional command line switch \fB\-\-plugin\fR \fIname\fR causes -\&\fBar\fR to load the plugin called \fIname\fR which adds support -for more file formats. This option is only available if the toolchain -has been built with plugin support enabled. -.PP -The optional command line switch \fB\-\-target\fR \fIbfdname\fR -specifies that the archive members are in an object code format -different from your system's default format. See -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fInm\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/binutils.info binutils-2.24/binutils/doc/binutils.info --- binutils-2.24.orig/binutils/doc/binutils.info 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/doc/binutils.info 1970-01-01 01:00:00.000000000 +0100 @@ -1,4898 +0,0 @@ -This is binutils.info, produced by makeinfo version 4.8 from -binutils.texi. - - Copyright (C) 1991-2013 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.3 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". - -INFO-DIR-SECTION Software development -START-INFO-DIR-ENTRY -* Binutils: (binutils). The GNU binary utilities. -END-INFO-DIR-ENTRY - -INFO-DIR-SECTION Individual utilities -START-INFO-DIR-ENTRY -* addr2line: (binutils)addr2line. Convert addresses to file and line. -* ar: (binutils)ar. Create, modify, and extract from archives. -* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols. -* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt. -* dlltool: (binutils)dlltool. Create files needed to build and use DLLs. -* nlmconv: (binutils)nlmconv. Converts object code into an NLM. -* 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. -* elfedit: (binutils)elfedit. Update the ELF header of ELF files. -* windmc: (binutils)windmc. Generator for Windows message resources. -* windres: (binutils)windres. Manipulate Windows resources. -END-INFO-DIR-ENTRY - - -File: binutils.info, Node: Top, Next: ar, Up: (dir) - -Introduction -************ - -This brief manual contains documentation for the GNU binary utilities -(GNU Binutils) version 2.23.91: - - This document is distributed under the terms of the GNU Free -Documentation License version 1.3. 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 -* 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 -* windmc:: Generator for Windows message resources -* windres:: Manipulate Windows resources -* dlltool:: Create files needed to build and use DLLs -* readelf:: Display the contents of ELF format files -* elfedit:: Update the ELF header of ELF files -* Common Options:: Command-line options for all utilities -* Selecting the Target System:: How these utilities determine the target -* Reporting Bugs:: Reporting Bugs -* GNU Free Documentation License:: GNU Free Documentation License -* Binutils Index:: Binutils Index - - -File: binutils.info, Node: ar, Next: nm, Prev: Top, Up: Top - -1 ar -**** - - ar [`--plugin' NAME] [-]P[MOD [RELPOS] [COUNT]] [`--target' BFDNAME] ARCHIVE [MEMBER...] - ar -M [ '), and continues executing even after errors. If you -redirect standard input to a script file, no prompts are issued, and -`ar' abandons execution (with a nonzero exit code) on any error. - - The `ar' command language is _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 GNU `ar' for developers who already have scripts written -for the MRI "librarian" program. - - The syntax for the `ar' command language is straightforward: - * commands are recognized in upper or lower case; for example, `LIST' - is the same as `list'. In the following descriptions, commands are - shown in upper case for clarity. - - * a single command may appear on each line; it is the first word on - the line. - - * empty lines are allowed, and have no effect. - - * comments are allowed; text after either of the characters `*' or - `;' is ignored. - - * Whenever you use a list of names as part of the argument to an `ar' - command, you can separate the individual names with either commas - or blanks. Commas are shown in the explanations below, for - clarity. - - * `+' is used as a line continuation character; if `+' appears at - the end of a line, the text on the following line is considered - part of the current command. - - Here are the commands you can use in `ar' scripts, or when using -`ar' interactively. Three of them have special significance: - - `OPEN' or `CREATE' specify a "current archive", which is a temporary -file required for most of the other commands. - - `SAVE' commits the changes so far specified by the script. Prior to -`SAVE', commands affect only the temporary copy of the current archive. - -`ADDLIB ARCHIVE' -`ADDLIB ARCHIVE (MODULE, MODULE, ... MODULE)' - Add all the contents of ARCHIVE (or, if specified, each named - MODULE from ARCHIVE) to the current archive. - - Requires prior use of `OPEN' or `CREATE'. - -`ADDMOD MEMBER, MEMBER, ... MEMBER' - Add each named MEMBER as a module in the current archive. - - Requires prior use of `OPEN' or `CREATE'. - -`CLEAR' - Discard the contents of the current archive, canceling the effect - of any operations since the last `SAVE'. May be executed (with no - effect) even if no current archive is specified. - -`CREATE 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 ARCHIVE until you use `SAVE'. - You can overwrite existing archives; similarly, the contents of any - existing file named ARCHIVE will not be destroyed until `SAVE'. - -`DELETE MODULE, MODULE, ... MODULE' - Delete each listed MODULE from the current archive; equivalent to - `ar -d ARCHIVE MODULE ... MODULE'. - - Requires prior use of `OPEN' or `CREATE'. - -`DIRECTORY ARCHIVE (MODULE, ... MODULE)' -`DIRECTORY ARCHIVE (MODULE, ... MODULE) OUTPUTFILE' - List each named MODULE present in ARCHIVE. The separate command - `VERBOSE' specifies the form of the output: when verbose output is - off, output is like that of `ar -t ARCHIVE MODULE...'. When - verbose output is on, the listing is like `ar -tv ARCHIVE - MODULE...'. - - Output normally goes to the standard output stream; however, if you - specify OUTPUTFILE as a final argument, `ar' directs the output to - that file. - -`END' - Exit from `ar', with a `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 `SAVE' command, - those changes are lost. - -`EXTRACT MODULE, MODULE, ... MODULE' - Extract each named MODULE from the current archive, writing them - into the current directory as separate files. Equivalent to `ar -x - ARCHIVE MODULE...'. - - Requires prior use of `OPEN' or `CREATE'. - -`LIST' - Display full contents of the current archive, in "verbose" style - regardless of the state of `VERBOSE'. The effect is like `ar tv - ARCHIVE'. (This single command is a GNU `ar' enhancement, rather - than present for MRI compatibility.) - - Requires prior use of `OPEN' or `CREATE'. - -`OPEN 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 ARCHIVE until you next use - `SAVE'. - -`REPLACE MODULE, MODULE, ... MODULE' - In the current archive, replace each existing MODULE (named in the - `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 `OPEN' or `CREATE'. - -`VERBOSE' - Toggle an internal flag governing the output from `DIRECTORY'. - When the flag is on, `DIRECTORY' output matches output from `ar - -tv '.... - -`SAVE' - Commit your changes to the current archive, and actually save it - as a file with the name specified in the last `CREATE' or `OPEN' - command. - - Requires prior use of `OPEN' or `CREATE'. - - - -File: binutils.info, Node: nm, Next: objcopy, Prev: ar, Up: Top - -2 nm -**** - - nm [`-A'|`-o'|`--print-file-name'] [`-a'|`--debug-syms'] - [`-B'|`--format=bsd'] [`-C'|`--demangle'[=STYLE]] - [`-D'|`--dynamic'] [`-f'FORMAT|`--format='FORMAT] - [`-g'|`--extern-only'] [`-h'|`--help'] - [`-l'|`--line-numbers'] [`-n'|`-v'|`--numeric-sort'] - [`-P'|`--portability'] [`-p'|`--no-sort'] - [`-r'|`--reverse-sort'] [`-S'|`--print-size'] - [`-s'|`--print-armap'] [`-t' RADIX|`--radix='RADIX] - [`-u'|`--undefined-only'] [`-V'|`--version'] - [`-X 32_64'] [`--defined-only'] [`--no-demangle'] - [`--plugin' NAME] [`--size-sort'] [`--special-syms'] - [`--synthetic'] [`--target='BFDNAME] - [OBJFILE...] - - GNU `nm' lists the symbols from object files OBJFILE.... If no -object files are listed as arguments, `nm' assumes the file `a.out'. - - For each symbol, `nm' shows: - - * The symbol value, in the radix selected by options (see below), or - hexadecimal by default. - - * 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 usually local; if uppercase, the symbol is global - (external). There are however a few lowercase symbols that are - shown for special global symbols (`u', `v' and `w'). - - `A' - The symbol's value is absolute, and will not be changed by - further linking. - - `B' - `b' - The symbol is in the uninitialized data section (known as - BSS). - - `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 *Note Linker options: (ld.info)Options. - - `D' - `d' - The symbol is in the initialized data section. - - `G' - `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. - - `i' - For PE format files this indicates that the symbol is in a - section specific to the implementation of DLLs. For ELF - format files this indicates that the symbol is an indirect - function. This is a GNU extension to the standard set of ELF - symbol types. It indicates a symbol which if referenced by a - relocation does not evaluate to its address, but instead must - be invoked at runtime. The runtime execution will then - return the value to be used in the relocation. - - `I' - The symbol is an indirect reference to another symbol. - - `N' - The symbol is a debugging symbol. - - `p' - The symbols is in a stack unwind section. - - `R' - `r' - The symbol is in a read only data section. - - `S' - `s' - The symbol is in an uninitialized data section for small - objects. - - `T' - `t' - The symbol is in the text (code) section. - - `U' - The symbol is undefined. - - `u' - The symbol is a unique global symbol. This is a GNU - extension to the standard set of ELF symbol bindings. For - such a symbol the dynamic linker will make sure that in the - entire process there is just one symbol with this name and - type in use. - - `V' - `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. On some systems, - uppercase indicates that a default value has been specified. - - `W' - `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 - symbol is determined in a system-specific manner without - error. On some systems, uppercase indicates that a default - value has been specified. - - `-' - 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. - - `?' - The symbol type is unknown, or object file format specific. - - * The symbol name. - - The long and short forms of options, shown here as alternatives, are -equivalent. - -`-A' -`-o' -`--print-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. - -`-a' -`--debug-syms' - Display all symbols, even debugger-only symbols; normally these - are not listed. - -`-B' - The same as `--format=bsd' (for compatibility with the MIPS `nm'). - -`-C' -`--demangle[=STYLE]' - Decode ("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. *Note c++filt::, for more information on demangling. - -`--no-demangle' - Do not demangle low-level symbol names. This is the default. - -`-D' -`--dynamic' - Display the dynamic symbols rather than the normal symbols. This - is only meaningful for dynamic objects, such as certain types of - shared libraries. - -`-f FORMAT' -`--format=FORMAT' - Use the output format FORMAT, which can be `bsd', `sysv', or - `posix'. The default is `bsd'. Only the first character of - FORMAT is significant; it can be either upper or lower case. - -`-g' -`--extern-only' - Display only external symbols. - -`-h' -`--help' - Show a summary of the options to `nm' and exit. - -`-l' -`--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. - -`-n' -`-v' -`--numeric-sort' - Sort symbols numerically by their addresses, rather than - alphabetically by their names. - -`-p' -`--no-sort' - Do not bother to sort the symbols in any order; print them in the - order encountered. - -`-P' -`--portability' - Use the POSIX.2 standard output format instead of the default - format. Equivalent to `-f posix'. - -`-r' -`--reverse-sort' - Reverse the order of the sort (whether numeric or alphabetic); let - the last come first. - -`-S' -`--print-size' - Print both value and size of defined symbols for the `bsd' output - style. This option has no effect for object formats that do not - record symbol sizes, unless `--size-sort' is also used in which - case a calculated size is displayed. - -`-s' -`--print-armap' - When listing symbols from archive members, include the index: a - mapping (stored in the archive by `ar' or `ranlib') of which - modules contain definitions for which names. - -`-t RADIX' -`--radix=RADIX' - Use RADIX as the radix for printing the symbol values. It must be - `d' for decimal, `o' for octal, or `x' for hexadecimal. - -`-u' -`--undefined-only' - Display only undefined symbols (those external to each object - file). - -`-V' -`--version' - Show the version number of `nm' and exit. - -`-X' - This option is ignored for compatibility with the AIX version of - `nm'. It takes one parameter which must be the string `32_64'. - The default mode of AIX `nm' corresponds to `-X 32', which is not - supported by GNU `nm'. - -`--defined-only' - Display only defined symbols for each object file. - -`--plugin NAME' - Load the plugin called NAME to add support for extra target types. - This option is only available if the toolchain has been built - with plugin support enabled. - -`--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. If the `bsd' output format is used the - size of the symbol is printed, rather than the value, and `-S' - must be used in order both size and value to be printed. - -`--special-syms' - Display symbols which have a target-specific special meaning. - These symbols are usually used by the target for some special - processing and are not normally helpful when included in the - normal symbol lists. For example for ARM targets this option - would skip the mapping symbols used to mark transitions between - ARM code, THUMB code and data. - -`--synthetic' - Include synthetic symbols in the output. These are special symbols - created by the linker for various purposes. They are not shown by - default since they are not part of the binary's original source - code. - -`--target=BFDNAME' - Specify an object code format other than your system's default - format. *Note Target Selection::, for more information. - - - -File: binutils.info, Node: objcopy, Next: objdump, Prev: nm, Up: Top - -3 objcopy -********* - - objcopy [`-F' BFDNAME|`--target='BFDNAME] - [`-I' BFDNAME|`--input-target='BFDNAME] - [`-O' BFDNAME|`--output-target='BFDNAME] - [`-B' BFDARCH|`--binary-architecture='BFDARCH] - [`-S'|`--strip-all'] - [`-g'|`--strip-debug'] - [`-K' SYMBOLNAME|`--keep-symbol='SYMBOLNAME] - [`-N' SYMBOLNAME|`--strip-symbol='SYMBOLNAME] - [`--strip-unneeded-symbol='SYMBOLNAME] - [`-G' SYMBOLNAME|`--keep-global-symbol='SYMBOLNAME] - [`--localize-hidden'] - [`-L' SYMBOLNAME|`--localize-symbol='SYMBOLNAME] - [`--globalize-symbol='SYMBOLNAME] - [`-W' SYMBOLNAME|`--weaken-symbol='SYMBOLNAME] - [`-w'|`--wildcard'] - [`-x'|`--discard-all'] - [`-X'|`--discard-locals'] - [`-b' BYTE|`--byte='BYTE] - [`-i' [BREADTH]|`--interleave'[=BREADTH]] - [`--interleave-width='WIDTH] - [`-j' SECTIONPATTERN|`--only-section='SECTIONPATTERN] - [`-R' SECTIONPATTERN|`--remove-section='SECTIONPATTERN] - [`-p'|`--preserve-dates'] - [`-D'|`--enable-deterministic-archives'] - [`-U'|`--disable-deterministic-archives'] - [`--debugging'] - [`--gap-fill='VAL] - [`--pad-to='ADDRESS] - [`--set-start='VAL] - [`--adjust-start='INCR] - [`--change-addresses='INCR] - [`--change-section-address' SECTIONPATTERN{=,+,-}VAL] - [`--change-section-lma' SECTIONPATTERN{=,+,-}VAL] - [`--change-section-vma' SECTIONPATTERN{=,+,-}VAL] - [`--change-warnings'] [`--no-change-warnings'] - [`--set-section-flags' SECTIONPATTERN=FLAGS] - [`--add-section' SECTIONNAME=FILENAME] - [`--rename-section' OLDNAME=NEWNAME[,FLAGS]] - [`--long-section-names' {enable,disable,keep}] - [`--change-leading-char'] [`--remove-leading-char'] - [`--reverse-bytes='NUM] - [`--srec-len='IVAL] [`--srec-forceS3'] - [`--redefine-sym' OLD=NEW] - [`--redefine-syms='FILENAME] - [`--weaken'] - [`--keep-symbols='FILENAME] - [`--strip-symbols='FILENAME] - [`--strip-unneeded-symbols='FILENAME] - [`--keep-global-symbols='FILENAME] - [`--localize-symbols='FILENAME] - [`--globalize-symbols='FILENAME] - [`--weaken-symbols='FILENAME] - [`--alt-machine-code='INDEX] - [`--prefix-symbols='STRING] - [`--prefix-sections='STRING] - [`--prefix-alloc-sections='STRING] - [`--add-gnu-debuglink='PATH-TO-FILE] - [`--keep-file-symbols'] - [`--only-keep-debug'] - [`--strip-dwo'] - [`--extract-dwo'] - [`--extract-symbol'] - [`--writable-text'] - [`--readonly-text'] - [`--pure'] - [`--impure'] - [`--file-alignment='NUM] - [`--heap='SIZE] - [`--image-base='ADDRESS] - [`--section-alignment='NUM] - [`--stack='SIZE] - [`--subsystem='WHICH:MAJOR.MINOR] - [`--compress-debug-sections'] - [`--decompress-debug-sections'] - [`--dwarf-depth=N'] - [`--dwarf-start=N'] - [`-v'|`--verbose'] - [`-V'|`--version'] - [`--help'] [`--info'] - INFILE [OUTFILE] - - The GNU `objcopy' utility copies the contents of an object file to -another. `objcopy' uses the GNU 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 -`objcopy' is controlled by command-line options. Note that `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. - - `objcopy' creates temporary files to do its translations and deletes -them afterward. `objcopy' uses BFD to do all its translation work; it -has access to all the formats described in BFD and thus is able to -recognize most formats without being told explicitly. *Note BFD: -(ld.info)BFD. - - `objcopy' can be used to generate S-records by using an output -target of `srec' (e.g., use `-O srec'). - - `objcopy' can be used to generate a raw binary file by using an -output target of `binary' (e.g., use `-O binary'). When `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 `-S' to remove sections containing debugging information. In -some cases `-R' will be useful to remove sections which contain -information that is not needed by the binary file. - - Note--`objcopy' is not able to change the endianness of its input -files. If the input format has an endianness (some formats do not), -`objcopy' can only copy the inputs into file formats that have the same -endianness or which have no endianness (e.g., `srec'). (However, see -the `--reverse-bytes' option.) - -`INFILE' -`OUTFILE' - The input and output files, respectively. If you do not specify - OUTFILE, `objcopy' creates a temporary file and destructively - renames the result with the name of INFILE. - -`-I BFDNAME' -`--input-target=BFDNAME' - Consider the source file's object format to be BFDNAME, rather than - attempting to deduce it. *Note Target Selection::, for more - information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Write the output file using the object format BFDNAME. *Note - Target Selection::, for more information. - -`-F BFDNAME' -`--target=BFDNAME' - Use 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. *Note Target Selection::, for more information. - -`-B BFDARCH' -`--binary-architecture=BFDARCH' - Useful when transforming a architecture-less input file into an - object file. In this case the output architecture can be set to - BFDARCH. This option will be ignored if the input file has a - known BFDARCH. 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_OBJFILE_start, _binary_OBJFILE_end and - _binary_OBJFILE_size. e.g. you can transform a picture file into - an object file and then access it in your code using these symbols. - -`-j SECTIONPATTERN' -`--only-section=SECTIONPATTERN' - Copy only the indicated sections 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. - Wildcard characters are accepted in SECTIONPATTERN. - -`-R SECTIONPATTERN' -`--remove-section=SECTIONPATTERN' - Remove any section matching SECTIONPATTERN from the output file. - This option may be given more than once. Note that using this - option inappropriately may make the output file unusable. Wildcard - characters are accepted in SECTIONPATTERN. Using both the `-j' - and `-R' options together results in undefined behaviour. - -`-S' -`--strip-all' - Do not copy relocation and symbol information from the source file. - -`-g' -`--strip-debug' - Do not copy debugging symbols or sections from the source file. - -`--strip-unneeded' - Strip all symbols that are not needed for relocation processing. - -`-K SYMBOLNAME' -`--keep-symbol=SYMBOLNAME' - When stripping symbols, keep symbol SYMBOLNAME even if it would - normally be stripped. This option may be given more than once. - -`-N SYMBOLNAME' -`--strip-symbol=SYMBOLNAME' - Do not copy symbol SYMBOLNAME from the source file. This option - may be given more than once. - -`--strip-unneeded-symbol=SYMBOLNAME' - Do not copy symbol SYMBOLNAME from the source file unless it is - needed by a relocation. This option may be given more than once. - -`-G SYMBOLNAME' -`--keep-global-symbol=SYMBOLNAME' - Keep only symbol 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. - -`--localize-hidden' - In an ELF object, mark all symbols that have hidden or internal - visibility as local. This option applies on top of - symbol-specific localization options such as `-L'. - -`-L SYMBOLNAME' -`--localize-symbol=SYMBOLNAME' - Make symbol SYMBOLNAME local to the file, so that it is not - visible externally. This option may be given more than once. - -`-W SYMBOLNAME' -`--weaken-symbol=SYMBOLNAME' - Make symbol SYMBOLNAME weak. This option may be given more than - once. - -`--globalize-symbol=SYMBOLNAME' - Give symbol SYMBOLNAME global scoping so that it is visible - outside of the file in which it is defined. This option may be - given more than once. - -`-w' -`--wildcard' - Permit regular expressions in SYMBOLNAMEs used in other command - line options. The question mark (?), asterisk (*), backslash (\) - and square brackets ([]) operators can be used anywhere in the - symbol name. If the first character of the symbol name is the - exclamation point (!) then the sense of the switch is reversed for - that symbol. For example: - - -w -W !foo -W fo* - - would cause objcopy to weaken all symbols that start with "fo" - except for the symbol "foo". - -`-x' -`--discard-all' - Do not copy non-global symbols from the source file. - -`-X' -`--discard-locals' - Do not copy compiler-generated local symbols. (These usually - start with `L' or `.'.) - -`-b BYTE' -`--byte=BYTE' - If interleaving has been enabled via the `--interleave' option - then start the range of bytes to keep at the BYTEth byte. BYTE - can be in the range from 0 to BREADTH-1, where BREADTH is the - value given by the `--interleave' option. - -`-i [BREADTH]' -`--interleave[=BREADTH]' - Only copy a range out of every BREADTH bytes. (Header data is not - affected). Select which byte in the range begins the copy with - the `--byte' option. Select the width of the range with the - `--interleave-width' option. - - This option is useful for creating files to program ROM. It is - typically used with an `srec' output target. Note that `objcopy' - will complain if you do not specify the `--byte' option as well. - - The default interleave breadth is 4, so with `--byte' set to 0, - `objcopy' would copy the first byte out of every four bytes from - the input to the output. - -`--interleave-width=WIDTH' - When used with the `--interleave' option, copy WIDTH bytes at a - time. The start of the range of bytes to be copied is set by the - `--byte' option, and the extent of the range is set with the - `--interleave' option. - - The default value for this option is 1. The value of WIDTH plus - the BYTE value set by the `--byte' option must not exceed the - interleave breadth set by the `--interleave' option. - - This option can be used to create images for two 16-bit flashes - interleaved in a 32-bit bus by passing `-b 0 -i 4 - --interleave-width=2' and `-b 2 -i 4 --interleave-width=2' to two - `objcopy' commands. If the input was '12345678' then the outputs - would be '1256' and '3478' respectively. - -`-p' -`--preserve-dates' - Set the access and modification dates of the output file to be the - same as those of the input file. - -`-D' -`--enable-deterministic-archives' - Operate in _deterministic_ mode. When copying archive members and - writing the archive index, use zero for UIDs, GIDs, timestamps, - and use consistent file modes for all files. - - If `binutils' was configured with - `--enable-deterministic-archives', then this mode is on by default. - It can be disabled with the `-U' option, below. - -`-U' -`--disable-deterministic-archives' - Do _not_ operate in _deterministic_ mode. This is the inverse of - the `-D' option, above: when copying archive members and writing - the archive index, use their actual UID, GID, timestamp, and file - mode values. - - This is the default unless `binutils' was configured with - `--enable-deterministic-archives'. - -`--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. - -`--gap-fill VAL' - Fill gaps between sections with VAL. This operation applies to - the _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 VAL. - -`--pad-to ADDRESS' - Pad the output file up to the load address ADDRESS. This is done - by increasing the size of the last section. The extra space is - filled in with the value specified by `--gap-fill' (default zero). - -`--set-start VAL' - Set the start address of the new file to VAL. Not all object file - formats support setting the start address. - -`--change-start INCR' -`--adjust-start INCR' - Change the start address by adding INCR. Not all object file - formats support setting the start address. - -`--change-addresses INCR' -`--adjust-vma INCR' - Change the VMA and LMA addresses of all sections, as well as the - start address, by adding 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. - -`--change-section-address SECTIONPATTERN{=,+,-}VAL' -`--adjust-section-vma SECTIONPATTERN{=,+,-}VAL' - Set or change both the VMA address and the LMA address of any - section matching SECTIONPATTERN. If `=' is used, the section - address is set to VAL. Otherwise, VAL is added to or subtracted - from the section address. See the comments under - `--change-addresses', above. If SECTIONPATTERN does not match any - sections in the input file, a warning will be issued, unless - `--no-change-warnings' is used. - -`--change-section-lma SECTIONPATTERN{=,+,-}VAL' - Set or change the LMA address of any sections matching - SECTIONPATTERN. 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 `=' is used, - the section address is set to VAL. Otherwise, VAL is added to or - subtracted from the section address. See the comments under - `--change-addresses', above. If SECTIONPATTERN does not match any - sections in the input file, a warning will be issued, unless - `--no-change-warnings' is used. - -`--change-section-vma SECTIONPATTERN{=,+,-}VAL' - Set or change the VMA address of any section matching - SECTIONPATTERN. 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 `=' is used, the section address is set to VAL. - Otherwise, VAL is added to or subtracted from the section address. - See the comments under `--change-addresses', above. If - SECTIONPATTERN does not match any sections in the input file, a - warning will be issued, unless `--no-change-warnings' is used. - -`--change-warnings' -`--adjust-warnings' - If `--change-section-address' or `--change-section-lma' or - `--change-section-vma' is used, and the section pattern does not - match any sections, issue a warning. This is the default. - -`--no-change-warnings' -`--no-adjust-warnings' - Do not issue a warning if `--change-section-address' or - `--adjust-section-lma' or `--adjust-section-vma' is used, even if - the section pattern does not match any sections. - -`--set-section-flags SECTIONPATTERN=FLAGS' - Set the flags for any sections matching SECTIONPATTERN. The FLAGS - argument is a comma separated string of flag names. The - recognized names are `alloc', `contents', `load', `noload', - `readonly', `code', `data', `rom', `share', and `debug'. You can - set the `contents' flag for a section which does not have - contents, but it is not meaningful to clear the `contents' flag of - a section which does have contents-just remove the section - instead. Not all flags are meaningful for all object file formats. - -`--add-section SECTIONNAME=FILENAME' - Add a new section named SECTIONNAME while copying the file. The - contents of the new section are taken from the file 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. - -`--rename-section OLDNAME=NEWNAME[,FLAGS]' - Rename a section from OLDNAME to NEWNAME, optionally changing the - section's flags to FLAGS in the process. This has the advantage - over usng a linker script to perform the rename in that the output - stays as an object file and does not become a linked executable. - - This option is particularly helpful when the input format is - binary, since this will always create a section called .data. If - for example, you wanted instead to create a section called .rodata - containing binary data you could use the following command line to - achieve it: - - objcopy -I binary -O -B \ - --rename-section .data=.rodata,alloc,load,readonly,data,contents \ - - -`--long-section-names {enable,disable,keep}' - Controls the handling of long section names when processing `COFF' - and `PE-COFF' object formats. The default behaviour, `keep', is - to preserve long section names if any are present in the input - file. The `enable' and `disable' options forcibly enable or - disable the use of long section names in the output object; when - `disable' is in effect, any long section names in the input object - will be truncated. The `enable' option will only emit long - section names if any are present in the inputs; this is mostly the - same as `keep', but it is left undefined whether the `enable' - option might force the creation of an empty string table in the - output file. - -`--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 - `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. - -`--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 `--change-leading-char' - because it always changes the symbol name when appropriate, - regardless of the object file format of the output file. - -`--reverse-bytes=NUM' - Reverse the bytes in a section with output contents. A section - length must be evenly divisible by the value given in order for - the swap to be able to take place. Reversing takes place before - the interleaving is performed. - - This option is used typically in generating ROM images for - problematic target systems. For example, on some target boards, - the 32-bit words fetched from 8-bit ROMs are re-assembled in - little-endian byte order regardless of the CPU byte order. - Depending on the programming model, the endianness of the ROM may - need to be modified. - - Consider a simple file with a section containing the following - eight bytes: `12345678'. - - Using `--reverse-bytes=2' for the above example, the bytes in the - output file would be ordered `21436587'. - - Using `--reverse-bytes=4' for the above example, the bytes in the - output file would be ordered `43218765'. - - By using `--reverse-bytes=2' for the above example, followed by - `--reverse-bytes=4' on the output file, the bytes in the second - output file would be ordered `34127856'. - -`--srec-len=IVAL' - Meaningful only for srec output. Set the maximum length of the - Srecords being produced to IVAL. This length covers both address, - data and crc fields. - -`--srec-forceS3' - Meaningful only for srec output. Avoid generation of S1/S2 - records, creating S3-only record format. - -`--redefine-sym OLD=NEW' - Change the name of a symbol OLD, to NEW. This can be useful when - one is trying link two things together for which you have no - source, and there are name collisions. - -`--redefine-syms=FILENAME' - Apply `--redefine-sym' to each symbol pair "OLD NEW" listed in the - file FILENAME. FILENAME is simply a flat file, with one symbol - pair per line. Line comments may be introduced by the hash - character. This option may be given more than once. - -`--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 `-R' option to the linker. This option is only - effective when using an object file format which supports weak - symbols. - -`--keep-symbols=FILENAME' - Apply `--keep-symbol' option to each symbol listed in the file - FILENAME. 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. - -`--strip-symbols=FILENAME' - Apply `--strip-symbol' option to each symbol listed in the file - FILENAME. 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. - -`--strip-unneeded-symbols=FILENAME' - Apply `--strip-unneeded-symbol' option to each symbol listed in - the file FILENAME. 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. - -`--keep-global-symbols=FILENAME' - Apply `--keep-global-symbol' option to each symbol listed in the - file FILENAME. 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. - -`--localize-symbols=FILENAME' - Apply `--localize-symbol' option to each symbol listed in the file - FILENAME. 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. - -`--globalize-symbols=FILENAME' - Apply `--globalize-symbol' option to each symbol listed in the file - FILENAME. 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. - -`--weaken-symbols=FILENAME' - Apply `--weaken-symbol' option to each symbol listed in the file - FILENAME. 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. - -`--alt-machine-code=INDEX' - If the output architecture has alternate machine codes, use the - INDEXth code instead of the default one. This is useful in case a - machine is assigned an official code and the tool-chain adopts the - new code, but other applications still depend on the original code - being used. For ELF based architectures if the INDEX alternative - does not exist then the value is treated as an absolute number to - be stored in the e_machine field of the ELF header. - -`--writable-text' - Mark the output text as writable. This option isn't meaningful - for all object file formats. - -`--readonly-text' - Make the output text write protected. This option isn't - meaningful for all object file formats. - -`--pure' - Mark the output file as demand paged. This option isn't - meaningful for all object file formats. - -`--impure' - Mark the output file as impure. This option isn't meaningful for - all object file formats. - -`--prefix-symbols=STRING' - Prefix all symbols in the output file with STRING. - -`--prefix-sections=STRING' - Prefix all section names in the output file with STRING. - -`--prefix-alloc-sections=STRING' - Prefix all the names of all allocated sections in the output file - with STRING. - -`--add-gnu-debuglink=PATH-TO-FILE' - Creates a .gnu_debuglink section which contains a reference to - PATH-TO-FILE and adds it to the output file. - -`--keep-file-symbols' - When stripping a file, perhaps with `--strip-debug' or - `--strip-unneeded', retain any symbols specifying source file - names, which would otherwise get stripped. - -`--only-keep-debug' - Strip a file, removing contents of any sections that would not be - stripped by `--strip-debug' and leaving the debugging sections - intact. In ELF files, this preserves all note sections in the - output. - - The intention is that this option will be used in conjunction with - `--add-gnu-debuglink' to create a two part executable. One a - stripped binary which will occupy less space in RAM and in a - distribution and the second a debugging information file which is - only needed if debugging abilities are required. The suggested - procedure to create these files is as follows: - - 1. Link the executable as normal. Assuming that is is called - `foo' then... - - 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file - containing the debugging info. - - 3. Run `objcopy --strip-debug foo' to create a stripped - executable. - - 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link - to the debugging info into the stripped executable. - - Note--the choice of `.dbg' as an extension for the debug info file - is arbitrary. Also the `--only-keep-debug' step is optional. You - could instead do this: - - 1. Link the executable as normal. - - 2. Copy `foo' to `foo.full' - - 3. Run `objcopy --strip-debug foo' - - 4. Run `objcopy --add-gnu-debuglink=foo.full foo' - - i.e., the file pointed to by the `--add-gnu-debuglink' can be the - full executable. It does not have to be a file created by the - `--only-keep-debug' switch. - - Note--this switch is only intended for use on fully linked files. - It does not make sense to use it on object files where the - debugging information may be incomplete. Besides the - gnu_debuglink feature currently only supports the presence of one - filename containing debugging information, not multiple filenames - on a one-per-object-file basis. - -`--strip-dwo' - Remove the contents of all DWARF .dwo sections, leaving the - remaining debugging sections and all symbols intact. This option - is intended for use by the compiler as part of the `-gsplit-dwarf' - option, which splits debug information between the .o file and a - separate .dwo file. The compiler generates all debug information - in the same file, then uses the `--extract-dwo' option to copy the - .dwo sections to the .dwo file, then the `--strip-dwo' option to - remove those sections from the original .o file. - -`--extract-dwo' - Extract the contents of all DWARF .dwo sections. See the - `--strip-dwo' option for more information. - -`--file-alignment NUM' - Specify the file alignment. Sections in the file will always - begin at file offsets which are multiples of this number. This - defaults to 512. [This option is specific to PE targets.] - -`--heap RESERVE' -`--heap RESERVE,COMMIT' - Specify the number of bytes of memory to reserve (and optionally - commit) to be used as heap for this program. [This option is - specific to PE targets.] - -`--image-base VALUE' - Use VALUE as the base address of your program or dll. This is the - lowest memory location that will be used when your program or dll - is loaded. To reduce the need to relocate and improve performance - of your dlls, each should have a unique base address and not - overlap any other dlls. The default is 0x400000 for executables, - and 0x10000000 for dlls. [This option is specific to PE targets.] - -`--section-alignment NUM' - Sets the section alignment. Sections in memory will always begin - at addresses which are a multiple of this number. Defaults to - 0x1000. [This option is specific to PE targets.] - -`--stack RESERVE' -`--stack RESERVE,COMMIT' - Specify the number of bytes of memory to reserve (and optionally - commit) to be used as stack for this program. [This option is - specific to PE targets.] - -`--subsystem WHICH' -`--subsystem WHICH:MAJOR' -`--subsystem WHICH:MAJOR.MINOR' - Specifies the subsystem under which your program will execute. The - legal values for WHICH are `native', `windows', `console', - `posix', `efi-app', `efi-bsd', `efi-rtd', `sal-rtd', and `xbox'. - You may optionally set the subsystem version also. Numeric values - are also accepted for WHICH. [This option is specific to PE - targets.] - -`--extract-symbol' - Keep the file's section flags and symbols but remove all section - data. Specifically, the option: - - * removes the contents of all sections; - - * sets the size of every section to zero; and - - * sets the file's start address to zero. - - This option is used to build a `.sym' file for a VxWorks kernel. - It can also be a useful way of reducing the size of a - `--just-symbols' linker input file. - -`--compress-debug-sections' - Compress DWARF debug sections using zlib. - -`--decompress-debug-sections' - Decompress DWARF debug sections using zlib. - -`-V' -`--version' - Show the version number of `objcopy'. - -`-v' -`--verbose' - Verbose output: list all object files modified. In the case of - archives, `objcopy -V' lists all members of the archive. - -`--help' - Show a summary of the options to `objcopy'. - -`--info' - Display a list showing all architectures and object formats - available. - - -File: binutils.info, Node: objdump, Next: ranlib, Prev: objcopy, Up: Top - -4 objdump -********* - - objdump [`-a'|`--archive-headers'] - [`-b' BFDNAME|`--target=BFDNAME'] - [`-C'|`--demangle'[=STYLE] ] - [`-d'|`--disassemble'] - [`-D'|`--disassemble-all'] - [`-z'|`--disassemble-zeroes'] - [`-EB'|`-EL'|`--endian='{big | little }] - [`-f'|`--file-headers'] - [`-F'|`--file-offsets'] - [`--file-start-context'] - [`-g'|`--debugging'] - [`-e'|`--debugging-tags'] - [`-h'|`--section-headers'|`--headers'] - [`-i'|`--info'] - [`-j' SECTION|`--section='SECTION] - [`-l'|`--line-numbers'] - [`-S'|`--source'] - [`-m' MACHINE|`--architecture='MACHINE] - [`-M' OPTIONS|`--disassembler-options='OPTIONS] - [`-p'|`--private-headers'] - [`-P' OPTIONS|`--private='OPTIONS] - [`-r'|`--reloc'] - [`-R'|`--dynamic-reloc'] - [`-s'|`--full-contents'] - [`-W[lLiaprmfFsoRt]'| - `--dwarf'[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]] - [`-G'|`--stabs'] - [`-t'|`--syms'] - [`-T'|`--dynamic-syms'] - [`-x'|`--all-headers'] - [`-w'|`--wide'] - [`--start-address='ADDRESS] - [`--stop-address='ADDRESS] - [`--prefix-addresses'] - [`--[no-]show-raw-insn'] - [`--adjust-vma='OFFSET] - [`--special-syms'] - [`--prefix='PREFIX] - [`--prefix-strip='LEVEL] - [`--insn-width='WIDTH] - [`-V'|`--version'] - [`-H'|`--help'] - OBJFILE... - - `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. - - OBJFILE... are the object files to be examined. When you specify -archives, `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 -`-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-P,-r,-R,-s,-S,-t,-T,-V,-x' must be -given. - -`-a' -`--archive-header' - If any of the OBJFILE files are archives, display the archive - header information (in a format similar to `ls -l'). Besides the - information you could list with `ar tv', `objdump -a' shows the - object file format of each archive member. - -`--adjust-vma=OFFSET' - When dumping information, first add 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. - -`-b BFDNAME' -`--target=BFDNAME' - Specify that the object-code format for the object files is - BFDNAME. This option may not be necessary; OBJDUMP can - automatically recognize many formats. - - For example, - objdump -b oasys -m vax -h fu.o - displays summary information from the section headers (`-h') of - `fu.o', which is explicitly identified (`-m') as a VAX object file - in the format produced by Oasys compilers. You can list the - formats available with the `-i' option. *Note Target Selection::, - for more information. - -`-C' -`--demangle[=STYLE]' - Decode ("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. *Note c++filt::, for more information on demangling. - -`-g' -`--debugging' - Display debugging information. This attempts to parse STABS and - IEEE debugging format information stored in the file and print it - out using a C like syntax. If neither of these formats are found - this option falls back on the `-W' option to print any DWARF - information in the file. - -`-e' -`--debugging-tags' - Like `-g', but the information is generated in a format compatible - with ctags tool. - -`-d' -`--disassemble' - Display the assembler mnemonics for the machine instructions from - OBJFILE. This option only disassembles those sections which are - expected to contain instructions. - -`-D' -`--disassemble-all' - Like `-d', but disassemble the contents of all sections, not just - those expected to contain instructions. - - If the target is an ARM architecture this switch also has the - effect of forcing the disassembler to decode pieces of data found - in code sections as if they were instructions. - -`--prefix-addresses' - When disassembling, print the complete address on each line. This - is the older disassembly format. - -`-EB' -`-EL' -`--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. - -`-f' -`--file-headers' - Display summary information from the overall header of each of the - OBJFILE files. - -`-F' -`--file-offsets' - When disassembling sections, whenever a symbol is displayed, also - display the file offset of the region of data that is about to be - dumped. If zeroes are being skipped, then when disassembly - resumes, tell the user how many zeroes were skipped and the file - offset of the location from where the disassembly resumes. When - dumping sections, display the file offset of the location from - where the dump starts. - -`--file-start-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. - -`-h' -`--section-headers' -`--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 `-Ttext', `-Tdata', or `-Tbss' options to - `ld'. However, some object file formats, such as a.out, do not - store the starting address of the file segments. In those - situations, although `ld' relocates the sections correctly, using - `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. - -`-H' -`--help' - Print a summary of the options to `objdump' and exit. - -`-i' -`--info' - Display a list showing all architectures and object formats - available for specification with `-b' or `-m'. - -`-j NAME' -`--section=NAME' - Display information only for section NAME. - -`-l' -`--line-numbers' - Label the display (using debugging information) with the filename - and source line numbers corresponding to the object code or relocs - shown. Only useful with `-d', `-D', or `-r'. - -`-m MACHINE' -`--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 `-i' option. - - If the target is an ARM architecture then this switch has an - additional effect. It restricts the disassembly to only those - instructions supported by the architecture specified by MACHINE. - If it is necessary to use this switch because the input file does - not contain any architecture information, but it is also desired to - disassemble all the instructions use `-marm'. - -`-M OPTIONS' -`--disassembler-options=OPTIONS' - Pass target specific information to the disassembler. Only - supported on some targets. If it is necessary to specify more - than one disassembler option then multiple `-M' options can be - used or can be placed together into a comma separated list. - - If the target is an ARM architecture then this switch can be used - to select which register name set is used during disassembler. - Specifying `-M reg-names-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 `-M reg-names-apcs' will select the - name set used by the ARM Procedure Call Standard, whilst - specifying `-M reg-names-raw' will just use `r' followed by the - register number. - - There are also two variants on the APCS register naming scheme - enabled by `-M reg-names-atpcs' and `-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 `--disassembler-options=force-thumb'. This can be - useful when attempting to disassemble thumb code produced by other - compilers. - - For the x86, some of the options duplicate functions of the `-m' - switch, but allow finer grained control. Multiple selections from - the following may be specified as a comma separated string. - `x86-64', `i386' and `i8086' select disassembly for the given - architecture. `intel' and `att' select between intel syntax mode - and AT&T syntax mode. `intel-mnemonic' and `att-mnemonic' select - between intel mnemonic mode and AT&T mnemonic mode. - `intel-mnemonic' implies `intel' and `att-mnemonic' implies `att'. - `addr64', `addr32', `addr16', `data32' and `data16' specify the - default address size and operand size. These four options will be - overridden if `x86-64', `i386' or `i8086' appear later in the - option string. Lastly, `suffix', when in AT&T mode, instructs the - disassembler to print a mnemonic suffix even when the suffix could - be inferred by the operands. - - For PowerPC, `booke' controls the disassembly of BookE - instructions. `32' and `64' select PowerPC and PowerPC64 - disassembly, respectively. `e300' selects disassembly for the - e300 family. `440' selects disassembly for the PowerPC 440. - `ppcps' selects disassembly for the paired single instructions of - the PPC750CL. - - For MIPS, this option controls the printing of instruction mnemonic - names and register names in disassembled instructions. Multiple - selections from the following may be specified as a comma separated - string, and invalid options are ignored: - - `no-aliases' - Print the 'raw' instruction mnemonic instead of some pseudo - instruction mnemonic. I.e., print 'daddu' or 'or' instead of - 'move', 'sll' instead of 'nop', etc. - - `virt' - Disassemble the virtualization ASE instructions. - - `gpr-names=ABI' - Print GPR (general-purpose register) names as appropriate for - the specified ABI. By default, GPR names are selected - according to the ABI of the binary being disassembled. - - `fpr-names=ABI' - Print FPR (floating-point register) names as appropriate for - the specified ABI. By default, FPR numbers are printed - rather than names. - - `cp0-names=ARCH' - Print CP0 (system control coprocessor; coprocessor 0) - register names as appropriate for the CPU or architecture - specified by ARCH. By default, CP0 register names are - selected according to the architecture and CPU of the binary - being disassembled. - - `hwr-names=ARCH' - Print HWR (hardware register, used by the `rdhwr' - instruction) names as appropriate for the CPU or architecture - specified by ARCH. By default, HWR names are selected - according to the architecture and CPU of the binary being - disassembled. - - `reg-names=ABI' - Print GPR and FPR names as appropriate for the selected ABI. - - `reg-names=ARCH' - Print CPU-specific register names (CP0 register and HWR names) - as appropriate for the selected CPU or architecture. - - For any of the options listed above, ABI or ARCH may be specified - as `numeric' to have numbers printed rather than names, for the - selected types of registers. You can list the available values of - ABI and ARCH using the `--help' option. - - For VAX, you can specify function entry addresses with `-M - entry:0xf00ba'. You can use this multiple times to properly - disassemble VAX binary files that don't contain symbol tables (like - ROM dumps). In these cases, the function entry mask would - otherwise be decoded as VAX instructions, which would probably - lead the rest of the function being wrongly disassembled. - -`-p' -`--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. - -`-P OPTIONS' -`--private=OPTIONS' - Print information that is specific to the object file format. The - argument OPTIONS is a comma separated list that depends on the - format (the lists of options is displayed with the help). - - For XCOFF, the available options are: `header', `aout', - `sections', `syms', `relocs', `lineno', `loader', `except', - `typchk', `traceback', `toc' and `ldinfo'. - -`-r' -`--reloc' - Print the relocation entries of the file. If used with `-d' or - `-D', the relocations are printed interspersed with the - disassembly. - -`-R' -`--dynamic-reloc' - Print the dynamic relocation entries of the file. This is only - meaningful for dynamic objects, such as certain types of shared - libraries. As for `-r', if used with `-d' or `-D', the - relocations are printed interspersed with the disassembly. - -`-s' -`--full-contents' - Display the full contents of any sections requested. By default - all non-empty sections are displayed. - -`-S' -`--source' - Display source code intermixed with disassembly, if possible. - Implies `-d'. - -`--prefix=PREFIX' - Specify PREFIX to add to the absolute paths when used with `-S'. - -`--prefix-strip=LEVEL' - Indicate how many initial directory names to strip off the - hardwired absolute paths. It has no effect without - `--prefix='PREFIX. - -`--show-raw-insn' - When disassembling instructions, print the instruction in hex as - well as in symbolic form. This is the default except when - `--prefix-addresses' is used. - -`--no-show-raw-insn' - When disassembling instructions, do not print the instruction - bytes. This is the default when `--prefix-addresses' is used. - -`--insn-width=WIDTH' - Display WIDTH bytes on a single line when disassembling - instructions. - -`-W[lLiaprmfFsoRt]' -`--dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]' - 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. - - Note that there is no single letter option to display the content - of trace sections or .gdb_index. - - Note: the output from the `=info' option can also be affected by - the options `--dwarf-depth', the `--dwarf-start' and the - `--dwarf-check'. - -`--dwarf-depth=N' - Limit the dump of the `.debug_info' section to N children. This - is only useful with `--dwarf=info'. The default is to print all - DIEs; the special value 0 for N will also have this effect. - - With a non-zero value for N, DIEs at or deeper than N levels will - not be printed. The range for N is zero-based. - -`--dwarf-start=N' - Print only DIEs beginning with the DIE numbered N. This is only - useful with `--dwarf=info'. - - If specified, this option will suppress printing of any header - information and all DIEs before the DIE numbered N. Only siblings - and children of the specified DIE will be printed. - - This can be used in conjunction with `--dwarf-depth'. - -`--dwarf-check' - Enable additional checks for consistency of Dwarf information. - -`-G' -`--stabs' - 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 `.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 `--syms' output. - -`--start-address=ADDRESS' - Start displaying data at the specified address. This affects the - output of the `-d', `-r' and `-s' options. - -`--stop-address=ADDRESS' - Stop displaying data at the specified address. This affects the - output of the `-d', `-r' and `-s' options. - -`-t' -`--syms' - Print the symbol table entries of the file. This is similar to - the information provided by the `nm' program, although the display - format is different. The format of the output depends upon the - format of the file being dumped, but there are two main types. - One looks like this: - - [ 4](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss - [ 6](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 fred - - where the number inside the square brackets is the number of the - entry in the symbol table, the SEC number is the section number, - the FL value are the symbol's flag bits, the TY number is the - symbol's type, the SCL number is the symbol's storage class and - the NX value is the number of auxilary entries associated with the - symbol. The last two fields are the symbol's value and its name. - - The other common output format, usually seen with ELF based files, - looks like this: - - 00000000 l d .bss 00000000 .bss - 00000000 g .text 00000000 fred - - Here the first number is the symbol's value (sometimes refered to - as its address). The next field is actually a set of characters - and spaces indicating the flag bits that are set on the symbol. - These characters are described below. Next is the section with - which the symbol is associated or _*ABS*_ if the section is - absolute (ie not connected with any section), or _*UND*_ if the - section is referenced in the file being dumped, but not defined - there. - - After the section name comes another field, a number, which for - common symbols is the alignment and for other symbol is the size. - Finally the symbol's name is displayed. - - The flag characters are divided into 7 groups as follows: - `l' - `g' - `u' - `!' - The symbol is a local (l), global (g), unique global (u), - neither global nor local (a space) or both global and local - (!). A symbol can be neither local or global for a variety - of reasons, e.g., because it is used for debugging, but it is - probably an indication of a bug if it is ever both local and - global. Unique global symbols are a GNU extension to the - standard set of ELF symbol bindings. For such a symbol the - dynamic linker will make sure that in the entire process - there is just one symbol with this name and type in use. - - `w' - The symbol is weak (w) or strong (a space). - - `C' - The symbol denotes a constructor (C) or an ordinary symbol (a - space). - - `W' - The symbol is a warning (W) or a normal symbol (a space). A - warning symbol's name is a message to be displayed if the - symbol following the warning symbol is ever referenced. - - `I' - - `i' - The symbol is an indirect reference to another symbol (I), a - function to be evaluated during reloc processing (i) or a - normal symbol (a space). - - `d' - `D' - The symbol is a debugging symbol (d) or a dynamic symbol (D) - or a normal symbol (a space). - - `F' - - `f' - - `O' - The symbol is the name of a function (F) or a file (f) or an - object (O) or just a normal symbol (a space). - -`-T' -`--dynamic-syms' - 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 `nm' - program when given the `-D' (`--dynamic') option. - -`--special-syms' - When displaying symbols include those which the target considers - to be special in some way and which would not normally be of - interest to the user. - -`-V' -`--version' - Print the version number of `objdump' and exit. - -`-x' -`--all-headers' - Display all available header information, including the symbol - table and relocation entries. Using `-x' is equivalent to - specifying all of `-a -f -h -p -r -t'. - -`-w' -`--wide' - Format some lines for output devices that have more than 80 - columns. Also do not truncate symbol names when they are - displayed. - -`-z' -`--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. - - -File: binutils.info, Node: ranlib, Next: size, Prev: objdump, Up: Top - -5 ranlib -******** - - ranlib [`--plugin' NAME] [`-DhHvVt'] ARCHIVE - - `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 `nm -s' or `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 GNU `ranlib' program is another form of GNU `ar'; running -`ranlib' is completely equivalent to executing `ar -s'. *Note ar::. - -`-h' -`-H' -`--help' - Show usage information for `ranlib'. - -`-v' -`-V' -`--version' - Show the version number of `ranlib'. - -`-D' - Operate in _deterministic_ mode. The symbol map archive member's - header will show zero for the UID, GID, and timestamp. When this - option is used, multiple runs will produce identical output files. - - If `binutils' was configured with - `--enable-deterministic-archives', then this mode is on by - default. It can be disabled with the `-U' option, described below. - -`-t' - Update the timestamp of the symbol map of an archive. - -`-U' - Do _not_ operate in _deterministic_ mode. This is the inverse of - the `-D' option, above: the archive index will get actual UID, - GID, timestamp, and file mode values. - - If `binutils' was configured _without_ - `--enable-deterministic-archives', then this mode is on by default. - - - -File: binutils.info, Node: size, Next: strings, Prev: ranlib, Up: Top - -6 size -****** - - size [`-A'|`-B'|`--format='COMPATIBILITY] - [`--help'] - [`-d'|`-o'|`-x'|`--radix='NUMBER] - [`--common'] - [`-t'|`--totals'] - [`--target='BFDNAME] [`-V'|`--version'] - [OBJFILE...] - - The GNU `size' utility lists the section sizes--and the total -size--for each of the object or archive files OBJFILE in its argument -list. By default, one line of output is generated for each object file -or each module in an archive. - - OBJFILE... are the object files to be examined. If none are -specified, the file `a.out' will be used. - - The command line options have the following meanings: - -`-A' -`-B' -`--format=COMPATIBILITY' - Using one of these options, you can choose whether the output from - GNU `size' resembles output from System V `size' (using `-A', or - `--format=sysv'), or Berkeley `size' (using `-B', or - `--format=berkeley'). The default is the one-line format similar - to Berkeley's. - - Here is an example of the Berkeley (default) format of output from - `size': - $ size --format=Berkeley ranlib size - text data bss dec hex filename - 294880 81920 11592 388392 5ed28 ranlib - 294880 81920 11888 388688 5ee50 size - - This is the same data, but displayed closer to System V - conventions: - - $ 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 - -`--help' - Show a summary of acceptable arguments and options. - -`-d' -`-o' -`-x' -`--radix=NUMBER' - Using one of these options, you can control whether the size of - each section is given in decimal (`-d', or `--radix=10'); octal - (`-o', or `--radix=8'); or hexadecimal (`-x', or `--radix=16'). - In `--radix=NUMBER', only the three values (8, 10, 16) are - supported. The total size is always given in two radices; decimal - and hexadecimal for `-d' or `-x' output, or octal and hexadecimal - if you're using `-o'. - -`--common' - Print total size of common symbols in each file. When using - Berkeley format these are included in the bss size. - -`-t' -`--totals' - Show totals of all objects listed (Berkeley format listing mode - only). - -`--target=BFDNAME' - Specify that the object-code format for OBJFILE is BFDNAME. This - option may not be necessary; `size' can automatically recognize - many formats. *Note Target Selection::, for more information. - -`-V' -`--version' - Display the version number of `size'. - - -File: binutils.info, Node: strings, Next: strip, Prev: size, Up: Top - -7 strings -********* - - strings [`-afovV'] [`-'MIN-LEN] - [`-n' MIN-LEN] [`--bytes='MIN-LEN] - [`-t' RADIX] [`--radix='RADIX] - [`-e' ENCODING] [`--encoding='ENCODING] - [`-'] [`--all'] [`--print-file-name'] - [`-T' BFDNAME] [`--target='BFDNAME] - [`--help'] [`--version'] FILE... - - For each FILE given, GNU `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. - - `strings' is mainly useful for determining the contents of non-text -files. - -`-a' -`--all' -`-' - Do not scan only the initialized and loaded sections of object - files; scan the whole files. - -`-f' -`--print-file-name' - Print the name of the file before each string. - -`--help' - Print a summary of the program usage on the standard output and - exit. - -`-MIN-LEN' -`-n MIN-LEN' -`--bytes=MIN-LEN' - Print sequences of characters that are at least MIN-LEN characters - long, instead of the default 4. - -`-o' - Like `-t o'. Some other versions of `strings' have `-o' act like - `-t d' instead. Since we can not be compatible with both ways, we - simply chose one. - -`-t RADIX' -`--radix=RADIX' - Print the offset within the file before each string. The single - character argument specifies the radix of the offset--`o' for - octal, `x' for hexadecimal, or `d' for decimal. - -`-e ENCODING' -`--encoding=ENCODING' - Select the character encoding of the strings that are to be found. - Possible values for ENCODING are: `s' = single-7-bit-byte - characters (ASCII, ISO 8859, etc., default), `S' = - single-8-bit-byte characters, `b' = 16-bit bigendian, `l' = 16-bit - littleendian, `B' = 32-bit bigendian, `L' = 32-bit littleendian. - Useful for finding wide character strings. (`l' and `b' apply to, - for example, Unicode UTF-16/UCS-2 encodings). - -`-T BFDNAME' -`--target=BFDNAME' - Specify an object code format other than your system's default - format. *Note Target Selection::, for more information. - -`-v' -`-V' -`--version' - Print the program version number on the standard output and exit. - - -File: binutils.info, Node: strip, Next: c++filt, Prev: strings, Up: Top - -8 strip -******* - - strip [`-F' BFDNAME |`--target='BFDNAME] - [`-I' BFDNAME |`--input-target='BFDNAME] - [`-O' BFDNAME |`--output-target='BFDNAME] - [`-s'|`--strip-all'] - [`-S'|`-g'|`-d'|`--strip-debug'] - [`--strip-dwo'] - [`-K' SYMBOLNAME |`--keep-symbol='SYMBOLNAME] - [`-N' SYMBOLNAME |`--strip-symbol='SYMBOLNAME] - [`-w'|`--wildcard'] - [`-x'|`--discard-all'] [`-X' |`--discard-locals'] - [`-R' SECTIONNAME |`--remove-section='SECTIONNAME] - [`-o' FILE] [`-p'|`--preserve-dates'] - [`-D'|`--enable-deterministic-archives'] - [`-U'|`--disable-deterministic-archives'] - [`--keep-file-symbols'] - [`--only-keep-debug'] - [`-v' |`--verbose'] [`-V'|`--version'] - [`--help'] [`--info'] - OBJFILE... - - GNU `strip' discards all symbols from object files OBJFILE. The -list of object files may include archives. At least one object file -must be given. - - `strip' modifies the files named in its argument, rather than -writing modified copies under different names. - -`-F BFDNAME' -`--target=BFDNAME' - Treat the original OBJFILE as a file with the object code format - BFDNAME, and rewrite it in the same format. *Note Target - Selection::, for more information. - -`--help' - Show a summary of the options to `strip' and exit. - -`--info' - Display a list showing all architectures and object formats - available. - -`-I BFDNAME' -`--input-target=BFDNAME' - Treat the original OBJFILE as a file with the object code format - BFDNAME. *Note Target Selection::, for more information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Replace OBJFILE with a file in the output format BFDNAME. *Note - Target Selection::, for more information. - -`-R SECTIONNAME' -`--remove-section=SECTIONNAME' - Remove any section named 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. The wildcard - character `*' may be given at the end of SECTIONNAME. If so, then - any section starting with SECTIONNAME will be removed. - -`-s' -`--strip-all' - Remove all symbols. - -`-g' -`-S' -`-d' -`--strip-debug' - Remove debugging symbols only. - -`--strip-dwo' - Remove the contents of all DWARF .dwo sections, leaving the - remaining debugging sections and all symbols intact. See the - description of this option in the `objcopy' section for more - information. - -`--strip-unneeded' - Remove all symbols that are not needed for relocation processing. - -`-K SYMBOLNAME' -`--keep-symbol=SYMBOLNAME' - When stripping symbols, keep symbol SYMBOLNAME even if it would - normally be stripped. This option may be given more than once. - -`-N SYMBOLNAME' -`--strip-symbol=SYMBOLNAME' - Remove symbol SYMBOLNAME from the source file. This option may be - given more than once, and may be combined with strip options other - than `-K'. - -`-o FILE' - Put the stripped output in FILE, rather than replacing the - existing file. When this argument is used, only one OBJFILE - argument may be specified. - -`-p' -`--preserve-dates' - Preserve the access and modification dates of the file. - -`-D' -`--enable-deterministic-archives' - Operate in _deterministic_ mode. When copying archive members and - writing the archive index, use zero for UIDs, GIDs, timestamps, - and use consistent file modes for all files. - - If `binutils' was configured with - `--enable-deterministic-archives', then this mode is on by default. - It can be disabled with the `-U' option, below. - -`-U' -`--disable-deterministic-archives' - Do _not_ operate in _deterministic_ mode. This is the inverse of - the `-D' option, above: when copying archive members and writing - the archive index, use their actual UID, GID, timestamp, and file - mode values. - - This is the default unless `binutils' was configured with - `--enable-deterministic-archives'. - -`-w' -`--wildcard' - Permit regular expressions in SYMBOLNAMEs used in other command - line options. The question mark (?), asterisk (*), backslash (\) - and square brackets ([]) operators can be used anywhere in the - symbol name. If the first character of the symbol name is the - exclamation point (!) then the sense of the switch is reversed for - that symbol. For example: - - -w -K !foo -K fo* - - would cause strip to only keep symbols that start with the letters - "fo", but to discard the symbol "foo". - -`-x' -`--discard-all' - Remove non-global symbols. - -`-X' -`--discard-locals' - Remove compiler-generated local symbols. (These usually start - with `L' or `.'.) - -`--keep-file-symbols' - When stripping a file, perhaps with `--strip-debug' or - `--strip-unneeded', retain any symbols specifying source file - names, which would otherwise get stripped. - -`--only-keep-debug' - Strip a file, removing contents of any sections that would not be - stripped by `--strip-debug' and leaving the debugging sections - intact. In ELF files, this preserves all note sections in the - output. - - The intention is that this option will be used in conjunction with - `--add-gnu-debuglink' to create a two part executable. One a - stripped binary which will occupy less space in RAM and in a - distribution and the second a debugging information file which is - only needed if debugging abilities are required. The suggested - procedure to create these files is as follows: - - 1. Link the executable as normal. Assuming that is is called - `foo' then... - - 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file - containing the debugging info. - - 3. Run `objcopy --strip-debug foo' to create a stripped - executable. - - 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link - to the debugging info into the stripped executable. - - Note--the choice of `.dbg' as an extension for the debug info file - is arbitrary. Also the `--only-keep-debug' step is optional. You - could instead do this: - - 1. Link the executable as normal. - - 2. Copy `foo' to `foo.full' - - 3. Run `strip --strip-debug foo' - - 4. Run `objcopy --add-gnu-debuglink=foo.full foo' - - i.e., the file pointed to by the `--add-gnu-debuglink' can be the - full executable. It does not have to be a file created by the - `--only-keep-debug' switch. - - Note--this switch is only intended for use on fully linked files. - It does not make sense to use it on object files where the - debugging information may be incomplete. Besides the - gnu_debuglink feature currently only supports the presence of one - filename containing debugging information, not multiple filenames - on a one-per-object-file basis. - -`-V' -`--version' - Show the version number for `strip'. - -`-v' -`--verbose' - Verbose output: list all object files modified. In the case of - archives, `strip -v' lists all members of the archive. - - -File: binutils.info, Node: c++filt, Next: addr2line, Prev: strip, Up: Top - -9 c++filt -********* - - c++filt [`-_'|`--strip-underscore'] - [`-n'|`--no-strip-underscore'] - [`-p'|`--no-params'] - [`-t'|`--types'] - [`-i'|`--no-verbose'] - [`-s' FORMAT|`--format='FORMAT] - [`--help'] [`--version'] [SYMBOL...] - - The C++ and Java languages provide function overloading, which means -that you can write many functions with the same name, providing that -each function takes parameters of different types. In order to be able -to distinguish these similarly named functions C++ and Java encode them -into a low-level assembler name which uniquely identifies each -different version. This process is known as "mangling". The `c++filt' -(1) program does the inverse mapping: it decodes ("demangles") low-level -names into user-level names so that they can be read. - - Every alphanumeric word (consisting of letters, digits, underscores, -dollars, or periods) seen in the input is a potential mangled name. If -the name decodes into a C++ name, the C++ name replaces the low-level -name in the output, otherwise the original word is output. In this way -you can pass an entire assembler source file, containing mangled names, -through `c++filt' and see the same source file containing demangled -names. - - You can also use `c++filt' to decipher individual symbols by passing -them on the command line: - - c++filt SYMBOL - - If no SYMBOL arguments are given, `c++filt' reads symbol names from -the standard input instead. All the results are printed on the -standard output. The difference between reading names from the command -line versus reading names from the standard input is that command line -arguments are expected to be just mangled names and no checking is -performed to separate them from surrounding text. Thus for example: - - c++filt -n _Z1fv - - will work and demangle the name to "f()" whereas: - - c++filt -n _Z1fv, - - will not work. (Note the extra comma at the end of the mangled name -which makes it invalid). This command however will work: - - echo _Z1fv, | c++filt -n - - and will display "f(),", i.e., the demangled name followed by a -trailing comma. This behaviour is because when the names are read from -the standard input it is expected that they might be part of an -assembler source file where there might be extra, extraneous characters -trailing after a mangled name. For example: - - .type _Z1fv, @function - -`-_' -`--strip-underscore' - On some systems, both the C and C++ compilers put an underscore in - front of every name. For example, the C name `foo' gets the - low-level name `_foo'. This option removes the initial - underscore. Whether `c++filt' removes the underscore by default - is target dependent. - -`-n' -`--no-strip-underscore' - Do not remove the initial underscore. - -`-p' -`--no-params' - When demangling the name of a function, do not display the types of - the function's parameters. - -`-t' -`--types' - Attempt to demangle types as well as function names. This is - disabled by default since mangled types are normally only used - internally in the compiler, and they can be confused with - non-mangled names. For example, a function called "a" treated as - a mangled type name would be demangled to "signed char". - -`-i' -`--no-verbose' - Do not include implementation details (if any) in the demangled - output. - -`-s FORMAT' -`--format=FORMAT' - `c++filt' can decode various methods of mangling, used by - different compilers. The argument to this option selects which - method it uses: - - `auto' - Automatic selection based on executable (the default method) - - `gnu' - the one used by the GNU C++ compiler (g++) - - `lucid' - the one used by the Lucid compiler (lcc) - - `arm' - the one specified by the C++ Annotated Reference Manual - - `hp' - the one used by the HP compiler (aCC) - - `edg' - the one used by the EDG compiler - - `gnu-v3' - the one used by the GNU C++ compiler (g++) with the V3 ABI. - - `java' - the one used by the GNU Java compiler (gcj) - - `gnat' - the one used by the GNU Ada compiler (GNAT). - -`--help' - Print a summary of the options to `c++filt' and exit. - -`--version' - Print the version number of `c++filt' and exit. - - _Warning:_ `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 future to decode a - name passed as an argument on the command line; in other words, - - c++filt SYMBOL - - may in a future release become - - c++filt OPTION SYMBOL - - ---------- Footnotes ---------- - - (1) MS-DOS does not allow `+' characters in file names, so on MS-DOS -this program is named `CXXFILT'. - - -File: binutils.info, Node: addr2line, Next: nlmconv, Prev: c++filt, Up: Top - -10 addr2line -************ - - addr2line [`-a'|`--addresses'] - [`-b' BFDNAME|`--target='BFDNAME] - [`-C'|`--demangle'[=STYLE]] - [`-e' FILENAME|`--exe='FILENAME] - [`-f'|`--functions'] [`-s'|`--basename'] - [`-i'|`--inlines'] - [`-p'|`--pretty-print'] - [`-j'|`--section='NAME] - [`-H'|`--help'] [`-V'|`--version'] - [addr addr ...] - - `addr2line' translates addresses into file names and line numbers. -Given an address in an executable or an offset in a section of a -relocatable object, it uses the debugging information to figure out -which file name and line number are associated with it. - - The executable or relocatable object to use is specified with the -`-e' option. The default is the file `a.out'. The section in the -relocatable object to use is specified with the `-j' option. - - `addr2line' has two modes of operation. - - In the first, hexadecimal addresses are specified on the command -line, and `addr2line' displays the file name and line number for each -address. - - In the second, `addr2line' reads hexadecimal addresses from standard -input, and prints the file name and line number for each address on -standard output. In this mode, `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 input address is printed on separate lines. - - If the `-f' option is used, then each `FILENAME:LINENO' line is -preceded by `FUNCTIONNAME' which is the name of the function containing -the address. - - If the `-i' option is used and the code at the given address is -present there because of inlining by the compiler then the -`{FUNCTIONNAME} FILENAME:LINENO' information for the inlining function -will be displayed afterwards. This continues recursively until there -is no more inlining to report. - - If the `-a' option is used then the output is prefixed by the input -address. - - If the `-p' option is used then the output for each input address is -displayed on one, possibly quite long, line. If `-p' is not used then -the output is broken up into multiple lines, based on the paragraphs -above. - - If the file name or function name can not be determined, `addr2line' -will print two question marks in their place. If the line number can -not be determined, `addr2line' will print 0. - - The long and short forms of options, shown here as alternatives, are -equivalent. - -`-a' -`--addresses' - Display the address before the function name, file and line number - information. The address is printed with a `0x' prefix to easily - identify it. - -`-b BFDNAME' -`--target=BFDNAME' - Specify that the object-code format for the object files is - BFDNAME. - -`-C' -`--demangle[=STYLE]' - Decode ("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. *Note c++filt::, for more information on demangling. - -`-e FILENAME' -`--exe=FILENAME' - Specify the name of the executable for which addresses should be - translated. The default file is `a.out'. - -`-f' -`--functions' - Display function names as well as file and line number information. - -`-s' -`--basenames' - Display only the base of each file name. - -`-i' -`--inlines' - If the address belongs to a function that was inlined, the source - information for all enclosing scopes back to the first non-inlined - function will also be printed. For example, if `main' inlines - `callee1' which inlines `callee2', and address is from `callee2', - the source information for `callee1' and `main' will also be - printed. - -`-j' -`--section' - Read offsets relative to the specified section instead of absolute - addresses. - -`-p' -`--pretty-print' - Make the output more human friendly: each location are printed on - one line. If option `-i' is specified, lines for all enclosing - scopes are prefixed with `(inlined by)'. - - -File: binutils.info, Node: nlmconv, Next: windmc, Prev: addr2line, Up: Top - -11 nlmconv -********** - -`nlmconv' converts a relocatable object file into a NetWare Loadable -Module. - - _Warning:_ `nlmconv' is not always built as part of the binary - utilities, since it is only useful for NLM targets. - - nlmconv [`-I' BFDNAME|`--input-target='BFDNAME] - [`-O' BFDNAME|`--output-target='BFDNAME] - [`-T' HEADERFILE|`--header-file='HEADERFILE] - [`-d'|`--debug'] [`-l' LINKER|`--linker='LINKER] - [`-h'|`--help'] [`-V'|`--version'] - INFILE OUTFILE - - `nlmconv' converts the relocatable `i386' object file INFILE into -the NetWare Loadable Module OUTFILE, optionally reading HEADERFILE for -NLM header information. For instructions on writing the NLM command -file language used in header files, see the `linkers' section, -`NLMLINK' in particular, of the `NLM Development and Tools Overview', -which is part of the NLM Software Developer's Kit ("NLM SDK"), -available from Novell, Inc. `nlmconv' uses the GNU Binary File -Descriptor library to read INFILE; see *Note BFD: (ld.info)BFD, for -more information. - - `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, `nlmconv' calls the linker for you. - -`-I BFDNAME' -`--input-target=BFDNAME' - Object format of the input file. `nlmconv' can usually determine - the format of a given file (so no default is necessary). *Note - Target Selection::, for more information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Object format of the output file. `nlmconv' infers the output - format based on the input format, e.g. for a `i386' input file the - output format is `nlm32-i386'. *Note Target Selection::, for more - information. - -`-T HEADERFILE' -`--header-file=HEADERFILE' - Reads HEADERFILE for NLM header information. For instructions on - writing the NLM command file language used in header files, see - see the `linkers' section, of the `NLM Development and Tools - Overview', which is part of the NLM Software Developer's Kit, - available from Novell, Inc. - -`-d' -`--debug' - Displays (on standard error) the linker command line used by - `nlmconv'. - -`-l LINKER' -`--linker=LINKER' - Use LINKER for any linking. LINKER can be an absolute or a - relative pathname. - -`-h' -`--help' - Prints a usage summary. - -`-V' -`--version' - Prints the version number for `nlmconv'. - - -File: binutils.info, Node: windmc, Next: windres, Prev: nlmconv, Up: Top - -12 windmc -********* - -`windmc' may be used to generator Windows message resources. - - _Warning:_ `windmc' is not always built as part of the binary - utilities, since it is only useful for Windows targets. - - windmc [options] input-file - - `windmc' reads message definitions from an input file (.mc) and -translate them into a set of output files. The output files may be of -four kinds: - -`h' - A C header file containing the message definitions. - -`rc' - A resource file compilable by the `windres' tool. - -`bin' - One or more binary files containing the resource data for a - specific message language. - -`dbg' - A C include file that maps message id's to their symbolic name. - - The exact description of these different formats is available in -documentation from Microsoft. - - When `windmc' converts from the `mc' format to the `bin' format, -`rc', `h', and optional `dbg' it is acting like the Windows Message -Compiler. - -`-a' -`--ascii_in' - Specifies that the input file specified is ASCII. This is the - default behaviour. - -`-A' -`--ascii_out' - Specifies that messages in the output `bin' files should be in - ASCII format. - -`-b' -`--binprefix' - Specifies that `bin' filenames should have to be prefixed by the - basename of the source file. - -`-c' -`--customflag' - Sets the customer bit in all message id's. - -`-C CODEPAGE' -`--codepage_in CODEPAGE' - Sets the default codepage to be used to convert input file to - UTF16. The default is ocdepage 1252. - -`-d' -`--decimal_values' - Outputs the constants in the header file in decimal. Default is - using hexadecimal output. - -`-e EXT' -`--extension EXT' - The extension for the header file. The default is .h extension. - -`-F TARGET' -`--target TARGET' - Specify the BFD format to use for a bin file as output. This is a - BFD target name; you can use the `--help' option to see a list of - supported targets. Normally `windmc' will use the default format, - which is the first one listed by the `--help' option. *Note - Target Selection::. - -`-h PATH' -`--headerdir PATH' - The target directory of the generated header file. The default is - the current directory. - -`-H' -`--help' - Displays a list of command line options and then exits. - -`-m CHARACTERS' -`--maxlength CHARACTERS' - Instructs `windmc' to generate a warning if the length of any - message exceeds the number specified. - -`-n' -`--nullterminate' - Terminate message text in `bin' files by zero. By default they are - terminated by CR/LF. - -`-o' -`--hresult_use' - Not yet implemented. Instructs `windmc' to generate an OLE2 header - file, using HRESULT definitions. Status codes are used if the flag - is not specified. - -`-O CODEPAGE' -`--codepage_out CODEPAGE' - Sets the default codepage to be used to output text files. The - default is ocdepage 1252. - -`-r PATH' -`--rcdir PATH' - The target directory for the generated `rc' script and the - generated `bin' files that the resource compiler script includes. - The default is the current directory. - -`-u' -`--unicode_in' - Specifies that the input file is UTF16. - -`-U' -`--unicode_out' - Specifies that messages in the output `bin' file should be in UTF16 - format. This is the default behaviour. - -`-v' - -`--verbose' - Enable verbose mode. - -`-V' - -`--version' - Prints the version number for `windmc'. - -`-x PATH' -`--xdgb PATH' - The path of the `dbg' C include file that maps message id's to the - symbolic name. No such file is generated without specifying the - switch. - - -File: binutils.info, Node: windres, Next: dlltool, Prev: windmc, Up: Top - -13 windres -********** - -`windres' may be used to manipulate Windows resources. - - _Warning:_ `windres' is not always built as part of the binary - utilities, since it is only useful for Windows targets. - - windres [options] [input-file] [output-file] - - `windres' reads resources from an input file and copies them into an -output file. Either file may be in one of three formats: - -`rc' - A text format read by the Resource Compiler. - -`res' - A binary format generated by the Resource Compiler. - -`coff' - A COFF object or executable. - - The exact description of these different formats is available in -documentation from Microsoft. - - When `windres' converts from the `rc' format to the `res' format, it -is acting like the Windows Resource Compiler. When `windres' converts -from the `res' format to the `coff' format, it is acting like the -Windows `CVTRES' program. - - When `windres' generates an `rc' file, the output is similar but not -identical to the format expected for the input. When an input `rc' -file refers to an external filename, an output `rc' file will instead -include the file contents. - - If the input or output format is not specified, `windres' will guess -based on the file name, or, for the input file, the file contents. A -file with an extension of `.rc' will be treated as an `rc' file, a file -with an extension of `.res' will be treated as a `res' file, and a file -with an extension of `.o' or `.exe' will be treated as a `coff' file. - - If no output file is specified, `windres' will print the resources -in `rc' format to standard output. - - The normal use is for you to write an `rc' file, use `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 `rc' file -available to Windows. - -`-i FILENAME' -`--input FILENAME' - The name of the input file. If this option is not used, then - `windres' will use the first non-option argument as the input file - name. If there are no non-option arguments, then `windres' will - read from standard input. `windres' can not read a COFF file from - standard input. - -`-o FILENAME' -`--output FILENAME' - The name of the output file. If this option is not used, then - `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 `windres' will write to standard output. - `windres' can not write a COFF file to standard output. Note, for - compatibility with `rc' the option `-fo' is also accepted, but its - use is not recommended. - -`-J FORMAT' -`--input-format FORMAT' - The input format to read. FORMAT may be `res', `rc', or `coff'. - If no input format is specified, `windres' will guess, as - described above. - -`-O FORMAT' -`--output-format FORMAT' - The output format to generate. FORMAT may be `res', `rc', or - `coff'. If no output format is specified, `windres' will guess, - as described above. - -`-F TARGET' -`--target 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 `--help' option to see - a list of supported targets. Normally `windres' will use the - default format, which is the first one listed by the `--help' - option. *Note Target Selection::. - -`--preprocessor PROGRAM' - When `windres' reads an `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 `gcc -E -xc-header -DRC_INVOKED'. - -`--preprocessor-arg OPTION' - When `windres' reads an `rc' file, it runs it through the C - preprocessor first. This option may be used to specify additional - text to be passed to preprocessor on its command line. This - option can be used multiple times to add multiple options to the - preprocessor command line. - -`-I DIRECTORY' -`--include-dir DIRECTORY' - Specify an include directory to use when reading an `rc' file. - `windres' will pass this to the preprocessor as an `-I' option. - `windres' will also search this directory when looking for files - named in the `rc' file. If the argument passed to this command - matches any of the supported FORMATS (as described in the `-J' - option), it will issue a deprecation warning, and behave just like - the `-J' option. New programs should not use this behaviour. If a - directory happens to match a FORMAT, simple prefix it with `./' to - disable the backward compatibility. - -`-D TARGET' -`--define SYM[=VAL]' - Specify a `-D' option to pass to the preprocessor when reading an - `rc' file. - -`-U TARGET' -`--undefine SYM' - Specify a `-U' option to pass to the preprocessor when reading an - `rc' file. - -`-r' - Ignored for compatibility with rc. - -`-v' - Enable verbose mode. This tells you what the preprocessor is if - you didn't specify one. - -`-c VAL' - -`--codepage VAL' - Specify the default codepage to use when reading an `rc' file. - VAL should be a hexadecimal prefixed by `0x' or decimal codepage - code. The valid range is from zero up to 0xffff, but the validity - of the codepage is host and configuration dependent. - -`-l VAL' - -`--language VAL' - Specify the default language to use when reading an `rc' file. - VAL should be a hexadecimal language code. The low eight bits are - the language, and the high eight bits are the sublanguage. - -`--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). - -`--no-use-temp-file' - Use popen, not a temporary file, to read the output of the - preprocessor. This is the default behaviour. - -`-h' - -`--help' - Prints a usage summary. - -`-V' - -`--version' - Prints the version number for `windres'. - -`--yydebug' - If `windres' is compiled with `YYDEBUG' defined as `1', this will - turn on parser debugging. - - -File: binutils.info, Node: dlltool, Next: readelf, Prev: windres, Up: Top - -14 dlltool -********** - -`dlltool' is used to create the files needed to create dynamic link -libraries (DLLs) on systems which understand PE format image files such -as Windows. A DLL contains an export table which contains information -that the runtime loader needs to resolve references from a referencing -program. - - The export table is generated by this program by reading in a `.def' -file or scanning the `.a' and `.o' files which will be in the DLL. A -`.o' file can contain information in special `.drectve' sections with -export information. - - _Note:_ `dlltool' is not always built as part of the binary - utilities, since it is only useful for those targets which support - DLLs. - - dlltool [`-d'|`--input-def' DEF-FILE-NAME] - [`-b'|`--base-file' BASE-FILE-NAME] - [`-e'|`--output-exp' EXPORTS-FILE-NAME] - [`-z'|`--output-def' DEF-FILE-NAME] - [`-l'|`--output-lib' LIBRARY-FILE-NAME] - [`-y'|`--output-delaylib' LIBRARY-FILE-NAME] - [`--export-all-symbols'] [`--no-export-all-symbols'] - [`--exclude-symbols' LIST] - [`--no-default-excludes'] - [`-S'|`--as' PATH-TO-ASSEMBLER] [`-f'|`--as-flags' OPTIONS] - [`-D'|`--dllname' NAME] [`-m'|`--machine' MACHINE] - [`-a'|`--add-indirect'] - [`-U'|`--add-underscore'] [`--add-stdcall-underscore'] - [`-k'|`--kill-at'] [`-A'|`--add-stdcall-alias'] - [`-p'|`--ext-prefix-alias' PREFIX] - [`-x'|`--no-idata4'] [`-c'|`--no-idata5'] - [`--use-nul-prefixed-import-tables'] - [`-I'|`--identify' LIBRARY-FILE-NAME] [`--identify-strict'] - [`-i'|`--interwork'] - [`-n'|`--nodelete'] [`-t'|`--temp-prefix' PREFIX] - [`-v'|`--verbose'] - [`-h'|`--help'] [`-V'|`--version'] - [`--no-leading-underscore'] [`--leading-underscore'] - [object-file ...] - - `dlltool' reads its inputs, which can come from the `-d' and `-b' -options as well as object files specified on the command line. It then -processes these inputs and if the `-e' option has been specified it -creates a exports file. If the `-l' option has been specified it -creates a library file and if the `-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. `dlltool' can help with the -creation of these files. - - The first file is a `.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 `dlltool' can be used to -create it using the `-z' option. In this case `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 `-export:' entry in the `.drectve' section of -the object file. This can be done in C by using the asm() operator: - - asm (".section .drectve"); - asm (".ascii \"-export:my_func\""); - - int my_func (void) { ... } - - 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 `-e' option to -`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 (an -`import library'). This file can be created by giving the `-l' option -to dlltool when it is creating or reading in a `.def' file. - - If the `-y' option is specified, dlltool generates a delay-import -library that can be used instead of the normal import library to allow -a program to link to the dll only as soon as an imported function is -called for the first time. The resulting executable will need to be -linked to the static delayimp library containing __delayLoadHelper2(), -which in turn will import LoadLibraryA and GetProcAddress from kernel32. - - `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 `-S' command line option can be used to -specify the path to the assembler that dlltool will use, and the `-f' -option can be used to pass specific flags to that assembler. The `-n' -can be used to prevent dlltool from deleting these temporary assembler -files when it is done, and if `-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 `dll.c' and -also creating a program (from an object file called `program.o') that -uses that DLL: - - 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 - - `dlltool' may also be used to query an existing import library to -determine the name of the DLL to which it is associated. See the -description of the `-I' or `--identify' option. - - The command line options have the following meanings: - -`-d FILENAME' -`--input-def FILENAME' - Specifies the name of a `.def' file to be read in and processed. - -`-b FILENAME' -`--base-file FILENAME' - 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. - -`-e FILENAME' -`--output-exp FILENAME' - Specifies the name of the export file to be created by dlltool. - -`-z FILENAME' -`--output-def FILENAME' - Specifies the name of the `.def' file to be created by dlltool. - -`-l FILENAME' -`--output-lib FILENAME' - Specifies the name of the library file to be created by dlltool. - -`-y FILENAME' -`--output-delaylib FILENAME' - Specifies the name of the delay-import library file to be created - by dlltool. - -`--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 `--no-default-excludes' - option. You may add to the list of symbols to not export by using - the `--exclude-symbols' option. - -`--no-export-all-symbols' - Only export symbols explicitly listed in an input `.def' file or in - `.drectve' sections in the input object files. This is the default - behaviour. The `.drectve' sections are created by `dllexport' - attributes in the source code. - -`--exclude-symbols LIST' - Do not export the symbols in 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 - `--export-all-symbols' is used. - -`--no-default-excludes' - When `--export-all-symbols' is used, it will by default avoid - exporting certain special symbols. The current list of symbols to - avoid exporting is `DllMain@12', `DllEntryPoint@0', `impure_ptr'. - You may use the `--no-default-excludes' option to go ahead and - export these special symbols. This is only meaningful when - `--export-all-symbols' is used. - -`-S PATH' -`--as PATH' - Specifies the path, including the filename, of the assembler to be - used to create the exports file. - -`-f OPTIONS' -`--as-flags OPTIONS' - Specifies any specific command line options to be passed to the - assembler when building the exports file. This option will work - even if the `-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 options to the assembler they - should be enclosed in double quotes. - -`-D NAME' -`--dll-name NAME' - Specifies the name to be stored in the `.def' file as the name of - the DLL when the `-e' option is used. If this option is not - present, then the filename given to the `-e' option will be used - as the name of the DLL. - -`-m MACHINE' -`-machine MACHINE' - Specifies the type of machine for which the library file should be - built. `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. - -`-a' -`--add-indirect' - Specifies that when `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! - -`-U' -`--add-underscore' - Specifies that when `dlltool' is creating the exports file it - should prepend an underscore to the names of _all_ exported - symbols. - -`--no-leading-underscore' - -`--leading-underscore' - Specifies whether standard symbol should be forced to be prefixed, - or not. - -`--add-stdcall-underscore' - Specifies that when `dlltool' is creating the exports file it - should prepend an underscore to the names of exported _stdcall_ - functions. Variable names and non-stdcall function names are not - modified. This option is useful when creating GNU-compatible - import libs for third party DLLs that were built with MS-Windows - tools. - -`-k' -`--kill-at' - Specifies that when `dlltool' is creating the exports file it - should not append the string `@ '. These numbers are - called ordinal numbers and they represent another way of accessing - the function in a DLL, other than by name. - -`-A' -`--add-stdcall-alias' - Specifies that when `dlltool' is creating the exports file it - should add aliases for stdcall symbols without `@ ' in - addition to the symbols with `@ '. - -`-p' -`--ext-prefix-alias PREFIX' - Causes `dlltool' to create external aliases for all DLL imports - with the specified prefix. The aliases are created for both - external and import symbols with no leading underscore. - -`-x' -`--no-idata4' - Specifies that when `dlltool' is creating the exports and library - files it should omit the `.idata4' section. This is for - compatibility with certain operating systems. - -`--use-nul-prefixed-import-tables' - Specifies that when `dlltool' is creating the exports and library - files it should prefix the `.idata4' and `.idata5' by zero an - element. This emulates old gnu import library generation of - `dlltool'. By default this option is turned off. - -`-c' -`--no-idata5' - Specifies that when `dlltool' is creating the exports and library - files it should omit the `.idata5' section. This is for - compatibility with certain operating systems. - -`-I FILENAME' -`--identify FILENAME' - Specifies that `dlltool' should inspect the import library - indicated by FILENAME and report, on `stdout', the name(s) of the - associated DLL(s). This can be performed in addition to any other - operations indicated by the other options and arguments. - `dlltool' fails if the import library does not exist or is not - actually an import library. See also `--identify-strict'. - -`--identify-strict' - Modifies the behavior of the `--identify' option, such that an - error is reported if FILENAME is associated with more than one DLL. - -`-i' -`--interwork' - Specifies that `dlltool' should mark the objects in the library - file and exports file that it produces as supporting interworking - between ARM and Thumb code. - -`-n' -`--nodelete' - Makes `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. - -`-t PREFIX' -`--temp-prefix PREFIX' - Makes `dlltool' use PREFIX when constructing the names of - temporary assembler and object files. By default, the temp file - prefix is generated from the pid. - -`-v' -`--verbose' - Make dlltool describe what it is doing. - -`-h' -`--help' - Displays a list of command line options and then exits. - -`-V' -`--version' - Displays dlltool's version number and then exits. - - -* Menu: - -* def file format:: The format of the dlltool `.def' file - - -File: binutils.info, Node: def file format, Up: dlltool - -14.1 The format of the `dlltool' `.def' file -============================================ - -A `.def' file contains any number of the following commands: - -`NAME' NAME `[ ,' BASE `]' - The result is going to be named NAME`.exe'. - -`LIBRARY' NAME `[ ,' BASE `]' - The result is going to be named NAME`.dll'. Note: If you want to - use LIBRARY as name then you need to quote. Otherwise this will - fail due a necessary hack for libtool (see PR binutils/13710 for - more details). - -`EXPORTS ( ( (' NAME1 `[ = ' NAME2 `] ) | ( ' NAME1 `=' MODULE-NAME `.' EXTERNAL-NAME `) ) [ == ' ITS_NAME `]' - -`[' INTEGER `] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *' - Declares NAME1 as an exported symbol from the DLL, with optional - ordinal number INTEGER, or declares NAME1 as an alias (forward) of - the function EXTERNAL-NAME in the DLL. If ITS_NAME is specified, - this name is used as string in export table. MODULE-NAME. Note: - The `EXPORTS' has to be the last command in .def file, as keywords - are treated - beside `LIBRARY' - as simple name-identifiers. If - you want to use LIBRARY as name then you need to quote it. - -`IMPORTS ( (' INTERNAL-NAME `=' MODULE-NAME `.' INTEGER `) | [' INTERNAL-NAME `= ]' MODULE-NAME `.' EXTERNAL-NAME `) [ == ) ITS_NAME `]' *' - Declares that EXTERNAL-NAME or the exported function whose ordinal - number is INTEGER is to be imported from the file MODULE-NAME. If - INTERNAL-NAME is specified then this is the name that the imported - function will be referred to in the body of the DLL. If ITS_NAME - is specified, this name is used as string in import table. Note: - The `IMPORTS' has to be the last command in .def file, as keywords - are treated - beside `LIBRARY' - as simple name-identifiers. If - you want to use LIBRARY as name then you need to quote it. - -`DESCRIPTION' STRING - Puts STRING into the output `.exp' file in the `.rdata' section. - -`STACKSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]' - -`HEAPSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]' - Generates `--stack' or `--heap' NUMBER-RESERVE,NUMBER-COMMIT in - the output `.drectve' section. The linker will see this and act - upon it. - -`CODE' ATTR `+' - -`DATA' ATTR `+' - -`SECTIONS (' SECTION-NAME ATTR` + ) *' - Generates `--attr' SECTION-NAME ATTR in the output `.drectve' - section, where ATTR is one of `READ', `WRITE', `EXECUTE' or - `SHARED'. The linker will see this and act upon it. - - - -File: binutils.info, Node: readelf, Next: elfedit, Prev: dlltool, Up: Top - -15 readelf -********** - - readelf [`-a'|`--all'] - [`-h'|`--file-header'] - [`-l'|`--program-headers'|`--segments'] - [`-S'|`--section-headers'|`--sections'] - [`-g'|`--section-groups'] - [`-t'|`--section-details'] - [`-e'|`--headers'] - [`-s'|`--syms'|`--symbols'] - [`--dyn-syms'] - [`-n'|`--notes'] - [`-r'|`--relocs'] - [`-u'|`--unwind'] - [`-d'|`--dynamic'] - [`-V'|`--version-info'] - [`-A'|`--arch-specific'] - [`-D'|`--use-dynamic'] - [`-x' |`--hex-dump='] - [`-p' |`--string-dump='] - [`-R' |`--relocated-dump='] - [`-c'|`--archive-index'] - [`-w[lLiaprmfFsoRt]'| - `--debug-dump'[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]] - [`--dwarf-depth=N'] - [`--dwarf-start=N'] - [`-I'|`--histogram'] - [`-v'|`--version'] - [`-W'|`--wide'] - [`-H'|`--help'] - ELFFILE... - - `readelf' displays information about one or more ELF format object -files. The options control what particular information to display. - - ELFFILE... are the object files to be examined. 32-bit and 64-bit -ELF files are supported, as are archives containing ELF files. - - This program performs a similar function to `objdump' but it goes -into more detail and it exists independently of the BFD library, so if -there is a bug in BFD then readelf will not be affected. - - The long and short forms of options, shown here as alternatives, are -equivalent. At least one option besides `-v' or `-H' must be given. - -`-a' -`--all' - Equivalent to specifying `--file-header', `--program-headers', - `--sections', `--symbols', `--relocs', `--dynamic', `--notes' and - `--version-info'. - -`-h' -`--file-header' - Displays the information contained in the ELF header at the start - of the file. - -`-l' -`--program-headers' -`--segments' - Displays the information contained in the file's segment headers, - if it has any. - -`-S' -`--sections' -`--section-headers' - Displays the information contained in the file's section headers, - if it has any. - -`-g' -`--section-groups' - Displays the information contained in the file's section groups, - if it has any. - -`-t' -`--section-details' - Displays the detailed section information. Implies `-S'. - -`-s' -`--symbols' -`--syms' - Displays the entries in symbol table section of the file, if it - has one. - -`--dyn-syms' - Displays the entries in dynamic symbol table section of the file, - if it has one. - -`-e' -`--headers' - Display all the headers in the file. Equivalent to `-h -l -S'. - -`-n' -`--notes' - Displays the contents of the NOTE segments and/or sections, if any. - -`-r' -`--relocs' - Displays the contents of the file's relocation section, if it has - one. - -`-u' -`--unwind' - Displays the contents of the file's unwind section, if it has one. - Only the unwind sections for IA64 ELF files, as well as ARM - unwind tables (`.ARM.exidx' / `.ARM.extab') are currently - supported. - -`-d' -`--dynamic' - Displays the contents of the file's dynamic section, if it has one. - -`-V' -`--version-info' - Displays the contents of the version sections in the file, it they - exist. - -`-A' -`--arch-specific' - Displays architecture-specific information in the file, if there - is any. - -`-D' -`--use-dynamic' - When displaying symbols, this option makes `readelf' use the - symbol hash tables in the file's dynamic section, rather than the - symbol table sections. - -`-x ' -`--hex-dump=' - Displays the contents of the indicated section as a hexadecimal - bytes. A number identifies a particular section by index in the - section table; any other string identifies all sections with that - name in the object file. - -`-R ' -`--relocated-dump=' - Displays the contents of the indicated section as a hexadecimal - bytes. A number identifies a particular section by index in the - section table; any other string identifies all sections with that - name in the object file. The contents of the section will be - relocated before they are displayed. - -`-p ' -`--string-dump=' - Displays the contents of the indicated section as printable - strings. A number identifies a particular section by index in the - section table; any other string identifies all sections with that - name in the object file. - -`-c' -`--archive-index' - Displays the file symbol index information contained in the header - part of binary archives. Performs the same function as the `t' - command to `ar', but without using the BFD library. *Note ar::. - -`-w[lLiaprmfFsoRt]' -`--debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]' - 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. - - Note that there is no single letter option to display the content - of trace sections or .gdb_index. - - Note: the `=decodedline' option will display the interpreted - contents of a .debug_line section whereas the `=rawline' option - dumps the contents in a raw format. - - Note: the `=frames-interp' option will display the interpreted - contents of a .debug_frame section whereas the `=frames' option - dumps the contents in a raw format. - - Note: the output from the `=info' option can also be affected by - the options `--dwarf-depth' and `--dwarf-start'. - -`--dwarf-depth=N' - Limit the dump of the `.debug_info' section to N children. This - is only useful with `--debug-dump=info'. The default is to print - all DIEs; the special value 0 for N will also have this effect. - - With a non-zero value for N, DIEs at or deeper than N levels will - not be printed. The range for N is zero-based. - -`--dwarf-start=N' - Print only DIEs beginning with the DIE numbered N. This is only - useful with `--debug-dump=info'. - - If specified, this option will suppress printing of any header - information and all DIEs before the DIE numbered N. Only siblings - and children of the specified DIE will be printed. - - This can be used in conjunction with `--dwarf-depth'. - -`-I' -`--histogram' - Display a histogram of bucket list lengths when displaying the - contents of the symbol tables. - -`-v' -`--version' - Display the version number of readelf. - -`-W' -`--wide' - Don't break output lines to fit into 80 columns. By default - `readelf' breaks section header and segment listing lines for - 64-bit ELF files, so that they fit into 80 columns. This option - causes `readelf' to print each section header resp. each segment - one a single line, which is far more readable on terminals wider - than 80 columns. - -`-H' -`--help' - Display the command line options understood by `readelf'. - - - -File: binutils.info, Node: elfedit, Next: Common Options, Prev: readelf, Up: Top - -16 elfedit -********** - - elfedit [`--input-mach='MACHINE] - [`--input-type='TYPE] - [`--input-osabi='OSABI] - `--output-mach='MACHINE - `--output-type='TYPE - `--output-osabi='OSABI - [`-v'|`--version'] - [`-h'|`--help'] - ELFFILE... - - `elfedit' updates the ELF header of ELF files which have the -matching ELF machine and file types. The options control how and which -fields in the ELF header should be updated. - - ELFFILE... are the ELF files to be updated. 32-bit and 64-bit ELF -files are supported, as are archives containing ELF files. - - The long and short forms of options, shown here as alternatives, are -equivalent. At least one of the `--output-mach', `--output-type' and -`--output-osabi' options must be given. - -`--input-mach=MACHINE' - Set the matching input ELF machine type to MACHINE. If - `--input-mach' isn't specified, it will match any ELF machine - types. - - The supported ELF machine types are, L1OM, K1OM and X86-64. - -`--output-mach=MACHINE' - Change the ELF machine type in the ELF header to MACHINE. The - supported ELF machine types are the same as `--input-mach'. - -`--input-type=TYPE' - Set the matching input ELF file type to TYPE. If `--input-type' - isn't specified, it will match any ELF file types. - - The supported ELF file types are, REL, EXEC and DYN. - -`--output-type=TYPE' - Change the ELF file type in the ELF header to TYPE. The supported - ELF types are the same as `--input-type'. - -`--input-osabi=OSABI' - Set the matching input ELF file OSABI to OSABI. If - `--input-osabi' isn't specified, it will match any ELF OSABIs. - - The supported ELF OSABIs are, NONE, HPUX, NETBSD, GNU, LINUX - (alias for GNU), SOLARIS, AIX, IRIX, FREEBSD, TRU64, MODESTO, - OPENBSD, OPENVMS, NSK, AROS and FENIXOS. - -`--output-osabi=OSABI' - Change the ELF OSABI in the ELF header to OSABI. The supported - ELF OSABI are the same as `--input-osabi'. - -`-v' -`--version' - Display the version number of `elfedit'. - -`-h' -`--help' - Display the command line options understood by `elfedit'. - - - -File: binutils.info, Node: Common Options, Next: Selecting the Target System, Prev: elfedit, Up: Top - -17 Common Options -***************** - -The following command-line options are supported by all of the programs -described in this manual. - -`@FILE' - Read command-line options from FILE. The options read are - inserted in place of the original @FILE option. If FILE does not - exist, or cannot be read, then the option will be treated - literally, and not removed. - - Options in FILE are separated by whitespace. A whitespace - character may be included in an option by surrounding the entire - option in either single or double quotes. Any character - (including a backslash) may be included by prefixing the character - to be included with a backslash. The FILE may itself contain - additional @FILE options; any such options will be processed - recursively. - -`--help' - Display the command-line options supported by the program. - -`--version' - Display the version number of the program. - - - -File: binutils.info, Node: Selecting the Target System, Next: Reporting Bugs, Prev: Common Options, Up: Top - -18 Selecting the Target System -****************************** - -You can specify two aspects of the target system to the GNU binary file -utilities, each in several ways: - - * the target - - * the architecture - - 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 -`--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 "native" (on hosts with the -same type as the target system). - -* Menu: - -* Target Selection:: -* Architecture Selection:: - - -File: binutils.info, Node: Target Selection, Next: Architecture Selection, Up: Selecting the Target System - -18.1 Target Selection -===================== - -A "target" is an object file format. A given target may be supported -for multiple architectures (*note Architecture Selection::). A target -selection may also have variations for different operating systems or -architectures. - - The command to list valid target values is `objdump -i' (the first -column of output contains the relevant information). - - Some sample values are: `a.out-hp300bsd', `ecoff-littlemips', -`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 `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 `config.sub' which is included with the -sources. - - Some sample configuration triplets are: `m68k-hp-bsd', -`mips-dec-ultrix', `sparc-sun-sunos'. - -`objdump' Target ----------------- - -Ways to specify: - - 1. command line option: `-b' or `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - -`objcopy' and `strip' Input Target ----------------------------------- - -Ways to specify: - - 1. command line options: `-I' or `--input-target', or `-F' or - `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - -`objcopy' and `strip' Output Target ------------------------------------ - -Ways to specify: - - 1. command line options: `-O' or `--output-target', or `-F' or - `--target' - - 2. the input target (see "`objcopy' and `strip' Input Target" above) - - 3. environment variable `GNUTARGET' - - 4. deduced from the input file - -`nm', `size', and `strings' Target ----------------------------------- - -Ways to specify: - - 1. command line option: `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - - -File: binutils.info, Node: Architecture Selection, Prev: Target Selection, Up: Selecting the Target System - -18.2 Architecture Selection -=========================== - -An "architecture" is a type of 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 CPU. - - The command to list valid architecture values is `objdump -i' (the -second column contains the relevant information). - - Sample values: `m68k:68020', `mips:3000', `sparc'. - -`objdump' Architecture ----------------------- - -Ways to specify: - - 1. command line option: `-m' or `--architecture' - - 2. deduced from the input file - -`objcopy', `nm', `size', `strings' Architecture ------------------------------------------------ - -Ways to specify: - - 1. deduced from the input file - - -File: binutils.info, Node: Reporting Bugs, Next: GNU Free Documentation License, Prev: Selecting the Target System, Up: Top - -19 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 - - -File: binutils.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs - -19.1 Have You Found a Bug? -========================== - -If you are not sure whether you have found a bug, here are some -guidelines: - - * If a binary utility gets a fatal signal, for any input whatever, - that is a bug. Reliable utilities never crash. - - * If a binary utility produces an error message for valid input, - that is a bug. - - * If you are an experienced user of binary utilities, your - suggestions for improvement are welcome in any case. - - -File: binutils.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs - -19.2 How to Report Bugs -======================= - -A number of companies and individuals offer support for 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 `etc/SERVICE' in the GNU Emacs distribution. - - In any event, we also recommend that you send bug reports for the -binary utilities to `http://www.sourceware.org/bugzilla/'. - - The fundamental principle of reporting bugs usefully is this: -*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?" This cannot help us fix a bug, so it is basically useless. We -respond by asking for enough details to enable us to investigate. You -might as well expedite matters by sending them to begin with. - - To enable us to fix the bug, you should include all these things: - - * The version of the utility. Each utility announces it if you - start it with the `--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. - - * Any patches you may have applied to the source, including any - patches made to the `BFD' library. - - * The type of machine you are using, and the operating system name - and version number. - - * What compiler (and its version) was used to compile the - utilities--e.g. "`gcc-2.7'". - - * 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. - - * 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. - - If the source files were produced exclusively using GNU programs - (e.g., `gcc', `gas', and/or the GNU `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 `gcc', or whatever, was - used to produce the object files. Also say how `gcc', or - whatever, was configured. - - * 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 sync, 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. - - * If you wish to suggest changes to the source, send us context - diffs, as generated by `diff' with the `-u', `-c', or `-p' option. - Always send diffs from the old file to the new file. If you wish - to discuss something in the `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. - - Here are some things that are not necessary: - - * 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 _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. - - * 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. - - * 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. - - -File: binutils.info, Node: GNU Free Documentation License, Next: Binutils Index, Prev: Reporting Bugs, Up: Top - -Appendix A GNU Free Documentation License -***************************************** - - Version 1.3, 3 November 2008 - - Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. - `http://fsf.org/' - - 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 - functional and useful 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, in any medium, - that contains a notice placed by the copyright holder saying it - can be distributed under the terms of this License. Such a notice - grants a world-wide, royalty-free license, unlimited in duration, - to use that work under the conditions stated herein. The - "Document", below, refers to any such manual or work. Any member - of the public is a licensee, and is addressed as "you". You - accept the license if you copy, modify or distribute the work in a - way requiring permission under copyright law. - - 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. (Thus, 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. If a section does not fit the above definition of - Secondary then it is not allowed to be designated as Invariant. - The Document may contain zero Invariant Sections. If the Document - does not identify any Invariant Sections then there are none. - - 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 - Front-Cover Text may be at most 5 words, and a Back-Cover Text may - be at most 25 words. - - A "Transparent" copy of the Document means a machine-readable copy, - represented in a format whose specification is available to the - general public, that is suitable for revising the document - 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, or absence of - markup, has been arranged to thwart or discourage subsequent - modification by readers is not Transparent. An image format is - not Transparent if used for any substantial amount of text. 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, PostScript or PDF designed for - human modification. Examples of transparent image formats include - PNG, XCF and JPG. Opaque formats include 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, PostScript or PDF - 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. - - The "publisher" means any person or entity that distributes copies - of the Document to the public. - - A section "Entitled XYZ" means a named subunit of the Document - whose title either is precisely XYZ or contains XYZ in parentheses - following text that translates XYZ in another language. (Here XYZ - stands for a specific section name mentioned below, such as - "Acknowledgements", "Dedications", "Endorsements", or "History".) - To "Preserve the Title" of such a section when you modify the - Document means that it remains a section "Entitled XYZ" according - to this definition. - - The Document may include Warranty Disclaimers next to the notice - which states that this License applies to the Document. These - Warranty Disclaimers are considered to be included by reference in - this License, but only as regards disclaiming warranties: any other - implication that these Warranty Disclaimers may have is void and - has no effect on the meaning of this License. - - 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 (or copies in media that commonly - have printed covers) 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 computer-network location from - which the general network-using public has access to download - using public-standard network protocols a complete Transparent - copy of the Document, free of added material. 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 fewer than five), unless they release you - from this requirement. - - 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", Preserve 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. For any section Entitled "Acknowledgements" or "Dedications", - Preserve the Title of the section, 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 to be Entitled - "Endorsements" or to conflict in title with any Invariant - Section. - - O. Preserve any Warranty Disclaimers. - - 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, and that you preserve all - their Warranty Disclaimers. - - 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, is called an "aggregate" if the - copyright resulting from the compilation is not used to limit the - legal rights of the compilation's users beyond what the individual - works permit. When the Document is included in an aggregate, this - License does not apply to the other works in the aggregate which - 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 half - of the entire aggregate, the Document's Cover Texts may be placed - on covers that bracket the Document within the aggregate, or the - electronic equivalent of covers if the Document is in electronic - form. Otherwise they must appear on printed covers that bracket - 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, and all the license notices in the - Document, and any Warranty Disclaimers, provided that you also - include the original English version of this License and the - original versions of those notices and disclaimers. In case of a - disagreement between the translation and the original version of - this License or a notice or disclaimer, the original version will - prevail. - - If a section in the Document is Entitled "Acknowledgements", - "Dedications", or "History", the requirement (section 4) to - Preserve its Title (section 1) will typically require changing the - actual title. - - 9. TERMINATION - - You may not copy, modify, sublicense, or distribute the Document - except as expressly provided under this License. Any attempt - otherwise to copy, modify, sublicense, or distribute it is void, - and will automatically terminate your rights under this License. - - However, if you cease all violation of this License, then your - license from a particular copyright holder is reinstated (a) - provisionally, unless and until the copyright holder explicitly - and finally terminates your license, and (b) permanently, if the - copyright holder fails to notify you of the violation by some - reasonable means prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is - reinstated permanently if the copyright holder notifies you of the - violation by some reasonable means, this is the first time you have - received notice of violation of this License (for any work) from - that copyright holder, and you cure the violation prior to 30 days - after your receipt of the notice. - - Termination of your rights under this section does not terminate - the licenses of parties who have received copies or rights from - you under this License. If your rights have been terminated and - not permanently reinstated, receipt of a copy of some or all of - the same material does not give you any rights to use it. - - 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. If the Document specifies that a proxy - can decide which future versions of this License can be used, that - proxy's public statement of acceptance of a version permanently - authorizes you to choose that version for the Document. - - 11. RELICENSING - - "Massive Multiauthor Collaboration Site" (or "MMC Site") means any - World Wide Web server that publishes copyrightable works and also - provides prominent facilities for anybody to edit those works. A - public wiki that anybody can edit is an example of such a server. - A "Massive Multiauthor Collaboration" (or "MMC") contained in the - site means any set of copyrightable works thus published on the MMC - site. - - "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 - license published by Creative Commons Corporation, a not-for-profit - corporation with a principal place of business in San Francisco, - California, as well as future copyleft versions of that license - published by that same organization. - - "Incorporate" means to publish or republish a Document, in whole or - in part, as part of another Document. - - An MMC is "eligible for relicensing" if it is licensed under this - License, and if all works that were first published under this - License somewhere other than this MMC, and subsequently - incorporated in whole or in part into the MMC, (1) had no cover - texts or invariant sections, and (2) were thus incorporated prior - to November 1, 2008. - - The operator of an MMC Site may republish an MMC contained in the - site under CC-BY-SA on the same site at any time before August 1, - 2009, provided the MMC is eligible for relicensing. - - -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: - - 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.3 - or any later version published by the Free Software Foundation; - with no Invariant Sections, no Front-Cover Texts, and no Back-Cover - Texts. A copy of the license is included in the section entitled ``GNU - Free Documentation License''. - - If you have Invariant Sections, Front-Cover Texts and Back-Cover -Texts, replace the "with...Texts." line with this: - - with the Invariant Sections being LIST THEIR TITLES, with - the Front-Cover Texts being LIST, and with the Back-Cover Texts - being LIST. - - If you have Invariant Sections without Cover Texts, or some other -combination of the three, merge those two alternatives to suit the -situation. - - 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. - - -File: binutils.info, Node: Binutils Index, Prev: GNU Free Documentation License, Up: Top - -Binutils Index -************** - -[index] -* Menu: - -* --enable-deterministic-archives <1>: objcopy. (line 302) -* --enable-deterministic-archives <2>: ranlib. (line 44) -* --enable-deterministic-archives <3>: ar cmdline. (line 151) -* --enable-deterministic-archives <4>: strip. (line 115) -* --enable-deterministic-archives <5>: ar cmdline. (line 224) -* --enable-deterministic-archives: objcopy. (line 292) -* .stab: objdump. (line 413) -* Add prefix to absolute paths: objdump. (line 356) -* addr2line: addr2line. (line 6) -* address to file name and line number: addr2line. (line 6) -* all header information, object file: objdump. (line 531) -* ar: ar. (line 6) -* ar compatibility: ar. (line 60) -* architecture: objdump. (line 197) -* architectures available: objdump. (line 182) -* archive contents: ranlib. (line 6) -* Archive file symbol index information: readelf. (line 155) -* archive headers: objdump. (line 67) -* archives: ar. (line 6) -* base files: dlltool. (line 124) -* bug criteria: Bug Criteria. (line 6) -* bug reports: Bug Reporting. (line 6) -* bugs: Reporting Bugs. (line 6) -* bugs, reporting: Bug Reporting. (line 6) -* c++filt: c++filt. (line 6) -* changing object addresses: objcopy. (line 337) -* changing section address: objcopy. (line 347) -* changing section LMA: objcopy. (line 356) -* changing section VMA: objcopy. (line 369) -* changing start address: objcopy. (line 332) -* collections of files: ar. (line 6) -* compatibility, ar: ar. (line 60) -* contents of archive: ar cmdline. (line 97) -* crash: Bug Criteria. (line 9) -* creating archives: ar cmdline. (line 145) -* creating thin archive: ar cmdline. (line 210) -* cxxfilt: c++filt. (line 14) -* dates in archive: ar cmdline. (line 184) -* debug symbols: objdump. (line 413) -* debugging symbols: nm. (line 147) -* deleting from archive: ar cmdline. (line 26) -* demangling C++ symbols: c++filt. (line 6) -* demangling in nm: nm. (line 155) -* demangling in objdump <1>: objdump. (line 95) -* demangling in objdump: addr2line. (line 78) -* deterministic archives <1>: ranlib. (line 32) -* deterministic archives <2>: objcopy. (line 292) -* deterministic archives <3>: ar cmdline. (line 224) -* deterministic archives <4>: strip. (line 105) -* deterministic archives <5>: ar cmdline. (line 151) -* deterministic archives <6>: ranlib. (line 44) -* deterministic archives: objcopy. (line 302) -* disassembling object code: objdump. (line 117) -* disassembly architecture: objdump. (line 197) -* disassembly endianness: objdump. (line 137) -* disassembly, with source: objdump. (line 352) -* discarding symbols: strip. (line 6) -* DLL: dlltool. (line 6) -* dlltool: dlltool. (line 6) -* DWARF: objdump. (line 378) -* dynamic relocation entries, in object file: objdump. (line 340) -* dynamic symbol table entries, printing: objdump. (line 515) -* dynamic symbols: nm. (line 167) -* ELF dynamic section information: readelf. (line 113) -* ELF dynamic symbol table information: readelf. (line 88) -* ELF file header information: readelf. (line 57) -* ELF file information: readelf. (line 6) -* ELF notes: readelf. (line 97) -* ELF object file format: objdump. (line 413) -* ELF program header information: readelf. (line 63) -* ELF reloc information: readelf. (line 101) -* ELF section group information: readelf. (line 74) -* ELF section information: readelf. (line 79) -* ELF segment information: readelf. (line 63) -* ELF symbol table information: readelf. (line 84) -* ELF version sections information: readelf. (line 117) -* elfedit: elfedit. (line 6) -* endianness: objdump. (line 137) -* error on valid input: Bug Criteria. (line 12) -* external symbols: nm. (line 179) -* extract from archive: ar cmdline. (line 112) -* fatal signal: Bug Criteria. (line 9) -* file name: nm. (line 141) -* header information, all: objdump. (line 531) -* input .def file: dlltool. (line 120) -* input file name: nm. (line 141) -* Instruction width: objdump. (line 373) -* libraries: ar. (line 25) -* listings strings: strings. (line 6) -* load plugin: nm. (line 252) -* machine instructions: objdump. (line 117) -* moving in archive: ar cmdline. (line 34) -* MRI compatibility, ar: ar scripts. (line 8) -* name duplication in archive: ar cmdline. (line 106) -* name length: ar. (line 18) -* nm: nm. (line 6) -* nm compatibility: nm. (line 173) -* nm format: nm. (line 173) -* not writing archive index: ar cmdline. (line 203) -* objdump: objdump. (line 6) -* object code format <1>: strings. (line 67) -* object code format <2>: nm. (line 278) -* object code format <3>: addr2line. (line 73) -* object code format <4>: objdump. (line 81) -* object code format: size. (line 84) -* object file header: objdump. (line 143) -* object file information: objdump. (line 6) -* object file offsets: objdump. (line 148) -* object file sections: objdump. (line 347) -* object formats available: objdump. (line 182) -* operations on archive: ar cmdline. (line 22) -* printing from archive: ar cmdline. (line 46) -* printing strings: strings. (line 6) -* quick append to archive: ar cmdline. (line 54) -* radix for section sizes: size. (line 66) -* ranlib <1>: ranlib. (line 6) -* ranlib: ar cmdline. (line 91) -* readelf: readelf. (line 6) -* relative placement in archive: ar cmdline. (line 133) -* relocation entries, in object file: objdump. (line 334) -* removing symbols: strip. (line 6) -* repeated names in archive: ar cmdline. (line 106) -* replacement in archive: ar cmdline. (line 73) -* reporting bugs: Reporting Bugs. (line 6) -* scripts, ar: ar scripts. (line 8) -* section addresses in objdump: objdump. (line 73) -* section headers: objdump. (line 164) -* section information: objdump. (line 187) -* section sizes: size. (line 6) -* sections, full contents: objdump. (line 347) -* size: size. (line 6) -* size display format: size. (line 27) -* size number format: size. (line 66) -* sorting symbols: nm. (line 202) -* source code context: objdump. (line 157) -* source disassembly: objdump. (line 352) -* source file name: nm. (line 141) -* source filenames for object files: objdump. (line 191) -* stab: objdump. (line 413) -* start-address: objdump. (line 422) -* stop-address: objdump. (line 426) -* strings: strings. (line 6) -* strings, printing: strings. (line 6) -* strip: strip. (line 6) -* Strip absolute paths: objdump. (line 359) -* symbol index <1>: ar. (line 28) -* symbol index: ranlib. (line 6) -* symbol index, listing: nm. (line 224) -* symbol line numbers: nm. (line 187) -* symbol table entries, printing: objdump. (line 431) -* symbols: nm. (line 6) -* symbols, discarding: strip. (line 6) -* thin archives: ar. (line 40) -* undefined symbols: nm. (line 235) -* Unix compatibility, ar: ar cmdline. (line 8) -* unwind information: readelf. (line 106) -* Update ELF header: elfedit. (line 6) -* updating an archive: ar cmdline. (line 215) -* version: Top. (line 6) -* VMA in objdump: objdump. (line 73) -* wide output, printing: objdump. (line 537) -* writing archive index: ar cmdline. (line 197) - - - -Tag Table: -Node: Top1896 -Node: ar3609 -Node: ar cmdline6747 -Node: ar scripts17089 -Node: nm22777 -Node: objcopy32671 -Node: objdump64440 -Node: ranlib86571 -Node: size88176 -Node: strings91180 -Node: strip93638 -Node: c++filt100870 -Ref: c++filt-Footnote-1105711 -Node: addr2line105817 -Node: nlmconv110154 -Node: windmc112759 -Node: windres116408 -Node: dlltool122769 -Node: def file format135649 -Node: readelf138188 -Node: elfedit145743 -Node: Common Options147997 -Node: Selecting the Target System149037 -Node: Target Selection149969 -Node: Architecture Selection151951 -Node: Reporting Bugs152779 -Node: Bug Criteria153558 -Node: Bug Reporting154111 -Node: GNU Free Documentation License160981 -Node: Binutils Index186160 - -End Tag Table diff -Nur binutils-2.24.orig/binutils/doc/cxxfilt.man binutils-2.24/binutils/doc/cxxfilt.man --- binutils-2.24.orig/binutils/doc/cxxfilt.man 2013-11-18 09:49:32.000000000 +0100 +++ binutils-2.24/binutils/doc/cxxfilt.man 1970-01-01 01:00:00.000000000 +0100 @@ -1,336 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "C++FILT 1" -.TH C++FILT 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -cxxfilt \- Demangle C++ and Java symbols. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -c++filt [\fB\-_\fR|\fB\-\-strip\-underscore\fR] - [\fB\-n\fR|\fB\-\-no\-strip\-underscore\fR] - [\fB\-p\fR|\fB\-\-no\-params\fR] - [\fB\-t\fR|\fB\-\-types\fR] - [\fB\-i\fR|\fB\-\-no\-verbose\fR] - [\fB\-s\fR \fIformat\fR|\fB\-\-format=\fR\fIformat\fR] - [\fB\-\-help\fR] [\fB\-\-version\fR] [\fIsymbol\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \*(C+ and Java languages provide function overloading, which means -that you can write many functions with the same name, providing that -each function takes parameters of different types. In order to be -able to distinguish these similarly named functions \*(C+ and Java -encode them into a low-level assembler name which uniquely identifies -each different version. This process is known as \fImangling\fR. The -\&\fBc++filt\fR -[1] -program does the inverse mapping: it decodes (\fIdemangles\fR) low-level -names into user-level names so that they can be read. -.PP -Every alphanumeric word (consisting of letters, digits, underscores, -dollars, or periods) seen in the input is a potential mangled name. -If the name decodes into a \*(C+ name, the \*(C+ name replaces the -low-level name in the output, otherwise the original word is output. -In this way you can pass an entire assembler source file, containing -mangled names, through \fBc++filt\fR and see the same source file -containing demangled names. -.PP -You can also use \fBc++filt\fR to decipher individual symbols by -passing them on the command line: -.PP -.Vb 1 -\& c++filt -.Ve -.PP -If no \fIsymbol\fR arguments are given, \fBc++filt\fR reads symbol -names from the standard input instead. All the results are printed on -the standard output. The difference between reading names from the -command line versus reading names from the standard input is that -command line arguments are expected to be just mangled names and no -checking is performed to separate them from surrounding text. Thus -for example: -.PP -.Vb 1 -\& c++filt \-n _Z1fv -.Ve -.PP -will work and demangle the name to \*(L"f()\*(R" whereas: -.PP -.Vb 1 -\& c++filt \-n _Z1fv, -.Ve -.PP -will not work. (Note the extra comma at the end of the mangled -name which makes it invalid). This command however will work: -.PP -.Vb 1 -\& echo _Z1fv, | c++filt \-n -.Ve -.PP -and will display \*(L"f(),\*(R", i.e., the demangled name followed by a -trailing comma. This behaviour is because when the names are read -from the standard input it is expected that they might be part of an -assembler source file where there might be extra, extraneous -characters trailing after a mangled name. For example: -.PP -.Vb 1 -\& .type _Z1fv, @function -.Ve -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-_\fR" 4 -.IX Item "-_" -.PD 0 -.IP "\fB\-\-strip\-underscore\fR" 4 -.IX Item "--strip-underscore" -.PD -On some systems, both the C and \*(C+ compilers put an underscore in front -of every name. For example, the C name \f(CW\*(C`foo\*(C'\fR gets the low-level -name \f(CW\*(C`_foo\*(C'\fR. This option removes the initial underscore. Whether -\&\fBc++filt\fR removes the underscore by default is target dependent. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-\-no\-strip\-underscore\fR" 4 -.IX Item "--no-strip-underscore" -.PD -Do not remove the initial underscore. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-no\-params\fR" 4 -.IX Item "--no-params" -.PD -When demangling the name of a function, do not display the types of -the function's parameters. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-types\fR" 4 -.IX Item "--types" -.PD -Attempt to demangle types as well as function names. This is disabled -by default since mangled types are normally only used internally in -the compiler, and they can be confused with non-mangled names. For example, -a function called \*(L"a\*(R" treated as a mangled type name would be -demangled to \*(L"signed char\*(R". -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-no\-verbose\fR" 4 -.IX Item "--no-verbose" -.PD -Do not include implementation details (if any) in the demangled -output. -.IP "\fB\-s\fR \fIformat\fR" 4 -.IX Item "-s format" -.PD 0 -.IP "\fB\-\-format=\fR\fIformat\fR" 4 -.IX Item "--format=format" -.PD -\&\fBc++filt\fR can decode various methods of mangling, used by -different compilers. The argument to this option selects which -method it uses: -.RS 4 -.ie n .IP """auto""" 4 -.el .IP "\f(CWauto\fR" 4 -.IX Item "auto" -Automatic selection based on executable (the default method) -.ie n .IP """gnu""" 4 -.el .IP "\f(CWgnu\fR" 4 -.IX Item "gnu" -the one used by the \s-1GNU\s0 \*(C+ compiler (g++) -.ie n .IP """lucid""" 4 -.el .IP "\f(CWlucid\fR" 4 -.IX Item "lucid" -the one used by the Lucid compiler (lcc) -.ie n .IP """arm""" 4 -.el .IP "\f(CWarm\fR" 4 -.IX Item "arm" -the one specified by the \*(C+ Annotated Reference Manual -.ie n .IP """hp""" 4 -.el .IP "\f(CWhp\fR" 4 -.IX Item "hp" -the one used by the \s-1HP\s0 compiler (aCC) -.ie n .IP """edg""" 4 -.el .IP "\f(CWedg\fR" 4 -.IX Item "edg" -the one used by the \s-1EDG\s0 compiler -.ie n .IP """gnu\-v3""" 4 -.el .IP "\f(CWgnu\-v3\fR" 4 -.IX Item "gnu-v3" -the one used by the \s-1GNU\s0 \*(C+ compiler (g++) with the V3 \s-1ABI\s0. -.ie n .IP """java""" 4 -.el .IP "\f(CWjava\fR" 4 -.IX Item "java" -the one used by the \s-1GNU\s0 Java compiler (gcj) -.ie n .IP """gnat""" 4 -.el .IP "\f(CWgnat\fR" 4 -.IX Item "gnat" -the one used by the \s-1GNU\s0 Ada compiler (\s-1GNAT\s0). -.RE -.RS 4 -.RE -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Print a summary of the options to \fBc++filt\fR and exit. -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -Print the version number of \fBc++filt\fR and exit. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "FOOTNOTES" -.IX Header "FOOTNOTES" -.IP "1." 4 -MS-DOS does not allow \f(CW\*(C`+\*(C'\fR characters in file names, so on -MS-DOS this program is named \fB\s-1CXXFILT\s0\fR. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/dlltool.1 binutils-2.24/binutils/doc/dlltool.1 --- binutils-2.24.orig/binutils/doc/dlltool.1 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/doc/dlltool.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,529 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "DLLTOOL 1" -.TH DLLTOOL 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -dlltool \- Create files needed to build and use DLLs. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -dlltool [\fB\-d\fR|\fB\-\-input\-def\fR \fIdef-file-name\fR] - [\fB\-b\fR|\fB\-\-base\-file\fR \fIbase-file-name\fR] - [\fB\-e\fR|\fB\-\-output\-exp\fR \fIexports-file-name\fR] - [\fB\-z\fR|\fB\-\-output\-def\fR \fIdef-file-name\fR] - [\fB\-l\fR|\fB\-\-output\-lib\fR \fIlibrary-file-name\fR] - [\fB\-y\fR|\fB\-\-output\-delaylib\fR \fIlibrary-file-name\fR] - [\fB\-\-export\-all\-symbols\fR] [\fB\-\-no\-export\-all\-symbols\fR] - [\fB\-\-exclude\-symbols\fR \fIlist\fR] - [\fB\-\-no\-default\-excludes\fR] - [\fB\-S\fR|\fB\-\-as\fR \fIpath-to-assembler\fR] [\fB\-f\fR|\fB\-\-as\-flags\fR \fIoptions\fR] - [\fB\-D\fR|\fB\-\-dllname\fR \fIname\fR] [\fB\-m\fR|\fB\-\-machine\fR \fImachine\fR] - [\fB\-a\fR|\fB\-\-add\-indirect\fR] - [\fB\-U\fR|\fB\-\-add\-underscore\fR] [\fB\-\-add\-stdcall\-underscore\fR] - [\fB\-k\fR|\fB\-\-kill\-at\fR] [\fB\-A\fR|\fB\-\-add\-stdcall\-alias\fR] - [\fB\-p\fR|\fB\-\-ext\-prefix\-alias\fR \fIprefix\fR] - [\fB\-x\fR|\fB\-\-no\-idata4\fR] [\fB\-c\fR|\fB\-\-no\-idata5\fR] - [\fB\-\-use\-nul\-prefixed\-import\-tables\fR] - [\fB\-I\fR|\fB\-\-identify\fR \fIlibrary-file-name\fR] [\fB\-\-identify\-strict\fR] - [\fB\-i\fR|\fB\-\-interwork\fR] - [\fB\-n\fR|\fB\-\-nodelete\fR] [\fB\-t\fR|\fB\-\-temp\-prefix\fR \fIprefix\fR] - [\fB\-v\fR|\fB\-\-verbose\fR] - [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-\-no\-leading\-underscore\fR] [\fB\-\-leading\-underscore\fR] - [object\-file ...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBdlltool\fR reads its inputs, which can come from the \fB\-d\fR and -\&\fB\-b\fR options as well as object files specified on the command -line. It then processes these inputs and if the \fB\-e\fR option has -been specified it creates a exports file. If the \fB\-l\fR option -has been specified it creates a library file and if the \fB\-z\fR option -has been specified it creates a def file. Any or all of the \fB\-e\fR, -\&\fB\-l\fR and \fB\-z\fR options can be present in one invocation of -dlltool. -.PP -When creating a \s-1DLL\s0, along with the source for the \s-1DLL\s0, it is necessary -to have three other files. \fBdlltool\fR can help with the creation of -these files. -.PP -The first file is a \fI.def\fR file which specifies which functions are -exported from the \s-1DLL\s0, which functions the \s-1DLL\s0 imports, and so on. This -is a text file and can be created by hand, or \fBdlltool\fR can be used -to create it using the \fB\-z\fR option. In this case \fBdlltool\fR -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 \fI.def\fR file it creates. -.PP -In order to mark a function as being exported from a \s-1DLL\s0, it needs to -have an \fB\-export:\fR entry in the \fB.drectve\fR -section of the object file. This can be done in C by using the -\&\fIasm()\fR operator: -.PP -.Vb 2 -\& asm (".section .drectve"); -\& asm (".ascii \e"\-export:my_func\e""); -\& -\& int my_func (void) { ... } -.Ve -.PP -The second file needed for \s-1DLL\s0 creation is an exports file. This file -is linked with the object files that make up the body of the \s-1DLL\s0 and it -handles the interface between the \s-1DLL\s0 and the outside world. This is a -binary file and it can be created by giving the \fB\-e\fR option to -\&\fBdlltool\fR when it is creating or reading in a \fI.def\fR file. -.PP -The third file needed for \s-1DLL\s0 creation is the library file that programs -will link with in order to access the functions in the \s-1DLL\s0 (an `import -library'). This file can be created by giving the \fB\-l\fR option to -dlltool when it is creating or reading in a \fI.def\fR file. -.PP -If the \fB\-y\fR option is specified, dlltool generates a delay-import -library that can be used instead of the normal import library to allow -a program to link to the dll only as soon as an imported function is -called for the first time. The resulting executable will need to be -linked to the static delayimp library containing _\|\fI_delayLoadHelper2()\fR, -which in turn will import LoadLibraryA and GetProcAddress from kernel32. -.PP -\&\fBdlltool\fR builds the library file by hand, but it builds the -exports file by creating temporary files containing assembler statements -and then assembling these. The \fB\-S\fR command line option can be -used to specify the path to the assembler that dlltool will use, -and the \fB\-f\fR option can be used to pass specific flags to that -assembler. The \fB\-n\fR can be used to prevent dlltool from deleting -these temporary assembler files when it is done, and if \fB\-n\fR is -specified twice then this will prevent dlltool from deleting the -temporary object files it used to build the library. -.PP -Here is an example of creating a \s-1DLL\s0 from a source file \fBdll.c\fR and -also creating a program (from an object file called \fBprogram.o\fR) -that uses that \s-1DLL:\s0 -.PP -.Vb 4 -\& 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 -.Ve -.PP -\&\fBdlltool\fR may also be used to query an existing import library -to determine the name of the \s-1DLL\s0 to which it is associated. See the -description of the \fB\-I\fR or \fB\-\-identify\fR option. -.SH "OPTIONS" -.IX Header "OPTIONS" -The command line options have the following meanings: -.IP "\fB\-d\fR \fIfilename\fR" 4 -.IX Item "-d filename" -.PD 0 -.IP "\fB\-\-input\-def\fR \fIfilename\fR" 4 -.IX Item "--input-def filename" -.PD -Specifies the name of a \fI.def\fR file to be read in and processed. -.IP "\fB\-b\fR \fIfilename\fR" 4 -.IX Item "-b filename" -.PD 0 -.IP "\fB\-\-base\-file\fR \fIfilename\fR" 4 -.IX Item "--base-file filename" -.PD -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. -.IP "\fB\-e\fR \fIfilename\fR" 4 -.IX Item "-e filename" -.PD 0 -.IP "\fB\-\-output\-exp\fR \fIfilename\fR" 4 -.IX Item "--output-exp filename" -.PD -Specifies the name of the export file to be created by dlltool. -.IP "\fB\-z\fR \fIfilename\fR" 4 -.IX Item "-z filename" -.PD 0 -.IP "\fB\-\-output\-def\fR \fIfilename\fR" 4 -.IX Item "--output-def filename" -.PD -Specifies the name of the \fI.def\fR file to be created by dlltool. -.IP "\fB\-l\fR \fIfilename\fR" 4 -.IX Item "-l filename" -.PD 0 -.IP "\fB\-\-output\-lib\fR \fIfilename\fR" 4 -.IX Item "--output-lib filename" -.PD -Specifies the name of the library file to be created by dlltool. -.IP "\fB\-y\fR \fIfilename\fR" 4 -.IX Item "-y filename" -.PD 0 -.IP "\fB\-\-output\-delaylib\fR \fIfilename\fR" 4 -.IX Item "--output-delaylib filename" -.PD -Specifies the name of the delay-import library file to be created by dlltool. -.IP "\fB\-\-export\-all\-symbols\fR" 4 -.IX 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 \fB\-\-no\-default\-excludes\fR -option. You may add to the list of symbols to not export by using the -\&\fB\-\-exclude\-symbols\fR option. -.IP "\fB\-\-no\-export\-all\-symbols\fR" 4 -.IX Item "--no-export-all-symbols" -Only export symbols explicitly listed in an input \fI.def\fR file or in -\&\fB.drectve\fR sections in the input object files. This is the default -behaviour. The \fB.drectve\fR sections are created by \fBdllexport\fR -attributes in the source code. -.IP "\fB\-\-exclude\-symbols\fR \fIlist\fR" 4 -.IX Item "--exclude-symbols list" -Do not export the symbols in \fIlist\fR. 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 -\&\fB\-\-export\-all\-symbols\fR is used. -.IP "\fB\-\-no\-default\-excludes\fR" 4 -.IX Item "--no-default-excludes" -When \fB\-\-export\-all\-symbols\fR is used, it will by default avoid -exporting certain special symbols. The current list of symbols to avoid -exporting is \fBDllMain@12\fR, \fBDllEntryPoint@0\fR, -\&\fBimpure_ptr\fR. You may use the \fB\-\-no\-default\-excludes\fR option -to go ahead and export these special symbols. This is only meaningful -when \fB\-\-export\-all\-symbols\fR is used. -.IP "\fB\-S\fR \fIpath\fR" 4 -.IX Item "-S path" -.PD 0 -.IP "\fB\-\-as\fR \fIpath\fR" 4 -.IX Item "--as path" -.PD -Specifies the path, including the filename, of the assembler to be used -to create the exports file. -.IP "\fB\-f\fR \fIoptions\fR" 4 -.IX Item "-f options" -.PD 0 -.IP "\fB\-\-as\-flags\fR \fIoptions\fR" 4 -.IX Item "--as-flags options" -.PD -Specifies any specific command line options to be passed to the -assembler when building the exports file. This option will work even if -the \fB\-S\fR 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 options to the assembler they should be enclosed in -double quotes. -.IP "\fB\-D\fR \fIname\fR" 4 -.IX Item "-D name" -.PD 0 -.IP "\fB\-\-dll\-name\fR \fIname\fR" 4 -.IX Item "--dll-name name" -.PD -Specifies the name to be stored in the \fI.def\fR file as the name of -the \s-1DLL\s0 when the \fB\-e\fR option is used. If this option is not -present, then the filename given to the \fB\-e\fR option will be -used as the name of the \s-1DLL\s0. -.IP "\fB\-m\fR \fImachine\fR" 4 -.IX Item "-m machine" -.PD 0 -.IP "\fB\-machine\fR \fImachine\fR" 4 -.IX Item "-machine machine" -.PD -Specifies the type of machine for which the library file should be -built. \fBdlltool\fR 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 \s-1ARM\s0 processor, when the -contents of the \s-1DLL\s0 are actually encode using Thumb instructions. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-add\-indirect\fR" 4 -.IX Item "--add-indirect" -.PD -Specifies that when \fBdlltool\fR 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! -.IP "\fB\-U\fR" 4 -.IX Item "-U" -.PD 0 -.IP "\fB\-\-add\-underscore\fR" 4 -.IX Item "--add-underscore" -.PD -Specifies that when \fBdlltool\fR is creating the exports file it -should prepend an underscore to the names of \fIall\fR exported symbols. -.IP "\fB\-\-no\-leading\-underscore\fR" 4 -.IX Item "--no-leading-underscore" -.PD 0 -.IP "\fB\-\-leading\-underscore\fR" 4 -.IX Item "--leading-underscore" -.PD -Specifies whether standard symbol should be forced to be prefixed, or -not. -.IP "\fB\-\-add\-stdcall\-underscore\fR" 4 -.IX Item "--add-stdcall-underscore" -Specifies that when \fBdlltool\fR is creating the exports file it -should prepend an underscore to the names of exported \fIstdcall\fR -functions. Variable names and non-stdcall function names are not modified. -This option is useful when creating GNU-compatible import libs for third -party DLLs that were built with MS-Windows tools. -.IP "\fB\-k\fR" 4 -.IX Item "-k" -.PD 0 -.IP "\fB\-\-kill\-at\fR" 4 -.IX Item "--kill-at" -.PD -Specifies that when \fBdlltool\fR is creating the exports file it -should not append the string \fB@ \fR. These numbers are -called ordinal numbers and they represent another way of accessing the -function in a \s-1DLL\s0, other than by name. -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-\-add\-stdcall\-alias\fR" 4 -.IX Item "--add-stdcall-alias" -.PD -Specifies that when \fBdlltool\fR is creating the exports file it -should add aliases for stdcall symbols without \fB@ \fR -in addition to the symbols with \fB@ \fR. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-ext\-prefix\-alias\fR \fIprefix\fR" 4 -.IX Item "--ext-prefix-alias prefix" -.PD -Causes \fBdlltool\fR to create external aliases for all \s-1DLL\s0 -imports with the specified prefix. The aliases are created for both -external and import symbols with no leading underscore. -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-no\-idata4\fR" 4 -.IX Item "--no-idata4" -.PD -Specifies that when \fBdlltool\fR is creating the exports and library -files it should omit the \f(CW\*(C`.idata4\*(C'\fR section. This is for compatibility -with certain operating systems. -.IP "\fB\-\-use\-nul\-prefixed\-import\-tables\fR" 4 -.IX Item "--use-nul-prefixed-import-tables" -Specifies that when \fBdlltool\fR is creating the exports and library -files it should prefix the \f(CW\*(C`.idata4\*(C'\fR and \f(CW\*(C`.idata5\*(C'\fR by zero an -element. This emulates old gnu import library generation of -\&\f(CW\*(C`dlltool\*(C'\fR. By default this option is turned off. -.IP "\fB\-c\fR" 4 -.IX Item "-c" -.PD 0 -.IP "\fB\-\-no\-idata5\fR" 4 -.IX Item "--no-idata5" -.PD -Specifies that when \fBdlltool\fR is creating the exports and library -files it should omit the \f(CW\*(C`.idata5\*(C'\fR section. This is for compatibility -with certain operating systems. -.IP "\fB\-I\fR \fIfilename\fR" 4 -.IX Item "-I filename" -.PD 0 -.IP "\fB\-\-identify\fR \fIfilename\fR" 4 -.IX Item "--identify filename" -.PD -Specifies that \fBdlltool\fR should inspect the import library -indicated by \fIfilename\fR and report, on \f(CW\*(C`stdout\*(C'\fR, the name(s) -of the associated \s-1DLL\s0(s). This can be performed in addition to any -other operations indicated by the other options and arguments. -\&\fBdlltool\fR fails if the import library does not exist or is not -actually an import library. See also \fB\-\-identify\-strict\fR. -.IP "\fB\-\-identify\-strict\fR" 4 -.IX Item "--identify-strict" -Modifies the behavior of the \fB\-\-identify\fR option, such -that an error is reported if \fIfilename\fR is associated with -more than one \s-1DLL\s0. -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-interwork\fR" 4 -.IX Item "--interwork" -.PD -Specifies that \fBdlltool\fR should mark the objects in the library -file and exports file that it produces as supporting interworking -between \s-1ARM\s0 and Thumb code. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-\-nodelete\fR" 4 -.IX Item "--nodelete" -.PD -Makes \fBdlltool\fR 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. -.IP "\fB\-t\fR \fIprefix\fR" 4 -.IX Item "-t prefix" -.PD 0 -.IP "\fB\-\-temp\-prefix\fR \fIprefix\fR" 4 -.IX Item "--temp-prefix prefix" -.PD -Makes \fBdlltool\fR use \fIprefix\fR when constructing the names of -temporary assembler and object files. By default, the temp file prefix -is generated from the pid. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-verbose\fR" 4 -.IX Item "--verbose" -.PD -Make dlltool describe what it is doing. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Displays a list of command line options and then exits. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Displays dlltool's version number and then exits. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -The Info pages for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/elfedit.1 binutils-2.24/binutils/doc/elfedit.1 --- binutils-2.24.orig/binutils/doc/elfedit.1 2013-11-18 09:49:31.000000000 +0100 +++ binutils-2.24/binutils/doc/elfedit.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,233 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "ELFEDIT 1" -.TH ELFEDIT 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -elfedit \- Update the ELF header of ELF files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -elfedit [\fB\-\-input\-mach=\fR\fImachine\fR] - [\fB\-\-input\-type=\fR\fItype\fR] - [\fB\-\-input\-osabi=\fR\fIosabi\fR] - \fB\-\-output\-mach=\fR\fImachine\fR - \fB\-\-output\-type=\fR\fItype\fR - \fB\-\-output\-osabi=\fR\fIosabi\fR - [\fB\-v\fR|\fB\-\-version\fR] - [\fB\-h\fR|\fB\-\-help\fR] - \fIelffile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBelfedit\fR updates the \s-1ELF\s0 header of \s-1ELF\s0 files which have -the matching \s-1ELF\s0 machine and file types. The options control how and -which fields in the \s-1ELF\s0 header should be updated. -.PP -\&\fIelffile\fR... are the \s-1ELF\s0 files to be updated. 32\-bit and -64\-bit \s-1ELF\s0 files are supported, as are archives containing \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 of the \fB\-\-output\-mach\fR, -\&\fB\-\-output\-type\fR and \fB\-\-output\-osabi\fR options must be given. -.IP "\fB\-\-input\-mach=\fR\fImachine\fR" 4 -.IX Item "--input-mach=machine" -Set the matching input \s-1ELF\s0 machine type to \fImachine\fR. If -\&\fB\-\-input\-mach\fR isn't specified, it will match any \s-1ELF\s0 -machine types. -.Sp -The supported \s-1ELF\s0 machine types are, \fIL1OM\fR, \fIK1OM\fR and -\&\fIx86\-64\fR. -.IP "\fB\-\-output\-mach=\fR\fImachine\fR" 4 -.IX Item "--output-mach=machine" -Change the \s-1ELF\s0 machine type in the \s-1ELF\s0 header to \fImachine\fR. The -supported \s-1ELF\s0 machine types are the same as \fB\-\-input\-mach\fR. -.IP "\fB\-\-input\-type=\fR\fItype\fR" 4 -.IX Item "--input-type=type" -Set the matching input \s-1ELF\s0 file type to \fItype\fR. If -\&\fB\-\-input\-type\fR isn't specified, it will match any \s-1ELF\s0 file types. -.Sp -The supported \s-1ELF\s0 file types are, \fIrel\fR, \fIexec\fR and \fIdyn\fR. -.IP "\fB\-\-output\-type=\fR\fItype\fR" 4 -.IX Item "--output-type=type" -Change the \s-1ELF\s0 file type in the \s-1ELF\s0 header to \fItype\fR. The -supported \s-1ELF\s0 types are the same as \fB\-\-input\-type\fR. -.IP "\fB\-\-input\-osabi=\fR\fIosabi\fR" 4 -.IX Item "--input-osabi=osabi" -Set the matching input \s-1ELF\s0 file \s-1OSABI\s0 to \fIosabi\fR. If -\&\fB\-\-input\-osabi\fR isn't specified, it will match any \s-1ELF\s0 OSABIs. -.Sp -The supported \s-1ELF\s0 OSABIs are, \fInone\fR, \fI\s-1HPUX\s0\fR, \fINetBSD\fR, -\&\fI\s-1GNU\s0\fR, \fILinux\fR (alias for \fI\s-1GNU\s0\fR), -\&\fISolaris\fR, \fI\s-1AIX\s0\fR, \fIIrix\fR, -\&\fIFreeBSD\fR, \fI\s-1TRU64\s0\fR, \fIModesto\fR, \fIOpenBSD\fR, \fIOpenVMS\fR, -\&\fI\s-1NSK\s0\fR, \fI\s-1AROS\s0\fR and \fIFenixOS\fR. -.IP "\fB\-\-output\-osabi=\fR\fIosabi\fR" 4 -.IX Item "--output-osabi=osabi" -Change the \s-1ELF\s0 \s-1OSABI\s0 in the \s-1ELF\s0 header to \fIosabi\fR. The -supported \s-1ELF\s0 \s-1OSABI\s0 are the same as \fB\-\-input\-osabi\fR. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Display the version number of \fBelfedit\fR. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Display the command line options understood by \fBelfedit\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/nlmconv.1 binutils-2.24/binutils/doc/nlmconv.1 --- binutils-2.24.orig/binutils/doc/nlmconv.1 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/doc/nlmconv.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,242 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "NLMCONV 1" -.TH NLMCONV 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -nlmconv \- converts object code into an NLM. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -nlmconv [\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR] - [\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR] - [\fB\-T\fR \fIheaderfile\fR|\fB\-\-header\-file=\fR\fIheaderfile\fR] - [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-l\fR \fIlinker\fR|\fB\-\-linker=\fR\fIlinker\fR] - [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] - \fIinfile\fR \fIoutfile\fR -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBnlmconv\fR converts the relocatable \fBi386\fR object file -\&\fIinfile\fR into the NetWare Loadable Module \fIoutfile\fR, optionally -reading \fIheaderfile\fR for \s-1NLM\s0 header information. For instructions -on writing the \s-1NLM\s0 command file language used in header files, see the -\&\fBlinkers\fR section, \fB\s-1NLMLINK\s0\fR in particular, of the \fI\s-1NLM\s0 -Development and Tools Overview\fR, which is part of the \s-1NLM\s0 Software -Developer's Kit (\*(L"\s-1NLM\s0 \s-1SDK\s0\*(R"), available from Novell, Inc. -\&\fBnlmconv\fR uses the \s-1GNU\s0 Binary File Descriptor library to read -\&\fIinfile\fR; -.PP -\&\fBnlmconv\fR 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, \fBnlmconv\fR calls the linker for you. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-I\fR \fIbfdname\fR" 4 -.IX Item "-I bfdname" -.PD 0 -.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 -.IX Item "--input-target=bfdname" -.PD -Object format of the input file. \fBnlmconv\fR can usually determine -the format of a given file (so no default is necessary). -.IP "\fB\-O\fR \fIbfdname\fR" 4 -.IX Item "-O bfdname" -.PD 0 -.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4 -.IX Item "--output-target=bfdname" -.PD -Object format of the output file. \fBnlmconv\fR infers the output -format based on the input format, e.g. for a \fBi386\fR input file the -output format is \fBnlm32\-i386\fR. -.IP "\fB\-T\fR \fIheaderfile\fR" 4 -.IX Item "-T headerfile" -.PD 0 -.IP "\fB\-\-header\-file=\fR\fIheaderfile\fR" 4 -.IX Item "--header-file=headerfile" -.PD -Reads \fIheaderfile\fR for \s-1NLM\s0 header information. For instructions on -writing the \s-1NLM\s0 command file language used in header files, see see the -\&\fBlinkers\fR section, of the \fI\s-1NLM\s0 Development and Tools -Overview\fR, which is part of the \s-1NLM\s0 Software Developer's Kit, available -from Novell, Inc. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-\-debug\fR" 4 -.IX Item "--debug" -.PD -Displays (on standard error) the linker command line used by \fBnlmconv\fR. -.IP "\fB\-l\fR \fIlinker\fR" 4 -.IX Item "-l linker" -.PD 0 -.IP "\fB\-\-linker=\fR\fIlinker\fR" 4 -.IX Item "--linker=linker" -.PD -Use \fIlinker\fR for any linking. \fIlinker\fR can be an absolute or a -relative pathname. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Prints a usage summary. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Prints the version number for \fBnlmconv\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/nm.1 binutils-2.24/binutils/doc/nm.1 --- binutils-2.24.orig/binutils/doc/nm.1 2013-11-18 09:49:31.000000000 +0100 +++ binutils-2.24/binutils/doc/nm.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,530 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "NM 1" -.TH NM 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -nm \- list symbols from object files -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -nm [\fB\-A\fR|\fB\-o\fR|\fB\-\-print\-file\-name\fR] [\fB\-a\fR|\fB\-\-debug\-syms\fR] - [\fB\-B\fR|\fB\-\-format=bsd\fR] [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]] - [\fB\-D\fR|\fB\-\-dynamic\fR] [\fB\-f\fR\fIformat\fR|\fB\-\-format=\fR\fIformat\fR] - [\fB\-g\fR|\fB\-\-extern\-only\fR] [\fB\-h\fR|\fB\-\-help\fR] - [\fB\-l\fR|\fB\-\-line\-numbers\fR] [\fB\-n\fR|\fB\-v\fR|\fB\-\-numeric\-sort\fR] - [\fB\-P\fR|\fB\-\-portability\fR] [\fB\-p\fR|\fB\-\-no\-sort\fR] - [\fB\-r\fR|\fB\-\-reverse\-sort\fR] [\fB\-S\fR|\fB\-\-print\-size\fR] - [\fB\-s\fR|\fB\-\-print\-armap\fR] [\fB\-t\fR \fIradix\fR|\fB\-\-radix=\fR\fIradix\fR] - [\fB\-u\fR|\fB\-\-undefined\-only\fR] [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-X 32_64\fR] [\fB\-\-defined\-only\fR] [\fB\-\-no\-demangle\fR] - [\fB\-\-plugin\fR \fIname\fR] [\fB\-\-size\-sort\fR] [\fB\-\-special\-syms\fR] - [\fB\-\-synthetic\fR] [\fB\-\-target=\fR\fIbfdname\fR] - [\fIobjfile\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\s-1GNU\s0 \fBnm\fR lists the symbols from object files \fIobjfile\fR.... -If no object files are listed as arguments, \fBnm\fR assumes the file -\&\fIa.out\fR. -.PP -For each symbol, \fBnm\fR shows: -.IP "\(bu" 4 -The symbol value, in the radix selected by options (see below), or -hexadecimal by default. -.IP "\(bu" 4 -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 -usually local; if uppercase, the symbol is global (external). There -are however a few lowercase symbols that are shown for special global -symbols (\f(CW\*(C`u\*(C'\fR, \f(CW\*(C`v\*(C'\fR and \f(CW\*(C`w\*(C'\fR). -.RS 4 -.ie n .IP """A""" 4 -.el .IP "\f(CWA\fR" 4 -.IX Item "A" -The symbol's value is absolute, and will not be changed by further -linking. -.ie n .IP """B""" 4 -.el .IP "\f(CWB\fR" 4 -.IX Item "B" -.PD 0 -.ie n .IP """b""" 4 -.el .IP "\f(CWb\fR" 4 -.IX Item "b" -.PD -The symbol is in the uninitialized data section (known as \s-1BSS\s0). -.ie n .IP """C""" 4 -.el .IP "\f(CWC\fR" 4 -.IX 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. -.ie n .IP """D""" 4 -.el .IP "\f(CWD\fR" 4 -.IX Item "D" -.PD 0 -.ie n .IP """d""" 4 -.el .IP "\f(CWd\fR" 4 -.IX Item "d" -.PD -The symbol is in the initialized data section. -.ie n .IP """G""" 4 -.el .IP "\f(CWG\fR" 4 -.IX Item "G" -.PD 0 -.ie n .IP """g""" 4 -.el .IP "\f(CWg\fR" 4 -.IX Item "g" -.PD -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. -.ie n .IP """i""" 4 -.el .IP "\f(CWi\fR" 4 -.IX Item "i" -For \s-1PE\s0 format files this indicates that the symbol is in a section -specific to the implementation of DLLs. For \s-1ELF\s0 format files this -indicates that the symbol is an indirect function. This is a \s-1GNU\s0 -extension to the standard set of \s-1ELF\s0 symbol types. It indicates a -symbol which if referenced by a relocation does not evaluate to its -address, but instead must be invoked at runtime. The runtime -execution will then return the value to be used in the relocation. -.ie n .IP """I""" 4 -.el .IP "\f(CWI\fR" 4 -.IX Item "I" -The symbol is an indirect reference to another symbol. -.ie n .IP """N""" 4 -.el .IP "\f(CWN\fR" 4 -.IX Item "N" -The symbol is a debugging symbol. -.ie n .IP """p""" 4 -.el .IP "\f(CWp\fR" 4 -.IX Item "p" -The symbols is in a stack unwind section. -.ie n .IP """R""" 4 -.el .IP "\f(CWR\fR" 4 -.IX Item "R" -.PD 0 -.ie n .IP """r""" 4 -.el .IP "\f(CWr\fR" 4 -.IX Item "r" -.PD -The symbol is in a read only data section. -.ie n .IP """S""" 4 -.el .IP "\f(CWS\fR" 4 -.IX Item "S" -.PD 0 -.ie n .IP """s""" 4 -.el .IP "\f(CWs\fR" 4 -.IX Item "s" -.PD -The symbol is in an uninitialized data section for small objects. -.ie n .IP """T""" 4 -.el .IP "\f(CWT\fR" 4 -.IX Item "T" -.PD 0 -.ie n .IP """t""" 4 -.el .IP "\f(CWt\fR" 4 -.IX Item "t" -.PD -The symbol is in the text (code) section. -.ie n .IP """U""" 4 -.el .IP "\f(CWU\fR" 4 -.IX Item "U" -The symbol is undefined. -.ie n .IP """u""" 4 -.el .IP "\f(CWu\fR" 4 -.IX Item "u" -The symbol is a unique global symbol. This is a \s-1GNU\s0 extension to the -standard set of \s-1ELF\s0 symbol bindings. For such a symbol the dynamic linker -will make sure that in the entire process there is just one symbol with -this name and type in use. -.ie n .IP """V""" 4 -.el .IP "\f(CWV\fR" 4 -.IX Item "V" -.PD 0 -.ie n .IP """v""" 4 -.el .IP "\f(CWv\fR" 4 -.IX Item "v" -.PD -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. On some -systems, uppercase indicates that a default value has been specified. -.ie n .IP """W""" 4 -.el .IP "\f(CWW\fR" 4 -.IX Item "W" -.PD 0 -.ie n .IP """w""" 4 -.el .IP "\f(CWw\fR" 4 -.IX Item "w" -.PD -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 symbol is determined in a system-specific manner without -error. On some systems, uppercase indicates that a default value has been -specified. -.ie n .IP """\-""" 4 -.el .IP "\f(CW\-\fR" 4 -.IX 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. -.ie n .IP """?""" 4 -.el .IP "\f(CW?\fR" 4 -.IX Item "?" -The symbol type is unknown, or object file format specific. -.RE -.RS 4 -.RE -.IP "\(bu" 4 -The symbol name. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-o\fR" 4 -.IX Item "-o" -.IP "\fB\-\-print\-file\-name\fR" 4 -.IX Item "--print-file-name" -.PD -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. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-debug\-syms\fR" 4 -.IX Item "--debug-syms" -.PD -Display all symbols, even debugger-only symbols; normally these are not -listed. -.IP "\fB\-B\fR" 4 -.IX Item "-B" -The same as \fB\-\-format=bsd\fR (for compatibility with the \s-1MIPS\s0 \fBnm\fR). -.IP "\fB\-C\fR" 4 -.IX Item "-C" -.PD 0 -.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 -.IX Item "--demangle[=style]" -.PD -Decode (\fIdemangle\fR) 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. -.IP "\fB\-\-no\-demangle\fR" 4 -.IX Item "--no-demangle" -Do not demangle low-level symbol names. This is the default. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -.PD 0 -.IP "\fB\-\-dynamic\fR" 4 -.IX Item "--dynamic" -.PD -Display the dynamic symbols rather than the normal symbols. This is -only meaningful for dynamic objects, such as certain types of shared -libraries. -.IP "\fB\-f\fR \fIformat\fR" 4 -.IX Item "-f format" -.PD 0 -.IP "\fB\-\-format=\fR\fIformat\fR" 4 -.IX Item "--format=format" -.PD -Use the output format \fIformat\fR, which can be \f(CW\*(C`bsd\*(C'\fR, -\&\f(CW\*(C`sysv\*(C'\fR, or \f(CW\*(C`posix\*(C'\fR. The default is \f(CW\*(C`bsd\*(C'\fR. -Only the first character of \fIformat\fR is significant; it can be -either upper or lower case. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-extern\-only\fR" 4 -.IX Item "--extern-only" -.PD -Display only external symbols. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Show a summary of the options to \fBnm\fR and exit. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -.PD 0 -.IP "\fB\-\-line\-numbers\fR" 4 -.IX Item "--line-numbers" -.PD -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. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.IP "\fB\-\-numeric\-sort\fR" 4 -.IX Item "--numeric-sort" -.PD -Sort symbols numerically by their addresses, rather than alphabetically -by their names. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-no\-sort\fR" 4 -.IX Item "--no-sort" -.PD -Do not bother to sort the symbols in any order; print them in the order -encountered. -.IP "\fB\-P\fR" 4 -.IX Item "-P" -.PD 0 -.IP "\fB\-\-portability\fR" 4 -.IX Item "--portability" -.PD -Use the \s-1POSIX\s0.2 standard output format instead of the default format. -Equivalent to \fB\-f posix\fR. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -.PD 0 -.IP "\fB\-\-reverse\-sort\fR" 4 -.IX Item "--reverse-sort" -.PD -Reverse the order of the sort (whether numeric or alphabetic); let the -last come first. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-print\-size\fR" 4 -.IX Item "--print-size" -.PD -Print both value and size of defined symbols for the \f(CW\*(C`bsd\*(C'\fR output style. -This option has no effect for object formats that do not record symbol -sizes, unless \fB\-\-size\-sort\fR is also used in which case a -calculated size is displayed. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-print\-armap\fR" 4 -.IX Item "--print-armap" -.PD -When listing symbols from archive members, include the index: a mapping -(stored in the archive by \fBar\fR or \fBranlib\fR) of which modules -contain definitions for which names. -.IP "\fB\-t\fR \fIradix\fR" 4 -.IX Item "-t radix" -.PD 0 -.IP "\fB\-\-radix=\fR\fIradix\fR" 4 -.IX Item "--radix=radix" -.PD -Use \fIradix\fR as the radix for printing the symbol values. It must be -\&\fBd\fR for decimal, \fBo\fR for octal, or \fBx\fR for hexadecimal. -.IP "\fB\-u\fR" 4 -.IX Item "-u" -.PD 0 -.IP "\fB\-\-undefined\-only\fR" 4 -.IX Item "--undefined-only" -.PD -Display only undefined symbols (those external to each object file). -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number of \fBnm\fR and exit. -.IP "\fB\-X\fR" 4 -.IX Item "-X" -This option is ignored for compatibility with the \s-1AIX\s0 version of -\&\fBnm\fR. It takes one parameter which must be the string -\&\fB32_64\fR. The default mode of \s-1AIX\s0 \fBnm\fR corresponds -to \fB\-X 32\fR, which is not supported by \s-1GNU\s0 \fBnm\fR. -.IP "\fB\-\-defined\-only\fR" 4 -.IX Item "--defined-only" -Display only defined symbols for each object file. -.IP "\fB\-\-plugin\fR \fIname\fR" 4 -.IX Item "--plugin name" -Load the plugin called \fIname\fR to add support for extra target -types. This option is only available if the toolchain has been built -with plugin support enabled. -.IP "\fB\-\-size\-sort\fR" 4 -.IX 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. If the \f(CW\*(C`bsd\*(C'\fR output format is used the size of the symbol -is printed, rather than the value, and \fB\-S\fR must be used in order -both size and value to be printed. -.IP "\fB\-\-special\-syms\fR" 4 -.IX Item "--special-syms" -Display symbols which have a target-specific special meaning. These -symbols are usually used by the target for some special processing and -are not normally helpful when included in the normal symbol lists. -For example for \s-1ARM\s0 targets this option would skip the mapping symbols -used to mark transitions between \s-1ARM\s0 code, \s-1THUMB\s0 code and data. -.IP "\fB\-\-synthetic\fR" 4 -.IX Item "--synthetic" -Include synthetic symbols in the output. These are special symbols -created by the linker for various purposes. They are not shown by -default since they are not part of the binary's original source code. -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -Specify an object code format other than your system's default format. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/objcopy.1 binutils-2.24/binutils/doc/objcopy.1 --- binutils-2.24.orig/binutils/doc/objcopy.1 2013-11-18 09:49:31.000000000 +0100 +++ binutils-2.24/binutils/doc/objcopy.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,1012 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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" -.TH OBJCOPY 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -objcopy \- copy and translate object files -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -objcopy [\fB\-F\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR] - [\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR] - [\fB\-B\fR \fIbfdarch\fR|\fB\-\-binary\-architecture=\fR\fIbfdarch\fR] - [\fB\-S\fR|\fB\-\-strip\-all\fR] - [\fB\-g\fR|\fB\-\-strip\-debug\fR] - [\fB\-K\fR \fIsymbolname\fR|\fB\-\-keep\-symbol=\fR\fIsymbolname\fR] - [\fB\-N\fR \fIsymbolname\fR|\fB\-\-strip\-symbol=\fR\fIsymbolname\fR] - [\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR] - [\fB\-G\fR \fIsymbolname\fR|\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR] - [\fB\-\-localize\-hidden\fR] - [\fB\-L\fR \fIsymbolname\fR|\fB\-\-localize\-symbol=\fR\fIsymbolname\fR] - [\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR] - [\fB\-W\fR \fIsymbolname\fR|\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR] - [\fB\-w\fR|\fB\-\-wildcard\fR] - [\fB\-x\fR|\fB\-\-discard\-all\fR] - [\fB\-X\fR|\fB\-\-discard\-locals\fR] - [\fB\-b\fR \fIbyte\fR|\fB\-\-byte=\fR\fIbyte\fR] - [\fB\-i\fR [\fIbreadth\fR]|\fB\-\-interleave\fR[=\fIbreadth\fR]] - [\fB\-\-interleave\-width=\fR\fIwidth\fR] - [\fB\-j\fR \fIsectionpattern\fR|\fB\-\-only\-section=\fR\fIsectionpattern\fR] - [\fB\-R\fR \fIsectionpattern\fR|\fB\-\-remove\-section=\fR\fIsectionpattern\fR] - [\fB\-p\fR|\fB\-\-preserve\-dates\fR] - [\fB\-D\fR|\fB\-\-enable\-deterministic\-archives\fR] - [\fB\-U\fR|\fB\-\-disable\-deterministic\-archives\fR] - [\fB\-\-debugging\fR] - [\fB\-\-gap\-fill=\fR\fIval\fR] - [\fB\-\-pad\-to=\fR\fIaddress\fR] - [\fB\-\-set\-start=\fR\fIval\fR] - [\fB\-\-adjust\-start=\fR\fIincr\fR] - [\fB\-\-change\-addresses=\fR\fIincr\fR] - [\fB\-\-change\-section\-address\fR \fIsectionpattern\fR{=,+,\-}\fIval\fR] - [\fB\-\-change\-section\-lma\fR \fIsectionpattern\fR{=,+,\-}\fIval\fR] - [\fB\-\-change\-section\-vma\fR \fIsectionpattern\fR{=,+,\-}\fIval\fR] - [\fB\-\-change\-warnings\fR] [\fB\-\-no\-change\-warnings\fR] - [\fB\-\-set\-section\-flags\fR \fIsectionpattern\fR=\fIflags\fR] - [\fB\-\-add\-section\fR \fIsectionname\fR=\fIfilename\fR] - [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR[,\fIflags\fR]] - [\fB\-\-long\-section\-names\fR {enable,disable,keep}] - [\fB\-\-change\-leading\-char\fR] [\fB\-\-remove\-leading\-char\fR] - [\fB\-\-reverse\-bytes=\fR\fInum\fR] - [\fB\-\-srec\-len=\fR\fIival\fR] [\fB\-\-srec\-forceS3\fR] - [\fB\-\-redefine\-sym\fR \fIold\fR=\fInew\fR] - [\fB\-\-redefine\-syms=\fR\fIfilename\fR] - [\fB\-\-weaken\fR] - [\fB\-\-keep\-symbols=\fR\fIfilename\fR] - [\fB\-\-strip\-symbols=\fR\fIfilename\fR] - [\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR] - [\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR] - [\fB\-\-localize\-symbols=\fR\fIfilename\fR] - [\fB\-\-globalize\-symbols=\fR\fIfilename\fR] - [\fB\-\-weaken\-symbols=\fR\fIfilename\fR] - [\fB\-\-alt\-machine\-code=\fR\fIindex\fR] - [\fB\-\-prefix\-symbols=\fR\fIstring\fR] - [\fB\-\-prefix\-sections=\fR\fIstring\fR] - [\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR] - [\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR] - [\fB\-\-keep\-file\-symbols\fR] - [\fB\-\-only\-keep\-debug\fR] - [\fB\-\-strip\-dwo\fR] - [\fB\-\-extract\-dwo\fR] - [\fB\-\-extract\-symbol\fR] - [\fB\-\-writable\-text\fR] - [\fB\-\-readonly\-text\fR] - [\fB\-\-pure\fR] - [\fB\-\-impure\fR] - [\fB\-\-file\-alignment=\fR\fInum\fR] - [\fB\-\-heap=\fR\fIsize\fR] - [\fB\-\-image\-base=\fR\fIaddress\fR] - [\fB\-\-section\-alignment=\fR\fInum\fR] - [\fB\-\-stack=\fR\fIsize\fR] - [\fB\-\-subsystem=\fR\fIwhich\fR:\fImajor\fR.\fIminor\fR] - [\fB\-\-compress\-debug\-sections\fR] - [\fB\-\-decompress\-debug\-sections\fR] - [\fB\-\-dwarf\-depth=\fR\fIn\fR] - [\fB\-\-dwarf\-start=\fR\fIn\fR] - [\fB\-v\fR|\fB\-\-verbose\fR] - [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-\-help\fR] [\fB\-\-info\fR] - \fIinfile\fR [\fIoutfile\fR] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \s-1GNU\s0 \fBobjcopy\fR utility copies the contents of an object -file to another. \fBobjcopy\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 \fBobjcopy\fR is controlled by command-line options. -Note that \fBobjcopy\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 -\&\fBobjcopy\fR creates temporary files to do its translations and -deletes them afterward. \fBobjcopy\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 -\&\fBobjcopy\fR can be used to generate S\-records by using an output -target of \fBsrec\fR (e.g., use \fB\-O srec\fR). -.PP -\&\fBobjcopy\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 -\&\fBobjcopy\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\-\-\-\fBobjcopy\fR is not able to change the endianness of its input -files. If the input format has an endianness (some formats do not), -\&\fBobjcopy\fR can only copy the inputs into file formats that have the -same endianness or which have no endianness (e.g., \fBsrec\fR). -(However, see the \fB\-\-reverse\-bytes\fR option.) -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fIinfile\fR" 4 -.IX Item "infile" -.PD 0 -.IP "\fIoutfile\fR" 4 -.IX Item "outfile" -.PD -The input and output files, respectively. -If you do not specify \fIoutfile\fR, \fBobjcopy\fR creates a -temporary file and destructively renames the result with -the name of \fIinfile\fR. -.IP "\fB\-I\fR \fIbfdname\fR" 4 -.IX Item "-I bfdname" -.PD 0 -.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 -.IX Item "--input-target=bfdname" -.PD -Consider the source file's object format to be \fIbfdname\fR, rather than -attempting to deduce it. -.IP "\fB\-O\fR \fIbfdname\fR" 4 -.IX Item "-O bfdname" -.PD 0 -.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4 -.IX Item "--output-target=bfdname" -.PD -Write the output file using the object format \fIbfdname\fR. -.IP "\fB\-F\fR \fIbfdname\fR" 4 -.IX Item "-F bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -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 "\fB\-B\fR \fIbfdarch\fR" 4 -.IX Item "-B bfdarch" -.PD 0 -.IP "\fB\-\-binary\-architecture=\fR\fIbfdarch\fR" 4 -.IX Item "--binary-architecture=bfdarch" -.PD -Useful when transforming a architecture-less 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 "\fB\-j\fR \fIsectionpattern\fR" 4 -.IX Item "-j sectionpattern" -.PD 0 -.IP "\fB\-\-only\-section=\fR\fIsectionpattern\fR" 4 -.IX Item "--only-section=sectionpattern" -.PD -Copy only the indicated sections 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. Wildcard -characters are accepted in \fIsectionpattern\fR. -.IP "\fB\-R\fR \fIsectionpattern\fR" 4 -.IX Item "-R sectionpattern" -.PD 0 -.IP "\fB\-\-remove\-section=\fR\fIsectionpattern\fR" 4 -.IX Item "--remove-section=sectionpattern" -.PD -Remove any section matching \fIsectionpattern\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. Wildcard -characters are accepted in \fIsectionpattern\fR. Using both the -\&\fB\-j\fR and \fB\-R\fR options together results in undefined -behaviour. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-strip\-all\fR" 4 -.IX Item "--strip-all" -.PD -Do not copy relocation and symbol information from the source file. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-strip\-debug\fR" 4 -.IX Item "--strip-debug" -.PD -Do not copy debugging symbols or sections from the source file. -.IP "\fB\-\-strip\-unneeded\fR" 4 -.IX Item "--strip-unneeded" -Strip all symbols that are not needed for relocation processing. -.IP "\fB\-K\fR \fIsymbolname\fR" 4 -.IX Item "-K symbolname" -.PD 0 -.IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--keep-symbol=symbolname" -.PD -When stripping symbols, keep symbol \fIsymbolname\fR even if it would -normally be stripped. This option may be given more than once. -.IP "\fB\-N\fR \fIsymbolname\fR" 4 -.IX Item "-N symbolname" -.PD 0 -.IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--strip-symbol=symbolname" -.PD -Do not copy symbol \fIsymbolname\fR from the source file. This option -may be given more than once. -.IP "\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--strip-unneeded-symbol=symbolname" -Do not copy symbol \fIsymbolname\fR from the source file unless it is needed -by a relocation. This option may be given more than once. -.IP "\fB\-G\fR \fIsymbolname\fR" 4 -.IX Item "-G symbolname" -.PD 0 -.IP "\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--keep-global-symbol=symbolname" -.PD -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 "\fB\-\-localize\-hidden\fR" 4 -.IX Item "--localize-hidden" -In an \s-1ELF\s0 object, mark all symbols that have hidden or internal visibility -as local. This option applies on top of symbol-specific localization options -such as \fB\-L\fR. -.IP "\fB\-L\fR \fIsymbolname\fR" 4 -.IX Item "-L symbolname" -.PD 0 -.IP "\fB\-\-localize\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--localize-symbol=symbolname" -.PD -Make symbol \fIsymbolname\fR local to the file, so that it is not -visible externally. This option may be given more than once. -.IP "\fB\-W\fR \fIsymbolname\fR" 4 -.IX Item "-W symbolname" -.PD 0 -.IP "\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--weaken-symbol=symbolname" -.PD -Make symbol \fIsymbolname\fR weak. This option may be given more than once. -.IP "\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--globalize-symbol=symbolname" -Give symbol \fIsymbolname\fR global scoping so that it is visible -outside of the file in which it is defined. This option may be given -more than once. -.IP "\fB\-w\fR" 4 -.IX Item "-w" -.PD 0 -.IP "\fB\-\-wildcard\fR" 4 -.IX Item "--wildcard" -.PD -Permit regular expressions in \fIsymbolname\fRs used in other command -line options. The question mark (?), asterisk (*), backslash (\e) and -square brackets ([]) operators can be used anywhere in the symbol -name. If the first character of the symbol name is the exclamation -point (!) then the sense of the switch is reversed for that symbol. -For example: -.Sp -.Vb 1 -\& \-w \-W !foo \-W fo* -.Ve -.Sp -would cause objcopy to weaken all symbols that start with \*(L"fo\*(R" -except for the symbol \*(L"foo\*(R". -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-discard\-all\fR" 4 -.IX Item "--discard-all" -.PD -Do not copy non-global symbols from the source file. -.IP "\fB\-X\fR" 4 -.IX Item "-X" -.PD 0 -.IP "\fB\-\-discard\-locals\fR" 4 -.IX Item "--discard-locals" -.PD -Do not copy compiler-generated local symbols. -(These usually start with \fBL\fR or \fB.\fR.) -.IP "\fB\-b\fR \fIbyte\fR" 4 -.IX Item "-b byte" -.PD 0 -.IP "\fB\-\-byte=\fR\fIbyte\fR" 4 -.IX Item "--byte=byte" -.PD -If interleaving has been enabled via the \fB\-\-interleave\fR option -then start the range of bytes to keep at the \fIbyte\fRth byte. -\&\fIbyte\fR can be in the range from 0 to \fIbreadth\fR\-1, where -\&\fIbreadth\fR is the value given by the \fB\-\-interleave\fR option. -.IP "\fB\-i [\fR\fIbreadth\fR\fB]\fR" 4 -.IX Item "-i [breadth]" -.PD 0 -.IP "\fB\-\-interleave[=\fR\fIbreadth\fR\fB]\fR" 4 -.IX Item "--interleave[=breadth]" -.PD -Only copy a range out of every \fIbreadth\fR bytes. (Header data is -not affected). Select which byte in the range begins the copy with -the \fB\-\-byte\fR option. Select the width of the range with the -\&\fB\-\-interleave\-width\fR option. -.Sp -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. Note that -\&\fBobjcopy\fR will complain if you do not specify the -\&\fB\-\-byte\fR option as well. -.Sp -The default interleave breadth is 4, so with \fB\-\-byte\fR set to 0, -\&\fBobjcopy\fR would copy the first byte out of every four bytes -from the input to the output. -.IP "\fB\-\-interleave\-width=\fR\fIwidth\fR" 4 -.IX Item "--interleave-width=width" -When used with the \fB\-\-interleave\fR option, copy \fIwidth\fR -bytes at a time. The start of the range of bytes to be copied is set -by the \fB\-\-byte\fR option, and the extent of the range is set with -the \fB\-\-interleave\fR option. -.Sp -The default value for this option is 1. The value of \fIwidth\fR plus -the \fIbyte\fR value set by the \fB\-\-byte\fR option must not exceed -the interleave breadth set by the \fB\-\-interleave\fR option. -.Sp -This option can be used to create images for two 16\-bit flashes interleaved -in a 32\-bit bus by passing \fB\-b 0 \-i 4 \-\-interleave\-width=2\fR -and \fB\-b 2 \-i 4 \-\-interleave\-width=2\fR to two \fBobjcopy\fR -commands. If the input was '12345678' then the outputs would be -\&'1256' and '3478' respectively. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-preserve\-dates\fR" 4 -.IX Item "--preserve-dates" -.PD -Set the access and modification dates of the output file to be the same -as those of the input file. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -.PD 0 -.IP "\fB\-\-enable\-deterministic\-archives\fR" 4 -.IX Item "--enable-deterministic-archives" -.PD -Operate in \fIdeterministic\fR mode. When copying archive members -and writing the archive index, use zero for UIDs, GIDs, timestamps, -and use consistent file modes for all files. -.Sp -If \fIbinutils\fR was configured with -\&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by default. -It can be disabled with the \fB\-U\fR option, below. -.IP "\fB\-U\fR" 4 -.IX Item "-U" -.PD 0 -.IP "\fB\-\-disable\-deterministic\-archives\fR" 4 -.IX Item "--disable-deterministic-archives" -.PD -Do \fInot\fR operate in \fIdeterministic\fR mode. This is the -inverse of the \fB\-D\fR option, above: when copying archive members -and writing the archive index, use their actual \s-1UID\s0, \s-1GID\s0, timestamp, -and file mode values. -.Sp -This is the default unless \fIbinutils\fR was configured with -\&\fB\-\-enable\-deterministic\-archives\fR. -.IP "\fB\-\-debugging\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 "\fB\-\-gap\-fill\fR \fIval\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 "\fB\-\-pad\-to\fR \fIaddress\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 "\fB\-\-set\-start\fR \fIval\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 "\fB\-\-change\-start\fR \fIincr\fR" 4 -.IX Item "--change-start incr" -.PD 0 -.IP "\fB\-\-adjust\-start\fR \fIincr\fR" 4 -.IX Item "--adjust-start incr" -.PD -Change the start address by adding \fIincr\fR. Not all object file -formats support setting the start address. -.IP "\fB\-\-change\-addresses\fR \fIincr\fR" 4 -.IX Item "--change-addresses incr" -.PD 0 -.IP "\fB\-\-adjust\-vma\fR \fIincr\fR" 4 -.IX Item "--adjust-vma incr" -.PD -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 "\fB\-\-change\-section\-address\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--change-section-address sectionpattern{=,+,-}val" -.PD 0 -.IP "\fB\-\-adjust\-section\-vma\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--adjust-section-vma sectionpattern{=,+,-}val" -.PD -Set or change both the \s-1VMA\s0 address and the \s-1LMA\s0 address of any section -matching \fIsectionpattern\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 \fIsectionpattern\fR does not -match any sections in the input file, a warning will be issued, unless -\&\fB\-\-no\-change\-warnings\fR is used. -.IP "\fB\-\-change\-section\-lma\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--change-section-lma sectionpattern{=,+,-}val" -Set or change the \s-1LMA\s0 address of any sections matching -\&\fIsectionpattern\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 -\&\fIsectionpattern\fR does not match any sections in the input file, a -warning will be issued, unless \fB\-\-no\-change\-warnings\fR is used. -.IP "\fB\-\-change\-section\-vma\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--change-section-vma sectionpattern{=,+,-}val" -Set or change the \s-1VMA\s0 address of any section matching -\&\fIsectionpattern\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 \fIsectionpattern\fR does not match any sections in the -input file, a warning will be issued, unless -\&\fB\-\-no\-change\-warnings\fR is used. -.IP "\fB\-\-change\-warnings\fR" 4 -.IX Item "--change-warnings" -.PD 0 -.IP "\fB\-\-adjust\-warnings\fR" 4 -.IX Item "--adjust-warnings" -.PD -If \fB\-\-change\-section\-address\fR or \fB\-\-change\-section\-lma\fR or -\&\fB\-\-change\-section\-vma\fR is used, and the section pattern does not -match any sections, issue a warning. This is the default. -.IP "\fB\-\-no\-change\-warnings\fR" 4 -.IX Item "--no-change-warnings" -.PD 0 -.IP "\fB\-\-no\-adjust\-warnings\fR" 4 -.IX Item "--no-adjust-warnings" -.PD -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 section pattern does not match any sections. -.IP "\fB\-\-set\-section\-flags\fR \fIsectionpattern\fR\fB=\fR\fIflags\fR" 4 -.IX Item "--set-section-flags sectionpattern=flags" -Set the flags for any sections matching \fIsectionpattern\fR. 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 "\fB\-\-add\-section\fR \fIsectionname\fR\fB=\fR\fIfilename\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 "\fB\-\-rename\-section\fR \fIoldname\fR\fB=\fR\fInewname\fR\fB[,\fR\fIflags\fR\fB]\fR" 4 -.IX Item "--rename-section oldname=newname[,flags]" -Rename a section from \fIoldname\fR to \fInewname\fR, optionally -changing the section's flags to \fIflags\fR in the process. This has -the advantage over usng a linker script to perform the rename in that -the output stays as an object file and does not become a linked -executable. -.Sp -This option is particularly helpful when the input format is binary, -since this will always create a section called .data. If for example, -you wanted instead to create a section called .rodata containing binary -data you could use the following command line to achieve it: -.Sp -.Vb 3 -\& objcopy \-I binary \-O \-B \e -\& \-\-rename\-section .data=.rodata,alloc,load,readonly,data,contents \e -\& -.Ve -.IP "\fB\-\-long\-section\-names {enable,disable,keep}\fR" 4 -.IX Item "--long-section-names {enable,disable,keep}" -Controls the handling of long section names when processing \f(CW\*(C`COFF\*(C'\fR -and \f(CW\*(C`PE\-COFF\*(C'\fR object formats. The default behaviour, \fBkeep\fR, -is to preserve long section names if any are present in the input file. -The \fBenable\fR and \fBdisable\fR options forcibly enable or disable -the use of long section names in the output object; when \fBdisable\fR -is in effect, any long section names in the input object will be truncated. -The \fBenable\fR option will only emit long section names if any are -present in the inputs; this is mostly the same as \fBkeep\fR, but it -is left undefined whether the \fBenable\fR option might force the -creation of an empty string table in the output file. -.IP "\fB\-\-change\-leading\-char\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 \fBobjcopy\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 "\fB\-\-remove\-leading\-char\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 -\&\fB\-\-change\-leading\-char\fR because it always changes the symbol name -when appropriate, regardless of the object file format of the output -file. -.IP "\fB\-\-reverse\-bytes=\fR\fInum\fR" 4 -.IX Item "--reverse-bytes=num" -Reverse the bytes in a section with output contents. A section length must -be evenly divisible by the value given in order for the swap to be able to -take place. Reversing takes place before the interleaving is performed. -.Sp -This option is used typically in generating \s-1ROM\s0 images for problematic -target systems. For example, on some target boards, the 32\-bit words -fetched from 8\-bit ROMs are re-assembled in little-endian byte order -regardless of the \s-1CPU\s0 byte order. Depending on the programming model, the -endianness of the \s-1ROM\s0 may need to be modified. -.Sp -Consider a simple file with a section containing the following eight -bytes: \f(CW12345678\fR. -.Sp -Using \fB\-\-reverse\-bytes=2\fR for the above example, the bytes in the -output file would be ordered \f(CW21436587\fR. -.Sp -Using \fB\-\-reverse\-bytes=4\fR for the above example, the bytes in the -output file would be ordered \f(CW43218765\fR. -.Sp -By using \fB\-\-reverse\-bytes=2\fR for the above example, followed by -\&\fB\-\-reverse\-bytes=4\fR on the output file, the bytes in the second -output file would be ordered \f(CW34127856\fR. -.IP "\fB\-\-srec\-len=\fR\fIival\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 "\fB\-\-srec\-forceS3\fR" 4 -.IX Item "--srec-forceS3" -Meaningful only for srec output. Avoid generation of S1/S2 records, -creating S3\-only record format. -.IP "\fB\-\-redefine\-sym\fR \fIold\fR\fB=\fR\fInew\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 "\fB\-\-redefine\-syms=\fR\fIfilename\fR" 4 -.IX Item "--redefine-syms=filename" -Apply \fB\-\-redefine\-sym\fR to each symbol pair "\fIold\fR \fInew\fR" -listed in the file \fIfilename\fR. \fIfilename\fR is simply a flat file, -with one symbol pair per line. Line comments may be introduced by the hash -character. This option may be given more than once. -.IP "\fB\-\-weaken\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 \fB\-R\fR option to the linker. This option is only effective when -using an object file format which supports weak symbols. -.IP "\fB\-\-keep\-symbols=\fR\fIfilename\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 "\fB\-\-strip\-symbols=\fR\fIfilename\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 "\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--strip-unneeded-symbols=filename" -Apply \fB\-\-strip\-unneeded\-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 "\fB\-\-keep\-global\-symbols=\fR\fIfilename\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 "\fB\-\-localize\-symbols=\fR\fIfilename\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 "\fB\-\-globalize\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--globalize-symbols=filename" -Apply \fB\-\-globalize\-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 "\fB\-\-weaken\-symbols=\fR\fIfilename\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 "\fB\-\-alt\-machine\-code=\fR\fIindex\fR" 4 -.IX Item "--alt-machine-code=index" -If the output architecture has alternate machine codes, use the -\&\fIindex\fRth code instead of the default one. This is useful in case -a machine is assigned an official code and the tool-chain adopts the -new code, but other applications still depend on the original code -being used. For \s-1ELF\s0 based architectures if the \fIindex\fR -alternative does not exist then the value is treated as an absolute -number to be stored in the e_machine field of the \s-1ELF\s0 header. -.IP "\fB\-\-writable\-text\fR" 4 -.IX Item "--writable-text" -Mark the output text as writable. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-readonly\-text\fR" 4 -.IX Item "--readonly-text" -Make the output text write protected. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-pure\fR" 4 -.IX Item "--pure" -Mark the output file as demand paged. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-impure\fR" 4 -.IX Item "--impure" -Mark the output file as impure. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-prefix\-symbols=\fR\fIstring\fR" 4 -.IX Item "--prefix-symbols=string" -Prefix all symbols in the output file with \fIstring\fR. -.IP "\fB\-\-prefix\-sections=\fR\fIstring\fR" 4 -.IX Item "--prefix-sections=string" -Prefix all section names in the output file with \fIstring\fR. -.IP "\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR" 4 -.IX Item "--prefix-alloc-sections=string" -Prefix all the names of all allocated sections in the output file with -\&\fIstring\fR. -.IP "\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR" 4 -.IX Item "--add-gnu-debuglink=path-to-file" -Creates a .gnu_debuglink section which contains a reference to \fIpath-to-file\fR -and adds it to the output file. -.IP "\fB\-\-keep\-file\-symbols\fR" 4 -.IX Item "--keep-file-symbols" -When stripping a file, perhaps with \fB\-\-strip\-debug\fR or -\&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names, -which would otherwise get stripped. -.IP "\fB\-\-only\-keep\-debug\fR" 4 -.IX Item "--only-keep-debug" -Strip a file, removing contents of any sections that would not be -stripped by \fB\-\-strip\-debug\fR and leaving the debugging sections -intact. In \s-1ELF\s0 files, this preserves all note sections in the output. -.Sp -The intention is that this option will be used in conjunction with -\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a -stripped binary which will occupy less space in \s-1RAM\s0 and in a -distribution and the second a debugging information file which is only -needed if debugging abilities are required. The suggested procedure -to create these files is as follows: -.RS 4 -.IP "1." 4 -.IX Item "1." -\&\f(CW\*(C`foo\*(C'\fR then... -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -create a file containing the debugging info. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -stripped executable. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -to add a link to the debugging info into the stripped executable. -.RE -.RS 4 -.Sp -Note\-\-\-the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info -file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is -optional. You could instead do this: -.IP "1." 4 -.IX Item "1." -.PD 0 -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.RE -.RS 4 -.PD -.Sp -i.e., the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the -full executable. It does not have to be a file created by the -\&\fB\-\-only\-keep\-debug\fR switch. -.Sp -Note\-\-\-this switch is only intended for use on fully linked files. It -does not make sense to use it on object files where the debugging -information may be incomplete. Besides the gnu_debuglink feature -currently only supports the presence of one filename containing -debugging information, not multiple filenames on a one-per-object-file -basis. -.RE -.IP "\fB\-\-strip\-dwo\fR" 4 -.IX Item "--strip-dwo" -Remove the contents of all \s-1DWARF\s0 .dwo sections, leaving the -remaining debugging sections and all symbols intact. -This option is intended for use by the compiler as part of -the \fB\-gsplit\-dwarf\fR option, which splits debug information -between the .o file and a separate .dwo file. The compiler -generates all debug information in the same file, then uses -the \fB\-\-extract\-dwo\fR option to copy the .dwo sections to -the .dwo file, then the \fB\-\-strip\-dwo\fR option to remove -those sections from the original .o file. -.IP "\fB\-\-extract\-dwo\fR" 4 -.IX Item "--extract-dwo" -Extract the contents of all \s-1DWARF\s0 .dwo sections. See the -\&\fB\-\-strip\-dwo\fR option for more information. -.IP "\fB\-\-file\-alignment\fR \fInum\fR" 4 -.IX Item "--file-alignment num" -Specify the file alignment. Sections in the file will always begin at -file offsets which are multiples of this number. This defaults to -512. -[This option is specific to \s-1PE\s0 targets.] -.IP "\fB\-\-heap\fR \fIreserve\fR" 4 -.IX Item "--heap reserve" -.PD 0 -.IP "\fB\-\-heap\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4 -.IX Item "--heap reserve,commit" -.PD -Specify the number of bytes of memory to reserve (and optionally commit) -to be used as heap for this program. -[This option is specific to \s-1PE\s0 targets.] -.IP "\fB\-\-image\-base\fR \fIvalue\fR" 4 -.IX Item "--image-base value" -Use \fIvalue\fR as the base address of your program or dll. This is -the lowest memory location that will be used when your program or dll -is loaded. To reduce the need to relocate and improve performance of -your dlls, each should have a unique base address and not overlap any -other dlls. The default is 0x400000 for executables, and 0x10000000 -for dlls. -[This option is specific to \s-1PE\s0 targets.] -.IP "\fB\-\-section\-alignment\fR \fInum\fR" 4 -.IX Item "--section-alignment num" -Sets the section alignment. Sections in memory will always begin at -addresses which are a multiple of this number. Defaults to 0x1000. -[This option is specific to \s-1PE\s0 targets.] -.IP "\fB\-\-stack\fR \fIreserve\fR" 4 -.IX Item "--stack reserve" -.PD 0 -.IP "\fB\-\-stack\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4 -.IX Item "--stack reserve,commit" -.PD -Specify the number of bytes of memory to reserve (and optionally commit) -to be used as stack for this program. -[This option is specific to \s-1PE\s0 targets.] -.IP "\fB\-\-subsystem\fR \fIwhich\fR" 4 -.IX Item "--subsystem which" -.PD 0 -.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR" 4 -.IX Item "--subsystem which:major" -.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR\fB.\fR\fIminor\fR" 4 -.IX Item "--subsystem which:major.minor" -.PD -Specifies the subsystem under which your program will execute. The -legal values for \fIwhich\fR are \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`windows\*(C'\fR, -\&\f(CW\*(C`console\*(C'\fR, \f(CW\*(C`posix\*(C'\fR, \f(CW\*(C`efi\-app\*(C'\fR, \f(CW\*(C`efi\-bsd\*(C'\fR, -\&\f(CW\*(C`efi\-rtd\*(C'\fR, \f(CW\*(C`sal\-rtd\*(C'\fR, and \f(CW\*(C`xbox\*(C'\fR. You may optionally set -the subsystem version also. Numeric values are also accepted for -\&\fIwhich\fR. -[This option is specific to \s-1PE\s0 targets.] -.IP "\fB\-\-extract\-symbol\fR" 4 -.IX Item "--extract-symbol" -Keep the file's section flags and symbols but remove all section data. -Specifically, the option: -.RS 4 -.IP "*" 4 -.IX Item "*" -.PD 0 -.IP "*" 4 -.IX Item "*" -.IP "*" 4 -.IX Item "*" -.RE -.RS 4 -.PD -.Sp -This option is used to build a \fI.sym\fR file for a VxWorks kernel. -It can also be a useful way of reducing the size of a \fB\-\-just\-symbols\fR -linker input file. -.RE -.IP "\fB\-\-compress\-debug\-sections\fR" 4 -.IX Item "--compress-debug-sections" -Compress \s-1DWARF\s0 debug sections using zlib. -.IP "\fB\-\-decompress\-debug\-sections\fR" 4 -.IX Item "--decompress-debug-sections" -Decompress \s-1DWARF\s0 debug sections using zlib. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number of \fBobjcopy\fR. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-verbose\fR" 4 -.IX Item "--verbose" -.PD -Verbose output: list all object files modified. In the case of -archives, \fBobjcopy \-V\fR lists all members of the archive. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Show a summary of the options to \fBobjcopy\fR. -.IP "\fB\-\-info\fR" 4 -.IX Item "--info" -Display a list showing all architectures and object formats available. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.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\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/objdump.1 binutils-2.24/binutils/doc/objdump.1 --- binutils-2.24.orig/binutils/doc/objdump.1 2013-11-18 09:49:31.000000000 +0100 +++ binutils-2.24/binutils/doc/objdump.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,842 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "OBJDUMP 1" -.TH OBJDUMP 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -objdump \- display information from object files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -objdump [\fB\-a\fR|\fB\-\-archive\-headers\fR] - [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR] ] - [\fB\-d\fR|\fB\-\-disassemble\fR] - [\fB\-D\fR|\fB\-\-disassemble\-all\fR] - [\fB\-z\fR|\fB\-\-disassemble\-zeroes\fR] - [\fB\-EB\fR|\fB\-EL\fR|\fB\-\-endian=\fR{big | little }] - [\fB\-f\fR|\fB\-\-file\-headers\fR] - [\fB\-F\fR|\fB\-\-file\-offsets\fR] - [\fB\-\-file\-start\-context\fR] - [\fB\-g\fR|\fB\-\-debugging\fR] - [\fB\-e\fR|\fB\-\-debugging\-tags\fR] - [\fB\-h\fR|\fB\-\-section\-headers\fR|\fB\-\-headers\fR] - [\fB\-i\fR|\fB\-\-info\fR] - [\fB\-j\fR \fIsection\fR|\fB\-\-section=\fR\fIsection\fR] - [\fB\-l\fR|\fB\-\-line\-numbers\fR] - [\fB\-S\fR|\fB\-\-source\fR] - [\fB\-m\fR \fImachine\fR|\fB\-\-architecture=\fR\fImachine\fR] - [\fB\-M\fR \fIoptions\fR|\fB\-\-disassembler\-options=\fR\fIoptions\fR] - [\fB\-p\fR|\fB\-\-private\-headers\fR] - [\fB\-P\fR \fIoptions\fR|\fB\-\-private=\fR\fIoptions\fR] - [\fB\-r\fR|\fB\-\-reloc\fR] - [\fB\-R\fR|\fB\-\-dynamic\-reloc\fR] - [\fB\-s\fR|\fB\-\-full\-contents\fR] - [\fB\-W[lLiaprmfFsoRt]\fR| - \fB\-\-dwarf\fR[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]] - [\fB\-G\fR|\fB\-\-stabs\fR] - [\fB\-t\fR|\fB\-\-syms\fR] - [\fB\-T\fR|\fB\-\-dynamic\-syms\fR] - [\fB\-x\fR|\fB\-\-all\-headers\fR] - [\fB\-w\fR|\fB\-\-wide\fR] - [\fB\-\-start\-address=\fR\fIaddress\fR] - [\fB\-\-stop\-address=\fR\fIaddress\fR] - [\fB\-\-prefix\-addresses\fR] - [\fB\-\-[no\-]show\-raw\-insn\fR] - [\fB\-\-adjust\-vma=\fR\fIoffset\fR] - [\fB\-\-special\-syms\fR] - [\fB\-\-prefix=\fR\fIprefix\fR] - [\fB\-\-prefix\-strip=\fR\fIlevel\fR] - [\fB\-\-insn\-width=\fR\fIwidth\fR] - [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-H\fR|\fB\-\-help\fR] - \fIobjfile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBobjdump\fR 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 -\&\fIobjfile\fR... are the object files to be examined. When you -specify archives, \fBobjdump\fR shows information on each of the member -object files. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. At least one option from the list -\&\fB\-a,\-d,\-D,\-e,\-f,\-g,\-G,\-h,\-H,\-p,\-P,\-r,\-R,\-s,\-S,\-t,\-T,\-V,\-x\fR must be given. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-archive\-header\fR" 4 -.IX Item "--archive-header" -.PD -If any of the \fIobjfile\fR files are archives, display the archive -header information (in a format similar to \fBls \-l\fR). Besides the -information you could list with \fBar tv\fR, \fBobjdump \-a\fR shows -the object file format of each archive member. -.IP "\fB\-\-adjust\-vma=\fR\fIoffset\fR" 4 -.IX Item "--adjust-vma=offset" -When dumping information, first add \fIoffset\fR 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. -.IP "\fB\-b\fR \fIbfdname\fR" 4 -.IX Item "-b bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Specify that the object-code format for the object files is -\&\fIbfdname\fR. This option may not be necessary; \fIobjdump\fR can -automatically recognize many formats. -.Sp -For example, -.Sp -.Vb 1 -\& objdump \-b oasys \-m vax \-h fu.o -.Ve -.Sp -displays summary information from the section headers (\fB\-h\fR) of -\&\fIfu.o\fR, which is explicitly identified (\fB\-m\fR) as a \s-1VAX\s0 object -file in the format produced by Oasys compilers. You can list the -formats available with the \fB\-i\fR option. -.IP "\fB\-C\fR" 4 -.IX Item "-C" -.PD 0 -.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 -.IX Item "--demangle[=style]" -.PD -Decode (\fIdemangle\fR) 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. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-debugging\fR" 4 -.IX Item "--debugging" -.PD -Display debugging information. This attempts to parse \s-1STABS\s0 and \s-1IEEE\s0 -debugging format information stored in the file and print it out using -a C like syntax. If neither of these formats are found this option -falls back on the \fB\-W\fR option to print any \s-1DWARF\s0 information in -the file. -.IP "\fB\-e\fR" 4 -.IX Item "-e" -.PD 0 -.IP "\fB\-\-debugging\-tags\fR" 4 -.IX Item "--debugging-tags" -.PD -Like \fB\-g\fR, but the information is generated in a format compatible -with ctags tool. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-\-disassemble\fR" 4 -.IX Item "--disassemble" -.PD -Display the assembler mnemonics for the machine instructions from -\&\fIobjfile\fR. This option only disassembles those sections which are -expected to contain instructions. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -.PD 0 -.IP "\fB\-\-disassemble\-all\fR" 4 -.IX Item "--disassemble-all" -.PD -Like \fB\-d\fR, but disassemble the contents of all sections, not just -those expected to contain instructions. -.Sp -If the target is an \s-1ARM\s0 architecture this switch also has the effect -of forcing the disassembler to decode pieces of data found in code -sections as if they were instructions. -.IP "\fB\-\-prefix\-addresses\fR" 4 -.IX Item "--prefix-addresses" -When disassembling, print the complete address on each line. This is -the older disassembly format. -.IP "\fB\-EB\fR" 4 -.IX Item "-EB" -.PD 0 -.IP "\fB\-EL\fR" 4 -.IX Item "-EL" -.IP "\fB\-\-endian={big|little}\fR" 4 -.IX Item "--endian={big|little}" -.PD -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. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -.PD 0 -.IP "\fB\-\-file\-headers\fR" 4 -.IX Item "--file-headers" -.PD -Display summary information from the overall header of -each of the \fIobjfile\fR files. -.IP "\fB\-F\fR" 4 -.IX Item "-F" -.PD 0 -.IP "\fB\-\-file\-offsets\fR" 4 -.IX Item "--file-offsets" -.PD -When disassembling sections, whenever a symbol is displayed, also -display the file offset of the region of data that is about to be -dumped. If zeroes are being skipped, then when disassembly resumes, -tell the user how many zeroes were skipped and the file offset of the -location from where the disassembly resumes. When dumping sections, -display the file offset of the location from where the dump starts. -.IP "\fB\-\-file\-start\-context\fR" 4 -.IX Item "--file-start-context" -Specify that when displaying interlisted source code/disassembly -(assumes \fB\-S\fR) from a file that has not yet been displayed, extend the -context to the start of the file. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-section\-headers\fR" 4 -.IX Item "--section-headers" -.IP "\fB\-\-headers\fR" 4 -.IX Item "--headers" -.PD -Display summary information from the section headers of the -object file. -.Sp -File segments may be relocated to nonstandard addresses, for example by -using the \fB\-Ttext\fR, \fB\-Tdata\fR, or \fB\-Tbss\fR options to -\&\fBld\fR. However, some object file formats, such as a.out, do not -store the starting address of the file segments. In those situations, -although \fBld\fR relocates the sections correctly, using \fBobjdump -\&\-h\fR to list the file section headers cannot show the correct addresses. -Instead, it shows the usual addresses, which are implicit for the -target. -.IP "\fB\-H\fR" 4 -.IX Item "-H" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Print a summary of the options to \fBobjdump\fR and exit. -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-info\fR" 4 -.IX Item "--info" -.PD -Display a list showing all architectures and object formats available -for specification with \fB\-b\fR or \fB\-m\fR. -.IP "\fB\-j\fR \fIname\fR" 4 -.IX Item "-j name" -.PD 0 -.IP "\fB\-\-section=\fR\fIname\fR" 4 -.IX Item "--section=name" -.PD -Display information only for section \fIname\fR. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -.PD 0 -.IP "\fB\-\-line\-numbers\fR" 4 -.IX Item "--line-numbers" -.PD -Label the display (using debugging information) with the filename and -source line numbers corresponding to the object code or relocs shown. -Only useful with \fB\-d\fR, \fB\-D\fR, or \fB\-r\fR. -.IP "\fB\-m\fR \fImachine\fR" 4 -.IX Item "-m machine" -.PD 0 -.IP "\fB\-\-architecture=\fR\fImachine\fR" 4 -.IX Item "--architecture=machine" -.PD -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\fR option. -.Sp -If the target is an \s-1ARM\s0 architecture then this switch has an -additional effect. It restricts the disassembly to only those -instructions supported by the architecture specified by \fImachine\fR. -If it is necessary to use this switch because the input file does not -contain any architecture information, but it is also desired to -disassemble all the instructions use \fB\-marm\fR. -.IP "\fB\-M\fR \fIoptions\fR" 4 -.IX Item "-M options" -.PD 0 -.IP "\fB\-\-disassembler\-options=\fR\fIoptions\fR" 4 -.IX Item "--disassembler-options=options" -.PD -Pass target specific information to the disassembler. Only supported on -some targets. If it is necessary to specify more than one -disassembler option then multiple \fB\-M\fR options can be used or -can be placed together into a comma separated list. -.Sp -If the target is an \s-1ARM\s0 architecture then this switch can be used to -select which register name set is used during disassembler. Specifying -\&\fB\-M reg-names-std\fR (the default) will select the register names as -used in \s-1ARM\s0's instruction set documentation, but with register 13 called -\&'sp', register 14 called 'lr' and register 15 called 'pc'. Specifying -\&\fB\-M reg-names-apcs\fR will select the name set used by the \s-1ARM\s0 -Procedure Call Standard, whilst specifying \fB\-M reg-names-raw\fR will -just use \fBr\fR followed by the register number. -.Sp -There are also two variants on the \s-1APCS\s0 register naming scheme enabled -by \fB\-M reg-names-atpcs\fR and \fB\-M reg-names-special-atpcs\fR which -use the ARM/Thumb Procedure Call Standard naming conventions. (Either -with the normal register names or the special register names). -.Sp -This option can also be used for \s-1ARM\s0 architectures to force the -disassembler to interpret all instructions as Thumb instructions by -using the switch \fB\-\-disassembler\-options=force\-thumb\fR. This can be -useful when attempting to disassemble thumb code produced by other -compilers. -.Sp -For the x86, some of the options duplicate functions of the \fB\-m\fR -switch, but allow finer grained control. Multiple selections from the -following may be specified as a comma separated string. -\&\fBx86\-64\fR, \fBi386\fR and \fBi8086\fR select disassembly for -the given architecture. \fBintel\fR and \fBatt\fR select between -intel syntax mode and \s-1AT&T\s0 syntax mode. -\&\fBintel-mnemonic\fR and \fBatt-mnemonic\fR select between -intel mnemonic mode and \s-1AT&T\s0 mnemonic mode. \fBintel-mnemonic\fR -implies \fBintel\fR and \fBatt-mnemonic\fR implies \fBatt\fR. -\&\fBaddr64\fR, \fBaddr32\fR, -\&\fBaddr16\fR, \fBdata32\fR and \fBdata16\fR specify the default -address size and operand size. These four options will be overridden if -\&\fBx86\-64\fR, \fBi386\fR or \fBi8086\fR appear later in the -option string. Lastly, \fBsuffix\fR, when in \s-1AT&T\s0 mode, -instructs the disassembler to print a mnemonic suffix even when the -suffix could be inferred by the operands. -.Sp -For PowerPC, \fBbooke\fR controls the disassembly of BookE -instructions. \fB32\fR and \fB64\fR select PowerPC and -PowerPC64 disassembly, respectively. \fBe300\fR selects -disassembly for the e300 family. \fB440\fR selects disassembly for -the PowerPC 440. \fBppcps\fR selects disassembly for the paired -single instructions of the \s-1PPC750CL\s0. -.Sp -For \s-1MIPS\s0, this option controls the printing of instruction mnemonic -names and register names in disassembled instructions. Multiple -selections from the following may be specified as a comma separated -string, and invalid options are ignored: -.RS 4 -.ie n .IP """no\-aliases""" 4 -.el .IP "\f(CWno\-aliases\fR" 4 -.IX Item "no-aliases" -Print the 'raw' instruction mnemonic instead of some pseudo -instruction mnemonic. I.e., print 'daddu' or 'or' instead of 'move', -\&'sll' instead of 'nop', etc. -.ie n .IP """virt""" 4 -.el .IP "\f(CWvirt\fR" 4 -.IX Item "virt" -Disassemble the virtualization \s-1ASE\s0 instructions. -.ie n .IP """gpr\-names=\f(CIABI\f(CW""" 4 -.el .IP "\f(CWgpr\-names=\f(CIABI\f(CW\fR" 4 -.IX Item "gpr-names=ABI" -Print \s-1GPR\s0 (general-purpose register) names as appropriate -for the specified \s-1ABI\s0. By default, \s-1GPR\s0 names are selected according to -the \s-1ABI\s0 of the binary being disassembled. -.ie n .IP """fpr\-names=\f(CIABI\f(CW""" 4 -.el .IP "\f(CWfpr\-names=\f(CIABI\f(CW\fR" 4 -.IX Item "fpr-names=ABI" -Print \s-1FPR\s0 (floating-point register) names as -appropriate for the specified \s-1ABI\s0. By default, \s-1FPR\s0 numbers are printed -rather than names. -.ie n .IP """cp0\-names=\f(CIARCH\f(CW""" 4 -.el .IP "\f(CWcp0\-names=\f(CIARCH\f(CW\fR" 4 -.IX Item "cp0-names=ARCH" -Print \s-1CP0\s0 (system control coprocessor; coprocessor 0) register names -as appropriate for the \s-1CPU\s0 or architecture specified by -\&\fI\s-1ARCH\s0\fR. By default, \s-1CP0\s0 register names are selected according to -the architecture and \s-1CPU\s0 of the binary being disassembled. -.ie n .IP """hwr\-names=\f(CIARCH\f(CW""" 4 -.el .IP "\f(CWhwr\-names=\f(CIARCH\f(CW\fR" 4 -.IX Item "hwr-names=ARCH" -Print \s-1HWR\s0 (hardware register, used by the \f(CW\*(C`rdhwr\*(C'\fR instruction) names -as appropriate for the \s-1CPU\s0 or architecture specified by -\&\fI\s-1ARCH\s0\fR. By default, \s-1HWR\s0 names are selected according to -the architecture and \s-1CPU\s0 of the binary being disassembled. -.ie n .IP """reg\-names=\f(CIABI\f(CW""" 4 -.el .IP "\f(CWreg\-names=\f(CIABI\f(CW\fR" 4 -.IX Item "reg-names=ABI" -Print \s-1GPR\s0 and \s-1FPR\s0 names as appropriate for the selected \s-1ABI\s0. -.ie n .IP """reg\-names=\f(CIARCH\f(CW""" 4 -.el .IP "\f(CWreg\-names=\f(CIARCH\f(CW\fR" 4 -.IX Item "reg-names=ARCH" -Print CPU-specific register names (\s-1CP0\s0 register and \s-1HWR\s0 names) -as appropriate for the selected \s-1CPU\s0 or architecture. -.RE -.RS 4 -.Sp -For any of the options listed above, \fI\s-1ABI\s0\fR or -\&\fI\s-1ARCH\s0\fR may be specified as \fBnumeric\fR to have numbers printed -rather than names, for the selected types of registers. -You can list the available values of \fI\s-1ABI\s0\fR and \fI\s-1ARCH\s0\fR using -the \fB\-\-help\fR option. -.Sp -For \s-1VAX\s0, you can specify function entry addresses with \fB\-M -entry:0xf00ba\fR. You can use this multiple times to properly -disassemble \s-1VAX\s0 binary files that don't contain symbol tables (like -\&\s-1ROM\s0 dumps). In these cases, the function entry mask would otherwise -be decoded as \s-1VAX\s0 instructions, which would probably lead the rest -of the function being wrongly disassembled. -.RE -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-private\-headers\fR" 4 -.IX Item "--private-headers" -.PD -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. -.IP "\fB\-P\fR \fIoptions\fR" 4 -.IX Item "-P options" -.PD 0 -.IP "\fB\-\-private=\fR\fIoptions\fR" 4 -.IX Item "--private=options" -.PD -Print information that is specific to the object file format. The -argument \fIoptions\fR is a comma separated list that depends on the -format (the lists of options is displayed with the help). -.Sp -For \s-1XCOFF\s0, the available options are: \fBheader\fR, \fBaout\fR, -\&\fBsections\fR, \fBsyms\fR, \fBrelocs\fR, \fBlineno\fR, -\&\fBloader\fR, \fBexcept\fR, \fBtypchk\fR, \fBtraceback\fR, -\&\fBtoc\fR and \fBldinfo\fR. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -.PD 0 -.IP "\fB\-\-reloc\fR" 4 -.IX Item "--reloc" -.PD -Print the relocation entries of the file. If used with \fB\-d\fR or -\&\fB\-D\fR, the relocations are printed interspersed with the -disassembly. -.IP "\fB\-R\fR" 4 -.IX Item "-R" -.PD 0 -.IP "\fB\-\-dynamic\-reloc\fR" 4 -.IX Item "--dynamic-reloc" -.PD -Print the dynamic relocation entries of the file. This is only -meaningful for dynamic objects, such as certain types of shared -libraries. As for \fB\-r\fR, if used with \fB\-d\fR or -\&\fB\-D\fR, the relocations are printed interspersed with the -disassembly. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-full\-contents\fR" 4 -.IX Item "--full-contents" -.PD -Display the full contents of any sections requested. By default all -non-empty sections are displayed. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-source\fR" 4 -.IX Item "--source" -.PD -Display source code intermixed with disassembly, if possible. Implies -\&\fB\-d\fR. -.IP "\fB\-\-prefix=\fR\fIprefix\fR" 4 -.IX Item "--prefix=prefix" -Specify \fIprefix\fR to add to the absolute paths when used with -\&\fB\-S\fR. -.IP "\fB\-\-prefix\-strip=\fR\fIlevel\fR" 4 -.IX Item "--prefix-strip=level" -Indicate how many initial directory names to strip off the hardwired -absolute paths. It has no effect without \fB\-\-prefix=\fR\fIprefix\fR. -.IP "\fB\-\-show\-raw\-insn\fR" 4 -.IX Item "--show-raw-insn" -When disassembling instructions, print the instruction in hex as well as -in symbolic form. This is the default except when -\&\fB\-\-prefix\-addresses\fR is used. -.IP "\fB\-\-no\-show\-raw\-insn\fR" 4 -.IX Item "--no-show-raw-insn" -When disassembling instructions, do not print the instruction bytes. -This is the default when \fB\-\-prefix\-addresses\fR is used. -.IP "\fB\-\-insn\-width=\fR\fIwidth\fR" 4 -.IX Item "--insn-width=width" -Display \fIwidth\fR bytes on a single line when disassembling -instructions. -.IP "\fB\-W[lLiaprmfFsoRt]\fR" 4 -.IX Item "-W[lLiaprmfFsoRt]" -.PD 0 -.IP "\fB\-\-dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]\fR" 4 -.IX Item "--dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]" -.PD -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. -.Sp -Note that there is no single letter option to display the content of -trace sections or .gdb_index. -.Sp -Note: the output from the \fB=info\fR option can also be affected -by the options \fB\-\-dwarf\-depth\fR, the \fB\-\-dwarf\-start\fR and -the \fB\-\-dwarf\-check\fR. -.IP "\fB\-\-dwarf\-depth=\fR\fIn\fR" 4 -.IX Item "--dwarf-depth=n" -Limit the dump of the \f(CW\*(C`.debug_info\*(C'\fR section to \fIn\fR children. -This is only useful with \fB\-\-dwarf=info\fR. The default is -to print all DIEs; the special value 0 for \fIn\fR will also have this -effect. -.Sp -With a non-zero value for \fIn\fR, DIEs at or deeper than \fIn\fR -levels will not be printed. The range for \fIn\fR is zero-based. -.IP "\fB\-\-dwarf\-start=\fR\fIn\fR" 4 -.IX Item "--dwarf-start=n" -Print only DIEs beginning with the \s-1DIE\s0 numbered \fIn\fR. This is only -useful with \fB\-\-dwarf=info\fR. -.Sp -If specified, this option will suppress printing of any header -information and all DIEs before the \s-1DIE\s0 numbered \fIn\fR. Only -siblings and children of the specified \s-1DIE\s0 will be printed. -.Sp -This can be used in conjunction with \fB\-\-dwarf\-depth\fR. -.IP "\fB\-\-dwarf\-check\fR" 4 -.IX Item "--dwarf-check" -Enable additional checks for consistency of Dwarf information. -.IP "\fB\-G\fR" 4 -.IX Item "-G" -.PD 0 -.IP "\fB\-\-stabs\fR" 4 -.IX Item "--stabs" -.PD -Display the full contents of any sections requested. Display the -contents of the .stab and .stab.index and .stab.excl sections from an -\&\s-1ELF\s0 file. This is only useful on systems (such as Solaris 2.0) in which -\&\f(CW\*(C`.stab\*(C'\fR debugging symbol-table entries are carried in an \s-1ELF\s0 -section. In most other file formats, debugging symbol-table entries are -interleaved with linkage symbols, and are visible in the \fB\-\-syms\fR -output. -.IP "\fB\-\-start\-address=\fR\fIaddress\fR" 4 -.IX Item "--start-address=address" -Start displaying data at the specified address. This affects the output -of the \fB\-d\fR, \fB\-r\fR and \fB\-s\fR options. -.IP "\fB\-\-stop\-address=\fR\fIaddress\fR" 4 -.IX Item "--stop-address=address" -Stop displaying data at the specified address. This affects the output -of the \fB\-d\fR, \fB\-r\fR and \fB\-s\fR options. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-syms\fR" 4 -.IX Item "--syms" -.PD -Print the symbol table entries of the file. -This is similar to the information provided by the \fBnm\fR program, -although the display format is different. The format of the output -depends upon the format of the file being dumped, but there are two main -types. One looks like this: -.Sp -.Vb 2 -\& [ 4](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss -\& [ 6](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 fred -.Ve -.Sp -where the number inside the square brackets is the number of the entry -in the symbol table, the \fIsec\fR number is the section number, the -\&\fIfl\fR value are the symbol's flag bits, the \fIty\fR number is the -symbol's type, the \fIscl\fR number is the symbol's storage class and -the \fInx\fR value is the number of auxilary entries associated with -the symbol. The last two fields are the symbol's value and its name. -.Sp -The other common output format, usually seen with \s-1ELF\s0 based files, -looks like this: -.Sp -.Vb 2 -\& 00000000 l d .bss 00000000 .bss -\& 00000000 g .text 00000000 fred -.Ve -.Sp -Here the first number is the symbol's value (sometimes refered to as -its address). The next field is actually a set of characters and -spaces indicating the flag bits that are set on the symbol. These -characters are described below. Next is the section with which the -symbol is associated or \fI*ABS*\fR if the section is absolute (ie -not connected with any section), or \fI*UND*\fR if the section is -referenced in the file being dumped, but not defined there. -.Sp -After the section name comes another field, a number, which for common -symbols is the alignment and for other symbol is the size. Finally -the symbol's name is displayed. -.Sp -The flag characters are divided into 7 groups as follows: -.RS 4 -.ie n .IP """l""" 4 -.el .IP "\f(CWl\fR" 4 -.IX Item "l" -.PD 0 -.ie n .IP """g""" 4 -.el .IP "\f(CWg\fR" 4 -.IX Item "g" -.ie n .IP """u""" 4 -.el .IP "\f(CWu\fR" 4 -.IX Item "u" -.ie n .IP """!""" 4 -.el .IP "\f(CW!\fR" 4 -.IX Item "!" -.PD -The symbol is a local (l), global (g), unique global (u), neither -global nor local (a space) or both global and local (!). A -symbol can be neither local or global for a variety of reasons, e.g., -because it is used for debugging, but it is probably an indication of -a bug if it is ever both local and global. Unique global symbols are -a \s-1GNU\s0 extension to the standard set of \s-1ELF\s0 symbol bindings. For such -a symbol the dynamic linker will make sure that in the entire process -there is just one symbol with this name and type in use. -.ie n .IP """w""" 4 -.el .IP "\f(CWw\fR" 4 -.IX Item "w" -The symbol is weak (w) or strong (a space). -.ie n .IP """C""" 4 -.el .IP "\f(CWC\fR" 4 -.IX Item "C" -The symbol denotes a constructor (C) or an ordinary symbol (a space). -.ie n .IP """W""" 4 -.el .IP "\f(CWW\fR" 4 -.IX Item "W" -The symbol is a warning (W) or a normal symbol (a space). A warning -symbol's name is a message to be displayed if the symbol following the -warning symbol is ever referenced. -.ie n .IP """I""" 4 -.el .IP "\f(CWI\fR" 4 -.IX Item "I" -.PD 0 -.ie n .IP """i""" 4 -.el .IP "\f(CWi\fR" 4 -.IX Item "i" -.PD -The symbol is an indirect reference to another symbol (I), a function -to be evaluated during reloc processing (i) or a normal symbol (a -space). -.ie n .IP """d""" 4 -.el .IP "\f(CWd\fR" 4 -.IX Item "d" -.PD 0 -.ie n .IP """D""" 4 -.el .IP "\f(CWD\fR" 4 -.IX Item "D" -.PD -The symbol is a debugging symbol (d) or a dynamic symbol (D) or a -normal symbol (a space). -.ie n .IP """F""" 4 -.el .IP "\f(CWF\fR" 4 -.IX Item "F" -.PD 0 -.ie n .IP """f""" 4 -.el .IP "\f(CWf\fR" 4 -.IX Item "f" -.ie n .IP """O""" 4 -.el .IP "\f(CWO\fR" 4 -.IX Item "O" -.PD -The symbol is the name of a function (F) or a file (f) or an object -(O) or just a normal symbol (a space). -.RE -.RS 4 -.RE -.IP "\fB\-T\fR" 4 -.IX Item "-T" -.PD 0 -.IP "\fB\-\-dynamic\-syms\fR" 4 -.IX Item "--dynamic-syms" -.PD -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 \fBnm\fR -program when given the \fB\-D\fR (\fB\-\-dynamic\fR) option. -.IP "\fB\-\-special\-syms\fR" 4 -.IX Item "--special-syms" -When displaying symbols include those which the target considers to be -special in some way and which would not normally be of interest to the -user. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Print the version number of \fBobjdump\fR and exit. -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-all\-headers\fR" 4 -.IX Item "--all-headers" -.PD -Display all available header information, including the symbol table and -relocation entries. Using \fB\-x\fR is equivalent to specifying all of -\&\fB\-a \-f \-h \-p \-r \-t\fR. -.IP "\fB\-w\fR" 4 -.IX Item "-w" -.PD 0 -.IP "\fB\-\-wide\fR" 4 -.IX Item "--wide" -.PD -Format some lines for output devices that have more than 80 columns. -Also do not truncate symbol names when they are displayed. -.IP "\fB\-z\fR" 4 -.IX Item "-z" -.PD 0 -.IP "\fB\-\-disassemble\-zeroes\fR" 4 -.IX Item "--disassemble-zeroes" -.PD -Normally the disassembly output will skip blocks of zeroes. This -option directs the disassembler to disassemble those blocks, just like -any other data. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fInm\fR\|(1), \fIreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/ranlib.1 binutils-2.24/binutils/doc/ranlib.1 --- binutils-2.24.orig/binutils/doc/ranlib.1 2013-11-18 09:49:31.000000000 +0100 +++ binutils-2.24/binutils/doc/ranlib.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,218 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "RANLIB 1" -.TH RANLIB 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -ranlib \- generate index to archive. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -ranlib [\fB\-\-plugin\fR \fIname\fR] [\fB\-DhHvVt\fR] \fIarchive\fR -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBranlib\fR 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 \fBnm \-s\fR or \fBnm \-\-print\-armap\fR 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 \s-1GNU\s0 \fBranlib\fR program is another form of \s-1GNU\s0 \fBar\fR; running -\&\fBranlib\fR is completely equivalent to executing \fBar \-s\fR. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-H\fR" 4 -.IX Item "-H" -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Show usage information for \fBranlib\fR. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number of \fBranlib\fR. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -Operate in \fIdeterministic\fR mode. The symbol map archive member's -header will show zero for the \s-1UID\s0, \s-1GID\s0, and timestamp. When this -option is used, multiple runs will produce identical output files. -.Sp -If \fIbinutils\fR was configured with -\&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by -default. It can be disabled with the \fB\-U\fR option, described -below. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -Update the timestamp of the symbol map of an archive. -.IP "\fB\-U\fR" 4 -.IX Item "-U" -Do \fInot\fR operate in \fIdeterministic\fR mode. This is the -inverse of the \fB\-D\fR option, above: the archive index will get -actual \s-1UID\s0, \s-1GID\s0, timestamp, and file mode values. -.Sp -If \fIbinutils\fR was configured \fIwithout\fR -\&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by -default. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fInm\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/readelf.1 binutils-2.24/binutils/doc/readelf.1 --- binutils-2.24.orig/binutils/doc/readelf.1 2013-11-18 09:49:31.000000000 +0100 +++ binutils-2.24/binutils/doc/readelf.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,448 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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" -.TH READELF 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -readelf \- Displays information about ELF files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -readelf [\fB\-a\fR|\fB\-\-all\fR] - [\fB\-h\fR|\fB\-\-file\-header\fR] - [\fB\-l\fR|\fB\-\-program\-headers\fR|\fB\-\-segments\fR] - [\fB\-S\fR|\fB\-\-section\-headers\fR|\fB\-\-sections\fR] - [\fB\-g\fR|\fB\-\-section\-groups\fR] - [\fB\-t\fR|\fB\-\-section\-details\fR] - [\fB\-e\fR|\fB\-\-headers\fR] - [\fB\-s\fR|\fB\-\-syms\fR|\fB\-\-symbols\fR] - [\fB\-\-dyn\-syms\fR] - [\fB\-n\fR|\fB\-\-notes\fR] - [\fB\-r\fR|\fB\-\-relocs\fR] - [\fB\-u\fR|\fB\-\-unwind\fR] - [\fB\-d\fR|\fB\-\-dynamic\fR] - [\fB\-V\fR|\fB\-\-version\-info\fR] - [\fB\-A\fR|\fB\-\-arch\-specific\fR] - [\fB\-D\fR|\fB\-\-use\-dynamic\fR] - [\fB\-x\fR |\fB\-\-hex\-dump=\fR] - [\fB\-p\fR |\fB\-\-string\-dump=\fR] - [\fB\-R\fR |\fB\-\-relocated\-dump=\fR] - [\fB\-c\fR|\fB\-\-archive\-index\fR] - [\fB\-w[lLiaprmfFsoRt]\fR| - \fB\-\-debug\-dump\fR[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]] - [\fB\-\-dwarf\-depth=\fR\fIn\fR] - [\fB\-\-dwarf\-start=\fR\fIn\fR] - [\fB\-I\fR|\fB\-\-histogram\fR] - [\fB\-v\fR|\fB\-\-version\fR] - [\fB\-W\fR|\fB\-\-wide\fR] - [\fB\-H\fR|\fB\-\-help\fR] - \fIelffile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBreadelf\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. 32\-bit and -64\-bit \s-1ELF\s0 files are supported, as are archives containing \s-1ELF\s0 files. -.PP -This program performs a similar function to \fBobjdump\fR but it -goes into more detail and it exists independently of the \s-1BFD\s0 -library, so if there is a bug in \s-1BFD\s0 then readelf will not be -affected. -.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 "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-all\fR" 4 -.IX Item "--all" -.PD -Equivalent to specifying \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 "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-file\-header\fR" 4 -.IX Item "--file-header" -.PD -Displays the information contained in the \s-1ELF\s0 header at the start of the -file. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -.PD 0 -.IP "\fB\-\-program\-headers\fR" 4 -.IX Item "--program-headers" -.IP "\fB\-\-segments\fR" 4 -.IX Item "--segments" -.PD -Displays the information contained in the file's segment headers, if it -has any. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-sections\fR" 4 -.IX Item "--sections" -.IP "\fB\-\-section\-headers\fR" 4 -.IX Item "--section-headers" -.PD -Displays the information contained in the file's section headers, if it -has any. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-section\-groups\fR" 4 -.IX Item "--section-groups" -.PD -Displays the information contained in the file's section groups, if it -has any. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-section\-details\fR" 4 -.IX Item "--section-details" -.PD -Displays the detailed section information. Implies \fB\-S\fR. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-symbols\fR" 4 -.IX Item "--symbols" -.IP "\fB\-\-syms\fR" 4 -.IX Item "--syms" -.PD -Displays the entries in symbol table section of the file, if it has one. -.IP "\fB\-\-dyn\-syms\fR" 4 -.IX Item "--dyn-syms" -Displays the entries in dynamic symbol table section of the file, if it -has one. -.IP "\fB\-e\fR" 4 -.IX Item "-e" -.PD 0 -.IP "\fB\-\-headers\fR" 4 -.IX Item "--headers" -.PD -Display all the headers in the file. Equivalent to \fB\-h \-l \-S\fR. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-\-notes\fR" 4 -.IX Item "--notes" -.PD -Displays the contents of the \s-1NOTE\s0 segments and/or sections, if any. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -.PD 0 -.IP "\fB\-\-relocs\fR" 4 -.IX Item "--relocs" -.PD -Displays the contents of the file's relocation section, if it has one. -.IP "\fB\-u\fR" 4 -.IX Item "-u" -.PD 0 -.IP "\fB\-\-unwind\fR" 4 -.IX Item "--unwind" -.PD -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, as well as \s-1ARM\s0 unwind tables -(\f(CW\*(C`.ARM.exidx\*(C'\fR / \f(CW\*(C`.ARM.extab\*(C'\fR) are currently supported. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-\-dynamic\fR" 4 -.IX Item "--dynamic" -.PD -Displays the contents of the file's dynamic section, if it has one. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\-info\fR" 4 -.IX Item "--version-info" -.PD -Displays the contents of the version sections in the file, it they -exist. -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-\-arch\-specific\fR" 4 -.IX Item "--arch-specific" -.PD -Displays architecture-specific information in the file, if there -is any. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -.PD 0 -.IP "\fB\-\-use\-dynamic\fR" 4 -.IX Item "--use-dynamic" -.PD -When displaying symbols, this option makes \fBreadelf\fR use the -symbol hash tables in the file's dynamic section, rather than the -symbol table sections. -.IP "\fB\-x \fR" 4 -.IX Item "-x " -.PD 0 -.IP "\fB\-\-hex\-dump=\fR" 4 -.IX Item "--hex-dump=" -.PD -Displays the contents of the indicated section as a hexadecimal bytes. -A number identifies a particular section by index in the section table; -any other string identifies all sections with that name in the object file. -.IP "\fB\-R \fR" 4 -.IX Item "-R " -.PD 0 -.IP "\fB\-\-relocated\-dump=\fR" 4 -.IX Item "--relocated-dump=" -.PD -Displays the contents of the indicated section as a hexadecimal -bytes. A number identifies a particular section by index in the -section table; any other string identifies all sections with that name -in the object file. The contents of the section will be relocated -before they are displayed. -.IP "\fB\-p \fR" 4 -.IX Item "-p " -.PD 0 -.IP "\fB\-\-string\-dump=\fR" 4 -.IX Item "--string-dump=" -.PD -Displays the contents of the indicated section as printable strings. -A number identifies a particular section by index in the section table; -any other string identifies all sections with that name in the object file. -.IP "\fB\-c\fR" 4 -.IX Item "-c" -.PD 0 -.IP "\fB\-\-archive\-index\fR" 4 -.IX Item "--archive-index" -.PD -Displays the file symbol index information contained in the header part -of binary archives. Performs the same function as the \fBt\fR -command to \fBar\fR, but without using the \s-1BFD\s0 library. -.IP "\fB\-w[lLiaprmfFsoRt]\fR" 4 -.IX Item "-w[lLiaprmfFsoRt]" -.PD 0 -.IP "\fB\-\-debug\-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]\fR" 4 -.IX Item "--debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]" -.PD -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. -.Sp -Note that there is no single letter option to display the content of -trace sections or .gdb_index. -.Sp -Note: the \fB=decodedline\fR option will display the interpreted -contents of a .debug_line section whereas the \fB=rawline\fR option -dumps the contents in a raw format. -.Sp -Note: the \fB=frames\-interp\fR option will display the interpreted -contents of a .debug_frame section whereas the \fB=frames\fR option -dumps the contents in a raw format. -.Sp -Note: the output from the \fB=info\fR option can also be affected -by the options \fB\-\-dwarf\-depth\fR and \fB\-\-dwarf\-start\fR. -.IP "\fB\-\-dwarf\-depth=\fR\fIn\fR" 4 -.IX Item "--dwarf-depth=n" -Limit the dump of the \f(CW\*(C`.debug_info\*(C'\fR section to \fIn\fR children. -This is only useful with \fB\-\-debug\-dump=info\fR. The default is -to print all DIEs; the special value 0 for \fIn\fR will also have this -effect. -.Sp -With a non-zero value for \fIn\fR, DIEs at or deeper than \fIn\fR -levels will not be printed. The range for \fIn\fR is zero-based. -.IP "\fB\-\-dwarf\-start=\fR\fIn\fR" 4 -.IX Item "--dwarf-start=n" -Print only DIEs beginning with the \s-1DIE\s0 numbered \fIn\fR. This is only -useful with \fB\-\-debug\-dump=info\fR. -.Sp -If specified, this option will suppress printing of any header -information and all DIEs before the \s-1DIE\s0 numbered \fIn\fR. Only -siblings and children of the specified \s-1DIE\s0 will be printed. -.Sp -This can be used in conjunction with \fB\-\-dwarf\-depth\fR. -.IP "\fB\-I\fR" 4 -.IX Item "-I" -.PD 0 -.IP "\fB\-\-histogram\fR" 4 -.IX Item "--histogram" -.PD -Display a histogram of bucket list lengths when displaying the contents -of the symbol tables. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Display the version number of readelf. -.IP "\fB\-W\fR" 4 -.IX Item "-W" -.PD 0 -.IP "\fB\-\-wide\fR" 4 -.IX Item "--wide" -.PD -Don't break output lines to fit into 80 columns. By default -\&\fBreadelf\fR breaks section header and segment listing lines for -64\-bit \s-1ELF\s0 files, so that they fit into 80 columns. This option causes -\&\fBreadelf\fR to print each section header resp. each segment one a -single line, which is far more readable on terminals wider than 80 columns. -.IP "\fB\-H\fR" 4 -.IX Item "-H" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Display the command line options understood by \fBreadelf\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.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\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/size.1 binutils-2.24/binutils/doc/size.1 --- binutils-2.24.orig/binutils/doc/size.1 2013-11-18 09:49:31.000000000 +0100 +++ binutils-2.24/binutils/doc/size.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,266 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "SIZE 1" -.TH SIZE 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -size \- list section sizes and total size. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -size [\fB\-A\fR|\fB\-B\fR|\fB\-\-format=\fR\fIcompatibility\fR] - [\fB\-\-help\fR] - [\fB\-d\fR|\fB\-o\fR|\fB\-x\fR|\fB\-\-radix=\fR\fInumber\fR] - [\fB\-\-common\fR] - [\fB\-t\fR|\fB\-\-totals\fR] - [\fB\-\-target=\fR\fIbfdname\fR] [\fB\-V\fR|\fB\-\-version\fR] - [\fIobjfile\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \s-1GNU\s0 \fBsize\fR utility lists the section sizes\-\-\-and the total -size\-\-\-for each of the object or archive files \fIobjfile\fR in its -argument list. By default, one line of output is generated for each -object file or each module in an archive. -.PP -\&\fIobjfile\fR... are the object files to be examined. -If none are specified, the file \f(CW\*(C`a.out\*(C'\fR will be used. -.SH "OPTIONS" -.IX Header "OPTIONS" -The command line options have the following meanings: -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-B\fR" 4 -.IX Item "-B" -.IP "\fB\-\-format=\fR\fIcompatibility\fR" 4 -.IX Item "--format=compatibility" -.PD -Using one of these options, you can choose whether the output from \s-1GNU\s0 -\&\fBsize\fR resembles output from System V \fBsize\fR (using \fB\-A\fR, -or \fB\-\-format=sysv\fR), or Berkeley \fBsize\fR (using \fB\-B\fR, or -\&\fB\-\-format=berkeley\fR). The default is the one-line format similar to -Berkeley's. -.Sp -Here is an example of the Berkeley (default) format of output from -\&\fBsize\fR: -.Sp -.Vb 4 -\& $ size \-\-format=Berkeley ranlib size -\& text data bss dec hex filename -\& 294880 81920 11592 388392 5ed28 ranlib -\& 294880 81920 11888 388688 5ee50 size -.Ve -.Sp -This is the same data, but displayed closer to System V conventions: -.Sp -.Vb 7 -\& $ 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 -.Ve -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Show a summary of acceptable arguments and options. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-o\fR" 4 -.IX Item "-o" -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.IP "\fB\-\-radix=\fR\fInumber\fR" 4 -.IX Item "--radix=number" -.PD -Using one of these options, you can control whether the size of each -section is given in decimal (\fB\-d\fR, or \fB\-\-radix=10\fR); octal -(\fB\-o\fR, or \fB\-\-radix=8\fR); or hexadecimal (\fB\-x\fR, or -\&\fB\-\-radix=16\fR). In \fB\-\-radix=\fR\fInumber\fR, only the three -values (8, 10, 16) are supported. The total size is always given in two -radices; decimal and hexadecimal for \fB\-d\fR or \fB\-x\fR output, or -octal and hexadecimal if you're using \fB\-o\fR. -.IP "\fB\-\-common\fR" 4 -.IX Item "--common" -Print total size of common symbols in each file. When using Berkeley -format these are included in the bss size. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-totals\fR" 4 -.IX Item "--totals" -.PD -Show totals of all objects listed (Berkeley format listing mode only). -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -Specify that the object-code format for \fIobjfile\fR is -\&\fIbfdname\fR. This option may not be necessary; \fBsize\fR can -automatically recognize many formats. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Display the version number of \fBsize\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/strings.1 binutils-2.24/binutils/doc/strings.1 --- binutils-2.24.orig/binutils/doc/strings.1 2013-11-18 09:49:31.000000000 +0100 +++ binutils-2.24/binutils/doc/strings.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,255 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "STRINGS 1" -.TH STRINGS 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -strings \- print the strings of printable characters in files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -strings [\fB\-afovV\fR] [\fB\-\fR\fImin-len\fR] - [\fB\-n\fR \fImin-len\fR] [\fB\-\-bytes=\fR\fImin-len\fR] - [\fB\-t\fR \fIradix\fR] [\fB\-\-radix=\fR\fIradix\fR] - [\fB\-e\fR \fIencoding\fR] [\fB\-\-encoding=\fR\fIencoding\fR] - [\fB\-\fR] [\fB\-\-all\fR] [\fB\-\-print\-file\-name\fR] - [\fB\-T\fR \fIbfdname\fR] [\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-\-help\fR] [\fB\-\-version\fR] \fIfile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -For each \fIfile\fR given, \s-1GNU\s0 \fBstrings\fR 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 -\&\fBstrings\fR is mainly useful for determining the contents of non-text -files. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-all\fR" 4 -.IX Item "--all" -.IP "\fB\-\fR" 4 -.IX Item "-" -.PD -Do not scan only the initialized and loaded sections of object files; -scan the whole files. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -.PD 0 -.IP "\fB\-\-print\-file\-name\fR" 4 -.IX Item "--print-file-name" -.PD -Print the name of the file before each string. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Print a summary of the program usage on the standard output and exit. -.IP "\fB\-\fR\fImin-len\fR" 4 -.IX Item "-min-len" -.PD 0 -.IP "\fB\-n\fR \fImin-len\fR" 4 -.IX Item "-n min-len" -.IP "\fB\-\-bytes=\fR\fImin-len\fR" 4 -.IX Item "--bytes=min-len" -.PD -Print sequences of characters that are at least \fImin-len\fR characters -long, instead of the default 4. -.IP "\fB\-o\fR" 4 -.IX Item "-o" -Like \fB\-t o\fR. Some other versions of \fBstrings\fR have \fB\-o\fR -act like \fB\-t d\fR instead. Since we can not be compatible with both -ways, we simply chose one. -.IP "\fB\-t\fR \fIradix\fR" 4 -.IX Item "-t radix" -.PD 0 -.IP "\fB\-\-radix=\fR\fIradix\fR" 4 -.IX Item "--radix=radix" -.PD -Print the offset within the file before each string. The single -character argument specifies the radix of the offset\-\-\-\fBo\fR for -octal, \fBx\fR for hexadecimal, or \fBd\fR for decimal. -.IP "\fB\-e\fR \fIencoding\fR" 4 -.IX Item "-e encoding" -.PD 0 -.IP "\fB\-\-encoding=\fR\fIencoding\fR" 4 -.IX Item "--encoding=encoding" -.PD -Select the character encoding of the strings that are to be found. -Possible values for \fIencoding\fR are: \fBs\fR = single\-7\-bit\-byte -characters (\s-1ASCII\s0, \s-1ISO\s0 8859, etc., default), \fBS\fR = -single\-8\-bit\-byte characters, \fBb\fR = 16\-bit bigendian, \fBl\fR = -16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit -littleendian. Useful for finding wide character strings. (\fBl\fR -and \fBb\fR apply to, for example, Unicode \s-1UTF\-16/UCS\-2\s0 encodings). -.IP "\fB\-T\fR \fIbfdname\fR" 4 -.IX Item "-T bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Specify an object code format other than your system's default format. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Print the program version number on the standard output and exit. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fInm\fR\|(1), \fIobjdump\fR\|(1), \fIranlib\fR\|(1), \fIreadelf\fR\|(1) -and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/strip.1 binutils-2.24/binutils/doc/strip.1 --- binutils-2.24.orig/binutils/doc/strip.1 2013-11-18 09:49:31.000000000 +0100 +++ binutils-2.24/binutils/doc/strip.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,427 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "STRIP 1" -.TH STRIP 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -strip \- Discard symbols from object files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -strip [\fB\-F\fR \fIbfdname\fR |\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-I\fR \fIbfdname\fR |\fB\-\-input\-target=\fR\fIbfdname\fR] - [\fB\-O\fR \fIbfdname\fR |\fB\-\-output\-target=\fR\fIbfdname\fR] - [\fB\-s\fR|\fB\-\-strip\-all\fR] - [\fB\-S\fR|\fB\-g\fR|\fB\-d\fR|\fB\-\-strip\-debug\fR] - [\fB\-\-strip\-dwo\fR] - [\fB\-K\fR \fIsymbolname\fR |\fB\-\-keep\-symbol=\fR\fIsymbolname\fR] - [\fB\-N\fR \fIsymbolname\fR |\fB\-\-strip\-symbol=\fR\fIsymbolname\fR] - [\fB\-w\fR|\fB\-\-wildcard\fR] - [\fB\-x\fR|\fB\-\-discard\-all\fR] [\fB\-X\fR |\fB\-\-discard\-locals\fR] - [\fB\-R\fR \fIsectionname\fR |\fB\-\-remove\-section=\fR\fIsectionname\fR] - [\fB\-o\fR \fIfile\fR] [\fB\-p\fR|\fB\-\-preserve\-dates\fR] - [\fB\-D\fR|\fB\-\-enable\-deterministic\-archives\fR] - [\fB\-U\fR|\fB\-\-disable\-deterministic\-archives\fR] - [\fB\-\-keep\-file\-symbols\fR] - [\fB\-\-only\-keep\-debug\fR] - [\fB\-v\fR |\fB\-\-verbose\fR] [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-\-help\fR] [\fB\-\-info\fR] - \fIobjfile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\s-1GNU\s0 \fBstrip\fR discards all symbols from object files -\&\fIobjfile\fR. The list of object files may include archives. -At least one object file must be given. -.PP -\&\fBstrip\fR modifies the files named in its argument, -rather than writing modified copies under different names. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-F\fR \fIbfdname\fR" 4 -.IX Item "-F bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Treat the original \fIobjfile\fR as a file with the object -code format \fIbfdname\fR, and rewrite it in the same format. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Show a summary of the options to \fBstrip\fR and exit. -.IP "\fB\-\-info\fR" 4 -.IX Item "--info" -Display a list showing all architectures and object formats available. -.IP "\fB\-I\fR \fIbfdname\fR" 4 -.IX Item "-I bfdname" -.PD 0 -.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 -.IX Item "--input-target=bfdname" -.PD -Treat the original \fIobjfile\fR as a file with the object -code format \fIbfdname\fR. -.IP "\fB\-O\fR \fIbfdname\fR" 4 -.IX Item "-O bfdname" -.PD 0 -.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4 -.IX Item "--output-target=bfdname" -.PD -Replace \fIobjfile\fR with a file in the output format \fIbfdname\fR. -.IP "\fB\-R\fR \fIsectionname\fR" 4 -.IX Item "-R sectionname" -.PD 0 -.IP "\fB\-\-remove\-section=\fR\fIsectionname\fR" 4 -.IX Item "--remove-section=sectionname" -.PD -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. The wildcard -character \fB*\fR may be given at the end of \fIsectionname\fR. If -so, then any section starting with \fIsectionname\fR will be removed. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-strip\-all\fR" 4 -.IX Item "--strip-all" -.PD -Remove all symbols. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.IP "\fB\-\-strip\-debug\fR" 4 -.IX Item "--strip-debug" -.PD -Remove debugging symbols only. -.IP "\fB\-\-strip\-dwo\fR" 4 -.IX Item "--strip-dwo" -Remove the contents of all \s-1DWARF\s0 .dwo sections, leaving the -remaining debugging sections and all symbols intact. -See the description of this option in the \fBobjcopy\fR section -for more information. -.IP "\fB\-\-strip\-unneeded\fR" 4 -.IX Item "--strip-unneeded" -Remove all symbols that are not needed for relocation processing. -.IP "\fB\-K\fR \fIsymbolname\fR" 4 -.IX Item "-K symbolname" -.PD 0 -.IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--keep-symbol=symbolname" -.PD -When stripping symbols, keep symbol \fIsymbolname\fR even if it would -normally be stripped. This option may be given more than once. -.IP "\fB\-N\fR \fIsymbolname\fR" 4 -.IX Item "-N symbolname" -.PD 0 -.IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--strip-symbol=symbolname" -.PD -Remove symbol \fIsymbolname\fR from the source file. This option may be -given more than once, and may be combined with strip options other than -\&\fB\-K\fR. -.IP "\fB\-o\fR \fIfile\fR" 4 -.IX Item "-o file" -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. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-preserve\-dates\fR" 4 -.IX Item "--preserve-dates" -.PD -Preserve the access and modification dates of the file. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -.PD 0 -.IP "\fB\-\-enable\-deterministic\-archives\fR" 4 -.IX Item "--enable-deterministic-archives" -.PD -Operate in \fIdeterministic\fR mode. When copying archive members -and writing the archive index, use zero for UIDs, GIDs, timestamps, -and use consistent file modes for all files. -.Sp -If \fIbinutils\fR was configured with -\&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by default. -It can be disabled with the \fB\-U\fR option, below. -.IP "\fB\-U\fR" 4 -.IX Item "-U" -.PD 0 -.IP "\fB\-\-disable\-deterministic\-archives\fR" 4 -.IX Item "--disable-deterministic-archives" -.PD -Do \fInot\fR operate in \fIdeterministic\fR mode. This is the -inverse of the \fB\-D\fR option, above: when copying archive members -and writing the archive index, use their actual \s-1UID\s0, \s-1GID\s0, timestamp, -and file mode values. -.Sp -This is the default unless \fIbinutils\fR was configured with -\&\fB\-\-enable\-deterministic\-archives\fR. -.IP "\fB\-w\fR" 4 -.IX Item "-w" -.PD 0 -.IP "\fB\-\-wildcard\fR" 4 -.IX Item "--wildcard" -.PD -Permit regular expressions in \fIsymbolname\fRs used in other command -line options. The question mark (?), asterisk (*), backslash (\e) and -square brackets ([]) operators can be used anywhere in the symbol -name. If the first character of the symbol name is the exclamation -point (!) then the sense of the switch is reversed for that symbol. -For example: -.Sp -.Vb 1 -\& \-w \-K !foo \-K fo* -.Ve -.Sp -would cause strip to only keep symbols that start with the letters -\&\*(L"fo\*(R", but to discard the symbol \*(L"foo\*(R". -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-discard\-all\fR" 4 -.IX Item "--discard-all" -.PD -Remove non-global symbols. -.IP "\fB\-X\fR" 4 -.IX Item "-X" -.PD 0 -.IP "\fB\-\-discard\-locals\fR" 4 -.IX Item "--discard-locals" -.PD -Remove compiler-generated local symbols. -(These usually start with \fBL\fR or \fB.\fR.) -.IP "\fB\-\-keep\-file\-symbols\fR" 4 -.IX Item "--keep-file-symbols" -When stripping a file, perhaps with \fB\-\-strip\-debug\fR or -\&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names, -which would otherwise get stripped. -.IP "\fB\-\-only\-keep\-debug\fR" 4 -.IX Item "--only-keep-debug" -Strip a file, removing contents of any sections that would not be -stripped by \fB\-\-strip\-debug\fR and leaving the debugging sections -intact. In \s-1ELF\s0 files, this preserves all note sections in the output. -.Sp -The intention is that this option will be used in conjunction with -\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a -stripped binary which will occupy less space in \s-1RAM\s0 and in a -distribution and the second a debugging information file which is only -needed if debugging abilities are required. The suggested procedure -to create these files is as follows: -.RS 4 -.IP "1." 4 -.IX Item "1." -\&\f(CW\*(C`foo\*(C'\fR then... -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -create a file containing the debugging info. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -stripped executable. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -to add a link to the debugging info into the stripped executable. -.RE -.RS 4 -.Sp -Note\-\-\-the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info -file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is -optional. You could instead do this: -.IP "1." 4 -.IX Item "1." -.PD 0 -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.RE -.RS 4 -.PD -.Sp -i.e., the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the -full executable. It does not have to be a file created by the -\&\fB\-\-only\-keep\-debug\fR switch. -.Sp -Note\-\-\-this switch is only intended for use on fully linked files. It -does not make sense to use it on object files where the debugging -information may be incomplete. Besides the gnu_debuglink feature -currently only supports the presence of one filename containing -debugging information, not multiple filenames on a one-per-object-file -basis. -.RE -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number for \fBstrip\fR. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-verbose\fR" 4 -.IX Item "--verbose" -.PD -Verbose output: list all object files modified. In the case of -archives, \fBstrip \-v\fR lists all members of the archive. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/windmc.1 binutils-2.24/binutils/doc/windmc.1 --- binutils-2.24.orig/binutils/doc/windmc.1 2013-11-18 09:49:32.000000000 +0100 +++ binutils-2.24/binutils/doc/windmc.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,351 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "WINDMC 1" -.TH WINDMC 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -windmc \- generates Windows message resources. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -windmc [options] input-file -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBwindmc\fR reads message definitions from an input file (.mc) and -translate them into a set of output files. The output files may be of -four kinds: -.ie n .IP """h""" 4 -.el .IP "\f(CWh\fR" 4 -.IX Item "h" -A C header file containing the message definitions. -.ie n .IP """rc""" 4 -.el .IP "\f(CWrc\fR" 4 -.IX Item "rc" -A resource file compilable by the \fBwindres\fR tool. -.ie n .IP """bin""" 4 -.el .IP "\f(CWbin\fR" 4 -.IX Item "bin" -One or more binary files containing the resource data for a specific -message language. -.ie n .IP """dbg""" 4 -.el .IP "\f(CWdbg\fR" 4 -.IX Item "dbg" -A C include file that maps message id's to their symbolic name. -.PP -The exact description of these different formats is available in -documentation from Microsoft. -.PP -When \fBwindmc\fR converts from the \f(CW\*(C`mc\*(C'\fR format to the \f(CW\*(C`bin\*(C'\fR -format, \f(CW\*(C`rc\*(C'\fR, \f(CW\*(C`h\*(C'\fR, and optional \f(CW\*(C`dbg\*(C'\fR it is acting like the -Windows Message Compiler. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-ascii_in\fR" 4 -.IX Item "--ascii_in" -.PD -Specifies that the input file specified is \s-1ASCII\s0. This is the default -behaviour. -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-\-ascii_out\fR" 4 -.IX Item "--ascii_out" -.PD -Specifies that messages in the output \f(CW\*(C`bin\*(C'\fR files should be in \s-1ASCII\s0 -format. -.IP "\fB\-b\fR" 4 -.IX Item "-b" -.PD 0 -.IP "\fB\-\-binprefix\fR" 4 -.IX Item "--binprefix" -.PD -Specifies that \f(CW\*(C`bin\*(C'\fR filenames should have to be prefixed by the -basename of the source file. -.IP "\fB\-c\fR" 4 -.IX Item "-c" -.PD 0 -.IP "\fB\-\-customflag\fR" 4 -.IX Item "--customflag" -.PD -Sets the customer bit in all message id's. -.IP "\fB\-C\fR \fIcodepage\fR" 4 -.IX Item "-C codepage" -.PD 0 -.IP "\fB\-\-codepage_in\fR \fIcodepage\fR" 4 -.IX Item "--codepage_in codepage" -.PD -Sets the default codepage to be used to convert input file to \s-1UTF16\s0. The -default is ocdepage 1252. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-\-decimal_values\fR" 4 -.IX Item "--decimal_values" -.PD -Outputs the constants in the header file in decimal. Default is using -hexadecimal output. -.IP "\fB\-e\fR \fIext\fR" 4 -.IX Item "-e ext" -.PD 0 -.IP "\fB\-\-extension\fR \fIext\fR" 4 -.IX Item "--extension ext" -.PD -The extension for the header file. The default is .h extension. -.IP "\fB\-F\fR \fItarget\fR" 4 -.IX Item "-F target" -.PD 0 -.IP "\fB\-\-target\fR \fItarget\fR" 4 -.IX Item "--target target" -.PD -Specify the \s-1BFD\s0 format to use for a bin file as output. This -is a \s-1BFD\s0 target name; you can use the \fB\-\-help\fR option to see a list -of supported targets. Normally \fBwindmc\fR will use the default -format, which is the first one listed by the \fB\-\-help\fR option. -.IP "\fB\-h\fR \fIpath\fR" 4 -.IX Item "-h path" -.PD 0 -.IP "\fB\-\-headerdir\fR \fIpath\fR" 4 -.IX Item "--headerdir path" -.PD -The target directory of the generated header file. The default is the -current directory. -.IP "\fB\-H\fR" 4 -.IX Item "-H" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Displays a list of command line options and then exits. -.IP "\fB\-m\fR \fIcharacters\fR" 4 -.IX Item "-m characters" -.PD 0 -.IP "\fB\-\-maxlength\fR \fIcharacters\fR" 4 -.IX Item "--maxlength characters" -.PD -Instructs \fBwindmc\fR to generate a warning if the length -of any message exceeds the number specified. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-\-nullterminate\fR" 4 -.IX Item "--nullterminate" -.PD -Terminate message text in \f(CW\*(C`bin\*(C'\fR files by zero. By default they are -terminated by \s-1CR/LF\s0. -.IP "\fB\-o\fR" 4 -.IX Item "-o" -.PD 0 -.IP "\fB\-\-hresult_use\fR" 4 -.IX Item "--hresult_use" -.PD -Not yet implemented. Instructs \f(CW\*(C`windmc\*(C'\fR to generate an \s-1OLE2\s0 header -file, using \s-1HRESULT\s0 definitions. Status codes are used if the flag is not -specified. -.IP "\fB\-O\fR \fIcodepage\fR" 4 -.IX Item "-O codepage" -.PD 0 -.IP "\fB\-\-codepage_out\fR \fIcodepage\fR" 4 -.IX Item "--codepage_out codepage" -.PD -Sets the default codepage to be used to output text files. The default -is ocdepage 1252. -.IP "\fB\-r\fR \fIpath\fR" 4 -.IX Item "-r path" -.PD 0 -.IP "\fB\-\-rcdir\fR \fIpath\fR" 4 -.IX Item "--rcdir path" -.PD -The target directory for the generated \f(CW\*(C`rc\*(C'\fR script and the generated -\&\f(CW\*(C`bin\*(C'\fR files that the resource compiler script includes. The default -is the current directory. -.IP "\fB\-u\fR" 4 -.IX Item "-u" -.PD 0 -.IP "\fB\-\-unicode_in\fR" 4 -.IX Item "--unicode_in" -.PD -Specifies that the input file is \s-1UTF16\s0. -.IP "\fB\-U\fR" 4 -.IX Item "-U" -.PD 0 -.IP "\fB\-\-unicode_out\fR" 4 -.IX Item "--unicode_out" -.PD -Specifies that messages in the output \f(CW\*(C`bin\*(C'\fR file should be in \s-1UTF16\s0 -format. This is the default behaviour. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-verbose\fR" 4 -.IX Item "--verbose" -.PD -Enable verbose mode. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Prints the version number for \fBwindmc\fR. -.IP "\fB\-x\fR \fIpath\fR" 4 -.IX Item "-x path" -.PD 0 -.IP "\fB\-\-xdgb\fR \fIpath\fR" 4 -.IX Item "--xdgb path" -.PD -The path of the \f(CW\*(C`dbg\*(C'\fR C include file that maps message id's to the -symbolic name. No such file is generated without specifying the switch. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/doc/windres.1 binutils-2.24/binutils/doc/windres.1 --- binutils-2.24.orig/binutils/doc/windres.1 2013-11-18 09:49:31.000000000 +0100 +++ binutils-2.24/binutils/doc/windres.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,359 +0,0 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.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. \*(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- -.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\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" 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 "WINDRES 1" -.TH WINDRES 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -windres \- manipulate Windows resources. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -windres [options] [input\-file] [output\-file] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBwindres\fR reads resources from an input file and copies them into -an output file. Either file may be in one of three formats: -.ie n .IP """rc""" 4 -.el .IP "\f(CWrc\fR" 4 -.IX Item "rc" -A text format read by the Resource Compiler. -.ie n .IP """res""" 4 -.el .IP "\f(CWres\fR" 4 -.IX Item "res" -A binary format generated by the Resource Compiler. -.ie n .IP """coff""" 4 -.el .IP "\f(CWcoff\fR" 4 -.IX Item "coff" -A \s-1COFF\s0 object or executable. -.PP -The exact description of these different formats is available in -documentation from Microsoft. -.PP -When \fBwindres\fR converts from the \f(CW\*(C`rc\*(C'\fR format to the \f(CW\*(C`res\*(C'\fR -format, it is acting like the Windows Resource Compiler. When -\&\fBwindres\fR converts from the \f(CW\*(C`res\*(C'\fR format to the \f(CW\*(C`coff\*(C'\fR -format, it is acting like the Windows \f(CW\*(C`CVTRES\*(C'\fR program. -.PP -When \fBwindres\fR generates an \f(CW\*(C`rc\*(C'\fR file, the output is similar -but not identical to the format expected for the input. When an input -\&\f(CW\*(C`rc\*(C'\fR file refers to an external filename, an output \f(CW\*(C`rc\*(C'\fR file -will instead include the file contents. -.PP -If the input or output format is not specified, \fBwindres\fR will -guess based on the file name, or, for the input file, the file contents. -A file with an extension of \fI.rc\fR will be treated as an \f(CW\*(C`rc\*(C'\fR -file, a file with an extension of \fI.res\fR will be treated as a -\&\f(CW\*(C`res\*(C'\fR file, and a file with an extension of \fI.o\fR or -\&\fI.exe\fR will be treated as a \f(CW\*(C`coff\*(C'\fR file. -.PP -If no output file is specified, \fBwindres\fR will print the resources -in \f(CW\*(C`rc\*(C'\fR format to standard output. -.PP -The normal use is for you to write an \f(CW\*(C`rc\*(C'\fR file, use \fBwindres\fR -to convert it to a \s-1COFF\s0 object file, and then link the \s-1COFF\s0 file into -your application. This will make the resources described in the -\&\f(CW\*(C`rc\*(C'\fR file available to Windows. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-i\fR \fIfilename\fR" 4 -.IX Item "-i filename" -.PD 0 -.IP "\fB\-\-input\fR \fIfilename\fR" 4 -.IX Item "--input filename" -.PD -The name of the input file. If this option is not used, then -\&\fBwindres\fR will use the first non-option argument as the input file -name. If there are no non-option arguments, then \fBwindres\fR will -read from standard input. \fBwindres\fR can not read a \s-1COFF\s0 file from -standard input. -.IP "\fB\-o\fR \fIfilename\fR" 4 -.IX Item "-o filename" -.PD 0 -.IP "\fB\-\-output\fR \fIfilename\fR" 4 -.IX Item "--output filename" -.PD -The name of the output file. If this option is not used, then -\&\fBwindres\fR 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 \fBwindres\fR will write to standard output. -\&\fBwindres\fR can not write a \s-1COFF\s0 file to standard output. Note, -for compatibility with \fBrc\fR the option \fB\-fo\fR is also -accepted, but its use is not recommended. -.IP "\fB\-J\fR \fIformat\fR" 4 -.IX Item "-J format" -.PD 0 -.IP "\fB\-\-input\-format\fR \fIformat\fR" 4 -.IX Item "--input-format format" -.PD -The input format to read. \fIformat\fR may be \fBres\fR, \fBrc\fR, or -\&\fBcoff\fR. If no input format is specified, \fBwindres\fR will -guess, as described above. -.IP "\fB\-O\fR \fIformat\fR" 4 -.IX Item "-O format" -.PD 0 -.IP "\fB\-\-output\-format\fR \fIformat\fR" 4 -.IX Item "--output-format format" -.PD -The output format to generate. \fIformat\fR may be \fBres\fR, -\&\fBrc\fR, or \fBcoff\fR. If no output format is specified, -\&\fBwindres\fR will guess, as described above. -.IP "\fB\-F\fR \fItarget\fR" 4 -.IX Item "-F target" -.PD 0 -.IP "\fB\-\-target\fR \fItarget\fR" 4 -.IX Item "--target target" -.PD -Specify the \s-1BFD\s0 format to use for a \s-1COFF\s0 file as input or output. This -is a \s-1BFD\s0 target name; you can use the \fB\-\-help\fR option to see a list -of supported targets. Normally \fBwindres\fR will use the default -format, which is the first one listed by the \fB\-\-help\fR option. -.IP "\fB\-\-preprocessor\fR \fIprogram\fR" 4 -.IX Item "--preprocessor program" -When \fBwindres\fR reads an \f(CW\*(C`rc\*(C'\fR 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 \f(CW\*(C`gcc \-E \-xc\-header \-DRC_INVOKED\*(C'\fR. -.IP "\fB\-\-preprocessor\-arg\fR \fIoption\fR" 4 -.IX Item "--preprocessor-arg option" -When \fBwindres\fR reads an \f(CW\*(C`rc\*(C'\fR file, it runs it through -the C preprocessor first. This option may be used to specify additional -text to be passed to preprocessor on its command line. -This option can be used multiple times to add multiple options to the -preprocessor command line. -.IP "\fB\-I\fR \fIdirectory\fR" 4 -.IX Item "-I directory" -.PD 0 -.IP "\fB\-\-include\-dir\fR \fIdirectory\fR" 4 -.IX Item "--include-dir directory" -.PD -Specify an include directory to use when reading an \f(CW\*(C`rc\*(C'\fR file. -\&\fBwindres\fR will pass this to the preprocessor as an \fB\-I\fR -option. \fBwindres\fR will also search this directory when looking for -files named in the \f(CW\*(C`rc\*(C'\fR file. If the argument passed to this command -matches any of the supported \fIformats\fR (as described in the \fB\-J\fR -option), it will issue a deprecation warning, and behave just like the -\&\fB\-J\fR option. New programs should not use this behaviour. If a -directory happens to match a \fIformat\fR, simple prefix it with \fB./\fR -to disable the backward compatibility. -.IP "\fB\-D\fR \fItarget\fR" 4 -.IX Item "-D target" -.PD 0 -.IP "\fB\-\-define\fR \fIsym\fR\fB[=\fR\fIval\fR\fB]\fR" 4 -.IX Item "--define sym[=val]" -.PD -Specify a \fB\-D\fR option to pass to the preprocessor when reading an -\&\f(CW\*(C`rc\*(C'\fR file. -.IP "\fB\-U\fR \fItarget\fR" 4 -.IX Item "-U target" -.PD 0 -.IP "\fB\-\-undefine\fR \fIsym\fR" 4 -.IX Item "--undefine sym" -.PD -Specify a \fB\-U\fR option to pass to the preprocessor when reading an -\&\f(CW\*(C`rc\*(C'\fR file. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -Ignored for compatibility with rc. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -Enable verbose mode. This tells you what the preprocessor is if you -didn't specify one. -.IP "\fB\-c\fR \fIval\fR" 4 -.IX Item "-c val" -.PD 0 -.IP "\fB\-\-codepage\fR \fIval\fR" 4 -.IX Item "--codepage val" -.PD -Specify the default codepage to use when reading an \f(CW\*(C`rc\*(C'\fR file. -\&\fIval\fR should be a hexadecimal prefixed by \fB0x\fR or decimal -codepage code. The valid range is from zero up to 0xffff, but the -validity of the codepage is host and configuration dependent. -.IP "\fB\-l\fR \fIval\fR" 4 -.IX Item "-l val" -.PD 0 -.IP "\fB\-\-language\fR \fIval\fR" 4 -.IX Item "--language val" -.PD -Specify the default language to use when reading an \f(CW\*(C`rc\*(C'\fR file. -\&\fIval\fR should be a hexadecimal language code. The low eight bits are -the language, and the high eight bits are the sublanguage. -.IP "\fB\-\-use\-temp\-file\fR" 4 -.IX 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). -.IP "\fB\-\-no\-use\-temp\-file\fR" 4 -.IX Item "--no-use-temp-file" -Use popen, not a temporary file, to read the output of the preprocessor. -This is the default behaviour. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Prints a usage summary. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Prints the version number for \fBwindres\fR. -.IP "\fB\-\-yydebug\fR" 4 -.IX Item "--yydebug" -If \fBwindres\fR is compiled with \f(CW\*(C`YYDEBUG\*(C'\fR defined as \f(CW1\fR, -this will turn on parser debugging. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991\-2013 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.3 -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 -Nur binutils-2.24.orig/binutils/dwarf.c binutils-2.24/binutils/dwarf.c --- binutils-2.24.orig/binutils/dwarf.c 2013-11-08 11:13:48.000000000 +0100 +++ binutils-2.24/binutils/dwarf.c 2016-06-30 21:26:12.585890467 +0200 @@ -263,7 +263,7 @@ *length_return = num_read; if (sign && (shift < 8 * sizeof (result)) && (byte & 0x40)) - result |= -1L << shift; + result |= (dwarf_vma) -1 << shift; return result; } @@ -2663,14 +2663,10 @@ linfo->li_max_ops_per_insn = 1; SAFE_BYTE_GET_AND_INC (linfo->li_default_is_stmt, hdrptr, 1, end); - SAFE_BYTE_GET_AND_INC (linfo->li_line_base, hdrptr, 1, end); + SAFE_SIGNED_BYTE_GET_AND_INC (linfo->li_line_base, hdrptr, 1, end); SAFE_BYTE_GET_AND_INC (linfo->li_line_range, hdrptr, 1, end); SAFE_BYTE_GET_AND_INC (linfo->li_opcode_base, hdrptr, 1, end); - /* Sign extend the line base field. */ - linfo->li_line_base <<= 24; - linfo->li_line_base >>= 24; - * end_of_sequence = data + linfo->li_length + initial_length_size; return hdrptr; } diff -Nur binutils-2.24.orig/binutils/MAINTAINERS binutils-2.24/binutils/MAINTAINERS --- binutils-2.24.orig/binutils/MAINTAINERS 2013-11-08 11:13:48.000000000 +0100 +++ binutils-2.24/binutils/MAINTAINERS 2016-06-30 21:26:12.585890467 +0200 @@ -109,6 +109,8 @@ MN10300 Alexandre Oliva Moxie Anthony Green MSP430 Dmitry Diky + NDS32 Kuan-Lin Chen + NDS32 Wei-Cheng Wang NetBSD support Matt Thomas Nios II Sandra Loosemore Nios II Andrew Jenner diff -Nur binutils-2.24.orig/binutils/Makefile.am binutils-2.24/binutils/Makefile.am --- binutils-2.24.orig/binutils/Makefile.am 2013-11-04 16:33:37.000000000 +0100 +++ binutils-2.24/binutils/Makefile.am 2016-06-30 21:26:12.585890467 +0200 @@ -241,7 +241,7 @@ objdump_SOURCES = objdump.c dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS) $(ELFLIBS) EXTRA_objdump_SOURCES = od-xcoff.c -objdump_LDADD = $(OBJDUMP_PRIVATE_OFILES) $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) +objdump_LDADD = $(OBJDUMP_PRIVATE_OFILES) $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) -ldl objdump.@OBJEXT@:objdump.c if am__fastdepCC diff -Nur binutils-2.24.orig/binutils/Makefile.in binutils-2.24/binutils/Makefile.in --- binutils-2.24.orig/binutils/Makefile.in 2013-11-04 16:33:37.000000000 +0100 +++ binutils-2.24/binutils/Makefile.in 2016-06-30 21:26:12.589890622 +0200 @@ -581,7 +581,7 @@ nm_new_SOURCES = nm.c $(BULIBS) objdump_SOURCES = objdump.c dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS) $(ELFLIBS) EXTRA_objdump_SOURCES = od-xcoff.c -objdump_LDADD = $(OBJDUMP_PRIVATE_OFILES) $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) +objdump_LDADD = $(OBJDUMP_PRIVATE_OFILES) $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) -ldl cxxfilt_SOURCES = cxxfilt.c $(BULIBS) ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \ emul_$(EMULATION).c $(BULIBS) diff -Nur binutils-2.24.orig/binutils/mcparse.c binutils-2.24/binutils/mcparse.c --- binutils-2.24.orig/binutils/mcparse.c 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/mcparse.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,2156 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NL = 258, - MCIDENT = 259, - MCFILENAME = 260, - MCLINE = 261, - MCCOMMENT = 262, - MCTOKEN = 263, - MCENDLINE = 264, - MCLANGUAGENAMES = 265, - MCFACILITYNAMES = 266, - MCSEVERITYNAMES = 267, - MCOUTPUTBASE = 268, - MCMESSAGEIDTYPEDEF = 269, - MCLANGUAGE = 270, - MCMESSAGEID = 271, - MCSEVERITY = 272, - MCFACILITY = 273, - MCSYMBOLICNAME = 274, - MCNUMBER = 275 - }; -#endif -/* Tokens. */ -#define NL 258 -#define MCIDENT 259 -#define MCFILENAME 260 -#define MCLINE 261 -#define MCCOMMENT 262 -#define MCTOKEN 263 -#define MCENDLINE 264 -#define MCLANGUAGENAMES 265 -#define MCFACILITYNAMES 266 -#define MCSEVERITYNAMES 267 -#define MCOUTPUTBASE 268 -#define MCMESSAGEIDTYPEDEF 269 -#define MCLANGUAGE 270 -#define MCMESSAGEID 271 -#define MCSEVERITY 272 -#define MCFACILITY 273 -#define MCSYMBOLICNAME 274 -#define MCNUMBER 275 - - - - -/* Copy the first part of user declarations. */ -#line 1 "mcparse.y" - /* mcparse.y -- parser for Windows mc files - Copyright 2007 - Free Software Foundation, Inc. - - Parser for Windows mc files - Written by Kai Tietz, Onevision. - - 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* This is a parser for Windows rc files. It is based on the parser - by Gunther Ebert . */ - -#include "sysdep.h" -#include "bfd.h" -#include "bucomm.h" -#include "libiberty.h" -#include "windmc.h" -#include "safe-ctype.h" - -static rc_uint_type mc_last_id = 0; -static rc_uint_type mc_sefa_val = 0; -static unichar *mc_last_symbol = NULL; -static const mc_keyword *mc_cur_severity = NULL; -static const mc_keyword *mc_cur_facility = NULL; -static mc_node *cur_node = NULL; - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 45 "mcparse.y" -{ - rc_uint_type ival; - unichar *ustr; - const mc_keyword *tok; - mc_node *nod; -} -/* Line 193 of yacc.c. */ -#line 186 "mcparse.c" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 216 of yacc.c. */ -#line 199 "mcparse.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 114 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 26 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 29 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 82 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 125 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 275 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 22, 23, 2, 25, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 24, 2, - 2, 21, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 6, 9, 11, 13, 15, 17, - 23, 29, 33, 36, 42, 48, 52, 55, 61, 67, - 71, 74, 78, 82, 86, 89, 91, 94, 96, 101, - 105, 108, 110, 113, 115, 120, 124, 127, 129, 132, - 134, 141, 148, 153, 157, 160, 161, 164, 167, 168, - 173, 177, 181, 184, 185, 187, 190, 193, 194, 197, - 200, 203, 207, 211, 215, 217, 220, 225, 227, 230, - 232, 235, 237, 240, 246, 252, 258, 263, 266, 268, - 270, 271, 272 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 27, 0, -1, 28, -1, -1, 28, 29, -1, 30, - -1, 38, -1, 49, -1, 1, -1, 12, 21, 22, - 31, 23, -1, 12, 21, 22, 31, 1, -1, 12, - 21, 1, -1, 12, 1, -1, 10, 21, 22, 35, - 23, -1, 10, 21, 22, 35, 1, -1, 10, 21, - 1, -1, 10, 1, -1, 11, 21, 22, 33, 23, - -1, 11, 21, 22, 33, 1, -1, 11, 21, 1, - -1, 11, 1, -1, 13, 21, 20, -1, 14, 21, - 4, -1, 14, 21, 1, -1, 14, 1, -1, 32, - -1, 31, 32, -1, 1, -1, 51, 21, 20, 37, - -1, 51, 21, 1, -1, 51, 1, -1, 34, -1, - 33, 34, -1, 1, -1, 51, 21, 20, 37, -1, - 51, 21, 1, -1, 51, 1, -1, 36, -1, 35, - 36, -1, 1, -1, 51, 21, 20, 54, 24, 5, - -1, 51, 21, 20, 54, 24, 1, -1, 51, 21, - 20, 1, -1, 51, 21, 1, -1, 51, 1, -1, - -1, 24, 4, -1, 24, 1, -1, -1, 40, 42, - 39, 46, -1, 16, 21, 41, -1, 16, 21, 1, - -1, 16, 1, -1, -1, 20, -1, 25, 20, -1, - 25, 1, -1, -1, 42, 43, -1, 42, 44, -1, - 42, 45, -1, 17, 21, 8, -1, 18, 21, 8, - -1, 19, 21, 4, -1, 47, -1, 46, 47, -1, - 50, 53, 48, 9, -1, 6, -1, 48, 6, -1, - 1, -1, 48, 1, -1, 7, -1, 49, 7, -1, - 15, 52, 21, 8, 3, -1, 15, 52, 21, 4, - 3, -1, 15, 52, 21, 51, 1, -1, 15, 52, - 21, 1, -1, 15, 1, -1, 4, -1, 8, -1, - -1, -1, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 67, 67, 70, 72, 74, 75, 76, 81, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 103, 107, 111, 118, 119, 120, 124, 128, - 129, 133, 134, 135, 139, 143, 144, 148, 149, 150, - 154, 158, 159, 160, 161, 166, 169, 173, 178, 177, - 190, 191, 192, 196, 199, 203, 207, 212, 219, 225, - 231, 239, 247, 255, 262, 263, 267, 277, 281, 293, - 294, 297, 298, 312, 316, 321, 326, 331, 338, 339, - 343, 347, 351 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "NL", "MCIDENT", "MCFILENAME", "MCLINE", - "MCCOMMENT", "MCTOKEN", "MCENDLINE", "MCLANGUAGENAMES", - "MCFACILITYNAMES", "MCSEVERITYNAMES", "MCOUTPUTBASE", - "MCMESSAGEIDTYPEDEF", "MCLANGUAGE", "MCMESSAGEID", "MCSEVERITY", - "MCFACILITY", "MCSYMBOLICNAME", "MCNUMBER", "'='", "'('", "')'", "':'", - "'+'", "$accept", "input", "entities", "entity", "global_section", - "severitymaps", "severitymap", "facilitymaps", "facilitymap", "langmaps", - "langmap", "alias_name", "message", "@1", "id", "vid", "sefasy_def", - "severity", "facility", "symbol", "lang_entities", "lang_entity", - "lines", "comments", "lang", "token", "lex_want_nl", "lex_want_line", - "lex_want_filename", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 61, 40, 41, 58, 43 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 26, 27, 28, 28, 29, 29, 29, 29, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 31, 31, 31, 32, 32, - 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, - 36, 36, 36, 36, 36, 37, 37, 37, 39, 38, - 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, - 42, 43, 44, 45, 46, 46, 47, 48, 48, 48, - 48, 49, 49, 50, 50, 50, 50, 50, 51, 51, - 52, 53, 54 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 0, 2, 1, 1, 1, 1, 5, - 5, 3, 2, 5, 5, 3, 2, 5, 5, 3, - 2, 3, 3, 3, 2, 1, 2, 1, 4, 3, - 2, 1, 2, 1, 4, 3, 2, 1, 2, 1, - 6, 6, 4, 3, 2, 0, 2, 2, 0, 4, - 3, 3, 2, 0, 1, 2, 2, 0, 2, 2, - 2, 3, 3, 3, 1, 2, 4, 1, 2, 1, - 2, 1, 2, 5, 5, 5, 4, 2, 1, 1, - 0, 0, 0 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 3, 0, 0, 1, 8, 71, 0, 0, 0, 0, - 0, 0, 4, 5, 6, 57, 7, 16, 0, 20, - 0, 12, 0, 0, 24, 0, 52, 0, 48, 72, - 15, 0, 19, 0, 11, 0, 21, 23, 22, 51, - 54, 0, 50, 0, 0, 0, 0, 58, 59, 60, - 39, 78, 79, 0, 37, 0, 33, 0, 31, 0, - 27, 0, 25, 0, 56, 55, 0, 0, 0, 0, - 49, 64, 81, 14, 13, 38, 44, 0, 18, 17, - 32, 36, 0, 10, 9, 26, 30, 0, 61, 62, - 63, 77, 0, 65, 0, 43, 0, 35, 45, 29, - 45, 0, 69, 67, 0, 42, 0, 0, 34, 28, - 76, 78, 79, 0, 70, 68, 66, 0, 47, 46, - 74, 73, 75, 41, 40 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 1, 2, 12, 13, 61, 62, 57, 58, 53, - 54, 108, 14, 46, 15, 42, 28, 47, 48, 49, - 70, 71, 104, 16, 72, 55, 92, 94, 106 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -34 -static const yytype_int8 yypact[] = -{ - -34, 62, 70, -34, -34, -34, 15, 22, 30, -15, - 34, 37, -34, -34, -34, -34, 56, -34, 10, -34, - 12, -34, 20, 25, -34, 52, -34, 0, 80, -34, - -34, 71, -34, 84, -34, 86, -34, -34, -34, -34, - -34, 45, -34, 1, 68, 74, 76, -34, -34, -34, - -34, -34, -34, 4, -34, 38, -34, 6, -34, 39, - -34, 29, -34, 40, -34, -34, 93, 94, 99, 43, - 76, -34, -34, -34, -34, -34, -34, 46, -34, -34, - -34, -34, 47, -34, -34, -34, -34, 49, -34, -34, - -34, -34, 83, -34, 3, -34, 2, -34, 81, -34, - 81, 92, -34, -34, 48, -34, 82, 72, -34, -34, - -34, 104, 105, 108, -34, -34, -34, 73, -34, -34, - -34, -34, -34, -34, -34 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -34, -34, -34, -34, -34, -34, 50, -34, 53, -34, - 59, 13, -34, -34, -34, -34, -34, -34, -34, -34, - -34, 44, -34, -34, -34, -33, -34, -34, -34 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -83 -static const yytype_int8 yytable[] = -{ - 59, 39, 63, 105, 102, 73, 23, 78, 51, 103, - 51, 30, 52, 32, 52, -53, 17, -53, -53, -53, - 40, 34, 66, 19, 59, 41, -82, 74, 63, 79, - 83, 21, 31, 51, 33, 24, 18, 52, 26, 76, - 81, 86, 35, 20, 91, 36, 64, 95, 97, 114, - 99, 22, 84, 37, 115, 25, 38, 116, 27, 77, - 82, 87, 3, 29, -80, 65, 96, 98, 113, 100, - -2, 4, 50, 118, 123, 51, 119, 5, 124, 52, - 6, 7, 8, 9, 10, 56, 11, 60, 51, 67, - 51, 69, 52, 110, 52, 68, 111, 43, 44, 45, - 112, 88, 89, 90, 101, 107, 117, 120, 121, 122, - 80, 85, 75, 109, 93 -}; - -static const yytype_uint8 yycheck[] = -{ - 33, 1, 35, 1, 1, 1, 21, 1, 4, 6, - 4, 1, 8, 1, 8, 15, 1, 17, 18, 19, - 20, 1, 21, 1, 57, 25, 24, 23, 61, 23, - 1, 1, 22, 4, 22, 1, 21, 8, 1, 1, - 1, 1, 22, 21, 1, 20, 1, 1, 1, 1, - 1, 21, 23, 1, 6, 21, 4, 9, 21, 21, - 21, 21, 0, 7, 21, 20, 20, 20, 101, 20, - 0, 1, 1, 1, 1, 4, 4, 7, 5, 8, - 10, 11, 12, 13, 14, 1, 16, 1, 4, 21, - 4, 15, 8, 1, 8, 21, 4, 17, 18, 19, - 8, 8, 8, 4, 21, 24, 24, 3, 3, 1, - 57, 61, 53, 100, 70 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 27, 28, 0, 1, 7, 10, 11, 12, 13, - 14, 16, 29, 30, 38, 40, 49, 1, 21, 1, - 21, 1, 21, 21, 1, 21, 1, 21, 42, 7, - 1, 22, 1, 22, 1, 22, 20, 1, 4, 1, - 20, 25, 41, 17, 18, 19, 39, 43, 44, 45, - 1, 4, 8, 35, 36, 51, 1, 33, 34, 51, - 1, 31, 32, 51, 1, 20, 21, 21, 21, 15, - 46, 47, 50, 1, 23, 36, 1, 21, 1, 23, - 34, 1, 21, 1, 23, 32, 1, 21, 8, 8, - 4, 1, 52, 47, 53, 1, 20, 1, 20, 1, - 20, 21, 1, 6, 48, 1, 54, 24, 37, 37, - 1, 4, 8, 51, 1, 6, 9, 24, 1, 4, - 3, 3, 1, 1, 5 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 7: -#line 77 "mcparse.y" - { - cur_node = mc_add_node (); - cur_node->user_text = (yyvsp[(1) - (1)].ustr); - } - break; - - case 8: -#line 81 "mcparse.y" - { mc_fatal ("syntax error"); } - break; - - case 10: -#line 86 "mcparse.y" - { mc_fatal ("missing ')' in SeverityNames"); } - break; - - case 11: -#line 87 "mcparse.y" - { mc_fatal ("missing '(' in SeverityNames"); } - break; - - case 12: -#line 88 "mcparse.y" - { mc_fatal ("missing '=' for SeverityNames"); } - break; - - case 14: -#line 90 "mcparse.y" - { mc_fatal ("missing ')' in LanguageNames"); } - break; - - case 15: -#line 91 "mcparse.y" - { mc_fatal ("missing '(' in LanguageNames"); } - break; - - case 16: -#line 92 "mcparse.y" - { mc_fatal ("missing '=' for LanguageNames"); } - break; - - case 18: -#line 94 "mcparse.y" - { mc_fatal ("missing ')' in FacilityNames"); } - break; - - case 19: -#line 95 "mcparse.y" - { mc_fatal ("missing '(' in FacilityNames"); } - break; - - case 20: -#line 96 "mcparse.y" - { mc_fatal ("missing '=' for FacilityNames"); } - break; - - case 21: -#line 98 "mcparse.y" - { - if ((yyvsp[(3) - (3)].ival) != 10 && (yyvsp[(3) - (3)].ival) != 16) - mc_fatal ("OutputBase allows 10 or 16 as value"); - mcset_out_values_are_decimal = ((yyvsp[(3) - (3)].ival) == 10 ? 1 : 0); - } - break; - - case 22: -#line 104 "mcparse.y" - { - mcset_msg_id_typedef = (yyvsp[(3) - (3)].ustr); - } - break; - - case 23: -#line 108 "mcparse.y" - { - mc_fatal ("MessageIdTypedef expects an identifier"); - } - break; - - case 24: -#line 112 "mcparse.y" - { - mc_fatal ("missing '=' for MessageIdTypedef"); - } - break; - - case 27: -#line 120 "mcparse.y" - { mc_fatal ("severity ident missing"); } - break; - - case 28: -#line 125 "mcparse.y" - { - mc_add_keyword ((yyvsp[(1) - (4)].ustr), MCTOKEN, "severity", (yyvsp[(3) - (4)].ival), (yyvsp[(4) - (4)].ustr)); - } - break; - - case 29: -#line 128 "mcparse.y" - { mc_fatal ("severity number missing"); } - break; - - case 30: -#line 129 "mcparse.y" - { mc_fatal ("severity missing '='"); } - break; - - case 33: -#line 135 "mcparse.y" - { mc_fatal ("missing ident in FacilityNames"); } - break; - - case 34: -#line 140 "mcparse.y" - { - mc_add_keyword ((yyvsp[(1) - (4)].ustr), MCTOKEN, "facility", (yyvsp[(3) - (4)].ival), (yyvsp[(4) - (4)].ustr)); - } - break; - - case 35: -#line 143 "mcparse.y" - { mc_fatal ("facility number missing"); } - break; - - case 36: -#line 144 "mcparse.y" - { mc_fatal ("facility missing '='"); } - break; - - case 39: -#line 150 "mcparse.y" - { mc_fatal ("missing ident in LanguageNames"); } - break; - - case 40: -#line 155 "mcparse.y" - { - mc_add_keyword ((yyvsp[(1) - (6)].ustr), MCTOKEN, "language", (yyvsp[(3) - (6)].ival), (yyvsp[(6) - (6)].ustr)); - } - break; - - case 41: -#line 158 "mcparse.y" - { mc_fatal ("missing filename in LanguageNames"); } - break; - - case 42: -#line 159 "mcparse.y" - { mc_fatal ("missing ':' in LanguageNames"); } - break; - - case 43: -#line 160 "mcparse.y" - { mc_fatal ("missing language code in LanguageNames"); } - break; - - case 44: -#line 161 "mcparse.y" - { mc_fatal ("missing '=' for LanguageNames"); } - break; - - case 45: -#line 166 "mcparse.y" - { - (yyval.ustr) = NULL; - } - break; - - case 46: -#line 170 "mcparse.y" - { - (yyval.ustr) = (yyvsp[(2) - (2)].ustr); - } - break; - - case 47: -#line 173 "mcparse.y" - { mc_fatal ("illegal token in identifier"); (yyval.ustr) = NULL; } - break; - - case 48: -#line 178 "mcparse.y" - { - cur_node = mc_add_node (); - cur_node->symbol = mc_last_symbol; - cur_node->facility = mc_cur_facility; - cur_node->severity = mc_cur_severity; - cur_node->id = ((yyvsp[(1) - (2)].ival) & 0xffffUL); - cur_node->vid = ((yyvsp[(1) - (2)].ival) & 0xffffUL) | mc_sefa_val; - mc_last_id = (yyvsp[(1) - (2)].ival); - } - break; - - case 50: -#line 190 "mcparse.y" - { (yyval.ival) = (yyvsp[(3) - (3)].ival); } - break; - - case 51: -#line 191 "mcparse.y" - { mc_fatal ("missing number in MessageId"); (yyval.ival) = 0; } - break; - - case 52: -#line 192 "mcparse.y" - { mc_fatal ("missing '=' for MessageId"); (yyval.ival) = 0; } - break; - - case 53: -#line 196 "mcparse.y" - { - (yyval.ival) = ++mc_last_id; - } - break; - - case 54: -#line 200 "mcparse.y" - { - (yyval.ival) = (yyvsp[(1) - (1)].ival); - } - break; - - case 55: -#line 204 "mcparse.y" - { - (yyval.ival) = mc_last_id + (yyvsp[(2) - (2)].ival); - } - break; - - case 56: -#line 207 "mcparse.y" - { mc_fatal ("missing number after MessageId '+'"); } - break; - - case 57: -#line 212 "mcparse.y" - { - (yyval.ival) = 0; - mc_sefa_val = (mcset_custom_bit ? 1 : 0) << 29; - mc_last_symbol = NULL; - mc_cur_severity = NULL; - mc_cur_facility = NULL; - } - break; - - case 58: -#line 220 "mcparse.y" - { - if ((yyvsp[(1) - (2)].ival) & 1) - mc_warn (_("duplicate definition of Severity")); - (yyval.ival) = (yyvsp[(1) - (2)].ival) | 1; - } - break; - - case 59: -#line 226 "mcparse.y" - { - if ((yyvsp[(1) - (2)].ival) & 2) - mc_warn (_("duplicate definition of Facility")); - (yyval.ival) = (yyvsp[(1) - (2)].ival) | 2; - } - break; - - case 60: -#line 232 "mcparse.y" - { - if ((yyvsp[(1) - (2)].ival) & 4) - mc_warn (_("duplicate definition of SymbolicName")); - (yyval.ival) = (yyvsp[(1) - (2)].ival) | 4; - } - break; - - case 61: -#line 240 "mcparse.y" - { - mc_sefa_val &= ~ (0x3UL << 30); - mc_sefa_val |= (((yyvsp[(3) - (3)].tok)->nval & 0x3UL) << 30); - mc_cur_severity = (yyvsp[(3) - (3)].tok); - } - break; - - case 62: -#line 248 "mcparse.y" - { - mc_sefa_val &= ~ (0xfffUL << 16); - mc_sefa_val |= (((yyvsp[(3) - (3)].tok)->nval & 0xfffUL) << 16); - mc_cur_facility = (yyvsp[(3) - (3)].tok); - } - break; - - case 63: -#line 256 "mcparse.y" - { - mc_last_symbol = (yyvsp[(3) - (3)].ustr); - } - break; - - case 66: -#line 268 "mcparse.y" - { - mc_node_lang *h; - h = mc_add_node_lang (cur_node, (yyvsp[(1) - (4)].tok), cur_node->vid); - h->message = (yyvsp[(3) - (4)].ustr); - if (mcset_max_message_length != 0 && unichar_len (h->message) > mcset_max_message_length) - mc_warn ("message length to long"); - } - break; - - case 67: -#line 278 "mcparse.y" - { - (yyval.ustr) = (yyvsp[(1) - (1)].ustr); - } - break; - - case 68: -#line 282 "mcparse.y" - { - unichar *h; - rc_uint_type l1,l2; - l1 = unichar_len ((yyvsp[(1) - (2)].ustr)); - l2 = unichar_len ((yyvsp[(2) - (2)].ustr)); - h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar)); - if (l1) memcpy (h, (yyvsp[(1) - (2)].ustr), l1 * sizeof (unichar)); - if (l2) memcpy (&h[l1], (yyvsp[(2) - (2)].ustr), l2 * sizeof (unichar)); - h[l1 + l2] = 0; - (yyval.ustr) = h; - } - break; - - case 69: -#line 293 "mcparse.y" - { mc_fatal ("missing end of message text"); (yyval.ustr) = NULL; } - break; - - case 70: -#line 294 "mcparse.y" - { mc_fatal ("missing end of message text"); (yyval.ustr) = (yyvsp[(1) - (2)].ustr); } - break; - - case 71: -#line 297 "mcparse.y" - { (yyval.ustr) = (yyvsp[(1) - (1)].ustr); } - break; - - case 72: -#line 299 "mcparse.y" - { - unichar *h; - rc_uint_type l1,l2; - l1 = unichar_len ((yyvsp[(1) - (2)].ustr)); - l2 = unichar_len ((yyvsp[(2) - (2)].ustr)); - h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar)); - if (l1) memcpy (h, (yyvsp[(1) - (2)].ustr), l1 * sizeof (unichar)); - if (l2) memcpy (&h[l1], (yyvsp[(2) - (2)].ustr), l2 * sizeof (unichar)); - h[l1 + l2] = 0; - (yyval.ustr) = h; - } - break; - - case 73: -#line 313 "mcparse.y" - { - (yyval.tok) = (yyvsp[(4) - (5)].tok); - } - break; - - case 74: -#line 317 "mcparse.y" - { - (yyval.tok) = NULL; - mc_fatal (_("undeclared language identifier")); - } - break; - - case 75: -#line 322 "mcparse.y" - { - (yyval.tok) = NULL; - mc_fatal ("missing newline after Language"); - } - break; - - case 76: -#line 327 "mcparse.y" - { - (yyval.tok) = NULL; - mc_fatal ("missing ident for Language"); - } - break; - - case 77: -#line 332 "mcparse.y" - { - (yyval.tok) = NULL; - mc_fatal ("missing '=' for Language"); - } - break; - - case 78: -#line 338 "mcparse.y" - { (yyval.ustr) = (yyvsp[(1) - (1)].ustr); } - break; - - case 79: -#line 339 "mcparse.y" - { (yyval.ustr) = (yyvsp[(1) - (1)].tok)->usz; } - break; - - case 80: -#line 343 "mcparse.y" - { mclex_want_nl = 1; } - break; - - case 81: -#line 347 "mcparse.y" - { mclex_want_line = 1; } - break; - - case 82: -#line 351 "mcparse.y" - { mclex_want_filename = 1; } - break; - - -/* Line 1267 of yacc.c. */ -#line 1939 "mcparse.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -#line 354 "mcparse.y" - - -/* Something else. */ - diff -Nur binutils-2.24.orig/binutils/mcparse.h binutils-2.24/binutils/mcparse.h --- binutils-2.24.orig/binutils/mcparse.h 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/mcparse.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,103 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NL = 258, - MCIDENT = 259, - MCFILENAME = 260, - MCLINE = 261, - MCCOMMENT = 262, - MCTOKEN = 263, - MCENDLINE = 264, - MCLANGUAGENAMES = 265, - MCFACILITYNAMES = 266, - MCSEVERITYNAMES = 267, - MCOUTPUTBASE = 268, - MCMESSAGEIDTYPEDEF = 269, - MCLANGUAGE = 270, - MCMESSAGEID = 271, - MCSEVERITY = 272, - MCFACILITY = 273, - MCSYMBOLICNAME = 274, - MCNUMBER = 275 - }; -#endif -/* Tokens. */ -#define NL 258 -#define MCIDENT 259 -#define MCFILENAME 260 -#define MCLINE 261 -#define MCCOMMENT 262 -#define MCTOKEN 263 -#define MCENDLINE 264 -#define MCLANGUAGENAMES 265 -#define MCFACILITYNAMES 266 -#define MCSEVERITYNAMES 267 -#define MCOUTPUTBASE 268 -#define MCMESSAGEIDTYPEDEF 269 -#define MCLANGUAGE 270 -#define MCMESSAGEID 271 -#define MCSEVERITY 272 -#define MCFACILITY 273 -#define MCSYMBOLICNAME 274 -#define MCNUMBER 275 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 45 "mcparse.y" -{ - rc_uint_type ival; - unichar *ustr; - const mc_keyword *tok; - mc_node *nod; -} -/* Line 1529 of yacc.c. */ -#line 96 "mcparse.h" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - diff -Nur binutils-2.24.orig/binutils/NEWS binutils-2.24/binutils/NEWS --- binutils-2.24.orig/binutils/NEWS 2013-11-04 16:33:37.000000000 +0100 +++ binutils-2.24/binutils/NEWS 2016-06-30 21:26:12.589890622 +0200 @@ -1,5 +1,7 @@ -*- text -*- +* Add support for the Andes NDS32. + Changes in 2.24: * Objcopy now supports wildcard characters in command line options that take diff -Nur binutils-2.24.orig/binutils/nlmheader.c binutils-2.24/binutils/nlmheader.c --- binutils-2.24.orig/binutils/nlmheader.c 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/nlmheader.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,2698 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - CHECK = 258, - CODESTART = 259, - COPYRIGHT = 260, - CUSTOM = 261, - DATE = 262, - DEBUG_K = 263, - DESCRIPTION = 264, - EXIT = 265, - EXPORT = 266, - FLAG_ON = 267, - FLAG_OFF = 268, - FULLMAP = 269, - HELP = 270, - IMPORT = 271, - INPUT = 272, - MAP = 273, - MESSAGES = 274, - MODULE = 275, - MULTIPLE = 276, - OS_DOMAIN = 277, - OUTPUT = 278, - PSEUDOPREEMPTION = 279, - REENTRANT = 280, - SCREENNAME = 281, - SHARELIB = 282, - STACK = 283, - START = 284, - SYNCHRONIZE = 285, - THREADNAME = 286, - TYPE = 287, - VERBOSE = 288, - VERSIONK = 289, - XDCDATA = 290, - STRING = 291, - QUOTED_STRING = 292 - }; -#endif -/* Tokens. */ -#define CHECK 258 -#define CODESTART 259 -#define COPYRIGHT 260 -#define CUSTOM 261 -#define DATE 262 -#define DEBUG_K 263 -#define DESCRIPTION 264 -#define EXIT 265 -#define EXPORT 266 -#define FLAG_ON 267 -#define FLAG_OFF 268 -#define FULLMAP 269 -#define HELP 270 -#define IMPORT 271 -#define INPUT 272 -#define MAP 273 -#define MESSAGES 274 -#define MODULE 275 -#define MULTIPLE 276 -#define OS_DOMAIN 277 -#define OUTPUT 278 -#define PSEUDOPREEMPTION 279 -#define REENTRANT 280 -#define SCREENNAME 281 -#define SHARELIB 282 -#define STACK 283 -#define START 284 -#define SYNCHRONIZE 285 -#define THREADNAME 286 -#define TYPE 287 -#define VERBOSE 288 -#define VERSIONK 289 -#define XDCDATA 290 -#define STRING 291 -#define QUOTED_STRING 292 - - - - -/* Copy the first part of user declarations. */ -#line 1 "nlmheader.y" -/* nlmheader.y - parse NLM header specification keywords. - Copyright 1993, 1994, 1995, 1997, 1998, 2001, 2002, 2003, 2005, 2007, - 2010 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 3 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., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - -/* Written by Ian Lance Taylor . - - This bison file parses the commands recognized by the NetWare NLM - linker, except for lists of object files. It stores the - information in global variables. - - This implementation is based on the description in the NetWare Tool - Maker Specification manual, edition 1.0. */ - -#include "sysdep.h" -#include "safe-ctype.h" -#include "bfd.h" -#include "nlm/common.h" -#include "nlm/internal.h" -#include "bucomm.h" -#include "nlmconv.h" - -/* Information is stored in the structures pointed to by these - variables. */ - -Nlm_Internal_Fixed_Header *fixed_hdr; -Nlm_Internal_Variable_Header *var_hdr; -Nlm_Internal_Version_Header *version_hdr; -Nlm_Internal_Copyright_Header *copyright_hdr; -Nlm_Internal_Extended_Header *extended_hdr; - -/* Procedure named by CHECK. */ -char *check_procedure; -/* File named by CUSTOM. */ -char *custom_file; -/* Whether to generate debugging information (DEBUG). */ -bfd_boolean debug_info; -/* Procedure named by EXIT. */ -char *exit_procedure; -/* Exported symbols (EXPORT). */ -struct string_list *export_symbols; -/* List of files from INPUT. */ -struct string_list *input_files; -/* Map file name (MAP, FULLMAP). */ -char *map_file; -/* Whether a full map has been requested (FULLMAP). */ -bfd_boolean full_map; -/* File named by HELP. */ -char *help_file; -/* Imported symbols (IMPORT). */ -struct string_list *import_symbols; -/* File named by MESSAGES. */ -char *message_file; -/* Autoload module list (MODULE). */ -struct string_list *modules; -/* File named by OUTPUT. */ -char *output_file; -/* File named by SHARELIB. */ -char *sharelib_file; -/* Start procedure name (START). */ -char *start_procedure; -/* VERBOSE. */ -bfd_boolean verbose; -/* RPC description file (XDCDATA). */ -char *rpc_file; - -/* The number of serious errors that have occurred. */ -int parse_errors; - -/* The current symbol prefix when reading a list of import or export - symbols. */ -static char *symbol_prefix; - -/* Parser error message handler. */ -#define yyerror(msg) nlmheader_error (msg); - -/* Local functions. */ -static int yylex (void); -static void nlmlex_file_push (const char *); -static bfd_boolean nlmlex_file_open (const char *); -static int nlmlex_buf_init (void); -static char nlmlex_buf_add (int); -static long nlmlex_get_number (const char *); -static void nlmheader_identify (void); -static void nlmheader_warn (const char *, int); -static void nlmheader_error (const char *); -static struct string_list * string_list_cons (char *, struct string_list *); -static struct string_list * string_list_append (struct string_list *, - struct string_list *); -static struct string_list * string_list_append1 (struct string_list *, - char *); -static char *xstrdup (const char *); - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 113 "nlmheader.y" -{ - char *string; - struct string_list *list; -} -/* Line 193 of yacc.c. */ -#line 286 "nlmheader.c" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 216 of yacc.c. */ -#line 299 "nlmheader.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 64 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 73 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 40 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 11 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 52 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 82 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 292 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 38, 39, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 5, 6, 9, 12, 15, 18, 21, - 26, 28, 31, 34, 35, 39, 42, 45, 47, 50, - 53, 54, 58, 61, 63, 66, 69, 72, 74, 76, - 79, 81, 83, 86, 89, 92, 95, 97, 100, 103, - 105, 110, 114, 117, 118, 120, 122, 124, 127, 130, - 134, 136, 137 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 41, 0, -1, 42, -1, -1, 43, 42, -1, 3, - 36, -1, 4, 36, -1, 5, 37, -1, 6, 36, - -1, 7, 36, 36, 36, -1, 8, -1, 9, 37, - -1, 10, 36, -1, -1, 11, 44, 46, -1, 12, - 36, -1, 13, 36, -1, 14, -1, 14, 36, -1, - 15, 36, -1, -1, 16, 45, 46, -1, 17, 50, - -1, 18, -1, 18, 36, -1, 19, 36, -1, 20, - 50, -1, 21, -1, 22, -1, 23, 36, -1, 24, - -1, 25, -1, 26, 37, -1, 27, 36, -1, 28, - 36, -1, 29, 36, -1, 30, -1, 31, 37, -1, - 32, 36, -1, 33, -1, 34, 36, 36, 36, -1, - 34, 36, 36, -1, 35, 36, -1, -1, 47, -1, - 49, -1, 48, -1, 47, 49, -1, 47, 48, -1, - 38, 36, 39, -1, 36, -1, -1, 36, 50, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 144, 144, 149, 151, 157, 161, 166, 183, 187, - 205, 209, 225, 230, 229, 237, 242, 247, 252, 257, - 262, 261, 269, 273, 277, 281, 285, 289, 293, 297, - 304, 308, 312, 328, 332, 337, 341, 345, 361, 366, - 370, 394, 410, 420, 423, 434, 438, 442, 446, 455, - 466, 483, 486 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "CHECK", "CODESTART", "COPYRIGHT", - "CUSTOM", "DATE", "DEBUG_K", "DESCRIPTION", "EXIT", "EXPORT", "FLAG_ON", - "FLAG_OFF", "FULLMAP", "HELP", "IMPORT", "INPUT", "MAP", "MESSAGES", - "MODULE", "MULTIPLE", "OS_DOMAIN", "OUTPUT", "PSEUDOPREEMPTION", - "REENTRANT", "SCREENNAME", "SHARELIB", "STACK", "START", "SYNCHRONIZE", - "THREADNAME", "TYPE", "VERBOSE", "VERSIONK", "XDCDATA", "STRING", - "QUOTED_STRING", "'('", "')'", "$accept", "file", "commands", "command", - "@1", "@2", "symbol_list_opt", "symbol_list", "symbol_prefix", "symbol", - "string_list", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 40, 41 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 40, 41, 42, 42, 43, 43, 43, 43, 43, - 43, 43, 43, 44, 43, 43, 43, 43, 43, 43, - 45, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 46, 46, 47, 47, 47, 47, 48, - 49, 50, 50 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 0, 2, 2, 2, 2, 2, 4, - 1, 2, 2, 0, 3, 2, 2, 1, 2, 2, - 0, 3, 2, 1, 2, 2, 2, 1, 1, 2, - 1, 1, 2, 2, 2, 2, 1, 2, 2, 1, - 4, 3, 2, 0, 1, 1, 1, 2, 2, 3, - 1, 0, 2 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 3, 0, 0, 0, 0, 0, 10, 0, 0, 13, - 0, 0, 17, 0, 20, 51, 23, 0, 51, 27, - 28, 0, 30, 31, 0, 0, 0, 0, 36, 0, - 0, 39, 0, 0, 0, 2, 3, 5, 6, 7, - 8, 0, 11, 12, 43, 15, 16, 18, 19, 43, - 51, 22, 24, 25, 26, 29, 32, 33, 34, 35, - 37, 38, 0, 42, 1, 4, 0, 50, 0, 14, - 44, 46, 45, 21, 52, 41, 9, 0, 48, 47, - 40, 49 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 34, 35, 36, 44, 49, 69, 70, 71, 72, - 51 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -20 -static const yytype_int8 yypact[] = -{ - -3, -1, 1, 2, 4, 5, -20, 6, 8, -20, - 9, 10, 11, 12, -20, 13, 14, 16, 13, -20, - -20, 17, -20, -20, 18, 20, 21, 22, -20, 23, - 25, -20, 26, 27, 38, -20, -3, -20, -20, -20, - -20, 28, -20, -20, -2, -20, -20, -20, -20, -2, - 13, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, 30, -20, -20, -20, 31, -20, 32, -20, - -2, -20, -20, -20, -20, 33, -20, 3, -20, -20, - -20, -20 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -20, -20, 34, -20, -20, -20, 24, -20, -19, -16, - 15 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const yytype_uint8 yytable[] = -{ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 54, 67, 37, 68, 38, 64, 39, - 40, 41, 81, 42, 43, 45, 46, 47, 48, 50, - 52, 78, 53, 55, 79, 56, 57, 58, 59, 0, - 60, 61, 62, 63, 66, 74, 75, 76, 77, 80, - 65, 0, 0, 73 -}; - -static const yytype_int8 yycheck[] = -{ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 18, 36, 36, 38, 36, 0, 37, - 36, 36, 39, 37, 36, 36, 36, 36, 36, 36, - 36, 70, 36, 36, 70, 37, 36, 36, 36, -1, - 37, 36, 36, 36, 36, 50, 36, 36, 36, 36, - 36, -1, -1, 49 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 41, 42, 43, 36, 36, 37, - 36, 36, 37, 36, 44, 36, 36, 36, 36, 45, - 36, 50, 36, 36, 50, 36, 37, 36, 36, 36, - 37, 36, 36, 36, 0, 42, 36, 36, 38, 46, - 47, 48, 49, 46, 50, 36, 36, 36, 48, 49, - 36, 39 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 5: -#line 158 "nlmheader.y" - { - check_procedure = (yyvsp[(2) - (2)].string); - } - break; - - case 6: -#line 162 "nlmheader.y" - { - nlmheader_warn (_("CODESTART is not implemented; sorry"), -1); - free ((yyvsp[(2) - (2)].string)); - } - break; - - case 7: -#line 167 "nlmheader.y" - { - int len; - - strncpy (copyright_hdr->stamp, "CoPyRiGhT=", 10); - len = strlen ((yyvsp[(2) - (2)].string)); - if (len >= NLM_MAX_COPYRIGHT_MESSAGE_LENGTH) - { - nlmheader_warn (_("copyright string is too long"), - NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1); - len = NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1; - } - copyright_hdr->copyrightMessageLength = len; - strncpy (copyright_hdr->copyrightMessage, (yyvsp[(2) - (2)].string), len); - copyright_hdr->copyrightMessage[len] = '\0'; - free ((yyvsp[(2) - (2)].string)); - } - break; - - case 8: -#line 184 "nlmheader.y" - { - custom_file = (yyvsp[(2) - (2)].string); - } - break; - - case 9: -#line 188 "nlmheader.y" - { - /* We don't set the version stamp here, because we use the - version stamp to detect whether the required VERSION - keyword was given. */ - version_hdr->month = nlmlex_get_number ((yyvsp[(2) - (4)].string)); - version_hdr->day = nlmlex_get_number ((yyvsp[(3) - (4)].string)); - version_hdr->year = nlmlex_get_number ((yyvsp[(4) - (4)].string)); - free ((yyvsp[(2) - (4)].string)); - free ((yyvsp[(3) - (4)].string)); - free ((yyvsp[(4) - (4)].string)); - if (version_hdr->month < 1 || version_hdr->month > 12) - nlmheader_warn (_("illegal month"), -1); - if (version_hdr->day < 1 || version_hdr->day > 31) - nlmheader_warn (_("illegal day"), -1); - if (version_hdr->year < 1900 || version_hdr->year > 3000) - nlmheader_warn (_("illegal year"), -1); - } - break; - - case 10: -#line 206 "nlmheader.y" - { - debug_info = TRUE; - } - break; - - case 11: -#line 210 "nlmheader.y" - { - int len; - - len = strlen ((yyvsp[(2) - (2)].string)); - if (len > NLM_MAX_DESCRIPTION_LENGTH) - { - nlmheader_warn (_("description string is too long"), - NLM_MAX_DESCRIPTION_LENGTH); - len = NLM_MAX_DESCRIPTION_LENGTH; - } - var_hdr->descriptionLength = len; - strncpy (var_hdr->descriptionText, (yyvsp[(2) - (2)].string), len); - var_hdr->descriptionText[len] = '\0'; - free ((yyvsp[(2) - (2)].string)); - } - break; - - case 12: -#line 226 "nlmheader.y" - { - exit_procedure = (yyvsp[(2) - (2)].string); - } - break; - - case 13: -#line 230 "nlmheader.y" - { - symbol_prefix = NULL; - } - break; - - case 14: -#line 234 "nlmheader.y" - { - export_symbols = string_list_append (export_symbols, (yyvsp[(3) - (3)].list)); - } - break; - - case 15: -#line 238 "nlmheader.y" - { - fixed_hdr->flags |= nlmlex_get_number ((yyvsp[(2) - (2)].string)); - free ((yyvsp[(2) - (2)].string)); - } - break; - - case 16: -#line 243 "nlmheader.y" - { - fixed_hdr->flags &=~ nlmlex_get_number ((yyvsp[(2) - (2)].string)); - free ((yyvsp[(2) - (2)].string)); - } - break; - - case 17: -#line 248 "nlmheader.y" - { - map_file = ""; - full_map = TRUE; - } - break; - - case 18: -#line 253 "nlmheader.y" - { - map_file = (yyvsp[(2) - (2)].string); - full_map = TRUE; - } - break; - - case 19: -#line 258 "nlmheader.y" - { - help_file = (yyvsp[(2) - (2)].string); - } - break; - - case 20: -#line 262 "nlmheader.y" - { - symbol_prefix = NULL; - } - break; - - case 21: -#line 266 "nlmheader.y" - { - import_symbols = string_list_append (import_symbols, (yyvsp[(3) - (3)].list)); - } - break; - - case 22: -#line 270 "nlmheader.y" - { - input_files = string_list_append (input_files, (yyvsp[(2) - (2)].list)); - } - break; - - case 23: -#line 274 "nlmheader.y" - { - map_file = ""; - } - break; - - case 24: -#line 278 "nlmheader.y" - { - map_file = (yyvsp[(2) - (2)].string); - } - break; - - case 25: -#line 282 "nlmheader.y" - { - message_file = (yyvsp[(2) - (2)].string); - } - break; - - case 26: -#line 286 "nlmheader.y" - { - modules = string_list_append (modules, (yyvsp[(2) - (2)].list)); - } - break; - - case 27: -#line 290 "nlmheader.y" - { - fixed_hdr->flags |= 0x2; - } - break; - - case 28: -#line 294 "nlmheader.y" - { - fixed_hdr->flags |= 0x10; - } - break; - - case 29: -#line 298 "nlmheader.y" - { - if (output_file == NULL) - output_file = (yyvsp[(2) - (2)].string); - else - nlmheader_warn (_("ignoring duplicate OUTPUT statement"), -1); - } - break; - - case 30: -#line 305 "nlmheader.y" - { - fixed_hdr->flags |= 0x8; - } - break; - - case 31: -#line 309 "nlmheader.y" - { - fixed_hdr->flags |= 0x1; - } - break; - - case 32: -#line 313 "nlmheader.y" - { - int len; - - len = strlen ((yyvsp[(2) - (2)].string)); - if (len >= NLM_MAX_SCREEN_NAME_LENGTH) - { - nlmheader_warn (_("screen name is too long"), - NLM_MAX_SCREEN_NAME_LENGTH); - len = NLM_MAX_SCREEN_NAME_LENGTH; - } - var_hdr->screenNameLength = len; - strncpy (var_hdr->screenName, (yyvsp[(2) - (2)].string), len); - var_hdr->screenName[NLM_MAX_SCREEN_NAME_LENGTH] = '\0'; - free ((yyvsp[(2) - (2)].string)); - } - break; - - case 33: -#line 329 "nlmheader.y" - { - sharelib_file = (yyvsp[(2) - (2)].string); - } - break; - - case 34: -#line 333 "nlmheader.y" - { - var_hdr->stackSize = nlmlex_get_number ((yyvsp[(2) - (2)].string)); - free ((yyvsp[(2) - (2)].string)); - } - break; - - case 35: -#line 338 "nlmheader.y" - { - start_procedure = (yyvsp[(2) - (2)].string); - } - break; - - case 36: -#line 342 "nlmheader.y" - { - fixed_hdr->flags |= 0x4; - } - break; - - case 37: -#line 346 "nlmheader.y" - { - int len; - - len = strlen ((yyvsp[(2) - (2)].string)); - if (len >= NLM_MAX_THREAD_NAME_LENGTH) - { - nlmheader_warn (_("thread name is too long"), - NLM_MAX_THREAD_NAME_LENGTH); - len = NLM_MAX_THREAD_NAME_LENGTH; - } - var_hdr->threadNameLength = len; - strncpy (var_hdr->threadName, (yyvsp[(2) - (2)].string), len); - var_hdr->threadName[len] = '\0'; - free ((yyvsp[(2) - (2)].string)); - } - break; - - case 38: -#line 362 "nlmheader.y" - { - fixed_hdr->moduleType = nlmlex_get_number ((yyvsp[(2) - (2)].string)); - free ((yyvsp[(2) - (2)].string)); - } - break; - - case 39: -#line 367 "nlmheader.y" - { - verbose = TRUE; - } - break; - - case 40: -#line 371 "nlmheader.y" - { - long val; - - strncpy (version_hdr->stamp, "VeRsIoN#", 8); - version_hdr->majorVersion = nlmlex_get_number ((yyvsp[(2) - (4)].string)); - val = nlmlex_get_number ((yyvsp[(3) - (4)].string)); - if (val < 0 || val > 99) - nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"), - -1); - else - version_hdr->minorVersion = val; - val = nlmlex_get_number ((yyvsp[(4) - (4)].string)); - if (val < 0) - nlmheader_warn (_("illegal revision number (must be between 0 and 26)"), - -1); - else if (val > 26) - version_hdr->revision = 0; - else - version_hdr->revision = val; - free ((yyvsp[(2) - (4)].string)); - free ((yyvsp[(3) - (4)].string)); - free ((yyvsp[(4) - (4)].string)); - } - break; - - case 41: -#line 395 "nlmheader.y" - { - long val; - - strncpy (version_hdr->stamp, "VeRsIoN#", 8); - version_hdr->majorVersion = nlmlex_get_number ((yyvsp[(2) - (3)].string)); - val = nlmlex_get_number ((yyvsp[(3) - (3)].string)); - if (val < 0 || val > 99) - nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"), - -1); - else - version_hdr->minorVersion = val; - version_hdr->revision = 0; - free ((yyvsp[(2) - (3)].string)); - free ((yyvsp[(3) - (3)].string)); - } - break; - - case 42: -#line 411 "nlmheader.y" - { - rpc_file = (yyvsp[(2) - (2)].string); - } - break; - - case 43: -#line 420 "nlmheader.y" - { - (yyval.list) = NULL; - } - break; - - case 44: -#line 424 "nlmheader.y" - { - (yyval.list) = (yyvsp[(1) - (1)].list); - } - break; - - case 45: -#line 435 "nlmheader.y" - { - (yyval.list) = string_list_cons ((yyvsp[(1) - (1)].string), NULL); - } - break; - - case 46: -#line 439 "nlmheader.y" - { - (yyval.list) = NULL; - } - break; - - case 47: -#line 443 "nlmheader.y" - { - (yyval.list) = string_list_append1 ((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].string)); - } - break; - - case 48: -#line 447 "nlmheader.y" - { - (yyval.list) = (yyvsp[(1) - (2)].list); - } - break; - - case 49: -#line 456 "nlmheader.y" - { - if (symbol_prefix != NULL) - free (symbol_prefix); - symbol_prefix = (yyvsp[(2) - (3)].string); - } - break; - - case 50: -#line 467 "nlmheader.y" - { - if (symbol_prefix == NULL) - (yyval.string) = (yyvsp[(1) - (1)].string); - else - { - (yyval.string) = xmalloc (strlen (symbol_prefix) + strlen ((yyvsp[(1) - (1)].string)) + 2); - sprintf ((yyval.string), "%s@%s", symbol_prefix, (yyvsp[(1) - (1)].string)); - free ((yyvsp[(1) - (1)].string)); - } - } - break; - - case 51: -#line 483 "nlmheader.y" - { - (yyval.list) = NULL; - } - break; - - case 52: -#line 487 "nlmheader.y" - { - (yyval.list) = string_list_cons ((yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].list)); - } - break; - - -/* Line 1267 of yacc.c. */ -#line 2015 "nlmheader.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -#line 492 "nlmheader.y" - - -/* If strerror is just a macro, we want to use the one from libiberty - since it will handle undefined values. */ -#undef strerror -extern char *strerror PARAMS ((int)); - -/* The lexer is simple, too simple for flex. Keywords are only - recognized at the start of lines. Everything else must be an - argument. A comma is treated as whitespace. */ - -/* The states the lexer can be in. */ - -enum lex_state -{ - /* At the beginning of a line. */ - BEGINNING_OF_LINE, - /* In the middle of a line. */ - IN_LINE -}; - -/* We need to keep a stack of files to handle file inclusion. */ - -struct input -{ - /* The file to read from. */ - FILE *file; - /* The name of the file. */ - char *name; - /* The current line number. */ - int lineno; - /* The current state. */ - enum lex_state state; - /* The next file on the stack. */ - struct input *next; -}; - -/* The current input file. */ - -static struct input current; - -/* The character which introduces comments. */ -#define COMMENT_CHAR '#' - -/* Start the lexer going on the main input file. */ - -bfd_boolean -nlmlex_file (const char *name) -{ - current.next = NULL; - return nlmlex_file_open (name); -} - -/* Start the lexer going on a subsidiary input file. */ - -static void -nlmlex_file_push (const char *name) -{ - struct input *push; - - push = (struct input *) xmalloc (sizeof (struct input)); - *push = current; - if (nlmlex_file_open (name)) - current.next = push; - else - { - current = *push; - free (push); - } -} - -/* Start lexing from a file. */ - -static bfd_boolean -nlmlex_file_open (const char *name) -{ - current.file = fopen (name, "r"); - if (current.file == NULL) - { - fprintf (stderr, "%s:%s: %s\n", program_name, name, strerror (errno)); - ++parse_errors; - return FALSE; - } - current.name = xstrdup (name); - current.lineno = 1; - current.state = BEGINNING_OF_LINE; - return TRUE; -} - -/* Table used to turn keywords into tokens. */ - -struct keyword_tokens_struct -{ - const char *keyword; - int token; -}; - -static struct keyword_tokens_struct keyword_tokens[] = -{ - { "CHECK", CHECK }, - { "CODESTART", CODESTART }, - { "COPYRIGHT", COPYRIGHT }, - { "CUSTOM", CUSTOM }, - { "DATE", DATE }, - { "DEBUG", DEBUG_K }, - { "DESCRIPTION", DESCRIPTION }, - { "EXIT", EXIT }, - { "EXPORT", EXPORT }, - { "FLAG_ON", FLAG_ON }, - { "FLAG_OFF", FLAG_OFF }, - { "FULLMAP", FULLMAP }, - { "HELP", HELP }, - { "IMPORT", IMPORT }, - { "INPUT", INPUT }, - { "MAP", MAP }, - { "MESSAGES", MESSAGES }, - { "MODULE", MODULE }, - { "MULTIPLE", MULTIPLE }, - { "OS_DOMAIN", OS_DOMAIN }, - { "OUTPUT", OUTPUT }, - { "PSEUDOPREEMPTION", PSEUDOPREEMPTION }, - { "REENTRANT", REENTRANT }, - { "SCREENNAME", SCREENNAME }, - { "SHARELIB", SHARELIB }, - { "STACK", STACK }, - { "STACKSIZE", STACK }, - { "START", START }, - { "SYNCHRONIZE", SYNCHRONIZE }, - { "THREADNAME", THREADNAME }, - { "TYPE", TYPE }, - { "VERBOSE", VERBOSE }, - { "VERSION", VERSIONK }, - { "XDCDATA", XDCDATA } -}; - -#define KEYWORD_COUNT (sizeof (keyword_tokens) / sizeof (keyword_tokens[0])) - -/* The lexer accumulates strings in these variables. */ -static char *lex_buf; -static int lex_size; -static int lex_pos; - -/* Start accumulating strings into the buffer. */ -#define BUF_INIT() \ - ((void) (lex_buf != NULL ? lex_pos = 0 : nlmlex_buf_init ())) - -static int -nlmlex_buf_init (void) -{ - lex_size = 10; - lex_buf = xmalloc (lex_size + 1); - lex_pos = 0; - return 0; -} - -/* Finish a string in the buffer. */ -#define BUF_FINISH() ((void) (lex_buf[lex_pos] = '\0')) - -/* Accumulate a character into the buffer. */ -#define BUF_ADD(c) \ - ((void) (lex_pos < lex_size \ - ? lex_buf[lex_pos++] = (c) \ - : nlmlex_buf_add (c))) - -static char -nlmlex_buf_add (int c) -{ - if (lex_pos >= lex_size) - { - lex_size *= 2; - lex_buf = xrealloc (lex_buf, lex_size + 1); - } - - return lex_buf[lex_pos++] = c; -} - -/* The lexer proper. This is called by the bison generated parsing - code. */ - -static int -yylex (void) -{ - int c; - -tail_recurse: - - c = getc (current.file); - - /* Commas are treated as whitespace characters. */ - while (ISSPACE (c) || c == ',') - { - current.state = IN_LINE; - if (c == '\n') - { - ++current.lineno; - current.state = BEGINNING_OF_LINE; - } - c = getc (current.file); - } - - /* At the end of the file we either pop to the previous file or - finish up. */ - if (c == EOF) - { - fclose (current.file); - free (current.name); - if (current.next == NULL) - return 0; - else - { - struct input *next; - - next = current.next; - current = *next; - free (next); - goto tail_recurse; - } - } - - /* A comment character always means to drop everything until the - next newline. */ - if (c == COMMENT_CHAR) - { - do - { - c = getc (current.file); - } - while (c != '\n'); - ++current.lineno; - current.state = BEGINNING_OF_LINE; - goto tail_recurse; - } - - /* An '@' introduces an include file. */ - if (c == '@') - { - do - { - c = getc (current.file); - if (c == '\n') - ++current.lineno; - } - while (ISSPACE (c)); - BUF_INIT (); - while (! ISSPACE (c) && c != EOF) - { - BUF_ADD (c); - c = getc (current.file); - } - BUF_FINISH (); - - ungetc (c, current.file); - - nlmlex_file_push (lex_buf); - goto tail_recurse; - } - - /* A non-space character at the start of a line must be the start of - a keyword. */ - if (current.state == BEGINNING_OF_LINE) - { - BUF_INIT (); - while (ISALNUM (c) || c == '_') - { - BUF_ADD (TOUPPER (c)); - c = getc (current.file); - } - BUF_FINISH (); - - if (c != EOF && ! ISSPACE (c) && c != ',') - { - nlmheader_identify (); - fprintf (stderr, _("%s:%d: illegal character in keyword: %c\n"), - current.name, current.lineno, c); - } - else - { - unsigned int i; - - for (i = 0; i < KEYWORD_COUNT; i++) - { - if (lex_buf[0] == keyword_tokens[i].keyword[0] - && strcmp (lex_buf, keyword_tokens[i].keyword) == 0) - { - /* Pushing back the final whitespace avoids worrying - about \n here. */ - ungetc (c, current.file); - current.state = IN_LINE; - return keyword_tokens[i].token; - } - } - - nlmheader_identify (); - fprintf (stderr, _("%s:%d: unrecognized keyword: %s\n"), - current.name, current.lineno, lex_buf); - } - - ++parse_errors; - /* Treat the rest of this line as a comment. */ - ungetc (COMMENT_CHAR, current.file); - goto tail_recurse; - } - - /* Parentheses just represent themselves. */ - if (c == '(' || c == ')') - return c; - - /* Handle quoted strings. */ - if (c == '"' || c == '\'') - { - int quote; - int start_lineno; - - quote = c; - start_lineno = current.lineno; - - c = getc (current.file); - BUF_INIT (); - while (c != quote && c != EOF) - { - BUF_ADD (c); - if (c == '\n') - ++current.lineno; - c = getc (current.file); - } - BUF_FINISH (); - - if (c == EOF) - { - nlmheader_identify (); - fprintf (stderr, _("%s:%d: end of file in quoted string\n"), - current.name, start_lineno); - ++parse_errors; - } - - /* FIXME: Possible memory leak. */ - yylval.string = xstrdup (lex_buf); - return QUOTED_STRING; - } - - /* Gather a generic argument. */ - BUF_INIT (); - while (! ISSPACE (c) - && c != ',' - && c != COMMENT_CHAR - && c != '(' - && c != ')') - { - BUF_ADD (c); - c = getc (current.file); - } - BUF_FINISH (); - - ungetc (c, current.file); - - /* FIXME: Possible memory leak. */ - yylval.string = xstrdup (lex_buf); - return STRING; -} - -/* Get a number from a string. */ - -static long -nlmlex_get_number (const char *s) -{ - long ret; - char *send; - - ret = strtol (s, &send, 10); - if (*send != '\0') - nlmheader_warn (_("bad number"), -1); - return ret; -} - -/* Prefix the nlmconv warnings with a note as to where they come from. - We don't use program_name on every warning, because then some - versions of the emacs next-error function can't recognize the line - number. */ - -static void -nlmheader_identify (void) -{ - static int done; - - if (! done) - { - fprintf (stderr, _("%s: problems in NLM command language input:\n"), - program_name); - done = 1; - } -} - -/* Issue a warning. */ - -static void -nlmheader_warn (const char *s, int imax) -{ - nlmheader_identify (); - fprintf (stderr, "%s:%d: %s", current.name, current.lineno, s); - if (imax != -1) - fprintf (stderr, " (max %d)", imax); - fprintf (stderr, "\n"); -} - -/* Report an error. */ - -static void -nlmheader_error (const char *s) -{ - nlmheader_warn (s, -1); - ++parse_errors; -} - -/* Add a string to a string list. */ - -static struct string_list * -string_list_cons (char *s, struct string_list *l) -{ - struct string_list *ret; - - ret = (struct string_list *) xmalloc (sizeof (struct string_list)); - ret->next = l; - ret->string = s; - return ret; -} - -/* Append a string list to another string list. */ - -static struct string_list * -string_list_append (struct string_list *l1, struct string_list *l2) -{ - register struct string_list **pp; - - for (pp = &l1; *pp != NULL; pp = &(*pp)->next) - ; - *pp = l2; - return l1; -} - -/* Append a string to a string list. */ - -static struct string_list * -string_list_append1 (struct string_list *l, char *s) -{ - struct string_list *n; - register struct string_list **pp; - - n = (struct string_list *) xmalloc (sizeof (struct string_list)); - n->next = NULL; - n->string = s; - for (pp = &l; *pp != NULL; pp = &(*pp)->next) - ; - *pp = n; - return l; -} - -/* Duplicate a string in memory. */ - -static char * -xstrdup (const char *s) -{ - unsigned long len; - char *ret; - - len = strlen (s); - ret = xmalloc (len + 1); - strcpy (ret, s); - return ret; -} - diff -Nur binutils-2.24.orig/binutils/nlmheader.h binutils-2.24/binutils/nlmheader.h --- binutils-2.24.orig/binutils/nlmheader.h 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/nlmheader.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,135 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - CHECK = 258, - CODESTART = 259, - COPYRIGHT = 260, - CUSTOM = 261, - DATE = 262, - DEBUG_K = 263, - DESCRIPTION = 264, - EXIT = 265, - EXPORT = 266, - FLAG_ON = 267, - FLAG_OFF = 268, - FULLMAP = 269, - HELP = 270, - IMPORT = 271, - INPUT = 272, - MAP = 273, - MESSAGES = 274, - MODULE = 275, - MULTIPLE = 276, - OS_DOMAIN = 277, - OUTPUT = 278, - PSEUDOPREEMPTION = 279, - REENTRANT = 280, - SCREENNAME = 281, - SHARELIB = 282, - STACK = 283, - START = 284, - SYNCHRONIZE = 285, - THREADNAME = 286, - TYPE = 287, - VERBOSE = 288, - VERSIONK = 289, - XDCDATA = 290, - STRING = 291, - QUOTED_STRING = 292 - }; -#endif -/* Tokens. */ -#define CHECK 258 -#define CODESTART 259 -#define COPYRIGHT 260 -#define CUSTOM 261 -#define DATE 262 -#define DEBUG_K 263 -#define DESCRIPTION 264 -#define EXIT 265 -#define EXPORT 266 -#define FLAG_ON 267 -#define FLAG_OFF 268 -#define FULLMAP 269 -#define HELP 270 -#define IMPORT 271 -#define INPUT 272 -#define MAP 273 -#define MESSAGES 274 -#define MODULE 275 -#define MULTIPLE 276 -#define OS_DOMAIN 277 -#define OUTPUT 278 -#define PSEUDOPREEMPTION 279 -#define REENTRANT 280 -#define SCREENNAME 281 -#define SHARELIB 282 -#define STACK 283 -#define START 284 -#define SYNCHRONIZE 285 -#define THREADNAME 286 -#define TYPE 287 -#define VERBOSE 288 -#define VERSIONK 289 -#define XDCDATA 290 -#define STRING 291 -#define QUOTED_STRING 292 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 113 "nlmheader.y" -{ - char *string; - struct string_list *list; -} -/* Line 1529 of yacc.c. */ -#line 128 "nlmheader.h" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - diff -Nur binutils-2.24.orig/binutils/rcparse.c binutils-2.24/binutils/rcparse.c --- binutils-2.24.orig/binutils/rcparse.c 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/rcparse.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,4663 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - BEG = 258, - END = 259, - ACCELERATORS = 260, - VIRTKEY = 261, - ASCII = 262, - NOINVERT = 263, - SHIFT = 264, - CONTROL = 265, - ALT = 266, - BITMAP = 267, - CURSOR = 268, - DIALOG = 269, - DIALOGEX = 270, - EXSTYLE = 271, - CAPTION = 272, - CLASS = 273, - STYLE = 274, - AUTO3STATE = 275, - AUTOCHECKBOX = 276, - AUTORADIOBUTTON = 277, - CHECKBOX = 278, - COMBOBOX = 279, - CTEXT = 280, - DEFPUSHBUTTON = 281, - EDITTEXT = 282, - GROUPBOX = 283, - LISTBOX = 284, - LTEXT = 285, - PUSHBOX = 286, - PUSHBUTTON = 287, - RADIOBUTTON = 288, - RTEXT = 289, - SCROLLBAR = 290, - STATE3 = 291, - USERBUTTON = 292, - BEDIT = 293, - HEDIT = 294, - IEDIT = 295, - FONT = 296, - ICON = 297, - ANICURSOR = 298, - ANIICON = 299, - DLGINCLUDE = 300, - DLGINIT = 301, - FONTDIR = 302, - HTML = 303, - MANIFEST = 304, - PLUGPLAY = 305, - VXD = 306, - TOOLBAR = 307, - BUTTON = 308, - LANGUAGE = 309, - CHARACTERISTICS = 310, - VERSIONK = 311, - MENU = 312, - MENUEX = 313, - MENUITEM = 314, - SEPARATOR = 315, - POPUP = 316, - CHECKED = 317, - GRAYED = 318, - HELP = 319, - INACTIVE = 320, - MENUBARBREAK = 321, - MENUBREAK = 322, - MESSAGETABLE = 323, - RCDATA = 324, - STRINGTABLE = 325, - VERSIONINFO = 326, - FILEVERSION = 327, - PRODUCTVERSION = 328, - FILEFLAGSMASK = 329, - FILEFLAGS = 330, - FILEOS = 331, - FILETYPE = 332, - FILESUBTYPE = 333, - BLOCKSTRINGFILEINFO = 334, - BLOCKVARFILEINFO = 335, - VALUE = 336, - BLOCK = 337, - MOVEABLE = 338, - FIXED = 339, - PURE = 340, - IMPURE = 341, - PRELOAD = 342, - LOADONCALL = 343, - DISCARDABLE = 344, - NOT = 345, - QUOTEDUNISTRING = 346, - QUOTEDSTRING = 347, - STRING = 348, - NUMBER = 349, - SIZEDUNISTRING = 350, - SIZEDSTRING = 351, - IGNORED_TOKEN = 352, - NEG = 353 - }; -#endif -/* Tokens. */ -#define BEG 258 -#define END 259 -#define ACCELERATORS 260 -#define VIRTKEY 261 -#define ASCII 262 -#define NOINVERT 263 -#define SHIFT 264 -#define CONTROL 265 -#define ALT 266 -#define BITMAP 267 -#define CURSOR 268 -#define DIALOG 269 -#define DIALOGEX 270 -#define EXSTYLE 271 -#define CAPTION 272 -#define CLASS 273 -#define STYLE 274 -#define AUTO3STATE 275 -#define AUTOCHECKBOX 276 -#define AUTORADIOBUTTON 277 -#define CHECKBOX 278 -#define COMBOBOX 279 -#define CTEXT 280 -#define DEFPUSHBUTTON 281 -#define EDITTEXT 282 -#define GROUPBOX 283 -#define LISTBOX 284 -#define LTEXT 285 -#define PUSHBOX 286 -#define PUSHBUTTON 287 -#define RADIOBUTTON 288 -#define RTEXT 289 -#define SCROLLBAR 290 -#define STATE3 291 -#define USERBUTTON 292 -#define BEDIT 293 -#define HEDIT 294 -#define IEDIT 295 -#define FONT 296 -#define ICON 297 -#define ANICURSOR 298 -#define ANIICON 299 -#define DLGINCLUDE 300 -#define DLGINIT 301 -#define FONTDIR 302 -#define HTML 303 -#define MANIFEST 304 -#define PLUGPLAY 305 -#define VXD 306 -#define TOOLBAR 307 -#define BUTTON 308 -#define LANGUAGE 309 -#define CHARACTERISTICS 310 -#define VERSIONK 311 -#define MENU 312 -#define MENUEX 313 -#define MENUITEM 314 -#define SEPARATOR 315 -#define POPUP 316 -#define CHECKED 317 -#define GRAYED 318 -#define HELP 319 -#define INACTIVE 320 -#define MENUBARBREAK 321 -#define MENUBREAK 322 -#define MESSAGETABLE 323 -#define RCDATA 324 -#define STRINGTABLE 325 -#define VERSIONINFO 326 -#define FILEVERSION 327 -#define PRODUCTVERSION 328 -#define FILEFLAGSMASK 329 -#define FILEFLAGS 330 -#define FILEOS 331 -#define FILETYPE 332 -#define FILESUBTYPE 333 -#define BLOCKSTRINGFILEINFO 334 -#define BLOCKVARFILEINFO 335 -#define VALUE 336 -#define BLOCK 337 -#define MOVEABLE 338 -#define FIXED 339 -#define PURE 340 -#define IMPURE 341 -#define PRELOAD 342 -#define LOADONCALL 343 -#define DISCARDABLE 344 -#define NOT 345 -#define QUOTEDUNISTRING 346 -#define QUOTEDSTRING 347 -#define STRING 348 -#define NUMBER 349 -#define SIZEDUNISTRING 350 -#define SIZEDSTRING 351 -#define IGNORED_TOKEN 352 -#define NEG 353 - - - - -/* Copy the first part of user declarations. */ -#line 1 "rcparse.y" - /* rcparse.y -- parser for Windows rc files - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008, - 2011 Free Software Foundation, Inc. - Written by Ian Lance Taylor, Cygnus Support. - Extended by Kai Tietz, Onevision. - - 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - - -/* This is a parser for Windows rc files. It is based on the parser - by Gunther Ebert . */ - -#include "sysdep.h" -#include "bfd.h" -#include "bucomm.h" -#include "libiberty.h" -#include "windres.h" -#include "safe-ctype.h" - -/* The current language. */ - -static unsigned short language; - -/* The resource information during a sub statement. */ - -static rc_res_res_info sub_res_info; - -/* Dialog information. This is built by the nonterminals styles and - controls. */ - -static rc_dialog dialog; - -/* This is used when building a style. It is modified by the - nonterminal styleexpr. */ - -static unsigned long style; - -/* These are used when building a control. They are set before using - control_params. */ - -static rc_uint_type base_style; -static rc_uint_type default_style; -static rc_res_id class; -static rc_res_id res_text_field; -static unichar null_unichar; - -/* This is used for COMBOBOX, LISTBOX and EDITTEXT which - do not allow resource 'text' field in control definition. */ -static const rc_res_id res_null_text = { 1, {{0, &null_unichar}}}; - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 69 "rcparse.y" -{ - rc_accelerator acc; - rc_accelerator *pacc; - rc_dialog_control *dialog_control; - rc_menuitem *menuitem; - struct - { - rc_rcdata_item *first; - rc_rcdata_item *last; - } rcdata; - rc_rcdata_item *rcdata_item; - rc_fixed_versioninfo *fixver; - rc_ver_info *verinfo; - rc_ver_stringtable *verstringtable; - rc_ver_stringinfo *verstring; - rc_ver_varinfo *vervar; - rc_toolbar_item *toobar_item; - rc_res_id id; - rc_res_res_info res_info; - struct - { - rc_uint_type on; - rc_uint_type off; - } memflags; - struct - { - rc_uint_type val; - /* Nonzero if this number was explicitly specified as long. */ - int dword; - } i; - rc_uint_type il; - rc_uint_type is; - const char *s; - struct - { - rc_uint_type length; - const char *s; - } ss; - unichar *uni; - struct - { - rc_uint_type length; - const unichar *s; - } suni; -} -/* Line 193 of yacc.c. */ -#line 405 "rcparse.c" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 216 of yacc.c. */ -#line 418 "rcparse.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 2 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 830 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 112 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 102 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 276 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 520 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 353 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 105, 100, 2, - 110, 111, 103, 101, 108, 102, 2, 104, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 109, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 99, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 98, 2, 106, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 107 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 13, 16, 19, 22, - 25, 28, 31, 34, 37, 40, 43, 46, 49, 56, - 57, 60, 63, 68, 70, 72, 74, 78, 81, 83, - 85, 87, 89, 91, 93, 98, 103, 104, 118, 119, - 133, 134, 149, 150, 154, 155, 159, 163, 167, 171, - 175, 181, 188, 196, 205, 209, 213, 218, 222, 223, - 226, 227, 232, 233, 238, 239, 244, 245, 250, 251, - 256, 257, 261, 273, 286, 287, 292, 293, 298, 299, - 303, 304, 309, 310, 315, 322, 331, 342, 354, 355, - 360, 361, 365, 366, 371, 372, 377, 378, 383, 384, - 389, 390, 395, 396, 400, 401, 406, 407, 423, 430, - 439, 449, 452, 453, 456, 458, 460, 461, 465, 466, - 470, 471, 475, 476, 480, 485, 490, 494, 501, 502, - 505, 510, 513, 520, 521, 525, 528, 530, 532, 534, - 536, 538, 540, 547, 548, 551, 554, 558, 564, 567, - 573, 580, 588, 598, 603, 604, 607, 608, 610, 612, - 614, 616, 620, 624, 628, 631, 632, 639, 640, 644, - 649, 652, 654, 656, 658, 660, 662, 664, 666, 668, - 670, 672, 679, 684, 693, 694, 698, 701, 708, 709, - 716, 723, 727, 731, 735, 739, 743, 744, 750, 758, - 759, 765, 766, 772, 773, 777, 779, 781, 783, 785, - 788, 790, 793, 794, 797, 801, 806, 810, 811, 814, - 815, 818, 820, 822, 824, 826, 828, 830, 832, 834, - 836, 838, 841, 843, 845, 847, 849, 851, 854, 856, - 859, 861, 864, 866, 869, 873, 878, 880, 884, 885, - 887, 890, 892, 894, 898, 901, 904, 908, 912, 916, - 920, 924, 928, 932, 936, 939, 941, 943, 947, 950, - 954, 958, 962, 966, 970, 974, 978 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 113, 0, -1, -1, 113, 114, -1, 113, 120, -1, - 113, 121, -1, 113, 122, -1, 113, 162, -1, 113, - 163, -1, 113, 164, -1, 113, 165, -1, 113, 170, - -1, 113, 173, -1, 113, 178, -1, 113, 183, -1, - 113, 182, -1, 113, 185, -1, 113, 97, -1, 191, - 5, 194, 3, 115, 4, -1, -1, 115, 116, -1, - 117, 211, -1, 117, 211, 108, 118, -1, 92, -1, - 212, -1, 119, -1, 118, 108, 119, -1, 118, 119, - -1, 6, -1, 7, -1, 8, -1, 9, -1, 10, - -1, 11, -1, 191, 12, 196, 198, -1, 191, 13, - 195, 198, -1, -1, 191, 14, 196, 126, 212, 208, - 208, 208, 123, 127, 3, 128, 4, -1, -1, 191, - 15, 196, 126, 212, 208, 208, 208, 124, 127, 3, - 128, 4, -1, -1, 191, 15, 196, 126, 212, 208, - 208, 208, 208, 125, 127, 3, 128, 4, -1, -1, - 16, 109, 209, -1, -1, 127, 17, 199, -1, 127, - 18, 191, -1, 127, 19, 205, -1, 127, 16, 209, - -1, 127, 18, 199, -1, 127, 41, 209, 108, 199, - -1, 127, 41, 209, 108, 199, 208, -1, 127, 41, - 209, 108, 199, 208, 208, -1, 127, 41, 209, 108, - 199, 208, 208, 208, -1, 127, 57, 191, -1, 127, - 55, 209, -1, 127, 54, 209, 208, -1, 127, 56, - 209, -1, -1, 128, 129, -1, -1, 20, 153, 130, - 151, -1, -1, 21, 153, 131, 151, -1, -1, 22, - 153, 132, 151, -1, -1, 38, 153, 133, 151, -1, - -1, 23, 153, 134, 151, -1, -1, 24, 135, 151, - -1, 10, 153, 209, 152, 156, 208, 208, 208, 208, - 207, 155, -1, 10, 153, 209, 152, 156, 208, 208, - 208, 208, 208, 208, 155, -1, -1, 25, 153, 136, - 151, -1, -1, 26, 153, 137, 151, -1, -1, 27, - 138, 151, -1, -1, 28, 153, 139, 151, -1, -1, - 39, 153, 140, 151, -1, 42, 193, 209, 208, 208, - 155, -1, 42, 193, 209, 208, 208, 208, 208, 155, - -1, 42, 193, 209, 208, 208, 208, 208, 158, 207, - 155, -1, 42, 193, 209, 208, 208, 208, 208, 158, - 208, 208, 155, -1, -1, 40, 153, 141, 151, -1, - -1, 29, 142, 151, -1, -1, 30, 153, 143, 151, - -1, -1, 31, 153, 144, 151, -1, -1, 32, 153, - 145, 151, -1, -1, 33, 153, 146, 151, -1, -1, - 34, 153, 147, 151, -1, -1, 35, 148, 151, -1, - -1, 36, 153, 149, 151, -1, -1, 37, 193, 209, - 108, 209, 108, 209, 108, 209, 108, 209, 108, 150, - 205, 207, -1, 209, 208, 208, 208, 208, 155, -1, - 209, 208, 208, 208, 208, 160, 207, 155, -1, 209, - 208, 208, 208, 208, 160, 208, 208, 155, -1, 108, - 154, -1, -1, 154, 108, -1, 212, -1, 199, -1, - -1, 3, 174, 4, -1, -1, 108, 157, 205, -1, - -1, 108, 159, 205, -1, -1, 108, 161, 205, -1, - 191, 41, 195, 198, -1, 191, 42, 195, 198, -1, - 54, 209, 208, -1, 191, 57, 194, 3, 166, 4, - -1, -1, 166, 167, -1, 59, 199, 208, 168, -1, - 59, 60, -1, 61, 199, 168, 3, 166, 4, -1, - -1, 168, 108, 169, -1, 168, 169, -1, 62, -1, - 63, -1, 64, -1, 65, -1, 66, -1, 67, -1, - 191, 58, 194, 3, 171, 4, -1, -1, 171, 172, - -1, 59, 199, -1, 59, 199, 208, -1, 59, 199, - 208, 208, 207, -1, 59, 60, -1, 61, 199, 3, - 171, 4, -1, 61, 199, 208, 3, 171, 4, -1, - 61, 199, 208, 208, 3, 171, 4, -1, 61, 199, - 208, 208, 208, 207, 3, 171, 4, -1, 191, 68, - 196, 198, -1, -1, 175, 176, -1, -1, 177, -1, - 203, -1, 204, -1, 210, -1, 177, 108, 203, -1, - 177, 108, 204, -1, 177, 108, 210, -1, 177, 108, - -1, -1, 70, 194, 3, 179, 180, 4, -1, -1, - 180, 209, 202, -1, 180, 209, 108, 202, -1, 180, - 1, -1, 191, -1, 48, -1, 69, -1, 49, -1, - 50, -1, 51, -1, 45, -1, 46, -1, 43, -1, - 44, -1, 191, 181, 194, 3, 174, 4, -1, 191, - 181, 194, 198, -1, 191, 52, 194, 209, 208, 3, - 184, 4, -1, -1, 184, 53, 191, -1, 184, 60, - -1, 191, 71, 186, 3, 187, 4, -1, -1, 186, - 72, 209, 207, 207, 207, -1, 186, 73, 209, 207, - 207, 207, -1, 186, 74, 209, -1, 186, 75, 209, - -1, 186, 76, 209, -1, 186, 77, 209, -1, 186, - 78, 209, -1, -1, 187, 79, 3, 188, 4, -1, - 187, 80, 3, 81, 199, 190, 4, -1, -1, 188, - 82, 3, 189, 4, -1, -1, 189, 81, 199, 108, - 199, -1, -1, 190, 208, 208, -1, 212, -1, 192, - -1, 200, -1, 93, -1, 212, 108, -1, 192, -1, - 192, 108, -1, -1, 194, 197, -1, 194, 55, 209, - -1, 194, 54, 209, 208, -1, 194, 56, 209, -1, - -1, 195, 197, -1, -1, 196, 197, -1, 83, -1, - 84, -1, 85, -1, 86, -1, 87, -1, 88, -1, - 89, -1, 92, -1, 93, -1, 200, -1, 199, 200, - -1, 91, -1, 92, -1, 204, -1, 203, -1, 201, - -1, 202, 201, -1, 96, -1, 203, 96, -1, 95, - -1, 204, 95, -1, 206, -1, 90, 206, -1, 205, - 98, 206, -1, 205, 98, 90, 206, -1, 94, -1, - 110, 209, 111, -1, -1, 208, -1, 108, 209, -1, - 210, -1, 94, -1, 110, 210, 111, -1, 106, 210, - -1, 102, 210, -1, 210, 103, 210, -1, 210, 104, - 210, -1, 210, 105, 210, -1, 210, 101, 210, -1, - 210, 102, 210, -1, 210, 100, 210, -1, 210, 99, - 210, -1, 210, 98, 210, -1, 108, 212, -1, 213, - -1, 94, -1, 110, 210, 111, -1, 106, 210, -1, - 213, 103, 210, -1, 213, 104, 210, -1, 213, 105, - 210, -1, 213, 101, 210, -1, 213, 102, 210, -1, - 213, 100, 210, -1, 213, 99, 210, -1, 213, 98, - 210, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 179, 179, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 201, 212, - 215, 236, 241, 253, 273, 283, 287, 292, 299, 303, - 308, 312, 316, 320, 329, 341, 355, 353, 380, 378, - 407, 405, 437, 440, 446, 448, 454, 458, 463, 467, - 471, 484, 499, 514, 529, 533, 537, 541, 547, 549, - 561, 560, 573, 572, 585, 584, 597, 596, 612, 611, - 624, 623, 637, 648, 658, 657, 670, 669, 682, 681, - 694, 693, 706, 705, 720, 725, 731, 737, 744, 743, - 759, 758, 771, 770, 783, 782, 794, 793, 806, 805, - 818, 817, 830, 829, 842, 841, 855, 853, 874, 885, - 896, 908, 919, 922, 926, 931, 941, 944, 954, 953, - 960, 959, 966, 965, 973, 985, 998, 1007, 1018, 1021, - 1038, 1042, 1046, 1054, 1057, 1061, 1068, 1072, 1076, 1080, - 1084, 1088, 1097, 1108, 1111, 1128, 1132, 1136, 1140, 1144, - 1148, 1152, 1156, 1166, 1179, 1179, 1191, 1195, 1202, 1210, - 1218, 1226, 1235, 1244, 1253, 1263, 1262, 1267, 1269, 1274, - 1279, 1287, 1291, 1296, 1301, 1306, 1311, 1316, 1321, 1326, - 1331, 1342, 1349, 1359, 1365, 1366, 1385, 1410, 1421, 1426, - 1433, 1440, 1445, 1450, 1455, 1460, 1475, 1478, 1482, 1490, - 1493, 1501, 1504, 1512, 1515, 1524, 1529, 1538, 1542, 1552, - 1557, 1561, 1572, 1578, 1584, 1589, 1594, 1605, 1610, 1622, - 1627, 1639, 1644, 1649, 1654, 1659, 1664, 1669, 1679, 1683, - 1691, 1696, 1711, 1715, 1724, 1728, 1740, 1745, 1761, 1765, - 1777, 1781, 1803, 1807, 1811, 1815, 1822, 1826, 1836, 1839, - 1848, 1857, 1866, 1870, 1874, 1879, 1884, 1889, 1894, 1899, - 1904, 1909, 1914, 1919, 1930, 1939, 1950, 1954, 1958, 1963, - 1968, 1973, 1978, 1983, 1988, 1993, 1998 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "BEG", "END", "ACCELERATORS", "VIRTKEY", - "ASCII", "NOINVERT", "SHIFT", "CONTROL", "ALT", "BITMAP", "CURSOR", - "DIALOG", "DIALOGEX", "EXSTYLE", "CAPTION", "CLASS", "STYLE", - "AUTO3STATE", "AUTOCHECKBOX", "AUTORADIOBUTTON", "CHECKBOX", "COMBOBOX", - "CTEXT", "DEFPUSHBUTTON", "EDITTEXT", "GROUPBOX", "LISTBOX", "LTEXT", - "PUSHBOX", "PUSHBUTTON", "RADIOBUTTON", "RTEXT", "SCROLLBAR", "STATE3", - "USERBUTTON", "BEDIT", "HEDIT", "IEDIT", "FONT", "ICON", "ANICURSOR", - "ANIICON", "DLGINCLUDE", "DLGINIT", "FONTDIR", "HTML", "MANIFEST", - "PLUGPLAY", "VXD", "TOOLBAR", "BUTTON", "LANGUAGE", "CHARACTERISTICS", - "VERSIONK", "MENU", "MENUEX", "MENUITEM", "SEPARATOR", "POPUP", - "CHECKED", "GRAYED", "HELP", "INACTIVE", "MENUBARBREAK", "MENUBREAK", - "MESSAGETABLE", "RCDATA", "STRINGTABLE", "VERSIONINFO", "FILEVERSION", - "PRODUCTVERSION", "FILEFLAGSMASK", "FILEFLAGS", "FILEOS", "FILETYPE", - "FILESUBTYPE", "BLOCKSTRINGFILEINFO", "BLOCKVARFILEINFO", "VALUE", - "BLOCK", "MOVEABLE", "FIXED", "PURE", "IMPURE", "PRELOAD", "LOADONCALL", - "DISCARDABLE", "NOT", "QUOTEDUNISTRING", "QUOTEDSTRING", "STRING", - "NUMBER", "SIZEDUNISTRING", "SIZEDSTRING", "IGNORED_TOKEN", "'|'", "'^'", - "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "'~'", "NEG", "','", "'='", - "'('", "')'", "$accept", "input", "accelerator", "acc_entries", - "acc_entry", "acc_event", "acc_options", "acc_option", "bitmap", - "cursor", "dialog", "@1", "@2", "@3", "exstyle", "styles", "controls", - "control", "@4", "@5", "@6", "@7", "@8", "@9", "@10", "@11", "@12", - "@13", "@14", "@15", "@16", "@17", "@18", "@19", "@20", "@21", "@22", - "@23", "@24", "control_params", "cresid", "optresidc", "resid", - "opt_control_data", "control_styleexpr", "@25", "icon_styleexpr", "@26", - "control_params_styleexpr", "@27", "font", "icon", "language", "menu", - "menuitems", "menuitem", "menuitem_flags", "menuitem_flag", "menuex", - "menuexitems", "menuexitem", "messagetable", "optrcdata_data", "@28", - "optrcdata_data_int", "rcdata_data", "stringtable", "@29", "string_data", - "rcdata_id", "user", "toolbar", "toolbar_data", "versioninfo", - "fixedverinfo", "verblocks", "verstringtables", "vervals", "vertrans", - "id", "resname", "resref", "suboptions", "memflags_move_discard", - "memflags_move", "memflag", "file_name", "res_unicode_string_concat", - "res_unicode_string", "res_unicode_sizedstring", - "res_unicode_sizedstring_concat", "sizedstring", "sizedunistring", - "styleexpr", "parennumber", "optcnumexpr", "cnumexpr", "numexpr", - "sizednumexpr", "cposnumexpr", "posnumexpr", "sizedposnumexpr", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 124, 94, - 38, 43, 45, 42, 47, 37, 126, 353, 44, 61, - 40, 41 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 112, 113, 113, 113, 113, 113, 113, 113, 113, - 113, 113, 113, 113, 113, 113, 113, 113, 114, 115, - 115, 116, 116, 117, 117, 118, 118, 118, 119, 119, - 119, 119, 119, 119, 120, 121, 123, 122, 124, 122, - 125, 122, 126, 126, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, - 130, 129, 131, 129, 132, 129, 133, 129, 134, 129, - 135, 129, 129, 129, 136, 129, 137, 129, 138, 129, - 139, 129, 140, 129, 129, 129, 129, 129, 141, 129, - 142, 129, 143, 129, 144, 129, 145, 129, 146, 129, - 147, 129, 148, 129, 149, 129, 150, 129, 151, 151, - 151, 152, 153, 153, 154, 154, 155, 155, 157, 156, - 159, 158, 161, 160, 162, 163, 164, 165, 166, 166, - 167, 167, 167, 168, 168, 168, 169, 169, 169, 169, - 169, 169, 170, 171, 171, 172, 172, 172, 172, 172, - 172, 172, 172, 173, 175, 174, 176, 176, 177, 177, - 177, 177, 177, 177, 177, 179, 178, 180, 180, 180, - 180, 181, 181, 181, 181, 181, 181, 181, 181, 181, - 181, 182, 182, 183, 184, 184, 184, 185, 186, 186, - 186, 186, 186, 186, 186, 186, 187, 187, 187, 188, - 188, 189, 189, 190, 190, 191, 191, 192, 192, 193, - 193, 193, 194, 194, 194, 194, 194, 195, 195, 196, - 196, 197, 197, 197, 197, 197, 197, 197, 198, 198, - 199, 199, 200, 200, 201, 201, 202, 202, 203, 203, - 204, 204, 205, 205, 205, 205, 206, 206, 207, 207, - 208, 209, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 211, 212, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 6, 0, - 2, 2, 4, 1, 1, 1, 3, 2, 1, 1, - 1, 1, 1, 1, 4, 4, 0, 13, 0, 13, - 0, 14, 0, 3, 0, 3, 3, 3, 3, 3, - 5, 6, 7, 8, 3, 3, 4, 3, 0, 2, - 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, - 0, 3, 11, 12, 0, 4, 0, 4, 0, 3, - 0, 4, 0, 4, 6, 8, 10, 11, 0, 4, - 0, 3, 0, 4, 0, 4, 0, 4, 0, 4, - 0, 4, 0, 3, 0, 4, 0, 15, 6, 8, - 9, 2, 0, 2, 1, 1, 0, 3, 0, 3, - 0, 3, 0, 3, 4, 4, 3, 6, 0, 2, - 4, 2, 6, 0, 3, 2, 1, 1, 1, 1, - 1, 1, 6, 0, 2, 2, 3, 5, 2, 5, - 6, 7, 9, 4, 0, 2, 0, 1, 1, 1, - 1, 3, 3, 3, 2, 0, 6, 0, 3, 4, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 6, 4, 8, 0, 3, 2, 6, 0, 6, - 6, 3, 3, 3, 3, 3, 0, 5, 7, 0, - 5, 0, 5, 0, 3, 1, 1, 1, 1, 2, - 1, 2, 0, 2, 3, 4, 3, 0, 2, 0, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, - 1, 2, 1, 2, 3, 4, 1, 3, 0, 1, - 2, 1, 1, 3, 2, 2, 3, 3, 3, 3, - 3, 3, 3, 3, 2, 1, 1, 3, 2, 3, - 3, 3, 3, 3, 3, 3, 3 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint16 yydefact[] = -{ - 2, 0, 1, 0, 212, 232, 233, 208, 266, 17, - 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 15, 14, 16, 0, 206, 207, 205, - 265, 252, 0, 0, 0, 0, 251, 0, 268, 0, - 212, 219, 217, 219, 219, 217, 217, 179, 180, 177, - 178, 172, 174, 175, 176, 212, 212, 212, 219, 173, - 188, 212, 171, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 254, 0, 0, 126, 0, 0, 0, 0, - 0, 0, 0, 0, 165, 0, 0, 0, 221, 222, - 223, 224, 225, 226, 227, 213, 267, 0, 0, 0, - 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, - 276, 275, 274, 272, 273, 269, 270, 271, 253, 250, - 263, 262, 261, 259, 260, 256, 257, 258, 167, 0, - 214, 216, 19, 228, 229, 220, 34, 218, 35, 0, - 0, 0, 124, 125, 0, 128, 143, 153, 196, 0, - 0, 0, 0, 0, 0, 0, 154, 182, 0, 215, - 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, - 191, 192, 193, 194, 195, 0, 156, 170, 166, 0, - 18, 23, 20, 0, 24, 43, 0, 0, 184, 127, - 0, 0, 129, 142, 0, 0, 144, 187, 0, 0, - 248, 249, 248, 181, 240, 238, 155, 157, 158, 159, - 160, 0, 236, 168, 235, 234, 0, 21, 0, 0, - 0, 131, 0, 230, 133, 148, 145, 0, 199, 0, - 248, 248, 164, 239, 241, 169, 237, 264, 0, 36, - 38, 183, 0, 186, 231, 133, 0, 146, 143, 0, - 0, 0, 189, 190, 161, 162, 163, 28, 29, 30, - 31, 32, 33, 22, 25, 44, 44, 40, 185, 130, - 128, 136, 137, 138, 139, 140, 141, 0, 135, 248, - 0, 143, 0, 197, 0, 203, 0, 27, 0, 0, - 44, 0, 134, 147, 149, 0, 143, 248, 201, 0, - 26, 58, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 58, 0, 132, 150, 0, 0, 0, 198, 0, - 0, 48, 45, 46, 49, 207, 0, 246, 0, 47, - 242, 0, 0, 55, 57, 54, 0, 58, 151, 143, - 200, 0, 204, 37, 112, 112, 112, 112, 112, 70, - 112, 112, 78, 112, 90, 112, 112, 112, 112, 112, - 102, 112, 0, 112, 112, 112, 0, 59, 243, 0, - 0, 0, 56, 39, 0, 0, 0, 0, 0, 115, - 114, 60, 62, 64, 68, 0, 74, 76, 0, 80, - 0, 92, 94, 96, 98, 100, 0, 104, 210, 0, - 0, 66, 82, 88, 0, 247, 0, 244, 50, 41, - 152, 0, 0, 113, 0, 0, 0, 0, 71, 0, - 0, 0, 79, 0, 91, 0, 0, 0, 0, 0, - 103, 0, 211, 0, 209, 0, 0, 0, 0, 245, - 51, 202, 0, 0, 61, 63, 65, 69, 0, 75, - 77, 81, 93, 95, 97, 99, 101, 105, 0, 67, - 83, 89, 0, 52, 111, 118, 0, 0, 0, 116, - 53, 0, 0, 0, 0, 154, 84, 0, 119, 0, - 116, 0, 0, 116, 0, 122, 108, 248, 0, 117, - 120, 85, 248, 248, 0, 116, 249, 0, 0, 116, - 249, 116, 249, 123, 109, 116, 0, 121, 86, 116, - 72, 116, 110, 0, 87, 73, 106, 0, 248, 107 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 1, 12, 160, 182, 183, 263, 264, 13, 14, - 15, 265, 266, 290, 140, 288, 320, 367, 414, 415, - 416, 435, 417, 385, 420, 421, 388, 423, 436, 437, - 390, 425, 426, 427, 428, 429, 396, 431, 517, 418, - 443, 377, 378, 476, 466, 471, 492, 498, 487, 494, - 16, 17, 18, 19, 165, 192, 246, 278, 20, 166, - 196, 21, 175, 176, 206, 207, 22, 128, 158, 61, - 23, 24, 220, 25, 108, 167, 250, 317, 299, 26, - 27, 399, 37, 99, 98, 95, 136, 379, 223, 212, - 213, 214, 215, 329, 330, 200, 201, 419, 36, 217, - 380, 30 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -446 -static const yytype_int16 yypact[] = -{ - -446, 75, -446, 317, -446, -446, -446, -446, -446, -446, - 317, 317, -446, -446, -446, -446, -446, -446, -446, -446, - -446, -446, -446, -446, -446, -446, 463, -446, -446, -446, - 589, -446, 317, 317, 317, -93, 626, 209, -446, 437, - -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, - -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, - -446, -446, -446, 317, 317, 317, 317, 317, 317, 317, - 317, -446, -446, 526, 317, -446, 317, 317, 317, 317, - 317, 317, 317, 317, -446, 317, 317, 317, -446, -446, - -446, -446, -446, -446, -446, -446, -446, 267, 675, 675, - 275, 275, 675, 675, 491, 404, 441, 675, 168, 256, - 719, 379, 397, 213, 213, -446, -446, -446, -446, -446, - 719, 379, 397, 213, 213, -446, -446, -446, -446, -93, - -446, -446, -446, -446, -446, -446, -446, -446, -446, -65, - 144, 144, -446, -446, -93, -446, -446, -446, -446, 317, - 317, 317, 317, 317, 317, 317, -446, -446, 18, -446, - 21, 317, -93, -93, 31, 140, 155, 126, -93, -93, - -446, -446, -446, -446, -446, 47, 177, -446, -446, 212, - -446, -446, -446, -34, -446, -446, -93, -93, -446, -446, - -36, -5, -446, -446, -25, -5, -446, -446, 119, 131, - -93, -446, -93, -446, -446, -446, -446, 54, 68, 84, - 626, 2, -446, 2, 68, 84, 144, 87, -93, -93, - 25, -446, 95, -446, -5, -446, 95, 62, -446, 102, - -93, -93, 177, -446, -446, 2, -446, -446, 552, -446, - -93, -446, 306, -446, -446, -446, 76, -93, -446, 8, - 6, -5, -446, -446, 68, 84, 626, -446, -446, -446, - -446, -446, -446, 167, -446, -446, -446, -446, -446, 271, - -446, -446, -446, -446, -446, -446, -446, 763, -446, -93, - 161, -446, 11, -446, 197, -5, 552, -446, 374, 548, - -446, 178, -446, -446, -446, 190, -446, -93, -446, 3, - -446, -446, 317, -5, 306, -47, 317, 317, 317, 317, - 306, -446, 565, -446, -446, 194, 201, -1, -446, -93, - 639, -446, -5, -446, -5, 143, -33, -446, 317, 110, - -446, 105, -93, -446, -446, -446, 676, -446, -446, -446, - -446, -5, -446, -446, 311, 311, 311, 311, 311, -446, - 311, 311, -446, 311, -446, 311, 311, 311, 311, 311, - -446, 311, 306, 311, 311, 311, 306, -446, -446, 104, - -42, -5, -446, -446, 713, 207, 99, 317, 113, -5, - -446, -446, -446, -446, -446, 317, -446, -446, 317, -446, - 317, -446, -446, -446, -446, -446, 317, -446, 115, 317, - 120, -446, -446, -446, 317, -446, -33, -446, 95, -446, - -446, -5, 152, -446, 317, 317, 317, 317, -446, -93, - 317, 317, -446, 317, -446, 317, 317, 317, 317, 317, - -446, 317, -446, 153, -446, 317, 317, 317, -93, -446, - -93, -5, 311, 159, -446, -446, -446, -446, -93, -446, - -446, -446, -446, -446, -446, -446, -446, -446, 317, -446, - -446, -446, -93, -93, -446, -446, -93, -93, 173, 15, - -446, -47, -93, -93, 317, -446, -446, -93, 110, -93, - 27, 180, 244, 29, -93, -446, -446, -93, 317, -446, - -446, -446, -93, -93, -47, 273, -93, 192, -47, 273, - -93, 273, -93, 110, -446, 273, 317, 110, -446, 273, - -446, 273, -446, 193, -446, -446, -446, -47, -75, -446 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -446, -446, -446, -446, -446, -446, -446, -236, -446, -446, - -446, -446, -446, -446, 184, -262, -273, -446, -446, -446, - -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, - -446, -446, -446, -446, -446, -446, -446, -446, -446, 219, - -446, 442, -123, 274, -446, -446, -446, -446, -446, -446, - -446, -446, -446, -446, 77, -446, 101, 88, -446, -239, - -446, -446, -109, -446, -446, -446, -446, -446, -446, -446, - -446, -446, -446, -446, -446, -446, -446, -446, -446, -24, - -245, 4, 169, 211, 270, 710, 175, -178, 5, -173, - 157, -156, -122, -445, -325, -161, -30, -3, 26, -446, - 20, -446 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -231 -static const yytype_int16 yytable[] = -{ - 35, 368, 62, 340, 289, 75, 28, 318, 202, 280, - 283, 281, 222, 224, 296, 74, 226, 227, 475, 177, - 208, 29, 178, 370, 221, 180, 478, 287, 312, 241, - 475, 28, 475, 74, 188, 225, 38, 39, 336, 230, - 236, 231, 295, 326, 161, 407, 29, 327, 406, 503, - 300, 203, 327, 507, 209, 5, 6, 315, 71, 72, - 73, 327, 236, 328, 374, 248, 5, 6, 328, 252, - 253, 119, 518, 285, 216, 2, 254, 328, 242, 270, - 341, 439, 129, 130, 131, 243, 5, 6, 284, 110, - 111, 112, 113, 114, 115, 116, 117, 204, 205, 159, - 375, 144, 120, 121, 122, 123, 124, 125, 126, 127, - 255, 74, 31, 181, 164, 8, 74, 398, 293, 74, - 32, 398, 228, 74, 33, 322, 324, 10, 34, 3, - 197, 11, 186, 187, 229, 485, 316, 490, 271, 272, - 273, 274, 275, 276, 189, 4, 168, 169, 170, 171, - 172, 173, 174, 5, 6, 179, 218, 219, 185, 193, - 162, 163, 232, 376, 233, 294, 5, 6, 7, 8, - 74, 148, 9, 257, 258, 259, 260, 261, 262, 234, - 184, 10, 313, 251, 277, 11, 5, 6, 239, 240, - 5, 6, 245, 408, 314, 238, 247, 249, 338, 190, - 298, 191, 210, 74, 339, 198, 199, 411, 370, 97, - 267, 410, 84, 371, 194, 405, 195, 279, 268, 282, - 194, 413, 195, 432, 104, 105, 106, 244, 434, 244, - 109, 244, 244, 441, -230, -230, 237, 190, 8, 191, - 149, 150, 151, 152, 153, 154, 155, 28, 489, 194, - 10, 195, 297, 194, 11, 195, 102, 103, 256, 156, - 442, 458, 29, 85, 86, 87, 194, 465, 195, 319, - 132, 31, 204, 205, 138, 286, 475, 142, 143, 32, - 323, 474, 147, 33, 157, 141, 335, 34, 488, 342, - 244, 139, 88, 89, 90, 91, 92, 93, 94, 321, - 506, 516, 372, 331, 332, 333, 334, 204, 205, 325, - 85, 86, 87, 100, 101, 28, 81, 82, 83, 464, - 211, 85, 86, 87, 29, 369, 495, 244, 107, 244, - 29, 499, 501, 271, 272, 273, 274, 275, 276, 88, - 89, 90, 91, 92, 93, 94, 269, 291, 133, 134, - 88, 89, 90, 91, 92, 93, 94, 519, 88, 89, - 90, 91, 92, 93, 94, 292, 482, 28, 235, 0, - 404, 28, 0, 0, 412, 0, 0, 301, 440, 277, - 0, 244, 400, 0, 244, 0, 400, 0, 0, 448, - 302, 303, 304, 305, 0, 0, 433, 5, 6, 7, - 8, 438, 5, 6, 0, 8, 0, 145, 462, 0, - 463, 31, 10, 244, 0, 306, 11, 10, 467, 32, - 0, 11, 0, 33, 0, 0, 0, 34, 307, 308, - 309, 310, 469, 470, 0, 0, 472, 473, 0, 477, - 0, 0, 479, 480, 146, 0, 244, 483, 0, 484, - 0, 0, 0, 0, 493, 468, 0, 496, 85, 86, - 87, 0, 500, 502, 0, 0, 505, 0, 40, 0, - 509, 481, 511, 0, 0, 41, 42, 43, 44, 78, - 79, 80, 81, 82, 83, 497, 0, 88, 89, 90, - 91, 92, 93, 94, 0, 85, 86, 87, 79, 80, - 81, 82, 83, 513, 45, 46, 47, 48, 49, 50, - 0, 51, 52, 53, 54, 55, 0, 0, 0, 0, - 56, 57, 0, 0, 88, 89, 90, 91, 92, 93, - 94, 58, 59, 0, 60, 76, 77, 78, 79, 80, - 81, 82, 83, 0, 0, 85, 86, 87, 96, 0, - 0, 311, 0, 0, 5, 6, 7, 8, 257, 258, - 259, 260, 261, 262, 302, 303, 304, 305, 337, 10, - 0, 0, 0, 11, 88, 89, 90, 91, 92, 93, - 94, 302, 303, 304, 305, 31, 0, 0, 0, 306, - 0, 0, 0, 32, 0, 0, 0, 33, 0, 0, - 0, 34, 307, 308, 309, 310, 306, 422, 0, 424, - 0, 0, 0, 0, 0, 430, 0, 0, 0, 307, - 308, 309, 310, 0, 76, 77, 78, 79, 80, 81, - 82, 83, 0, 444, 445, 446, 447, 118, 0, 449, - 450, 0, 451, 343, 452, 453, 454, 455, 456, 344, - 457, 0, 0, 0, 459, 460, 461, 0, 0, 345, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, - 373, 366, 0, 0, 0, 0, 344, 63, 64, 65, - 66, 67, 68, 69, 70, 0, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 364, 365, 409, 366, 0, - 0, 0, 0, 344, 76, 77, 78, 79, 80, 81, - 82, 83, 0, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 486, 366, 0, 491, 88, 89, - 90, 91, 92, 93, 94, 0, 0, 133, 134, 504, - 0, 0, 0, 508, 0, 510, 0, 0, 0, 512, - 0, 0, 0, 514, 0, 515, 0, 381, 382, 383, - 384, 0, 386, 387, 0, 389, 0, 391, 392, 393, - 394, 395, 0, 397, 0, 401, 402, 403, 135, 137, - 135, 135, 137, 137, 0, 0, 0, 135, 77, 78, - 79, 80, 81, 82, 83, 271, 272, 273, 274, 275, - 276 -}; - -static const yytype_int16 yycheck[] = -{ - 3, 326, 26, 4, 266, 35, 1, 4, 169, 248, - 4, 3, 190, 191, 3, 108, 194, 195, 3, 1, - 176, 1, 4, 98, 60, 4, 471, 263, 290, 4, - 3, 26, 3, 108, 3, 60, 10, 11, 311, 200, - 213, 202, 281, 90, 109, 370, 26, 94, 90, 494, - 286, 4, 94, 498, 176, 91, 92, 296, 32, 33, - 34, 94, 235, 110, 337, 3, 91, 92, 110, 230, - 231, 74, 517, 251, 108, 0, 232, 110, 53, 3, - 81, 406, 85, 86, 87, 60, 91, 92, 82, 63, - 64, 65, 66, 67, 68, 69, 70, 95, 96, 129, - 339, 104, 76, 77, 78, 79, 80, 81, 82, 83, - 232, 108, 94, 92, 144, 94, 108, 362, 279, 108, - 102, 366, 3, 108, 106, 303, 304, 106, 110, 54, - 4, 110, 162, 163, 3, 108, 297, 108, 62, 63, - 64, 65, 66, 67, 4, 70, 149, 150, 151, 152, - 153, 154, 155, 91, 92, 158, 186, 187, 161, 4, - 140, 141, 108, 341, 96, 4, 91, 92, 93, 94, - 108, 3, 97, 6, 7, 8, 9, 10, 11, 95, - 160, 106, 4, 81, 108, 110, 91, 92, 218, 219, - 91, 92, 222, 371, 4, 108, 226, 227, 4, 59, - 3, 61, 176, 108, 3, 79, 80, 108, 98, 40, - 240, 4, 3, 108, 59, 111, 61, 247, 242, 249, - 59, 108, 61, 108, 55, 56, 57, 222, 108, 224, - 61, 226, 227, 411, 91, 92, 216, 59, 94, 61, - 72, 73, 74, 75, 76, 77, 78, 242, 4, 59, - 106, 61, 282, 59, 110, 61, 45, 46, 232, 3, - 108, 108, 242, 54, 55, 56, 59, 108, 61, 299, - 3, 94, 95, 96, 99, 108, 3, 102, 103, 102, - 304, 108, 107, 106, 109, 101, 310, 110, 108, 319, - 285, 16, 83, 84, 85, 86, 87, 88, 89, 302, - 108, 108, 332, 306, 307, 308, 309, 95, 96, 304, - 54, 55, 56, 43, 44, 310, 103, 104, 105, 442, - 108, 54, 55, 56, 304, 328, 487, 322, 58, 324, - 310, 492, 493, 62, 63, 64, 65, 66, 67, 83, - 84, 85, 86, 87, 88, 89, 245, 270, 92, 93, - 83, 84, 85, 86, 87, 88, 89, 518, 83, 84, - 85, 86, 87, 88, 89, 277, 475, 362, 211, -1, - 366, 366, -1, -1, 377, -1, -1, 3, 408, 108, - -1, 376, 362, -1, 379, -1, 366, -1, -1, 419, - 16, 17, 18, 19, -1, -1, 399, 91, 92, 93, - 94, 404, 91, 92, -1, 94, -1, 3, 438, -1, - 440, 94, 106, 408, -1, 41, 110, 106, 448, 102, - -1, 110, -1, 106, -1, -1, -1, 110, 54, 55, - 56, 57, 462, 463, -1, -1, 466, 467, -1, 469, - -1, -1, 472, 473, 3, -1, 441, 477, -1, 479, - -1, -1, -1, -1, 484, 458, -1, 487, 54, 55, - 56, -1, 492, 493, -1, -1, 496, -1, 5, -1, - 500, 474, 502, -1, -1, 12, 13, 14, 15, 100, - 101, 102, 103, 104, 105, 488, -1, 83, 84, 85, - 86, 87, 88, 89, -1, 54, 55, 56, 101, 102, - 103, 104, 105, 506, 41, 42, 43, 44, 45, 46, - -1, 48, 49, 50, 51, 52, -1, -1, -1, -1, - 57, 58, -1, -1, 83, 84, 85, 86, 87, 88, - 89, 68, 69, -1, 71, 98, 99, 100, 101, 102, - 103, 104, 105, -1, -1, 54, 55, 56, 111, -1, - -1, 3, -1, -1, 91, 92, 93, 94, 6, 7, - 8, 9, 10, 11, 16, 17, 18, 19, 3, 106, - -1, -1, -1, 110, 83, 84, 85, 86, 87, 88, - 89, 16, 17, 18, 19, 94, -1, -1, -1, 41, - -1, -1, -1, 102, -1, -1, -1, 106, -1, -1, - -1, 110, 54, 55, 56, 57, 41, 388, -1, 390, - -1, -1, -1, -1, -1, 396, -1, -1, -1, 54, - 55, 56, 57, -1, 98, 99, 100, 101, 102, 103, - 104, 105, -1, 414, 415, 416, 417, 111, -1, 420, - 421, -1, 423, 4, 425, 426, 427, 428, 429, 10, - 431, -1, -1, -1, 435, 436, 437, -1, -1, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 4, 42, -1, -1, -1, -1, 10, 98, 99, 100, - 101, 102, 103, 104, 105, -1, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 4, 42, -1, - -1, -1, -1, 10, 98, 99, 100, 101, 102, 103, - 104, 105, -1, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 480, 42, -1, 483, 83, 84, - 85, 86, 87, 88, 89, -1, -1, 92, 93, 495, - -1, -1, -1, 499, -1, 501, -1, -1, -1, 505, - -1, -1, -1, 509, -1, 511, -1, 345, 346, 347, - 348, -1, 350, 351, -1, 353, -1, 355, 356, 357, - 358, 359, -1, 361, -1, 363, 364, 365, 98, 99, - 100, 101, 102, 103, -1, -1, -1, 107, 99, 100, - 101, 102, 103, 104, 105, 62, 63, 64, 65, 66, - 67 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 113, 0, 54, 70, 91, 92, 93, 94, 97, - 106, 110, 114, 120, 121, 122, 162, 163, 164, 165, - 170, 173, 178, 182, 183, 185, 191, 192, 200, 212, - 213, 94, 102, 106, 110, 209, 210, 194, 210, 210, - 5, 12, 13, 14, 15, 41, 42, 43, 44, 45, - 46, 48, 49, 50, 51, 52, 57, 58, 68, 69, - 71, 181, 191, 98, 99, 100, 101, 102, 103, 104, - 105, 210, 210, 210, 108, 208, 98, 99, 100, 101, - 102, 103, 104, 105, 3, 54, 55, 56, 83, 84, - 85, 86, 87, 88, 89, 197, 111, 194, 196, 195, - 196, 196, 195, 195, 194, 194, 194, 196, 186, 194, - 210, 210, 210, 210, 210, 210, 210, 210, 111, 209, - 210, 210, 210, 210, 210, 210, 210, 210, 179, 209, - 209, 209, 3, 92, 93, 197, 198, 197, 198, 16, - 126, 126, 198, 198, 209, 3, 3, 198, 3, 72, - 73, 74, 75, 76, 77, 78, 3, 198, 180, 208, - 115, 109, 212, 212, 208, 166, 171, 187, 209, 209, - 209, 209, 209, 209, 209, 174, 175, 1, 4, 209, - 4, 92, 116, 117, 212, 209, 208, 208, 3, 4, - 59, 61, 167, 4, 59, 61, 172, 4, 79, 80, - 207, 208, 207, 4, 95, 96, 176, 177, 203, 204, - 210, 108, 201, 202, 203, 204, 108, 211, 208, 208, - 184, 60, 199, 200, 199, 60, 199, 199, 3, 3, - 207, 207, 108, 96, 95, 202, 201, 212, 108, 208, - 208, 4, 53, 60, 200, 208, 168, 208, 3, 208, - 188, 81, 207, 207, 203, 204, 210, 6, 7, 8, - 9, 10, 11, 118, 119, 123, 124, 208, 191, 168, - 3, 62, 63, 64, 65, 66, 67, 108, 169, 208, - 171, 3, 208, 4, 82, 199, 108, 119, 127, 127, - 125, 166, 169, 207, 4, 171, 3, 208, 3, 190, - 119, 3, 16, 17, 18, 19, 41, 54, 55, 56, - 57, 3, 127, 4, 4, 171, 207, 189, 4, 208, - 128, 209, 199, 191, 199, 200, 90, 94, 110, 205, - 206, 209, 209, 209, 209, 191, 128, 3, 4, 3, - 4, 81, 208, 4, 10, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 42, 129, 206, 209, - 98, 108, 208, 4, 128, 171, 199, 153, 154, 199, - 212, 153, 153, 153, 153, 135, 153, 153, 138, 153, - 142, 153, 153, 153, 153, 153, 148, 153, 192, 193, - 212, 153, 153, 153, 193, 111, 90, 206, 199, 4, - 4, 108, 209, 108, 130, 131, 132, 134, 151, 209, - 136, 137, 151, 139, 151, 143, 144, 145, 146, 147, - 151, 149, 108, 209, 108, 133, 140, 141, 209, 206, - 208, 199, 108, 152, 151, 151, 151, 151, 208, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 108, 151, - 151, 151, 208, 208, 154, 108, 156, 208, 209, 208, - 208, 157, 208, 208, 108, 3, 155, 208, 205, 208, - 208, 209, 174, 208, 208, 108, 155, 160, 108, 4, - 108, 155, 158, 208, 161, 207, 208, 209, 159, 207, - 208, 207, 208, 205, 155, 208, 108, 205, 155, 208, - 155, 208, 155, 209, 155, 155, 108, 150, 205, 207 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 18: -#line 202 "rcparse.y" - { - define_accelerator ((yyvsp[(1) - (6)].id), &(yyvsp[(3) - (6)].res_info), (yyvsp[(5) - (6)].pacc)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 19: -#line 212 "rcparse.y" - { - (yyval.pacc) = NULL; - } - break; - - case 20: -#line 216 "rcparse.y" - { - rc_accelerator *a; - - a = (rc_accelerator *) res_alloc (sizeof *a); - *a = (yyvsp[(2) - (2)].acc); - if ((yyvsp[(1) - (2)].pacc) == NULL) - (yyval.pacc) = a; - else - { - rc_accelerator **pp; - - for (pp = &(yyvsp[(1) - (2)].pacc)->next; *pp != NULL; pp = &(*pp)->next) - ; - *pp = a; - (yyval.pacc) = (yyvsp[(1) - (2)].pacc); - } - } - break; - - case 21: -#line 237 "rcparse.y" - { - (yyval.acc) = (yyvsp[(1) - (2)].acc); - (yyval.acc).id = (yyvsp[(2) - (2)].il); - } - break; - - case 22: -#line 242 "rcparse.y" - { - (yyval.acc) = (yyvsp[(1) - (4)].acc); - (yyval.acc).id = (yyvsp[(2) - (4)].il); - (yyval.acc).flags |= (yyvsp[(4) - (4)].is); - if (((yyval.acc).flags & ACC_VIRTKEY) == 0 - && ((yyval.acc).flags & (ACC_SHIFT | ACC_CONTROL)) != 0) - rcparse_warning (_("inappropriate modifiers for non-VIRTKEY")); - } - break; - - case 23: -#line 254 "rcparse.y" - { - const char *s = (yyvsp[(1) - (1)].s); - char ch; - - (yyval.acc).next = NULL; - (yyval.acc).id = 0; - ch = *s; - if (ch != '^') - (yyval.acc).flags = 0; - else - { - (yyval.acc).flags = ACC_CONTROL | ACC_VIRTKEY; - ++s; - ch = TOUPPER (s[0]); - } - (yyval.acc).key = ch; - if (s[1] != '\0') - rcparse_warning (_("accelerator should only be one character")); - } - break; - - case 24: -#line 274 "rcparse.y" - { - (yyval.acc).next = NULL; - (yyval.acc).flags = 0; - (yyval.acc).id = 0; - (yyval.acc).key = (yyvsp[(1) - (1)].il); - } - break; - - case 25: -#line 284 "rcparse.y" - { - (yyval.is) = (yyvsp[(1) - (1)].is); - } - break; - - case 26: -#line 288 "rcparse.y" - { - (yyval.is) = (yyvsp[(1) - (3)].is) | (yyvsp[(3) - (3)].is); - } - break; - - case 27: -#line 293 "rcparse.y" - { - (yyval.is) = (yyvsp[(1) - (2)].is) | (yyvsp[(2) - (2)].is); - } - break; - - case 28: -#line 300 "rcparse.y" - { - (yyval.is) = ACC_VIRTKEY; - } - break; - - case 29: -#line 304 "rcparse.y" - { - /* This is just the absence of VIRTKEY. */ - (yyval.is) = 0; - } - break; - - case 30: -#line 309 "rcparse.y" - { - (yyval.is) = ACC_NOINVERT; - } - break; - - case 31: -#line 313 "rcparse.y" - { - (yyval.is) = ACC_SHIFT; - } - break; - - case 32: -#line 317 "rcparse.y" - { - (yyval.is) = ACC_CONTROL; - } - break; - - case 33: -#line 321 "rcparse.y" - { - (yyval.is) = ACC_ALT; - } - break; - - case 34: -#line 330 "rcparse.y" - { - define_bitmap ((yyvsp[(1) - (4)].id), &(yyvsp[(3) - (4)].res_info), (yyvsp[(4) - (4)].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 35: -#line 342 "rcparse.y" - { - define_cursor ((yyvsp[(1) - (4)].id), &(yyvsp[(3) - (4)].res_info), (yyvsp[(4) - (4)].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 36: -#line 355 "rcparse.y" - { - memset (&dialog, 0, sizeof dialog); - dialog.x = (yyvsp[(5) - (8)].il); - dialog.y = (yyvsp[(6) - (8)].il); - dialog.width = (yyvsp[(7) - (8)].il); - dialog.height = (yyvsp[(8) - (8)].il); - dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; - dialog.exstyle = (yyvsp[(4) - (8)].il); - dialog.menu.named = 1; - dialog.class.named = 1; - dialog.font = NULL; - dialog.ex = NULL; - dialog.controls = NULL; - sub_res_info = (yyvsp[(3) - (8)].res_info); - style = 0; - } - break; - - case 37: -#line 372 "rcparse.y" - { - define_dialog ((yyvsp[(1) - (13)].id), &sub_res_info, &dialog); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 38: -#line 380 "rcparse.y" - { - memset (&dialog, 0, sizeof dialog); - dialog.x = (yyvsp[(5) - (8)].il); - dialog.y = (yyvsp[(6) - (8)].il); - dialog.width = (yyvsp[(7) - (8)].il); - dialog.height = (yyvsp[(8) - (8)].il); - dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; - dialog.exstyle = (yyvsp[(4) - (8)].il); - dialog.menu.named = 1; - dialog.class.named = 1; - dialog.font = NULL; - dialog.ex = ((rc_dialog_ex *) - res_alloc (sizeof (rc_dialog_ex))); - memset (dialog.ex, 0, sizeof (rc_dialog_ex)); - dialog.controls = NULL; - sub_res_info = (yyvsp[(3) - (8)].res_info); - style = 0; - } - break; - - case 39: -#line 399 "rcparse.y" - { - define_dialog ((yyvsp[(1) - (13)].id), &sub_res_info, &dialog); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 40: -#line 407 "rcparse.y" - { - memset (&dialog, 0, sizeof dialog); - dialog.x = (yyvsp[(5) - (9)].il); - dialog.y = (yyvsp[(6) - (9)].il); - dialog.width = (yyvsp[(7) - (9)].il); - dialog.height = (yyvsp[(8) - (9)].il); - dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; - dialog.exstyle = (yyvsp[(4) - (9)].il); - dialog.menu.named = 1; - dialog.class.named = 1; - dialog.font = NULL; - dialog.ex = ((rc_dialog_ex *) - res_alloc (sizeof (rc_dialog_ex))); - memset (dialog.ex, 0, sizeof (rc_dialog_ex)); - dialog.ex->help = (yyvsp[(9) - (9)].il); - dialog.controls = NULL; - sub_res_info = (yyvsp[(3) - (9)].res_info); - style = 0; - } - break; - - case 41: -#line 427 "rcparse.y" - { - define_dialog ((yyvsp[(1) - (14)].id), &sub_res_info, &dialog); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 42: -#line 437 "rcparse.y" - { - (yyval.il) = 0; - } - break; - - case 43: -#line 441 "rcparse.y" - { - (yyval.il) = (yyvsp[(3) - (3)].il); - } - break; - - case 45: -#line 449 "rcparse.y" - { - dialog.style |= WS_CAPTION; - style |= WS_CAPTION; - dialog.caption = (yyvsp[(3) - (3)].uni); - } - break; - - case 46: -#line 455 "rcparse.y" - { - dialog.class = (yyvsp[(3) - (3)].id); - } - break; - - case 47: -#line 460 "rcparse.y" - { - dialog.style = style; - } - break; - - case 48: -#line 464 "rcparse.y" - { - dialog.exstyle = (yyvsp[(3) - (3)].il); - } - break; - - case 49: -#line 468 "rcparse.y" - { - res_unistring_to_id (& dialog.class, (yyvsp[(3) - (3)].uni)); - } - break; - - case 50: -#line 472 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[(3) - (5)].il); - dialog.font = (yyvsp[(5) - (5)].uni); - if (dialog.ex != NULL) - { - dialog.ex->weight = 0; - dialog.ex->italic = 0; - dialog.ex->charset = 1; - } - } - break; - - case 51: -#line 485 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[(3) - (6)].il); - dialog.font = (yyvsp[(5) - (6)].uni); - if (dialog.ex == NULL) - rcparse_warning (_("extended FONT requires DIALOGEX")); - else - { - dialog.ex->weight = (yyvsp[(6) - (6)].il); - dialog.ex->italic = 0; - dialog.ex->charset = 1; - } - } - break; - - case 52: -#line 500 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[(3) - (7)].il); - dialog.font = (yyvsp[(5) - (7)].uni); - if (dialog.ex == NULL) - rcparse_warning (_("extended FONT requires DIALOGEX")); - else - { - dialog.ex->weight = (yyvsp[(6) - (7)].il); - dialog.ex->italic = (yyvsp[(7) - (7)].il); - dialog.ex->charset = 1; - } - } - break; - - case 53: -#line 515 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[(3) - (8)].il); - dialog.font = (yyvsp[(5) - (8)].uni); - if (dialog.ex == NULL) - rcparse_warning (_("extended FONT requires DIALOGEX")); - else - { - dialog.ex->weight = (yyvsp[(6) - (8)].il); - dialog.ex->italic = (yyvsp[(7) - (8)].il); - dialog.ex->charset = (yyvsp[(8) - (8)].il); - } - } - break; - - case 54: -#line 530 "rcparse.y" - { - dialog.menu = (yyvsp[(3) - (3)].id); - } - break; - - case 55: -#line 534 "rcparse.y" - { - sub_res_info.characteristics = (yyvsp[(3) - (3)].il); - } - break; - - case 56: -#line 538 "rcparse.y" - { - sub_res_info.language = (yyvsp[(3) - (4)].il) | ((yyvsp[(4) - (4)].il) << SUBLANG_SHIFT); - } - break; - - case 57: -#line 542 "rcparse.y" - { - sub_res_info.version = (yyvsp[(3) - (3)].il); - } - break; - - case 59: -#line 550 "rcparse.y" - { - rc_dialog_control **pp; - - for (pp = &dialog.controls; *pp != NULL; pp = &(*pp)->next) - ; - *pp = (yyvsp[(2) - (2)].dialog_control); - } - break; - - case 60: -#line 561 "rcparse.y" - { - default_style = BS_AUTO3STATE | WS_TABSTOP; - base_style = BS_AUTO3STATE; - class.named = 0; - class.u.id = CTL_BUTTON; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 61: -#line 569 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 62: -#line 573 "rcparse.y" - { - default_style = BS_AUTOCHECKBOX | WS_TABSTOP; - base_style = BS_AUTOCHECKBOX; - class.named = 0; - class.u.id = CTL_BUTTON; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 63: -#line 581 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 64: -#line 585 "rcparse.y" - { - default_style = BS_AUTORADIOBUTTON | WS_TABSTOP; - base_style = BS_AUTORADIOBUTTON; - class.named = 0; - class.u.id = CTL_BUTTON; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 65: -#line 593 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 66: -#line 597 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class.named = 0; - class.u.id = CTL_EDIT; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 67: -#line 605 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - if (dialog.ex == NULL) - rcparse_warning (_("BEDIT requires DIALOGEX")); - res_string_to_id (&(yyval.dialog_control)->class, "BEDIT"); - } - break; - - case 68: -#line 612 "rcparse.y" - { - default_style = BS_CHECKBOX | WS_TABSTOP; - base_style = BS_CHECKBOX | WS_TABSTOP; - class.named = 0; - class.u.id = CTL_BUTTON; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 69: -#line 620 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 70: -#line 624 "rcparse.y" - { - /* This is as per MSDN documentation. With some (???) - versions of MS rc.exe their is no default style. */ - default_style = CBS_SIMPLE | WS_TABSTOP; - base_style = 0; - class.named = 0; - class.u.id = CTL_COMBOBOX; - res_text_field = res_null_text; - } - break; - - case 71: -#line 634 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(3) - (3)].dialog_control); - } - break; - - case 72: -#line 639 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[(2) - (11)].id), (yyvsp[(3) - (11)].il), (yyvsp[(6) - (11)].il), (yyvsp[(7) - (11)].il), (yyvsp[(8) - (11)].il), (yyvsp[(9) - (11)].il), (yyvsp[(4) - (11)].id), style, (yyvsp[(10) - (11)].il)); - if ((yyvsp[(11) - (11)].rcdata_item) != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - (yyval.dialog_control)->data = (yyvsp[(11) - (11)].rcdata_item); - } - } - break; - - case 73: -#line 650 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[(2) - (12)].id), (yyvsp[(3) - (12)].il), (yyvsp[(6) - (12)].il), (yyvsp[(7) - (12)].il), (yyvsp[(8) - (12)].il), (yyvsp[(9) - (12)].il), (yyvsp[(4) - (12)].id), style, (yyvsp[(10) - (12)].il)); - if (dialog.ex == NULL) - rcparse_warning (_("help ID requires DIALOGEX")); - (yyval.dialog_control)->help = (yyvsp[(11) - (12)].il); - (yyval.dialog_control)->data = (yyvsp[(12) - (12)].rcdata_item); - } - break; - - case 74: -#line 658 "rcparse.y" - { - default_style = SS_CENTER | WS_GROUP; - base_style = SS_CENTER; - class.named = 0; - class.u.id = CTL_STATIC; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 75: -#line 666 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 76: -#line 670 "rcparse.y" - { - default_style = BS_DEFPUSHBUTTON | WS_TABSTOP; - base_style = BS_DEFPUSHBUTTON | WS_TABSTOP; - class.named = 0; - class.u.id = CTL_BUTTON; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 77: -#line 678 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 78: -#line 682 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class.named = 0; - class.u.id = CTL_EDIT; - res_text_field = res_null_text; - } - break; - - case 79: -#line 690 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(3) - (3)].dialog_control); - } - break; - - case 80: -#line 694 "rcparse.y" - { - default_style = BS_GROUPBOX; - base_style = BS_GROUPBOX; - class.named = 0; - class.u.id = CTL_BUTTON; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 81: -#line 702 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 82: -#line 706 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class.named = 0; - class.u.id = CTL_EDIT; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 83: -#line 714 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - if (dialog.ex == NULL) - rcparse_warning (_("IEDIT requires DIALOGEX")); - res_string_to_id (&(yyval.dialog_control)->class, "HEDIT"); - } - break; - - case 84: -#line 721 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[(2) - (6)].id), (yyvsp[(3) - (6)].il), (yyvsp[(4) - (6)].il), (yyvsp[(5) - (6)].il), 0, 0, 0, (yyvsp[(6) - (6)].rcdata_item), - dialog.ex); - } - break; - - case 85: -#line 727 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[(2) - (8)].id), (yyvsp[(3) - (8)].il), (yyvsp[(4) - (8)].il), (yyvsp[(5) - (8)].il), 0, 0, 0, (yyvsp[(8) - (8)].rcdata_item), - dialog.ex); - } - break; - - case 86: -#line 733 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[(2) - (10)].id), (yyvsp[(3) - (10)].il), (yyvsp[(4) - (10)].il), (yyvsp[(5) - (10)].il), style, (yyvsp[(9) - (10)].il), 0, (yyvsp[(10) - (10)].rcdata_item), - dialog.ex); - } - break; - - case 87: -#line 739 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[(2) - (11)].id), (yyvsp[(3) - (11)].il), (yyvsp[(4) - (11)].il), (yyvsp[(5) - (11)].il), style, (yyvsp[(9) - (11)].il), (yyvsp[(10) - (11)].il), (yyvsp[(11) - (11)].rcdata_item), - dialog.ex); - } - break; - - case 88: -#line 744 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class.named = 0; - class.u.id = CTL_EDIT; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 89: -#line 752 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - if (dialog.ex == NULL) - rcparse_warning (_("IEDIT requires DIALOGEX")); - res_string_to_id (&(yyval.dialog_control)->class, "IEDIT"); - } - break; - - case 90: -#line 759 "rcparse.y" - { - default_style = LBS_NOTIFY | WS_BORDER; - base_style = LBS_NOTIFY | WS_BORDER; - class.named = 0; - class.u.id = CTL_LISTBOX; - res_text_field = res_null_text; - } - break; - - case 91: -#line 767 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(3) - (3)].dialog_control); - } - break; - - case 92: -#line 771 "rcparse.y" - { - default_style = SS_LEFT | WS_GROUP; - base_style = SS_LEFT; - class.named = 0; - class.u.id = CTL_STATIC; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 93: -#line 779 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 94: -#line 783 "rcparse.y" - { - default_style = BS_PUSHBOX | WS_TABSTOP; - base_style = BS_PUSHBOX; - class.named = 0; - class.u.id = CTL_BUTTON; - } - break; - - case 95: -#line 790 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 96: -#line 794 "rcparse.y" - { - default_style = BS_PUSHBUTTON | WS_TABSTOP; - base_style = BS_PUSHBUTTON | WS_TABSTOP; - class.named = 0; - class.u.id = CTL_BUTTON; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 97: -#line 802 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 98: -#line 806 "rcparse.y" - { - default_style = BS_RADIOBUTTON | WS_TABSTOP; - base_style = BS_RADIOBUTTON; - class.named = 0; - class.u.id = CTL_BUTTON; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 99: -#line 814 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 100: -#line 818 "rcparse.y" - { - default_style = SS_RIGHT | WS_GROUP; - base_style = SS_RIGHT; - class.named = 0; - class.u.id = CTL_STATIC; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 101: -#line 826 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 102: -#line 830 "rcparse.y" - { - default_style = SBS_HORZ; - base_style = 0; - class.named = 0; - class.u.id = CTL_SCROLLBAR; - res_text_field = res_null_text; - } - break; - - case 103: -#line 838 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(3) - (3)].dialog_control); - } - break; - - case 104: -#line 842 "rcparse.y" - { - default_style = BS_3STATE | WS_TABSTOP; - base_style = BS_3STATE; - class.named = 0; - class.u.id = CTL_BUTTON; - res_text_field = (yyvsp[(2) - (2)].id); - } - break; - - case 105: -#line 850 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[(4) - (4)].dialog_control); - } - break; - - case 106: -#line 855 "rcparse.y" - { style = WS_CHILD | WS_VISIBLE; } - break; - - case 107: -#line 857 "rcparse.y" - { - rc_res_id cid; - cid.named = 0; - cid.u.id = CTL_BUTTON; - (yyval.dialog_control) = define_control ((yyvsp[(2) - (15)].id), (yyvsp[(3) - (15)].il), (yyvsp[(5) - (15)].il), (yyvsp[(7) - (15)].il), (yyvsp[(9) - (15)].il), (yyvsp[(11) - (15)].il), cid, - style, (yyvsp[(15) - (15)].il)); - } - break; - - case 108: -#line 875 "rcparse.y" - { - (yyval.dialog_control) = define_control (res_text_field, (yyvsp[(1) - (6)].il), (yyvsp[(2) - (6)].il), (yyvsp[(3) - (6)].il), (yyvsp[(4) - (6)].il), (yyvsp[(5) - (6)].il), class, - default_style | WS_CHILD | WS_VISIBLE, 0); - if ((yyvsp[(6) - (6)].rcdata_item) != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - (yyval.dialog_control)->data = (yyvsp[(6) - (6)].rcdata_item); - } - } - break; - - case 109: -#line 887 "rcparse.y" - { - (yyval.dialog_control) = define_control (res_text_field, (yyvsp[(1) - (8)].il), (yyvsp[(2) - (8)].il), (yyvsp[(3) - (8)].il), (yyvsp[(4) - (8)].il), (yyvsp[(5) - (8)].il), class, style, (yyvsp[(7) - (8)].il)); - if ((yyvsp[(8) - (8)].rcdata_item) != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - (yyval.dialog_control)->data = (yyvsp[(8) - (8)].rcdata_item); - } - } - break; - - case 110: -#line 898 "rcparse.y" - { - (yyval.dialog_control) = define_control (res_text_field, (yyvsp[(1) - (9)].il), (yyvsp[(2) - (9)].il), (yyvsp[(3) - (9)].il), (yyvsp[(4) - (9)].il), (yyvsp[(5) - (9)].il), class, style, (yyvsp[(7) - (9)].il)); - if (dialog.ex == NULL) - rcparse_warning (_("help ID requires DIALOGEX")); - (yyval.dialog_control)->help = (yyvsp[(8) - (9)].il); - (yyval.dialog_control)->data = (yyvsp[(9) - (9)].rcdata_item); - } - break; - - case 111: -#line 909 "rcparse.y" - { - if ((yyvsp[(2) - (2)].id).named) - res_unistring_to_id (&(yyval.id), (yyvsp[(2) - (2)].id).u.n.name); - else - (yyval.id)=(yyvsp[(2) - (2)].id); - } - break; - - case 112: -#line 919 "rcparse.y" - { - res_string_to_id (&(yyval.id), ""); - } - break; - - case 113: -#line 922 "rcparse.y" - { (yyval.id)=(yyvsp[(1) - (2)].id); } - break; - - case 114: -#line 927 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = (yyvsp[(1) - (1)].il); - } - break; - - case 115: -#line 932 "rcparse.y" - { - (yyval.id).named = 1; - (yyval.id).u.n.name = (yyvsp[(1) - (1)].uni); - (yyval.id).u.n.length = unichar_len ((yyvsp[(1) - (1)].uni)); - } - break; - - case 116: -#line 941 "rcparse.y" - { - (yyval.rcdata_item) = NULL; - } - break; - - case 117: -#line 945 "rcparse.y" - { - (yyval.rcdata_item) = (yyvsp[(2) - (3)].rcdata).first; - } - break; - - case 118: -#line 954 "rcparse.y" - { style = WS_CHILD | WS_VISIBLE; } - break; - - case 120: -#line 960 "rcparse.y" - { style = SS_ICON | WS_CHILD | WS_VISIBLE; } - break; - - case 122: -#line 966 "rcparse.y" - { style = base_style | WS_CHILD | WS_VISIBLE; } - break; - - case 124: -#line 974 "rcparse.y" - { - define_font ((yyvsp[(1) - (4)].id), &(yyvsp[(3) - (4)].res_info), (yyvsp[(4) - (4)].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 125: -#line 986 "rcparse.y" - { - define_icon ((yyvsp[(1) - (4)].id), &(yyvsp[(3) - (4)].res_info), (yyvsp[(4) - (4)].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 126: -#line 999 "rcparse.y" - { - language = (yyvsp[(2) - (3)].il) | ((yyvsp[(3) - (3)].il) << SUBLANG_SHIFT); - } - break; - - case 127: -#line 1008 "rcparse.y" - { - define_menu ((yyvsp[(1) - (6)].id), &(yyvsp[(3) - (6)].res_info), (yyvsp[(5) - (6)].menuitem)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 128: -#line 1018 "rcparse.y" - { - (yyval.menuitem) = NULL; - } - break; - - case 129: -#line 1022 "rcparse.y" - { - if ((yyvsp[(1) - (2)].menuitem) == NULL) - (yyval.menuitem) = (yyvsp[(2) - (2)].menuitem); - else - { - rc_menuitem **pp; - - for (pp = &(yyvsp[(1) - (2)].menuitem)->next; *pp != NULL; pp = &(*pp)->next) - ; - *pp = (yyvsp[(2) - (2)].menuitem); - (yyval.menuitem) = (yyvsp[(1) - (2)].menuitem); - } - } - break; - - case 130: -#line 1039 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[(2) - (4)].uni), (yyvsp[(3) - (4)].il), (yyvsp[(4) - (4)].is), 0, 0, NULL); - } - break; - - case 131: -#line 1043 "rcparse.y" - { - (yyval.menuitem) = define_menuitem (NULL, 0, 0, 0, 0, NULL); - } - break; - - case 132: -#line 1047 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[(2) - (6)].uni), 0, (yyvsp[(3) - (6)].is), 0, 0, (yyvsp[(5) - (6)].menuitem)); - } - break; - - case 133: -#line 1054 "rcparse.y" - { - (yyval.is) = 0; - } - break; - - case 134: -#line 1058 "rcparse.y" - { - (yyval.is) = (yyvsp[(1) - (3)].is) | (yyvsp[(3) - (3)].is); - } - break; - - case 135: -#line 1062 "rcparse.y" - { - (yyval.is) = (yyvsp[(1) - (2)].is) | (yyvsp[(2) - (2)].is); - } - break; - - case 136: -#line 1069 "rcparse.y" - { - (yyval.is) = MENUITEM_CHECKED; - } - break; - - case 137: -#line 1073 "rcparse.y" - { - (yyval.is) = MENUITEM_GRAYED; - } - break; - - case 138: -#line 1077 "rcparse.y" - { - (yyval.is) = MENUITEM_HELP; - } - break; - - case 139: -#line 1081 "rcparse.y" - { - (yyval.is) = MENUITEM_INACTIVE; - } - break; - - case 140: -#line 1085 "rcparse.y" - { - (yyval.is) = MENUITEM_MENUBARBREAK; - } - break; - - case 141: -#line 1089 "rcparse.y" - { - (yyval.is) = MENUITEM_MENUBREAK; - } - break; - - case 142: -#line 1098 "rcparse.y" - { - define_menu ((yyvsp[(1) - (6)].id), &(yyvsp[(3) - (6)].res_info), (yyvsp[(5) - (6)].menuitem)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 143: -#line 1108 "rcparse.y" - { - (yyval.menuitem) = NULL; - } - break; - - case 144: -#line 1112 "rcparse.y" - { - if ((yyvsp[(1) - (2)].menuitem) == NULL) - (yyval.menuitem) = (yyvsp[(2) - (2)].menuitem); - else - { - rc_menuitem **pp; - - for (pp = &(yyvsp[(1) - (2)].menuitem)->next; *pp != NULL; pp = &(*pp)->next) - ; - *pp = (yyvsp[(2) - (2)].menuitem); - (yyval.menuitem) = (yyvsp[(1) - (2)].menuitem); - } - } - break; - - case 145: -#line 1129 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[(2) - (2)].uni), 0, 0, 0, 0, NULL); - } - break; - - case 146: -#line 1133 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[(2) - (3)].uni), (yyvsp[(3) - (3)].il), 0, 0, 0, NULL); - } - break; - - case 147: -#line 1137 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[(2) - (5)].uni), (yyvsp[(3) - (5)].il), (yyvsp[(4) - (5)].il), (yyvsp[(5) - (5)].il), 0, NULL); - } - break; - - case 148: -#line 1141 "rcparse.y" - { - (yyval.menuitem) = define_menuitem (NULL, 0, 0, 0, 0, NULL); - } - break; - - case 149: -#line 1145 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[(2) - (5)].uni), 0, 0, 0, 0, (yyvsp[(4) - (5)].menuitem)); - } - break; - - case 150: -#line 1149 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[(2) - (6)].uni), (yyvsp[(3) - (6)].il), 0, 0, 0, (yyvsp[(5) - (6)].menuitem)); - } - break; - - case 151: -#line 1153 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[(2) - (7)].uni), (yyvsp[(3) - (7)].il), (yyvsp[(4) - (7)].il), 0, 0, (yyvsp[(6) - (7)].menuitem)); - } - break; - - case 152: -#line 1158 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[(2) - (9)].uni), (yyvsp[(3) - (9)].il), (yyvsp[(4) - (9)].il), (yyvsp[(5) - (9)].il), (yyvsp[(6) - (9)].il), (yyvsp[(8) - (9)].menuitem)); - } - break; - - case 153: -#line 1167 "rcparse.y" - { - define_messagetable ((yyvsp[(1) - (4)].id), &(yyvsp[(3) - (4)].res_info), (yyvsp[(4) - (4)].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 154: -#line 1179 "rcparse.y" - { - rcparse_rcdata (); - } - break; - - case 155: -#line 1183 "rcparse.y" - { - rcparse_normal (); - (yyval.rcdata) = (yyvsp[(2) - (2)].rcdata); - } - break; - - case 156: -#line 1191 "rcparse.y" - { - (yyval.rcdata).first = NULL; - (yyval.rcdata).last = NULL; - } - break; - - case 157: -#line 1196 "rcparse.y" - { - (yyval.rcdata) = (yyvsp[(1) - (1)].rcdata); - } - break; - - case 158: -#line 1203 "rcparse.y" - { - rc_rcdata_item *ri; - - ri = define_rcdata_string ((yyvsp[(1) - (1)].ss).s, (yyvsp[(1) - (1)].ss).length); - (yyval.rcdata).first = ri; - (yyval.rcdata).last = ri; - } - break; - - case 159: -#line 1211 "rcparse.y" - { - rc_rcdata_item *ri; - - ri = define_rcdata_unistring ((yyvsp[(1) - (1)].suni).s, (yyvsp[(1) - (1)].suni).length); - (yyval.rcdata).first = ri; - (yyval.rcdata).last = ri; - } - break; - - case 160: -#line 1219 "rcparse.y" - { - rc_rcdata_item *ri; - - ri = define_rcdata_number ((yyvsp[(1) - (1)].i).val, (yyvsp[(1) - (1)].i).dword); - (yyval.rcdata).first = ri; - (yyval.rcdata).last = ri; - } - break; - - case 161: -#line 1227 "rcparse.y" - { - rc_rcdata_item *ri; - - ri = define_rcdata_string ((yyvsp[(3) - (3)].ss).s, (yyvsp[(3) - (3)].ss).length); - (yyval.rcdata).first = (yyvsp[(1) - (3)].rcdata).first; - (yyvsp[(1) - (3)].rcdata).last->next = ri; - (yyval.rcdata).last = ri; - } - break; - - case 162: -#line 1236 "rcparse.y" - { - rc_rcdata_item *ri; - - ri = define_rcdata_unistring ((yyvsp[(3) - (3)].suni).s, (yyvsp[(3) - (3)].suni).length); - (yyval.rcdata).first = (yyvsp[(1) - (3)].rcdata).first; - (yyvsp[(1) - (3)].rcdata).last->next = ri; - (yyval.rcdata).last = ri; - } - break; - - case 163: -#line 1245 "rcparse.y" - { - rc_rcdata_item *ri; - - ri = define_rcdata_number ((yyvsp[(3) - (3)].i).val, (yyvsp[(3) - (3)].i).dword); - (yyval.rcdata).first = (yyvsp[(1) - (3)].rcdata).first; - (yyvsp[(1) - (3)].rcdata).last->next = ri; - (yyval.rcdata).last = ri; - } - break; - - case 164: -#line 1254 "rcparse.y" - { - (yyval.rcdata)=(yyvsp[(1) - (2)].rcdata); - } - break; - - case 165: -#line 1263 "rcparse.y" - { sub_res_info = (yyvsp[(2) - (3)].res_info); rcparse_rcdata (); } - break; - - case 166: -#line 1264 "rcparse.y" - { rcparse_normal (); } - break; - - case 168: -#line 1270 "rcparse.y" - { - define_stringtable (&sub_res_info, (yyvsp[(2) - (3)].il), (yyvsp[(3) - (3)].suni).s, (yyvsp[(3) - (3)].suni).length); - rcparse_discard_strings (); - } - break; - - case 169: -#line 1275 "rcparse.y" - { - define_stringtable (&sub_res_info, (yyvsp[(2) - (4)].il), (yyvsp[(4) - (4)].suni).s, (yyvsp[(4) - (4)].suni).length); - rcparse_discard_strings (); - } - break; - - case 170: -#line 1280 "rcparse.y" - { - rcparse_warning (_("invalid stringtable resource.")); - abort (); - } - break; - - case 171: -#line 1288 "rcparse.y" - { - (yyval.id)=(yyvsp[(1) - (1)].id); - } - break; - - case 172: -#line 1292 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = 23; - } - break; - - case 173: -#line 1297 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = RT_RCDATA; - } - break; - - case 174: -#line 1302 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = RT_MANIFEST; - } - break; - - case 175: -#line 1307 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = RT_PLUGPLAY; - } - break; - - case 176: -#line 1312 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = RT_VXD; - } - break; - - case 177: -#line 1317 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = RT_DLGINCLUDE; - } - break; - - case 178: -#line 1322 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = RT_DLGINIT; - } - break; - - case 179: -#line 1327 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = RT_ANICURSOR; - } - break; - - case 180: -#line 1332 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = RT_ANIICON; - } - break; - - case 181: -#line 1343 "rcparse.y" - { - define_user_data ((yyvsp[(1) - (6)].id), (yyvsp[(2) - (6)].id), &(yyvsp[(3) - (6)].res_info), (yyvsp[(5) - (6)].rcdata).first); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 182: -#line 1350 "rcparse.y" - { - define_user_file ((yyvsp[(1) - (4)].id), (yyvsp[(2) - (4)].id), &(yyvsp[(3) - (4)].res_info), (yyvsp[(4) - (4)].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 183: -#line 1360 "rcparse.y" - { - define_toolbar ((yyvsp[(1) - (8)].id), &(yyvsp[(3) - (8)].res_info), (yyvsp[(4) - (8)].il), (yyvsp[(5) - (8)].il), (yyvsp[(7) - (8)].toobar_item)); - } - break; - - case 184: -#line 1365 "rcparse.y" - { (yyval.toobar_item)= NULL; } - break; - - case 185: -#line 1367 "rcparse.y" - { - rc_toolbar_item *c,*n; - c = (yyvsp[(1) - (3)].toobar_item); - n= (rc_toolbar_item *) - res_alloc (sizeof (rc_toolbar_item)); - if (c != NULL) - while (c->next != NULL) - c = c->next; - n->prev = c; - n->next = NULL; - if (c != NULL) - c->next = n; - n->id = (yyvsp[(3) - (3)].id); - if ((yyvsp[(1) - (3)].toobar_item) == NULL) - (yyval.toobar_item) = n; - else - (yyval.toobar_item) = (yyvsp[(1) - (3)].toobar_item); - } - break; - - case 186: -#line 1386 "rcparse.y" - { - rc_toolbar_item *c,*n; - c = (yyvsp[(1) - (2)].toobar_item); - n= (rc_toolbar_item *) - res_alloc (sizeof (rc_toolbar_item)); - if (c != NULL) - while (c->next != NULL) - c = c->next; - n->prev = c; - n->next = NULL; - if (c != NULL) - c->next = n; - n->id.named = 0; - n->id.u.id = 0; - if ((yyvsp[(1) - (2)].toobar_item) == NULL) - (yyval.toobar_item) = n; - else - (yyval.toobar_item) = (yyvsp[(1) - (2)].toobar_item); - } - break; - - case 187: -#line 1411 "rcparse.y" - { - define_versioninfo ((yyvsp[(1) - (6)].id), language, (yyvsp[(3) - (6)].fixver), (yyvsp[(5) - (6)].verinfo)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 188: -#line 1421 "rcparse.y" - { - (yyval.fixver) = ((rc_fixed_versioninfo *) - res_alloc (sizeof (rc_fixed_versioninfo))); - memset ((yyval.fixver), 0, sizeof (rc_fixed_versioninfo)); - } - break; - - case 189: -#line 1428 "rcparse.y" - { - (yyvsp[(1) - (6)].fixver)->file_version_ms = ((yyvsp[(3) - (6)].il) << 16) | (yyvsp[(4) - (6)].il); - (yyvsp[(1) - (6)].fixver)->file_version_ls = ((yyvsp[(5) - (6)].il) << 16) | (yyvsp[(6) - (6)].il); - (yyval.fixver) = (yyvsp[(1) - (6)].fixver); - } - break; - - case 190: -#line 1435 "rcparse.y" - { - (yyvsp[(1) - (6)].fixver)->product_version_ms = ((yyvsp[(3) - (6)].il) << 16) | (yyvsp[(4) - (6)].il); - (yyvsp[(1) - (6)].fixver)->product_version_ls = ((yyvsp[(5) - (6)].il) << 16) | (yyvsp[(6) - (6)].il); - (yyval.fixver) = (yyvsp[(1) - (6)].fixver); - } - break; - - case 191: -#line 1441 "rcparse.y" - { - (yyvsp[(1) - (3)].fixver)->file_flags_mask = (yyvsp[(3) - (3)].il); - (yyval.fixver) = (yyvsp[(1) - (3)].fixver); - } - break; - - case 192: -#line 1446 "rcparse.y" - { - (yyvsp[(1) - (3)].fixver)->file_flags = (yyvsp[(3) - (3)].il); - (yyval.fixver) = (yyvsp[(1) - (3)].fixver); - } - break; - - case 193: -#line 1451 "rcparse.y" - { - (yyvsp[(1) - (3)].fixver)->file_os = (yyvsp[(3) - (3)].il); - (yyval.fixver) = (yyvsp[(1) - (3)].fixver); - } - break; - - case 194: -#line 1456 "rcparse.y" - { - (yyvsp[(1) - (3)].fixver)->file_type = (yyvsp[(3) - (3)].il); - (yyval.fixver) = (yyvsp[(1) - (3)].fixver); - } - break; - - case 195: -#line 1461 "rcparse.y" - { - (yyvsp[(1) - (3)].fixver)->file_subtype = (yyvsp[(3) - (3)].il); - (yyval.fixver) = (yyvsp[(1) - (3)].fixver); - } - break; - - case 196: -#line 1475 "rcparse.y" - { - (yyval.verinfo) = NULL; - } - break; - - case 197: -#line 1479 "rcparse.y" - { - (yyval.verinfo) = append_ver_stringfileinfo ((yyvsp[(1) - (5)].verinfo), (yyvsp[(4) - (5)].verstringtable)); - } - break; - - case 198: -#line 1483 "rcparse.y" - { - (yyval.verinfo) = append_ver_varfileinfo ((yyvsp[(1) - (7)].verinfo), (yyvsp[(5) - (7)].uni), (yyvsp[(6) - (7)].vervar)); - } - break; - - case 199: -#line 1490 "rcparse.y" - { - (yyval.verstringtable) = NULL; - } - break; - - case 200: -#line 1494 "rcparse.y" - { - (yyval.verstringtable) = append_ver_stringtable ((yyvsp[(1) - (5)].verstringtable), (yyvsp[(2) - (5)].s), (yyvsp[(4) - (5)].verstring)); - } - break; - - case 201: -#line 1501 "rcparse.y" - { - (yyval.verstring) = NULL; - } - break; - - case 202: -#line 1505 "rcparse.y" - { - (yyval.verstring) = append_verval ((yyvsp[(1) - (5)].verstring), (yyvsp[(3) - (5)].uni), (yyvsp[(5) - (5)].uni)); - } - break; - - case 203: -#line 1512 "rcparse.y" - { - (yyval.vervar) = NULL; - } - break; - - case 204: -#line 1516 "rcparse.y" - { - (yyval.vervar) = append_vertrans ((yyvsp[(1) - (3)].vervar), (yyvsp[(2) - (3)].il), (yyvsp[(3) - (3)].il)); - } - break; - - case 205: -#line 1525 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = (yyvsp[(1) - (1)].il); - } - break; - - case 206: -#line 1530 "rcparse.y" - { - res_unistring_to_id (&(yyval.id), (yyvsp[(1) - (1)].uni)); - } - break; - - case 207: -#line 1539 "rcparse.y" - { - (yyval.uni) = (yyvsp[(1) - (1)].uni); - } - break; - - case 208: -#line 1543 "rcparse.y" - { - unichar *h = NULL; - unicode_from_ascii ((rc_uint_type *) NULL, &h, (yyvsp[(1) - (1)].s)); - (yyval.uni) = h; - } - break; - - case 209: -#line 1553 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = (yyvsp[(1) - (2)].il); - } - break; - - case 210: -#line 1558 "rcparse.y" - { - res_unistring_to_id (&(yyval.id), (yyvsp[(1) - (1)].uni)); - } - break; - - case 211: -#line 1562 "rcparse.y" - { - res_unistring_to_id (&(yyval.id), (yyvsp[(1) - (2)].uni)); - } - break; - - case 212: -#line 1572 "rcparse.y" - { - memset (&(yyval.res_info), 0, sizeof (rc_res_res_info)); - (yyval.res_info).language = language; - /* FIXME: Is this the right default? */ - (yyval.res_info).memflags = MEMFLAG_MOVEABLE | MEMFLAG_PURE | MEMFLAG_DISCARDABLE; - } - break; - - case 213: -#line 1579 "rcparse.y" - { - (yyval.res_info) = (yyvsp[(1) - (2)].res_info); - (yyval.res_info).memflags |= (yyvsp[(2) - (2)].memflags).on; - (yyval.res_info).memflags &=~ (yyvsp[(2) - (2)].memflags).off; - } - break; - - case 214: -#line 1585 "rcparse.y" - { - (yyval.res_info) = (yyvsp[(1) - (3)].res_info); - (yyval.res_info).characteristics = (yyvsp[(3) - (3)].il); - } - break; - - case 215: -#line 1590 "rcparse.y" - { - (yyval.res_info) = (yyvsp[(1) - (4)].res_info); - (yyval.res_info).language = (yyvsp[(3) - (4)].il) | ((yyvsp[(4) - (4)].il) << SUBLANG_SHIFT); - } - break; - - case 216: -#line 1595 "rcparse.y" - { - (yyval.res_info) = (yyvsp[(1) - (3)].res_info); - (yyval.res_info).version = (yyvsp[(3) - (3)].il); - } - break; - - case 217: -#line 1605 "rcparse.y" - { - memset (&(yyval.res_info), 0, sizeof (rc_res_res_info)); - (yyval.res_info).language = language; - (yyval.res_info).memflags = MEMFLAG_MOVEABLE | MEMFLAG_DISCARDABLE; - } - break; - - case 218: -#line 1611 "rcparse.y" - { - (yyval.res_info) = (yyvsp[(1) - (2)].res_info); - (yyval.res_info).memflags |= (yyvsp[(2) - (2)].memflags).on; - (yyval.res_info).memflags &=~ (yyvsp[(2) - (2)].memflags).off; - } - break; - - case 219: -#line 1622 "rcparse.y" - { - memset (&(yyval.res_info), 0, sizeof (rc_res_res_info)); - (yyval.res_info).language = language; - (yyval.res_info).memflags = MEMFLAG_MOVEABLE | MEMFLAG_PURE | MEMFLAG_DISCARDABLE; - } - break; - - case 220: -#line 1628 "rcparse.y" - { - (yyval.res_info) = (yyvsp[(1) - (2)].res_info); - (yyval.res_info).memflags |= (yyvsp[(2) - (2)].memflags).on; - (yyval.res_info).memflags &=~ (yyvsp[(2) - (2)].memflags).off; - } - break; - - case 221: -#line 1640 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_MOVEABLE; - (yyval.memflags).off = 0; - } - break; - - case 222: -#line 1645 "rcparse.y" - { - (yyval.memflags).on = 0; - (yyval.memflags).off = MEMFLAG_MOVEABLE; - } - break; - - case 223: -#line 1650 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_PURE; - (yyval.memflags).off = 0; - } - break; - - case 224: -#line 1655 "rcparse.y" - { - (yyval.memflags).on = 0; - (yyval.memflags).off = MEMFLAG_PURE; - } - break; - - case 225: -#line 1660 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_PRELOAD; - (yyval.memflags).off = 0; - } - break; - - case 226: -#line 1665 "rcparse.y" - { - (yyval.memflags).on = 0; - (yyval.memflags).off = MEMFLAG_PRELOAD; - } - break; - - case 227: -#line 1670 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_DISCARDABLE; - (yyval.memflags).off = 0; - } - break; - - case 228: -#line 1680 "rcparse.y" - { - (yyval.s) = (yyvsp[(1) - (1)].s); - } - break; - - case 229: -#line 1684 "rcparse.y" - { - (yyval.s) = (yyvsp[(1) - (1)].s); - } - break; - - case 230: -#line 1692 "rcparse.y" - { - (yyval.uni) = (yyvsp[(1) - (1)].uni); - } - break; - - case 231: -#line 1697 "rcparse.y" - { - rc_uint_type l1 = unichar_len ((yyvsp[(1) - (2)].uni)); - rc_uint_type l2 = unichar_len ((yyvsp[(2) - (2)].uni)); - unichar *h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar)); - if (l1 != 0) - memcpy (h, (yyvsp[(1) - (2)].uni), l1 * sizeof (unichar)); - if (l2 != 0) - memcpy (h + l1, (yyvsp[(2) - (2)].uni), l2 * sizeof (unichar)); - h[l1 + l2] = 0; - (yyval.uni) = h; - } - break; - - case 232: -#line 1712 "rcparse.y" - { - (yyval.uni) = unichar_dup ((yyvsp[(1) - (1)].uni)); - } - break; - - case 233: -#line 1716 "rcparse.y" - { - unichar *h = NULL; - unicode_from_ascii ((rc_uint_type *) NULL, &h, (yyvsp[(1) - (1)].s)); - (yyval.uni) = h; - } - break; - - case 234: -#line 1725 "rcparse.y" - { - (yyval.suni) = (yyvsp[(1) - (1)].suni); - } - break; - - case 235: -#line 1729 "rcparse.y" - { - unichar *h = NULL; - rc_uint_type l = 0; - unicode_from_ascii_len (&l, &h, (yyvsp[(1) - (1)].ss).s, (yyvsp[(1) - (1)].ss).length); - (yyval.suni).s = h; - (yyval.suni).length = l; - } - break; - - case 236: -#line 1741 "rcparse.y" - { - (yyval.suni) = (yyvsp[(1) - (1)].suni); - } - break; - - case 237: -#line 1746 "rcparse.y" - { - rc_uint_type l1 = (yyvsp[(1) - (2)].suni).length; - rc_uint_type l2 = (yyvsp[(2) - (2)].suni).length; - unichar *h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar)); - if (l1 != 0) - memcpy (h, (yyvsp[(1) - (2)].suni).s, l1 * sizeof (unichar)); - if (l2 != 0) - memcpy (h + l1, (yyvsp[(2) - (2)].suni).s, l2 * sizeof (unichar)); - h[l1 + l2] = 0; - (yyval.suni).length = l1 + l2; - (yyval.suni).s = h; - } - break; - - case 238: -#line 1762 "rcparse.y" - { - (yyval.ss) = (yyvsp[(1) - (1)].ss); - } - break; - - case 239: -#line 1766 "rcparse.y" - { - rc_uint_type l = (yyvsp[(1) - (2)].ss).length + (yyvsp[(2) - (2)].ss).length; - char *h = (char *) res_alloc (l); - memcpy (h, (yyvsp[(1) - (2)].ss).s, (yyvsp[(1) - (2)].ss).length); - memcpy (h + (yyvsp[(1) - (2)].ss).length, (yyvsp[(2) - (2)].ss).s, (yyvsp[(2) - (2)].ss).length); - (yyval.ss).s = h; - (yyval.ss).length = l; - } - break; - - case 240: -#line 1778 "rcparse.y" - { - (yyval.suni) = (yyvsp[(1) - (1)].suni); - } - break; - - case 241: -#line 1782 "rcparse.y" - { - rc_uint_type l = (yyvsp[(1) - (2)].suni).length + (yyvsp[(2) - (2)].suni).length; - unichar *h = (unichar *) res_alloc (l * sizeof (unichar)); - memcpy (h, (yyvsp[(1) - (2)].suni).s, (yyvsp[(1) - (2)].suni).length * sizeof (unichar)); - memcpy (h + (yyvsp[(1) - (2)].suni).length, (yyvsp[(2) - (2)].suni).s, (yyvsp[(2) - (2)].suni).length * sizeof (unichar)); - (yyval.suni).s = h; - (yyval.suni).length = l; - } - break; - - case 242: -#line 1804 "rcparse.y" - { - style |= (yyvsp[(1) - (1)].il); - } - break; - - case 243: -#line 1808 "rcparse.y" - { - style &=~ (yyvsp[(2) - (2)].il); - } - break; - - case 244: -#line 1812 "rcparse.y" - { - style |= (yyvsp[(3) - (3)].il); - } - break; - - case 245: -#line 1816 "rcparse.y" - { - style &=~ (yyvsp[(4) - (4)].il); - } - break; - - case 246: -#line 1823 "rcparse.y" - { - (yyval.il) = (yyvsp[(1) - (1)].i).val; - } - break; - - case 247: -#line 1827 "rcparse.y" - { - (yyval.il) = (yyvsp[(2) - (3)].il); - } - break; - - case 248: -#line 1836 "rcparse.y" - { - (yyval.il) = 0; - } - break; - - case 249: -#line 1840 "rcparse.y" - { - (yyval.il) = (yyvsp[(1) - (1)].il); - } - break; - - case 250: -#line 1849 "rcparse.y" - { - (yyval.il) = (yyvsp[(2) - (2)].il); - } - break; - - case 251: -#line 1858 "rcparse.y" - { - (yyval.il) = (yyvsp[(1) - (1)].i).val; - } - break; - - case 252: -#line 1867 "rcparse.y" - { - (yyval.i) = (yyvsp[(1) - (1)].i); - } - break; - - case 253: -#line 1871 "rcparse.y" - { - (yyval.i) = (yyvsp[(2) - (3)].i); - } - break; - - case 254: -#line 1875 "rcparse.y" - { - (yyval.i).val = ~ (yyvsp[(2) - (2)].i).val; - (yyval.i).dword = (yyvsp[(2) - (2)].i).dword; - } - break; - - case 255: -#line 1880 "rcparse.y" - { - (yyval.i).val = - (yyvsp[(2) - (2)].i).val; - (yyval.i).dword = (yyvsp[(2) - (2)].i).dword; - } - break; - - case 256: -#line 1885 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val * (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 257: -#line 1890 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val / (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 258: -#line 1895 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val % (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 259: -#line 1900 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val + (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 260: -#line 1905 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val - (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 261: -#line 1910 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val & (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 262: -#line 1915 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val ^ (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 263: -#line 1920 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val | (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 264: -#line 1931 "rcparse.y" - { - (yyval.il) = (yyvsp[(2) - (2)].il); - } - break; - - case 265: -#line 1940 "rcparse.y" - { - (yyval.il) = (yyvsp[(1) - (1)].i).val; - } - break; - - case 266: -#line 1951 "rcparse.y" - { - (yyval.i) = (yyvsp[(1) - (1)].i); - } - break; - - case 267: -#line 1955 "rcparse.y" - { - (yyval.i) = (yyvsp[(2) - (3)].i); - } - break; - - case 268: -#line 1959 "rcparse.y" - { - (yyval.i).val = ~ (yyvsp[(2) - (2)].i).val; - (yyval.i).dword = (yyvsp[(2) - (2)].i).dword; - } - break; - - case 269: -#line 1964 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val * (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 270: -#line 1969 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val / (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 271: -#line 1974 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val % (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 272: -#line 1979 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val + (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 273: -#line 1984 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val - (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 274: -#line 1989 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val & (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 275: -#line 1994 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val ^ (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - case 276: -#line 1999 "rcparse.y" - { - (yyval.i).val = (yyvsp[(1) - (3)].i).val | (yyvsp[(3) - (3)].i).val; - (yyval.i).dword = (yyvsp[(1) - (3)].i).dword || (yyvsp[(3) - (3)].i).dword; - } - break; - - -/* Line 1267 of yacc.c. */ -#line 4440 "rcparse.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -#line 2005 "rcparse.y" - - -/* Set the language from the command line. */ - -void -rcparse_set_language (int lang) -{ - language = lang; -} - diff -Nur binutils-2.24.orig/binutils/rcparse.h binutils-2.24/binutils/rcparse.h --- binutils-2.24.orig/binutils/rcparse.h 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/rcparse.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,298 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - BEG = 258, - END = 259, - ACCELERATORS = 260, - VIRTKEY = 261, - ASCII = 262, - NOINVERT = 263, - SHIFT = 264, - CONTROL = 265, - ALT = 266, - BITMAP = 267, - CURSOR = 268, - DIALOG = 269, - DIALOGEX = 270, - EXSTYLE = 271, - CAPTION = 272, - CLASS = 273, - STYLE = 274, - AUTO3STATE = 275, - AUTOCHECKBOX = 276, - AUTORADIOBUTTON = 277, - CHECKBOX = 278, - COMBOBOX = 279, - CTEXT = 280, - DEFPUSHBUTTON = 281, - EDITTEXT = 282, - GROUPBOX = 283, - LISTBOX = 284, - LTEXT = 285, - PUSHBOX = 286, - PUSHBUTTON = 287, - RADIOBUTTON = 288, - RTEXT = 289, - SCROLLBAR = 290, - STATE3 = 291, - USERBUTTON = 292, - BEDIT = 293, - HEDIT = 294, - IEDIT = 295, - FONT = 296, - ICON = 297, - ANICURSOR = 298, - ANIICON = 299, - DLGINCLUDE = 300, - DLGINIT = 301, - FONTDIR = 302, - HTML = 303, - MANIFEST = 304, - PLUGPLAY = 305, - VXD = 306, - TOOLBAR = 307, - BUTTON = 308, - LANGUAGE = 309, - CHARACTERISTICS = 310, - VERSIONK = 311, - MENU = 312, - MENUEX = 313, - MENUITEM = 314, - SEPARATOR = 315, - POPUP = 316, - CHECKED = 317, - GRAYED = 318, - HELP = 319, - INACTIVE = 320, - MENUBARBREAK = 321, - MENUBREAK = 322, - MESSAGETABLE = 323, - RCDATA = 324, - STRINGTABLE = 325, - VERSIONINFO = 326, - FILEVERSION = 327, - PRODUCTVERSION = 328, - FILEFLAGSMASK = 329, - FILEFLAGS = 330, - FILEOS = 331, - FILETYPE = 332, - FILESUBTYPE = 333, - BLOCKSTRINGFILEINFO = 334, - BLOCKVARFILEINFO = 335, - VALUE = 336, - BLOCK = 337, - MOVEABLE = 338, - FIXED = 339, - PURE = 340, - IMPURE = 341, - PRELOAD = 342, - LOADONCALL = 343, - DISCARDABLE = 344, - NOT = 345, - QUOTEDUNISTRING = 346, - QUOTEDSTRING = 347, - STRING = 348, - NUMBER = 349, - SIZEDUNISTRING = 350, - SIZEDSTRING = 351, - IGNORED_TOKEN = 352, - NEG = 353 - }; -#endif -/* Tokens. */ -#define BEG 258 -#define END 259 -#define ACCELERATORS 260 -#define VIRTKEY 261 -#define ASCII 262 -#define NOINVERT 263 -#define SHIFT 264 -#define CONTROL 265 -#define ALT 266 -#define BITMAP 267 -#define CURSOR 268 -#define DIALOG 269 -#define DIALOGEX 270 -#define EXSTYLE 271 -#define CAPTION 272 -#define CLASS 273 -#define STYLE 274 -#define AUTO3STATE 275 -#define AUTOCHECKBOX 276 -#define AUTORADIOBUTTON 277 -#define CHECKBOX 278 -#define COMBOBOX 279 -#define CTEXT 280 -#define DEFPUSHBUTTON 281 -#define EDITTEXT 282 -#define GROUPBOX 283 -#define LISTBOX 284 -#define LTEXT 285 -#define PUSHBOX 286 -#define PUSHBUTTON 287 -#define RADIOBUTTON 288 -#define RTEXT 289 -#define SCROLLBAR 290 -#define STATE3 291 -#define USERBUTTON 292 -#define BEDIT 293 -#define HEDIT 294 -#define IEDIT 295 -#define FONT 296 -#define ICON 297 -#define ANICURSOR 298 -#define ANIICON 299 -#define DLGINCLUDE 300 -#define DLGINIT 301 -#define FONTDIR 302 -#define HTML 303 -#define MANIFEST 304 -#define PLUGPLAY 305 -#define VXD 306 -#define TOOLBAR 307 -#define BUTTON 308 -#define LANGUAGE 309 -#define CHARACTERISTICS 310 -#define VERSIONK 311 -#define MENU 312 -#define MENUEX 313 -#define MENUITEM 314 -#define SEPARATOR 315 -#define POPUP 316 -#define CHECKED 317 -#define GRAYED 318 -#define HELP 319 -#define INACTIVE 320 -#define MENUBARBREAK 321 -#define MENUBREAK 322 -#define MESSAGETABLE 323 -#define RCDATA 324 -#define STRINGTABLE 325 -#define VERSIONINFO 326 -#define FILEVERSION 327 -#define PRODUCTVERSION 328 -#define FILEFLAGSMASK 329 -#define FILEFLAGS 330 -#define FILEOS 331 -#define FILETYPE 332 -#define FILESUBTYPE 333 -#define BLOCKSTRINGFILEINFO 334 -#define BLOCKVARFILEINFO 335 -#define VALUE 336 -#define BLOCK 337 -#define MOVEABLE 338 -#define FIXED 339 -#define PURE 340 -#define IMPURE 341 -#define PRELOAD 342 -#define LOADONCALL 343 -#define DISCARDABLE 344 -#define NOT 345 -#define QUOTEDUNISTRING 346 -#define QUOTEDSTRING 347 -#define STRING 348 -#define NUMBER 349 -#define SIZEDUNISTRING 350 -#define SIZEDSTRING 351 -#define IGNORED_TOKEN 352 -#define NEG 353 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 69 "rcparse.y" -{ - rc_accelerator acc; - rc_accelerator *pacc; - rc_dialog_control *dialog_control; - rc_menuitem *menuitem; - struct - { - rc_rcdata_item *first; - rc_rcdata_item *last; - } rcdata; - rc_rcdata_item *rcdata_item; - rc_fixed_versioninfo *fixver; - rc_ver_info *verinfo; - rc_ver_stringtable *verstringtable; - rc_ver_stringinfo *verstring; - rc_ver_varinfo *vervar; - rc_toolbar_item *toobar_item; - rc_res_id id; - rc_res_res_info res_info; - struct - { - rc_uint_type on; - rc_uint_type off; - } memflags; - struct - { - rc_uint_type val; - /* Nonzero if this number was explicitly specified as long. */ - int dword; - } i; - rc_uint_type il; - rc_uint_type is; - const char *s; - struct - { - rc_uint_type length; - const char *s; - } ss; - unichar *uni; - struct - { - rc_uint_type length; - const unichar *s; - } suni; -} -/* Line 1529 of yacc.c. */ -#line 291 "rcparse.h" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - diff -Nur binutils-2.24.orig/binutils/readelf.c binutils-2.24/binutils/readelf.c --- binutils-2.24.orig/binutils/readelf.c 2013-11-18 09:40:15.000000000 +0100 +++ binutils-2.24/binutils/readelf.c 2016-06-30 21:26:12.593890778 +0200 @@ -131,6 +131,7 @@ #include "elf/moxie.h" #include "elf/mt.h" #include "elf/msp430.h" +#include "elf/nds32.h" #include "elf/nios2.h" #include "elf/or32.h" #include "elf/pj.h" @@ -626,6 +627,7 @@ case EM_MSP430: case EM_MSP430_OLD: case EM_MT: + case EM_NDS32: case EM_NIOS32: case EM_PPC64: case EM_PPC: @@ -1144,6 +1146,10 @@ rtype = elf_msp430_reloc_type (type); break; + case EM_NDS32: + rtype = elf_nds32_reloc_type (type); + break; + case EM_PPC: rtype = elf_ppc_reloc_type (type); break; @@ -2307,6 +2313,215 @@ strcat (buf,_(", ")); } +static void +decode_NDS32_machine_flags (unsigned e_flags, char buf[], size_t size) +{ + unsigned abi; + unsigned arch; + unsigned config; + unsigned version; + int has_fpu = 0; + int r = 0; + + static const char *ABI_STRINGS[] = { + [E_NDS_ABI_V0 >> EF_NDS_ABI_SHIFT] = "ABI v0", /* use r5 as return register; only used in N1213HC */ + [E_NDS_ABI_V1 >> EF_NDS_ABI_SHIFT] = "ABI v1", /* use r0 as return register */ + [E_NDS_ABI_V2 >> EF_NDS_ABI_SHIFT] = "ABI v2", /* use r0 as return register and don't reserve 24 bytes for arguments */ + [E_NDS_ABI_V2FP >> EF_NDS_ABI_SHIFT] = "ABI v2fp", /* for FPU */ + [E_NDS_ABI_AABI >> EF_NDS_ABI_SHIFT] = "AABI", + [E_NDS_ABI_V2FP_PLUS >> EF_NDS_ABI_SHIFT] = "ABI2 FP+" + }; + static const char *VER_STRINGS[] = { + [E_NDS32_ELF_VER_1_2 >> EF_NDS32_ELF_VERSION_SHIFT] = "Andes ELF V1.3 or older", + [E_NDS32_ELF_VER_1_3 >> EF_NDS32_ELF_VERSION_SHIFT] = "Andes ELF V1.3.1", + [E_NDS32_ELF_VER_1_4 >> EF_NDS32_ELF_VERSION_SHIFT] = "Andes ELF V1.4", + }; + static const char *ARCH_STRINGS[] = { + [E_NDS_ARCH_STAR_V1_0 >> EF_NDS_ARCH_SHIFT] = "Andes Star v1.0", + [E_NDS_ARCH_STAR_V2_0 >> EF_NDS_ARCH_SHIFT] = "Andes Star v2.0", + [E_NDS_ARCH_STAR_V3_0 >> EF_NDS_ARCH_SHIFT] = "Andes Star v3.0", + [E_NDS_ARCH_STAR_V3_M >> EF_NDS_ARCH_SHIFT] = "Andes Star v3.0m" + }; + + abi = EF_NDS_ABI & e_flags; + arch = EF_NDS_ARCH & e_flags; + config = EF_NDS_INST & e_flags; + version = EF_NDS32_ELF_VERSION & e_flags; + + memset (buf, 0, size); + + switch (abi) + { + case E_NDS_ABI_V0: + case E_NDS_ABI_V1: + case E_NDS_ABI_V2: + case E_NDS_ABI_V2FP: + case E_NDS_ABI_AABI: + case E_NDS_ABI_V2FP_PLUS: + /* In case there are holes in the array. */ + r += snprintf (buf + r, size - r, ", %s", ABI_STRINGS[abi >> EF_NDS_ABI_SHIFT]); + break; + + default: + r += snprintf (buf + r, size - r, ", "); + break; + } + + switch (version) + { + case E_NDS32_ELF_VER_1_2: + case E_NDS32_ELF_VER_1_3: + case E_NDS32_ELF_VER_1_4: + r += snprintf (buf + r, size - r, ", %s", VER_STRINGS[version >> EF_NDS32_ELF_VERSION_SHIFT]); + break; + + default: + r += snprintf (buf + r, size - r, ", "); + break; + } + + if (E_NDS_ABI_V0 == abi) + { + /* OLD ABI; only used in N1213HC, has performance extension 1 */ + r += snprintf (buf + r, size - r, ", Andes Star v1.0, N1213HC, MAC, PERF1"); + if (arch == E_NDS_ARCH_STAR_V1_0) + r += snprintf (buf + r, size -r, ", 16b"); /* has 16-bit instructions */ + return; + } + + switch (arch) + { + case E_NDS_ARCH_STAR_V1_0: + case E_NDS_ARCH_STAR_V2_0: + case E_NDS_ARCH_STAR_V3_0: + case E_NDS_ARCH_STAR_V3_M: + r += snprintf (buf + r, size - r, ", %s", ARCH_STRINGS[arch >> EF_NDS_ARCH_SHIFT]); + break; + + default: + r += snprintf (buf + r, size - r, ", "); + /* ARCH version determines how the e_flags are interpreted. + If it is unknown, we cannot proceed. */ + return; + } + + /* newer ABI; Now handle architecture specific flags. */ + if (arch == E_NDS_ARCH_STAR_V1_0) + { + if (config & E_NDS32_HAS_MFUSR_PC_INST) + r += snprintf (buf + r, size -r, ", MFUSR_PC"); + + if (!(config & E_NDS32_HAS_NO_MAC_INST)) + r += snprintf (buf + r, size -r, ", MAC"); + + if (config & E_NDS32_HAS_DIV_INST) + r += snprintf (buf + r, size -r, ", DIV"); + + if (config & E_NDS32_HAS_16BIT_INST) + r += snprintf (buf + r, size -r, ", 16b"); + } + else + { + if (config & E_NDS32_HAS_MFUSR_PC_INST) + { + if (version <= E_NDS32_ELF_VER_1_3) + r += snprintf (buf + r, size -r, ", [B8]"); + else + r += snprintf (buf + r, size -r, ", EX9"); + } + + if (config & E_NDS32_HAS_MAC_DX_INST) + r += snprintf (buf + r, size -r, ", MAC_DX"); + + if (config & E_NDS32_HAS_DIV_DX_INST) + r += snprintf (buf + r, size -r, ", DIV_DX"); + + if (config & E_NDS32_HAS_16BIT_INST) + { + if (version <= E_NDS32_ELF_VER_1_3) + r += snprintf (buf + r, size -r, ", 16b"); + else + r += snprintf (buf + r, size -r, ", IFC"); + } + } + + if (config & E_NDS32_HAS_EXT_INST) + r += snprintf (buf + r, size -r, ", PERF1"); + + if (config & E_NDS32_HAS_EXT2_INST) + r += snprintf (buf + r, size -r, ", PERF2"); + + if (config & E_NDS32_HAS_FPU_INST) + { + has_fpu = 1; + r += snprintf (buf + r, size -r, ", FPU_SP"); + } + + if (config & E_NDS32_HAS_FPU_DP_INST) + { + has_fpu = 1; + r += snprintf (buf + r, size -r, ", FPU_DP"); + } + + if (config & E_NDS32_HAS_FPU_MAC_INST) + { + has_fpu = 1; + r += snprintf (buf + r, size -r, ", FPU_MAC"); + } + + if (config & E_NDS32_HAS_DSP_INST) + { + r += snprintf (buf + r, size -r, ", DSP"); + } + + if (config & E_NDS32_HAS_ZOL) + { + r += snprintf (buf + r, size -r, ", ZOL"); + } + + if (has_fpu) + { + switch ((config & E_NDS32_FPU_REG_CONF) >> E_NDS32_FPU_REG_CONF_SHIFT) + { + case E_NDS32_FPU_REG_8SP_4DP: + r += snprintf (buf + r, size -r, ", FPU_REG:8/4"); + break; + case E_NDS32_FPU_REG_16SP_8DP: + r += snprintf (buf + r, size -r, ", FPU_REG:16/8"); + break; + case E_NDS32_FPU_REG_32SP_16DP: + r += snprintf (buf + r, size -r, ", FPU_REG:32/16"); + break; + case E_NDS32_FPU_REG_32SP_32DP: + r += snprintf (buf + r, size -r, ", FPU_REG:32/32"); + break; + } + } + + if (config & E_NDS32_HAS_AUDIO_INST) + r += snprintf (buf + r, size -r, ", AUDIO"); + + if (config & E_NDS32_HAS_STRING_INST) + r += snprintf (buf + r, size -r, ", STR"); + + if (config & E_NDS32_HAS_REDUCED_REGS) + r += snprintf (buf + r, size -r, ", 16REG"); + + if (config & E_NDS32_HAS_VIDEO_INST) + { + if (version <= E_NDS32_ELF_VER_1_3) + r += snprintf (buf + r, size -r, ", VIDEO"); + else + r += snprintf (buf + r, size -r, ", SATURATION"); + } + + if (config & E_NDS32_HAS_ENCRIPT_INST) + r += snprintf (buf + r, size -r, ", ENCRP"); + + if (config & E_NDS32_HAS_L2C_INST) + r += snprintf (buf + r, size -r, ", L2C"); +} + static char * get_machine_flags (unsigned e_flags, unsigned e_machine) { @@ -2649,6 +2864,10 @@ } break; + case EM_NDS32: + decode_NDS32_machine_flags (e_flags, buf, sizeof buf); + break; + case EM_SH: switch ((e_flags & EF_SH_MACH_MASK)) { @@ -4171,7 +4390,7 @@ else { char fmt [32]; - int ret = snprintf (fmt, sizeof (fmt), "%%%ds", PATH_MAX); + int ret = snprintf (fmt, sizeof (fmt), "%%%ds", PATH_MAX - 1); if (ret >= (int) sizeof (fmt) || ret < 0) error (_("Internal error: failed to create format string to display program interpreter\n")); @@ -10257,6 +10476,8 @@ return reloc_type == 1; /* R_MSP430_32 or R_MSP320_ABS32. */ case EM_MT: return reloc_type == 2; /* R_MT_32. */ + case EM_NDS32: + return reloc_type == 20; /* R_NDS32_RELA. */ case EM_ALTERA_NIOS2: return reloc_type == 12; /* R_NIOS2_BFD_RELOC_32. */ case EM_NIOS32: @@ -10510,6 +10731,8 @@ return reloc_type == 2; /* R_MSP430_ABS16. */ case EM_MSP430_OLD: return reloc_type == 5; /* R_MSP430_16_BYTE. */ + case EM_NDS32: + return reloc_type == 19; /* R_NDS32_RELA. */ case EM_ALTERA_NIOS2: return reloc_type == 13; /* R_NIOS2_BFD_RELOC_16. */ case EM_NIOS32: @@ -10573,6 +10796,12 @@ return reloc_type == 0; case EM_AARCH64: return reloc_type == 0 || reloc_type == 256; + case EM_NDS32: + return (reloc_type == 0 /* R_XTENSA_NONE. */ + || reloc_type == 204 /* R_NDS32_DIFF8. */ + || reloc_type == 205 /* R_NDS32_DIFF16. */ + || reloc_type == 206 /* R_NDS32_DIFF32. */ + || reloc_type == 207 /* R_NDS32_ULEB128. */); case EM_XTENSA_OLD: case EM_XTENSA: return (reloc_type == 0 /* R_XTENSA_NONE. */ @@ -12954,6 +13183,39 @@ } static int +process_nds32_specific (FILE * file) +{ + Elf_Internal_Shdr *sect = NULL; + + sect = find_section (".nds32_e_flags"); + if (sect != NULL) + { + unsigned int *flag; + printf ("\nNDS32 elf flags section:\n"); + flag = get_data (NULL, file, sect->sh_offset, 1, + sect->sh_size, _("NDS32 elf flags section")); + + switch ((*flag) & 0x3) + { + case 0: + printf ("(VEC_SIZE):\tNo entry.\n"); + break; + case 1: + printf ("(VEC_SIZE):\t4 bytes\n"); + break; + case 2: + printf ("(VEC_SIZE):\t16 bytes\n"); + break; + case 3: + printf ("(VEC_SIZE):\treserved\n"); + break; + } + } + + return TRUE; +} + +static int process_gnu_liblist (FILE * file) { Elf_Internal_Shdr * section; @@ -13779,6 +14041,9 @@ case EM_MIPS_RS3_LE: return process_mips_specific (file); break; + case EM_NDS32: + return process_nds32_specific (file); + break; case EM_PPC: return process_power_specific (file); break; diff -Nur binutils-2.24.orig/binutils/size.c binutils-2.24/binutils/size.c --- binutils-2.24.orig/binutils/size.c 2013-11-04 16:33:37.000000000 +0100 +++ binutils-2.24/binutils/size.c 2016-06-30 21:26:12.593890778 +0200 @@ -436,6 +436,7 @@ static bfd_size_type bsssize; static bfd_size_type datasize; static bfd_size_type textsize; +static bfd_size_type rodata_size; static void berkeley_sum (bfd *abfd ATTRIBUTE_UNUSED, sec_ptr sec, @@ -449,6 +450,10 @@ return; size = bfd_get_section_size (sec); + + if ((flags & SEC_DATA) != 0 && (flags & SEC_READONLY) != 0 && (flags & SEC_CODE) == 0) + rodata_size = rodata_size + size; + if ((flags & SEC_CODE) != 0 || (flags & SEC_READONLY) != 0) textsize += size; else if ((flags & SEC_HAS_CONTENTS) != 0) @@ -466,13 +471,15 @@ bsssize = 0; datasize = 0; textsize = 0; + rodata_size = 0; bfd_map_over_sections (abfd, berkeley_sum, NULL); bsssize += common_size; if (files_seen++ == 0) - puts ((radix == octal) ? " text\t data\t bss\t oct\t hex\tfilename" : - " text\t data\t bss\t dec\t hex\tfilename"); + puts ((radix == octal) ? + " text (code + rodata)\t data\t bss\t oct\t hex\tfilename" : + " text (code + rodata)\t data\t bss\t dec\t hex\tfilename"); total = textsize + datasize + bsssize; @@ -484,6 +491,11 @@ } rprint_number (7, textsize); + printf (" ("); + rprint_number (4, (textsize - rodata_size)); + printf (" + "); + rprint_number (6, rodata_size); + printf (")"); putchar ('\t'); rprint_number (7, datasize); putchar ('\t'); diff -Nur binutils-2.24.orig/binutils/sysinfo.c binutils-2.24/binutils/sysinfo.c --- binutils-2.24.orig/binutils/sysinfo.c 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/sysinfo.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1962 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - COND = 258, - REPEAT = 259, - TYPE = 260, - NAME = 261, - NUMBER = 262, - UNIT = 263 - }; -#endif -/* Tokens. */ -#define COND 258 -#define REPEAT 259 -#define TYPE 260 -#define NAME 261 -#define NUMBER 262 -#define UNIT 263 - - - - -/* Copy the first part of user declarations. */ -#line 21 "sysinfo.y" - -#include -#include - -static char writecode; -static char *it; -static int code; -static char * repeat; -static char *oldrepeat; -static char *name; -static int rdepth; -static char *names[] = {" ","[n]","[n][m]"}; -static char *pnames[]= {"","*","**"}; - -static int yyerror (char *s); -extern int yylex (void); - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 40 "sysinfo.y" -{ - int i; - char *s; -} -/* Line 193 of yacc.c. */ -#line 135 "sysinfo.c" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 216 of yacc.c. */ -#line 148 "sysinfo.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 38 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 11 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 19 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 27 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 55 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 263 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 5, 6, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 7, 8, 9, 10 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 11, 12, 19, 22, - 25, 28, 29, 30, 37, 38, 45, 46, 57, 59, - 60, 64, 67, 71, 72, 73, 77, 78 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 12, 0, -1, -1, 13, 14, -1, 15, 14, -1, - -1, -1, 5, 8, 9, 16, 17, 6, -1, 22, - 17, -1, 20, 17, -1, 18, 17, -1, -1, -1, - 5, 4, 8, 19, 17, 6, -1, -1, 5, 3, - 8, 21, 17, 6, -1, -1, 5, 25, 5, 24, - 26, 6, 27, 23, 28, 6, -1, 7, -1, -1, - 5, 8, 6, -1, 9, 10, -1, 5, 8, 6, - -1, -1, -1, 5, 29, 6, -1, -1, 29, 5, - 8, 8, 6, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 54, 54, 54, 92, 93, 98, 97, 169, 170, - 171, 172, 176, 175, 223, 222, 250, 249, 357, 358, - 362, 367, 373, 374, 377, 378, 380, 382 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "COND", "REPEAT", "'('", "')'", "TYPE", - "NAME", "NUMBER", "UNIT", "$accept", "top", "@1", "it_list", "it", "@2", - "it_field_list", "repeat_it_field", "@3", "cond_it_field", "@4", - "it_field", "@5", "attr_type", "attr_desc", "attr_size", "attr_id", - "enums", "enum_list", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 40, 41, 260, 261, 262, - 263 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 11, 13, 12, 14, 14, 16, 15, 17, 17, - 17, 17, 19, 18, 21, 20, 23, 22, 24, 24, - 25, 26, 27, 27, 28, 28, 29, 29 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 2, 0, 0, 6, 2, 2, - 2, 0, 0, 6, 0, 6, 0, 10, 1, 0, - 3, 2, 3, 0, 0, 3, 0, 5 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 0, 5, 1, 0, 3, 5, 0, 4, 6, - 11, 0, 0, 11, 11, 11, 0, 0, 0, 0, - 7, 10, 9, 8, 14, 12, 0, 19, 11, 11, - 20, 18, 0, 0, 0, 0, 0, 15, 13, 21, - 23, 0, 16, 0, 24, 22, 26, 0, 0, 17, - 0, 25, 0, 0, 27 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 1, 2, 5, 6, 10, 12, 13, 29, 14, - 28, 15, 44, 32, 19, 36, 42, 47, 48 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -14 -static const yytype_int8 yypact[] = -{ - -14, 8, 4, -14, 2, -14, 4, 3, -14, -14, - 6, 0, 7, 6, 6, 6, 9, 10, 11, 15, - -14, -14, -14, -14, -14, -14, 16, 14, 6, 6, - -14, -14, 5, 17, 18, 19, 20, -14, -14, -14, - 22, 23, -14, 24, 27, -14, -14, 28, 1, -14, - 25, -14, 29, 30, -14 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -14, -14, -14, 32, -14, -14, -13, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const yytype_uint8 yytable[] = -{ - 21, 22, 23, 16, 17, 18, 50, 51, 3, 4, - 7, 11, 9, 20, 35, 33, 34, 24, 25, 26, - 27, 31, 30, 37, 38, 0, 40, 41, 0, 39, - 45, 43, 46, 52, 49, 0, 54, 53, 8 -}; - -static const yytype_int8 yycheck[] = -{ - 13, 14, 15, 3, 4, 5, 5, 6, 0, 5, - 8, 5, 9, 6, 9, 28, 29, 8, 8, 8, - 5, 7, 6, 6, 6, -1, 6, 5, -1, 10, - 6, 8, 5, 8, 6, -1, 6, 8, 6 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 12, 13, 0, 5, 14, 15, 8, 14, 9, - 16, 5, 17, 18, 20, 22, 3, 4, 5, 25, - 6, 17, 17, 17, 8, 8, 8, 5, 21, 19, - 6, 7, 24, 17, 17, 9, 26, 6, 6, 10, - 6, 5, 27, 8, 23, 6, 5, 28, 29, 6, - 5, 6, 8, 8, 6 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 54 "sysinfo.y" - { - switch (writecode) - { - case 'i': - printf("#ifdef SYSROFF_SWAP_IN\n"); - break; - case 'p': - printf("#ifdef SYSROFF_p\n"); - break; - case 'd': - break; - case 'g': - printf("#ifdef SYSROFF_SWAP_OUT\n"); - break; - case 'c': - printf("#ifdef SYSROFF_PRINT\n"); - printf("#include \n"); - printf("#include \n"); - printf("#include \n"); - break; - } - } - break; - - case 3: -#line 76 "sysinfo.y" - { - switch (writecode) { - case 'i': - case 'p': - case 'g': - case 'c': - printf("#endif\n"); - break; - case 'd': - break; - } -} - break; - - case 6: -#line 98 "sysinfo.y" - { - it = (yyvsp[(2) - (3)].s); code = (yyvsp[(3) - (3)].i); - switch (writecode) - { - case 'd': - printf("\n\n\n#define IT_%s_CODE 0x%x\n", it,code); - printf("struct IT_%s;\n", it); - printf("extern void sysroff_swap_%s_in (struct IT_%s *);\n", - (yyvsp[(2) - (3)].s), it); - printf("extern void sysroff_swap_%s_out (FILE *, struct IT_%s *);\n", - (yyvsp[(2) - (3)].s), it); - printf("extern void sysroff_print_%s_out (struct IT_%s *);\n", - (yyvsp[(2) - (3)].s), it); - printf("struct IT_%s { \n", it); - break; - case 'i': - printf("void sysroff_swap_%s_in (struct IT_%s * ptr)\n",(yyvsp[(2) - (3)].s),it); - printf("{\n"); - printf("\tunsigned char raw[255];\n"); - printf("\tint idx = 0;\n"); - printf("\tint size;\n"); - printf("\tmemset(raw,0,255);\n"); - printf("\tmemset(ptr,0,sizeof(*ptr));\n"); - printf("\tsize = fillup(raw);\n"); - break; - case 'g': - printf("void sysroff_swap_%s_out (FILE * ffile, struct IT_%s * ptr)\n",(yyvsp[(2) - (3)].s),it); - printf("{\n"); - printf("\tunsigned char raw[255];\n"); - printf("\tint idx = 16;\n"); - printf("\tmemset (raw, 0, 255);\n"); - printf("\tcode = IT_%s_CODE;\n", it); - break; - case 'o': - printf("void sysroff_swap_%s_out (bfd * abfd, struct IT_%s * ptr)\n",(yyvsp[(2) - (3)].s), it); - printf("{\n"); - printf("\tint idx = 0;\n"); - break; - case 'c': - printf("void sysroff_print_%s_out (struct IT_%s *ptr)\n",(yyvsp[(2) - (3)].s),it); - printf("{\n"); - printf("itheader(\"%s\", IT_%s_CODE);\n",(yyvsp[(2) - (3)].s),(yyvsp[(2) - (3)].s)); - break; - - case 't': - break; - } - - } - break; - - case 7: -#line 149 "sysinfo.y" - { - switch (writecode) { - case 'd': - printf("};\n"); - break; - case 'g': - printf("\tchecksum(ffile,raw, idx, IT_%s_CODE);\n", it); - - case 'i': - - case 'o': - case 'c': - printf("}\n"); - } -} - break; - - case 12: -#line 176 "sysinfo.y" - { - rdepth++; - switch (writecode) - { - case 'c': - if (rdepth==1) - printf("\tprintf(\"repeat %%d\\n\", %s);\n",(yyvsp[(3) - (3)].s)); - if (rdepth==2) - printf("\tprintf(\"repeat %%d\\n\", %s[n]);\n",(yyvsp[(3) - (3)].s)); - case 'i': - case 'g': - case 'o': - - if (rdepth==1) - { - printf("\t{ int n; for (n = 0; n < %s; n++) {\n", (yyvsp[(3) - (3)].s)); - } - if (rdepth == 2) { - printf("\t{ int m; for (m = 0; m < %s[n]; m++) {\n", (yyvsp[(3) - (3)].s)); - } - - break; - } - - oldrepeat = repeat; - repeat = (yyvsp[(3) - (3)].s); - } - break; - - case 13: -#line 206 "sysinfo.y" - { - repeat = oldrepeat; - oldrepeat =0; - rdepth--; - switch (writecode) - { - case 'i': - case 'g': - case 'o': - case 'c': - printf("\t}}\n"); - } - } - break; - - case 14: -#line 223 "sysinfo.y" - { - switch (writecode) - { - case 'i': - case 'g': - case 'o': - case 'c': - printf("\tif (%s) {\n", (yyvsp[(3) - (3)].s)); - break; - } - } - break; - - case 15: -#line 236 "sysinfo.y" - { - switch (writecode) - { - case 'i': - case 'g': - case 'o': - case 'c': - printf("\t}\n"); - } - } - break; - - case 16: -#line 250 "sysinfo.y" - {name = (yyvsp[(7) - (7)].s); } - break; - - case 17: -#line 252 "sysinfo.y" - { - char *desc = (yyvsp[(2) - (10)].s); - char *type = (yyvsp[(4) - (10)].s); - int size = (yyvsp[(5) - (10)].i); - char *id = (yyvsp[(7) - (10)].s); -char *p = names[rdepth]; -char *ptr = pnames[rdepth]; - switch (writecode) - { - case 'g': - if (size % 8) - { - - printf("\twriteBITS(ptr->%s%s,raw,&idx,%d);\n", - id, - names[rdepth], size); - - } - else { - printf("\twrite%s(ptr->%s%s,raw,&idx,%d,ffile);\n", - type, - id, - names[rdepth],size/8); - } - break; - case 'i': - { - - if (rdepth >= 1) - - { - printf("if (!ptr->%s) ptr->%s = (%s*)xcalloc(%s, sizeof(ptr->%s[0]));\n", - id, - id, - type, - repeat, - id); - } - - if (rdepth == 2) - { - printf("if (!ptr->%s[n]) ptr->%s[n] = (%s**)xcalloc(%s[n], sizeof(ptr->%s[n][0]));\n", - id, - id, - type, - repeat, - id); - } - - } - - if (size % 8) - { - printf("\tptr->%s%s = getBITS(raw,&idx, %d,size);\n", - id, - names[rdepth], - size); - } - else { - printf("\tptr->%s%s = get%s(raw,&idx, %d,size);\n", - id, - names[rdepth], - type, - size/8); - } - break; - case 'o': - printf("\tput%s(raw,%d,%d,&idx,ptr->%s%s);\n", type,size/8,size%8,id,names[rdepth]); - break; - case 'd': - if (repeat) - printf("\t/* repeat %s */\n", repeat); - - if (type[0] == 'I') { - printf("\tint %s%s; \t/* %s */\n",ptr,id, desc); - } - else if (type[0] =='C') { - printf("\tchar %s*%s;\t /* %s */\n",ptr,id, desc); - } - else { - printf("\tbarray %s%s;\t /* %s */\n",ptr,id, desc); - } - break; - case 'c': - printf("tabout();\n"); - printf("\tprintf(\"/*%-30s*/ ptr->%s = \");\n", desc, id); - - if (type[0] == 'I') - printf("\tprintf(\"%%d\\n\",ptr->%s%s);\n", id,p); - else if (type[0] == 'C') - printf("\tprintf(\"%%s\\n\",ptr->%s%s);\n", id,p); - - else if (type[0] == 'B') - { - printf("\tpbarray(&ptr->%s%s);\n", id,p); - } - else abort(); - break; - } - } - break; - - case 18: -#line 357 "sysinfo.y" - { (yyval.s) = (yyvsp[(1) - (1)].s); } - break; - - case 19: -#line 358 "sysinfo.y" - { (yyval.s) = "INT";} - break; - - case 20: -#line 363 "sysinfo.y" - { (yyval.s) = (yyvsp[(2) - (3)].s); } - break; - - case 21: -#line 368 "sysinfo.y" - { (yyval.i) = (yyvsp[(1) - (2)].i) * (yyvsp[(2) - (2)].i); } - break; - - case 22: -#line 373 "sysinfo.y" - { (yyval.s) = (yyvsp[(2) - (3)].s); } - break; - - case 23: -#line 374 "sysinfo.y" - { (yyval.s) = "dummy";} - break; - - case 27: -#line 382 "sysinfo.y" - { - switch (writecode) - { - case 'd': - printf("#define %s %s\n", (yyvsp[(3) - (5)].s),(yyvsp[(4) - (5)].s)); - break; - case 'c': - printf("if (ptr->%s%s == %s) { tabout(); printf(\"%s\\n\");}\n", name, names[rdepth],(yyvsp[(4) - (5)].s),(yyvsp[(3) - (5)].s)); - } - } - break; - - -/* Line 1267 of yacc.c. */ -#line 1715 "sysinfo.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -#line 397 "sysinfo.y" - -/* four modes - - -d write structure definitions for sysroff in host format - -i write functions to swap into sysroff format in - -o write functions to swap into sysroff format out - -c write code to print info in human form */ - -int yydebug; - -int -main (int ac, char **av) -{ - yydebug=0; - if (ac > 1) - writecode = av[1][1]; -if (writecode == 'd') - { - printf("typedef struct { unsigned char *data; int len; } barray; \n"); - printf("typedef int INT;\n"); - printf("typedef char * CHARS;\n"); - - } - yyparse(); -return 0; -} - -static int -yyerror (char *s) -{ - fprintf(stderr, "%s\n" , s); - return 0; -} - diff -Nur binutils-2.24.orig/binutils/sysinfo.h binutils-2.24/binutils/sysinfo.h --- binutils-2.24.orig/binutils/sysinfo.h 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/sysinfo.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,77 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - COND = 258, - REPEAT = 259, - TYPE = 260, - NAME = 261, - NUMBER = 262, - UNIT = 263 - }; -#endif -/* Tokens. */ -#define COND 258 -#define REPEAT 259 -#define TYPE 260 -#define NAME 261 -#define NUMBER 262 -#define UNIT 263 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 40 "sysinfo.y" -{ - int i; - char *s; -} -/* Line 1529 of yacc.c. */ -#line 70 "sysinfo.h" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - diff -Nur binutils-2.24.orig/binutils/syslex.c binutils-2.24/binutils/syslex.c --- binutils-2.24.orig/binutils/syslex.c 2013-11-18 09:49:30.000000000 +0100 +++ binutils-2.24/binutils/syslex.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1906 +0,0 @@ - -#line 3 "syslex.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern yy_size_t yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); - -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; - -typedef int yy_state_type; - -extern int yylineno; - -int yylineno = 1; - -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (yy_size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 25 -#define YY_END_OF_BUFFER 26 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[81] = - { 0, - 0, 0, 26, 25, 7, 8, 5, 25, 1, 2, - 11, 11, 6, 3, 4, 25, 25, 25, 25, 25, - 25, 25, 0, 9, 11, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, - 13, 0, 0, 0, 0, 16, 0, 0, 0, 0, - 0, 12, 15, 0, 23, 0, 0, 0, 0, 0, - 0, 14, 18, 0, 0, 0, 0, 0, 17, 0, - 24, 0, 0, 0, 20, 22, 0, 21, 19, 0 - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 1, 5, 1, 1, 1, 1, 1, 6, - 7, 1, 1, 1, 1, 1, 1, 8, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 1, 10, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 11, 1, 12, 1, 1, 1, 13, 14, 15, 16, - - 17, 18, 19, 20, 21, 1, 1, 22, 1, 23, - 24, 25, 1, 26, 27, 28, 29, 30, 1, 31, - 32, 33, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int32_t yy_meta[34] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 3, 3, 1, - 1, 1, 3, 3, 3, 3, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1 - } ; - -static yyconst flex_int16_t yy_base[84] = - { 0, - 0, 0, 100, 101, 101, 101, 101, 94, 101, 101, - 26, 28, 0, 101, 101, 82, 26, 18, 74, 79, - 78, 81, 88, 101, 32, 0, 0, 76, 65, 62, - 61, 75, 20, 59, 61, 66, 58, 0, 57, 56, - 54, 63, 53, 62, 54, 101, 59, 48, 53, 46, - 59, 101, 44, 43, 101, 41, 55, 46, 53, 44, - 31, 101, 101, 39, 27, 21, 39, 19, 101, 35, - 101, 33, 26, 29, 101, 101, 28, 101, 101, 101, - 58, 61, 41 - } ; - -static yyconst flex_int16_t yy_def[84] = - { 0, - 80, 1, 80, 80, 80, 80, 80, 81, 80, 80, - 80, 80, 82, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 81, 80, 80, 83, 82, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 83, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, - 80, 80, 80 - } ; - -static yyconst flex_int16_t yy_nxt[135] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 4, 4, 4, 4, 4, - 19, 4, 4, 4, 4, 20, 21, 4, 4, 22, - 4, 4, 4, 25, 25, 25, 25, 32, 29, 25, - 25, 33, 44, 38, 79, 78, 30, 77, 45, 76, - 75, 74, 73, 72, 71, 70, 26, 31, 23, 23, - 23, 27, 69, 27, 68, 67, 66, 65, 64, 63, - 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, - 52, 51, 50, 49, 48, 47, 46, 43, 42, 41, - 40, 39, 24, 37, 36, 35, 34, 28, 24, 80, - - 3, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80 - } ; - -static yyconst flex_int16_t yy_chk[135] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 11, 11, 12, 12, 18, 17, 25, - 25, 18, 33, 83, 77, 74, 17, 73, 33, 72, - 70, 68, 67, 66, 65, 64, 11, 17, 81, 81, - 81, 82, 61, 82, 60, 59, 58, 57, 56, 54, - 53, 51, 50, 49, 48, 47, 45, 44, 43, 42, - 41, 40, 39, 37, 36, 35, 34, 32, 31, 30, - 29, 28, 23, 22, 21, 20, 19, 16, 8, 3, - - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "syslex.l" -#define YY_NO_INPUT 1 -#line 4 "syslex.l" -/* Copyright 2001, 2003, 2005, 2007, 2011, 2012 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 3, 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 GLD; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Note: config.h is #included via syslex_wrap.c. */ - -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif - -#include "sysinfo.h" - -#ifndef YY_NO_UNPUT -#define YY_NO_UNPUT -#endif - -#ifndef yywrap -static int yywrap (void) { return 1; } -#endif - -extern int yylex (void); -#line 544 "syslex.c" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy (void ); - -int yyget_debug (void ); - -void yyset_debug (int debug_flag ); - -YY_EXTRA_TYPE yyget_extra (void ); - -void yyset_extra (YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in (void ); - -void yyset_in (FILE * in_str ); - -FILE *yyget_out (void ); - -void yyset_out (FILE * out_str ); - -yy_size_t yyget_leng (void ); - -char *yyget_text (void ); - -int yyget_lineno (void ); - -void yyset_lineno (int line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap (void ); -#else -extern int yywrap (void ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - yy_size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 45 "syslex.l" - -#line 726 "syslex.c" - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 101 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 46 "syslex.l" -{ return '(';} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 47 "syslex.l" -{ return ')';} - YY_BREAK -case 3: -YY_RULE_SETUP -#line 48 "syslex.l" -{ return '[';} - YY_BREAK -case 4: -YY_RULE_SETUP -#line 49 "syslex.l" -{ return ']';} - YY_BREAK -case 5: -YY_RULE_SETUP -#line 50 "syslex.l" -{ ; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 51 "syslex.l" -{ ; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 52 "syslex.l" -{ ; } - YY_BREAK -case 8: -/* rule 8 can match eol */ -YY_RULE_SETUP -#line 53 "syslex.l" -{ ; } - YY_BREAK -case 9: -/* rule 9 can match eol */ -YY_RULE_SETUP -#line 54 "syslex.l" -{ - yylval.s = malloc (yyleng - 1); - memcpy (yylval.s, yytext + 1, yyleng - 2); - yylval.s[yyleng - 2] = '\0'; - return NAME; - } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 61 "syslex.l" -{ - yylval.i = strtol(yytext,0,16); - return NUMBER; - } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 66 "syslex.l" -{ - yylval.i = atoi(yytext); - return NUMBER; - } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 72 "syslex.l" -{ yylval.i =1 ;return UNIT;} - YY_BREAK -case 13: -YY_RULE_SETUP -#line 73 "syslex.l" -{ yylval.i = 1; return UNIT;} - YY_BREAK -case 14: -YY_RULE_SETUP -#line 74 "syslex.l" -{ yylval.i= 8; return UNIT;} - YY_BREAK -case 15: -YY_RULE_SETUP -#line 75 "syslex.l" -{ yylval.i = 8; return UNIT;} - YY_BREAK -case 16: -YY_RULE_SETUP -#line 77 "syslex.l" -{ yylval.s = "INT"; return TYPE;} - YY_BREAK -case 17: -YY_RULE_SETUP -#line 78 "syslex.l" -{ yylval.s = "BARRAY"; return TYPE;} - YY_BREAK -case 18: -YY_RULE_SETUP -#line 79 "syslex.l" -{ yylval.s = "CHARS"; return TYPE;} - YY_BREAK -case 19: -YY_RULE_SETUP -#line 80 "syslex.l" -{ yylval.i = 0; return NUMBER;} - YY_BREAK -case 20: -YY_RULE_SETUP -#line 81 "syslex.l" -{ yylval.i = -4; return NUMBER;} - YY_BREAK -case 21: -YY_RULE_SETUP -#line 82 "syslex.l" -{ yylval.i = -2; return NUMBER; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 83 "syslex.l" -{ yylval.i = -1; return NUMBER; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 84 "syslex.l" -{ return COND;} - YY_BREAK -case 24: -YY_RULE_SETUP -#line 85 "syslex.l" -{ return REPEAT;} - YY_BREAK -case 25: -YY_RULE_SETUP -#line 86 "syslex.l" -ECHO; - YY_BREAK -#line 947 "syslex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 80); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer(b,file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); - - yyfree((void *) b ); -} - -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer(b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) -{ - - return yy_scan_bytes(yystr,strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n, i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -yy_size_t yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param line_number - * - */ -void yyset_lineno (int line_number ) -{ - - yylineno = line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * in_str ) -{ - yyin = in_str ; -} - -void yyset_out (FILE * out_str ) -{ - yyout = out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int bdebug ) -{ - yy_flex_debug = bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return (void *) malloc( size ); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 86 "syslex.l" diff -Nur binutils-2.24.orig/cgen/aclocal.m4 binutils-2.24/cgen/aclocal.m4 --- binutils-2.24.orig/cgen/aclocal.m4 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/aclocal.m4 2016-06-30 21:26:12.597890934 +0200 @@ -0,0 +1,137 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff -Nur binutils-2.24.orig/cgen/attr.scm binutils-2.24/cgen/attr.scm --- binutils-2.24.orig/cgen/attr.scm 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/attr.scm 2016-06-30 21:26:12.597890934 +0200 @@ -0,0 +1,1230 @@ +; Attributes. +; Copyright (C) 2000, 2003, 2005, 2009 Red Hat, Inc. +; This file is part of CGEN. +; See file COPYING.CGEN for details. + +; There are 5 kinds of attributes: boolean, integer, enum, bitset, and string. +; Boolean attributes are really enum attributes with two possible values, +; but they occur frequently enough that they are special cased. +; String attributes are intentionally not documented in the manual as +; being supported - they're still a bit of work-in-progress. +; +; All objects that use attributes must have two methods: +; - 'get-atlist - returns the object's attr-list +; - 'set-atlist! - set the object's attr-list +; +; In .cpu files, attribute lists are associative lists of (NAME VALUE). +; Boolean attributes are specified as (NAME #t) or (NAME #f), +; but for convenience ATTR and !ATTR are also supported. +; integer/enum attrs are specified as (ATTR value). +; string attrs are specified as (ATTR "value"). +; Bitset attrs are specified as (ATTR val1 val2 val3), each value must be +; a valid Scheme symbol (stick with valid C symbols + "-" and you'll be fine). +; For backwards compatibility (ATTR val1,val2,val3) and +; (ATTR "val1,val2,val3") are also supported for bitset values. +; val1,val2,val3 is not portable (e.g. mzscheme will reject it). +; In all cases the value needn't be constant, and can be an expression, +; though expressions are currently only supported for META-attributes +; (attributes that don't appear in any generated code). +; +; Example: +; (FOO1 !FOO2 (BAR 3) (FOO3 X) (MACH sparc sparclite)) +; +; ??? Implementation of expressions is being postponed as long +; as possible, avoiding adding complications for complication's sake, and +; because I'm not completely sure how I want to do them. +; The syntax for an expression value is (ATTR (rtx-func ...)). +; +; ??? May wish to allow a bitset attribute like (ATTR val1 !val2), where `!' +; means to turn off that particular bit (or bits if val2 refers to several). +; +; ??? May wish to allow specifying enum attributes by only having to +; specify the value (move names into "enum space" or some such). + +; An attr-list (or "atlist") is a collection of attributes. +; Attributes are stored as an associative list. +; There is possible confusion between "alist" (associative-list) and +; "atlist" (attribute-list) but in practice I haven't had a problem. +; ??? May wish to change this to a list of objects, as the alist doesn't carry +; enough info. However the alist is simple and fast. + +(define (class-make ' nil '(prefix attrs) nil)) + +(define atlist-prefix (elm-make-getter 'prefix)) +(define atlist-attrs (elm-make-getter 'attrs)) + +(define (atlist? x) (class-instance? x)) + +; An empty attribute-list. + +(define atlist-empty (make "" nil)) + +; The attribute baseclass. +; The attributes of are the set of attributes for this attribute +; [meaning attributes themselves can have attributes]. +; [Ya, that's clumsily written. I left it that way for fun.] +; An odd notion that is of some use. It's current raison d'etre is to +; support sanitization of attributes [which is implemented with the +; `sanitize' attribute]. + +(define + (class-make ' + '() + '( + ; List of object types this attribute is for. + ; Possible element values are: + ; attr, enum, cpu, mach, model, ifield, hardware, operand, + ; insn + ; A value of #f means the attribute is for everything. + for + ) + nil) +) + +; Accessors. + +(define atlist-for (elm-make-getter 'for)) + +; A class for each type of attribute. + +; `values' exists for boolean-attribute to simplify the code, it's ignored. +; Ditto for `default'. The default for boolean-attribute is always #f. + +(define + (class-make ' + '() + '(default values) + nil) +) + +; VALUES is ignored for string-attribute. + +(define + (class-make ' + '() + '(default values) + nil) +) + +; For bitset attributes VALUES is a list of +; (symbol bit-number-or-#f attr-list comment-or-#f), +; one for each bit. +; If bit-number is #f (unspecified), cgen will choose. +; Int's are used to record the bitset in the generated code so there's a limit +; of 32 elements, though there's nothing inherent in the description language +; that precludes removing the limit. +; NOTE: While one might want to record each element as an object, there's +; currently no need for the added complexity. + +(define + (class-make ' + '() + '(default values) + nil) +) + +; For integer attributes VALUES is a list of (int), +; one for each possible value, +; or the empty list of all values are permissible. +; Note that each element is itself a list. This is for consistency. + +(define + (class-make ' + '() + '(default values) + nil) +) + +; For enum attributes VALUES is a list of +; (symbol enum-value-or-#f attr-list comment-or-#f), +; one for each possible. +; If enum-value is #f (unspecified) cgen will apply the standard rule for +; assigning enum values. +; NOTE: While one might want to record each element as an object, there's +; currently no need for the added complexity. + +(define + (class-make ' + '() + '(default values) + nil) +) + +; Return a boolean indicating if X is a object. + +(define (bool-attr? x) (class-instance? x)) + +; Return a symbol indicating the kind of attribute ATTR is. +; The result is one of boolean,integer,enum,bitset or string. + +(define (attr-kind attr) + (case (object-class-name attr) + (() 'boolean) + (() 'string) + (() 'integer) + (() 'enum) + (() 'bitset) + (else (error "attr-kind: internal error, not an attribute class" + (object-class-name attr)))) +) + +; Accessors. + +(define (attr-default attr) (elm-xget attr 'default)) +(define (attr-values attr) (elm-xget attr 'values)) + +; Create an attribute. +; Attributes are stored in attribute lists using the actual value +; rather than an object containing the value, so we only have to cons +; NAME and VALUE rather than building some object. This is for simplicity +; and speed. We try to incrementally complicate things, only as necessary. + +; VALUE must be #f or #t. + +(define (bool-attr-make name value) (cons name value)) + +; VALUES must be a list of symbols. +; E.g., (val1 val2) not val1,val2. + +(define (bitset-attr-make name values) (cons name values)) + +; VALUE must be a number (or maybe a symbol). + +(define (int-attr-make name value) (cons name value)) + +; VALUE must be a symbol. + +(define (enum-attr-make name value) (cons name value)) + +;; Return a procedure to parse an attribute. +;; RIGHT-TYPE? is a procedure that verifies the value is the right type. +;; MESSAGE is printed if there is an error. +;; The result of the parsed attribute is (name . value). + +(define (/parse-simple-attribute right-type? message) + (lambda (self context val) + (if (and (not (null? val)) + (right-type? (car val)) + (null? (cdr val))) + (cons (obj:name self) (car val)) + (parse-error context message (cons (obj:name self) val)))) +) + +; A boolean attribute's value is either #t or #f. + +(method-make! + 'parse-value + (/parse-simple-attribute boolean? "boolean attribute not one of #f/#t") +) + +(method-make! + 'parse-value + (/parse-simple-attribute string? "invalid argument to string attribute")) + +; A bitset attribute's value is a list of symbols. +; For backwards compatibility (ATTR val1,val2,val3) and +; (ATTR "val1,val2,val3") are also supported for bitset values. +; val1,val2,val3 is not portable (e.g. mzscheme will reject it). +; +; We don't validate the values. In the case of the MACH attribute, +; there's no current mechanism to create it after all define-mach's have +; been read in. +; ??? Need to decide whether all define-mach's must appear before any +; define-insn's. It would be nice to be able to spread an architecture's +; description over several .cpu files. +; ??? On the other hand, all machs are specified in define-arch. +; Perhaps creation of builtins could be defered until then. + +(method-make! + 'parse-value + (lambda (self context val) + (let ((value (if (and (= (length val) 1) + (or (symbol? (car val)) (string? (car val)))) + (map string->symbol (string-cut (->string (car val)) #\,)) + val)) + (message "improper bitset attribute")) + ;; NOTE: An empty list is ok. + (if (all-true? (map symbol? value)) + (cons (obj:name self) value) + (parse-error context message (cons (obj:name self) val))))) +) + +; An integer attribute's value is a number +; (or maybe a symbol representing that value). + +(method-make! + 'parse-value + (/parse-simple-attribute (lambda (x) (or (number? x) (symbol? x))) + "improper integer attribute") +) + +; An enum attribute's value is a symbol representing that value. + +(method-make! + 'parse-value + (/parse-simple-attribute (lambda (x) (or (symbol? x) (string? x))) + "improper enum attribute") +) + +; Parse a boolean attribute's value definition. + +(method-make! + 'parse-value-def + (lambda (self context values) + (if (equal? values '(#f #t)) + values + (parse-error context "boolean value list must be (#f #t)" values))) +) + +; Ignore values for strings. +; They're not supported and /attr-read catches this. + +(method-make! + 'parse-value-def + (lambda (self context values) #f) +) + +; Parse a bitset attribute's value definition. + +(method-make! + 'parse-value-def + (lambda (self context values) + ;; parse-enum-vals works well enough + (parse-enum-vals context "" values)) +) + +; Parse an integer attribute's value definition. +; VALUES may be #f which means any value is ok. +; A fixed set of VALUES is work-in-progress. + +(method-make! + 'parse-value-def + (lambda (self context values) + (if values + (for-each (lambda (val) + ;; A list entry is for providing a sanitization key. + (if (or (not (list? val)) + (not (number? (car val)))) + (parse-error context + "invalid element in integer attribute list" + val))) + values)) + values) +) + +; Parse an enum attribute's value definition. +; See parse-enum-vals for more info. + +(method-make! + 'parse-value-def + (lambda (self context values) + (parse-enum-vals context "" values)) +) + +; Make an attribute list object from a list of name/value pairs. + +(define (atlist-make prefix . attrs) (make prefix attrs)) + +; Parse an attribute definition. +; This is the main routine for building an attribute object from a +; description in the .cpu file. +; All arguments are in raw (non-evaluated) form. +; TYPE-CLASS is the class of the object to create. +; i.e. one of <{boolean,bitset,integer,enum,string}-attribute>. +; For enum attributes, if DEFAULT is #f use the first value. +; For all other attribute kinds, we use what /attr-read gives us. +; ??? Allowable values for integer attributes is wip, +; for now it is the portable set of integers (int32_t). + +(define (/attr-parse context type-class name comment attrs for default values) + (logit 2 "Processing attribute " name " ...\n") + + ;; Pick out name first to augment the error context. + (let* ((name (parse-name context name)) + (context (context-append-name context name)) + (result (new type-class)) + (parsed-values (send result 'parse-value-def context values))) + + (elm-xset! result 'name name) + (elm-xset! result 'comment (parse-comment context comment)) + (elm-xset! result 'attrs (atlist-parse context attrs "")) + (elm-xset! result 'for for) + + ;; Set the default. + ;; FIXME: Clean up with /attr-read. + (case (class-name type-class) + (() + ;; ??? docs say default must be #f, but we want to allow an rtx to + ;; specify the default. + (if (and (not (memq default '(#f #t))) + (not (/attr-val-is-rtx? default))) + (parse-error context "invalid default" default)) + (elm-xset! result 'default default)) + (() + (let ((default (or default ""))) + (if (and (not (string? default)) + (not (/attr-val-is-rtx? default))) + (parse-error context "invalid default" default)) + (elm-xset! result 'default default))) + (() + (let ((default (if default default (if (null? values) 0 (car values))))) + (if (and (not (integer? default)) + (not (/attr-val-is-rtx? default))) + (parse-error context "invalid default" default)) + (elm-xset! result 'default default))) + (() + (let ((default (if default default (caar parsed-values)))) + (if (and (not (assq default parsed-values)) + (not (/attr-val-is-rtx? default))) + (parse-error context "invalid default" default)) + (elm-xset! result 'default default))) + (() + ;; bitset attributes must specify a default, /attr-read catches this + (assert default) + ;; It's also /attr-read's job to ensure it is a list. + (assert (list? default)) + (let ((default default)) + ;; NOTE: We don't allow an rtx for bitset attributes, + ;; the rtl language currently doesn't support them. + (if (/attr-val-is-rtx? default) + (parse-error context "invalid default, rtx not supported for bitset" default)) + (if (not (all-true? (map (lambda (v) (assq v parsed-values)) + default))) + (parse-error context "invalid default" default)) + (elm-xset! result 'default default)))) + + (elm-xset! result 'values parsed-values) + + result) +) + +; Read an attribute description +; This is the main routine for analyzing attributes in the .cpu file. +; CONTEXT is a object for error messages. +; ARG-LIST is an associative list of field name and field value. +; /attr-parse is invoked to create the attribute object. + +(define (/attr-read context . arg-list) + (let ( + (type 'not-set) ;; attribute type + (type-class 'not-set) ;; attribute class + (name #f) + (comment "") + (attrs nil) + (for #f) ;; assume for everything + (default #f) ;; #f indicates "not set" + (values #f) ;; #f indicates "not set" + ) + + ;; Loop over each element in ARG-LIST, recording what's found. + (let loop ((arg-list arg-list)) + (if (null? arg-list) + nil + (let ((arg (car arg-list)) + (elm-name (caar arg-list))) + (case elm-name + ((type) + (set! type-class (case (cadr arg) + ((boolean) ) + ((string) ) + ((bitset) ) + ((integer) ) + ((enum) ) + (else (parse-error + context + "invalid attribute type" + (cadr arg))))) + (set! type (cadr arg))) + ((name) (set! name (cadr arg))) + ((comment) (set! comment (cadr arg))) + ((attrs) (set! attrs (cdr arg))) + ((for) (set! for (cdr arg))) + ((default) (set! default (cdr arg))) + ((values) (set! values (cdr arg))) + (else (parse-error context "invalid attribute arg" arg))) + (loop (cdr arg-list))))) + + ;; Must have type now. + (if (eq? type-class 'not-set) + (parse-error context "type not specified") arg-list) + + ;; For scalar attributes, fix up the default. + (if (and default (memq type '(boolean string integer enum))) + (begin + (if (!= (length default) 1) + (parse-error context "invalid default" default)) + ;; Don't change rtx values. + (if (not (pair? (car default))) + (set! default (car default))))) + + ;; Establish proper defaults now that we know the type. + ;; FIXME: Clean up with /attr-parse. + (case type + ((boolean) + (if (eq? default #f) + (set! default #f)) ;; really a nop, but for consistency + (if (eq? values #f) + (set! values '(#f #t)))) + ((bitset) ;; FIXME + (if (eq? default #f) + (parse-error context "bitset attribute default not specified" + arg-list)) + (if (eq? values #f) + (parse-error context "bitset attribute values not specified" + arg-list))) + ((integer) ;; FIXME + (if (eq? default #f) + (set! default 0)) + (if (eq? values #f) + (set! values #f))) ;; really a nop, but for consistency + ((enum) ;; FIXME +;; There are some existing cases where no default is specified, +;; expecting that the first value is the default. +;; (if (eq? default #f) +;; (parse-error context "enum attribute default not specified" +;; arg-list)) + (if (eq? values #f) + (parse-error context "enum attribute values not specified" + arg-list))) + ((string) + (if (eq? default #f) + (set! default "")) + (if (not (eq? values #f)) + (parse-error context "string attribute values specified" + arg-list))) + ) + + ;; Now that we've identified the elements, build the object. + (/attr-parse context type-class name comment attrs for default values)) +) + +; Main routines for defining attributes in .cpu files. + +(define define-attr + (lambda arg-list + (let ((a (apply /attr-read (cons (make-current-context "define-attr") + arg-list)))) + (current-attr-add! a) + a)) +) + +; Query routines. + +; Lookup ATTR-NAME in ATTR-LIST. +; The result is the object or #f if not found. + +(define (attr-lookup attr-name attr-list) + (object-assq attr-name attr-list) +) + +; Return a boolean indicating if boolean attribute ATTR is "true" in +; attribute alist ALIST. +; Note that if the attribute isn't present, it is defined to be #f. + +(method-make! + 'has-attr? + (lambda (self attr) + (let ((a (assq attr (elm-get self 'attrs)))) + (cond ((not a) a) + ((boolean? (cdr a)) (cdr a)) + (else (error "Not a boolean attribute:" attr))))) +) + +(define (atlist-has-attr? atlist attr) + (send atlist 'has-attr? attr) +) + +; Return a boolean indicating if attribute ATTR is present in +; attribute alist ALIST. + +(method-make! + 'attr-present? + (lambda (self attr) + (->bool (assq attr (elm-get self 'attrs)))) +) + +(define (atlist-attr-present? atlist attr) + (send atlist 'attr-present? attr) +) + +;; Return #t if attribute value VAL is an rtx expression. +;; RTXs in attributes are recorded as a list of one element +;; which is the rtx. +;; I.e., ((rtx foo bar)). + +(define (/attr-val-is-rtx? val) + (and (pair? val) + (null? (cdr val)) + (pair? (car val))) ;; pair? -> cheap non-null-list? +) + +; Expand attribute value ATVAL, which is an rtx expression. +; OWNER is the containing object or #f if there is none. +; OWNER is needed if an attribute is defined in terms of other attributes. +; OWNER is also needed to get the ISA(s) in which to evaluate the expression. +; If it's #f obviously ATVAL can't be defined in terms of others, +; or refer to operands that require an ISA to disambiguate. + +(define (/attr-eval atval owner) + (let* ((atval-expr (car atval)) + (expr (rtx-simplify #f owner + (rtx-canonicalize #f 'DFLT + (and owner (obj-isa-list owner)) + nil atval-expr) + nil)) + (value (rtx-value expr owner))) + (cond ((symbol? value) value) + ((number? value) value) + (error "/attr-eval: internal error, unsupported result:" value))) +) + +; Return value of ATTR in attribute alist ALIST. +; If not present, return the default value. +; If ATTR is an unknown attribute, return #f. +; OWNER is the containing object or #f if there is none. + +(define (attr-value alist attr owner) + (let ((a (assq-ref alist attr))) + (if a + (if (/attr-val-is-rtx? a) + (/attr-eval a owner) + a) + (attr-lookup-default attr owner))) +) + +; Return the value of ATTR in ATLIST. +; If not present, return the default value. +; If ATTR is an unknown attribute, return #f. +; OWNER is the containing object or #f if there is none. + +(define (atlist-attr-value atlist attr owner) + (attr-value (atlist-attrs atlist) attr owner) +) + +; Same as atlist-attr-value but return nil if attribute not present. + +(define (atlist-attr-value-no-default atlist attr owner) + (let ((a (assq-ref (atlist-attrs atlist) attr))) + (if a + (if (/attr-val-is-rtx? a) + (/attr-eval a owner) + a) + nil)) +) + +; Return the default for attribute A. +; +; If A is unknown return #f. +; This means the caller can't distinguish booleans from unknowns, +; but the caller is left to deal with that. +; +; OWNER is the containing object or #f if there is none. + +(define (attr-lookup-default a owner) + (let ((at (current-attr-lookup a))) + (if at + (if (bool-attr? at) + #f ;; FIXME: should fetch default from the attribute + (let ((deflt (attr-default at))) + (if deflt + (if (/attr-val-is-rtx? deflt) + (/attr-eval deflt owner) + deflt) + ;; If no default was provided, use the first value. + ;; FIXME: This shouldn't happen. /attr-parse should DTRT. + (caar (attr-values at))))) + #f)) +) + +; Return a boolean indicating if X is present in BITSET. +; Bitset values are recorded as (val1 val2 ...). + +(define (bitset-attr-member? x bitset) + (->bool (memq x bitset)) +) + +; Routines for accessing attributes in objects. + +; Get/set attributes of OBJ. +; OBJ is any object which supports the get-atlist message. + +(define (obj-atlist obj) + (let ((result (send obj 'get-atlist))) + ; As a speed up, we allow objects to specify an empty attribute list + ; with #f or (), rather than creating an attr-list object. + ; ??? There is atlist-empty now which should be used directly. + (if (or (null? result) (not result)) + atlist-empty + result)) +) + +(define (obj-set-atlist! obj attrs) (send obj 'set-atlist! attrs)) + +; Add attribute ATTR to OBJ. +; The attribute is prepended to the front so it overrides any existing +; definition. + +(define (obj-cons-attr! obj attr) + (obj-set-atlist! obj (atlist-cons attr (obj-atlist obj))) +) + +; Add attribute list ATLIST to OBJ. +; Attributes in ATLIST override existing values, so ATLIST is "prepended". + +(define (obj-prepend-atlist! obj atlist) + ; Must have same prefix. + (assert (equal? (atlist-prefix (obj-atlist obj)) + (atlist-prefix atlist))) + (obj-set-atlist! obj (atlist-append atlist (obj-atlist obj))) +) + +; Return boolean of whether OBJ has boolean attribute ATTR or not. +; OBJ is any object that supports attributes. + +(define (obj-has-attr? obj attr) + (atlist-has-attr? (obj-atlist obj) attr) +) + +; FIXME: for backward compatibility. Delete in time. +(define has-attr? obj-has-attr?) + +; Return a boolean indicating if attribute ATTR is present in OBJ. + +(define (obj-attr-present? obj attr) + (atlist-attr-present? (obj-atlist obj) attr) +) + +; Return value of attribute ATTR in OBJ. +; If the attribute isn't present, the default is returned. +; If ATTR is an unknown attribute, return #f. +; OBJ is any object that supports the get-atlist method. + +(define (obj-attr-value obj attr) + (let ((atlist (obj-atlist obj))) + (atlist-attr-value atlist attr obj)) +) + +; Return boolean of whether OBJ has attribute ATTR value VALUE or not. +; OBJ is any object that supports attributes. +; NOTE: The default value of the attribute IS considered. + +(define (obj-has-attr-value? obj attr value) + (let ((a (obj-attr-value obj attr))) + (eq? a value)) +) + +; Return boolean of whether OBJ explicitly has attribute ATTR value VALUE +; or not. +; OBJ is any object that supports attributes. +; NOTE: The default value of the attribute IS NOT considered. + +(define (obj-has-attr-value-no-default? obj attr value) + (let* ((atlist (obj-atlist obj)) + (objs-value (atlist-attr-value-no-default atlist attr obj))) + (and (not (null? objs-value)) (eq? value objs-value))) +) + +; Utilities. + +; Generate a list representing a bit mask of the indices of 'values' +; within 'all-values'. Each element in the resulting list represents a byte. +; Both bits and bytes are indexed from left to right starting at 0 +; with 8 bits in a byte. + +(define (charmask-bytes values all-values vec-length) + (logit 3 "charmask-bytes for " values " " all-values "\n") + (let ((result (make-vector vec-length 0)) + (indices (map (lambda (name) + (list-ref (map cadr all-values) + (element-lookup-index name (map car all-values) 0))) + values))) + (logit 3 "indices: " indices "\n") + (for-each (lambda (x) + (let* ((byteno (quotient x 8)) + (bitno (- 7 (remainder x 8))) + (byteval (logior (vector-ref result byteno) + (ash 1 bitno)))) + (vector-set! result byteno byteval))) + indices) + (logit 3 "result: " (vector->list result) "\n") + (vector->list result)) +) + +; Convert a bitset value into a bit string based on the +; index of each member in values. +; VALUE is a list of symbols in the bitset. +; VALUES is the values member of the attribute's definition. + +(define (/bitset-attr->charmask value values) + (let* ((values-names (map car values)) + (values-values (map cadr values)) + (vec-length (+ 1 (quotient (apply max values-values) 8)))) + (string-append "{ " (number->string vec-length) ", \"" + (string-map (lambda (x) + (string-append "\\x" (number->hex x))) + (charmask-bytes value values vec-length)) + "\" }")) +) + +; Return the enum of ATTR-NAME for type TYPE. +; TYPE is one of 'ifld, 'hw, 'operand, 'insn. + +(define (gen-attr-enum type attr-name) + (string-upcase (string-append "CGEN_" type "_" (gen-sym attr-name))) +) + +; Return a list of enum value definitions for gen-enum-decl. +; Attributes numbers are organized as follows: booleans are numbered 0-31. +; The range is because that's what fits in a portable int. Unused numbers +; are left unused. Non-booleans are numbered starting at 32. +; An alternative is start numbering the booleans at 32. The generated code +; is simpler with the current way (the "- 32" to get back the bit number or +; array index number occurs less often). +; +; Three special values are created: +; END-BOOLS - mark end of boolean attributes +; END-NBOOLS - mark end of non-boolean attributes +; START-NBOOLS - marks the start of the non-boolean attributes +; (needed in case first non-bool is sanytized out). +; +; ATTR-OBJ-LIST is a list of objects (always subclassed of course). + +(define (attr-list-enum-list attr-obj-list) + (let ((sorted-attrs (/attr-sort (attr-remove-meta-attrs attr-obj-list)))) + (assert (<= (length (car sorted-attrs)) 32)) + (append! + (map (lambda (bool-attr) + (list (obj:name bool-attr) '- + (atlist-attrs (obj-atlist bool-attr)))) + (car sorted-attrs)) + (list '(END-BOOLS)) + (list '(START-NBOOLS 31)) + (map (lambda (nbool-attr) + (list (obj:name nbool-attr) '- + (atlist-attrs (obj-atlist nbool-attr)))) + (cdr sorted-attrs)) + (list '(END-NBOOLS)) + )) +) + +; Sort an alist of attributes so non-boolean attributes are at the front. +; This is used to sort a particular object's attributes. +; This is required by the C support code (cgen.h:CGEN_ATTR_VALUE). +; Boolean attributes appear as (NAME . #t/#f), non-boolean ones appear as +; (NAME . VALUE). Attributes of the same type are sorted by name. + +(define (/attr-sort-alist alist) + (sort alist + (lambda (a b) + ;(display (list a b "\n")) + (cond ((and (boolean? (cdr a)) (boolean? (cdr b))) + (stringstring (car a)) (symbol->string (car b)))) + ((boolean? (cdr a)) #f) ; we know b is non-bool here + ((boolean? (cdr b)) #t) ; we know a is non-bool here + (else (stringstring (car a)) + (symbol->string (car b))))))) +) + +; Sort ATTR-LIST into two lists: bools and non-bools. +; The car of the result is the bools, the cdr is the non-bools. +; Attributes requiring a fixed index have the INDEX attribute, +; and used for the few special attributes that are refered to by +; architecture independent code. +; For each of non-bools and bools, put attributes with the INDEX attribute +; first. This is used to sort a list of attributes for output (e.g. define +; the attr enum). +; +; FIXME: Record index number with the INDEX attribute and sort on it. +; At present it's just a boolean. + +(define (/attr-sort attr-list) + (let loop ((fixed-non-bools nil) + (non-fixed-non-bools nil) + (fixed-bools nil) + (non-fixed-bools nil) + (attr-list attr-list)) + (cond ((null? attr-list) + (cons (append! (reverse! fixed-bools) + (reverse! non-fixed-bools)) + (append! (reverse! fixed-non-bools) + (reverse! non-fixed-non-bools)))) + ((bool-attr? (car attr-list)) + (if (obj-has-attr? (car attr-list) 'INDEX) + (loop fixed-non-bools non-fixed-non-bools + (cons (car attr-list) fixed-bools) non-fixed-bools + (cdr attr-list)) + (loop fixed-non-bools non-fixed-non-bools + fixed-bools (cons (car attr-list) non-fixed-bools) + (cdr attr-list)))) + (else + (if (obj-has-attr? (car attr-list) 'INDEX) + (loop (cons (car attr-list) fixed-non-bools) non-fixed-non-bools + fixed-bools non-fixed-bools + (cdr attr-list)) + (loop fixed-non-bools (cons (car attr-list) non-fixed-non-bools) + fixed-bools non-fixed-bools + (cdr attr-list)))))) +) + +; Return number of non-bools in attributes ATLIST. + +(define (attr-count-non-bools atlist) + (count-true (map (lambda (a) (not (bool-attr? a))) + atlist)) +) + +; Given an alist of attributes, return the non-bools. + +(define (attr-non-bool-attrs alist) + (let loop ((result nil) (alist alist)) + (cond ((null? alist) (reverse! result)) + ((boolean? (cdar alist)) (loop result (cdr alist))) + (else (loop (cons (car alist) result) (cdr alist))))) +) + +; Given an alist of attributes, return the bools. + +(define (attr-bool-attrs alist) + (let loop ((result nil) (alist alist)) + (cond ((null? alist) (reverse! result)) + ((boolean? (cdar alist)) + (loop (cons (car alist) result) (cdr alist))) + (else (loop result (cdr alist))))) +) + +; Parse an attribute spec. +; CONTEXT is a object or #f if there is none. +; ATTRS is a list of attribute specs (e.g. (FOO !BAR (BAZ 3))). +; The result is the attribute alist. + +(define (attr-parse context attrs) + (logit 4 (list 'attr-parse context attrs) "\n") + (if (not (list? attrs)) + (parse-error context "improper attribute list" attrs)) + (let ((alist nil)) + (for-each (lambda (elm) + (cond ((symbol? elm) + ; boolean attribute + (if (char=? (string-ref (symbol->string elm) 0) #\!) + (set! alist (acons (string->symbol (string-drop1 (symbol->string elm))) #f alist)) + (set! alist (acons elm #t alist))) + (if (not (current-attr-lookup (caar alist))) + (parse-error context "unknown attribute" (caar alist)))) + ((and (list? elm) (pair? elm) (symbol? (car elm))) + (let ((a (current-attr-lookup (car elm)))) + (if (not a) + (parse-error context "unknown attribute" elm)) + (set! alist (cons (send a 'parse-value + context (cdr elm)) + alist)))) + (else (parse-error context "improper attribute" elm)))) + attrs) + alist) +) + +; Parse an object attribute spec. +; ATTRS is a list of attribute specs (e.g. (FOO !BAR (BAZ 3))). +; The result is an object. + +(define (atlist-parse context attrs prefix) + (make prefix (attr-parse context attrs)) +) + +;; Return the source form of an atlist's values. +;; Externally scalar attributes (boolean, integer, enum and string) are +;; ((name1 value1) (name2 value2) ...). +;; Internally they are ((name1 . value1) (name2 . value2) ...). +;; Externally bitset attributes are (name value1 value2 ...). +;; Internally they are the same, (name value1 value2 ...). +;; If the value is an rtx expression, externally it is (name (expr)), +;; and internally it is the same, (name (expr)). + +(define (atlist-source-form atlist) + (map (lambda (attr) + (let ((value (cdr attr))) + (if (pair? value) + (cons (car attr) value) + (list (car attr) value)))) + (atlist-attrs atlist)) +) + +; Cons an attribute to an attribute list to create a new attribute list. +; ATLIST is either an attr-list object or #f or () (both of the latter two +; signify an empty attribute list, in which case we make the prefix of the +; result ""). + +(define (atlist-cons attr atlist) + (if (or (not atlist) (null? atlist)) + (make "" (cons attr nil)) + (make (atlist-prefix atlist) (cons attr (atlist-attrs atlist)))) +) + +; Append one attribute list to another. +; The prefix for the new atlist is taken from the first one. + +(define (atlist-append attr-list1 attr-list2) + (make + (atlist-prefix attr-list1) + (append (atlist-attrs attr-list1) (atlist-attrs attr-list2))) +) + +; Remove meta-attributes from ALIST. +; "meta" may be the wrong adjective to use here. +; The attributes in question are not intended to appear in generated files. +; They started out being attributes of attributes, hence the name "meta". + +(define (attr-remove-meta-attrs-alist alist) + (let ((all-attrs (current-attr-list))) + ; FIXME: Why not use find? + (let loop ((result nil) (alist alist)) + (if (null? alist) + (reverse! result) + (let ((attr (attr-lookup (caar alist) all-attrs))) + (if (and attr (has-attr? attr 'META)) + (loop result (cdr alist)) + (loop (cons (car alist) result) (cdr alist))))))) +) + +; Remove meta-attributes from ATTR-LIST. +; "meta" may be the wrong adjective to use here. +; The attributes in question are not intended to appear in generated files. +; They started out being attributes of attributes, hence the name "meta". + +(define (attr-remove-meta-attrs attr-list) + ; FIXME: Why not use find? + (let loop ((result nil) (attr-list attr-list)) + (cond ((null? attr-list) + (reverse! result)) + ((has-attr? (car attr-list) 'META) + (loop result (cdr attr-list))) + (else + (loop (cons (car attr-list) result) (cdr attr-list))))) +) + +; Remove duplicates from ATTRS, a list of attributes. +; Attribute lists are typically small so we use a simple O^2 algorithm. +; The leading entry of an attribute overrides subsequent ones so this is +; defined to pick the first entry of each attribute. + +(define (attr-nub attrs) + (let loop ((result nil) (attrs attrs)) + (cond ((null? attrs) (reverse! result)) + ((assq (caar attrs) result) (loop result (cdr attrs))) + (else (loop (cons (car attrs) result) (cdr attrs))))) +) + +; Return a list of all attrs in TABLE-LIST, a list of lists of arbitrary +; elements. A list of lists is passed to simplify computation of insn +; attributes where the insns and macro-insns are on separate lists and +; appending them into one list would be unnecessarily expensive. +; ACCESSOR is a function to access the attrs field from TABLE-LIST. +; Duplicates are eliminated and the list is sorted so non-boolean attributes +; are at the front (required by the C code that fetches attribute values). +; STD-ATTRS is an `attr-list' object of attrs that are always available. +; The actual values returned are random (e.g. #t vs #f). We could +; canonicalize them. +; The result is an alist of all the attributes that are used in TABLE-LIST. +; ??? The cdr of each element is some random value. Perhaps it should be +; the default value or perhaps we should just return a list of names. +; ??? No longer used. + +(define (attr-compute-all table-list accessor std-attrs) + (let ((accessor (lambda (elm) (atlist-attrs (accessor elm))))) + (attr-remove-meta-attrs-alist + (attr-nub + (/attr-sort-alist + (append + (apply append + (map (lambda (table-elm) + (apply append + (find-apply accessor + (lambda (e) + (let ((attrs (accessor e))) + (not (null? attrs)))) + table-elm))) + table-list)) + (atlist-attrs std-attrs)))))) +) + +; Return lists of attributes for particular object types. +; FIXME: The output shouldn't be required to be sorted. + +(define (current-attr-list-for type) + (let ((sorted (/attr-sort (find (lambda (a) + (if (atlist-for a) + (memq type (atlist-for a)) + #t)) + (attr-remove-meta-attrs + (current-attr-list)))))) + ; Current behaviour puts the non-bools at the front. + (append! (cdr sorted) (car sorted))) +) +(define (current-ifld-attr-list) + (current-attr-list-for 'ifield) +) +(define (current-hw-attr-list) + (current-attr-list-for 'hardware) +) +(define (current-op-attr-list) + (current-attr-list-for 'operand) +) +(define (current-insn-attr-list) + (current-attr-list-for 'insn) +) + +; Methods to emit the C value of an attribute. +; These don't _really_ belong here (C code doesn't belong in the appl'n +; independent part of CGEN), but there isn't a better place for them +; (maybe utils-cgen.scm?) and there's only a few of them. + +(method-make! + 'gen-value-for-defn-raw + (lambda (self value) + (if (not value) + "0" + "1")) + ;(string-upcase (string-append (obj:str-name self) "_" value))) +) + +(method-make! + 'gen-value-for-defn + (lambda (self value) + (send self 'gen-value-for-defn-raw value)) +) + +;; NOTE: VALUE is a list of symbols in the bitset. + +(method-make! + 'gen-value-for-defn-raw + (lambda (self value) + (if (string=? (string-downcase (gen-sym self)) "isa") + (/bitset-attr->charmask value (elm-get self 'values)) + (string-drop1 + (string-upcase + (string-map (lambda (x) + (string-append "|(1<<" + (gen-sym self) + "_" (gen-c-symbol x) ")")) + value)))) + ) +) + +;; NOTE: VALUE is a list of symbols in the bitset. + +(method-make! + 'gen-value-for-defn + (lambda (self value) + (string-append + "{ " + (if (string=? (string-downcase (gen-sym self)) "isa") + (/bitset-attr->charmask value (elm-get self 'values)) + (string-append + "{ " + (string-drop1 + (string-upcase + (string-map (lambda (x) + (string-append "|(1<<" + (gen-sym self) + "_" (gen-c-symbol x) ")")) + value))) + ", 0 }")) + " }") + ) +) + +(method-make! + 'gen-value-for-defn-raw + (lambda (self value) + (number->string value) + ) +) + +(method-make! + 'gen-value-for-defn + (lambda (self value) + (string-append + "{ { " + (send self 'gen-value-for-defn-raw value) + ", 0 } }") + ) +) + +(method-make! + 'gen-value-for-defn-raw + (lambda (self value) + (string-upcase + (gen-c-symbol (string-append (obj:str-name self) + "_" + (symbol->string value)))) + ) +) + +(method-make! + 'gen-value-for-defn + (lambda (self value) + (string-append + "{ { " + (send self 'gen-value-for-defn-raw value) + ", 0 } }") + ) +) + +;; Doesn't handle escape sequences. +(method-make! + 'gen-value-for-defn-raw + (lambda (self value) + (string-append "\"" value "\"")) +) + +(method-make! + 'gen-value-for-defn + (lambda (self value) + (send self 'gen-value-for-defn-raw value)) +) + + +; Called before loading a .cpu file to initialize. + +(define (attr-init!) + + (reader-add-command! 'define-attr + "\ +Define an attribute, name/value pair list version. +" + nil 'arg-list define-attr) + + *UNSPECIFIED* +) + +; Called before a . cpu file is read in to install any builtins. +; One thing this does is define all attributes requiring a fixed index, +; keeping them all in one place. +; ??? Perhaps it would make sense to define all predefined attributes here. + +(define (attr-builtin!) + (define-attr '(type boolean) '(name VIRTUAL) '(comment "virtual object")) + + ; The meta attribute is used for attributes that aren't to appear in + ; generated output (need a better name). + (define-attr '(for attr) '(type boolean) '(name META)) + + ; Objects to keep local to a generated file. + (define-attr '(for keyword) '(type boolean) '(name PRIVATE)) + + ; Attributes requiring fixed indices. + (define-attr '(for attr) '(type boolean) '(name INDEX) '(attrs META)) + + ; ALIAS is used for instructions that are aliases of more general insns. + ; ALIAS insns are ignored by the simulator. + (define-attr '(for insn) '(type boolean) '(name ALIAS) + '(comment "insn is an alias of another") + '(attrs INDEX)) + + *UNSPECIFIED* +) + +; Called after loading a .cpu file to perform any post-processing required. + +(define (attr-finish!) + *UNSPECIFIED* +) diff -Nur binutils-2.24.orig/cgen/AUTHORS binutils-2.24/cgen/AUTHORS --- binutils-2.24.orig/cgen/AUTHORS 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/AUTHORS 2016-06-30 21:26:12.597890934 +0200 @@ -0,0 +1,2 @@ +CGEN was originally written by Doug Evans +while at Cygnus. diff -Nur binutils-2.24.orig/cgen/cgen-doc.scm binutils-2.24/cgen/cgen-doc.scm --- binutils-2.24.orig/cgen/cgen-doc.scm 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/cgen-doc.scm 2016-06-30 21:26:12.597890934 +0200 @@ -0,0 +1,77 @@ +; CPU description file generator for CGEN cpu documentation +; This is invoked to build: $arch.html. +; Copyright (C) 2003, 2009 Doug Evans +; This file is part of CGEN. +; +; This is a standalone script, we don't load anything until we parse the +; -s argument (keeps reliance off of environment variables, etc.). + +; Load the various support routines. + +(define (load-files srcdir) + (load (string-append srcdir "/read.scm")) + (load (string-append srcdir "/desc.scm")) + (load (string-append srcdir "/desc-cpu.scm")) + (load (string-append srcdir "/html.scm")) +) + +(define doc-arguments + (list + (list "-H" "file" "generate $arch.html in " + #f + (lambda (arg) (file-write arg cgen.html))) + (list "-I" "file" "generate $arch-insn.html in " + #f + (lambda (arg) (file-write arg cgen-insn.html))) + (list "-N" "file" "specify name of insn.html file" + #f + (lambda (arg) (set! *insn-html-file-name* arg))) + ) +) + +; Kept global so it's available to the other .scm files. +(define srcdir ".") + +; Scan argv for -s srcdir. +; We can't process any other args until we find the cgen source dir. +; The result is srcdir. +; We assume "-s" isn't the argument to another option. Unwise, yes. +; Alternatives are to require it to be the first argument or at least preceed +; any option with a "-s" argument, or to put knowledge of the common argument +; set and common argument parsing code in every top level file. + +(define (find-srcdir argv) + (let loop ((argv argv)) + (if (null? argv) + (error "`-s srcdir' not present, can't load cgen")) + (if (string=? "-s" (car argv)) + (begin + (if (null? (cdr argv)) + (error "missing srcdir arg to `-s'")) + (cadr argv)) + (loop (cdr argv)))) +) + +; Main routine, parses options and calls generators. + +(define (cgen-doc argv) + (let () + + ; Find and set srcdir, then load all Scheme code. + ; Drop the first argument, it is the script name (i.e. argv[0]). + (set! srcdir (find-srcdir (cdr argv))) + (set! %load-path (cons srcdir %load-path)) + (load-files srcdir) + + (display-argv argv) + + (cgen #:argv argv + #:app-name "doc" + #:arg-spec doc-arguments + #:init doc-init! + #:finish doc-finish! + #:analyze doc-analyze!) + ) +) + +(cgen-doc (program-arguments)) diff -Nur binutils-2.24.orig/cgen/cgen-gas.scm binutils-2.24/cgen/cgen-gas.scm --- binutils-2.24.orig/cgen/cgen-gas.scm 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/cgen-gas.scm 2016-06-30 21:26:12.597890934 +0200 @@ -0,0 +1,80 @@ +; CPU description file generator for the GAS testsuite. +; Copyright (C) 2000, 2001, 2009 Red Hat, Inc. +; This file is part of CGEN. + +; This is invoked to build several .s files and a "build script", +; which generates the .d files and .exp DejaGNU test case. + +; Load the various support routines. + +(define (load-files srcdir) + (load (string-append srcdir "/read.scm")) + (load (string-append srcdir "/desc.scm")) + (load (string-append srcdir "/desc-cpu.scm")) + (load (string-append srcdir "/opcodes.scm")) + (load (string-append srcdir "/opc-asmdis.scm")) + (load (string-append srcdir "/opc-ibld.scm")) + (load (string-append srcdir "/opc-itab.scm")) + (load (string-append srcdir "/opc-opinst.scm")) + (load (string-append srcdir "/gas-test.scm")) +) + +(define gas-arguments + (list + (list "-B" "file" "generate build script in " + #f + (lambda (arg) (file-write arg cgen-build.sh))) + (list "-E" "file" "generate allinsn.exp in " + #f + (lambda (arg) (file-write arg cgen-allinsn.exp))) + ) +) + +; Kept global so it's available to the other .scm files. +(define srcdir ".") + +; Scan argv for -s srcdir. +; We can't process any other args until we find the cgen source dir. +; The result is srcdir. +; We assume "-s" isn't the argument to another option. Unwise, yes. +; Alternatives are to require it to be the first argument or at least preceed +; any option with a "-s" argument, or to put knowledge of the common argument +; set and common argument parsing code in every top level file. + +(define (find-srcdir argv) + (let loop ((argv argv)) + (if (null? argv) + (error "`-s srcdir' not present, can't load cgen")) + (if (string=? "-s" (car argv)) + (begin + (if (null? (cdr argv)) + (error "missing srcdir arg to `-s'")) + (cadr argv)) + (loop (cdr argv)))) +) + +; Main routine, parses options and calls generators. + +(define (cgen-gas argv) + (let () + + ; Find and set srcdir, then load all Scheme code. + ; Drop the first argument, it is the script name (i.e. argv[0]). + (set! srcdir (find-srcdir (cdr argv))) + (set! %load-path (cons srcdir %load-path)) + (load-files srcdir) + + (display-argv argv) + + (cgen #:argv argv + #:app-name "gas-test" + #:arg-spec gas-arguments + #:init gas-test-init! + #:finish gas-test-finish! + #:analyze gas-test-analyze!) + ) +) + +(cgen-gas (program-arguments)) + +;; FIXME: cgen-all will generate the opcodes files, not what we want diff -Nur binutils-2.24.orig/cgen/cgen-intrinsics.scm binutils-2.24/cgen/cgen-intrinsics.scm --- binutils-2.24.orig/cgen/cgen-intrinsics.scm 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/cgen-intrinsics.scm 2016-06-30 21:26:12.597890934 +0200 @@ -0,0 +1,84 @@ +; GCC "intrinsics" file entry point. +; +; This is invoked to build support files for registering intrinsic +; functions within gcc. this code has a fair bit of target-specific +; code in it. it's not a general-purpose module yet. +; +; Copyright (C) 2000, 2009 Red Hat, Inc. +; This file is part of CGEN. +; +; This is a standalone script, we don't load anything until we parse the +; -s argument (keeps reliance off of environment variables, etc.). + +; Load the various support routines. + +(define (load-files srcdir) + ; Fix up Scheme to be what we use (guile is always in flux). + (primitive-load-path (string-append srcdir "/guile.scm")) + + (load (string-append srcdir "/read.scm")) + (load (string-append srcdir "/intrinsics.scm")) +) + +(define intrinsics-isas '()) + +(define intrinsics-arguments + (list + (list "-K" "isa" "keep isa in intrinsics" #f + (lambda (args) + (for-each + (lambda (arg) (set! intrinsics-isas (cons (string->symbol arg) intrinsics-isas))) + (string-cut args #\,)))) + (list "-M" "file" "generate insns.md in " #f + (lambda (arg) (file-write arg insns.md))) + (list "-N" "file" "generate intrinsics.h in " #f + (lambda (arg) (file-write arg intrinsics.h))) + (list "-P" "file" "generate intrinsic-protos.h in " #f + (lambda (arg) (file-write arg intrinsic-protos.h))) + (list "-T" "file" "generate intrinsic-testsuite.c in " #f + (lambda (arg) (file-write arg intrinsic-testsuite.c))))) + +; Kept global so it's available to the other .scm files. +(define srcdir ".") + +; Scan argv for -s srcdir. +; We can't process any other args until we find the cgen source dir. +; The result is srcdir. +; We assume "-s" isn't the argument to another option. Unwise, yes. +; Alternatives are to require it to be the first argument or at least preceed +; any option with a "-s" argument, or to put knowledge of the common argument +; set and common argument parsing code in every top level file. + +(define (find-srcdir argv) + (let loop ((argv argv)) + (if (null? argv) + (error "`-s srcdir' not present, can't load cgen")) + (if (string=? "-s" (car argv)) + (begin + (if (null? (cdr argv)) + (error "missing srcdir arg to `-s'")) + (cadr argv)) + (loop (cdr argv)))) +) + +; Main routine, parses options and calls generators. + +(define (cgen-intrinsics argv) + (let () + + ; Find and set srcdir, then load all Scheme code. + ; Drop the first argument, it is the script name (i.e. argv[0]). + (set! srcdir (find-srcdir (cdr argv))) + (set! %load-path (cons srcdir %load-path)) + (load-files srcdir) + + (display-argv argv) + + (cgen #:argv argv + #:app-name "intrinsics" + #:arg-spec intrinsics-arguments + #:analyze intrinsics-analyze!) + ) +) + +(cgen-intrinsics (program-arguments)) diff -Nur binutils-2.24.orig/cgen/cgen-opc.scm binutils-2.24/cgen/cgen-opc.scm --- binutils-2.24.orig/cgen/cgen-opc.scm 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/cgen-opc.scm 2016-06-30 21:26:12.597890934 +0200 @@ -0,0 +1,108 @@ +; CPU description file generator for the GNU Binutils. +; This is invoked to build: $arch-desc.[ch], $arch-opinst.c, +; $arch-opc.h, $arch-opc.c, $arch-asm.in, $arch-dis.in, and $arch-ibld.[ch]. +; Copyright (C) 2000, 2009 Red Hat, Inc. +; This file is part of CGEN. +; +; This is a standalone script, we don't load anything until we parse the +; -s argument (keeps reliance off of environment variables, etc.). + +; Load the various support routines. + +(define (load-files srcdir) + (load (string-append srcdir "/read.scm")) + (load (string-append srcdir "/desc.scm")) + (load (string-append srcdir "/desc-cpu.scm")) + (load (string-append srcdir "/opcodes.scm")) + (load (string-append srcdir "/opc-asmdis.scm")) + (load (string-append srcdir "/opc-ibld.scm")) + (load (string-append srcdir "/opc-itab.scm")) + (load (string-append srcdir "/opc-opinst.scm")) +) + +(define opc-arguments + (list + (list "-OPC" "file" "specify path to .opc file" + (lambda (arg) (set-opc-file-path! arg)) + #f) + (list "-H" "file" "generate $arch-desc.h in " + #f + (lambda (arg) (file-write arg cgen-desc.h))) + (list "-C" "file" "generate $arch-desc.c in " + #f + (lambda (arg) (file-write arg cgen-desc.c))) + (list "-O" "file" "generate $arch-opc.h in " + #f + (lambda (arg) (file-write arg cgen-opc.h))) + (list "-P" "file" "generate $arch-opc.c in " + #f + (lambda (arg) (file-write arg cgen-opc.c))) + (list "-Q" "file" "generate $arch-opinst.c in " + #f + (lambda (arg) (file-write arg cgen-opinst.c))) + (list "-B" "file" "generate $arch-ibld.h in " + #f + (lambda (arg) (file-write arg cgen-ibld.h))) + (list "-L" "file" "generate $arch-ibld.in in " + #f + (lambda (arg) (file-write arg cgen-ibld.in))) + (list "-A" "file" "generate $arch-asm.in in " + #f + (lambda (arg) (file-write arg cgen-asm.in))) + (list "-D" "file" "generate $arch-dis.in in " + #f + (lambda (arg) (file-write arg cgen-dis.in))) + ) +) + +; (-R "file" "generate $cpu-reloc.h") ; FIXME: wip (rename to -abi.h?) +; (-S "file" "generate cpu-$cpu.c") ; FIXME: wip (bfd's cpu-$cpu.c) +; ((-R) (file-write *arg* cgen-reloc.c)) +; ((-S) (file-write *arg* cgen-bfdcpu.c)) + +; Kept global so it's available to the other .scm files. +(define srcdir ".") + +; Scan argv for -s srcdir. +; We can't process any other args until we find the cgen source dir. +; The result is srcdir. +; We assume "-s" isn't the argument to another option. Unwise, yes. +; Alternatives are to require it to be the first argument or at least preceed +; any option with a "-s" argument, or to put knowledge of the common argument +; set and common argument parsing code in every top level file. + +(define (find-srcdir argv) + (let loop ((argv argv)) + (if (null? argv) + (error "`-s srcdir' not present, can't load cgen")) + (if (string=? "-s" (car argv)) + (begin + (if (null? (cdr argv)) + (error "missing srcdir arg to `-s'")) + (cadr argv)) + (loop (cdr argv)))) +) + +; Main routine, parses options and calls generators. + +(define (cgen-opc argv) + (let () + + ; Find and set srcdir, then load all Scheme code. + ; Drop the first argument, it is the script name (i.e. argv[0]). + (set! srcdir (find-srcdir (cdr argv))) + (set! %load-path (cons srcdir %load-path)) + (load-files srcdir) + + (display-argv argv) + + (cgen #:argv argv + #:app-name "opcodes" + #:arg-spec opc-arguments + #:init opcodes-init! + #:finish opcodes-finish! + #:analyze opcodes-analyze!) + ) +) + +(cgen-opc (program-arguments)) diff -Nur binutils-2.24.orig/cgen/cgen-sid.scm binutils-2.24/cgen/cgen-sid.scm --- binutils-2.24.orig/cgen/cgen-sid.scm 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/cgen-sid.scm 2016-06-30 21:26:12.597890934 +0200 @@ -0,0 +1,101 @@ +; Simulator generator entry point. +; This is invoked to build: desc.h, cpu.h, defs.h, decode.h, decode.cxx, +; semantics.cxx, sem-switch.cxx, model.h, model.cxx +; Copyright (C) 2000, 2003, 2009 Red Hat, Inc. +; This file is part of CGEN. +; +; This is a standalone script, we don't load anything until we parse the +; -s argument (keeps reliance off of environment variables, etc.). + +; Load the various support routines. + +(define (load-files srcdir) + (load (string-append srcdir "/read.scm")) + (load (string-append srcdir "/utils-sim.scm")) + (load (string-append srcdir "/sid.scm")) + (load (string-append srcdir "/sid-cpu.scm")) + (load (string-append srcdir "/sid-model.scm")) + (load (string-append srcdir "/sid-decode.scm")) +) + +(define sim-arguments + (list + (list "-H" "file" "generate desc.h in " + #f + (lambda (arg) (file-write arg cgen-desc.h))) + (list "-C" "file" "generate cpu.h in " + #f + (lambda (arg) (file-write arg cgen-cpu.h))) + (list "-E" "file" "generate defs.h in " + #f + (lambda (arg) (file-write arg cgen-defs.h))) + (list "-T" "file" "generate decode.h in " + #f + (lambda (arg) (file-write arg cgen-decode.h))) + (list "-D" "file" "generate decode.cxx in " + #f + (lambda (arg) (file-write arg cgen-decode.cxx))) + (list "-W" "file" "generate write.cxx in " + #f + (lambda (arg) (file-write arg cgen-write.cxx))) + (list "-S" "file" "generate semantics.cxx in " + #f + (lambda (arg) (file-write arg cgen-semantics.cxx))) + (list "-X" "file" "generate sem-switch.cxx in " + #f + (lambda (arg) (file-write arg cgen-sem-switch.cxx))) + (list "-M" "file" "generate model.cxx in " + #f + (lambda (arg) (file-write arg cgen-model.cxx))) + (list "-N" "file" "generate model.h in " + #f + (lambda (arg) (file-write arg cgen-model.h))) + ) +) + +; Kept global so it's available to the other .scm files. +(define srcdir ".") + +; Scan argv for -s srcdir. +; We can't process any other args until we find the cgen source dir. +; The result is srcdir. +; We assume "-s" isn't the argument to another option. Unwise, yes. +; Alternatives are to require it to be the first argument or at least preceed +; any option with a "-s" argument, or to put knowledge of the common argument +; set and common argument parsing code in every top level file. + +(define (find-srcdir argv) + (let loop ((argv argv)) + (if (null? argv) + (error "`-s srcdir' not present, can't load cgen")) + (if (string=? "-s" (car argv)) + (begin + (if (null? (cdr argv)) + (error "missing srcdir arg to `-s'")) + (cadr argv)) + (loop (cdr argv)))) +) + +; Main routine, parses options and calls generators. + +(define (cgen-sim argv) + (let () + + ; Find and set srcdir, then load all Scheme code. + ; Drop the first argument, it is the script name (i.e. argv[0]). + (set! srcdir (find-srcdir (cdr argv))) + (set! %load-path (cons srcdir %load-path)) + (load-files srcdir) + + (display-argv argv) + + (cgen #:argv argv + #:app-name "sim" + #:arg-spec sim-arguments + #:init sim-init! + #:finish sim-finish! + #:analyze sim-analyze!) + ) +) + +(cgen-sim (program-arguments)) diff -Nur binutils-2.24.orig/cgen/cgen-sim.scm binutils-2.24/cgen/cgen-sim.scm --- binutils-2.24.orig/cgen/cgen-sim.scm 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/cgen-sim.scm 2016-06-30 21:26:12.597890934 +0200 @@ -0,0 +1,129 @@ +; Simulator generator entry point. +; This is invoked to build: arch.h, cpu-.h, memops.h, semops.h, decode.h, +; decode.c, defs.h, extract.c, semantics.c, ops.c, model.c, mainloop.in. +; +; memops.h, semops.h, ops.c, mainloop.in are either deprecated or wip. +; +; Copyright (C) 2000, 2009 Red Hat, Inc. +; This file is part of CGEN. +; +; This is a standalone script, we don't load anything until we parse the +; -s argument (keeps reliance off of environment variables, etc.). + +; Load the various support routines. + +(define (load-files srcdir) + (load (string-append srcdir "/read.scm")) + (load (string-append srcdir "/utils-sim.scm")) + (load (string-append srcdir "/sim.scm")) + (load (string-append srcdir "/sim-arch.scm")) + (load (string-append srcdir "/sim-cpu.scm")) + (load (string-append srcdir "/sim-model.scm")) + (load (string-append srcdir "/sim-decode.scm")) +) + +(define sim-arguments + (list + (list "-A" "file" "generate arch.h in " + #f + (lambda (arg) (file-write arg cgen-arch.h))) + (list "-B" "file" "generate arch.c in " + #f + (lambda (arg) (file-write arg cgen-arch.c))) + (list "-C" "file" "generate cpu-.h in " + #f + (lambda (arg) (file-write arg cgen-cpu.h))) + (list "-U" "file" "generate cpu-.c in " + #f + (lambda (arg) (file-write arg cgen-cpu.c))) + (list "-N" "file" "generate cpu-all.h in " + #f + (lambda (arg) (file-write arg cgen-cpuall.h))) + (list "-F" "file" "generate memops.h in " + #f + (lambda (arg) (file-write arg cgen-mem-ops.h))) + (list "-G" "file" "generate defs.h in " + #f + (lambda (arg) (file-write arg cgen-defs.h))) + (list "-P" "file" "generate semops.h in " + #f + (lambda (arg) (file-write arg cgen-sem-ops.h))) + (list "-T" "file" "generate decode.h in " + #f + (lambda (arg) (file-write arg cgen-decode.h))) + (list "-D" "file" "generate decode.c in " + #f + (lambda (arg) (file-write arg cgen-decode.c))) + (list "-E" "file" "generate extract.c in " + #f + (lambda (arg) (file-write arg cgen-extract.c))) + (list "-R" "file" "generate read.c in " + #f + (lambda (arg) (file-write arg cgen-read.c))) + (list "-W" "file" "generate write.c in " + #f + (lambda (arg) (file-write arg cgen-write.c))) + (list "-S" "file" "generate semantics.c in " + #f + (lambda (arg) (file-write arg cgen-semantics.c))) + (list "-X" "file" "generate sem-switch.c in " + #f + (lambda (arg) (file-write arg cgen-sem-switch.c))) + (list "-O" "file" "generate ops.c in " + #f + (lambda (arg) (file-write arg cgen-ops.c))) + (list "-M" "file" "generate model.c in " + #f + (lambda (arg) (file-write arg cgen-model.c))) + (list "-L" "file" "generate mainloop.in in " + #f + (lambda (arg) (file-write arg cgen-mainloop.in))) + ) +) + +; Kept global so it's available to the other .scm files. +(define srcdir ".") + +; Scan argv for -s srcdir. +; We can't process any other args until we find the cgen source dir. +; The result is srcdir. +; We assume "-s" isn't the argument to another option. Unwise, yes. +; Alternatives are to require it to be the first argument or at least preceed +; any option with a "-s" argument, or to put knowledge of the common argument +; set and common argument parsing code in every top level file. + +(define (find-srcdir argv) + (let loop ((argv argv)) + (if (null? argv) + (error "`-s srcdir' not present, can't load cgen")) + (if (string=? "-s" (car argv)) + (begin + (if (null? (cdr argv)) + (error "missing srcdir arg to `-s'")) + (cadr argv)) + (loop (cdr argv)))) +) + +; Main routine, parses options and calls generators. + +(define (cgen-sim argv) + (let () + + ; Find and set srcdir, then load all Scheme code. + ; Drop the first argument, it is the script name (i.e. argv[0]). + (set! srcdir (find-srcdir (cdr argv))) + (set! %load-path (cons srcdir %load-path)) + (load-files srcdir) + + (display-argv argv) + + (cgen #:argv argv + #:app-name "sim" + #:arg-spec sim-arguments + #:init sim-init! + #:finish sim-finish! + #:analyze sim-analyze!) + ) +) + +(cgen-sim (program-arguments)) diff -Nur binutils-2.24.orig/cgen/cgen-stest.scm binutils-2.24/cgen/cgen-stest.scm --- binutils-2.24.orig/cgen/cgen-stest.scm 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/cgen-stest.scm 2016-06-30 21:26:12.597890934 +0200 @@ -0,0 +1,80 @@ +; CPU description file generator for the simulator testsuite. +; Copyright (C) 2000, 2009 Red Hat, Inc. +; This file is part of CGEN. + +; This is invoked to build several .s files and a script to run to +; generate the .d files and .exp file. +; This is invoked to build: tmp-build.sh cpu-cpu.exp + +; Load the various support routines +(define (load-files srcdir) + (load (string-append srcdir "/read.scm")) + (load (string-append srcdir "/desc.scm")) + (load (string-append srcdir "/desc-cpu.scm")) + (load (string-append srcdir "/opcodes.scm")) + (load (string-append srcdir "/opc-asmdis.scm")) + (load (string-append srcdir "/opc-ibld.scm")) + (load (string-append srcdir "/opc-itab.scm")) + (load (string-append srcdir "/opc-opinst.scm")) + (load (string-append srcdir "/sim-test.scm")) +) + +(define stest-arguments + (list + (list "-B" "file" "generate build.sh" + #f + (lambda (arg) (file-write arg cgen-build.sh))) + (list "-E" "file" "generate the testsuite .exp" + #f + (lambda (arg) (file-write arg cgen-allinsn.exp))) + ) +) + +; Kept global so it's available to the other .scm files. +(define srcdir ".") + +; Scan argv for -s srcdir. +; We can't process any other args until we find the cgen source dir. +; The result is srcdir. +; We assume "-s" isn't the argument to another option. Unwise, yes. +; Alternatives are to require it to be the first argument or at least preceed +; any option with a "-s" argument, or to put knowledge of the common argument +; set and common argument parsing code in every top level file. + +(define (find-srcdir argv) + (let loop ((argv argv)) + (if (null? argv) + (error "`-s srcdir' not present, can't load cgen")) + (if (string=? "-s" (car argv)) + (begin + (if (null? (cdr argv)) + (error "missing srcdir arg to `-s'")) + (cadr argv)) + (loop (cdr argv)))) +) + +; Main routine, parses options and calls generators. + +(define (cgen-stest argv) + (let () + + ; Find and set srcdir, then load all Scheme code. + ; Drop the first argument, it is the script name (i.e. argv[0]). + (set! srcdir (find-srcdir (cdr argv))) + (set! %load-path (cons srcdir %load-path)) + (load-files srcdir) + + (display-argv argv) + + (cgen #:argv argv + #:app-name "sim-test" + #:arg-spec stest-arguments + #:init sim-test-init! + #:finish sim-test-finish! + #:analyze sim-test-analyze!) + ) +) + +(cgen-stest (program-arguments)) + +;; FIXME: cgen-all will generate the opcodes files, not what we want diff -Nur binutils-2.24.orig/cgen/cgen-testsuite.scm binutils-2.24/cgen/cgen-testsuite.scm --- binutils-2.24.orig/cgen/cgen-testsuite.scm 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/cgen-testsuite.scm 2016-06-30 21:26:12.597890934 +0200 @@ -0,0 +1,70 @@ +; CGEN testsuite driver. +; Copyright (C) 2009 Doug Evans +; This file is part of CGEN. +; +; This is a standalone script, we don't load anything until we parse the +; -s argument (keeps reliance off of environment variables, etc.). + +; Load the various support routines. + +(define (load-files srcdir) + (load (string-append srcdir "/read.scm")) + (load (string-append srcdir "/desc.scm")) + (load (string-append srcdir "/desc-cpu.scm")) + (load (string-append srcdir "/testsuite.scm")) +) + +(define testsuite-arguments + (list + (list "-T" "file" "generate $arch-test.h in " + #f + (lambda (arg) (file-write arg cgen-test.h))) + ) +) + +; Kept global so it's available to the other .scm files. +(define srcdir ".") + +; Scan argv for -s srcdir. +; We can't process any other args until we find the cgen source dir. +; The result is srcdir. +; We assume "-s" isn't the argument to another option. Unwise, yes. +; Alternatives are to require it to be the first argument or at least preceed +; any option with a "-s" argument, or to put knowledge of the common argument +; set and common argument parsing code in every top level file. + +(define (find-srcdir argv) + (let loop ((argv argv)) + (if (null? argv) + (error "`-s srcdir' not present, can't load cgen")) + (if (string=? "-s" (car argv)) + (begin + (if (null? (cdr argv)) + (error "missing srcdir arg to `-s'")) + (cadr argv)) + (loop (cdr argv)))) +) + +; Main routine, parses options and calls generators. + +(define (cgen-testsuite argv) + (let () + + ; Find and set srcdir, then load all Scheme code. + ; Drop the first argument, it is the script name (i.e. argv[0]). + (set! srcdir (find-srcdir (cdr argv))) + (set! %load-path (cons srcdir %load-path)) + (load-files srcdir) + + (display-argv argv) + + (cgen #:argv argv + #:app-name "testsuite" + #:arg-spec testsuite-arguments + #:init testsuite-init! + #:finish testsuite-finish! + #:analyze testsuite-analyze!) + ) +) + +(cgen-testsuite (program-arguments)) diff -Nur binutils-2.24.orig/cgen/ChangeLog binutils-2.24/cgen/ChangeLog --- binutils-2.24.orig/cgen/ChangeLog 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.24/cgen/ChangeLog 2016-06-30 21:26:12.601891090 +0200 @@ -0,0 +1,6422 @@ +2006-02-17 Shrirang Khisti + Anil Paranjape + Shilin Shakti + + * cpu/xc16x.cpu: New file containing complete CGEN specific XC16X + CPU description. + * cpu/xc16x.opc: New file containing supporting XC16C routines. + +2006-02-10 Nick Clifton + + * cpu/iq2000.opc (parse_hi16): Truncate shifted value to 16 bits. + +2005-12-28 Nathan Sidwell + + * sid-cpu.scm (-gen-hw-stream-and-destream-fns): Stringize mode + for concatenation. + (-hw-gen-write-stack-decl): Likewise. + +2005-12-05 Hans-Peter Nilsson + + * utils-sim.scm (-gen-decode-insn-entry): Correct last change for + non-(adata-integral-insn? CURRENT-ARCH) case. + +2005-10-28 Dave Brolley + + Contribute the following changes: + 2005-09-19 Dave Brolley + + * attr.scm (gen-value-for-defn-raw): New methods. + (gen-value-for-defn): Don't test for 'SID-SIMULATOR. Call + gen-value-for-defn-raw. + * sid.scm (gen-obj-attr-sid-defn): Call gen-value-for-defn-raw. + + 2002-12-13 Dave Brolley + + * utils-cgen.scm (gen-attr-type): Moved from sid.scm. + (-gen-attr-accessors): New function. + (gen-obj-attr-defn): Update terminating initializer. + (gen-obj-attr-end-defn): New function. + * sid.scm (gen-attr-type): Moved to utils-cgen.scm. + * sid-cpu.scm (cgen-desc.h): Generate code to include + "opcode/cgen-bitset.h" + * intrinsics.scm (kept-insn-isas): Correct the extraction of the isa + name. + * desc.scm ('gen-defn): Update terminating initializer. + * desc-cpu.scm (gen-ifld-decls): Call -gen-attr-accessors. Update + terminatinig initializer. + (gen-hw-decls): Ditto. + (gen-operand-decls): Ditto. + (gen-insn-decls): Ditto. + (-gen-hash-defines): Generate code to include "opcde/cgen-bitset.h" + (gen-insn-table): Update terminating initializer. + (-gen-cpu-open): Update generation of @arch@_cgen_rebuild_tables, + @arch@_cgen_cpu_open, @arch@_cgen_cpu_close. + * attr.scm (charmask-bytes): New function. + (bitset-attr->charmask): New function. + (): Handle isa-attributes specially. Also handle + differences for SID-SIMULATOR. + (): Handle differences for SID-SIMULATOR. + (): Ditto. + +2005-10-26 Kazuhiro Inaoka + + * cpu/m32r.opc (parse_hi16): Do not assume a 32-bit host word size. + +2005-10-24 DJ Delorie + + * operand.scm (-anyof-merge-syntax): Print a more useful error + message. + +2005-10-19 Nick Clifton + + * cpu/m32r.opc (parse_slo16): Fix bad application of previous + patch. + +2005-10-18 Andreas Schwab + + * cpu/m32r.opc (parse_slo16): Better version of previous patch. + +2005-10-14 Kazuhiro Inaoka + + * cpu/m32r.opc (parse_slo16): Do not assume a 32-bit host word + size. + +2005-08-02 Dave Brolley + + * rtl-c.scm (s-unop): Don't dereference + CGEN_CPU_FPU (current_cpu)->ops->xxxxx in the generated code. + (s-binop, s-convop, s-cmpop): Likewise. + +2005-07-29 Dave Brolley + + * sid-cpu.scm (-gen-scache-semantic-fn): Generate a declation of 'written' + if with-profile or with-parallel-write. + (cgen-semantics.cxx): Make the @prefix@ namespace available if with-parallel. + * operand.scm (op:new-mode): Convert (obj:name op) to a string for + string-append. + +2005-07-15 Alan Modra + + * cpu/fr30.opc (print_register_list): Correct format strings. + * cpu/ip2k.opc: Likewise. + +2005-07-05 Nick Clifton + + * cpu/iq2000.opc (parse_lo16, parse_mlo16): Make value parameter + unsigned in order to avoid compile time warnings about sign + conflicts. + +2005-07-01 Nick Clifton + + * desc-cpu.scm: Update to ISO C90 function declaration style. + * opc-asmdis.scm: Likewise. + * opc-ibld.scm: Likewise. + * opc-itab.scm: Likewise. + * cpu/fr30.opc: Likewise. + * cpu/i960.opc: Likewise. + * cpu/ip2k.opc: Likewise. + * cpu/iq2000.opc: Likewise. + * cpu/m32r.opc: Likewise. + * cpu/openrisc.opc: Likewise. + * cpu/sh.opc: Likewise. + * cpu/sparc.opc: Likewise. + * cpu/xstormy16.opc: Likewise. + +2005-06-15 Dave Brolley + + * sid-cpu.scm (-gen-hw-stream-and-destream-fns): New function. + (cgen-cpu.h): Call it. + + Contributed on behalf of Graydon Hoare + 2001-06-05 graydon hoare + + * utils.scm (foldl): Define. + (foldr): Define. + (filter): Define. + (union): Define. + (intersection): Simplify. + * sid.scm : Set APPLICATION to SID-SIMULATOR. + (-op-gen-delayed-set-maybe-trace): Define. + ( 'gen-set-{quiet,trace}): Delegate to + op-gen-delayed-set-quiet etc. Note: this is still a little tangled + up and needs cleaning. + (-with-parallel?): Hardwire with-parallel to #t. + ( 'cxmake-get): Replace with lookahead-aware code + * sid-decode.scm: Remove per-insn writeback fns. + (-gen-idesc-decls): Redefine sem_fn type. + * sid-cpu.scm (gen-write-stack-structure): Replace parexec stuff + with write stack stuff. + (cgen-write.cxx): Replace per-insn writebacks with single write + stack writeback. Add write stack reset function. + (-gen-scache-semantic-fn insn): Replace parexec stuff with write + stack stuff. + * rtl-c.scm (xop): Clone operand into delayed operand if #:delayed + estate attribute set. + (delay): Set #:delayed attribute to calculated delay, update + maximum delay of cpu, check (delay ...) usage. + * operand.scm (): Add delayed slot to . + * mach.scm (): Add max-delay slot to . + * dev.scm (load-sid): Set APPLICATION to SID-SIMULATOR. + * doc/rtl.texi (Expressions): Add section on (delay ...). + +2005-06-13 Jim Blandy + + * pmacros.scm (-pmacro-upcase, -pmacro-downcase): Handle symbols + as well as strings. + +2005-06-07 Zack Weinberg + + * doc/porting.texi: Change all mention of md_apply_fix3 and + gas_cgen_md_apply_fix3 to md_apply_fix and gas_cgen_md_apply_fix + respectively. + +2005-05-18 Dave Brolley + + * utils-sim.scm (-gen-decode-default-entry): New function. + (-gen-decode-insn-entry): Now takes 'invalid-insn' argument. Generate + code to check that all opcodes bits match. + (-gen-decoder-switch): Use -gen-decode-default-entry. + +2005-05-16 Jim Blandy + + * sid.scm (gen-ifetch): Require BITSIZE to be exactly the size + fetched by one of our GETIMEM* methods. + * utils-gen.scm (-extract-chunk-specs): Always fetch full + base-insn-sized chunks. + +2005-05-10 Nick Clifton + + * Update the address and phone number of the FSF organization in + the GPL notices in the following files: + COPYING.CGEN, utils.scm, cpu/iq2000m.cpu, cpu/openrisc.cpu, + cpu/powerpc.cpu, slib/random.scm + +2005-05-06 Jim Blandy + + * pprint.scm, cos-pprint.scm: Add documentation. + + * pprint.scm (pprint): Don't wipe out elide-table after each call. + + * pprint.scm, cos-pprint.scm: New files. + +2005-04-04 Nick Clifton + + * opcodes.scm (-gen-parse-address): Initialise value to zero to + avoid a compile time warning. + +2005-03-18 Nick Clifton + + * cpu/ip2k.opc (parse_lit8): Change wording of error message to + "percent-operand" from "%operand" as the latter confuses xgettext + into thinking that it is a C printf formating directive, which + prevents proper translation. + +2005-02-23 Nick Clifton + + * opcodes.scm (gen-parse-number): Add a cast to the desired + pointer signed'ness in order to prevent compile time warnings. + * cpu/ip2k.opc: Fixed compile time warnings about differing + signed'ness of pointers passed to functions. + * cpu/iq2000.opc: Likewise. + * cpu/m32r.opc: Likewise. + * cpu/openrisc.opc: Likewise. + * cpu/xstormy16.opc: Likewise. + +2005-02-22 Alan Modra + + * desc-cpu.scm (gen-ifld-decls): Move cgen_ifld_table from here.. + (cgen-desc.h): ..to here, after opcode/cgen.h include. + +2005-02-16 Dave Brolley + + * utils.scm: Update copyright years. + * utils-gen.scm (gen-ifld-extract): Pass base-length to -gen-ifld-extract-base. + * sid.scm (gen-ifetch): Handle the case where bitsize == 24. + * operand.scm (-derived-operand-parse): Move logit message from level 1 + to level 2. + +2005-02-15 Nick Clifton + + * opc-itab.scm (-gen-ifmt-table-1): Add an ATTRIBUTE_UNUSED to + prevent compile time warning messages. + * opc-opinst.scm (-gen-operand-instance-table): Likewise. + * utils-gen.scm (attr-int-gen-defn): Likewise. + (attr-gen-defn): Likewise. + * cpu/ip2k.opc (parse_addr16_p): Remove unused function. + (print_dollarhex16): Remove unused function. + +2005-02-15 Jim Blandy + + * guile.scm (cgen-call-with-debugging): Doc fix. + + Make backtraces work more reliably. + * guile.scm: Set up debugging parameters, and enable debugging and + source positions while loading. + (cgen-call-with-debugging, cgen-debugging-stack-start): New + functions. + * read.scm: Don't set debugging parameters here. + (catch-with-backtrace): Function deleted. + (-cgen): Simply note the presence or absence of the -b option. + Pass the flag to cgen-call-with-debugging, so debugging is turned + off here if the user didn't request it, for faster computation. + (cgen): Call cgen-debugging-stack-start here, instead of + catch-with-backtrace. + + * Makefile.am (GUILE): Explicitly load guile.scm here, and leave a + trailing -s. + (desc, html, opcodes, sim-arch, sim-cpu, gas-test, sim-test): + Don't write out the trailing -s here. + * Makefile.in: Regenerated. + * cgen-doc.scm, cgen-gas.scm, cgen-stest.scm): Don't load + fixup.scm here; let the caller decide which Scheme's customization + file to preload. + * dev.scm: Load guile.scm, not fixup.scm. + * fixup.scm: Deleted; contents have all moved to guile.scm. + * README: Doc fix. + + * guile.scm (debug-write): New function. + +2005-02-14 Jim Blandy + + * pmacros.scm (pmacros-init!): For .eval macros, use eval1 as the + transformer procedure, not eval. Transformer procedures take one + argument. + +2005-02-11 Nick Clifton + + * cpu/iq2000.opc (parse_jtargq10): Change type of valuep argument + to 'bfd_vma *' in order avoid compile time warning message. + +2005-02-09 Jim Blandy + + * cgen-sim.scm (load-files): Don't load fixup.scm. (See + corresponding change in the sim/common directory.) + +2005-02-07 Jim Blandy + + * cgen-opc.scm: Don't load fixup.scm here. (See corresponding + changes in the opcodes directory.) + + * guile.scm: New file, containing Guile-specific definitions and + adaptations. This is loaded by the app-specific shell scripts. + Initially identical to fixup.scm. + * cgen-sid.scm: Don't load fixup.scm here. + + * cos.scm: Profile elm-xset! when requested, not elm-set!; the + latter is a macro. + +2005-01-27 Jim Blandy + + * utils.scm (string/symbol->append): Renamed from 'concat'. + * opcodes.scm (gen-switch): Use new name. + * insn.scm (-sub-insn-make!): Same. + * rtl.scm (rtx-dump): Same. + * semantics.scm (semantic-compile): Same. + +2005-01-20 Jim Blandy + + * opcodes.scm (gen-switch): Use concat instead of string-map. + + * utils.scm (concat): New function. + * insn.scm (-sub-insn-make!): Use concat instead of string-map. + * rtl.scm (rtx-dump): Same. + * semantics.scm (semantic-compile): Same. + +2004-12-16 Jim Blandy + + * utils-cgen.scm (parse-name): Don't assume that string-map can be + applied to symbols. Process everything as strings, and then + convert to a symbol at the end. + + * read.scm (debug-repl): Temporarily redirect input and output to + /dev/tty while we debug, so we don't interfere with whatever CGEN + is reading or writing. + * utils.scm (setter-getter-fluid-let, with-input-and-output-to): + New functions. + +2004-11-15 Michael K. Lechner + + * cpu/iq2000.cpu: Added quotes around macro arguments so that they + will work with newer versions of guile. + +2004-10-27 Nick Clifton + + * cpu/iq2000m.cpu: Import latest version from cpu/ directory. + * cpu/iq2000.cpu: Likewise. + +2004-07-21 DJ Delorie + + * cpu/xstormy16.cpu (movhmemgr): Use hmem8, not lmem8. + +2003-03-14 Frank Ch. Eigler + + * cpu/iq2000.opc (parse_jtargq10): Add ATTRIBUTE_UNUSED on unused args. + (parse_jtargq10, iq2000_cgen_isa_register, parse_mlo16): Declare. + +2004-03-30 Kazuhiro Inaoka + + * cpu/m32r.opc (parse_hi16): Fixed shigh(0xffff8000) bug. + +2004-03-22 Dave Brolley + + * utils.scm (copyright-fsf): Update copyright years. + (copyright-red-hat): Ditto. + * sid.scm (-op-gen-set-trace): Generate trace code before semantic + code. + (-op-gen-set-trace-parallel): Ditto. + +2004-02-10 Kazuhiro Inaoka + + * cpu/m32r.opc (my_print_insn): Fixed incorrect output when + disassembling codes for 0x*2 addresses. + +2004-01-29 Dave Brolley + + * decode.scm (-opcode-slots): For short insns, generate 'opcode' with + zeroes in the extra bit positions and generate 'opcode-mask' with ones + in the extra bit positions. + +2003-12-15 Kazuhiro Inaoka + + * cpu/m32r.cpu: Add PIPE_O attribute to "pop" instruction. + +2003-12-04 Alan Modra + + * cpu/openrisc.opc (openrisc_sign_extend_16bit): Don't rely on + "short" being 16 bit. + (parse_hi16): Likewise. Fix type-punned pointer warnings too, and + internationalize error message. + (parse_lo16): Likewise. Remove useless code. + +2003-12-03 Kazuhiro Inaoka + + * cpu/m32r.cpu : Add new model m32r2. + Add new instructions. + Replace occurrances of 'Mitsubishi' with 'Renesas'. + Changed PIPE attr of push from O to OS. + Care for Little-endian of M32R. + * cpu/m32r.opc (CGEN_DIS_HASH, my_print_insn): + Care for Little-endian of M32R. + (parse_slo16): signed extension for value. + +2003-10-26 Dave Brolley + + * sid-decode.scm (-gen-record-profile-args): Test trace_counter_p + and final_insn_count_p. Don't test WITH_PROFILE_MODEL_P. + (-gen-extract-fn): Call -gen-record-profile-args. + +2003-10-21 Dave Brolley + + * sid-model.scm (-gen-model-class-decls): Generate MAX_UNITS as + a static const int. + * decode.scm (-opcode-slots): Correct typo in logit call. + +2003-10-09 Jim Blandy + + * desc-cpu.scm (gen-hw-table-decls): Emit an 'extern' declaration + for @arch@_cgen_hw_table. GDB needs to be able to find this. + + * mach.scm (def-isa-attr!): hardware can have ISA attributes, too. + +2003-10-06 Dave Brolley + + * gen-all-doc: Add fr550. + +2003-09-11 Doug Evans + + * Makefile.am (ARCHFILE): New var. + (desc): Pass $(ARCHFILE) for -a parm, not $(ARCH). + (html,opcodes,sim-arch,sim-cpu,gas-test,sim-test): Ditto. + * Makefile.in: Regenerate. + +2003-09-08 Dave Brolley + + On behalf of Doug Evans + Pass in paths to input files, instead of assuming they live in + $srcdir/cpu. Plus misc. option processing cleanup. + * cgen-doc.scm (doc-arguments): Make options strings not symbols. + Add pre-process pass to all options. + * cgen-gas.scm (gas-arguments): Ditto. + * cgen-sid.scm (sim-arguments): Ditto. + * cgen-sim.scm (sim-arguments): Ditto. + * cgen-stest.scm (stest-arguments): Ditto. + * cgen-opc.scm (opc-arguments): Ditto. New argument -OPC. + (-opc-file-path): New global. + (opc-file-path): New fn. + * opcodes.scm (read-cpu.opc): Replace srcdir,cpu args with opc-file. + All callers updated. + (gen-extra-cpu.h,gen-extra-cpu.c,gen-extra-opc.h,gen-extra-opc.c, + gen-extra-asm.c,gen-extra-dis.c,gen-extra-ibld.h,gen-extra-ibld.c): + Replace srcdir arg with opc-file. All callers updated. + * read.scm (-opt-spec-update): Delete. + (opt-get-first-pass,opt-get-second-pass): New fns. + (-cgen): Process application-specific arguments in two passes. + +2003-08-29 Dave Brolley + + * cpu/frv.cpu: Removed. + * cpu/frv.opc: Removed. + +2003-08-21 Nick Clifton + + * cpu/frv.cpu (mbtoh): Replace input parameter to + u-media-dual-expand and u-media-dual-btoh with output parameter. + (cmbtoh): Add profiling hack. + +2003-08-19 Michael Snyder + + * cpu/frv.cpu: Fix typo, Frintkeven -> FRintkeven + +2003-08-07 Michael Meissner + + * opc-opinst.scm (-gen-operand-instance-table): Initialize all of + the elements for the END record of CGEN_OPINST, silencing warnings. + +2003-07-15 Doug Evans + + Add guile 1.6.4 support. + - empty list must be quoted + - string functions have stricter type checking + - eval now takes a second argument + - symbol-bound? is deprecated + * attr.scm (-attr-parse): Use stringsym-append to build errtxt. + (bitset-attr->list): Ensure arg to string-cut is a string. + (attr-parse): Ensure args to string-ref and string-drop1 are strings. + (,gen-value-for-defn): Fetch string name of self. + * cos.scm (-class-list): Must quote empty list. + (-class-parent-classes,-class-compute-class-desc): Ditto. + (class-make,make,object-reset!): Ditto. + (method-make-make!): Call eval1 instead of eval. + (method-make-forward!,method-make-virtual-forward!): Ditto. + * decode.scm (subdtable-add): Use stringsym-append instead of + string-append. + (-gen-exprtable-name): Fetch string name of exprtable-entry-insn. + (-build-decode-table-entry): Fetch string name of insn. + * desc-cpu.scm (-gen-isa-table-defns): Fetch string name of isa. + (-gen-mach-table-defns): Ditto for mach. + (gen-ifld-defns): Ditto for ifld. + (gen-hw-table-defns): Ditto for hw. + (gen-operand-table): Ditto for op. + (gen-insn-table-entry): Ditto for insn. + * desc.scm (gen-attr-table-defn): Ditto for attr. + (,gen-defn): Don't pass symbols to string-append. + * enum.scm (parse-enum-vals): Use symbolstr-append instead of + symbol-append. + (enum-vals-upcase): Use symbol-upcase to build result. + (-enum-parse): Use stringsym-append to build errtxt. + * fixup.scm (*guile-major-version*,*guile-minor-version*): New globals. + (eval1): New function. + (symbol-bound?): Provide own version if >= guile 1.6. + * hardware.scm (define-keyword): Use string-append instead of + symbol-append. + * html.scm (gen-html-header,gen-table-of-contents,gen-arch-intro, + cgen.html,cgen-insn.html): Convert current-arch-name to a string + before using. + (gen-list-entry): Handle either symbol or string `name' arg. + (gen-obj-doc-header): Fetch string name of `o' arg. + (define-cpu-intro): Ditto for cpu. + (gen-mach-intro): Ditto for mach. + (gen-model-intro): Ditto for model. + (gen-isa-intro): Ditto for isa. + (gen-machine-doc-1): Ditto for isa. + (gen-reg-doc-1): Convert mach to string first. + (gen-insn-doc-1): Ditto. Convert model/unit names to strings first. + (gen-insn-doc-list): Fetch string name of mach. Convert insn name + to string first. + (gen-insn-categories): Fetch string name of mach. Convert + enum-val-name to string first. + (gen-insn-docs): Fetch string name of mach. + * ifield.scm (ifld-ilk): Result is a string. + * iformat.scm (-ifmt-search-key): Convert attr value to string first. + Fetch string name of ifld. + (-sfmt-search-key): Similarily for ifld and op. + * insn.scm (syntax-make): Fetch string name of syntax element. + * mach.scm (-cpu-parse): Use stringsym-append to build errtxt. + * minsn.scm (minsn-make-alias): Fetch string name of minsn. + * mode.scm (mode:c-type): Result is a string. + (mode:enum): Fetch string name of mode. + (-mode-parse): Use stringsym-append to build errtxt. + * model.scm (model:enum): Fetch string name of model. + (-model-parse): Use stringsym-append to build errtxt. + (parse-insn-timing): Must quote empty list. + * opc-itab.scm (-gen-minsn-table-entry): Fetch string name of minsn. + (-gen-minsn-opcode-entry): Ditto. + * opcodes.scm (,gen-function-name): `what' arg is a symbol, + convert to string. + (read-cpu.opc): Convert current-arch-name to a string before using. + * operand.scm (,gen-pretty-name): Ensure `name' is a string. + (): Must quote empty list. + (op-sort): Simplify, call alpha-sort-obj-list to do sort. + * pgmr-tools.scm (pgmr-pretty-print-insn-value): Fetch string name + of ifld. + * pmacros.scm (-pmacro-build-lambda): Use eval1 instead of eval. + (-pmacro-sym): Must convert symbols to strings before passing to + string-append. + (-pmacro-str): Ditto. + (pmacros-init!): Use eval1 instead of eval. + * read.scm (keep-mach-atlist?): Simplify, use bitset-attr->list. + (keep-isa-atlist?): Ditto. + (cmd-if): Use eval1 instead of eval. + * rtl-c.scm (,get-name): Fetch string name of self. + (-rtl-c-get): Fetch string name of src. + (s-unop): Ditto for mode. + (s-binop,s-binop-with-bit,s-shop,s-convop,s-cmpop): Ditto. + (-gen-par-temp-defns,subword): Ditto. + (join): Use stringsym-append instead of string-append. + * rtl-traverse.scm (rtx-option?): Convert option to string first. + (rtx-traverse-debug): Fetch string name of rtx-obj. + * rtl.scm (def-rtx-node): Use eval1 instead of eval. + (def-rtx-syntax-node,def-rtx-operand-node,def-rtx-macro-node): Ditto. + (rtx-pretty-name): Result is a string. + (-rtx-hw-name): Use symbolstr-append instead of symbol-append. + * semantics.scm (semantic-compile): Simplify, use alpha-sort-obj-list. + * sid-cpu.scm (cgen-write.cxx): Convert current-arch-name to a string + before using. + (-gen-sfrag-case): Fetch string name of user. + * sid-model.scm (unit:enum): Fetch string name of unit. + * sid.scm (,cxmake-get): Fetch string name of mode. + (,gen-set-quiet): Ditto. + (gen-mode-defs): Ditto. + (sim-finish!): Convert current-arch-name to a string before using. + * sim-cpu.scm (-gen-scache-semantic-fn): Fetch string name of insn. + (-gen-no-scache-semantic-fn): Ditto. + (cgen-defs.h): Fetch string name of isa. + (cgen-read.c): Convert current-arch-name to a string before using. + (cgen-write.c): Ditto. + * sim-model.scm (unit:enum): Fetch string name of unit. + (gen-model-fn-decls): Use stringsym-append instead of string-append. + (-gen-model-timing-table): Fetch string name of model. + (-gen-mach-model-table): Ditto. + (-gen-mach-defns): Fetch string name of mach. + * sim.scm (gen-reg-access-defn): Fetch string name of hw. + (,cxmake-get): Fetch string name of mode. + (,gen-set-quiet): Ditto. + (gen-mode-defs): Ditto. + (sim-finish!): Must quote empty list. + * utils-cgen.scm (): Must quote empty list. + (obj:str-name): New fn. + (parse-comment): Result is a string. + (parse-symbol): Result is a symbol. + (parse-string): Result is a string. + (keyword-list?): Convert arg to string before calling string-ref. + (keyword-list->arg-list): Ditto. + (gen-attr-name): Convert attr-name to string first. + (alpha-sort-obj-list): Use symbolstring,->symbol): New fns. + (reduce): Call eval1 instead of eval. + * cpu/m32r.cpu (addi): Don't use `#.'. + + * gen-all-sim: Fix some typos. + +2003-07-08 Doug Evans + + * gen-all-doc: Ensure run from cgen src dir. + * gen-all-opcodes: Build in ./tmp-opcodes. Don't delete dir when done. + * gen-all-sid: Similarily, in ./tmp-sid. + * gen-all-sim: Similarily, in ./tmp-sim. + +2003-06-20 Doug Evans + + * gen-all-sim: Add fr30,sh64 support. Only generate m32r by default. + +2003-06-19 Doug Evans + + * mach.scm (-ifld-already-defined?): New proc. + (current-ifld-add!): Use it. + (-op-already-defined?): New proc. + (current-op-add!): Use it. + (-insn-already-defined?): New proc. + (current-insn-add!): Use it. + (-minsn-already-defined?): New proc. + (current-minsn-add!): Use it. + (obj-isa-list): New proc. + (isa-supports?): Use it. + +2003-06-10 Doug Evans + + * insn.scm (insn-builtin!): RELAX renamed to RELAXABLE. + * cpu/m32r.cpu (all insns): Ditto. + + * mach.scm (current-*-add!): Disallow redefinition. Make result + "unspecified". + + * gen-all-doc: Split arm and frv docs up a bit. + + * cpu/arm.cpu: Add IDOC attribute. + * cpu/frv.cpu: Ditto. + * cpu/i960.cpu: Ditto. + * cpu/openrisc.cpu: Ditto. + * cpu/xstormy16.cpu: Ditto. + * cpu/m32r.cpu: Ditto. + (all insns): Explicitly specify IDOC attribute. + + * Makefile.am (MACH,ISAS,INSN_FILE_NAME): New vars. + (desc,opcodes,sim-arch,sim-cpu,gas-test,sim-test): Use MACH,ISAS. + (html): Use MACH,ISAS,INSN_FILE_NAME. Generate insn.html separately. + * Makefile.in: Regenerate. + * attr.scm (:parse-value-def): Implement. + (-attr-read): Defer computing default value until we know the type. + (attr-has-attr?): Delete, move contents to :has-attr?. + (:attr-present?): New method. + (atlist-attr-present?,obj-attr-present?): New fns. + (obj-has-attr-value?,obj-has-attr-value-no-default?): New fns. + (attr-builtin!): New insn attr IDOC. + * cgen-doc.scm (doc-arguments): New args -I,-N. + * enum.scm (parse-enum-vals): New arg errtxt, all callers updated. + Support comment as fourth element of enum value. + (enum-val-name,enum-val-value,enum-val-attrs,enum-val-comment): New fns. + * html.scm (gen-html-header): New arg kind, all callers updated. + (gen-table-of-contents): New arg insn-file, all callers updated. + (gen-list-entry,gen-doc-header): New fn. + (get-operands): Delete. + (gen-iformat-table): Rewrite. + (gen-insn-doc-1): Print constant-folded and trimmed semantics. + (gen-insn-doc-list): New args name, comment, insns. All callers updated. + (get-insn-properties,guess-insn-idoc-attr!): New fn. + (insn-sets-pc?,insn-refs-mem?,insn-uses-fpu?): New fns. + (get-insns-for-category,gen-categories-insn-lists): New fns. + (gen-insn-docs): Simplify each insn's semantics first. + Print insn tables sorted by IDOC categories. + (*insn-html-file-name*): New global. + (cgen-insn.html): New fn. + (cgen-all): Update. + * insn.scm (): Create a setter for the `tmp' member. + * semantics.scm (insn-build-known-values): Renamed from + -build-known-values. All callers updated. + + * rtl.scm: Move traveral/evaluation support to ... + * rtl-traverse.scm: New file. + * read.scm: Maybe-load rtl-traverse.scm. + + * rtl.scm (-rtx-valid-types): Add SETRTX. + + * rtx-funcs.scm (nop,parallel): Fix mode. + + * utils.scm (eqv-lookup-index): New fn. + (assq-lookup-index): Renamed from lookup-index. All callers updated. + + * dev.scm (load-doc): Set APPLICATION. + +2003-06-10 Dave Brolley + + * sid-cpu.scm: Generate #include of config.h into @prefix@-sem.cxx. + * sid-decode.scm: Generate #include of config.h into + @prefix@-decode.cxx. + * sid-model.scm: Generate #include of config.h into @prefix@-model.cxx. + +2003-06-07 Doug Evans + + * gen-all-sid: New file. + * gen-all-opcodes: New file. + +2003-06-05 Nick Clifton + + * cpu/frv.cpu (FRintieven): New operand. An even-numbered only + version of the FRinti operand. + (FRintjeven): Likewise for FRintj. + (FRintkeven): Likewise for FRintk. + (mdcutssi, media-dual-word-rotate-r-r, mqsaths, + media-quad-arith-sat-semantics, media-quad-arith-sat, + conditional-media-quad-arith-sat, mdunpackh, + media-quad-multiply-semantics, media-quad-multiply, + conditional-media-quad-multiply, media-quad-complex-i, + media-quad-multiply-acc-semantics, media-quad-multiply-acc, + conditional-media-quad-multiply-acc, munpackh, + media-quad-multiply-cross-acc-semantics, mdpackh, + media-quad-multiply-cross-acc, mbtoh-semantics, + media-quad-cross-multiply-cross-acc-semantics, + media-quad-cross-multiply-cross-acc, mbtoh, mhtob-semantics, + media-quad-cross-multiply-acc-semantics, cmbtoh, + media-quad-cross-multiply-acc, media-quad-complex, mhtob, + media-expand-halfword-to-double-semantics, mexpdhd, cmexpdhd, + cmhtob): Use new operands. + * cpu/frv.opc (CGEN_VERBOSE_ASSEMBLER_ERRORS): Define. + (parse_even_register): New function. + +2003-06-04 Doug Evans + + Better handling of 64 bit and mixed 32/64 bit architectures. + * hardware.scm (hw-update-word-modes!): New fn. + * mach.scm (define-cpu)): Call mode-set-word-modes!, + hw-update-word-modes!. + (state-word-bitsize): Replace FIXME with requested check. + (arch-analyze-insns!): Call mode-ensure-word-sizes-defined. + * mode.scm (mode-find): Ignore INT,UINT. + (-mode-word-sizes-kind): New global. + (mode-set-word-modes!,mode-set-identical-word-bitsizes!, + mode-set-biggest-word-bitsizes!,mode-ensure-word-sizes-defined): New fns. + (mode-init!): Initialize -mode-word-sizes-kind. Move initialization + of mode-list to ... + (mode-builtin!): ... here. Initialize WI/UWI/AI/IAI to something + unusable, correct values set later. + (mode-finish!): Remove cruft. + * html.scm (doc-init!): Call mode-set-biggest-word-bitsizes!. + * opcodes.scm (opcodes-init!): Ditto. + * rtx-funcs.scm (annul): Fix mode of pc. + * cpu/ia64.cpu: Remove cruft that sets word modes. + * cpu/xstormy16.cpu (define-cpu): Set word-bitsize. + +2003-06-03 Nick Clifton + + * cpu/frv.cpu (media-dual-word-rotate-r-r): Use a signed 6-bit + immediate value not unsigned. + +2003-05-21 J"orn Rennecke + + * cpu/sh.cpu: Amend comments to refer to SuperH. + * cpu/sh64-compact.cpu: Change comment to refer to SuperH. + * cpu/sh64-media.cpu: Likewise. + (Saturation): Update manual reference. + +2003-05-15 Doug Evans + + * Makefile.am (srcroot): New var. + (html): New rule. + * Makefile.in: Regenerate. + * cgen-doc.scm: New file. + * html.scm: New file. + * gen-all-doc: New file. + * dev.scm (cload): Handle DOC application. + (load-doc): New fn. + * machs.scm (machs-for-cpu): New fn. + * model.scm (models-for-cpu): New fn. + * utils.scm (gen-c-copyright): Renamed from gen-copyright. + All uses updated. + (iota): Rewrite to be identical to pmacro version. All uses updated. + * utils-cgen.scm (alpha-sort-obj-list): New fn. + + * utils-sim.scm (-gen-decoder-switch): Back out patch of 2003-01-09. + (-gen-decode-bits): Instead put in better fix here. + + * cpu/i960.cpu (index): Rename to indx. All uses updated. + +2003-05-01 DJ Delorie + + * cpu/xstormy16.cpu (alignfix-mem): Correct logic for unaligned + word accesses. + (set-alignfix-mem): Likewise. + +2003-04-16 Dave Brolley + + * doc/rtl.texi (Iiming): Correct example to use 'model-name'. + * utils.scm (copyright-fsf): Update generate copyright years. + (copyright-cygnus): Ditto. + * sid.scm (-op-gen-set-trace): Generate code to fill in bitmask of modified + operands. + (-gen-arch-model-decls): Don't generate unit enum declaration or MAX_UNITS + here. + ('gen-profile-code): New parameter 'when'. + ('gen-profile-code): Ditto. + ('gen-profile-code): Ditto. + ('gen-profile-code): Ditto. Only generate 'referenced' and + 'insn_reference' for the 'after' function. + * model.scm (unit:enum): Moved to sim-model.scm. + * sim-model.scm (unit:enum): Moved from model.scm. + * sid-decode.scm (-gen-scache-decls): Generate the 'written' field. + * cgen-sid.scm (sim-arguments): Document the generation of model.h. + * sid-model.scm (unit:enum): New version for sid. + (gen-model-class-name): New function. + (gen-model-unit-fn-decl): New function. + (gen-model-fn-decls): Call gen-model-unit-fn-decl. + (gen-model-unit-fn-name): New parameter 'when'. + (-gen-model-insn-fn-name): Ditto. + (-gen-model-insn-qualified-fn-name): New function. + (-gen-model-insn-fn-decl): New function. + (-gen-model-insn-fn-decls): New function. + (-gen-model-insn-fn): New parameter 'when'. Call + -gen-model-insn-qualified-fn-name. + (-gen-model-insn-fns): Generate the constructor for the model. Generate + functions for modelling insn before and after execution. + (-gen-model-class-decls): New function. + (" (gen-model-class-name model) "): New function. + (gen-model-classes): New function. + (-gen-insn-timing): Generate functions for modelling insn before and after + execution. + (-gen-insn-unit-timing): Generate class-qualified names. + (-gen-model-timing-table): Ditto. + (cgen-model.cxx): Generate #include for @cpu@.h. Omit generation of code + not needed (yet) by sid. + (cgen-model.h): New function. + +2003-04-15 Rohit Kumar Srivastava + + * cpu/sh.cpu: Replace occurrances of 'Hitachi' with 'Renesas'. + * cpu/sh64-compact.cpu: Likewise. + * cpu/sh64-media.cpu: Likewise. + +2003-03-21 DJ Delorie + + * cpu/xstormy16.cpu (basic-psw): New argument ws (wordsize), + which indicates if the sign flag is set from bit 15 or 7. + Adjust all callers. + (set-psw): New argument ws, propogate it. + (set-psw-nowrite): Likewise. + (set-mem-psw): Likewise. + (set-psw-carry): Likewise. Use temporaries to prevent + prematurely overwriting needed inputs. + (set-psw-rrotate17): Fix logic. + (shrgrgr): Preserve carry for zero-bit shifts. + (shrgrimm): Likewise. + (shlgrgr): Likewise. + (shlgrimm): Likewise. + (asrgrgr): Likewise. + (asrgrimm): Likewise. + (reset): New. + +2003-03-12 Frank Ch. Eigler + + * sid.scm: Set APPLICATION to SID-SIMULATOR. + +2002-03-05 DJ Delorie + + * cpu/xstormy16.cpu (set-psw-add): Use temporaries to prevent + prematurely overwriting needed inputs. + (set-psw-sub): Likewise. + +Fri Feb 21 19:48:19 2003 J"orn Rennecke + + * cpu/sh64-media.cpu (make-mextr): Fix setting of count. + +2003-02-18 DJ Delorie + + * xstormy16.cpu (set-mem-alignfix-psw): Remove. + (movlmemimm): Just mask the address. + (movhmemimm): Likewise. + (movlmemgr): Likewise. + (movhmemgr): Likewise. + (set-psw): Always set the psw last. + (set-psw-carry): Likewise. + (set-psw-add): Likewise. + (set-psw-sub): Likewise. + + * xstormy16.cpu (set-psw-rrotate17): New. Choose the correct set + of 16 patterns from the set-psw-rotate17 function. + (movgrigr, movgripostincgr, movgripredecgr, movgriigr, + movgriipostincgr, movgriipredecgr): Set psw correctly. + (movfgrigr, movfgripostincgr, movfgripredecgr, movfgriigr, + movfgriipostincgr, movfgriipredecgr): Fix semantics. + (rrcgrgr, rrcgrimm4): Use new set-psw-rrotate17 function. + +2003-02-11 Dave Brolley + + * desc-cpu.scm (gen-ifld-defns): Add all ifields to the + @arch@_cgen-ifld_table. + (gen-maybe-multi-ifld): Use the ifield enumerators to index the + @arch@_cgen-ifld_table. + +2003-02-03 Frank Ch. Eigler + + * sid-cpu.scm (-gen-sfrag-engine-fn): Generate more hygienic C++. + +2003-01-09 Graydon Hoare + + * utils-sim.scm (-gen-decoder-switch): Fix edge condition for + empty ISAs. + +2003-01-07 Graydon Hoare + + * utils-gen.scm (attr-int-gen-defn): Define. + +2002-12-21 Doug Evans + + * ifield.scm (-ifield-parse): Rewrite computation. + (-get-ifld-word-offset,-get-ifld-word-length): New fns. + + * dev.scm (cload): Update location of .cpu files. + +2002-12-19 Doug Evans + + * utils-sim.scm (gen-profile-sym): New fn. + (,sbuf-profile-sym): New method. + (,sbuf-profile-elm): Use it. + * sim.scm (,gen-record-profile): Use sbuf-profile-sym instead + of hardcoding symbol name. + (,gen-profile-code): Ditto. + (,gen-profile-code): Use gen-profile-sym instead of hardcoding + symbol name. + + * mode.scm (mode-sem-mode): New fn. + * operand.scm (op:new-mode): Update. mode-name. + (op-natural-mode?) New fn. + * rtl.scm (hw): Set hw-name,mode-name. + + Back out sim*.scm changes of 2001-04-02 Ben Elliston + Instead do: + * sim-decode.scm (-gen-decode-insn-globals): Use @PREFIX@_INSN__MAX + as size of IDESC-TABLE-VAR. + (@prefix@_init_idesc_table): Ditto. + * sim-model.scm (-gen-mach-defns): Ditto. + * sim.scm (gen-cpu-insn-enum-decl): Rename last elm from max to -max. + + * utils-sim.scm (-gen-decode-insn-entry): Fix some spacing in output. + + * insn.scm (-parse-insn-format-symbol): Improve error message. + (-parse-insn-format): Ditto. + + * gen-all-sim: New script. + +2002-12-16 DJ Delorie + + * cpu/xstormy16.opc (parse_immediate16): Add prototype. + +2002-12-16 Andrew MacLeod + + * cpu/xstormy16.cpu (imm16): Call handler immediate16. + * cpu/xstormy16.opc (parse_small_immediate): Return on '@'. + (parse_immediate16): Handle immediate16 values, which now include + @hi(label) and @lo(label) + +2002-12-03 Alan Modra + + * desc-cpu.scm (gen-maybe-multi-ifld): Remove superfluous parens. + Add braces and cast for union field. + (gen-multi-ifield-nodes): Add braces and cast for union field. + (cgen_operand_table): Similarly fix sentinel. + (cgen_cpu_close): Constify "insns". Formatting. + (cgen-desc.c): Include xregex.h. + * cpu/ip2k.opc (ip2k_cgen_insn_supported): Move to opc.c section. + Prototype. + : Include safe-ctype.h. + (ip2k_asm_hash): Use ISSPACE and TOLOWER. + (PARSE_FUNC_DECL): Declare. Use to prototype parse_fr, parse_addr16, + parse_addr16_p, parse_addr16_cjp, parse_lit8 and parse_bit3. + (parse_fr): Constify "old_strp". Correct type of "tempvalue". + Don't test it for >= 0. Use ISSPACE rather than isspace. Formatting. + (parse_addr16): Correct type of "value". Formatting. + (parse_addr16_p): Likewise. + (parse_addr16_cjp): Likewise. + (parse_lit8): Likewise. + (parse_bit3): Formatting. + (PRINT_FUNC_DECL): Define. Use to prototype print_fr, print_dollarhex, + print_dollarhex8, print_dollarhex16, print_dollarhex_addr16h, + print_dollarhex_addr16l, print_dollarhex_p, print_dollarhex_cj and + print_decimal. + (print_fr): Add ATTRIBUTE_UNUSED on unused args. Formatting. + (print_dollarhex): Add ATTRIBUTE_UNUSED on unused args. + (print_dollarhex8): Likewise. + (print_dollarhex16): Likewise. + (print_dollarhex_addr16h): Likewise. + (print_dollarhex_addr16l): Likewise. + (print_dollarhex_p): Likewise. + (print_dollarhex_cj): Likewise. + (print_decimal): Likewise. + * cpu/xstormy16.opc (parse_mem8): Use ISALNUM rather than isalnum. + +2002-11-30 Hans-Peter Nilsson + + * doc/rtl.texi (Model variants): Mention current limitations for + unit inputs and outputs. + (Hardware elements) : Be slightly more + verbose. + (Instructions) : input/output overrides have a direction + operand. + +2002-11-25 DJ Delorie + + * xstormy16.cpu (sdiv, divlh, sdivlh): Fix sdivlh/divlh encodings. + +2002-11-21 Jeff Johnston + + * cpu/iq10.cpu: New file. + * cpu/iq2000.cpu: Likewise. + * cpu/iq2000.opc: Likewise. + * cpu/iq2000m.cpu: Likewise. + +2002-11-19 DJ Delorie + + * cpu/xstormy16.cpu (sdiv, divlh, sdivlh): New. + +2002-11-05 Frank Ch. Eigler + + * dev.scm: Call getenv with a string, not a symbol. + +2002-10-08 Doug Evans + Hans-Peter Nilsson + + * types.scm (bitrange-overlap?): Handle lsb0?. + +2002-09-07 Frank Ch. Eigler + + From Robert Cragie : + * cpu/arm7.cpu (ldm*-sw*, stm*-sw*): New instructions. + +2002-07-17 Frank Ch. Eigler + Ben Elliston + John Healy + Jeff Johnston + Alan Lehotsky + Ubicom Inc. + + * cpu/ip2k.cpu: New file. + * cpu/ip2k.opc: Likewise. + +2002-07-01 Hans-Peter Nilsson + + * utils-gen.scm (-gen-extract-word): Handle lsb0?. + +2002-06-25 J"orn Rennecke + + * cpu/sh64-compact.cpu (movw5): Use Correct operand field for reg. + * cpu/sh64-media.cpu (-ldhi-byte, -ldhi-word, -ldhi-long): New macros. + (-ldlo-byte, -ldlo-word, -ldlo-long): Likewise. + (-sthi-word, -sthi-long -stlo-byte, -stlo-word, -stlo-long): Likewise. + (ldhil, ldhiq, ldlol, ldloq, stlol, stloq): Implement. + (mshfhib, mshfhil, mshfhiw, mshflob, mshflol, mshflow): Fix indices. + (-sthi-byte): If there is a single byte to store, store it at + proper address. + (sthil, sthiq): Fix big-endian behaviour. + (mcnvslw, mcnvswb, mcnvswub, mmacfxwl, mmacnfx.wl): Fix indices. + (mmulfxl, mmulfxw, mmulfxrpw, mmulhiwl, mmullowl): Likewise. + (saturate): Use Dimode to check if saturation operation is required. + (usaturate): Likewise. + (mpermw): Fix mask. + (-maddsl, -maddsub): Compute to-be-saturated value in wider mode. + (-maddsw, mmacfxwl, mmacnfx.wl, -mshaldsl, -mshaldsw): Likewise. + (-mshardl, -mshardw, -msubsl, -msubsub, -msubsw): Likewise. + (msadubq): Fix subword index in second operand of first subtraction. + +2002-06-20 Hans-Peter Nilsson + + * sim-cpu.scm (gen-semantic-code): Prepend with setup-semantics + code. + +2002-06-18 Dave Brolley + + * cpu/frv.cpu: New cpu description. + * cpu/frv.opc: New cpu support code. + +2002-05-21 Dave Brolley + + * decode.scm (-opcode-slots): Don't consider bits beyond the + length of the insn. + +2002-05-17 Johan Rydberg + + * cpu/powerpc.cpu: New file. + +2002-05-01 Graydon Hoare + + * desc-cpu.scm (@arch@_cgen_cpu_close): Fix memory leaks. + +2002-03-20 Hans-Peter Nilsson + + * doc/pmacros.texi (Symbol concatenation): Mention that .sym + results are expanded recursively. + +2002-03-19 Hans-Peter Nilsson + + * pmacros.scm (-pmacro-expand,scan): If result is a symbol, + call scan-symbol on it, to enable recursive macro-expansion. + +2002-01-25 Frank Ch. Eigler + + * sid-cpu.scm (-gen-hardware-types): Generate single hardware union + for multiple-isa configurations. + * sid-decode.scm (-gen-decode-fn): Tolerate empty insn list. + +2002-02-04 Ben Elliston + + * cpu/sh.cpu, cpu/sh.opc: New files. + * cpu/sh64-comact.cpu, cpu/sh64-media.cpu: Likewise. + +2002-01-29 Hans-Peter Nilsson + + * doc/rtl.texi: Fix typo: define-attr, not define-attribute. + (Enumerated constants): Mention that an ifield must not specify a + multi-ifield. + (Instruction operands): Ditto for index. + (Expressions) : Remove misplaced mention of local + variables. + : Mention that mode must be specified and non-VOID when the + result is used. + +2002-01-28 Hans-Peter Nilsson + + * doc/porting.texi: When referring to *.opc, mention they are in + the cpu subdir. Call top-level directory toplevel, not devo. + Close string in define-normal-insn example. + + * doc/pmacros.texi: Fix .substr typo to .substring. + Mention that .sym expansions are not further expanded. + +2002-01-22 Graydon Hoare + + * desc-cpu.scm (ifld-number-cache): Add. + (ifld-number): Add. + (gen-maybe-multi-ifld-of-op): Add. + (gen-maybe-multi-ifld): Add. + (gen-multi-ifield-nodes): Add. + (cgen-desc.c): Add call to gen-multi-ifield-nodes. + +2002-01-10 matthew green + + * cpu/xstormy16.cpu (gr-Rbj-names): Rename this ... + (gr-Rb-names): ... to this. + (h-Rb): New hardware piece. + (h-Rbj): Use gr-Rb-names. + (Rb): Use h-Rb. + (holdx): New instruction. + +2002-01-07 Ben Elliston + + * utils.scm (package-cygnus-simulators): Rename from this .. + (package-red-hat-simulators): .. to this. + * opcodes.scm (option-set!): Use package-red-hat-simulators. + * sid-cpu.scm (cgen-desc.h): Likewise. + (cgen-cpu.h): Likewise. + (cgen-defs.h): Likewise. + (cgen-write.cxx): Likewise. + (cgen-semantics.cxx): Likewise. + (cgen-sem-switch.cxx): Likewise. + * sid-decode.scm (cgen-decode.h): Likewise. + (cgen-decode.cxx): Likewise. + * sid-model.scm (cgen-model.cxx): Likewise. + * sid.scm (option-set!): Likewise. + * sim.scm (option-set!): Likewise. + +2002-01-07 Ben Elliston + + * utils.scm (copyright-fsf): Add 2002. + (copyright-cygnus): Rename to copyright-red-hat. + (copyright-red-hat): Add 2002. + (CURRENT-COPYRIGHT): Update comment. + * opcodes.scm (option-set!): Update callers. + * sid-model.scm (cgen-model.cxx): Likewise. + * sid-cpu.scm: Likewise. + * sid-decode.scm: Likewise. + * sid.scm (option-set!): Handle "redhat" as an option for + "copyright"; use copyright-red-hat. + * sim.scm (option-set!): Likewise. + +2002-01-03 Dave Brolley + + * decode.scm (-distinguishing-bit-population): Compute num-insns, the + number of insns in the list. Update the population count function to + identify and prioritize 3 catgories of useful bits. + (-population-top-few): Don't consider bits with a population count of + zero. + (-build-decode-table-entry): Don't call + filter-harmlessly-ambiguous-insns. Filter out non-specialized and + identical insns at the next tree level. + * insn.scm (filter-harmlessly-ambiguous-insns): Note in a comment that + this function is no longer used. + (filter-non-specialized-ambiguous-insns): New function. + (filter-identical-ambiguous-insns): New function. + (find-identical-insn): New function. + (filter-harmlessly-ambiguous-insns): Removed. + +2001-11-26 Geoffrey Keating + matthew green + Frank Ch. Eigler + Nick Clifton + + * cpu/xstormy16.cpu: New file. + * cpu/xstormy16.opc: New file. + +2001-11-26 Frank Ch. Eigler + + * doc/sim.texi, rtl.texi, porting.texi: Correct texinfo markup typos. + +2001-11-14 Dave Brolley + + * utils-gen.scm (-gen-extract-word): Correct computation of the length + of the field being extracted. + +2001-10-29 Johan Rydberg + + * doc/rtl.texi (Expressions): Document the (error ..), (sqrt ..), + (cos ...) and (sin ..) rtx. + +2001-10-13 Nick Clifton + + * desc-cpu.scm: Do not include ctype.h in generated desc + files. They will inherit safe-ctype.h instead. + +2001-10-08 Nick Clifton + + * desc-cpu.scm: Add missing function prototypes (for generated + C files). Fix compile time warning messages about unused + parameters (for generated C files). + * opc-asmdis.scm: The same. + * opc-ibld.c: The same. + * opc-itab.scm: The same. + * cpu/fr30.opc: The same. + * cpu/m32r.opc: The same. + * cpu/openrisc.opc: The same. + +2001-09-17 graydon hoare + + * insn.scm (syntax-break-out): Correct logic in handling escaped + syntax characters. + +2001-07-12 Jeff Johnston + + * opc-itab.scm (@arch@_cgen_init_opcode_table): Unconditionally + call @arch@_cgen_build_insn_regex now that regex support is in + libiberty. + +2001-07-12 Frank Ch. Eigler + + * insn.scm (filter-harmlessly-ambiguous-insns): Fix msg typo. + (mask-superset?): Look for strict supersets to allow rejection of + duplicate insns. + +2001-07-11 Frank Ch. Eigler + + * sid-cpu.scm (-gen-mach-params): New proc to emit ...CHUNK_BITSIZE... + (cgen-desc.h): Call it. + * sid-decode.scm (-gen-decode-fn): Use base-insn-bitsize as + decode-size. + * utils-sim.scm (-gen-decode-insn-entry): For SID only, prepare + entire_insn for extraction, if it's shorter than base-insn-bitsize. + +2001-07-11 Frank Ch. Eigler + + * desc-cpu.scm (-gen-mach-table-defns): Emit fourth field: the + mach->cpu insn-chunk-bitsize. + (-gen-cpu-open): In @arch@_cgen_rebuild_tables, process above new + field toward CGEN_CPU_TABLE->insn_chunk_bitsize. + * mach.scm (): New field insn-chunk-bitsize. + (-cpu-parse, -cpu-read): Parse/initialize it. + * doc/rtl.texi (define-cpu): Document it. + +2001-07-09 Geoffrey Keating + + * ifield.scm ( 'field-start): Don't look at word-len. + +2001-07-06 Ben Elliston + + * opcodes.scm (read-cpu.opc): Read .opc files from subdir/cpu. + +2001-07-05 Ben Elliston + + * README: Update. + + * read.scm (include): Include files from srcdir/cpu. + (-cgen): Likewise for loading .cpu files. + * sid.scm (sim-finish!): Read .sim files from srcdir/cpu. + * *.cpu: Move all cpu descriptions into cpu subdirectory. + * *.opc: Likewise. + * simplify.inc: Likewise. + +2001-07-04 Ben Elliston + + * read.scm (include): Log "Including file" message at level 1, + rather than outputting it with (display). + (cpu-load): Log "Loading cpu description" and "Processing cpu + description" messages at levels 1 and 2, respectively, rather than + using (display). + +2001-06-14 Geoffrey Keating + + * desc.scm ( 'gen-defn): Add extra zero into + CGEN_KEYWORD_ENTRY initializers. + + * gas-test.scm (gen-gas-test): Create 8 testcases, not just 5. + ( 'test-data): Involve both the index and the hardware + in testcase generation. + ( 'test-data): Generate test data from the underlying + object. + ( 'test-data): Generate test data by computing bit + patterns for the field, then decoding them. + ( 'test-data): Allow for new calling convention. + ( 'test-data): Likewise. + ( 'test-data): Convert index values into keywords. + ( 'test-data): Convert index values into integer strings. + + * gas-test.scm (cgen-build.sh): Escape '.' as well. + +2001-06-01 Frank Ch. Eigler + + * rtl.scm (hw): Encode hw access mode into name, since this + is required for multi-mode hw types (memory). + +2001-05-11 Ben Elliston + + * gas-test.scm (cgen-build.sh, gentest): Escape $ with a backslash + when generating allinsn.d from objdump output. Without it, the + testsuite will treat $ as the regular expression for end of line. + +2001-05-09 Ben Elliston + + * doc/porting.texi (Doing a GAS port): Replace `cgen_opcode_open' + with `cgen_cpu_open'; documentation had become out of date. + * doc/rtl.texi (Instruction operands): Likewise. + +2001-05-07 Frank Ch. Eigler + + * iformat.scm (compute-insn-base-mask-length): Rewrite to tolerate + various-base-length instruction sets. + +2001-04-02 Ben Elliston + + * sid-cpu.scm (-last-insn): New function. + (-gen-sem-switch-engine): Loop through idesc while less than or + equal to the last instruction enum, not less than the MAX enum. + (-gen-sfrag-engine-fn): Clean up frag_label_table initialisation. + * sid-decode.scm (-gen-decode-insn-globals): Define the idesc + table's size to be the last instruction enum plus one, not + @PREFIX@_INSN_MAX. + * sid.scm (gen-cpu-insn-enum-decl): Do not append a dummy `max' + instruction onto the instruction list. + + * sim-decode.scm (@prefix@_init_idesc_table): Compute tabsize + using the size of the table and its elements. + (-gen-decode-insn-globals): Define the idesc table's size to be + the last instruction enum plus one, not @PREFIX@_INSN_MAX. + * sim-model.scm (-gen-mach-defns): Define CPU_MAX_INSNS as the + last instruction enum plus one, not @CPU@_INSN_MAX. + +2001-03-28 Ben Elliston + + * doc/version.texi (UPDATED, EDITION): Update. + * doc/stamp-vti: Likewise. + +2001-03-26 Ben Elliston + + * doc/credits.texi (Credits): Update. + + * gas-test.scm (,test-data): Prefix keywords by their + specified prefix and, if necessary, escape `$' in gas-build.sh to + prevent unwanted shell variable expansion. + +2001-03-24 Ben Elliston + + * gas-test.scm (,test-data): Choose pseudo-random data. + (,test-data): Likewise. + (,test-data): Likewise. + (,test-data): Likewise. + (-collate-test-set): New function. + (build-test-set): Use it. + (gen-gas-test): Generate five test cases per instruction. + (cgen-allinsn.exp): Include "-*- Tcl -*-" in DejaGNU test file. + + * read.scm: Load "slib/random" if random is not defined. + * slib/random.scm: New file. + + * utils.scm: Remove comments about the Hobbit compiler. + (copyright-cygnus): Add 2001. + (package-cygnus-simulators): Replace "Cygnus" with "Red Hat". + (package-gnu-simulators): Tidy. + +2001-03-23 Ben Elliston + + * cgen-gas.scm: Inline documentation improvements. + +2001-03-21 Ben Elliston + + * opc-itab.scm (compute-syntax): Emit a parse error if an operand + given in a syntax string is undefined. + + * opc-itab.scm (compute-syntax): Emit a parse error if an operand + name is empty or invalid -- eg. "$(rs)" instead of "($rs)". + +2001-03-20 Patrick Macdonald + + * desc-cpu.scm (@arch@_cgen_cpu_open): Correct machine calculation + for arg_type CGEN_CPU_OPEN_BFDMACH. + +2001-03-20 Ben Elliston + + * opc-itab.scm (-gen-insn-enum): Do not append a dummy `max' + instruction onto the instruction list. Define MAX_INSNS to be the + value of the last instruction enum plus one. + +2001-03-14 Nick Clifton + + * utils.scm (copyright-fsf): Add 2001. Remove (C). + +2001-03-05 Dave Brolley + + * sim-decode.scm (-gen-extract-case): Generate declaration of "insn" + if the number of ifields is greater than zero. + +2001-03-01 Frank Ch. Eigler + + * sid.cpu (-op-gen-set-trace[-parallel], -create-virtual-insns!): + Emit LIKELY/UNLIKELY branch probability hints. + * sid-decode.cpu (-gen-record-args): Ditto. + +2001-02-02 Patrick Macdonald + + * desc-cpu.scm (-gen-hash-defines): Rename + CGEN_ACTUAL_MAX_SYNTAX_BYTES to CGEN_ACTUAL_MAX_SYNTAX_ELEMENTS. + +2001-01-26 Frank Ch. Eigler + + * sid-cpu.scm (gen-parallel-exec-type): Use unsigned long long for + writeback tracking. + (-gen-write-fn, -gen-sem-case, -gen-sfrag-case): Ditto. + * sid-decode.scm (-gen-scache-decls): Exclude writeback tracking field + if unnecessary. + * sid.scm ( gen-write): Use unsigned long long expression + for writeback. + (-op-gen-set-trace, -op-gen-set-trace-parallel): Ditto. + ( gen-profile-code): Ditto. + +2001-01-23 Johan Rydberg + + * doc/rtl.texi (Expressions): Document the (index-of ...) and + (regno ...) rtx. + +2001-01-08 Frank Ch. Eigler + + * operand.scm ( pretty-sem-name): New field. + ( make): Initialize it from hw-name. + (op:set-pretty-sem-name!): New function. + ( gen-pretty-name): Default to fetching new field. + * rtl.scm (hw): Copy hw-name to pretty-sem-name instead. Restore + sem-name setting from -rtx-hw-name. + +2001-01-08 Frank Ch. Eigler + + * rtl.scm (hw): Copy hw-name to new operand's sem-name, to simplify + its subsequent gen-pretty-name. + + * read.scm: Increase thread working stack limit and backtrace + depth limits. + +2001-01-08 Frank Ch. Eigler + + * doc/rtl.texi: Deprecate and depreciate the decode-assist construct. + +2001-01-06 Johan Rydberg + + * openrisc.cpu (or32): Setup semantics for h-delay-insn to + current insn plus 4. + (h-delay-insn): New hardware register. + (l-jal): Uses h-delay-insn instead of pc when setting link register. + (l-jalr): Likewise. + (l-bal): Likewise. + + * openrisc.opc (parse_hi16): Sign extend value. + (parse_lo16): Likewise. + +2001-01-06 Ben Elliston + + * utils-gen.scm (gen-sfmt-enum-decl): Use @prefix@ and @PREFIX@ + instead of @cpu@ and @CPU@ to generically prefix symbol names. + * sim-cpu.scm (-gen-sem-fn-table-entry): Likewise. + (-gen-semantic-fn-table): Likewise. + (-gen-scache-semantic-fn): Likewise. + (-gen-no-scache-semantic-fn): Likewise. + (cgen-read.c): Likewise. + (cgen-sem-switch.c): Likewise. + * desc-cpu.scm (cgen-desc.c): Use @arch@, not @prefix@, since this + is a filename prefix. + * sim-decode.scm (IDESC-TABLE-VAR): Use @prefix@, et al. + (-gen-decode-insn-globals): Likewise. + (-gen-idesc-decls): Likewise. + (cgen-decode.h): Likewise. + (cgen-decode.c): Likewise. + * sim.scm (gen-cpu-insn-enum-decl): Likewise. + (gen-cpu-insn-enum): Likewise. + (sim-finish!): Likewise. + +2001-01-05 Johan Rydberg + + * openrisc.cpu: New file. + * openrisc.opc: Likewise. + +2000-12-12 Ben Elliston + + * doc/rtl.texi (Expressions): Document the (delay ..) rtx. + +2000-12-07 Ben Elliston + + * sim-decode.scm (-gen-extract-case): Do not emit a definition for + "insn" when there are zero ifields to extract. + +2000-12-04 Frank Ch. Eigler + + * utils-sim.scm (gen-define-argbuf-macro): Handle sfmt=#f case, to be + used by simple/non-scache simulators. + * sim-cpu.scm (-gen-read-case): Call gen-define/undef-field-macro + regardless of with-scache?. + (-gen-write-case, -gen-no-scache-semantic-fn, -gen-sem-case): Ditto. + +2000-12-03 Ben Elliston + + * desc-cpu.scm (cgen-desc.h): Clarify generated filenames. + (cgen-desc.c): Likewise. + +2000-12-01 Greg McGary + + * desc.scm (,gen-defn): Prepend prefix to keyword names. + +2000-12-01 Ben Elliston + + * sim-cpu.scm (cgen-cpu.h): Only emit argbuf, scache and extract + definitions if run without with-multipla-isa?. + (cgen-defs.h): New function. Emit an ISA-specific defs file. + * cgen-sim.scm (sim-arguments): Accept -G option to generate defs. + +2000-11-24 Ben Elliston + + * sim-cpu.scm (-gen-hardware-struct): New function. + (-gen-hardware-types): If with-multiple-isa is specified, emit all + hardware elements wich have share one or more ISAs with the ISAs + being kept. + + * sim.scm (-with-multiple-isa?): New symbol. + (with-multiple-isa?): New function. + (option-init!): Initialise -with-multiple-isa?. + (option-set!): Handle with-multiple-isa option. + +2000-11-21 Ben Elliston + + * utils.scm (copyright-fsf): Add the year 2000. + +2000-11-20 Frank Ch. Eigler + + * opc-itab.scm (-gen-ifmt-table, -gen-macro-insn-table: Remove + unneeded "\n\n" from F() macro definition. + +2000-11-15 Greg McGary + + * utils-cgen.scm (gen-define-with-symcat): New function. + * desc-cpu.scm (gen-ifld-defns): Use it. + (gen-hw-table-defns): Use it. + (-gen-hash-defines): Use it. + (gen-operand-table): Use it. + (gen-insn-table): Use it. Remove spurious `#undef MNEM'. + * opc-itab.scm (-gen-ifmt-table): Use it. + (-gen-insn-opcode-table): Use it. + (-gen-macro-insn-table): Use it. + * opc-opinst.scm (-gen-operand-instance-tables): Use it. + * sim-cpu.scm (cgen-semantics.c): Use it. + (cgen-sem-switch.c): Use it. + +2000-11-10 Frank Ch. Eigler + + * utils-sim.scm (-gen-decode-insn-entry): Add fn? parameter to signal + request to emit calls to insn extractors as functions rather than + branches to inline blocks. + (-gen-decode-expr-set-itype, -gen-decode-expr-entry): Ditto. + (-gen-decode-table-entry, -gen-decoder-switch, gen-decoder): Ditto. + + * sim-decode.c (-gen-decode-fn): Tell (gen-decode) to emit branches + to extractor clauses. + +2000-11-10 Frank Ch. Eigler + + * decode.scm (-distinguishing-bit-population): Significantly + improve popularity heuristic. Renamed from + (-mask-bit-population): Gone. + (-population-above-threshold): Sort new bit numbers in order of + popularity. + (-population-top-few): Allow up to three more bits to be selected + than requested. Correct selection order to prefer better bits. + Correct bug in fewer-than-requested case. Keep threshold as + floating-point. + (decode-best-get-bits): Pass also the insn-values. + + * utils-sim.scm (-gen-decoder-switch): Add comment suggesting a + future optimization. + + * utils.scm (message): Format nested lists better. + +2000-11-09 Doug Evans + + * dev.scm: Add srcdir to %load-path. + + * rtx-funcs.scm (subword): Mode of argument can be different + than mode of result, so don't use OP0 to specify argument's mode. + +2000-11-02 Ben Elliston + + * doc/porting.texi (Building a GAS test suite): Document my change + to gas-build.sh. + +2000-11-01 Ben Elliston + + * sim-test.scm (cgen-build.sh): Include "-*- Asm -*-" in test cases. + +2000-10-31 Ben Elliston + + * gas-test.scm (cgen-build.sh): Allow the generated script to run + with no command line arguments if the gas build directory can be + determined. + +2000-10-26 Doug Evans + + * insn.scm (-parse-insn-format-symbol): Fix spelling error, + op-ifld -> op-ifield. + +2000-10-23 Frank Ch. Eigler + + * thumb.scm (cc-tests): Add (ISA thumb) attribute. + +2000-10-13 matthew green + + * utils-cgen.scm (get-ifetch): Move from here ... + * sim.scm (get-ifetch): ... to here. + * sid.scm (get-ifetch): Copy and port to c++. + +2000-10-06 Dave Brolley + + * utils-gen.scm (-gen-ifld-extract-base): Compute start position as + ifld-start + ifld-word-offset. + (gen-ifld-extract): Check adata-integral-insn? before checking whether + the field is beyond the base number of bits. + (gen-define-ifields): Use a base-length of 32 if adata-integral-insn?. + (gen-extract-ifields): Ditto. + * gas-test.scm (gentest): Generate backslashes before '[' and ']' + characters in the regular expression. + +2000-10-02 Frank Ch. Eigler + + * desc-cpu.scm: (gen-operand-decls): Emit MAX_OPERANDS as a + preprocessor constant. + +2000-09-21 Frank Ch. Eigler + + * slib/logical.scm: New file from slib. Provides robust bitwise + logical operations for large integers. + * read.scm: maybe-load it. + +2000-09-15 Frank Ch. Eigler + + * enum.scm (define-full-insn-enum): Filter with keep-isa predicate. + * ifield.scm (-ifield-parse, -multi-ifield-parse): No longer assert + single-isa predicate, but support keep-isa filtering. + +2000-09-08 Frank Ch. Eigler + + * rtl-c.scm (s-sequence): Handle nested c-calls in both + statement-expression and comma-expression contexts. + (s-c-call, s-c-raw-call): Add warning comment about bad assumption. + +2000-09-08 Frank Ch. Eigler + + * decode.scm (-population-top-few): Signal error gracefully if + decoding is about to become ambiguous. + +2000-09-06 Frank Ch. Eigler + + * doc/rtl.texi (decode-assist): Describe this field as optional. + +2000-09-06 Frank Ch. Eigler + + * utils-gen.scm (gen-multi-ifld-extract): Handle case of multi-ifield + with decode proc. + +2000-09-05 Dave Brolley + + * sim.scm (sim-finish!): Honour the definition of FAST_P when calling + @cpu@_pbb_begin. Use 0 if FAST_P is not defined. + +2000-08-29 Dave Brolley + + * utils-gen.scm (gen-ifld-extract): Pass total-len if + adata-integral-insn is true for this architecture. + +2000-08-24 Frank Ch. Eigler + + * hardware.scm ( get-index-mode): Define method. + * operand.scm ( gen-pretty-name): Tolerate no op:sem-name. + * rtl-c.scm (-c-rtl-get): Improve an error message. + * sim.scm (-op-gen-set-trace): Support lvalues. + +2000-08-22 Frank Ch. Eigler + + * Makefile.in (DIST_COMMON): Regenerated. + * ifield.scm ( needed-iflds): New method. + * iformat.scm (-ifmt-lookup-sfmt!): Use base ifields for + sfmts built from s. + * operand.scm (-derived-parse-encoding): Give a fixed + type symbol 'derived-ifield, not an unparseable string. + * utils-sim.scm (op-needed-iflds) Handler 'derived-ifield case. + (-sfmt-contents): Add tracing. + + From Doug Evans : + * sim.scm ( cxmake-get): Result is a , not a string of + C code. + +2000-08-20 Doug Evans + + * rtl-c.scm (rtl-c-expr-with-estate): New fn. + (rtl-c-expr-parsed,rtl-c-expr): New fns. + (-rtl-c-get): Rename from rtl-c-get. + (rtl-c-get): New fn for getter logging. + +2000-07-28 Ben Elliston + + * NEWS: Update. + +2000-07-25 Ben Elliston + + * doc/credits.texi (Credits): Add Frank Eigler. + +2000-07-24 Dave Brolley + + * opc-itab.scm (gen-insn-opcode-table): Initialize the first element + fully. + * desc.scm (gen-attr-table-defn): Initialize all elements fully. + (): Initialize all elements fully. + * desc-cpu.scm (-gen-isa-table-defns): Initialize the last element + fully. + (-gen-mach-table-defns): Ditto. + (-gen-ifld-defns): Ditto. + (-gen-operand-table): Ditto. + (-gen-insn-table): Ditto. + (-gen-cpu-open): Nothing to do for the mach table. + +2000-07-13 Ben Elliston + + * doc/version.texi (UPDATED): Update. + +2000-07-05 Ben Elliston + + * configure.in (AC_PATH_PROG): Remove. + * configure: Regenerate. + * Makefile.am (GUILE): Locate guile dynamically. + * Makefile.in: Regenerate. + * doc/Makefile.in: Likewise. + +2000-07-03 Ben Elliston + + * desc-cpu.scm (cgen-desc.c): Include "libiberty.h". + * opc-itab.scm (cgen-opc.c): Likewise. + +2000-06-28 Frank Ch. Eigler + + * rtl.scm (-rtx-traverse-locals): Correct call to `symbol?' for + guile 1.4 compatibility. + (rtx-env-dump): Comment out buggy display calls. + +2000-06-15 matthew green + + * opc-itab.scm (-gen-ifmt-table-1): Add extra braces to pacify GCC. + +2000-06-14 Frank Ch. Eigler + + * Makefile.in: Regenerated. + + * desc-cpu.scm (gen-ifld-decls): Exclude derived ifields. + (gen-ifld-defns): Ditto. + * pgmr-tools.scm (pgmr-pretty-print-insn-format): Ditto. + * rtl.c (rtl-finish!): Ditto. + * opc-itab.scm (-gen-ifield-decls): Ditto. + * opcodes.scm (gen-switch): Exclude derived operands. + * operand.scm (op-iflds-used): Expand derived operands. + (hw-index-derived): New dummy function to create dummy object. + (-derived-operand-parse): Fix mode arg passed to + constructor. Set object's hw-name and index fields. + (-anyof-merge-subchoices): Set instance object's index also. + (-anyof-name): New helper function. + (anyof-merge-semantics): Correct replacement of operand names in + anyof instance. + (op-ifield): Tolerate derived-operands and their funny indices better. + * ifield.scm (ifld-known-values): Expand derived ifields. + (non-multi-ifields, non-derived-ifields): New utility functions. + (ifld-decode-mode): Tolerate objects with unbound decode field. + * iformat.scm (compute-insn-length): Expand derived ifields. + (compute-insn-base-mask): Ditto. + * insn.scm (insn-base-ifields): Remove. + (): Add iflds-values entry to cache ifld-base-ifields values. + (insn-value): Call ifld-base-ifields and ifld-constant? instead. + * mach.scm (arch-analyze-insns!): Exclude multi-insns. + * sem-frags.scm (sim-sfrag-analyze-insns!): Ditto. + (-frag-test-data): Ditto. + * sid-cpu.scm (cgen-write.cxx,-gen-sem-switch): Ditto. + (-gen-sem-switch-engine); Ditto. + * sid-model.scm (-gen-model-insn-fns, -gen-model-timing-table): Ditto. + * sid-decode.scm (cgen-decode.h, cgen-decode.cxx): Ditto. + (-gen-record-args): Tolerate unbound op-ifield. + * sid.scm ( cxmake-get): New sketch implementation. + (-gen-arch-model-decls, scache-engine-insns, pbb-engine-insns): + Exclude multi-insns. + * sim-decode.scm (cgen-decode.h, cgen-decode.cxx): Ditto. + * utils-sim.scm (op-extract?): Handle derived operands. + + * gas-test.scm (cgen-build.sh): Quote '*' chars printed by objdump. + * semantics.scm (-build-operand!): Handle 'DFLT case during parsing. + * hardware.scm (hardware-for-mode): New function. + + * insn.scm (filter-harmlessly-ambiguous-insns): New function for + cleaning up decode tables. + (mask-superset?): Little helper function for above. + * decode.scm (-build-decode-table-entry): Call it. + (-opcode-slots): Add some more tracing. + * arm.cpu: Disable decode-splits construct due to implementation + conflict with `filter-harmlessly-ambiguous-insns' + + * decode.scm (-population-top-few): New function for better decode + bit generation. Includes minor helper functions. + (decode-get-best-bits): Call it instead. + (OLDdecode-get-best-bits): Renamed previous version of above. + + +2000-06-13 Ben Elliston + + * configure.in: Use AC_EXEEXT with Cygnus mode. Remove AC_ARG_WITH + for the Guile library directory. + * configure: Regenerate. + * Makefile.in, doc/Makefile.in: Regenerate. + + * Makefile.in, doc/Makefile.in: Regenerate. + * configure.in: Remove unnecessary tests. Move to version 1.0. + * acconfig.h, config.in: Remove. + * configure, aclocal.m4: Regenerate. + * doc/stamp-vti, doc/version.texi: Likewise. + * AUTHORS: New file. + +2000-06-07 Ben Elliston + + * fixup.scm (symbol-bound?): Reduce debugging output. + +2000-06-02 matthew green + + * insn.scm (insn-base-ifields): Returns all the instruction fields for + a given instruction, replacing derived fields with their subfields. + (insn-value): Use `insn-base-ifields' to find all constant values. + (multi-insn-instantiate!): Comment some debug messages. + +2000-06-01 Ben Elliston + + * doc/rtl.texi (Expressions): Document a hazard with the choice of + symbol names used in a (c-call ..) rtx. + + * sim-test.scm (build-test-set): Return (()) for an instruction + with no operands, so it too is included in the generated test set. + +2000-05-31 Ben Elliston + + * Makefile.am (gas-test): Ensure $(ISA) is not empty. + (sim-test): Likewise. + * Makefile.in: Regenerate. + +2000-05-30 Frank Ch. Eigler + + * read.scm (-cgen): In debugging mode (-b), ask guile for untruncated + stack traceback, in an order that resembles gdb's `bt'. + +2000-05-24 Frank Ch. Eigler + + * desc-cpu.scm (-gen-hash-defines): Use ifmt-ifields again. + * opc-itab.scm (-gen-ifmt-table-1): Ditto. + * gas-test.scm (gas-test-analyze!, cgen-build.sh): Filter out + multi insns. + * ifield.scm (multi-ifield): Define workable field-mask and field-value + virtual functions. + (ifld-base-ifields): New routine to replace ifmt-expanded-ifields. + * iformat.scm (ifmt-expanded-ifields): Gone. + (ifields-base-ifields): New function. Call ifld-base-ifields for real + work. + (-ifmt-lookup-ifmt!): Use it to expand derived/multi combos in new + ifmt entries. + + * opcodes.scm (multi-ifield gen-extract): Correct spacing in generated + code. + +2000-05-23 Frank Ch. Eigler + + * sid.scm (with-any-profile?): New function clone. + +2000-05-19 Frank Ch. Eigler + + * utils-gen.scm (gen-multi-ifld-extract): Fix decode hook for sim. + +2000-05-18 Frank Ch. Eigler + + * ifield.scm (-multi-ifield-parse): Add encode/decode args. + (-multi-ifield-read): Parse them. + (define-full-multi-ifield): Pass #f/#f as defaults for them. + * opcodes.scm (multi-ifield gen-insert): Add encode hook. + (multi-ifield gen-extract): Add decode hook. + * utils-gen.scm (gen-multi-ifld-extract): Add decode hook for sim. + + * insn.scm (syntax-break-out): More correctly handle \-escaped + syntax characters. + (syntax-make-elements): Ditto. + * opc-itab.scm (compute-syntax): Ditto. + +2000-05-17 Ben Elliston + + * gas-test.scm (cgen-build.sh): Log the correct script filename. + +2000-05-15 Frank Ch. Eigler + + * gas-test.scm (build-test-set): Return (()) for an instruction + with no operands, so it too is included in the generated test set. + +2000-05-15 Frank Ch. Eigler + + * desc-cpu.scm (-gen-hash-defines): Define CGEN_ACTUAL_MAX values for + IFMT_OPERANDS and SYNTAX_BYTES. + +2000-05-15 Frank Ch. Eigler + + * sim.scm (with-any-profile?): New function. + * utils-sim.scm (-sfmt-contents): Use above instead of `with-profile?' + to decide whether or not to include profiling counters. + +2000-05-10 Frank Ch. Eigler + + Fuller derived-operand support for opcodes. + * insn.scm (non-multi-insns): New filter to oppose `multi-insns'. + * desc-cpu.scm (-define-hash-defines): Compute CGEN_MAX_SYNTAX_BYTES. + Correctly compute ..._IFMT_OPERANDS. Omit useless ..._INSN_OPERANDS. + (gen-operand-table): Omit derived- and anyof- operands from table. + (gen-insn-table): Omit multi-insns from table. + * iformat.scm (ifmt-expanded-fields): New function to expand + subfields of derived-ifields. + (ifmt-compute!): Ignore remaining multi-insns. + * mach.scm (isa-min-insn-bitsize, isa-max-insn-bitsize): Ignore + multi-insns. + * opc-itab.scm (-gen-ifmt-table-1): Use ifmt-expanded-ifields. + (-gen-insn-enum, -gen-insn-opcode-table): Ignore multi-insns. + * opcodes.scm (derived-operand): Define abort()ing gen-insert, + gen-extract, gen-fget, gen-fset, gen-parse, gen-print functions. + (gen-switch): Omit anyof-operands. + * operand.scm (-anyof-syntax): New function. + (-anyof-merge-syntax): Call it. + * utils.scm (collect): New idiomatic function. + +2000-05-10 Ben Elliston + + * m68k.cpu: New file (work in progress). + +2000-05-05 Frank Ch. Eigler + + * Makefile.am (all-local): New target. Create stamp-cgen. + * Makefile.in: Regenerated. + * doc/Makefile.in: Regenerated. + +2000-04-26 Frank Ch. Eigler + + * operand.scm (-operand-g/setter-syntax): Correct off-by-one error. + (-operand-parse-setter): Ditto. + * utils-sim.scm (needed-iflds): Store ifield (index) in argbuf, even + for CACHE-ADDR operands. + * sid-decode.scm (-gen-record-args): Remove newly duplicated extract + trace entries. Widen byte-wide values for printing. + * sid.scm (-op-gen-set-trace): Enhance result trace with op indices. + Widen byte-wide values for printing. Hexify memory addresses. + +2000-04-23 matthew green + + * m32r.cpu: Fix a typo. + +Fri Apr 21 22:18:48 2000 Jim Wilson + + * ia64.cpu (define-model): Change merced to Itanium. + (f-qp): Change quilifying to qualifying. + (movbr_ph, movbr_pvec): Delete. + (I-I21): Delete uses of movbr_ph and movbr_pvec. + +2000-04-07 Ben Elliston + + * doc/porting.texi (Building a simulator test suite): Clarify + where generated test cases are placed. + +2000-04-07 Ben Elliston + + * Makefile.am (gas-test): Remove dependency on `cgen'. + (sim-test): Ditto. + * Makefile.in: Regenerate. + +2000-04-04 Frank Ch. Eigler + + * hardware.scm ( parse): Allow user to set type for pc register. + * mode.scm (mode-finish!): Add placeholder code for mach-dependent + type reconfiguration. + * utils-sim.scm (-sfmt-contents): Add profile-counters only if + with-profile?. + +2000-03-30 Ben Elliston + + * doc/rtl.texi (Enumerated constants): Add concept index entries. + +2000-03-24 Ben Elliston + + * Makefile.am (stamp-cgen): Reinstate target. + * Makefile.in: Regenerate. + +2000-03-22 Ben Elliston + + * slib/ppfile.scm: Remove; unused. + * slib/defmacex.scm: Likewise. + +2000-03-21 Ben Elliston + + * doc/internals.texi (Source file overview): Document. + + * Makefile.am (GUILEDIR): Remove. + (CGEN): Ditto. Callers use $(GUILE) instead. + (GUILEFLAGS): Ditto. + (CGENFILES): Ditto. + (APPDESCFILES): Ditto. + (OPCODESFILES): Ditto. + (SIMFILES): Ditto. + (pkgdata_SCRIPTS): Ditto. + (stamp-cgen): Remove target. + * Makefile.in: Regenerate. + + * configure.in: Remove header and library tests. + * configure: Regenerate. + * config.in: Likewise. + +2000-03-20 Ben Elliston + + * read.scm: Cease loading "hob-sup.scm". + * utils.scm: Inherit the fastcall family of procedures (for now). + * hob-sup.scm: Remove. + +2000-03-20 Ben Elliston + + * configure.in (AC_OUTPUT): Do not emit .gdbinit. + * configure: Regenerate. + * gdbinit.in: Remove. + +2000-03-17 Ben Elliston + + * Makefile.am (CGEN): Use guile, not cgen. + (CGENCFLAGS, LIBIBERTY, INCLUDES): Remove. + (bin_PROGRAMS, cgen_SOURCES): Likewise. + (CGENFILES): Fold CGEN_HOB_INPUT_FILES and CGEN_NOHOB_FILES. + (HOBBIT_INPUT_FILES, HOBBIT_OUTPUT_FILE): Remove. + (HOB_OBJS): Likewise. + (CGEN_HOB_SRC, CGEN_HOB_OBJ): Likewise. + (CGENOBJS): Likewise. + (cgen_DEPENDENCIES, cgen_LDFLAGS, cgen_LDADD): Likewise. + (hobbit, hobbit.o, hobbit.c): Remove targets. + (cos.o, cgen.o, cgen-gh.o, hob-sup.o): Likewise. + (CLEANFILES): Update. + * acconfig.h (WITH_HOBBIT): Remove. + * configure.in: Do not test for 3 arg scm_make_vector. Remove + option --with-cgen-hobbit. + * cos.h, cos.c, hob-main.c, hob-sup.c, hob-sup.h, hob.sh: Remove. + * cgen-gh.h, cgen-gh.c, cgen-hob.scm, cgen.c: Likewise. + * hobbit.c, hobbit.h, hobbit.scm: Likewise. + * hobscmif.h, hobslib.scm, scmhob.h: Likewise. + * Makefile.in: Regenerate. + * config.in: Likewise. + * aclocal.m4: Likewise. + * configure: Likewise. + * README (Hobbit support): Remove. + * doc/internals.texi (Conventions): Do not mention Hobbit. + * doc/porting.texi (Supported Guile versions): Likewise. + +2000-03-16 Frank Ch. Eigler + + * sid-cpu.scm (-gen-sem-switch-engine): Adjust calling & + callback convention to new sid sidutil::basic_cpu code. + (-gen-sfrag-engine-fn): Ditto. + * sid.scm (-create-virtual-insns!): Ditto. + (-hw-gen-set-quiet-pc): Mark delay slot execution specially in pbb + mode. + (cxmake-skip): Implement properly for pbb mode. + +2000-03-03 Ben Elliston + + * doc/internals.texi: New file. + +2000-02-29 Ben Elliston + + * doc/rtl.texi (Derived operands): Remove unnecessary footnote. + * doc/porting.texi: Formatting tweaks. + +2000-02-25 Nick Clifton + + * desc-cpu.scm (*_cgen_cpu_open): Initialise signed_overflow_ok_p + field. + +Thu Feb 24 14:09:01 2000 Doug Evans + + * operand.scm (,make!): Initialize mode-name, not + mode. + +2000-02-23 Andrew Haley + + * m32r.cpu (pcmpbz): Make pcmpbz a special (i.e. hidden) + instruction. + +2000-02-24 Ben Elliston + + * doc/rtl.texi (Derived operands): Add some cindex entries. + +2000-02-23 Ben Elliston + + * ia32.cpu (dndo): Move general purpose macro from here .. + * simplify.inc (dndo): .. to here. + +2000-02-18 Frank Ch. Eigler + + * arm.cpu (h-tbit): Add c-call setter function. + (h-mbits): Ditto. + +2000-02-17 Frank Ch. Eigler + + * sem-frags.scm (-frag-hash-compute!): Add appstuff arg for traversal. + (-frag-cost-compute!): Ditto. + * utils.scm (copyright-cygnus): Add Y2K. + * sid-cpu.scm (@prefix@_pbb_run): Add unsigned& argument. + +2000-01-25 Nick Clifton + + * desc-cpu.scm (@arch@_cgen_cpu_open): Add code to initialise + flags field of the CGEN_CPU_TABLE structure. + +Sun Dec 12 14:20:36 1999 Doug Evans + + * operand.scm (): Renamed from . + All references updated. + +Tue Nov 30 11:06:22 1999 Doug Evans + + * ia32.cpu: Rewrite addressing mode support. + + * ifield.scm (): New member `follows'. + (ifld-known-values): New proc. + (): New method set-word-offset!. + (ifld-set-word-offset!): New proc. + (ifld-new-word-offset): New proc. + (): New method next-word. + (): New method next-word. + (ifld-next-word): New proc. + (ifld-precedes?): New proc. + (-ifield-parse): New args word-offset,word-length,follows. + All callers updated. Handle CISC-style vs RISC-style ifields. + (-ifield-read): Recognize word-offset,word-length,follows specs. + (-ifld-parse-follows): New proc. + (-multi-ifield-make-default-insert): New proc. + (-multi-ifield-make-default-extract): New proc. + (-multi-ifield-parse): Provide default values for insert,extract + handlers if not specified. + (): New class. + (derived-ifield?): New predicate. + (ifld-derived-operand?): New predicate. + (f-anyof): New global. + (ifld-anyof?,ifld-anyof-operand?): New predicates. + (f-derived,ifld-derived?): Delete. + (ifield-builtin!): Delete init of f-derived. Init f-anyof. + * insn.scm (-sub-insn-ifields): New proc. + (-sub-insn-make!): New proc. + (multi-insn-instantiate!): Provide initial implementation. + (-insn-parse): If insn contains "anyof" operands, create a + object instead of a plain . + (-parse-insn-format-symbol): Rewrite derived operand handling. + Add anyof operand handling. + (-parse-insn-format-ifield-spec): Rewrite. + (-parse-insn-format-operand-spec): Delete. + (-parse-insn-format-list): Delete support for `(operand value)'. + (anyof-operand-format?): Replaces derived-operand-format?. + * operand.scm (-operand-parse-getter): Improve error messages. + (-operand-parse-setter): Ditto. + (): New members args,syntax,base-ifield,encoding, + ifield-assertion. + (): Change baseclass from to + . Delete member values. New members base-ifield,choices. + (anyof-operand?): New predicate. + (-derived-parse-encoding,-derived-parse-ifield-assertion): New procs. + (-derived-operand-parse): Rewrite. + (-derived-operand-read): Rewrite. + (-anyof-parse-choice): New proc. + (-anyof-operand-parse): Rewrite. + (-anyof-operand-read,define-anyof-operand): New procs. + (): Rewrite. + (-anyof-initial-known): New proc. + (anyof-satisfies-assertions?): New proc. + (-anyof-merge-syntax,-anyof-merge-encoding): New procs. + (-anyof-merge-getter,-anyof-merge-setter): New procs. + (-anyof-merge-semantics,-anyof-merge-ifield-assertion): New procs. + (-anyof-merge-subchoices,-anyof-all-subchoices): New procs. + (-anyof-value-from-derived): New proc. + (-anyof-all-choices-1,anyof-all-choices): New procs. + (operand-init!): Create define-anyof-operand reader command. + + * insn (syntax-break-out): Take syntax as argument instead of insn. + All callers updated. + (syntax-make): Move here, from ???. + + * types.scm (): Rename accessors from bitrange:foo to + bitrange-foo. All uses updated. + (bitrange-next-word): New proc. + + * semantics.scm (-solve-expr-fn,rtx-solve): New procs. + + * rtl.scm (rtx-canonicalize): Provide initial implementation. + (rtx-make-const,rtx-make-enum): New procs. + (rtx-arg1,rtx-arg2): Renamed from -rtx-arg[12]. All callers updated. + (rtx-mem-addr,rtx-mem-sel): New procs. + (rtx-change-address): New proc. + (rtx-make-ifield,rtx-make-operand,rtx-make-local): New proc. + (rtx-make-set,rtx-single-set?): New procs. + (rtx-combine): New proc. + + * rtl.scm (rtx-traverse): New arg `appstuff'. All callers updated. + (rtx-traverse-with-locals): Ditto. + (-rtx-traverse,-rtx-traverse-*): Ditto. + + * rtl.scm (define-subr): New proc. + (rtl-init!): Create reader command `define-subr'. + + * cos.c (_object_mi_p): Ensure argument is an object. + (indent): New function. + (_object_print_elms): Add pretty-printing support. + (_object_print): Ditto. + + * hobbit.scm (*reckless-s->c-fun-table*): Add fastcall7. + (*floats-s->c-fun-table*): Ditto. + * hobbit.c,hobbit.h: Rebuild. + * hob-sup.c (fastcall7): New proc. + * hob-sup.h (fastcall7): Declare. + * hob-sup.scm (fastcall7): New macro. + + * mach.scm (): New member subr-list. + (current-subr-list,current-subr-add!,current-subr-lookup): New procs. + (arch-finish!): Reverse recorded subr list. + + * read.scm (debug-env): New global. + (debug-var-names,debug-var,debug-repl-env): New procs. + (debug-repl): Rewrite. New arg `env-list'. All callers updated. + (debug-quit): Renamed from `continue'. + + * simplify.inc (dsmf): New pmacro. + + * utils.scm (plus-scan): New proc. + (split-bits): Rewrite. + (split-value): New proc. + +1999-10-13 Doug Evans + + * doc/Makefile.am (DOCFILES): Add notes.texi. + * doc/Makefile.in: Rebuild. + +1999-10-11 Doug Evans + + * ifield.scm (ifld-derived?): New proc. + (f-derived): New global. + (ifield-builtin!): Create ifield f-derived. + (): New class. + (multi-insn?): New predicate. + (multi-insn-instantiate!): New proc. + (-insn-parse): Create objects for insns with derived + ifields. + (-parse-insn-format-symbol): Handle derived ifields. + (-parse-insn-format-ifield-spec): New proc. + (-parse-insn-format-operand-spec): New proc. + (-parse-insn-format-list): Simplify. + (-parse-insn-format): No longer allow (ifield-object value) spec. + (derived-operand-format?): New proc. + (insn-alias?): New proc. + (non-alias-insns): Rewrite. + (insn-real?): Renamed from real-insn?, all callers updated. + (virutal-insns): Rewrite. + (multi-insns): New proc. + * mach.scm (arch-analyze-insns!): Instantiate multi-insns if present. + * operand.scm (op-ifield): Renamed from op:ifield, all callers updated. + Return #f if operand doesn't have an index or if index is not an + ifield. + (hw-index-anyof): New proc. + (-operand-parse): Allow integer indices. + (): New class. + (derived-operand?): New predicate. + (): New class. + (): New class. + (-anyof-parse-value,-anyof-operand-parse): New procs. + (-derived-operand-parse,-derived-operand-read): New procs. + (define-derived-operand,define-full-derived-operand): New procs. + (operand-init!): New reader command define-derived-operand. + + * utils.scm (list-take): Handle negative amount. + (element?): Rewrite. + +1999-10-10 Doug Evans + + * dev.scm: quick-utils.scm renamed to ~/.cgenrc. + +1999-10-04 Richard Henderson + + * ia64.cpu: Checkpoint. + +1999-09-29 Doug Evans + + * sim-cpu.scm (-gen-semantic-fn-table): Virtual insns are always valid. + + * sim.scm (sim-finish!,x-invalid): Always set pc. Set vpc based on + default-insn-bitsize. Pass vpc to sim_engine_invalid_insn. + +Wed Sep 29 14:39:39 1999 Dave Brolley + + * sim.scm (sim-finish!): Don't call sim_io_error for invalid insn. Use + PC returned by sim_engine_invalid_insn. + +1999-09-28 Doug Evans + + * ia32.cpu: New file. + +1999-09-25 Doug Evans + + * utils.scm (bit-set?): Fix off by one error. + + * rtl-c.scm (s-sequence): Fix non-void-mode result output. + + * rtl.scm (hw): Check for valid hardware element before trying to + get its mode. + + * arm.cpu (arm7f cpu): Renamed from arm. All users updated. + * arm7.cpu (bx): Fix name of target address operand in assembler spec. + (*): arm_compute_operand2_foo renamed to compute_operand2_foo. + * thumb.cpu (*): arm_compute_operand2_foo renamed to + compute_operand2_foo. + + * cgen-sid.scm (sim_arguments): Add support for building defs.h. + * sid.scm (-hw-gen-set-quiet-pc): Handle #:delay modifier. + Call delayed_branch/branch methods instead of assigning to `vpc'. + (,cxmake-skip): Call skip method. + (-gen-hw-selector): Call rtl-c++ instead of rtl-c. + (,cxmake-skip): Ditto. + (-create-virtual-insns!): Ditto. + (op:read): Call estate-make-for-normal-c++ instead of estate-...-c. + (op:write): Ditto. + (op:record-profile): Specify #:output-language "c++". + * sid-cpu.scm (-gen-insn-attr-decls): Rename @cpu@_insn_attr to + @arch@_insn_attr. + (cgen-desc.h): Use @arch@ namespace instead of @cpu@. + Define enums here. + (-gen-reg-access-defns): Use rtl-c++ instead of rtl-c. + (gen-semantic-code): Ditto. + (-gen-sem-case,-gen-sfrag-code): Ditto. + (-gen-hardware-types): Delete class @cpu@_cpu_base. + (cgen-cpu.h): File is now #included by main cpu class, rather than + subclassing. + (cgen-defs.h): New proc. + (-gen-scache-semantic-fn): Change result type to sem_status. + New local `status'. Call done_cti_insn/done_insn method at end. + (cgen-semantics.cxx): Include @cpu@.h instead of @arch@-main.h, + cgen-ops.h. + (cgen-sem-switch.cxx): Ditto. + * sid-decode.scm (-gen-idesc-decls): Update return type of + @prefix@_sem_fn. + (cgen-decode.h): Add using namespace @arch@. + (cgen-decode.cxx): Include @cpu@.h instead of @arch@-main.h. + + * rtl-c.scm (): New member output-language. + (estate-output-language-c?,estate-output-language-c++?): New procs. + (,vmake!): Handle #:output-language. + (estate-make-for-normal-rtl-c++): New proc. + (rtl-c++-parsed,rtl-c++): New proc. + (s-c-call): Invoke cpu class method if c++. + (join): Use s-c-raw-call. + + * rtl-c.scm (subword): Don't pass current_cpu to SUBWORD. + (nop): Rewrite. + + * rtl-c.scm (delay): Mark the sequence as #:delay'd. + * rtl.scm (): New member `modifiers'. + (,vmake!): Handle #:modifiers. + (estate-with-modifiers): New proc. + + * rtl.scm (rtx-side-effects?): New proc. + (rtx-canonical-bool): Don't change expr if it has side effects. + * semantics.scm (-simplify-expr-fn): Handle exprs with side-effects + better. + +1999-09-23 Doug Evans + + * sim.scm (gen-scache-type): Fix typo in last patch. + +Tue Sep 21 17:12:55 1999 Dave Brolley + + * sim.scm (gen-scache-type): Add last_insn_p flag for parallel support. + +1999-09-05 Doug Evans + + * sid.scm (,cxmake-skip): New method. + (,cxmake-skip): New method. + + * decode.scm (decode-build-table): Delete args startbit,index-list. + All callers updated. + * utils-sim.scm (gen-decoder): Delete args startbit,index-list. + All callers updated. + * sim-decode.scm (-gen-decode-fn): Always pass 0 for startbit + to decode-get-best-bits. + * sid-decode.scm (-gen-decode-fn): Ditto. + + * hardware.scm (hw-bits): New proc. + (-hw-parse): New arg layout. All callers updated. + (define-full-hardware): New arg layout. All callers updated. + (-hw-validate-layout): New proc. + (-hw-create-[gs]etter-from-layout): New procs. + (,parse!): Handle layout spec. + * types.scm (type-bits): New proc. + + * sem-frags.scm (-frag-cost-compute!): Fix calculation of + UNARY, BINARY, TRINARY rtxs. + + * attr.scm (,parse-value): Allow strings. + * enum.scm (parse-enum-vals): Use reverse! instead of reverse. + Support '- as "unused spot" indicator. + +1999-09-03 Doug Evans + + * pgmr-tools.scm (pgmr-pretty-print-insn-format): Fix typo. + +1999-09-02 Doug Evans + + * rtx-funcs.scm (subword): Fix mode spec of `value'. + + * rtl.scm (-rtx-traverse-operands): Fix debugging message + construction. + (tstate-make): New arg `depth'. All callers updated. + (tstate-depth,tstate-set-depth!): New procs. + (tstate-incr-depth!,tstate-decr-depth!): New procs. + (-rtx-traverse-operands): Indent debugging output by traversal depth. + (-rtx-traverse): Ditto. Keep track of traversal depth. + +1999-09-01 Doug Evans + + * sim-decode.scm (-gen-decoder+supporting cast): Move to utils-sim.scm. + * sid-decode.scm (-gen-decoder+supporting cast): Ditto. + * utils-sim.scm: Decoder generator support moved here. + (-decode-equiv-entries?,-decode-sort-entries): New procs. + (-gen-decoder-switch): Sort entries for more fall-throughs. + + * Makefile.am (gas-test,sim-test): Specify ISA when invoking cgen. + * Makefile.in: Rebuild. + * sim-test.scm (build-sim-testcase): Add logging message. + * dev.scm (cload): Recognize SIM-TEST application. + (load-stest): Set APPLICATION to SIM-TEST. + + * desc-cpu.scm (-gen-hash-defines): Add \n to output. + + * ifield.scm (-ifield-parse): Allow bit numbers up to 127. + * mach.scm (-isa-parse): Allow insn bitsizes from 8 to 128. + * mode.scm (mode-make-int,mode-make-uint): Allow values up to 64 bits. + + * insn.scm (syntax-break-out): Handle ${foo}. + +Sun Aug 29 11:11:15 1999 Doug Evans + + * Makefile.am (noinst_PROGRAMS,noinst_LIBRARIES): Delete. + (bin_PROGRAMS): Define. + (CGEN_HOB_INPUT_FILES): Remove $(srcdir)/. + (cgen-hob.c): Prepend $(srcdir)/ here. + (APPDESCFILES,OPCODESFILES,SIMFILES,pkgdata_SCRIPTS): Define. + (libcpu_a_SOURCES): Delete. + (cgen_DEPENDENCIES,cgen_LDADD): Rewrite. + (CGEN_HOB_OBJ,CGENOBJS): New variables. + * configure.in (LIBS): Replace -Wl,-rpath with -R. + Add AC_CHECK_LIB(guile,main). + * Makefile.in: Rebuild. + * doc/Makefile.in: Rebuild. + * aclocal.m4: Rebuild. + * config.in: Rebuild. + * configure: Rebuild. + +1999-08-28 Doug Evans + + Rename rtx functions from name: to name, accept optional leading + modifier and mode. + VM -> VOID, DM -> DFLT, use DFLT instead of VM for default mode. + * attr.scm (-attr-eval): Update. + * hardware.scm (hw-mode-ok?): Rename arg mode to new-mode-name. + (,mode-ok?): Disallow VOID. + (,mode-ok?): Disallow VOID. + (,mode-ok?): Disallow VOID. + * mode.scm (mode-name?): New proc. + (VOID): Renamed from VM. + (DFLT): Renamed from DM. + (mode-builtin!): Update. + * opcodes.scm (,gen-insert): Update. + (,gen-extract): Update. + (,gen-insert,gen-extract): Update. + * operand.scm (op:mode): Update. + (,make!): Update. + (op:new-mode): Update. + (-operand-read): Update. + * rtl.scm (-rtx-valid-types): Add OPTIONS, EXPLNUMMODE, + NONVOIDMODE, DFLTMODE. Rename VMMODE to VOIDMODE. + (def-rtx-dual-mode,define-rtx-dual-mode): Delete. + (-rtx-lazy-sem-mode): Renamed from -rtx-mode. All callers updated. + (rtx-make): Call -rtx-munge-mode&options. + (rtx accessors): Rewrite. + (rtx-pretty-name): Update. + (-rtx-traverse-*): Update. + (-rtx-traverse-explnummode,-rtx-traverse-nonvoidmode): New procs. + (-rtx-traverse-voidmode,-rtx-traverse-dfltmode): New procs. + (-rtx-make-traverse-table): Update. + (-rtx-traverse-operands): Update. + (-rtx-option?,-rtx-option-list?): New procs. + (-rtx-munge-mode&options): New proc. + (-rtx-traverse-expr): Call -rtx-munge-mode&options. + (-rtx-traverse): Update. + (rtx-traverse,rtx-traverse-with-locals,rtx-compile): Update. + (rtx-compile-time-constant?): Update. + (rtx-true?,rtx-false?,rtx-true,rtx-false): Update. + (rtx-value): Update. + (hw,reg,mem): Renamed from foo:. Update. All callers updated. + * rtx-funcs.scm (*): Update. + * rtl-c.scm (rtl-c-get): Update. + (rtl-c-set-quiet,rtl-c-set-trace): Update. + (s-c-call,s-c-raw-call): Update. + (s-boolifop,s-convop,s-if,s-cond): Update. + (s-case-vm,-gen-non-vm-case-test,s-case): Update. + (-par-replace-set-dests,-par-replace-set-srcs): Update. + (s-parallel,s-sequence): Update. + (rtl-c-build-table): Update. + * sem-frags.scm (-frag-hash-compute!): Update. + (-frag-cost-compute!): Improperly handle unary,binary,trinary ops + for temporary bug compatibility with previous version. + (-frag-expr-locals,-frag-expr-stmts): Update. + (-frag-compute-desired-frags,-frag-pick-best): Update. + * semantics.scm (-simplify-expr-fn): Update. + (rtx-simplify): Update. + (-rtx-ref-type): Update. Account for modifiers. + (-build-operand!,-build-reg-operand!,-build-mem-operand!): Update. + (-build-ifield-operand!): Update. + (-build-known-values): Update. + (semantic-compile): Update. + (-gen-reg-access-defns): Update. + (gen-semantic-code,-gen-sem-case): Update. + (-gen-sfrag-code,-gen-sfrag-case): Update. + * sim-cpu (gen-semantic-code): Update. + * sim.scm (,gen-write,cxmake-skip): Update. + (,gen-write,gen-set-macro,cxmake-get-raw): Update. + (-hw-cxmake-get): Update. + (,cxmake-get,gen-set-quiet,gen-write): Update. + (,cxmake-get): Update. + (,gen-type,gen-read,cxmake-get): Update. + (,gen-set-quiet,gen-set-trace): Update. + (,cxmake-get): Update. + (sim-finish!): Update. + * utils-gen.scm (-gen-ifld-extract-base): Update. + (-gen-ifld-extract-beyond): Update. + (gen-multi-ifld-extract): Update. + * sid-decode.scm (-decode-expr-ifield-values-used): Update. + * sid.scm (,gen-write): Update. + (-gen-decode-insn-globals): Update. + (-hw-cxmake-get): Update. + (,cxmake-get-raw): Update. + (,cxmake-get,gen-set-quiet,gen-write): Update. + (,cxmake-get): Update. + (,gen-type,gen-read,cxmake-get): Update. + (,gen-set-quiet,gen-set-trace): Update. + (,cxmake-get): Update. + (-create-virtual-insns!): Update. + (-decode-split-build-assertion): Update. + * *.cpu: Update. + * simplify.inc: Update. + +1999-08-20 Doug Evans + + * sim.scm (-op-gen-queued-write): Fix memory address calculation. + Prefix queue function name with sim_ instead of @cpu@_. + + * sim.scm (-with-parallel-only?): New global. + (option-init!): Initialize it. + (option-set!): Set it. + (with-parallel-only?): New proc. + * sim-decode.scm (-gen-decode-insn-globals): Don't include parallel + and writeback markers if with-parallel-only. + (-gen-idesc-init-fn): Update. + * sim-cpu.scm (cgen-cpu.h): Don't generate struct parexec if + with-generic-write. + +Wed Aug 18 15:04:30 1999 Doug Evans + + * sim-cpu.scm (-gen-semantic-fn-table): Handle unsupported insns + with the invalid insn handler. + + * utils.scm (list-maybe-ref): New proc. + + * mach.scm (-isa-parse): Signal error if isa wasn't specified in + define-arch. + (-mach-parse): Signal error if mach wasn't specified in define-arch. + + * i960.cpu (test*-*): Delete `expr' arg. + (test-op,branch-op): Update. + +1999-08-09 Doug Evans + + * sim.scm (gen-reg-getter-fn,gen-reg-setter-fn): New procs. + (gen-reg-access-decl): Replace `name' arg with `hw'. All callers + updated. + (gen-reg-access-defn): Ditto. + (-gen-hw-addr): Rewrite. + (-op-gen-queued-write): Rewrite. + * sim-cpu.scm (-gen-cpu-reg-access-decls): + (-gen-scache-semantic-fn): Handle with-generic-write. + (-gen-no-scache-semantic-fn): Ditto. + +1999-08-08 Doug Evans + + * utils-gen.scm (gen-define-ifmt-ifields): Tweak output. + + * sim.scm (-with-generic-write?): New global. + (option-init!): Initialize it. + (option-set!): Set it. + (with-generic-write?): New proc. + (-gen-hw-addr): New proc. + (-op-gen-queued-write): New proc. + (-op-gen-set-{quiet,trace}-parallel): Use it if with-generic-write?. + + * sim-cpu.scm (-gen-hardware-types): Output code with parallel support + turned off. + (-gen-sem-switch): Preserve existing with-parallel? value. + (-gen-sem-parallel-switch): Ditto. + (-gen-write-case): Add /indent support. + (cgen-write.c): Rewrite. + + * utils.scm (-current-print-state): New global. + (make-print-state): New proc. + (pstate-indent,pstate-set-indent!): New procs. + (pstate-cmd?,pstate-cmd-do): New procs. + (/indent): New global. + (/indent-set,/indent-add): New procs. + (string-write): Set -current-print-state. + (-string-write): New arg pstate, all callers updated. + Handle print-state commands. + (-string-list-flatten): New proc. + (string-list->string): Use it. + + * sim-cpu.scm (-gen-sem-fn-name): Move here from sim-decode.scm. + (-gen-sem-fn-table-entry): New proc. + (-gen-semantic-fn-table): New proc. + (-gen-scache-semantic-fn): Make fn static. + (-gen-no-scache-semantic-fn): Ditto. + (cgen-semantics.c): Define macro SEM_FN_NAME. + * sim-decode.scm (-gen-decode-insn-globals): Delete FMT,TYPE,IDX, + FAST,FULL. Update @cpu@_insn_sem contents. + (-gen-semf-fn-name): Delete. + (-gen-sem-fn-decls): Delete. + (-gen-idesc-decls): Output prototypes of @cpu@_sem_init_idesc_table, + @cpu@_semf_init_idesc_table. + (-gen-idesc-init-fn): Update. Don't initialize pointers to semantic + handlers here. + (cgen-decode.h): Print sfmt enum. + * sid-decode.scm (-gen-semf-fn-name): Delete. + * utils-gen.scm (gen-sfmt-enum-decl): New proc. + + * iformat.scm (sfmt-build): Rename sformats from fmt-foo to sfmt-foo. + (ifmt-compute!): Ditto. + * sim-decode.scm (-gen-decoder-switch): Ditto. + * sid-decode.scm (-gen-decode-expr-entry): Ditto. + (-gen-decoder-switch): Ditto. + + * insn.scm (insn-virtual?): New proc. + + * enum.scm (gen-enum-decl): Speed up, build string as list and then + convert to string. + * mach.scm (): attr-list is now a pair of lists. + (current-attr-list): Rewrite. + (current-attr-add!,current-attr-lookup): Rewrite. + * sim.scm (gen-cpu-insn-enum-decl): Replace append with append!. + +1999-08-06 Richard Henderson + + * ia64.cpu: Initial checkpoint. + +1999-08-06 Doug Evans + + * pmacros.scm (-pmacro-apply): Fix definition, takes only 1 arg. + (pmacros-init!): Update .apply help string. + +1999-08-03 Doug Evans + + * sim.scm (-hw-gen-set-quiet-pc): Update call to SEM_BRANCH_VIA_CACHE. + (,cxmake-skip): New method. + (,cxmake-skip): New method. + (-gen-argbuf-fields-union): Add branch_target to `chain' member. + (gen-argbuf-type): New member `skip_count'. + (sim-finish!): Update calls to @cpu@_pbb_cti_chain. + * utils-cgen.scm (atlist-cti?): Don't include SKIP-CTI insns. + + * utils-sim.scm: New file. + * dev.scm (load-sim): Load it. + (load-sid): Load it. + * cgen-sid.scm: Load it. + * cgen-sim.scm: Load it. + * iformat.scm (): New member sbuf, not initialized by + default make. + * rtx-funcs.scm (skip): Rewrite. + * rtl-c.scm (skip): Rewrite. + * m32r.cpu (sc,snc): Update `skip' usage. + * mode.scm (mode-real-mode): New proc. + * sem-frags.scm (-frag-split-by-sbuf): Rename from -frag-split-by-sfmt. + Distinguish fragments by the they use. + * sim.scm (gen-profile-index-type): Delete. + (ifield argbuf support): Move to utils-sim.scm and sim-decode.scm. + (-gen-ifld-decoded-val): Delete, use gen-extracted-ifld-value instead. + (hardware argbuf support): Move to utils-sim.scm and sim-decode.scm. + (operand argbuf support): Move to utils-sim.scm and sim-decode.scm. + (-gen-argbuf-elm): Rewrite. + (-gen-argbuf-hw-elm): Delete. + (-gen-argbuf-fields-union): Generate structs for each sbuf instead + of each sfmt. + (-sim-sformat-argbuf-list,-sim-insns-analyzed?): New globals. + (sim-init!): Initialize them. + (sim-analyze-insns!): Set them. + (current-sbuf-list): New proc. + * sim-cpu.scm (-gen-no-scache-semantic-fn): Update calls to + gen-sfmt-op-argbuf-defns,gen-sfmt-op-argbuf-assigns. + * sim-model.scm (-gen-model-insn-fn): Ditto. + * sim-decode.scm (-gen-extract-decls): Delete. + (-gen-record-argbuf-ifld,-gen-trace-argbuf-ifld): New procs. + (,gen-extract,gen-trace-extract): Move here from + sim.scm. + (,gen-extract,gen-trace-extract): Move here from + sid.scm. + ( + + * sid-cpu.scm (-gen-sem-switch-engine): Move definition of `count' + up to avoid g++ 'goto crosses initialization' warning. + (-gen-sfrag-engine-fn): Delete vpc arg to NEXT_FRAG. + (-gen-sfrag-case): Update use of NEXT_FRAG. + +1999-07-22 Doug Evans + + * cos.c (cos_init): Protect _make_x_symbol from garbage collection. + + * read.scm: Load sem-frags.scm. + * sem-frags.scm (*): Lots rewritten. + * sid.scm (-with-sem-frags?): New global + (with-sem-frags?): New proc. + (option-init!): Initialize -with-sem-frags?. + (option-set!): Recognize with-sem-frags. + (sim-init!): Call sim-sfrag-init! if with-sem-frags. + * sid-cpu.scm (cgen-sem-switch.cxx): Generate semantic frag version + if asked to. + (-gen-sfrag-engine-decls): New proc. + (-gen-sfrag-code,-gen-sfrag-case,-gen-sfrag-enum-decl): New procs. + (-gen-sfrag-engine-frag-table,-gen-sfrag-engine-fn): New procs. + (-gen-sfrag-engine): New proc. + (-gen-sem-case): Emit setup-semantics if specified. + (-gen-sem-switch-engine): Update init/use of computed goto label. + * sid-decode.scm (-gen-decode-expr-entry): Fetch ifield values + from local vars. + (-gen-idesc-decls): Replace sem_address with cgoto. + (-gen-scache-decls): Rewrite definition of `execute' member. + * arm.cpu (arm isa): Enable decode-splits. + * arm7.cpu (multiply insns): Rename result to mul-result. + + Rename decode-specialize to decode-split. + * decode.scm (*): Update. + * insn.scm (*): Update. + * mach.scm (*): Update. + * sid.scm (*): Update. + +1999-07-19 Doug Evans + + Record objects as a smob. + * cos.c (scm_tc16_object): New static global. + (cos_init): Initialize it. + (OBJECT_P,OBJECT_ELEMENTS,OBJECT_CLASS_DESC): Update macros. + (OBJECT_CLASS,OBJECT_ELEMENT_OFFSET): Update. + (_object_tag): Delete. + (_object_make_smob): New function. + (_object_make_x,_object_make_with_values_x): Rewrite. + (_object_elements,_object_class_desc): Rewrite. + (_object_copy,object_p): Rewrite. + (_object_specialize): Rewrite. + (_object_print_elms,_object_print): New functions. + (object_smob): New static global. + (default_make_x): Use OBJECT_ELEMENT_OFFSET instead of magic number. + + * cos.c (_make_x_symbol): New static global. + (object_make): Use it. + (cos_init): Initialize it. + +1999-07-15 Doug Evans + + * rtl-c.scm (ifield): Back out last patch, use estate-ifield-var? + instead to determine whether to use FLD macro. + (): New member ifield-var?. + (,vmake!): Recognize #:ifield-var?. + * utils-gen.scm (-gen-ifld-extract-base): Specify #:ifield-var? #f. + (-gen-ifld-extract-beyond,gen-multi-ifld-extract): Ditto. + + * rtl.scm (rtx-sequence-assq-locals): New proc. + + * cos.scm (-object-error): Don't crash on non-objects. + + * Makefile.am (CLEANFILES): Add hobbit. + * Makefile.in: Rebuild. + + * rtl-c.scm (s-c-call): Delete unnecessary code. + +1999-07-14 Doug Evans + + * rtl-c.scm (ifield): Always reference value via `FLD'. + + * cos.c (elm_bound_p): Return problem SCM boolean values. + + * utils-cgen.scm (display-argv): New proc. + * cgen-opc.scm (cgen): Call it. + * cgen-sim.scm (cgen): Ditto. + * cgen-gas.scm (cgen): Ditto. + * cgen-stest.scm (cgen): Ditto. + * cgen-sid.scm (cgen): Ditto. + +1999-07-05 Doug Evans + + * opc-asmdis.scm (-gen-parse-switch): New local var `junk'. + * opc-ibld.scm (-gen-insert-switch): Initialize result to NULL. + (-gen-extract-switch): Initialize result to 1. + * opcodes.scm (gen-ifield-default-type): New proc. + (gen-ifield-value-decl): Renamed from gen-ifield-type. All callers + updated. + (,gen-insert): Handle non-ifield indices. + (,gen-extract): Ditto. + (,gen-parse): Ditto. + (,gen-print): Ditto. + (,gen-parse): Ditto. + (,gen-print): Ditto. + (,gen-fget): Ditto. + (,gen-fset): Ditto. + + * sim.scm (-gen-hw-index-raw): Handle scalar indices. + (-gen-hw-index): Ditto. + * sid.scm (-gen-hw-index-raw): Handle scalar indices. + (-gen-hw-index): Ditto. + + * sem-frags.scm: New file. + + * attr.scm (attr-parse): Add better checking of input. + + * hardware.scm (-hw-parse-getter): Renamed from -hw-parse-get. + All uses updated. + (-hw-parse-setter): Renamed from -hw-parse-set. All uses updated. + + * ifield.scm (ifld-nil?): New proc. + + * operand.scm (): New members getter,setter. + (,make!): New args getter,setter. All uses updated. + (op:getter,op:setter): New procs. + (,field-start): Return 0 for non-ifield indices. + (,field-length): Return 0 for non-ifield indices. + (-operand-parse-getter,-operand-parse-setter): New procs. + (-operand-parse): New args getter,setter. All callers updated. + Always use hw-index-scalar for scalar operands. + (-operand-read): Handle getter,setter. + (define-full-operand): New args getter,setter. All uses updated. + * semantics.scm (-build-ifield-operand!): Update. + (-build-index-of-operand!): Update. + * sim.scm (,cxmake-get): If operand has getter, use it. + * simplify.inc (define-normal-operand): Update. + + * rtl.scm (abs,sqrt,cos,sin,min,max,umin,umax): New rtx fns. + * rtl-c.scm (s-unop): Indirect fp ops through fpu op vector. + (s-binop,s-cmpop,s-convop): Ditto. + (abs,sqrt,cos,sin,min,max,umin,umax): New rtx fns. + * sparc.cpu (insn-fmt2): Add FPOPS1,FPOPS2. + (fcc-tests): New insn-enum. + (fcc-value): Rename from fcc-type. + * sparcfpu.cpu: New file. All fp support moved here. + + * rtl.scm (): New member class. + (rtx-class-*?): New procs. + (def-rtx-node): New arg class. All callers updated. + (def-rtx-syntax-node,def-rtx-operand-node,def-rtx-dual-node): Ditto. + * rtx-funcs.scm (*): Specify class. + + * utils-cgen.scm (context-make-reader): New proc. + + * utils.scm (assert-fail-msg): New variable. + (assert): Use it. + (list-drop,list-tail-drop): New procs. + +1999-06-22 Doug Evans + + * desc-cpu.scm (-gen-hash-defines): Restore generation of + CGEN_MIN_INSN_SIZE deleted on March 22. + + * ifield.scm (,needed-iflds): New method. + (,needed-iflds): New method. + (ifld-needed-iflds): New proc. + (multi-ifield?): New proc. + * iformat.scm (): Delete member ifmt. New members length,iflds. + (-sfmt-search-key): Include insn length in key. + (-sfmt-order-iflds,-sfmt-used-iflds): New procs. + (): Delete members ifmt-key,sfmt-key. New member used-iflds. + (-ifmt-lookup-ifmt!): Compute key here. + (-ifmt-lookup-sfmt!): Compute key here. Delete arg ifmt. + All callers updated. + (ifmt-build): Delete arg desc. New args search-key,iflds. + All callers updated. + (sfmt-build): Delete args desc,ifmt. New args search-key,cti?, + in-ops,out-ops,sorted-used-iflds. All callers updated. + * minsn.scm (minsn-make-alias): Use insn-set-ifmt!. Update call + to ifmt-build. + * operand.scm (op-iflds-used): New proc. + * utils-gen.scm (gen-ifld-type): Move here from sim.scm + and sim-cpu.scm. + And from sid.scm,sid-cpu.scm as well. + (gen-ifld-extract-decl,-gen-ifld-extract-base): Ditto. + (-gen-extract-word,-gen-ifld-extract-beyond): Ditto. + (gen-ifld-extract,gen-multi-ifld-extract): Ditto. + (gen-extracted-ifld-value): Ditto. + (-extract-chunk-specs): Ditto. + (gen-define-ifields,gen-define-ifmt-ifields): Ditto. + (-extract-chunk,-gen-extract-beyond-var-list): Ditto. + (gen-extract-ifields,gen-extract-ifmt-ifields): Ditto. + (-extract-insert-subfields): New function. + * sim.scm (gen-record-argbuf-ifld): Renamed from gen-ifld-extract. + (gen-record-argvar-ifld): Renamed from gen-ifld-extract-argvar. + * sim-cpu.scm (-gen-extract-ifmt-macro): Replace calls to + gen-define-ifields with gen-define-ifmt-ifields. Ditto for + gen-extract-foo. + (-gen-no-scache-semantic-fn): Ditto. + (-gen-sem-case): Ditto. + (-gen-read-case): Update calls to gen-define-ifields, + gen-extract-ifields. + * sim-decode.scm (-gen-record-args): Update. + (-gen-sfmt-argvars-assigns): Update. + (-gen-extract-case): Update. + * sim-model.scm (-gen-model-insn-fn): Replace calls to + gen-define-ifields with gen-define-ifmt-ifields. Ditto for + gen-extract-foo. + * sid.scm (gen-ifld-argbuf-defn): Use gen-ifld-type. + (gen-record-argbuf-ifld): Rename from gen-ifld-extract. + (gen-record-argvar-ifld): Rename from gen-ifld-extract-argvar. + * sid-decode.scm (-gen-decode-expr-entry): Update calls to + gen-define-ifields, gen-extract-ifields. + (-gen-record-args): Update. + (gen-sfmt-argvars-assigns): Update. + (-gen-extract-case): Replace calls to gen-define-ifmt-ifields + with gen-define-ifields. Ditto for gen-extract-foo. + (-gen-decode-fn): Use gen-ifld-extract-decl/gen-ifld-extract + procs rather than method calls. + +1999-06-18 Doug Evans + + * sid.scm (-create-virtual-insns!): New local `context', pass it + to insn-read. + + * rtl.scm (-rtx-traverse): Output symbol shortcuts in source form, + (operand name) not (operand object), (local name) not (local object). + (rtx-traverse-with-locals): New proc. + (-compile-expr-fn): New proc. + (rtx-compile): Rewrite. + * rtl-c.scm (rtl-c-get): Handle operand/local names for src arg. + (rtl-c-set-quiet): Don't accept operand/local names for dest arg. + (rtl-c-set-trace): Ditto. + (operand define-fn): Recognize operand name argument. + (local define-fn): Recognize sequence temp name argument. + * rtx-funcs.scm (operand): Argument is operand name, not object, + so call current-op-lookup. + (local): Similarily, so call rtx-temp-lookup. + + * rtl.scm (rtx-field?): Use rtx-name instead of car. + (rtx-operand?): Ditto. + (rtx-pretty-name): Ditto. + (rtx-local-obj): Flag symbol argument as an error. + (rtx-local-name): New proc. + (rtx-sequence-locals,rtx-sequence-exprs): New procs. + + * rtl.scm (-rtx-traverse-operands): Fix debugging output of arg-types. + + * read.scm (debug-repl): Renamed from -debug-repl. All callers + updated. + + * arm7.cpu (do-word/byte-store): Use (trunc: QI rd) rather than + (and: QI rd #xff). + + * hobbit.scm (*reckless-s->c-fun-table*): Add fastcall4, fastcall6. + (*floats-s->c-fun-table*): Ditto. + * hobbit.c,hobbit.h: Rebuild. + * rtl.scm (-rtx-traverse-expr): Use fastcall6. + * semantics.scm (rtx-simplify): Use /fastcall-make. + + * iformat.scm (-sfmt-search-key): Don't include memory modes. + + * insn.scm (): Delete members condition, compiled-condition. + (,make!): Update + ( getters,setters): Update. + (-insn-parse,insn-read,define-full-insn): Update. + * minsn.scm (minsn-make-alias): Update. + * iformat.scm (ifmt-analyze): Delete insn-condition reference. + (ifmt-compute!): Ditto. + * sim.scm (sim-finish!): Update. + * simplify.inc: (define-normal-insn): Update. + * sid-cpu.scm (gen-semantic-code): Update. + + * iformat.scm (-ifmt-lookup-ifmt!): Use insn-set-ifmt!. + (-ifmt-lookup-sfmt!): Use insn-set-sfmt!. + (ifmt-compute!): Ditto. + +1999-06-16 Doug Evans + + * minsn.scm (minsn-compute-iflds): Print better error message for + missing ifields. + +1999-06-12 Doug Evans + + * rtl.scm (tstate->estate): Don't copy over expr-fn. + + * Makefile.am (HOBFLAGS): New variable. + (cgen-hob.c): Use it. + (hobbit.c): Use it. + (libcpu_a_SOURCES): Add hob-sup.c. + (hob-sup.o): New rule. + * Makefile.in: Rebuild. + * cgen.c: #include hob-sup.h. + (cgen_init_c): Call hobbit_init_support. + * hobbit.scm (*fastcall-make*,*c-symbol*): New variables. + (*special-scm->c-functions*): Add them. + (display-c-expression): Handle *c-symbol*. + (*reckless-s->c-fun-table*): Add *fastcall-make*, fastcall5. + (*floats-s->c-fun-table*): Ditto. + (normalize): Recognize /fastcall-make. + (normalize-fastcall-make): New proc. + * hobbit.c,hobbit.h: Rebuild. + * hob-sup.scm: New file. + * hob-sup.c: New file. + * hob-sup.h: New file. + * read.scm: Load hob-sup.scm. + * rtl.scm (-rtx-name-list): New variable. + (rtx-name-list): New proc. + (rtx-lookup): Try symbol first. + (def-rtx-node): Add name to -rtx-name-list. + (def-rtx-syntax-node,def-rtx-operand-node,def-rtx-macro-node): Ditto. + (-rtx-traverse-anymode): New proc. + (-rtx-traverse-{emode,intmode,floatmode,nummode,vmmode}): New procs. + (-rtx-traverse-{rtx,setrtx,testrtx,condrtx,casertx}): New procs. + (-rtx-traverse-{locals,env,attrs,symbol,string,number}): New procs. + (-rtx-traverse-{symornum,object}): New procs. + (-rtx-make-traverse-table): Rewrite. + (-rtx-traverse-operands): Rewrite arg-types handling. + Handle #f result of traverser. + (-rtx-traverse): Renamed from -rtx-traverse-normal. + Move debug handling here. + (-rtx-traverse-debug): Delete. + (rtl-finish!): Change -rtx-traverse-table into list of handlers + for each rtx. + * semantics.scm (semantic-compile:process-expr!): Fix call to + -rtx-traverse. + * utils.scm (map1-improper): New proc. + +1999-06-08 Doug Evans + + * arm.sim (h-tbit): Replace FUN-ACCESS with FUN-SET. + (h-mbits): Ditto. + * sid.scm (-hw-cxmake-get): s/FUN-ACCESS/FUN-GET/. + (-hw-gen-set-quiet): s/FUN-ACCESS/FUN-SET/. + (,cxmake-get): Tweak. + (sim-finish!): Delete FUN-ACCESS attribute. Create FUN-GET,FUN_SET. + +1999-06-07 Doug Evans + + * thumb.cpu (dnti): Delete timing spec. + (all insn): Update. + + * arm.cpu (arm isa): New fields condition, setup-semantics. + (thumb isa): New field setup-semantics. + (h-gr): Add attribute CACHE-ADDR. + * arm7.cpu (dnai): Delete condition. + (eval-cond): Delete. + + * mach.scm (): New member setup-semantics. + (-isa-parse-setup-semantics): New proc. + (-isa-parse): New arg setup-semantics. + (-isa-read): Recognize setup-semantics. + + * sid-cpu.scm (gen-extract-fields): Split into two: + gen-extract-ifields, gen-extract-ifmt-ifields. + (-gen-scache-semantic-fn): Delete `taken_p'. Delete + tracing begin/end messages (done by caller now). + (-gen-sem-case): Delete `taken_p'. Add npc,br_status. Delete + tracing begin/end messages (done by x-before,x-after virtual insns). + (-gen-sem-switch-engine): Redo vpc initialization. Save vpc at + end so don't have to look it up again next time. + * sid-decode.scm (-decode-expr-ifield-values): New proc. + (-decode-expr-ifield-tracking-key): New proc. + (-decode-expr-ifield-tracking): New proc. + (-decode-expr-ifield-values-used): New proc. + (-decode-expr-ifield-mark-used!): New proc. + (-gen-decode-expr-set-itype): New proc. + (-gen-decode-expr-entry): Rewrite. + (-gen-decode-table-entry): New proc. + (-gen-decoder-switch): Use it. + (-gen-virtual-insn-finder): New proc. + (-gen-argbuf-elm): Move here from sid.scm. + (-gen-argbuf-hw-elm): Ditto. + (-gen-argbuf-fields-union): Add entries for chain,before insns. + (-gen-scache-decls): Add `cond' member to @prefix@_scache for + conditional-execution isas. + (-gen-decode-fn): Record conditional-exec ifield. + * sid.scm (-current-pbb-engine?): New global. + (current-pbb-engine?,set-current-pbb-engine?!): New procs. + (,gen-ifld-extract): New arg `indent'. + (,gen-ifld-extract): Ditto. + (-hw-gen-set-quiet-pc): Add pbb support. Delete `taken_p'. + (-op-gen-set-trace): Don't print tracing messages for pbb engine. + (-gen-arch-model-decls): Only scan real insns. + (scache-engine-insns,pbb-engine-insns): New procs. + (-create-virtual-insns!): New proc. + (sim-finish!): Call it. + (-decode-specialize-insn?): New proc. + (-decode-specialize-build-assertion): New proc. + (-decode-specialize-insn-1): New proc. + (-decode-specialize-insn): New proc. + (-fill-sim-insn-list!): New proc. + (sim-analyze!): Create copies of insns to be specialized. + * utils-cgen.scm (obj-set-name!): New proc. + + * attr.scm (-attr-eval): Rewrite calls to rtx-simplify/rtx-compile. + * iformat.scm (ifmt-analyze): Pass `insn' to semantic-compile, + semantic-attrs. + (ifmt-compute!): Delete arg `arch'. Result is list of iformats, + sformats. + * mach.scm (arch-analyze-insns!): Update call to ifmt-compute!. + * rtl-c.scm (rtl-c-get): Use DM for default mode instead of VM. + Avoid infinite loop when rtx-eval-with-estate leaves expr alone. + (attr): Rewrite test for insn owner. + (member): New rtx function. + * rtl.scm (rtx-* accessors): Define as cxr directly rather than + as separate function. + (rtx-ifield?,rtx-ifield-name): New procs. + (rtx-operand-obj): Rewrite. + (rtx-operand-name): New proc. + (rtx-cmp-op-mode,rtx-cmp-op-arg): New procs. + (rtx-number-list-values,rtx-member-value,rtx-member-set): New procs. + (tstate-make): New args owner, known. All callers updated. + (tstate-known-lookup): New proc. + (rtx-traverse): New arg owner. All callers updated. + (rtx-make-bool): New proc. + (rtl-find-ifields): Rewrite. + (rtx-simplify,rtx-simplify-eq-attr-{insn,mach}): Moved to ... + * semantics.scm: ... here. + (rtx-const-equal,rtx-const-list-equal): New procs. + (-build-known-values): New proc. + (semantic-compile): New arg `insn'. Call rtx-simplify. + (semantic-attrs): Ditto. + * rtx-funcs.scm (member,number-list): New rtx functions. + + * attr.scm (attr-remove-meta-attrs-alist): Delete leading '-' in name. + Rewrite. Delete arg `all-attrs'. All callers updated. + (attr-remove-meta-attrs): Delete leading '-' in name. All callers + updated. + * utils-cgen.scm (gen-bool-attrs): Remove meta attrs. + + * decode.scm (subdtable-add): Handle `expr' entries. + (exprtable-entry-make): Use vector. Record ifields refered to by expr. + (exprtable-entry-*): Update. + (exprtable-entry-iflds): New proc. + (exprentry-cost): New proc. + (exprtable-sort,-gen-exprtable-name): New procs. + (exprtable-make): New arg `name'. All callers updated. use vector. + (exprtable-*): Update. + (-build-decode-table-entry): Don't issue collision warning if all are + specialized insns. Sort exprtable entries before building table. + + * read.scm (-reader-process-expanded-1): Move pretty printing of + input to logging level 4. + + * utils.scm (string-list->string): New proc. + + * insn.scm (): Define setters for ifield-assertion, condition, + semantics. + (insn-read): Delete leading '-' in name. All callers updated. + (real-insn?): New proc. + (real-insns): Rewrite. + (insn-has-ifield?): New proc. + (insn-builtin!): Create insn attribute SPECIALIZED. + + * mach.scm (): Delete member app-data. + (current-raw-insn-list): New proc. + (insn-list-car,insn-list-splice!): New procs. + (): New class. + (-isa-parse-decode-specialize): New proc. + (-isa-parse-decode-specializes): New proc. + (): New members `condition', `decode-specializes'. + (-isa-parse-condition): New proc. + (-isa-parse): New args condition, decode-specializes. + (-isa-read): Recognize condition, decode-specializes. + (-isa-add-decode-specialize!): New proc. + (modify-isa): New proc. + (isa-conditional-exec?,state-conditional-exec?): New procs. + (arch-init!): New reader command `modify-isa'. + + * mode.scm (mode-class-signed?,mode-class-unsigned?): New procs. + (mode-signed,mode-unsigned?): New procs. + +Thu Jun 3 16:00:40 1999 Doug Evans + + * types.scm (): New method get-shape. + * hardware.scm (): Forward get-shape,get-num-elms + onto type. + (hw-shape,hw-num-elms): New procs. + * sim.scm (,gen-profile-index-type): Use "unsigned short" + if there's more than 255 registers. + * sid.scm (,gen-profile-index-type): Ditto. + + * hardware.scm (-hw-parse): Flag as error CACHE-ADDR specified + with get/set specs. + +1999-05-21 Doug Evans + + * cgen-sid.scm (sim-arguments): Add -X. + * sid-cpu.scm (-gen-hardware-types): Comment out scache vars. + (-gen-all-semantic-fns): Don't include PBB support virtual insns. + (-gen-sem-case): Use CASE/NEXT macros again. Tweak indenting. + Simplify by supporting pbb engine only. + (-gen-sem-switch-init): New proc. + (-gen-sem-switch-engine): Rename from -gen-sem-switch-fn. + (cgen-sem-switch.cxx): New proc. + * sid-decode.scm (-gen-decode-insn-globals): Replace with-sem-switch? + with with-pbb?. Support dual scache/pbb engines. + (-gen-idesc-decls): Replace with-sem-switch? with with-pbb?. + Support dual scache/pbb engines. + (cgen-decode.h): Generate semantic fn decls if with-scache?. + * sid.scm (*) with-pbb? replaces with-sem-switch?. + (sim-finish!): Create pbb support virtual insns if with-pbb?. + +1999-05-10 Ben Elliston + + * arm7.cpu: Remove coprocessor related fields, operands and insn + definitions for now. Take the undefined instruction trap instead. + (ldmda-wb): New instruction. + (ldmib-wb): Likewise. + (ldmdb-wb): Likewise. + (stmdb-wb): Likewise. + (stmib-wb): Likewise. + (stmda-wb): Likewise. + +1999-05-08 Doug Evans + + * sid.scm (,cxmake-get): Call GETMEM method, not function. + (,gen-set-quiet): Call SETMEM method, not function. + + * utils-cgen.scm (keyword-list->arg-list): Fix call to substring, + hobbit can't handle optional third arg. + +1999-05-07 Doug Evans + + * arm.cpu (h-tbit): Delete set spec. + (h-mbits): Don't call arm_mbits_set in set spec. + * arm.sim: New file. + * hardware.scm (modify-hardware): New proc. + (hardware-init!): Add modify-hardware command. + * sid.scm (-hw-cxmake-get): Use method call if FUN-ACCESS specified. + (-hw-gen-set-quiet): Ditto. + (sim-finish!): Call invalid_insn method. Define FUN-ACCESS builtin + hardware attribute. Load $arch.sim file if present. + * utils-cgen.scm (keyword-list?): New proc. + (keyword-list->arg-list,arg-list-validate-name): New procs. + (arg-list-check-no-args,arg-list-symbol-arg): New procs. + + * arm7.cpu (eval-cond): Pass pc to @cpu@_eval_cond handler. + + * sid-cpu.scm (-gen-hardware-types): Rename @cpu@_cpu to + @cpu@_cpu_cgen. + + * attr.scm (obj-prepend-atlist!): New proc. + + * opc-opinst.scm (cgen-opinst.c): Analyze instructions if necessary. + + * sid.scm (,profilable?): Use op:type. + * sim.scm (,profilable?): Use op:type. + +1999-05-04 Doug Evans + + * utils.scm (find-index,find): Be more stack friendly. + + * arm7.cpu (arith-imm-op): Compute pc before setting cpsr. + (bic-imm): Ditto. + +1999-05-01 Doug Evans + + * arm.cpu (h-gr-usr): New hardware element. + (h-gr-fiq,h-gr-svc,h-gr-abt,h-gr-irq,h-gr-und): New hardware elements. + (arm-mode): New keyword. + (h-mbits): Add set spec. + (h-spsr): Implement get/set specs. + + * read.scm: Load slib/pp.scm, slib/genwrite.scm. + (-reader-process-expanded-1): Pretty print logging output. + + * sid-cpu.scm (-gen-reg-access-defns): Make getters `const'. + (cgen-cpu.h): Print enums before hardware elements. + (cgen-semantics.cxx): @arch@-cgen.h renamed to @arch@-main.h. + * sid-decode.scm (cgen-decode.cxx): Ditto. + * sid-model.scm (cgen-model.cxx): Ditto. + + * utils-cgen.scm (context-error): Accept variable number of + trailing args. + + * rtx-funcs.scm (error:): New rtx function. + * rtl-c.scm (s-case-vm): New proc. + (-gen-non-vm-case-get,s-case-non-vm): New procs. + (s-case): Simplify, handle non-VM result. + (error:): New rtx function. + +1999-04-30 Doug Evans + + * arm.cpu (h-pc): Add set spec to zero bottom bits. + (test-hi,test-ls): Fix cbit handling. + (shift-type,h-operand2-shifttype): Move here ... + * arm7.cpu: ... from here. + (set-cond,set-cond-maybe,dnix): Delete, unused. + (set-zn-flags,set-logical-cc,set-add-flags,set-sub-flags): Move ... + * arm.cpu: ... to here. + * thumb.cpu (cmp,alu-cmp): Use set-sub-flags. + (alu-cmn): Use set-add-flags. + (alu-tst): Use set-zn-flags. + (alu-cmp): Use set-sub-flags. + (lsl,lsr,asr): Set condition codes. + (add,addi,sub,subi,mov,addi8,subi8): Ditto. + (alu-op): Split into three: alu-logical-op,alu-arith-op, + alu-shift-op. + (hireg-op): Split sem-fn into lo-dest-sem-fn,hi-dest-sem-fn. + All callers updated. + (sub-sp): Rename from add-sp-neg. + (f-lbwl-offset): Delete. + (f-lbwl-hi,f-lbwl-lo): New ifields. + (lbwl-hi,lbwl-lo): Update. + (bl-hi): Add 4 to pc. + (push-reg,pop-reg): Simplify. + (push,push-lr): Push registers in correct order. + (pop,pop-pc): Pop registers in correct order. + (save-reg-inc,load-reg-inc): Simplify. + (ldmia): Save registers in correct order. + +1999-04-30 Ben Elliston + + * arm7.cpu (f-op-hdt): Remove; unused. + (f-ror-imm8-value,f-ror-imm-rotate): New fields. + (f-ror-imm8): New multi-ifield. + (f-operand2-bit7): Remove; use the generic `f-bit7' instead. All + callers updated. + (f-uimm12): New field. + (ror-imm8): New operand. + (uimm12): Likewise. + (hdt-offset8): Reinstate operand. + (offset4-hi,offset4-lo): Remove. + (set-cond): Remove macro; unused. + (set-cond-maybe): Likewise. + (load-word/byte): Use uimm12 operand for a true 12-bit immediate. + (store-word/byte): Likewise. + (load-halfword): Use hdt-offset8 multifield operand instead of two + 4-bit operands that are explicitly combined by semantic code. + (do-halfword-store): Bug fix. Set address when not preindexing. + (store-halfword): Also use hdt-offset8 operand. + (arith-op): Avoid clobbering source registers when one of them is + the destination register. + (arith-imm-op): Likewise. + (tst-imm): Use ror-imm8 operand. Handle special case of rot 0. + (teq-imm): Likewise. + (ldm-p): Rename to ldmdb. + (stm-pw): Rename to stmdb-wb. + (multi-action): New macro; test reg-list bits and execute a + semantic fn if the bit is set. + (ldmda,ldmib,ldmia,ldmia-wb,ldmdb): New multiple load insns. + (stmdb,stmib,stmia,stmia-wb,stmda,stmdb-wb): Store insns. + (all insns): Use dnai entries for simplicity rather than dni. + (*): Use short-form of (const ..). + +1999-04-29 Doug Evans + + * rtl.scm (): Rename member type to style. Rename + member eval to evaluator. + (rtx-foo accessors): Rename from rtx:foo. All callers updated. + (tstate-make): Delete arg op-fn. All callers updated. + (tstate-op-fn,tstate-set-op-fn!): Delete. + (rtx-traverse): Delete op-fn arg. All callers updated. + * semantics.scm (-simplify-for-compilation-process-expr): New proc, + split out of -simplify-for-compilation. + + * Makefile.am (CGEN_NONHOB_FILES,CGENFILES): New variables. + (cgen_DEPENDENCIES): Add stamp-cgen. + (stamp-cgen): New rule. + * Makefile.in: Rebuild. + + * rtl-c.scm (enum:): Define emitter for. + * rtl.scm (rtx-constant?): Rename from rtx-const? and check for + enums as well. + (rtx-constant-value,rtx-enum-value): New procs. + (-rtx-traverse-normal): Expand enum-value to (enum enum-value). + (rtx-compile-time-constant?): Return #t for enums. + (rtx-true?,rtx-false?): Handle enums. + (rtx-simplify-eq-attr-mach): Use rtx-true,rtx-false instead of + building result by hand. + (rtx-simplify-eq-attr-insn): Ditto. + * rtx-funcs.scm (enum:,enum): New rtx functions. + + * mach.scm (): New members insns-analyzed?, semantics-analyzed?, + aliases-analyzed?. + (arch-analyze-insns!): New proc. + * opcodes.scm (opcodes-analyze!): Call arch-analyze-insns! instead + of calling ifmt-compute! directly. + * sid.scm (-sim-insns-analyzed?): Delete. + (sim-analyze!): Call arch-analyze-insns! instead of calling + ifmt-compute! directly. + * sim.scm (-sim-insns-analyzed?): Delete. + (sim-analyze!): Call arch-analyze-insns! instead of calling + ifmt-compute! directly. + + * utils.scm (string-take-with-filler): New proc. + (string-take): Use it. + + * pgmr-tools.scm: New file. + * read.scm: Load it. + * insn.scm (pretty-print-insn-format): Move to pgmr.scm. + + * insn.scm (insn-base-mask): Renamed from insn:mask. + All callers updated. + (insn-base-mask-length): Renamed from insn:mask-length. + All callers updated. + (insn-foo): Renamed from insn:foo. All callers updated. + * minsn.scm (minsn-foo): Renamed from minsn:foo. All callers updated. + * iformat.scm (compute-insn-base-mask-length): Renamed from + compute-insn-mask-length. All callers updated. + (compute-insn-base-mask): Renamed from compute-insn-mask. + All callers updated. + + * enum.scm (-enum-parse-prefix): New proc. + (,make!): Don't parse enum values here. + (-enum-parse): Do it here. Call -enum-parse-prefix. + (define-full-insn-enum): Ditto. + (enum-vals-upcase): New proc. + * hardware.scm (define-keyword): Make enum prefix uppercase. + * hobscmif.h (CHAR_LOWERP,CHAR_UPPERP,CHAR_WHITEP): New macros. + + * ifield.scm (,field-mask): Allow container to be #f. + (,field-extract): New method. + (,field-extract): New method. + (ifld-extract): New proc. + * opcodes.scm (ifld-insert-fn-name): Renamed from ifld-insert. + (ifld-extract-fn-name): Renamed from ifld-extract. + + * ifield.scm (ifld-new-value): Renamed from ifield-make. + All callers updated. + + * ifield.scm (ifld-lsb0?): New proc. + (sort-ifield-list): New arg up?. All callers updated. + * iformat.scm (compute-insn-mask): Get lsb0? flag from argument, + rather than global state. + +1999-04-27 Doug Evans + + * insn.scm (pretty-print-insn-format): New proc. + + * Makefile.in: Rebuild. + * aclocal.m4: Rebuild + * configure: Rebuild. + +Mon Apr 26 10:30:18 1999 Doug Evans + + * configure.in (AM_INIT_AUTOMAKE): Update version to 0.7.2. + * configure: Rebuild. + * aclocal.m4: Rebuild. + * Makefile.in: Rebuild. + * doc/Makefile.in: Rebuild. + * doc/version.texi: Rebuild. + +1999-04-25 Doug Evans + + * utils.scm (bits->bools): New proc. + +1999-04-23 Doug Evans + + * sid.scm (,gen-ifld-extract-decl): Fix call to + subfield's gen-ifld-extract-decl method. + +1999-04-23 Ben Elliston + + * arm7.cpu (ldrsh-pu): Remove. + (do-halfword-load): New pmacro. + (load-halfword): Likewise. + (do-halfword-store): Likewise. + (store-halfword): Likewise. + (strh-*): New instructions. + (ldrsb-*): Likewise. + (ldrh-*): Likewise. + (ldrsh-*): Likewise. + +1999-04-22 Doug Evans + + * ifield.scm (ifld-constant?): Delete special handling of RESERVED + fields. + + * arm7.cpu (do-word/byte-store): Fix typo. + +1999-04-22 Ben Elliston + + * arm7.cpu (do-word/byte-load): Handle cases where the destination + register is the program counter (R15). + + * arm7.cpu (do-word/byte-store,store-word/byte): New pmacros. + (str-*): Implement using store-word-byte. Remove older versions. + (bic): Use the `inv' rtx for obtaining bitwise complements. + (bic-imm): Likewise. + (mvn): Likewise. + (mvn-imm): Likewise. + (store-indev-reg): Remove crufty pmacro. + (load-indiv-reg): Likewise. + (ldm-p): Reverse the order of register processing for decrement. + (stm-p): Likewise. + (stbi): Remove; handled by the str-* insns. + +1999-04-21 Doug Evans + + * thumb.cpu (cmp): Fix carry bit computation. + (alu-cmp): Ditto. + +1999-04-20 Doug Evans + + * arm.cpu (h-tbit): Specify set spec. + (h-cpsr): Ditto. + * arm7.cpu (bx): Don't call C routine, just set h-tbit. + (set-sub-flags): Interpret "carry bit" as a borrow. + (all sub/cmp insns): Carry bit is actually a borrow bit. + * thumb.cpu (bx-rs,bx-hs): Don't call C routine, just set h-tbit. + (add-carry,sub-carry,thumb-neg,thumb-bic,thumb-inv): Delete. Use + .pmacro instead. + (hireg-add,hireg-cmp,hireg-move): Ditto. + + * read.scm (-CGEN-VERSION): Change version to 0.7.2. + (-CGEN-LANG-VERSION): Ditto. + +1999-04-18 Doug Evans + + * pmacros.scm (-pmacro-make): New arg `default-values', + all callers updated. + (-pmacro-default-values): New proc. + (-pmacro-process-keyworded-args): New proc. + (-pmacro-process-args): New proc. + (-pmacro-invoke): Process arguments before expanding macro. + (-pmacro-get-arg-spec,-pmacro-get-default-values): New procs. + (define-pmacro): Handle default values specified in arg list. + * rtl.scm (rtx-alu-op-mode,rtx-alu-op-arg): New procs. + (rtx-boolif-op-arg[01]): New procs. + (rtx-true,rtx-false,rtx-canonical-bool): New procs. + (rtx-simplify): Handle not,orif,andif. + * semantics.scm (-simplify-for-compilation): Simplify not,orif,andif. + * utils.scm (alist-copy): New proc. + * arm7.cpu (do-word/byte-load,load-word/byte): New pmacros. + (ldr*): Rewrite. + (swi): Explicitly set pc. + + * thumb.cpu (bx-rs,bx-hs): Reverse test for switch to arm mode. + +1999-04-17 Ben Elliston + + * arm7.cpu (ldr-pu): Do not add 8 to R15; the step() method + correctly adjusts the program counter now. + + * arm7.cpu (f-halfword?): Rename from `f-hdt-halfword?'. + (f-signed?): Rename from `f-hdt-signed?'. + (f-offset4-hi): Rename from `h-hdt-off4-ms'. + (f-offset4-lo): Rename from `h-hdt-off4-ls'. + (f-hdt-offset8): Use new field names. + (ldr): Use `imm12' field, not `offset12', since we do our own + address arithmetic. + (str, str-*): Likewise. + (ldu-*): Remove most; better not implemented than broken. + (ldrh*): Likewise. + (ldrsh-pu): New insn. + (stri): Likewise. + (stri-p): Likewise. + (stbi): Likewise. + (ldm-p): Likewise; replace (load-indiv-reg) version. + +1999-04-15 Doug Evans + + * arm.cpu (h-pc): Delete VIRTUAL attribute, get/set specs. + * arm7.cpu (*): Fix mode of result of arm_compute_carry_out_*. + (*): Explicitly specify mode in c-call. + (logical-op): Recognize sets of h-gr[15] as sets of pc. + (arith-op): Ditto. + (and-imm,orr-imm,xor-imm,mov-imm,bic-imm,mvn-imm): Ditto. + (arith-imm-op): New pmacro. + (add-imm,adc-imm,sub-imm,sbc-imm,rsb-imm,rsc-imm): Use it. + * thumb.cpu (bx-rs,bx-hs): Rewrite. + +1999-04-14 Doug Evans + + * rtl.scm (rtx-simplify-eq-attr-insn): Fix call to context-error. + + * rtl.scm (rtl-find-ifields): Implement. + + * utils-gen.scm: New file. + * read.scm: Load it. + * desc.scm: Move generic attribute code to utils-gen.scm. + * Makefile.am (CGEN_HOB_INPUT_FILES): Add it. + * Makefile.in: Rebuild. + + * arm7.cpu (R15-OFFSET): New attribute. + (dnai): New pmacro. + (logical-op): Delete arg `result?'. All callers updated. Use dnai. + Delete use of eval-cond (dnai specifies it). Specify R15-OFFSET of 12 + for reg-shift version. + (arith-op): Ditto. + (data processing insns): Reorganize. Use dnai. + + * attr.scm (attr-kind): New proc. + (attr-list-enum-list): Rewrite. + (-attr-sort): Split result into two lists, bools and non-bools. + (current-attr-list-for): Update. + + * cgen-sid.scm (sim-arguments): Add -H -> build desc.h file. + * sid-cpu.scm (-gen-attr-decls): New proc. + (-gen-insn-attr-decls): New proc. + (cgen-desc.h): New proc. + (cgen-cpu.h): Put everything in @cpu@ namespace. + (gen-parallel-exec-type): Change prefix of parexec struct from + @cpu@ to @prefix@. + (-gen-trace-record-type): Ditto for trace_record struct. + (-gen-write-case): Update. + (-gen-scache-semantic-fn): Change function prefix from @cpu@ to + @prefix@. Update scache struct references. + (-gen-sem-case): Update scache struct references. + (-gen-sem-switch-fn): Update idesc struct reference. + Update insn_type enum reference. + (cgen-write.cxx): Update scache,argbuf references. + (cgen-semantics.cxx): Simplify namespace choice (always @cpu@). + * sid-decode.scm (IDESC-TABLE-VAR): Change prefix of insn_data + from @cpu@ to @prefix@. + (-gen-decode-insn-entry): Use gen-cpu-insn-enum. + (-gen-decode-expr-entry): Ditto. Change prefix of INSN_X_INVALID + from @CPU@ to @PREFIX@. + (-gen-decoder-switch): Change prefix of INSN_X_INVALID + from @CPU@ to @PREFIX@. + (-gen-decode-insn-globals): Generate insn attributes. + (-gen-sem-fn-name): Change function prefix from @cpu@ to @prefix@. + (-gen-sem-fn-decls): Use -gen-sem-fn-name. Add `using' for + semantic fn typedef. + (-gen-idesc-decls): Simplify cpu class name (always @cpu@_cpu). + Change prefix of scache struct from @cpu@ to @prefix@. + Change prefix of semantic fn typedef from @cpu@ to @prefix@. + Change prefix of idesc struct from @cpu@ to @prefix@. + Change prefix of insn_type enum from @cpu@ to @prefix@. + (-gen-argbuf-fields-union): Change prefix of sem_fields union + from @cpu@ to @prefix@. + (-gen-scache-decls): Change prefix of scache struct from + @cpu@ to @prefix@. Update idesc struct name. + Update decode,execute methods. + (-gen-extract-case): Update to type name changes. + (-gen-decode-fn): Ditto. + (cgen-decode.h): Put everything in @cpu@ namespace (except + semantic fn decls). Change prefix of insn_word from @cpu@ to @prefix@. + (cgen-decode.cxx): Add using namespace @cpu@. + * sid-model.scm (-gen-hw-profile-decls): Change prefix of + model_mark_get/set from @cpu@ to @prefix@. + (gen-model-unit-fn-name): Change function prefix from @cpu@ to + @prefix@. + (gen-model-fn-decls): Update idesc struct name. Change prefix + of model_insn_before/after from @cpu@ to @prefix@. + (-gen-model-insn-fn): Update scache/idesc/argbuf struct names. + Update insn_word type name. + (-gen-model-timing-table): Update INSN_TIMING struct name. + (-gen-model-init-fn): Update MODEL_DATA struct name. + (-gen-mach-defns): Update name of init_idesc_table fn. + (cgen-model.cxx): Add using namespace @cpu@. + * sid.scm (gen-cpu-class): Delete. + (gen-attr-type): New proc. + (gen-obj-attr-sid-defn): New proc. + (,gen-profile-code): Update name of model_mark_get/set fn. + (gen-cpu-insn-enum-decl): Change prefix of insn_type enum from + @CPU@ to @PREFIX@. + (gen-cpu-insn-enum): Update name of insn enum. + * thumb.cpu (bx-rs): Rename @cpu@_do_bx to @prefix@_do_bx. + (bx-hs): Ditto. + (swi): Rename @cpu@_swi to @prefix@_swi. + + * decode.scm (-build-decode-table-entry): Remove heuristic for + distinguishing insns, and use insn ifield-assertion specs. + + * desc-cpu.scm (gen-A-attr-mask): Simplify. + (gen-ifld-defns): Boolean attributes begin at number 0 now. + (gen-hw-table-defns,gen-operand-table,gen-insn-table): Ditto. + * opc-itab.scm (-gen-macro-insn-table): Ditto. + * utils-cgen.scm (gen-attr-enum-decl): Change type arg to prefix, + all callers updated. + (gen-attr-name): New proc + (gen-attr-mask): Use it. Boolean attributes start at 0 now. + (gen-obj-attr-defn): Delete num_nonbools count. + + * iformat.scm (ifmt-analyze): Handle insn-condition. + (ifmt-compute!): Ditto. + * insn.scm (): Specify default value for condition, + post-cond-trap,compiled-condition,compiled-semantics. + (,make!): New arg condition. + (): Add getters for condition,compiled-condition. + (-insn-parse): New arg condition, all callers updated. + (-insn-read): Recognize condition spec. + (define-full-insn): New arg condition. + * minsn.scm (minsn-make-alias): Update call to (make ...). + * semantics.scm (semantic-compile): Change arg sem-code to + sem-code-list. + (semantic-attrs): Ditto. + * sim.scm (sim-finish!): Update calls to define-full-insn. + * simplify.inc (define-normal-insn): Update call to define-full-insn. + * sid-cpu.scm (gen-semantic-code): Handle insn-condition. + * sid.scm (sim-finish!): Update call to define-full-insn. + +Tue Apr 13 17:04:34 1999 Doug Evans + + * Makefile.am (sim-cpu): Allow specification of ISA. + * Makefile.in: Rebuild. + +Sun Apr 11 00:37:56 1999 Jim Wilson + + * i960.cpu (sll-expr, srl-expr, sra-expr): Handle large shift counts. + +1999-04-10 Doug Evans + + * sparccom.cpu (check-fp-enable): Wrap TRAP32_FP_DIS in c-code. + + * arm.cpu (gr-names): Put pc first so it gets prefered in disassembly. + + * attr.scm (atlist?): New proc. + (-attr-eval): Rewrite. + (attr-parse): New proc. + (atlist-parse): Use it. + + * decode.scm (exprtable-entry-make): New proc. + (exprtable-entry-insn,exprtable-entry-expr): New procs. + (exprtable-make,exprtable-insns): New procs. + + * hardware.scm (hw-mode-ok?): Delete argument `set?'. + All uses updated. + (hardware-builtin!): Make h-memory a vector. + + * iformat.scm (ifmt-ifields): Renamed from ifmt-fields. + All callers updated. + (ifmt-analyze): Use csem-* accessors on result of semantic-compile. + + * insn.scm (). Rename ifld-assertions to ifield-assertion. + All uses updated. + (-insn-parse): Set semantics to #f if not specified. + (define-insn,define-full-insn): Take out code that ignores ALIAS's + if simulator. + (-parse-insn-format): Recognize `=' iformat spec. + + * mach.scm (isa-min-insn-bitsize): Ignore ALIAS's. + (isa-max-insn-bitsize): Ditto. + + * opcodes.scm (,gen-insert): Call rtl-c instead of + rtl-c-with-alist. + (,gen-extract): Ditto. + (,gen-insert,gen-extract): Ditto. + * sid-cpu.scm (-gen-reg-access-defns): Ditto. + (gen-define-ifmt-ifields): New proc. + (gen-semantic-code): Rewrite. + * sid-decode.scm (-gen-decode-expr-entry): New proc. + (-gen-decoder-switch): Handle expression tables. + (-gen-extract-case): Call gen-define-ifmt-ifields instead of + gen-define-fields. + * sid-model.scm (-gen-model-insn-fn): Call gen-define-ifmt-ifields + instead of gen-define-fields. + * sid.scm (,gen-ifld-extract-decl): New arg `indent', all + callers updated. + (,gen-ifld-extract): Ditto. + (<*>,cxmake-get,gen-set-quiet,gen-set-trace,gen-write): Update to new + rtl evaluation code. + (op:read): Build an to pass to gen-read. + (op:write): Build an to pass to gen-write. + (op:record-profile): Build an to pass to + gen-record-profile. + * sim-cpu.scm (gen-semantic-code): Rewrite. + * sim.scm (-gen-ifld-extract-base): Call rtl-c instead of + rtl-c-with-alist. + (-gen-ifld-extract-beyond): Ditto. + (,gen-ifld-extract): Ditto. + (,gen-get-macro,gen-set-macro): Ditto. + (<*>,cxmake-get,gen-set-quiet,gen-set-trace,gen-write): Update to new + rtl evaluation code. + (op:read): Build an to pass to gen-read. + (op:write): Build an to pass to gen-write. + (op:record-profile): Build an to pass to + gen-record-profile. + + * operand.scm (): Give `selector' default value of #f. + Give `num' default value of -1. Give `cond?' default value of #f. + (op:new-mode): Delete arg `set?', all uses updated. + + * read.scm (reader-error): Handle #f return from port-filename. + (-init-parse-cpu!): Call rtl-c-init!. + (reader-install-builtin!): Call rtl-builtin!. + + * rtl-c.scm: New file. + * semantics.scm: New file. + * read.scm: Load them. + * rtl.scm: C generation moved to rtl-c.scm. Semantic analysis moved + to semantics.scm. + (): Delete members syntax?,macro,c,expr. New members + type,eval,num. + (rtx-lookup): Renamed from -rtx-func-lookup. All callers updated. + (-rtx-num-text,-rtx-max-num): New globals. + (def-rtx-operand-node,define-rtx-operand-node): New procs. + (-rtx-macro-lookup): New proc. + (rtx-lvalue-mode-name): Renamed from rtx-expr-mode-name. + (rtx-env-stack-empty?,rtx-env-stack-head): New procs. + (rtx-env-var-list,rtx-env-empty-stack,rtx-env-init-stack1): New procs. + (rtx-env-make,rtx-env-empty?,rtx-env-make-locals): New procs. + (rtx-env-push,rtx-temp-lookup,-rtx-closure-make): New procs. + (rtx-make,rtx-kind?,rtx-const?,rtx-const-value,rtx-symbol-name, + rtx-operand?,rtx-operand-obj,rtx-local?,rtx-local-obj, rtx-xop-obj, + rtx-index-of-value,rtx-if-mode,rtx-if-test,rtx-if-then,rtx-if-else, + rtx-eq-attr-owner,rtx-eq-attr-attr,rtx-eq-attr-value): New procs. + (rtx-pretty-name): New proc. + (-rtx-traverser-table,-rtx-make-traverse-table): New procs. + (rtx-traverse-*): Rewrite rtx traversing. + (rtx-eval-*): Rewrite rtx evaluation. + (rtx-compile): New proc. + (rtx-simplify): New proc. + (rtx-simply-eq-attr-mach,rtx-simplify-eq-attr-insn): New procs. + * rtx-funcs.scm: C generation moved to rtl-c.scm. + (ifield,index-of): Rewrite. + (name): Renamed from `operand:'. + (operand,xop,local): New rtx's. + (current-insn): Rewrite. + * Makefile.am (CGEN_HOB_INPUT_FILES): Add rtl-c.scm, semantics.scm. + (cgen-hob.h): Remove rule for. + (cgen-hob.o): Depend on cgen-hob.c only. + * Makefile.in: Rebuild. + + * utils-cgen.scm (vmake): New proc. + (): New class. + (context-make-prefix,context-error): New procs. + +Fri Apr 9 19:26:28 1999 Jim Wilson + + * i960.cpu: Add some ??? comments. + (xnor, ornot): New instructions. + (*): Delete obsolete COND-CTI and UNCOND-CTI attributes. + +1999-04-08 Doug Evans + + * cos.scm (-object-error): Print better error message. + + * pmacros.scm (-pmacro-env-make): Renamed from -env-make. + (-pmacro-env-ref): Renamed from -env-ref. + +1999-03-31 Doug Evans + + * hardware.scm (,parse!): Allow get/set specs. + (h-pc): Delete. + (hardware-builtin!): Delete h-pc builtin. + * arm.cpu (h-pc): Define. + (h-gr): Delete get,set specs. Make array of 16 regs again. + * arm7.cpu (set-logical-cc-maybe): Delete. + (set-zn-flags,set-add-flags,set-sub-flags): New macros. + (data processing insns): Rewrite. + * m32r.cpu (h-pc): Define. + * fr30.cpu (h-pc): Define. + * i960.cpu (h-pc): Define. + * sparc.cpu (h-pc): Define. + + * rtl.scm (-rtx-traverse-operands): Add some error checking to LOCALS. + (s-parallel): Replace do {...} while (0) with {...}. + (s-sequence): Ditto. + + * sid-cpu.scm (gen-parallel-exec-type): Make type of `written' + consistent. + (-gen-write-case,-gen-sem-case): Ditto. + (-gen-sem-case): Only specify `written' if profiling or + parallel-write-back. + (-gen-scache-semantic-fn,-gen-all-semantic-fns): Put procs back in. + (-gen-sem-switch-fn): New proc. + (cgen-semantics.cxx): Emit either semantic fns or semantic switch + based on with-sem-switch option. + * sid-decode.scm (-gen-decode-insn-globals): Only define + idesc_table_initialized_p if with-sem-switch. Record semantic fn + addresses in idesc_table if !with-sem-switch. + (-gen-sem-fn-decls): Rewrite. + (-gen-idesc-decls): Define @cpu@_sem_fn type. Define `execute' + member based on with-sem-switch. Only define + `idesc_table_initialized_p' member if with-sem-switch. + (cgen-decode.h): If !with-sem-switch, declare semantic fns. + * sid.scm (-with-sem-switch?): New variable. + (option-init!): Initialize it. + (option-set!): Set it. + (with-sem-switch?): New proc. + (-op-gen-set-trace): Only emit `written' reference if profiling. + (sim-finish!): Use h_pc_set to set pc. + +1999-03-30 Doug Evans + + * sparccom.cpu (arith-cc-binop): New args s32-set-flags,s64-set-flags. + All callers updated. + (arith-carry-cc-binop): New arg set-flags. All callers updated. + + * sid.scm (gen-argbuf-type): Delete. + (-gen-argbuf-fields-union): Move to ... + * sid-decode.scm: ... here. + + * read.scm (-reader-process-expanded-1): New proc. + (-reader-process-expanded): Call it to catch nested begin's. + (reader-process): Move `begin' handling to -reader-process-expanded. + + * insn.scm (-insn-read): Fix name of `format' spec. + + * pmacros.scm (.pmacro): New builtin. + (scan-symbol): If procedure macro, return macro rather than its symbol. + (check-macro): Don't do lookup, instead check if (car expr) is + macro object. + (scan-list): Handle .pmacro. + (scan): No longer re-examine text for another macro invocation. + (-pmacro-build-lambda): New proc. + (define-pmacro): Rewrite. If defining one pmacro to be an alias of + another, fetch the other's value (rather than doing it during + expansion). + +1999-03-27 Doug Evans + + * Makefile.am (CGEN_HOB_INPUT_FILES): Add decode.scm. + * Makefile.in: Rebuild. + + * decode.scm (decode-get-best-bits): Use memq instead of element?. + (-fill-slot!): Simplify. + (-build-slots): Simplify. + + * dev.scm (load-sid): Don't load sid-arch.scm. + + * sid-decode.scm: Replace computed goto decoder/extractor with plain + switch's. + * sim-decode.scm: Replace computed goto decoder/extractor with plain + switch's. + +1999-03-26 Doug Evans + + * sim-decode.scm: Clean up pass. Move decoder computation into ... + * decode.scm: ... here. New file. + * sid-decode.scm: Use decoder computation code in decode.scm. + * read.scm: Load decode.scm. + + * arm.cpu (arm710 model): Add u-exec function unit. + (h-gr): Delete CACHE-ADDR for now. Make array of 15, not 16 regs. + Add get/set specs to redirect reg 15 to h-pc. + (h-*): Indicate for both ARM and THUMB isas. + (cbit,nbit,vbit,zbit): Ditto. + (h-ibit,h-fbit,h-tbit,h-mbits): New hardware elements. + (h-cpsr): Make virtual. Add get/set specs. + (h-spsr-fiq,h-spsr-svc,h-spsr-abt,h-spsr-irq,h-spsr-und): New hw. + (h-spsr): New virtual reg. + * arm7.cpu (shift-type): New explicitly defined keyword. + (h-operand2-shifttype): Use it. + (set-logical-cc-maybe): Delete carry-out arg. New args arg1,arg2. + All callers updated. Don't set cbit. + (logical-op): Add rm to ifield list. Change case to case:. Use + shift-type enum as case choices. Set cbit. + (and,orr,eor,add-imm): Uncomment out. + (undefined): Temporarily comment out. + * thumb.scm (mov,cmp,addi8,subi8,str-sprel,ldr-sprel): s/rd/bit10-rd/. + (lda-pc,lda-sp): Ditto. + (ldr-pc): Rename from ldr. + (cbranch): Mark insns as being thumb insns. + + * attr.scm (,parse-value): Recognize strings. + + * cgen-sid.scm: Don't load sid-arch.scm. + (sim-arguments): Delete unused entries. + * sid-arch.scm: Delete. + + * insn.scm (,iflds): Renamed from flds. All uses updated. + (,ifld-assertions): New member. + (,make!): New arg ifld-assertions, all callers updated. + ( accessors): Change insn:foo to insn-foo. All callers updated. + (insn:fields): Delete. + (-insn-parse): New arg ifld-assertions. All callers updated. + (-insn-read,define-insn): New procs. + (define-full-insn): New arg ifld-assertions. All callers updated. + (insn-init!): New comment define-insn. + + * model.scm (-model-parse): Ensure at least one unit specified. + + * rtl.scm (-rtx-traverse-operands): Recognize environments. + (,get-name): New method. + (-rtx-make-current-closure,s-closure): New proc. + (hw:): Wrap rtx indices in a closure. + (-gen-case-prefix): New proc. + (s-case): Simplify. + * rtx-funcs.scm (case:): Fix call to s-case. + (closure): New rtx func. + + * hardware.scm (): New member isas-cache. + (,get-isas): New method. + (hardware-builtin): Indicate for all isas. + * ifield.scm (-ifield-parse): Only keep if isa+mach are kept. + * mach.scm (current-arch-mach-name-list): Return list of names. + (current-isa-mach-name-list): Ditto. + (define-arch): Install builtin objects here. + * read.scm (keep-atlist?): Only keep if both mach and isa are + being kept. + (keep-mach-atlist?): New proc. + (keep-isa-multiple?,current-keep-isa-name-list): New proc. + (reader-install-builtin!): Renamed from -install-builtin!. + * sid-cpu.scm (-gen-reg-access-defns): Renamed from + -gen-cpu-reg-access-defns. Rewrite. + (gen-reg-access-defn): Delete. + (-gen-hardware-struct): New proc. + (-gen-hardware-types): Simplify. Add multiple-isa support. + (gen-semantic-fn,-gen-all-semantics): Delete. + (-gen-read-args,-gen-read-case,-gen-read-switch): Delete. + (cgen-cpu.c,cgen-read.c,cgen-sem-switch.c,cgen-mainloop.in): Delete. + (cgen-write.cxx,cgen-semantics.cxx,cgen-decode.cxx): Renamed from *.c. + Call sem-analyze-insns!. + (cgen-semantics.cxx): Add multiple-isa support. + * sid-decode.c (-gen-idesc-decls): Add multiple-isa support. + (-gen-scache-decls,-gen-decode-fn): Ditto. + (cgen-decode.h): Call sem-analyze-insns!. + * sid-model.scm (cgen-model.cxx): Renamed from cgen-model.c. + * sid.scm (-with-multiple-isa?): New variable. + (option-init!): Initialize it. + (option-set!): Set it. + (with-multiple-isa?): New proc. + (gen-cpu-ref): New arg isas. All callers updated. + (gen-cpu-class): New proc. + (*-get-macro,*-set-macro): Delete. + (gen-reg-get-fun-name,gen-reg-set-fun-name): New procs. + (-hw-gen-fun-get): Call gen-reg-get-fun-name. + (-hw-gen-fun-set): Call gen-reg-set-fun-name. + (-gen-hw-index): Call rtx-c instead of rtx-c-with-temps for rtxs. + (-sim-insns-analyzed): New global variable. + (sim-init!): Reset it. + (sim-analyze-insns!): New proc. + (sim-analyze!): Don't do instruction analysis here. + (sim-finish!): Specify isa of x-invalid insn. + * sim.scm (sim-finish!): Specify isa of added x-* virtual insns. + +1999-03-22 Doug Evans + + * thumb.cpu (cpu,mach,model): Delete. + (dntf): New pmacro. Use it for all field definitions. + (dntop): New pmacro. Use it for all operand definitions. + (asr): Correct field list. + (add,addi,sub,subi,add-sp,add-sp-neg): Ditto. + + * utils-cgen.scm (define-getters): New macro to simplify + writing class accessors. + (define-setters): Ditto. + (sanitize): Recognize isa elements. + + * sid-cpu.scm (*): Replace cpu:parallel-exec? call with + state-parallel-exec?. + * sid-model.scm (*): Ditto. + * sid-decode.scm (*): Ditto. Replace cpu:decode-assist with + state-decode-assist. + + * sid-decode.scm (decode-bits): Replace list-reverse! with reverse!. + (-gen-decode-switch): Rewrite to not generate deeply nested lists. + * sim-decode.scm (-gen-decode-switch): Ditto. + + * sim-arch.scm (-regs-for-access-fns): Delete. + (-biggest-reg-mode,-gen-arch-reg-access-decls): Delete. + (-gen-arch-reg-access-defns): Delete. + + * sim-cpu.scm (*): Replace cpu:liw-insns with state-liw-insns, + cpu:parallel-insns with state-parallel-insns, cpu:parallel-exec? + with state-parallel=exec?. + (cgen-*): Call sim-analyze-insns! here. + * sim-decode.scm (cgen-*): Ditto. + * sim-model.scm (cgen-*): Ditto. + * sim.scm (-sim-insns-analyzed): New global variable. + (sim-init!): Reset it. + (sim-analyze-insns!): Renamed from sim-analyze!. Keep track if we've + already done the analysis. + + * sim-model.scm (-gen-mach-defns): Add mach attribute number to + MACH struct. + + * arm.cpu: Only include arm7.cpu,thumb.cpu if necessary. + (arm arch): Update isa spec. + (arm,thumb isas): Define. + (arm7 cpu): default-insn-bitsize,base-insn-bitsize moved to isas. + (arm7tdmi mach): Add isa spec. + * arm7.cpu (*): Replace subreg: with subword:. Remove unnecessary + `const' on word number. + * fr30.cpu (fr30 arch): Update isa spec. + (fr30 isa): Define. + (fr30bf cpu): default-insn-bitsize,base-insn-bitsize,decode-assist, + moved to isa spec. + * i960.cpu (i960 arch): Update isa spec. + (i960 isa): Define. + (i960base cpu): default-insn-bitsize,base-insn-bitsize,decode-assist, + liw-insns,parallel-insns moved to isas spec. + * m32r.cpu (m32r arch): Update isas spec. + (m32r isa): Define. + (m32rbf cpu): default-insn-bitsize,base-insn-bitsize,decode-assist, + liw-insns,parallel-insns moved to isa spec. + * sparc.cpu (sparc arch): Update isas spec. + (sparc isa): Define. + * sparc32.cpu (sparc32 cpu): default-insn-bitsize,base-insn-bitsize, + decode-assist moved to isa spec. + * sparc64.cpu (sparc64 cpu): Ditto. + * sparccom.cpu (trap insns): Correct mode of result of c-call:. + * desc-cpu.scm (-gen-isa-table-defns): New proc. + (-gen-mach-table-defns): Output mach table. + (-gen-hash-defines): Delete insn size macros, except for + CGEN_MAX_INSN_SIZE. + (-cgen-cpu-open): Rewrite cpu_open handling. Take stdarg list of args. + (cgen-desc.h): Define MAX_ISAS. + (cgen-desc.c): Include stdarg.h. Call -gen-isa-table-defns. + * mach.scm (): Rename arch-data to data. New member isa-list. + (arch-* accessors): Renamed from arch:*. All callers updated. + (current-arch-isa-name-list): New proc. + (-arch-parse-isas): Renamed from -arch-parse-isa. + (def-isa-attr!): Rewrite. + (